@sme.up/ketchup 6.0.0 → 6.2.0
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-a78d6fac.js → cell-utils-fe64a28c.js} +2 -2
- package/dist/cjs/{f-button-ac179257.js → f-button-5b69d882.js} +4 -4
- package/dist/cjs/f-cell-3a740c48.js +418 -0
- package/dist/cjs/f-checkbox-57443ca3.js +29 -0
- package/dist/cjs/{f-chip-b00897d7.js → f-chip-02e83f82.js} +3 -3
- package/dist/cjs/{f-image-89f25556.js → f-image-2a61ece2.js} +2 -2
- package/dist/cjs/{f-paginator-utils-8fa501b3.js → f-paginator-utils-09126bdd.js} +5 -5
- package/dist/cjs/{f-text-field-e1e45ade.js → f-text-field-9ee20a67.js} +3 -3
- package/dist/cjs/{index-eb556444.js → index-06b131ea.js} +6 -4
- package/dist/cjs/ketchup.cjs.js +3 -3
- package/dist/cjs/kup-accordion.cjs.entry.js +4 -4
- package/dist/cjs/kup-autocomplete_25.cjs.entry.js +209 -193
- package/dist/cjs/kup-box.cjs.entry.js +1306 -0
- package/dist/cjs/kup-calendar.cjs.entry.js +7 -7
- package/dist/cjs/kup-cell.cjs.entry.js +10 -9
- package/dist/cjs/kup-dash-list.cjs.entry.js +4 -4
- package/dist/cjs/kup-dash_2.cjs.entry.js +4 -7
- package/dist/cjs/{kup-form-editor.cjs.entry.js → kup-dashboard.cjs.entry.js} +123 -148
- package/dist/cjs/kup-drawer.cjs.entry.js +4 -4
- package/dist/cjs/{kup-box_2.cjs.entry.js → kup-echart.cjs.entry.js} +53 -1338
- package/dist/cjs/kup-family-tree.cjs.entry.js +410 -0
- package/dist/cjs/kup-form.cjs.entry.js +480 -0
- package/dist/cjs/kup-iframe.cjs.entry.js +3 -3
- package/dist/cjs/kup-image-list.cjs.entry.js +73 -11
- package/dist/cjs/kup-lazy.cjs.entry.js +4 -4
- package/dist/cjs/kup-magic-box.cjs.entry.js +4 -4
- package/dist/cjs/{kup-manager-7a941909.js → kup-manager-02acbb37.js} +407 -7
- package/dist/cjs/kup-nav-bar.cjs.entry.js +3 -3
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +3 -3
- 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 +5 -5
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{utils-6287d878.js → utils-4b208b48.js} +1 -1
- package/dist/collection/assets/dashboard.js +113 -0
- package/dist/collection/assets/data-table.js +15 -0
- package/dist/collection/assets/family-tree.js +2437 -0
- package/dist/collection/assets/form.js +433 -0
- package/dist/collection/assets/grid.js +17 -0
- package/dist/collection/assets/index.js +14 -6
- package/dist/collection/collection-manifest.json +4 -3
- package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +135 -129
- package/dist/collection/components/kup-box/kup-box.js +13 -2
- package/dist/collection/components/kup-button/kup-button.js +1 -0
- package/dist/collection/components/kup-combobox/kup-combobox.js +16 -13
- package/dist/collection/components/kup-dashboard/kup-dashboard-declarations.js +10 -0
- package/dist/collection/components/{kup-form-editor/kup-form-editor.css → kup-dashboard/kup-dashboard.css} +7 -6
- package/dist/collection/components/{kup-form-editor/kup-form-editor.js → kup-dashboard/kup-dashboard.js} +148 -149
- package/dist/collection/components/kup-data-table/kup-data-table.js +7 -6
- package/dist/collection/components/kup-drawer/kup-drawer.css +5 -8
- package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.js +1 -0
- package/dist/collection/components/kup-family-tree/kup-family-tree-declarations.js +12 -0
- package/dist/collection/components/kup-family-tree/kup-family-tree.css +101 -0
- package/dist/collection/components/kup-family-tree/kup-family-tree.js +666 -0
- package/dist/collection/components/kup-form/kup-form-declarations.js +25 -0
- package/dist/collection/components/kup-form/kup-form.css +99 -0
- package/dist/collection/components/kup-form/kup-form.js +647 -0
- package/dist/collection/components/kup-grid/kup-grid.js +1 -4
- package/dist/collection/components/kup-image-list/kup-image-list-state.js +9 -0
- package/dist/collection/components/kup-image-list/kup-image-list.css +0 -6
- package/dist/collection/components/kup-image-list/kup-image-list.js +113 -1
- package/dist/collection/components/kup-lazy/kup-lazy.css +13 -6
- package/dist/collection/components/kup-list/kup-list-helper.js +9 -3
- package/dist/collection/components/kup-photo-frame/kup-photo-frame.css +13 -3
- package/dist/collection/components/kup-photo-frame/kup-photo-frame.js +1 -1
- package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +3 -0
- package/dist/collection/components/kup-text-field/kup-text-field.js +27 -0
- package/dist/collection/components/kup-time-picker/kup-time-picker.js +0 -6
- package/dist/collection/components/kup-tree/kup-tree.js +10 -4
- package/dist/collection/f-components/f-button/f-button.js +2 -2
- package/dist/collection/f-components/f-cell/f-cell-declarations.js +5 -1
- package/dist/collection/f-components/f-cell/f-cell.js +34 -114
- package/dist/collection/f-components/f-text-field/f-text-field.js +1 -1
- package/dist/collection/managers/kup-data/kup-data-node-helper.js +69 -0
- package/dist/collection/managers/kup-data/kup-data.js +109 -1
- package/dist/collection/managers/kup-language/kup-language-declarations.js +11 -0
- package/dist/collection/managers/kup-objects/kup-objects.js +10 -0
- package/dist/collection/managers/kup-theme/kup-theme-declarations.js +20 -3
- package/dist/collection/types/GenericTypes.js +3 -2
- package/dist/esm/{cell-utils-964da6b5.js → cell-utils-cb5d4149.js} +2 -2
- package/dist/esm/{f-button-871a544b.js → f-button-fd44ef70.js} +4 -4
- package/dist/esm/{f-cell-521ef17a.js → f-cell-7b159a22.js} +48 -283
- package/dist/esm/f-checkbox-c51c4a75.js +27 -0
- package/dist/esm/{f-chip-1dda722f.js → f-chip-c2e4c522.js} +3 -3
- package/dist/esm/{f-image-c468d8ae.js → f-image-2ab4b9aa.js} +2 -2
- package/dist/esm/{f-paginator-utils-7dff8ff0.js → f-paginator-utils-ef537d82.js} +5 -5
- package/dist/esm/{f-text-field-d6c61c73.js → f-text-field-41c575eb.js} +3 -3
- package/dist/esm/{index-baeab1ac.js → index-ad6ab214.js} +6 -4
- package/dist/esm/ketchup.js +3 -3
- package/dist/esm/kup-accordion.entry.js +4 -4
- package/dist/esm/kup-autocomplete_25.entry.js +199 -183
- package/dist/esm/kup-box.entry.js +1302 -0
- package/dist/esm/kup-calendar.entry.js +7 -7
- package/dist/esm/kup-cell.entry.js +9 -8
- package/dist/esm/kup-dash-list.entry.js +4 -4
- package/dist/esm/kup-dash_2.entry.js +4 -7
- package/dist/esm/{kup-form-editor.entry.js → kup-dashboard.entry.js} +123 -148
- package/dist/esm/kup-drawer.entry.js +4 -4
- package/dist/esm/{kup-box_2.entry.js → kup-echart.entry.js} +54 -1338
- package/dist/esm/kup-family-tree.entry.js +406 -0
- package/dist/esm/kup-form.entry.js +476 -0
- package/dist/esm/kup-iframe.entry.js +3 -3
- package/dist/esm/kup-image-list.entry.js +72 -10
- package/dist/esm/kup-lazy.entry.js +4 -4
- package/dist/esm/kup-magic-box.entry.js +4 -4
- package/dist/esm/{kup-manager-58b075b4.js → kup-manager-22a475e6.js} +404 -8
- package/dist/esm/kup-nav-bar.entry.js +3 -3
- package/dist/esm/kup-numeric-picker.entry.js +3 -3
- 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 +5 -5
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{utils-d7e4b3c2.js → utils-2c1f4122.js} +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/p-06c6cc68.js +1 -0
- package/dist/ketchup/{p-3c11e615.entry.js → p-0dacd4bc.entry.js} +1 -1
- package/dist/ketchup/{p-fac1a08b.entry.js → p-1959f835.entry.js} +1 -1
- package/dist/ketchup/p-1c44dc62.entry.js +1 -0
- package/dist/ketchup/{p-f09f2f98.entry.js → p-264b1b19.entry.js} +1 -1
- package/dist/ketchup/p-38d7584e.js +1 -0
- package/dist/ketchup/{p-f71a1675.entry.js → p-42080355.entry.js} +1 -1
- package/dist/ketchup/p-4bc9f98b.entry.js +1 -0
- package/dist/ketchup/p-578583db.entry.js +1 -0
- package/dist/ketchup/p-5866d507.entry.js +1 -0
- package/dist/ketchup/p-61059e9d.entry.js +9 -0
- package/dist/ketchup/{p-a615a92b.entry.js → p-664be494.entry.js} +1 -1
- package/dist/ketchup/{p-d2ee56dd.entry.js → p-67cd575d.entry.js} +1 -1
- package/dist/ketchup/{p-e0035c58.js → p-682a367a.js} +1 -1
- package/dist/ketchup/p-6ccf7eb2.entry.js +1 -0
- package/dist/ketchup/p-7230ab97.entry.js +1 -0
- package/dist/ketchup/p-752b4cef.entry.js +1 -0
- package/dist/ketchup/{p-954cc340.entry.js → p-7de3e7ac.entry.js} +1 -1
- package/dist/ketchup/p-928c5c36.js +1 -0
- package/dist/ketchup/{p-6dff70f8.entry.js → p-9b36497d.entry.js} +1 -1
- package/dist/ketchup/{p-99e0d768.entry.js → p-b982d137.entry.js} +1 -1
- package/dist/ketchup/{p-8cdf61a4.js → p-c0219e5e.js} +1 -1
- package/dist/ketchup/p-c55fd0a7.entry.js +1 -0
- package/dist/ketchup/p-cd5cfa7c.js +1 -0
- package/dist/ketchup/p-d154b3a0.entry.js +1 -0
- package/dist/ketchup/p-d2affb6f.entry.js +27 -0
- package/dist/ketchup/p-d3b542b3.js +2 -0
- package/dist/ketchup/{p-7454cb92.js → p-d6c12c6c.js} +1 -1
- package/dist/ketchup/p-da0eab60.entry.js +1 -0
- package/dist/ketchup/{p-7eff4eee.js → p-dc62a30f.js} +1 -1
- package/dist/ketchup/p-e9366aaf.entry.js +39 -0
- package/dist/ketchup/{p-44ec4f03.js → p-edae3076.js} +1 -1
- package/dist/ketchup/p-fc2b1229.js +30 -0
- package/dist/types/components/kup-autocomplete/kup-autocomplete.d.ts +1 -16
- package/dist/types/components/{kup-form-editor/kup-form-editor-declarations.d.ts → kup-dashboard/kup-dashboard-declarations.d.ts} +9 -27
- package/dist/types/components/{kup-form-editor/kup-form-editor.d.ts → kup-dashboard/kup-dashboard.d.ts} +12 -9
- package/dist/types/components/kup-family-tree/kup-family-tree-declarations.d.ts +33 -0
- package/dist/types/components/kup-family-tree/kup-family-tree.d.ts +61 -0
- package/dist/types/components/kup-form/kup-form-declarations.d.ts +60 -0
- package/dist/types/components/kup-form/kup-form.d.ts +63 -0
- package/dist/types/components/kup-image-list/kup-image-list-state.d.ts +6 -0
- package/dist/types/components/kup-image-list/kup-image-list.d.ts +17 -0
- package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +3 -0
- package/dist/types/components/kup-text-field/kup-text-field.d.ts +5 -0
- package/dist/types/components/kup-time-picker/kup-time-picker.d.ts +0 -6
- package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +2 -0
- package/dist/types/components.d.ts +460 -241
- package/dist/types/f-components/f-cell/f-cell-declarations.d.ts +4 -1
- package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +1 -0
- package/dist/types/managers/kup-data/kup-data-declarations.d.ts +8 -0
- package/dist/types/managers/kup-data/kup-data-node-helper.d.ts +15 -1
- package/dist/types/managers/kup-data/kup-data.d.ts +7 -1
- package/dist/types/managers/kup-language/kup-language-declarations.d.ts +11 -1
- package/dist/types/managers/kup-objects/kup-objects.d.ts +6 -0
- package/dist/types/types/GenericTypes.d.ts +3 -2
- package/package.json +2 -2
- package/dist/cjs/f-cell-69294bca.js +0 -653
- package/dist/cjs/kup-field.cjs.entry.js +0 -241
- package/dist/collection/assets/form-editor.js +0 -338
- package/dist/collection/components/kup-field/kup-field-declarations.js +0 -15
- package/dist/collection/components/kup-field/kup-field.css +0 -48
- package/dist/collection/components/kup-field/kup-field.js +0 -514
- package/dist/collection/components/kup-form-editor/kup-form-editor-declarations.js +0 -23
- package/dist/esm/kup-field.entry.js +0 -237
- package/dist/ketchup/p-1ae66cc5.js +0 -1
- package/dist/ketchup/p-34b74425.js +0 -1
- package/dist/ketchup/p-4ffbc3ff.js +0 -1
- package/dist/ketchup/p-5264a3e6.entry.js +0 -1
- package/dist/ketchup/p-65974e48.entry.js +0 -1
- package/dist/ketchup/p-65b46587.entry.js +0 -40
- package/dist/ketchup/p-80968627.entry.js +0 -1
- package/dist/ketchup/p-a0f6e25c.entry.js +0 -1
- package/dist/ketchup/p-aca0e54b.js +0 -30
- package/dist/ketchup/p-b8939a8b.entry.js +0 -1
- package/dist/ketchup/p-bfc3bac7.js +0 -1
- package/dist/ketchup/p-c5ce8951.entry.js +0 -1
- package/dist/ketchup/p-cad1e097.entry.js +0 -9
- package/dist/ketchup/p-db71436b.entry.js +0 -27
- package/dist/ketchup/p-e1039cf2.entry.js +0 -1
- package/dist/ketchup/p-ea10176c.entry.js +0 -1
- package/dist/types/components/kup-field/kup-field-declarations.d.ts +0 -25
- package/dist/types/components/kup-field/kup-field.d.ts +0 -90
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-06b131ea.js');
|
|
6
|
+
const kupManager = require('./kup-manager-02acbb37.js');
|
|
7
|
+
const utils = require('./utils-4b208b48.js');
|
|
8
|
+
const GenericVariables = require('./GenericVariables-a9ed17ee.js');
|
|
9
|
+
const fCell = require('./f-cell-3a740c48.js');
|
|
10
|
+
const fTextFieldMdc = require('./f-text-field-mdc-85997738.js');
|
|
11
|
+
require('./cell-utils-fe64a28c.js');
|
|
12
|
+
require('./f-checkbox-57443ca3.js');
|
|
13
|
+
require('./f-text-field-9ee20a67.js');
|
|
14
|
+
require('./f-image-2a61ece2.js');
|
|
15
|
+
require('./f-chip-02e83f82.js');
|
|
16
|
+
require('./tslib.es6-0ee02c67.js');
|
|
17
|
+
require('./component-72a5b626.js');
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Props of the kup-form component.
|
|
21
|
+
* Used to export every prop in an object.
|
|
22
|
+
*/
|
|
23
|
+
var KupFormProps;
|
|
24
|
+
(function (KupFormProps) {
|
|
25
|
+
KupFormProps["customStyle"] = "Custom style of the component.";
|
|
26
|
+
KupFormProps["data"] = "Actual data of the form.";
|
|
27
|
+
KupFormProps["layout"] = "How the form will arrange its content.";
|
|
28
|
+
})(KupFormProps || (KupFormProps = {}));
|
|
29
|
+
var KupFormLabelAlignment;
|
|
30
|
+
(function (KupFormLabelAlignment) {
|
|
31
|
+
KupFormLabelAlignment["CENTER"] = "center";
|
|
32
|
+
KupFormLabelAlignment["LEFT"] = "left";
|
|
33
|
+
KupFormLabelAlignment["RIGHT"] = "right";
|
|
34
|
+
})(KupFormLabelAlignment || (KupFormLabelAlignment = {}));
|
|
35
|
+
var KupFormLabelPlacement;
|
|
36
|
+
(function (KupFormLabelPlacement) {
|
|
37
|
+
KupFormLabelPlacement["BOTTOM"] = "bottom";
|
|
38
|
+
KupFormLabelPlacement["LEFT"] = "left";
|
|
39
|
+
KupFormLabelPlacement["HIDDEN"] = "hidden";
|
|
40
|
+
KupFormLabelPlacement["PLACEHOLDER"] = "placeholder";
|
|
41
|
+
KupFormLabelPlacement["RIGHT"] = "right";
|
|
42
|
+
KupFormLabelPlacement["TOP"] = "top";
|
|
43
|
+
})(KupFormLabelPlacement || (KupFormLabelPlacement = {}));
|
|
44
|
+
|
|
45
|
+
const kupFormCss = ":host{--kup_form_background_color:var(\n --kup-form-background-color,\n var(--kup-background-color)\n );--kup_form_color:var(--kup-form-color, var(--kup-text-color));--kup_form_font_family:var(--kup-form-font-family, var(--kup-font-family));--kup_form_font_size:var(--kup-form-font-size, var(--kup-font-size));--kup_form_label_alignment:var(--kup-form-label-alignment);--kup_form_label_width:var(--kup-form-label-width);display:block;font-family:var(--kup_form_font_family);font-size:var(--kup_form_font_size)}.form{background:var(--kup_form_background_color);color:var(--kup_form_color);display:flex;flex-grow:1;overflow:auto;position:relative}.form--column{flex-direction:column}.form__section{display:flex;flex:1 1 1%;flex-direction:row;flex-wrap:wrap}.form__section--column{flex-direction:column;flex-wrap:unset}.form__section--column>.form__section{flex:0 0 auto}.form__section--grid{display:grid}.form__section--titled{border:1px solid var(--kup-border-color);padding-top:5px;position:relative;margin:10px}.form__section--titled>h3{background:var(--kup-background-color);font-size:calc(var(--kup-font-size) * 1.15);position:absolute;margin:0px;padding:0 8px;top:-11px;left:5px;transition:background-color 0.25s ease}.form__section--left .form__label{width:var(--kup_form_label_width, 0)}.form__section--right .form__field{min-width:200px;width:0}.form__label{-webkit-font-smoothing:antialiased;box-sizing:border-box;font-size:0.875em;letter-spacing:0.0178571429em;white-space:nowrap;width:var(--kup_form_label_width)}.form__label--center{text-align:var(--kup_form_label_alignment, center)}.form__label--left{text-align:var(--kup_form_label_alignment, left)}.form__label--right{text-align:var(--kup_form_label_alignment, right)}.form__field{min-height:16px}.form__field img{height:auto}.form .f-cell.c-right-aligned:not(.c-centered) .f-cell__content{justify-content:flex-start}";
|
|
46
|
+
|
|
47
|
+
const dom = document.documentElement;
|
|
48
|
+
const KupForm = class {
|
|
49
|
+
constructor(hostRef) {
|
|
50
|
+
index.registerInstance(this, hostRef);
|
|
51
|
+
/*-------------------------------------------------*/
|
|
52
|
+
/* P r o p s */
|
|
53
|
+
/*-------------------------------------------------*/
|
|
54
|
+
/**
|
|
55
|
+
* Custom style of the component.
|
|
56
|
+
* @default ""
|
|
57
|
+
* @see https://ketchup.smeup.com/ketchup-showcase/#/customization
|
|
58
|
+
*/
|
|
59
|
+
this.customStyle = '';
|
|
60
|
+
/**
|
|
61
|
+
* Actual data of the form.
|
|
62
|
+
* @default null
|
|
63
|
+
*/
|
|
64
|
+
this.data = null;
|
|
65
|
+
/**
|
|
66
|
+
* How the form will arrange its content.
|
|
67
|
+
* @default null
|
|
68
|
+
*/
|
|
69
|
+
this.layout = null;
|
|
70
|
+
/*-------------------------------------------------*/
|
|
71
|
+
/* I n t e r n a l V a r i a b l e s */
|
|
72
|
+
/*-------------------------------------------------*/
|
|
73
|
+
this.kupManager = kupManager.kupManagerInstance();
|
|
74
|
+
this.visibleColumns = [];
|
|
75
|
+
}
|
|
76
|
+
/*-------------------------------------------------*/
|
|
77
|
+
/* W a t c h e r s */
|
|
78
|
+
/*-------------------------------------------------*/
|
|
79
|
+
onDataChanged() {
|
|
80
|
+
utils.identify(this.getRows());
|
|
81
|
+
this.initVisibleColumns();
|
|
82
|
+
this.checkLayout();
|
|
83
|
+
}
|
|
84
|
+
onLayoutChanged() {
|
|
85
|
+
this.checkLayout();
|
|
86
|
+
}
|
|
87
|
+
/*-------------------------------------------------*/
|
|
88
|
+
/* P u b l i c M e t h o d s */
|
|
89
|
+
/*-------------------------------------------------*/
|
|
90
|
+
/**
|
|
91
|
+
* Used to retrieve component's props values.
|
|
92
|
+
* @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
|
|
93
|
+
* @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
|
|
94
|
+
*/
|
|
95
|
+
async getProps(descriptions) {
|
|
96
|
+
return utils.getProps(this, KupFormProps, descriptions);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* This method is used to trigger a new render of the component.
|
|
100
|
+
*/
|
|
101
|
+
async refresh() {
|
|
102
|
+
index.forceUpdate(this);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Sets the focus on an editable table cell.
|
|
106
|
+
* @param {string} column - Name of the column.
|
|
107
|
+
* @param {string} rowId - Id of the row.
|
|
108
|
+
*/
|
|
109
|
+
async setFocus(column, rowId) {
|
|
110
|
+
const cells = this.rootElement.shadowRoot.querySelectorAll('td[data-column="' + column + '"]');
|
|
111
|
+
for (let index = 0; cells && index < cells.length; index++) {
|
|
112
|
+
const cell = cells[index];
|
|
113
|
+
if (cell['data-row'] && cell['data-row'].id == rowId) {
|
|
114
|
+
const input = cell.querySelector('input');
|
|
115
|
+
if (input) {
|
|
116
|
+
input.focus();
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
const kupInput = cell.querySelector('.hydrated');
|
|
120
|
+
if (kupInput) {
|
|
121
|
+
try {
|
|
122
|
+
kupInput.setFocus();
|
|
123
|
+
}
|
|
124
|
+
catch (error) { }
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Sets the props to the component.
|
|
132
|
+
* @param {GenericObject} props - Object containing props that will be set to the component.
|
|
133
|
+
*/
|
|
134
|
+
async setProps(props) {
|
|
135
|
+
utils.setProps(this, KupFormProps, props);
|
|
136
|
+
}
|
|
137
|
+
/*-------------------------------------------------*/
|
|
138
|
+
/* P r i v a t e M e t h o d s */
|
|
139
|
+
/*-------------------------------------------------*/
|
|
140
|
+
getColumns() {
|
|
141
|
+
return this.data && this.data.columns
|
|
142
|
+
? this.data.columns
|
|
143
|
+
: [{ title: '', name: '', size: undefined }];
|
|
144
|
+
}
|
|
145
|
+
initVisibleColumns() {
|
|
146
|
+
this.visibleColumns = this.getColumns().filter((column) => {
|
|
147
|
+
if (column.hasOwnProperty('visible')) {
|
|
148
|
+
return column.visible;
|
|
149
|
+
}
|
|
150
|
+
return true;
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
getRows() {
|
|
154
|
+
return this.data && this.data.rows ? this.data.rows : [];
|
|
155
|
+
}
|
|
156
|
+
checkLayout() {
|
|
157
|
+
if (this.layout) {
|
|
158
|
+
this.formLayout = this.layout;
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const section = {
|
|
162
|
+
horizontal: false,
|
|
163
|
+
sections: [],
|
|
164
|
+
};
|
|
165
|
+
const visibleColumns = this.visibleColumns;
|
|
166
|
+
let size = visibleColumns.length;
|
|
167
|
+
const content = [];
|
|
168
|
+
let cnt = 0;
|
|
169
|
+
while (size-- > 0) {
|
|
170
|
+
content.push({
|
|
171
|
+
column: visibleColumns[cnt++].name,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
section.content = content;
|
|
175
|
+
this.formLayout = {
|
|
176
|
+
sections: [section],
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
renderRow(row) {
|
|
180
|
+
const visibleColumns = [...this.visibleColumns];
|
|
181
|
+
let formContent = null;
|
|
182
|
+
let rowLayout = row.layout;
|
|
183
|
+
if (!rowLayout) {
|
|
184
|
+
rowLayout = this.formLayout;
|
|
185
|
+
}
|
|
186
|
+
let horizontal = false;
|
|
187
|
+
if (rowLayout) {
|
|
188
|
+
if (rowLayout.horizontal) {
|
|
189
|
+
horizontal = true;
|
|
190
|
+
}
|
|
191
|
+
const sections = rowLayout.sections;
|
|
192
|
+
let size = sections.length;
|
|
193
|
+
let cnt = 0;
|
|
194
|
+
if (size > 0) {
|
|
195
|
+
formContent = [];
|
|
196
|
+
}
|
|
197
|
+
const parent = {
|
|
198
|
+
horizontal: horizontal,
|
|
199
|
+
};
|
|
200
|
+
while (size-- > 0) {
|
|
201
|
+
formContent.push(this.renderSection(sections[cnt++], parent, row, visibleColumns));
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
const classObj = {
|
|
205
|
+
form: true,
|
|
206
|
+
'form--column': !horizontal,
|
|
207
|
+
};
|
|
208
|
+
return index.h("form", { class: classObj }, formContent);
|
|
209
|
+
}
|
|
210
|
+
renderSection(section, parent, row, visibleColumns) {
|
|
211
|
+
var _a;
|
|
212
|
+
let sectionContent = null;
|
|
213
|
+
if (section.sections && section.sections.length > 0) {
|
|
214
|
+
const sections = section.sections;
|
|
215
|
+
let size = sections.length;
|
|
216
|
+
let cnt = 0;
|
|
217
|
+
if (size > 0) {
|
|
218
|
+
sectionContent = [];
|
|
219
|
+
}
|
|
220
|
+
while (size-- > 0) {
|
|
221
|
+
sectionContent.push(this.renderSection(sections[cnt++], section, row, visibleColumns));
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
else if (section.content) {
|
|
225
|
+
const content = section.content;
|
|
226
|
+
let size = content.length;
|
|
227
|
+
let cnt = 0;
|
|
228
|
+
if (size > 0) {
|
|
229
|
+
sectionContent = [];
|
|
230
|
+
}
|
|
231
|
+
while (size-- > 0) {
|
|
232
|
+
const formField = this.renderFormField({
|
|
233
|
+
formField: content[cnt++],
|
|
234
|
+
row,
|
|
235
|
+
visibleColumns,
|
|
236
|
+
}, section);
|
|
237
|
+
let field = formField;
|
|
238
|
+
if (!section.horizontal) {
|
|
239
|
+
field = index.h("tr", null, formField);
|
|
240
|
+
}
|
|
241
|
+
sectionContent.push(field);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
else if (visibleColumns.length > 0) {
|
|
245
|
+
const column = visibleColumns[0];
|
|
246
|
+
sectionContent = this.renderFormField({
|
|
247
|
+
formField: { column: column.name },
|
|
248
|
+
row,
|
|
249
|
+
visibleColumns,
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
const isGrid = !!section.columns;
|
|
253
|
+
const labelPlacement = ((_a = section === null || section === void 0 ? void 0 : section.label) === null || _a === void 0 ? void 0 : _a.placement) || KupFormLabelPlacement.LEFT;
|
|
254
|
+
const sectionClass = {
|
|
255
|
+
form__section: true,
|
|
256
|
+
'form__section--column': !isGrid && !section.horizontal,
|
|
257
|
+
'form__section--grid': isGrid,
|
|
258
|
+
'form__section--titled': !!section.title,
|
|
259
|
+
'form__section--last': !section.sections || section.sections.length === 0,
|
|
260
|
+
[`form__section--${labelPlacement}`]: true,
|
|
261
|
+
};
|
|
262
|
+
const sectionStyle = section.style || {};
|
|
263
|
+
if (section.dim && parent) {
|
|
264
|
+
sectionStyle.flex = `0 0 ${section.dim}`;
|
|
265
|
+
if (parent.horizontal) {
|
|
266
|
+
sectionStyle.maxWidth = section.dim;
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
sectionStyle.maxHeight = section.dim;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
if (isGrid) {
|
|
273
|
+
sectionStyle['grid-template-columns'] = `repeat(${section.columns}, 1fr)`;
|
|
274
|
+
}
|
|
275
|
+
return (index.h("div", { class: sectionClass, style: sectionStyle }, section.title ? index.h("h3", null, section.title) : null, index.h("table", null, index.h("tbody", null, section.horizontal ? (index.h("tr", null, sectionContent)) : (sectionContent)))));
|
|
276
|
+
}
|
|
277
|
+
renderFormField({ formField, row, visibleColumns, }, section) {
|
|
278
|
+
var _a;
|
|
279
|
+
const classObj = {
|
|
280
|
+
form__field: true,
|
|
281
|
+
};
|
|
282
|
+
const styleObj = {};
|
|
283
|
+
let column = null;
|
|
284
|
+
let index$1 = -1;
|
|
285
|
+
for (let i = 0; i < visibleColumns.length; i++) {
|
|
286
|
+
const c = visibleColumns[i];
|
|
287
|
+
if (c.name === formField.column) {
|
|
288
|
+
index$1 = i;
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
if (index$1 >= 0) {
|
|
293
|
+
column = visibleColumns[index$1];
|
|
294
|
+
visibleColumns.splice(index$1, 1);
|
|
295
|
+
}
|
|
296
|
+
else if (section) {
|
|
297
|
+
column = this.data.columns.find((x) => x.name === formField.column);
|
|
298
|
+
}
|
|
299
|
+
const cell = row.cells[formField.column];
|
|
300
|
+
let title = undefined;
|
|
301
|
+
if (cell) {
|
|
302
|
+
cell.isEditable = true;
|
|
303
|
+
if (!this.kupManager.objects.isEmptyKupObj(cell.obj)) {
|
|
304
|
+
if (this.kupManager.debug.isDebug()) {
|
|
305
|
+
title =
|
|
306
|
+
cell.obj.t +
|
|
307
|
+
'; ' +
|
|
308
|
+
cell.obj.p +
|
|
309
|
+
'; ' +
|
|
310
|
+
cell.obj.k +
|
|
311
|
+
';';
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
return null;
|
|
317
|
+
}
|
|
318
|
+
const cellProps = {
|
|
319
|
+
cell: formField.data ? Object.assign(Object.assign({}, cell), { data: formField.data }) : cell,
|
|
320
|
+
column: column,
|
|
321
|
+
component: this,
|
|
322
|
+
editable: true,
|
|
323
|
+
renderKup: true,
|
|
324
|
+
row: row,
|
|
325
|
+
setSizes: true,
|
|
326
|
+
shape: formField.shape,
|
|
327
|
+
};
|
|
328
|
+
const label = formField.label || column.title;
|
|
329
|
+
resetLabel();
|
|
330
|
+
switch ((_a = section.label) === null || _a === void 0 ? void 0 : _a.placement) {
|
|
331
|
+
case KupFormLabelPlacement.BOTTOM:
|
|
332
|
+
return [index.h("tr", null, fieldCell()), index.h("tr", null, labelCell(label))];
|
|
333
|
+
case KupFormLabelPlacement.PLACEHOLDER:
|
|
334
|
+
setPlaceholderLabel();
|
|
335
|
+
case KupFormLabelPlacement.HIDDEN: {
|
|
336
|
+
if (section) {
|
|
337
|
+
return [fieldCell()];
|
|
338
|
+
}
|
|
339
|
+
else {
|
|
340
|
+
return [index.h("tr", null, fieldCell())];
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
case KupFormLabelPlacement.RIGHT: {
|
|
344
|
+
if (section) {
|
|
345
|
+
return [fieldCell(), labelCell(label)];
|
|
346
|
+
}
|
|
347
|
+
else {
|
|
348
|
+
return [
|
|
349
|
+
index.h("tr", null, fieldCell(), labelCell(label)),
|
|
350
|
+
];
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
case KupFormLabelPlacement.TOP:
|
|
354
|
+
return [index.h("tr", null, labelCell(label)), index.h("tr", null, fieldCell())];
|
|
355
|
+
default: {
|
|
356
|
+
if (section) {
|
|
357
|
+
return [labelCell(label), fieldCell()];
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
return [
|
|
361
|
+
index.h("tr", null, labelCell(label), fieldCell()),
|
|
362
|
+
];
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
function fieldCell() {
|
|
367
|
+
return (index.h("td", { "data-cell": cell, "data-row": row, "data-column": formField.column, class: classObj, style: styleObj, title: title }, cell && column ? (index.h(fCell.FCell, Object.assign({}, cellProps))) : (index.h("span", null, formField.value))));
|
|
368
|
+
}
|
|
369
|
+
function labelCell(label) {
|
|
370
|
+
var _a, _b, _c;
|
|
371
|
+
const alignment = ((_a = section === null || section === void 0 ? void 0 : section.label) === null || _a === void 0 ? void 0 : _a.alignment) || KupFormLabelAlignment.LEFT;
|
|
372
|
+
const style = {
|
|
373
|
+
width: ((_b = section === null || section === void 0 ? void 0 : section.label) === null || _b === void 0 ? void 0 : _b.width) ? (_c = section === null || section === void 0 ? void 0 : section.label) === null || _c === void 0 ? void 0 : _c.width : '',
|
|
374
|
+
};
|
|
375
|
+
return (index.h("td", { class: `form__label form__label--${alignment}`, style: style }, index.h("span", null, label)));
|
|
376
|
+
}
|
|
377
|
+
function resetLabel() {
|
|
378
|
+
if (!cell.data) {
|
|
379
|
+
cell.data = {};
|
|
380
|
+
}
|
|
381
|
+
try {
|
|
382
|
+
delete cell.data.label;
|
|
383
|
+
}
|
|
384
|
+
catch (_a) { }
|
|
385
|
+
try {
|
|
386
|
+
delete cell.data.data['kup-text-field'].label;
|
|
387
|
+
}
|
|
388
|
+
catch (_b) { }
|
|
389
|
+
}
|
|
390
|
+
function setPlaceholderLabel() {
|
|
391
|
+
switch (dom.ketchup.data.cell.getType(cell, cell.shape || column.shape || null)) {
|
|
392
|
+
case kupManager.FCellTypes.AUTOCOMPLETE:
|
|
393
|
+
case kupManager.FCellTypes.COLOR_PICKER:
|
|
394
|
+
case kupManager.FCellTypes.COMBOBOX:
|
|
395
|
+
case kupManager.FCellTypes.DATE:
|
|
396
|
+
case kupManager.FCellTypes.DATETIME:
|
|
397
|
+
case kupManager.FCellTypes.TIME:
|
|
398
|
+
if (cell.data.data) {
|
|
399
|
+
if (cell.data.data['kup-text-field']) {
|
|
400
|
+
cell.data.data['kup-text-field'].label =
|
|
401
|
+
column.title;
|
|
402
|
+
}
|
|
403
|
+
else {
|
|
404
|
+
cell.data.data = {
|
|
405
|
+
'kup-text-field': {
|
|
406
|
+
label: column.title,
|
|
407
|
+
},
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
else {
|
|
412
|
+
cell.data.data = {
|
|
413
|
+
'kup-text-field': {
|
|
414
|
+
label: column.title,
|
|
415
|
+
},
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
break;
|
|
419
|
+
case kupManager.FCellTypes.CHECKBOX:
|
|
420
|
+
case kupManager.FCellTypes.NUMBER:
|
|
421
|
+
case kupManager.FCellTypes.STRING:
|
|
422
|
+
case kupManager.FCellTypes.SWITCH:
|
|
423
|
+
cell.data.label = column.title;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
/*-------------------------------------------------*/
|
|
428
|
+
/* L i f e c y c l e H o o k s */
|
|
429
|
+
/*-------------------------------------------------*/
|
|
430
|
+
componentWillLoad() {
|
|
431
|
+
this.kupManager.debug.logLoad(this, false);
|
|
432
|
+
this.kupManager.language.register(this);
|
|
433
|
+
this.kupManager.theme.register(this);
|
|
434
|
+
this.onDataChanged();
|
|
435
|
+
}
|
|
436
|
+
componentDidLoad() {
|
|
437
|
+
this.kupManager.debug.logLoad(this, true);
|
|
438
|
+
}
|
|
439
|
+
componentWillRender() {
|
|
440
|
+
this.kupManager.debug.logRender(this, false);
|
|
441
|
+
}
|
|
442
|
+
componentDidRender() {
|
|
443
|
+
const root = this.rootElement.shadowRoot;
|
|
444
|
+
if (root) {
|
|
445
|
+
const fs = root.querySelectorAll('.f-text-field');
|
|
446
|
+
for (let index = 0; index < fs.length; index++) {
|
|
447
|
+
fTextFieldMdc.FTextFieldMDC(fs[index]);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
this.kupManager.debug.logRender(this, true);
|
|
451
|
+
}
|
|
452
|
+
render() {
|
|
453
|
+
let formContent = null;
|
|
454
|
+
if (this.data.rows.length === 0) {
|
|
455
|
+
formContent = (index.h("p", null, this.kupManager.language.translate(kupManager.KupLanguageGeneric.EMPTY_DATA)));
|
|
456
|
+
}
|
|
457
|
+
else {
|
|
458
|
+
const rows = this.data.rows;
|
|
459
|
+
let size = rows.length;
|
|
460
|
+
let cnt = 0;
|
|
461
|
+
formContent = [];
|
|
462
|
+
while (size-- > 0) {
|
|
463
|
+
formContent.push(this.renderRow(rows[cnt++]));
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
return (index.h(index.Host, null, index.h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)), index.h("div", { id: GenericVariables.componentWrapperId }, formContent)));
|
|
467
|
+
}
|
|
468
|
+
disconnectedCallback() {
|
|
469
|
+
this.kupManager.language.unregister(this);
|
|
470
|
+
this.kupManager.theme.unregister(this);
|
|
471
|
+
}
|
|
472
|
+
get rootElement() { return index.getElement(this); }
|
|
473
|
+
static get watchers() { return {
|
|
474
|
+
"data": ["onDataChanged"],
|
|
475
|
+
"layout": ["onLayoutChanged"]
|
|
476
|
+
}; }
|
|
477
|
+
};
|
|
478
|
+
KupForm.style = kupFormCss;
|
|
479
|
+
|
|
480
|
+
exports.kup_form = KupForm;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const kupManager = require('./kup-manager-
|
|
7
|
-
const utils = require('./utils-
|
|
5
|
+
const index = require('./index-06b131ea.js');
|
|
6
|
+
const kupManager = require('./kup-manager-02acbb37.js');
|
|
7
|
+
const utils = require('./utils-4b208b48.js');
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Props of the kup-iframe component.
|
|
@@ -2,18 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const kupManager = require('./kup-manager-
|
|
7
|
-
const utils = require('./utils-
|
|
5
|
+
const index = require('./index-06b131ea.js');
|
|
6
|
+
const kupManager = require('./kup-manager-02acbb37.js');
|
|
7
|
+
const utils = require('./utils-4b208b48.js');
|
|
8
8
|
const GenericVariables = require('./GenericVariables-a9ed17ee.js');
|
|
9
|
-
const fImage = require('./f-image-
|
|
10
|
-
const fButton = require('./f-button-
|
|
9
|
+
const fImage = require('./f-image-2a61ece2.js');
|
|
10
|
+
const fButton = require('./f-button-5b69d882.js');
|
|
11
11
|
const fButtonDeclarations = require('./f-button-declarations-b611587f.js');
|
|
12
|
-
const fCell = require('./f-cell-
|
|
12
|
+
const fCell = require('./f-cell-3a740c48.js');
|
|
13
13
|
const component = require('./component-72a5b626.js');
|
|
14
|
-
require('./cell-utils-
|
|
15
|
-
require('./f-
|
|
16
|
-
require('./f-
|
|
14
|
+
require('./cell-utils-fe64a28c.js');
|
|
15
|
+
require('./f-checkbox-57443ca3.js');
|
|
16
|
+
require('./f-text-field-9ee20a67.js');
|
|
17
|
+
require('./f-chip-02e83f82.js');
|
|
17
18
|
require('./tslib.es6-0ee02c67.js');
|
|
18
19
|
|
|
19
20
|
/**
|
|
@@ -27,7 +28,17 @@ var KupImageListProps;
|
|
|
27
28
|
KupImageListProps["ripple"] = "When enabled displays Material's ripple effect on clicked items.";
|
|
28
29
|
})(KupImageListProps || (KupImageListProps = {}));
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
class KupImageListState {
|
|
32
|
+
constructor() {
|
|
33
|
+
this.load = false;
|
|
34
|
+
}
|
|
35
|
+
toDebugString() {
|
|
36
|
+
// TODO
|
|
37
|
+
return 'image-list state';
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
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__back,.navigation-bar__top{--kup-button-primary-color-rgb:0}.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}";
|
|
31
42
|
|
|
32
43
|
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
33
44
|
if (kind === "a" && !f)
|
|
@@ -56,6 +67,7 @@ const KupImageList = class {
|
|
|
56
67
|
/*-------------------------------------------------*/
|
|
57
68
|
/* S t a t e s */
|
|
58
69
|
/*-------------------------------------------------*/
|
|
70
|
+
this.state = new KupImageListState();
|
|
59
71
|
this.currentNode = null;
|
|
60
72
|
this.navigationBarToggled = false;
|
|
61
73
|
/*-------------------------------------------------*/
|
|
@@ -77,9 +89,18 @@ const KupImageList = class {
|
|
|
77
89
|
* @default true
|
|
78
90
|
*/
|
|
79
91
|
this.ripple = true;
|
|
92
|
+
/**
|
|
93
|
+
* An array of integers containing the path to a selected child.\
|
|
94
|
+
*/
|
|
95
|
+
this.selectedNode = [];
|
|
96
|
+
this.stateId = '';
|
|
80
97
|
/*-------------------------------------------------*/
|
|
81
98
|
/* I n t e r n a l V a r i a b l e s */
|
|
82
99
|
/*-------------------------------------------------*/
|
|
100
|
+
/**
|
|
101
|
+
* Instance of the KupManager class.
|
|
102
|
+
*/
|
|
103
|
+
this.kupManager = kupManager.kupManagerInstance();
|
|
83
104
|
_KupImageList_clickTimeout.set(this, []);
|
|
84
105
|
_KupImageList_kupManager.set(this, kupManager.kupManagerInstance());
|
|
85
106
|
_KupImageList_backProps.set(this, {
|
|
@@ -103,6 +124,32 @@ const KupImageList = class {
|
|
|
103
124
|
wrapperClass: 'navigation-bar__top',
|
|
104
125
|
});
|
|
105
126
|
}
|
|
127
|
+
initWithPersistedState() {
|
|
128
|
+
if (this.store && this.stateId) {
|
|
129
|
+
const state = this.store.getState(this.stateId);
|
|
130
|
+
if (state != null) {
|
|
131
|
+
this.currentNode =
|
|
132
|
+
this.kupManager.data.node.findByStrTreeNodePath(this.data, state.selectedTreeNodePath);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
persistState() {
|
|
137
|
+
if (this.store && this.stateId) {
|
|
138
|
+
let somethingChanged = false;
|
|
139
|
+
let cNodeRowId = this.currentNode ? this.currentNode.id : '';
|
|
140
|
+
if (!this.kupManager.objects.deepEqual(this.state.selectedTreeNodePath, cNodeRowId)) {
|
|
141
|
+
this.state.selectedTreeNodePath = cNodeRowId;
|
|
142
|
+
somethingChanged = true;
|
|
143
|
+
}
|
|
144
|
+
if (!this.state.load) {
|
|
145
|
+
this.state.load = true;
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if (somethingChanged) {
|
|
149
|
+
this.store.persistState(this.stateId, this.state);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
106
153
|
onKupClick(node) {
|
|
107
154
|
if (node.children && node.children.length > 0) {
|
|
108
155
|
this.currentNode = node;
|
|
@@ -133,6 +180,15 @@ const KupImageList = class {
|
|
|
133
180
|
});
|
|
134
181
|
}
|
|
135
182
|
/*-------------------------------------------------*/
|
|
183
|
+
/* W a t c h e r s */
|
|
184
|
+
/*-------------------------------------------------*/
|
|
185
|
+
selectNode(newData) {
|
|
186
|
+
if (!newData || newData.length == 0) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
this.currentNode = this.kupManager.data.node.find(this.data, newData);
|
|
190
|
+
}
|
|
191
|
+
/*-------------------------------------------------*/
|
|
136
192
|
/* P u b l i c M e t h o d s */
|
|
137
193
|
/*-------------------------------------------------*/
|
|
138
194
|
/**
|
|
@@ -180,6 +236,9 @@ const KupImageList = class {
|
|
|
180
236
|
}
|
|
181
237
|
}
|
|
182
238
|
}
|
|
239
|
+
// *** Store
|
|
240
|
+
this.persistState();
|
|
241
|
+
// ***
|
|
183
242
|
__classPrivateFieldGet(this, _KupImageList_kupManager, "f").debug.logRender(this, true);
|
|
184
243
|
}
|
|
185
244
|
render() {
|
|
@@ -196,6 +255,9 @@ const KupImageList = class {
|
|
|
196
255
|
__classPrivateFieldGet(this, _KupImageList_kupManager, "f").theme.unregister(this);
|
|
197
256
|
}
|
|
198
257
|
get rootElement() { return index.getElement(this); }
|
|
258
|
+
static get watchers() { return {
|
|
259
|
+
"selectedNode": ["selectNode"]
|
|
260
|
+
}; }
|
|
199
261
|
};
|
|
200
262
|
_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) {
|
|
201
263
|
const props = {
|
|
@@ -206,7 +268,7 @@ _KupImageList_clickTimeout = new WeakMap(), _KupImageList_kupManager = new WeakM
|
|
|
206
268
|
};
|
|
207
269
|
const image = index.h(fImage.FImage, Object.assign({}, props));
|
|
208
270
|
const label = index.h("div", { class: "image-list__label" }, node.value);
|
|
209
|
-
return (index.h(fCell.FCell, { cell: { value: node.value, icon: node.icon, obj: node.obj }, column: { name: 'IMAGE', title: 'Image' }, density:
|
|
271
|
+
return (index.h(fCell.FCell, { cell: { value: node.value, icon: node.icon, obj: node.obj }, column: { name: 'IMAGE', title: 'Image' }, density: kupManager.FCellPadding.NONE, row: Object.assign({}, node) }, index.h("div", { class: "image-list__wrapper" }, image, label)));
|
|
210
272
|
}, _KupImageList_createList = function _KupImageList_createList() {
|
|
211
273
|
const nodes = [];
|
|
212
274
|
const items = this.currentNode ? this.currentNode.children : this.data;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const kupManager = require('./kup-manager-
|
|
7
|
-
const utils = require('./utils-
|
|
5
|
+
const index = require('./index-06b131ea.js');
|
|
6
|
+
const kupManager = require('./kup-manager-02acbb37.js');
|
|
7
|
+
const utils = require('./utils-4b208b48.js');
|
|
8
8
|
const GenericVariables = require('./GenericVariables-a9ed17ee.js');
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -28,7 +28,7 @@ var KupLazyRender;
|
|
|
28
28
|
KupLazyRender["BOTH"] = "both";
|
|
29
29
|
})(KupLazyRender || (KupLazyRender = {}));
|
|
30
30
|
|
|
31
|
-
const kupLazyCss = ":host{--
|
|
31
|
+
const kupLazyCss = ":host{--kup_lazy_animation_time:var(--kup-lazy-animation-time, 2s);--kup_lazy_hor_alignment:var(--kup-lazy-hor-alignment, center);--kup_lazy_placeholder_color:var(\n --kup-lazy-placeholder-color,\n var(--kup-icon-color)\n );--kup_lazy_ver_alignment:var(--kup-lazy-ver-alignment, center);--kup_lazy_width:var(--kup-lazy-width, 100%);display:block;height:100%;width:var(--kup_lazy_width);position:relative}#kup-component{align-items:var(--kup_lazy_ver_alignment);display:flex;justify-content:var(--kup_lazy_hor_alignment);height:100%;width:var(--kup_lazy_width)}#kup-component kup-data-table{min-width:100%}.kup-loaded,.kup-to-be-loaded{width:var(--kup_lazy_width)}svg{fill:var(--kup_lazy_placeholder_color);animation:shine ease var(--kup_lazy_animation_time) infinite}@keyframes shine{0%{opacity:0.4}50%{opacity:0.8}100%{opacity:0.4}}:host(.kup-bottom-aligned){--kup-lazy-ver-alignment:flex-end}:host(.kup-left-aligned){--kup-lazy-hor-alignment:flex-start}:host(.kup-right-aligned){--kup-lazy-hor-alignment:flex-end}:host(.kup-top-aligned){--kup-lazy-ver-alignment:flex-start}:host(.kup-to-be-loaded) #kup-component{position:absolute}:host(.kup-to-be-loaded) #kup-component>*{margin:auto}";
|
|
32
32
|
|
|
33
33
|
const KupLazy = class {
|
|
34
34
|
constructor(hostRef) {
|