Skip to content

Commit

Permalink
Merge pull request #1821 from apuliasoft/inputpanel
Browse files Browse the repository at this point in the history
feature: added input panel in showcase
  • Loading branch information
lucafoscili authored Mar 22, 2024
2 parents dd1590a + d549b70 commit 5e7d9b7
Show file tree
Hide file tree
Showing 23 changed files with 376 additions and 17 deletions.
10 changes: 10 additions & 0 deletions packages/ketchup-showcase/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,16 @@ export default {
value: 'Image list',
visible: true,
},
{
cells: {
ROUTE: {
value: 'inputpanel',
},
},
icon: 'mode_edit',
value: 'Input Panel',
visible: true,
},
{
cells: {
ROUTE: {
Expand Down
6 changes: 6 additions & 0 deletions packages/ketchup-showcase/src/plugins/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,12 @@ const advancedRoutes = [
component: () =>
import(`@/views/components/advanced/imagelist/ImageList.vue`),
},
{
path: `/inputpanel`,
name: 'inputpanel',
component: () =>
import(`@/views/components/advanced/inputpanel/InputPanel.vue`),
},
{
path: `/tree`,
name: 'tree',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<template>
<div>
<comp :giturl="giturl" :headtitle="headtitle" :titles="titles">
<template v-slot:0>
<input-panel-demo></input-panel-demo>
</template>
<template v-slot:1>
<input-panel-basic></input-panel-basic>
</template>
</comp>
</div>
</template>

<script>
import InputPanelDemo from '@/views/components/advanced/inputpanel/examples/InputPanelDemo';
import InputPanelBasic from '@/views/components/advanced/inputpanel/examples/InputPanelBasic';
import Comp from '@/views/templates/Comp';
export default {
components: {
InputPanelDemo,
InputPanelBasic,
Comp,
},
data() {
return {
giturl:
'https://github.com/smeup/ketchup/tree/develop/packages/ketchup/src/components/kup-input-panel',
headtitle: 'Input Panel',
titles: ['Playground', 'Basic usage'],
};
},
title: 'Ketchup | Input Panel',
};
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<template>
<div>
<div class="demo-wrapper">
<p>The Input Panel component arranges different input fields.</p>
<p class="centered">Sample markup</p>
<code class="flat">{{ markupBasic }}</code>
</div>
</div>
</template>

<script>
export default {
name: 'InputPanelBasic',
data() {
return {
markupBasic: '<kup-input-panel></kup-input-panel>',
};
},
};
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
<template>
<div>
<demo
:demoComp="demoComp"
:demoEvents="demoEvents"
:demoMethods="demoMethods"
:demoProps="demoProps"
></demo>
</div>
</template>

<script>
import Demo from '@/views/templates/Demo';
import { baseData } from '@/mock/chart';
export default {
components: {
Demo,
},
name: 'InputPanelDemo',
data() {
return {
demoComp: createComp(),
demoEvents: [
{
name: 'kup-form-ready',
type: 'CustomEvent',
},
],
demoMethods: [],
demoProps: [
{
prop: 'customStyle',
description:
'Custom style of the component. For more information: https://ketchup.smeup.com/ketchup-showcase/#/customization',
type: 'string',
default: '""',
try: 'css',
},
{
prop: 'data',
description: 'Actual data of the form.',
type: 'KupInputPanelData',
default: 'null',
try: 'json',
},
{
prop: 'hiddenSubmitButton',
description:
'Creates a hidden submit button in order to submit the form with enter.',
type: 'boolean',
default: 'false',
try: 'switch',
},
{
prop: 'submitCb',
description: 'Sets the callback function on submit form.',
type: 'string',
default: 'null',
try: 'field',
},
],
};
},
};
function createComp() {
const comp = document.createElement('kup-input-panel');
comp.data = {
columns: [
{
name: 'NAM',
title: 'Name',
visible: true,
},
{
name: 'SUR',
title: 'Surname',
visible: true,
},
{
name: 'COL',
title: 'Color Shirt',
visible: true,
},
{
name: 'NAT',
title: 'Nation',
visible: true,
},
{
name: 'CIT',
title: 'City',
visible: true,
},
{
name: 'CAM',
title: 'Campionato vinto',
visible: true,
},
{
name: 'CHI',
title: 'Chip',
visible: true,
},
],
rows: [
{
cells: {
NAM: {
value: 'Francesco',
obj: {
t: '',
p: '',
k: '',
},
editable: true,
mandatory: true,
shape: 'ITX',
},
SUR: {
value: 'Totti',
obj: {
t: '',
p: '',
k: '',
},
editable: true,
mandatory: true,
shape: 'INF',
},
COL: {
value: '#8E1F2F',
obj: {
t: 'J1',
p: 'COL',
k: '',
},
editable: true,
mandatory: true,
// shape: 'CLP',
},
NAT: {
value: 'It',
options: [
{ id: 'It', label: 'Italy' },
{ id: 'Sp', label: 'Spain' },
],
obj: {
t: '',
p: '',
k: '',
},
editable: true,
mandatory: true,
shape: 'CMB',
},
CIT: {
value: 'Rom',
obj: {
t: '',
p: '',
k: '',
},
editable: true,
mandatory: true,
options: [
{ id: 'Rom', label: 'Roma' },
{ id: 'Flam', label: 'Flaminio' },
{ id: 'PorMet', label: 'Porta Metronia' },
{ id: 'Garbat', label: 'Garbatella' },
],
shape: 'ACP',
},
CAM: {
value: 'on',
obj: {
t: 'V2',
p: 'SI/NO',
k: '',
},
editable: true,
mandatory: true,
// shape: 'CHK',
},
CHI: {
shape: 'CHI',
value: 'Chi',
editable: true,
options: [{ id: 'Chi', label: 'Chip' }],
},
},
},
],
};
comp.id = 'demo-component';
return comp;
}
</script>
7 changes: 4 additions & 3 deletions packages/ketchup/src/assets/input-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const data = {
{
name: 'BUT',
title: 'Buttons list',
visible: false,
visible: true,
},
],
rows: [
Expand Down Expand Up @@ -144,9 +144,10 @@ const data = {
value: '8;4;5',
},
CHI: {
// data: {},
shape: 'CHI',
value: 'Chipp',
value: 'Chi',
editable: true,
options: [{ id: 'Chi', label: 'Chip' }],
},
BUT: {
cssClass: 'strong-text',
Expand Down
2 changes: 2 additions & 0 deletions packages/ketchup/src/components/kup-autocomplete/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ Type: `Promise<void>`
- [kup-data-table](../kup-data-table)
- [kup-form](../kup-form)
- [kup-image-list](../kup-image-list)
- [kup-input-panel](../kup-input-panel)
- [kup-tree](../kup-tree)

### Depends on
Expand Down Expand Up @@ -222,6 +223,7 @@ graph TD;
kup-box --> kup-autocomplete
kup-cell --> kup-autocomplete
kup-image-list --> kup-autocomplete
kup-input-panel --> kup-autocomplete
style kup-autocomplete fill:#f9f,stroke:#333,stroke-width:4px
```

Expand Down
2 changes: 2 additions & 0 deletions packages/ketchup/src/components/kup-badge/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ Type: `Promise<void>`
- [kup-form](../kup-form)
- [kup-image](../kup-image)
- [kup-image-list](../kup-image-list)
- [kup-input-panel](../kup-input-panel)
- [kup-list](../kup-list)
- [kup-magic-box](../kup-magic-box)
- [kup-numeric-picker](../kup-numeric-picker)
Expand Down Expand Up @@ -167,6 +168,7 @@ graph TD;
kup-dashboard --> kup-badge
kup-family-tree --> kup-badge
kup-image-list --> kup-badge
kup-input-panel --> kup-badge
kup-magic-box --> kup-badge
kup-numeric-picker --> kup-badge
kup-planner --> kup-badge
Expand Down
2 changes: 2 additions & 0 deletions packages/ketchup/src/components/kup-button-list/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ Type: `Promise<void>`
- [kup-data-table](../kup-data-table)
- [kup-form](../kup-form)
- [kup-image-list](../kup-image-list)
- [kup-input-panel](../kup-input-panel)
- [kup-magic-box](../kup-magic-box)
- [kup-tree](../kup-tree)

Expand Down Expand Up @@ -180,6 +181,7 @@ graph TD;
kup-box --> kup-button-list
kup-cell --> kup-button-list
kup-image-list --> kup-button-list
kup-input-panel --> kup-button-list
kup-magic-box --> kup-button-list
style kup-button-list fill:#f9f,stroke:#333,stroke-width:4px
```
Expand Down
2 changes: 2 additions & 0 deletions packages/ketchup/src/components/kup-chart/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ Type: `Promise<void>`
- [kup-data-table](../kup-data-table)
- [kup-form](../kup-form)
- [kup-image-list](../kup-image-list)
- [kup-input-panel](../kup-input-panel)
- [kup-magic-box](../kup-magic-box)
- [kup-tree](../kup-tree)

Expand Down Expand Up @@ -190,6 +191,7 @@ graph TD;
kup-box --> kup-chart
kup-cell --> kup-chart
kup-image-list --> kup-chart
kup-input-panel --> kup-chart
kup-magic-box --> kup-chart
style kup-chart fill:#f9f,stroke:#333,stroke-width:4px
```
Expand Down
2 changes: 2 additions & 0 deletions packages/ketchup/src/components/kup-chip/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ Type: `Promise<void>`
- [kup-data-table](../kup-data-table)
- [kup-form](../kup-form)
- [kup-image-list](../kup-image-list)
- [kup-input-panel](../kup-input-panel)
- [kup-magic-box](../kup-magic-box)
- [kup-tree](../kup-tree)

Expand Down Expand Up @@ -190,6 +191,7 @@ graph TD;
kup-box --> kup-chip
kup-cell --> kup-chip
kup-image-list --> kup-chip
kup-input-panel --> kup-chip
kup-magic-box --> kup-chip
style kup-chip fill:#f9f,stroke:#333,stroke-width:4px
```
Expand Down
Loading

0 comments on commit 5e7d9b7

Please sign in to comment.