-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1821 from apuliasoft/inputpanel
feature: added input panel in showcase
- Loading branch information
Showing
23 changed files
with
376 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
packages/ketchup-showcase/src/views/components/advanced/inputpanel/InputPanel.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
20 changes: 20 additions & 0 deletions
20
...es/ketchup-showcase/src/views/components/advanced/inputpanel/examples/InputPanelBasic.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
200 changes: 200 additions & 0 deletions
200
...ges/ketchup-showcase/src/views/components/advanced/inputpanel/examples/InputPanelDemo.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.