Skip to content

Commit

Permalink
Merge pull request #2133 from smeup/feat/kup-toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
lucafoscili authored Oct 24, 2024
2 parents 442d503 + a7b8cc9 commit 4edc294
Show file tree
Hide file tree
Showing 83 changed files with 1,820 additions and 106 deletions.
1 change: 1 addition & 0 deletions packages/ketchup-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export const KupTaskListHeader = /*@__PURE__*/createReactComponent<JSX.KupTaskLi
export const KupTaskListTable = /*@__PURE__*/createReactComponent<JSX.KupTaskListTable, HTMLKupTaskListTableElement>('kup-task-list-table');
export const KupTextField = /*@__PURE__*/createReactComponent<JSX.KupTextField, HTMLKupTextFieldElement>('kup-text-field');
export const KupTimePicker = /*@__PURE__*/createReactComponent<JSX.KupTimePicker, HTMLKupTimePickerElement>('kup-time-picker');
export const KupToolbar = /*@__PURE__*/createReactComponent<JSX.KupToolbar, HTMLKupToolbarElement>('kup-toolbar');
export const KupTooltip = /*@__PURE__*/createReactComponent<JSX.KupTooltip, HTMLKupTooltipElement>('kup-tooltip');
export const KupTree = /*@__PURE__*/createReactComponent<JSX.KupTree, HTMLKupTreeElement>('kup-tree');
export const KupTypography = /*@__PURE__*/createReactComponent<JSX.KupTypography, HTMLKupTypographyElement>('kup-typography');
Expand Down
10 changes: 10 additions & 0 deletions packages/ketchup-showcase/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,16 @@ export default {
value: 'Planner',
visible: true,
},
{
cells: {
ROUTE: {
value: 'toolbar',
},
},
icon: 'app',
value: 'Toolbar',
visible: true,
},
{
cells: {
ROUTE: {
Expand Down
5 changes: 5 additions & 0 deletions packages/ketchup-showcase/src/plugins/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ const advancedRoutes = [
component: () =>
import(`@/views/components/advanced/inputpanel/InputPanel.vue`),
},
{
path: `/toolbar`,
name: 'Toolbar',
component: () => import(`@/views/components/advanced/toolbar/Toolbar.vue`),
},
{
path: `/tree`,
name: 'tree',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<template>
<div>
<comp :giturl="giturl" :headtitle="headtitle" :titles="titles">
<template v-slot:0>
<toolbar-basic></toolbar-basic>
</template>
</comp>
</div>
</template>

<script>
import Comp from '@/views/templates/Comp';
import ToolbarBasic from './examples/ToolbarBasic';
export default {
components: {
ToolbarBasic,
Comp,
},
data() {
return {
giturl:
'https://github.com/smeup/ketchup/tree/develop/packages/ketchup/src/components/kup-toolbar',
headtitle: 'Toolbar',
titles: ['Playground'],
};
},
title: 'Ketchup | Toolbar',
};
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<template>
<div>
<div class="demo-wrapper">
<p>
The toolbar is a component that uses cell to generate a structured and
nested tree used for operative functionalities.</p
>
<div class="demo-container">
<div class="kup-container" style="display: block">
<kup-toolbar :data.prop="toolbarProps.data" />
</div>
</div>
<div class="demo-container">
<p class="centered">Sample markup</p>
<code class="flat">{{ markupBasic }}</code>
</div>
</div>
</div>
</template>

<script>
export default {
name: 'ToolbarBasic',
data() {
return {
markupBasic: '<kup-toolbar></kup-toolbar>',
toolbarProps: {
customStyle: '',
data: [
{
children: [],
disabled: false,
expandable: false,
id: '',
isExpanded: false,
value: 'Element 1 Parent',
visible: true,
},
{
children: [
{
children: [],
disabled: false,
id: '',
isEditable: true,
shape: 'Rad',
obj: {
t: '',
p: '',
k: '',
},
data: {
type: 'chevron',
},
options: [
{
id: 0,
label: 'One',
},
{
id: 1,
label: 'Two',
},
{
id: 2,
label: 'Three',
},
],
value: '0',
},
],
disabled: false,
expandable: false,
id: '',
isExpanded: false,
style: {},
value: 'element 2 parent',
visible: true,
},
{
children: [
{
children: [
{
children: [],
disabled: false,
expandable: false,
id: '',
isExpanded: false,
value: 'element 3 child 1 child 1',
},
{
children: [],
disabled: false,
expandable: false,
id: '',
isExpanded: false,
value: 'element 3 child 1 child 2',
},
],
disabled: false,
expandable: false,
id: '',
isExpanded: false,
value: 'element 3 child 1',
},
],
disabled: false,
expandable: false,
id: '',
isExpanded: false,
value: 'element 3',
visible: true,
},
],
listCellWidth: '300px',
maxWidth: '100%',
readOnly: false,
showSecondaryDates: false,
taskColumns: ['R§COMM', 'R£COMM'],
taskDates: ['DATINZ', 'DATPRE'],
taskIdCol: 'R§COMM',
taskNameCol: 'R£COMM',
taskPrevDates: ['INZORD', 'DATORD'],
titleMess: '',
},
};
},
};
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ export default {
value: 'kup-time-picker',
id: 'kup-time-picker',
},
{
value: 'kup-toolbar',
id: 'kup-toolbar',
},
{
value: 'kup-tree',
id: 'kup-tree',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1307,6 +1307,18 @@
></kup-text-field
></td>
</tr>
<tr>
<td class="prevent-cr">
<span class="code-word">KUP-TOOLBAR</span>
</td>
<td class="text-cell">
<kup-text-field
text-area
id="kup-time-picker"
@kup-textfield-input="updateCustomStyles"
></kup-text-field
></td>
</tr>
<tr>
<td class="prevent-cr">
<span class="code-word">KUP-TREE</span>
Expand Down
4 changes: 4 additions & 0 deletions packages/ketchup/src/assets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ components.data = [
value: 'Time picker',
id: 'time-picker.html',
},
{
value: 'Toolbar',
id: 'toolbar.html',
},
{
value: 'Typography',
id: 'typography.html',
Expand Down
90 changes: 90 additions & 0 deletions packages/ketchup/src/assets/toolbar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
const toolbarData = [
{
children: [],
disabled: false,
expandable: false,
id: '',
isExpanded: false,
value: 'Element 1 Parent',
visible: true,
},
{
children: [
{
children: [],
disabled: false,
id: '',
isEditable: true,
shape: 'Rad',
obj: {
t: '',
p: '',
k: '',
},
data: {
type: 'chevron',
},
options: [
{
id: 0,
label: 'One',
},
{
id: 1,
label: 'Two',
},
{
id: 2,
label: 'Three',
},
],
value: '0',
},
],
disabled: false,
expandable: false,
id: '',
isExpanded: false,
style: {},
value: 'element 2 parent',
visible: true,
},
{
children: [
{
children: [
{
children: [],
disabled: false,
expandable: false,
id: '',
isExpanded: false,
value: 'element 3 child 1 child 1',
},
{
children: [],
disabled: false,
expandable: false,
id: '',
isExpanded: false,
value: 'element 3 child 1 child 2',
},
],
disabled: false,
expandable: false,
id: '',
isExpanded: false,
value: 'element 3 child 1',
},
],
disabled: false,
expandable: false,
id: '',
isExpanded: false,
value: 'element 3',
visible: true,
},
];

const esempio = document.getElementById('esempio');
esempio.data = toolbarData;
Loading

0 comments on commit 4edc294

Please sign in to comment.