@sme.up/ketchup 6.2.0 → 6.3.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-5b69d882.js → f-button-94cb5f35.js} +2 -2
- package/dist/cjs/{f-cell-3a740c48.js → f-cell-76830a0d.js} +12 -14
- package/dist/cjs/{f-checkbox-57443ca3.js → f-checkbox-cd977193.js} +1 -1
- package/dist/cjs/{f-chip-02e83f82.js → f-chip-68d45fd3.js} +3 -3
- package/dist/cjs/{f-image-2a61ece2.js → f-image-0e71df7e.js} +2 -2
- package/dist/cjs/{f-paginator-utils-09126bdd.js → f-paginator-utils-46689c0a.js} +80 -403
- package/dist/cjs/{f-text-field-9ee20a67.js → f-text-field-b4229cef.js} +11 -3
- package/dist/cjs/{index-06b131ea.js → index-31125378.js} +9 -4
- package/dist/cjs/ketchup.cjs.js +3 -3
- package/dist/cjs/kup-accordion.cjs.entry.js +5 -6
- package/dist/cjs/kup-autocomplete_25.cjs.entry.js +116 -111
- package/dist/cjs/kup-box.cjs.entry.js +15 -17
- package/dist/cjs/kup-calendar.cjs.entry.js +9 -11
- package/dist/cjs/kup-cell.cjs.entry.js +9 -11
- package/dist/cjs/kup-dash-list.cjs.entry.js +5 -7
- package/dist/cjs/kup-dash_2.cjs.entry.js +4 -5
- package/dist/cjs/kup-dashboard.cjs.entry.js +76 -17
- package/dist/cjs/kup-drawer.cjs.entry.js +4 -5
- package/dist/cjs/kup-echart.cjs.entry.js +17 -19
- package/dist/cjs/kup-family-tree.cjs.entry.js +140 -64
- package/dist/cjs/kup-form.cjs.entry.js +10 -12
- package/dist/cjs/kup-iframe.cjs.entry.js +4 -5
- package/dist/cjs/kup-image-list.cjs.entry.js +10 -12
- package/dist/cjs/kup-lazy.cjs.entry.js +4 -5
- package/dist/cjs/kup-magic-box.cjs.entry.js +5 -6
- package/dist/cjs/{kup-manager-02acbb37.js → kup-manager-7c514a30.js} +1400 -369
- package/dist/cjs/kup-nav-bar.cjs.entry.js +4 -5
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +3 -3
- package/dist/cjs/kup-photo-frame.cjs.entry.js +4 -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 -7
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/collection/assets/dashboard.js +48 -0
- package/dist/collection/assets/family-tree.js +236 -19
- package/dist/collection/assets/index.js +4 -0
- package/dist/collection/assets/kupinteract.js +68 -0
- package/dist/collection/collection-manifest.json +5 -5
- package/dist/collection/components/kup-dashboard/kup-dashboard.css +7 -0
- package/dist/collection/components/kup-dashboard/kup-dashboard.js +67 -7
- package/dist/collection/components/kup-data-table/kup-data-table-helper.js +42 -30
- package/dist/collection/components/kup-echart/kup-echart.js +9 -9
- package/dist/collection/components/kup-family-tree/kup-family-tree-declarations.js +3 -1
- package/dist/collection/components/kup-family-tree/kup-family-tree.css +79 -9
- package/dist/collection/components/kup-family-tree/kup-family-tree.js +253 -65
- package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +1 -0
- package/dist/collection/components/kup-text-field/kup-text-field.js +27 -0
- package/dist/collection/f-components/f-text-field/f-text-field.js +9 -1
- package/dist/collection/managers/kup-data/kup-data-cell-helper.js +48 -15
- package/dist/collection/managers/kup-data/kup-data.js +5 -5
- package/dist/collection/managers/kup-interact/kup-interact.js +3 -5
- package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.js +2 -0
- package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover.js +131 -45
- package/dist/collection/utils/filters/filters-rows.js +4 -23
- package/dist/collection/utils/filters/filters-tree-items.js +2 -1
- package/dist/esm/{f-button-fd44ef70.js → f-button-cd948e50.js} +2 -2
- package/dist/esm/{f-cell-7b159a22.js → f-cell-474dd282.js} +6 -8
- package/dist/esm/{f-checkbox-c51c4a75.js → f-checkbox-e06cf07b.js} +1 -1
- package/dist/esm/{f-chip-c2e4c522.js → f-chip-d6f2eb94.js} +3 -3
- package/dist/esm/{f-image-2ab4b9aa.js → f-image-914a03ef.js} +2 -2
- package/dist/esm/{f-paginator-utils-ef537d82.js → f-paginator-utils-a4a52732.js} +44 -366
- package/dist/esm/{f-text-field-41c575eb.js → f-text-field-76341fe3.js} +11 -3
- package/dist/esm/{index-ad6ab214.js → index-e41330a5.js} +9 -4
- package/dist/esm/ketchup.js +3 -3
- package/dist/esm/kup-accordion.entry.js +3 -4
- package/dist/esm/kup-autocomplete_25.entry.js +17 -12
- package/dist/esm/kup-box.entry.js +9 -11
- package/dist/esm/kup-calendar.entry.js +5 -7
- package/dist/esm/kup-cell.entry.js +7 -9
- package/dist/esm/kup-dash-list.entry.js +2 -4
- package/dist/esm/kup-dash_2.entry.js +2 -3
- package/dist/esm/kup-dashboard.entry.js +74 -15
- package/dist/esm/kup-drawer.entry.js +2 -3
- package/dist/esm/kup-echart.entry.js +11 -13
- package/dist/esm/kup-family-tree.entry.js +138 -62
- package/dist/esm/kup-form.entry.js +7 -9
- package/dist/esm/kup-iframe.entry.js +2 -3
- package/dist/esm/kup-image-list.entry.js +8 -10
- package/dist/esm/kup-lazy.entry.js +2 -3
- package/dist/esm/kup-magic-box.entry.js +3 -4
- package/dist/esm/{kup-manager-22a475e6.js → kup-manager-86f440c7.js} +1379 -370
- package/dist/esm/kup-nav-bar.entry.js +2 -3
- package/dist/esm/kup-numeric-picker.entry.js +3 -3
- package/dist/esm/kup-photo-frame.entry.js +2 -3
- 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 +4 -5
- package/dist/esm/loader.js +3 -3
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/p-00e1133d.entry.js +9 -0
- package/dist/ketchup/p-066f344a.entry.js +1 -0
- package/dist/ketchup/p-0c6e0647.entry.js +1 -0
- package/dist/ketchup/p-151f7c17.entry.js +27 -0
- package/dist/ketchup/p-1e9c03b0.entry.js +1 -0
- package/dist/ketchup/{p-fc2b1229.js → p-21ea11cb.js} +3 -3
- package/dist/ketchup/{p-1959f835.entry.js → p-2f4e6c50.entry.js} +1 -1
- package/dist/ketchup/p-3586f59c.js +1 -0
- package/dist/ketchup/p-359fd90d.entry.js +1 -0
- package/dist/ketchup/{p-38d7584e.js → p-389fd0bf.js} +1 -1
- package/dist/ketchup/{p-cd5cfa7c.js → p-5552f156.js} +1 -1
- package/dist/ketchup/{p-264b1b19.entry.js → p-77aff9c1.entry.js} +1 -1
- package/dist/ketchup/{p-e9366aaf.entry.js → p-7cfdf53c.entry.js} +4 -4
- package/dist/ketchup/p-853a5178.entry.js +1 -0
- package/dist/ketchup/{p-edae3076.js → p-8673bd4e.js} +1 -1
- package/dist/ketchup/p-8b55b786.entry.js +1 -0
- package/dist/ketchup/p-95f5834b.entry.js +1 -0
- package/dist/ketchup/p-a2c595c4.js +1 -0
- package/dist/ketchup/p-ae91f27e.entry.js +1 -0
- package/dist/ketchup/{p-928c5c36.js → p-af664379.js} +1 -1
- package/dist/ketchup/p-b0b3989b.js +2 -0
- package/dist/ketchup/p-b3b65a61.entry.js +1 -0
- package/dist/ketchup/p-bc306a53.entry.js +1 -0
- package/dist/ketchup/{p-42080355.entry.js → p-c3783b77.entry.js} +1 -1
- package/dist/ketchup/{p-dc62a30f.js → p-cd4fc3fb.js} +1 -1
- package/dist/ketchup/p-cee76b14.entry.js +1 -0
- package/dist/ketchup/p-cfaea29b.entry.js +1 -0
- package/dist/ketchup/p-d2f51e7b.entry.js +1 -0
- package/dist/ketchup/p-df8e6a4d.entry.js +1 -0
- package/dist/ketchup/p-e60a1170.entry.js +1 -0
- package/dist/ketchup/p-e9a1ba04.entry.js +1 -0
- package/dist/types/components/kup-dashboard/kup-dashboard.d.ts +6 -1
- package/dist/types/components/kup-family-tree/kup-family-tree-declarations.d.ts +7 -3
- package/dist/types/components/kup-family-tree/kup-family-tree.d.ts +26 -5
- package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +1 -0
- package/dist/types/components/kup-text-field/kup-text-field.d.ts +5 -0
- package/dist/types/components.d.ts +49 -7
- package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +1 -0
- package/dist/types/managers/kup-data/kup-data-cell-helper.d.ts +13 -6
- package/dist/types/managers/kup-data/kup-data.d.ts +2 -1
- package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.d.ts +9 -1
- package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover.d.ts +7 -5
- package/dist/types/utils/filters/filters-rows.d.ts +0 -2
- package/package.json +2 -2
- package/dist/cjs/cell-utils-fe64a28c.js +0 -168
- package/dist/cjs/utils-4b208b48.js +0 -447
- package/dist/esm/cell-utils-cb5d4149.js +0 -160
- package/dist/esm/utils-2c1f4122.js +0 -428
- package/dist/ketchup/p-06c6cc68.js +0 -1
- package/dist/ketchup/p-0dacd4bc.entry.js +0 -1
- package/dist/ketchup/p-1c44dc62.entry.js +0 -1
- package/dist/ketchup/p-4bc9f98b.entry.js +0 -1
- package/dist/ketchup/p-578583db.entry.js +0 -1
- package/dist/ketchup/p-5866d507.entry.js +0 -1
- package/dist/ketchup/p-61059e9d.entry.js +0 -9
- package/dist/ketchup/p-664be494.entry.js +0 -1
- package/dist/ketchup/p-67cd575d.entry.js +0 -1
- package/dist/ketchup/p-682a367a.js +0 -1
- package/dist/ketchup/p-6ccf7eb2.entry.js +0 -1
- package/dist/ketchup/p-7230ab97.entry.js +0 -1
- package/dist/ketchup/p-752b4cef.entry.js +0 -1
- package/dist/ketchup/p-7de3e7ac.entry.js +0 -1
- package/dist/ketchup/p-9b36497d.entry.js +0 -1
- package/dist/ketchup/p-b982d137.entry.js +0 -1
- package/dist/ketchup/p-c0219e5e.js +0 -1
- package/dist/ketchup/p-c55fd0a7.entry.js +0 -1
- package/dist/ketchup/p-d154b3a0.entry.js +0 -1
- package/dist/ketchup/p-d2affb6f.entry.js +0 -27
- package/dist/ketchup/p-d3b542b3.js +0 -2
- package/dist/ketchup/p-d6c12c6c.js +0 -1
- package/dist/ketchup/p-da0eab60.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getAssetPath, s as setAssetPath } from './index-
|
|
1
|
+
import { a as getAssetPath, s as setAssetPath } from './index-e41330a5.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Props of the kup-card component.
|
|
@@ -336,7 +336,7 @@ var __classPrivateFieldGet$3 = (undefined && undefined.__classPrivateFieldGet) |
|
|
|
336
336
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
337
337
|
};
|
|
338
338
|
var _KupDebug_debugWidget;
|
|
339
|
-
const dom$
|
|
339
|
+
const dom$i = document.documentElement;
|
|
340
340
|
/**
|
|
341
341
|
* Debugging suite, used to log messages and statuses from the Ketchup components.
|
|
342
342
|
* @module KupDebug
|
|
@@ -383,32 +383,32 @@ class KupDebug {
|
|
|
383
383
|
*/
|
|
384
384
|
showWidget() {
|
|
385
385
|
const debugWidget = document.createElement('kup-card');
|
|
386
|
-
const languages = dom$
|
|
386
|
+
const languages = dom$i.ketchup.language.getLanguages();
|
|
387
387
|
const languagesListData = [];
|
|
388
388
|
for (let index = 0; index < languages.length; index++) {
|
|
389
389
|
languagesListData.push({
|
|
390
390
|
id: languages[index],
|
|
391
|
-
selected: languages[index] === dom$
|
|
391
|
+
selected: languages[index] === dom$i.ketchup.language.name
|
|
392
392
|
? true
|
|
393
393
|
: false,
|
|
394
394
|
value: languages[index],
|
|
395
395
|
});
|
|
396
396
|
}
|
|
397
|
-
const themes = dom$
|
|
397
|
+
const themes = dom$i.ketchup.theme.getThemes();
|
|
398
398
|
const themesListData = [];
|
|
399
399
|
for (let index = 0; index < themes.length; index++) {
|
|
400
400
|
themesListData.push({
|
|
401
401
|
id: themes[index],
|
|
402
|
-
selected: themes[index] === dom$
|
|
402
|
+
selected: themes[index] === dom$i.ketchup.theme.name ? true : false,
|
|
403
403
|
value: themes[index],
|
|
404
404
|
});
|
|
405
405
|
}
|
|
406
|
-
const locales = dom$
|
|
406
|
+
const locales = dom$i.ketchup.dates.getLocales();
|
|
407
407
|
const localesListData = [];
|
|
408
408
|
for (let index = 0; index < locales.length; index++) {
|
|
409
409
|
localesListData.push({
|
|
410
410
|
id: locales[index],
|
|
411
|
-
selected: locales[index] === dom$
|
|
411
|
+
selected: locales[index] === dom$i.ketchup.dates.locale ? true : false,
|
|
412
412
|
value: locales[index],
|
|
413
413
|
});
|
|
414
414
|
}
|
|
@@ -418,13 +418,13 @@ class KupDebug {
|
|
|
418
418
|
icon: 'power_settings_new',
|
|
419
419
|
id: 'kup-debug-off',
|
|
420
420
|
customStyle: ':host {--kup-font-size: 0.875em; border-left: 1px solid var(--kup-border-color); border-right: 1px solid var(--kup-border-color);}',
|
|
421
|
-
title: dom$
|
|
421
|
+
title: dom$i.ketchup.language.translate(KupLanguageDebug.OFF),
|
|
422
422
|
},
|
|
423
423
|
{
|
|
424
424
|
customStyle: ':host {--kup-font-size: 0.875em;}',
|
|
425
425
|
icon: 'print',
|
|
426
426
|
id: 'kup-debug-print',
|
|
427
|
-
title: dom$
|
|
427
|
+
title: dom$i.ketchup.language.translate(KupLanguageDebug.PRINT),
|
|
428
428
|
},
|
|
429
429
|
{
|
|
430
430
|
checked: this.autoPrint,
|
|
@@ -432,20 +432,20 @@ class KupDebug {
|
|
|
432
432
|
icon: 'speaker_notes',
|
|
433
433
|
iconOff: 'speaker_notes_off',
|
|
434
434
|
id: 'kup-debug-autoprint',
|
|
435
|
-
title: dom$
|
|
435
|
+
title: dom$i.ketchup.language.translate(KupLanguageDebug.AUTOPRINT),
|
|
436
436
|
toggable: true,
|
|
437
437
|
},
|
|
438
438
|
{
|
|
439
439
|
customStyle: ':host {--kup-font-size: 0.875em;}',
|
|
440
440
|
icon: 'broom',
|
|
441
441
|
id: 'kup-debug-clear',
|
|
442
|
-
title: dom$
|
|
442
|
+
title: dom$i.ketchup.language.translate(KupLanguageDebug.CLEAR),
|
|
443
443
|
},
|
|
444
444
|
{
|
|
445
445
|
customStyle: ':host {--kup-font-size: 0.875em;}',
|
|
446
446
|
icon: 'delete',
|
|
447
447
|
id: 'kup-debug-delete',
|
|
448
|
-
title: dom$
|
|
448
|
+
title: dom$i.ketchup.language.translate(KupLanguageDebug.DUMP),
|
|
449
449
|
},
|
|
450
450
|
{
|
|
451
451
|
className: 'kup-full-height',
|
|
@@ -454,22 +454,22 @@ class KupDebug {
|
|
|
454
454
|
id: 'kup-debug-dl-props',
|
|
455
455
|
label: 'Props',
|
|
456
456
|
styling: 'flat',
|
|
457
|
-
title: dom$
|
|
457
|
+
title: dom$i.ketchup.language.translate(KupLanguageDebug.DL_PROPS),
|
|
458
458
|
},
|
|
459
459
|
{
|
|
460
460
|
className: 'kup-full-height',
|
|
461
461
|
customStyle: ':host {border-right: 1px solid var(--kup-border-color);}',
|
|
462
462
|
icon: 'download',
|
|
463
463
|
id: 'kup-debug-dl-all',
|
|
464
|
-
label: dom$
|
|
464
|
+
label: dom$i.ketchup.language.translate(KupLanguageDebug.DL_ALL),
|
|
465
465
|
styling: 'flat',
|
|
466
|
-
title: dom$
|
|
466
|
+
title: dom$i.ketchup.language.translate(KupLanguageDebug.DL_ALL),
|
|
467
467
|
},
|
|
468
468
|
{
|
|
469
469
|
customStyle: ':host {--kup-font-size: 0.875em;}',
|
|
470
470
|
icon: 'auto-fix',
|
|
471
471
|
id: 'kup-debug-magic-box',
|
|
472
|
-
title: dom$
|
|
472
|
+
title: dom$i.ketchup.language.translate(KupLanguageDebug.MAGIC_BOX),
|
|
473
473
|
},
|
|
474
474
|
],
|
|
475
475
|
combobox: [
|
|
@@ -484,11 +484,11 @@ class KupDebug {
|
|
|
484
484
|
className: 'kup-full-height',
|
|
485
485
|
emitSubmitEventOnEnter: false,
|
|
486
486
|
inputType: 'text',
|
|
487
|
-
label: dom$
|
|
487
|
+
label: dom$i.ketchup.language.translate(KupLanguageDebug.THEME_CHANGER),
|
|
488
488
|
},
|
|
489
489
|
},
|
|
490
490
|
id: 'kup-debug-theme-changer',
|
|
491
|
-
initialValue: dom$
|
|
491
|
+
initialValue: dom$i.ketchup.theme.name,
|
|
492
492
|
isSelect: true,
|
|
493
493
|
},
|
|
494
494
|
{
|
|
@@ -502,11 +502,11 @@ class KupDebug {
|
|
|
502
502
|
className: 'kup-full-height',
|
|
503
503
|
emitSubmitEventOnEnter: false,
|
|
504
504
|
inputType: 'text',
|
|
505
|
-
label: dom$
|
|
505
|
+
label: dom$i.ketchup.language.translate(KupLanguageDebug.LANGUAGE_CHANGER),
|
|
506
506
|
},
|
|
507
507
|
},
|
|
508
508
|
id: 'kup-debug-language-changer',
|
|
509
|
-
initialValue: dom$
|
|
509
|
+
initialValue: dom$i.ketchup.language.name,
|
|
510
510
|
isSelect: true,
|
|
511
511
|
},
|
|
512
512
|
{
|
|
@@ -520,11 +520,11 @@ class KupDebug {
|
|
|
520
520
|
className: 'kup-full-height',
|
|
521
521
|
emitSubmitEventOnEnter: false,
|
|
522
522
|
inputType: 'text',
|
|
523
|
-
label: dom$
|
|
523
|
+
label: dom$i.ketchup.language.translate(KupLanguageDebug.LOCALE_CHANGER),
|
|
524
524
|
},
|
|
525
525
|
},
|
|
526
526
|
id: 'kup-debug-locale-changer',
|
|
527
|
-
initialValue: dom$
|
|
527
|
+
initialValue: dom$i.ketchup.dates.locale,
|
|
528
528
|
isSelect: true,
|
|
529
529
|
},
|
|
530
530
|
],
|
|
@@ -532,7 +532,7 @@ class KupDebug {
|
|
|
532
532
|
{
|
|
533
533
|
className: 'kup-full-height',
|
|
534
534
|
id: 'kup-debug-log-limit',
|
|
535
|
-
label: dom$
|
|
535
|
+
label: dom$i.ketchup.language.translate(KupLanguageDebug.LOG_LIMIT),
|
|
536
536
|
initialValue: this.logLimit,
|
|
537
537
|
emitSubmitEventOnEnter: false,
|
|
538
538
|
inputType: 'number',
|
|
@@ -583,7 +583,7 @@ class KupDebug {
|
|
|
583
583
|
kupDebug.dump();
|
|
584
584
|
break;
|
|
585
585
|
case 'kup-debug-magic-box':
|
|
586
|
-
dom$
|
|
586
|
+
dom$i.ketchup.toggleMagicBox();
|
|
587
587
|
break;
|
|
588
588
|
case 'kup-debug-off':
|
|
589
589
|
kupDebug.toggle();
|
|
@@ -598,14 +598,14 @@ class KupDebug {
|
|
|
598
598
|
case 'kup-combobox-itemclick':
|
|
599
599
|
switch (compID) {
|
|
600
600
|
case 'kup-debug-language-changer':
|
|
601
|
-
dom$
|
|
601
|
+
dom$i.ketchup.language.set(compEvent.detail.value);
|
|
602
602
|
break;
|
|
603
603
|
case 'kup-debug-locale-changer':
|
|
604
|
-
dom$
|
|
605
|
-
dom$
|
|
604
|
+
dom$i.ketchup.dates.setLocale(compEvent.detail.value);
|
|
605
|
+
dom$i.ketchup.math.setLocale(compEvent.detail.value);
|
|
606
606
|
break;
|
|
607
607
|
case 'kup-debug-theme-changer':
|
|
608
|
-
dom$
|
|
608
|
+
dom$i.ketchup.theme.set(compEvent.detail.value);
|
|
609
609
|
break;
|
|
610
610
|
}
|
|
611
611
|
case 'kup-textfield-input':
|
|
@@ -667,7 +667,7 @@ class KupDebug {
|
|
|
667
667
|
// If the log is tied to a KupComponent, on click its props will be downloaded.
|
|
668
668
|
// Also, a different style will be applied to distinguish it between the others.
|
|
669
669
|
if (typeof this.logs[index].element == 'object') {
|
|
670
|
-
slot.title = dom$
|
|
670
|
+
slot.title = dom$i.ketchup.language.translate(KupLanguageDebug.DL_PROPS_COMP);
|
|
671
671
|
slot.style.fontWeight = 'bold';
|
|
672
672
|
slot.style.cursor = 'pointer';
|
|
673
673
|
slot.onclick = () => {
|
|
@@ -725,7 +725,7 @@ class KupDebug {
|
|
|
725
725
|
printLog[type] = [];
|
|
726
726
|
}
|
|
727
727
|
printLog[type].push({
|
|
728
|
-
date: dom$
|
|
728
|
+
date: dom$i.ketchup.dates.format(this.logs[index].date, 'LLL:ms'),
|
|
729
729
|
element: isComponent
|
|
730
730
|
? this.logs[index].element
|
|
731
731
|
: this.logs[index].id,
|
|
@@ -905,7 +905,7 @@ class KupDebug {
|
|
|
905
905
|
message: message,
|
|
906
906
|
};
|
|
907
907
|
if (this.logs.length > this.logLimit) {
|
|
908
|
-
console.warn(dom$
|
|
908
|
+
console.warn(dom$i.ketchup.dates.format(date, 'LLL:ms') +
|
|
909
909
|
' kup-debug => ' +
|
|
910
910
|
'Too many logs (> ' +
|
|
911
911
|
this.logLimit +
|
|
@@ -921,14 +921,14 @@ class KupDebug {
|
|
|
921
921
|
}
|
|
922
922
|
switch (category) {
|
|
923
923
|
case KupDebugCategory.ERROR:
|
|
924
|
-
console.error(dom$
|
|
924
|
+
console.error(dom$i.ketchup.dates.format(date, 'LLL:ms') + id + message, obj);
|
|
925
925
|
window.dispatchEvent(new CustomEvent('kup-debug-error', {
|
|
926
926
|
bubbles: true,
|
|
927
927
|
detail: { comp, date, message },
|
|
928
928
|
}));
|
|
929
929
|
break;
|
|
930
930
|
case KupDebugCategory.WARNING:
|
|
931
|
-
console.warn(dom$
|
|
931
|
+
console.warn(dom$i.ketchup.dates.format(date, 'LLL:ms') + id + message, obj);
|
|
932
932
|
break;
|
|
933
933
|
}
|
|
934
934
|
}
|
|
@@ -1015,7 +1015,7 @@ var KupDynamicPositionPlacement;
|
|
|
1015
1015
|
KupDynamicPositionPlacement["TOP_RIGHT"] = "tr";
|
|
1016
1016
|
})(KupDynamicPositionPlacement || (KupDynamicPositionPlacement = {}));
|
|
1017
1017
|
|
|
1018
|
-
const dom$
|
|
1018
|
+
const dom$h = document.documentElement;
|
|
1019
1019
|
/**
|
|
1020
1020
|
* This class is used to dynamically reposition HTML elements.
|
|
1021
1021
|
* @module KupDynamicPosition
|
|
@@ -1083,7 +1083,7 @@ class KupDynamicPosition {
|
|
|
1083
1083
|
const target = mutations[0].target;
|
|
1084
1084
|
if (target.classList.contains(kupDynamicPositionActiveClass)) {
|
|
1085
1085
|
requestAnimationFrame(function () {
|
|
1086
|
-
dom$
|
|
1086
|
+
dom$h.ketchup.dynamicPosition.run(el);
|
|
1087
1087
|
});
|
|
1088
1088
|
}
|
|
1089
1089
|
});
|
|
@@ -1140,7 +1140,7 @@ class KupDynamicPosition {
|
|
|
1140
1140
|
*/
|
|
1141
1141
|
run(el) {
|
|
1142
1142
|
if (!el.isConnected) {
|
|
1143
|
-
dom$
|
|
1143
|
+
dom$h.ketchup.dynamicPosition.managedElements.delete(el);
|
|
1144
1144
|
cancelAnimationFrame(el.kupDynamicPosition.rAF);
|
|
1145
1145
|
return;
|
|
1146
1146
|
}
|
|
@@ -1248,7 +1248,7 @@ class KupDynamicPosition {
|
|
|
1248
1248
|
// Recursive
|
|
1249
1249
|
if (!el.kupDynamicPosition.detach) {
|
|
1250
1250
|
el.kupDynamicPosition.rAF = requestAnimationFrame(function () {
|
|
1251
|
-
dom$
|
|
1251
|
+
dom$h.ketchup.dynamicPosition.run(el);
|
|
1252
1252
|
});
|
|
1253
1253
|
}
|
|
1254
1254
|
else {
|
|
@@ -1336,7 +1336,7 @@ var KupDropEventTypes;
|
|
|
1336
1336
|
KupDropEventTypes["MAGICBOX"] = "text/kup-magic-box-drag";
|
|
1337
1337
|
})(KupDropEventTypes || (KupDropEventTypes = {}));
|
|
1338
1338
|
|
|
1339
|
-
const dom$
|
|
1339
|
+
const dom$g = document.documentElement;
|
|
1340
1340
|
/**
|
|
1341
1341
|
* This class handles elements as dialogs, making them resizable and movable.
|
|
1342
1342
|
* @module KupInteract
|
|
@@ -1385,16 +1385,13 @@ class KupInteract {
|
|
|
1385
1385
|
draggable.kupDragDrop.ghostImage
|
|
1386
1386
|
? draggable.kupDragDrop.ghostImage
|
|
1387
1387
|
: e.target;
|
|
1388
|
-
const oldTransform = ghostImage.style.transform;
|
|
1389
1388
|
let x = parseFloat(ghostImage.getAttribute('data-x')) || 0;
|
|
1390
1389
|
let y = parseFloat(ghostImage.getAttribute('data-y')) || 0;
|
|
1391
1390
|
x = x + e.dx;
|
|
1392
1391
|
y = y + e.dy;
|
|
1393
1392
|
ghostImage.style.transform = `translate(${x}px, ${y}px)`;
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
ghostImage.setAttribute('data-y', y.toString());
|
|
1397
|
-
}
|
|
1393
|
+
ghostImage.setAttribute('data-x', x.toString());
|
|
1394
|
+
ghostImage.setAttribute('data-y', y.toString());
|
|
1398
1395
|
}
|
|
1399
1396
|
},
|
|
1400
1397
|
start(e) {
|
|
@@ -1437,11 +1434,12 @@ class KupInteract {
|
|
|
1437
1434
|
ghostImage.style.transition = 'none';
|
|
1438
1435
|
ghostImage.style.zIndex =
|
|
1439
1436
|
'calc(var(--kup-navbar-zindex) + 1)';
|
|
1440
|
-
dom$
|
|
1437
|
+
dom$g.ketchup.interact.container.appendChild(ghostImage);
|
|
1441
1438
|
draggable.kupDragDrop.ghostImage = ghostImage;
|
|
1442
1439
|
break;
|
|
1443
1440
|
case KupDragEffect.CLONE:
|
|
1444
1441
|
ghostImage = draggable.cloneNode(true);
|
|
1442
|
+
ghostImage.id = '';
|
|
1445
1443
|
ghostImage.style.cursor = 'grabbing';
|
|
1446
1444
|
ghostImage.style.height = draggable.clientHeight + 'px';
|
|
1447
1445
|
ghostImage.style.left =
|
|
@@ -1597,7 +1595,7 @@ class KupInteract {
|
|
|
1597
1595
|
x += e.deltaRect.left;
|
|
1598
1596
|
y += e.deltaRect.top;
|
|
1599
1597
|
el.style.transform = 'translate(' + x + 'px,' + y + 'px)';
|
|
1600
|
-
if (dom$
|
|
1598
|
+
if (dom$g.ketchup.interact.isInViewport(el, oldTransform, e.delta)) {
|
|
1601
1599
|
el.setAttribute('data-x', x.toString());
|
|
1602
1600
|
el.setAttribute('data-y', y.toString());
|
|
1603
1601
|
}
|
|
@@ -1649,7 +1647,7 @@ class KupInteract {
|
|
|
1649
1647
|
const callbacks = {
|
|
1650
1648
|
start(e) {
|
|
1651
1649
|
const el = e.currentTarget;
|
|
1652
|
-
el.style.zIndex = (dom$
|
|
1650
|
+
el.style.zIndex = (dom$g.ketchup.interact.zIndex++).toString();
|
|
1653
1651
|
},
|
|
1654
1652
|
};
|
|
1655
1653
|
this.draggable(el, {
|
|
@@ -1658,7 +1656,7 @@ class KupInteract {
|
|
|
1658
1656
|
interact.modifiers.restrictRect({
|
|
1659
1657
|
restriction: restrictContainer
|
|
1660
1658
|
? restrictContainer
|
|
1661
|
-
: dom$
|
|
1659
|
+
: dom$g.ketchup.interact.restrictContainer,
|
|
1662
1660
|
endOnly: true,
|
|
1663
1661
|
}),
|
|
1664
1662
|
],
|
|
@@ -2552,7 +2550,7 @@ const languages = {
|
|
|
2552
2550
|
spanish: spanish
|
|
2553
2551
|
};
|
|
2554
2552
|
|
|
2555
|
-
const dom$
|
|
2553
|
+
const dom$f = document.documentElement;
|
|
2556
2554
|
/**
|
|
2557
2555
|
* Handles the translation to different languages.
|
|
2558
2556
|
* @module KupLanguage
|
|
@@ -2606,7 +2604,7 @@ class KupLanguage {
|
|
|
2606
2604
|
return invalidKey(key);
|
|
2607
2605
|
}
|
|
2608
2606
|
function invalidKey(key) {
|
|
2609
|
-
dom$
|
|
2607
|
+
dom$f.ketchup.debug.logMessage('kup-language', 'Invalid translation for key (' + key + ')!', KupDebugCategory.WARNING);
|
|
2610
2608
|
return key;
|
|
2611
2609
|
}
|
|
2612
2610
|
}
|
|
@@ -2619,7 +2617,7 @@ class KupLanguage {
|
|
|
2619
2617
|
language = language.toLowerCase();
|
|
2620
2618
|
}
|
|
2621
2619
|
else {
|
|
2622
|
-
dom$
|
|
2620
|
+
dom$f.ketchup.debug.logMessage('kup-language', "Couldn't set language, invalid string received (" +
|
|
2623
2621
|
language +
|
|
2624
2622
|
')!', KupDebugCategory.WARNING);
|
|
2625
2623
|
return;
|
|
@@ -2629,12 +2627,12 @@ class KupLanguage {
|
|
|
2629
2627
|
const dVariant = decodedLanguage.variant;
|
|
2630
2628
|
if (this.list[dLanguage]) {
|
|
2631
2629
|
if (dVariant && !this.list[dLanguage].variants[dVariant]) {
|
|
2632
|
-
dom$
|
|
2630
|
+
dom$f.ketchup.debug.logMessage('kup-language', 'Variant not found (' + dVariant + ')!', KupDebugCategory.WARNING);
|
|
2633
2631
|
return;
|
|
2634
2632
|
}
|
|
2635
2633
|
}
|
|
2636
2634
|
else {
|
|
2637
|
-
dom$
|
|
2635
|
+
dom$f.ketchup.debug.logMessage('kup-language', 'Language not found (' + dLanguage + ')!', KupDebugCategory.WARNING);
|
|
2638
2636
|
return;
|
|
2639
2637
|
}
|
|
2640
2638
|
this.name = language;
|
|
@@ -2721,7 +2719,7 @@ const obj = {
|
|
|
2721
2719
|
types: types
|
|
2722
2720
|
};
|
|
2723
2721
|
|
|
2724
|
-
const dom$
|
|
2722
|
+
const dom$e = document.documentElement;
|
|
2725
2723
|
/**
|
|
2726
2724
|
* Handles objects definition and validation.
|
|
2727
2725
|
* @module KupObjects
|
|
@@ -3046,9 +3044,9 @@ class KupObjects {
|
|
|
3046
3044
|
*/
|
|
3047
3045
|
parseDate(obj) {
|
|
3048
3046
|
if (obj.t === 'D8' && obj.p === '*DMYY') {
|
|
3049
|
-
return dom$
|
|
3047
|
+
return dom$e.ketchup.dates.toDayjs(obj.k, 'DDMMYYYY');
|
|
3050
3048
|
}
|
|
3051
|
-
return dom$
|
|
3049
|
+
return dom$e.ketchup.dates.toDayjs(obj.k);
|
|
3052
3050
|
}
|
|
3053
3051
|
/**
|
|
3054
3052
|
* Check whether two JS objects are deeply equal. When the arguments aren't objects, they are tested directly for equity.
|
|
@@ -3103,8 +3101,10 @@ class KupObjects {
|
|
|
3103
3101
|
*/
|
|
3104
3102
|
var ScrollOnHoverDirection;
|
|
3105
3103
|
(function (ScrollOnHoverDirection) {
|
|
3104
|
+
ScrollOnHoverDirection["BOTTOM"] = "bottom";
|
|
3106
3105
|
ScrollOnHoverDirection["LEFT"] = "left";
|
|
3107
3106
|
ScrollOnHoverDirection["RIGHT"] = "right";
|
|
3107
|
+
ScrollOnHoverDirection["TOP"] = "top";
|
|
3108
3108
|
})(ScrollOnHoverDirection || (ScrollOnHoverDirection = {}));
|
|
3109
3109
|
|
|
3110
3110
|
var __classPrivateFieldSet$2 = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
@@ -3118,8 +3118,8 @@ var __classPrivateFieldGet$2 = (undefined && undefined.__classPrivateFieldGet) |
|
|
|
3118
3118
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
3119
3119
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
3120
3120
|
};
|
|
3121
|
-
var _KupScrollOnHover_arrowsContainer, _KupScrollOnHover_leftArrows, _KupScrollOnHover_rightArrows, _KupScrollOnHover_scrollEvent, _KupScrollOnHover_mousemoveEvent, _KupScrollOnHover_mouseleaveEvent, _KupScrollOnHover_rAF, _KupScrollOnHover_timeout;
|
|
3122
|
-
const dom$
|
|
3121
|
+
var _KupScrollOnHover_instances, _KupScrollOnHover_arrowsContainer, _KupScrollOnHover_leftArrows, _KupScrollOnHover_rightArrows, _KupScrollOnHover_scrollEvent, _KupScrollOnHover_mousemoveEvent, _KupScrollOnHover_mouseleaveEvent, _KupScrollOnHover_rAF, _KupScrollOnHover_timeout, _KupScrollOnHover_initArrows;
|
|
3122
|
+
const dom$d = document.documentElement;
|
|
3123
3123
|
/**
|
|
3124
3124
|
* Lets the user scroll an element's overflow by hovering with the mouse on its left/right edge.
|
|
3125
3125
|
* @module KupScrollOnHover
|
|
@@ -3131,6 +3131,7 @@ class KupScrollOnHover {
|
|
|
3131
3131
|
* @param {number} step - The amount in pixels for each scroll recursion.
|
|
3132
3132
|
*/
|
|
3133
3133
|
constructor(delay, step) {
|
|
3134
|
+
_KupScrollOnHover_instances.add(this);
|
|
3134
3135
|
_KupScrollOnHover_arrowsContainer.set(this, void 0);
|
|
3135
3136
|
_KupScrollOnHover_leftArrows.set(this, void 0);
|
|
3136
3137
|
_KupScrollOnHover_rightArrows.set(this, void 0);
|
|
@@ -3142,42 +3143,32 @@ class KupScrollOnHover {
|
|
|
3142
3143
|
this.delay = delay ? delay : 500;
|
|
3143
3144
|
this.managedElements = new Set();
|
|
3144
3145
|
this.step = step ? step : 50;
|
|
3145
|
-
__classPrivateFieldSet$2(this, _KupScrollOnHover_arrowsContainer, document.createElement('div'), "f");
|
|
3146
|
-
__classPrivateFieldSet$2(this, _KupScrollOnHover_leftArrows, [], "f");
|
|
3147
3146
|
__classPrivateFieldSet$2(this, _KupScrollOnHover_mouseleaveEvent, (event) => this.stop(event.target), "f");
|
|
3148
3147
|
__classPrivateFieldSet$2(this, _KupScrollOnHover_mousemoveEvent, (event) => this.start(event), "f");
|
|
3149
3148
|
__classPrivateFieldSet$2(this, _KupScrollOnHover_rAF, null, "f");
|
|
3150
|
-
__classPrivateFieldSet$2(this, _KupScrollOnHover_rightArrows, [], "f");
|
|
3151
3149
|
__classPrivateFieldSet$2(this, _KupScrollOnHover_scrollEvent, (event) => this.updateChildren(event.target), "f");
|
|
3152
3150
|
__classPrivateFieldSet$2(this, _KupScrollOnHover_timeout, null, "f");
|
|
3153
|
-
__classPrivateFieldGet$2(this, _KupScrollOnHover_arrowsContainer, "f").id = 'kup-scrolling-arrows';
|
|
3154
|
-
for (let index = 1; index < 4; index++) {
|
|
3155
|
-
const arrow = document.createElement('div');
|
|
3156
|
-
arrow.setAttribute('class', 'kup-left-scrolling-arrow kup-arrow-' + index);
|
|
3157
|
-
__classPrivateFieldGet$2(this, _KupScrollOnHover_leftArrows, "f").push(arrow);
|
|
3158
|
-
}
|
|
3159
|
-
for (let index = 1; index < 4; index++) {
|
|
3160
|
-
const arrow = document.createElement('div');
|
|
3161
|
-
arrow.setAttribute('class', 'kup-right-scrolling-arrow kup-arrow-' + index);
|
|
3162
|
-
__classPrivateFieldGet$2(this, _KupScrollOnHover_rightArrows, "f").push(arrow);
|
|
3163
|
-
}
|
|
3164
|
-
__classPrivateFieldGet$2(this, _KupScrollOnHover_arrowsContainer, "f").append(__classPrivateFieldGet$2(this, _KupScrollOnHover_leftArrows, "f")[2], __classPrivateFieldGet$2(this, _KupScrollOnHover_leftArrows, "f")[1], __classPrivateFieldGet$2(this, _KupScrollOnHover_leftArrows, "f")[0], __classPrivateFieldGet$2(this, _KupScrollOnHover_rightArrows, "f")[0], __classPrivateFieldGet$2(this, _KupScrollOnHover_rightArrows, "f")[1], __classPrivateFieldGet$2(this, _KupScrollOnHover_rightArrows, "f")[2]);
|
|
3165
|
-
this.container = document.createElement('div');
|
|
3166
|
-
this.container.setAttribute('kup-scroll-on-hover', '');
|
|
3167
|
-
this.container.appendChild(__classPrivateFieldGet$2(this, _KupScrollOnHover_arrowsContainer, "f"));
|
|
3168
|
-
document.body.appendChild(this.container);
|
|
3169
3151
|
}
|
|
3170
3152
|
/**
|
|
3171
3153
|
* Watches the given element in order to trigger the scroll on hover when conditions are met.
|
|
3172
3154
|
* Children nodes with the "hover-scrolling-child" will be watched and scrolled when el scrolls.
|
|
3173
3155
|
* @param {KupScrollOnHoverElement} el - Element to watch.
|
|
3156
|
+
* @param {boolean} vertical - Enables vertical scroll.
|
|
3157
|
+
* @param {KupScrollOnHoverPercentages} percentages - Sets how big is the area in which the scroll is enabled.
|
|
3174
3158
|
*/
|
|
3175
|
-
register(el) {
|
|
3159
|
+
register(el, vertical, percentages) {
|
|
3160
|
+
if (!__classPrivateFieldGet$2(this, _KupScrollOnHover_arrowsContainer, "f")) {
|
|
3161
|
+
__classPrivateFieldGet$2(this, _KupScrollOnHover_instances, "m", _KupScrollOnHover_initArrows).call(this);
|
|
3162
|
+
}
|
|
3176
3163
|
el.style.overflowX = 'auto';
|
|
3177
3164
|
el.scrollOnHover = {
|
|
3178
3165
|
active: false,
|
|
3179
3166
|
children: el.querySelectorAll('.hover-scrolling-child'),
|
|
3167
|
+
percentages: percentages
|
|
3168
|
+
? percentages
|
|
3169
|
+
: { back: 0.1, forward: 0.9 },
|
|
3180
3170
|
rect: null,
|
|
3171
|
+
vertical: vertical || null,
|
|
3181
3172
|
x: 0,
|
|
3182
3173
|
y: 0,
|
|
3183
3174
|
};
|
|
@@ -3222,14 +3213,19 @@ class KupScrollOnHover {
|
|
|
3222
3213
|
if (el.scrollOnHover.active || __classPrivateFieldGet$2(this, _KupScrollOnHover_timeout, "f")) {
|
|
3223
3214
|
return;
|
|
3224
3215
|
}
|
|
3216
|
+
let trueHeight = el.clientHeight;
|
|
3217
|
+
if (trueHeight === 0) {
|
|
3218
|
+
trueHeight = el.offsetHeight;
|
|
3219
|
+
}
|
|
3225
3220
|
let trueWidth = el.clientWidth;
|
|
3226
3221
|
if (trueWidth === 0) {
|
|
3227
3222
|
trueWidth = el.offsetWidth;
|
|
3228
3223
|
}
|
|
3229
3224
|
if (el.scrollWidth > trueWidth + 10) {
|
|
3230
3225
|
if (trueWidth !== 0 && !el.scrollOnHover.active) {
|
|
3231
|
-
const percRight = trueWidth - trueWidth *
|
|
3232
|
-
const percLeft = trueWidth -
|
|
3226
|
+
const percRight = trueWidth - trueWidth * el.scrollOnHover.percentages.back;
|
|
3227
|
+
const percLeft = trueWidth -
|
|
3228
|
+
trueWidth * el.scrollOnHover.percentages.forward;
|
|
3233
3229
|
const elOffset = el.scrollOnHover.x - el.scrollOnHover.rect.left;
|
|
3234
3230
|
const maxScrollLeft = el.scrollWidth - trueWidth;
|
|
3235
3231
|
const direction = elOffset < percLeft && el.scrollLeft !== 0
|
|
@@ -3250,7 +3246,29 @@ class KupScrollOnHover {
|
|
|
3250
3246
|
__classPrivateFieldSet$2(this, _KupScrollOnHover_timeout, setTimeout(() => {
|
|
3251
3247
|
el.scrollOnHover.active = true;
|
|
3252
3248
|
__classPrivateFieldSet$2(this, _KupScrollOnHover_rAF, requestAnimationFrame(function () {
|
|
3253
|
-
dom$
|
|
3249
|
+
dom$d.ketchup.scrollOnHover.run(el, maxScrollLeft, percRight, percLeft, direction);
|
|
3250
|
+
}), "f");
|
|
3251
|
+
}, this.delay), "f");
|
|
3252
|
+
}
|
|
3253
|
+
}
|
|
3254
|
+
}
|
|
3255
|
+
if (el.scrollOnHover.vertical && el.scrollHeight > trueHeight + 10) {
|
|
3256
|
+
if (trueHeight !== 0 && !el.scrollOnHover.active) {
|
|
3257
|
+
const percBottom = trueHeight - trueHeight * el.scrollOnHover.percentages.back;
|
|
3258
|
+
const percTop = trueHeight -
|
|
3259
|
+
trueHeight * el.scrollOnHover.percentages.forward;
|
|
3260
|
+
const elOffset = el.scrollOnHover.y - el.scrollOnHover.rect.top;
|
|
3261
|
+
const maxScrollTop = el.scrollHeight - trueHeight;
|
|
3262
|
+
const direction = elOffset < percTop && el.scrollTop !== 0
|
|
3263
|
+
? ScrollOnHoverDirection.TOP
|
|
3264
|
+
: elOffset > percBottom && el.scrollTop !== maxScrollTop
|
|
3265
|
+
? ScrollOnHoverDirection.BOTTOM
|
|
3266
|
+
: null;
|
|
3267
|
+
if (direction) {
|
|
3268
|
+
__classPrivateFieldSet$2(this, _KupScrollOnHover_timeout, setTimeout(() => {
|
|
3269
|
+
el.scrollOnHover.active = true;
|
|
3270
|
+
__classPrivateFieldSet$2(this, _KupScrollOnHover_rAF, requestAnimationFrame(function () {
|
|
3271
|
+
dom$d.ketchup.scrollOnHover.run(el, maxScrollTop, percBottom, percTop, direction);
|
|
3254
3272
|
}), "f");
|
|
3255
3273
|
}, this.delay), "f");
|
|
3256
3274
|
}
|
|
@@ -3279,25 +3297,51 @@ class KupScrollOnHover {
|
|
|
3279
3297
|
* The actual recursive scroll function.
|
|
3280
3298
|
* @param {KupScrollOnHoverElement} el - The scrolled element.
|
|
3281
3299
|
* @param {number} maxScrollLeft - Left coordinates to which the recursiveness must be stopped.
|
|
3282
|
-
* @param {number}
|
|
3283
|
-
* @param {number}
|
|
3300
|
+
* @param {number} percForward - Range of the right (or bottom) area.
|
|
3301
|
+
* @param {number} percBack - Range of the left (or top) scrollable area.
|
|
3284
3302
|
* @param {ScrollOnHoverDirection} direction - Direction of the scroll.
|
|
3285
3303
|
*/
|
|
3286
|
-
run(el, maxScrollLeft,
|
|
3304
|
+
run(el, maxScrollLeft, percForward, percBack, direction) {
|
|
3287
3305
|
if (!el.scrollOnHover.active) {
|
|
3288
3306
|
this.stop(el);
|
|
3289
3307
|
return;
|
|
3290
3308
|
}
|
|
3291
|
-
|
|
3292
|
-
|
|
3309
|
+
let offset = 0;
|
|
3310
|
+
switch (direction) {
|
|
3311
|
+
case ScrollOnHoverDirection.BOTTOM:
|
|
3312
|
+
case ScrollOnHoverDirection.TOP: {
|
|
3313
|
+
offset = el.scrollOnHover.y - el.scrollOnHover.rect.top;
|
|
3314
|
+
if (offset > percBack && offset < percForward) {
|
|
3315
|
+
this.stop(el);
|
|
3316
|
+
return;
|
|
3317
|
+
}
|
|
3318
|
+
break;
|
|
3319
|
+
}
|
|
3320
|
+
case ScrollOnHoverDirection.LEFT:
|
|
3321
|
+
case ScrollOnHoverDirection.RIGHT: {
|
|
3322
|
+
offset = el.scrollOnHover.x - el.scrollOnHover.rect.left;
|
|
3323
|
+
if (offset > percBack && offset < percForward) {
|
|
3324
|
+
this.stop(el);
|
|
3325
|
+
return;
|
|
3326
|
+
}
|
|
3327
|
+
break;
|
|
3328
|
+
}
|
|
3329
|
+
}
|
|
3330
|
+
if (direction === ScrollOnHoverDirection.RIGHT &&
|
|
3331
|
+
percForward > offset) {
|
|
3332
|
+
this.stop(el);
|
|
3333
|
+
return;
|
|
3334
|
+
}
|
|
3335
|
+
if (direction === ScrollOnHoverDirection.LEFT && percBack < offset) {
|
|
3293
3336
|
this.stop(el);
|
|
3294
3337
|
return;
|
|
3295
3338
|
}
|
|
3296
|
-
if (direction === ScrollOnHoverDirection.
|
|
3339
|
+
if (direction === ScrollOnHoverDirection.TOP && percBack < offset) {
|
|
3297
3340
|
this.stop(el);
|
|
3298
3341
|
return;
|
|
3299
3342
|
}
|
|
3300
|
-
if (direction === ScrollOnHoverDirection.
|
|
3343
|
+
if (direction === ScrollOnHoverDirection.BOTTOM &&
|
|
3344
|
+
percForward > offset) {
|
|
3301
3345
|
this.stop(el);
|
|
3302
3346
|
return;
|
|
3303
3347
|
}
|
|
@@ -3305,27 +3349,49 @@ class KupScrollOnHover {
|
|
|
3305
3349
|
this.updateChildren(el);
|
|
3306
3350
|
}
|
|
3307
3351
|
let arrow;
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3352
|
+
switch (direction) {
|
|
3353
|
+
case ScrollOnHoverDirection.BOTTOM: {
|
|
3354
|
+
arrow = [];
|
|
3355
|
+
if (el.scrollTop === maxScrollLeft) {
|
|
3356
|
+
this.stop(el);
|
|
3357
|
+
return;
|
|
3358
|
+
}
|
|
3359
|
+
el.scrollTop += this.step;
|
|
3360
|
+
break;
|
|
3313
3361
|
}
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3362
|
+
case ScrollOnHoverDirection.LEFT: {
|
|
3363
|
+
arrow = __classPrivateFieldGet$2(this, _KupScrollOnHover_leftArrows, "f");
|
|
3364
|
+
if (el.scrollLeft === 0) {
|
|
3365
|
+
this.stop(el);
|
|
3366
|
+
return;
|
|
3367
|
+
}
|
|
3368
|
+
el.scrollLeft -= this.step;
|
|
3369
|
+
break;
|
|
3370
|
+
}
|
|
3371
|
+
case ScrollOnHoverDirection.RIGHT: {
|
|
3372
|
+
arrow = __classPrivateFieldGet$2(this, _KupScrollOnHover_rightArrows, "f");
|
|
3373
|
+
if (el.scrollLeft === maxScrollLeft) {
|
|
3374
|
+
this.stop(el);
|
|
3375
|
+
return;
|
|
3376
|
+
}
|
|
3377
|
+
el.scrollLeft += this.step;
|
|
3378
|
+
break;
|
|
3379
|
+
}
|
|
3380
|
+
case ScrollOnHoverDirection.TOP: {
|
|
3381
|
+
arrow = [];
|
|
3382
|
+
if (el.scrollTop === 0) {
|
|
3383
|
+
this.stop(el);
|
|
3384
|
+
return;
|
|
3385
|
+
}
|
|
3386
|
+
el.scrollTop -= this.step;
|
|
3387
|
+
break;
|
|
3321
3388
|
}
|
|
3322
|
-
el.scrollLeft += this.step;
|
|
3323
3389
|
}
|
|
3324
3390
|
for (let i = 0; i < arrow.length; i++) {
|
|
3325
3391
|
arrow[i].classList.add('kup-animated');
|
|
3326
3392
|
}
|
|
3327
3393
|
__classPrivateFieldSet$2(this, _KupScrollOnHover_rAF, requestAnimationFrame(function () {
|
|
3328
|
-
dom$
|
|
3394
|
+
dom$d.ketchup.scrollOnHover.run(el, maxScrollLeft, percForward, percBack, direction);
|
|
3329
3395
|
}), "f");
|
|
3330
3396
|
}
|
|
3331
3397
|
/**
|
|
@@ -3338,7 +3404,27 @@ class KupScrollOnHover {
|
|
|
3338
3404
|
}
|
|
3339
3405
|
}
|
|
3340
3406
|
}
|
|
3341
|
-
_KupScrollOnHover_arrowsContainer = new WeakMap(), _KupScrollOnHover_leftArrows = new WeakMap(), _KupScrollOnHover_rightArrows = new WeakMap(), _KupScrollOnHover_scrollEvent = new WeakMap(), _KupScrollOnHover_mousemoveEvent = new WeakMap(), _KupScrollOnHover_mouseleaveEvent = new WeakMap(), _KupScrollOnHover_rAF = new WeakMap(), _KupScrollOnHover_timeout = new WeakMap()
|
|
3407
|
+
_KupScrollOnHover_arrowsContainer = new WeakMap(), _KupScrollOnHover_leftArrows = new WeakMap(), _KupScrollOnHover_rightArrows = new WeakMap(), _KupScrollOnHover_scrollEvent = new WeakMap(), _KupScrollOnHover_mousemoveEvent = new WeakMap(), _KupScrollOnHover_mouseleaveEvent = new WeakMap(), _KupScrollOnHover_rAF = new WeakMap(), _KupScrollOnHover_timeout = new WeakMap(), _KupScrollOnHover_instances = new WeakSet(), _KupScrollOnHover_initArrows = function _KupScrollOnHover_initArrows() {
|
|
3408
|
+
__classPrivateFieldSet$2(this, _KupScrollOnHover_arrowsContainer, document.createElement('div'), "f");
|
|
3409
|
+
__classPrivateFieldSet$2(this, _KupScrollOnHover_leftArrows, [], "f");
|
|
3410
|
+
__classPrivateFieldSet$2(this, _KupScrollOnHover_rightArrows, [], "f");
|
|
3411
|
+
__classPrivateFieldGet$2(this, _KupScrollOnHover_arrowsContainer, "f").id = 'kup-scrolling-arrows';
|
|
3412
|
+
for (let index = 1; index < 4; index++) {
|
|
3413
|
+
const arrow = document.createElement('div');
|
|
3414
|
+
arrow.setAttribute('class', 'kup-left-scrolling-arrow kup-arrow-' + index);
|
|
3415
|
+
__classPrivateFieldGet$2(this, _KupScrollOnHover_leftArrows, "f").push(arrow);
|
|
3416
|
+
}
|
|
3417
|
+
for (let index = 1; index < 4; index++) {
|
|
3418
|
+
const arrow = document.createElement('div');
|
|
3419
|
+
arrow.setAttribute('class', 'kup-right-scrolling-arrow kup-arrow-' + index);
|
|
3420
|
+
__classPrivateFieldGet$2(this, _KupScrollOnHover_rightArrows, "f").push(arrow);
|
|
3421
|
+
}
|
|
3422
|
+
__classPrivateFieldGet$2(this, _KupScrollOnHover_arrowsContainer, "f").append(__classPrivateFieldGet$2(this, _KupScrollOnHover_leftArrows, "f")[2], __classPrivateFieldGet$2(this, _KupScrollOnHover_leftArrows, "f")[1], __classPrivateFieldGet$2(this, _KupScrollOnHover_leftArrows, "f")[0], __classPrivateFieldGet$2(this, _KupScrollOnHover_rightArrows, "f")[0], __classPrivateFieldGet$2(this, _KupScrollOnHover_rightArrows, "f")[1], __classPrivateFieldGet$2(this, _KupScrollOnHover_rightArrows, "f")[2]);
|
|
3423
|
+
this.container = document.createElement('div');
|
|
3424
|
+
this.container.setAttribute('kup-scroll-on-hover', '');
|
|
3425
|
+
this.container.appendChild(__classPrivateFieldGet$2(this, _KupScrollOnHover_arrowsContainer, "f"));
|
|
3426
|
+
document.body.appendChild(this.container);
|
|
3427
|
+
};
|
|
3342
3428
|
|
|
3343
3429
|
const bubbles = {
|
|
3344
3430
|
cssVariables: {
|
|
@@ -3837,6 +3923,7 @@ const print = {
|
|
|
3837
3923
|
"KUP-BUTTON": ":host(:not(.printable)) {\ndisplay: none;\n}\n\n",
|
|
3838
3924
|
"KUP-CARD": "",
|
|
3839
3925
|
"KUP-DATA-TABLE": "#kup-component sticky-header {\ndisplay: none;\n}\n\n#kup-component kup-paginator {\ndisplay: none;\n}\n\n:host(.cross-selection) #kup-component table tr.selected td.selected, \n#kup-component table td.selected, #kup-component tr.selected td {\nbackground-color: inherit;\nbackground-image: none;\n}\n\n#kup-component table,\n#kup-component .below-wrapper {\noverflow: hidden !important;\n}\n\n:host(.cross-selection) #kup-component tr.selected td:first-of-type,\n:host(.cross-selection) #kup-component th.selected { \nbox-shadow: none !important;\n}\n\n:host(.cross-selection) #kup-component table td.selected,\n:host(.cross-selection) #kup-component table tr.selected td {\nbackground-color: inherit;\n}\n\n:host(.cross-selection) #kup-component table tr.selected td.fixed-column.selected,\n:host(.cross-selection) #kup-component table td.selected.fixed-column, \n:host(.cross-selection) #kup-component table td.selected.fixed-row,\n:host(.cross-selection) #kup-component table tr.selected td.fixed-column, \n:host(.cross-selection) #kup-component table tr.selected td.fixed-row {\nbackground-color: inherit;\nbackground-image: none;\n}\n\n",
|
|
3926
|
+
"KUP-FAMILY-TREE": "#kup-component .family-tree__item__expand {\ndisplay: none;\n}\n\n",
|
|
3840
3927
|
"KUP-PROGRESS-BAR": "#kup-component .progress-bar {\nbackground: #e7e7e7;\n}\n\n#kup-component .progress-bar-percentage span {\ntext-shadow: 0px 0px 0px hsl(0deg 0% 100%);\n}\n\n",
|
|
3841
3928
|
"KUP-TREE": "#kup-component .wrapper {\noverflow: hidden;\n}\n\n#kup-component tr.mdc-ripple-surface::before, \n#kup-component tr.mdc-ripple-surface::after,\n#kup-component td.mdc-ripple-surface::before, \n#kup-component td.mdc-ripple-surface::after,\n#kup-component .kup-tree__node--selected:not(.kup-tree__node--disabled) td {\nbackground-color: var(--kup-background-color);\n}"
|
|
3842
3929
|
},
|
|
@@ -4465,7 +4552,7 @@ var KupThemeIconValues;
|
|
|
4465
4552
|
KupThemeIconValues["SEARCH"] = "--kup-search-icon";
|
|
4466
4553
|
})(KupThemeIconValues || (KupThemeIconValues = {}));
|
|
4467
4554
|
|
|
4468
|
-
const dom$
|
|
4555
|
+
const dom$c = document.documentElement;
|
|
4469
4556
|
/**
|
|
4470
4557
|
* Theme manager, handles everything about theming, customStyles and color utilities.
|
|
4471
4558
|
* @module KupTheme
|
|
@@ -4479,7 +4566,7 @@ class KupTheme {
|
|
|
4479
4566
|
this.list = list ? list : themes;
|
|
4480
4567
|
this.managedComponents = new Set();
|
|
4481
4568
|
this.name = name ? name : 'ketchup';
|
|
4482
|
-
this.styleTag = dom$
|
|
4569
|
+
this.styleTag = dom$c
|
|
4483
4570
|
.querySelector('head')
|
|
4484
4571
|
.appendChild(document.createElement('style'));
|
|
4485
4572
|
}
|
|
@@ -4566,9 +4653,9 @@ class KupTheme {
|
|
|
4566
4653
|
if (list) {
|
|
4567
4654
|
this.list = list;
|
|
4568
4655
|
}
|
|
4569
|
-
dom$
|
|
4656
|
+
dom$c.ketchup.debug.logMessage('theme manager', 'Setting theme to: ' + this.name + '.');
|
|
4570
4657
|
if (!this.list[this.name]) {
|
|
4571
|
-
dom$
|
|
4658
|
+
dom$c.ketchup.debug.logMessage('theme manager', 'Invalid theme name, falling back to default ("ketchup").');
|
|
4572
4659
|
this.name = 'ketchup';
|
|
4573
4660
|
}
|
|
4574
4661
|
this.cssVars = {};
|
|
@@ -4611,11 +4698,11 @@ class KupTheme {
|
|
|
4611
4698
|
this.icons() +
|
|
4612
4699
|
'}';
|
|
4613
4700
|
this.customStyle();
|
|
4614
|
-
dom$
|
|
4701
|
+
dom$c.ketchup.debug.logMessage('kup-theme', 'Theme ' + dom$c.getAttribute('kup-theme') + ' refreshed.');
|
|
4615
4702
|
document.dispatchEvent(new CustomEvent('kup-theme-refresh'));
|
|
4616
4703
|
}
|
|
4617
4704
|
catch (error) {
|
|
4618
|
-
dom$
|
|
4705
|
+
dom$c.ketchup.debug.logMessage('kup-theme', 'Theme not refreshed.', KupDebugCategory.WARNING);
|
|
4619
4706
|
}
|
|
4620
4707
|
}
|
|
4621
4708
|
/**
|
|
@@ -4734,7 +4821,7 @@ class KupTheme {
|
|
|
4734
4821
|
this.set(themes[index]);
|
|
4735
4822
|
}
|
|
4736
4823
|
else {
|
|
4737
|
-
dom$
|
|
4824
|
+
dom$c.ketchup.debug.logMessage('kup-theme', "Couldn't set a random theme: no themes available!", KupDebugCategory.WARNING);
|
|
4738
4825
|
}
|
|
4739
4826
|
}
|
|
4740
4827
|
/**
|
|
@@ -4746,7 +4833,7 @@ class KupTheme {
|
|
|
4746
4833
|
//Testing whether the color is transparent, if it is a fall back value will be returned matching the background-color
|
|
4747
4834
|
if (color === 'transparent') {
|
|
4748
4835
|
color = this.cssVars['--kup-background-color'];
|
|
4749
|
-
dom$
|
|
4836
|
+
dom$c.ketchup.debug.logMessage('theme manager', 'Received TRANSPARENT color, converted to ' +
|
|
4750
4837
|
color +
|
|
4751
4838
|
' (theme background).');
|
|
4752
4839
|
}
|
|
@@ -4764,7 +4851,7 @@ class KupTheme {
|
|
|
4764
4851
|
const oldColor = color;
|
|
4765
4852
|
color = this.codeToHex(color);
|
|
4766
4853
|
isHex = color.substring(0, 1) === '#' ? true : false;
|
|
4767
|
-
dom$
|
|
4854
|
+
dom$c.ketchup.debug.logMessage('theme manager', 'Received CODE NAME color ' +
|
|
4768
4855
|
oldColor +
|
|
4769
4856
|
', converted to ' +
|
|
4770
4857
|
color +
|
|
@@ -4818,14 +4905,14 @@ class KupTheme {
|
|
|
4818
4905
|
else {
|
|
4819
4906
|
hexColor = this.rgbToHex(rgbColorObj.r, rgbColorObj.g, rgbColorObj.b);
|
|
4820
4907
|
}
|
|
4821
|
-
dom$
|
|
4908
|
+
dom$c.ketchup.debug.logMessage('theme-manager', 'Received HEX color ' +
|
|
4822
4909
|
oldColor +
|
|
4823
4910
|
', converted to ' +
|
|
4824
4911
|
color +
|
|
4825
4912
|
'.');
|
|
4826
4913
|
}
|
|
4827
4914
|
catch (error) {
|
|
4828
|
-
dom$
|
|
4915
|
+
dom$c.ketchup.debug.logMessage('theme-manager', 'Invalid color: ' + color + '.');
|
|
4829
4916
|
}
|
|
4830
4917
|
}
|
|
4831
4918
|
let rgbValues = null;
|
|
@@ -4835,14 +4922,14 @@ class KupTheme {
|
|
|
4835
4922
|
rgbColor = color;
|
|
4836
4923
|
}
|
|
4837
4924
|
catch (error) {
|
|
4838
|
-
dom$
|
|
4925
|
+
dom$c.ketchup.debug.logMessage('theme-manager', 'Color not converted to rgb values: ' + color + '.');
|
|
4839
4926
|
}
|
|
4840
4927
|
if (!hexColor) {
|
|
4841
4928
|
try {
|
|
4842
4929
|
hexColor = this.rgbToHex(parseInt(values[1]), parseInt(values[2]), parseInt(values[3]));
|
|
4843
4930
|
}
|
|
4844
4931
|
catch (error) {
|
|
4845
|
-
dom$
|
|
4932
|
+
dom$c.ketchup.debug.logMessage('theme-manager', 'Color not converted to hex value: ' + color + '.');
|
|
4846
4933
|
}
|
|
4847
4934
|
}
|
|
4848
4935
|
if (!hslColor || !hslValues) {
|
|
@@ -4855,7 +4942,7 @@ class KupTheme {
|
|
|
4855
4942
|
hslColor = 'hsl(' + hsl.h + ',' + hsl.s + '%,' + hsl.l + '%)';
|
|
4856
4943
|
}
|
|
4857
4944
|
catch (error) {
|
|
4858
|
-
dom$
|
|
4945
|
+
dom$c.ketchup.debug.logMessage('theme-manager', 'Color not converted to hex value: ' + color + '.');
|
|
4859
4946
|
}
|
|
4860
4947
|
}
|
|
4861
4948
|
return {
|
|
@@ -5160,7 +5247,7 @@ class KupTheme {
|
|
|
5160
5247
|
return colorCodes[color.toLowerCase()];
|
|
5161
5248
|
}
|
|
5162
5249
|
else {
|
|
5163
|
-
dom$
|
|
5250
|
+
dom$c.ketchup.debug.logMessage('theme manager', 'Could not decode color ' + color + '!');
|
|
5164
5251
|
return color;
|
|
5165
5252
|
}
|
|
5166
5253
|
}
|
|
@@ -5188,7 +5275,7 @@ var __classPrivateFieldGet$1 = (undefined && undefined.__classPrivateFieldGet) |
|
|
|
5188
5275
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5189
5276
|
};
|
|
5190
5277
|
var _KupToolbar_keyEvent;
|
|
5191
|
-
const dom$
|
|
5278
|
+
const dom$b = document.documentElement;
|
|
5192
5279
|
/**
|
|
5193
5280
|
* Handles component's toolbar.
|
|
5194
5281
|
* @module KupToolbar
|
|
@@ -5206,7 +5293,7 @@ class KupToolbar {
|
|
|
5206
5293
|
KupToolbarModifierKeys.CTRL,
|
|
5207
5294
|
];
|
|
5208
5295
|
__classPrivateFieldSet$1(this, _KupToolbar_keyEvent, function (e) {
|
|
5209
|
-
const toolbar = dom$
|
|
5296
|
+
const toolbar = dom$b.ketchup.toolbar;
|
|
5210
5297
|
if (toolbar.managedElements) {
|
|
5211
5298
|
for (let index = 0; index < toolbar.modifiers.length; index++) {
|
|
5212
5299
|
if (toolbar.modifiers[index] ===
|
|
@@ -5553,78 +5640,1181 @@ var KupDataNewColumnTypes;
|
|
|
5553
5640
|
KupDataNewColumnTypes["MERGE"] = "merge";
|
|
5554
5641
|
})(KupDataNewColumnTypes || (KupDataNewColumnTypes = {}));
|
|
5555
5642
|
|
|
5556
|
-
const dom$7 = document.documentElement;
|
|
5557
5643
|
/**
|
|
5558
|
-
*
|
|
5559
|
-
*
|
|
5560
|
-
* @param {KupDataFindCellFilters} filters - Filters of the research.
|
|
5561
|
-
* @returns {KupDataCell[]} Array of cells fetched after applying the filters.
|
|
5644
|
+
* Props of the kup-data-table component.
|
|
5645
|
+
* Used to export every prop in an object.
|
|
5562
5646
|
*/
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5647
|
+
var KupDataTableProps;
|
|
5648
|
+
(function (KupDataTableProps) {
|
|
5649
|
+
KupDataTableProps["autoFillMissingCells"] = "When true and when a row is missing some columns, the missing cells will be autogenerated.";
|
|
5650
|
+
KupDataTableProps["customStyle"] = "Custom style of the component.";
|
|
5651
|
+
KupDataTableProps["data"] = "The data of the table.";
|
|
5652
|
+
KupDataTableProps["density"] = "The density of the rows, defaults at 'medium' and can be also set to 'large' or 'small'.";
|
|
5653
|
+
KupDataTableProps["dragEnabled"] = "Enables drag.";
|
|
5654
|
+
KupDataTableProps["dropEnabled"] = "Enables drop.";
|
|
5655
|
+
KupDataTableProps["editableData"] = "When set to true, editable cells will be rendered using input components.";
|
|
5656
|
+
KupDataTableProps["emptyDataLabel"] = "Defines the label to show when the table is empty.";
|
|
5657
|
+
KupDataTableProps["enableColumnsFormula"] = "Enables the choice to set formulas on columns by dragging them into different columns.";
|
|
5658
|
+
KupDataTableProps["enableMergeColumns"] = "Enables the merging of columns by dragging them into different columns.";
|
|
5659
|
+
KupDataTableProps["enableExtraColumns"] = "Enables adding extra columns.";
|
|
5660
|
+
KupDataTableProps["enableSortableColumns"] = "Enables the sorting of columns by dragging them into different columns.";
|
|
5661
|
+
KupDataTableProps["expandGroups"] = "Expands groups when set to true.";
|
|
5662
|
+
KupDataTableProps["filters"] = "List of filters set by the user.";
|
|
5663
|
+
KupDataTableProps["fixedColumns"] = "Fixes the given number of columns so that they stay visible when horizontally scrolling the data-table. If grouping is active or the value of the prop is <= 0, this prop will have no effect. Can be combined with fixedRows.";
|
|
5664
|
+
KupDataTableProps["fixedRows"] = "Fixes the given number of rows so that they stay visible when vertically scrolling the data-table. If grouping is active or the value of the prop is <= 0, this prop will have no effect. Can be combined with fixedColumns.";
|
|
5665
|
+
KupDataTableProps["forceOneLine"] = "Forces cells with long text and a fixed column size to have an ellipsis set on their text. The reflect attribute is mandatory to allow styling.";
|
|
5666
|
+
KupDataTableProps["globalFilter"] = "When set to true it activates the global filter.";
|
|
5667
|
+
KupDataTableProps["globalFilterValue"] = "The value of the global filter.";
|
|
5668
|
+
KupDataTableProps["groupLabelDisplay"] = "How the label of a group must be displayed. For available values";
|
|
5669
|
+
KupDataTableProps["groups"] = "The list of groups.";
|
|
5670
|
+
KupDataTableProps["headerIsPersistent"] = "When set to true the header will stick on top of the table when scrolling.";
|
|
5671
|
+
KupDataTableProps["isFocusable"] = "When set to true, clicked-on rows will have a visual feedback.";
|
|
5672
|
+
KupDataTableProps["lazyLoadRows"] = "When set to true, extra rows will be automatically loaded once the last row enters the viewport. When groups are present, the number of rows is referred to groups and not to their content. Paginator is disabled.";
|
|
5673
|
+
KupDataTableProps["lineBreakCharacter"] = "Defines the placeholder character which will be replaced by a line break inside table header cells, normal or sticky.";
|
|
5674
|
+
KupDataTableProps["loadMoreLimit"] = "Sets a maximum limit of new records which can be required by the load more functionality.";
|
|
5675
|
+
KupDataTableProps["loadMoreMode"] = "Establish the modality of how many new records will be downloaded. This property is regulated also by loadMoreStep.";
|
|
5676
|
+
KupDataTableProps["loadMoreStep"] = "The number of records which will be requested to be downloaded when clicking on the load more button. This property is regulated also by loadMoreMode.";
|
|
5677
|
+
KupDataTableProps["multiSelection"] = "When set to true enables rows multi selection.";
|
|
5678
|
+
KupDataTableProps["pageSelected"] = "Current selected page set on component load";
|
|
5679
|
+
KupDataTableProps["paginatorPos"] = "Sets the position of the paginator. Available positions: top, bottom or both.";
|
|
5680
|
+
KupDataTableProps["removableColumns"] = "Sets the possibility to remove the selected column.";
|
|
5681
|
+
KupDataTableProps["resizableColumns"] = "Gives the possibility to resize columns by dragging on their right edge.";
|
|
5682
|
+
KupDataTableProps["rowActions"] = "Sets the actions of the rows.";
|
|
5683
|
+
KupDataTableProps["rowsPerPage"] = "Sets the number of rows per page to display.";
|
|
5684
|
+
KupDataTableProps["scrollOnHover"] = "Activates the scroll on hover function.";
|
|
5685
|
+
KupDataTableProps["showCustomization"] = "If set to true, displays the button to open the customization panel.";
|
|
5686
|
+
KupDataTableProps["showFilters"] = "When set to true enables the column filters.";
|
|
5687
|
+
KupDataTableProps["showFooter"] = "When set to true shows the footer.";
|
|
5688
|
+
KupDataTableProps["showGrid"] = "Can be used to customize the grid view of the table.";
|
|
5689
|
+
KupDataTableProps["showGroups"] = "When set to true enables the column grouping.";
|
|
5690
|
+
KupDataTableProps["showHeader"] = "Enables rendering of the table header.";
|
|
5691
|
+
KupDataTableProps["showLoadMore"] = "If set to true, displays the button to load more records.";
|
|
5692
|
+
KupDataTableProps["sort"] = "Defines the current sorting options.";
|
|
5693
|
+
KupDataTableProps["stateId"] = "";
|
|
5694
|
+
KupDataTableProps["store"] = "";
|
|
5695
|
+
KupDataTableProps["sortableColumnsMutateData"] = "If set to true, when a column is dragged to be sorted, the component directly mutates the data.columns property and then fires the event";
|
|
5696
|
+
KupDataTableProps["sortEnabled"] = "When set to true enables the sorting of the columns by clicking on the column header.";
|
|
5697
|
+
KupDataTableProps["tableHeight"] = "Sets the height of the table.";
|
|
5698
|
+
KupDataTableProps["tableWidth"] = "Sets the width of the table.";
|
|
5699
|
+
KupDataTableProps["totals"] = "Defines the current totals options.";
|
|
5700
|
+
KupDataTableProps["transpose"] = "Transposes the data of the data table.";
|
|
5701
|
+
})(KupDataTableProps || (KupDataTableProps = {}));
|
|
5702
|
+
var SortMode;
|
|
5703
|
+
(function (SortMode) {
|
|
5704
|
+
SortMode["A"] = "A";
|
|
5705
|
+
SortMode["D"] = "D";
|
|
5706
|
+
})(SortMode || (SortMode = {}));
|
|
5707
|
+
var TotalMode;
|
|
5708
|
+
(function (TotalMode) {
|
|
5709
|
+
TotalMode["COUNT"] = "Count";
|
|
5710
|
+
TotalMode["SUM"] = "Sum";
|
|
5711
|
+
TotalMode["MIN"] = "Min";
|
|
5712
|
+
TotalMode["MAX"] = "Max";
|
|
5713
|
+
TotalMode["DISTINCT"] = "Distinct";
|
|
5714
|
+
TotalMode["AVERAGE"] = "Average";
|
|
5715
|
+
TotalMode["MATH"] = "MATH";
|
|
5716
|
+
})(TotalMode || (TotalMode = {}));
|
|
5717
|
+
var TotalLabel;
|
|
5718
|
+
(function (TotalLabel) {
|
|
5719
|
+
TotalLabel["COUNT"] = "Count";
|
|
5720
|
+
TotalLabel["SUM"] = "Sum";
|
|
5721
|
+
TotalLabel["MIN"] = "Min";
|
|
5722
|
+
TotalLabel["MAX"] = "Max";
|
|
5723
|
+
TotalLabel["DISTINCT"] = "Distinct";
|
|
5724
|
+
TotalLabel["AVERAGE"] = "Average";
|
|
5725
|
+
TotalLabel["MATH"] = "Formula";
|
|
5726
|
+
TotalLabel["CANC"] = "Cancel";
|
|
5727
|
+
TotalLabel["CALC"] = "Calculate";
|
|
5728
|
+
})(TotalLabel || (TotalLabel = {}));
|
|
5729
|
+
var PaginatorPos;
|
|
5730
|
+
(function (PaginatorPos) {
|
|
5731
|
+
PaginatorPos["TOP"] = "Top";
|
|
5732
|
+
PaginatorPos["BOTTOM"] = "Bottom";
|
|
5733
|
+
PaginatorPos["BOTH"] = "Both";
|
|
5734
|
+
})(PaginatorPos || (PaginatorPos = {}));
|
|
5735
|
+
var ShowGrid;
|
|
5736
|
+
(function (ShowGrid) {
|
|
5737
|
+
ShowGrid["NONE"] = "None";
|
|
5738
|
+
ShowGrid["ROW"] = "Row";
|
|
5739
|
+
ShowGrid["COL"] = "Col";
|
|
5740
|
+
ShowGrid["COMPLETE"] = "Complete";
|
|
5741
|
+
})(ShowGrid || (ShowGrid = {}));
|
|
5742
|
+
// export enum RowActionType {
|
|
5743
|
+
// DEFAULT = 'Default',
|
|
5744
|
+
// VARIABLE = 'Variable',
|
|
5745
|
+
// }
|
|
5746
|
+
//---- *NEXT functionality AKA load more ----
|
|
5747
|
+
var LoadMoreMode;
|
|
5748
|
+
(function (LoadMoreMode) {
|
|
5749
|
+
LoadMoreMode["CONSTANT"] = "constant";
|
|
5750
|
+
LoadMoreMode["CONSTANT_INCREMENT"] = "constant_increment";
|
|
5751
|
+
LoadMoreMode["PROGRESSIVE_THRESHOLD"] = "progressive_threshold";
|
|
5752
|
+
})(LoadMoreMode || (LoadMoreMode = {}));
|
|
5753
|
+
//---- Group label display functionality ----
|
|
5566
5754
|
/**
|
|
5567
|
-
*
|
|
5568
|
-
* @
|
|
5569
|
-
* @
|
|
5570
|
-
* @
|
|
5755
|
+
* The possible values the display property can have.
|
|
5756
|
+
* @enum
|
|
5757
|
+
* @property {string} BOTH - Shows both the column label and the value. This is the default.
|
|
5758
|
+
* @property {string} LABEL - Shows only the columns label.
|
|
5759
|
+
* @property {string} VALUE - Shows only the value.
|
|
5760
|
+
* @readonly
|
|
5571
5761
|
*/
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5762
|
+
var GroupLabelDisplayMode;
|
|
5763
|
+
(function (GroupLabelDisplayMode) {
|
|
5764
|
+
GroupLabelDisplayMode["BOTH"] = "Both";
|
|
5765
|
+
GroupLabelDisplayMode["LABEL"] = "Label";
|
|
5766
|
+
GroupLabelDisplayMode["VALUE"] = "Value";
|
|
5767
|
+
})(GroupLabelDisplayMode || (GroupLabelDisplayMode = {}));
|
|
5768
|
+
//---- Fixed rows and cells classes ----
|
|
5769
|
+
const FixedCellsClasses = {
|
|
5770
|
+
columns: 'fixed-column',
|
|
5771
|
+
rows: 'fixed-row',
|
|
5772
|
+
};
|
|
5773
|
+
const FixedCellsCSSVarsBase = {
|
|
5774
|
+
columns: '--ddt_column-left-',
|
|
5775
|
+
rows: '--ddt_row-top-',
|
|
5776
|
+
};
|
|
5586
5777
|
/**
|
|
5587
|
-
*
|
|
5588
|
-
* If no columns are provided, the value will be applied to every column of the dataset.
|
|
5589
|
-
* @param {KupDataDataset} dataset - Input dataset.
|
|
5590
|
-
* @param {KupDataCell} cell - New cell.
|
|
5591
|
-
* @param {string[]} columns - Columns to be handled.
|
|
5592
|
-
* @returns {KupDataCell[]} Replaced cells.
|
|
5778
|
+
* Constants for mocked/premade columns created by data mutations.
|
|
5593
5779
|
*/
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
}
|
|
5605
|
-
}
|
|
5606
|
-
return replaced;
|
|
5607
|
-
}
|
|
5780
|
+
const fieldColumn = 'Field';
|
|
5781
|
+
const iconColumn = 'Icon';
|
|
5782
|
+
const keyColumn = 'Key';
|
|
5783
|
+
var SelectionMode;
|
|
5784
|
+
(function (SelectionMode) {
|
|
5785
|
+
SelectionMode["SINGLE"] = "single";
|
|
5786
|
+
SelectionMode["MULTIPLE_CHECKBOX"] = "multiple-checkbox";
|
|
5787
|
+
SelectionMode["MULTIPLE"] = "multiple";
|
|
5788
|
+
SelectionMode["NONE"] = "none";
|
|
5789
|
+
})(SelectionMode || (SelectionMode = {}));
|
|
5608
5790
|
|
|
5609
|
-
const dom$6 = document.documentElement;
|
|
5610
5791
|
/**
|
|
5611
|
-
*
|
|
5612
|
-
* @param {KupDataDataset | Column[]} dataset - Input dataset or array of columns.
|
|
5613
|
-
* @param {Partial<Column>} filters - Column interface containing the filters to match.
|
|
5614
|
-
* @returns {Column[]} Columns matching the criteria.
|
|
5792
|
+
* Normalization types.
|
|
5615
5793
|
*/
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5794
|
+
var KupDatesNormalize;
|
|
5795
|
+
(function (KupDatesNormalize) {
|
|
5796
|
+
KupDatesNormalize["DATE"] = "date";
|
|
5797
|
+
KupDatesNormalize["TIME"] = "time";
|
|
5798
|
+
KupDatesNormalize["TIMESTAMP"] = "timestamp";
|
|
5799
|
+
})(KupDatesNormalize || (KupDatesNormalize = {}));
|
|
5800
|
+
/**
|
|
5801
|
+
* Common use formats
|
|
5802
|
+
*/
|
|
5803
|
+
var KupDatesFormats;
|
|
5804
|
+
(function (KupDatesFormats) {
|
|
5805
|
+
KupDatesFormats["ISO_DATE"] = "YYYY-MM-DD";
|
|
5806
|
+
KupDatesFormats["ISO_DATE_TIME"] = "YYYY-MM-DD HH:mm:ss";
|
|
5807
|
+
KupDatesFormats["ISO_TIME"] = "HH:mm:ss";
|
|
5808
|
+
KupDatesFormats["ISO_TIME_WITHOUT_SECONDS"] = "HH:mm";
|
|
5809
|
+
})(KupDatesFormats || (KupDatesFormats = {}));
|
|
5810
|
+
/**
|
|
5811
|
+
* Supported locales.
|
|
5812
|
+
*/
|
|
5813
|
+
var KupDatesLocales;
|
|
5814
|
+
(function (KupDatesLocales) {
|
|
5815
|
+
KupDatesLocales["CHINESE"] = "cn";
|
|
5816
|
+
KupDatesLocales["ENGLISH"] = "en";
|
|
5817
|
+
KupDatesLocales["FRENCH"] = "fr";
|
|
5818
|
+
KupDatesLocales["ITALIAN"] = "it";
|
|
5819
|
+
KupDatesLocales["POLISH"] = "pl";
|
|
5820
|
+
KupDatesLocales["RUSSIAN"] = "ru";
|
|
5821
|
+
KupDatesLocales["SPANISH"] = "es";
|
|
5822
|
+
})(KupDatesLocales || (KupDatesLocales = {}));
|
|
5823
|
+
|
|
5824
|
+
const dom$a = document.documentElement;
|
|
5825
|
+
var DateTimeFormatOptionsMonth;
|
|
5826
|
+
(function (DateTimeFormatOptionsMonth) {
|
|
5827
|
+
DateTimeFormatOptionsMonth["NUMERIC"] = "numeric";
|
|
5828
|
+
DateTimeFormatOptionsMonth["DIGIT2"] = "2-digit";
|
|
5829
|
+
DateTimeFormatOptionsMonth["LONG"] = "long";
|
|
5830
|
+
DateTimeFormatOptionsMonth["SHORT"] = "short";
|
|
5831
|
+
DateTimeFormatOptionsMonth["NARROW"] = "narrow";
|
|
5832
|
+
})(DateTimeFormatOptionsMonth || (DateTimeFormatOptionsMonth = {}));
|
|
5833
|
+
function identify(array) {
|
|
5834
|
+
if (array) {
|
|
5835
|
+
for (let i = 0; i < array.length; i++) {
|
|
5836
|
+
array[i].id = i.toString();
|
|
5837
|
+
}
|
|
5838
|
+
}
|
|
5839
|
+
}
|
|
5840
|
+
function getSeparator(locale, separatorType) {
|
|
5841
|
+
const numberWithGroupAndDecimalSeparator = 1000.1;
|
|
5842
|
+
return Intl.NumberFormat(locale)
|
|
5843
|
+
.formatToParts(numberWithGroupAndDecimalSeparator)
|
|
5844
|
+
.find((part) => part.type === separatorType).value;
|
|
5845
|
+
}
|
|
5846
|
+
function getCurrentTimeFormatFromBrowserLocale(manageSeconds) {
|
|
5847
|
+
const options = {
|
|
5848
|
+
hour: '2-digit',
|
|
5849
|
+
minute: '2-digit',
|
|
5850
|
+
hour12: false,
|
|
5851
|
+
};
|
|
5852
|
+
if (manageSeconds == true) {
|
|
5853
|
+
options.second = '2-digit';
|
|
5854
|
+
}
|
|
5855
|
+
const formatObj = new Intl.DateTimeFormat(dom$a.ketchup.dates.getLocale() + '-u-hc-h23', options).formatToParts(new Date());
|
|
5856
|
+
let timeFormat = formatObj
|
|
5857
|
+
.map((obj) => {
|
|
5858
|
+
switch (obj.type) {
|
|
5859
|
+
case 'hour':
|
|
5860
|
+
return 'HH';
|
|
5861
|
+
case 'minute':
|
|
5862
|
+
return 'mm';
|
|
5863
|
+
case 'second':
|
|
5864
|
+
return 'ss';
|
|
5865
|
+
default:
|
|
5866
|
+
return obj.value;
|
|
5867
|
+
}
|
|
5868
|
+
})
|
|
5869
|
+
.join('');
|
|
5870
|
+
return timeFormat;
|
|
5871
|
+
}
|
|
5872
|
+
/**
|
|
5873
|
+
* @param value number as string, formatted by actual browser locale
|
|
5874
|
+
* @param type - type of number for calculate suffix
|
|
5875
|
+
* @returns true if number string in input is a valid number
|
|
5876
|
+
*/
|
|
5877
|
+
function isValidFormattedStringNumber(value, type) {
|
|
5878
|
+
if (value == null || value.trim() == '') {
|
|
5879
|
+
return false;
|
|
5880
|
+
}
|
|
5881
|
+
let tmpStr = formattedStringToUnformattedStringNumber(value, type);
|
|
5882
|
+
if (isNumber(tmpStr)) {
|
|
5883
|
+
return true;
|
|
5884
|
+
}
|
|
5885
|
+
return false;
|
|
5886
|
+
}
|
|
5887
|
+
function isNumber(value) {
|
|
5888
|
+
//return typeof value === 'number';
|
|
5889
|
+
return !isNaN(value);
|
|
5890
|
+
}
|
|
5891
|
+
/**
|
|
5892
|
+
* @param input number as string, formatted by locale US, decimal separator . (like java decimal numbers)
|
|
5893
|
+
* @returns number
|
|
5894
|
+
**/
|
|
5895
|
+
function stringToNumber(input) {
|
|
5896
|
+
if (!input || input == null || input.trim() == '') {
|
|
5897
|
+
input = '0';
|
|
5898
|
+
}
|
|
5899
|
+
return dom$a.ketchup.math.numberify(input);
|
|
5900
|
+
}
|
|
5901
|
+
/**
|
|
5902
|
+
* @param input number
|
|
5903
|
+
* @param decimals number of significant decimal digits for output
|
|
5904
|
+
* @returns number as string, formatted by actual browser locale
|
|
5905
|
+
**/
|
|
5906
|
+
function numberToString(input, decimals) {
|
|
5907
|
+
if (input == null) {
|
|
5908
|
+
return '';
|
|
5909
|
+
}
|
|
5910
|
+
return _numberToString(input, decimals, dom$a.ketchup.dates.getLocale(), true);
|
|
5911
|
+
}
|
|
5912
|
+
/**
|
|
5913
|
+
* @param type - type of number for calculate suffix
|
|
5914
|
+
* @returns suffix for number, by type
|
|
5915
|
+
**/
|
|
5916
|
+
function getNumericValueSuffixByType(type) {
|
|
5917
|
+
type = type.toUpperCase();
|
|
5918
|
+
let nstr = '';
|
|
5919
|
+
if (type == 'P') {
|
|
5920
|
+
nstr = ' %';
|
|
5921
|
+
}
|
|
5922
|
+
else if (type == 'VE') {
|
|
5923
|
+
nstr = ' €';
|
|
5924
|
+
}
|
|
5925
|
+
else if (type == 'VL') {
|
|
5926
|
+
nstr = ' £';
|
|
5927
|
+
}
|
|
5928
|
+
else if (type == 'VV') {
|
|
5929
|
+
nstr = ' $';
|
|
5930
|
+
}
|
|
5931
|
+
return nstr;
|
|
5932
|
+
}
|
|
5933
|
+
/**
|
|
5934
|
+
* @param input number
|
|
5935
|
+
* @param decimals number of significant decimal digits for output
|
|
5936
|
+
* @param type - type of number for calculate suffix
|
|
5937
|
+
* @returns number as string, formatted by actual browser locale, with suffix by type
|
|
5938
|
+
**/
|
|
5939
|
+
function numberToFormattedStringNumber(input, decimals, type) {
|
|
5940
|
+
if (input == null || isNaN(input)) {
|
|
5941
|
+
return '';
|
|
5942
|
+
}
|
|
5943
|
+
let nstr = numberToString(input, decimals);
|
|
5944
|
+
nstr = nstr + getNumericValueSuffixByType(type);
|
|
5945
|
+
return nstr;
|
|
5946
|
+
}
|
|
5947
|
+
/**
|
|
5948
|
+
* @param input number as string, formatted by locale US, decimal separator . (like java decimal numbers)
|
|
5949
|
+
* @param decimals number of significant decimal digits for output
|
|
5950
|
+
* @param type - type of number for calculate suffix
|
|
5951
|
+
* @returns number as string, formatted by actual browser locale, with suffix by type
|
|
5952
|
+
**/
|
|
5953
|
+
function unformattedStringToFormattedStringNumber(input, decimals, type) {
|
|
5954
|
+
return numberToFormattedStringNumber(stringToNumber(input), decimals, type);
|
|
5955
|
+
}
|
|
5956
|
+
/**
|
|
5957
|
+
* @param input number as string, formatted by actual browser locale
|
|
5958
|
+
* @param type - type of number for calculate suffix
|
|
5959
|
+
* @returns number as string, formatted by locale US, decimal separator . (like java decimal numbers), without group separator
|
|
5960
|
+
**/
|
|
5961
|
+
function formattedStringToUnformattedStringNumber(input, type) {
|
|
5962
|
+
return numberStringToNumberString(input, type, getDecimalSeparator(dom$a.ketchup.dates.getLocale()));
|
|
5963
|
+
}
|
|
5964
|
+
/**
|
|
5965
|
+
* @param input number as string, formatted by locale US, decimal separator . (like java decimal numbers), with group separator
|
|
5966
|
+
* @param type - type of number for calculate suffix
|
|
5967
|
+
* @returns number as string, formatted by locale US, decimal separator . (like java decimal numbers), without group separator
|
|
5968
|
+
**/
|
|
5969
|
+
function unformattedStringNumberToNumber(input, type) {
|
|
5970
|
+
return numberStringToNumberString(input, type, '.');
|
|
5971
|
+
}
|
|
5972
|
+
function numberStringToNumberString(input, type, decFmt) {
|
|
5973
|
+
if (input == null || input.trim() == '') {
|
|
5974
|
+
return '';
|
|
5975
|
+
}
|
|
5976
|
+
let originalInputValue = input;
|
|
5977
|
+
let suffix = getNumericValueSuffixByType(type);
|
|
5978
|
+
if (suffix != '') {
|
|
5979
|
+
input = input.replace(suffix, '');
|
|
5980
|
+
}
|
|
5981
|
+
let regExpr = null;
|
|
5982
|
+
if (decFmt == '.') {
|
|
5983
|
+
regExpr = /,/g;
|
|
5984
|
+
}
|
|
5985
|
+
else {
|
|
5986
|
+
regExpr = /\./g;
|
|
5987
|
+
}
|
|
5988
|
+
input = input.replace(regExpr, '');
|
|
5989
|
+
if (decFmt != '.') {
|
|
5990
|
+
input = input.replace(/,/g, '.');
|
|
5991
|
+
}
|
|
5992
|
+
if (dom$a.ketchup.math.numberify(input) == null ||
|
|
5993
|
+
isNaN(dom$a.ketchup.math.numberify(input))) {
|
|
5994
|
+
return originalInputValue;
|
|
5995
|
+
}
|
|
5996
|
+
let unf = stringToNumber(input);
|
|
5997
|
+
return _numberToString(unf, -1, 'en-US', false);
|
|
5998
|
+
}
|
|
5999
|
+
function getDecimalSeparator(locale) {
|
|
6000
|
+
return getSeparator(locale, 'decimal');
|
|
6001
|
+
}
|
|
6002
|
+
function countDecimals(value) {
|
|
6003
|
+
if (Math.floor(value) === value)
|
|
6004
|
+
return 0;
|
|
6005
|
+
let stringValue = value.toString().split('.')[1];
|
|
6006
|
+
if (stringValue) {
|
|
6007
|
+
return stringValue.length ? stringValue.length : 0;
|
|
6008
|
+
}
|
|
6009
|
+
else {
|
|
6010
|
+
return 0;
|
|
6011
|
+
}
|
|
6012
|
+
}
|
|
6013
|
+
function _numberToString(input, decimals, locale, useGrouping) {
|
|
6014
|
+
if (input == null) {
|
|
6015
|
+
input = 0;
|
|
6016
|
+
}
|
|
6017
|
+
if (decimals == null || decimals == -1) {
|
|
6018
|
+
decimals = countDecimals(input);
|
|
6019
|
+
}
|
|
6020
|
+
let n = Number(input);
|
|
6021
|
+
let f = decimals > -1
|
|
6022
|
+
? {
|
|
6023
|
+
minimumFractionDigits: decimals,
|
|
6024
|
+
maximumFractionDigits: decimals,
|
|
6025
|
+
useGrouping: useGrouping,
|
|
6026
|
+
}
|
|
6027
|
+
: { useGrouping: useGrouping };
|
|
6028
|
+
return n.toLocaleString(locale, f);
|
|
6029
|
+
}
|
|
6030
|
+
/**
|
|
6031
|
+
* @param time time as Date object
|
|
6032
|
+
* @param manageSeconds flag to set seconds managing
|
|
6033
|
+
* @return time as string, formatted
|
|
6034
|
+
**/
|
|
6035
|
+
function formatTime(time, manageSeconds) {
|
|
6036
|
+
const options = {
|
|
6037
|
+
hour: '2-digit',
|
|
6038
|
+
minute: '2-digit',
|
|
6039
|
+
hour12: false,
|
|
6040
|
+
};
|
|
6041
|
+
if (manageSeconds == true) {
|
|
6042
|
+
options.second = '2-digit';
|
|
6043
|
+
}
|
|
6044
|
+
return time.toLocaleTimeString(dom$a.ketchup.dates.getLocale() + '-u-hc-h23', options);
|
|
6045
|
+
}
|
|
6046
|
+
/**
|
|
6047
|
+
* @param value time string, formatted by actual browser locale
|
|
6048
|
+
* @returns true if time string in input is a valid time
|
|
6049
|
+
*/
|
|
6050
|
+
function isValidFormattedStringTime(value, manageSeconds) {
|
|
6051
|
+
let format = getCurrentTimeFormatFromBrowserLocale(manageSeconds);
|
|
6052
|
+
return dom$a.ketchup.dates.isValid(value, format, true);
|
|
6053
|
+
}
|
|
6054
|
+
/**
|
|
6055
|
+
* @param value date/time as string, formatted by actual browser locale
|
|
6056
|
+
* @returns date/time as string, formatted ISO
|
|
6057
|
+
**/
|
|
6058
|
+
function formattedStringToDefaultUnformattedStringTimestamp(value) {
|
|
6059
|
+
return formattedStringToCustomUnformattedStringTime(value, KupDatesFormats.ISO_DATE_TIME, true);
|
|
6060
|
+
}
|
|
6061
|
+
/**
|
|
6062
|
+
* @param value time as string, formatted by actual browser locale
|
|
6063
|
+
* @param outputFormat time format to return
|
|
6064
|
+
* @param manageSeconds flag to set seconds managing
|
|
6065
|
+
* @returns time as string, formatted
|
|
6066
|
+
**/
|
|
6067
|
+
function formattedStringToCustomUnformattedStringTime(value, outputFormat, manageSeconds) {
|
|
6068
|
+
let inputFormat = getCurrentTimeFormatFromBrowserLocale(manageSeconds);
|
|
6069
|
+
if (dom$a.ketchup.dates.isValid(value, inputFormat)) {
|
|
6070
|
+
return dom$a.ketchup.dates.format(dom$a.ketchup.dates.normalize(value, KupDatesNormalize.TIME), outputFormat);
|
|
6071
|
+
}
|
|
6072
|
+
else {
|
|
6073
|
+
return '';
|
|
6074
|
+
}
|
|
6075
|
+
}
|
|
6076
|
+
/**
|
|
6077
|
+
* @param value time as string, formatted ISO
|
|
6078
|
+
* @param manageSeconds flag to set seconds managing
|
|
6079
|
+
* @param valueTimeFormat time format (default ISO)
|
|
6080
|
+
* @param customedFormat time format from smeupObject
|
|
6081
|
+
* @returns time as string, formatted by actual browser locale
|
|
6082
|
+
**/
|
|
6083
|
+
function unformattedStringToFormattedStringTime(value, manageSeconds, customedFormat) {
|
|
6084
|
+
const options = {
|
|
6085
|
+
hour: '2-digit',
|
|
6086
|
+
minute: '2-digit',
|
|
6087
|
+
hour12: false,
|
|
6088
|
+
};
|
|
6089
|
+
if (manageSeconds == true) {
|
|
6090
|
+
options.second = '2-digit';
|
|
6091
|
+
}
|
|
6092
|
+
let date = dom$a.ketchup.dates.toDate(dom$a.ketchup.dates.normalize(value, KupDatesNormalize.TIME));
|
|
6093
|
+
return formatByCustomedOutputTimeFormat(value, date, options, customedFormat);
|
|
6094
|
+
}
|
|
6095
|
+
function formatByCustomedOutputTimeFormat(valueStr, date, options, customedFormat) {
|
|
6096
|
+
if (customedFormat == null) {
|
|
6097
|
+
return date.toLocaleTimeString(dom$a.ketchup.dates.getLocale() + '-u-hc-h23', options);
|
|
6098
|
+
}
|
|
6099
|
+
switch (customedFormat) {
|
|
6100
|
+
case 'I13': {
|
|
6101
|
+
//hh:mm
|
|
6102
|
+
break;
|
|
6103
|
+
}
|
|
6104
|
+
case 'I12': {
|
|
6105
|
+
//hh:mm:ss
|
|
6106
|
+
break;
|
|
6107
|
+
}
|
|
6108
|
+
case 'I11': {
|
|
6109
|
+
//???
|
|
6110
|
+
//hh:dddd
|
|
6111
|
+
//return moment(date).format('HH:DDDD');
|
|
6112
|
+
return valueStr;
|
|
6113
|
+
}
|
|
6114
|
+
case 'I14': {
|
|
6115
|
+
//???
|
|
6116
|
+
//sssss
|
|
6117
|
+
//return moment(date).format('SSSSS');
|
|
6118
|
+
return valueStr;
|
|
6119
|
+
}
|
|
6120
|
+
case 'I1H': {
|
|
6121
|
+
//???
|
|
6122
|
+
//Ora,Cen/Min HH,xx
|
|
6123
|
+
return valueStr;
|
|
6124
|
+
}
|
|
6125
|
+
case 'I1M': {
|
|
6126
|
+
//???
|
|
6127
|
+
//Min,Cen/Sec MMMM,xx
|
|
6128
|
+
return valueStr;
|
|
6129
|
+
}
|
|
6130
|
+
case 'I21': {
|
|
6131
|
+
//???
|
|
6132
|
+
//Giorni,(4 decim)
|
|
6133
|
+
return valueStr;
|
|
6134
|
+
}
|
|
6135
|
+
case 'I22': {
|
|
6136
|
+
//???
|
|
6137
|
+
//Ore,(4 decim)
|
|
6138
|
+
return valueStr;
|
|
6139
|
+
}
|
|
6140
|
+
case 'I23': {
|
|
6141
|
+
//???
|
|
6142
|
+
//Minuti,(4 decim)
|
|
6143
|
+
return valueStr;
|
|
6144
|
+
}
|
|
6145
|
+
case 'I24': {
|
|
6146
|
+
//???
|
|
6147
|
+
//Secondi
|
|
6148
|
+
return valueStr;
|
|
6149
|
+
}
|
|
6150
|
+
case 'I2H': {
|
|
6151
|
+
//???
|
|
6152
|
+
//Ora,Cen/Min HHHH,xx
|
|
6153
|
+
return valueStr;
|
|
6154
|
+
}
|
|
6155
|
+
case 'I2D': {
|
|
6156
|
+
//???
|
|
6157
|
+
//Ore Minuti Secondi HHMMS
|
|
6158
|
+
return valueStr;
|
|
6159
|
+
}
|
|
6160
|
+
case 'I2M': {
|
|
6161
|
+
//???
|
|
6162
|
+
//Min,Cen/Sec MMMM,xx
|
|
6163
|
+
return valueStr;
|
|
6164
|
+
}
|
|
6165
|
+
}
|
|
6166
|
+
return date.toLocaleTimeString(dom$a.ketchup.dates.getLocale() + '-u-hc-h23', options);
|
|
6167
|
+
}
|
|
6168
|
+
/**
|
|
6169
|
+
* @param value date/time as string, formatted ISO
|
|
6170
|
+
* @param valueDateFormat date/time format (default ISO)
|
|
6171
|
+
* @returns date/time as string, formatted by actual browser locale
|
|
6172
|
+
**/
|
|
6173
|
+
function unformattedStringToFormattedStringTimestamp(value) {
|
|
6174
|
+
const options = {
|
|
6175
|
+
day: '2-digit',
|
|
6176
|
+
month: '2-digit',
|
|
6177
|
+
year: 'numeric',
|
|
6178
|
+
hour: '2-digit',
|
|
6179
|
+
minute: '2-digit',
|
|
6180
|
+
second: '2-digit',
|
|
6181
|
+
hour12: false,
|
|
6182
|
+
};
|
|
6183
|
+
let date = dom$a.ketchup.dates.toDate(dom$a.ketchup.dates.normalize(value, KupDatesNormalize.TIMESTAMP));
|
|
6184
|
+
return date.toLocaleString(dom$a.ketchup.dates.getLocale() + '-u-hc-h23', options);
|
|
6185
|
+
}
|
|
6186
|
+
function getMonthAsStringByLocale(month, format) {
|
|
6187
|
+
if (month == null) {
|
|
6188
|
+
return '';
|
|
6189
|
+
}
|
|
6190
|
+
const dateTmp = new Date();
|
|
6191
|
+
dateTmp.setDate(1);
|
|
6192
|
+
dateTmp.setMonth(month - 1);
|
|
6193
|
+
const options = {
|
|
6194
|
+
month: format,
|
|
6195
|
+
};
|
|
6196
|
+
const dateTimeFormat = new Intl.DateTimeFormat(dom$a.ketchup.dates.getLocale(), options);
|
|
6197
|
+
return dateTimeFormat.format(dateTmp);
|
|
6198
|
+
}
|
|
6199
|
+
function getMonthsAsStringByLocale(format) {
|
|
6200
|
+
if (format == null || format.trim() == '') {
|
|
6201
|
+
format = DateTimeFormatOptionsMonth.LONG;
|
|
6202
|
+
}
|
|
6203
|
+
var months = [];
|
|
6204
|
+
for (var i = 0; i < 12; i++) {
|
|
6205
|
+
months[i] = getMonthAsStringByLocale(i + 1, format);
|
|
6206
|
+
}
|
|
6207
|
+
return months;
|
|
6208
|
+
}
|
|
6209
|
+
/**
|
|
6210
|
+
* Used to retrieve component's props values.
|
|
6211
|
+
* @param {any} comp - Component calling this function.
|
|
6212
|
+
* @param {GenericObject} list - Prop list, specific for each component.
|
|
6213
|
+
* @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
|
|
6214
|
+
* @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
|
|
6215
|
+
*/
|
|
6216
|
+
function getProps(comp, list, descriptions) {
|
|
6217
|
+
let props = {};
|
|
6218
|
+
if (descriptions) {
|
|
6219
|
+
props = list;
|
|
6220
|
+
}
|
|
6221
|
+
else {
|
|
6222
|
+
for (const key in list) {
|
|
6223
|
+
if (Object.prototype.hasOwnProperty.call(list, key)) {
|
|
6224
|
+
props[key] = comp[key];
|
|
6225
|
+
}
|
|
6226
|
+
}
|
|
6227
|
+
}
|
|
6228
|
+
return props;
|
|
6229
|
+
}
|
|
6230
|
+
/**
|
|
6231
|
+
* Sets the props to the component.
|
|
6232
|
+
* @param {any} comp - Component calling this function.
|
|
6233
|
+
* @param {GenericObject} list - Prop list, specific for each component.
|
|
6234
|
+
* @param {GenericObject} props - Prop to be set.
|
|
6235
|
+
*/
|
|
6236
|
+
function setProps(comp, list, props) {
|
|
6237
|
+
for (const key in props) {
|
|
6238
|
+
// If key is a custom prop it will be set on the component (i.e.: "data", "customStyle", ecc.)
|
|
6239
|
+
if (list[key]) {
|
|
6240
|
+
comp[key] = props[key];
|
|
6241
|
+
}
|
|
6242
|
+
else {
|
|
6243
|
+
// Otherwise, it will be set on its HTML element (i.e.: "id", "style", ecc.)
|
|
6244
|
+
comp.rootElement[key] = props[key];
|
|
6245
|
+
}
|
|
6246
|
+
}
|
|
6247
|
+
}
|
|
6248
|
+
|
|
6249
|
+
const dom$9 = document.documentElement;
|
|
6250
|
+
// -------------
|
|
6251
|
+
// COMMONS
|
|
6252
|
+
// -------------
|
|
6253
|
+
function getCellValueForDisplay(column, cell) {
|
|
6254
|
+
if (cell != null) {
|
|
6255
|
+
if (cell.displayedValue != null) {
|
|
6256
|
+
return cell.displayedValue;
|
|
6257
|
+
}
|
|
6258
|
+
}
|
|
6259
|
+
let formattedValue = _getCellValueForDisplay(cell.value, column, cell);
|
|
6260
|
+
if (cell != null) {
|
|
6261
|
+
cell.displayedValue = formattedValue;
|
|
6262
|
+
}
|
|
6263
|
+
return formattedValue;
|
|
6264
|
+
}
|
|
6265
|
+
function getValueForDisplay2(values, column) {
|
|
6266
|
+
if (values == null) {
|
|
6267
|
+
return '';
|
|
6268
|
+
}
|
|
6269
|
+
if (values.displayedValue == null || values.displayedValue.trim() == '') {
|
|
6270
|
+
values.displayedValue = _getCellValueForDisplay(values.value, column, null);
|
|
6271
|
+
}
|
|
6272
|
+
return values.displayedValue;
|
|
6273
|
+
}
|
|
6274
|
+
function formatToNumber(cell) {
|
|
6275
|
+
if (cell.obj) {
|
|
6276
|
+
return dom$9.ketchup.math.numberify(cell.obj.k);
|
|
6277
|
+
}
|
|
6278
|
+
return dom$9.ketchup.math.numberify(cell.value);
|
|
6279
|
+
}
|
|
6280
|
+
function _getCellValueForDisplay(value, column, cell) {
|
|
6281
|
+
let obj = column != null ? column.obj : null;
|
|
6282
|
+
if (cell != null) {
|
|
6283
|
+
obj = cell.obj ? cell.obj : obj;
|
|
6284
|
+
}
|
|
6285
|
+
return getValueForDisplay(value, obj, column != null ? column.decimals : null);
|
|
6286
|
+
}
|
|
6287
|
+
function getValueForDisplay(value, obj, decimals) {
|
|
6288
|
+
if (value == null || value.trim() == '') {
|
|
6289
|
+
return value;
|
|
6290
|
+
}
|
|
6291
|
+
if (dom$9.ketchup.objects.isNumber(obj)) {
|
|
6292
|
+
return unformattedStringToFormattedStringNumber(value, decimals ? decimals : -1, obj ? obj.p : '');
|
|
6293
|
+
}
|
|
6294
|
+
if (dom$9.ketchup.objects.isDate(obj) &&
|
|
6295
|
+
dom$9.ketchup.dates.isValid(value, KupDatesFormats.ISO_DATE)) {
|
|
6296
|
+
return dom$9.ketchup.dates.format(value);
|
|
6297
|
+
}
|
|
6298
|
+
if (dom$9.ketchup.objects.isTime(obj)) {
|
|
6299
|
+
return unformattedStringToFormattedStringTime(value, dom$9.ketchup.objects.isTimeWithSeconds(obj), obj.t + obj.p);
|
|
6300
|
+
}
|
|
6301
|
+
if (dom$9.ketchup.objects.isTimestamp(obj)) {
|
|
6302
|
+
return unformattedStringToFormattedStringTimestamp(value);
|
|
6303
|
+
}
|
|
6304
|
+
return value;
|
|
6305
|
+
}
|
|
6306
|
+
function getColumnByName(columns, name) {
|
|
6307
|
+
if (columns == null) {
|
|
6308
|
+
return null;
|
|
6309
|
+
}
|
|
6310
|
+
for (let column of columns) {
|
|
6311
|
+
if (column.name === name) {
|
|
6312
|
+
return column;
|
|
6313
|
+
}
|
|
6314
|
+
}
|
|
6315
|
+
return null;
|
|
6316
|
+
}
|
|
6317
|
+
function compareCell(cell1, cell2, sortMode) {
|
|
6318
|
+
return compareValues(cell1.obj, cell1.value, cell2.obj, cell2.value, sortMode);
|
|
6319
|
+
}
|
|
6320
|
+
function compareValues(obj1, value1, obj2, value2, sortMode) {
|
|
6321
|
+
const sm = sortMode === 'A' ? 1 : -1;
|
|
6322
|
+
if (obj1 == null || obj2 == null) {
|
|
6323
|
+
return sm * localCompareAsInJava(value1, value2);
|
|
6324
|
+
}
|
|
6325
|
+
// If either the type or the parameter of the current object are not equal.
|
|
6326
|
+
if (!(obj1.t === obj2.t && obj1.p === obj2.p)) {
|
|
6327
|
+
let compare = localCompareAsInJava(obj1.t, obj2.t);
|
|
6328
|
+
if (compare === 0) {
|
|
6329
|
+
compare = localCompareAsInJava(obj1.p, obj2.p);
|
|
6330
|
+
}
|
|
6331
|
+
return compare * sm;
|
|
6332
|
+
}
|
|
6333
|
+
let s1 = value1;
|
|
6334
|
+
let s2 = value2;
|
|
6335
|
+
if (s1 == s2) {
|
|
6336
|
+
return 0;
|
|
6337
|
+
}
|
|
6338
|
+
if (s1 == '') {
|
|
6339
|
+
return sm * -1;
|
|
6340
|
+
}
|
|
6341
|
+
if (s2 == '') {
|
|
6342
|
+
return sm * 1;
|
|
6343
|
+
}
|
|
6344
|
+
let v1 = s1;
|
|
6345
|
+
let v2 = s2;
|
|
6346
|
+
if (dom$9.ketchup.objects.isNumber(obj1)) {
|
|
6347
|
+
v1 = stringToNumber(s1);
|
|
6348
|
+
v2 = stringToNumber(s2);
|
|
6349
|
+
}
|
|
6350
|
+
else if (dom$9.ketchup.objects.isDate(obj1)) {
|
|
6351
|
+
v1 = dom$9.ketchup.dates.toDate(dom$9.ketchup.dates.format(s1, KupDatesFormats.ISO_DATE));
|
|
6352
|
+
v2 = dom$9.ketchup.dates.toDate(dom$9.ketchup.dates.format(s2, KupDatesFormats.ISO_DATE));
|
|
6353
|
+
}
|
|
6354
|
+
else if (dom$9.ketchup.objects.isTime(obj1)) {
|
|
6355
|
+
let manageSeconds = dom$9.ketchup.objects.isTimeWithSeconds(obj1);
|
|
6356
|
+
v1 = dom$9.ketchup.dates.toDate(dom$9.ketchup.dates.format(s1, manageSeconds
|
|
6357
|
+
? KupDatesFormats.ISO_TIME
|
|
6358
|
+
: KupDatesFormats.ISO_TIME_WITHOUT_SECONDS));
|
|
6359
|
+
v2 = dom$9.ketchup.dates.toDate(dom$9.ketchup.dates.format(s2, manageSeconds
|
|
6360
|
+
? KupDatesFormats.ISO_TIME
|
|
6361
|
+
: KupDatesFormats.ISO_TIME_WITHOUT_SECONDS));
|
|
6362
|
+
}
|
|
6363
|
+
else if (dom$9.ketchup.objects.isTimestamp(obj1)) {
|
|
6364
|
+
v1 = dom$9.ketchup.dates.toDate(dom$9.ketchup.dates.format(s1, KupDatesFormats.ISO_DATE_TIME));
|
|
6365
|
+
v2 = dom$9.ketchup.dates.toDate(dom$9.ketchup.dates.format(s2, KupDatesFormats.ISO_DATE_TIME));
|
|
6366
|
+
}
|
|
6367
|
+
if (v1 > v2) {
|
|
6368
|
+
return sm * 1;
|
|
6369
|
+
}
|
|
6370
|
+
if (v1 < v2) {
|
|
6371
|
+
return sm * -1;
|
|
6372
|
+
}
|
|
6373
|
+
return 0;
|
|
6374
|
+
}
|
|
6375
|
+
/**
|
|
6376
|
+
* Given two strings to compare, the functions decides which string comes before the other or if they are equal.
|
|
6377
|
+
* This is meant as a replacement for the JavaScript function localCompare() which produces a slightly different result from
|
|
6378
|
+
* the Java version of compareTo().
|
|
6379
|
+
*
|
|
6380
|
+
* Re-implemented from java source method compareTo() of java.lang.String
|
|
6381
|
+
* @param t1 firstString the first string to be compared
|
|
6382
|
+
* @param t2 anotherString the another string to be compared to the first one
|
|
6383
|
+
* @returns the value 0 if the anotherString is equal to
|
|
6384
|
+
* firstString; a value less than 0 if firstString
|
|
6385
|
+
* is lexicographically less than the anotherString; and a
|
|
6386
|
+
* value greater than 0 if firstString is
|
|
6387
|
+
* lexicographically greater than the anotherString.
|
|
6388
|
+
*/
|
|
6389
|
+
function localCompareAsInJava(t1, t2) {
|
|
6390
|
+
let t1Length = t1 == null ? 0 : t1.length;
|
|
6391
|
+
let t2Length = t2 == null ? 0 : t2.length;
|
|
6392
|
+
const lim = Math.min(t1Length, t2Length);
|
|
6393
|
+
let k = 0;
|
|
6394
|
+
while (k < lim) {
|
|
6395
|
+
const c1 = t1[k];
|
|
6396
|
+
const c2 = t2[k];
|
|
6397
|
+
if (c1 !== c2) {
|
|
6398
|
+
return c1.charCodeAt(0) - c2.charCodeAt(0);
|
|
6399
|
+
}
|
|
6400
|
+
k++;
|
|
6401
|
+
}
|
|
6402
|
+
return t1Length - t2Length;
|
|
6403
|
+
}
|
|
6404
|
+
|
|
6405
|
+
/**
|
|
6406
|
+
* Interface for ranged filters.
|
|
6407
|
+
*/
|
|
6408
|
+
var FilterInterval;
|
|
6409
|
+
(function (FilterInterval) {
|
|
6410
|
+
FilterInterval[FilterInterval["FROM"] = 0] = "FROM";
|
|
6411
|
+
FilterInterval[FilterInterval["TO"] = 1] = "TO";
|
|
6412
|
+
})(FilterInterval || (FilterInterval = {}));
|
|
6413
|
+
/**
|
|
6414
|
+
* This regular expressions returns a match like this one:
|
|
6415
|
+
* if the string does not match is null, otherwise the indexes are equal to the object below:
|
|
6416
|
+
*
|
|
6417
|
+
* @property {string} 0 - The entire match of the regexp; is equal to the cellValue.
|
|
6418
|
+
* @property {string} 1 - Either !' or ' it's the start of the regexp.
|
|
6419
|
+
* @property {string} 2 - Either % or null: means the string must start with the given string.
|
|
6420
|
+
* @property {string} 3 - Either "" or a string with a length.
|
|
6421
|
+
* @property {string} 4 - Either % or null: means the string must finish with the given string.
|
|
6422
|
+
* @property {string} 5 - Always equal to ': it's the end of the filter.
|
|
6423
|
+
*/
|
|
6424
|
+
const FILTER_ANALIZER = /^('|!')(%){0,1}(.*?)(%){0,1}(')$/;
|
|
6425
|
+
var KupGlobalFilterMode;
|
|
6426
|
+
(function (KupGlobalFilterMode) {
|
|
6427
|
+
KupGlobalFilterMode["SIMPLE"] = "simple";
|
|
6428
|
+
KupGlobalFilterMode["HIGHLIGHT"] = "highlight";
|
|
6429
|
+
})(KupGlobalFilterMode || (KupGlobalFilterMode = {}));
|
|
6430
|
+
|
|
6431
|
+
const dom$8 = document.documentElement;
|
|
6432
|
+
/**
|
|
6433
|
+
* Filtering algorithms.
|
|
6434
|
+
* @module Filters
|
|
6435
|
+
* @todo Should contain EVERY filtering method in common between filtering types (i.e.: global filters and column menu filters).
|
|
6436
|
+
*/
|
|
6437
|
+
class Filters {
|
|
6438
|
+
/**
|
|
6439
|
+
* Function used to check whether the component is a KupTree or KupDataTable.
|
|
6440
|
+
* @param {KupDataTable | KupTree} comp - Component using the column menu.
|
|
6441
|
+
* @returns {comp is KupTree} Returns true when the component is KupTree.
|
|
6442
|
+
*/
|
|
6443
|
+
static isTree(comp) {
|
|
6444
|
+
return comp.rootElement.tagName === KupTagNames.TREE;
|
|
6445
|
+
}
|
|
6446
|
+
isObjFiltrableByInterval(obj) {
|
|
6447
|
+
if (dom$8.ketchup.objects.isDate(obj)) {
|
|
6448
|
+
return true;
|
|
6449
|
+
}
|
|
6450
|
+
if (dom$8.ketchup.objects.isTime(obj)) {
|
|
6451
|
+
return true;
|
|
6452
|
+
}
|
|
6453
|
+
if (dom$8.ketchup.objects.isTimestamp(obj)) {
|
|
6454
|
+
return true;
|
|
6455
|
+
}
|
|
6456
|
+
if (dom$8.ketchup.objects.isNumber(obj)) {
|
|
6457
|
+
return true;
|
|
6458
|
+
}
|
|
6459
|
+
return false;
|
|
6460
|
+
}
|
|
6461
|
+
normalizeValue(value, smeupObj) {
|
|
6462
|
+
let newValue = value != null ? value.trim() : value;
|
|
6463
|
+
if (newValue == null || newValue == '' || smeupObj == null) {
|
|
6464
|
+
return newValue;
|
|
6465
|
+
}
|
|
6466
|
+
if (dom$8.ketchup.objects.isDate(smeupObj)) {
|
|
6467
|
+
if (dom$8.ketchup.dates.isValid(value, KupDatesFormats.ISO_DATE)) {
|
|
6468
|
+
return newValue;
|
|
6469
|
+
}
|
|
6470
|
+
if (dom$8.ketchup.dates.isValid(value)) {
|
|
6471
|
+
return dom$8.ketchup.dates.format(dom$8.ketchup.dates.normalize(value, KupDatesNormalize.DATE), KupDatesFormats.ISO_DATE);
|
|
6472
|
+
}
|
|
6473
|
+
}
|
|
6474
|
+
else if (dom$8.ketchup.objects.isTime(smeupObj)) {
|
|
6475
|
+
let manageSeconds = dom$8.ketchup.objects.isTimeWithSeconds(smeupObj);
|
|
6476
|
+
if (dom$8.ketchup.dates.isValid(value, manageSeconds
|
|
6477
|
+
? KupDatesFormats.ISO_TIME
|
|
6478
|
+
: KupDatesFormats.ISO_TIME_WITHOUT_SECONDS)) {
|
|
6479
|
+
return newValue;
|
|
6480
|
+
}
|
|
6481
|
+
if (isValidFormattedStringTime(value, manageSeconds)) {
|
|
6482
|
+
return formattedStringToCustomUnformattedStringTime(value, manageSeconds
|
|
6483
|
+
? KupDatesFormats.ISO_TIME
|
|
6484
|
+
: KupDatesFormats.ISO_TIME_WITHOUT_SECONDS, manageSeconds);
|
|
6485
|
+
}
|
|
6486
|
+
}
|
|
6487
|
+
else if (dom$8.ketchup.objects.isTimestamp(smeupObj)) {
|
|
6488
|
+
if (dom$8.ketchup.dates.isValid(value, KupDatesFormats.ISO_DATE_TIME)) {
|
|
6489
|
+
return newValue;
|
|
6490
|
+
}
|
|
6491
|
+
if (isValidFormattedStringTime(value, true)) {
|
|
6492
|
+
return formattedStringToDefaultUnformattedStringTimestamp(value);
|
|
6493
|
+
}
|
|
6494
|
+
}
|
|
6495
|
+
else if (dom$8.ketchup.objects.isNumber(smeupObj)) {
|
|
6496
|
+
if (isValidFormattedStringNumber(value, smeupObj ? smeupObj.p : '')) {
|
|
6497
|
+
return formattedStringToUnformattedStringNumber(value, smeupObj ? smeupObj.p : '');
|
|
6498
|
+
}
|
|
6499
|
+
}
|
|
6500
|
+
return newValue;
|
|
6501
|
+
}
|
|
6502
|
+
/**
|
|
6503
|
+
* Given a filter value, check if is a negative filter
|
|
6504
|
+
* @param filterValue the filter value to use for check
|
|
6505
|
+
*/
|
|
6506
|
+
filterIsNegative(filterValue) {
|
|
6507
|
+
const analyzedFilter = filterValue.match(FILTER_ANALIZER);
|
|
6508
|
+
const filterIsNegative = analyzedFilter
|
|
6509
|
+
? analyzedFilter[1].indexOf('!') >= 0
|
|
6510
|
+
: false;
|
|
6511
|
+
return filterIsNegative;
|
|
6512
|
+
}
|
|
6513
|
+
/**
|
|
6514
|
+
* Given a value and a filter value, returns if that value matches the filter.
|
|
6515
|
+
*
|
|
6516
|
+
* Web filters can also be expressions: by putting strings between single quotes (') it's possible to activate filter expressions.
|
|
6517
|
+
* Valid syntax:
|
|
6518
|
+
* 'filter' = search for exact phrase;
|
|
6519
|
+
* '' = match when value is empty;
|
|
6520
|
+
* 'filter%' = match when a string starts with "filter";
|
|
6521
|
+
* '%filter' = match when a string ends with "filter";
|
|
6522
|
+
* '%filter%' = match when a string contains "filter".
|
|
6523
|
+
*
|
|
6524
|
+
* It is also possible to negate the expression by prepending "!" in front of the expression.
|
|
6525
|
+
* For example: !'' = value in the cell must not be empty.
|
|
6526
|
+
*
|
|
6527
|
+
* With no expression set, the filter is by default set to '%filter%'.
|
|
6528
|
+
*
|
|
6529
|
+
* @param value - The current value to check.
|
|
6530
|
+
* @param filterValue - The value of the current filter.
|
|
6531
|
+
* @returns false if value or filterValue are empty;
|
|
6532
|
+
true if value contains filterValue;
|
|
6533
|
+
true if value matches special filter created on filterValue;
|
|
6534
|
+
false otherwise.
|
|
6535
|
+
*/
|
|
6536
|
+
isFilterCompliantForValue(value, filterValue) {
|
|
6537
|
+
if (value == null) {
|
|
6538
|
+
return false;
|
|
6539
|
+
}
|
|
6540
|
+
if (filterValue == null) {
|
|
6541
|
+
return false;
|
|
6542
|
+
}
|
|
6543
|
+
const _filterIsNegative = this.filterIsNegative(filterValue);
|
|
6544
|
+
// checks if the value of the filter is contained inside value of the object
|
|
6545
|
+
// Or is if the filter is a special filter to be matched.
|
|
6546
|
+
if (value.toLowerCase().includes(filterValue.toLowerCase()) ||
|
|
6547
|
+
this.matchSpecialFilter(value.toLowerCase(), filterValue.toLowerCase().match(FILTER_ANALIZER), true)) {
|
|
6548
|
+
// the element matches the field filter
|
|
6549
|
+
if (_filterIsNegative) {
|
|
6550
|
+
return false;
|
|
6551
|
+
}
|
|
6552
|
+
return true;
|
|
6553
|
+
}
|
|
6554
|
+
if (_filterIsNegative) {
|
|
6555
|
+
return true;
|
|
6556
|
+
}
|
|
6557
|
+
return false;
|
|
6558
|
+
}
|
|
6559
|
+
/**
|
|
6560
|
+
* Given a value and a filter value, returns if that value matches the filter.
|
|
6561
|
+
*
|
|
6562
|
+
* Web filters can also be expressions: by putting strings between single quotes (') it's possible to activate filter expressions.
|
|
6563
|
+
* Valid syntax:
|
|
6564
|
+
* 'filter' = search for exact phrase;
|
|
6565
|
+
* '' = match when value is empty;
|
|
6566
|
+
* 'filter%' = match when a string starts with "filter";
|
|
6567
|
+
* '%filter' = match when a string ends with "filter";
|
|
6568
|
+
* '%filter%' = match when a string contains "filter".
|
|
6569
|
+
*
|
|
6570
|
+
* It is also possible to negate the expression by prepending "!" in front of the expression.
|
|
6571
|
+
* For example: !'' = value in the cell must not be empty.
|
|
6572
|
+
*
|
|
6573
|
+
* With no expression set, the filter is by default set to '%filter%'.
|
|
6574
|
+
*
|
|
6575
|
+
* @param value - The current value to check.
|
|
6576
|
+
* @param parsedFilter - The value of the current filter.
|
|
6577
|
+
* @param ignoreNegativeFlag = false - When set to true, the matcher will ignore the (!) operator; useful for global filter.
|
|
6578
|
+
* @returns True if the filter is empty and the value of the cell is empty, false otherwise.
|
|
6579
|
+
*/
|
|
6580
|
+
matchSpecialFilter(value, parsedFilter, ignoreNegativeFlag = false) {
|
|
6581
|
+
if (parsedFilter != null) {
|
|
6582
|
+
// endsWith and startWith are not supported by IE 11
|
|
6583
|
+
// Check here https://www.w3schools.com/jsref/jsref_endswith.asp
|
|
6584
|
+
const toRet = (parsedFilter[3] === '' && !value.trim()) ||
|
|
6585
|
+
(!parsedFilter[2] &&
|
|
6586
|
+
parsedFilter[4] &&
|
|
6587
|
+
value.startsWith(parsedFilter[3])) ||
|
|
6588
|
+
(parsedFilter[2] &&
|
|
6589
|
+
!parsedFilter[4] &&
|
|
6590
|
+
value.endsWith(parsedFilter[3])) ||
|
|
6591
|
+
(!parsedFilter[2] &&
|
|
6592
|
+
!parsedFilter[4] &&
|
|
6593
|
+
value === parsedFilter[3]) ||
|
|
6594
|
+
(parsedFilter[2] &&
|
|
6595
|
+
parsedFilter[4] &&
|
|
6596
|
+
value.indexOf(parsedFilter[3]) >= 0);
|
|
6597
|
+
return !ignoreNegativeFlag
|
|
6598
|
+
? parsedFilter[1].indexOf('!') < 0
|
|
6599
|
+
? toRet
|
|
6600
|
+
: !toRet
|
|
6601
|
+
: toRet;
|
|
6602
|
+
}
|
|
6603
|
+
return false;
|
|
6604
|
+
}
|
|
6605
|
+
isFilterCompliantForSimpleValue(valueToCheck, obj, filterValue, interval) {
|
|
6606
|
+
if (valueToCheck == null) {
|
|
6607
|
+
return false;
|
|
6608
|
+
}
|
|
6609
|
+
filterValue = this.normalizeValue(filterValue, obj);
|
|
6610
|
+
let value = valueToCheck;
|
|
6611
|
+
let from = '';
|
|
6612
|
+
let to = '';
|
|
6613
|
+
if (interval != null) {
|
|
6614
|
+
from = interval[FilterInterval.FROM];
|
|
6615
|
+
to = interval[FilterInterval.TO];
|
|
6616
|
+
}
|
|
6617
|
+
let checkByRegularExpression = true;
|
|
6618
|
+
if (dom$8.ketchup.objects.isNumber(obj)) {
|
|
6619
|
+
value = unformattedStringNumberToNumber(value, obj ? obj.p : '');
|
|
6620
|
+
let valueNumber = stringToNumber(value);
|
|
6621
|
+
if (from != '') {
|
|
6622
|
+
if (isNumber(from)) {
|
|
6623
|
+
checkByRegularExpression = false;
|
|
6624
|
+
let fromNumber = stringToNumber(from);
|
|
6625
|
+
if (valueNumber < fromNumber) {
|
|
6626
|
+
return false;
|
|
6627
|
+
}
|
|
6628
|
+
}
|
|
6629
|
+
else {
|
|
6630
|
+
filterValue = from;
|
|
6631
|
+
}
|
|
6632
|
+
}
|
|
6633
|
+
if (to != '') {
|
|
6634
|
+
if (isNumber(to)) {
|
|
6635
|
+
checkByRegularExpression = false;
|
|
6636
|
+
let toNumber = stringToNumber(to);
|
|
6637
|
+
if (valueNumber > toNumber) {
|
|
6638
|
+
return false;
|
|
6639
|
+
}
|
|
6640
|
+
}
|
|
6641
|
+
else {
|
|
6642
|
+
filterValue = to;
|
|
6643
|
+
}
|
|
6644
|
+
}
|
|
6645
|
+
}
|
|
6646
|
+
if (dom$8.ketchup.objects.isDate(obj) ||
|
|
6647
|
+
dom$8.ketchup.objects.isTime(obj) ||
|
|
6648
|
+
dom$8.ketchup.objects.isTimestamp(obj)) {
|
|
6649
|
+
let valueDate = null;
|
|
6650
|
+
let defaultFormat = KupDatesFormats.ISO_DATE;
|
|
6651
|
+
if (dom$8.ketchup.objects.isDate(obj)) {
|
|
6652
|
+
defaultFormat = KupDatesFormats.ISO_DATE;
|
|
6653
|
+
}
|
|
6654
|
+
else if (dom$8.ketchup.objects.isTime(obj)) {
|
|
6655
|
+
defaultFormat = dom$8.ketchup.objects.isTimeWithSeconds(obj)
|
|
6656
|
+
? KupDatesFormats.ISO_TIME
|
|
6657
|
+
: KupDatesFormats.ISO_TIME_WITHOUT_SECONDS;
|
|
6658
|
+
}
|
|
6659
|
+
else if (dom$8.ketchup.objects.isTimestamp(obj)) {
|
|
6660
|
+
defaultFormat = KupDatesFormats.ISO_DATE_TIME;
|
|
6661
|
+
}
|
|
6662
|
+
if (dom$8.ketchup.dates.isValid(value, defaultFormat, true)) {
|
|
6663
|
+
valueDate = dom$8.ketchup.dates.toDate(value, defaultFormat);
|
|
6664
|
+
}
|
|
6665
|
+
if (from != '') {
|
|
6666
|
+
if (valueDate != null &&
|
|
6667
|
+
dom$8.ketchup.dates.isValid(from, defaultFormat, true)) {
|
|
6668
|
+
checkByRegularExpression = false;
|
|
6669
|
+
let fromDate = dom$8.ketchup.dates.toDate(from, defaultFormat);
|
|
6670
|
+
if (valueDate < fromDate) {
|
|
6671
|
+
return false;
|
|
6672
|
+
}
|
|
6673
|
+
}
|
|
6674
|
+
else {
|
|
6675
|
+
filterValue = from;
|
|
6676
|
+
}
|
|
6677
|
+
}
|
|
6678
|
+
if (to != '') {
|
|
6679
|
+
if (valueDate != null &&
|
|
6680
|
+
dom$8.ketchup.dates.isValid(to, defaultFormat, true)) {
|
|
6681
|
+
checkByRegularExpression = false;
|
|
6682
|
+
let toDate = dom$8.ketchup.dates.toDate(to, defaultFormat);
|
|
6683
|
+
if (valueDate > toDate) {
|
|
6684
|
+
return false;
|
|
6685
|
+
}
|
|
6686
|
+
}
|
|
6687
|
+
else {
|
|
6688
|
+
filterValue = to;
|
|
6689
|
+
}
|
|
6690
|
+
}
|
|
6691
|
+
if (!dom$8.ketchup.dates.isValid(filterValue, defaultFormat) &&
|
|
6692
|
+
!dom$8.ketchup.dates.isValid(filterValue)) {
|
|
6693
|
+
value = dom$8.ketchup.dates.format(value);
|
|
6694
|
+
}
|
|
6695
|
+
}
|
|
6696
|
+
if (checkByRegularExpression) {
|
|
6697
|
+
return this.isFilterCompliantForValue(value, filterValue);
|
|
6698
|
+
}
|
|
6699
|
+
return true;
|
|
6700
|
+
}
|
|
6701
|
+
static valuesArrayContainsValue(values, value) {
|
|
6702
|
+
return Filters.indexOfValueInValuesArray(values, value) >= 0;
|
|
6703
|
+
}
|
|
6704
|
+
static indexOfValueInValuesArray(values, value) {
|
|
6705
|
+
if (values == null || values.length < 1) {
|
|
6706
|
+
return -1;
|
|
6707
|
+
}
|
|
6708
|
+
for (let i = 0; i < values.length; i++) {
|
|
6709
|
+
if (values[i].value == value) {
|
|
6710
|
+
return i;
|
|
6711
|
+
}
|
|
6712
|
+
}
|
|
6713
|
+
return -1;
|
|
6714
|
+
}
|
|
6715
|
+
}
|
|
6716
|
+
|
|
6717
|
+
const dom$7 = document.documentElement;
|
|
6718
|
+
const kupObjects = dom$7.ketchup
|
|
6719
|
+
? dom$7.ketchup.objects
|
|
6720
|
+
: new KupObjects();
|
|
6721
|
+
/**
|
|
6722
|
+
* Finds all the cells matching the filters criteria in the input dataset.
|
|
6723
|
+
* @param {KupDataDataset} dataset - Input dataset.
|
|
6724
|
+
* @param {KupDataFindCellFilters} filters - Filters of the research.
|
|
6725
|
+
* @returns {KupDataCell[]} Array of cells fetched after applying the filters.
|
|
6726
|
+
*/
|
|
6727
|
+
function findCell(dataset, filters) {
|
|
6728
|
+
return dom$7.ketchup.data.finder(dataset, filters).cells;
|
|
6729
|
+
}
|
|
6730
|
+
/**
|
|
6731
|
+
* Returns all the cells values of the specified column, sorted if required.
|
|
6732
|
+
* @param {Array<KupDataRow>} dataset - Input dataset.
|
|
6733
|
+
* @param {KupDataColumn} column - Column included in the search. When missing, returns empty array.
|
|
6734
|
+
* @returns {ValueDisplayedValue[]} Values of the cells, sorted.
|
|
6735
|
+
*/
|
|
6736
|
+
function getCellValue(dataset, column, sorted) {
|
|
6737
|
+
const rows = dataset.rows;
|
|
6738
|
+
const values = new Array();
|
|
6739
|
+
const result = new Array();
|
|
6740
|
+
if (!rows || rows.length == 0 || !column) {
|
|
6741
|
+
return result;
|
|
6742
|
+
}
|
|
6743
|
+
extractColumnValues(rows, column, values);
|
|
6744
|
+
if (sorted == true) {
|
|
6745
|
+
values.sort((n1, n2) => {
|
|
6746
|
+
return compareValues(null, kupObjects.isDate(n1.obj)
|
|
6747
|
+
? n1.value
|
|
6748
|
+
: getValueForDisplay2(n1, column), null, kupObjects.isDate(n2.obj)
|
|
6749
|
+
? n2.value
|
|
6750
|
+
: getValueForDisplay2(n2, column), SortMode.A);
|
|
6751
|
+
});
|
|
6752
|
+
}
|
|
6753
|
+
for (let i = 0; i < values.length; i++) {
|
|
6754
|
+
let v = values[i];
|
|
6755
|
+
result.push({ value: v.value, displayedValue: v.displayedValue });
|
|
6756
|
+
}
|
|
6757
|
+
return result;
|
|
6758
|
+
}
|
|
6759
|
+
function extractColumnValues(rows, column, values) {
|
|
6760
|
+
/** il valore delle righe attualmente filtrate, formattato */
|
|
6761
|
+
rows.forEach((row) => addColumnValueFromRow(values, column, row.cells[column.name]));
|
|
6762
|
+
return values;
|
|
6763
|
+
}
|
|
6764
|
+
function addColumnValueFromRow(values, column, cell) {
|
|
6765
|
+
if (cell) {
|
|
6766
|
+
let item = {
|
|
6767
|
+
value: cell.value,
|
|
6768
|
+
displayedValue: getCellValueForDisplay(column, cell),
|
|
6769
|
+
obj: cell.obj ? cell.obj : column.obj,
|
|
6770
|
+
};
|
|
6771
|
+
if (!Filters.valuesArrayContainsValue(values, cell.value)) {
|
|
6772
|
+
values.push(item);
|
|
6773
|
+
}
|
|
6774
|
+
}
|
|
6775
|
+
}
|
|
6776
|
+
/**
|
|
6777
|
+
* Overrides the given cell attributes for the specified columns.
|
|
6778
|
+
* If no columns are provided, the value will be applied to every column of the dataset.
|
|
6779
|
+
* @param {KupDataDataset} dataset - Input dataset.
|
|
6780
|
+
* @param {KupDataCell} cell - New cell.
|
|
6781
|
+
* @param {string[]} columns - Columns to be handled.
|
|
6782
|
+
* @returns {KupDataCell[]} Replaced cells.
|
|
6783
|
+
*/
|
|
6784
|
+
function replaceCell(dataset, cell, columns) {
|
|
6785
|
+
const replaced = [];
|
|
6786
|
+
for (let index = 0; index < dataset.rows.length; index++) {
|
|
6787
|
+
const row = dataset.rows[index];
|
|
6788
|
+
const cells = row.cells;
|
|
6789
|
+
for (const key in cells) {
|
|
6790
|
+
if (!columns || !columns.length || columns.includes(key)) {
|
|
6791
|
+
cells[key] = Object.assign({}, cell);
|
|
6792
|
+
replaced.push(cells[key]);
|
|
6793
|
+
}
|
|
6794
|
+
}
|
|
6795
|
+
}
|
|
6796
|
+
return replaced;
|
|
6797
|
+
}
|
|
6798
|
+
|
|
6799
|
+
const dom$6 = document.documentElement;
|
|
6800
|
+
/**
|
|
6801
|
+
* Finds the columns matching the criteria specified in the filters argument.
|
|
6802
|
+
* @param {KupDataDataset | Column[]} dataset - Input dataset or array of columns.
|
|
6803
|
+
* @param {Partial<Column>} filters - Column interface containing the filters to match.
|
|
6804
|
+
* @returns {Column[]} Columns matching the criteria.
|
|
6805
|
+
*/
|
|
6806
|
+
function findColumns(dataset, filters) {
|
|
6807
|
+
const columns = dataset.columns
|
|
6808
|
+
? dataset.columns
|
|
6809
|
+
: dataset;
|
|
6810
|
+
const result = [];
|
|
6811
|
+
for (let index = 0; index < columns.length; index++) {
|
|
6812
|
+
const column = columns[index];
|
|
6813
|
+
for (const key in filters) {
|
|
6814
|
+
const filter = filters[key];
|
|
6815
|
+
if (column[key] === filter) {
|
|
6816
|
+
result.push(column);
|
|
6817
|
+
}
|
|
5628
6818
|
else if (dom$6.ketchup.objects.deepEqual(column[key], filter)) {
|
|
5629
6819
|
result.push(column);
|
|
5630
6820
|
}
|
|
@@ -6092,154 +7282,6 @@ function _getNode(nodes, node, index) {
|
|
|
6092
7282
|
}
|
|
6093
7283
|
}
|
|
6094
7284
|
|
|
6095
|
-
/**
|
|
6096
|
-
* Props of the kup-data-table component.
|
|
6097
|
-
* Used to export every prop in an object.
|
|
6098
|
-
*/
|
|
6099
|
-
var KupDataTableProps;
|
|
6100
|
-
(function (KupDataTableProps) {
|
|
6101
|
-
KupDataTableProps["autoFillMissingCells"] = "When true and when a row is missing some columns, the missing cells will be autogenerated.";
|
|
6102
|
-
KupDataTableProps["customStyle"] = "Custom style of the component.";
|
|
6103
|
-
KupDataTableProps["data"] = "The data of the table.";
|
|
6104
|
-
KupDataTableProps["density"] = "The density of the rows, defaults at 'medium' and can be also set to 'large' or 'small'.";
|
|
6105
|
-
KupDataTableProps["dragEnabled"] = "Enables drag.";
|
|
6106
|
-
KupDataTableProps["dropEnabled"] = "Enables drop.";
|
|
6107
|
-
KupDataTableProps["editableData"] = "When set to true, editable cells will be rendered using input components.";
|
|
6108
|
-
KupDataTableProps["emptyDataLabel"] = "Defines the label to show when the table is empty.";
|
|
6109
|
-
KupDataTableProps["enableColumnsFormula"] = "Enables the choice to set formulas on columns by dragging them into different columns.";
|
|
6110
|
-
KupDataTableProps["enableMergeColumns"] = "Enables the merging of columns by dragging them into different columns.";
|
|
6111
|
-
KupDataTableProps["enableExtraColumns"] = "Enables adding extra columns.";
|
|
6112
|
-
KupDataTableProps["enableSortableColumns"] = "Enables the sorting of columns by dragging them into different columns.";
|
|
6113
|
-
KupDataTableProps["expandGroups"] = "Expands groups when set to true.";
|
|
6114
|
-
KupDataTableProps["filters"] = "List of filters set by the user.";
|
|
6115
|
-
KupDataTableProps["fixedColumns"] = "Fixes the given number of columns so that they stay visible when horizontally scrolling the data-table. If grouping is active or the value of the prop is <= 0, this prop will have no effect. Can be combined with fixedRows.";
|
|
6116
|
-
KupDataTableProps["fixedRows"] = "Fixes the given number of rows so that they stay visible when vertically scrolling the data-table. If grouping is active or the value of the prop is <= 0, this prop will have no effect. Can be combined with fixedColumns.";
|
|
6117
|
-
KupDataTableProps["forceOneLine"] = "Forces cells with long text and a fixed column size to have an ellipsis set on their text. The reflect attribute is mandatory to allow styling.";
|
|
6118
|
-
KupDataTableProps["globalFilter"] = "When set to true it activates the global filter.";
|
|
6119
|
-
KupDataTableProps["globalFilterValue"] = "The value of the global filter.";
|
|
6120
|
-
KupDataTableProps["groupLabelDisplay"] = "How the label of a group must be displayed. For available values";
|
|
6121
|
-
KupDataTableProps["groups"] = "The list of groups.";
|
|
6122
|
-
KupDataTableProps["headerIsPersistent"] = "When set to true the header will stick on top of the table when scrolling.";
|
|
6123
|
-
KupDataTableProps["isFocusable"] = "When set to true, clicked-on rows will have a visual feedback.";
|
|
6124
|
-
KupDataTableProps["lazyLoadRows"] = "When set to true, extra rows will be automatically loaded once the last row enters the viewport. When groups are present, the number of rows is referred to groups and not to their content. Paginator is disabled.";
|
|
6125
|
-
KupDataTableProps["lineBreakCharacter"] = "Defines the placeholder character which will be replaced by a line break inside table header cells, normal or sticky.";
|
|
6126
|
-
KupDataTableProps["loadMoreLimit"] = "Sets a maximum limit of new records which can be required by the load more functionality.";
|
|
6127
|
-
KupDataTableProps["loadMoreMode"] = "Establish the modality of how many new records will be downloaded. This property is regulated also by loadMoreStep.";
|
|
6128
|
-
KupDataTableProps["loadMoreStep"] = "The number of records which will be requested to be downloaded when clicking on the load more button. This property is regulated also by loadMoreMode.";
|
|
6129
|
-
KupDataTableProps["multiSelection"] = "When set to true enables rows multi selection.";
|
|
6130
|
-
KupDataTableProps["pageSelected"] = "Current selected page set on component load";
|
|
6131
|
-
KupDataTableProps["paginatorPos"] = "Sets the position of the paginator. Available positions: top, bottom or both.";
|
|
6132
|
-
KupDataTableProps["removableColumns"] = "Sets the possibility to remove the selected column.";
|
|
6133
|
-
KupDataTableProps["resizableColumns"] = "Gives the possibility to resize columns by dragging on their right edge.";
|
|
6134
|
-
KupDataTableProps["rowActions"] = "Sets the actions of the rows.";
|
|
6135
|
-
KupDataTableProps["rowsPerPage"] = "Sets the number of rows per page to display.";
|
|
6136
|
-
KupDataTableProps["scrollOnHover"] = "Activates the scroll on hover function.";
|
|
6137
|
-
KupDataTableProps["showCustomization"] = "If set to true, displays the button to open the customization panel.";
|
|
6138
|
-
KupDataTableProps["showFilters"] = "When set to true enables the column filters.";
|
|
6139
|
-
KupDataTableProps["showFooter"] = "When set to true shows the footer.";
|
|
6140
|
-
KupDataTableProps["showGrid"] = "Can be used to customize the grid view of the table.";
|
|
6141
|
-
KupDataTableProps["showGroups"] = "When set to true enables the column grouping.";
|
|
6142
|
-
KupDataTableProps["showHeader"] = "Enables rendering of the table header.";
|
|
6143
|
-
KupDataTableProps["showLoadMore"] = "If set to true, displays the button to load more records.";
|
|
6144
|
-
KupDataTableProps["sort"] = "Defines the current sorting options.";
|
|
6145
|
-
KupDataTableProps["stateId"] = "";
|
|
6146
|
-
KupDataTableProps["store"] = "";
|
|
6147
|
-
KupDataTableProps["sortableColumnsMutateData"] = "If set to true, when a column is dragged to be sorted, the component directly mutates the data.columns property and then fires the event";
|
|
6148
|
-
KupDataTableProps["sortEnabled"] = "When set to true enables the sorting of the columns by clicking on the column header.";
|
|
6149
|
-
KupDataTableProps["tableHeight"] = "Sets the height of the table.";
|
|
6150
|
-
KupDataTableProps["tableWidth"] = "Sets the width of the table.";
|
|
6151
|
-
KupDataTableProps["totals"] = "Defines the current totals options.";
|
|
6152
|
-
KupDataTableProps["transpose"] = "Transposes the data of the data table.";
|
|
6153
|
-
})(KupDataTableProps || (KupDataTableProps = {}));
|
|
6154
|
-
var SortMode;
|
|
6155
|
-
(function (SortMode) {
|
|
6156
|
-
SortMode["A"] = "A";
|
|
6157
|
-
SortMode["D"] = "D";
|
|
6158
|
-
})(SortMode || (SortMode = {}));
|
|
6159
|
-
var TotalMode;
|
|
6160
|
-
(function (TotalMode) {
|
|
6161
|
-
TotalMode["COUNT"] = "Count";
|
|
6162
|
-
TotalMode["SUM"] = "Sum";
|
|
6163
|
-
TotalMode["MIN"] = "Min";
|
|
6164
|
-
TotalMode["MAX"] = "Max";
|
|
6165
|
-
TotalMode["DISTINCT"] = "Distinct";
|
|
6166
|
-
TotalMode["AVERAGE"] = "Average";
|
|
6167
|
-
TotalMode["MATH"] = "MATH";
|
|
6168
|
-
})(TotalMode || (TotalMode = {}));
|
|
6169
|
-
var TotalLabel;
|
|
6170
|
-
(function (TotalLabel) {
|
|
6171
|
-
TotalLabel["COUNT"] = "Count";
|
|
6172
|
-
TotalLabel["SUM"] = "Sum";
|
|
6173
|
-
TotalLabel["MIN"] = "Min";
|
|
6174
|
-
TotalLabel["MAX"] = "Max";
|
|
6175
|
-
TotalLabel["DISTINCT"] = "Distinct";
|
|
6176
|
-
TotalLabel["AVERAGE"] = "Average";
|
|
6177
|
-
TotalLabel["MATH"] = "Formula";
|
|
6178
|
-
TotalLabel["CANC"] = "Cancel";
|
|
6179
|
-
TotalLabel["CALC"] = "Calculate";
|
|
6180
|
-
})(TotalLabel || (TotalLabel = {}));
|
|
6181
|
-
var PaginatorPos;
|
|
6182
|
-
(function (PaginatorPos) {
|
|
6183
|
-
PaginatorPos["TOP"] = "Top";
|
|
6184
|
-
PaginatorPos["BOTTOM"] = "Bottom";
|
|
6185
|
-
PaginatorPos["BOTH"] = "Both";
|
|
6186
|
-
})(PaginatorPos || (PaginatorPos = {}));
|
|
6187
|
-
var ShowGrid;
|
|
6188
|
-
(function (ShowGrid) {
|
|
6189
|
-
ShowGrid["NONE"] = "None";
|
|
6190
|
-
ShowGrid["ROW"] = "Row";
|
|
6191
|
-
ShowGrid["COL"] = "Col";
|
|
6192
|
-
ShowGrid["COMPLETE"] = "Complete";
|
|
6193
|
-
})(ShowGrid || (ShowGrid = {}));
|
|
6194
|
-
// export enum RowActionType {
|
|
6195
|
-
// DEFAULT = 'Default',
|
|
6196
|
-
// VARIABLE = 'Variable',
|
|
6197
|
-
// }
|
|
6198
|
-
//---- *NEXT functionality AKA load more ----
|
|
6199
|
-
var LoadMoreMode;
|
|
6200
|
-
(function (LoadMoreMode) {
|
|
6201
|
-
LoadMoreMode["CONSTANT"] = "constant";
|
|
6202
|
-
LoadMoreMode["CONSTANT_INCREMENT"] = "constant_increment";
|
|
6203
|
-
LoadMoreMode["PROGRESSIVE_THRESHOLD"] = "progressive_threshold";
|
|
6204
|
-
})(LoadMoreMode || (LoadMoreMode = {}));
|
|
6205
|
-
//---- Group label display functionality ----
|
|
6206
|
-
/**
|
|
6207
|
-
* The possible values the display property can have.
|
|
6208
|
-
* @enum
|
|
6209
|
-
* @property {string} BOTH - Shows both the column label and the value. This is the default.
|
|
6210
|
-
* @property {string} LABEL - Shows only the columns label.
|
|
6211
|
-
* @property {string} VALUE - Shows only the value.
|
|
6212
|
-
* @readonly
|
|
6213
|
-
*/
|
|
6214
|
-
var GroupLabelDisplayMode;
|
|
6215
|
-
(function (GroupLabelDisplayMode) {
|
|
6216
|
-
GroupLabelDisplayMode["BOTH"] = "Both";
|
|
6217
|
-
GroupLabelDisplayMode["LABEL"] = "Label";
|
|
6218
|
-
GroupLabelDisplayMode["VALUE"] = "Value";
|
|
6219
|
-
})(GroupLabelDisplayMode || (GroupLabelDisplayMode = {}));
|
|
6220
|
-
//---- Fixed rows and cells classes ----
|
|
6221
|
-
const FixedCellsClasses = {
|
|
6222
|
-
columns: 'fixed-column',
|
|
6223
|
-
rows: 'fixed-row',
|
|
6224
|
-
};
|
|
6225
|
-
const FixedCellsCSSVarsBase = {
|
|
6226
|
-
columns: '--ddt_column-left-',
|
|
6227
|
-
rows: '--ddt_row-top-',
|
|
6228
|
-
};
|
|
6229
|
-
/**
|
|
6230
|
-
* Constants for mocked/premade columns created by data mutations.
|
|
6231
|
-
*/
|
|
6232
|
-
const fieldColumn = 'Field';
|
|
6233
|
-
const iconColumn = 'Icon';
|
|
6234
|
-
const keyColumn = 'Key';
|
|
6235
|
-
var SelectionMode;
|
|
6236
|
-
(function (SelectionMode) {
|
|
6237
|
-
SelectionMode["SINGLE"] = "single";
|
|
6238
|
-
SelectionMode["MULTIPLE_CHECKBOX"] = "multiple-checkbox";
|
|
6239
|
-
SelectionMode["MULTIPLE"] = "multiple";
|
|
6240
|
-
SelectionMode["NONE"] = "none";
|
|
6241
|
-
})(SelectionMode || (SelectionMode = {}));
|
|
6242
|
-
|
|
6243
7285
|
const autoCenterComps = [KupTagNames.DATA_TABLE, KupTagNames.TREE];
|
|
6244
7286
|
const fullWidthFieldsComps = [KupTagNames.DATA_TABLE, KupTagNames.TREE];
|
|
6245
7287
|
/**
|
|
@@ -6400,8 +7442,8 @@ class KupData {
|
|
|
6400
7442
|
find(dataset, filters) {
|
|
6401
7443
|
return findCell(dataset, filters);
|
|
6402
7444
|
},
|
|
6403
|
-
getValue(dataset,
|
|
6404
|
-
return getCellValue(dataset,
|
|
7445
|
+
getValue(dataset, column, sorted) {
|
|
7446
|
+
return getCellValue(dataset, column, sorted);
|
|
6405
7447
|
},
|
|
6406
7448
|
replace(dataset, cell, columns) {
|
|
6407
7449
|
return replaceCell(dataset, cell, columns);
|
|
@@ -6758,9 +7800,9 @@ class KupData {
|
|
|
6758
7800
|
};
|
|
6759
7801
|
const length = dataset.rows.length;
|
|
6760
7802
|
// sort all columns values by descending
|
|
6761
|
-
let values = getCellValue(dataset, [
|
|
7803
|
+
let values = getCellValue(dataset, this.column.find(dataset, { name: headerColumn })[0]);
|
|
6762
7804
|
values.sort(function (a, b) {
|
|
6763
|
-
return Number(a) - Number(b);
|
|
7805
|
+
return Number(a.value) - Number(b.value);
|
|
6764
7806
|
});
|
|
6765
7807
|
values.reverse();
|
|
6766
7808
|
// excluding duplicates values.
|
|
@@ -6772,7 +7814,7 @@ class KupData {
|
|
|
6772
7814
|
let rightIdx = idx + 1;
|
|
6773
7815
|
// sort the rows like a "mountain", the greatest is in the middle and the other ones are splitted left and right
|
|
6774
7816
|
for (let i = 0; i < length; i++) {
|
|
6775
|
-
const value = values[i];
|
|
7817
|
+
const value = values[i].value;
|
|
6776
7818
|
// looping the rows because we have many rows with same value.
|
|
6777
7819
|
this.finder(dataset, {
|
|
6778
7820
|
columns: [headerColumn],
|
|
@@ -6915,39 +7957,6 @@ createCommonjsModule(function (module, exports) {
|
|
|
6915
7957
|
!function(e,_){module.exports=_(dayjs_min);}(commonjsGlobal,(function(e){function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),d={name:"zh",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(e,_){return "W"===_?e+"周":e+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s后",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(e,_){var t=100*e+_;return t<600?"凌晨":t<900?"早上":t<1100?"上午":t<1300?"中午":t<1800?"下午":"晚上"}};return t.default.locale(d,null,!0),d}));
|
|
6916
7958
|
});
|
|
6917
7959
|
|
|
6918
|
-
/**
|
|
6919
|
-
* Normalization types.
|
|
6920
|
-
*/
|
|
6921
|
-
var KupDatesNormalize;
|
|
6922
|
-
(function (KupDatesNormalize) {
|
|
6923
|
-
KupDatesNormalize["DATE"] = "date";
|
|
6924
|
-
KupDatesNormalize["TIME"] = "time";
|
|
6925
|
-
KupDatesNormalize["TIMESTAMP"] = "timestamp";
|
|
6926
|
-
})(KupDatesNormalize || (KupDatesNormalize = {}));
|
|
6927
|
-
/**
|
|
6928
|
-
* Common use formats
|
|
6929
|
-
*/
|
|
6930
|
-
var KupDatesFormats;
|
|
6931
|
-
(function (KupDatesFormats) {
|
|
6932
|
-
KupDatesFormats["ISO_DATE"] = "YYYY-MM-DD";
|
|
6933
|
-
KupDatesFormats["ISO_DATE_TIME"] = "YYYY-MM-DD HH:mm:ss";
|
|
6934
|
-
KupDatesFormats["ISO_TIME"] = "HH:mm:ss";
|
|
6935
|
-
KupDatesFormats["ISO_TIME_WITHOUT_SECONDS"] = "HH:mm";
|
|
6936
|
-
})(KupDatesFormats || (KupDatesFormats = {}));
|
|
6937
|
-
/**
|
|
6938
|
-
* Supported locales.
|
|
6939
|
-
*/
|
|
6940
|
-
var KupDatesLocales;
|
|
6941
|
-
(function (KupDatesLocales) {
|
|
6942
|
-
KupDatesLocales["CHINESE"] = "cn";
|
|
6943
|
-
KupDatesLocales["ENGLISH"] = "en";
|
|
6944
|
-
KupDatesLocales["FRENCH"] = "fr";
|
|
6945
|
-
KupDatesLocales["ITALIAN"] = "it";
|
|
6946
|
-
KupDatesLocales["POLISH"] = "pl";
|
|
6947
|
-
KupDatesLocales["RUSSIAN"] = "ru";
|
|
6948
|
-
KupDatesLocales["SPANISH"] = "es";
|
|
6949
|
-
})(KupDatesLocales || (KupDatesLocales = {}));
|
|
6950
|
-
|
|
6951
7960
|
/**
|
|
6952
7961
|
* Handles operations and formatting of dates.
|
|
6953
7962
|
* @module KupDates
|
|
@@ -17079,4 +18088,4 @@ function kupManagerInstance() {
|
|
|
17079
18088
|
return dom.ketchup;
|
|
17080
18089
|
}
|
|
17081
18090
|
|
|
17082
|
-
export {
|
|
18091
|
+
export { numberToFormattedStringNumber as $, KupLanguageCheckbox as A, getValueForDisplay2 as B, getValueForDisplay as C, DateTimeFormatOptionsMonth as D, KupLanguageSearch as E, Filters as F, GroupLabelDisplayMode as G, FilterInterval as H, FCellPadding as I, ShowGrid as J, KupThemeIconValues as K, LoadMoreMode as L, TotalLabel as M, KupPointerEventTypes as N, kupDraggableColumnAttr as O, PaginatorPos as P, kupDragActiveAttr as Q, KupDragEffect as R, SelectionMode as S, TotalMode as T, kupDraggableCellAttr as U, KupDropEventTypes as V, iconColumn as W, keyColumn as X, fieldColumn as Y, FixedCellsCSSVarsBase as Z, SortMode as _, KupDynamicPositionPlacement as a, KupLanguageFontsize as a0, KupLanguageDensity as a1, KupLanguageGrid as a2, kupDynamicPositionAttribute as a3, KupDataTableProps as a4, FixedCellsClasses as a5, unformattedStringToFormattedStringNumber as a6, formattedStringToCustomUnformattedStringTime as a7, isValidFormattedStringTime as a8, formatTime as a9, unformattedStringToFormattedStringTime as aa, addColumnValueFromRow as ab, KupGlobalFilterMode as ac, getCellValueForDisplay as ad, KupData as ae, compareCell as af, stringToNumber as ag, isNumber as ah, KupLanguagePage as ai, editableTypes as aj, kupTypes as ak, FCellTypes as al, KupTagNames as am, fullWidthFieldsComps as an, FCellClasses as ao, autoCenterComps as ap, FCellEvents as aq, createCommonjsModule as ar, getDefaultExportFromCjs as as, KupDatesLocales as at, getDecimalSeparator as au, KupLanguageDashboard as av, kupDropEvent as aw, kupDraggableRowAttr as ax, KupThemeColorValues as b, KupDebugCategory as c, getMonthsAsStringByLocale as d, KupDatesFormats as e, KupCardBuiltInClockElements as f, getProps as g, KupCardCSSClasses as h, KupLanguageTotals as i, KupLanguageGeneric as j, kupManagerInstance as k, KupLanguageColumn as l, KupDataNewColumnTypes as m, KupCardSubEvents as n, KupCardIds as o, KupLanguageRow as p, KupCardFamily as q, KupCardProps as r, setProps as s, getColumnByName as t, KupDates as u, formatToNumber as v, KupDatesNormalize as w, KupObjects as x, identify as y, KupLanguageGrouping as z };
|