@sme.up/ketchup 5.2.0-SNAPSHOT → 6.1.0-SNAPSHOT
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{cell-utils-5b16c180.js → cell-utils-a78d6fac.js} +2 -2
- package/dist/cjs/{component-d1496215.js → component-72a5b626.js} +30 -0
- package/dist/cjs/{f-button-3b9f32af.js → f-button-ac179257.js} +2 -2
- package/dist/cjs/{f-cell-c6ad973a.js → f-cell-69294bca.js} +33 -121
- package/dist/cjs/{f-chip-bed86c4a.js → f-chip-b00897d7.js} +5 -4
- package/dist/cjs/{f-image-08a3d340.js → f-image-89f25556.js} +2 -2
- package/dist/cjs/f-paginator-utils-8fa501b3.js +1898 -0
- package/dist/cjs/f-text-field-e1e45ade.js +94 -0
- package/dist/cjs/f-text-field-mdc-85997738.js +2570 -0
- package/dist/cjs/{index-8d7bb3be.js → index-eb556444.js} +2 -0
- package/dist/cjs/ketchup.cjs.js +3 -3
- package/dist/cjs/kup-accordion.cjs.entry.js +5 -5
- package/dist/cjs/{kup-autocomplete_27.cjs.entry.js → kup-autocomplete_25.cjs.entry.js} +1766 -8367
- package/dist/cjs/{kup-echart.cjs.entry.js → kup-box_2.cjs.entry.js} +17102 -14788
- package/dist/cjs/kup-calendar.cjs.entry.js +42 -34
- package/dist/cjs/kup-cell.cjs.entry.js +8 -7
- package/dist/cjs/kup-dash-list.cjs.entry.js +4 -4
- package/dist/cjs/kup-dash_2.cjs.entry.js +3 -3
- package/dist/cjs/kup-drawer.cjs.entry.js +12 -5
- package/dist/cjs/kup-field.cjs.entry.js +2 -2
- package/dist/cjs/kup-form-editor.cjs.entry.js +404 -0
- package/dist/cjs/kup-iframe.cjs.entry.js +3 -3
- package/dist/cjs/kup-image-list.cjs.entry.js +228 -0
- package/dist/cjs/kup-lazy.cjs.entry.js +3 -3
- package/dist/cjs/kup-magic-box.cjs.entry.js +4 -4
- package/dist/cjs/kup-manager-7a941909.js +16703 -0
- package/dist/cjs/kup-nav-bar.cjs.entry.js +3 -3
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +423 -0
- package/dist/cjs/kup-photo-frame.cjs.entry.js +5 -5
- package/dist/cjs/kup-probe.cjs.entry.js +2 -2
- package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
- package/dist/cjs/kup-snackbar.cjs.entry.js +6 -6
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{utils-b9df398c.js → utils-6287d878.js} +1 -1
- package/dist/collection/assets/card.js +4 -5
- package/dist/collection/assets/data-table.js +0 -79
- package/dist/collection/assets/form-editor.js +338 -0
- package/dist/collection/assets/image-list.js +624 -0
- package/dist/collection/assets/index.js +16 -0
- package/dist/collection/assets/kupdata.js +0 -3
- package/dist/collection/assets/kuptooltip.js +654 -0
- package/dist/collection/assets/tree.js +0 -128
- package/dist/collection/collection-manifest.json +8 -6
- package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +1 -1
- package/dist/collection/components/kup-box/kup-box-declarations.js +0 -4
- package/dist/collection/components/kup-box/kup-box.js +7 -135
- package/dist/collection/components/kup-card/built-in/kup-card-built-in.js +10 -0
- package/dist/collection/components/kup-card/built-in/kup-card-clock.js +1 -1
- package/dist/collection/components/kup-card/built-in/kup-card-column-drop-menu.js +1 -2
- package/dist/collection/components/kup-card/built-in/kup-card-numeric.js +153 -0
- package/dist/collection/components/kup-card/kup-card.css +61 -8
- package/dist/collection/components/kup-card/kup-card.js +2 -2
- package/dist/collection/components/kup-card/standard/kup-card-standard.js +14 -6
- package/dist/collection/components/kup-combobox/kup-combobox.js +1 -1
- package/dist/collection/components/kup-data-table/kup-data-table-declarations.js +1 -3
- package/dist/collection/components/kup-data-table/kup-data-table.js +50 -138
- package/dist/collection/components/kup-date-picker/kup-date-picker.js +1 -1
- package/dist/collection/components/kup-drawer/kup-drawer.css +1 -0
- package/dist/collection/components/kup-drawer/kup-drawer.js +8 -1
- package/dist/collection/components/kup-form-editor/kup-form-editor-declarations.js +23 -0
- package/dist/collection/components/kup-form-editor/kup-form-editor.css +80 -0
- package/dist/collection/components/kup-form-editor/kup-form-editor.js +561 -0
- package/dist/collection/components/kup-image-list/kup-image-list-declarations.js +10 -0
- package/dist/collection/components/kup-image-list/kup-image-list.css +166 -0
- package/dist/collection/components/kup-image-list/kup-image-list.js +432 -0
- package/dist/collection/components/kup-numeric-picker/kup-numeric-picker-declarations.js +16 -0
- package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.css +50 -0
- package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.js +895 -0
- package/dist/collection/components/kup-photo-frame/kup-photo-frame.css +3 -13
- package/dist/collection/components/kup-photo-frame/kup-photo-frame.js +1 -1
- package/dist/collection/components/kup-snackbar/kup-snackbar.css +4 -0
- package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +18 -19
- package/dist/collection/components/kup-time-picker/kup-time-picker.js +2 -2
- package/dist/collection/components/kup-tree/kup-tree-declarations.js +0 -4
- package/dist/collection/components/kup-tree/kup-tree.css +10 -3
- package/dist/collection/components/kup-tree/kup-tree.js +65 -140
- package/dist/collection/f-components/f-cell/f-cell.js +7 -7
- package/dist/collection/f-components/f-chip/f-chip.js +2 -1
- package/dist/collection/managers/kup-data/kup-data-node-helper.js +24 -0
- package/dist/collection/managers/kup-data/kup-data.js +4 -1
- package/dist/collection/managers/kup-debug/kup-debug.js +1 -0
- package/dist/collection/managers/kup-dynamic-position/kup-dynamic-position.js +4 -2
- package/dist/collection/managers/kup-interact/kup-interact.js +1 -22
- package/dist/collection/managers/kup-language/kup-language-declarations.js +2 -0
- package/dist/collection/managers/kup-manager/kup-manager.js +31 -1
- package/dist/collection/managers/kup-math/kup-math.js +11 -1
- package/dist/collection/managers/kup-theme/kup-theme-declarations.js +6 -0
- package/dist/collection/managers/kup-tooltip/kup-tooltip-declarations.js +1 -0
- package/dist/collection/managers/kup-tooltip/kup-tooltip.js +224 -0
- package/dist/collection/types/GenericTypes.js +3 -0
- package/dist/collection/utils/kup-column-menu/kup-column-menu.js +8 -12
- package/dist/esm/{cell-utils-69f75e2e.js → cell-utils-964da6b5.js} +3 -3
- package/dist/esm/{component-c4eb6153.js → component-b1bedf1d.js} +27 -2
- package/dist/esm/{f-button-7e7607d8.js → f-button-871a544b.js} +2 -2
- package/dist/esm/{f-cell-e4d83c27.js → f-cell-521ef17a.js} +33 -120
- package/dist/esm/{f-chip-51dfefaf.js → f-chip-1dda722f.js} +6 -5
- package/dist/esm/{f-image-de331954.js → f-image-c468d8ae.js} +2 -2
- package/dist/esm/f-paginator-utils-7dff8ff0.js +1884 -0
- package/dist/esm/f-text-field-d6c61c73.js +92 -0
- package/dist/esm/f-text-field-mdc-d42d3f9e.js +2568 -0
- package/dist/esm/{index-aeec9835.js → index-baeab1ac.js} +2 -1
- package/dist/esm/ketchup.js +3 -3
- package/dist/esm/kup-accordion.entry.js +6 -6
- package/dist/esm/{kup-autocomplete_27.entry.js → kup-autocomplete_25.entry.js} +1711 -8310
- package/dist/esm/{kup-echart.entry.js → kup-box_2.entry.js} +17102 -14789
- package/dist/esm/kup-calendar.entry.js +43 -35
- package/dist/esm/kup-cell.entry.js +8 -7
- package/dist/esm/kup-dash-list.entry.js +4 -4
- package/dist/esm/kup-dash_2.entry.js +3 -3
- package/dist/esm/kup-drawer.entry.js +12 -5
- package/dist/esm/kup-field.entry.js +2 -2
- package/dist/esm/kup-form-editor.entry.js +400 -0
- package/dist/esm/kup-iframe.entry.js +3 -3
- package/dist/esm/kup-image-list.entry.js +224 -0
- package/dist/esm/kup-lazy.entry.js +3 -3
- package/dist/esm/kup-magic-box.entry.js +4 -4
- package/dist/esm/kup-manager-58b075b4.js +16686 -0
- package/dist/esm/kup-nav-bar.entry.js +3 -3
- package/dist/esm/kup-numeric-picker.entry.js +419 -0
- package/dist/esm/kup-photo-frame.entry.js +5 -5
- package/dist/esm/kup-probe.entry.js +2 -2
- package/dist/esm/kup-qlik.entry.js +2 -2
- package/dist/esm/kup-snackbar.entry.js +6 -6
- package/dist/esm/loader.js +3 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/{tslib.es6-8f2d44b6.js → tslib.es6-3eea2234.js} +1 -1
- package/dist/esm/{utils-35c7a90d.js → utils-d7e4b3c2.js} +2 -2
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-5d190cf5.js → p-1ae66cc5.js} +1 -1
- package/dist/ketchup/{p-8be1337b.js → p-34b74425.js} +1 -1
- package/dist/ketchup/{p-fea316ab.entry.js → p-3c11e615.entry.js} +1 -1
- package/dist/ketchup/p-44ec4f03.js +1 -0
- package/dist/ketchup/p-4ffbc3ff.js +1 -0
- package/dist/ketchup/p-5264a3e6.entry.js +1 -0
- package/dist/ketchup/{p-d7af8156.entry.js → p-65974e48.entry.js} +1 -1
- package/dist/ketchup/p-65b46587.entry.js +40 -0
- package/dist/ketchup/{p-3813281b.entry.js → p-6dff70f8.entry.js} +1 -1
- package/dist/ketchup/{p-33073f4a.js → p-7454cb92.js} +1 -1
- package/dist/ketchup/{p-a0b1d769.js → p-79b0730b.js} +1 -1
- package/dist/ketchup/p-7eff4eee.js +1 -0
- package/dist/ketchup/p-80968627.entry.js +1 -0
- package/dist/ketchup/{p-8c44c3b9.js → p-81605f08.js} +4 -5
- package/dist/ketchup/p-8cdf61a4.js +1 -0
- package/dist/ketchup/{p-f9c41e20.entry.js → p-954cc340.entry.js} +1 -1
- package/dist/ketchup/p-976244f9.entry.js +9 -0
- package/dist/ketchup/p-99e0d768.entry.js +1 -0
- package/dist/ketchup/{p-8f735633.entry.js → p-a0f6e25c.entry.js} +1 -1
- package/dist/ketchup/p-a203f78b.js +45 -0
- package/dist/ketchup/{p-9bcda66f.entry.js → p-a615a92b.entry.js} +1 -1
- package/dist/ketchup/p-aca0e54b.js +30 -0
- package/dist/ketchup/p-b8939a8b.entry.js +1 -0
- package/dist/ketchup/p-bfc3bac7.js +1 -0
- package/dist/ketchup/{p-67c64257.entry.js → p-c5ce8951.entry.js} +1 -1
- package/dist/ketchup/{p-68fc1428.entry.js → p-d2ee56dd.entry.js} +1 -1
- package/dist/ketchup/p-db71436b.entry.js +27 -0
- package/dist/ketchup/{p-10c8d755.js → p-e0035c58.js} +1 -1
- package/dist/ketchup/p-e1039cf2.entry.js +1 -0
- package/dist/ketchup/{p-b5e1dbfa.entry.js → p-ea10176c.entry.js} +1 -1
- package/dist/ketchup/p-f09f2f98.entry.js +1 -0
- package/dist/ketchup/{p-0751aaf6.entry.js → p-f71a1675.entry.js} +1 -1
- package/dist/ketchup/{p-4081f5f7.entry.js → p-fac1a08b.entry.js} +1 -1
- package/dist/types/components/kup-box/kup-box-declarations.d.ts +3 -5
- package/dist/types/components/kup-box/kup-box.d.ts +0 -22
- package/dist/types/components/kup-card/built-in/kup-card-built-in.d.ts +7 -0
- package/dist/types/components/kup-card/built-in/kup-card-numeric.d.ts +2 -0
- package/dist/types/components/kup-card/kup-card-declarations.d.ts +26 -1
- package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +4 -4
- package/dist/types/components/kup-data-table/kup-data-table.d.ts +5 -19
- package/dist/types/components/kup-form-editor/kup-form-editor-declarations.d.ts +79 -0
- package/dist/types/components/kup-form-editor/kup-form-editor.d.ts +72 -0
- package/dist/types/components/kup-image-list/kup-image-list-declarations.d.ts +14 -0
- package/dist/types/components/kup-image-list/kup-image-list.d.ts +56 -0
- package/dist/types/components/kup-numeric-picker/kup-numeric-picker-declarations.d.ts +19 -0
- package/dist/types/components/kup-numeric-picker/kup-numeric-picker.d.ts +121 -0
- package/dist/types/components/kup-tab-bar/kup-tab-bar-declarations.d.ts +3 -9
- package/dist/types/components/kup-tab-bar/kup-tab-bar.d.ts +6 -6
- package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +1 -5
- package/dist/types/components/kup-tree/kup-tree.d.ts +1 -24
- package/dist/types/components.d.ts +265 -232
- package/dist/types/managers/kup-data/kup-data-declarations.d.ts +1 -0
- package/dist/types/managers/kup-data/kup-data-node-helper.d.ts +7 -0
- package/dist/types/managers/kup-data/kup-data.d.ts +1 -0
- package/dist/types/managers/kup-language/kup-language-declarations.d.ts +2 -0
- package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +14 -0
- package/dist/types/managers/kup-manager/kup-manager.d.ts +14 -0
- package/dist/types/managers/kup-math/kup-math-declarations.d.ts +6 -0
- package/dist/types/managers/kup-math/kup-math.d.ts +2 -1
- package/dist/types/managers/kup-tooltip/kup-tooltip-declarations.d.ts +8 -0
- package/dist/types/managers/kup-tooltip/kup-tooltip.d.ts +51 -0
- package/dist/types/types/GenericTypes.d.ts +3 -0
- package/dist/types/utils/kup-column-menu/kup-column-menu.d.ts +1 -3
- package/package.json +16 -15
- package/dist/cjs/kup-manager-4227f0a2.js +0 -8582
- package/dist/collection/assets/tooltip.js +0 -73
- package/dist/collection/components/kup-tooltip/kup-tooltip-declarations.js +0 -20
- package/dist/collection/components/kup-tooltip/kup-tooltip.css +0 -149
- package/dist/collection/components/kup-tooltip/kup-tooltip.js +0 -1205
- package/dist/collection/utils/helpers.js +0 -38
- package/dist/esm/kup-manager-0ab94726.js +0 -8565
- package/dist/ketchup/p-24df4f29.entry.js +0 -27
- package/dist/ketchup/p-2d4f19f4.js +0 -1
- package/dist/ketchup/p-3445be1e.entry.js +0 -1
- package/dist/ketchup/p-3aab1f0d.entry.js +0 -1
- package/dist/ketchup/p-47b57d97.js +0 -1
- package/dist/ketchup/p-5186885c.entry.js +0 -1
- package/dist/ketchup/p-78223dc0.entry.js +0 -143
- package/dist/ketchup/p-96101f09.entry.js +0 -39
- package/dist/ketchup/p-c314b1e6.js +0 -1
- package/dist/ketchup/p-ee33cbe9.js +0 -9
- package/dist/types/components/kup-tooltip/kup-tooltip-declarations.d.ts +0 -93
- package/dist/types/components/kup-tooltip/kup-tooltip.d.ts +0 -142
- package/dist/types/utils/helpers.d.ts +0 -4
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-baeab1ac.js';
|
|
2
|
+
import { F as FButton } from './f-button-871a544b.js';
|
|
3
|
+
import { k as kupManagerInstance, h as KupLanguageGeneric, B as KupDragEffect, c as KupDebugCategory } from './kup-manager-58b075b4.js';
|
|
4
|
+
import { g as getProps, s as setProps } from './utils-d7e4b3c2.js';
|
|
5
|
+
import { c as componentWrapperId } from './GenericVariables-665de00a.js';
|
|
6
|
+
import './f-button-declarations-b1b4cac4.js';
|
|
7
|
+
import './f-image-c468d8ae.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Props of the kup-form-editor component.
|
|
11
|
+
* Used to export every prop in an object.
|
|
12
|
+
*/
|
|
13
|
+
var KupFormEditorProps;
|
|
14
|
+
(function (KupFormEditorProps) {
|
|
15
|
+
KupFormEditorProps["customStyle"] = "Custom style of the component.";
|
|
16
|
+
KupFormEditorProps["data"] = "The data of the component.";
|
|
17
|
+
})(KupFormEditorProps || (KupFormEditorProps = {}));
|
|
18
|
+
var KupFormEditorDragTypes;
|
|
19
|
+
(function (KupFormEditorDragTypes) {
|
|
20
|
+
KupFormEditorDragTypes["Components"] = "1";
|
|
21
|
+
KupFormEditorDragTypes["Sections"] = "2";
|
|
22
|
+
})(KupFormEditorDragTypes || (KupFormEditorDragTypes = {}));
|
|
23
|
+
var KupFormEditorLabels;
|
|
24
|
+
(function (KupFormEditorLabels) {
|
|
25
|
+
KupFormEditorLabels["Loaded"] = "Loaded";
|
|
26
|
+
KupFormEditorLabels["Reset"] = "Reset";
|
|
27
|
+
KupFormEditorLabels["Save"] = "Save";
|
|
28
|
+
KupFormEditorLabels["Components"] = "Components";
|
|
29
|
+
KupFormEditorLabels["Sections"] = "Sections";
|
|
30
|
+
KupFormEditorLabels["Column"] = "Column";
|
|
31
|
+
})(KupFormEditorLabels || (KupFormEditorLabels = {}));
|
|
32
|
+
|
|
33
|
+
const kupFormEditorCss = ":host{width:100%;height:100%}.header{display:flex;flex-direction:row;justify-content:center}.header>*{margin-left:0.5em}.form{display:grid;grid-gap:0.5em}.form-dropzone{padding:1em;border:1px solid var(--kup-primary-color)}.section{display:flex;flex-direction:column}.section-header{display:flex;flex-direction:column}.section-header>*{width:100%;display:flex;flex-direction:row}.section-header>*>.section-header-actions{display:flex;justify-content:end}.section-header>*>.section-header-actions>*{margin-top:auto;margin-bottom:auto}.section-body{display:grid}.section-dropzone{border:1px solid var(--kup-primary-color);min-height:100px}.section-draggable{border:1px solid var(--kup-secondary-color);padding:1em}.component{height:fit-content;padding:1em;margin:0.5em}.component-draggable{border:1px solid var(--kup-secondary-color)}.layout-row{grid-auto-flow:column;grid-template-columns:min-content}.layout-column{grid-auto-flow:row;grid-template-rows:min-content}";
|
|
34
|
+
|
|
35
|
+
const KupFormEditor = class {
|
|
36
|
+
constructor(hostRef) {
|
|
37
|
+
registerInstance(this, hostRef);
|
|
38
|
+
this.kupSave = createEvent(this, "kup-formeditor-save", 6);
|
|
39
|
+
/*-------------------------------------------------*/
|
|
40
|
+
/* S t a t e s */
|
|
41
|
+
/*-------------------------------------------------*/
|
|
42
|
+
/**
|
|
43
|
+
* Force render component by internal event.
|
|
44
|
+
*/
|
|
45
|
+
this.resetInternalData = false;
|
|
46
|
+
/*-------------------------------------------------*/
|
|
47
|
+
/* P r o p s */
|
|
48
|
+
/*-------------------------------------------------*/
|
|
49
|
+
/**
|
|
50
|
+
* Custom style of the component.
|
|
51
|
+
* @default ""
|
|
52
|
+
* @see https://ketchup.smeup.com/ketchup-showcase/#/customization
|
|
53
|
+
*/
|
|
54
|
+
this.customStyle = '';
|
|
55
|
+
/**
|
|
56
|
+
* The data of the component.
|
|
57
|
+
* @default false
|
|
58
|
+
*/
|
|
59
|
+
this.data = null;
|
|
60
|
+
/*-------------------------------------------------*/
|
|
61
|
+
/* I n t e r n a l V a r i a b l e s */
|
|
62
|
+
/*-------------------------------------------------*/
|
|
63
|
+
/**
|
|
64
|
+
* Instance of the KupManager class.
|
|
65
|
+
*/
|
|
66
|
+
this.kupManager = kupManagerInstance();
|
|
67
|
+
/**
|
|
68
|
+
* Draggable type of Form (Components or Sections).
|
|
69
|
+
*/
|
|
70
|
+
this.dragType = KupFormEditorDragTypes.Components;
|
|
71
|
+
/**
|
|
72
|
+
* Internal data of the component.
|
|
73
|
+
*/
|
|
74
|
+
this.internalData = null;
|
|
75
|
+
/**
|
|
76
|
+
* Internal data backup of the component for refresh when changed content by drag&drop.
|
|
77
|
+
*/
|
|
78
|
+
this.internalDataBackup = null;
|
|
79
|
+
}
|
|
80
|
+
onKupSave() {
|
|
81
|
+
this.kupSave.emit({
|
|
82
|
+
comp: this,
|
|
83
|
+
id: this.rootElement.id,
|
|
84
|
+
data: this.internalData,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/*-------------------------------------------------*/
|
|
88
|
+
/* W a t c h e r s */
|
|
89
|
+
/*-------------------------------------------------*/
|
|
90
|
+
dataChanged() {
|
|
91
|
+
this.resetData();
|
|
92
|
+
}
|
|
93
|
+
/*-------------------------------------------------*/
|
|
94
|
+
/* P u b l i c M e t h o d s */
|
|
95
|
+
/*-------------------------------------------------*/
|
|
96
|
+
/**
|
|
97
|
+
* Used to retrieve component's props values.
|
|
98
|
+
* @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
|
|
99
|
+
* @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
|
|
100
|
+
*/
|
|
101
|
+
async getProps(descriptions) {
|
|
102
|
+
return getProps(this, KupFormEditorProps, descriptions);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* This method is used to trigger a new render of the component.
|
|
106
|
+
*/
|
|
107
|
+
async refresh() {
|
|
108
|
+
forceUpdate(this);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Sets the props to the component.
|
|
112
|
+
* @param {GenericObject} props - Object containing props that will be set to the component.
|
|
113
|
+
*/
|
|
114
|
+
async setProps(props) {
|
|
115
|
+
setProps(this, KupFormEditorProps, props);
|
|
116
|
+
}
|
|
117
|
+
/*-------------------------------------------------*/
|
|
118
|
+
/* P r i v a t e M e t h o d s */
|
|
119
|
+
/*-------------------------------------------------*/
|
|
120
|
+
buildHeader() {
|
|
121
|
+
const clearButtonProp = {
|
|
122
|
+
icon: 'cancel',
|
|
123
|
+
label: KupFormEditorLabels.Reset,
|
|
124
|
+
secondary: true,
|
|
125
|
+
onClick: () => {
|
|
126
|
+
this.resetData();
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
const saveButtonProp = {
|
|
130
|
+
icon: 'save',
|
|
131
|
+
label: KupFormEditorLabels.Save,
|
|
132
|
+
onClick: () => this.onKupSave(),
|
|
133
|
+
};
|
|
134
|
+
const selRadioProp = [
|
|
135
|
+
{
|
|
136
|
+
label: KupFormEditorLabels.Components,
|
|
137
|
+
value: KupFormEditorDragTypes.Components,
|
|
138
|
+
checked: this.dragType == KupFormEditorDragTypes.Components,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
label: KupFormEditorLabels.Sections,
|
|
142
|
+
value: KupFormEditorDragTypes.Sections,
|
|
143
|
+
checked: this.dragType == KupFormEditorDragTypes.Sections,
|
|
144
|
+
},
|
|
145
|
+
];
|
|
146
|
+
return (h("div", { class: "header" }, h("kup-radio", { data: selRadioProp, "onKup-radio-change": (ev) => {
|
|
147
|
+
this.dragType = ev.detail
|
|
148
|
+
.value;
|
|
149
|
+
this.resetData(this.internalData);
|
|
150
|
+
} }), h(FButton, Object.assign({}, clearButtonProp)), h(FButton, Object.assign({}, saveButtonProp))));
|
|
151
|
+
}
|
|
152
|
+
buildForm(form, parent) {
|
|
153
|
+
const classes = {
|
|
154
|
+
form: true,
|
|
155
|
+
'layout-column': form && form.layout == 'column',
|
|
156
|
+
'layout-row': form && form.layout == 'row',
|
|
157
|
+
'form-dropzone': form &&
|
|
158
|
+
this.dragType == KupFormEditorDragTypes.Sections &&
|
|
159
|
+
form.sections != null &&
|
|
160
|
+
form.sections.length > 0,
|
|
161
|
+
};
|
|
162
|
+
return form ? (h("div", { class: classes, ref: (el) => {
|
|
163
|
+
if (!el)
|
|
164
|
+
return;
|
|
165
|
+
const kel = el;
|
|
166
|
+
kel.kupData = { parent: parent, form: form };
|
|
167
|
+
} }, form.sections.map((section) => this.buildSection(section, form)))) : (h("div", null, this.kupManager.language.translate(KupLanguageGeneric.EMPTY_DATA)));
|
|
168
|
+
}
|
|
169
|
+
buildSectionHeader(section, parent) {
|
|
170
|
+
const addButtonProp = {
|
|
171
|
+
icon: 'add',
|
|
172
|
+
slim: true,
|
|
173
|
+
onClick: () => {
|
|
174
|
+
if (!section.sections) {
|
|
175
|
+
section.sections = [];
|
|
176
|
+
}
|
|
177
|
+
const newSec = {
|
|
178
|
+
id: section.id + (section.sections.length + 1),
|
|
179
|
+
loaded: section.loaded,
|
|
180
|
+
layout: section.layout,
|
|
181
|
+
components: [],
|
|
182
|
+
};
|
|
183
|
+
if (section.components) {
|
|
184
|
+
section.components.forEach((x) => newSec.components.push(x));
|
|
185
|
+
section.components.splice(0);
|
|
186
|
+
}
|
|
187
|
+
section.sections.push(newSec);
|
|
188
|
+
this.resetData(this.internalData);
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
const removeButtonProp = {
|
|
192
|
+
icon: 'remove',
|
|
193
|
+
slim: true,
|
|
194
|
+
secondary: true,
|
|
195
|
+
onClick: () => {
|
|
196
|
+
const idx = parent.sections.indexOf(section);
|
|
197
|
+
parent.sections.splice(idx, 1);
|
|
198
|
+
this.resetData(this.internalData);
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
return (h("div", { class: "section-header" }, h("div", null, section.id, ' ', section.dim ? '(' + section.dim + ')' : undefined, " -", ' ', section.layout), h("div", null, h("div", { class: "section-header-actions" }, h("kup-switch", { checked: section.loaded, label: KupFormEditorLabels.Loaded, "onKup-switch-change": (ev) => {
|
|
202
|
+
section.loaded = ev.detail.value == 'on';
|
|
203
|
+
} }), h("kup-switch", { checked: section.layout == 'column', label: KupFormEditorLabels.Column, "onKup-switch-change": (ev) => {
|
|
204
|
+
section.layout =
|
|
205
|
+
ev.detail.value == 'on' ? 'column' : 'row';
|
|
206
|
+
this.resetData(this.internalData);
|
|
207
|
+
} }), h(FButton, Object.assign({}, addButtonProp)), h(FButton, Object.assign({}, removeButtonProp)), section.components && section.components.length > 0 ? (h("kup-image", { resource: "widgets", sizeX: "24px", sizeY: "24px" })) : undefined))));
|
|
208
|
+
}
|
|
209
|
+
buildSection(section, parent) {
|
|
210
|
+
const classes = {
|
|
211
|
+
section: true,
|
|
212
|
+
'section-draggable': this.dragType == KupFormEditorDragTypes.Sections,
|
|
213
|
+
'section-dropzone': !section.sections ||
|
|
214
|
+
section.sections.length == 0 ||
|
|
215
|
+
this.dragType == KupFormEditorDragTypes.Sections,
|
|
216
|
+
};
|
|
217
|
+
const bodyClasses = {
|
|
218
|
+
'section-body': true,
|
|
219
|
+
'layout-column': section && section.layout == 'column',
|
|
220
|
+
'layout-row': section && section.layout == 'row',
|
|
221
|
+
};
|
|
222
|
+
let bodyStyles = {};
|
|
223
|
+
if (section.sections) {
|
|
224
|
+
let gridTemplate = '';
|
|
225
|
+
section.sections.forEach((childSection) => {
|
|
226
|
+
if (!childSection.dim)
|
|
227
|
+
gridTemplate += ' 1fr';
|
|
228
|
+
else
|
|
229
|
+
gridTemplate +=
|
|
230
|
+
childSection.dim.indexOf('%') < 0
|
|
231
|
+
? ' ' + childSection.dim + 'px'
|
|
232
|
+
: ' ' + childSection.dim;
|
|
233
|
+
});
|
|
234
|
+
if (section.layout == 'column')
|
|
235
|
+
bodyStyles['gridTemplateRows'] = gridTemplate;
|
|
236
|
+
if (section.layout == 'row')
|
|
237
|
+
bodyStyles['gridTemplateColumns'] = gridTemplate;
|
|
238
|
+
}
|
|
239
|
+
return (h("div", { class: classes, ref: (el) => {
|
|
240
|
+
if (!el)
|
|
241
|
+
return;
|
|
242
|
+
const kel = el;
|
|
243
|
+
kel.kupData = { parent: parent, section: section };
|
|
244
|
+
} }, this.dragType == KupFormEditorDragTypes.Sections
|
|
245
|
+
? this.buildSectionHeader(section, parent)
|
|
246
|
+
: undefined, h("div", { class: bodyClasses, style: bodyStyles }, this.dragType == KupFormEditorDragTypes.Components &&
|
|
247
|
+
section.components
|
|
248
|
+
? section.components.map((component) => component.type == 'SCH' ? (this.buildForm(component, section)) : (h("div", { class: "component component-draggable", ref: (el) => {
|
|
249
|
+
if (!el)
|
|
250
|
+
return;
|
|
251
|
+
const kel = el;
|
|
252
|
+
kel.kupData = {
|
|
253
|
+
section: section,
|
|
254
|
+
componnent: component,
|
|
255
|
+
};
|
|
256
|
+
} }, component.id, " - ", component.type, h("kup-switch", { checked: component.loaded, label: KupFormEditorLabels.Loaded, "onKup-switch-change": (ev) => {
|
|
257
|
+
component.loaded =
|
|
258
|
+
ev.detail.value == 'on';
|
|
259
|
+
} }))))
|
|
260
|
+
: undefined, section.sections
|
|
261
|
+
? section.sections.map((childSection) => this.buildSection(childSection, section))
|
|
262
|
+
: undefined)));
|
|
263
|
+
}
|
|
264
|
+
didRenderInteractables() {
|
|
265
|
+
try {
|
|
266
|
+
const items = [];
|
|
267
|
+
this.rootElement.shadowRoot
|
|
268
|
+
.querySelectorAll('.component-draggable')
|
|
269
|
+
.forEach((x) => items.push(x));
|
|
270
|
+
this.rootElement.shadowRoot
|
|
271
|
+
.querySelectorAll('.section-draggable')
|
|
272
|
+
.forEach((x) => items.push(x));
|
|
273
|
+
items.forEach((item) => {
|
|
274
|
+
this.kupManager.interact.draggable(item, null, null, KupDragEffect.CLONE);
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
catch (error) {
|
|
278
|
+
this.kupManager.debug.logMessage(this, error, KupDebugCategory.ERROR);
|
|
279
|
+
}
|
|
280
|
+
try {
|
|
281
|
+
const items = [];
|
|
282
|
+
this.rootElement.shadowRoot
|
|
283
|
+
.querySelectorAll('.section-dropzone')
|
|
284
|
+
.forEach((x) => items.push(x));
|
|
285
|
+
this.rootElement.shadowRoot
|
|
286
|
+
.querySelectorAll('.form-dropzone')
|
|
287
|
+
.forEach((x) => items.push(x));
|
|
288
|
+
items.forEach((item) => {
|
|
289
|
+
this.kupManager.interact.dropzone(item, null, null, {
|
|
290
|
+
drop: (ev) => {
|
|
291
|
+
ev.currentTarget.appendChild(ev.relatedTarget);
|
|
292
|
+
this.dropped(ev.currentTarget, ev.relatedTarget);
|
|
293
|
+
},
|
|
294
|
+
});
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
catch (error) {
|
|
298
|
+
this.kupManager.debug.logMessage(this, error, KupDebugCategory.ERROR);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
dropped(parent, child) {
|
|
302
|
+
if (this.dragType == KupFormEditorDragTypes.Components) {
|
|
303
|
+
const idx = child.kupData.section.components.indexOf(child.kupData.componnent);
|
|
304
|
+
child.kupData.section.components.splice(idx, 1);
|
|
305
|
+
parent.kupData.section.components.push(child.kupData.componnent);
|
|
306
|
+
child.kupData.section = parent.kupData.section;
|
|
307
|
+
}
|
|
308
|
+
else if (this.dragType == KupFormEditorDragTypes.Sections) {
|
|
309
|
+
const idx = child.kupData.parent.sections.indexOf(child.kupData.section);
|
|
310
|
+
child.kupData.parent.sections.splice(idx, 1);
|
|
311
|
+
if (parent.kupData.form) {
|
|
312
|
+
// il nuovo target è la form.
|
|
313
|
+
if (!parent.kupData.form.sections)
|
|
314
|
+
parent.kupData.form.sections = [];
|
|
315
|
+
parent.kupData.form.sections.push(child.kupData.section);
|
|
316
|
+
child.kupData.parent = parent.kupData.form;
|
|
317
|
+
}
|
|
318
|
+
else if (parent.kupData.section) {
|
|
319
|
+
// il nuovo target è la section.
|
|
320
|
+
if (!parent.kupData.section.sections)
|
|
321
|
+
parent.kupData.section.sections = [];
|
|
322
|
+
if (parent.kupData.section.components &&
|
|
323
|
+
parent.kupData.section.components.length > 0) {
|
|
324
|
+
// devo creare una section contenitore e sposare i components
|
|
325
|
+
const newSec = {
|
|
326
|
+
id: parent.kupData.section.id + '1',
|
|
327
|
+
loaded: parent.kupData.section.loaded,
|
|
328
|
+
layout: parent.kupData.section.layout,
|
|
329
|
+
components: [],
|
|
330
|
+
};
|
|
331
|
+
parent.kupData.section.components.forEach((x) => newSec.components.push(x));
|
|
332
|
+
parent.kupData.section.components.splice(0);
|
|
333
|
+
parent.kupData.section.sections.push(newSec);
|
|
334
|
+
}
|
|
335
|
+
parent.kupData.section.sections.push(child.kupData.section);
|
|
336
|
+
child.kupData.parent = parent.kupData.section;
|
|
337
|
+
}
|
|
338
|
+
this.resetData(this.internalData);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
resetData(form = null) {
|
|
342
|
+
if (form)
|
|
343
|
+
this.internalDataBackup = form;
|
|
344
|
+
this.resetInternalData = true;
|
|
345
|
+
setTimeout(() => {
|
|
346
|
+
if (this.internalDataBackup) {
|
|
347
|
+
this.internalData = this.internalDataBackup;
|
|
348
|
+
this.internalDataBackup = null;
|
|
349
|
+
}
|
|
350
|
+
this.resetInternalData = false;
|
|
351
|
+
}, 250);
|
|
352
|
+
}
|
|
353
|
+
unregisterInteractables() {
|
|
354
|
+
this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll('.component-draggable')));
|
|
355
|
+
this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll('.section-dropzone')));
|
|
356
|
+
this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll('.section-draggable')));
|
|
357
|
+
this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll('.form-dropzone')));
|
|
358
|
+
}
|
|
359
|
+
/*-------------------------------------------------*/
|
|
360
|
+
/* L i f e c y c l e H o o k s */
|
|
361
|
+
/*-------------------------------------------------*/
|
|
362
|
+
componentWillLoad() {
|
|
363
|
+
this.kupManager.dates.register(this);
|
|
364
|
+
this.kupManager.debug.logLoad(this, false);
|
|
365
|
+
this.kupManager.language.register(this);
|
|
366
|
+
this.kupManager.theme.register(this);
|
|
367
|
+
}
|
|
368
|
+
componentDidLoad() {
|
|
369
|
+
this.kupManager.debug.logLoad(this, true);
|
|
370
|
+
}
|
|
371
|
+
componentWillRender() {
|
|
372
|
+
this.kupManager.debug.logRender(this, false);
|
|
373
|
+
if (this.resetInternalData) {
|
|
374
|
+
this.internalData = null;
|
|
375
|
+
this.unregisterInteractables();
|
|
376
|
+
}
|
|
377
|
+
else if (!this.internalData)
|
|
378
|
+
this.internalData = JSON.parse(JSON.stringify(this.data));
|
|
379
|
+
}
|
|
380
|
+
componentDidRender() {
|
|
381
|
+
this.kupManager.debug.logRender(this, true);
|
|
382
|
+
this.didRenderInteractables();
|
|
383
|
+
}
|
|
384
|
+
render() {
|
|
385
|
+
return (h(Host, null, h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)), h("div", { id: componentWrapperId }, this.buildHeader(), this.buildForm(this.internalData, null))));
|
|
386
|
+
}
|
|
387
|
+
disconnectedCallback() {
|
|
388
|
+
this.unregisterInteractables();
|
|
389
|
+
this.kupManager.dates.unregister(this);
|
|
390
|
+
this.kupManager.language.unregister(this);
|
|
391
|
+
this.kupManager.theme.unregister(this);
|
|
392
|
+
}
|
|
393
|
+
get rootElement() { return getElement(this); }
|
|
394
|
+
static get watchers() { return {
|
|
395
|
+
"data": ["dataChanged"]
|
|
396
|
+
}; }
|
|
397
|
+
};
|
|
398
|
+
KupFormEditor.style = kupFormEditorCss;
|
|
399
|
+
|
|
400
|
+
export { KupFormEditor as kup_form_editor };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-
|
|
2
|
-
import { k as kupManagerInstance,
|
|
3
|
-
import { g as getProps, s as setProps } from './utils-
|
|
1
|
+
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-baeab1ac.js';
|
|
2
|
+
import { k as kupManagerInstance, c as KupDebugCategory } from './kup-manager-58b075b4.js';
|
|
3
|
+
import { g as getProps, s as setProps } from './utils-d7e4b3c2.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Props of the kup-iframe component.
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-baeab1ac.js';
|
|
2
|
+
import { k as kupManagerInstance, h as KupLanguageGeneric } from './kup-manager-58b075b4.js';
|
|
3
|
+
import { g as getProps, s as setProps } from './utils-d7e4b3c2.js';
|
|
4
|
+
import { c as componentWrapperId } from './GenericVariables-665de00a.js';
|
|
5
|
+
import { F as FImage } from './f-image-c468d8ae.js';
|
|
6
|
+
import { F as FButton } from './f-button-871a544b.js';
|
|
7
|
+
import { F as FButtonStyling } from './f-button-declarations-b1b4cac4.js';
|
|
8
|
+
import { a as FCellPadding, b as FCell } from './f-cell-521ef17a.js';
|
|
9
|
+
import { M as MDCRipple } from './component-b1bedf1d.js';
|
|
10
|
+
import './cell-utils-964da6b5.js';
|
|
11
|
+
import './f-text-field-d6c61c73.js';
|
|
12
|
+
import './f-chip-1dda722f.js';
|
|
13
|
+
import './tslib.es6-3eea2234.js';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Props of the kup-image-list component.
|
|
17
|
+
* Used to export every prop in an object.
|
|
18
|
+
*/
|
|
19
|
+
var KupImageListProps;
|
|
20
|
+
(function (KupImageListProps) {
|
|
21
|
+
KupImageListProps["customStyle"] = "Custom style of the component.";
|
|
22
|
+
KupImageListProps["data"] = "Actual data of the component";
|
|
23
|
+
KupImageListProps["ripple"] = "When enabled displays Material's ripple effect on clicked items.";
|
|
24
|
+
})(KupImageListProps || (KupImageListProps = {}));
|
|
25
|
+
|
|
26
|
+
const kupImageListCss = ":host{--kup_imagelist_background_color:var(\n --kup-imagelist-background-color,\n transparent\n );--kup_imagelist_columns:var(--kup-imagelist-columns, 4);--kup_imagelist_grid_gap:var(--kup-imagelist-grid-gap, 0.5em);--kup_imagelist_image_margin:var(--kup-imagelist-image-margin, 1em auto);--kup_imagelist_image_min_height:var(--kup-imagelist-image-min-height, 64px);--kup_imagelist_item_border_radius:var(\n --kup-imagelist-item-border-radius,\n 8px\n );--kup_imagelist_item_height:var(--kup-imagelist-item-height, auto);--kup_imagelist_item_padding:var(--kup-imagelist-item-padding, 0);--kup_imagelist_item_width:var(--kup-imagelist-item-width, auto);--kup_imagelist_label_margin:var(\n --kup-imagelist-label-margin,\n 0 auto 1em auto\n );--kup_imagelist_navbar_background_color:var(\n --kup-imagelist-navbar-background-color,\n transparent\n );--kup_imagelist_primary_color:var(\n --kup-imagelist-primary-color,\n var(--kup-primary-color)\n );--kup_imagelist_primary_color_rgb:var(\n --kup-imagelist-primary-color-rgb,\n var(--kup-primary-color-rgb)\n );--kup_imagelist_text_color:var(\n --kup-imagelist-text-color,\n var(--kup-text-color)\n );display:block}.navigation-bar{align-items:center;background-color:var(--kup_imagelist_navbar_background_color);display:flex;justify-content:center}.navigation-bar__wrapper{align-items:center;display:flex;flex-wrap:wrap;justify-content:center;max-width:100%;position:relative}.navigation-bar__wrapper--active .navigation-bar__title{background-color:rgba(var(--kup_imagelist_primary_color_rgb), 0.15);color:var(--kup_imagelist_primary_color)}.navigation-bar__wrapper--active .navigation-bar__back,.navigation-bar__wrapper--active .navigation-bar__top{display:block}.navigation-bar__back,.navigation-bar__top{--kup-button-primary-color-rgb:0;animation:fade-in 0.375s ease-in;display:none}.navigation-bar__title{border-radius:16px;box-sizing:border-box;cursor:pointer;display:flex;justify-content:center;padding:0.75em 1em;user-select:none;transition:background-color 125ms, color 125ms;width:100%}.navigation-bar__title__image.f-image{margin:0}.navigation-bar__title__label{font-size:1.2em;font-weight:bold;letter-spacing:0.12em;overflow:hidden;padding:0 0.5em;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}.image-list{background-color:var(--kup_imagelist_background_color);display:grid;grid-gap:var(--kup_imagelist_grid_gap);grid-template-columns:repeat(var(--kup_imagelist_columns, 4), minmax(0px, 1fr));margin-top:1em;width:100%}.image-list .f-cell{height:100%;width:100%}.image-list__item{border-radius:var(--kup_imagelist_item_border_radius);cursor:pointer;height:var(--kup_imagelist_item_height);padding:var(--kup_imagelist_item_padding);width:var(--kup_imagelist_item_width)}.image-list__image.f-image{margin:var(--kup_imagelist_image_margin)}.image-list__image.f-image .f-image__icon{min-height:var(--kup_imagelist_image_min_height)}.image-list__label{color:var(--kup_imagelist_text_color);letter-spacing:0.12em;margin:var(--kup_imagelist_label_margin);overflow:hidden;text-align:center;text-overflow:ellipsis}.image-list .mdc-ripple-surface{--mdc-ripple-fg-opacity:0.24}.image-list .mdc-ripple-surface:before,.image-list .mdc-ripple-surface:after{background-color:var(--kup_imagelist_primary_color)}:host(.kup-full-height){height:100%}:host(.kup-full-width){width:100%}:host(.kup-horizontal) .image-list{display:flex}:host(.kup-auto-grid) .image-list{display:flex;flex-wrap:wrap;justify-content:center}";
|
|
27
|
+
|
|
28
|
+
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
29
|
+
if (kind === "a" && !f)
|
|
30
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
31
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
32
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
33
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
34
|
+
};
|
|
35
|
+
var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
36
|
+
if (kind === "m")
|
|
37
|
+
throw new TypeError("Private method is not writable");
|
|
38
|
+
if (kind === "a" && !f)
|
|
39
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
40
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
41
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
42
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
43
|
+
};
|
|
44
|
+
var _KupImageList_instances, _KupImageList_clickTimeout, _KupImageList_kupManager, _KupImageList_backProps, _KupImageList_topProps, _KupImageList_createItem, _KupImageList_createList;
|
|
45
|
+
const KupImageList = class {
|
|
46
|
+
constructor(hostRef) {
|
|
47
|
+
registerInstance(this, hostRef);
|
|
48
|
+
this.kupClick = createEvent(this, "kup-imagelist-click", 6);
|
|
49
|
+
this.kupContextMenu = createEvent(this, "kup-imagelist-contextmenu", 6);
|
|
50
|
+
this.kupDblClick = createEvent(this, "kup-imagelist-dblclick", 6);
|
|
51
|
+
_KupImageList_instances.add(this);
|
|
52
|
+
/*-------------------------------------------------*/
|
|
53
|
+
/* S t a t e s */
|
|
54
|
+
/*-------------------------------------------------*/
|
|
55
|
+
this.currentNode = null;
|
|
56
|
+
this.navigationBarToggled = false;
|
|
57
|
+
/*-------------------------------------------------*/
|
|
58
|
+
/* P r o p s */
|
|
59
|
+
/*-------------------------------------------------*/
|
|
60
|
+
/**
|
|
61
|
+
* Custom style of the component.
|
|
62
|
+
* @default ""
|
|
63
|
+
* @see https://ketchup.smeup.com/ketchup-showcase/#/customization
|
|
64
|
+
*/
|
|
65
|
+
this.customStyle = '';
|
|
66
|
+
/**
|
|
67
|
+
* Actual data of the component.
|
|
68
|
+
* @default []
|
|
69
|
+
*/
|
|
70
|
+
this.data = [];
|
|
71
|
+
/**
|
|
72
|
+
* When enabled displays Material's ripple effect on clicked items.
|
|
73
|
+
* @default true
|
|
74
|
+
*/
|
|
75
|
+
this.ripple = true;
|
|
76
|
+
/*-------------------------------------------------*/
|
|
77
|
+
/* I n t e r n a l V a r i a b l e s */
|
|
78
|
+
/*-------------------------------------------------*/
|
|
79
|
+
_KupImageList_clickTimeout.set(this, []);
|
|
80
|
+
_KupImageList_kupManager.set(this, kupManagerInstance());
|
|
81
|
+
_KupImageList_backProps.set(this, {
|
|
82
|
+
icon: 'arrow_back',
|
|
83
|
+
onClick: () => {
|
|
84
|
+
this.currentNode = __classPrivateFieldGet(this, _KupImageList_kupManager, "f").data.node.getParent(this.data, this.currentNode);
|
|
85
|
+
if (!this.currentNode) {
|
|
86
|
+
this.navigationBarToggled = false;
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
styling: FButtonStyling.FLAT,
|
|
90
|
+
wrapperClass: 'navigation-bar__back',
|
|
91
|
+
});
|
|
92
|
+
_KupImageList_topProps.set(this, {
|
|
93
|
+
icon: 'arrow_upward',
|
|
94
|
+
onClick: () => {
|
|
95
|
+
this.currentNode = null;
|
|
96
|
+
this.navigationBarToggled = false;
|
|
97
|
+
},
|
|
98
|
+
styling: FButtonStyling.FLAT,
|
|
99
|
+
wrapperClass: 'navigation-bar__top',
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
onKupClick(node) {
|
|
103
|
+
if (node.children && node.children.length > 0) {
|
|
104
|
+
this.currentNode = node;
|
|
105
|
+
}
|
|
106
|
+
this.kupClick.emit({
|
|
107
|
+
comp: this,
|
|
108
|
+
id: this.rootElement.id,
|
|
109
|
+
node: node,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
onKupContextMenu(e, node) {
|
|
113
|
+
e.preventDefault();
|
|
114
|
+
this.kupContextMenu.emit({
|
|
115
|
+
comp: this,
|
|
116
|
+
id: this.rootElement.id,
|
|
117
|
+
node: node,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
onKupDblClick(node) {
|
|
121
|
+
for (let index = 0; index < __classPrivateFieldGet(this, _KupImageList_clickTimeout, "f").length; index++) {
|
|
122
|
+
clearTimeout(__classPrivateFieldGet(this, _KupImageList_clickTimeout, "f")[index]);
|
|
123
|
+
}
|
|
124
|
+
__classPrivateFieldSet(this, _KupImageList_clickTimeout, [], "f");
|
|
125
|
+
this.kupDblClick.emit({
|
|
126
|
+
comp: this,
|
|
127
|
+
id: this.rootElement.id,
|
|
128
|
+
node: node,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/*-------------------------------------------------*/
|
|
132
|
+
/* P u b l i c M e t h o d s */
|
|
133
|
+
/*-------------------------------------------------*/
|
|
134
|
+
/**
|
|
135
|
+
* Used to retrieve component's props values.
|
|
136
|
+
* @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
|
|
137
|
+
* @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
|
|
138
|
+
*/
|
|
139
|
+
async getProps(descriptions) {
|
|
140
|
+
return getProps(this, KupImageListProps, descriptions);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* This method is used to trigger a new render of the component.
|
|
144
|
+
*/
|
|
145
|
+
async refresh() {
|
|
146
|
+
forceUpdate(this);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Sets the props to the component.
|
|
150
|
+
* @param {GenericObject} props - Object containing props that will be set to the component.
|
|
151
|
+
*/
|
|
152
|
+
async setProps(props) {
|
|
153
|
+
setProps(this, KupImageListProps, props);
|
|
154
|
+
}
|
|
155
|
+
/*-------------------------------------------------*/
|
|
156
|
+
/* L i f e c y c l e H o o k s */
|
|
157
|
+
/*-------------------------------------------------*/
|
|
158
|
+
componentWillLoad() {
|
|
159
|
+
__classPrivateFieldGet(this, _KupImageList_kupManager, "f").debug.logLoad(this, false);
|
|
160
|
+
__classPrivateFieldGet(this, _KupImageList_kupManager, "f").language.register(this);
|
|
161
|
+
__classPrivateFieldGet(this, _KupImageList_kupManager, "f").theme.register(this);
|
|
162
|
+
}
|
|
163
|
+
componentDidLoad() {
|
|
164
|
+
__classPrivateFieldGet(this, _KupImageList_kupManager, "f").debug.logLoad(this, true);
|
|
165
|
+
}
|
|
166
|
+
componentWillRender() {
|
|
167
|
+
__classPrivateFieldGet(this, _KupImageList_kupManager, "f").debug.logRender(this, false);
|
|
168
|
+
}
|
|
169
|
+
componentDidRender() {
|
|
170
|
+
const root = this.rootElement.shadowRoot;
|
|
171
|
+
if (root && this.ripple) {
|
|
172
|
+
const rippleCells = root.querySelectorAll('.mdc-ripple-surface:not(.mdc-ripple-upgraded)');
|
|
173
|
+
if (rippleCells) {
|
|
174
|
+
for (let i = 0; i < rippleCells.length; i++) {
|
|
175
|
+
MDCRipple.attachTo(rippleCells[i]);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
__classPrivateFieldGet(this, _KupImageList_kupManager, "f").debug.logRender(this, true);
|
|
180
|
+
}
|
|
181
|
+
render() {
|
|
182
|
+
const hasNavigation = !!this.currentNode;
|
|
183
|
+
return (h(Host, null, h("style", null, __classPrivateFieldGet(this, _KupImageList_kupManager, "f").theme.setKupStyle(this.rootElement)), h("div", { id: componentWrapperId }, h("div", { class: "navigation-bar" }, hasNavigation ? (h("div", { class: `navigation-bar__wrapper ${this.navigationBarToggled
|
|
184
|
+
? 'navigation-bar__wrapper--active'
|
|
185
|
+
: ''}` }, h("div", { class: `navigation-bar__title`, onClick: () => {
|
|
186
|
+
this.navigationBarToggled =
|
|
187
|
+
!this.navigationBarToggled;
|
|
188
|
+
} }, h(FImage, { fit: true, resource: this.currentNode.icon, sizeX: "1.25em", sizeY: "1.25em", wrapperClass: "navigation-bar__title__image" }), h("div", { class: "navigation-bar__title__label" }, this.currentNode.value)), h(FButton, Object.assign({}, __classPrivateFieldGet(this, _KupImageList_backProps, "f"), { label: __classPrivateFieldGet(this, _KupImageList_kupManager, "f").language.translate(KupLanguageGeneric.BACK) })), h(FButton, Object.assign({}, __classPrivateFieldGet(this, _KupImageList_topProps, "f"), { label: __classPrivateFieldGet(this, _KupImageList_kupManager, "f").language.translate(KupLanguageGeneric.TOP) })))) : null), h("div", { class: "image-list" }, ...__classPrivateFieldGet(this, _KupImageList_instances, "m", _KupImageList_createList).call(this)))));
|
|
189
|
+
}
|
|
190
|
+
disconnectedCallback() {
|
|
191
|
+
__classPrivateFieldGet(this, _KupImageList_kupManager, "f").language.unregister(this);
|
|
192
|
+
__classPrivateFieldGet(this, _KupImageList_kupManager, "f").theme.unregister(this);
|
|
193
|
+
}
|
|
194
|
+
get rootElement() { return getElement(this); }
|
|
195
|
+
};
|
|
196
|
+
_KupImageList_clickTimeout = new WeakMap(), _KupImageList_kupManager = new WeakMap(), _KupImageList_backProps = new WeakMap(), _KupImageList_topProps = new WeakMap(), _KupImageList_instances = new WeakSet(), _KupImageList_createItem = function _KupImageList_createItem(node) {
|
|
197
|
+
const props = {
|
|
198
|
+
fit: true,
|
|
199
|
+
resource: node.icon,
|
|
200
|
+
title: node.title,
|
|
201
|
+
wrapperClass: 'image-list__image',
|
|
202
|
+
};
|
|
203
|
+
const image = h(FImage, Object.assign({}, props));
|
|
204
|
+
const label = h("div", { class: "image-list__label" }, node.value);
|
|
205
|
+
return (h(FCell, { cell: { value: node.value, icon: node.icon, obj: node.obj }, column: { name: 'IMAGE', title: 'Image' }, density: FCellPadding.NONE, row: Object.assign({}, node) }, h("div", { class: "image-list__wrapper" }, image, label)));
|
|
206
|
+
}, _KupImageList_createList = function _KupImageList_createList() {
|
|
207
|
+
const nodes = [];
|
|
208
|
+
const items = this.currentNode ? this.currentNode.children : this.data;
|
|
209
|
+
for (let index = 0; items && index < items.length; index++) {
|
|
210
|
+
const node = items[index];
|
|
211
|
+
const classObj = {
|
|
212
|
+
'image-list__item': true,
|
|
213
|
+
'mdc-ripple-surface': this.ripple ? true : false,
|
|
214
|
+
};
|
|
215
|
+
const item = (h("div", { onClick: () => {
|
|
216
|
+
__classPrivateFieldGet(this, _KupImageList_clickTimeout, "f").push(setTimeout(() => this.onKupClick(node), 300));
|
|
217
|
+
}, onContextMenu: (e) => this.onKupContextMenu(e, node), onDblClick: () => this.onKupDblClick(node), class: classObj }, __classPrivateFieldGet(this, _KupImageList_instances, "m", _KupImageList_createItem).call(this, node)));
|
|
218
|
+
nodes.push(item);
|
|
219
|
+
}
|
|
220
|
+
return nodes;
|
|
221
|
+
};
|
|
222
|
+
KupImageList.style = kupImageListCss;
|
|
223
|
+
|
|
224
|
+
export { KupImageList as kup_image_list };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-
|
|
2
|
-
import { k as kupManagerInstance } from './kup-manager-
|
|
3
|
-
import { g as getProps, s as setProps } from './utils-
|
|
1
|
+
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-baeab1ac.js';
|
|
2
|
+
import { k as kupManagerInstance } from './kup-manager-58b075b4.js';
|
|
3
|
+
import { g as getProps, s as setProps } from './utils-d7e4b3c2.js';
|
|
4
4
|
import { c as componentWrapperId } from './GenericVariables-665de00a.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as registerInstance, f as forceUpdate, h, H as Host, g as getElement } from './index-
|
|
2
|
-
import { k as kupManagerInstance,
|
|
1
|
+
import { r as registerInstance, f as forceUpdate, h, H as Host, g as getElement } from './index-baeab1ac.js';
|
|
2
|
+
import { k as kupManagerInstance, h as KupLanguageGeneric, c as KupDebugCategory, _ as kupDropEvent, z as kupDraggableColumnAttr, $ as kupDraggableRowAttr, D as KupDropEventTypes, b as KupThemeColorValues } from './kup-manager-58b075b4.js';
|
|
3
3
|
import { F as FButtonStyling } from './f-button-declarations-b1b4cac4.js';
|
|
4
|
-
import { F as FImage } from './f-image-
|
|
5
|
-
import { g as getProps, s as setProps } from './utils-
|
|
4
|
+
import { F as FImage } from './f-image-c468d8ae.js';
|
|
5
|
+
import { g as getProps, s as setProps } from './utils-d7e4b3c2.js';
|
|
6
6
|
import { c as componentWrapperId } from './GenericVariables-665de00a.js';
|
|
7
7
|
|
|
8
8
|
/**
|