@sme.up/ketchup 5.2.0-SNAPSHOT → 6.1.0-SNAPSHOT
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{cell-utils-5b16c180.js → cell-utils-a78d6fac.js} +2 -2
- package/dist/cjs/{component-d1496215.js → component-72a5b626.js} +30 -0
- package/dist/cjs/{f-button-3b9f32af.js → f-button-ac179257.js} +2 -2
- package/dist/cjs/{f-cell-c6ad973a.js → f-cell-69294bca.js} +33 -121
- package/dist/cjs/{f-chip-bed86c4a.js → f-chip-b00897d7.js} +5 -4
- package/dist/cjs/{f-image-08a3d340.js → f-image-89f25556.js} +2 -2
- package/dist/cjs/f-paginator-utils-8fa501b3.js +1898 -0
- package/dist/cjs/f-text-field-e1e45ade.js +94 -0
- package/dist/cjs/f-text-field-mdc-85997738.js +2570 -0
- package/dist/cjs/{index-8d7bb3be.js → index-eb556444.js} +2 -0
- package/dist/cjs/ketchup.cjs.js +3 -3
- package/dist/cjs/kup-accordion.cjs.entry.js +5 -5
- package/dist/cjs/{kup-autocomplete_27.cjs.entry.js → kup-autocomplete_25.cjs.entry.js} +1766 -8367
- package/dist/cjs/{kup-echart.cjs.entry.js → kup-box_2.cjs.entry.js} +17102 -14788
- package/dist/cjs/kup-calendar.cjs.entry.js +42 -34
- package/dist/cjs/kup-cell.cjs.entry.js +8 -7
- package/dist/cjs/kup-dash-list.cjs.entry.js +4 -4
- package/dist/cjs/kup-dash_2.cjs.entry.js +3 -3
- package/dist/cjs/kup-drawer.cjs.entry.js +12 -5
- package/dist/cjs/kup-field.cjs.entry.js +2 -2
- package/dist/cjs/kup-form-editor.cjs.entry.js +404 -0
- package/dist/cjs/kup-iframe.cjs.entry.js +3 -3
- package/dist/cjs/kup-image-list.cjs.entry.js +228 -0
- package/dist/cjs/kup-lazy.cjs.entry.js +3 -3
- package/dist/cjs/kup-magic-box.cjs.entry.js +4 -4
- package/dist/cjs/kup-manager-7a941909.js +16703 -0
- package/dist/cjs/kup-nav-bar.cjs.entry.js +3 -3
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +423 -0
- package/dist/cjs/kup-photo-frame.cjs.entry.js +5 -5
- package/dist/cjs/kup-probe.cjs.entry.js +2 -2
- package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
- package/dist/cjs/kup-snackbar.cjs.entry.js +6 -6
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{utils-b9df398c.js → utils-6287d878.js} +1 -1
- package/dist/collection/assets/card.js +4 -5
- package/dist/collection/assets/data-table.js +0 -79
- package/dist/collection/assets/form-editor.js +338 -0
- package/dist/collection/assets/image-list.js +624 -0
- package/dist/collection/assets/index.js +16 -0
- package/dist/collection/assets/kupdata.js +0 -3
- package/dist/collection/assets/kuptooltip.js +654 -0
- package/dist/collection/assets/tree.js +0 -128
- package/dist/collection/collection-manifest.json +8 -6
- package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +1 -1
- package/dist/collection/components/kup-box/kup-box-declarations.js +0 -4
- package/dist/collection/components/kup-box/kup-box.js +7 -135
- package/dist/collection/components/kup-card/built-in/kup-card-built-in.js +10 -0
- package/dist/collection/components/kup-card/built-in/kup-card-clock.js +1 -1
- package/dist/collection/components/kup-card/built-in/kup-card-column-drop-menu.js +1 -2
- package/dist/collection/components/kup-card/built-in/kup-card-numeric.js +153 -0
- package/dist/collection/components/kup-card/kup-card.css +61 -8
- package/dist/collection/components/kup-card/kup-card.js +2 -2
- package/dist/collection/components/kup-card/standard/kup-card-standard.js +14 -6
- package/dist/collection/components/kup-combobox/kup-combobox.js +1 -1
- package/dist/collection/components/kup-data-table/kup-data-table-declarations.js +1 -3
- package/dist/collection/components/kup-data-table/kup-data-table.js +50 -138
- package/dist/collection/components/kup-date-picker/kup-date-picker.js +1 -1
- package/dist/collection/components/kup-drawer/kup-drawer.css +1 -0
- package/dist/collection/components/kup-drawer/kup-drawer.js +8 -1
- package/dist/collection/components/kup-form-editor/kup-form-editor-declarations.js +23 -0
- package/dist/collection/components/kup-form-editor/kup-form-editor.css +80 -0
- package/dist/collection/components/kup-form-editor/kup-form-editor.js +561 -0
- package/dist/collection/components/kup-image-list/kup-image-list-declarations.js +10 -0
- package/dist/collection/components/kup-image-list/kup-image-list.css +166 -0
- package/dist/collection/components/kup-image-list/kup-image-list.js +432 -0
- package/dist/collection/components/kup-numeric-picker/kup-numeric-picker-declarations.js +16 -0
- package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.css +50 -0
- package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.js +895 -0
- package/dist/collection/components/kup-photo-frame/kup-photo-frame.css +3 -13
- package/dist/collection/components/kup-photo-frame/kup-photo-frame.js +1 -1
- package/dist/collection/components/kup-snackbar/kup-snackbar.css +4 -0
- package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +18 -19
- package/dist/collection/components/kup-time-picker/kup-time-picker.js +2 -2
- package/dist/collection/components/kup-tree/kup-tree-declarations.js +0 -4
- package/dist/collection/components/kup-tree/kup-tree.css +10 -3
- package/dist/collection/components/kup-tree/kup-tree.js +65 -140
- package/dist/collection/f-components/f-cell/f-cell.js +7 -7
- package/dist/collection/f-components/f-chip/f-chip.js +2 -1
- package/dist/collection/managers/kup-data/kup-data-node-helper.js +24 -0
- package/dist/collection/managers/kup-data/kup-data.js +4 -1
- package/dist/collection/managers/kup-debug/kup-debug.js +1 -0
- package/dist/collection/managers/kup-dynamic-position/kup-dynamic-position.js +4 -2
- package/dist/collection/managers/kup-interact/kup-interact.js +1 -22
- package/dist/collection/managers/kup-language/kup-language-declarations.js +2 -0
- package/dist/collection/managers/kup-manager/kup-manager.js +31 -1
- package/dist/collection/managers/kup-math/kup-math.js +11 -1
- package/dist/collection/managers/kup-theme/kup-theme-declarations.js +6 -0
- package/dist/collection/managers/kup-tooltip/kup-tooltip-declarations.js +1 -0
- package/dist/collection/managers/kup-tooltip/kup-tooltip.js +224 -0
- package/dist/collection/types/GenericTypes.js +3 -0
- package/dist/collection/utils/kup-column-menu/kup-column-menu.js +8 -12
- package/dist/esm/{cell-utils-69f75e2e.js → cell-utils-964da6b5.js} +3 -3
- package/dist/esm/{component-c4eb6153.js → component-b1bedf1d.js} +27 -2
- package/dist/esm/{f-button-7e7607d8.js → f-button-871a544b.js} +2 -2
- package/dist/esm/{f-cell-e4d83c27.js → f-cell-521ef17a.js} +33 -120
- package/dist/esm/{f-chip-51dfefaf.js → f-chip-1dda722f.js} +6 -5
- package/dist/esm/{f-image-de331954.js → f-image-c468d8ae.js} +2 -2
- package/dist/esm/f-paginator-utils-7dff8ff0.js +1884 -0
- package/dist/esm/f-text-field-d6c61c73.js +92 -0
- package/dist/esm/f-text-field-mdc-d42d3f9e.js +2568 -0
- package/dist/esm/{index-aeec9835.js → index-baeab1ac.js} +2 -1
- package/dist/esm/ketchup.js +3 -3
- package/dist/esm/kup-accordion.entry.js +6 -6
- package/dist/esm/{kup-autocomplete_27.entry.js → kup-autocomplete_25.entry.js} +1711 -8310
- package/dist/esm/{kup-echart.entry.js → kup-box_2.entry.js} +17102 -14789
- package/dist/esm/kup-calendar.entry.js +43 -35
- package/dist/esm/kup-cell.entry.js +8 -7
- package/dist/esm/kup-dash-list.entry.js +4 -4
- package/dist/esm/kup-dash_2.entry.js +3 -3
- package/dist/esm/kup-drawer.entry.js +12 -5
- package/dist/esm/kup-field.entry.js +2 -2
- package/dist/esm/kup-form-editor.entry.js +400 -0
- package/dist/esm/kup-iframe.entry.js +3 -3
- package/dist/esm/kup-image-list.entry.js +224 -0
- package/dist/esm/kup-lazy.entry.js +3 -3
- package/dist/esm/kup-magic-box.entry.js +4 -4
- package/dist/esm/kup-manager-58b075b4.js +16686 -0
- package/dist/esm/kup-nav-bar.entry.js +3 -3
- package/dist/esm/kup-numeric-picker.entry.js +419 -0
- package/dist/esm/kup-photo-frame.entry.js +5 -5
- package/dist/esm/kup-probe.entry.js +2 -2
- package/dist/esm/kup-qlik.entry.js +2 -2
- package/dist/esm/kup-snackbar.entry.js +6 -6
- package/dist/esm/loader.js +3 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/{tslib.es6-8f2d44b6.js → tslib.es6-3eea2234.js} +1 -1
- package/dist/esm/{utils-35c7a90d.js → utils-d7e4b3c2.js} +2 -2
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-5d190cf5.js → p-1ae66cc5.js} +1 -1
- package/dist/ketchup/{p-8be1337b.js → p-34b74425.js} +1 -1
- package/dist/ketchup/{p-fea316ab.entry.js → p-3c11e615.entry.js} +1 -1
- package/dist/ketchup/p-44ec4f03.js +1 -0
- package/dist/ketchup/p-4ffbc3ff.js +1 -0
- package/dist/ketchup/p-5264a3e6.entry.js +1 -0
- package/dist/ketchup/{p-d7af8156.entry.js → p-65974e48.entry.js} +1 -1
- package/dist/ketchup/p-65b46587.entry.js +40 -0
- package/dist/ketchup/{p-3813281b.entry.js → p-6dff70f8.entry.js} +1 -1
- package/dist/ketchup/{p-33073f4a.js → p-7454cb92.js} +1 -1
- package/dist/ketchup/{p-a0b1d769.js → p-79b0730b.js} +1 -1
- package/dist/ketchup/p-7eff4eee.js +1 -0
- package/dist/ketchup/p-80968627.entry.js +1 -0
- package/dist/ketchup/{p-8c44c3b9.js → p-81605f08.js} +4 -5
- package/dist/ketchup/p-8cdf61a4.js +1 -0
- package/dist/ketchup/{p-f9c41e20.entry.js → p-954cc340.entry.js} +1 -1
- package/dist/ketchup/p-976244f9.entry.js +9 -0
- package/dist/ketchup/p-99e0d768.entry.js +1 -0
- package/dist/ketchup/{p-8f735633.entry.js → p-a0f6e25c.entry.js} +1 -1
- package/dist/ketchup/p-a203f78b.js +45 -0
- package/dist/ketchup/{p-9bcda66f.entry.js → p-a615a92b.entry.js} +1 -1
- package/dist/ketchup/p-aca0e54b.js +30 -0
- package/dist/ketchup/p-b8939a8b.entry.js +1 -0
- package/dist/ketchup/p-bfc3bac7.js +1 -0
- package/dist/ketchup/{p-67c64257.entry.js → p-c5ce8951.entry.js} +1 -1
- package/dist/ketchup/{p-68fc1428.entry.js → p-d2ee56dd.entry.js} +1 -1
- package/dist/ketchup/p-db71436b.entry.js +27 -0
- package/dist/ketchup/{p-10c8d755.js → p-e0035c58.js} +1 -1
- package/dist/ketchup/p-e1039cf2.entry.js +1 -0
- package/dist/ketchup/{p-b5e1dbfa.entry.js → p-ea10176c.entry.js} +1 -1
- package/dist/ketchup/p-f09f2f98.entry.js +1 -0
- package/dist/ketchup/{p-0751aaf6.entry.js → p-f71a1675.entry.js} +1 -1
- package/dist/ketchup/{p-4081f5f7.entry.js → p-fac1a08b.entry.js} +1 -1
- package/dist/types/components/kup-box/kup-box-declarations.d.ts +3 -5
- package/dist/types/components/kup-box/kup-box.d.ts +0 -22
- package/dist/types/components/kup-card/built-in/kup-card-built-in.d.ts +7 -0
- package/dist/types/components/kup-card/built-in/kup-card-numeric.d.ts +2 -0
- package/dist/types/components/kup-card/kup-card-declarations.d.ts +26 -1
- package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +4 -4
- package/dist/types/components/kup-data-table/kup-data-table.d.ts +5 -19
- package/dist/types/components/kup-form-editor/kup-form-editor-declarations.d.ts +79 -0
- package/dist/types/components/kup-form-editor/kup-form-editor.d.ts +72 -0
- package/dist/types/components/kup-image-list/kup-image-list-declarations.d.ts +14 -0
- package/dist/types/components/kup-image-list/kup-image-list.d.ts +56 -0
- package/dist/types/components/kup-numeric-picker/kup-numeric-picker-declarations.d.ts +19 -0
- package/dist/types/components/kup-numeric-picker/kup-numeric-picker.d.ts +121 -0
- package/dist/types/components/kup-tab-bar/kup-tab-bar-declarations.d.ts +3 -9
- package/dist/types/components/kup-tab-bar/kup-tab-bar.d.ts +6 -6
- package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +1 -5
- package/dist/types/components/kup-tree/kup-tree.d.ts +1 -24
- package/dist/types/components.d.ts +265 -232
- package/dist/types/managers/kup-data/kup-data-declarations.d.ts +1 -0
- package/dist/types/managers/kup-data/kup-data-node-helper.d.ts +7 -0
- package/dist/types/managers/kup-data/kup-data.d.ts +1 -0
- package/dist/types/managers/kup-language/kup-language-declarations.d.ts +2 -0
- package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +14 -0
- package/dist/types/managers/kup-manager/kup-manager.d.ts +14 -0
- package/dist/types/managers/kup-math/kup-math-declarations.d.ts +6 -0
- package/dist/types/managers/kup-math/kup-math.d.ts +2 -1
- package/dist/types/managers/kup-tooltip/kup-tooltip-declarations.d.ts +8 -0
- package/dist/types/managers/kup-tooltip/kup-tooltip.d.ts +51 -0
- package/dist/types/types/GenericTypes.d.ts +3 -0
- package/dist/types/utils/kup-column-menu/kup-column-menu.d.ts +1 -3
- package/package.json +16 -15
- package/dist/cjs/kup-manager-4227f0a2.js +0 -8582
- package/dist/collection/assets/tooltip.js +0 -73
- package/dist/collection/components/kup-tooltip/kup-tooltip-declarations.js +0 -20
- package/dist/collection/components/kup-tooltip/kup-tooltip.css +0 -149
- package/dist/collection/components/kup-tooltip/kup-tooltip.js +0 -1205
- package/dist/collection/utils/helpers.js +0 -38
- package/dist/esm/kup-manager-0ab94726.js +0 -8565
- package/dist/ketchup/p-24df4f29.entry.js +0 -27
- package/dist/ketchup/p-2d4f19f4.js +0 -1
- package/dist/ketchup/p-3445be1e.entry.js +0 -1
- package/dist/ketchup/p-3aab1f0d.entry.js +0 -1
- package/dist/ketchup/p-47b57d97.js +0 -1
- package/dist/ketchup/p-5186885c.entry.js +0 -1
- package/dist/ketchup/p-78223dc0.entry.js +0 -143
- package/dist/ketchup/p-96101f09.entry.js +0 -39
- package/dist/ketchup/p-c314b1e6.js +0 -1
- package/dist/ketchup/p-ee33cbe9.js +0 -9
- package/dist/types/components/kup-tooltip/kup-tooltip-declarations.d.ts +0 -93
- package/dist/types/components/kup-tooltip/kup-tooltip.d.ts +0 -142
- package/dist/types/utils/helpers.d.ts +0 -4
|
@@ -190169,125 +190169,6 @@ let treeLayoutFixedEl = document.getElementById('tree-layout-fixed');
|
|
|
190169
190169
|
if (treeLayoutFixedEl != null) {
|
|
190170
190170
|
treeLayoutFixedEl.columns = tlfCols;
|
|
190171
190171
|
treeLayoutFixedEl.data = tlfData;
|
|
190172
|
-
treeLayoutFixedEl.addEventListener('kup-tooltip-loaddata', ({ detail }) => {
|
|
190173
|
-
console.log(JSON.stringify(detail));
|
|
190174
|
-
onLoadData(detail);
|
|
190175
|
-
});
|
|
190176
|
-
treeLayoutFixedEl.addEventListener(
|
|
190177
|
-
'kup-tooltip-loaddetail',
|
|
190178
|
-
({ detail }) => {
|
|
190179
|
-
console.log(JSON.stringify(detail));
|
|
190180
|
-
onLoadDetailData(detail);
|
|
190181
|
-
}
|
|
190182
|
-
);
|
|
190183
|
-
}
|
|
190184
|
-
|
|
190185
|
-
function onLoadData(detail) {
|
|
190186
|
-
detail.comp.data = {
|
|
190187
|
-
//image: this.images.bornToDie,
|
|
190188
|
-
title: 'Born to die',
|
|
190189
|
-
content: {
|
|
190190
|
-
info1: {
|
|
190191
|
-
label: 'Author',
|
|
190192
|
-
value: 'Lana del Rey',
|
|
190193
|
-
},
|
|
190194
|
-
info2: {
|
|
190195
|
-
label: 'Year',
|
|
190196
|
-
value: 2012,
|
|
190197
|
-
},
|
|
190198
|
-
},
|
|
190199
|
-
};
|
|
190200
|
-
console.log('data:' + JSON.stringify(detail.comp.data));
|
|
190201
|
-
}
|
|
190202
|
-
|
|
190203
|
-
function onLoadDetailData(detail) {
|
|
190204
|
-
detail.comp.detailData = {
|
|
190205
|
-
columns: [
|
|
190206
|
-
{
|
|
190207
|
-
name: 'label',
|
|
190208
|
-
title: 'Label',
|
|
190209
|
-
size: '10',
|
|
190210
|
-
},
|
|
190211
|
-
{
|
|
190212
|
-
name: 'value',
|
|
190213
|
-
title: 'Value',
|
|
190214
|
-
size: '10',
|
|
190215
|
-
},
|
|
190216
|
-
],
|
|
190217
|
-
rows: [
|
|
190218
|
-
{
|
|
190219
|
-
cells: {
|
|
190220
|
-
label: {
|
|
190221
|
-
value: 'Born to die',
|
|
190222
|
-
},
|
|
190223
|
-
value: {
|
|
190224
|
-
value: '4:46',
|
|
190225
|
-
},
|
|
190226
|
-
},
|
|
190227
|
-
},
|
|
190228
|
-
{
|
|
190229
|
-
cells: {
|
|
190230
|
-
label: {
|
|
190231
|
-
value: 'Off to the races',
|
|
190232
|
-
},
|
|
190233
|
-
value: {
|
|
190234
|
-
value: '5:00',
|
|
190235
|
-
},
|
|
190236
|
-
},
|
|
190237
|
-
},
|
|
190238
|
-
{
|
|
190239
|
-
cells: {
|
|
190240
|
-
label: {
|
|
190241
|
-
value: 'Blue jeans',
|
|
190242
|
-
},
|
|
190243
|
-
value: {
|
|
190244
|
-
value: '3:29',
|
|
190245
|
-
},
|
|
190246
|
-
},
|
|
190247
|
-
},
|
|
190248
|
-
],
|
|
190249
|
-
actions: {
|
|
190250
|
-
/** Ne metto 7 per verificare se vengono visualizzati solo i primi 5 */
|
|
190251
|
-
command: [
|
|
190252
|
-
{
|
|
190253
|
-
text: 'Attiva il riconoscimento facciale',
|
|
190254
|
-
icon: 'face',
|
|
190255
|
-
exec: 'F(EXD;*SCO;) 1(CN;CLI;C0001)',
|
|
190256
|
-
},
|
|
190257
|
-
{
|
|
190258
|
-
text: 'Accendi la luce',
|
|
190259
|
-
icon: 'lightbulb-on',
|
|
190260
|
-
exec: 'F(EXD;*SCO;) 1(CN;CLI;C0002)',
|
|
190261
|
-
},
|
|
190262
|
-
{
|
|
190263
|
-
text: 'Leggi gli ultimi feed rss',
|
|
190264
|
-
icon: 'rss',
|
|
190265
|
-
exec: 'F(EXD;*SCO;) 1(CN;CLI;C0003)',
|
|
190266
|
-
},
|
|
190267
|
-
{
|
|
190268
|
-
text: 'Accedi a videocorso su udemy',
|
|
190269
|
-
icon: 'school',
|
|
190270
|
-
exec: 'F(EXD;*SCO;) 1(CN;CLI;C0004)',
|
|
190271
|
-
},
|
|
190272
|
-
{
|
|
190273
|
-
text: 'Sblocca la serratura della cantina',
|
|
190274
|
-
icon: 'lock_open',
|
|
190275
|
-
exec: 'F(EXD;*SCO;) 1(CN;CLI;C0005)',
|
|
190276
|
-
},
|
|
190277
|
-
{
|
|
190278
|
-
text: "Fai qualcosa d'altro",
|
|
190279
|
-
icon: 'play',
|
|
190280
|
-
exec: 'F(EXD;*SCO;) 1(CN;CLI;C0005)',
|
|
190281
|
-
},
|
|
190282
|
-
{
|
|
190283
|
-
text: "Fai qualcosa d'altro",
|
|
190284
|
-
icon: 'play',
|
|
190285
|
-
exec: 'F(EXD;*SCO;) 1(CN;CLI;C0006)',
|
|
190286
|
-
},
|
|
190287
|
-
],
|
|
190288
|
-
},
|
|
190289
|
-
};
|
|
190290
|
-
console.log('detailData:' + JSON.stringify(detail.comp.detailData));
|
|
190291
190172
|
}
|
|
190292
190173
|
|
|
190293
190174
|
let tmCols = [
|
|
@@ -227779,15 +227660,6 @@ let treeMixedEl = document.getElementById('tree-mixed');
|
|
|
227779
227660
|
if (treeMixedEl != null) {
|
|
227780
227661
|
treeMixedEl.columns = tmCols;
|
|
227781
227662
|
treeMixedEl.data = tmData;
|
|
227782
|
-
/*
|
|
227783
|
-
treeMixedEl.addEventListener('kup-tooltip-loaddata', ({ detail }) => {
|
|
227784
|
-
console.log(JSON.stringify(detail));
|
|
227785
|
-
onLoadData(detail);
|
|
227786
|
-
});
|
|
227787
|
-
treeMixedEl.addEventListener('kup-tooltip-loaddetail', ({ detail }) => {
|
|
227788
|
-
console.log(JSON.stringify(detail));
|
|
227789
|
-
onLoadDetailData(detail);
|
|
227790
|
-
});*/
|
|
227791
227663
|
}
|
|
227792
227664
|
|
|
227793
227665
|
let f2Data = [
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
"entries": [
|
|
3
3
|
"./components/kup-card/kup-card.js",
|
|
4
4
|
"./components/kup-badge/kup-badge.js",
|
|
5
|
-
"./components/kup-tooltip/kup-tooltip.js",
|
|
6
|
-
"./components/kup-text-field/kup-text-field.js",
|
|
7
|
-
"./components/kup-chart/kup-chart.js",
|
|
8
|
-
"./components/kup-data-table/kup-data-table.js",
|
|
9
|
-
"./components/kup-tree/kup-tree.js",
|
|
10
5
|
"./components/kup-accordion/kup-accordion.js",
|
|
11
6
|
"./components/kup-autocomplete/kup-autocomplete.js",
|
|
7
|
+
"./components/kup-chart/kup-chart.js",
|
|
8
|
+
"./components/kup-tree/kup-tree.js",
|
|
9
|
+
"./components/kup-text-field/kup-text-field.js",
|
|
10
|
+
"./components/kup-data-table/kup-data-table.js",
|
|
12
11
|
"./components/kup-box/kup-box.js",
|
|
13
12
|
"./components/kup-button/kup-button.js",
|
|
14
13
|
"./components/kup-button-list/kup-button-list.js",
|
|
@@ -25,15 +24,18 @@
|
|
|
25
24
|
"./components/kup-dropdown-button/kup-dropdown-button.js",
|
|
26
25
|
"./components/kup-echart/kup-echart.js",
|
|
27
26
|
"./components/kup-field/kup-field.js",
|
|
27
|
+
"./components/kup-form-editor/kup-form-editor.js",
|
|
28
28
|
"./components/kup-gauge/kup-gauge.js",
|
|
29
29
|
"./components/kup-grid/kup-grid.js",
|
|
30
30
|
"./components/kup-iframe/kup-iframe.js",
|
|
31
31
|
"./components/kup-image/kup-image.js",
|
|
32
|
+
"./components/kup-image-list/kup-image-list.js",
|
|
32
33
|
"./components/kup-lazy/kup-lazy.js",
|
|
33
34
|
"./components/kup-radio/kup-radio.js",
|
|
34
35
|
"./components/kup-list/kup-list.js",
|
|
35
36
|
"./components/kup-magic-box/kup-magic-box.js",
|
|
36
37
|
"./components/kup-nav-bar/kup-nav-bar.js",
|
|
38
|
+
"./components/kup-numeric-picker/kup-numeric-picker.js",
|
|
37
39
|
"./components/kup-photo-frame/kup-photo-frame.js",
|
|
38
40
|
"./components/kup-probe/kup-probe.js",
|
|
39
41
|
"./components/kup-progress-bar/kup-progress-bar.js",
|
|
@@ -47,7 +49,7 @@
|
|
|
47
49
|
],
|
|
48
50
|
"compiler": {
|
|
49
51
|
"name": "@stencil/core",
|
|
50
|
-
"version": "2.
|
|
52
|
+
"version": "2.15.2",
|
|
51
53
|
"typescriptVersion": "4.5.4"
|
|
52
54
|
},
|
|
53
55
|
"collections": [],
|
|
@@ -25,13 +25,9 @@ export var KupBoxProps;
|
|
|
25
25
|
KupBoxProps["selectBox"] = "Automatically selects the box at the specified index.";
|
|
26
26
|
KupBoxProps["selectedRowsState"] = "Multiple selection.";
|
|
27
27
|
KupBoxProps["showSelection"] = "If enabled, highlights the selected box/boxes.";
|
|
28
|
-
KupBoxProps["showTooltipOnRightClick"] = "If set to true, displays tooltip on right click; if set to false, displays tooltip on mouseOver.";
|
|
29
28
|
KupBoxProps["sortBy"] = "If sorting is enabled, specifies which column to sort.";
|
|
30
29
|
KupBoxProps["sortEnabled"] = "Enable sorting.";
|
|
31
30
|
KupBoxProps["stateId"] = "";
|
|
32
31
|
KupBoxProps["store"] = "";
|
|
33
32
|
KupBoxProps["swipeDisabled"] = "Disable swipe.";
|
|
34
|
-
KupBoxProps["tooltipDetailTimeout"] = "Defines the timeout for tooltip detail.";
|
|
35
|
-
KupBoxProps["tooltipEnabled"] = "Enable show tooltip.";
|
|
36
|
-
KupBoxProps["tooltipLoadTimeout"] = "Defines the timeout for tooltip load.";
|
|
37
33
|
})(KupBoxProps || (KupBoxProps = {}));
|
|
@@ -5,7 +5,6 @@ import { getColumnByName } from '../../utils/cell-utils';
|
|
|
5
5
|
import { filterRows, sortRows, paginateRows, } from '../kup-data-table/kup-data-table-helper';
|
|
6
6
|
import { kupManagerInstance, } from '../../managers/kup-manager/kup-manager';
|
|
7
7
|
import { KupBoxState } from './kup-box-state';
|
|
8
|
-
import { setTooltip, unsetTooltip } from '../../utils/helpers';
|
|
9
8
|
import { getProps, identify, setProps } from '../../utils/utils';
|
|
10
9
|
import { FImage } from '../../f-components/f-image/f-image';
|
|
11
10
|
import { FChip } from '../../f-components/f-chip/f-chip';
|
|
@@ -123,11 +122,6 @@ export class KupBox {
|
|
|
123
122
|
* @default true
|
|
124
123
|
*/
|
|
125
124
|
this.showSelection = true;
|
|
126
|
-
/**
|
|
127
|
-
* If set to true, displays tooltip on right click; if set to false, displays tooltip on mouseOver.
|
|
128
|
-
* @default true
|
|
129
|
-
*/
|
|
130
|
-
this.showTooltipOnRightClick = true;
|
|
131
125
|
/**
|
|
132
126
|
* Enable sorting
|
|
133
127
|
* @default false
|
|
@@ -139,11 +133,6 @@ export class KupBox {
|
|
|
139
133
|
* @default false
|
|
140
134
|
*/
|
|
141
135
|
this.swipeDisabled = false;
|
|
142
|
-
/**
|
|
143
|
-
* Enable show tooltip
|
|
144
|
-
* @default true
|
|
145
|
-
*/
|
|
146
|
-
this.tooltipEnabled = true;
|
|
147
136
|
/*-------------------------------------------------*/
|
|
148
137
|
/* I n t e r n a l V a r i a b l e s */
|
|
149
138
|
/*-------------------------------------------------*/
|
|
@@ -386,7 +375,7 @@ export class KupBox {
|
|
|
386
375
|
});
|
|
387
376
|
}
|
|
388
377
|
}
|
|
389
|
-
getEventDetails(el) {
|
|
378
|
+
getEventDetails(el, e) {
|
|
390
379
|
let boxObject = null;
|
|
391
380
|
let cell = null;
|
|
392
381
|
let row = null;
|
|
@@ -402,16 +391,14 @@ export class KupBox {
|
|
|
402
391
|
}
|
|
403
392
|
return {
|
|
404
393
|
boxObject: boxObject ? boxObject : null,
|
|
405
|
-
row: row ? row : null,
|
|
406
394
|
column: column ? column : null,
|
|
407
395
|
cell: cell ? cell : null,
|
|
396
|
+
originalEvent: e,
|
|
397
|
+
row: row ? row : null,
|
|
408
398
|
};
|
|
409
399
|
}
|
|
410
400
|
contextMenuHandler(e) {
|
|
411
|
-
const details = this.getEventDetails(e.target);
|
|
412
|
-
if (this.showTooltipOnRightClick && details.boxObject && details.cell) {
|
|
413
|
-
setTooltip(e, details.row.id, details.column.name, details.cell, this.tooltip);
|
|
414
|
-
}
|
|
401
|
+
const details = this.getEventDetails(e.target, e);
|
|
415
402
|
return details;
|
|
416
403
|
}
|
|
417
404
|
/**
|
|
@@ -923,33 +910,14 @@ export class KupBox {
|
|
|
923
910
|
column = this.data.columns.find((x) => x.name === boxObject.column);
|
|
924
911
|
}
|
|
925
912
|
const cell = row.cells[boxObject.column];
|
|
926
|
-
let _hasTooltip = false;
|
|
927
913
|
let title = undefined;
|
|
928
|
-
if (
|
|
914
|
+
if (cell && !this.kupManager.objects.isEmptyKupObj(cell.obj)) {
|
|
929
915
|
classObj['is-obj'] = true;
|
|
930
916
|
if (this.kupManager.debug.isDebug()) {
|
|
931
917
|
title =
|
|
932
918
|
cell.obj.t + '; ' + cell.obj.p + '; ' + cell.obj.k + ';';
|
|
933
919
|
}
|
|
934
920
|
}
|
|
935
|
-
let tipEvents = null;
|
|
936
|
-
if (_hasTooltip) {
|
|
937
|
-
if (!this.showTooltipOnRightClick) {
|
|
938
|
-
tipEvents = {
|
|
939
|
-
onMouseEnter: (ev) => {
|
|
940
|
-
if (_hasTooltip) {
|
|
941
|
-
setTooltip(ev, row.id, boxObject.column, cell, this.tooltip);
|
|
942
|
-
}
|
|
943
|
-
else if (!_hasTooltip) {
|
|
944
|
-
unsetTooltip(this.tooltip);
|
|
945
|
-
}
|
|
946
|
-
},
|
|
947
|
-
onMouseLeave: () => {
|
|
948
|
-
unsetTooltip(this.tooltip);
|
|
949
|
-
},
|
|
950
|
-
};
|
|
951
|
-
}
|
|
952
|
-
}
|
|
953
921
|
const cellProps = {
|
|
954
922
|
cell: cell,
|
|
955
923
|
column: column,
|
|
@@ -960,7 +928,7 @@ export class KupBox {
|
|
|
960
928
|
setSizes: true,
|
|
961
929
|
shape: boxObject.shape,
|
|
962
930
|
};
|
|
963
|
-
return (h("div",
|
|
931
|
+
return (h("div", { "data-cell": cell, "data-row": row, "data-column": boxObject.column, class: classObj, style: boStyle, title: title }, cell && column ? (h(FCell, Object.assign({}, cellProps))) : (h("span", null, boxObject.value))));
|
|
964
932
|
}
|
|
965
933
|
/**
|
|
966
934
|
* Prepares the kanban sections by sorting the boxlist's data.
|
|
@@ -1053,14 +1021,6 @@ export class KupBox {
|
|
|
1053
1021
|
},
|
|
1054
1022
|
};
|
|
1055
1023
|
}
|
|
1056
|
-
renderTooltip() {
|
|
1057
|
-
if (this.tooltipEnabled == false) {
|
|
1058
|
-
return null;
|
|
1059
|
-
}
|
|
1060
|
-
return (h("kup-tooltip", { class: "box-tooltip", owner: this.rootElement.tagName, loadTimeout: this.showTooltipOnRightClick == true
|
|
1061
|
-
? 0
|
|
1062
|
-
: this.tooltipLoadTimeout, detailTimeout: this.tooltipDetailTimeout, ref: (el) => (this.tooltip = el) }));
|
|
1063
|
-
}
|
|
1064
1024
|
didLoadInteractables() {
|
|
1065
1025
|
this.interactableTouch.push(this.boxContainer);
|
|
1066
1026
|
const tapCb = (e) => {
|
|
@@ -1069,7 +1029,6 @@ export class KupBox {
|
|
|
1069
1029
|
return;
|
|
1070
1030
|
}
|
|
1071
1031
|
switch (e.button) {
|
|
1072
|
-
// right click
|
|
1073
1032
|
case 2:
|
|
1074
1033
|
this.kupBoxContextMenu.emit({
|
|
1075
1034
|
comp: this,
|
|
@@ -1266,7 +1225,6 @@ export class KupBox {
|
|
|
1266
1225
|
boxContent.push(this.renderRow(rows[cnt++]));
|
|
1267
1226
|
}
|
|
1268
1227
|
}
|
|
1269
|
-
const tooltip = this.renderTooltip();
|
|
1270
1228
|
return (h(Host, null,
|
|
1271
1229
|
h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)),
|
|
1272
1230
|
h("div", { id: componentWrapperId },
|
|
@@ -1276,12 +1234,8 @@ export class KupBox {
|
|
|
1276
1234
|
paginator,
|
|
1277
1235
|
h("div", { class: isKanban ? 'is-kanban' : '', id: 'box-container', style: containerStyle, onContextMenu: (e) => {
|
|
1278
1236
|
e.preventDefault();
|
|
1279
|
-
}, onMouseLeave: (ev) => {
|
|
1280
|
-
ev.stopPropagation();
|
|
1281
|
-
unsetTooltip(this.tooltip);
|
|
1282
1237
|
}, ref: (el) => (this.boxContainer =
|
|
1283
|
-
el) }, boxContent)
|
|
1284
|
-
tooltip))));
|
|
1238
|
+
el) }, boxContent)))));
|
|
1285
1239
|
}
|
|
1286
1240
|
disconnectedCallback() {
|
|
1287
1241
|
this.kupManager.interact.unregister(this.interactableDrag.concat(this.interactableDrop));
|
|
@@ -1776,27 +1730,6 @@ export class KupBox {
|
|
|
1776
1730
|
"reflect": false,
|
|
1777
1731
|
"defaultValue": "true"
|
|
1778
1732
|
},
|
|
1779
|
-
"showTooltipOnRightClick": {
|
|
1780
|
-
"type": "boolean",
|
|
1781
|
-
"mutable": false,
|
|
1782
|
-
"complexType": {
|
|
1783
|
-
"original": "boolean",
|
|
1784
|
-
"resolved": "boolean",
|
|
1785
|
-
"references": {}
|
|
1786
|
-
},
|
|
1787
|
-
"required": false,
|
|
1788
|
-
"optional": false,
|
|
1789
|
-
"docs": {
|
|
1790
|
-
"tags": [{
|
|
1791
|
-
"name": "default",
|
|
1792
|
-
"text": "true"
|
|
1793
|
-
}],
|
|
1794
|
-
"text": "If set to true, displays tooltip on right click; if set to false, displays tooltip on mouseOver."
|
|
1795
|
-
},
|
|
1796
|
-
"attribute": "show-tooltip-on-right-click",
|
|
1797
|
-
"reflect": false,
|
|
1798
|
-
"defaultValue": "true"
|
|
1799
|
-
},
|
|
1800
1733
|
"sortBy": {
|
|
1801
1734
|
"type": "string",
|
|
1802
1735
|
"mutable": true,
|
|
@@ -1896,67 +1829,6 @@ export class KupBox {
|
|
|
1896
1829
|
"attribute": "swipe-disabled",
|
|
1897
1830
|
"reflect": false,
|
|
1898
1831
|
"defaultValue": "false"
|
|
1899
|
-
},
|
|
1900
|
-
"tooltipDetailTimeout": {
|
|
1901
|
-
"type": "number",
|
|
1902
|
-
"mutable": false,
|
|
1903
|
-
"complexType": {
|
|
1904
|
-
"original": "number",
|
|
1905
|
-
"resolved": "number",
|
|
1906
|
-
"references": {}
|
|
1907
|
-
},
|
|
1908
|
-
"required": false,
|
|
1909
|
-
"optional": false,
|
|
1910
|
-
"docs": {
|
|
1911
|
-
"tags": [{
|
|
1912
|
-
"name": "default",
|
|
1913
|
-
"text": "undefined"
|
|
1914
|
-
}],
|
|
1915
|
-
"text": "Defines the timeout for tooltip detail"
|
|
1916
|
-
},
|
|
1917
|
-
"attribute": "tooltip-detail-timeout",
|
|
1918
|
-
"reflect": false
|
|
1919
|
-
},
|
|
1920
|
-
"tooltipEnabled": {
|
|
1921
|
-
"type": "boolean",
|
|
1922
|
-
"mutable": false,
|
|
1923
|
-
"complexType": {
|
|
1924
|
-
"original": "boolean",
|
|
1925
|
-
"resolved": "boolean",
|
|
1926
|
-
"references": {}
|
|
1927
|
-
},
|
|
1928
|
-
"required": false,
|
|
1929
|
-
"optional": false,
|
|
1930
|
-
"docs": {
|
|
1931
|
-
"tags": [{
|
|
1932
|
-
"name": "default",
|
|
1933
|
-
"text": "true"
|
|
1934
|
-
}],
|
|
1935
|
-
"text": "Enable show tooltip"
|
|
1936
|
-
},
|
|
1937
|
-
"attribute": "tooltip-enabled",
|
|
1938
|
-
"reflect": false,
|
|
1939
|
-
"defaultValue": "true"
|
|
1940
|
-
},
|
|
1941
|
-
"tooltipLoadTimeout": {
|
|
1942
|
-
"type": "number",
|
|
1943
|
-
"mutable": false,
|
|
1944
|
-
"complexType": {
|
|
1945
|
-
"original": "number",
|
|
1946
|
-
"resolved": "number",
|
|
1947
|
-
"references": {}
|
|
1948
|
-
},
|
|
1949
|
-
"required": false,
|
|
1950
|
-
"optional": false,
|
|
1951
|
-
"docs": {
|
|
1952
|
-
"tags": [{
|
|
1953
|
-
"name": "default",
|
|
1954
|
-
"text": "undefined"
|
|
1955
|
-
}],
|
|
1956
|
-
"text": "Defines the timeout for tooltip load"
|
|
1957
|
-
},
|
|
1958
|
-
"attribute": "tooltip-load-timeout",
|
|
1959
|
-
"reflect": false
|
|
1960
1832
|
}
|
|
1961
1833
|
}; }
|
|
1962
1834
|
static get states() { return {
|
|
@@ -3,6 +3,7 @@ import { KupCardCSSClasses } from '../kup-card-declarations';
|
|
|
3
3
|
import { prepareCalendar } from './kup-card-calendar';
|
|
4
4
|
import { prepareClock } from './kup-card-clock';
|
|
5
5
|
import { prepareColumnDropMenu } from './kup-card-column-drop-menu';
|
|
6
|
+
import { prepareNumeric } from './kup-card-numeric';
|
|
6
7
|
/**
|
|
7
8
|
* 1st built-in layout, calendar view.
|
|
8
9
|
* @param {KupCard} component - Card component.
|
|
@@ -36,3 +37,12 @@ export function create3(component) {
|
|
|
36
37
|
export function create4(component) {
|
|
37
38
|
return (h("div", { class: `built-in-layout-${component.layoutNumber} ${KupCardCSSClasses.BUILT_IN_CARD}` }));
|
|
38
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* 5th built-in layout, numeric picker.
|
|
42
|
+
* This layout is rendered after the render cycle completes.
|
|
43
|
+
* @param {KupCard} component - Card component.
|
|
44
|
+
* @returns {VNode} 4th built-in layout virtual node.
|
|
45
|
+
*/
|
|
46
|
+
export function create5(component) {
|
|
47
|
+
return (h("div", { class: `built-in-layout-${component.layoutNumber} ${KupCardCSSClasses.BUILT_IN_CARD}` }, prepareNumeric(component)));
|
|
48
|
+
}
|
|
@@ -119,8 +119,7 @@ function typeColumn(e, component) {
|
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
121
|
function listClick(e, options) {
|
|
122
|
-
|
|
123
|
-
switch (value) {
|
|
122
|
+
switch (e.detail.selected.id) {
|
|
124
123
|
case KupLanguageGeneric.MERGE:
|
|
125
124
|
if (options.mergeCb) {
|
|
126
125
|
options.mergeCb();
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { FButton } from '../../../f-components/f-button/f-button';
|
|
3
|
+
const dom = document.documentElement;
|
|
4
|
+
const maximumFractionDigits = 14;
|
|
5
|
+
export function prepareNumeric(component) {
|
|
6
|
+
const el = component.rootElement;
|
|
7
|
+
if (!el.kupData)
|
|
8
|
+
el.kupData = {
|
|
9
|
+
value: null,
|
|
10
|
+
localeValue: '',
|
|
11
|
+
};
|
|
12
|
+
let decimals = false;
|
|
13
|
+
let negative = false;
|
|
14
|
+
const options = getOptions(component);
|
|
15
|
+
if (options.resetStatus) {
|
|
16
|
+
el.kupData = {
|
|
17
|
+
value: null,
|
|
18
|
+
localeValue: '',
|
|
19
|
+
};
|
|
20
|
+
const obj = options.initialValue;
|
|
21
|
+
if (options.initialValue) {
|
|
22
|
+
if (obj && obj.k)
|
|
23
|
+
el.kupData.value = obj.k;
|
|
24
|
+
else
|
|
25
|
+
el.kupData.value = options.initialValue.toString();
|
|
26
|
+
el.kupData.localeValue = dom.ketchup.math.numbers.toLocaleString(el.kupData.value);
|
|
27
|
+
}
|
|
28
|
+
options.resetStatus = false;
|
|
29
|
+
}
|
|
30
|
+
if (options.negative)
|
|
31
|
+
negative = true;
|
|
32
|
+
if (options.decimals)
|
|
33
|
+
decimals = true;
|
|
34
|
+
const clearButtonProp = {
|
|
35
|
+
icon: 'cancel',
|
|
36
|
+
onClick: () => clearValue(component),
|
|
37
|
+
};
|
|
38
|
+
const saveButtonProp = {
|
|
39
|
+
icon: 'save',
|
|
40
|
+
onClick: () => saveValue(component),
|
|
41
|
+
};
|
|
42
|
+
const decChar = getDecimalChar();
|
|
43
|
+
return (h("table", null,
|
|
44
|
+
h("tr", null,
|
|
45
|
+
h("td", { colSpan: 3 },
|
|
46
|
+
h("div", { class: "value" }, el.kupData.localeValue))),
|
|
47
|
+
h("tr", null,
|
|
48
|
+
h("td", null,
|
|
49
|
+
h("div", { class: "number", onClick: () => setValue(component, '1') }, "1")),
|
|
50
|
+
h("td", null,
|
|
51
|
+
h("div", { class: "number", onClick: () => setValue(component, '2') }, "2")),
|
|
52
|
+
h("td", null,
|
|
53
|
+
h("div", { class: "number", onClick: () => setValue(component, '3') }, "3"))),
|
|
54
|
+
h("tr", null,
|
|
55
|
+
h("td", null,
|
|
56
|
+
h("div", { class: "number", onClick: () => setValue(component, '4') }, "4")),
|
|
57
|
+
h("td", null,
|
|
58
|
+
h("div", { class: "number", onClick: () => setValue(component, '5') }, "5")),
|
|
59
|
+
h("td", null,
|
|
60
|
+
h("div", { class: "number", onClick: () => setValue(component, '6') }, "6"))),
|
|
61
|
+
h("tr", null,
|
|
62
|
+
h("td", null,
|
|
63
|
+
h("div", { class: "number", onClick: () => setValue(component, '7') }, "7")),
|
|
64
|
+
h("td", null,
|
|
65
|
+
h("div", { class: "number", onClick: () => setValue(component, '8') }, "8")),
|
|
66
|
+
h("td", null,
|
|
67
|
+
h("div", { class: "number", onClick: () => setValue(component, '9') }, "9"))),
|
|
68
|
+
h("tr", null,
|
|
69
|
+
h("td", null, negative
|
|
70
|
+
? [
|
|
71
|
+
h("div", { class: "number", onClick: () => setSign(component) }, "-"),
|
|
72
|
+
]
|
|
73
|
+
: []),
|
|
74
|
+
h("td", null,
|
|
75
|
+
h("div", { class: "number", onClick: () => setValue(component, '0') }, "0")),
|
|
76
|
+
h("td", null, decimals
|
|
77
|
+
? [
|
|
78
|
+
h("div", { class: "number", onClick: () => setValue(component, '.') }, decChar),
|
|
79
|
+
]
|
|
80
|
+
: [])),
|
|
81
|
+
h("tr", null,
|
|
82
|
+
h("td", null),
|
|
83
|
+
h("td", null,
|
|
84
|
+
h(FButton, Object.assign({}, clearButtonProp))),
|
|
85
|
+
h("td", null,
|
|
86
|
+
h(FButton, Object.assign({}, saveButtonProp))))));
|
|
87
|
+
}
|
|
88
|
+
function getOptions(component) {
|
|
89
|
+
if (component.data.options)
|
|
90
|
+
return component.data.options;
|
|
91
|
+
else
|
|
92
|
+
return { resetStatus: false };
|
|
93
|
+
}
|
|
94
|
+
function setSign(component) {
|
|
95
|
+
const el = component.rootElement;
|
|
96
|
+
let strVal = el.kupData.value ? el.kupData.value : '0';
|
|
97
|
+
if (strVal.startsWith('-'))
|
|
98
|
+
return;
|
|
99
|
+
strVal = '-' + strVal;
|
|
100
|
+
el.kupData.value = strVal;
|
|
101
|
+
el.kupData.localeValue = dom.ketchup.math.numbers.toLocaleString(strVal);
|
|
102
|
+
component.refresh();
|
|
103
|
+
}
|
|
104
|
+
function setValue(component, value) {
|
|
105
|
+
const options = getOptions(component);
|
|
106
|
+
const el = component.rootElement;
|
|
107
|
+
const decChar = '.';
|
|
108
|
+
let strVal = el.kupData.value ? el.kupData.value.toString() : '0';
|
|
109
|
+
// if the first value is 0 and the character you want to insert is not a comma, I clear the field.
|
|
110
|
+
if (strVal == '0' && value != decChar) {
|
|
111
|
+
strVal = '';
|
|
112
|
+
}
|
|
113
|
+
// if I have already entered a decimal sign I stop.
|
|
114
|
+
if (value == decChar && strVal.includes(decChar))
|
|
115
|
+
return;
|
|
116
|
+
// if the text field contains the maximum number entered, excluding the comma, I stop.
|
|
117
|
+
if (options.maxLength &&
|
|
118
|
+
strVal.replace(decChar, '').length == options.maxLength)
|
|
119
|
+
return;
|
|
120
|
+
// if a maximum number of integers is required, and I don't have the comma, I check to be right with the values.
|
|
121
|
+
if (options.maxIntegers &&
|
|
122
|
+
value != decChar &&
|
|
123
|
+
!strVal.includes(decChar) &&
|
|
124
|
+
strVal.length == options.maxIntegers)
|
|
125
|
+
return;
|
|
126
|
+
// if a maximum number of decimals has been requested, check where we are.
|
|
127
|
+
if (options.maxDecimals &&
|
|
128
|
+
strVal.includes(decChar) &&
|
|
129
|
+
strVal.substring(strVal.indexOf(decChar) + 1).length ==
|
|
130
|
+
options.maxDecimals)
|
|
131
|
+
return;
|
|
132
|
+
// if the maximum number of decimals in JS has been reached, I stop.
|
|
133
|
+
if (strVal.includes(decChar) &&
|
|
134
|
+
strVal.substring(strVal.indexOf(decChar) + 1).length == 14)
|
|
135
|
+
return;
|
|
136
|
+
strVal += value;
|
|
137
|
+
el.kupData.value = strVal;
|
|
138
|
+
el.kupData.localeValue = dom.ketchup.math.numbers.toLocaleString(strVal);
|
|
139
|
+
component.refresh();
|
|
140
|
+
}
|
|
141
|
+
function clearValue(component) {
|
|
142
|
+
const el = component.rootElement;
|
|
143
|
+
el.kupData.value = null;
|
|
144
|
+
el.kupData.localeValue = '';
|
|
145
|
+
component.refresh();
|
|
146
|
+
}
|
|
147
|
+
function getDecimalChar() {
|
|
148
|
+
return (0.1).toLocaleString(dom.ketchup.math.locale).substring(1, 2);
|
|
149
|
+
}
|
|
150
|
+
function saveValue(component) {
|
|
151
|
+
const el = component.rootElement;
|
|
152
|
+
component.onKupClick(component.rootElement.id, el.kupData.value ? Number(el.kupData.value).toString() : '');
|
|
153
|
+
}
|