@sme.up/ketchup 6.8.0 → 7.0.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/{f-button-229c63fd.js → f-button-293afb08.js} +1 -1
- package/dist/cjs/{f-cell-dd006395.js → f-cell-06b323ca.js} +11 -8
- package/dist/cjs/{f-chip-f2c369fd.js → f-chip-1c944c07.js} +2 -2
- package/dist/cjs/{f-image-847a6ddf.js → f-image-bfb4e4c9.js} +1 -1
- package/dist/cjs/{f-paginator-utils-cedc4b3e.js → f-paginator-utils-c9560cfd.js} +2 -2
- package/dist/cjs/{f-text-field-fe85187d.js → f-text-field-e99c5a26.js} +1 -1
- package/dist/cjs/ketchup.cjs.js +1 -1
- package/dist/cjs/kup-accordion.cjs.entry.js +2 -2
- package/dist/cjs/kup-autocomplete_26.cjs.entry.js +166 -23
- package/dist/cjs/kup-box.cjs.entry.js +7 -7
- package/dist/cjs/kup-calendar.cjs.entry.js +4 -4
- package/dist/cjs/kup-cell.cjs.entry.js +5 -5
- package/dist/cjs/kup-dash-list.cjs.entry.js +1 -1
- package/dist/cjs/kup-dash_2.cjs.entry.js +1 -1
- package/dist/cjs/kup-dashboard.cjs.entry.js +4 -4
- package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
- package/dist/cjs/kup-echart.cjs.entry.js +1 -1
- package/dist/cjs/kup-family-tree.cjs.entry.js +3 -3
- package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
- package/dist/cjs/kup-image-list.cjs.entry.js +6 -6
- package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
- package/dist/cjs/kup-magic-box.cjs.entry.js +2 -2
- package/dist/cjs/{kup-manager-c53468cd.js → kup-manager-1e882e61.js} +7 -2
- package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +2 -2
- package/dist/cjs/kup-photo-frame.cjs.entry.js +1 -1
- package/dist/cjs/kup-probe.cjs.entry.js +1 -1
- package/dist/cjs/kup-qlik.cjs.entry.js +1 -1
- package/dist/cjs/kup-snackbar.cjs.entry.js +3 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/assets/card.js +9 -2
- package/dist/collection/assets/data-table.js +4 -1
- package/dist/collection/components/kup-card/box/kup-card-box.js +114 -5
- package/dist/collection/components/kup-card/kup-card.css +171 -21
- package/dist/collection/components/kup-chip/kup-chip.js +2 -2
- package/dist/collection/components/kup-data-table/kup-data-table.js +10 -3
- package/dist/collection/components/kup-form/kup-form-declarations.js +3 -0
- package/dist/collection/components/kup-form/kup-form.js +56 -3
- package/dist/collection/f-components/f-cell/f-cell-declarations.js +2 -0
- package/dist/collection/f-components/f-cell/f-cell.js +7 -4
- package/dist/collection/managers/kup-data/kup-data-column-helper.js +4 -1
- package/dist/collection/utils/kup-column-menu/kup-column-menu.js +1 -1
- package/dist/components/index.d.ts +68 -0
- package/dist/components/index.js +48 -0
- package/dist/components/kup-accordion.d.ts +11 -0
- package/dist/components/kup-accordion.js +363 -0
- package/dist/components/kup-autocomplete.d.ts +11 -0
- package/dist/components/kup-autocomplete.js +6 -0
- package/dist/components/kup-autocomplete2.js +46145 -0
- package/dist/components/kup-badge.d.ts +11 -0
- package/dist/components/kup-badge.js +6 -0
- package/dist/components/kup-box.d.ts +11 -0
- package/dist/components/kup-box.js +6 -0
- package/dist/components/kup-box2.js +1412 -0
- package/dist/components/kup-button-list.d.ts +11 -0
- package/dist/components/kup-button-list.js +6 -0
- package/dist/components/kup-button.d.ts +11 -0
- package/dist/components/kup-button.js +6 -0
- package/dist/components/kup-calendar.d.ts +11 -0
- package/dist/components/kup-calendar.js +14818 -0
- package/dist/components/kup-card.d.ts +11 -0
- package/dist/components/kup-card.js +6 -0
- package/dist/components/kup-cell.d.ts +11 -0
- package/dist/components/kup-cell.js +332 -0
- package/dist/components/kup-chart.d.ts +11 -0
- package/dist/components/kup-chart.js +6 -0
- package/dist/components/kup-checkbox.d.ts +11 -0
- package/dist/components/kup-checkbox.js +6 -0
- package/dist/components/kup-chip.d.ts +11 -0
- package/dist/components/kup-chip.js +6 -0
- package/dist/components/kup-color-picker.d.ts +11 -0
- package/dist/components/kup-color-picker.js +6 -0
- package/dist/components/kup-combobox.d.ts +11 -0
- package/dist/components/kup-combobox.js +6 -0
- package/dist/components/kup-dash-list.d.ts +11 -0
- package/dist/components/kup-dash-list.js +275 -0
- package/dist/components/kup-dash.d.ts +11 -0
- package/dist/components/kup-dash.js +6 -0
- package/dist/components/kup-dash2.js +223 -0
- package/dist/components/kup-dashboard.d.ts +11 -0
- package/dist/components/kup-dashboard.js +559 -0
- package/dist/components/kup-data-table.d.ts +11 -0
- package/dist/components/kup-data-table.js +6 -0
- package/dist/components/kup-date-picker.d.ts +11 -0
- package/dist/components/kup-date-picker.js +6 -0
- package/dist/components/kup-drawer.d.ts +11 -0
- package/dist/components/kup-drawer.js +303 -0
- package/dist/components/kup-dropdown-button.d.ts +11 -0
- package/dist/components/kup-dropdown-button.js +6 -0
- package/dist/components/kup-echart.d.ts +11 -0
- package/dist/components/kup-echart.js +6 -0
- package/dist/components/kup-echart2.js +94317 -0
- package/dist/components/kup-family-tree.d.ts +11 -0
- package/dist/components/kup-family-tree.js +623 -0
- package/dist/components/kup-form.d.ts +11 -0
- package/dist/components/kup-form.js +6 -0
- package/dist/components/kup-gauge.d.ts +11 -0
- package/dist/components/kup-gauge.js +6 -0
- package/dist/components/kup-grid.d.ts +11 -0
- package/dist/components/kup-grid.js +6 -0
- package/dist/components/kup-grid2.js +256 -0
- package/dist/components/kup-iframe.d.ts +11 -0
- package/dist/components/kup-iframe.js +257 -0
- package/dist/components/kup-image-list.d.ts +11 -0
- package/dist/components/kup-image-list.js +416 -0
- package/dist/components/kup-image.d.ts +11 -0
- package/dist/components/kup-image.js +6 -0
- package/dist/components/kup-lazy.d.ts +11 -0
- package/dist/components/kup-lazy.js +352 -0
- package/dist/components/kup-list.d.ts +11 -0
- package/dist/components/kup-list.js +6 -0
- package/dist/components/kup-magic-box.d.ts +11 -0
- package/dist/components/kup-magic-box.js +470 -0
- package/dist/components/kup-nav-bar.d.ts +11 -0
- package/dist/components/kup-nav-bar.js +292 -0
- package/dist/components/kup-numeric-picker.d.ts +11 -0
- package/dist/components/kup-numeric-picker.js +536 -0
- package/dist/components/kup-photo-frame.d.ts +11 -0
- package/dist/components/kup-photo-frame.js +308 -0
- package/dist/components/kup-probe.d.ts +11 -0
- package/dist/components/kup-probe.js +403 -0
- package/dist/components/kup-progress-bar.d.ts +11 -0
- package/dist/components/kup-progress-bar.js +6 -0
- package/dist/components/kup-qlik.d.ts +11 -0
- package/dist/components/kup-qlik.js +302 -0
- package/dist/components/kup-radio.d.ts +11 -0
- package/dist/components/kup-radio.js +6 -0
- package/dist/components/kup-rating.d.ts +11 -0
- package/dist/components/kup-rating.js +6 -0
- package/dist/components/kup-snackbar.d.ts +11 -0
- package/dist/components/kup-snackbar.js +272 -0
- package/dist/components/kup-spinner.d.ts +11 -0
- package/dist/components/kup-spinner.js +6 -0
- package/dist/components/kup-switch.d.ts +11 -0
- package/dist/components/kup-switch.js +6 -0
- package/dist/components/kup-tab-bar.d.ts +11 -0
- package/dist/components/kup-tab-bar.js +6 -0
- package/dist/components/kup-text-field.d.ts +11 -0
- package/dist/components/kup-text-field.js +6 -0
- package/dist/components/kup-time-picker.d.ts +11 -0
- package/dist/components/kup-time-picker.js +6 -0
- package/dist/components/kup-tree.d.ts +11 -0
- package/dist/components/kup-tree.js +6 -0
- package/dist/esm/{f-button-d1aba968.js → f-button-4aad092d.js} +1 -1
- package/dist/esm/{f-cell-646406bb.js → f-cell-43ca8ab5.js} +11 -8
- package/dist/esm/{f-chip-d94e9e81.js → f-chip-94851217.js} +2 -2
- package/dist/esm/{f-image-57c88302.js → f-image-48a4b032.js} +1 -1
- package/dist/esm/{f-paginator-utils-2c865e9a.js → f-paginator-utils-fe00f75c.js} +2 -2
- package/dist/esm/{f-text-field-b0a1fea6.js → f-text-field-b6f9ce84.js} +1 -1
- package/dist/esm/ketchup.js +1 -1
- package/dist/esm/kup-accordion.entry.js +2 -2
- package/dist/esm/kup-autocomplete_26.entry.js +166 -23
- package/dist/esm/kup-box.entry.js +7 -7
- package/dist/esm/kup-calendar.entry.js +4 -4
- package/dist/esm/kup-cell.entry.js +5 -5
- package/dist/esm/kup-dash-list.entry.js +1 -1
- package/dist/esm/kup-dash_2.entry.js +1 -1
- package/dist/esm/kup-dashboard.entry.js +4 -4
- package/dist/esm/kup-drawer.entry.js +1 -1
- package/dist/esm/kup-echart.entry.js +1 -1
- package/dist/esm/kup-family-tree.entry.js +3 -3
- package/dist/esm/kup-iframe.entry.js +1 -1
- package/dist/esm/kup-image-list.entry.js +6 -6
- package/dist/esm/kup-lazy.entry.js +1 -1
- package/dist/esm/kup-magic-box.entry.js +2 -2
- package/dist/esm/{kup-manager-c0fbb180.js → kup-manager-07c9ba13.js} +7 -2
- package/dist/esm/kup-nav-bar.entry.js +1 -1
- package/dist/esm/kup-numeric-picker.entry.js +2 -2
- package/dist/esm/kup-photo-frame.entry.js +1 -1
- package/dist/esm/kup-probe.entry.js +1 -1
- package/dist/esm/kup-qlik.entry.js +1 -1
- package/dist/esm/kup-snackbar.entry.js +3 -3
- package/dist/esm/loader.js +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-a1fe329f.entry.js → p-02be3dd2.entry.js} +1 -1
- package/dist/ketchup/{p-35e16ea2.entry.js → p-10281712.entry.js} +1 -1
- package/dist/ketchup/{p-b1da1ba7.entry.js → p-122f51a0.entry.js} +1 -1
- package/dist/ketchup/{p-e6f19333.entry.js → p-14aec9c8.entry.js} +1 -1
- package/dist/ketchup/{p-a992cf87.js → p-200c76a8.js} +1 -1
- package/dist/ketchup/{p-738685f9.entry.js → p-23f50851.entry.js} +1 -1
- package/dist/ketchup/{p-30766296.entry.js → p-2935f22d.entry.js} +1 -1
- package/dist/ketchup/{p-7c8c5444.entry.js → p-33429412.entry.js} +1 -1
- package/dist/ketchup/{p-596bdc10.entry.js → p-3a55568c.entry.js} +1 -1
- package/dist/ketchup/{p-cee3635a.entry.js → p-4c92f0a4.entry.js} +1 -1
- package/dist/ketchup/{p-a740352c.js → p-5781af8a.js} +1 -1
- package/dist/ketchup/{p-1914969e.entry.js → p-5f7da18e.entry.js} +1 -1
- package/dist/ketchup/{p-9214ef33.entry.js → p-69a9af60.entry.js} +1 -1
- package/dist/ketchup/{p-f43b445e.entry.js → p-7134b172.entry.js} +1 -1
- package/dist/ketchup/{p-980ed953.entry.js → p-772f4bb7.entry.js} +1 -1
- package/dist/ketchup/{p-72d4fa26.entry.js → p-79936744.entry.js} +1 -1
- package/dist/ketchup/{p-395675b8.js → p-86e4bfad.js} +1 -1
- package/dist/ketchup/p-8f8b5a08.entry.js +9 -0
- package/dist/ketchup/{p-250118e3.entry.js → p-94e3b109.entry.js} +1 -1
- package/dist/ketchup/{p-86154e2b.js → p-984a05ff.js} +1 -1
- package/dist/ketchup/{p-eb10958a.entry.js → p-9f759d8d.entry.js} +1 -1
- package/dist/ketchup/{p-351cecba.entry.js → p-ab6c66f7.entry.js} +1 -1
- package/dist/ketchup/{p-fa37e92e.entry.js → p-be7748e6.entry.js} +1 -1
- package/dist/ketchup/{p-61ff1761.js → p-c1a5ed6b.js} +1 -1
- package/dist/ketchup/p-e3b85cae.js +1 -0
- package/dist/ketchup/p-e8666a6d.js +1 -0
- package/dist/ketchup/{p-d422151a.entry.js → p-eab86c09.entry.js} +1 -1
- package/dist/ketchup/{p-991bd70d.entry.js → p-ec2d1c8c.entry.js} +1 -1
- package/dist/types/adoptedStyleSheet-shim.d.ts +3 -3
- package/dist/types/components/kup-box/kup-box-declarations.d.ts +9 -9
- package/dist/types/components/kup-card/box/kup-card-box.d.ts +24 -0
- package/dist/types/components/kup-form/kup-form-declarations.d.ts +4 -1
- package/dist/types/components/kup-form/kup-form.d.ts +11 -1
- package/dist/types/components.d.ts +21 -1
- package/dist/types/f-components/f-cell/f-cell-declarations.d.ts +2 -1
- package/package.json +1 -1
- package/dist/ketchup/p-3cf97e3a.js +0 -1
- package/dist/ketchup/p-d05ed931.entry.js +0 -9
- package/dist/ketchup/p-ecac6269.js +0 -1
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, forceUpdate, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { k as kupManagerInstance, g as getProps, s as setProps, R as KupLanguageGeneric, F as FImage, a9 as KupDebugCategory, ak as kupDropEvent, al as kupDraggableColumnAttr, am as kupDraggableRowAttr, an as KupDropEventTypes, c as componentWrapperId, af as FButtonStyling, K as KupThemeColorValues, d as defineCustomElement$2, b as defineCustomElement$3, e as defineCustomElement$4, f as defineCustomElement$5, h as defineCustomElement$6, i as defineCustomElement$7, j as defineCustomElement$8, l as defineCustomElement$9, m as defineCustomElement$a, n as defineCustomElement$b, o as defineCustomElement$c, p as defineCustomElement$d, q as defineCustomElement$e, r as defineCustomElement$g, t as defineCustomElement$h, u as defineCustomElement$i, v as defineCustomElement$j, w as defineCustomElement$k, x as defineCustomElement$l, y as defineCustomElement$m, z as defineCustomElement$n, A as defineCustomElement$o, B as defineCustomElement$p, C as defineCustomElement$q, D as defineCustomElement$s, E as defineCustomElement$t } from './kup-autocomplete2.js';
|
|
3
|
+
import { d as defineCustomElement$r } from './kup-box2.js';
|
|
4
|
+
import { d as defineCustomElement$f } from './kup-echart2.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Props of the kup-magic-box component.
|
|
8
|
+
* Used to export every prop in an object.
|
|
9
|
+
*/
|
|
10
|
+
var KupMagicBoxProps;
|
|
11
|
+
(function (KupMagicBoxProps) {
|
|
12
|
+
KupMagicBoxProps["customStyle"] = "Custom style of the component.";
|
|
13
|
+
KupMagicBoxProps["data"] = "Sets the data that will be used to display different components.";
|
|
14
|
+
})(KupMagicBoxProps || (KupMagicBoxProps = {}));
|
|
15
|
+
/**
|
|
16
|
+
* Viable display modes selectable in kup-magic-box.
|
|
17
|
+
*/
|
|
18
|
+
var KupMagicBoxDisplay;
|
|
19
|
+
(function (KupMagicBoxDisplay) {
|
|
20
|
+
KupMagicBoxDisplay["BOX"] = "Box";
|
|
21
|
+
KupMagicBoxDisplay["BUTTON_LIST"] = "Button List";
|
|
22
|
+
KupMagicBoxDisplay["CHART"] = "Chart";
|
|
23
|
+
KupMagicBoxDisplay["CHIP"] = "Chip";
|
|
24
|
+
KupMagicBoxDisplay["ECHART"] = "Echart";
|
|
25
|
+
KupMagicBoxDisplay["DATATABLE"] = "Datatable";
|
|
26
|
+
KupMagicBoxDisplay["JSON"] = "JSON";
|
|
27
|
+
KupMagicBoxDisplay["TREE"] = "Tree";
|
|
28
|
+
})(KupMagicBoxDisplay || (KupMagicBoxDisplay = {}));
|
|
29
|
+
|
|
30
|
+
const kupMagicBoxCss = ":host{background-color:var(--kup-background-color);color:var(--kup-text-color);display:block;height:300px;min-width:700px;width:700px}#kup-component,.magic-box-wrapper{height:100%;width:100%}.magic-box-wrapper{border:3px dashed var(--kup-border-color);box-sizing:border-box;display:flex;flex-direction:column}.actions{align-items:center;background-color:var(--kup-title-background-color);display:inline-flex;height:52px;justify-content:center;left:0;position:absolute;top:0;width:100%;z-index:1}.actions kup-button{margin:0.5em}.actions #comp-switcher{margin:auto 0}.actions #close-dialog{position:absolute;margin:0;top:0;right:0;background-color:var(--kup-title-background-color)}.content{box-sizing:border-box;height:100%;margin-top:52px;overflow:auto;transition:background-color 125ms ease}.empty{flex-direction:column;display:flex;text-align:center;justify-content:center;height:100%;width:100%;opacity:0.5;transition:opacity 0.25s ease-out}.empty .f-image{margin:0}.json{font-family:var(--kup-font-family-monospace);margin:0}[kup-drag-over]{background-color:rgba(var(--kup-success-color-rgb), 0.25)}";
|
|
31
|
+
|
|
32
|
+
const KupMagicBox$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
33
|
+
constructor() {
|
|
34
|
+
super();
|
|
35
|
+
this.__registerHost();
|
|
36
|
+
this.__attachShadow();
|
|
37
|
+
/*-------------------------------------------------*/
|
|
38
|
+
/* I n t e r n a l V a r i a b l e s */
|
|
39
|
+
/*-------------------------------------------------*/
|
|
40
|
+
this.dragHandler = null;
|
|
41
|
+
this.kupManager = kupManagerInstance();
|
|
42
|
+
this.textArea = null;
|
|
43
|
+
this.wrapperRef = null;
|
|
44
|
+
this.display = KupMagicBoxDisplay.DATATABLE;
|
|
45
|
+
this.customStyle = '';
|
|
46
|
+
this.data = null;
|
|
47
|
+
}
|
|
48
|
+
/*-------------------------------------------------*/
|
|
49
|
+
/* P u b l i c M e t h o d s */
|
|
50
|
+
/*-------------------------------------------------*/
|
|
51
|
+
/**
|
|
52
|
+
* Used to retrieve component's props values.
|
|
53
|
+
* @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
|
|
54
|
+
* @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
|
|
55
|
+
*/
|
|
56
|
+
async getProps(descriptions) {
|
|
57
|
+
return getProps(this, KupMagicBoxProps, descriptions);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* This method is used to trigger a new render of the component.
|
|
61
|
+
*/
|
|
62
|
+
async refresh() {
|
|
63
|
+
forceUpdate(this);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Sets the props to the component.
|
|
67
|
+
* @param {GenericObject} props - Object containing props that will be set to the component.
|
|
68
|
+
*/
|
|
69
|
+
async setProps(props) {
|
|
70
|
+
setProps(this, KupMagicBoxProps, props);
|
|
71
|
+
}
|
|
72
|
+
/*-------------------------------------------------*/
|
|
73
|
+
/* P r i v a t e M e t h o d s */
|
|
74
|
+
/*-------------------------------------------------*/
|
|
75
|
+
/**
|
|
76
|
+
* Sets the props of the combobox used to switch view.
|
|
77
|
+
* @returns {GenericObject} Combobox props.
|
|
78
|
+
*/
|
|
79
|
+
comboboxProps() {
|
|
80
|
+
const listData = [];
|
|
81
|
+
for (const key in KupMagicBoxDisplay) {
|
|
82
|
+
if (Object.prototype.hasOwnProperty.call(KupMagicBoxDisplay, key)) {
|
|
83
|
+
listData.push({
|
|
84
|
+
id: KupMagicBoxDisplay[key],
|
|
85
|
+
selected: false,
|
|
86
|
+
value: KupMagicBoxDisplay[key],
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
data: {
|
|
92
|
+
'kup-list': {
|
|
93
|
+
data: listData,
|
|
94
|
+
id: 'kup-debug-theme-changer-list',
|
|
95
|
+
},
|
|
96
|
+
'kup-text-field': {
|
|
97
|
+
emitSubmitEventOnEnter: false,
|
|
98
|
+
inputType: 'text',
|
|
99
|
+
label: this.kupManager.language.translate(KupLanguageGeneric.VIEW_AS),
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
id: 'comp-switcher',
|
|
103
|
+
initialValue: this.display,
|
|
104
|
+
isSelect: true,
|
|
105
|
+
['onKup-combobox-itemclick']: (e) => {
|
|
106
|
+
this.display = e.detail.value;
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Sets the content window.
|
|
112
|
+
* @returns {VNode[]} Virtual nodes of the content window.
|
|
113
|
+
*/
|
|
114
|
+
setContent() {
|
|
115
|
+
const hasColumns = !!(this.data &&
|
|
116
|
+
this.data.columns &&
|
|
117
|
+
this.data.columns.length > 0);
|
|
118
|
+
const content = [];
|
|
119
|
+
const props = {};
|
|
120
|
+
if (this.display === KupMagicBoxDisplay.JSON) {
|
|
121
|
+
props.initialValue = this.data
|
|
122
|
+
? JSON.stringify(this.data, null, 2)
|
|
123
|
+
: '';
|
|
124
|
+
props.textArea = true;
|
|
125
|
+
content.push(h("kup-text-field", Object.assign({ class: "kup-full-width kup-full-height" }, props, { ref: (el) => (this.textArea = el), "onkup-textfield-input": (e) => {
|
|
126
|
+
try {
|
|
127
|
+
this.data = JSON.parse(e.detail.value);
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
this.data = {
|
|
131
|
+
columns: [{ name: 'ERROR', title: 'Error' }],
|
|
132
|
+
rows: [
|
|
133
|
+
{
|
|
134
|
+
cells: {
|
|
135
|
+
ERROR: {
|
|
136
|
+
value: 'Invalid JSON:' + error,
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
} })));
|
|
144
|
+
}
|
|
145
|
+
else if (!hasColumns) {
|
|
146
|
+
content.push(h("div", { class: "empty" }, h(FImage, { sizeY: "100px", resource: "move_to_inbox" }), h("div", { class: "empty-text" }, this.kupManager.language.translate(KupLanguageGeneric.DROP_YOUR_DATA))));
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
switch (this.display) {
|
|
150
|
+
case KupMagicBoxDisplay.BOX:
|
|
151
|
+
props.data = this.data;
|
|
152
|
+
content.push(h("kup-box", Object.assign({}, props)));
|
|
153
|
+
break;
|
|
154
|
+
case KupMagicBoxDisplay.BUTTON_LIST:
|
|
155
|
+
props.data = this.data;
|
|
156
|
+
content.push(h("kup-button-list", Object.assign({}, props)));
|
|
157
|
+
break;
|
|
158
|
+
case KupMagicBoxDisplay.CHIP:
|
|
159
|
+
props.data = this.data;
|
|
160
|
+
content.push(h("kup-chip", Object.assign({}, props)));
|
|
161
|
+
break;
|
|
162
|
+
case KupMagicBoxDisplay.CHART:
|
|
163
|
+
case KupMagicBoxDisplay.ECHART:
|
|
164
|
+
props.data = this.data;
|
|
165
|
+
props['series'] = [];
|
|
166
|
+
props['axis'] = null;
|
|
167
|
+
for (let index = 0; index < this.data.columns.length; index++) {
|
|
168
|
+
const col = this.data.columns[index];
|
|
169
|
+
if ((col.obj &&
|
|
170
|
+
this.kupManager.objects.isNumber(col.obj)) ||
|
|
171
|
+
props['axis'] !== null) {
|
|
172
|
+
if (this.display === KupMagicBoxDisplay.CHART) {
|
|
173
|
+
props['series'].push({
|
|
174
|
+
code: col.name,
|
|
175
|
+
decode: col.title,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
props['series'].push(col.name);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
props['axis'] = col.name;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if (props['series'].length === 0) {
|
|
187
|
+
this.kupManager.debug.logMessage(this, 'Not enough numerical columns to display a chart!', KupDebugCategory.WARNING);
|
|
188
|
+
}
|
|
189
|
+
if (!props['axis']) {
|
|
190
|
+
this.kupManager.debug.logMessage(this, 'No axis for the chart!', KupDebugCategory.WARNING);
|
|
191
|
+
}
|
|
192
|
+
if (this.display === KupMagicBoxDisplay.CHART) {
|
|
193
|
+
content.push(h("kup-chart", Object.assign({}, props)));
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
content.push(h("kup-echart", Object.assign({}, props)));
|
|
197
|
+
}
|
|
198
|
+
break;
|
|
199
|
+
case KupMagicBoxDisplay.DATATABLE:
|
|
200
|
+
props.data = this.data;
|
|
201
|
+
props['autoFillMissingCells'] = true;
|
|
202
|
+
content.push(h("kup-data-table", Object.assign({}, props)));
|
|
203
|
+
break;
|
|
204
|
+
case KupMagicBoxDisplay.TREE:
|
|
205
|
+
props.data = this.data;
|
|
206
|
+
content.push(h("kup-tree", Object.assign({ class: "kup-full-width" }, props)));
|
|
207
|
+
break;
|
|
208
|
+
default:
|
|
209
|
+
this.kupManager.debug.logMessage(this, 'Display mode not supported (' + this.display + ')!', KupDebugCategory.ERROR);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return content;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* When a kup-drop event is received, the data will be updated.
|
|
217
|
+
* @param {CustomEvent} e - kup-drop event.
|
|
218
|
+
*/
|
|
219
|
+
updateData(e) {
|
|
220
|
+
{
|
|
221
|
+
const data = Object.assign({}, this.data);
|
|
222
|
+
const column = e.detail.sourceElement && e.detail.sourceElement.column
|
|
223
|
+
? e.detail.sourceElement.column
|
|
224
|
+
: null;
|
|
225
|
+
const row = e.detail.sourceElement && e.detail.sourceElement.row
|
|
226
|
+
? e.detail.sourceElement.row
|
|
227
|
+
: null;
|
|
228
|
+
if (column && column.name) {
|
|
229
|
+
if (!data.columns) {
|
|
230
|
+
data.columns = [column];
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
const columnExists = this.data.columns.find((x) => x.name === column.name);
|
|
234
|
+
if (!columnExists) {
|
|
235
|
+
data.columns.push(column);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
this.kupManager.debug.logMessage(this, 'Invalid column received.', KupDebugCategory.WARNING);
|
|
241
|
+
}
|
|
242
|
+
if (row) {
|
|
243
|
+
if (!data.rows) {
|
|
244
|
+
data.rows = [row];
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
data.rows.push(row);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
this.data = data;
|
|
251
|
+
if (this.data && this.textArea) {
|
|
252
|
+
try {
|
|
253
|
+
this.textArea.setValue(JSON.stringify(this.data, null, 2));
|
|
254
|
+
}
|
|
255
|
+
catch (error) {
|
|
256
|
+
this.textArea.setValue('Invalid JSON:' + error);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
/*-------------------------------------------------*/
|
|
262
|
+
/* L i f e c y c l e H o o k s */
|
|
263
|
+
/*-------------------------------------------------*/
|
|
264
|
+
componentWillLoad() {
|
|
265
|
+
this.kupManager.debug.logLoad(this, false);
|
|
266
|
+
this.kupManager.language.register(this);
|
|
267
|
+
this.kupManager.theme.register(this);
|
|
268
|
+
}
|
|
269
|
+
componentDidLoad() {
|
|
270
|
+
this.rootElement.addEventListener(kupDropEvent, (e) => this.updateData(e));
|
|
271
|
+
this.dragHandler =
|
|
272
|
+
this.rootElement.shadowRoot.querySelector('#drag-handle');
|
|
273
|
+
this.kupManager.interact.dialogify(this.rootElement, this.dragHandler);
|
|
274
|
+
this.kupManager.interact.dropzone(this.wrapperRef, {
|
|
275
|
+
accept: `[${kupDraggableColumnAttr}],[${kupDraggableRowAttr}]`,
|
|
276
|
+
}, {
|
|
277
|
+
dispatcher: this.rootElement,
|
|
278
|
+
type: KupDropEventTypes.MAGICBOX,
|
|
279
|
+
});
|
|
280
|
+
this.kupManager.debug.logLoad(this, true);
|
|
281
|
+
}
|
|
282
|
+
componentWillRender() {
|
|
283
|
+
this.kupManager.debug.logRender(this, false);
|
|
284
|
+
}
|
|
285
|
+
componentDidRender() {
|
|
286
|
+
this.kupManager.debug.logRender(this, true);
|
|
287
|
+
}
|
|
288
|
+
render() {
|
|
289
|
+
return (h(Host, null, h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)), h("div", { id: componentWrapperId }, h("div", { class: "magic-box-wrapper" }, h("div", { class: "actions", id: "drag-handle" }, h("kup-combobox", Object.assign({}, this.comboboxProps())), h("kup-button", { styling: FButtonStyling.FLAT, icon: "delete", label: "Reset", "onkup-button-click": () => {
|
|
290
|
+
this.data = null;
|
|
291
|
+
} }), h("kup-button", { id: "close-dialog", customStyle: `:host{${KupThemeColorValues.PRIMARY}: var(${KupThemeColorValues.TITLE});}`, icon: "clear", "onkup-button-click": () => {
|
|
292
|
+
this.kupManager.hideMagicBox();
|
|
293
|
+
} })), h("div", { class: "content", ref: (el) => (this.wrapperRef = el) }, this.setContent())))));
|
|
294
|
+
}
|
|
295
|
+
disconnectedCallback() {
|
|
296
|
+
this.kupManager.interact.unregister([
|
|
297
|
+
this.rootElement,
|
|
298
|
+
this.wrapperRef,
|
|
299
|
+
]);
|
|
300
|
+
this.kupManager.language.unregister(this);
|
|
301
|
+
this.kupManager.theme.unregister(this);
|
|
302
|
+
}
|
|
303
|
+
get rootElement() { return this; }
|
|
304
|
+
static get style() { return kupMagicBoxCss; }
|
|
305
|
+
}, [1, "kup-magic-box", {
|
|
306
|
+
"customStyle": [1, "custom-style"],
|
|
307
|
+
"data": [1040],
|
|
308
|
+
"display": [32],
|
|
309
|
+
"getProps": [64],
|
|
310
|
+
"refresh": [64],
|
|
311
|
+
"setProps": [64]
|
|
312
|
+
}]);
|
|
313
|
+
function defineCustomElement$1() {
|
|
314
|
+
if (typeof customElements === "undefined") {
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
const components = ["kup-magic-box", "kup-autocomplete", "kup-badge", "kup-box", "kup-button", "kup-button-list", "kup-card", "kup-chart", "kup-checkbox", "kup-chip", "kup-color-picker", "kup-combobox", "kup-data-table", "kup-date-picker", "kup-dropdown-button", "kup-echart", "kup-form", "kup-gauge", "kup-image", "kup-list", "kup-progress-bar", "kup-radio", "kup-rating", "kup-spinner", "kup-switch", "kup-tab-bar", "kup-text-field", "kup-time-picker", "kup-tree"];
|
|
318
|
+
components.forEach(tagName => { switch (tagName) {
|
|
319
|
+
case "kup-magic-box":
|
|
320
|
+
if (!customElements.get(tagName)) {
|
|
321
|
+
customElements.define(tagName, KupMagicBox$1);
|
|
322
|
+
}
|
|
323
|
+
break;
|
|
324
|
+
case "kup-autocomplete":
|
|
325
|
+
if (!customElements.get(tagName)) {
|
|
326
|
+
defineCustomElement$t();
|
|
327
|
+
}
|
|
328
|
+
break;
|
|
329
|
+
case "kup-badge":
|
|
330
|
+
if (!customElements.get(tagName)) {
|
|
331
|
+
defineCustomElement$s();
|
|
332
|
+
}
|
|
333
|
+
break;
|
|
334
|
+
case "kup-box":
|
|
335
|
+
if (!customElements.get(tagName)) {
|
|
336
|
+
defineCustomElement$r();
|
|
337
|
+
}
|
|
338
|
+
break;
|
|
339
|
+
case "kup-button":
|
|
340
|
+
if (!customElements.get(tagName)) {
|
|
341
|
+
defineCustomElement$q();
|
|
342
|
+
}
|
|
343
|
+
break;
|
|
344
|
+
case "kup-button-list":
|
|
345
|
+
if (!customElements.get(tagName)) {
|
|
346
|
+
defineCustomElement$p();
|
|
347
|
+
}
|
|
348
|
+
break;
|
|
349
|
+
case "kup-card":
|
|
350
|
+
if (!customElements.get(tagName)) {
|
|
351
|
+
defineCustomElement$o();
|
|
352
|
+
}
|
|
353
|
+
break;
|
|
354
|
+
case "kup-chart":
|
|
355
|
+
if (!customElements.get(tagName)) {
|
|
356
|
+
defineCustomElement$n();
|
|
357
|
+
}
|
|
358
|
+
break;
|
|
359
|
+
case "kup-checkbox":
|
|
360
|
+
if (!customElements.get(tagName)) {
|
|
361
|
+
defineCustomElement$m();
|
|
362
|
+
}
|
|
363
|
+
break;
|
|
364
|
+
case "kup-chip":
|
|
365
|
+
if (!customElements.get(tagName)) {
|
|
366
|
+
defineCustomElement$l();
|
|
367
|
+
}
|
|
368
|
+
break;
|
|
369
|
+
case "kup-color-picker":
|
|
370
|
+
if (!customElements.get(tagName)) {
|
|
371
|
+
defineCustomElement$k();
|
|
372
|
+
}
|
|
373
|
+
break;
|
|
374
|
+
case "kup-combobox":
|
|
375
|
+
if (!customElements.get(tagName)) {
|
|
376
|
+
defineCustomElement$j();
|
|
377
|
+
}
|
|
378
|
+
break;
|
|
379
|
+
case "kup-data-table":
|
|
380
|
+
if (!customElements.get(tagName)) {
|
|
381
|
+
defineCustomElement$i();
|
|
382
|
+
}
|
|
383
|
+
break;
|
|
384
|
+
case "kup-date-picker":
|
|
385
|
+
if (!customElements.get(tagName)) {
|
|
386
|
+
defineCustomElement$h();
|
|
387
|
+
}
|
|
388
|
+
break;
|
|
389
|
+
case "kup-dropdown-button":
|
|
390
|
+
if (!customElements.get(tagName)) {
|
|
391
|
+
defineCustomElement$g();
|
|
392
|
+
}
|
|
393
|
+
break;
|
|
394
|
+
case "kup-echart":
|
|
395
|
+
if (!customElements.get(tagName)) {
|
|
396
|
+
defineCustomElement$f();
|
|
397
|
+
}
|
|
398
|
+
break;
|
|
399
|
+
case "kup-form":
|
|
400
|
+
if (!customElements.get(tagName)) {
|
|
401
|
+
defineCustomElement$e();
|
|
402
|
+
}
|
|
403
|
+
break;
|
|
404
|
+
case "kup-gauge":
|
|
405
|
+
if (!customElements.get(tagName)) {
|
|
406
|
+
defineCustomElement$d();
|
|
407
|
+
}
|
|
408
|
+
break;
|
|
409
|
+
case "kup-image":
|
|
410
|
+
if (!customElements.get(tagName)) {
|
|
411
|
+
defineCustomElement$c();
|
|
412
|
+
}
|
|
413
|
+
break;
|
|
414
|
+
case "kup-list":
|
|
415
|
+
if (!customElements.get(tagName)) {
|
|
416
|
+
defineCustomElement$b();
|
|
417
|
+
}
|
|
418
|
+
break;
|
|
419
|
+
case "kup-progress-bar":
|
|
420
|
+
if (!customElements.get(tagName)) {
|
|
421
|
+
defineCustomElement$a();
|
|
422
|
+
}
|
|
423
|
+
break;
|
|
424
|
+
case "kup-radio":
|
|
425
|
+
if (!customElements.get(tagName)) {
|
|
426
|
+
defineCustomElement$9();
|
|
427
|
+
}
|
|
428
|
+
break;
|
|
429
|
+
case "kup-rating":
|
|
430
|
+
if (!customElements.get(tagName)) {
|
|
431
|
+
defineCustomElement$8();
|
|
432
|
+
}
|
|
433
|
+
break;
|
|
434
|
+
case "kup-spinner":
|
|
435
|
+
if (!customElements.get(tagName)) {
|
|
436
|
+
defineCustomElement$7();
|
|
437
|
+
}
|
|
438
|
+
break;
|
|
439
|
+
case "kup-switch":
|
|
440
|
+
if (!customElements.get(tagName)) {
|
|
441
|
+
defineCustomElement$6();
|
|
442
|
+
}
|
|
443
|
+
break;
|
|
444
|
+
case "kup-tab-bar":
|
|
445
|
+
if (!customElements.get(tagName)) {
|
|
446
|
+
defineCustomElement$5();
|
|
447
|
+
}
|
|
448
|
+
break;
|
|
449
|
+
case "kup-text-field":
|
|
450
|
+
if (!customElements.get(tagName)) {
|
|
451
|
+
defineCustomElement$4();
|
|
452
|
+
}
|
|
453
|
+
break;
|
|
454
|
+
case "kup-time-picker":
|
|
455
|
+
if (!customElements.get(tagName)) {
|
|
456
|
+
defineCustomElement$3();
|
|
457
|
+
}
|
|
458
|
+
break;
|
|
459
|
+
case "kup-tree":
|
|
460
|
+
if (!customElements.get(tagName)) {
|
|
461
|
+
defineCustomElement$2();
|
|
462
|
+
}
|
|
463
|
+
break;
|
|
464
|
+
} });
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
const KupMagicBox = KupMagicBox$1;
|
|
468
|
+
const defineCustomElement = defineCustomElement$1;
|
|
469
|
+
|
|
470
|
+
export { KupMagicBox, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface KupNavBar extends Components.KupNavBar, HTMLElement {}
|
|
4
|
+
export const KupNavBar: {
|
|
5
|
+
prototype: KupNavBar;
|
|
6
|
+
new (): KupNavBar;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|