@sme.up/ketchup 8.0.0 → 8.0.2
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-49b2c37c.js → f-button-9524bbf7.js} +2 -2
- package/dist/cjs/{f-cell-9a6bc55c.js → f-cell-bcb75ade.js} +22 -13
- package/dist/cjs/{f-checkbox-593f72c3.js → f-checkbox-1148e791.js} +1 -1
- package/dist/cjs/{f-chip-dee84122.js → f-chip-2249b386.js} +3 -3
- package/dist/cjs/{f-image-27f965ff.js → f-image-47d74999.js} +2 -2
- package/dist/cjs/{f-paginator-utils-4a30189d.js → f-paginator-utils-b0a9ae5f.js} +64 -63
- package/dist/cjs/{f-text-field-04a663b4.js → f-text-field-579c0fc0.js} +83 -9
- package/dist/cjs/{index-74433248.js → index-1f177abc.js} +0 -3
- package/dist/cjs/ketchup.cjs.js +2 -2
- package/dist/cjs/kup-accordion.cjs.entry.js +3 -3
- package/dist/cjs/kup-autocomplete_27.cjs.entry.js +798 -815
- package/dist/cjs/kup-box.cjs.entry.js +10 -10
- package/dist/cjs/kup-calendar.cjs.entry.js +5 -5
- package/dist/cjs/kup-cell.cjs.entry.js +7 -7
- package/dist/cjs/kup-dash-list.cjs.entry.js +3 -4
- package/dist/cjs/kup-dash_2.cjs.entry.js +2 -2
- package/dist/cjs/kup-dashboard.cjs.entry.js +6 -6
- package/dist/cjs/kup-drawer.cjs.entry.js +2 -2
- package/dist/cjs/kup-echart.cjs.entry.js +2 -2
- package/dist/cjs/kup-family-tree.cjs.entry.js +4 -4
- package/dist/cjs/kup-iframe.cjs.entry.js +2 -2
- package/dist/cjs/kup-image-list.cjs.entry.js +8 -8
- package/dist/cjs/kup-lazy.cjs.entry.js +2 -2
- package/dist/cjs/kup-magic-box.cjs.entry.js +3 -3
- package/dist/cjs/{kup-manager-2ff5d258.js → kup-manager-85b2a756.js} +758 -538
- package/dist/cjs/kup-nav-bar.cjs.entry.js +2 -2
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +3 -3
- package/dist/cjs/kup-photo-frame.cjs.entry.js +2 -2
- package/dist/cjs/kup-planner.cjs.entry.js +3 -3
- 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 +12 -4
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/kup-card/built-in/kup-card-calendar.js +5 -61
- package/dist/collection/components/kup-card/built-in/kup-card-clock.js +1 -1
- package/dist/collection/components/kup-dash-list/kup-dash-list.js +1 -3
- package/dist/collection/components/kup-data-table/kup-data-table-helper.js +7 -8
- package/dist/collection/components/kup-data-table/kup-data-table.js +5 -4
- package/dist/collection/components/kup-gauge/kup-gauge.js +4 -4
- package/dist/collection/components/kup-snackbar/kup-snackbar.js +27 -0
- package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +3 -0
- package/dist/collection/components/kup-text-field/kup-text-field.js +107 -9
- package/dist/collection/components/kup-time-picker/kup-time-picker.js +7 -7
- package/dist/collection/components/kup-tree/kup-tree.js +2 -2
- package/dist/collection/f-components/f-cell/f-cell.js +16 -8
- package/dist/collection/f-components/f-paginator/f-paginator-utils.js +3 -3
- package/dist/collection/f-components/f-text-field/f-text-field.js +80 -6
- package/dist/collection/managers/kup-data/kup-data.js +3 -1
- package/dist/collection/managers/kup-dates/kup-dates-declarations.js +21 -10
- package/dist/collection/managers/kup-dates/kup-dates.js +312 -1
- package/dist/collection/managers/kup-math/kup-math.js +258 -6
- package/dist/collection/utils/cell-utils.js +5 -6
- package/dist/collection/utils/filters/filters.js +11 -13
- package/dist/collection/utils/utils.js +18 -444
- package/dist/components/kup-autocomplete2.js +1301 -1002
- package/dist/components/kup-box2.js +1 -1
- package/dist/components/kup-calendar.js +1 -1
- package/dist/components/kup-cell.js +1 -1
- package/dist/components/kup-dash-list.js +2 -3
- package/dist/components/kup-dashboard.js +1 -1
- package/dist/components/kup-data-table.js +1 -1
- package/dist/components/kup-date-picker.js +1 -1
- package/dist/components/kup-dialog.js +1 -1
- package/dist/components/kup-dropdown-button.js +1 -1
- package/dist/components/kup-echart2.js +1 -1
- package/dist/components/kup-family-tree.js +1 -1
- package/dist/components/kup-form.js +1 -1
- package/dist/components/kup-gauge.js +1 -1
- package/dist/components/kup-grid2.js +1 -1
- package/dist/components/kup-iframe.js +1 -1
- package/dist/components/kup-image-list.js +1 -1
- package/dist/components/kup-image.js +1 -1
- package/dist/components/kup-list.js +1 -1
- package/dist/components/kup-magic-box.js +1 -1
- package/dist/components/kup-numeric-picker.js +1 -1
- package/dist/components/kup-planner.js +1 -1
- package/dist/components/kup-progress-bar.js +1 -1
- package/dist/components/kup-radio.js +1 -1
- package/dist/components/kup-rating.js +1 -1
- package/dist/components/kup-snackbar.js +8 -0
- package/dist/components/kup-spinner.js +1 -1
- package/dist/components/kup-switch.js +1 -1
- package/dist/components/kup-tab-bar.js +1 -1
- package/dist/components/kup-text-field.js +1 -1
- package/dist/components/kup-time-picker.js +1 -1
- package/dist/components/kup-tree.js +1 -1
- package/dist/esm/{f-button-744cf1f6.js → f-button-024f0cfe.js} +2 -2
- package/dist/esm/{f-cell-b319c869.js → f-cell-90240a8c.js} +22 -13
- package/dist/esm/{f-checkbox-ec85b437.js → f-checkbox-9b3f5f5b.js} +1 -1
- package/dist/esm/{f-chip-7e3e4180.js → f-chip-2238ad43.js} +3 -3
- package/dist/esm/{f-image-098c26ce.js → f-image-f2e9bf79.js} +2 -2
- package/dist/esm/{f-paginator-utils-674cb2ae.js → f-paginator-utils-8cb3c023.js} +64 -63
- package/dist/esm/{f-text-field-c38ef113.js → f-text-field-d231982c.js} +83 -9
- package/dist/esm/{index-b326ffc9.js → index-8bd38435.js} +1 -3
- package/dist/esm/ketchup.js +3 -3
- package/dist/esm/kup-accordion.entry.js +3 -3
- package/dist/esm/kup-autocomplete_27.entry.js +792 -809
- package/dist/esm/kup-box.entry.js +10 -10
- package/dist/esm/kup-calendar.entry.js +5 -5
- package/dist/esm/kup-cell.entry.js +7 -7
- package/dist/esm/kup-dash-list.entry.js +3 -4
- package/dist/esm/kup-dash_2.entry.js +2 -2
- package/dist/esm/kup-dashboard.entry.js +6 -6
- package/dist/esm/kup-drawer.entry.js +2 -2
- package/dist/esm/kup-echart.entry.js +2 -2
- package/dist/esm/kup-family-tree.entry.js +4 -4
- package/dist/esm/kup-iframe.entry.js +2 -2
- package/dist/esm/kup-image-list.entry.js +8 -8
- package/dist/esm/kup-lazy.entry.js +2 -2
- package/dist/esm/kup-magic-box.entry.js +3 -3
- package/dist/esm/{kup-manager-b41eb2a8.js → kup-manager-d1da769e.js} +758 -529
- package/dist/esm/kup-nav-bar.entry.js +2 -2
- package/dist/esm/kup-numeric-picker.entry.js +3 -3
- package/dist/esm/kup-photo-frame.entry.js +2 -2
- package/dist/esm/kup-planner.entry.js +3 -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 +12 -4
- package/dist/esm/loader.js +3 -3
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-5ce2b4fc.entry.js → p-063d4c27.entry.js} +1 -1
- package/dist/ketchup/{p-4325d965.entry.js → p-0bcda0e2.entry.js} +1 -1
- package/dist/ketchup/{p-af82131e.entry.js → p-0d7d59c7.entry.js} +1 -1
- package/dist/ketchup/{p-bd42562d.entry.js → p-163b18b9.entry.js} +1 -1
- package/dist/ketchup/{p-b244f5ca.entry.js → p-1ad628fb.entry.js} +1 -1
- package/dist/ketchup/{p-a9b7533b.entry.js → p-33aff1ca.entry.js} +1 -1
- package/dist/ketchup/p-3432ebaf.entry.js +9 -0
- package/dist/ketchup/{p-b032f47d.entry.js → p-35b29b22.entry.js} +1 -1
- package/dist/ketchup/{p-940a5feb.js → p-36dac88e.js} +3 -3
- package/dist/ketchup/{p-395e1960.entry.js → p-37067ee6.entry.js} +1 -1
- package/dist/ketchup/p-39a55c47.js +1 -0
- package/dist/ketchup/p-3cf64473.js +1 -0
- package/dist/ketchup/{p-5d398e42.js → p-410c102a.js} +1 -1
- package/dist/ketchup/p-43b67de4.entry.js +1 -0
- package/dist/ketchup/{p-a7e19620.entry.js → p-489d55ff.entry.js} +1 -1
- package/dist/ketchup/{p-77e3d537.js → p-5f3680f2.js} +1 -1
- package/dist/ketchup/p-651d89c8.entry.js +1 -0
- package/dist/ketchup/{p-da891093.entry.js → p-73c8d651.entry.js} +1 -1
- package/dist/ketchup/{p-bb17c1ba.entry.js → p-83435e6c.entry.js} +1 -1
- package/dist/ketchup/{p-3b41aca7.entry.js → p-89743989.entry.js} +1 -1
- package/dist/ketchup/{p-ef614656.js → p-8b46e7ce.js} +1 -1
- package/dist/ketchup/{p-d4ece435.js → p-9dcfbb1e.js} +2 -2
- package/dist/ketchup/{p-c26975bf.js → p-9f9b6656.js} +1 -1
- package/dist/ketchup/{p-c968e93d.entry.js → p-a84f1d24.entry.js} +1 -1
- package/dist/ketchup/{p-e02b5141.entry.js → p-b2fd2dbf.entry.js} +1 -1
- package/dist/ketchup/{p-d739710a.entry.js → p-c42b80c1.entry.js} +1 -1
- package/dist/ketchup/p-d1b050d0.entry.js +27 -0
- package/dist/ketchup/p-d6ea709e.entry.js +1 -0
- package/dist/ketchup/{p-0b91f5f8.entry.js → p-e1f1e661.entry.js} +1 -1
- package/dist/ketchup/p-eda7f130.js +1 -0
- package/dist/ketchup/{p-4ae2ca6f.entry.js → p-f876125d.entry.js} +1 -1
- package/dist/types/components/kup-snackbar/kup-snackbar.d.ts +5 -0
- package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +3 -0
- package/dist/types/components/kup-text-field/kup-text-field.d.ts +20 -2
- package/dist/types/components.d.ts +34 -0
- package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +3 -0
- package/dist/types/managers/kup-dates/kup-dates-declarations.d.ts +19 -9
- package/dist/types/managers/kup-dates/kup-dates.d.ts +94 -1
- package/dist/types/managers/kup-math/kup-math-declarations.d.ts +6 -0
- package/dist/types/managers/kup-math/kup-math.d.ts +88 -3
- package/dist/types/utils/utils.d.ts +13 -103
- package/package.json +1 -1
- package/dist/ketchup/p-0b0b61cb.entry.js +0 -1
- package/dist/ketchup/p-3efe7f43.entry.js +0 -27
- package/dist/ketchup/p-9700eb32.js +0 -1
- package/dist/ketchup/p-a877a87b.entry.js +0 -9
- package/dist/ketchup/p-c8b7790a.entry.js +0 -1
- package/dist/ketchup/p-d98fdb9b.js +0 -1
- package/dist/ketchup/p-df316daf.entry.js +0 -1
- package/dist/ketchup/p-e714f4dc.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getAssetPath, d as setAssetPath } from './index-
|
|
1
|
+
import { a as getAssetPath, d as setAssetPath } from './index-8bd38435.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Props of the kup-card component.
|
|
@@ -344,7 +344,7 @@ var __classPrivateFieldGet$3 = (undefined && undefined.__classPrivateFieldGet) |
|
|
|
344
344
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
345
345
|
};
|
|
346
346
|
var _KupDebug_debugWidget;
|
|
347
|
-
const dom$
|
|
347
|
+
const dom$h = document.documentElement;
|
|
348
348
|
/**
|
|
349
349
|
* Debugging suite, used to log messages and statuses from the Ketchup components.
|
|
350
350
|
* @module KupDebug
|
|
@@ -391,32 +391,32 @@ class KupDebug {
|
|
|
391
391
|
*/
|
|
392
392
|
showWidget() {
|
|
393
393
|
const debugWidget = document.createElement('kup-card');
|
|
394
|
-
const languages = dom$
|
|
394
|
+
const languages = dom$h.ketchup.language.getLanguages();
|
|
395
395
|
const languagesListData = [];
|
|
396
396
|
for (let index = 0; index < languages.length; index++) {
|
|
397
397
|
languagesListData.push({
|
|
398
398
|
id: languages[index],
|
|
399
|
-
selected: languages[index] === dom$
|
|
399
|
+
selected: languages[index] === dom$h.ketchup.language.name
|
|
400
400
|
? true
|
|
401
401
|
: false,
|
|
402
402
|
value: languages[index],
|
|
403
403
|
});
|
|
404
404
|
}
|
|
405
|
-
const themes = dom$
|
|
405
|
+
const themes = dom$h.ketchup.theme.getThemes();
|
|
406
406
|
const themesListData = [];
|
|
407
407
|
for (let index = 0; index < themes.length; index++) {
|
|
408
408
|
themesListData.push({
|
|
409
409
|
id: themes[index],
|
|
410
|
-
selected: themes[index] === dom$
|
|
410
|
+
selected: themes[index] === dom$h.ketchup.theme.name ? true : false,
|
|
411
411
|
value: themes[index],
|
|
412
412
|
});
|
|
413
413
|
}
|
|
414
|
-
const locales = dom$
|
|
414
|
+
const locales = dom$h.ketchup.dates.getLocales();
|
|
415
415
|
const localesListData = [];
|
|
416
416
|
for (let index = 0; index < locales.length; index++) {
|
|
417
417
|
localesListData.push({
|
|
418
418
|
id: locales[index],
|
|
419
|
-
selected: locales[index] === dom$
|
|
419
|
+
selected: locales[index] === dom$h.ketchup.dates.locale ? true : false,
|
|
420
420
|
value: locales[index],
|
|
421
421
|
});
|
|
422
422
|
}
|
|
@@ -426,13 +426,13 @@ class KupDebug {
|
|
|
426
426
|
icon: 'power_settings_new',
|
|
427
427
|
id: 'kup-debug-off',
|
|
428
428
|
customStyle: ':host {--kup-font-size: 0.875em; border-left: 1px solid var(--kup-border-color); border-right: 1px solid var(--kup-border-color);}',
|
|
429
|
-
title: dom$
|
|
429
|
+
title: dom$h.ketchup.language.translate(KupLanguageDebug.OFF),
|
|
430
430
|
},
|
|
431
431
|
{
|
|
432
432
|
customStyle: ':host {--kup-font-size: 0.875em;}',
|
|
433
433
|
icon: 'print',
|
|
434
434
|
id: 'kup-debug-print',
|
|
435
|
-
title: dom$
|
|
435
|
+
title: dom$h.ketchup.language.translate(KupLanguageDebug.PRINT),
|
|
436
436
|
},
|
|
437
437
|
{
|
|
438
438
|
checked: this.autoPrint,
|
|
@@ -440,20 +440,20 @@ class KupDebug {
|
|
|
440
440
|
icon: 'speaker_notes',
|
|
441
441
|
iconOff: 'speaker_notes_off',
|
|
442
442
|
id: 'kup-debug-autoprint',
|
|
443
|
-
title: dom$
|
|
443
|
+
title: dom$h.ketchup.language.translate(KupLanguageDebug.AUTOPRINT),
|
|
444
444
|
toggable: true,
|
|
445
445
|
},
|
|
446
446
|
{
|
|
447
447
|
customStyle: ':host {--kup-font-size: 0.875em;}',
|
|
448
448
|
icon: 'broom',
|
|
449
449
|
id: 'kup-debug-clear',
|
|
450
|
-
title: dom$
|
|
450
|
+
title: dom$h.ketchup.language.translate(KupLanguageDebug.CLEAR),
|
|
451
451
|
},
|
|
452
452
|
{
|
|
453
453
|
customStyle: ':host {--kup-font-size: 0.875em;}',
|
|
454
454
|
icon: 'delete',
|
|
455
455
|
id: 'kup-debug-delete',
|
|
456
|
-
title: dom$
|
|
456
|
+
title: dom$h.ketchup.language.translate(KupLanguageDebug.DUMP),
|
|
457
457
|
},
|
|
458
458
|
{
|
|
459
459
|
className: 'kup-full-height',
|
|
@@ -462,22 +462,22 @@ class KupDebug {
|
|
|
462
462
|
id: 'kup-debug-dl-props',
|
|
463
463
|
label: 'Props',
|
|
464
464
|
styling: 'flat',
|
|
465
|
-
title: dom$
|
|
465
|
+
title: dom$h.ketchup.language.translate(KupLanguageDebug.DL_PROPS),
|
|
466
466
|
},
|
|
467
467
|
{
|
|
468
468
|
className: 'kup-full-height',
|
|
469
469
|
customStyle: ':host {border-right: 1px solid var(--kup-border-color);}',
|
|
470
470
|
icon: 'download',
|
|
471
471
|
id: 'kup-debug-dl-all',
|
|
472
|
-
label: dom$
|
|
472
|
+
label: dom$h.ketchup.language.translate(KupLanguageDebug.DL_ALL),
|
|
473
473
|
styling: 'flat',
|
|
474
|
-
title: dom$
|
|
474
|
+
title: dom$h.ketchup.language.translate(KupLanguageDebug.DL_ALL),
|
|
475
475
|
},
|
|
476
476
|
{
|
|
477
477
|
customStyle: ':host {--kup-font-size: 0.875em;}',
|
|
478
478
|
icon: 'auto-fix',
|
|
479
479
|
id: 'kup-debug-magic-box',
|
|
480
|
-
title: dom$
|
|
480
|
+
title: dom$h.ketchup.language.translate(KupLanguageDebug.MAGIC_BOX),
|
|
481
481
|
},
|
|
482
482
|
],
|
|
483
483
|
combobox: [
|
|
@@ -492,11 +492,11 @@ class KupDebug {
|
|
|
492
492
|
className: 'kup-full-height',
|
|
493
493
|
emitSubmitEventOnEnter: false,
|
|
494
494
|
inputType: 'text',
|
|
495
|
-
label: dom$
|
|
495
|
+
label: dom$h.ketchup.language.translate(KupLanguageDebug.THEME_CHANGER),
|
|
496
496
|
},
|
|
497
497
|
},
|
|
498
498
|
id: 'kup-debug-theme-changer',
|
|
499
|
-
initialValue: dom$
|
|
499
|
+
initialValue: dom$h.ketchup.theme.name,
|
|
500
500
|
isSelect: true,
|
|
501
501
|
},
|
|
502
502
|
{
|
|
@@ -510,11 +510,11 @@ class KupDebug {
|
|
|
510
510
|
className: 'kup-full-height',
|
|
511
511
|
emitSubmitEventOnEnter: false,
|
|
512
512
|
inputType: 'text',
|
|
513
|
-
label: dom$
|
|
513
|
+
label: dom$h.ketchup.language.translate(KupLanguageDebug.LANGUAGE_CHANGER),
|
|
514
514
|
},
|
|
515
515
|
},
|
|
516
516
|
id: 'kup-debug-language-changer',
|
|
517
|
-
initialValue: dom$
|
|
517
|
+
initialValue: dom$h.ketchup.language.name,
|
|
518
518
|
isSelect: true,
|
|
519
519
|
},
|
|
520
520
|
{
|
|
@@ -528,11 +528,11 @@ class KupDebug {
|
|
|
528
528
|
className: 'kup-full-height',
|
|
529
529
|
emitSubmitEventOnEnter: false,
|
|
530
530
|
inputType: 'text',
|
|
531
|
-
label: dom$
|
|
531
|
+
label: dom$h.ketchup.language.translate(KupLanguageDebug.LOCALE_CHANGER),
|
|
532
532
|
},
|
|
533
533
|
},
|
|
534
534
|
id: 'kup-debug-locale-changer',
|
|
535
|
-
initialValue: dom$
|
|
535
|
+
initialValue: dom$h.ketchup.dates.locale,
|
|
536
536
|
isSelect: true,
|
|
537
537
|
},
|
|
538
538
|
],
|
|
@@ -540,7 +540,7 @@ class KupDebug {
|
|
|
540
540
|
{
|
|
541
541
|
className: 'kup-full-height',
|
|
542
542
|
id: 'kup-debug-log-limit',
|
|
543
|
-
label: dom$
|
|
543
|
+
label: dom$h.ketchup.language.translate(KupLanguageDebug.LOG_LIMIT),
|
|
544
544
|
initialValue: this.logLimit,
|
|
545
545
|
emitSubmitEventOnEnter: false,
|
|
546
546
|
inputType: 'number',
|
|
@@ -591,7 +591,7 @@ class KupDebug {
|
|
|
591
591
|
kupDebug.dump();
|
|
592
592
|
break;
|
|
593
593
|
case 'kup-debug-magic-box':
|
|
594
|
-
dom$
|
|
594
|
+
dom$h.ketchup.toggleMagicBox();
|
|
595
595
|
break;
|
|
596
596
|
case 'kup-debug-off':
|
|
597
597
|
kupDebug.toggle();
|
|
@@ -606,14 +606,14 @@ class KupDebug {
|
|
|
606
606
|
case 'kup-combobox-itemclick':
|
|
607
607
|
switch (compID) {
|
|
608
608
|
case 'kup-debug-language-changer':
|
|
609
|
-
dom$
|
|
609
|
+
dom$h.ketchup.language.set(compEvent.detail.value);
|
|
610
610
|
break;
|
|
611
611
|
case 'kup-debug-locale-changer':
|
|
612
|
-
dom$
|
|
613
|
-
dom$
|
|
612
|
+
dom$h.ketchup.dates.setLocale(compEvent.detail.value);
|
|
613
|
+
dom$h.ketchup.math.setLocale(compEvent.detail.value);
|
|
614
614
|
break;
|
|
615
615
|
case 'kup-debug-theme-changer':
|
|
616
|
-
dom$
|
|
616
|
+
dom$h.ketchup.theme.set(compEvent.detail.value);
|
|
617
617
|
break;
|
|
618
618
|
}
|
|
619
619
|
case 'kup-textfield-input':
|
|
@@ -675,7 +675,7 @@ class KupDebug {
|
|
|
675
675
|
// If the log is tied to a KupComponent, on click its props will be downloaded.
|
|
676
676
|
// Also, a different style will be applied to distinguish it between the others.
|
|
677
677
|
if (typeof this.logs[index].element == 'object') {
|
|
678
|
-
slot.title = dom$
|
|
678
|
+
slot.title = dom$h.ketchup.language.translate(KupLanguageDebug.DL_PROPS_COMP);
|
|
679
679
|
slot.style.fontWeight = 'bold';
|
|
680
680
|
slot.style.cursor = 'pointer';
|
|
681
681
|
slot.onclick = () => {
|
|
@@ -733,7 +733,7 @@ class KupDebug {
|
|
|
733
733
|
printLog[type] = [];
|
|
734
734
|
}
|
|
735
735
|
printLog[type].push({
|
|
736
|
-
date: dom$
|
|
736
|
+
date: dom$h.ketchup.dates.format(this.logs[index].date, 'LLL:ms'),
|
|
737
737
|
element: isComponent
|
|
738
738
|
? this.logs[index].element
|
|
739
739
|
: this.logs[index].id,
|
|
@@ -913,7 +913,7 @@ class KupDebug {
|
|
|
913
913
|
message: message,
|
|
914
914
|
};
|
|
915
915
|
if (this.logs.length > this.logLimit) {
|
|
916
|
-
console.warn(dom$
|
|
916
|
+
console.warn(dom$h.ketchup.dates.format(date, 'LLL:ms') +
|
|
917
917
|
' kup-debug => ' +
|
|
918
918
|
'Too many logs (> ' +
|
|
919
919
|
this.logLimit +
|
|
@@ -929,14 +929,14 @@ class KupDebug {
|
|
|
929
929
|
}
|
|
930
930
|
switch (category) {
|
|
931
931
|
case KupDebugCategory.ERROR:
|
|
932
|
-
console.error(dom$
|
|
932
|
+
console.error(dom$h.ketchup.dates.format(date, 'LLL:ms') + id + message, obj);
|
|
933
933
|
window.dispatchEvent(new CustomEvent('kup-debug-error', {
|
|
934
934
|
bubbles: true,
|
|
935
935
|
detail: { comp, date, message },
|
|
936
936
|
}));
|
|
937
937
|
break;
|
|
938
938
|
case KupDebugCategory.WARNING:
|
|
939
|
-
console.warn(dom$
|
|
939
|
+
console.warn(dom$h.ketchup.dates.format(date, 'LLL:ms') + id + message, obj);
|
|
940
940
|
break;
|
|
941
941
|
}
|
|
942
942
|
}
|
|
@@ -1023,7 +1023,7 @@ var KupDynamicPositionPlacement;
|
|
|
1023
1023
|
KupDynamicPositionPlacement["TOP_RIGHT"] = "tr";
|
|
1024
1024
|
})(KupDynamicPositionPlacement || (KupDynamicPositionPlacement = {}));
|
|
1025
1025
|
|
|
1026
|
-
const dom$
|
|
1026
|
+
const dom$g = document.documentElement;
|
|
1027
1027
|
/**
|
|
1028
1028
|
* This class is used to dynamically reposition HTML elements.
|
|
1029
1029
|
* @module KupDynamicPosition
|
|
@@ -1091,7 +1091,7 @@ class KupDynamicPosition {
|
|
|
1091
1091
|
const target = mutations[0].target;
|
|
1092
1092
|
if (target.classList.contains(kupDynamicPositionActiveClass)) {
|
|
1093
1093
|
requestAnimationFrame(function () {
|
|
1094
|
-
dom$
|
|
1094
|
+
dom$g.ketchup.dynamicPosition.run(el);
|
|
1095
1095
|
});
|
|
1096
1096
|
}
|
|
1097
1097
|
});
|
|
@@ -1148,7 +1148,7 @@ class KupDynamicPosition {
|
|
|
1148
1148
|
*/
|
|
1149
1149
|
run(el) {
|
|
1150
1150
|
if (!el.isConnected) {
|
|
1151
|
-
dom$
|
|
1151
|
+
dom$g.ketchup.dynamicPosition.managedElements.delete(el);
|
|
1152
1152
|
cancelAnimationFrame(el.kupDynamicPosition.rAF);
|
|
1153
1153
|
return;
|
|
1154
1154
|
}
|
|
@@ -1256,7 +1256,7 @@ class KupDynamicPosition {
|
|
|
1256
1256
|
// Recursive
|
|
1257
1257
|
if (!el.kupDynamicPosition.detach) {
|
|
1258
1258
|
el.kupDynamicPosition.rAF = requestAnimationFrame(function () {
|
|
1259
|
-
dom$
|
|
1259
|
+
dom$g.ketchup.dynamicPosition.run(el);
|
|
1260
1260
|
});
|
|
1261
1261
|
}
|
|
1262
1262
|
else {
|
|
@@ -1344,7 +1344,7 @@ var KupDropEventTypes;
|
|
|
1344
1344
|
KupDropEventTypes["MAGICBOX"] = "text/kup-magic-box-drag";
|
|
1345
1345
|
})(KupDropEventTypes || (KupDropEventTypes = {}));
|
|
1346
1346
|
|
|
1347
|
-
const dom$
|
|
1347
|
+
const dom$f = document.documentElement;
|
|
1348
1348
|
/**
|
|
1349
1349
|
* This class handles elements as dialogs, making them resizable and movable.
|
|
1350
1350
|
* @module KupInteract
|
|
@@ -1458,7 +1458,7 @@ class KupInteract {
|
|
|
1458
1458
|
ghostImage.style.transition = 'none';
|
|
1459
1459
|
ghostImage.style.zIndex =
|
|
1460
1460
|
'calc(var(--kup-navbar-zindex) + 1)';
|
|
1461
|
-
dom$
|
|
1461
|
+
dom$f.ketchup.interact.container.appendChild(ghostImage);
|
|
1462
1462
|
draggable.kupDragDrop.ghostImage = ghostImage;
|
|
1463
1463
|
break;
|
|
1464
1464
|
case KupDragEffect.CLONE:
|
|
@@ -1619,7 +1619,7 @@ class KupInteract {
|
|
|
1619
1619
|
x += e.deltaRect.left;
|
|
1620
1620
|
y += e.deltaRect.top;
|
|
1621
1621
|
el.style.transform = 'translate(' + x + 'px,' + y + 'px)';
|
|
1622
|
-
if (dom$
|
|
1622
|
+
if (dom$f.ketchup.interact.isInViewport(el, oldTransform, e.delta)) {
|
|
1623
1623
|
el.setAttribute('data-x', x.toString());
|
|
1624
1624
|
el.setAttribute('data-y', y.toString());
|
|
1625
1625
|
}
|
|
@@ -1671,7 +1671,7 @@ class KupInteract {
|
|
|
1671
1671
|
const callbacks = {
|
|
1672
1672
|
start(e) {
|
|
1673
1673
|
const el = e.currentTarget;
|
|
1674
|
-
el.style.zIndex = (dom$
|
|
1674
|
+
el.style.zIndex = (dom$f.ketchup.interact.zIndex++).toString();
|
|
1675
1675
|
},
|
|
1676
1676
|
};
|
|
1677
1677
|
this.draggable(el, {
|
|
@@ -1680,7 +1680,7 @@ class KupInteract {
|
|
|
1680
1680
|
interact.modifiers.restrictRect({
|
|
1681
1681
|
restriction: restrictContainer
|
|
1682
1682
|
? restrictContainer
|
|
1683
|
-
: dom$
|
|
1683
|
+
: dom$f.ketchup.interact.restrictContainer,
|
|
1684
1684
|
endOnly: true,
|
|
1685
1685
|
}),
|
|
1686
1686
|
],
|
|
@@ -2632,7 +2632,7 @@ const languages = {
|
|
|
2632
2632
|
spanish: spanish
|
|
2633
2633
|
};
|
|
2634
2634
|
|
|
2635
|
-
const dom$
|
|
2635
|
+
const dom$e = document.documentElement;
|
|
2636
2636
|
/**
|
|
2637
2637
|
* Handles the translation to different languages.
|
|
2638
2638
|
* @module KupLanguage
|
|
@@ -2686,7 +2686,7 @@ class KupLanguage {
|
|
|
2686
2686
|
return invalidKey(key);
|
|
2687
2687
|
}
|
|
2688
2688
|
function invalidKey(key) {
|
|
2689
|
-
dom$
|
|
2689
|
+
dom$e.ketchup.debug.logMessage('kup-language', 'Invalid translation for key (' + key + ')!', KupDebugCategory.WARNING);
|
|
2690
2690
|
return key;
|
|
2691
2691
|
}
|
|
2692
2692
|
}
|
|
@@ -2699,7 +2699,7 @@ class KupLanguage {
|
|
|
2699
2699
|
language = language.toLowerCase();
|
|
2700
2700
|
}
|
|
2701
2701
|
else {
|
|
2702
|
-
dom$
|
|
2702
|
+
dom$e.ketchup.debug.logMessage('kup-language', "Couldn't set language, invalid string received (" +
|
|
2703
2703
|
language +
|
|
2704
2704
|
')!', KupDebugCategory.WARNING);
|
|
2705
2705
|
return;
|
|
@@ -2709,12 +2709,12 @@ class KupLanguage {
|
|
|
2709
2709
|
const dVariant = decodedLanguage.variant;
|
|
2710
2710
|
if (this.list[dLanguage]) {
|
|
2711
2711
|
if (dVariant && !this.list[dLanguage].variants[dVariant]) {
|
|
2712
|
-
dom$
|
|
2712
|
+
dom$e.ketchup.debug.logMessage('kup-language', 'Variant not found (' + dVariant + ')!', KupDebugCategory.WARNING);
|
|
2713
2713
|
return;
|
|
2714
2714
|
}
|
|
2715
2715
|
}
|
|
2716
2716
|
else {
|
|
2717
|
-
dom$
|
|
2717
|
+
dom$e.ketchup.debug.logMessage('kup-language', 'Language not found (' + dLanguage + ')!', KupDebugCategory.WARNING);
|
|
2718
2718
|
return;
|
|
2719
2719
|
}
|
|
2720
2720
|
this.name = language;
|
|
@@ -2801,7 +2801,7 @@ const obj = {
|
|
|
2801
2801
|
types: types
|
|
2802
2802
|
};
|
|
2803
2803
|
|
|
2804
|
-
const dom$
|
|
2804
|
+
const dom$d = document.documentElement;
|
|
2805
2805
|
/**
|
|
2806
2806
|
* Handles objects definition and validation.
|
|
2807
2807
|
* @module KupObjects
|
|
@@ -3136,9 +3136,9 @@ class KupObjects {
|
|
|
3136
3136
|
*/
|
|
3137
3137
|
parseDate(obj) {
|
|
3138
3138
|
if (obj.t === 'D8' && obj.p === '*DMYY') {
|
|
3139
|
-
return dom$
|
|
3139
|
+
return dom$d.ketchup.dates.toDayjs(obj.k, 'DDMMYYYY');
|
|
3140
3140
|
}
|
|
3141
|
-
return dom$
|
|
3141
|
+
return dom$d.ketchup.dates.toDayjs(obj.k);
|
|
3142
3142
|
}
|
|
3143
3143
|
/**
|
|
3144
3144
|
* Check whether two JS objects are deeply equal. When the arguments aren't objects, they are tested directly for equity.
|
|
@@ -3211,7 +3211,7 @@ var __classPrivateFieldGet$2 = (undefined && undefined.__classPrivateFieldGet) |
|
|
|
3211
3211
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
3212
3212
|
};
|
|
3213
3213
|
var _KupScrollOnHover_instances, _KupScrollOnHover_arrowsContainer, _KupScrollOnHover_leftArrows, _KupScrollOnHover_rightArrows, _KupScrollOnHover_scrollEvent, _KupScrollOnHover_mousemoveEvent, _KupScrollOnHover_mouseleaveEvent, _KupScrollOnHover_rAF, _KupScrollOnHover_timeout, _KupScrollOnHover_initArrows;
|
|
3214
|
-
const dom$
|
|
3214
|
+
const dom$c = document.documentElement;
|
|
3215
3215
|
/**
|
|
3216
3216
|
* Lets the user scroll an element's overflow by hovering with the mouse on its left/right edge.
|
|
3217
3217
|
* @module KupScrollOnHover
|
|
@@ -3340,7 +3340,7 @@ class KupScrollOnHover {
|
|
|
3340
3340
|
__classPrivateFieldSet$2(this, _KupScrollOnHover_timeout, setTimeout(() => {
|
|
3341
3341
|
el.scrollOnHover.active = true;
|
|
3342
3342
|
__classPrivateFieldSet$2(this, _KupScrollOnHover_rAF, requestAnimationFrame(function () {
|
|
3343
|
-
dom$
|
|
3343
|
+
dom$c.ketchup.scrollOnHover.run(el, maxScrollLeft, percRight, percLeft, direction);
|
|
3344
3344
|
}), "f");
|
|
3345
3345
|
}, this.delay), "f");
|
|
3346
3346
|
}
|
|
@@ -3362,7 +3362,7 @@ class KupScrollOnHover {
|
|
|
3362
3362
|
__classPrivateFieldSet$2(this, _KupScrollOnHover_timeout, setTimeout(() => {
|
|
3363
3363
|
el.scrollOnHover.active = true;
|
|
3364
3364
|
__classPrivateFieldSet$2(this, _KupScrollOnHover_rAF, requestAnimationFrame(function () {
|
|
3365
|
-
dom$
|
|
3365
|
+
dom$c.ketchup.scrollOnHover.run(el, maxScrollTop, percBottom, percTop, direction);
|
|
3366
3366
|
}), "f");
|
|
3367
3367
|
}, this.delay), "f");
|
|
3368
3368
|
}
|
|
@@ -3493,7 +3493,7 @@ class KupScrollOnHover {
|
|
|
3493
3493
|
arrow[i].classList.add('kup-animated');
|
|
3494
3494
|
}
|
|
3495
3495
|
__classPrivateFieldSet$2(this, _KupScrollOnHover_rAF, requestAnimationFrame(function () {
|
|
3496
|
-
dom$
|
|
3496
|
+
dom$c.ketchup.scrollOnHover.run(el, maxScrollLeft, percForward, percBack, direction);
|
|
3497
3497
|
}), "f");
|
|
3498
3498
|
}
|
|
3499
3499
|
/**
|
|
@@ -4731,7 +4731,7 @@ var KupThemeIconValues;
|
|
|
4731
4731
|
KupThemeIconValues["SEARCH"] = "--kup-search-icon";
|
|
4732
4732
|
})(KupThemeIconValues || (KupThemeIconValues = {}));
|
|
4733
4733
|
|
|
4734
|
-
const dom$
|
|
4734
|
+
const dom$b = document.documentElement;
|
|
4735
4735
|
/**
|
|
4736
4736
|
* Theme manager, handles everything about theming, customStyles and color utilities.
|
|
4737
4737
|
* @module KupTheme
|
|
@@ -4745,7 +4745,7 @@ class KupTheme {
|
|
|
4745
4745
|
this.list = list ? list : themes;
|
|
4746
4746
|
this.managedComponents = new Set();
|
|
4747
4747
|
this.name = name ? name : 'ketchup';
|
|
4748
|
-
this.styleTag = dom$
|
|
4748
|
+
this.styleTag = dom$b
|
|
4749
4749
|
.querySelector('head')
|
|
4750
4750
|
.appendChild(document.createElement('style'));
|
|
4751
4751
|
}
|
|
@@ -4832,9 +4832,9 @@ class KupTheme {
|
|
|
4832
4832
|
if (list) {
|
|
4833
4833
|
this.list = list;
|
|
4834
4834
|
}
|
|
4835
|
-
dom$
|
|
4835
|
+
dom$b.ketchup.debug.logMessage('theme manager', 'Setting theme to: ' + this.name + '.');
|
|
4836
4836
|
if (!this.list[this.name]) {
|
|
4837
|
-
dom$
|
|
4837
|
+
dom$b.ketchup.debug.logMessage('theme manager', 'Invalid theme name, falling back to default ("ketchup").');
|
|
4838
4838
|
this.name = 'ketchup';
|
|
4839
4839
|
}
|
|
4840
4840
|
this.cssVars = {};
|
|
@@ -4877,11 +4877,11 @@ class KupTheme {
|
|
|
4877
4877
|
this.icons() +
|
|
4878
4878
|
'}';
|
|
4879
4879
|
this.customStyle();
|
|
4880
|
-
dom$
|
|
4880
|
+
dom$b.ketchup.debug.logMessage('kup-theme', 'Theme ' + dom$b.getAttribute('kup-theme') + ' refreshed.');
|
|
4881
4881
|
document.dispatchEvent(new CustomEvent('kup-theme-refresh'));
|
|
4882
4882
|
}
|
|
4883
4883
|
catch (error) {
|
|
4884
|
-
dom$
|
|
4884
|
+
dom$b.ketchup.debug.logMessage('kup-theme', 'Theme not refreshed.', KupDebugCategory.WARNING);
|
|
4885
4885
|
}
|
|
4886
4886
|
}
|
|
4887
4887
|
/**
|
|
@@ -5000,7 +5000,7 @@ class KupTheme {
|
|
|
5000
5000
|
this.set(themes[index]);
|
|
5001
5001
|
}
|
|
5002
5002
|
else {
|
|
5003
|
-
dom$
|
|
5003
|
+
dom$b.ketchup.debug.logMessage('kup-theme', "Couldn't set a random theme: no themes available!", KupDebugCategory.WARNING);
|
|
5004
5004
|
}
|
|
5005
5005
|
}
|
|
5006
5006
|
/**
|
|
@@ -5012,7 +5012,7 @@ class KupTheme {
|
|
|
5012
5012
|
//Testing whether the color is transparent, if it is a fall back value will be returned matching the background-color
|
|
5013
5013
|
if (color === 'transparent') {
|
|
5014
5014
|
color = this.cssVars['--kup-background-color'];
|
|
5015
|
-
dom$
|
|
5015
|
+
dom$b.ketchup.debug.logMessage('theme manager', 'Received TRANSPARENT color, converted to ' +
|
|
5016
5016
|
color +
|
|
5017
5017
|
' (theme background).');
|
|
5018
5018
|
}
|
|
@@ -5030,7 +5030,7 @@ class KupTheme {
|
|
|
5030
5030
|
const oldColor = color;
|
|
5031
5031
|
color = this.codeToHex(color);
|
|
5032
5032
|
isHex = color.substring(0, 1) === '#' ? true : false;
|
|
5033
|
-
dom$
|
|
5033
|
+
dom$b.ketchup.debug.logMessage('theme manager', 'Received CODE NAME color ' +
|
|
5034
5034
|
oldColor +
|
|
5035
5035
|
', converted to ' +
|
|
5036
5036
|
color +
|
|
@@ -5084,14 +5084,14 @@ class KupTheme {
|
|
|
5084
5084
|
else {
|
|
5085
5085
|
hexColor = this.rgbToHex(rgbColorObj.r, rgbColorObj.g, rgbColorObj.b);
|
|
5086
5086
|
}
|
|
5087
|
-
dom$
|
|
5087
|
+
dom$b.ketchup.debug.logMessage('theme-manager', 'Received HEX color ' +
|
|
5088
5088
|
oldColor +
|
|
5089
5089
|
', converted to ' +
|
|
5090
5090
|
color +
|
|
5091
5091
|
'.');
|
|
5092
5092
|
}
|
|
5093
5093
|
catch (error) {
|
|
5094
|
-
dom$
|
|
5094
|
+
dom$b.ketchup.debug.logMessage('theme-manager', 'Invalid color: ' + color + '.');
|
|
5095
5095
|
}
|
|
5096
5096
|
}
|
|
5097
5097
|
let rgbValues = null;
|
|
@@ -5101,14 +5101,14 @@ class KupTheme {
|
|
|
5101
5101
|
rgbColor = color;
|
|
5102
5102
|
}
|
|
5103
5103
|
catch (error) {
|
|
5104
|
-
dom$
|
|
5104
|
+
dom$b.ketchup.debug.logMessage('theme-manager', 'Color not converted to rgb values: ' + color + '.');
|
|
5105
5105
|
}
|
|
5106
5106
|
if (!hexColor) {
|
|
5107
5107
|
try {
|
|
5108
5108
|
hexColor = this.rgbToHex(parseInt(values[1]), parseInt(values[2]), parseInt(values[3]));
|
|
5109
5109
|
}
|
|
5110
5110
|
catch (error) {
|
|
5111
|
-
dom$
|
|
5111
|
+
dom$b.ketchup.debug.logMessage('theme-manager', 'Color not converted to hex value: ' + color + '.');
|
|
5112
5112
|
}
|
|
5113
5113
|
}
|
|
5114
5114
|
if (!hslColor || !hslValues) {
|
|
@@ -5121,7 +5121,7 @@ class KupTheme {
|
|
|
5121
5121
|
hslColor = 'hsl(' + hsl.h + ',' + hsl.s + '%,' + hsl.l + '%)';
|
|
5122
5122
|
}
|
|
5123
5123
|
catch (error) {
|
|
5124
|
-
dom$
|
|
5124
|
+
dom$b.ketchup.debug.logMessage('theme-manager', 'Color not converted to hex value: ' + color + '.');
|
|
5125
5125
|
}
|
|
5126
5126
|
}
|
|
5127
5127
|
return {
|
|
@@ -5426,7 +5426,7 @@ class KupTheme {
|
|
|
5426
5426
|
return colorCodes[color.toLowerCase()];
|
|
5427
5427
|
}
|
|
5428
5428
|
else {
|
|
5429
|
-
dom$
|
|
5429
|
+
dom$b.ketchup.debug.logMessage('theme manager', 'Could not decode color ' + color + '!');
|
|
5430
5430
|
return color;
|
|
5431
5431
|
}
|
|
5432
5432
|
}
|
|
@@ -5454,7 +5454,7 @@ var __classPrivateFieldGet$1 = (undefined && undefined.__classPrivateFieldGet) |
|
|
|
5454
5454
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5455
5455
|
};
|
|
5456
5456
|
var _KupToolbar_keyEvent;
|
|
5457
|
-
const dom$
|
|
5457
|
+
const dom$a = document.documentElement;
|
|
5458
5458
|
/**
|
|
5459
5459
|
* Handles component's toolbar.
|
|
5460
5460
|
* @module KupToolbar
|
|
@@ -5472,7 +5472,7 @@ class KupToolbar {
|
|
|
5472
5472
|
KupToolbarModifierKeys.CTRL,
|
|
5473
5473
|
];
|
|
5474
5474
|
__classPrivateFieldSet$1(this, _KupToolbar_keyEvent, function (e) {
|
|
5475
|
-
const toolbar = dom$
|
|
5475
|
+
const toolbar = dom$a.ketchup.toolbar;
|
|
5476
5476
|
if (toolbar.managedElements) {
|
|
5477
5477
|
for (let index = 0; index < toolbar.modifiers.length; index++) {
|
|
5478
5478
|
if (toolbar.modifiers[index] ===
|
|
@@ -5979,16 +5979,6 @@ var KupDatesNormalize;
|
|
|
5979
5979
|
KupDatesNormalize["TIME"] = "time";
|
|
5980
5980
|
KupDatesNormalize["TIMESTAMP"] = "timestamp";
|
|
5981
5981
|
})(KupDatesNormalize || (KupDatesNormalize = {}));
|
|
5982
|
-
/**
|
|
5983
|
-
* Common use formats
|
|
5984
|
-
*/
|
|
5985
|
-
var KupDatesFormats;
|
|
5986
|
-
(function (KupDatesFormats) {
|
|
5987
|
-
KupDatesFormats["ISO_DATE"] = "YYYY-MM-DD";
|
|
5988
|
-
KupDatesFormats["ISO_DATE_TIME"] = "YYYY-MM-DD HH:mm:ss";
|
|
5989
|
-
KupDatesFormats["ISO_TIME"] = "HH:mm:ss";
|
|
5990
|
-
KupDatesFormats["ISO_TIME_WITHOUT_SECONDS"] = "HH:mm";
|
|
5991
|
-
})(KupDatesFormats || (KupDatesFormats = {}));
|
|
5992
5982
|
/**
|
|
5993
5983
|
* Supported locales.
|
|
5994
5984
|
*/
|
|
@@ -6001,432 +5991,28 @@ var KupDatesLocales;
|
|
|
6001
5991
|
KupDatesLocales["POLISH"] = "pl";
|
|
6002
5992
|
KupDatesLocales["RUSSIAN"] = "ru";
|
|
6003
5993
|
KupDatesLocales["SPANISH"] = "es";
|
|
6004
|
-
})(KupDatesLocales || (KupDatesLocales = {}));
|
|
6005
|
-
|
|
6006
|
-
const dom$a = document.documentElement;
|
|
6007
|
-
var DateTimeFormatOptionsMonth;
|
|
6008
|
-
(function (DateTimeFormatOptionsMonth) {
|
|
6009
|
-
DateTimeFormatOptionsMonth["NUMERIC"] = "numeric";
|
|
6010
|
-
DateTimeFormatOptionsMonth["DIGIT2"] = "2-digit";
|
|
6011
|
-
DateTimeFormatOptionsMonth["LONG"] = "long";
|
|
6012
|
-
DateTimeFormatOptionsMonth["SHORT"] = "short";
|
|
6013
|
-
DateTimeFormatOptionsMonth["NARROW"] = "narrow";
|
|
6014
|
-
})(DateTimeFormatOptionsMonth || (DateTimeFormatOptionsMonth = {}));
|
|
6015
|
-
function identify(array) {
|
|
6016
|
-
if (array) {
|
|
6017
|
-
for (let i = 0; i < array.length; i++) {
|
|
6018
|
-
array[i].id = i.toString();
|
|
6019
|
-
}
|
|
6020
|
-
}
|
|
6021
|
-
}
|
|
6022
|
-
function getSeparator(locale, separatorType) {
|
|
6023
|
-
const numberWithGroupAndDecimalSeparator = 1000.1;
|
|
6024
|
-
return Intl.NumberFormat(locale)
|
|
6025
|
-
.formatToParts(numberWithGroupAndDecimalSeparator)
|
|
6026
|
-
.find((part) => part.type === separatorType).value;
|
|
6027
|
-
}
|
|
6028
|
-
function getCurrentTimeFormatFromBrowserLocale(manageSeconds) {
|
|
6029
|
-
const options = {
|
|
6030
|
-
hour: '2-digit',
|
|
6031
|
-
minute: '2-digit',
|
|
6032
|
-
hour12: false,
|
|
6033
|
-
};
|
|
6034
|
-
if (manageSeconds == true) {
|
|
6035
|
-
options.second = '2-digit';
|
|
6036
|
-
}
|
|
6037
|
-
const formatObj = new Intl.DateTimeFormat(dom$a.ketchup.dates.getLocale() + '-u-hc-h23', options).formatToParts(new Date());
|
|
6038
|
-
let timeFormat = formatObj
|
|
6039
|
-
.map((obj) => {
|
|
6040
|
-
switch (obj.type) {
|
|
6041
|
-
case 'hour':
|
|
6042
|
-
return 'HH';
|
|
6043
|
-
case 'minute':
|
|
6044
|
-
return 'mm';
|
|
6045
|
-
case 'second':
|
|
6046
|
-
return 'ss';
|
|
6047
|
-
default:
|
|
6048
|
-
return obj.value;
|
|
6049
|
-
}
|
|
6050
|
-
})
|
|
6051
|
-
.join('');
|
|
6052
|
-
return timeFormat;
|
|
6053
|
-
}
|
|
5994
|
+
})(KupDatesLocales || (KupDatesLocales = {}));
|
|
6054
5995
|
/**
|
|
6055
|
-
*
|
|
6056
|
-
* @param type - type of number for calculate suffix
|
|
6057
|
-
* @returns true if number string in input is a valid number
|
|
5996
|
+
* Format Months
|
|
6058
5997
|
*/
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
return false;
|
|
6068
|
-
}
|
|
6069
|
-
function isNumber(value) {
|
|
6070
|
-
//return typeof value === 'number';
|
|
6071
|
-
return !isNaN(value);
|
|
6072
|
-
}
|
|
6073
|
-
/**
|
|
6074
|
-
* @param input number as string, formatted by locale US, decimal separator . (like java decimal numbers)
|
|
6075
|
-
* @returns number
|
|
6076
|
-
**/
|
|
6077
|
-
function stringToNumber(input) {
|
|
6078
|
-
if (!input || input == null || input.trim() == '') {
|
|
6079
|
-
input = '0';
|
|
6080
|
-
}
|
|
6081
|
-
return dom$a.ketchup.math.numberify(input);
|
|
6082
|
-
}
|
|
6083
|
-
/**
|
|
6084
|
-
* @param input number
|
|
6085
|
-
* @param decimals number of significant decimal digits for output
|
|
6086
|
-
* @returns number as string, formatted by actual browser locale
|
|
6087
|
-
**/
|
|
6088
|
-
function numberToString(input, decimals) {
|
|
6089
|
-
if (input == null) {
|
|
6090
|
-
return '';
|
|
6091
|
-
}
|
|
6092
|
-
return _numberToString(input, decimals, dom$a.ketchup.dates.getLocale(), true);
|
|
6093
|
-
}
|
|
6094
|
-
/**
|
|
6095
|
-
* @param type - type of number for calculate suffix
|
|
6096
|
-
* @returns suffix for number, by type
|
|
6097
|
-
**/
|
|
6098
|
-
function getNumericValueSuffixByType(type) {
|
|
6099
|
-
type = type.toUpperCase();
|
|
6100
|
-
let nstr = '';
|
|
6101
|
-
if (type == 'P') {
|
|
6102
|
-
nstr = ' %';
|
|
6103
|
-
}
|
|
6104
|
-
else if (type == 'VE') {
|
|
6105
|
-
nstr = ' €';
|
|
6106
|
-
}
|
|
6107
|
-
else if (type == 'VL') {
|
|
6108
|
-
nstr = ' £';
|
|
6109
|
-
}
|
|
6110
|
-
else if (type == 'VV') {
|
|
6111
|
-
nstr = ' $';
|
|
6112
|
-
}
|
|
6113
|
-
return nstr;
|
|
6114
|
-
}
|
|
6115
|
-
/**
|
|
6116
|
-
* @param input number
|
|
6117
|
-
* @param decimals number of significant decimal digits for output
|
|
6118
|
-
* @param type - type of number for calculate suffix
|
|
6119
|
-
* @returns number as string, formatted by actual browser locale, with suffix by type
|
|
6120
|
-
**/
|
|
6121
|
-
function numberToFormattedStringNumber(input, decimals, type) {
|
|
6122
|
-
if (input == null || isNaN(input)) {
|
|
6123
|
-
return '';
|
|
6124
|
-
}
|
|
6125
|
-
let nstr = numberToString(input, decimals);
|
|
6126
|
-
nstr = nstr + getNumericValueSuffixByType(type);
|
|
6127
|
-
return nstr;
|
|
6128
|
-
}
|
|
6129
|
-
/**
|
|
6130
|
-
* @param input number as string, formatted by locale US, decimal separator . (like java decimal numbers)
|
|
6131
|
-
* @param decimals number of significant decimal digits for output
|
|
6132
|
-
* @param type - type of number for calculate suffix
|
|
6133
|
-
* @returns number as string, formatted by actual browser locale, with suffix by type
|
|
6134
|
-
**/
|
|
6135
|
-
function unformattedStringToFormattedStringNumber(input, decimals, type) {
|
|
6136
|
-
return numberToFormattedStringNumber(stringToNumber(input), decimals, type);
|
|
6137
|
-
}
|
|
6138
|
-
/**
|
|
6139
|
-
* @param input number as string, formatted by actual browser locale
|
|
6140
|
-
* @param type - type of number for calculate suffix
|
|
6141
|
-
* @returns number as string, formatted by locale US, decimal separator . (like java decimal numbers), without group separator
|
|
6142
|
-
**/
|
|
6143
|
-
function formattedStringToUnformattedStringNumber(input, type) {
|
|
6144
|
-
return numberStringToNumberString(input, type, getDecimalSeparator(dom$a.ketchup.dates.getLocale()));
|
|
6145
|
-
}
|
|
6146
|
-
/**
|
|
6147
|
-
* @param input number as string, formatted by locale US, decimal separator . (like java decimal numbers), with group separator
|
|
6148
|
-
* @param type - type of number for calculate suffix
|
|
6149
|
-
* @returns number as string, formatted by locale US, decimal separator . (like java decimal numbers), without group separator
|
|
6150
|
-
**/
|
|
6151
|
-
function unformattedStringNumberToNumber(input, type) {
|
|
6152
|
-
return numberStringToNumberString(input, type, '.');
|
|
6153
|
-
}
|
|
6154
|
-
function numberStringToNumberString(input, type, decFmt) {
|
|
6155
|
-
if (input == null || input.trim() == '') {
|
|
6156
|
-
return '';
|
|
6157
|
-
}
|
|
6158
|
-
let originalInputValue = input;
|
|
6159
|
-
let suffix = getNumericValueSuffixByType(type);
|
|
6160
|
-
if (suffix != '') {
|
|
6161
|
-
input = input.replace(suffix, '');
|
|
6162
|
-
}
|
|
6163
|
-
let regExpr = null;
|
|
6164
|
-
if (decFmt == '.') {
|
|
6165
|
-
regExpr = /,/g;
|
|
6166
|
-
}
|
|
6167
|
-
else {
|
|
6168
|
-
regExpr = /\./g;
|
|
6169
|
-
}
|
|
6170
|
-
input = input.replace(regExpr, '');
|
|
6171
|
-
if (decFmt != '.') {
|
|
6172
|
-
input = input.replace(/,/g, '.');
|
|
6173
|
-
}
|
|
6174
|
-
if (dom$a.ketchup.math.numberify(input) == null ||
|
|
6175
|
-
isNaN(dom$a.ketchup.math.numberify(input))) {
|
|
6176
|
-
return originalInputValue;
|
|
6177
|
-
}
|
|
6178
|
-
let unf = stringToNumber(input);
|
|
6179
|
-
return _numberToString(unf, -1, 'en-US', false);
|
|
6180
|
-
}
|
|
6181
|
-
function getDecimalSeparator(locale) {
|
|
6182
|
-
return getSeparator(locale, 'decimal');
|
|
6183
|
-
}
|
|
6184
|
-
function countDecimals(value) {
|
|
6185
|
-
if (Math.floor(value) === value)
|
|
6186
|
-
return 0;
|
|
6187
|
-
let stringValue = value.toString().split('.')[1];
|
|
6188
|
-
if (stringValue) {
|
|
6189
|
-
return stringValue.length ? stringValue.length : 0;
|
|
6190
|
-
}
|
|
6191
|
-
else {
|
|
6192
|
-
return 0;
|
|
6193
|
-
}
|
|
6194
|
-
}
|
|
6195
|
-
function _numberToString(input, decimals, locale, useGrouping) {
|
|
6196
|
-
if (input == null) {
|
|
6197
|
-
input = 0;
|
|
6198
|
-
}
|
|
6199
|
-
if (decimals == null || decimals == -1) {
|
|
6200
|
-
decimals = countDecimals(input);
|
|
6201
|
-
}
|
|
6202
|
-
let n = Number(input);
|
|
6203
|
-
let f = decimals > -1
|
|
6204
|
-
? {
|
|
6205
|
-
minimumFractionDigits: decimals,
|
|
6206
|
-
maximumFractionDigits: decimals,
|
|
6207
|
-
useGrouping: useGrouping,
|
|
6208
|
-
}
|
|
6209
|
-
: { useGrouping: useGrouping };
|
|
6210
|
-
return n.toLocaleString(locale, f);
|
|
6211
|
-
}
|
|
6212
|
-
/**
|
|
6213
|
-
* @param time time as Date object
|
|
6214
|
-
* @param manageSeconds flag to set seconds managing
|
|
6215
|
-
* @return time as string, formatted
|
|
6216
|
-
**/
|
|
6217
|
-
function formatTime(time, manageSeconds) {
|
|
6218
|
-
const options = {
|
|
6219
|
-
hour: '2-digit',
|
|
6220
|
-
minute: '2-digit',
|
|
6221
|
-
hour12: false,
|
|
6222
|
-
};
|
|
6223
|
-
if (manageSeconds == true) {
|
|
6224
|
-
options.second = '2-digit';
|
|
6225
|
-
}
|
|
6226
|
-
return time.toLocaleTimeString(dom$a.ketchup.dates.getLocale() + '-u-hc-h23', options);
|
|
6227
|
-
}
|
|
6228
|
-
/**
|
|
6229
|
-
* @param value time string, formatted by actual browser locale
|
|
6230
|
-
* @returns true if time string in input is a valid time
|
|
6231
|
-
*/
|
|
6232
|
-
function isValidFormattedStringTime(value, manageSeconds) {
|
|
6233
|
-
let format = getCurrentTimeFormatFromBrowserLocale(manageSeconds);
|
|
6234
|
-
return dom$a.ketchup.dates.isValid(value, format, true);
|
|
6235
|
-
}
|
|
5998
|
+
var KupDateTimeFormatOptionsMonth;
|
|
5999
|
+
(function (KupDateTimeFormatOptionsMonth) {
|
|
6000
|
+
KupDateTimeFormatOptionsMonth["NUMERIC"] = "numeric";
|
|
6001
|
+
KupDateTimeFormatOptionsMonth["DIGIT2"] = "2-digit";
|
|
6002
|
+
KupDateTimeFormatOptionsMonth["LONG"] = "long";
|
|
6003
|
+
KupDateTimeFormatOptionsMonth["SHORT"] = "short";
|
|
6004
|
+
KupDateTimeFormatOptionsMonth["NARROW"] = "narrow";
|
|
6005
|
+
})(KupDateTimeFormatOptionsMonth || (KupDateTimeFormatOptionsMonth = {}));
|
|
6236
6006
|
/**
|
|
6237
|
-
*
|
|
6238
|
-
* @returns date/time as string, formatted ISO
|
|
6239
|
-
**/
|
|
6240
|
-
function formattedStringToDefaultUnformattedStringTimestamp(value) {
|
|
6241
|
-
return formattedStringToCustomUnformattedStringTime(value, KupDatesFormats.ISO_DATE_TIME, true);
|
|
6242
|
-
}
|
|
6243
|
-
/**
|
|
6244
|
-
* @param value time as string, formatted by actual browser locale
|
|
6245
|
-
* @param outputFormat time format to return
|
|
6246
|
-
* @param manageSeconds flag to set seconds managing
|
|
6247
|
-
* @returns time as string, formatted
|
|
6248
|
-
**/
|
|
6249
|
-
function formattedStringToCustomUnformattedStringTime(value, outputFormat, manageSeconds) {
|
|
6250
|
-
let inputFormat = getCurrentTimeFormatFromBrowserLocale(manageSeconds);
|
|
6251
|
-
if (dom$a.ketchup.dates.isValid(value, inputFormat)) {
|
|
6252
|
-
return dom$a.ketchup.dates.format(dom$a.ketchup.dates.normalize(value, KupDatesNormalize.TIME), outputFormat);
|
|
6253
|
-
}
|
|
6254
|
-
else {
|
|
6255
|
-
return '';
|
|
6256
|
-
}
|
|
6257
|
-
}
|
|
6258
|
-
/**
|
|
6259
|
-
* @param value time as string, formatted ISO
|
|
6260
|
-
* @param manageSeconds flag to set seconds managing
|
|
6261
|
-
* @param valueTimeFormat time format (default ISO)
|
|
6262
|
-
* @param customedFormat time format from smeupObject
|
|
6263
|
-
* @returns time as string, formatted by actual browser locale
|
|
6264
|
-
**/
|
|
6265
|
-
function unformattedStringToFormattedStringTime(value, manageSeconds, customedFormat) {
|
|
6266
|
-
const options = {
|
|
6267
|
-
hour: '2-digit',
|
|
6268
|
-
minute: '2-digit',
|
|
6269
|
-
hour12: false,
|
|
6270
|
-
};
|
|
6271
|
-
if (manageSeconds == true) {
|
|
6272
|
-
options.second = '2-digit';
|
|
6273
|
-
}
|
|
6274
|
-
let date = dom$a.ketchup.dates.toDate(dom$a.ketchup.dates.normalize(value, KupDatesNormalize.TIME));
|
|
6275
|
-
return formatByCustomedOutputTimeFormat(value, date, options, customedFormat);
|
|
6276
|
-
}
|
|
6277
|
-
function formatByCustomedOutputTimeFormat(valueStr, date, options, customedFormat) {
|
|
6278
|
-
if (customedFormat == null) {
|
|
6279
|
-
return date.toLocaleTimeString(dom$a.ketchup.dates.getLocale() + '-u-hc-h23', options);
|
|
6280
|
-
}
|
|
6281
|
-
switch (customedFormat) {
|
|
6282
|
-
case 'I13': {
|
|
6283
|
-
//hh:mm
|
|
6284
|
-
break;
|
|
6285
|
-
}
|
|
6286
|
-
case 'I12': {
|
|
6287
|
-
//hh:mm:ss
|
|
6288
|
-
break;
|
|
6289
|
-
}
|
|
6290
|
-
case 'I11': {
|
|
6291
|
-
//???
|
|
6292
|
-
//hh:dddd
|
|
6293
|
-
//return moment(date).format('HH:DDDD');
|
|
6294
|
-
return valueStr;
|
|
6295
|
-
}
|
|
6296
|
-
case 'I14': {
|
|
6297
|
-
//???
|
|
6298
|
-
//sssss
|
|
6299
|
-
//return moment(date).format('SSSSS');
|
|
6300
|
-
return valueStr;
|
|
6301
|
-
}
|
|
6302
|
-
case 'I1H': {
|
|
6303
|
-
//???
|
|
6304
|
-
//Ora,Cen/Min HH,xx
|
|
6305
|
-
return valueStr;
|
|
6306
|
-
}
|
|
6307
|
-
case 'I1M': {
|
|
6308
|
-
//???
|
|
6309
|
-
//Min,Cen/Sec MMMM,xx
|
|
6310
|
-
return valueStr;
|
|
6311
|
-
}
|
|
6312
|
-
case 'I21': {
|
|
6313
|
-
//???
|
|
6314
|
-
//Giorni,(4 decim)
|
|
6315
|
-
return valueStr;
|
|
6316
|
-
}
|
|
6317
|
-
case 'I22': {
|
|
6318
|
-
//???
|
|
6319
|
-
//Ore,(4 decim)
|
|
6320
|
-
return valueStr;
|
|
6321
|
-
}
|
|
6322
|
-
case 'I23': {
|
|
6323
|
-
//???
|
|
6324
|
-
//Minuti,(4 decim)
|
|
6325
|
-
return valueStr;
|
|
6326
|
-
}
|
|
6327
|
-
case 'I24': {
|
|
6328
|
-
//???
|
|
6329
|
-
//Secondi
|
|
6330
|
-
return valueStr;
|
|
6331
|
-
}
|
|
6332
|
-
case 'I2H': {
|
|
6333
|
-
//???
|
|
6334
|
-
//Ora,Cen/Min HHHH,xx
|
|
6335
|
-
return valueStr;
|
|
6336
|
-
}
|
|
6337
|
-
case 'I2D': {
|
|
6338
|
-
//???
|
|
6339
|
-
//Ore Minuti Secondi HHMMS
|
|
6340
|
-
return valueStr;
|
|
6341
|
-
}
|
|
6342
|
-
case 'I2M': {
|
|
6343
|
-
//???
|
|
6344
|
-
//Min,Cen/Sec MMMM,xx
|
|
6345
|
-
return valueStr;
|
|
6346
|
-
}
|
|
6347
|
-
}
|
|
6348
|
-
return date.toLocaleTimeString(dom$a.ketchup.dates.getLocale() + '-u-hc-h23', options);
|
|
6349
|
-
}
|
|
6350
|
-
/**
|
|
6351
|
-
* @param value date/time as string, formatted ISO
|
|
6352
|
-
* @param valueDateFormat date/time format (default ISO)
|
|
6353
|
-
* @returns date/time as string, formatted by actual browser locale
|
|
6354
|
-
**/
|
|
6355
|
-
function unformattedStringToFormattedStringTimestamp(value) {
|
|
6356
|
-
const options = {
|
|
6357
|
-
day: '2-digit',
|
|
6358
|
-
month: '2-digit',
|
|
6359
|
-
year: 'numeric',
|
|
6360
|
-
hour: '2-digit',
|
|
6361
|
-
minute: '2-digit',
|
|
6362
|
-
second: '2-digit',
|
|
6363
|
-
hour12: false,
|
|
6364
|
-
};
|
|
6365
|
-
let date = dom$a.ketchup.dates.toDate(dom$a.ketchup.dates.normalize(value, KupDatesNormalize.TIMESTAMP));
|
|
6366
|
-
return date.toLocaleString(dom$a.ketchup.dates.getLocale() + '-u-hc-h23', options);
|
|
6367
|
-
}
|
|
6368
|
-
function getMonthAsStringByLocale(month, format) {
|
|
6369
|
-
if (month == null) {
|
|
6370
|
-
return '';
|
|
6371
|
-
}
|
|
6372
|
-
const dateTmp = new Date();
|
|
6373
|
-
dateTmp.setDate(1);
|
|
6374
|
-
dateTmp.setMonth(month - 1);
|
|
6375
|
-
const options = {
|
|
6376
|
-
month: format,
|
|
6377
|
-
};
|
|
6378
|
-
const dateTimeFormat = new Intl.DateTimeFormat(dom$a.ketchup.dates.getLocale(), options);
|
|
6379
|
-
return dateTimeFormat.format(dateTmp);
|
|
6380
|
-
}
|
|
6381
|
-
function getMonthsAsStringByLocale(format) {
|
|
6382
|
-
if (format == null || format.trim() == '') {
|
|
6383
|
-
format = DateTimeFormatOptionsMonth.LONG;
|
|
6384
|
-
}
|
|
6385
|
-
var months = [];
|
|
6386
|
-
for (var i = 0; i < 12; i++) {
|
|
6387
|
-
months[i] = getMonthAsStringByLocale(i + 1, format);
|
|
6388
|
-
}
|
|
6389
|
-
return months;
|
|
6390
|
-
}
|
|
6391
|
-
/**
|
|
6392
|
-
* Used to retrieve component's props values.
|
|
6393
|
-
* @param {any} comp - Component calling this function.
|
|
6394
|
-
* @param {GenericObject} list - Prop list, specific for each component.
|
|
6395
|
-
* @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
|
|
6396
|
-
* @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
|
|
6397
|
-
*/
|
|
6398
|
-
function getProps(comp, list, descriptions) {
|
|
6399
|
-
let props = {};
|
|
6400
|
-
if (descriptions) {
|
|
6401
|
-
props = list;
|
|
6402
|
-
}
|
|
6403
|
-
else {
|
|
6404
|
-
for (const key in list) {
|
|
6405
|
-
if (Object.prototype.hasOwnProperty.call(list, key)) {
|
|
6406
|
-
props[key] = comp[key];
|
|
6407
|
-
}
|
|
6408
|
-
}
|
|
6409
|
-
}
|
|
6410
|
-
return props;
|
|
6411
|
-
}
|
|
6412
|
-
/**
|
|
6413
|
-
* Sets the props to the component.
|
|
6414
|
-
* @param {any} comp - Component calling this function.
|
|
6415
|
-
* @param {GenericObject} list - Prop list, specific for each component.
|
|
6416
|
-
* @param {GenericObject} props - Prop to be set.
|
|
6007
|
+
* Common use formats
|
|
6417
6008
|
*/
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
|
|
6425
|
-
// Otherwise, it will be set on its HTML element (i.e.: "id", "style", ecc.)
|
|
6426
|
-
comp.rootElement[key] = props[key];
|
|
6427
|
-
}
|
|
6428
|
-
}
|
|
6429
|
-
}
|
|
6009
|
+
var KupDatesFormats;
|
|
6010
|
+
(function (KupDatesFormats) {
|
|
6011
|
+
KupDatesFormats["ISO_DATE"] = "YYYY-MM-DD";
|
|
6012
|
+
KupDatesFormats["ISO_DATE_TIME"] = "YYYY-MM-DD HH:mm:ss";
|
|
6013
|
+
KupDatesFormats["ISO_TIME"] = "HH:mm:ss";
|
|
6014
|
+
KupDatesFormats["ISO_TIME_WITHOUT_SECONDS"] = "HH:mm";
|
|
6015
|
+
})(KupDatesFormats || (KupDatesFormats = {}));
|
|
6430
6016
|
|
|
6431
6017
|
const dom$9 = document.documentElement;
|
|
6432
6018
|
// -------------
|
|
@@ -6471,17 +6057,17 @@ function getValueForDisplay(value, obj, decimals) {
|
|
|
6471
6057
|
return value;
|
|
6472
6058
|
}
|
|
6473
6059
|
if (dom$9.ketchup.objects.isNumber(obj)) {
|
|
6474
|
-
return
|
|
6060
|
+
return dom$9.ketchup.math.numberStringToFormattedString(value, decimals ? decimals : -1, obj ? obj.p : '');
|
|
6475
6061
|
}
|
|
6476
6062
|
if (dom$9.ketchup.objects.isDate(obj) &&
|
|
6477
6063
|
dom$9.ketchup.dates.isValid(value, KupDatesFormats.ISO_DATE)) {
|
|
6478
6064
|
return dom$9.ketchup.dates.format(value);
|
|
6479
6065
|
}
|
|
6480
6066
|
if (dom$9.ketchup.objects.isTime(obj)) {
|
|
6481
|
-
return
|
|
6067
|
+
return dom$9.ketchup.dates.timeStringToFormattedString(value, dom$9.ketchup.objects.isTimeWithSeconds(obj), obj.t + obj.p);
|
|
6482
6068
|
}
|
|
6483
6069
|
if (dom$9.ketchup.objects.isTimestamp(obj)) {
|
|
6484
|
-
return
|
|
6070
|
+
return dom$9.ketchup.dates.timestampStringToFormattedString(value);
|
|
6485
6071
|
}
|
|
6486
6072
|
return value;
|
|
6487
6073
|
}
|
|
@@ -6526,8 +6112,8 @@ function compareValues(obj1, value1, obj2, value2, sortMode) {
|
|
|
6526
6112
|
let v1 = s1;
|
|
6527
6113
|
let v2 = s2;
|
|
6528
6114
|
if (dom$9.ketchup.objects.isNumber(obj1)) {
|
|
6529
|
-
v1 =
|
|
6530
|
-
v2 =
|
|
6115
|
+
v1 = dom$9.ketchup.math.numberifySafe(s1);
|
|
6116
|
+
v2 = dom$9.ketchup.math.numberifySafe(s2);
|
|
6531
6117
|
}
|
|
6532
6118
|
else if (dom$9.ketchup.objects.isDate(obj1)) {
|
|
6533
6119
|
v1 = dom$9.ketchup.dates.toDate(dom$9.ketchup.dates.format(s1, KupDatesFormats.ISO_DATE));
|
|
@@ -6660,8 +6246,8 @@ class Filters {
|
|
|
6660
6246
|
: KupDatesFormats.ISO_TIME_WITHOUT_SECONDS)) {
|
|
6661
6247
|
return newValue;
|
|
6662
6248
|
}
|
|
6663
|
-
if (isValidFormattedStringTime(value, manageSeconds)) {
|
|
6664
|
-
return
|
|
6249
|
+
if (dom$8.ketchup.dates.isValidFormattedStringTime(value, manageSeconds)) {
|
|
6250
|
+
return dom$8.ketchup.dates.formattedStringToCustomDateTime(value, manageSeconds
|
|
6665
6251
|
? KupDatesFormats.ISO_TIME
|
|
6666
6252
|
: KupDatesFormats.ISO_TIME_WITHOUT_SECONDS, manageSeconds);
|
|
6667
6253
|
}
|
|
@@ -6670,13 +6256,13 @@ class Filters {
|
|
|
6670
6256
|
if (dom$8.ketchup.dates.isValid(value, KupDatesFormats.ISO_DATE_TIME)) {
|
|
6671
6257
|
return newValue;
|
|
6672
6258
|
}
|
|
6673
|
-
if (isValidFormattedStringTime(value, true)) {
|
|
6674
|
-
return
|
|
6259
|
+
if (dom$8.ketchup.dates.isValidFormattedStringTime(value, true)) {
|
|
6260
|
+
return dom$8.ketchup.dates.formattedStringToTimestampString(value);
|
|
6675
6261
|
}
|
|
6676
6262
|
}
|
|
6677
6263
|
else if (dom$8.ketchup.objects.isNumber(smeupObj)) {
|
|
6678
|
-
if (
|
|
6679
|
-
return
|
|
6264
|
+
if (dom$8.ketchup.math.isStringNumber(value, smeupObj ? smeupObj.p : '')) {
|
|
6265
|
+
return dom$8.ketchup.math.formattedStringToNumberString(value, smeupObj ? smeupObj.p : '');
|
|
6680
6266
|
}
|
|
6681
6267
|
}
|
|
6682
6268
|
return newValue;
|
|
@@ -6798,12 +6384,11 @@ class Filters {
|
|
|
6798
6384
|
}
|
|
6799
6385
|
let checkByRegularExpression = true;
|
|
6800
6386
|
if (dom$8.ketchup.objects.isNumber(obj)) {
|
|
6801
|
-
|
|
6802
|
-
let valueNumber = stringToNumber(value);
|
|
6387
|
+
let valueNumber = dom$8.ketchup.math.numberifySafe(value, obj ? obj.p : '');
|
|
6803
6388
|
if (from != '') {
|
|
6804
|
-
if (isNumber(from)) {
|
|
6389
|
+
if (dom$8.ketchup.math.isNumber(from)) {
|
|
6805
6390
|
checkByRegularExpression = false;
|
|
6806
|
-
let fromNumber =
|
|
6391
|
+
let fromNumber = dom$8.ketchup.math.numberifySafe(from);
|
|
6807
6392
|
if (valueNumber < fromNumber) {
|
|
6808
6393
|
return false;
|
|
6809
6394
|
}
|
|
@@ -6813,9 +6398,9 @@ class Filters {
|
|
|
6813
6398
|
}
|
|
6814
6399
|
}
|
|
6815
6400
|
if (to != '') {
|
|
6816
|
-
if (isNumber(to)) {
|
|
6401
|
+
if (dom$8.ketchup.math.isNumber(to)) {
|
|
6817
6402
|
checkByRegularExpression = false;
|
|
6818
|
-
let toNumber =
|
|
6403
|
+
let toNumber = dom$8.ketchup.math.numberifySafe(to);
|
|
6819
6404
|
if (valueNumber > toNumber) {
|
|
6820
6405
|
return false;
|
|
6821
6406
|
}
|
|
@@ -7840,9 +7425,11 @@ class KupData {
|
|
|
7840
7425
|
}
|
|
7841
7426
|
else {
|
|
7842
7427
|
n = dom$4.ketchup.math.numberify(cell.value);
|
|
7428
|
+
const nMax = dom$4.ketchup.math.numberify(max);
|
|
7429
|
+
const nMin = dom$4.ketchup.math.numberify(min);
|
|
7843
7430
|
if (n === max ||
|
|
7844
7431
|
n === min ||
|
|
7845
|
-
(n <
|
|
7432
|
+
(n < nMax && n > nMin)) {
|
|
7846
7433
|
result.cells.push(cell);
|
|
7847
7434
|
result.rows.push(row);
|
|
7848
7435
|
}
|
|
@@ -8232,6 +7819,59 @@ class KupDates {
|
|
|
8232
7819
|
.filter((value) => typeof value === 'string');
|
|
8233
7820
|
return items;
|
|
8234
7821
|
}
|
|
7822
|
+
/**
|
|
7823
|
+
* Gets date format by browser locale
|
|
7824
|
+
* @returns {string} date format pattern, by browser locale
|
|
7825
|
+
*/
|
|
7826
|
+
getDateFormat() {
|
|
7827
|
+
const formatObj = new Intl.DateTimeFormat(this.getLocale()).formatToParts(new Date());
|
|
7828
|
+
let dateFormat = formatObj
|
|
7829
|
+
.map((obj) => {
|
|
7830
|
+
switch (obj.type) {
|
|
7831
|
+
case 'day':
|
|
7832
|
+
return 'DD';
|
|
7833
|
+
case 'month':
|
|
7834
|
+
return 'MM';
|
|
7835
|
+
case 'year':
|
|
7836
|
+
return 'YYYY';
|
|
7837
|
+
default:
|
|
7838
|
+
return obj.value;
|
|
7839
|
+
}
|
|
7840
|
+
})
|
|
7841
|
+
.join('');
|
|
7842
|
+
return dateFormat;
|
|
7843
|
+
}
|
|
7844
|
+
/**
|
|
7845
|
+
* Gets time format by browser locale
|
|
7846
|
+
* @param {boolean} manageSeconds flag to set seconds managing
|
|
7847
|
+
* @returns {string} time format pattern, by browser locale
|
|
7848
|
+
*/
|
|
7849
|
+
getTimeFormat(manageSeconds) {
|
|
7850
|
+
const options = {
|
|
7851
|
+
hour: '2-digit',
|
|
7852
|
+
minute: '2-digit',
|
|
7853
|
+
hour12: false,
|
|
7854
|
+
};
|
|
7855
|
+
if (manageSeconds == true) {
|
|
7856
|
+
options.second = '2-digit';
|
|
7857
|
+
}
|
|
7858
|
+
const formatObj = new Intl.DateTimeFormat(this.getLocale() + '-u-hc-h23', options).formatToParts(new Date());
|
|
7859
|
+
let timeFormat = formatObj
|
|
7860
|
+
.map((obj) => {
|
|
7861
|
+
switch (obj.type) {
|
|
7862
|
+
case 'hour':
|
|
7863
|
+
return 'HH';
|
|
7864
|
+
case 'minute':
|
|
7865
|
+
return 'mm';
|
|
7866
|
+
case 'second':
|
|
7867
|
+
return 'ss';
|
|
7868
|
+
default:
|
|
7869
|
+
return obj.value;
|
|
7870
|
+
}
|
|
7871
|
+
})
|
|
7872
|
+
.join('');
|
|
7873
|
+
return timeFormat;
|
|
7874
|
+
}
|
|
8235
7875
|
/**
|
|
8236
7876
|
* Formats the given date.
|
|
8237
7877
|
* @param {dayjs.ConfigType} input - Date to be formatted.
|
|
@@ -8244,6 +7884,23 @@ class KupDates {
|
|
|
8244
7884
|
}
|
|
8245
7885
|
return dayjs_min(input).format(format);
|
|
8246
7886
|
}
|
|
7887
|
+
/**
|
|
7888
|
+
* Gets the time formatted
|
|
7889
|
+
* @param {Date} time time as Date object
|
|
7890
|
+
* @param {boolean} manageSeconds flag to set seconds managing
|
|
7891
|
+
* @return {string} time as string, formatted
|
|
7892
|
+
**/
|
|
7893
|
+
formatTime(time, manageSeconds) {
|
|
7894
|
+
const options = {
|
|
7895
|
+
hour: '2-digit',
|
|
7896
|
+
minute: '2-digit',
|
|
7897
|
+
hour12: false,
|
|
7898
|
+
};
|
|
7899
|
+
if (manageSeconds == true) {
|
|
7900
|
+
options.second = '2-digit';
|
|
7901
|
+
}
|
|
7902
|
+
return time.toLocaleTimeString(this.getLocale() + '-u-hc-h23', options);
|
|
7903
|
+
}
|
|
8247
7904
|
/**
|
|
8248
7905
|
* Validates the given date.
|
|
8249
7906
|
* @param {dayjs.ConfigType} date - Date to be validated.
|
|
@@ -8259,6 +7916,16 @@ class KupDates {
|
|
|
8259
7916
|
return dayjs_min(date, undefined, strict).isValid();
|
|
8260
7917
|
}
|
|
8261
7918
|
}
|
|
7919
|
+
/**
|
|
7920
|
+
* Validates the given date as string.
|
|
7921
|
+
* @param {string} value time string, formatted by actual browser locale
|
|
7922
|
+
* @param {boolean} manageSeconds if manage seconds
|
|
7923
|
+
* @returns {boolean} true if time string in input is a valid time
|
|
7924
|
+
*/
|
|
7925
|
+
isValidFormattedStringTime(value, manageSeconds) {
|
|
7926
|
+
let format = this.getTimeFormat(manageSeconds);
|
|
7927
|
+
return this.isValid(value, format, true);
|
|
7928
|
+
}
|
|
8262
7929
|
/**
|
|
8263
7930
|
* Converts the input in a Date object.
|
|
8264
7931
|
* @param {dayjs.ConfigType} input - Input date.
|
|
@@ -8467,6 +8134,237 @@ class KupDates {
|
|
|
8467
8134
|
subtract(input, value, unit) {
|
|
8468
8135
|
return dayjs_min(input).subtract(value, unit);
|
|
8469
8136
|
}
|
|
8137
|
+
/**
|
|
8138
|
+
* Gets the month formatted
|
|
8139
|
+
* @param {number} month month id
|
|
8140
|
+
* @param {KupDateTimeFormatOptionsMonth} format format
|
|
8141
|
+
* @returns {string} the month formatted, by browser locale
|
|
8142
|
+
*/
|
|
8143
|
+
getMonthAsString(month, format) {
|
|
8144
|
+
if (month == null) {
|
|
8145
|
+
return '';
|
|
8146
|
+
}
|
|
8147
|
+
const dateTmp = new Date();
|
|
8148
|
+
dateTmp.setDate(1);
|
|
8149
|
+
dateTmp.setMonth(month - 1);
|
|
8150
|
+
const options = {
|
|
8151
|
+
month: format,
|
|
8152
|
+
};
|
|
8153
|
+
const dateTimeFormat = new Intl.DateTimeFormat(this.getLocale(), options);
|
|
8154
|
+
return dateTimeFormat.format(dateTmp);
|
|
8155
|
+
}
|
|
8156
|
+
/**
|
|
8157
|
+
* Gets the year months formatted
|
|
8158
|
+
* @param {KupDateTimeFormatOptionsMonth} format format
|
|
8159
|
+
* @returns {string[]} the months formatted, by browser locale
|
|
8160
|
+
*/
|
|
8161
|
+
getMonthsAsString(format) {
|
|
8162
|
+
if (format == null || format.trim() == '') {
|
|
8163
|
+
format = KupDateTimeFormatOptionsMonth.LONG;
|
|
8164
|
+
}
|
|
8165
|
+
var months = [];
|
|
8166
|
+
for (var i = 0; i < 12; i++) {
|
|
8167
|
+
months[i] = this.getMonthAsString(i + 1, format);
|
|
8168
|
+
}
|
|
8169
|
+
return months;
|
|
8170
|
+
}
|
|
8171
|
+
/**
|
|
8172
|
+
* Gets the day formatted
|
|
8173
|
+
* @param {Date} date date
|
|
8174
|
+
* @returns {string} the day formatted, by browser locale
|
|
8175
|
+
*/
|
|
8176
|
+
getDayAsString(date) {
|
|
8177
|
+
if (date == null) {
|
|
8178
|
+
return '';
|
|
8179
|
+
}
|
|
8180
|
+
const options = {
|
|
8181
|
+
weekday: 'narrow',
|
|
8182
|
+
/** weekday: 'narrow' 'short' 'long' */
|
|
8183
|
+
};
|
|
8184
|
+
const dateTimeFormat = new Intl.DateTimeFormat(this.getLocale(), options);
|
|
8185
|
+
return dateTimeFormat.format(date);
|
|
8186
|
+
}
|
|
8187
|
+
/**
|
|
8188
|
+
* First day of current week
|
|
8189
|
+
* @param {number} firstDayIndex first day of week index
|
|
8190
|
+
* @returns {Date} the first day of current week
|
|
8191
|
+
*/
|
|
8192
|
+
firstDayThisWeek(firstDayIndex) {
|
|
8193
|
+
var d = new Date();
|
|
8194
|
+
const day = d.getDay();
|
|
8195
|
+
// dayIndex0
|
|
8196
|
+
d.setDate(d.getDate() - day);
|
|
8197
|
+
// dayIndexX
|
|
8198
|
+
d.setDate(d.getDate() + firstDayIndex);
|
|
8199
|
+
return d;
|
|
8200
|
+
}
|
|
8201
|
+
/**
|
|
8202
|
+
* Dates of current week
|
|
8203
|
+
* @param {number} firstDayIndex first day of week index
|
|
8204
|
+
* @returns { startDate: Date; endDate: Date } the dates of current week
|
|
8205
|
+
*/
|
|
8206
|
+
thisWeek(firstDayIndex) {
|
|
8207
|
+
const firstDay = this.firstDayThisWeek(firstDayIndex);
|
|
8208
|
+
return {
|
|
8209
|
+
startDate: firstDay,
|
|
8210
|
+
endDate: offsetDate(firstDay, 6),
|
|
8211
|
+
};
|
|
8212
|
+
function offsetDate(base, count) {
|
|
8213
|
+
const date = new Date(base);
|
|
8214
|
+
date.setDate(base.getDate() + count);
|
|
8215
|
+
return date;
|
|
8216
|
+
}
|
|
8217
|
+
}
|
|
8218
|
+
/**
|
|
8219
|
+
* Gets the days of current week as string
|
|
8220
|
+
* @param {number} firstDayIndex first day of week index
|
|
8221
|
+
* @returns {string[]} the days of current week as string
|
|
8222
|
+
*/
|
|
8223
|
+
getDaysOfWeekAsString(firstDayIndex) {
|
|
8224
|
+
var thisWeekDays = this.thisWeek(firstDayIndex);
|
|
8225
|
+
var monday = thisWeekDays.startDate;
|
|
8226
|
+
var days = [];
|
|
8227
|
+
for (var i = 0; i < 7; i++) {
|
|
8228
|
+
var date = new Date(monday.toISOString());
|
|
8229
|
+
date.setDate(date.getDate() + i);
|
|
8230
|
+
days[i] = this.getDayAsString(date);
|
|
8231
|
+
}
|
|
8232
|
+
return days;
|
|
8233
|
+
}
|
|
8234
|
+
/**
|
|
8235
|
+
* Gets the timestamp formatted
|
|
8236
|
+
* @param {string} value date/time as string, formatted ISO
|
|
8237
|
+
* @returns {string} date/time as string, formatted by actual browser locale
|
|
8238
|
+
**/
|
|
8239
|
+
timestampStringToFormattedString(value) {
|
|
8240
|
+
const options = {
|
|
8241
|
+
day: '2-digit',
|
|
8242
|
+
month: '2-digit',
|
|
8243
|
+
year: 'numeric',
|
|
8244
|
+
hour: '2-digit',
|
|
8245
|
+
minute: '2-digit',
|
|
8246
|
+
second: '2-digit',
|
|
8247
|
+
hour12: false,
|
|
8248
|
+
};
|
|
8249
|
+
let date = this.toDate(this.normalize(value, KupDatesNormalize.TIMESTAMP));
|
|
8250
|
+
return date.toLocaleString(this.getLocale() + '-u-hc-h23', options);
|
|
8251
|
+
}
|
|
8252
|
+
/**
|
|
8253
|
+
* Gets ISO date/time from formatted string, as string
|
|
8254
|
+
* @param {string} value date/time as string, formatted by actual browser locale
|
|
8255
|
+
* @returns {string} date/time as string, formatted ISO
|
|
8256
|
+
**/
|
|
8257
|
+
formattedStringToTimestampString(value) {
|
|
8258
|
+
return this.formattedStringToCustomDateTime(value, KupDatesFormats.ISO_DATE_TIME, true);
|
|
8259
|
+
}
|
|
8260
|
+
/**
|
|
8261
|
+
* Gets formatted dateTime as customed ISO (see KupDatesFormats)
|
|
8262
|
+
* @param {string} value time as string, formatted by actual browser locale
|
|
8263
|
+
* @param {string} outputFormat time format to return (see KupDatesFormats)
|
|
8264
|
+
* @param {boolean} manageSeconds flag to set seconds managing
|
|
8265
|
+
* @returns {string} time as string, formatted
|
|
8266
|
+
**/
|
|
8267
|
+
formattedStringToCustomDateTime(value, outputFormat, manageSeconds) {
|
|
8268
|
+
let inputFormat = this.getTimeFormat(manageSeconds);
|
|
8269
|
+
if (this.isValid(value, inputFormat)) {
|
|
8270
|
+
return this.format(this.normalize(value, KupDatesNormalize.TIME), outputFormat);
|
|
8271
|
+
}
|
|
8272
|
+
else {
|
|
8273
|
+
return '';
|
|
8274
|
+
}
|
|
8275
|
+
}
|
|
8276
|
+
/**
|
|
8277
|
+
* Gets the time formatted
|
|
8278
|
+
* @param {string} value time as string, formatted ISO
|
|
8279
|
+
* @param {boolean} manageSeconds flag to set seconds managing
|
|
8280
|
+
* @param {string} customedFormat time format from smeupObject
|
|
8281
|
+
* @returns {string} time as string, formatted by actual browser locale
|
|
8282
|
+
**/
|
|
8283
|
+
timeStringToFormattedString(value, manageSeconds, customedFormat) {
|
|
8284
|
+
const options = {
|
|
8285
|
+
hour: '2-digit',
|
|
8286
|
+
minute: '2-digit',
|
|
8287
|
+
hour12: false,
|
|
8288
|
+
};
|
|
8289
|
+
if (manageSeconds == true) {
|
|
8290
|
+
options.second = '2-digit';
|
|
8291
|
+
}
|
|
8292
|
+
let date = this.toDate(this.normalize(value, KupDatesNormalize.TIME));
|
|
8293
|
+
return formatByCustomedOutputTimeFormat(value, date, options, customedFormat, this);
|
|
8294
|
+
function formatByCustomedOutputTimeFormat(valueStr, date, options, customedFormat, kupDates) {
|
|
8295
|
+
if (customedFormat == null) {
|
|
8296
|
+
return date.toLocaleTimeString(kupDates.getLocale() + '-u-hc-h23', options);
|
|
8297
|
+
}
|
|
8298
|
+
switch (customedFormat) {
|
|
8299
|
+
case 'I13': {
|
|
8300
|
+
//hh:mm
|
|
8301
|
+
break;
|
|
8302
|
+
}
|
|
8303
|
+
case 'I12': {
|
|
8304
|
+
//hh:mm:ss
|
|
8305
|
+
break;
|
|
8306
|
+
}
|
|
8307
|
+
case 'I11': {
|
|
8308
|
+
//???
|
|
8309
|
+
//hh:dddd
|
|
8310
|
+
//return moment(date).format('HH:DDDD');
|
|
8311
|
+
return valueStr;
|
|
8312
|
+
}
|
|
8313
|
+
case 'I14': {
|
|
8314
|
+
//???
|
|
8315
|
+
//sssss
|
|
8316
|
+
//return moment(date).format('SSSSS');
|
|
8317
|
+
return valueStr;
|
|
8318
|
+
}
|
|
8319
|
+
case 'I1H': {
|
|
8320
|
+
//???
|
|
8321
|
+
//Ora,Cen/Min HH,xx
|
|
8322
|
+
return valueStr;
|
|
8323
|
+
}
|
|
8324
|
+
case 'I1M': {
|
|
8325
|
+
//???
|
|
8326
|
+
//Min,Cen/Sec MMMM,xx
|
|
8327
|
+
return valueStr;
|
|
8328
|
+
}
|
|
8329
|
+
case 'I21': {
|
|
8330
|
+
//???
|
|
8331
|
+
//Giorni,(4 decim)
|
|
8332
|
+
return valueStr;
|
|
8333
|
+
}
|
|
8334
|
+
case 'I22': {
|
|
8335
|
+
//???
|
|
8336
|
+
//Ore,(4 decim)
|
|
8337
|
+
return valueStr;
|
|
8338
|
+
}
|
|
8339
|
+
case 'I23': {
|
|
8340
|
+
//???
|
|
8341
|
+
//Minuti,(4 decim)
|
|
8342
|
+
return valueStr;
|
|
8343
|
+
}
|
|
8344
|
+
case 'I24': {
|
|
8345
|
+
//???
|
|
8346
|
+
//Secondi
|
|
8347
|
+
return valueStr;
|
|
8348
|
+
}
|
|
8349
|
+
case 'I2H': {
|
|
8350
|
+
//???
|
|
8351
|
+
//Ora,Cen/Min HHHH,xx
|
|
8352
|
+
return valueStr;
|
|
8353
|
+
}
|
|
8354
|
+
case 'I2D': {
|
|
8355
|
+
//???
|
|
8356
|
+
//Ore Minuti Secondi HHMMS
|
|
8357
|
+
return valueStr;
|
|
8358
|
+
}
|
|
8359
|
+
case 'I2M': {
|
|
8360
|
+
//???
|
|
8361
|
+
//Min,Cen/Sec MMMM,xx
|
|
8362
|
+
return valueStr;
|
|
8363
|
+
}
|
|
8364
|
+
}
|
|
8365
|
+
return date.toLocaleTimeString(kupDates.getLocale() + '-u-hc-h23', options);
|
|
8366
|
+
}
|
|
8367
|
+
}
|
|
8470
8368
|
/**
|
|
8471
8369
|
* Registers a KupComponent in KupDates, in order to be properly handled whenever the locale changes.
|
|
8472
8370
|
* @param {any} component - The Ketchup component to be registered.
|
|
@@ -9831,6 +9729,86 @@ function normalDistributionFormula(average, variance, x) {
|
|
|
9831
9729
|
Math.exp(-Math.pow(x - average, 2) / (2 * variance)));
|
|
9832
9730
|
}
|
|
9833
9731
|
|
|
9732
|
+
function identify(array) {
|
|
9733
|
+
if (array) {
|
|
9734
|
+
for (let i = 0; i < array.length; i++) {
|
|
9735
|
+
array[i].id = i.toString();
|
|
9736
|
+
}
|
|
9737
|
+
}
|
|
9738
|
+
}
|
|
9739
|
+
/**
|
|
9740
|
+
* Fills a string with another string, eventually before
|
|
9741
|
+
* @param {string} stringIn initial string
|
|
9742
|
+
* @param {string} stringForFill string used for fill
|
|
9743
|
+
* @param {number} finalLen final string length
|
|
9744
|
+
* @param {boolean} addBefore flag for fill on left
|
|
9745
|
+
* @returns the input string filled with stringForFill
|
|
9746
|
+
*/
|
|
9747
|
+
function fillString(stringIn, stringForFill, finalLen, addBefore) {
|
|
9748
|
+
let initSize = stringIn.length;
|
|
9749
|
+
let stringOut = '';
|
|
9750
|
+
for (let i = initSize; i < finalLen; i += stringForFill.length) {
|
|
9751
|
+
stringOut += stringForFill;
|
|
9752
|
+
}
|
|
9753
|
+
if (addBefore) {
|
|
9754
|
+
return stringOut + stringIn;
|
|
9755
|
+
}
|
|
9756
|
+
else {
|
|
9757
|
+
return stringIn + stringOut;
|
|
9758
|
+
}
|
|
9759
|
+
}
|
|
9760
|
+
/**
|
|
9761
|
+
* Used to retrieve component's props values.
|
|
9762
|
+
* @param {any} comp - Component calling this function.
|
|
9763
|
+
* @param {GenericObject} list - Prop list, specific for each component.
|
|
9764
|
+
* @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
|
|
9765
|
+
* @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
|
|
9766
|
+
*/
|
|
9767
|
+
function getProps(comp, list, descriptions) {
|
|
9768
|
+
let props = {};
|
|
9769
|
+
if (descriptions) {
|
|
9770
|
+
props = list;
|
|
9771
|
+
}
|
|
9772
|
+
else {
|
|
9773
|
+
for (const key in list) {
|
|
9774
|
+
if (Object.prototype.hasOwnProperty.call(list, key)) {
|
|
9775
|
+
props[key] = comp[key];
|
|
9776
|
+
}
|
|
9777
|
+
}
|
|
9778
|
+
}
|
|
9779
|
+
return props;
|
|
9780
|
+
}
|
|
9781
|
+
/**
|
|
9782
|
+
* Sets the props to the component.
|
|
9783
|
+
* @param {any} comp - Component calling this function.
|
|
9784
|
+
* @param {GenericObject} list - Prop list, specific for each component.
|
|
9785
|
+
* @param {GenericObject} props - Prop to be set.
|
|
9786
|
+
*/
|
|
9787
|
+
function setProps(comp, list, props) {
|
|
9788
|
+
for (const key in props) {
|
|
9789
|
+
// If key is a custom prop it will be set on the component (i.e.: "data", "customStyle", ecc.)
|
|
9790
|
+
if (list[key]) {
|
|
9791
|
+
comp[key] = props[key];
|
|
9792
|
+
}
|
|
9793
|
+
else {
|
|
9794
|
+
// Otherwise, it will be set on its HTML element (i.e.: "id", "style", ecc.)
|
|
9795
|
+
comp.rootElement[key] = props[key];
|
|
9796
|
+
}
|
|
9797
|
+
}
|
|
9798
|
+
}
|
|
9799
|
+
/**
|
|
9800
|
+
* Creates a regular expression object, from a string un-escaped
|
|
9801
|
+
* @param s string to use for create regular expression (not escaped)
|
|
9802
|
+
* @param flags flags used for the regular expression
|
|
9803
|
+
* @returns the regular expression object
|
|
9804
|
+
*/
|
|
9805
|
+
function getRegExpFromString(s, flags) {
|
|
9806
|
+
return new RegExp(escapeRegExp(s), flags);
|
|
9807
|
+
}
|
|
9808
|
+
function escapeRegExp(s) {
|
|
9809
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
|
|
9810
|
+
}
|
|
9811
|
+
|
|
9834
9812
|
const dom$2 = document.documentElement;
|
|
9835
9813
|
/**
|
|
9836
9814
|
* Handles mathematical operations and number formatting/conversion.
|
|
@@ -9854,7 +9832,7 @@ class KupMath {
|
|
|
9854
9832
|
const maximumFractionDigits = 14;
|
|
9855
9833
|
if (value == null || value == '')
|
|
9856
9834
|
return value;
|
|
9857
|
-
return Number(value).toLocaleString(
|
|
9835
|
+
return Number(value).toLocaleString(this.locale, {
|
|
9858
9836
|
maximumFractionDigits: maximumFractionDigits,
|
|
9859
9837
|
});
|
|
9860
9838
|
},
|
|
@@ -9925,10 +9903,11 @@ class KupMath {
|
|
|
9925
9903
|
* Formats the input number with the specified format of the currently set locale.
|
|
9926
9904
|
* @param {string | String | number} input - Input number which will be automatically "numberified".
|
|
9927
9905
|
* @param {string} format - Desired format. Defaults to '0,0.00' (i.e.: 2,000,000.51).
|
|
9906
|
+
* @param {boolean} inputIsLocalized Numberifies assuming the input string is in the current KupMath locale's format.
|
|
9928
9907
|
* @returns {string} Formatted number.
|
|
9929
9908
|
*/
|
|
9930
|
-
format(input, format) {
|
|
9931
|
-
const n = this.numberify(input);
|
|
9909
|
+
format(input, format, inputIsLocalized) {
|
|
9910
|
+
const n = this.numberify(input, inputIsLocalized);
|
|
9932
9911
|
if (!format) {
|
|
9933
9912
|
const positiveN = Math.abs(n);
|
|
9934
9913
|
const decimals = positiveN - Math.floor(positiveN);
|
|
@@ -9939,16 +9918,111 @@ class KupMath {
|
|
|
9939
9918
|
format = '0,0';
|
|
9940
9919
|
}
|
|
9941
9920
|
}
|
|
9942
|
-
|
|
9943
|
-
|
|
9921
|
+
return this.numeral(n).format(format);
|
|
9922
|
+
}
|
|
9923
|
+
/**
|
|
9924
|
+
* Create the pattern string for format a number
|
|
9925
|
+
* @param {boolean} thousandPoint - show thousandPoint
|
|
9926
|
+
* @param {number} decimals - number of decimals
|
|
9927
|
+
* @returns {string} - formatter pattern
|
|
9928
|
+
*/
|
|
9929
|
+
createFormatPattern(thousandPoint, decimals) {
|
|
9930
|
+
var format = '0';
|
|
9931
|
+
if (thousandPoint) {
|
|
9932
|
+
format += ',0';
|
|
9933
|
+
}
|
|
9934
|
+
if (decimals && decimals > 0) {
|
|
9935
|
+
format += '.';
|
|
9936
|
+
for (let i = 0; i < decimals; i++) {
|
|
9937
|
+
format += '0';
|
|
9938
|
+
}
|
|
9939
|
+
}
|
|
9940
|
+
return format;
|
|
9941
|
+
}
|
|
9942
|
+
/**
|
|
9943
|
+
* Returns the decimal separator of current browser
|
|
9944
|
+
* @returns {string} current decimal separator, by locale
|
|
9945
|
+
*/
|
|
9946
|
+
decimalSeparator() {
|
|
9947
|
+
const numberWithGroupAndDecimalSeparator = 1000.1;
|
|
9948
|
+
return Intl.NumberFormat(this.locale)
|
|
9949
|
+
.formatToParts(numberWithGroupAndDecimalSeparator)
|
|
9950
|
+
.find((part) => part.type === 'decimal').value;
|
|
9951
|
+
}
|
|
9952
|
+
/**
|
|
9953
|
+
* Returns the group separator of current browser
|
|
9954
|
+
* @returns {string} current group separator, by locale
|
|
9955
|
+
*/
|
|
9956
|
+
groupSeparator() {
|
|
9957
|
+
const numberWithGroupAndDecimalSeparator = 1000.1;
|
|
9958
|
+
return Intl.NumberFormat(this.locale)
|
|
9959
|
+
.formatToParts(numberWithGroupAndDecimalSeparator)
|
|
9960
|
+
.find((part) => part.type === 'group').value;
|
|
9961
|
+
}
|
|
9962
|
+
/**
|
|
9963
|
+
* Checks if an input string matches options, for desired formatted decimal number (integer digits, decimal digits)
|
|
9964
|
+
* @param {string} value the input value to check
|
|
9965
|
+
* @param {NumericFieldFormatOptions} options options for customize the check
|
|
9966
|
+
* @returns {RegExpMatchArray} an object from applying the regular expression for check
|
|
9967
|
+
*/
|
|
9968
|
+
matchNumericValueWithOptions(value, options) {
|
|
9969
|
+
value = value.replace(getRegExpFromString(this.groupSeparator(), 'g'), '');
|
|
9970
|
+
// see https://github.com/24eme/jquery-input-number-format.git
|
|
9971
|
+
let found = undefined;
|
|
9972
|
+
let integerPartSuffix = '+';
|
|
9973
|
+
if (options.integer && options.integer > 0) {
|
|
9974
|
+
integerPartSuffix = '{0,' + options.integer + '}';
|
|
9975
|
+
}
|
|
9976
|
+
let regexp = '^[0-9]' + integerPartSuffix;
|
|
9977
|
+
if (options.allowNegative) {
|
|
9978
|
+
regexp = '^-{0,1}[0-9]' + integerPartSuffix;
|
|
9979
|
+
}
|
|
9980
|
+
if (options.decimal && options.decimal > 0) {
|
|
9981
|
+
regexp +=
|
|
9982
|
+
'([' +
|
|
9983
|
+
this.decimalSeparator() +
|
|
9984
|
+
'][0-9]{0,' +
|
|
9985
|
+
options.decimal +
|
|
9986
|
+
'})?';
|
|
9987
|
+
let regexpObj = new RegExp(regexp + '$');
|
|
9988
|
+
found = value.match(regexpObj);
|
|
9989
|
+
if (!found) {
|
|
9990
|
+
regexp =
|
|
9991
|
+
'^[' +
|
|
9992
|
+
this.decimalSeparator() +
|
|
9993
|
+
'][0-9]{0,' +
|
|
9994
|
+
options.decimal +
|
|
9995
|
+
'}';
|
|
9996
|
+
regexpObj = new RegExp(regexp + '$');
|
|
9997
|
+
found = value.match(regexpObj);
|
|
9998
|
+
}
|
|
9999
|
+
}
|
|
10000
|
+
else {
|
|
10001
|
+
let regexpObj = new RegExp(regexp + '$');
|
|
10002
|
+
found = value.match(regexpObj);
|
|
10003
|
+
}
|
|
10004
|
+
return found;
|
|
9944
10005
|
}
|
|
9945
10006
|
/**
|
|
9946
10007
|
* Returns a number from a non-specified input type between string, number, or String.
|
|
9947
10008
|
* @param {string | String | number} input - Input value to numberify.
|
|
9948
10009
|
* @param {boolean} inputIsLocalized - Numberifies assuming the input string is in the current KupMath locale's format.
|
|
10010
|
+
* @param {string} type - type of number for calculate suffix
|
|
9949
10011
|
* @returns {number} Resulting number or NaN (when not a number).
|
|
9950
10012
|
*/
|
|
9951
|
-
numberify(input, inputIsLocalized) {
|
|
10013
|
+
numberify(input, inputIsLocalized, type) {
|
|
10014
|
+
if (typeof input != 'number') {
|
|
10015
|
+
if (type) {
|
|
10016
|
+
let suffix = this.getNumericValueSuffix(type);
|
|
10017
|
+
if (suffix != '') {
|
|
10018
|
+
input = input.replace(getRegExpFromString(suffix, 'g'), '');
|
|
10019
|
+
}
|
|
10020
|
+
}
|
|
10021
|
+
const groupSeparator = inputIsLocalized
|
|
10022
|
+
? this.groupSeparator()
|
|
10023
|
+
: ',';
|
|
10024
|
+
input = input.replace(getRegExpFromString(groupSeparator, 'g'), '');
|
|
10025
|
+
}
|
|
9952
10026
|
let n = NaN;
|
|
9953
10027
|
if (inputIsLocalized) {
|
|
9954
10028
|
n = this.numeral(input).value();
|
|
@@ -9964,6 +10038,161 @@ class KupMath {
|
|
|
9964
10038
|
}
|
|
9965
10039
|
return n;
|
|
9966
10040
|
}
|
|
10041
|
+
/**
|
|
10042
|
+
* Returns a number from a non-specified input type between string, number, or String.
|
|
10043
|
+
* If value in is null, undefined or blank, returns 0
|
|
10044
|
+
* @param {string} input number as string, formatted by locale US, decimal separator . (like java decimal numbers)
|
|
10045
|
+
* @param {boolean} inputIsLocalized - Numberifies assuming the input string is in the current KupMath locale's format.
|
|
10046
|
+
* @param {string} type - type of number for calculate suffix
|
|
10047
|
+
* @returns {number} Resulting number
|
|
10048
|
+
**/
|
|
10049
|
+
numberifySafe(input, inputIsLocalized, type) {
|
|
10050
|
+
if (!input || input == null || input.trim() == '') {
|
|
10051
|
+
input = '0';
|
|
10052
|
+
}
|
|
10053
|
+
return this.numberify(input, inputIsLocalized, type);
|
|
10054
|
+
}
|
|
10055
|
+
/**
|
|
10056
|
+
* Checks if input is a valid number
|
|
10057
|
+
* @param {any} value input value to check
|
|
10058
|
+
* @returns {boolean} if input value is valid number
|
|
10059
|
+
*/
|
|
10060
|
+
isNumber(value) {
|
|
10061
|
+
//return typeof value === 'number';
|
|
10062
|
+
return !isNaN(value);
|
|
10063
|
+
}
|
|
10064
|
+
/**
|
|
10065
|
+
* Checks if string in input is a valid formatted number
|
|
10066
|
+
* @param {string} value number as string, formatted by actual browser locale
|
|
10067
|
+
* @param {string} type - type of number for calculate suffix
|
|
10068
|
+
* @returns {boolean} true if number string in input is a valid number
|
|
10069
|
+
*/
|
|
10070
|
+
isStringNumber(value, type) {
|
|
10071
|
+
if (value == null || value.trim() == '') {
|
|
10072
|
+
return false;
|
|
10073
|
+
}
|
|
10074
|
+
let tmpStr = this.formattedStringToNumberString(value, type);
|
|
10075
|
+
if (this.isNumber(tmpStr)) {
|
|
10076
|
+
return true;
|
|
10077
|
+
}
|
|
10078
|
+
return false;
|
|
10079
|
+
}
|
|
10080
|
+
/**
|
|
10081
|
+
* Gets number as string, formatted by locale US, decimal separator . (like java decimal numbers)
|
|
10082
|
+
* @param {string} input number as string, formatted by actual browser locale (maybe)
|
|
10083
|
+
* @param {string} type - type of number for calculate suffix
|
|
10084
|
+
* @param {string} decSeparator - decimal serparator of input string
|
|
10085
|
+
* @returns {string} number as string, formatted by locale US, decimal separator . (like java decimal numbers), without group separator
|
|
10086
|
+
**/
|
|
10087
|
+
formattedStringToNumberString(input, type, decSeparator) {
|
|
10088
|
+
return numberStringToNumberString(input, type, decSeparator !== null && decSeparator !== void 0 ? decSeparator : this.decimalSeparator(), this);
|
|
10089
|
+
function numberStringToNumberString(input, type, decFmt, kupMath) {
|
|
10090
|
+
if (!input || input == null || input.trim() == '') {
|
|
10091
|
+
return '';
|
|
10092
|
+
}
|
|
10093
|
+
let unf = kupMath.numberifySafe(input, decFmt != '.', type);
|
|
10094
|
+
if (unf == null || isNaN(unf)) {
|
|
10095
|
+
return input;
|
|
10096
|
+
}
|
|
10097
|
+
return numberToString(unf, -1, 'en-US', kupMath);
|
|
10098
|
+
}
|
|
10099
|
+
function numberToString(input, decimals, locale, kupMath) {
|
|
10100
|
+
if (input == null) {
|
|
10101
|
+
input = 0;
|
|
10102
|
+
}
|
|
10103
|
+
if (decimals == null || decimals == -1) {
|
|
10104
|
+
decimals = kupMath.countDecimals(input);
|
|
10105
|
+
}
|
|
10106
|
+
let n = Number(input);
|
|
10107
|
+
let f = decimals > -1
|
|
10108
|
+
? {
|
|
10109
|
+
minimumFractionDigits: decimals,
|
|
10110
|
+
maximumFractionDigits: decimals,
|
|
10111
|
+
useGrouping: false,
|
|
10112
|
+
}
|
|
10113
|
+
: { useGrouping: false };
|
|
10114
|
+
return n.toLocaleString(locale, f);
|
|
10115
|
+
}
|
|
10116
|
+
}
|
|
10117
|
+
/**
|
|
10118
|
+
* Gets the number of decimals for current number
|
|
10119
|
+
* @param {number} value numer input
|
|
10120
|
+
* @returns {number} the number of decimals
|
|
10121
|
+
*/
|
|
10122
|
+
countDecimals(value) {
|
|
10123
|
+
var _a;
|
|
10124
|
+
if (Math.floor(value) === value)
|
|
10125
|
+
return 0;
|
|
10126
|
+
let stringValue = value.toString().split('.')[1];
|
|
10127
|
+
if (stringValue) {
|
|
10128
|
+
return (_a = stringValue.length) !== null && _a !== void 0 ? _a : 0;
|
|
10129
|
+
}
|
|
10130
|
+
else {
|
|
10131
|
+
return 0;
|
|
10132
|
+
}
|
|
10133
|
+
}
|
|
10134
|
+
/**
|
|
10135
|
+
* Gets the suffix for number, by type
|
|
10136
|
+
* @param {string} type - type of number for calculate suffix
|
|
10137
|
+
* @returns {string} suffix for number, by type
|
|
10138
|
+
**/
|
|
10139
|
+
getNumericValueSuffix(type) {
|
|
10140
|
+
type = type.toUpperCase();
|
|
10141
|
+
let nstr = '';
|
|
10142
|
+
if (type == 'P') {
|
|
10143
|
+
nstr = ' %';
|
|
10144
|
+
}
|
|
10145
|
+
else if (type == 'VE') {
|
|
10146
|
+
nstr = ' €';
|
|
10147
|
+
}
|
|
10148
|
+
else if (type == 'VL') {
|
|
10149
|
+
nstr = ' £';
|
|
10150
|
+
}
|
|
10151
|
+
else if (type == 'VV') {
|
|
10152
|
+
nstr = ' $';
|
|
10153
|
+
}
|
|
10154
|
+
return nstr;
|
|
10155
|
+
}
|
|
10156
|
+
/**
|
|
10157
|
+
* Gets the number as string, formatted by actual browser locale, with suffix by type
|
|
10158
|
+
* @param {number} input number
|
|
10159
|
+
* @param {number} decimals number of significant decimal digits for output
|
|
10160
|
+
* @param {string} type - type of number for calculate suffix
|
|
10161
|
+
* @returns {string} number as string, formatted by actual browser locale, with suffix by type
|
|
10162
|
+
**/
|
|
10163
|
+
numberToFormattedString(input, decimals, type) {
|
|
10164
|
+
if (input == null || isNaN(input)) {
|
|
10165
|
+
return '';
|
|
10166
|
+
}
|
|
10167
|
+
if (decimals == null || decimals == -1) {
|
|
10168
|
+
decimals = this.countDecimals(input);
|
|
10169
|
+
}
|
|
10170
|
+
let nstr = this.format(input, this.createFormatPattern(true, decimals));
|
|
10171
|
+
nstr = nstr + this.getNumericValueSuffix(type);
|
|
10172
|
+
return nstr;
|
|
10173
|
+
}
|
|
10174
|
+
/**
|
|
10175
|
+
* Gets the number as string, formatted by actual browser locale, with suffix by type
|
|
10176
|
+
* @param {string} input number as string, formatted by locale US, decimal separator . (like java decimal numbers)
|
|
10177
|
+
* @param {number} decimals number of significant decimal digits for output
|
|
10178
|
+
* @param {string} type - type of number for calculate suffix
|
|
10179
|
+
* @param {string} decSeparator decimal separator for outpu string
|
|
10180
|
+
* @returns {string} number as string, formatted by actual browser locale (or using decimal separator param), with suffix by type
|
|
10181
|
+
**/
|
|
10182
|
+
numberStringToFormattedString(input, decimals, type, decSeparator) {
|
|
10183
|
+
let value = this.numberToFormattedString(this.numberifySafe(input), decimals, type);
|
|
10184
|
+
if (!decSeparator) {
|
|
10185
|
+
return value;
|
|
10186
|
+
}
|
|
10187
|
+
const browserDecSeparator = this.decimalSeparator();
|
|
10188
|
+
if (browserDecSeparator == decSeparator) {
|
|
10189
|
+
return value;
|
|
10190
|
+
}
|
|
10191
|
+
const browserGroupSeparator = this.groupSeparator();
|
|
10192
|
+
value = value.replace(getRegExpFromString(browserGroupSeparator, 'g'), '');
|
|
10193
|
+
value = value.replace(getRegExpFromString(browserDecSeparator, 'g'), decSeparator);
|
|
10194
|
+
return value;
|
|
10195
|
+
}
|
|
9967
10196
|
/**
|
|
9968
10197
|
* Registers a KupComponent in KupMath, in order to be properly handled whenever the locale changes.
|
|
9969
10198
|
* @param {any} component - The Ketchup component to be registered.
|
|
@@ -18319,4 +18548,4 @@ function kupManagerInstance() {
|
|
|
18319
18548
|
return dom.ketchup;
|
|
18320
18549
|
}
|
|
18321
18550
|
|
|
18322
|
-
export {
|
|
18551
|
+
export { KupLanguageGrid as $, identify as A, KupLanguageGrouping as B, KupLanguageCheckbox as C, getValueForDisplay2 as D, Filters as E, FCellShapes as F, GroupLabelDisplayMode as G, getValueForDisplay as H, KupLanguageSearch as I, FilterInterval as J, KupThemeIconValues as K, LoadMoreMode as L, ShowGrid as M, TotalMode as N, kupDynamicPositionAttribute as O, PaginatorPos as P, KupPointerEventTypes as Q, kupDraggableColumnAttr as R, SelectionMode as S, TotalLabel as T, kupDragActiveAttr as U, KupDragEffect as V, kupDraggableCellAttr as W, KupDropEventTypes as X, FixedCellsCSSVarsBase as Y, KupLanguageFontsize as Z, KupLanguageDensity as _, KupDynamicPositionPlacement as a, KupDataTableProps as a0, FixedCellsClasses as a1, SortMode as a2, iconColumn as a3, keyColumn as a4, fieldColumn as a5, FCellTypes as a6, addColumnValueFromRow as a7, KupGlobalFilterMode as a8, editableTypes as a9, kupTypes as aa, KupTagNames as ab, fullWidthFieldsComps as ac, FCellClasses as ad, autoCenterComps as ae, getCellValueForDisplay as af, FCellEvents as ag, KupData as ah, compareCell as ai, KupLanguagePage as aj, createCommonjsModule as ak, getDefaultExportFromCjs as al, KupDatesLocales as am, KupLanguageDashboard as an, kupDropEvent as ao, kupDraggableRowAttr as ap, commonjsGlobal as aq, KupThemeColorValues as b, KupDebugCategory as c, FCellPadding as d, KupDateTimeFormatOptionsMonth as e, fillString as f, getProps as g, KupDatesFormats as h, KupCardBuiltInClockElements as i, KupCardCSSClasses as j, kupManagerInstance as k, KupLanguageTotals as l, KupLanguageGeneric as m, KupLanguageColumn as n, KupDataNewColumnTypes as o, KupCardSubEvents as p, KupCardIds as q, KupLanguageRow as r, setProps as s, KupCardFamily as t, KupCardProps as u, getColumnByName as v, KupDates as w, formatToNumber as x, KupDatesNormalize as y, KupObjects as z };
|