@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,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-1f177abc.js');
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Props of the kup-card component.
|
|
@@ -346,7 +346,7 @@ var __classPrivateFieldGet$3 = (undefined && undefined.__classPrivateFieldGet) |
|
|
|
346
346
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
347
347
|
};
|
|
348
348
|
var _KupDebug_debugWidget;
|
|
349
|
-
const dom$
|
|
349
|
+
const dom$h = document.documentElement;
|
|
350
350
|
/**
|
|
351
351
|
* Debugging suite, used to log messages and statuses from the Ketchup components.
|
|
352
352
|
* @module KupDebug
|
|
@@ -393,32 +393,32 @@ class KupDebug {
|
|
|
393
393
|
*/
|
|
394
394
|
showWidget() {
|
|
395
395
|
const debugWidget = document.createElement('kup-card');
|
|
396
|
-
const languages = dom$
|
|
396
|
+
const languages = dom$h.ketchup.language.getLanguages();
|
|
397
397
|
const languagesListData = [];
|
|
398
398
|
for (let index = 0; index < languages.length; index++) {
|
|
399
399
|
languagesListData.push({
|
|
400
400
|
id: languages[index],
|
|
401
|
-
selected: languages[index] === dom$
|
|
401
|
+
selected: languages[index] === dom$h.ketchup.language.name
|
|
402
402
|
? true
|
|
403
403
|
: false,
|
|
404
404
|
value: languages[index],
|
|
405
405
|
});
|
|
406
406
|
}
|
|
407
|
-
const themes = dom$
|
|
407
|
+
const themes = dom$h.ketchup.theme.getThemes();
|
|
408
408
|
const themesListData = [];
|
|
409
409
|
for (let index = 0; index < themes.length; index++) {
|
|
410
410
|
themesListData.push({
|
|
411
411
|
id: themes[index],
|
|
412
|
-
selected: themes[index] === dom$
|
|
412
|
+
selected: themes[index] === dom$h.ketchup.theme.name ? true : false,
|
|
413
413
|
value: themes[index],
|
|
414
414
|
});
|
|
415
415
|
}
|
|
416
|
-
const locales = dom$
|
|
416
|
+
const locales = dom$h.ketchup.dates.getLocales();
|
|
417
417
|
const localesListData = [];
|
|
418
418
|
for (let index = 0; index < locales.length; index++) {
|
|
419
419
|
localesListData.push({
|
|
420
420
|
id: locales[index],
|
|
421
|
-
selected: locales[index] === dom$
|
|
421
|
+
selected: locales[index] === dom$h.ketchup.dates.locale ? true : false,
|
|
422
422
|
value: locales[index],
|
|
423
423
|
});
|
|
424
424
|
}
|
|
@@ -428,13 +428,13 @@ class KupDebug {
|
|
|
428
428
|
icon: 'power_settings_new',
|
|
429
429
|
id: 'kup-debug-off',
|
|
430
430
|
customStyle: ':host {--kup-font-size: 0.875em; border-left: 1px solid var(--kup-border-color); border-right: 1px solid var(--kup-border-color);}',
|
|
431
|
-
title: dom$
|
|
431
|
+
title: dom$h.ketchup.language.translate(KupLanguageDebug.OFF),
|
|
432
432
|
},
|
|
433
433
|
{
|
|
434
434
|
customStyle: ':host {--kup-font-size: 0.875em;}',
|
|
435
435
|
icon: 'print',
|
|
436
436
|
id: 'kup-debug-print',
|
|
437
|
-
title: dom$
|
|
437
|
+
title: dom$h.ketchup.language.translate(KupLanguageDebug.PRINT),
|
|
438
438
|
},
|
|
439
439
|
{
|
|
440
440
|
checked: this.autoPrint,
|
|
@@ -442,20 +442,20 @@ class KupDebug {
|
|
|
442
442
|
icon: 'speaker_notes',
|
|
443
443
|
iconOff: 'speaker_notes_off',
|
|
444
444
|
id: 'kup-debug-autoprint',
|
|
445
|
-
title: dom$
|
|
445
|
+
title: dom$h.ketchup.language.translate(KupLanguageDebug.AUTOPRINT),
|
|
446
446
|
toggable: true,
|
|
447
447
|
},
|
|
448
448
|
{
|
|
449
449
|
customStyle: ':host {--kup-font-size: 0.875em;}',
|
|
450
450
|
icon: 'broom',
|
|
451
451
|
id: 'kup-debug-clear',
|
|
452
|
-
title: dom$
|
|
452
|
+
title: dom$h.ketchup.language.translate(KupLanguageDebug.CLEAR),
|
|
453
453
|
},
|
|
454
454
|
{
|
|
455
455
|
customStyle: ':host {--kup-font-size: 0.875em;}',
|
|
456
456
|
icon: 'delete',
|
|
457
457
|
id: 'kup-debug-delete',
|
|
458
|
-
title: dom$
|
|
458
|
+
title: dom$h.ketchup.language.translate(KupLanguageDebug.DUMP),
|
|
459
459
|
},
|
|
460
460
|
{
|
|
461
461
|
className: 'kup-full-height',
|
|
@@ -464,22 +464,22 @@ class KupDebug {
|
|
|
464
464
|
id: 'kup-debug-dl-props',
|
|
465
465
|
label: 'Props',
|
|
466
466
|
styling: 'flat',
|
|
467
|
-
title: dom$
|
|
467
|
+
title: dom$h.ketchup.language.translate(KupLanguageDebug.DL_PROPS),
|
|
468
468
|
},
|
|
469
469
|
{
|
|
470
470
|
className: 'kup-full-height',
|
|
471
471
|
customStyle: ':host {border-right: 1px solid var(--kup-border-color);}',
|
|
472
472
|
icon: 'download',
|
|
473
473
|
id: 'kup-debug-dl-all',
|
|
474
|
-
label: dom$
|
|
474
|
+
label: dom$h.ketchup.language.translate(KupLanguageDebug.DL_ALL),
|
|
475
475
|
styling: 'flat',
|
|
476
|
-
title: dom$
|
|
476
|
+
title: dom$h.ketchup.language.translate(KupLanguageDebug.DL_ALL),
|
|
477
477
|
},
|
|
478
478
|
{
|
|
479
479
|
customStyle: ':host {--kup-font-size: 0.875em;}',
|
|
480
480
|
icon: 'auto-fix',
|
|
481
481
|
id: 'kup-debug-magic-box',
|
|
482
|
-
title: dom$
|
|
482
|
+
title: dom$h.ketchup.language.translate(KupLanguageDebug.MAGIC_BOX),
|
|
483
483
|
},
|
|
484
484
|
],
|
|
485
485
|
combobox: [
|
|
@@ -494,11 +494,11 @@ class KupDebug {
|
|
|
494
494
|
className: 'kup-full-height',
|
|
495
495
|
emitSubmitEventOnEnter: false,
|
|
496
496
|
inputType: 'text',
|
|
497
|
-
label: dom$
|
|
497
|
+
label: dom$h.ketchup.language.translate(KupLanguageDebug.THEME_CHANGER),
|
|
498
498
|
},
|
|
499
499
|
},
|
|
500
500
|
id: 'kup-debug-theme-changer',
|
|
501
|
-
initialValue: dom$
|
|
501
|
+
initialValue: dom$h.ketchup.theme.name,
|
|
502
502
|
isSelect: true,
|
|
503
503
|
},
|
|
504
504
|
{
|
|
@@ -512,11 +512,11 @@ class KupDebug {
|
|
|
512
512
|
className: 'kup-full-height',
|
|
513
513
|
emitSubmitEventOnEnter: false,
|
|
514
514
|
inputType: 'text',
|
|
515
|
-
label: dom$
|
|
515
|
+
label: dom$h.ketchup.language.translate(KupLanguageDebug.LANGUAGE_CHANGER),
|
|
516
516
|
},
|
|
517
517
|
},
|
|
518
518
|
id: 'kup-debug-language-changer',
|
|
519
|
-
initialValue: dom$
|
|
519
|
+
initialValue: dom$h.ketchup.language.name,
|
|
520
520
|
isSelect: true,
|
|
521
521
|
},
|
|
522
522
|
{
|
|
@@ -530,11 +530,11 @@ class KupDebug {
|
|
|
530
530
|
className: 'kup-full-height',
|
|
531
531
|
emitSubmitEventOnEnter: false,
|
|
532
532
|
inputType: 'text',
|
|
533
|
-
label: dom$
|
|
533
|
+
label: dom$h.ketchup.language.translate(KupLanguageDebug.LOCALE_CHANGER),
|
|
534
534
|
},
|
|
535
535
|
},
|
|
536
536
|
id: 'kup-debug-locale-changer',
|
|
537
|
-
initialValue: dom$
|
|
537
|
+
initialValue: dom$h.ketchup.dates.locale,
|
|
538
538
|
isSelect: true,
|
|
539
539
|
},
|
|
540
540
|
],
|
|
@@ -542,7 +542,7 @@ class KupDebug {
|
|
|
542
542
|
{
|
|
543
543
|
className: 'kup-full-height',
|
|
544
544
|
id: 'kup-debug-log-limit',
|
|
545
|
-
label: dom$
|
|
545
|
+
label: dom$h.ketchup.language.translate(KupLanguageDebug.LOG_LIMIT),
|
|
546
546
|
initialValue: this.logLimit,
|
|
547
547
|
emitSubmitEventOnEnter: false,
|
|
548
548
|
inputType: 'number',
|
|
@@ -593,7 +593,7 @@ class KupDebug {
|
|
|
593
593
|
kupDebug.dump();
|
|
594
594
|
break;
|
|
595
595
|
case 'kup-debug-magic-box':
|
|
596
|
-
dom$
|
|
596
|
+
dom$h.ketchup.toggleMagicBox();
|
|
597
597
|
break;
|
|
598
598
|
case 'kup-debug-off':
|
|
599
599
|
kupDebug.toggle();
|
|
@@ -608,14 +608,14 @@ class KupDebug {
|
|
|
608
608
|
case 'kup-combobox-itemclick':
|
|
609
609
|
switch (compID) {
|
|
610
610
|
case 'kup-debug-language-changer':
|
|
611
|
-
dom$
|
|
611
|
+
dom$h.ketchup.language.set(compEvent.detail.value);
|
|
612
612
|
break;
|
|
613
613
|
case 'kup-debug-locale-changer':
|
|
614
|
-
dom$
|
|
615
|
-
dom$
|
|
614
|
+
dom$h.ketchup.dates.setLocale(compEvent.detail.value);
|
|
615
|
+
dom$h.ketchup.math.setLocale(compEvent.detail.value);
|
|
616
616
|
break;
|
|
617
617
|
case 'kup-debug-theme-changer':
|
|
618
|
-
dom$
|
|
618
|
+
dom$h.ketchup.theme.set(compEvent.detail.value);
|
|
619
619
|
break;
|
|
620
620
|
}
|
|
621
621
|
case 'kup-textfield-input':
|
|
@@ -677,7 +677,7 @@ class KupDebug {
|
|
|
677
677
|
// If the log is tied to a KupComponent, on click its props will be downloaded.
|
|
678
678
|
// Also, a different style will be applied to distinguish it between the others.
|
|
679
679
|
if (typeof this.logs[index].element == 'object') {
|
|
680
|
-
slot.title = dom$
|
|
680
|
+
slot.title = dom$h.ketchup.language.translate(KupLanguageDebug.DL_PROPS_COMP);
|
|
681
681
|
slot.style.fontWeight = 'bold';
|
|
682
682
|
slot.style.cursor = 'pointer';
|
|
683
683
|
slot.onclick = () => {
|
|
@@ -735,7 +735,7 @@ class KupDebug {
|
|
|
735
735
|
printLog[type] = [];
|
|
736
736
|
}
|
|
737
737
|
printLog[type].push({
|
|
738
|
-
date: dom$
|
|
738
|
+
date: dom$h.ketchup.dates.format(this.logs[index].date, 'LLL:ms'),
|
|
739
739
|
element: isComponent
|
|
740
740
|
? this.logs[index].element
|
|
741
741
|
: this.logs[index].id,
|
|
@@ -915,7 +915,7 @@ class KupDebug {
|
|
|
915
915
|
message: message,
|
|
916
916
|
};
|
|
917
917
|
if (this.logs.length > this.logLimit) {
|
|
918
|
-
console.warn(dom$
|
|
918
|
+
console.warn(dom$h.ketchup.dates.format(date, 'LLL:ms') +
|
|
919
919
|
' kup-debug => ' +
|
|
920
920
|
'Too many logs (> ' +
|
|
921
921
|
this.logLimit +
|
|
@@ -931,14 +931,14 @@ class KupDebug {
|
|
|
931
931
|
}
|
|
932
932
|
switch (category) {
|
|
933
933
|
case exports.KupDebugCategory.ERROR:
|
|
934
|
-
console.error(dom$
|
|
934
|
+
console.error(dom$h.ketchup.dates.format(date, 'LLL:ms') + id + message, obj);
|
|
935
935
|
window.dispatchEvent(new CustomEvent('kup-debug-error', {
|
|
936
936
|
bubbles: true,
|
|
937
937
|
detail: { comp, date, message },
|
|
938
938
|
}));
|
|
939
939
|
break;
|
|
940
940
|
case exports.KupDebugCategory.WARNING:
|
|
941
|
-
console.warn(dom$
|
|
941
|
+
console.warn(dom$h.ketchup.dates.format(date, 'LLL:ms') + id + message, obj);
|
|
942
942
|
break;
|
|
943
943
|
}
|
|
944
944
|
}
|
|
@@ -1025,7 +1025,7 @@ exports.KupDynamicPositionPlacement = void 0;
|
|
|
1025
1025
|
KupDynamicPositionPlacement["TOP_RIGHT"] = "tr";
|
|
1026
1026
|
})(exports.KupDynamicPositionPlacement || (exports.KupDynamicPositionPlacement = {}));
|
|
1027
1027
|
|
|
1028
|
-
const dom$
|
|
1028
|
+
const dom$g = document.documentElement;
|
|
1029
1029
|
/**
|
|
1030
1030
|
* This class is used to dynamically reposition HTML elements.
|
|
1031
1031
|
* @module KupDynamicPosition
|
|
@@ -1093,7 +1093,7 @@ class KupDynamicPosition {
|
|
|
1093
1093
|
const target = mutations[0].target;
|
|
1094
1094
|
if (target.classList.contains(kupDynamicPositionActiveClass)) {
|
|
1095
1095
|
requestAnimationFrame(function () {
|
|
1096
|
-
dom$
|
|
1096
|
+
dom$g.ketchup.dynamicPosition.run(el);
|
|
1097
1097
|
});
|
|
1098
1098
|
}
|
|
1099
1099
|
});
|
|
@@ -1150,7 +1150,7 @@ class KupDynamicPosition {
|
|
|
1150
1150
|
*/
|
|
1151
1151
|
run(el) {
|
|
1152
1152
|
if (!el.isConnected) {
|
|
1153
|
-
dom$
|
|
1153
|
+
dom$g.ketchup.dynamicPosition.managedElements.delete(el);
|
|
1154
1154
|
cancelAnimationFrame(el.kupDynamicPosition.rAF);
|
|
1155
1155
|
return;
|
|
1156
1156
|
}
|
|
@@ -1258,7 +1258,7 @@ class KupDynamicPosition {
|
|
|
1258
1258
|
// Recursive
|
|
1259
1259
|
if (!el.kupDynamicPosition.detach) {
|
|
1260
1260
|
el.kupDynamicPosition.rAF = requestAnimationFrame(function () {
|
|
1261
|
-
dom$
|
|
1261
|
+
dom$g.ketchup.dynamicPosition.run(el);
|
|
1262
1262
|
});
|
|
1263
1263
|
}
|
|
1264
1264
|
else {
|
|
@@ -1346,7 +1346,7 @@ exports.KupDropEventTypes = void 0;
|
|
|
1346
1346
|
KupDropEventTypes["MAGICBOX"] = "text/kup-magic-box-drag";
|
|
1347
1347
|
})(exports.KupDropEventTypes || (exports.KupDropEventTypes = {}));
|
|
1348
1348
|
|
|
1349
|
-
const dom$
|
|
1349
|
+
const dom$f = document.documentElement;
|
|
1350
1350
|
/**
|
|
1351
1351
|
* This class handles elements as dialogs, making them resizable and movable.
|
|
1352
1352
|
* @module KupInteract
|
|
@@ -1460,7 +1460,7 @@ class KupInteract {
|
|
|
1460
1460
|
ghostImage.style.transition = 'none';
|
|
1461
1461
|
ghostImage.style.zIndex =
|
|
1462
1462
|
'calc(var(--kup-navbar-zindex) + 1)';
|
|
1463
|
-
dom$
|
|
1463
|
+
dom$f.ketchup.interact.container.appendChild(ghostImage);
|
|
1464
1464
|
draggable.kupDragDrop.ghostImage = ghostImage;
|
|
1465
1465
|
break;
|
|
1466
1466
|
case exports.KupDragEffect.CLONE:
|
|
@@ -1621,7 +1621,7 @@ class KupInteract {
|
|
|
1621
1621
|
x += e.deltaRect.left;
|
|
1622
1622
|
y += e.deltaRect.top;
|
|
1623
1623
|
el.style.transform = 'translate(' + x + 'px,' + y + 'px)';
|
|
1624
|
-
if (dom$
|
|
1624
|
+
if (dom$f.ketchup.interact.isInViewport(el, oldTransform, e.delta)) {
|
|
1625
1625
|
el.setAttribute('data-x', x.toString());
|
|
1626
1626
|
el.setAttribute('data-y', y.toString());
|
|
1627
1627
|
}
|
|
@@ -1673,7 +1673,7 @@ class KupInteract {
|
|
|
1673
1673
|
const callbacks = {
|
|
1674
1674
|
start(e) {
|
|
1675
1675
|
const el = e.currentTarget;
|
|
1676
|
-
el.style.zIndex = (dom$
|
|
1676
|
+
el.style.zIndex = (dom$f.ketchup.interact.zIndex++).toString();
|
|
1677
1677
|
},
|
|
1678
1678
|
};
|
|
1679
1679
|
this.draggable(el, {
|
|
@@ -1682,7 +1682,7 @@ class KupInteract {
|
|
|
1682
1682
|
interact.modifiers.restrictRect({
|
|
1683
1683
|
restriction: restrictContainer
|
|
1684
1684
|
? restrictContainer
|
|
1685
|
-
: dom$
|
|
1685
|
+
: dom$f.ketchup.interact.restrictContainer,
|
|
1686
1686
|
endOnly: true,
|
|
1687
1687
|
}),
|
|
1688
1688
|
],
|
|
@@ -2634,7 +2634,7 @@ const languages = {
|
|
|
2634
2634
|
spanish: spanish
|
|
2635
2635
|
};
|
|
2636
2636
|
|
|
2637
|
-
const dom$
|
|
2637
|
+
const dom$e = document.documentElement;
|
|
2638
2638
|
/**
|
|
2639
2639
|
* Handles the translation to different languages.
|
|
2640
2640
|
* @module KupLanguage
|
|
@@ -2688,7 +2688,7 @@ class KupLanguage {
|
|
|
2688
2688
|
return invalidKey(key);
|
|
2689
2689
|
}
|
|
2690
2690
|
function invalidKey(key) {
|
|
2691
|
-
dom$
|
|
2691
|
+
dom$e.ketchup.debug.logMessage('kup-language', 'Invalid translation for key (' + key + ')!', exports.KupDebugCategory.WARNING);
|
|
2692
2692
|
return key;
|
|
2693
2693
|
}
|
|
2694
2694
|
}
|
|
@@ -2701,7 +2701,7 @@ class KupLanguage {
|
|
|
2701
2701
|
language = language.toLowerCase();
|
|
2702
2702
|
}
|
|
2703
2703
|
else {
|
|
2704
|
-
dom$
|
|
2704
|
+
dom$e.ketchup.debug.logMessage('kup-language', "Couldn't set language, invalid string received (" +
|
|
2705
2705
|
language +
|
|
2706
2706
|
')!', exports.KupDebugCategory.WARNING);
|
|
2707
2707
|
return;
|
|
@@ -2711,12 +2711,12 @@ class KupLanguage {
|
|
|
2711
2711
|
const dVariant = decodedLanguage.variant;
|
|
2712
2712
|
if (this.list[dLanguage]) {
|
|
2713
2713
|
if (dVariant && !this.list[dLanguage].variants[dVariant]) {
|
|
2714
|
-
dom$
|
|
2714
|
+
dom$e.ketchup.debug.logMessage('kup-language', 'Variant not found (' + dVariant + ')!', exports.KupDebugCategory.WARNING);
|
|
2715
2715
|
return;
|
|
2716
2716
|
}
|
|
2717
2717
|
}
|
|
2718
2718
|
else {
|
|
2719
|
-
dom$
|
|
2719
|
+
dom$e.ketchup.debug.logMessage('kup-language', 'Language not found (' + dLanguage + ')!', exports.KupDebugCategory.WARNING);
|
|
2720
2720
|
return;
|
|
2721
2721
|
}
|
|
2722
2722
|
this.name = language;
|
|
@@ -2803,7 +2803,7 @@ const obj = {
|
|
|
2803
2803
|
types: types
|
|
2804
2804
|
};
|
|
2805
2805
|
|
|
2806
|
-
const dom$
|
|
2806
|
+
const dom$d = document.documentElement;
|
|
2807
2807
|
/**
|
|
2808
2808
|
* Handles objects definition and validation.
|
|
2809
2809
|
* @module KupObjects
|
|
@@ -3138,9 +3138,9 @@ class KupObjects {
|
|
|
3138
3138
|
*/
|
|
3139
3139
|
parseDate(obj) {
|
|
3140
3140
|
if (obj.t === 'D8' && obj.p === '*DMYY') {
|
|
3141
|
-
return dom$
|
|
3141
|
+
return dom$d.ketchup.dates.toDayjs(obj.k, 'DDMMYYYY');
|
|
3142
3142
|
}
|
|
3143
|
-
return dom$
|
|
3143
|
+
return dom$d.ketchup.dates.toDayjs(obj.k);
|
|
3144
3144
|
}
|
|
3145
3145
|
/**
|
|
3146
3146
|
* Check whether two JS objects are deeply equal. When the arguments aren't objects, they are tested directly for equity.
|
|
@@ -3213,7 +3213,7 @@ var __classPrivateFieldGet$2 = (undefined && undefined.__classPrivateFieldGet) |
|
|
|
3213
3213
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
3214
3214
|
};
|
|
3215
3215
|
var _KupScrollOnHover_instances, _KupScrollOnHover_arrowsContainer, _KupScrollOnHover_leftArrows, _KupScrollOnHover_rightArrows, _KupScrollOnHover_scrollEvent, _KupScrollOnHover_mousemoveEvent, _KupScrollOnHover_mouseleaveEvent, _KupScrollOnHover_rAF, _KupScrollOnHover_timeout, _KupScrollOnHover_initArrows;
|
|
3216
|
-
const dom$
|
|
3216
|
+
const dom$c = document.documentElement;
|
|
3217
3217
|
/**
|
|
3218
3218
|
* Lets the user scroll an element's overflow by hovering with the mouse on its left/right edge.
|
|
3219
3219
|
* @module KupScrollOnHover
|
|
@@ -3342,7 +3342,7 @@ class KupScrollOnHover {
|
|
|
3342
3342
|
__classPrivateFieldSet$2(this, _KupScrollOnHover_timeout, setTimeout(() => {
|
|
3343
3343
|
el.scrollOnHover.active = true;
|
|
3344
3344
|
__classPrivateFieldSet$2(this, _KupScrollOnHover_rAF, requestAnimationFrame(function () {
|
|
3345
|
-
dom$
|
|
3345
|
+
dom$c.ketchup.scrollOnHover.run(el, maxScrollLeft, percRight, percLeft, direction);
|
|
3346
3346
|
}), "f");
|
|
3347
3347
|
}, this.delay), "f");
|
|
3348
3348
|
}
|
|
@@ -3364,7 +3364,7 @@ class KupScrollOnHover {
|
|
|
3364
3364
|
__classPrivateFieldSet$2(this, _KupScrollOnHover_timeout, setTimeout(() => {
|
|
3365
3365
|
el.scrollOnHover.active = true;
|
|
3366
3366
|
__classPrivateFieldSet$2(this, _KupScrollOnHover_rAF, requestAnimationFrame(function () {
|
|
3367
|
-
dom$
|
|
3367
|
+
dom$c.ketchup.scrollOnHover.run(el, maxScrollTop, percBottom, percTop, direction);
|
|
3368
3368
|
}), "f");
|
|
3369
3369
|
}, this.delay), "f");
|
|
3370
3370
|
}
|
|
@@ -3495,7 +3495,7 @@ class KupScrollOnHover {
|
|
|
3495
3495
|
arrow[i].classList.add('kup-animated');
|
|
3496
3496
|
}
|
|
3497
3497
|
__classPrivateFieldSet$2(this, _KupScrollOnHover_rAF, requestAnimationFrame(function () {
|
|
3498
|
-
dom$
|
|
3498
|
+
dom$c.ketchup.scrollOnHover.run(el, maxScrollLeft, percForward, percBack, direction);
|
|
3499
3499
|
}), "f");
|
|
3500
3500
|
}
|
|
3501
3501
|
/**
|
|
@@ -4733,7 +4733,7 @@ exports.KupThemeIconValues = void 0;
|
|
|
4733
4733
|
KupThemeIconValues["SEARCH"] = "--kup-search-icon";
|
|
4734
4734
|
})(exports.KupThemeIconValues || (exports.KupThemeIconValues = {}));
|
|
4735
4735
|
|
|
4736
|
-
const dom$
|
|
4736
|
+
const dom$b = document.documentElement;
|
|
4737
4737
|
/**
|
|
4738
4738
|
* Theme manager, handles everything about theming, customStyles and color utilities.
|
|
4739
4739
|
* @module KupTheme
|
|
@@ -4747,7 +4747,7 @@ class KupTheme {
|
|
|
4747
4747
|
this.list = list ? list : themes;
|
|
4748
4748
|
this.managedComponents = new Set();
|
|
4749
4749
|
this.name = name ? name : 'ketchup';
|
|
4750
|
-
this.styleTag = dom$
|
|
4750
|
+
this.styleTag = dom$b
|
|
4751
4751
|
.querySelector('head')
|
|
4752
4752
|
.appendChild(document.createElement('style'));
|
|
4753
4753
|
}
|
|
@@ -4834,9 +4834,9 @@ class KupTheme {
|
|
|
4834
4834
|
if (list) {
|
|
4835
4835
|
this.list = list;
|
|
4836
4836
|
}
|
|
4837
|
-
dom$
|
|
4837
|
+
dom$b.ketchup.debug.logMessage('theme manager', 'Setting theme to: ' + this.name + '.');
|
|
4838
4838
|
if (!this.list[this.name]) {
|
|
4839
|
-
dom$
|
|
4839
|
+
dom$b.ketchup.debug.logMessage('theme manager', 'Invalid theme name, falling back to default ("ketchup").');
|
|
4840
4840
|
this.name = 'ketchup';
|
|
4841
4841
|
}
|
|
4842
4842
|
this.cssVars = {};
|
|
@@ -4879,11 +4879,11 @@ class KupTheme {
|
|
|
4879
4879
|
this.icons() +
|
|
4880
4880
|
'}';
|
|
4881
4881
|
this.customStyle();
|
|
4882
|
-
dom$
|
|
4882
|
+
dom$b.ketchup.debug.logMessage('kup-theme', 'Theme ' + dom$b.getAttribute('kup-theme') + ' refreshed.');
|
|
4883
4883
|
document.dispatchEvent(new CustomEvent('kup-theme-refresh'));
|
|
4884
4884
|
}
|
|
4885
4885
|
catch (error) {
|
|
4886
|
-
dom$
|
|
4886
|
+
dom$b.ketchup.debug.logMessage('kup-theme', 'Theme not refreshed.', exports.KupDebugCategory.WARNING);
|
|
4887
4887
|
}
|
|
4888
4888
|
}
|
|
4889
4889
|
/**
|
|
@@ -5002,7 +5002,7 @@ class KupTheme {
|
|
|
5002
5002
|
this.set(themes[index]);
|
|
5003
5003
|
}
|
|
5004
5004
|
else {
|
|
5005
|
-
dom$
|
|
5005
|
+
dom$b.ketchup.debug.logMessage('kup-theme', "Couldn't set a random theme: no themes available!", exports.KupDebugCategory.WARNING);
|
|
5006
5006
|
}
|
|
5007
5007
|
}
|
|
5008
5008
|
/**
|
|
@@ -5014,7 +5014,7 @@ class KupTheme {
|
|
|
5014
5014
|
//Testing whether the color is transparent, if it is a fall back value will be returned matching the background-color
|
|
5015
5015
|
if (color === 'transparent') {
|
|
5016
5016
|
color = this.cssVars['--kup-background-color'];
|
|
5017
|
-
dom$
|
|
5017
|
+
dom$b.ketchup.debug.logMessage('theme manager', 'Received TRANSPARENT color, converted to ' +
|
|
5018
5018
|
color +
|
|
5019
5019
|
' (theme background).');
|
|
5020
5020
|
}
|
|
@@ -5032,7 +5032,7 @@ class KupTheme {
|
|
|
5032
5032
|
const oldColor = color;
|
|
5033
5033
|
color = this.codeToHex(color);
|
|
5034
5034
|
isHex = color.substring(0, 1) === '#' ? true : false;
|
|
5035
|
-
dom$
|
|
5035
|
+
dom$b.ketchup.debug.logMessage('theme manager', 'Received CODE NAME color ' +
|
|
5036
5036
|
oldColor +
|
|
5037
5037
|
', converted to ' +
|
|
5038
5038
|
color +
|
|
@@ -5086,14 +5086,14 @@ class KupTheme {
|
|
|
5086
5086
|
else {
|
|
5087
5087
|
hexColor = this.rgbToHex(rgbColorObj.r, rgbColorObj.g, rgbColorObj.b);
|
|
5088
5088
|
}
|
|
5089
|
-
dom$
|
|
5089
|
+
dom$b.ketchup.debug.logMessage('theme-manager', 'Received HEX color ' +
|
|
5090
5090
|
oldColor +
|
|
5091
5091
|
', converted to ' +
|
|
5092
5092
|
color +
|
|
5093
5093
|
'.');
|
|
5094
5094
|
}
|
|
5095
5095
|
catch (error) {
|
|
5096
|
-
dom$
|
|
5096
|
+
dom$b.ketchup.debug.logMessage('theme-manager', 'Invalid color: ' + color + '.');
|
|
5097
5097
|
}
|
|
5098
5098
|
}
|
|
5099
5099
|
let rgbValues = null;
|
|
@@ -5103,14 +5103,14 @@ class KupTheme {
|
|
|
5103
5103
|
rgbColor = color;
|
|
5104
5104
|
}
|
|
5105
5105
|
catch (error) {
|
|
5106
|
-
dom$
|
|
5106
|
+
dom$b.ketchup.debug.logMessage('theme-manager', 'Color not converted to rgb values: ' + color + '.');
|
|
5107
5107
|
}
|
|
5108
5108
|
if (!hexColor) {
|
|
5109
5109
|
try {
|
|
5110
5110
|
hexColor = this.rgbToHex(parseInt(values[1]), parseInt(values[2]), parseInt(values[3]));
|
|
5111
5111
|
}
|
|
5112
5112
|
catch (error) {
|
|
5113
|
-
dom$
|
|
5113
|
+
dom$b.ketchup.debug.logMessage('theme-manager', 'Color not converted to hex value: ' + color + '.');
|
|
5114
5114
|
}
|
|
5115
5115
|
}
|
|
5116
5116
|
if (!hslColor || !hslValues) {
|
|
@@ -5123,7 +5123,7 @@ class KupTheme {
|
|
|
5123
5123
|
hslColor = 'hsl(' + hsl.h + ',' + hsl.s + '%,' + hsl.l + '%)';
|
|
5124
5124
|
}
|
|
5125
5125
|
catch (error) {
|
|
5126
|
-
dom$
|
|
5126
|
+
dom$b.ketchup.debug.logMessage('theme-manager', 'Color not converted to hex value: ' + color + '.');
|
|
5127
5127
|
}
|
|
5128
5128
|
}
|
|
5129
5129
|
return {
|
|
@@ -5428,7 +5428,7 @@ class KupTheme {
|
|
|
5428
5428
|
return colorCodes[color.toLowerCase()];
|
|
5429
5429
|
}
|
|
5430
5430
|
else {
|
|
5431
|
-
dom$
|
|
5431
|
+
dom$b.ketchup.debug.logMessage('theme manager', 'Could not decode color ' + color + '!');
|
|
5432
5432
|
return color;
|
|
5433
5433
|
}
|
|
5434
5434
|
}
|
|
@@ -5456,7 +5456,7 @@ var __classPrivateFieldGet$1 = (undefined && undefined.__classPrivateFieldGet) |
|
|
|
5456
5456
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5457
5457
|
};
|
|
5458
5458
|
var _KupToolbar_keyEvent;
|
|
5459
|
-
const dom$
|
|
5459
|
+
const dom$a = document.documentElement;
|
|
5460
5460
|
/**
|
|
5461
5461
|
* Handles component's toolbar.
|
|
5462
5462
|
* @module KupToolbar
|
|
@@ -5474,7 +5474,7 @@ class KupToolbar {
|
|
|
5474
5474
|
KupToolbarModifierKeys.CTRL,
|
|
5475
5475
|
];
|
|
5476
5476
|
__classPrivateFieldSet$1(this, _KupToolbar_keyEvent, function (e) {
|
|
5477
|
-
const toolbar = dom$
|
|
5477
|
+
const toolbar = dom$a.ketchup.toolbar;
|
|
5478
5478
|
if (toolbar.managedElements) {
|
|
5479
5479
|
for (let index = 0; index < toolbar.modifiers.length; index++) {
|
|
5480
5480
|
if (toolbar.modifiers[index] ===
|
|
@@ -5981,16 +5981,6 @@ exports.KupDatesNormalize = void 0;
|
|
|
5981
5981
|
KupDatesNormalize["TIME"] = "time";
|
|
5982
5982
|
KupDatesNormalize["TIMESTAMP"] = "timestamp";
|
|
5983
5983
|
})(exports.KupDatesNormalize || (exports.KupDatesNormalize = {}));
|
|
5984
|
-
/**
|
|
5985
|
-
* Common use formats
|
|
5986
|
-
*/
|
|
5987
|
-
exports.KupDatesFormats = void 0;
|
|
5988
|
-
(function (KupDatesFormats) {
|
|
5989
|
-
KupDatesFormats["ISO_DATE"] = "YYYY-MM-DD";
|
|
5990
|
-
KupDatesFormats["ISO_DATE_TIME"] = "YYYY-MM-DD HH:mm:ss";
|
|
5991
|
-
KupDatesFormats["ISO_TIME"] = "HH:mm:ss";
|
|
5992
|
-
KupDatesFormats["ISO_TIME_WITHOUT_SECONDS"] = "HH:mm";
|
|
5993
|
-
})(exports.KupDatesFormats || (exports.KupDatesFormats = {}));
|
|
5994
5984
|
/**
|
|
5995
5985
|
* Supported locales.
|
|
5996
5986
|
*/
|
|
@@ -6003,432 +5993,28 @@ exports.KupDatesLocales = void 0;
|
|
|
6003
5993
|
KupDatesLocales["POLISH"] = "pl";
|
|
6004
5994
|
KupDatesLocales["RUSSIAN"] = "ru";
|
|
6005
5995
|
KupDatesLocales["SPANISH"] = "es";
|
|
6006
|
-
})(exports.KupDatesLocales || (exports.KupDatesLocales = {}));
|
|
6007
|
-
|
|
6008
|
-
const dom$a = document.documentElement;
|
|
6009
|
-
exports.DateTimeFormatOptionsMonth = void 0;
|
|
6010
|
-
(function (DateTimeFormatOptionsMonth) {
|
|
6011
|
-
DateTimeFormatOptionsMonth["NUMERIC"] = "numeric";
|
|
6012
|
-
DateTimeFormatOptionsMonth["DIGIT2"] = "2-digit";
|
|
6013
|
-
DateTimeFormatOptionsMonth["LONG"] = "long";
|
|
6014
|
-
DateTimeFormatOptionsMonth["SHORT"] = "short";
|
|
6015
|
-
DateTimeFormatOptionsMonth["NARROW"] = "narrow";
|
|
6016
|
-
})(exports.DateTimeFormatOptionsMonth || (exports.DateTimeFormatOptionsMonth = {}));
|
|
6017
|
-
function identify(array) {
|
|
6018
|
-
if (array) {
|
|
6019
|
-
for (let i = 0; i < array.length; i++) {
|
|
6020
|
-
array[i].id = i.toString();
|
|
6021
|
-
}
|
|
6022
|
-
}
|
|
6023
|
-
}
|
|
6024
|
-
function getSeparator(locale, separatorType) {
|
|
6025
|
-
const numberWithGroupAndDecimalSeparator = 1000.1;
|
|
6026
|
-
return Intl.NumberFormat(locale)
|
|
6027
|
-
.formatToParts(numberWithGroupAndDecimalSeparator)
|
|
6028
|
-
.find((part) => part.type === separatorType).value;
|
|
6029
|
-
}
|
|
6030
|
-
function getCurrentTimeFormatFromBrowserLocale(manageSeconds) {
|
|
6031
|
-
const options = {
|
|
6032
|
-
hour: '2-digit',
|
|
6033
|
-
minute: '2-digit',
|
|
6034
|
-
hour12: false,
|
|
6035
|
-
};
|
|
6036
|
-
if (manageSeconds == true) {
|
|
6037
|
-
options.second = '2-digit';
|
|
6038
|
-
}
|
|
6039
|
-
const formatObj = new Intl.DateTimeFormat(dom$a.ketchup.dates.getLocale() + '-u-hc-h23', options).formatToParts(new Date());
|
|
6040
|
-
let timeFormat = formatObj
|
|
6041
|
-
.map((obj) => {
|
|
6042
|
-
switch (obj.type) {
|
|
6043
|
-
case 'hour':
|
|
6044
|
-
return 'HH';
|
|
6045
|
-
case 'minute':
|
|
6046
|
-
return 'mm';
|
|
6047
|
-
case 'second':
|
|
6048
|
-
return 'ss';
|
|
6049
|
-
default:
|
|
6050
|
-
return obj.value;
|
|
6051
|
-
}
|
|
6052
|
-
})
|
|
6053
|
-
.join('');
|
|
6054
|
-
return timeFormat;
|
|
6055
|
-
}
|
|
5996
|
+
})(exports.KupDatesLocales || (exports.KupDatesLocales = {}));
|
|
6056
5997
|
/**
|
|
6057
|
-
*
|
|
6058
|
-
* @param type - type of number for calculate suffix
|
|
6059
|
-
* @returns true if number string in input is a valid number
|
|
5998
|
+
* Format Months
|
|
6060
5999
|
*/
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
return false;
|
|
6070
|
-
}
|
|
6071
|
-
function isNumber(value) {
|
|
6072
|
-
//return typeof value === 'number';
|
|
6073
|
-
return !isNaN(value);
|
|
6074
|
-
}
|
|
6075
|
-
/**
|
|
6076
|
-
* @param input number as string, formatted by locale US, decimal separator . (like java decimal numbers)
|
|
6077
|
-
* @returns number
|
|
6078
|
-
**/
|
|
6079
|
-
function stringToNumber(input) {
|
|
6080
|
-
if (!input || input == null || input.trim() == '') {
|
|
6081
|
-
input = '0';
|
|
6082
|
-
}
|
|
6083
|
-
return dom$a.ketchup.math.numberify(input);
|
|
6084
|
-
}
|
|
6085
|
-
/**
|
|
6086
|
-
* @param input number
|
|
6087
|
-
* @param decimals number of significant decimal digits for output
|
|
6088
|
-
* @returns number as string, formatted by actual browser locale
|
|
6089
|
-
**/
|
|
6090
|
-
function numberToString(input, decimals) {
|
|
6091
|
-
if (input == null) {
|
|
6092
|
-
return '';
|
|
6093
|
-
}
|
|
6094
|
-
return _numberToString(input, decimals, dom$a.ketchup.dates.getLocale(), true);
|
|
6095
|
-
}
|
|
6096
|
-
/**
|
|
6097
|
-
* @param type - type of number for calculate suffix
|
|
6098
|
-
* @returns suffix for number, by type
|
|
6099
|
-
**/
|
|
6100
|
-
function getNumericValueSuffixByType(type) {
|
|
6101
|
-
type = type.toUpperCase();
|
|
6102
|
-
let nstr = '';
|
|
6103
|
-
if (type == 'P') {
|
|
6104
|
-
nstr = ' %';
|
|
6105
|
-
}
|
|
6106
|
-
else if (type == 'VE') {
|
|
6107
|
-
nstr = ' €';
|
|
6108
|
-
}
|
|
6109
|
-
else if (type == 'VL') {
|
|
6110
|
-
nstr = ' £';
|
|
6111
|
-
}
|
|
6112
|
-
else if (type == 'VV') {
|
|
6113
|
-
nstr = ' $';
|
|
6114
|
-
}
|
|
6115
|
-
return nstr;
|
|
6116
|
-
}
|
|
6117
|
-
/**
|
|
6118
|
-
* @param input number
|
|
6119
|
-
* @param decimals number of significant decimal digits for output
|
|
6120
|
-
* @param type - type of number for calculate suffix
|
|
6121
|
-
* @returns number as string, formatted by actual browser locale, with suffix by type
|
|
6122
|
-
**/
|
|
6123
|
-
function numberToFormattedStringNumber(input, decimals, type) {
|
|
6124
|
-
if (input == null || isNaN(input)) {
|
|
6125
|
-
return '';
|
|
6126
|
-
}
|
|
6127
|
-
let nstr = numberToString(input, decimals);
|
|
6128
|
-
nstr = nstr + getNumericValueSuffixByType(type);
|
|
6129
|
-
return nstr;
|
|
6130
|
-
}
|
|
6131
|
-
/**
|
|
6132
|
-
* @param input number as string, formatted by locale US, decimal separator . (like java decimal numbers)
|
|
6133
|
-
* @param decimals number of significant decimal digits for output
|
|
6134
|
-
* @param type - type of number for calculate suffix
|
|
6135
|
-
* @returns number as string, formatted by actual browser locale, with suffix by type
|
|
6136
|
-
**/
|
|
6137
|
-
function unformattedStringToFormattedStringNumber(input, decimals, type) {
|
|
6138
|
-
return numberToFormattedStringNumber(stringToNumber(input), decimals, type);
|
|
6139
|
-
}
|
|
6140
|
-
/**
|
|
6141
|
-
* @param input number as string, formatted by actual browser locale
|
|
6142
|
-
* @param type - type of number for calculate suffix
|
|
6143
|
-
* @returns number as string, formatted by locale US, decimal separator . (like java decimal numbers), without group separator
|
|
6144
|
-
**/
|
|
6145
|
-
function formattedStringToUnformattedStringNumber(input, type) {
|
|
6146
|
-
return numberStringToNumberString(input, type, getDecimalSeparator(dom$a.ketchup.dates.getLocale()));
|
|
6147
|
-
}
|
|
6148
|
-
/**
|
|
6149
|
-
* @param input number as string, formatted by locale US, decimal separator . (like java decimal numbers), with group separator
|
|
6150
|
-
* @param type - type of number for calculate suffix
|
|
6151
|
-
* @returns number as string, formatted by locale US, decimal separator . (like java decimal numbers), without group separator
|
|
6152
|
-
**/
|
|
6153
|
-
function unformattedStringNumberToNumber(input, type) {
|
|
6154
|
-
return numberStringToNumberString(input, type, '.');
|
|
6155
|
-
}
|
|
6156
|
-
function numberStringToNumberString(input, type, decFmt) {
|
|
6157
|
-
if (input == null || input.trim() == '') {
|
|
6158
|
-
return '';
|
|
6159
|
-
}
|
|
6160
|
-
let originalInputValue = input;
|
|
6161
|
-
let suffix = getNumericValueSuffixByType(type);
|
|
6162
|
-
if (suffix != '') {
|
|
6163
|
-
input = input.replace(suffix, '');
|
|
6164
|
-
}
|
|
6165
|
-
let regExpr = null;
|
|
6166
|
-
if (decFmt == '.') {
|
|
6167
|
-
regExpr = /,/g;
|
|
6168
|
-
}
|
|
6169
|
-
else {
|
|
6170
|
-
regExpr = /\./g;
|
|
6171
|
-
}
|
|
6172
|
-
input = input.replace(regExpr, '');
|
|
6173
|
-
if (decFmt != '.') {
|
|
6174
|
-
input = input.replace(/,/g, '.');
|
|
6175
|
-
}
|
|
6176
|
-
if (dom$a.ketchup.math.numberify(input) == null ||
|
|
6177
|
-
isNaN(dom$a.ketchup.math.numberify(input))) {
|
|
6178
|
-
return originalInputValue;
|
|
6179
|
-
}
|
|
6180
|
-
let unf = stringToNumber(input);
|
|
6181
|
-
return _numberToString(unf, -1, 'en-US', false);
|
|
6182
|
-
}
|
|
6183
|
-
function getDecimalSeparator(locale) {
|
|
6184
|
-
return getSeparator(locale, 'decimal');
|
|
6185
|
-
}
|
|
6186
|
-
function countDecimals(value) {
|
|
6187
|
-
if (Math.floor(value) === value)
|
|
6188
|
-
return 0;
|
|
6189
|
-
let stringValue = value.toString().split('.')[1];
|
|
6190
|
-
if (stringValue) {
|
|
6191
|
-
return stringValue.length ? stringValue.length : 0;
|
|
6192
|
-
}
|
|
6193
|
-
else {
|
|
6194
|
-
return 0;
|
|
6195
|
-
}
|
|
6196
|
-
}
|
|
6197
|
-
function _numberToString(input, decimals, locale, useGrouping) {
|
|
6198
|
-
if (input == null) {
|
|
6199
|
-
input = 0;
|
|
6200
|
-
}
|
|
6201
|
-
if (decimals == null || decimals == -1) {
|
|
6202
|
-
decimals = countDecimals(input);
|
|
6203
|
-
}
|
|
6204
|
-
let n = Number(input);
|
|
6205
|
-
let f = decimals > -1
|
|
6206
|
-
? {
|
|
6207
|
-
minimumFractionDigits: decimals,
|
|
6208
|
-
maximumFractionDigits: decimals,
|
|
6209
|
-
useGrouping: useGrouping,
|
|
6210
|
-
}
|
|
6211
|
-
: { useGrouping: useGrouping };
|
|
6212
|
-
return n.toLocaleString(locale, f);
|
|
6213
|
-
}
|
|
6214
|
-
/**
|
|
6215
|
-
* @param time time as Date object
|
|
6216
|
-
* @param manageSeconds flag to set seconds managing
|
|
6217
|
-
* @return time as string, formatted
|
|
6218
|
-
**/
|
|
6219
|
-
function formatTime(time, manageSeconds) {
|
|
6220
|
-
const options = {
|
|
6221
|
-
hour: '2-digit',
|
|
6222
|
-
minute: '2-digit',
|
|
6223
|
-
hour12: false,
|
|
6224
|
-
};
|
|
6225
|
-
if (manageSeconds == true) {
|
|
6226
|
-
options.second = '2-digit';
|
|
6227
|
-
}
|
|
6228
|
-
return time.toLocaleTimeString(dom$a.ketchup.dates.getLocale() + '-u-hc-h23', options);
|
|
6229
|
-
}
|
|
6230
|
-
/**
|
|
6231
|
-
* @param value time string, formatted by actual browser locale
|
|
6232
|
-
* @returns true if time string in input is a valid time
|
|
6233
|
-
*/
|
|
6234
|
-
function isValidFormattedStringTime(value, manageSeconds) {
|
|
6235
|
-
let format = getCurrentTimeFormatFromBrowserLocale(manageSeconds);
|
|
6236
|
-
return dom$a.ketchup.dates.isValid(value, format, true);
|
|
6237
|
-
}
|
|
6000
|
+
exports.KupDateTimeFormatOptionsMonth = void 0;
|
|
6001
|
+
(function (KupDateTimeFormatOptionsMonth) {
|
|
6002
|
+
KupDateTimeFormatOptionsMonth["NUMERIC"] = "numeric";
|
|
6003
|
+
KupDateTimeFormatOptionsMonth["DIGIT2"] = "2-digit";
|
|
6004
|
+
KupDateTimeFormatOptionsMonth["LONG"] = "long";
|
|
6005
|
+
KupDateTimeFormatOptionsMonth["SHORT"] = "short";
|
|
6006
|
+
KupDateTimeFormatOptionsMonth["NARROW"] = "narrow";
|
|
6007
|
+
})(exports.KupDateTimeFormatOptionsMonth || (exports.KupDateTimeFormatOptionsMonth = {}));
|
|
6238
6008
|
/**
|
|
6239
|
-
*
|
|
6240
|
-
* @returns date/time as string, formatted ISO
|
|
6241
|
-
**/
|
|
6242
|
-
function formattedStringToDefaultUnformattedStringTimestamp(value) {
|
|
6243
|
-
return formattedStringToCustomUnformattedStringTime(value, exports.KupDatesFormats.ISO_DATE_TIME, true);
|
|
6244
|
-
}
|
|
6245
|
-
/**
|
|
6246
|
-
* @param value time as string, formatted by actual browser locale
|
|
6247
|
-
* @param outputFormat time format to return
|
|
6248
|
-
* @param manageSeconds flag to set seconds managing
|
|
6249
|
-
* @returns time as string, formatted
|
|
6250
|
-
**/
|
|
6251
|
-
function formattedStringToCustomUnformattedStringTime(value, outputFormat, manageSeconds) {
|
|
6252
|
-
let inputFormat = getCurrentTimeFormatFromBrowserLocale(manageSeconds);
|
|
6253
|
-
if (dom$a.ketchup.dates.isValid(value, inputFormat)) {
|
|
6254
|
-
return dom$a.ketchup.dates.format(dom$a.ketchup.dates.normalize(value, exports.KupDatesNormalize.TIME), outputFormat);
|
|
6255
|
-
}
|
|
6256
|
-
else {
|
|
6257
|
-
return '';
|
|
6258
|
-
}
|
|
6259
|
-
}
|
|
6260
|
-
/**
|
|
6261
|
-
* @param value time as string, formatted ISO
|
|
6262
|
-
* @param manageSeconds flag to set seconds managing
|
|
6263
|
-
* @param valueTimeFormat time format (default ISO)
|
|
6264
|
-
* @param customedFormat time format from smeupObject
|
|
6265
|
-
* @returns time as string, formatted by actual browser locale
|
|
6266
|
-
**/
|
|
6267
|
-
function unformattedStringToFormattedStringTime(value, manageSeconds, customedFormat) {
|
|
6268
|
-
const options = {
|
|
6269
|
-
hour: '2-digit',
|
|
6270
|
-
minute: '2-digit',
|
|
6271
|
-
hour12: false,
|
|
6272
|
-
};
|
|
6273
|
-
if (manageSeconds == true) {
|
|
6274
|
-
options.second = '2-digit';
|
|
6275
|
-
}
|
|
6276
|
-
let date = dom$a.ketchup.dates.toDate(dom$a.ketchup.dates.normalize(value, exports.KupDatesNormalize.TIME));
|
|
6277
|
-
return formatByCustomedOutputTimeFormat(value, date, options, customedFormat);
|
|
6278
|
-
}
|
|
6279
|
-
function formatByCustomedOutputTimeFormat(valueStr, date, options, customedFormat) {
|
|
6280
|
-
if (customedFormat == null) {
|
|
6281
|
-
return date.toLocaleTimeString(dom$a.ketchup.dates.getLocale() + '-u-hc-h23', options);
|
|
6282
|
-
}
|
|
6283
|
-
switch (customedFormat) {
|
|
6284
|
-
case 'I13': {
|
|
6285
|
-
//hh:mm
|
|
6286
|
-
break;
|
|
6287
|
-
}
|
|
6288
|
-
case 'I12': {
|
|
6289
|
-
//hh:mm:ss
|
|
6290
|
-
break;
|
|
6291
|
-
}
|
|
6292
|
-
case 'I11': {
|
|
6293
|
-
//???
|
|
6294
|
-
//hh:dddd
|
|
6295
|
-
//return moment(date).format('HH:DDDD');
|
|
6296
|
-
return valueStr;
|
|
6297
|
-
}
|
|
6298
|
-
case 'I14': {
|
|
6299
|
-
//???
|
|
6300
|
-
//sssss
|
|
6301
|
-
//return moment(date).format('SSSSS');
|
|
6302
|
-
return valueStr;
|
|
6303
|
-
}
|
|
6304
|
-
case 'I1H': {
|
|
6305
|
-
//???
|
|
6306
|
-
//Ora,Cen/Min HH,xx
|
|
6307
|
-
return valueStr;
|
|
6308
|
-
}
|
|
6309
|
-
case 'I1M': {
|
|
6310
|
-
//???
|
|
6311
|
-
//Min,Cen/Sec MMMM,xx
|
|
6312
|
-
return valueStr;
|
|
6313
|
-
}
|
|
6314
|
-
case 'I21': {
|
|
6315
|
-
//???
|
|
6316
|
-
//Giorni,(4 decim)
|
|
6317
|
-
return valueStr;
|
|
6318
|
-
}
|
|
6319
|
-
case 'I22': {
|
|
6320
|
-
//???
|
|
6321
|
-
//Ore,(4 decim)
|
|
6322
|
-
return valueStr;
|
|
6323
|
-
}
|
|
6324
|
-
case 'I23': {
|
|
6325
|
-
//???
|
|
6326
|
-
//Minuti,(4 decim)
|
|
6327
|
-
return valueStr;
|
|
6328
|
-
}
|
|
6329
|
-
case 'I24': {
|
|
6330
|
-
//???
|
|
6331
|
-
//Secondi
|
|
6332
|
-
return valueStr;
|
|
6333
|
-
}
|
|
6334
|
-
case 'I2H': {
|
|
6335
|
-
//???
|
|
6336
|
-
//Ora,Cen/Min HHHH,xx
|
|
6337
|
-
return valueStr;
|
|
6338
|
-
}
|
|
6339
|
-
case 'I2D': {
|
|
6340
|
-
//???
|
|
6341
|
-
//Ore Minuti Secondi HHMMS
|
|
6342
|
-
return valueStr;
|
|
6343
|
-
}
|
|
6344
|
-
case 'I2M': {
|
|
6345
|
-
//???
|
|
6346
|
-
//Min,Cen/Sec MMMM,xx
|
|
6347
|
-
return valueStr;
|
|
6348
|
-
}
|
|
6349
|
-
}
|
|
6350
|
-
return date.toLocaleTimeString(dom$a.ketchup.dates.getLocale() + '-u-hc-h23', options);
|
|
6351
|
-
}
|
|
6352
|
-
/**
|
|
6353
|
-
* @param value date/time as string, formatted ISO
|
|
6354
|
-
* @param valueDateFormat date/time format (default ISO)
|
|
6355
|
-
* @returns date/time as string, formatted by actual browser locale
|
|
6356
|
-
**/
|
|
6357
|
-
function unformattedStringToFormattedStringTimestamp(value) {
|
|
6358
|
-
const options = {
|
|
6359
|
-
day: '2-digit',
|
|
6360
|
-
month: '2-digit',
|
|
6361
|
-
year: 'numeric',
|
|
6362
|
-
hour: '2-digit',
|
|
6363
|
-
minute: '2-digit',
|
|
6364
|
-
second: '2-digit',
|
|
6365
|
-
hour12: false,
|
|
6366
|
-
};
|
|
6367
|
-
let date = dom$a.ketchup.dates.toDate(dom$a.ketchup.dates.normalize(value, exports.KupDatesNormalize.TIMESTAMP));
|
|
6368
|
-
return date.toLocaleString(dom$a.ketchup.dates.getLocale() + '-u-hc-h23', options);
|
|
6369
|
-
}
|
|
6370
|
-
function getMonthAsStringByLocale(month, format) {
|
|
6371
|
-
if (month == null) {
|
|
6372
|
-
return '';
|
|
6373
|
-
}
|
|
6374
|
-
const dateTmp = new Date();
|
|
6375
|
-
dateTmp.setDate(1);
|
|
6376
|
-
dateTmp.setMonth(month - 1);
|
|
6377
|
-
const options = {
|
|
6378
|
-
month: format,
|
|
6379
|
-
};
|
|
6380
|
-
const dateTimeFormat = new Intl.DateTimeFormat(dom$a.ketchup.dates.getLocale(), options);
|
|
6381
|
-
return dateTimeFormat.format(dateTmp);
|
|
6382
|
-
}
|
|
6383
|
-
function getMonthsAsStringByLocale(format) {
|
|
6384
|
-
if (format == null || format.trim() == '') {
|
|
6385
|
-
format = exports.DateTimeFormatOptionsMonth.LONG;
|
|
6386
|
-
}
|
|
6387
|
-
var months = [];
|
|
6388
|
-
for (var i = 0; i < 12; i++) {
|
|
6389
|
-
months[i] = getMonthAsStringByLocale(i + 1, format);
|
|
6390
|
-
}
|
|
6391
|
-
return months;
|
|
6392
|
-
}
|
|
6393
|
-
/**
|
|
6394
|
-
* Used to retrieve component's props values.
|
|
6395
|
-
* @param {any} comp - Component calling this function.
|
|
6396
|
-
* @param {GenericObject} list - Prop list, specific for each component.
|
|
6397
|
-
* @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
|
|
6398
|
-
* @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
|
|
6399
|
-
*/
|
|
6400
|
-
function getProps(comp, list, descriptions) {
|
|
6401
|
-
let props = {};
|
|
6402
|
-
if (descriptions) {
|
|
6403
|
-
props = list;
|
|
6404
|
-
}
|
|
6405
|
-
else {
|
|
6406
|
-
for (const key in list) {
|
|
6407
|
-
if (Object.prototype.hasOwnProperty.call(list, key)) {
|
|
6408
|
-
props[key] = comp[key];
|
|
6409
|
-
}
|
|
6410
|
-
}
|
|
6411
|
-
}
|
|
6412
|
-
return props;
|
|
6413
|
-
}
|
|
6414
|
-
/**
|
|
6415
|
-
* Sets the props to the component.
|
|
6416
|
-
* @param {any} comp - Component calling this function.
|
|
6417
|
-
* @param {GenericObject} list - Prop list, specific for each component.
|
|
6418
|
-
* @param {GenericObject} props - Prop to be set.
|
|
6009
|
+
* Common use formats
|
|
6419
6010
|
*/
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
// Otherwise, it will be set on its HTML element (i.e.: "id", "style", ecc.)
|
|
6428
|
-
comp.rootElement[key] = props[key];
|
|
6429
|
-
}
|
|
6430
|
-
}
|
|
6431
|
-
}
|
|
6011
|
+
exports.KupDatesFormats = void 0;
|
|
6012
|
+
(function (KupDatesFormats) {
|
|
6013
|
+
KupDatesFormats["ISO_DATE"] = "YYYY-MM-DD";
|
|
6014
|
+
KupDatesFormats["ISO_DATE_TIME"] = "YYYY-MM-DD HH:mm:ss";
|
|
6015
|
+
KupDatesFormats["ISO_TIME"] = "HH:mm:ss";
|
|
6016
|
+
KupDatesFormats["ISO_TIME_WITHOUT_SECONDS"] = "HH:mm";
|
|
6017
|
+
})(exports.KupDatesFormats || (exports.KupDatesFormats = {}));
|
|
6432
6018
|
|
|
6433
6019
|
const dom$9 = document.documentElement;
|
|
6434
6020
|
// -------------
|
|
@@ -6473,17 +6059,17 @@ function getValueForDisplay(value, obj, decimals) {
|
|
|
6473
6059
|
return value;
|
|
6474
6060
|
}
|
|
6475
6061
|
if (dom$9.ketchup.objects.isNumber(obj)) {
|
|
6476
|
-
return
|
|
6062
|
+
return dom$9.ketchup.math.numberStringToFormattedString(value, decimals ? decimals : -1, obj ? obj.p : '');
|
|
6477
6063
|
}
|
|
6478
6064
|
if (dom$9.ketchup.objects.isDate(obj) &&
|
|
6479
6065
|
dom$9.ketchup.dates.isValid(value, exports.KupDatesFormats.ISO_DATE)) {
|
|
6480
6066
|
return dom$9.ketchup.dates.format(value);
|
|
6481
6067
|
}
|
|
6482
6068
|
if (dom$9.ketchup.objects.isTime(obj)) {
|
|
6483
|
-
return
|
|
6069
|
+
return dom$9.ketchup.dates.timeStringToFormattedString(value, dom$9.ketchup.objects.isTimeWithSeconds(obj), obj.t + obj.p);
|
|
6484
6070
|
}
|
|
6485
6071
|
if (dom$9.ketchup.objects.isTimestamp(obj)) {
|
|
6486
|
-
return
|
|
6072
|
+
return dom$9.ketchup.dates.timestampStringToFormattedString(value);
|
|
6487
6073
|
}
|
|
6488
6074
|
return value;
|
|
6489
6075
|
}
|
|
@@ -6528,8 +6114,8 @@ function compareValues(obj1, value1, obj2, value2, sortMode) {
|
|
|
6528
6114
|
let v1 = s1;
|
|
6529
6115
|
let v2 = s2;
|
|
6530
6116
|
if (dom$9.ketchup.objects.isNumber(obj1)) {
|
|
6531
|
-
v1 =
|
|
6532
|
-
v2 =
|
|
6117
|
+
v1 = dom$9.ketchup.math.numberifySafe(s1);
|
|
6118
|
+
v2 = dom$9.ketchup.math.numberifySafe(s2);
|
|
6533
6119
|
}
|
|
6534
6120
|
else if (dom$9.ketchup.objects.isDate(obj1)) {
|
|
6535
6121
|
v1 = dom$9.ketchup.dates.toDate(dom$9.ketchup.dates.format(s1, exports.KupDatesFormats.ISO_DATE));
|
|
@@ -6662,8 +6248,8 @@ class Filters {
|
|
|
6662
6248
|
: exports.KupDatesFormats.ISO_TIME_WITHOUT_SECONDS)) {
|
|
6663
6249
|
return newValue;
|
|
6664
6250
|
}
|
|
6665
|
-
if (isValidFormattedStringTime(value, manageSeconds)) {
|
|
6666
|
-
return
|
|
6251
|
+
if (dom$8.ketchup.dates.isValidFormattedStringTime(value, manageSeconds)) {
|
|
6252
|
+
return dom$8.ketchup.dates.formattedStringToCustomDateTime(value, manageSeconds
|
|
6667
6253
|
? exports.KupDatesFormats.ISO_TIME
|
|
6668
6254
|
: exports.KupDatesFormats.ISO_TIME_WITHOUT_SECONDS, manageSeconds);
|
|
6669
6255
|
}
|
|
@@ -6672,13 +6258,13 @@ class Filters {
|
|
|
6672
6258
|
if (dom$8.ketchup.dates.isValid(value, exports.KupDatesFormats.ISO_DATE_TIME)) {
|
|
6673
6259
|
return newValue;
|
|
6674
6260
|
}
|
|
6675
|
-
if (isValidFormattedStringTime(value, true)) {
|
|
6676
|
-
return
|
|
6261
|
+
if (dom$8.ketchup.dates.isValidFormattedStringTime(value, true)) {
|
|
6262
|
+
return dom$8.ketchup.dates.formattedStringToTimestampString(value);
|
|
6677
6263
|
}
|
|
6678
6264
|
}
|
|
6679
6265
|
else if (dom$8.ketchup.objects.isNumber(smeupObj)) {
|
|
6680
|
-
if (
|
|
6681
|
-
return
|
|
6266
|
+
if (dom$8.ketchup.math.isStringNumber(value, smeupObj ? smeupObj.p : '')) {
|
|
6267
|
+
return dom$8.ketchup.math.formattedStringToNumberString(value, smeupObj ? smeupObj.p : '');
|
|
6682
6268
|
}
|
|
6683
6269
|
}
|
|
6684
6270
|
return newValue;
|
|
@@ -6800,12 +6386,11 @@ class Filters {
|
|
|
6800
6386
|
}
|
|
6801
6387
|
let checkByRegularExpression = true;
|
|
6802
6388
|
if (dom$8.ketchup.objects.isNumber(obj)) {
|
|
6803
|
-
|
|
6804
|
-
let valueNumber = stringToNumber(value);
|
|
6389
|
+
let valueNumber = dom$8.ketchup.math.numberifySafe(value, obj ? obj.p : '');
|
|
6805
6390
|
if (from != '') {
|
|
6806
|
-
if (isNumber(from)) {
|
|
6391
|
+
if (dom$8.ketchup.math.isNumber(from)) {
|
|
6807
6392
|
checkByRegularExpression = false;
|
|
6808
|
-
let fromNumber =
|
|
6393
|
+
let fromNumber = dom$8.ketchup.math.numberifySafe(from);
|
|
6809
6394
|
if (valueNumber < fromNumber) {
|
|
6810
6395
|
return false;
|
|
6811
6396
|
}
|
|
@@ -6815,9 +6400,9 @@ class Filters {
|
|
|
6815
6400
|
}
|
|
6816
6401
|
}
|
|
6817
6402
|
if (to != '') {
|
|
6818
|
-
if (isNumber(to)) {
|
|
6403
|
+
if (dom$8.ketchup.math.isNumber(to)) {
|
|
6819
6404
|
checkByRegularExpression = false;
|
|
6820
|
-
let toNumber =
|
|
6405
|
+
let toNumber = dom$8.ketchup.math.numberifySafe(to);
|
|
6821
6406
|
if (valueNumber > toNumber) {
|
|
6822
6407
|
return false;
|
|
6823
6408
|
}
|
|
@@ -7842,9 +7427,11 @@ class KupData {
|
|
|
7842
7427
|
}
|
|
7843
7428
|
else {
|
|
7844
7429
|
n = dom$4.ketchup.math.numberify(cell.value);
|
|
7430
|
+
const nMax = dom$4.ketchup.math.numberify(max);
|
|
7431
|
+
const nMin = dom$4.ketchup.math.numberify(min);
|
|
7845
7432
|
if (n === max ||
|
|
7846
7433
|
n === min ||
|
|
7847
|
-
(n <
|
|
7434
|
+
(n < nMax && n > nMin)) {
|
|
7848
7435
|
result.cells.push(cell);
|
|
7849
7436
|
result.rows.push(row);
|
|
7850
7437
|
}
|
|
@@ -8234,6 +7821,59 @@ class KupDates {
|
|
|
8234
7821
|
.filter((value) => typeof value === 'string');
|
|
8235
7822
|
return items;
|
|
8236
7823
|
}
|
|
7824
|
+
/**
|
|
7825
|
+
* Gets date format by browser locale
|
|
7826
|
+
* @returns {string} date format pattern, by browser locale
|
|
7827
|
+
*/
|
|
7828
|
+
getDateFormat() {
|
|
7829
|
+
const formatObj = new Intl.DateTimeFormat(this.getLocale()).formatToParts(new Date());
|
|
7830
|
+
let dateFormat = formatObj
|
|
7831
|
+
.map((obj) => {
|
|
7832
|
+
switch (obj.type) {
|
|
7833
|
+
case 'day':
|
|
7834
|
+
return 'DD';
|
|
7835
|
+
case 'month':
|
|
7836
|
+
return 'MM';
|
|
7837
|
+
case 'year':
|
|
7838
|
+
return 'YYYY';
|
|
7839
|
+
default:
|
|
7840
|
+
return obj.value;
|
|
7841
|
+
}
|
|
7842
|
+
})
|
|
7843
|
+
.join('');
|
|
7844
|
+
return dateFormat;
|
|
7845
|
+
}
|
|
7846
|
+
/**
|
|
7847
|
+
* Gets time format by browser locale
|
|
7848
|
+
* @param {boolean} manageSeconds flag to set seconds managing
|
|
7849
|
+
* @returns {string} time format pattern, by browser locale
|
|
7850
|
+
*/
|
|
7851
|
+
getTimeFormat(manageSeconds) {
|
|
7852
|
+
const options = {
|
|
7853
|
+
hour: '2-digit',
|
|
7854
|
+
minute: '2-digit',
|
|
7855
|
+
hour12: false,
|
|
7856
|
+
};
|
|
7857
|
+
if (manageSeconds == true) {
|
|
7858
|
+
options.second = '2-digit';
|
|
7859
|
+
}
|
|
7860
|
+
const formatObj = new Intl.DateTimeFormat(this.getLocale() + '-u-hc-h23', options).formatToParts(new Date());
|
|
7861
|
+
let timeFormat = formatObj
|
|
7862
|
+
.map((obj) => {
|
|
7863
|
+
switch (obj.type) {
|
|
7864
|
+
case 'hour':
|
|
7865
|
+
return 'HH';
|
|
7866
|
+
case 'minute':
|
|
7867
|
+
return 'mm';
|
|
7868
|
+
case 'second':
|
|
7869
|
+
return 'ss';
|
|
7870
|
+
default:
|
|
7871
|
+
return obj.value;
|
|
7872
|
+
}
|
|
7873
|
+
})
|
|
7874
|
+
.join('');
|
|
7875
|
+
return timeFormat;
|
|
7876
|
+
}
|
|
8237
7877
|
/**
|
|
8238
7878
|
* Formats the given date.
|
|
8239
7879
|
* @param {dayjs.ConfigType} input - Date to be formatted.
|
|
@@ -8246,6 +7886,23 @@ class KupDates {
|
|
|
8246
7886
|
}
|
|
8247
7887
|
return dayjs_min(input).format(format);
|
|
8248
7888
|
}
|
|
7889
|
+
/**
|
|
7890
|
+
* Gets the time formatted
|
|
7891
|
+
* @param {Date} time time as Date object
|
|
7892
|
+
* @param {boolean} manageSeconds flag to set seconds managing
|
|
7893
|
+
* @return {string} time as string, formatted
|
|
7894
|
+
**/
|
|
7895
|
+
formatTime(time, manageSeconds) {
|
|
7896
|
+
const options = {
|
|
7897
|
+
hour: '2-digit',
|
|
7898
|
+
minute: '2-digit',
|
|
7899
|
+
hour12: false,
|
|
7900
|
+
};
|
|
7901
|
+
if (manageSeconds == true) {
|
|
7902
|
+
options.second = '2-digit';
|
|
7903
|
+
}
|
|
7904
|
+
return time.toLocaleTimeString(this.getLocale() + '-u-hc-h23', options);
|
|
7905
|
+
}
|
|
8249
7906
|
/**
|
|
8250
7907
|
* Validates the given date.
|
|
8251
7908
|
* @param {dayjs.ConfigType} date - Date to be validated.
|
|
@@ -8261,6 +7918,16 @@ class KupDates {
|
|
|
8261
7918
|
return dayjs_min(date, undefined, strict).isValid();
|
|
8262
7919
|
}
|
|
8263
7920
|
}
|
|
7921
|
+
/**
|
|
7922
|
+
* Validates the given date as string.
|
|
7923
|
+
* @param {string} value time string, formatted by actual browser locale
|
|
7924
|
+
* @param {boolean} manageSeconds if manage seconds
|
|
7925
|
+
* @returns {boolean} true if time string in input is a valid time
|
|
7926
|
+
*/
|
|
7927
|
+
isValidFormattedStringTime(value, manageSeconds) {
|
|
7928
|
+
let format = this.getTimeFormat(manageSeconds);
|
|
7929
|
+
return this.isValid(value, format, true);
|
|
7930
|
+
}
|
|
8264
7931
|
/**
|
|
8265
7932
|
* Converts the input in a Date object.
|
|
8266
7933
|
* @param {dayjs.ConfigType} input - Input date.
|
|
@@ -8469,6 +8136,237 @@ class KupDates {
|
|
|
8469
8136
|
subtract(input, value, unit) {
|
|
8470
8137
|
return dayjs_min(input).subtract(value, unit);
|
|
8471
8138
|
}
|
|
8139
|
+
/**
|
|
8140
|
+
* Gets the month formatted
|
|
8141
|
+
* @param {number} month month id
|
|
8142
|
+
* @param {KupDateTimeFormatOptionsMonth} format format
|
|
8143
|
+
* @returns {string} the month formatted, by browser locale
|
|
8144
|
+
*/
|
|
8145
|
+
getMonthAsString(month, format) {
|
|
8146
|
+
if (month == null) {
|
|
8147
|
+
return '';
|
|
8148
|
+
}
|
|
8149
|
+
const dateTmp = new Date();
|
|
8150
|
+
dateTmp.setDate(1);
|
|
8151
|
+
dateTmp.setMonth(month - 1);
|
|
8152
|
+
const options = {
|
|
8153
|
+
month: format,
|
|
8154
|
+
};
|
|
8155
|
+
const dateTimeFormat = new Intl.DateTimeFormat(this.getLocale(), options);
|
|
8156
|
+
return dateTimeFormat.format(dateTmp);
|
|
8157
|
+
}
|
|
8158
|
+
/**
|
|
8159
|
+
* Gets the year months formatted
|
|
8160
|
+
* @param {KupDateTimeFormatOptionsMonth} format format
|
|
8161
|
+
* @returns {string[]} the months formatted, by browser locale
|
|
8162
|
+
*/
|
|
8163
|
+
getMonthsAsString(format) {
|
|
8164
|
+
if (format == null || format.trim() == '') {
|
|
8165
|
+
format = exports.KupDateTimeFormatOptionsMonth.LONG;
|
|
8166
|
+
}
|
|
8167
|
+
var months = [];
|
|
8168
|
+
for (var i = 0; i < 12; i++) {
|
|
8169
|
+
months[i] = this.getMonthAsString(i + 1, format);
|
|
8170
|
+
}
|
|
8171
|
+
return months;
|
|
8172
|
+
}
|
|
8173
|
+
/**
|
|
8174
|
+
* Gets the day formatted
|
|
8175
|
+
* @param {Date} date date
|
|
8176
|
+
* @returns {string} the day formatted, by browser locale
|
|
8177
|
+
*/
|
|
8178
|
+
getDayAsString(date) {
|
|
8179
|
+
if (date == null) {
|
|
8180
|
+
return '';
|
|
8181
|
+
}
|
|
8182
|
+
const options = {
|
|
8183
|
+
weekday: 'narrow',
|
|
8184
|
+
/** weekday: 'narrow' 'short' 'long' */
|
|
8185
|
+
};
|
|
8186
|
+
const dateTimeFormat = new Intl.DateTimeFormat(this.getLocale(), options);
|
|
8187
|
+
return dateTimeFormat.format(date);
|
|
8188
|
+
}
|
|
8189
|
+
/**
|
|
8190
|
+
* First day of current week
|
|
8191
|
+
* @param {number} firstDayIndex first day of week index
|
|
8192
|
+
* @returns {Date} the first day of current week
|
|
8193
|
+
*/
|
|
8194
|
+
firstDayThisWeek(firstDayIndex) {
|
|
8195
|
+
var d = new Date();
|
|
8196
|
+
const day = d.getDay();
|
|
8197
|
+
// dayIndex0
|
|
8198
|
+
d.setDate(d.getDate() - day);
|
|
8199
|
+
// dayIndexX
|
|
8200
|
+
d.setDate(d.getDate() + firstDayIndex);
|
|
8201
|
+
return d;
|
|
8202
|
+
}
|
|
8203
|
+
/**
|
|
8204
|
+
* Dates of current week
|
|
8205
|
+
* @param {number} firstDayIndex first day of week index
|
|
8206
|
+
* @returns { startDate: Date; endDate: Date } the dates of current week
|
|
8207
|
+
*/
|
|
8208
|
+
thisWeek(firstDayIndex) {
|
|
8209
|
+
const firstDay = this.firstDayThisWeek(firstDayIndex);
|
|
8210
|
+
return {
|
|
8211
|
+
startDate: firstDay,
|
|
8212
|
+
endDate: offsetDate(firstDay, 6),
|
|
8213
|
+
};
|
|
8214
|
+
function offsetDate(base, count) {
|
|
8215
|
+
const date = new Date(base);
|
|
8216
|
+
date.setDate(base.getDate() + count);
|
|
8217
|
+
return date;
|
|
8218
|
+
}
|
|
8219
|
+
}
|
|
8220
|
+
/**
|
|
8221
|
+
* Gets the days of current week as string
|
|
8222
|
+
* @param {number} firstDayIndex first day of week index
|
|
8223
|
+
* @returns {string[]} the days of current week as string
|
|
8224
|
+
*/
|
|
8225
|
+
getDaysOfWeekAsString(firstDayIndex) {
|
|
8226
|
+
var thisWeekDays = this.thisWeek(firstDayIndex);
|
|
8227
|
+
var monday = thisWeekDays.startDate;
|
|
8228
|
+
var days = [];
|
|
8229
|
+
for (var i = 0; i < 7; i++) {
|
|
8230
|
+
var date = new Date(monday.toISOString());
|
|
8231
|
+
date.setDate(date.getDate() + i);
|
|
8232
|
+
days[i] = this.getDayAsString(date);
|
|
8233
|
+
}
|
|
8234
|
+
return days;
|
|
8235
|
+
}
|
|
8236
|
+
/**
|
|
8237
|
+
* Gets the timestamp formatted
|
|
8238
|
+
* @param {string} value date/time as string, formatted ISO
|
|
8239
|
+
* @returns {string} date/time as string, formatted by actual browser locale
|
|
8240
|
+
**/
|
|
8241
|
+
timestampStringToFormattedString(value) {
|
|
8242
|
+
const options = {
|
|
8243
|
+
day: '2-digit',
|
|
8244
|
+
month: '2-digit',
|
|
8245
|
+
year: 'numeric',
|
|
8246
|
+
hour: '2-digit',
|
|
8247
|
+
minute: '2-digit',
|
|
8248
|
+
second: '2-digit',
|
|
8249
|
+
hour12: false,
|
|
8250
|
+
};
|
|
8251
|
+
let date = this.toDate(this.normalize(value, exports.KupDatesNormalize.TIMESTAMP));
|
|
8252
|
+
return date.toLocaleString(this.getLocale() + '-u-hc-h23', options);
|
|
8253
|
+
}
|
|
8254
|
+
/**
|
|
8255
|
+
* Gets ISO date/time from formatted string, as string
|
|
8256
|
+
* @param {string} value date/time as string, formatted by actual browser locale
|
|
8257
|
+
* @returns {string} date/time as string, formatted ISO
|
|
8258
|
+
**/
|
|
8259
|
+
formattedStringToTimestampString(value) {
|
|
8260
|
+
return this.formattedStringToCustomDateTime(value, exports.KupDatesFormats.ISO_DATE_TIME, true);
|
|
8261
|
+
}
|
|
8262
|
+
/**
|
|
8263
|
+
* Gets formatted dateTime as customed ISO (see KupDatesFormats)
|
|
8264
|
+
* @param {string} value time as string, formatted by actual browser locale
|
|
8265
|
+
* @param {string} outputFormat time format to return (see KupDatesFormats)
|
|
8266
|
+
* @param {boolean} manageSeconds flag to set seconds managing
|
|
8267
|
+
* @returns {string} time as string, formatted
|
|
8268
|
+
**/
|
|
8269
|
+
formattedStringToCustomDateTime(value, outputFormat, manageSeconds) {
|
|
8270
|
+
let inputFormat = this.getTimeFormat(manageSeconds);
|
|
8271
|
+
if (this.isValid(value, inputFormat)) {
|
|
8272
|
+
return this.format(this.normalize(value, exports.KupDatesNormalize.TIME), outputFormat);
|
|
8273
|
+
}
|
|
8274
|
+
else {
|
|
8275
|
+
return '';
|
|
8276
|
+
}
|
|
8277
|
+
}
|
|
8278
|
+
/**
|
|
8279
|
+
* Gets the time formatted
|
|
8280
|
+
* @param {string} value time as string, formatted ISO
|
|
8281
|
+
* @param {boolean} manageSeconds flag to set seconds managing
|
|
8282
|
+
* @param {string} customedFormat time format from smeupObject
|
|
8283
|
+
* @returns {string} time as string, formatted by actual browser locale
|
|
8284
|
+
**/
|
|
8285
|
+
timeStringToFormattedString(value, manageSeconds, customedFormat) {
|
|
8286
|
+
const options = {
|
|
8287
|
+
hour: '2-digit',
|
|
8288
|
+
minute: '2-digit',
|
|
8289
|
+
hour12: false,
|
|
8290
|
+
};
|
|
8291
|
+
if (manageSeconds == true) {
|
|
8292
|
+
options.second = '2-digit';
|
|
8293
|
+
}
|
|
8294
|
+
let date = this.toDate(this.normalize(value, exports.KupDatesNormalize.TIME));
|
|
8295
|
+
return formatByCustomedOutputTimeFormat(value, date, options, customedFormat, this);
|
|
8296
|
+
function formatByCustomedOutputTimeFormat(valueStr, date, options, customedFormat, kupDates) {
|
|
8297
|
+
if (customedFormat == null) {
|
|
8298
|
+
return date.toLocaleTimeString(kupDates.getLocale() + '-u-hc-h23', options);
|
|
8299
|
+
}
|
|
8300
|
+
switch (customedFormat) {
|
|
8301
|
+
case 'I13': {
|
|
8302
|
+
//hh:mm
|
|
8303
|
+
break;
|
|
8304
|
+
}
|
|
8305
|
+
case 'I12': {
|
|
8306
|
+
//hh:mm:ss
|
|
8307
|
+
break;
|
|
8308
|
+
}
|
|
8309
|
+
case 'I11': {
|
|
8310
|
+
//???
|
|
8311
|
+
//hh:dddd
|
|
8312
|
+
//return moment(date).format('HH:DDDD');
|
|
8313
|
+
return valueStr;
|
|
8314
|
+
}
|
|
8315
|
+
case 'I14': {
|
|
8316
|
+
//???
|
|
8317
|
+
//sssss
|
|
8318
|
+
//return moment(date).format('SSSSS');
|
|
8319
|
+
return valueStr;
|
|
8320
|
+
}
|
|
8321
|
+
case 'I1H': {
|
|
8322
|
+
//???
|
|
8323
|
+
//Ora,Cen/Min HH,xx
|
|
8324
|
+
return valueStr;
|
|
8325
|
+
}
|
|
8326
|
+
case 'I1M': {
|
|
8327
|
+
//???
|
|
8328
|
+
//Min,Cen/Sec MMMM,xx
|
|
8329
|
+
return valueStr;
|
|
8330
|
+
}
|
|
8331
|
+
case 'I21': {
|
|
8332
|
+
//???
|
|
8333
|
+
//Giorni,(4 decim)
|
|
8334
|
+
return valueStr;
|
|
8335
|
+
}
|
|
8336
|
+
case 'I22': {
|
|
8337
|
+
//???
|
|
8338
|
+
//Ore,(4 decim)
|
|
8339
|
+
return valueStr;
|
|
8340
|
+
}
|
|
8341
|
+
case 'I23': {
|
|
8342
|
+
//???
|
|
8343
|
+
//Minuti,(4 decim)
|
|
8344
|
+
return valueStr;
|
|
8345
|
+
}
|
|
8346
|
+
case 'I24': {
|
|
8347
|
+
//???
|
|
8348
|
+
//Secondi
|
|
8349
|
+
return valueStr;
|
|
8350
|
+
}
|
|
8351
|
+
case 'I2H': {
|
|
8352
|
+
//???
|
|
8353
|
+
//Ora,Cen/Min HHHH,xx
|
|
8354
|
+
return valueStr;
|
|
8355
|
+
}
|
|
8356
|
+
case 'I2D': {
|
|
8357
|
+
//???
|
|
8358
|
+
//Ore Minuti Secondi HHMMS
|
|
8359
|
+
return valueStr;
|
|
8360
|
+
}
|
|
8361
|
+
case 'I2M': {
|
|
8362
|
+
//???
|
|
8363
|
+
//Min,Cen/Sec MMMM,xx
|
|
8364
|
+
return valueStr;
|
|
8365
|
+
}
|
|
8366
|
+
}
|
|
8367
|
+
return date.toLocaleTimeString(kupDates.getLocale() + '-u-hc-h23', options);
|
|
8368
|
+
}
|
|
8369
|
+
}
|
|
8472
8370
|
/**
|
|
8473
8371
|
* Registers a KupComponent in KupDates, in order to be properly handled whenever the locale changes.
|
|
8474
8372
|
* @param {any} component - The Ketchup component to be registered.
|
|
@@ -9833,6 +9731,86 @@ function normalDistributionFormula(average, variance, x) {
|
|
|
9833
9731
|
Math.exp(-Math.pow(x - average, 2) / (2 * variance)));
|
|
9834
9732
|
}
|
|
9835
9733
|
|
|
9734
|
+
function identify(array) {
|
|
9735
|
+
if (array) {
|
|
9736
|
+
for (let i = 0; i < array.length; i++) {
|
|
9737
|
+
array[i].id = i.toString();
|
|
9738
|
+
}
|
|
9739
|
+
}
|
|
9740
|
+
}
|
|
9741
|
+
/**
|
|
9742
|
+
* Fills a string with another string, eventually before
|
|
9743
|
+
* @param {string} stringIn initial string
|
|
9744
|
+
* @param {string} stringForFill string used for fill
|
|
9745
|
+
* @param {number} finalLen final string length
|
|
9746
|
+
* @param {boolean} addBefore flag for fill on left
|
|
9747
|
+
* @returns the input string filled with stringForFill
|
|
9748
|
+
*/
|
|
9749
|
+
function fillString(stringIn, stringForFill, finalLen, addBefore) {
|
|
9750
|
+
let initSize = stringIn.length;
|
|
9751
|
+
let stringOut = '';
|
|
9752
|
+
for (let i = initSize; i < finalLen; i += stringForFill.length) {
|
|
9753
|
+
stringOut += stringForFill;
|
|
9754
|
+
}
|
|
9755
|
+
if (addBefore) {
|
|
9756
|
+
return stringOut + stringIn;
|
|
9757
|
+
}
|
|
9758
|
+
else {
|
|
9759
|
+
return stringIn + stringOut;
|
|
9760
|
+
}
|
|
9761
|
+
}
|
|
9762
|
+
/**
|
|
9763
|
+
* Used to retrieve component's props values.
|
|
9764
|
+
* @param {any} comp - Component calling this function.
|
|
9765
|
+
* @param {GenericObject} list - Prop list, specific for each component.
|
|
9766
|
+
* @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
|
|
9767
|
+
* @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
|
|
9768
|
+
*/
|
|
9769
|
+
function getProps(comp, list, descriptions) {
|
|
9770
|
+
let props = {};
|
|
9771
|
+
if (descriptions) {
|
|
9772
|
+
props = list;
|
|
9773
|
+
}
|
|
9774
|
+
else {
|
|
9775
|
+
for (const key in list) {
|
|
9776
|
+
if (Object.prototype.hasOwnProperty.call(list, key)) {
|
|
9777
|
+
props[key] = comp[key];
|
|
9778
|
+
}
|
|
9779
|
+
}
|
|
9780
|
+
}
|
|
9781
|
+
return props;
|
|
9782
|
+
}
|
|
9783
|
+
/**
|
|
9784
|
+
* Sets the props to the component.
|
|
9785
|
+
* @param {any} comp - Component calling this function.
|
|
9786
|
+
* @param {GenericObject} list - Prop list, specific for each component.
|
|
9787
|
+
* @param {GenericObject} props - Prop to be set.
|
|
9788
|
+
*/
|
|
9789
|
+
function setProps(comp, list, props) {
|
|
9790
|
+
for (const key in props) {
|
|
9791
|
+
// If key is a custom prop it will be set on the component (i.e.: "data", "customStyle", ecc.)
|
|
9792
|
+
if (list[key]) {
|
|
9793
|
+
comp[key] = props[key];
|
|
9794
|
+
}
|
|
9795
|
+
else {
|
|
9796
|
+
// Otherwise, it will be set on its HTML element (i.e.: "id", "style", ecc.)
|
|
9797
|
+
comp.rootElement[key] = props[key];
|
|
9798
|
+
}
|
|
9799
|
+
}
|
|
9800
|
+
}
|
|
9801
|
+
/**
|
|
9802
|
+
* Creates a regular expression object, from a string un-escaped
|
|
9803
|
+
* @param s string to use for create regular expression (not escaped)
|
|
9804
|
+
* @param flags flags used for the regular expression
|
|
9805
|
+
* @returns the regular expression object
|
|
9806
|
+
*/
|
|
9807
|
+
function getRegExpFromString(s, flags) {
|
|
9808
|
+
return new RegExp(escapeRegExp(s), flags);
|
|
9809
|
+
}
|
|
9810
|
+
function escapeRegExp(s) {
|
|
9811
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
|
|
9812
|
+
}
|
|
9813
|
+
|
|
9836
9814
|
const dom$2 = document.documentElement;
|
|
9837
9815
|
/**
|
|
9838
9816
|
* Handles mathematical operations and number formatting/conversion.
|
|
@@ -9856,7 +9834,7 @@ class KupMath {
|
|
|
9856
9834
|
const maximumFractionDigits = 14;
|
|
9857
9835
|
if (value == null || value == '')
|
|
9858
9836
|
return value;
|
|
9859
|
-
return Number(value).toLocaleString(
|
|
9837
|
+
return Number(value).toLocaleString(this.locale, {
|
|
9860
9838
|
maximumFractionDigits: maximumFractionDigits,
|
|
9861
9839
|
});
|
|
9862
9840
|
},
|
|
@@ -9927,10 +9905,11 @@ class KupMath {
|
|
|
9927
9905
|
* Formats the input number with the specified format of the currently set locale.
|
|
9928
9906
|
* @param {string | String | number} input - Input number which will be automatically "numberified".
|
|
9929
9907
|
* @param {string} format - Desired format. Defaults to '0,0.00' (i.e.: 2,000,000.51).
|
|
9908
|
+
* @param {boolean} inputIsLocalized Numberifies assuming the input string is in the current KupMath locale's format.
|
|
9930
9909
|
* @returns {string} Formatted number.
|
|
9931
9910
|
*/
|
|
9932
|
-
format(input, format) {
|
|
9933
|
-
const n = this.numberify(input);
|
|
9911
|
+
format(input, format, inputIsLocalized) {
|
|
9912
|
+
const n = this.numberify(input, inputIsLocalized);
|
|
9934
9913
|
if (!format) {
|
|
9935
9914
|
const positiveN = Math.abs(n);
|
|
9936
9915
|
const decimals = positiveN - Math.floor(positiveN);
|
|
@@ -9941,16 +9920,111 @@ class KupMath {
|
|
|
9941
9920
|
format = '0,0';
|
|
9942
9921
|
}
|
|
9943
9922
|
}
|
|
9944
|
-
|
|
9945
|
-
|
|
9923
|
+
return this.numeral(n).format(format);
|
|
9924
|
+
}
|
|
9925
|
+
/**
|
|
9926
|
+
* Create the pattern string for format a number
|
|
9927
|
+
* @param {boolean} thousandPoint - show thousandPoint
|
|
9928
|
+
* @param {number} decimals - number of decimals
|
|
9929
|
+
* @returns {string} - formatter pattern
|
|
9930
|
+
*/
|
|
9931
|
+
createFormatPattern(thousandPoint, decimals) {
|
|
9932
|
+
var format = '0';
|
|
9933
|
+
if (thousandPoint) {
|
|
9934
|
+
format += ',0';
|
|
9935
|
+
}
|
|
9936
|
+
if (decimals && decimals > 0) {
|
|
9937
|
+
format += '.';
|
|
9938
|
+
for (let i = 0; i < decimals; i++) {
|
|
9939
|
+
format += '0';
|
|
9940
|
+
}
|
|
9941
|
+
}
|
|
9942
|
+
return format;
|
|
9943
|
+
}
|
|
9944
|
+
/**
|
|
9945
|
+
* Returns the decimal separator of current browser
|
|
9946
|
+
* @returns {string} current decimal separator, by locale
|
|
9947
|
+
*/
|
|
9948
|
+
decimalSeparator() {
|
|
9949
|
+
const numberWithGroupAndDecimalSeparator = 1000.1;
|
|
9950
|
+
return Intl.NumberFormat(this.locale)
|
|
9951
|
+
.formatToParts(numberWithGroupAndDecimalSeparator)
|
|
9952
|
+
.find((part) => part.type === 'decimal').value;
|
|
9953
|
+
}
|
|
9954
|
+
/**
|
|
9955
|
+
* Returns the group separator of current browser
|
|
9956
|
+
* @returns {string} current group separator, by locale
|
|
9957
|
+
*/
|
|
9958
|
+
groupSeparator() {
|
|
9959
|
+
const numberWithGroupAndDecimalSeparator = 1000.1;
|
|
9960
|
+
return Intl.NumberFormat(this.locale)
|
|
9961
|
+
.formatToParts(numberWithGroupAndDecimalSeparator)
|
|
9962
|
+
.find((part) => part.type === 'group').value;
|
|
9963
|
+
}
|
|
9964
|
+
/**
|
|
9965
|
+
* Checks if an input string matches options, for desired formatted decimal number (integer digits, decimal digits)
|
|
9966
|
+
* @param {string} value the input value to check
|
|
9967
|
+
* @param {NumericFieldFormatOptions} options options for customize the check
|
|
9968
|
+
* @returns {RegExpMatchArray} an object from applying the regular expression for check
|
|
9969
|
+
*/
|
|
9970
|
+
matchNumericValueWithOptions(value, options) {
|
|
9971
|
+
value = value.replace(getRegExpFromString(this.groupSeparator(), 'g'), '');
|
|
9972
|
+
// see https://github.com/24eme/jquery-input-number-format.git
|
|
9973
|
+
let found = undefined;
|
|
9974
|
+
let integerPartSuffix = '+';
|
|
9975
|
+
if (options.integer && options.integer > 0) {
|
|
9976
|
+
integerPartSuffix = '{0,' + options.integer + '}';
|
|
9977
|
+
}
|
|
9978
|
+
let regexp = '^[0-9]' + integerPartSuffix;
|
|
9979
|
+
if (options.allowNegative) {
|
|
9980
|
+
regexp = '^-{0,1}[0-9]' + integerPartSuffix;
|
|
9981
|
+
}
|
|
9982
|
+
if (options.decimal && options.decimal > 0) {
|
|
9983
|
+
regexp +=
|
|
9984
|
+
'([' +
|
|
9985
|
+
this.decimalSeparator() +
|
|
9986
|
+
'][0-9]{0,' +
|
|
9987
|
+
options.decimal +
|
|
9988
|
+
'})?';
|
|
9989
|
+
let regexpObj = new RegExp(regexp + '$');
|
|
9990
|
+
found = value.match(regexpObj);
|
|
9991
|
+
if (!found) {
|
|
9992
|
+
regexp =
|
|
9993
|
+
'^[' +
|
|
9994
|
+
this.decimalSeparator() +
|
|
9995
|
+
'][0-9]{0,' +
|
|
9996
|
+
options.decimal +
|
|
9997
|
+
'}';
|
|
9998
|
+
regexpObj = new RegExp(regexp + '$');
|
|
9999
|
+
found = value.match(regexpObj);
|
|
10000
|
+
}
|
|
10001
|
+
}
|
|
10002
|
+
else {
|
|
10003
|
+
let regexpObj = new RegExp(regexp + '$');
|
|
10004
|
+
found = value.match(regexpObj);
|
|
10005
|
+
}
|
|
10006
|
+
return found;
|
|
9946
10007
|
}
|
|
9947
10008
|
/**
|
|
9948
10009
|
* Returns a number from a non-specified input type between string, number, or String.
|
|
9949
10010
|
* @param {string | String | number} input - Input value to numberify.
|
|
9950
10011
|
* @param {boolean} inputIsLocalized - Numberifies assuming the input string is in the current KupMath locale's format.
|
|
10012
|
+
* @param {string} type - type of number for calculate suffix
|
|
9951
10013
|
* @returns {number} Resulting number or NaN (when not a number).
|
|
9952
10014
|
*/
|
|
9953
|
-
numberify(input, inputIsLocalized) {
|
|
10015
|
+
numberify(input, inputIsLocalized, type) {
|
|
10016
|
+
if (typeof input != 'number') {
|
|
10017
|
+
if (type) {
|
|
10018
|
+
let suffix = this.getNumericValueSuffix(type);
|
|
10019
|
+
if (suffix != '') {
|
|
10020
|
+
input = input.replace(getRegExpFromString(suffix, 'g'), '');
|
|
10021
|
+
}
|
|
10022
|
+
}
|
|
10023
|
+
const groupSeparator = inputIsLocalized
|
|
10024
|
+
? this.groupSeparator()
|
|
10025
|
+
: ',';
|
|
10026
|
+
input = input.replace(getRegExpFromString(groupSeparator, 'g'), '');
|
|
10027
|
+
}
|
|
9954
10028
|
let n = NaN;
|
|
9955
10029
|
if (inputIsLocalized) {
|
|
9956
10030
|
n = this.numeral(input).value();
|
|
@@ -9966,6 +10040,161 @@ class KupMath {
|
|
|
9966
10040
|
}
|
|
9967
10041
|
return n;
|
|
9968
10042
|
}
|
|
10043
|
+
/**
|
|
10044
|
+
* Returns a number from a non-specified input type between string, number, or String.
|
|
10045
|
+
* If value in is null, undefined or blank, returns 0
|
|
10046
|
+
* @param {string} input number as string, formatted by locale US, decimal separator . (like java decimal numbers)
|
|
10047
|
+
* @param {boolean} inputIsLocalized - Numberifies assuming the input string is in the current KupMath locale's format.
|
|
10048
|
+
* @param {string} type - type of number for calculate suffix
|
|
10049
|
+
* @returns {number} Resulting number
|
|
10050
|
+
**/
|
|
10051
|
+
numberifySafe(input, inputIsLocalized, type) {
|
|
10052
|
+
if (!input || input == null || input.trim() == '') {
|
|
10053
|
+
input = '0';
|
|
10054
|
+
}
|
|
10055
|
+
return this.numberify(input, inputIsLocalized, type);
|
|
10056
|
+
}
|
|
10057
|
+
/**
|
|
10058
|
+
* Checks if input is a valid number
|
|
10059
|
+
* @param {any} value input value to check
|
|
10060
|
+
* @returns {boolean} if input value is valid number
|
|
10061
|
+
*/
|
|
10062
|
+
isNumber(value) {
|
|
10063
|
+
//return typeof value === 'number';
|
|
10064
|
+
return !isNaN(value);
|
|
10065
|
+
}
|
|
10066
|
+
/**
|
|
10067
|
+
* Checks if string in input is a valid formatted number
|
|
10068
|
+
* @param {string} value number as string, formatted by actual browser locale
|
|
10069
|
+
* @param {string} type - type of number for calculate suffix
|
|
10070
|
+
* @returns {boolean} true if number string in input is a valid number
|
|
10071
|
+
*/
|
|
10072
|
+
isStringNumber(value, type) {
|
|
10073
|
+
if (value == null || value.trim() == '') {
|
|
10074
|
+
return false;
|
|
10075
|
+
}
|
|
10076
|
+
let tmpStr = this.formattedStringToNumberString(value, type);
|
|
10077
|
+
if (this.isNumber(tmpStr)) {
|
|
10078
|
+
return true;
|
|
10079
|
+
}
|
|
10080
|
+
return false;
|
|
10081
|
+
}
|
|
10082
|
+
/**
|
|
10083
|
+
* Gets number as string, formatted by locale US, decimal separator . (like java decimal numbers)
|
|
10084
|
+
* @param {string} input number as string, formatted by actual browser locale (maybe)
|
|
10085
|
+
* @param {string} type - type of number for calculate suffix
|
|
10086
|
+
* @param {string} decSeparator - decimal serparator of input string
|
|
10087
|
+
* @returns {string} number as string, formatted by locale US, decimal separator . (like java decimal numbers), without group separator
|
|
10088
|
+
**/
|
|
10089
|
+
formattedStringToNumberString(input, type, decSeparator) {
|
|
10090
|
+
return numberStringToNumberString(input, type, decSeparator !== null && decSeparator !== void 0 ? decSeparator : this.decimalSeparator(), this);
|
|
10091
|
+
function numberStringToNumberString(input, type, decFmt, kupMath) {
|
|
10092
|
+
if (!input || input == null || input.trim() == '') {
|
|
10093
|
+
return '';
|
|
10094
|
+
}
|
|
10095
|
+
let unf = kupMath.numberifySafe(input, decFmt != '.', type);
|
|
10096
|
+
if (unf == null || isNaN(unf)) {
|
|
10097
|
+
return input;
|
|
10098
|
+
}
|
|
10099
|
+
return numberToString(unf, -1, 'en-US', kupMath);
|
|
10100
|
+
}
|
|
10101
|
+
function numberToString(input, decimals, locale, kupMath) {
|
|
10102
|
+
if (input == null) {
|
|
10103
|
+
input = 0;
|
|
10104
|
+
}
|
|
10105
|
+
if (decimals == null || decimals == -1) {
|
|
10106
|
+
decimals = kupMath.countDecimals(input);
|
|
10107
|
+
}
|
|
10108
|
+
let n = Number(input);
|
|
10109
|
+
let f = decimals > -1
|
|
10110
|
+
? {
|
|
10111
|
+
minimumFractionDigits: decimals,
|
|
10112
|
+
maximumFractionDigits: decimals,
|
|
10113
|
+
useGrouping: false,
|
|
10114
|
+
}
|
|
10115
|
+
: { useGrouping: false };
|
|
10116
|
+
return n.toLocaleString(locale, f);
|
|
10117
|
+
}
|
|
10118
|
+
}
|
|
10119
|
+
/**
|
|
10120
|
+
* Gets the number of decimals for current number
|
|
10121
|
+
* @param {number} value numer input
|
|
10122
|
+
* @returns {number} the number of decimals
|
|
10123
|
+
*/
|
|
10124
|
+
countDecimals(value) {
|
|
10125
|
+
var _a;
|
|
10126
|
+
if (Math.floor(value) === value)
|
|
10127
|
+
return 0;
|
|
10128
|
+
let stringValue = value.toString().split('.')[1];
|
|
10129
|
+
if (stringValue) {
|
|
10130
|
+
return (_a = stringValue.length) !== null && _a !== void 0 ? _a : 0;
|
|
10131
|
+
}
|
|
10132
|
+
else {
|
|
10133
|
+
return 0;
|
|
10134
|
+
}
|
|
10135
|
+
}
|
|
10136
|
+
/**
|
|
10137
|
+
* Gets the suffix for number, by type
|
|
10138
|
+
* @param {string} type - type of number for calculate suffix
|
|
10139
|
+
* @returns {string} suffix for number, by type
|
|
10140
|
+
**/
|
|
10141
|
+
getNumericValueSuffix(type) {
|
|
10142
|
+
type = type.toUpperCase();
|
|
10143
|
+
let nstr = '';
|
|
10144
|
+
if (type == 'P') {
|
|
10145
|
+
nstr = ' %';
|
|
10146
|
+
}
|
|
10147
|
+
else if (type == 'VE') {
|
|
10148
|
+
nstr = ' €';
|
|
10149
|
+
}
|
|
10150
|
+
else if (type == 'VL') {
|
|
10151
|
+
nstr = ' £';
|
|
10152
|
+
}
|
|
10153
|
+
else if (type == 'VV') {
|
|
10154
|
+
nstr = ' $';
|
|
10155
|
+
}
|
|
10156
|
+
return nstr;
|
|
10157
|
+
}
|
|
10158
|
+
/**
|
|
10159
|
+
* Gets the number as string, formatted by actual browser locale, with suffix by type
|
|
10160
|
+
* @param {number} input number
|
|
10161
|
+
* @param {number} decimals number of significant decimal digits for output
|
|
10162
|
+
* @param {string} type - type of number for calculate suffix
|
|
10163
|
+
* @returns {string} number as string, formatted by actual browser locale, with suffix by type
|
|
10164
|
+
**/
|
|
10165
|
+
numberToFormattedString(input, decimals, type) {
|
|
10166
|
+
if (input == null || isNaN(input)) {
|
|
10167
|
+
return '';
|
|
10168
|
+
}
|
|
10169
|
+
if (decimals == null || decimals == -1) {
|
|
10170
|
+
decimals = this.countDecimals(input);
|
|
10171
|
+
}
|
|
10172
|
+
let nstr = this.format(input, this.createFormatPattern(true, decimals));
|
|
10173
|
+
nstr = nstr + this.getNumericValueSuffix(type);
|
|
10174
|
+
return nstr;
|
|
10175
|
+
}
|
|
10176
|
+
/**
|
|
10177
|
+
* Gets the number as string, formatted by actual browser locale, with suffix by type
|
|
10178
|
+
* @param {string} input number as string, formatted by locale US, decimal separator . (like java decimal numbers)
|
|
10179
|
+
* @param {number} decimals number of significant decimal digits for output
|
|
10180
|
+
* @param {string} type - type of number for calculate suffix
|
|
10181
|
+
* @param {string} decSeparator decimal separator for outpu string
|
|
10182
|
+
* @returns {string} number as string, formatted by actual browser locale (or using decimal separator param), with suffix by type
|
|
10183
|
+
**/
|
|
10184
|
+
numberStringToFormattedString(input, decimals, type, decSeparator) {
|
|
10185
|
+
let value = this.numberToFormattedString(this.numberifySafe(input), decimals, type);
|
|
10186
|
+
if (!decSeparator) {
|
|
10187
|
+
return value;
|
|
10188
|
+
}
|
|
10189
|
+
const browserDecSeparator = this.decimalSeparator();
|
|
10190
|
+
if (browserDecSeparator == decSeparator) {
|
|
10191
|
+
return value;
|
|
10192
|
+
}
|
|
10193
|
+
const browserGroupSeparator = this.groupSeparator();
|
|
10194
|
+
value = value.replace(getRegExpFromString(browserGroupSeparator, 'g'), '');
|
|
10195
|
+
value = value.replace(getRegExpFromString(browserDecSeparator, 'g'), decSeparator);
|
|
10196
|
+
return value;
|
|
10197
|
+
}
|
|
9969
10198
|
/**
|
|
9970
10199
|
* Registers a KupComponent in KupMath, in order to be properly handled whenever the locale changes.
|
|
9971
10200
|
* @param {any} component - The Ketchup component to be registered.
|
|
@@ -18334,22 +18563,17 @@ exports.compareCell = compareCell;
|
|
|
18334
18563
|
exports.createCommonjsModule = createCommonjsModule;
|
|
18335
18564
|
exports.editableTypes = editableTypes;
|
|
18336
18565
|
exports.fieldColumn = fieldColumn;
|
|
18337
|
-
exports.
|
|
18566
|
+
exports.fillString = fillString;
|
|
18338
18567
|
exports.formatToNumber = formatToNumber;
|
|
18339
|
-
exports.formattedStringToCustomUnformattedStringTime = formattedStringToCustomUnformattedStringTime;
|
|
18340
18568
|
exports.fullWidthFieldsComps = fullWidthFieldsComps;
|
|
18341
18569
|
exports.getCellValueForDisplay = getCellValueForDisplay;
|
|
18342
18570
|
exports.getColumnByName = getColumnByName;
|
|
18343
|
-
exports.getDecimalSeparator = getDecimalSeparator;
|
|
18344
18571
|
exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
|
|
18345
|
-
exports.getMonthsAsStringByLocale = getMonthsAsStringByLocale;
|
|
18346
18572
|
exports.getProps = getProps;
|
|
18347
18573
|
exports.getValueForDisplay = getValueForDisplay;
|
|
18348
18574
|
exports.getValueForDisplay2 = getValueForDisplay2;
|
|
18349
18575
|
exports.iconColumn = iconColumn;
|
|
18350
18576
|
exports.identify = identify;
|
|
18351
|
-
exports.isNumber = isNumber;
|
|
18352
|
-
exports.isValidFormattedStringTime = isValidFormattedStringTime;
|
|
18353
18577
|
exports.keyColumn = keyColumn;
|
|
18354
18578
|
exports.kupDragActiveAttr = kupDragActiveAttr;
|
|
18355
18579
|
exports.kupDraggableCellAttr = kupDraggableCellAttr;
|
|
@@ -18359,8 +18583,4 @@ exports.kupDropEvent = kupDropEvent;
|
|
|
18359
18583
|
exports.kupDynamicPositionAttribute = kupDynamicPositionAttribute;
|
|
18360
18584
|
exports.kupManagerInstance = kupManagerInstance;
|
|
18361
18585
|
exports.kupTypes = kupTypes;
|
|
18362
|
-
exports.numberToFormattedStringNumber = numberToFormattedStringNumber;
|
|
18363
18586
|
exports.setProps = setProps;
|
|
18364
|
-
exports.stringToNumber = stringToNumber;
|
|
18365
|
-
exports.unformattedStringToFormattedStringNumber = unformattedStringToFormattedStringNumber;
|
|
18366
|
-
exports.unformattedStringToFormattedStringTime = unformattedStringToFormattedStringTime;
|