@sme.up/ketchup 5.2.1-SNAPSHOT → 6.2.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/CHANGELOG.md +5 -0
- package/dist/cjs/{cell-utils-d96b2993.js → cell-utils-d894e802.js} +2 -2
- package/dist/cjs/{component-d1496215.js → component-72a5b626.js} +30 -0
- package/dist/cjs/{f-button-2b9b99b1.js → f-button-414b3bc3.js} +4 -4
- package/dist/cjs/f-cell-c8983ec7.js +418 -0
- package/dist/cjs/f-checkbox-57443ca3.js +29 -0
- package/dist/cjs/{f-chip-df59e1b0.js → f-chip-ef81bf51.js} +5 -4
- package/dist/cjs/{f-image-12bab3b5.js → f-image-0618c795.js} +2 -2
- package/dist/cjs/f-paginator-utils-c9dd5173.js +1898 -0
- package/dist/cjs/{f-text-field-e7c35b5b.js → f-text-field-7d31190f.js} +3 -3
- package/dist/cjs/{f-text-field-mdc-a67f5dfe.js → f-text-field-mdc-85997738.js} +23 -305
- 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 +5 -5
- package/dist/cjs/{kup-autocomplete_27.cjs.entry.js → kup-autocomplete_25.cjs.entry.js} +1833 -5745
- package/dist/cjs/{kup-echart.cjs.entry.js → kup-box_2.cjs.entry.js} +17113 -14788
- package/dist/cjs/kup-calendar.cjs.entry.js +42 -34
- 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-dashboard.cjs.entry.js +379 -0
- 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.cjs.entry.js +469 -0
- package/dist/cjs/kup-iframe.cjs.entry.js +3 -3
- package/dist/cjs/kup-image-list.cjs.entry.js +229 -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-2fee8cf3.js +17021 -0
- package/dist/cjs/kup-nav-bar.cjs.entry.js +3 -3
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +5 -5
- package/dist/cjs/kup-photo-frame.cjs.entry.js +7 -9
- 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-e99921c1.js → utils-8470184d.js} +1 -1
- package/dist/collection/assets/card.js +4 -5
- package/dist/collection/assets/dashboard.js +113 -0
- package/dist/collection/assets/data-table.js +15 -79
- package/dist/collection/assets/form.js +179 -0
- package/dist/collection/assets/grid.js +17 -0
- package/dist/collection/assets/image-list.js +624 -0
- package/dist/collection/assets/index.js +16 -4
- package/dist/collection/assets/kupdata.js +0 -3
- package/dist/collection/assets/kuptooltip.js +53 -7
- 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 +136 -130
- package/dist/collection/components/kup-box/kup-box-declarations.js +0 -4
- package/dist/collection/components/kup-box/kup-box.js +20 -137
- 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/kup-card.css +26 -8
- package/dist/collection/components/kup-card/kup-card.js +1 -2
- package/dist/collection/components/kup-card/standard/kup-card-standard.js +14 -6
- package/dist/collection/components/kup-combobox/kup-combobox.js +17 -14
- package/dist/collection/components/kup-dashboard/kup-dashboard-declarations.js +10 -0
- package/dist/collection/components/kup-dashboard/kup-dashboard.css +81 -0
- package/dist/collection/components/kup-dashboard/kup-dashboard.js +560 -0
- 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 +19 -136
- package/dist/collection/components/kup-drawer/kup-drawer.css +6 -8
- package/dist/collection/components/kup-drawer/kup-drawer.js +8 -1
- package/dist/collection/components/kup-form/kup-form-declarations.js +19 -0
- package/dist/collection/components/kup-form/kup-form.css +86 -0
- package/dist/collection/components/kup-form/kup-form.js +668 -0
- package/dist/collection/components/kup-grid/kup-grid.js +1 -4
- 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-list/kup-list-helper.js +9 -3
- package/dist/collection/components/kup-photo-frame/kup-photo-frame.css +2 -9
- package/dist/collection/components/kup-photo-frame/kup-photo-frame.js +3 -5
- 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-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 +2 -8
- 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 +73 -142
- 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 +41 -121
- package/dist/collection/f-components/f-chip/f-chip.js +2 -1
- 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 +24 -0
- package/dist/collection/managers/kup-data/kup-data.js +98 -1
- 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 +13 -0
- package/dist/collection/managers/kup-manager/kup-manager.js +21 -2
- package/dist/collection/managers/kup-objects/kup-objects.js +10 -0
- package/dist/collection/managers/kup-theme/kup-theme-declarations.js +21 -1
- package/dist/collection/managers/kup-tooltip/kup-tooltip.js +53 -20
- package/dist/collection/types/GenericTypes.js +3 -0
- package/dist/collection/utils/kup-column-menu/kup-column-menu.js +7 -11
- package/dist/esm/{cell-utils-f4bdbbc8.js → cell-utils-7fc84d4e.js} +3 -3
- package/dist/esm/{component-c4eb6153.js → component-b1bedf1d.js} +27 -2
- package/dist/esm/{f-button-54a49fd8.js → f-button-2f6cc296.js} +4 -4
- package/dist/esm/f-cell-4428481c.js +415 -0
- package/dist/esm/f-checkbox-c51c4a75.js +27 -0
- package/dist/esm/{f-chip-a3035b4b.js → f-chip-b39eb49a.js} +6 -5
- package/dist/esm/{f-image-d32465e3.js → f-image-b08ebeb2.js} +2 -2
- package/dist/esm/f-paginator-utils-4fda6086.js +1884 -0
- package/dist/esm/{f-text-field-c25cc63f.js → f-text-field-184a5fb3.js} +3 -3
- package/dist/esm/{f-text-field-mdc-9fbbefc3.js → f-text-field-mdc-d42d3f9e.js} +2 -284
- 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 +6 -6
- package/dist/esm/{kup-autocomplete_27.entry.js → kup-autocomplete_25.entry.js} +1775 -5685
- package/dist/esm/{kup-echart.entry.js → kup-box_2.entry.js} +17113 -14789
- package/dist/esm/kup-calendar.entry.js +43 -35
- 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-dashboard.entry.js +375 -0
- package/dist/esm/kup-drawer.entry.js +12 -5
- package/dist/esm/kup-field.entry.js +2 -2
- package/dist/esm/kup-form.entry.js +465 -0
- package/dist/esm/kup-iframe.entry.js +3 -3
- package/dist/esm/kup-image-list.entry.js +225 -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-3325b2d8.js +17000 -0
- package/dist/esm/kup-nav-bar.entry.js +3 -3
- package/dist/esm/kup-numeric-picker.entry.js +6 -6
- package/dist/esm/kup-photo-frame.entry.js +7 -9
- 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-f24319a0.js → utils-6373a07e.js} +2 -2
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/p-006bc4d0.entry.js +1 -0
- package/dist/ketchup/p-0741da57.js +1 -0
- package/dist/ketchup/{p-669bde31.js → p-13e08580.js} +1 -1
- package/dist/ketchup/p-153697fb.entry.js +1 -0
- package/dist/ketchup/{p-9a61d8dc.entry.js → p-175edb62.entry.js} +1 -1
- package/dist/ketchup/{p-11e72a8c.entry.js → p-1db1d42b.entry.js} +1 -1
- package/dist/ketchup/{p-67842f1e.entry.js → p-30820f8f.entry.js} +1 -1
- package/dist/ketchup/p-35325834.entry.js +9 -0
- package/dist/ketchup/p-359e8bec.entry.js +40 -0
- package/dist/ketchup/{p-09d708c4.entry.js → p-3c7c92c0.entry.js} +1 -1
- package/dist/ketchup/p-41cf8703.entry.js +1 -0
- package/dist/ketchup/{p-e6709c26.entry.js → p-6127fccf.entry.js} +1 -1
- package/dist/ketchup/{p-203d6295.entry.js → p-6b82e4e2.entry.js} +1 -1
- package/dist/ketchup/p-704e60eb.js +30 -0
- package/dist/ketchup/{p-4f56932b.js → p-70660fe2.js} +1 -1
- package/dist/ketchup/{p-44192f30.entry.js → p-762c0382.entry.js} +1 -1
- package/dist/ketchup/{p-c58a2a81.entry.js → p-76947316.entry.js} +1 -1
- package/dist/ketchup/{p-a0b1d769.js → p-79b0730b.js} +1 -1
- package/dist/ketchup/{p-bb8844bf.entry.js → p-8103b80a.entry.js} +1 -1
- package/dist/ketchup/{p-8c44c3b9.js → p-81605f08.js} +4 -5
- package/dist/ketchup/p-9fa457d4.entry.js +1 -0
- package/dist/ketchup/{p-e8e3c9da.entry.js → p-a0ce8075.entry.js} +1 -1
- package/dist/ketchup/p-a203f78b.js +45 -0
- package/dist/ketchup/p-a804fe83.entry.js +27 -0
- package/dist/ketchup/{p-34748c91.js → p-ca9fd099.js} +1 -1
- package/dist/ketchup/p-caabb9ab.entry.js +1 -0
- package/dist/ketchup/p-cc3abf84.entry.js +1 -0
- package/dist/ketchup/p-cd5cfa7c.js +1 -0
- package/dist/ketchup/p-d2e76960.entry.js +1 -0
- package/dist/ketchup/p-d3b542b3.js +2 -0
- package/dist/ketchup/p-d7004ae4.js +1 -0
- package/dist/ketchup/{p-40f97429.js → p-d95c904b.js} +1 -1
- package/dist/ketchup/p-ddce3430.js +1 -0
- package/dist/ketchup/p-ee580b3a.entry.js +1 -0
- package/dist/ketchup/p-f49cb68e.js +1 -0
- package/dist/types/components/kup-autocomplete/kup-autocomplete.d.ts +1 -16
- 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-dashboard/kup-dashboard-declarations.d.ts +61 -0
- package/dist/types/components/kup-dashboard/kup-dashboard.d.ts +75 -0
- package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +2 -4
- package/dist/types/components/kup-data-table/kup-data-table.d.ts +1 -19
- package/dist/types/components/kup-form/kup-form-declarations.d.ts +48 -0
- package/dist/types/components/kup-form/kup-form.d.ts +68 -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-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-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 +3 -5
- package/dist/types/components/kup-tree/kup-tree.d.ts +1 -24
- package/dist/types/components.d.ts +512 -369
- 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 +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 +3 -0
- package/dist/types/managers/kup-language/kup-language-declarations.d.ts +13 -1
- package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +4 -0
- package/dist/types/managers/kup-manager/kup-manager.d.ts +12 -0
- package/dist/types/managers/kup-objects/kup-objects.d.ts +6 -0
- package/dist/types/managers/kup-tooltip/kup-tooltip-declarations.d.ts +3 -3
- package/dist/types/managers/kup-tooltip/kup-tooltip.d.ts +17 -6
- 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 +15 -14
- package/dist/cjs/f-cell-8351cb84.js +0 -653
- package/dist/cjs/kup-manager-5c03da64.js +0 -8795
- 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/f-cell-d5dac50b.js +0 -650
- package/dist/esm/kup-manager-9316a184.js +0 -8778
- package/dist/ketchup/p-12773ca8.js +0 -9
- package/dist/ketchup/p-34b74425.js +0 -1
- package/dist/ketchup/p-4173422f.entry.js +0 -1
- package/dist/ketchup/p-41741c28.entry.js +0 -1
- package/dist/ketchup/p-44f8da2a.js +0 -1
- package/dist/ketchup/p-7a74ad17.js +0 -1
- package/dist/ketchup/p-7ba8fa4a.entry.js +0 -39
- package/dist/ketchup/p-7de0d7e1.js +0 -1
- package/dist/ketchup/p-8418e8fa.entry.js +0 -1
- package/dist/ketchup/p-96bf19aa.entry.js +0 -1
- package/dist/ketchup/p-b0ddcce9.entry.js +0 -9
- package/dist/ketchup/p-b6c21223.entry.js +0 -27
- package/dist/ketchup/p-ca3d585b.entry.js +0 -1
- package/dist/ketchup/p-ecb7069b.js +0 -135
- 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,560 @@
|
|
|
1
|
+
import { Component, Element, forceUpdate, h, Host, Method, Prop, State, Event, Watch, } from '@stencil/core';
|
|
2
|
+
import { FButton } from '../../f-components/f-button/f-button';
|
|
3
|
+
import { FCheckbox } from '../../f-components/f-checkbox/f-checkbox';
|
|
4
|
+
import { FTextField } from '../../f-components/f-text-field/f-text-field';
|
|
5
|
+
import { FTextFieldMDC } from '../../f-components/f-text-field/f-text-field-mdc';
|
|
6
|
+
import { KupDebugCategory } from '../../managers/kup-debug/kup-debug-declarations';
|
|
7
|
+
import { KupDragEffect } from '../../managers/kup-interact/kup-interact-declarations';
|
|
8
|
+
import { KupLanguageDashboard, KupLanguageGeneric, } from '../../managers/kup-language/kup-language-declarations';
|
|
9
|
+
import { kupManagerInstance, } from '../../managers/kup-manager/kup-manager';
|
|
10
|
+
import { getProps, setProps } from '../../utils/utils';
|
|
11
|
+
import { componentWrapperId } from '../../variables/GenericVariables';
|
|
12
|
+
import { KupDashboardProps, } from './kup-dashboard-declarations';
|
|
13
|
+
export class KupDashboard {
|
|
14
|
+
constructor() {
|
|
15
|
+
/*-------------------------------------------------*/
|
|
16
|
+
/* S t a t e s */
|
|
17
|
+
/*-------------------------------------------------*/
|
|
18
|
+
/**
|
|
19
|
+
* Force render component by internal event.
|
|
20
|
+
*/
|
|
21
|
+
this.resetInternalData = false;
|
|
22
|
+
/*-------------------------------------------------*/
|
|
23
|
+
/* P r o p s */
|
|
24
|
+
/*-------------------------------------------------*/
|
|
25
|
+
/**
|
|
26
|
+
* Custom style of the component.
|
|
27
|
+
* @default ""
|
|
28
|
+
* @see https://ketchup.smeup.com/ketchup-showcase/#/customization
|
|
29
|
+
*/
|
|
30
|
+
this.customStyle = '';
|
|
31
|
+
/**
|
|
32
|
+
* The data of the component.
|
|
33
|
+
* @default null
|
|
34
|
+
*/
|
|
35
|
+
this.data = null;
|
|
36
|
+
/**
|
|
37
|
+
* Enable drag & drop of the section.
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
40
|
+
this.enableDesign = false;
|
|
41
|
+
/*-------------------------------------------------*/
|
|
42
|
+
/* I n t e r n a l V a r i a b l e s */
|
|
43
|
+
/*-------------------------------------------------*/
|
|
44
|
+
/**
|
|
45
|
+
* Instance of the KupManager class.
|
|
46
|
+
*/
|
|
47
|
+
this.kupManager = kupManagerInstance();
|
|
48
|
+
/**
|
|
49
|
+
* Internal data of the component.
|
|
50
|
+
*/
|
|
51
|
+
this.internalData = null;
|
|
52
|
+
/**
|
|
53
|
+
* Internal data backup of the component for refresh when changed content by drag&drop.
|
|
54
|
+
*/
|
|
55
|
+
this.internalDataBackup = null;
|
|
56
|
+
}
|
|
57
|
+
onKupSave() {
|
|
58
|
+
this.kupSave.emit({
|
|
59
|
+
comp: this,
|
|
60
|
+
id: this.rootElement.id,
|
|
61
|
+
data: this.internalData,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/*-------------------------------------------------*/
|
|
65
|
+
/* W a t c h e r s */
|
|
66
|
+
/*-------------------------------------------------*/
|
|
67
|
+
dataChanged() {
|
|
68
|
+
this.resetData();
|
|
69
|
+
}
|
|
70
|
+
/*-------------------------------------------------*/
|
|
71
|
+
/* P u b l i c M e t h o d s */
|
|
72
|
+
/*-------------------------------------------------*/
|
|
73
|
+
/**
|
|
74
|
+
* Used to retrieve component's props values.
|
|
75
|
+
* @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
|
|
76
|
+
* @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
|
|
77
|
+
*/
|
|
78
|
+
async getProps(descriptions) {
|
|
79
|
+
return getProps(this, KupDashboardProps, descriptions);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* This method is used to trigger a new render of the component.
|
|
83
|
+
*/
|
|
84
|
+
async refresh() {
|
|
85
|
+
forceUpdate(this);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Sets the props to the component.
|
|
89
|
+
* @param {GenericObject} props - Object containing props that will be set to the component.
|
|
90
|
+
*/
|
|
91
|
+
async setProps(props) {
|
|
92
|
+
setProps(this, KupDashboardProps, props);
|
|
93
|
+
}
|
|
94
|
+
/*-------------------------------------------------*/
|
|
95
|
+
/* P r i v a t e M e t h o d s */
|
|
96
|
+
/*-------------------------------------------------*/
|
|
97
|
+
buildGuid() {
|
|
98
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
99
|
+
var r = (Math.random() * 16) | 0, v = c === 'x' ? r : (r & 0x3) | 0x8;
|
|
100
|
+
return v.toString(16);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
buildHeader() {
|
|
104
|
+
const clearButtonProp = {
|
|
105
|
+
icon: 'cancel',
|
|
106
|
+
label: this.kupManager.language.translate(KupLanguageDashboard.RESET),
|
|
107
|
+
secondary: true,
|
|
108
|
+
onClick: () => {
|
|
109
|
+
this.resetData();
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
const saveButtonProp = {
|
|
113
|
+
icon: 'save',
|
|
114
|
+
label: this.kupManager.language.translate(KupLanguageDashboard.SAVE),
|
|
115
|
+
onClick: () => this.onKupSave(),
|
|
116
|
+
};
|
|
117
|
+
return (h("div", { class: "header" },
|
|
118
|
+
this.enableDesign ? (h(FButton, Object.assign({}, clearButtonProp))) : undefined,
|
|
119
|
+
this.enableDesign ? (h(FButton, Object.assign({}, saveButtonProp))) : undefined));
|
|
120
|
+
}
|
|
121
|
+
buildForm(form, parent) {
|
|
122
|
+
const classes = {
|
|
123
|
+
form: true,
|
|
124
|
+
'layout-column': form && form.layout == 'column',
|
|
125
|
+
'layout-row': form && form.layout == 'row',
|
|
126
|
+
'form-dropzone': this.enableDesign &&
|
|
127
|
+
form &&
|
|
128
|
+
form.sections != null &&
|
|
129
|
+
form.sections.length > 0,
|
|
130
|
+
};
|
|
131
|
+
return form ? (h("div", { class: classes, style: this.getGridStyle(form), ref: (el) => {
|
|
132
|
+
if (!el)
|
|
133
|
+
return;
|
|
134
|
+
const kel = el;
|
|
135
|
+
kel.kupData = { parent: parent, form: form };
|
|
136
|
+
} }, form.sections.map((section) => this.buildSection(section, form)))) : (h("div", null, this.kupManager.language.translate(KupLanguageGeneric.EMPTY_DATA)));
|
|
137
|
+
}
|
|
138
|
+
buildSectionHeader(section, parent) {
|
|
139
|
+
const dimTextFieldProp = {
|
|
140
|
+
value: section.dim,
|
|
141
|
+
label: this.kupManager.language.translate(KupLanguageDashboard.DIMENSION),
|
|
142
|
+
onChange: (e) => {
|
|
143
|
+
const { target } = e;
|
|
144
|
+
section.dim = target.value;
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
const addButtonProp = {
|
|
148
|
+
icon: 'add',
|
|
149
|
+
slim: true,
|
|
150
|
+
onClick: () => {
|
|
151
|
+
if (!section.sections) {
|
|
152
|
+
section.sections = [];
|
|
153
|
+
}
|
|
154
|
+
const newSec = {
|
|
155
|
+
id: section.id + (section.sections.length + 1),
|
|
156
|
+
loaded: section.loaded,
|
|
157
|
+
layout: section.layout,
|
|
158
|
+
};
|
|
159
|
+
section.sections.push(newSec);
|
|
160
|
+
this.resetData(this.internalData);
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
const removeButtonProp = {
|
|
164
|
+
icon: 'remove',
|
|
165
|
+
slim: true,
|
|
166
|
+
secondary: true,
|
|
167
|
+
onClick: () => {
|
|
168
|
+
const idx = parent.sections.indexOf(section);
|
|
169
|
+
parent.sections.splice(idx, 1);
|
|
170
|
+
this.resetData(this.internalData);
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
const loadedCheckBoxProp = {
|
|
174
|
+
checked: section.loaded,
|
|
175
|
+
label: this.kupManager.language.translate(KupLanguageDashboard.LOADED),
|
|
176
|
+
onChange: () => {
|
|
177
|
+
section.loaded = !section.loaded;
|
|
178
|
+
this.refresh();
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
const columnCheckBoxProp = {
|
|
182
|
+
checked: section.layout == 'column',
|
|
183
|
+
label: this.kupManager.language.translate(KupLanguageDashboard.VERTICAL),
|
|
184
|
+
onChange: () => {
|
|
185
|
+
section.layout = section.layout == 'column' ? 'row' : 'column';
|
|
186
|
+
this.refresh();
|
|
187
|
+
},
|
|
188
|
+
};
|
|
189
|
+
return (h("div", { class: "section-header" },
|
|
190
|
+
h("div", null,
|
|
191
|
+
section.id,
|
|
192
|
+
" - ",
|
|
193
|
+
section.layout),
|
|
194
|
+
h("div", null,
|
|
195
|
+
h("div", { class: "section-header-actions" },
|
|
196
|
+
h(FTextField, Object.assign({}, dimTextFieldProp)),
|
|
197
|
+
h(FCheckbox, Object.assign({}, loadedCheckBoxProp)),
|
|
198
|
+
h(FCheckbox, Object.assign({}, columnCheckBoxProp)),
|
|
199
|
+
h(FButton, Object.assign({}, addButtonProp)),
|
|
200
|
+
h(FButton, Object.assign({}, removeButtonProp))))));
|
|
201
|
+
}
|
|
202
|
+
buildSection(section, parent) {
|
|
203
|
+
const classes = {
|
|
204
|
+
section: true,
|
|
205
|
+
'section-draggable': this.enableDesign,
|
|
206
|
+
'section-dropzone': this.enableDesign,
|
|
207
|
+
};
|
|
208
|
+
const bodyClasses = {
|
|
209
|
+
'section-body': true,
|
|
210
|
+
'layout-column': section && section.layout == 'column',
|
|
211
|
+
'layout-row': section && section.layout == 'row',
|
|
212
|
+
};
|
|
213
|
+
return (h("div", { class: classes, ref: (el) => {
|
|
214
|
+
if (!el)
|
|
215
|
+
return;
|
|
216
|
+
const kel = el;
|
|
217
|
+
kel.kupData = { parent: parent, section: section };
|
|
218
|
+
} },
|
|
219
|
+
this.enableDesign
|
|
220
|
+
? this.buildSectionHeader(section, parent)
|
|
221
|
+
: undefined,
|
|
222
|
+
h("div", { class: bodyClasses, style: this.getGridStyle(section) },
|
|
223
|
+
!this.enableDesign &&
|
|
224
|
+
section.loaded &&
|
|
225
|
+
(!section.sections || section.sections.length == 0) ? (h("slot", { name: section.id })) : undefined,
|
|
226
|
+
section.sections && (section.loaded || this.enableDesign)
|
|
227
|
+
? section.sections.map((childSection) => this.buildSection(childSection, section))
|
|
228
|
+
: undefined)));
|
|
229
|
+
}
|
|
230
|
+
didRenderInteractables() {
|
|
231
|
+
try {
|
|
232
|
+
const items = [];
|
|
233
|
+
this.rootElement.shadowRoot
|
|
234
|
+
.querySelectorAll('.section-draggable')
|
|
235
|
+
.forEach((x) => items.push(x));
|
|
236
|
+
items.forEach((item) => {
|
|
237
|
+
this.kupManager.interact.draggable(item, null, null, KupDragEffect.CLONE);
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
catch (error) {
|
|
241
|
+
this.kupManager.debug.logMessage(this, error, KupDebugCategory.ERROR);
|
|
242
|
+
}
|
|
243
|
+
try {
|
|
244
|
+
const items = [];
|
|
245
|
+
this.rootElement.shadowRoot
|
|
246
|
+
.querySelectorAll('.section-dropzone')
|
|
247
|
+
.forEach((x) => items.push(x));
|
|
248
|
+
this.rootElement.shadowRoot
|
|
249
|
+
.querySelectorAll('.form-dropzone')
|
|
250
|
+
.forEach((x) => items.push(x));
|
|
251
|
+
items.forEach((item) => {
|
|
252
|
+
this.kupManager.interact.dropzone(item, null, null, {
|
|
253
|
+
drop: (ev) => {
|
|
254
|
+
this.dropped(ev.currentTarget, ev.relatedTarget);
|
|
255
|
+
},
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
catch (error) {
|
|
260
|
+
this.kupManager.debug.logMessage(this, error, KupDebugCategory.ERROR);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
dropped(parent, child) {
|
|
264
|
+
const idx = child.kupData.parent.sections.indexOf(child.kupData.section);
|
|
265
|
+
child.kupData.parent.sections.splice(idx, 1);
|
|
266
|
+
if (parent.kupData.form) {
|
|
267
|
+
// form is the target of drop.
|
|
268
|
+
if (!parent.kupData.form.sections)
|
|
269
|
+
parent.kupData.form.sections = [];
|
|
270
|
+
parent.kupData.form.sections.push(child.kupData.section);
|
|
271
|
+
child.kupData.parent = parent.kupData.form;
|
|
272
|
+
}
|
|
273
|
+
else if (parent.kupData.section) {
|
|
274
|
+
// section is the target of drop.
|
|
275
|
+
if (!parent.kupData.section.sections ||
|
|
276
|
+
parent.kupData.section.sections.length == 0) {
|
|
277
|
+
// if the section target of drop doesn't contains other sections, i create a wrapper that will contain target section and dragged section.
|
|
278
|
+
const newSec = JSON.parse(JSON.stringify(parent.kupData.section));
|
|
279
|
+
newSec.dim = null;
|
|
280
|
+
child.kupData.section.dim = null;
|
|
281
|
+
parent.kupData.section.id = this.buildGuid();
|
|
282
|
+
parent.kupData.section.sections = [];
|
|
283
|
+
parent.kupData.section.sections.push(newSec);
|
|
284
|
+
}
|
|
285
|
+
parent.kupData.section.sections.push(child.kupData.section);
|
|
286
|
+
child.kupData.parent = parent.kupData.section;
|
|
287
|
+
}
|
|
288
|
+
this.resetData(this.internalData);
|
|
289
|
+
}
|
|
290
|
+
getGridStyle(entity) {
|
|
291
|
+
let bodyStyles = {};
|
|
292
|
+
if (!this.enableDesign && entity.sections) {
|
|
293
|
+
let gridTemplate = '';
|
|
294
|
+
entity.sections.forEach((childSection) => {
|
|
295
|
+
if (!childSection.dim)
|
|
296
|
+
gridTemplate += ' 1fr';
|
|
297
|
+
else
|
|
298
|
+
gridTemplate +=
|
|
299
|
+
childSection.dim.indexOf('%') < 0
|
|
300
|
+
? ' ' + childSection.dim + 'px'
|
|
301
|
+
: ' ' + childSection.dim;
|
|
302
|
+
});
|
|
303
|
+
if (entity.layout == 'column')
|
|
304
|
+
bodyStyles['gridTemplateRows'] = gridTemplate;
|
|
305
|
+
if (entity.layout == 'row')
|
|
306
|
+
bodyStyles['gridTemplateColumns'] = gridTemplate;
|
|
307
|
+
}
|
|
308
|
+
return bodyStyles;
|
|
309
|
+
}
|
|
310
|
+
resetData(form = null) {
|
|
311
|
+
if (form)
|
|
312
|
+
this.internalDataBackup = form;
|
|
313
|
+
this.resetInternalData = true;
|
|
314
|
+
setTimeout(() => {
|
|
315
|
+
if (this.internalDataBackup) {
|
|
316
|
+
this.internalData = this.internalDataBackup;
|
|
317
|
+
this.internalDataBackup = null;
|
|
318
|
+
}
|
|
319
|
+
this.resetInternalData = false;
|
|
320
|
+
}, 250);
|
|
321
|
+
}
|
|
322
|
+
unregisterInteractables() {
|
|
323
|
+
this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll('.section-dropzone')));
|
|
324
|
+
this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll('.section-draggable')));
|
|
325
|
+
this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll('.form-dropzone')));
|
|
326
|
+
}
|
|
327
|
+
/*-------------------------------------------------*/
|
|
328
|
+
/* L i f e c y c l e H o o k s */
|
|
329
|
+
/*-------------------------------------------------*/
|
|
330
|
+
componentWillLoad() {
|
|
331
|
+
this.kupManager.dates.register(this);
|
|
332
|
+
this.kupManager.debug.logLoad(this, false);
|
|
333
|
+
this.kupManager.language.register(this);
|
|
334
|
+
this.kupManager.theme.register(this);
|
|
335
|
+
}
|
|
336
|
+
componentDidLoad() {
|
|
337
|
+
this.kupManager.debug.logLoad(this, true);
|
|
338
|
+
}
|
|
339
|
+
componentWillRender() {
|
|
340
|
+
this.kupManager.debug.logRender(this, false);
|
|
341
|
+
if (this.resetInternalData) {
|
|
342
|
+
this.internalData = null;
|
|
343
|
+
this.unregisterInteractables();
|
|
344
|
+
}
|
|
345
|
+
else if (!this.internalData)
|
|
346
|
+
this.internalData = JSON.parse(JSON.stringify(this.data));
|
|
347
|
+
}
|
|
348
|
+
componentDidRender() {
|
|
349
|
+
this.kupManager.debug.logRender(this, true);
|
|
350
|
+
const root = this.rootElement.shadowRoot;
|
|
351
|
+
if (root) {
|
|
352
|
+
const fields = root.querySelectorAll('.f-text-field');
|
|
353
|
+
if (fields)
|
|
354
|
+
fields.forEach((f) => {
|
|
355
|
+
FTextFieldMDC(f);
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
this.didRenderInteractables();
|
|
359
|
+
}
|
|
360
|
+
render() {
|
|
361
|
+
return (h(Host, null,
|
|
362
|
+
h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)),
|
|
363
|
+
h("div", { id: componentWrapperId },
|
|
364
|
+
this.buildHeader(),
|
|
365
|
+
this.buildForm(this.internalData, null))));
|
|
366
|
+
}
|
|
367
|
+
disconnectedCallback() {
|
|
368
|
+
this.unregisterInteractables();
|
|
369
|
+
this.kupManager.dates.unregister(this);
|
|
370
|
+
this.kupManager.language.unregister(this);
|
|
371
|
+
this.kupManager.theme.unregister(this);
|
|
372
|
+
}
|
|
373
|
+
static get is() { return "kup-dashboard"; }
|
|
374
|
+
static get encapsulation() { return "shadow"; }
|
|
375
|
+
static get originalStyleUrls() { return {
|
|
376
|
+
"$": ["kup-dashboard.scss"]
|
|
377
|
+
}; }
|
|
378
|
+
static get styleUrls() { return {
|
|
379
|
+
"$": ["kup-dashboard.css"]
|
|
380
|
+
}; }
|
|
381
|
+
static get properties() { return {
|
|
382
|
+
"customStyle": {
|
|
383
|
+
"type": "string",
|
|
384
|
+
"mutable": false,
|
|
385
|
+
"complexType": {
|
|
386
|
+
"original": "string",
|
|
387
|
+
"resolved": "string",
|
|
388
|
+
"references": {}
|
|
389
|
+
},
|
|
390
|
+
"required": false,
|
|
391
|
+
"optional": false,
|
|
392
|
+
"docs": {
|
|
393
|
+
"tags": [{
|
|
394
|
+
"name": "default",
|
|
395
|
+
"text": "\"\""
|
|
396
|
+
}, {
|
|
397
|
+
"name": "see",
|
|
398
|
+
"text": "https://ketchup.smeup.com/ketchup-showcase/#/customization"
|
|
399
|
+
}],
|
|
400
|
+
"text": "Custom style of the component."
|
|
401
|
+
},
|
|
402
|
+
"attribute": "custom-style",
|
|
403
|
+
"reflect": false,
|
|
404
|
+
"defaultValue": "''"
|
|
405
|
+
},
|
|
406
|
+
"data": {
|
|
407
|
+
"type": "unknown",
|
|
408
|
+
"mutable": false,
|
|
409
|
+
"complexType": {
|
|
410
|
+
"original": "KupDataDashboard",
|
|
411
|
+
"resolved": "KupDataDashboard",
|
|
412
|
+
"references": {
|
|
413
|
+
"KupDataDashboard": {
|
|
414
|
+
"location": "import",
|
|
415
|
+
"path": "./kup-dashboard-declarations"
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
"required": false,
|
|
420
|
+
"optional": false,
|
|
421
|
+
"docs": {
|
|
422
|
+
"tags": [{
|
|
423
|
+
"name": "default",
|
|
424
|
+
"text": "null"
|
|
425
|
+
}],
|
|
426
|
+
"text": "The data of the component."
|
|
427
|
+
},
|
|
428
|
+
"defaultValue": "null"
|
|
429
|
+
},
|
|
430
|
+
"enableDesign": {
|
|
431
|
+
"type": "boolean",
|
|
432
|
+
"mutable": false,
|
|
433
|
+
"complexType": {
|
|
434
|
+
"original": "boolean",
|
|
435
|
+
"resolved": "boolean",
|
|
436
|
+
"references": {}
|
|
437
|
+
},
|
|
438
|
+
"required": false,
|
|
439
|
+
"optional": false,
|
|
440
|
+
"docs": {
|
|
441
|
+
"tags": [{
|
|
442
|
+
"name": "default",
|
|
443
|
+
"text": "false"
|
|
444
|
+
}],
|
|
445
|
+
"text": "Enable drag & drop of the section."
|
|
446
|
+
},
|
|
447
|
+
"attribute": "enable-design",
|
|
448
|
+
"reflect": false,
|
|
449
|
+
"defaultValue": "false"
|
|
450
|
+
}
|
|
451
|
+
}; }
|
|
452
|
+
static get states() { return {
|
|
453
|
+
"resetInternalData": {}
|
|
454
|
+
}; }
|
|
455
|
+
static get events() { return [{
|
|
456
|
+
"method": "kupSave",
|
|
457
|
+
"name": "kup-dashboard-save",
|
|
458
|
+
"bubbles": true,
|
|
459
|
+
"cancelable": false,
|
|
460
|
+
"composed": true,
|
|
461
|
+
"docs": {
|
|
462
|
+
"tags": [],
|
|
463
|
+
"text": ""
|
|
464
|
+
},
|
|
465
|
+
"complexType": {
|
|
466
|
+
"original": "KupDashboardEventPayload",
|
|
467
|
+
"resolved": "KupDashboardEventPayload",
|
|
468
|
+
"references": {
|
|
469
|
+
"KupDashboardEventPayload": {
|
|
470
|
+
"location": "import",
|
|
471
|
+
"path": "./kup-dashboard-declarations"
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}]; }
|
|
476
|
+
static get methods() { return {
|
|
477
|
+
"getProps": {
|
|
478
|
+
"complexType": {
|
|
479
|
+
"signature": "(descriptions?: boolean) => Promise<GenericObject>",
|
|
480
|
+
"parameters": [{
|
|
481
|
+
"tags": [{
|
|
482
|
+
"name": "param",
|
|
483
|
+
"text": "descriptions - When provided and true, the result will be the list of props with their description."
|
|
484
|
+
}],
|
|
485
|
+
"text": "- When provided and true, the result will be the list of props with their description."
|
|
486
|
+
}],
|
|
487
|
+
"references": {
|
|
488
|
+
"Promise": {
|
|
489
|
+
"location": "global"
|
|
490
|
+
},
|
|
491
|
+
"GenericObject": {
|
|
492
|
+
"location": "import",
|
|
493
|
+
"path": "../../types/GenericTypes"
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
"return": "Promise<GenericObject>"
|
|
497
|
+
},
|
|
498
|
+
"docs": {
|
|
499
|
+
"text": "Used to retrieve component's props values.",
|
|
500
|
+
"tags": [{
|
|
501
|
+
"name": "param",
|
|
502
|
+
"text": "descriptions - When provided and true, the result will be the list of props with their description."
|
|
503
|
+
}, {
|
|
504
|
+
"name": "returns",
|
|
505
|
+
"text": "List of props as object, each key will be a prop."
|
|
506
|
+
}]
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
"refresh": {
|
|
510
|
+
"complexType": {
|
|
511
|
+
"signature": "() => Promise<void>",
|
|
512
|
+
"parameters": [],
|
|
513
|
+
"references": {
|
|
514
|
+
"Promise": {
|
|
515
|
+
"location": "global"
|
|
516
|
+
}
|
|
517
|
+
},
|
|
518
|
+
"return": "Promise<void>"
|
|
519
|
+
},
|
|
520
|
+
"docs": {
|
|
521
|
+
"text": "This method is used to trigger a new render of the component.",
|
|
522
|
+
"tags": []
|
|
523
|
+
}
|
|
524
|
+
},
|
|
525
|
+
"setProps": {
|
|
526
|
+
"complexType": {
|
|
527
|
+
"signature": "(props: GenericObject) => Promise<void>",
|
|
528
|
+
"parameters": [{
|
|
529
|
+
"tags": [{
|
|
530
|
+
"name": "param",
|
|
531
|
+
"text": "props - Object containing props that will be set to the component."
|
|
532
|
+
}],
|
|
533
|
+
"text": "- Object containing props that will be set to the component."
|
|
534
|
+
}],
|
|
535
|
+
"references": {
|
|
536
|
+
"Promise": {
|
|
537
|
+
"location": "global"
|
|
538
|
+
},
|
|
539
|
+
"GenericObject": {
|
|
540
|
+
"location": "import",
|
|
541
|
+
"path": "../../types/GenericTypes"
|
|
542
|
+
}
|
|
543
|
+
},
|
|
544
|
+
"return": "Promise<void>"
|
|
545
|
+
},
|
|
546
|
+
"docs": {
|
|
547
|
+
"text": "Sets the props to the component.",
|
|
548
|
+
"tags": [{
|
|
549
|
+
"name": "param",
|
|
550
|
+
"text": "props - Object containing props that will be set to the component."
|
|
551
|
+
}]
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}; }
|
|
555
|
+
static get elementRef() { return "rootElement"; }
|
|
556
|
+
static get watchers() { return [{
|
|
557
|
+
"propName": "data",
|
|
558
|
+
"methodName": "dataChanged"
|
|
559
|
+
}]; }
|
|
560
|
+
}
|
|
@@ -47,7 +47,6 @@ export var KupDataTableProps;
|
|
|
47
47
|
KupDataTableProps["showGroups"] = "When set to true enables the column grouping.";
|
|
48
48
|
KupDataTableProps["showHeader"] = "Enables rendering of the table header.";
|
|
49
49
|
KupDataTableProps["showLoadMore"] = "If set to true, displays the button to load more records.";
|
|
50
|
-
KupDataTableProps["showTooltipOnRightClick"] = "If set to true, displays tooltip on right click; if set to false, displays tooltip on mouseOver.";
|
|
51
50
|
KupDataTableProps["sort"] = "Defines the current sorting options.";
|
|
52
51
|
KupDataTableProps["stateId"] = "";
|
|
53
52
|
KupDataTableProps["store"] = "";
|
|
@@ -55,9 +54,8 @@ export var KupDataTableProps;
|
|
|
55
54
|
KupDataTableProps["sortEnabled"] = "When set to true enables the sorting of the columns by clicking on the column header.";
|
|
56
55
|
KupDataTableProps["tableHeight"] = "Sets the height of the table.";
|
|
57
56
|
KupDataTableProps["tableWidth"] = "Sets the width of the table.";
|
|
58
|
-
KupDataTableProps["tooltipDetailTimeout"] = "Defines the timeout for tooltip detail";
|
|
59
|
-
KupDataTableProps["tooltipEnabled"] = "Enable show tooltip";
|
|
60
57
|
KupDataTableProps["totals"] = "Defines the current totals options.";
|
|
58
|
+
KupDataTableProps["transpose"] = "Transposes the data of the data table.";
|
|
61
59
|
})(KupDataTableProps || (KupDataTableProps = {}));
|
|
62
60
|
export var SortMode;
|
|
63
61
|
(function (SortMode) {
|