@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
|
@@ -1,653 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const kupManager = require('./kup-manager-7a941909.js');
|
|
4
|
-
const index = require('./index-eb556444.js');
|
|
5
|
-
const cellUtils = require('./cell-utils-a78d6fac.js');
|
|
6
|
-
const fTextField = require('./f-text-field-e1e45ade.js');
|
|
7
|
-
const utils = require('./utils-6287d878.js');
|
|
8
|
-
const fImage = require('./f-image-89f25556.js');
|
|
9
|
-
const fChip = require('./f-chip-b00897d7.js');
|
|
10
|
-
|
|
11
|
-
/*-------------------------------------------------*/
|
|
12
|
-
/* C o m p o n e n t */
|
|
13
|
-
/*-------------------------------------------------*/
|
|
14
|
-
const FCheckbox = (props) => {
|
|
15
|
-
const indeterminateAttr = {
|
|
16
|
-
'data-indeterminate': props.indeterminate ? true : false,
|
|
17
|
-
};
|
|
18
|
-
const classObj = {
|
|
19
|
-
checkbox: true,
|
|
20
|
-
'checkbox--checked': props.checked && !props.indeterminate ? true : false,
|
|
21
|
-
'checkbox--disabled': props.disabled ? true : false,
|
|
22
|
-
'checkbox--indeterminate': props.indeterminate ? true : false,
|
|
23
|
-
};
|
|
24
|
-
return (index.h("div", Object.assign({ class: `f-checkbox ${props.danger ? 'kup-danger' : ''} ${props.info ? 'kup-info' : ''} ${props.secondary ? 'kup-secondary' : ''} ${props.success ? 'kup-success' : ''} ${props.warning ? 'kup-warning' : ''} ${props.wrapperClass ? props.wrapperClass : ''}` }, props.dataSet, { id: props.id, title: props.title }),
|
|
25
|
-
index.h("div", { class: `form-field ${props.leadingLabel ? 'form-field--align-end' : ''}` },
|
|
26
|
-
index.h("div", { class: classObj },
|
|
27
|
-
index.h("input", Object.assign({ type: "checkbox", class: "checkbox__native-control", checked: props.checked, disabled: props.disabled, onBlur: props.onBlur, onChange: props.onChange, onFocus: props.onFocus }, indeterminateAttr, { value: props.checked ? 'on' : 'off' })),
|
|
28
|
-
index.h("div", { class: "checkbox__background", onClick: props.onChange },
|
|
29
|
-
index.h("svg", { class: "checkbox__checkmark", viewBox: "0 0 24 24" },
|
|
30
|
-
index.h("path", { class: "checkbox__checkmark-path", fill: "none", d: "M1.73,12.91 8.1,19.28 22.79,4.59" })),
|
|
31
|
-
index.h("div", { class: "checkbox__mixedmark" }))),
|
|
32
|
-
props.label ? index.h("label", null, props.label) : undefined)));
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const autoAlignComps = [kupManager.KupTagNames.DATA_TABLE, kupManager.KupTagNames.TREE];
|
|
36
|
-
/**
|
|
37
|
-
* Supported cell events.
|
|
38
|
-
*/
|
|
39
|
-
var FCellEvents;
|
|
40
|
-
(function (FCellEvents) {
|
|
41
|
-
FCellEvents["CLICK"] = "kup-cell-click";
|
|
42
|
-
FCellEvents["ICON_CLICK"] = "kup-cell-iconclick";
|
|
43
|
-
FCellEvents["INPUT"] = "kup-cell-input";
|
|
44
|
-
FCellEvents["UPDATE"] = "kup-cell-update";
|
|
45
|
-
})(FCellEvents || (FCellEvents = {}));
|
|
46
|
-
/**
|
|
47
|
-
* Supported cell padding.
|
|
48
|
-
*/
|
|
49
|
-
exports.FCellPadding = void 0;
|
|
50
|
-
(function (FCellPadding) {
|
|
51
|
-
FCellPadding["DENSE"] = "dense";
|
|
52
|
-
FCellPadding["MEDIUM"] = "medium";
|
|
53
|
-
FCellPadding["NONE"] = "";
|
|
54
|
-
FCellPadding["WIDE"] = "wide";
|
|
55
|
-
})(exports.FCellPadding || (exports.FCellPadding = {}));
|
|
56
|
-
/**
|
|
57
|
-
* Supported cell CSS classes.
|
|
58
|
-
*/
|
|
59
|
-
var FCellClasses;
|
|
60
|
-
(function (FCellClasses) {
|
|
61
|
-
FCellClasses["BG_DANGER"] = "danger-bg";
|
|
62
|
-
FCellClasses["BG_GREEN"] = "green-bg";
|
|
63
|
-
FCellClasses["BG_GREY"] = "grey-bg";
|
|
64
|
-
FCellClasses["BG_ORANGE"] = "orange-bg";
|
|
65
|
-
FCellClasses["BG_PURPLE"] = "purple-bg";
|
|
66
|
-
FCellClasses["BG_SUCCESS"] = "success-bg";
|
|
67
|
-
FCellClasses["BG_TEAL"] = "teal-bg";
|
|
68
|
-
FCellClasses["BG_WARNING"] = "warning-bg";
|
|
69
|
-
FCellClasses["C_BG_DANGER"] = "c-danger-bg";
|
|
70
|
-
FCellClasses["C_BG_GREEN"] = "c-green-bg";
|
|
71
|
-
FCellClasses["C_BG_GREY"] = "c-grey-bg";
|
|
72
|
-
FCellClasses["C_BG_ORANGE"] = "c-orange-bg";
|
|
73
|
-
FCellClasses["C_BG_PURPLE"] = "c-purple-bg";
|
|
74
|
-
FCellClasses["C_BG_SUCCESS"] = "c-success-bg";
|
|
75
|
-
FCellClasses["C_BG_TEAL"] = "c-teal-bg";
|
|
76
|
-
FCellClasses["C_BG_WARNING"] = "c-warning-bg";
|
|
77
|
-
FCellClasses["C_CENTERED"] = "c-centered";
|
|
78
|
-
FCellClasses["C_FITTED"] = "c-fitted";
|
|
79
|
-
FCellClasses["C_PADDED"] = "c-padded";
|
|
80
|
-
FCellClasses["C_PADDED_HOR"] = "c-padded-hor";
|
|
81
|
-
FCellClasses["C_PADDED_VER"] = "c-padded-ver";
|
|
82
|
-
FCellClasses["C_ROUND"] = "c-round";
|
|
83
|
-
FCellClasses["C_RIGHT_ALIGNED"] = "c-right-aligned";
|
|
84
|
-
FCellClasses["C_SHAPED"] = "c-shaped";
|
|
85
|
-
FCellClasses["C_TEXT_VERTICAL"] = "c-vertical-text";
|
|
86
|
-
FCellClasses["CLICKABLE"] = "clickable";
|
|
87
|
-
FCellClasses["HOVER_DISPLAY"] = "display-on-hover";
|
|
88
|
-
FCellClasses["HOVER_EXPAND"] = "expand-on-hover";
|
|
89
|
-
FCellClasses["HOVER_REDUCE"] = "reduce-on-hover";
|
|
90
|
-
FCellClasses["INDICATOR_TOPRIGHT"] = "top-right-indicator";
|
|
91
|
-
FCellClasses["LINK"] = "link";
|
|
92
|
-
FCellClasses["MONOSPACE"] = "monospace";
|
|
93
|
-
FCellClasses["OBJ"] = "obj";
|
|
94
|
-
FCellClasses["SHAPED"] = "shaped";
|
|
95
|
-
FCellClasses["TEXT_DANGER"] = "danger-text";
|
|
96
|
-
FCellClasses["TEXT_INFO"] = "info-text";
|
|
97
|
-
FCellClasses["TEXT_PRIMARY"] = "primary-text";
|
|
98
|
-
FCellClasses["TEXT_PURPLE"] = "purple-text";
|
|
99
|
-
FCellClasses["TEXT_SECONDARY"] = "secondary-text";
|
|
100
|
-
FCellClasses["TEXT_STRONG"] = "strong-text";
|
|
101
|
-
FCellClasses["TEXT_SUCCESS"] = "success-text";
|
|
102
|
-
FCellClasses["TEXT_WARNING"] = "warning-text";
|
|
103
|
-
FCellClasses["UNDERLINED"] = "underlined";
|
|
104
|
-
})(FCellClasses || (FCellClasses = {}));
|
|
105
|
-
/**
|
|
106
|
-
* Supported cell shapes.
|
|
107
|
-
*/
|
|
108
|
-
var FCellShapes;
|
|
109
|
-
(function (FCellShapes) {
|
|
110
|
-
FCellShapes["AUTOCOMPLETE"] = "ACP";
|
|
111
|
-
FCellShapes["BUTTON_LIST"] = "BTN";
|
|
112
|
-
FCellShapes["CHART"] = "GRA";
|
|
113
|
-
FCellShapes["CHECKBOX"] = "CHK";
|
|
114
|
-
FCellShapes["CHIP"] = "CHI";
|
|
115
|
-
FCellShapes["COLOR_PICKER"] = "CLP";
|
|
116
|
-
FCellShapes["COMBOBOX"] = "CMB";
|
|
117
|
-
FCellShapes["EDITOR"] = "EDT";
|
|
118
|
-
FCellShapes["GAUGE"] = "GAU";
|
|
119
|
-
FCellShapes["IMAGE"] = "IMG";
|
|
120
|
-
FCellShapes["KNOB"] = "KNB";
|
|
121
|
-
FCellShapes["PROGRESS_BAR"] = "PGB";
|
|
122
|
-
FCellShapes["RADIO"] = "RAD";
|
|
123
|
-
FCellShapes["RATING"] = "RTG";
|
|
124
|
-
FCellShapes["TEXT_FIELD"] = "ITX";
|
|
125
|
-
})(FCellShapes || (FCellShapes = {}));
|
|
126
|
-
/**
|
|
127
|
-
* Supported cell types.
|
|
128
|
-
*/
|
|
129
|
-
var FCellTypes;
|
|
130
|
-
(function (FCellTypes) {
|
|
131
|
-
FCellTypes["AUTOCOMPLETE"] = "autocomplete";
|
|
132
|
-
FCellTypes["BAR"] = "bar";
|
|
133
|
-
FCellTypes["BUTTON"] = "button";
|
|
134
|
-
FCellTypes["BUTTON_LIST"] = "button-list";
|
|
135
|
-
FCellTypes["CHART"] = "chart";
|
|
136
|
-
FCellTypes["CHECKBOX"] = "checkbox";
|
|
137
|
-
FCellTypes["CHIP"] = "chips";
|
|
138
|
-
FCellTypes["COLOR_PICKER"] = "color-picker";
|
|
139
|
-
FCellTypes["COMBOBOX"] = "combobox";
|
|
140
|
-
FCellTypes["DATE"] = "date";
|
|
141
|
-
FCellTypes["DATETIME"] = "datetime";
|
|
142
|
-
FCellTypes["EDITOR"] = "editor";
|
|
143
|
-
FCellTypes["GAUGE"] = "gauge";
|
|
144
|
-
FCellTypes["ICON"] = "icon";
|
|
145
|
-
FCellTypes["IMAGE"] = "image";
|
|
146
|
-
FCellTypes["KNOB"] = "knob";
|
|
147
|
-
FCellTypes["LINK"] = "link";
|
|
148
|
-
FCellTypes["NUMBER"] = "number";
|
|
149
|
-
FCellTypes["PROGRESS_BAR"] = "progress-bar";
|
|
150
|
-
FCellTypes["RADIO"] = "radio";
|
|
151
|
-
FCellTypes["RATING"] = "rating";
|
|
152
|
-
FCellTypes["STRING"] = "string";
|
|
153
|
-
FCellTypes["TIME"] = "time";
|
|
154
|
-
})(FCellTypes || (FCellTypes = {}));
|
|
155
|
-
const editableTypes = [
|
|
156
|
-
FCellTypes.AUTOCOMPLETE,
|
|
157
|
-
FCellTypes.CHECKBOX,
|
|
158
|
-
FCellTypes.COLOR_PICKER,
|
|
159
|
-
FCellTypes.COMBOBOX,
|
|
160
|
-
FCellTypes.DATE,
|
|
161
|
-
FCellTypes.NUMBER,
|
|
162
|
-
FCellTypes.RATING,
|
|
163
|
-
FCellTypes.STRING,
|
|
164
|
-
FCellTypes.TIME,
|
|
165
|
-
];
|
|
166
|
-
const kupTypes = [
|
|
167
|
-
FCellTypes.BAR,
|
|
168
|
-
FCellTypes.BUTTON,
|
|
169
|
-
FCellTypes.BUTTON_LIST,
|
|
170
|
-
FCellTypes.CHART,
|
|
171
|
-
FCellTypes.CHIP,
|
|
172
|
-
FCellTypes.COLOR_PICKER,
|
|
173
|
-
FCellTypes.GAUGE,
|
|
174
|
-
FCellTypes.KNOB,
|
|
175
|
-
FCellTypes.PROGRESS_BAR,
|
|
176
|
-
FCellTypes.RADIO,
|
|
177
|
-
FCellTypes.RATING,
|
|
178
|
-
];
|
|
179
|
-
|
|
180
|
-
const dom = document.documentElement;
|
|
181
|
-
/*-------------------------------------------------*/
|
|
182
|
-
/* C o m p o n e n t */
|
|
183
|
-
/*-------------------------------------------------*/
|
|
184
|
-
const FCell = (props, children) => {
|
|
185
|
-
const cell = props.cell;
|
|
186
|
-
const column = props.column;
|
|
187
|
-
const row = props.row;
|
|
188
|
-
const shape = props.shape
|
|
189
|
-
? props.shape
|
|
190
|
-
: cell.shape
|
|
191
|
-
? cell.shape
|
|
192
|
-
: column.shape
|
|
193
|
-
? column.shape
|
|
194
|
-
: null;
|
|
195
|
-
const hasObj = !dom.ketchup.objects.isEmptyKupObj(cell.obj);
|
|
196
|
-
const isEditable = cell.isEditable && props.editable ? true : false;
|
|
197
|
-
const valueToDisplay = props.previousValue !== cell.value ? cell.value : '';
|
|
198
|
-
const cellType = getCellType(cell, shape);
|
|
199
|
-
const subcomponentProps = Object.assign({}, cell.data);
|
|
200
|
-
let cssClasses = cell.cssClass
|
|
201
|
-
? cell.cssClass
|
|
202
|
-
: column.cssClass
|
|
203
|
-
? column.cssClass
|
|
204
|
-
: '';
|
|
205
|
-
const classObj = {
|
|
206
|
-
'f-cell': true,
|
|
207
|
-
[FCellClasses.OBJ]: hasObj ? true : false,
|
|
208
|
-
[cellType + '-cell']: true,
|
|
209
|
-
[props.wrapperClass]: props.wrapperClass ? true : false,
|
|
210
|
-
[props.density]: props.density && cellType !== FCellTypes.BAR ? true : false,
|
|
211
|
-
[cssClasses]: cssClasses ? true : false,
|
|
212
|
-
};
|
|
213
|
-
let content = valueToDisplay;
|
|
214
|
-
if (isEditable && editableTypes.includes(cellType)) {
|
|
215
|
-
content = setEditableCell(cellType, classObj, cell, column, props);
|
|
216
|
-
}
|
|
217
|
-
else if (cell.data && kupTypes.includes(cellType)) {
|
|
218
|
-
if (props.setSizes) {
|
|
219
|
-
setCellSizeKup(cellType, subcomponentProps, cell);
|
|
220
|
-
}
|
|
221
|
-
if (!props.renderKup) {
|
|
222
|
-
const lazyClass = 'cell-' + cellType + ' placeholder';
|
|
223
|
-
content = index.h("span", { class: lazyClass });
|
|
224
|
-
}
|
|
225
|
-
else {
|
|
226
|
-
content = setKupCell(cellType, classObj, subcomponentProps, cell, row, column, props);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
else {
|
|
230
|
-
if (props.setSizes) {
|
|
231
|
-
setCellSize(cellType, subcomponentProps, cell, props);
|
|
232
|
-
}
|
|
233
|
-
content = setCell(cellType, subcomponentProps, content, classObj, cell, column, props);
|
|
234
|
-
}
|
|
235
|
-
let icon = null;
|
|
236
|
-
if (!isEditable && (column.icon || cell.icon) && content) {
|
|
237
|
-
const fProps = {
|
|
238
|
-
color: `rgba(var(${kupManager.KupThemeColorValues.TEXT}-rgb), 0.375)`,
|
|
239
|
-
resource: cell.icon ? cell.icon : column.icon,
|
|
240
|
-
sizeX: '1.25em',
|
|
241
|
-
sizeY: '1.25em',
|
|
242
|
-
wrapperClass: 'obj-icon',
|
|
243
|
-
};
|
|
244
|
-
icon = index.h(fImage.FImage, Object.assign({}, fProps));
|
|
245
|
-
}
|
|
246
|
-
let cellTitle = null;
|
|
247
|
-
if (dom.ketchup.debug.isDebug() && hasObj) {
|
|
248
|
-
cellTitle = cell.obj.t + '; ' + cell.obj.p + '; ' + cell.obj.k + ';';
|
|
249
|
-
}
|
|
250
|
-
else if (cell.title != null && cell.title.trim() != '') {
|
|
251
|
-
cellTitle = cell.title;
|
|
252
|
-
}
|
|
253
|
-
let infoEl = null;
|
|
254
|
-
if (cell.info) {
|
|
255
|
-
const info = Object.assign({}, cell.info);
|
|
256
|
-
if (!info.color) {
|
|
257
|
-
info.color = `var(${kupManager.KupThemeColorValues.INFO})`;
|
|
258
|
-
}
|
|
259
|
-
if (!info.icon) {
|
|
260
|
-
info.icon = 'info';
|
|
261
|
-
}
|
|
262
|
-
const fProps = {
|
|
263
|
-
color: info.color,
|
|
264
|
-
resource: info.icon,
|
|
265
|
-
sizeX: '1.25em',
|
|
266
|
-
sizeY: '1.25em',
|
|
267
|
-
title: info.message ? info.message : '',
|
|
268
|
-
wrapperClass: 'cell-info',
|
|
269
|
-
};
|
|
270
|
-
infoEl = index.h(fImage.FImage, Object.assign({}, fProps));
|
|
271
|
-
}
|
|
272
|
-
return (index.h("div", { class: classObj, "kup-get-cell-props": () => {
|
|
273
|
-
return props;
|
|
274
|
-
}, style: cell.style },
|
|
275
|
-
index.h("div", { class: "f-cell__content", style: cell.styleContent, title: cellTitle }, children && children.length > 0
|
|
276
|
-
? children
|
|
277
|
-
: [props.indents, infoEl, icon, content])));
|
|
278
|
-
};
|
|
279
|
-
function setCellSize(cellType, subcomponentProps, cell, props) {
|
|
280
|
-
switch (cellType) {
|
|
281
|
-
case FCellTypes.CHECKBOX:
|
|
282
|
-
case FCellTypes.ICON:
|
|
283
|
-
if (!subcomponentProps.sizeX) {
|
|
284
|
-
subcomponentProps.sizeX = '18px';
|
|
285
|
-
}
|
|
286
|
-
if (!subcomponentProps.sizeY) {
|
|
287
|
-
subcomponentProps.sizeY = '18px';
|
|
288
|
-
}
|
|
289
|
-
if (cell.style) {
|
|
290
|
-
if (!cell.style.height) {
|
|
291
|
-
cell.style['minHeight'] = subcomponentProps.sizeY;
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
else {
|
|
295
|
-
cell.style = {
|
|
296
|
-
minHeight: subcomponentProps.sizeY,
|
|
297
|
-
};
|
|
298
|
-
}
|
|
299
|
-
break;
|
|
300
|
-
case FCellTypes.IMAGE:
|
|
301
|
-
if (props.component.rootElement.tagName ===
|
|
302
|
-
kupManager.KupTagNames.BOX) {
|
|
303
|
-
if (!subcomponentProps.sizeY) {
|
|
304
|
-
subcomponentProps.sizeY = 'auto';
|
|
305
|
-
}
|
|
306
|
-
if (subcomponentProps.fit === undefined) {
|
|
307
|
-
subcomponentProps.fit = true;
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
else if (!subcomponentProps.sizeX) {
|
|
311
|
-
subcomponentProps.sizeX = 'auto';
|
|
312
|
-
}
|
|
313
|
-
if (!subcomponentProps.sizeY) {
|
|
314
|
-
subcomponentProps.sizeY = '64px';
|
|
315
|
-
}
|
|
316
|
-
break;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
function setCellSizeKup(cellType, subcomponentProps, cell) {
|
|
320
|
-
switch (cellType) {
|
|
321
|
-
case FCellTypes.BAR:
|
|
322
|
-
if (!subcomponentProps.sizeY) {
|
|
323
|
-
subcomponentProps.sizeY = '26px';
|
|
324
|
-
}
|
|
325
|
-
break;
|
|
326
|
-
case FCellTypes.BUTTON:
|
|
327
|
-
let height = '';
|
|
328
|
-
if (subcomponentProps.label) {
|
|
329
|
-
height = '36px';
|
|
330
|
-
}
|
|
331
|
-
if (cell.style) {
|
|
332
|
-
if (!cell.style.height) {
|
|
333
|
-
cell.style['minHeight'] = height;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
else {
|
|
337
|
-
cell.style = { minHeight: height };
|
|
338
|
-
}
|
|
339
|
-
break;
|
|
340
|
-
case FCellTypes.CHART:
|
|
341
|
-
if (!subcomponentProps.sizeX) {
|
|
342
|
-
subcomponentProps.sizeX = '100%';
|
|
343
|
-
}
|
|
344
|
-
if (!subcomponentProps.sizeY) {
|
|
345
|
-
subcomponentProps.sizeY = '100%';
|
|
346
|
-
}
|
|
347
|
-
break;
|
|
348
|
-
case FCellTypes.CHIP:
|
|
349
|
-
if (cell.style) {
|
|
350
|
-
if (!cell.style.height) {
|
|
351
|
-
cell.style['minHeight'] = '40px';
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
else {
|
|
355
|
-
cell.style = { minHeight: '40px' };
|
|
356
|
-
}
|
|
357
|
-
break;
|
|
358
|
-
case FCellTypes.RADIO:
|
|
359
|
-
if (cell.style) {
|
|
360
|
-
if (!cell.style.height) {
|
|
361
|
-
cell.style['minHeight'] = '40px';
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
else {
|
|
365
|
-
cell.style = { minHeight: '40px' };
|
|
366
|
-
}
|
|
367
|
-
break;
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
function setEditableCell(cellType, classObj, cell, column, props) {
|
|
371
|
-
switch (cellType) {
|
|
372
|
-
case FCellTypes.AUTOCOMPLETE:
|
|
373
|
-
return (index.h("kup-autocomplete", Object.assign({}, cell.data, { class: "kup-full-width", "onkup-autocomplete-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), "onkup-autocomplete-input": (e) => cellEvent(e, props, cellType, FCellEvents.INPUT), "onkup-autocomplete-iconclick": (e) => cellEvent(e, props, cellType, FCellEvents.ICON_CLICK) })));
|
|
374
|
-
case FCellTypes.CHECKBOX:
|
|
375
|
-
if (autoAlignComps.includes(props.component.rootElement
|
|
376
|
-
.tagName)) {
|
|
377
|
-
classObj[FCellClasses.C_CENTERED] = true;
|
|
378
|
-
}
|
|
379
|
-
return (index.h(FCheckbox, Object.assign({}, cell.data, { onChange: (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE) })));
|
|
380
|
-
case FCellTypes.COLOR_PICKER:
|
|
381
|
-
return (index.h("kup-color-picker", Object.assign({}, cell.data, { class: "kup-full-width", disabled: false, "onkup-colorpicker-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE) })));
|
|
382
|
-
case FCellTypes.COMBOBOX:
|
|
383
|
-
return (index.h("kup-combobox", Object.assign({}, cell.data, { class: "kup-full-width", "onkup-combobox-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), "onkup-combobox-input": (e) => cellEvent(e, props, cellType, FCellEvents.INPUT), "onkup-combobox-iconclick": (e) => cellEvent(e, props, cellType, FCellEvents.ICON_CLICK) })));
|
|
384
|
-
case FCellTypes.DATE:
|
|
385
|
-
return (index.h("kup-date-picker", Object.assign({ initialValue: cell.value }, cell.data, { class: "kup-full-width", "onkup-datepicker-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), "onkup-datepicker-input": (e) => cellEvent(e, props, cellType, FCellEvents.INPUT) })));
|
|
386
|
-
case FCellTypes.RATING:
|
|
387
|
-
return (index.h("kup-rating", Object.assign({}, cell.data, { disabled: false, "onkup-rating-click": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE) })));
|
|
388
|
-
case FCellTypes.TIME:
|
|
389
|
-
return (index.h("kup-time-picker", Object.assign({ initialValue: cell.value }, cell.data, { class: "kup-full-width", "onkup-timepicker-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), "onkup-timepicker-input": (e) => cellEvent(e, props, cellType, FCellEvents.INPUT) })));
|
|
390
|
-
case FCellTypes.NUMBER:
|
|
391
|
-
classObj[FCellClasses.C_RIGHT_ALIGNED] = true;
|
|
392
|
-
case FCellTypes.STRING:
|
|
393
|
-
return (index.h(fTextField.FTextField, Object.assign({}, cell.data, { icon: cell.icon ? cell.icon : column.icon ? column.icon : null, fullWidth: true, inputType: cellType === FCellTypes.NUMBER ? 'number' : null, value: cellType === FCellTypes.NUMBER
|
|
394
|
-
? utils.stringToNumber(cell.value).toString()
|
|
395
|
-
: cell.value, onChange: (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), onInput: (e) => cellEvent(e, props, cellType, FCellEvents.INPUT), onIconClick: (e) => cellEvent(e, props, cellType, FCellEvents.ICON_CLICK) })));
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
function setCell(cellType, subcomponentProps, content, classObj, cell, column, props) {
|
|
399
|
-
switch (cellType) {
|
|
400
|
-
case FCellTypes.AUTOCOMPLETE:
|
|
401
|
-
case FCellTypes.COMBOBOX:
|
|
402
|
-
case FCellTypes.DATE:
|
|
403
|
-
case FCellTypes.DATETIME:
|
|
404
|
-
case FCellTypes.TIME:
|
|
405
|
-
if (content && content != '') {
|
|
406
|
-
const cellValue = cellUtils.getCellValueForDisplay(column, cell);
|
|
407
|
-
return index.h("div", { class: "f-cell__text" }, cellValue);
|
|
408
|
-
}
|
|
409
|
-
return content;
|
|
410
|
-
case FCellTypes.CHECKBOX:
|
|
411
|
-
if (autoAlignComps.includes(props.component.rootElement
|
|
412
|
-
.tagName)) {
|
|
413
|
-
classObj[FCellClasses.C_CENTERED] = true;
|
|
414
|
-
}
|
|
415
|
-
return (index.h(fImage.FImage, { resource: subcomponentProps.checked
|
|
416
|
-
? 'check_box'
|
|
417
|
-
: 'check_box_outline_blank', sizeX: "18px", sizeY: "18px" }));
|
|
418
|
-
case FCellTypes.EDITOR:
|
|
419
|
-
return index.h("div", { innerHTML: cell.value });
|
|
420
|
-
case FCellTypes.ICON:
|
|
421
|
-
case FCellTypes.IMAGE:
|
|
422
|
-
if (autoAlignComps.includes(props.component.rootElement
|
|
423
|
-
.tagName)) {
|
|
424
|
-
classObj[FCellClasses.C_CENTERED] = true;
|
|
425
|
-
}
|
|
426
|
-
if (subcomponentProps.badgeData) {
|
|
427
|
-
classObj[FCellClasses.C_PADDED] = true;
|
|
428
|
-
}
|
|
429
|
-
return index.h(fImage.FImage, Object.assign({}, subcomponentProps));
|
|
430
|
-
case FCellTypes.LINK:
|
|
431
|
-
return (index.h("a", { href: content, target: "_blank" }, cell.value));
|
|
432
|
-
case FCellTypes.NUMBER:
|
|
433
|
-
if (content && content != '') {
|
|
434
|
-
const cellValueNumber = utils.stringToNumber(cell.value);
|
|
435
|
-
const cellValue = cellUtils.getCellValueForDisplay(column, cell);
|
|
436
|
-
if (cellValueNumber < 0) {
|
|
437
|
-
classObj[FCellClasses.TEXT_DANGER] = true;
|
|
438
|
-
}
|
|
439
|
-
if (autoAlignComps.includes(props.component.rootElement
|
|
440
|
-
.tagName)) {
|
|
441
|
-
classObj[FCellClasses.C_RIGHT_ALIGNED] = true;
|
|
442
|
-
}
|
|
443
|
-
return index.h("div", { class: "f-cell__text" }, cellValue);
|
|
444
|
-
}
|
|
445
|
-
return index.h("div", { class: "f-cell__text" }, content);
|
|
446
|
-
default:
|
|
447
|
-
return index.h("div", { class: "f-cell__text" }, content);
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
function setKupCell(cellType, classObj, subcomponentProps, cell, row, column, props) {
|
|
451
|
-
switch (cellType) {
|
|
452
|
-
case FCellTypes.BAR:
|
|
453
|
-
if (!subcomponentProps.data) {
|
|
454
|
-
return index.h("kup-image", Object.assign({}, subcomponentProps));
|
|
455
|
-
}
|
|
456
|
-
else {
|
|
457
|
-
const barStyle = {
|
|
458
|
-
height: subcomponentProps.sizeY,
|
|
459
|
-
width: '100%',
|
|
460
|
-
};
|
|
461
|
-
return (index.h("div", { style: barStyle },
|
|
462
|
-
index.h(fImage.FImage, Object.assign({}, subcomponentProps))));
|
|
463
|
-
}
|
|
464
|
-
case FCellTypes.BUTTON:
|
|
465
|
-
if (autoAlignComps.includes(props.component.rootElement
|
|
466
|
-
.tagName)) {
|
|
467
|
-
classObj[FCellClasses.C_CENTERED] = true;
|
|
468
|
-
}
|
|
469
|
-
return (index.h("kup-button", Object.assign({}, subcomponentProps, { "onkup-button-click": (e) => cellEvent(e, props, cellType, FCellEvents.CLICK) })));
|
|
470
|
-
case FCellTypes.BUTTON_LIST:
|
|
471
|
-
if (autoAlignComps.includes(props.component.rootElement
|
|
472
|
-
.tagName)) {
|
|
473
|
-
classObj[FCellClasses.C_CENTERED] = true;
|
|
474
|
-
}
|
|
475
|
-
subcomponentProps['data-storage'] = {
|
|
476
|
-
cell: cell,
|
|
477
|
-
row: row,
|
|
478
|
-
column: column,
|
|
479
|
-
};
|
|
480
|
-
return index.h("kup-button-list", Object.assign({}, subcomponentProps));
|
|
481
|
-
case FCellTypes.CHART:
|
|
482
|
-
if (autoAlignComps.includes(props.component.rootElement
|
|
483
|
-
.tagName)) {
|
|
484
|
-
classObj[FCellClasses.C_CENTERED] = true;
|
|
485
|
-
}
|
|
486
|
-
return index.h("kup-chart", Object.assign({}, subcomponentProps));
|
|
487
|
-
case FCellTypes.CHIP:
|
|
488
|
-
return index.h(fChip.FChip, Object.assign({}, subcomponentProps));
|
|
489
|
-
case FCellTypes.COLOR_PICKER:
|
|
490
|
-
return (index.h("kup-color-picker", Object.assign({}, subcomponentProps, { class: "kup-full-width", disabled: true })));
|
|
491
|
-
case FCellTypes.GAUGE:
|
|
492
|
-
return (index.h("kup-gauge", Object.assign({ value: utils.stringToNumber(cell.value), "width-component": "280px" }, subcomponentProps)));
|
|
493
|
-
case FCellTypes.KNOB:
|
|
494
|
-
case FCellTypes.PROGRESS_BAR:
|
|
495
|
-
return index.h("kup-progress-bar", Object.assign({}, subcomponentProps));
|
|
496
|
-
case FCellTypes.RADIO:
|
|
497
|
-
if (autoAlignComps.includes(props.component.rootElement
|
|
498
|
-
.tagName)) {
|
|
499
|
-
classObj[FCellClasses.C_CENTERED] = true;
|
|
500
|
-
}
|
|
501
|
-
subcomponentProps['disabled'] = row.readOnly;
|
|
502
|
-
return index.h("kup-radio", Object.assign({}, subcomponentProps));
|
|
503
|
-
case FCellTypes.RATING:
|
|
504
|
-
return index.h("kup-rating", Object.assign({}, subcomponentProps, { disabled: true }));
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
function getCellType(cell, shape) {
|
|
508
|
-
const obj = cell.obj;
|
|
509
|
-
if (shape) {
|
|
510
|
-
switch (shape.toUpperCase()) {
|
|
511
|
-
case FCellShapes.AUTOCOMPLETE:
|
|
512
|
-
return FCellTypes.AUTOCOMPLETE;
|
|
513
|
-
case FCellShapes.BUTTON_LIST:
|
|
514
|
-
return FCellTypes.BUTTON_LIST;
|
|
515
|
-
case FCellShapes.CHART:
|
|
516
|
-
return FCellTypes.CHART;
|
|
517
|
-
case FCellShapes.CHECKBOX:
|
|
518
|
-
return FCellTypes.CHECKBOX;
|
|
519
|
-
case FCellShapes.CHIP:
|
|
520
|
-
return FCellTypes.CHIP;
|
|
521
|
-
case FCellShapes.COLOR_PICKER:
|
|
522
|
-
return FCellTypes.COLOR_PICKER;
|
|
523
|
-
case FCellShapes.COMBOBOX:
|
|
524
|
-
return FCellTypes.COMBOBOX;
|
|
525
|
-
case FCellShapes.EDITOR:
|
|
526
|
-
return FCellTypes.EDITOR;
|
|
527
|
-
case FCellShapes.GAUGE:
|
|
528
|
-
return FCellTypes.GAUGE;
|
|
529
|
-
case FCellShapes.IMAGE:
|
|
530
|
-
return FCellTypes.IMAGE;
|
|
531
|
-
case FCellShapes.KNOB:
|
|
532
|
-
return FCellTypes.KNOB;
|
|
533
|
-
case FCellShapes.PROGRESS_BAR:
|
|
534
|
-
return FCellTypes.PROGRESS_BAR;
|
|
535
|
-
case FCellShapes.RADIO:
|
|
536
|
-
return FCellTypes.RADIO;
|
|
537
|
-
case FCellShapes.RATING:
|
|
538
|
-
return FCellTypes.RATING;
|
|
539
|
-
case FCellShapes.TEXT_FIELD:
|
|
540
|
-
return FCellTypes.STRING;
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
if (dom.ketchup.objects.isBar(obj)) {
|
|
544
|
-
return FCellTypes.BAR;
|
|
545
|
-
}
|
|
546
|
-
else if (dom.ketchup.objects.isButton(obj)) {
|
|
547
|
-
return FCellTypes.BUTTON;
|
|
548
|
-
}
|
|
549
|
-
else if (dom.ketchup.objects.isChart(obj)) {
|
|
550
|
-
return FCellTypes.CHART;
|
|
551
|
-
}
|
|
552
|
-
else if (dom.ketchup.objects.isCheckbox(obj)) {
|
|
553
|
-
return FCellTypes.CHECKBOX;
|
|
554
|
-
}
|
|
555
|
-
else if (dom.ketchup.objects.isColor(obj)) {
|
|
556
|
-
return FCellTypes.COLOR_PICKER;
|
|
557
|
-
}
|
|
558
|
-
else if (dom.ketchup.objects.isIcon(obj)) {
|
|
559
|
-
return FCellTypes.ICON;
|
|
560
|
-
}
|
|
561
|
-
else if (dom.ketchup.objects.isImage(obj)) {
|
|
562
|
-
return FCellTypes.IMAGE;
|
|
563
|
-
}
|
|
564
|
-
else if (dom.ketchup.objects.isLink(obj)) {
|
|
565
|
-
return FCellTypes.LINK;
|
|
566
|
-
}
|
|
567
|
-
else if (dom.ketchup.objects.isProgressBar(obj)) {
|
|
568
|
-
return FCellTypes.PROGRESS_BAR;
|
|
569
|
-
}
|
|
570
|
-
else if (dom.ketchup.objects.isRadio(obj)) {
|
|
571
|
-
return FCellTypes.RADIO;
|
|
572
|
-
}
|
|
573
|
-
else if (dom.ketchup.objects.isKupObjList(obj)) {
|
|
574
|
-
return FCellTypes.CHIP;
|
|
575
|
-
}
|
|
576
|
-
else if (dom.ketchup.objects.isNumber(obj)) {
|
|
577
|
-
return FCellTypes.NUMBER;
|
|
578
|
-
}
|
|
579
|
-
else if (dom.ketchup.objects.isDate(obj)) {
|
|
580
|
-
return FCellTypes.DATE;
|
|
581
|
-
}
|
|
582
|
-
else if (dom.ketchup.objects.isTimestamp(obj)) {
|
|
583
|
-
return FCellTypes.DATETIME;
|
|
584
|
-
}
|
|
585
|
-
else if (dom.ketchup.objects.isTime(obj)) {
|
|
586
|
-
return FCellTypes.TIME;
|
|
587
|
-
}
|
|
588
|
-
else if (dom.ketchup.objects.isVoCodver(obj)) {
|
|
589
|
-
return FCellTypes.ICON;
|
|
590
|
-
}
|
|
591
|
-
else {
|
|
592
|
-
return FCellTypes.STRING;
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
function cellEvent(e, props, cellType, cellEventName) {
|
|
596
|
-
const cell = props.cell;
|
|
597
|
-
const column = props.column;
|
|
598
|
-
const comp = props.component;
|
|
599
|
-
const row = props.row;
|
|
600
|
-
const isInputEvent = !!(e.target.tagName === 'INPUT');
|
|
601
|
-
let value = isInputEvent
|
|
602
|
-
? e.target.value
|
|
603
|
-
: e.detail.value;
|
|
604
|
-
if (cellEventName === FCellEvents.UPDATE) {
|
|
605
|
-
switch (cellType) {
|
|
606
|
-
case FCellTypes.AUTOCOMPLETE:
|
|
607
|
-
case FCellTypes.COMBOBOX:
|
|
608
|
-
case FCellTypes.DATE:
|
|
609
|
-
case FCellTypes.TIME:
|
|
610
|
-
if (cell.data) {
|
|
611
|
-
cell.data['initialValue'] = value;
|
|
612
|
-
}
|
|
613
|
-
break;
|
|
614
|
-
case FCellTypes.CHECKBOX:
|
|
615
|
-
value = value === 'on' ? '0' : '1';
|
|
616
|
-
if (cell.data) {
|
|
617
|
-
cell.data.checked =
|
|
618
|
-
value === '0' ? false : true;
|
|
619
|
-
}
|
|
620
|
-
break;
|
|
621
|
-
}
|
|
622
|
-
if (cell.obj) {
|
|
623
|
-
cell.obj.k = value.toString();
|
|
624
|
-
}
|
|
625
|
-
cell.value = value.toString();
|
|
626
|
-
cell.displayedValue = null;
|
|
627
|
-
cell.displayedValue = cellUtils.getCellValueForDisplay(column, cell);
|
|
628
|
-
}
|
|
629
|
-
if (comp && comp.rootElement) {
|
|
630
|
-
const cellEvent = new CustomEvent(cellEventName, {
|
|
631
|
-
bubbles: true,
|
|
632
|
-
cancelable: true,
|
|
633
|
-
composed: true,
|
|
634
|
-
detail: {
|
|
635
|
-
comp: comp,
|
|
636
|
-
id: comp.rootElement.id,
|
|
637
|
-
cell: cell,
|
|
638
|
-
column: column,
|
|
639
|
-
event: e,
|
|
640
|
-
row: row,
|
|
641
|
-
type: cellType,
|
|
642
|
-
},
|
|
643
|
-
});
|
|
644
|
-
comp.rootElement.dispatchEvent(cellEvent);
|
|
645
|
-
try {
|
|
646
|
-
comp.refresh();
|
|
647
|
-
}
|
|
648
|
-
catch (error) { }
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
exports.FCell = FCell;
|
|
653
|
-
exports.FCheckbox = FCheckbox;
|