@sme.up/ketchup 4.0.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/cjs/cell-utils-dc0884a3.js +168 -0
- package/dist/cjs/f-button-2ba74fb5.js +105 -0
- package/dist/cjs/f-cell-fe60a08d.js +731 -0
- package/dist/cjs/f-chip-90d95d22.js +141 -0
- package/dist/cjs/{f-image-5f4f29ca.js → f-image-d3bd4e08.js} +4 -5
- package/dist/cjs/{index-3c471303.js → index-0416afab.js} +73 -64
- package/dist/cjs/ketchup.cjs.js +3 -3
- package/dist/cjs/kup-accordion.cjs.entry.js +6 -8
- package/dist/cjs/{kup-autocomplete_29.cjs.entry.js → kup-autocomplete_28.cjs.entry.js} +2580 -3060
- package/dist/cjs/kup-calendar.cjs.entry.js +30 -30
- package/dist/cjs/kup-cell.cjs.entry.js +201 -0
- package/dist/cjs/kup-dash-list.cjs.entry.js +15 -7
- package/dist/cjs/kup-dash_2.cjs.entry.js +104 -62
- package/dist/cjs/kup-drawer.cjs.entry.js +4 -6
- package/dist/cjs/kup-field.cjs.entry.js +3 -5
- package/dist/cjs/kup-iframe.cjs.entry.js +3 -4
- package/dist/cjs/kup-lazy.cjs.entry.js +4 -6
- package/dist/cjs/kup-magic-box.cjs.entry.js +21 -31
- package/dist/cjs/kup-manager-1a2688ca.js +5813 -0
- package/dist/cjs/kup-nav-bar.cjs.entry.js +4 -6
- package/dist/cjs/kup-probe.cjs.entry.js +3 -4
- package/dist/cjs/kup-qlik.cjs.entry.js +2 -3
- package/dist/cjs/kup-snackbar.cjs.entry.js +152 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{utils-2af73538.js → utils-0cc466b9.js} +17 -83
- package/dist/collection/assets/cell.js +51 -0
- package/dist/collection/assets/data-table.js +518 -1
- package/dist/collection/assets/index.js +8 -0
- package/dist/collection/assets/snackbar.js +32 -0
- package/dist/collection/collection-manifest.json +6 -6
- package/dist/collection/components/kup-accordion/kup-accordion.css +0 -213
- package/dist/collection/components/kup-accordion/kup-accordion.js +15 -16
- package/dist/collection/components/kup-autocomplete/kup-autocomplete-declarations.js +2 -2
- package/dist/collection/components/kup-autocomplete/kup-autocomplete.css +5 -2381
- package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +83 -111
- package/dist/collection/components/kup-badge/kup-badge.css +1 -35
- package/dist/collection/components/kup-badge/kup-badge.js +13 -14
- package/dist/collection/components/kup-box/kup-box.css +47 -780
- package/dist/collection/components/kup-box/kup-box.js +240 -366
- package/dist/collection/components/kup-button/kup-button.css +0 -333
- package/dist/collection/components/kup-button/kup-button.js +27 -28
- package/dist/collection/components/kup-button-list/kup-button-list.css +0 -332
- package/dist/collection/components/kup-button-list/kup-button-list.js +19 -20
- package/dist/collection/components/kup-calendar/kup-calendar.css +0 -517
- package/dist/collection/components/kup-calendar/kup-calendar.js +47 -45
- package/dist/collection/components/kup-card/builtin/kup-card-builtin.js +20 -0
- package/dist/collection/components/kup-card/builtin/kup-card-calendar.js +458 -0
- package/dist/collection/components/kup-card/builtin/kup-card-clock.js +321 -0
- package/dist/collection/components/kup-card/dialog/kup-card-dialog.js +18 -0
- package/dist/collection/components/kup-card/free/kup-card-free.js +13 -0
- package/dist/collection/components/kup-card/kup-card-declarations.js +19 -0
- package/dist/collection/components/kup-card/kup-card-helper.js +19 -1
- package/dist/collection/components/kup-card/kup-card.css +615 -185
- package/dist/collection/components/kup-card/kup-card.js +94 -34
- package/dist/collection/components/kup-card/standard/kup-card-standard.js +75 -0
- package/dist/collection/components/kup-cell/kup-cell-declarations.js +11 -0
- package/dist/collection/components/kup-cell/kup-cell.css +20 -0
- package/dist/collection/components/kup-cell/kup-cell.js +413 -0
- package/dist/collection/components/kup-chart/kup-chart.js +41 -42
- package/dist/collection/components/kup-checkbox/kup-checkbox.css +0 -214
- package/dist/collection/components/kup-checkbox/kup-checkbox.js +19 -20
- package/dist/collection/components/kup-chip/kup-chip.css +0 -217
- package/dist/collection/components/kup-chip/kup-chip.js +15 -16
- package/dist/collection/components/kup-color-picker/kup-color-picker.css +7 -2380
- package/dist/collection/components/kup-color-picker/kup-color-picker.js +41 -41
- package/dist/collection/components/kup-combobox/kup-combobox-declarations.js +1 -0
- package/dist/collection/components/kup-combobox/kup-combobox.css +5 -2381
- package/dist/collection/components/kup-combobox/kup-combobox.js +68 -28
- package/dist/collection/components/kup-dash-list/kup-dash-list.js +13 -4
- package/dist/collection/components/kup-data-table/kup-data-table-declarations.js +2 -0
- package/dist/collection/components/kup-data-table/kup-data-table-helper.js +61 -102
- package/dist/collection/components/kup-data-table/kup-data-table.css +118 -3232
- package/dist/collection/components/kup-data-table/kup-data-table.js +589 -1089
- package/dist/collection/components/kup-date-picker/kup-date-picker.css +1 -85
- package/dist/collection/components/kup-date-picker/kup-date-picker.js +92 -395
- package/dist/collection/components/kup-drawer/kup-drawer.js +9 -10
- package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.css +12 -340
- package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.js +56 -45
- package/dist/collection/components/kup-field/kup-field.js +21 -22
- package/dist/collection/components/kup-gauge/kup-gauge.js +17 -18
- package/dist/collection/components/kup-grid/kup-grid.css +2 -1
- package/dist/collection/components/kup-grid/kup-grid.js +13 -14
- package/dist/collection/components/kup-iframe/kup-iframe.js +4 -4
- package/dist/collection/components/kup-image/assets/svg/ketchup.svg +74 -0
- package/dist/collection/components/kup-image/assets/svg/smeup.svg +59 -0
- package/dist/collection/components/kup-image/kup-image.css +0 -32
- package/dist/collection/components/kup-image/kup-image.js +25 -26
- package/dist/collection/components/kup-lazy/kup-lazy.js +17 -18
- package/dist/collection/components/kup-list/kup-list-declarations.js +1 -1
- package/dist/collection/components/kup-list/kup-list.css +4 -260
- package/dist/collection/components/kup-list/kup-list.js +39 -49
- package/dist/collection/components/kup-magic-box/kup-magic-box.css +13 -39
- package/dist/collection/components/kup-magic-box/kup-magic-box.js +29 -38
- package/dist/collection/components/kup-nav-bar/kup-nav-bar.js +11 -12
- package/dist/collection/components/kup-paginator/kup-paginator.css +0 -332
- package/dist/collection/components/kup-paginator/kup-paginator.js +44 -12
- package/dist/collection/components/kup-probe/kup-probe.js +9 -9
- package/dist/collection/components/kup-progress-bar/kup-progress-bar.js +21 -22
- package/dist/collection/components/kup-radio/kup-radio.js +17 -18
- package/dist/collection/components/kup-rating/kup-rating.js +15 -16
- package/dist/collection/components/kup-snackbar/kup-snackbar-declarations.js +13 -0
- package/dist/collection/components/kup-snackbar/kup-snackbar.css +75 -0
- package/dist/collection/components/kup-snackbar/kup-snackbar.js +390 -0
- package/dist/collection/components/kup-spinner/kup-spinner.js +23 -24
- package/dist/collection/components/kup-switch/kup-switch.css +0 -156
- package/dist/collection/components/kup-switch/kup-switch.js +17 -18
- package/dist/collection/components/kup-tab-bar/kup-tab-bar.css +0 -199
- package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +13 -14
- package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +1 -0
- package/dist/collection/components/kup-text-field/kup-text-field.css +4 -2371
- package/dist/collection/components/kup-text-field/kup-text-field.js +77 -51
- package/dist/collection/components/kup-time-picker/kup-time-picker.css +7 -0
- package/dist/collection/components/kup-time-picker/kup-time-picker.js +97 -317
- package/dist/collection/components/kup-tooltip/kup-tooltip.js +24 -14
- package/dist/collection/components/kup-tree/kup-tree.css +27 -371
- package/dist/collection/components/kup-tree/kup-tree.js +163 -383
- package/dist/collection/f-components/f-button/f-button.js +4 -2
- package/dist/collection/f-components/f-cell/f-cell-declarations.js +143 -0
- package/dist/collection/f-components/f-cell/f-cell.js +471 -0
- package/dist/collection/f-components/f-checkbox/f-checkbox.js +1 -1
- package/dist/collection/f-components/f-chip/f-chip.js +2 -2
- package/dist/collection/f-components/f-image/f-image.js +2 -3
- package/dist/collection/f-components/f-switch/f-switch.js +1 -1
- package/dist/collection/f-components/f-text-field/f-text-field-mdc.js +1 -1
- package/dist/collection/f-components/f-text-field/f-text-field.js +25 -21
- package/dist/collection/utils/cell-utils.js +18 -222
- package/dist/collection/utils/filters/filters.js +31 -37
- package/dist/collection/utils/kup-column-menu/kup-column-menu.js +15 -3
- package/dist/collection/utils/kup-dates/kup-dates.js +14 -2
- package/dist/collection/utils/kup-debug/kup-debug-browser-utils.js +3 -3
- package/dist/collection/utils/kup-debug/kup-debug.js +57 -29
- package/dist/collection/utils/kup-dynamic-position/kup-dynamic-position.js +5 -7
- package/dist/collection/utils/kup-interact/kup-interact-declarations.js +48 -0
- package/dist/collection/utils/kup-interact/kup-interact.js +379 -0
- package/dist/collection/utils/kup-language/kup-language-declarations.js +2 -0
- package/dist/collection/utils/kup-language/kup-language.js +1 -1
- package/dist/collection/utils/kup-manager/kup-manager.js +47 -10
- package/dist/collection/utils/kup-objects/kup-objects.js +9 -33
- package/dist/collection/utils/kup-scroll-on-hover/kup-scroll-on-hover.js +60 -62
- package/dist/collection/utils/kup-search/kup-search-declarations.js +1 -0
- package/dist/collection/utils/kup-search/kup-search.js +75 -0
- package/dist/collection/utils/kup-theme/kup-theme-declarations.js +1 -0
- package/dist/collection/utils/kup-theme/kup-theme.js +4 -3
- package/dist/collection/utils/kup-toolbar/kup-toolbar.js +16 -18
- package/dist/collection/utils/utils.js +15 -23
- package/dist/esm/cell-utils-8f512ea9.js +160 -0
- package/dist/esm/f-button-30dbcaa9.js +103 -0
- package/dist/esm/f-cell-95c186c6.js +727 -0
- package/dist/esm/f-chip-c0e9c0ff.js +139 -0
- package/dist/esm/{f-image-68b34fab.js → f-image-3bc8b24f.js} +4 -5
- package/dist/esm/{index-bf2824a6.js → index-e0e67c23.js} +74 -65
- package/dist/esm/ketchup.js +3 -3
- package/dist/esm/kup-accordion.entry.js +6 -8
- package/dist/esm/{kup-autocomplete_29.entry.js → kup-autocomplete_28.entry.js} +2379 -2858
- package/dist/esm/kup-calendar.entry.js +10 -10
- package/dist/esm/kup-cell.entry.js +197 -0
- package/dist/esm/kup-dash-list.entry.js +15 -7
- package/dist/esm/kup-dash_2.entry.js +104 -62
- package/dist/esm/kup-drawer.entry.js +4 -6
- package/dist/esm/kup-field.entry.js +3 -5
- package/dist/esm/kup-iframe.entry.js +3 -4
- package/dist/esm/kup-lazy.entry.js +4 -6
- package/dist/esm/kup-magic-box.entry.js +21 -31
- package/dist/esm/kup-manager-7fc234da.js +5800 -0
- package/dist/esm/kup-nav-bar.entry.js +4 -6
- package/dist/esm/kup-probe.entry.js +3 -4
- package/dist/esm/kup-qlik.entry.js +2 -3
- package/dist/esm/kup-snackbar.entry.js +148 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{utils-13dd007a.js → utils-6c73709d.js} +15 -78
- package/dist/ketchup/assets/svg/ketchup.svg +74 -0
- package/dist/ketchup/assets/svg/smeup.svg +59 -0
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/p-15321eae.js +1 -0
- package/dist/ketchup/p-1baf1205.entry.js +1 -0
- package/dist/ketchup/p-1c6178e4.entry.js +1 -0
- package/dist/ketchup/p-44375e49.js +1 -0
- package/dist/ketchup/p-4dcdbd31.entry.js +45 -0
- package/dist/ketchup/p-5a5f2a53.js +1 -0
- package/dist/ketchup/{p-c7ee1fbc.js → p-61faaa38.js} +2 -2
- package/dist/ketchup/p-62816d0b.entry.js +1 -0
- package/dist/ketchup/p-65adc15b.entry.js +1 -0
- package/dist/ketchup/p-7e23ea7c.entry.js +1 -0
- package/dist/ketchup/p-a378ba56.entry.js +1 -0
- package/dist/ketchup/p-a878016f.entry.js +1 -0
- package/dist/ketchup/p-a96e6e32.entry.js +1 -0
- package/dist/ketchup/p-ad32821e.entry.js +1 -0
- package/dist/ketchup/p-af4a6191.entry.js +1 -0
- package/dist/ketchup/p-c18c7bb0.entry.js +27 -0
- package/dist/ketchup/p-ca0ca27f.entry.js +1 -0
- package/dist/ketchup/p-cb5f4994.js +1 -0
- package/dist/ketchup/p-ccda584a.entry.js +1 -0
- package/dist/ketchup/p-d4aa4922.js +1 -0
- package/dist/ketchup/p-dbb6998b.entry.js +1 -0
- package/dist/ketchup/p-de83f2f6.js +1 -0
- package/dist/ketchup/p-ec3a3db9.js +1 -0
- package/dist/types/components/kup-autocomplete/kup-autocomplete-declarations.d.ts +2 -6
- package/dist/types/components/kup-autocomplete/kup-autocomplete.d.ts +7 -13
- package/dist/types/components/kup-box/kup-box-declarations.d.ts +13 -4
- package/dist/types/components/kup-box/kup-box.d.ts +13 -6
- package/dist/types/components/kup-card/builtin/kup-card-builtin.d.ts +14 -0
- package/dist/types/components/kup-card/builtin/kup-card-calendar.d.ts +2 -0
- package/dist/types/components/kup-card/builtin/kup-card-clock.d.ts +2 -0
- package/dist/types/components/kup-card/dialog/kup-card-dialog.d.ts +6 -0
- package/dist/types/components/kup-card/free/kup-card-free.d.ts +8 -0
- package/dist/types/components/kup-card/kup-card-declarations.d.ts +74 -0
- package/dist/types/components/kup-card/kup-card.d.ts +12 -3
- package/dist/types/components/kup-card/standard/kup-card-standard.d.ts +6 -0
- package/dist/types/components/kup-cell/kup-cell-declarations.d.ts +10 -0
- package/dist/types/components/kup-cell/kup-cell.d.ts +67 -0
- package/dist/types/components/kup-color-picker/kup-color-picker.d.ts +1 -1
- package/dist/types/components/kup-combobox/kup-combobox-declarations.d.ts +3 -2
- package/dist/types/components/kup-combobox/kup-combobox.d.ts +5 -0
- package/dist/types/components/kup-dash-list/kup-dash-list.d.ts +4 -0
- package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +20 -36
- package/dist/types/components/kup-data-table/kup-data-table-helper.d.ts +1 -15
- package/dist/types/components/kup-data-table/kup-data-table.d.ts +33 -83
- package/dist/types/components/kup-date-picker/kup-date-picker.d.ts +11 -23
- package/dist/types/components/kup-dropdown-button/kup-dropdown-button.d.ts +1 -4
- package/dist/types/components/kup-list/kup-list-declarations.d.ts +1 -1
- package/dist/types/components/kup-list/kup-list.d.ts +2 -3
- package/dist/types/components/kup-magic-box/kup-magic-box.d.ts +1 -0
- package/dist/types/components/kup-paginator/kup-paginator.d.ts +6 -0
- package/dist/types/components/kup-snackbar/kup-snackbar-declarations.d.ts +12 -0
- package/dist/types/components/kup-snackbar/kup-snackbar.d.ts +79 -0
- package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +2 -1
- package/dist/types/components/kup-text-field/kup-text-field.d.ts +5 -0
- package/dist/types/components/kup-time-picker/kup-time-picker.d.ts +10 -20
- package/dist/types/components/kup-tooltip/kup-tooltip.d.ts +1 -0
- package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +4 -4
- package/dist/types/components/kup-tree/kup-tree.d.ts +12 -23
- package/dist/types/components.d.ts +348 -176
- package/dist/types/f-components/f-cell/f-cell-declarations.d.ts +153 -0
- package/dist/types/f-components/f-cell/f-cell.d.ts +3 -0
- package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +1 -0
- package/dist/types/f-components/f-text-field/f-text-field-mdc.d.ts +1 -1
- package/dist/types/utils/cell-utils.d.ts +0 -19
- package/dist/types/utils/kup-column-menu/kup-column-menu.d.ts +2 -0
- package/dist/types/utils/kup-dates/kup-dates.d.ts +9 -4
- package/dist/types/utils/kup-debug/kup-debug.d.ts +1 -1
- package/dist/types/utils/kup-dynamic-position/kup-dynamic-position-declarations.d.ts +1 -1
- package/dist/types/utils/kup-dynamic-position/kup-dynamic-position.d.ts +2 -2
- package/dist/types/utils/kup-interact/kup-interact-declarations.d.ts +127 -0
- package/dist/types/utils/kup-interact/kup-interact.d.ts +93 -0
- package/dist/types/utils/kup-language/kup-language-declarations.d.ts +2 -0
- package/dist/types/utils/kup-language/kup-language.d.ts +1 -1
- package/dist/types/utils/kup-manager/kup-manager-declarations.d.ts +28 -8
- package/dist/types/utils/kup-manager/kup-manager.d.ts +18 -5
- package/dist/types/utils/kup-objects/kup-objects.d.ts +1 -7
- package/dist/types/utils/kup-search/kup-search-declarations.d.ts +7 -0
- package/dist/types/utils/kup-search/kup-search.d.ts +20 -0
- package/dist/types/utils/kup-theme/kup-theme-declarations.d.ts +2 -0
- package/dist/types/utils/kup-theme/kup-theme.d.ts +2 -2
- package/dist/types/utils/utils.d.ts +0 -1
- package/package.json +4 -6
- package/dist/cjs/cell-utils-1f89a299.js +0 -1527
- package/dist/cjs/drag-and-drop-4787ff6f.js +0 -281
- package/dist/cjs/f-chip-2d58c8f7.js +0 -239
- package/dist/cjs/kup-grid.cjs.entry.js +0 -130
- package/dist/cjs/kup-manager-59ad8bdc.js +0 -4845
- package/dist/cjs/kup-objects-59ea949c.js +0 -717
- package/dist/collection/assets/images/drag-multiple.js +0 -1
- package/dist/collection/components/kup-editor/kup-editor.css +0 -5
- package/dist/collection/components/kup-editor/kup-editor.js +0 -59
- package/dist/collection/components/kup-layout/kup-layout.css +0 -53
- package/dist/collection/components/kup-layout/kup-layout.js +0 -156
- package/dist/collection/utils/drag-and-drop.js +0 -109
- package/dist/collection/utils/kup-dialog/kup-dialog-declarations.js +0 -36
- package/dist/collection/utils/kup-dialog/kup-dialog.js +0 -310
- package/dist/esm/cell-utils-cb612463.js +0 -1510
- package/dist/esm/drag-and-drop-321cb4ca.js +0 -265
- package/dist/esm/f-chip-125d5dd6.js +0 -236
- package/dist/esm/kup-grid.entry.js +0 -126
- package/dist/esm/kup-manager-e7d7b353.js +0 -4842
- package/dist/esm/kup-objects-d38d2fa2.js +0 -711
- package/dist/ketchup/p-00fe1e3e.js +0 -1
- package/dist/ketchup/p-0320e24e.entry.js +0 -1
- package/dist/ketchup/p-08c7a092.js +0 -1
- package/dist/ketchup/p-1165f4ea.entry.js +0 -1
- package/dist/ketchup/p-170d3cba.js +0 -1
- package/dist/ketchup/p-18cb3ba3.js +0 -1
- package/dist/ketchup/p-23541a97.entry.js +0 -45
- package/dist/ketchup/p-64ea7e37.entry.js +0 -1
- package/dist/ketchup/p-7896031c.entry.js +0 -1
- package/dist/ketchup/p-876da4c2.entry.js +0 -1
- package/dist/ketchup/p-8fb9d9b2.entry.js +0 -1
- package/dist/ketchup/p-940ab57a.entry.js +0 -1
- package/dist/ketchup/p-9c858a38.entry.js +0 -1
- package/dist/ketchup/p-a12a5690.entry.js +0 -1
- package/dist/ketchup/p-a5424073.js +0 -1
- package/dist/ketchup/p-b0724035.entry.js +0 -1
- package/dist/ketchup/p-b14e77f0.js +0 -1
- package/dist/ketchup/p-d24cfdea.entry.js +0 -1
- package/dist/ketchup/p-ee89966f.entry.js +0 -27
- package/dist/ketchup/p-fcd2fd8f.js +0 -1
- package/dist/ketchup/p-fce3b9d8.entry.js +0 -1
- package/dist/types/assets/images/drag-multiple.d.ts +0 -1
- package/dist/types/components/kup-editor/kup-editor.d.ts +0 -16
- package/dist/types/components/kup-layout/kup-layout.d.ts +0 -25
- package/dist/types/utils/drag-and-drop.d.ts +0 -53
- package/dist/types/utils/kup-dialog/kup-dialog-declarations.d.ts +0 -43
- package/dist/types/utils/kup-dialog/kup-dialog.d.ts +0 -50
|
@@ -60,7 +60,7 @@ export class KupLanguage {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
|
-
* Changes the current
|
|
63
|
+
* Changes the current Ketchup language to the one provided. If the language argument contains a "_", a combo of language and variant will be assumed.
|
|
64
64
|
* @param {string} language - The new language. If not present in this.list, this function will keep the previous language.
|
|
65
65
|
*/
|
|
66
66
|
set(language) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { KupDebug } from '../kup-debug/kup-debug';
|
|
2
|
-
import { KupDialog } from '../kup-dialog/kup-dialog';
|
|
3
2
|
import { KupDynamicPosition } from '../kup-dynamic-position/kup-dynamic-position';
|
|
3
|
+
import { KupInteract } from '../kup-interact/kup-interact';
|
|
4
4
|
import { KupLanguage } from '../kup-language/kup-language';
|
|
5
5
|
import { KupObjects } from '../kup-objects/kup-objects';
|
|
6
6
|
import { KupScrollOnHover } from '../kup-scroll-on-hover/kup-scroll-on-hover';
|
|
@@ -11,9 +11,10 @@ import { KupLanguageDefaults, } from '../kup-language/kup-language-declarations'
|
|
|
11
11
|
import { KupDates } from '../kup-dates/kup-dates';
|
|
12
12
|
import { KupDatesLocales } from '../kup-dates/kup-dates-declarations';
|
|
13
13
|
import { KupDebugCategory } from '../kup-debug/kup-debug-declarations';
|
|
14
|
+
import { KupSearch } from '../kup-search/kup-search';
|
|
14
15
|
const dom = document.documentElement;
|
|
15
16
|
/**
|
|
16
|
-
* This class controls every other
|
|
17
|
+
* This class controls every other Ketchup utility suite.
|
|
17
18
|
* @module KupManager
|
|
18
19
|
*/
|
|
19
20
|
export class KupManager {
|
|
@@ -21,11 +22,11 @@ export class KupManager {
|
|
|
21
22
|
* Initializes KupManager.
|
|
22
23
|
*/
|
|
23
24
|
constructor(overrides) {
|
|
24
|
-
let datesLocale = null, debugActive = null, debugAutoprint = null, debugLogLimit = null, dialogZIndex = null, languageList = null, languageName = null, objectsList = null, scrollOnHoverDelay = null, scrollOnHoverStep = null, themeList = null, themeName = null;
|
|
25
|
+
let datesLocale = null, debugActive = null, debugAutoprint = null, debugLogLimit = null, dialogRestrictContainer = null, dialogZIndex = null, languageList = null, languageName = null, objectsList = null, scrollOnHoverDelay = null, scrollOnHoverStep = null, themeList = null, themeName = null;
|
|
25
26
|
if (overrides) {
|
|
26
27
|
const dates = overrides.dates;
|
|
27
28
|
const debug = overrides.debug;
|
|
28
|
-
const
|
|
29
|
+
const interact = overrides.interact;
|
|
29
30
|
const language = overrides.language;
|
|
30
31
|
const objects = overrides.objects;
|
|
31
32
|
const scrollOnHover = overrides.scrollOnHover;
|
|
@@ -38,8 +39,11 @@ export class KupManager {
|
|
|
38
39
|
debugAutoprint = debug.autoPrint ? debug.autoPrint : null;
|
|
39
40
|
debugLogLimit = debug.logLimit ? debug.logLimit : null;
|
|
40
41
|
}
|
|
41
|
-
if (
|
|
42
|
-
|
|
42
|
+
if (interact) {
|
|
43
|
+
dialogRestrictContainer = interact.restrictContainer
|
|
44
|
+
? dialogRestrictContainer
|
|
45
|
+
: null;
|
|
46
|
+
dialogZIndex = interact.zIndex ? interact.zIndex : null;
|
|
43
47
|
}
|
|
44
48
|
if (language) {
|
|
45
49
|
languageList = language.list ? language.list : null;
|
|
@@ -63,8 +67,8 @@ export class KupManager {
|
|
|
63
67
|
}
|
|
64
68
|
this.dates = new KupDates(datesLocale);
|
|
65
69
|
this.debug = new KupDebug(debugActive, debugAutoprint, debugLogLimit);
|
|
66
|
-
this.dialog = new KupDialog(dialogZIndex);
|
|
67
70
|
this.dynamicPosition = new KupDynamicPosition();
|
|
71
|
+
this.interact = new KupInteract(dialogZIndex, dialogRestrictContainer);
|
|
68
72
|
this.language = new KupLanguage(languageList, languageName);
|
|
69
73
|
this.magicBox = null;
|
|
70
74
|
this.overrides = overrides ? overrides : null;
|
|
@@ -86,8 +90,9 @@ export class KupManager {
|
|
|
86
90
|
});
|
|
87
91
|
});
|
|
88
92
|
this.scrollOnHover = new KupScrollOnHover(scrollOnHoverDelay, scrollOnHoverStep);
|
|
93
|
+
this.search = new KupSearch();
|
|
89
94
|
this.utilities = {
|
|
90
|
-
|
|
95
|
+
clickCallbacks: new Set(),
|
|
91
96
|
lastPointerDownString: null,
|
|
92
97
|
};
|
|
93
98
|
this.theme = new KupTheme(themeList, themeName);
|
|
@@ -95,7 +100,6 @@ export class KupManager {
|
|
|
95
100
|
document.addEventListener('pointerdown', (e) => {
|
|
96
101
|
const paths = e.composedPath();
|
|
97
102
|
const lastString = paths[0].innerText || paths[0].value;
|
|
98
|
-
this.utilities.lastPointerDownPath = paths;
|
|
99
103
|
this.utilities.lastPointerDownString = lastString;
|
|
100
104
|
if (lastString) {
|
|
101
105
|
document.dispatchEvent(new CustomEvent('kup-manager-stringfinder', {
|
|
@@ -104,6 +108,17 @@ export class KupManager {
|
|
|
104
108
|
}));
|
|
105
109
|
}
|
|
106
110
|
});
|
|
111
|
+
document.addEventListener('click', (e) => {
|
|
112
|
+
const paths = e.composedPath();
|
|
113
|
+
this.utilities.clickCallbacks.forEach((obj) => {
|
|
114
|
+
if (obj &&
|
|
115
|
+
obj.el &&
|
|
116
|
+
obj.el.isConnected &&
|
|
117
|
+
!paths.includes(obj.el)) {
|
|
118
|
+
obj.cb();
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
});
|
|
107
122
|
}
|
|
108
123
|
/**
|
|
109
124
|
* Creates kup-magic-box component.
|
|
@@ -156,9 +171,31 @@ export class KupManager {
|
|
|
156
171
|
this.dates.setLocale(locale);
|
|
157
172
|
this.language.set(KupLanguageDefaults[locale]);
|
|
158
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Adds a new click callback.
|
|
176
|
+
* @param {KupManagerClickCb} cb - The callback to add.
|
|
177
|
+
* @param {boolean} async - When true, the callback will be added asynchrounously to prevent instant firing if it was added through a click event.
|
|
178
|
+
*/
|
|
179
|
+
addClickCallback(cb, async) {
|
|
180
|
+
if (async) {
|
|
181
|
+
setTimeout(() => {
|
|
182
|
+
this.utilities.clickCallbacks.add(cb);
|
|
183
|
+
}, 0);
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
this.utilities.clickCallbacks.add(cb);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Removes the given click callback.
|
|
191
|
+
* @param {KupManagerClickCb} cb - The callback to remove.
|
|
192
|
+
*/
|
|
193
|
+
removeClickCallback(cb) {
|
|
194
|
+
this.utilities.clickCallbacks.delete(cb);
|
|
195
|
+
}
|
|
159
196
|
}
|
|
160
197
|
/**
|
|
161
|
-
* Called by the
|
|
198
|
+
* Called by the Ketchup components to retrieve the instance of KupManager (or creating a new one when missing).
|
|
162
199
|
* @returns {KupManager} KupManager instance.
|
|
163
200
|
*/
|
|
164
201
|
export function kupManagerInstance() {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { KupDates } from '../kup-dates/kup-dates';
|
|
2
1
|
import * as objJson from './obj.json';
|
|
3
2
|
const dom = document.documentElement;
|
|
4
|
-
const kupDates = dom.ketchup ? dom.ketchup.dates : new KupDates();
|
|
5
3
|
/**
|
|
6
4
|
* Handles objects definition and validation.
|
|
7
5
|
* @module KupObjects
|
|
@@ -48,42 +46,18 @@ export class KupObjects {
|
|
|
48
46
|
* @returns {boolean} True when the object has extra columns.
|
|
49
47
|
*/
|
|
50
48
|
canObjHaveExtraColumns(obj) {
|
|
51
|
-
if (
|
|
52
|
-
return false;
|
|
53
|
-
if (!obj.t ||
|
|
54
|
-
obj.t.trim() == '' ||
|
|
55
|
-
obj.t.trim() == '**') {
|
|
49
|
+
if (this.isEmptyKupObj(obj)) {
|
|
56
50
|
return false;
|
|
57
51
|
}
|
|
58
|
-
|
|
59
|
-
!this.isButton(obj) &&
|
|
60
|
-
!this.isCheckbox(obj) &&
|
|
61
|
-
!this.isIcon(obj) &&
|
|
62
|
-
!this.isImage(obj) &&
|
|
63
|
-
!this.isLink(obj) &&
|
|
64
|
-
!this.isProgressBar(obj) &&
|
|
65
|
-
!this.isRadio(obj) &&
|
|
66
|
-
!this.isVoCodver(obj) &&
|
|
67
|
-
!this.isChart(obj));
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Checks whether the object can have a related tooltip or not.
|
|
71
|
-
* @param {KupObj} obj - Object to check.
|
|
72
|
-
* @returns {boolean} True when the object can have a related tooltip.
|
|
73
|
-
*/
|
|
74
|
-
hasTooltip(obj) {
|
|
75
|
-
if (!obj)
|
|
76
|
-
return false;
|
|
77
|
-
if (obj.t == null || obj.t.trim() == '')
|
|
52
|
+
if (obj.t.trim() == '**') {
|
|
78
53
|
return false;
|
|
54
|
+
}
|
|
79
55
|
return (!this.isBar(obj) &&
|
|
80
56
|
!this.isButton(obj) &&
|
|
81
57
|
!this.isCheckbox(obj) &&
|
|
82
58
|
!this.isIcon(obj) &&
|
|
83
59
|
!this.isImage(obj) &&
|
|
84
60
|
!this.isLink(obj) &&
|
|
85
|
-
!this.isNumber(obj) &&
|
|
86
|
-
!this.isPercentage(obj) &&
|
|
87
61
|
!this.isProgressBar(obj) &&
|
|
88
62
|
!this.isRadio(obj) &&
|
|
89
63
|
!this.isVoCodver(obj) &&
|
|
@@ -310,10 +284,12 @@ export class KupObjects {
|
|
|
310
284
|
* @param {KupObj} obj - Object to check.
|
|
311
285
|
* @returns {boolean} True when the object is null or empty.
|
|
312
286
|
*/
|
|
313
|
-
|
|
287
|
+
isEmptyKupObj(obj) {
|
|
314
288
|
if (!obj)
|
|
315
289
|
return true;
|
|
316
|
-
return obj.t
|
|
290
|
+
return ((!obj.t || obj.t.trim() == '') &&
|
|
291
|
+
(!obj.p || obj.p.trim() == '') &&
|
|
292
|
+
(!obj.k || obj.k.trim() == ''));
|
|
317
293
|
}
|
|
318
294
|
/**
|
|
319
295
|
* Parses a date depending on the object's type.
|
|
@@ -322,8 +298,8 @@ export class KupObjects {
|
|
|
322
298
|
*/
|
|
323
299
|
parseDate(obj) {
|
|
324
300
|
if (obj.t === 'D8' && obj.p === '*DMYY') {
|
|
325
|
-
return
|
|
301
|
+
return dom.ketchup.dates.toDayjs(obj.k, 'DDMMYYYY');
|
|
326
302
|
}
|
|
327
|
-
return
|
|
303
|
+
return dom.ketchup.dates.toDayjs(obj.k);
|
|
328
304
|
}
|
|
329
305
|
}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver,
|
|
2
|
-
if (
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return value;
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
6
|
};
|
|
8
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver,
|
|
9
|
-
if (!
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return privateMap.get(receiver);
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
13
11
|
};
|
|
14
|
-
var
|
|
12
|
+
var _KupScrollOnHover_arrowsContainer, _KupScrollOnHover_leftArrows, _KupScrollOnHover_rightArrows, _KupScrollOnHover_scrollEvent, _KupScrollOnHover_mousemoveEvent, _KupScrollOnHover_mouseleaveEvent, _KupScrollOnHover_rAF, _KupScrollOnHover_timeout;
|
|
15
13
|
import { ScrollOnHoverDirection, } from './kup-scroll-on-hover-declarations';
|
|
16
14
|
const dom = document.documentElement;
|
|
17
15
|
/**
|
|
@@ -25,40 +23,40 @@ export class KupScrollOnHover {
|
|
|
25
23
|
* @param {number} step - The amount in pixels for each scroll recursion.
|
|
26
24
|
*/
|
|
27
25
|
constructor(delay, step) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
_KupScrollOnHover_arrowsContainer.set(this, void 0);
|
|
27
|
+
_KupScrollOnHover_leftArrows.set(this, void 0);
|
|
28
|
+
_KupScrollOnHover_rightArrows.set(this, void 0);
|
|
29
|
+
_KupScrollOnHover_scrollEvent.set(this, void 0);
|
|
30
|
+
_KupScrollOnHover_mousemoveEvent.set(this, void 0);
|
|
31
|
+
_KupScrollOnHover_mouseleaveEvent.set(this, void 0);
|
|
32
|
+
_KupScrollOnHover_rAF.set(this, void 0);
|
|
33
|
+
_KupScrollOnHover_timeout.set(this, void 0);
|
|
36
34
|
this.delay = delay ? delay : 500;
|
|
37
35
|
this.managedElements = new Set();
|
|
38
36
|
this.step = step ? step : 50;
|
|
39
|
-
__classPrivateFieldSet(this,
|
|
40
|
-
__classPrivateFieldSet(this,
|
|
41
|
-
__classPrivateFieldSet(this,
|
|
42
|
-
__classPrivateFieldSet(this,
|
|
43
|
-
__classPrivateFieldSet(this,
|
|
44
|
-
__classPrivateFieldSet(this,
|
|
45
|
-
__classPrivateFieldSet(this,
|
|
46
|
-
__classPrivateFieldSet(this,
|
|
47
|
-
__classPrivateFieldGet(this,
|
|
37
|
+
__classPrivateFieldSet(this, _KupScrollOnHover_arrowsContainer, document.createElement('div'), "f");
|
|
38
|
+
__classPrivateFieldSet(this, _KupScrollOnHover_leftArrows, [], "f");
|
|
39
|
+
__classPrivateFieldSet(this, _KupScrollOnHover_mouseleaveEvent, (event) => this.stop(event.target), "f");
|
|
40
|
+
__classPrivateFieldSet(this, _KupScrollOnHover_mousemoveEvent, (event) => this.start(event), "f");
|
|
41
|
+
__classPrivateFieldSet(this, _KupScrollOnHover_rAF, null, "f");
|
|
42
|
+
__classPrivateFieldSet(this, _KupScrollOnHover_rightArrows, [], "f");
|
|
43
|
+
__classPrivateFieldSet(this, _KupScrollOnHover_scrollEvent, (event) => this.updateChildren(event.target), "f");
|
|
44
|
+
__classPrivateFieldSet(this, _KupScrollOnHover_timeout, null, "f");
|
|
45
|
+
__classPrivateFieldGet(this, _KupScrollOnHover_arrowsContainer, "f").id = 'kup-scrolling-arrows';
|
|
48
46
|
for (let index = 1; index < 4; index++) {
|
|
49
47
|
const arrow = document.createElement('div');
|
|
50
48
|
arrow.setAttribute('class', 'kup-left-scrolling-arrow kup-arrow-' + index);
|
|
51
|
-
__classPrivateFieldGet(this,
|
|
49
|
+
__classPrivateFieldGet(this, _KupScrollOnHover_leftArrows, "f").push(arrow);
|
|
52
50
|
}
|
|
53
51
|
for (let index = 1; index < 4; index++) {
|
|
54
52
|
const arrow = document.createElement('div');
|
|
55
53
|
arrow.setAttribute('class', 'kup-right-scrolling-arrow kup-arrow-' + index);
|
|
56
|
-
__classPrivateFieldGet(this,
|
|
54
|
+
__classPrivateFieldGet(this, _KupScrollOnHover_rightArrows, "f").push(arrow);
|
|
57
55
|
}
|
|
58
|
-
__classPrivateFieldGet(this,
|
|
56
|
+
__classPrivateFieldGet(this, _KupScrollOnHover_arrowsContainer, "f").append(__classPrivateFieldGet(this, _KupScrollOnHover_leftArrows, "f")[2], __classPrivateFieldGet(this, _KupScrollOnHover_leftArrows, "f")[1], __classPrivateFieldGet(this, _KupScrollOnHover_leftArrows, "f")[0], __classPrivateFieldGet(this, _KupScrollOnHover_rightArrows, "f")[0], __classPrivateFieldGet(this, _KupScrollOnHover_rightArrows, "f")[1], __classPrivateFieldGet(this, _KupScrollOnHover_rightArrows, "f")[2]);
|
|
59
57
|
this.container = document.createElement('div');
|
|
60
58
|
this.container.setAttribute('kup-scroll-on-hover', '');
|
|
61
|
-
this.container.appendChild(__classPrivateFieldGet(this,
|
|
59
|
+
this.container.appendChild(__classPrivateFieldGet(this, _KupScrollOnHover_arrowsContainer, "f"));
|
|
62
60
|
document.body.appendChild(this.container);
|
|
63
61
|
}
|
|
64
62
|
/**
|
|
@@ -76,10 +74,10 @@ export class KupScrollOnHover {
|
|
|
76
74
|
y: 0,
|
|
77
75
|
};
|
|
78
76
|
if (el.scrollOnHover.children) {
|
|
79
|
-
el.addEventListener('scroll', __classPrivateFieldGet(this,
|
|
77
|
+
el.addEventListener('scroll', __classPrivateFieldGet(this, _KupScrollOnHover_scrollEvent, "f"));
|
|
80
78
|
}
|
|
81
|
-
el.addEventListener('mousemove', __classPrivateFieldGet(this,
|
|
82
|
-
el.addEventListener('mouseleave', __classPrivateFieldGet(this,
|
|
79
|
+
el.addEventListener('mousemove', __classPrivateFieldGet(this, _KupScrollOnHover_mousemoveEvent, "f"));
|
|
80
|
+
el.addEventListener('mouseleave', __classPrivateFieldGet(this, _KupScrollOnHover_mouseleaveEvent, "f"));
|
|
83
81
|
this.managedElements.add(el);
|
|
84
82
|
}
|
|
85
83
|
/**
|
|
@@ -87,9 +85,9 @@ export class KupScrollOnHover {
|
|
|
87
85
|
* @param {KupScrollOnHoverElement} el - Element to unregister.
|
|
88
86
|
*/
|
|
89
87
|
unregister(el) {
|
|
90
|
-
el.removeEventListener('scroll', __classPrivateFieldGet(this,
|
|
91
|
-
el.removeEventListener('mousemove', __classPrivateFieldGet(this,
|
|
92
|
-
el.removeEventListener('mouseleave', __classPrivateFieldGet(this,
|
|
88
|
+
el.removeEventListener('scroll', __classPrivateFieldGet(this, _KupScrollOnHover_scrollEvent, "f"));
|
|
89
|
+
el.removeEventListener('mousemove', __classPrivateFieldGet(this, _KupScrollOnHover_mousemoveEvent, "f"));
|
|
90
|
+
el.removeEventListener('mouseleave', __classPrivateFieldGet(this, _KupScrollOnHover_mouseleaveEvent, "f"));
|
|
93
91
|
if (this.managedElements) {
|
|
94
92
|
this.managedElements.delete(el);
|
|
95
93
|
}
|
|
@@ -111,9 +109,9 @@ export class KupScrollOnHover {
|
|
|
111
109
|
el.scrollOnHover.rect = el.getBoundingClientRect();
|
|
112
110
|
el.scrollOnHover.x = event.clientX;
|
|
113
111
|
el.scrollOnHover.y = event.clientY;
|
|
114
|
-
__classPrivateFieldGet(this,
|
|
115
|
-
__classPrivateFieldGet(this,
|
|
116
|
-
if (el.scrollOnHover.active || __classPrivateFieldGet(this,
|
|
112
|
+
__classPrivateFieldGet(this, _KupScrollOnHover_arrowsContainer, "f").style.left = event.clientX + 'px';
|
|
113
|
+
__classPrivateFieldGet(this, _KupScrollOnHover_arrowsContainer, "f").style.top = event.clientY + 'px';
|
|
114
|
+
if (el.scrollOnHover.active || __classPrivateFieldGet(this, _KupScrollOnHover_timeout, "f")) {
|
|
117
115
|
return;
|
|
118
116
|
}
|
|
119
117
|
let trueWidth = el.clientWidth;
|
|
@@ -135,18 +133,18 @@ export class KupScrollOnHover {
|
|
|
135
133
|
if (direction) {
|
|
136
134
|
for (let i = 0; i < 3; i++) {
|
|
137
135
|
if (direction === ScrollOnHoverDirection.LEFT) {
|
|
138
|
-
__classPrivateFieldGet(this,
|
|
136
|
+
__classPrivateFieldGet(this, _KupScrollOnHover_leftArrows, "f")[i].classList.add('kup-activated');
|
|
139
137
|
}
|
|
140
138
|
else {
|
|
141
|
-
__classPrivateFieldGet(this,
|
|
139
|
+
__classPrivateFieldGet(this, _KupScrollOnHover_rightArrows, "f")[i].classList.add('kup-activated');
|
|
142
140
|
}
|
|
143
141
|
}
|
|
144
|
-
__classPrivateFieldSet(this,
|
|
142
|
+
__classPrivateFieldSet(this, _KupScrollOnHover_timeout, setTimeout(() => {
|
|
145
143
|
el.scrollOnHover.active = true;
|
|
146
|
-
__classPrivateFieldSet(this,
|
|
144
|
+
__classPrivateFieldSet(this, _KupScrollOnHover_rAF, requestAnimationFrame(function () {
|
|
147
145
|
dom.ketchup.scrollOnHover.run(el, maxScrollLeft, percRight, percLeft, direction);
|
|
148
|
-
}));
|
|
149
|
-
}, this.delay));
|
|
146
|
+
}), "f");
|
|
147
|
+
}, this.delay), "f");
|
|
150
148
|
}
|
|
151
149
|
}
|
|
152
150
|
}
|
|
@@ -157,16 +155,16 @@ export class KupScrollOnHover {
|
|
|
157
155
|
*/
|
|
158
156
|
async stop(el) {
|
|
159
157
|
el.scrollOnHover.active = false;
|
|
160
|
-
cancelAnimationFrame(__classPrivateFieldGet(this,
|
|
161
|
-
clearTimeout(__classPrivateFieldGet(this,
|
|
162
|
-
__classPrivateFieldSet(this,
|
|
163
|
-
for (let i = 0; i < __classPrivateFieldGet(this,
|
|
164
|
-
__classPrivateFieldGet(this,
|
|
165
|
-
__classPrivateFieldGet(this,
|
|
158
|
+
cancelAnimationFrame(__classPrivateFieldGet(this, _KupScrollOnHover_rAF, "f"));
|
|
159
|
+
clearTimeout(__classPrivateFieldGet(this, _KupScrollOnHover_timeout, "f"));
|
|
160
|
+
__classPrivateFieldSet(this, _KupScrollOnHover_timeout, null, "f");
|
|
161
|
+
for (let i = 0; i < __classPrivateFieldGet(this, _KupScrollOnHover_leftArrows, "f").length; i++) {
|
|
162
|
+
__classPrivateFieldGet(this, _KupScrollOnHover_leftArrows, "f")[i].classList.remove('kup-activated');
|
|
163
|
+
__classPrivateFieldGet(this, _KupScrollOnHover_leftArrows, "f")[i].classList.remove('kup-animated');
|
|
166
164
|
}
|
|
167
|
-
for (let i = 0; i < __classPrivateFieldGet(this,
|
|
168
|
-
__classPrivateFieldGet(this,
|
|
169
|
-
__classPrivateFieldGet(this,
|
|
165
|
+
for (let i = 0; i < __classPrivateFieldGet(this, _KupScrollOnHover_rightArrows, "f").length; i++) {
|
|
166
|
+
__classPrivateFieldGet(this, _KupScrollOnHover_rightArrows, "f")[i].classList.remove('kup-activated');
|
|
167
|
+
__classPrivateFieldGet(this, _KupScrollOnHover_rightArrows, "f")[i].classList.remove('kup-animated');
|
|
170
168
|
}
|
|
171
169
|
}
|
|
172
170
|
/**
|
|
@@ -200,7 +198,7 @@ export class KupScrollOnHover {
|
|
|
200
198
|
}
|
|
201
199
|
let arrow;
|
|
202
200
|
if (direction === ScrollOnHoverDirection.LEFT) {
|
|
203
|
-
arrow = __classPrivateFieldGet(this,
|
|
201
|
+
arrow = __classPrivateFieldGet(this, _KupScrollOnHover_leftArrows, "f");
|
|
204
202
|
if (el.scrollLeft === 0) {
|
|
205
203
|
this.stop(el);
|
|
206
204
|
return;
|
|
@@ -208,7 +206,7 @@ export class KupScrollOnHover {
|
|
|
208
206
|
el.scrollLeft -= this.step;
|
|
209
207
|
}
|
|
210
208
|
else {
|
|
211
|
-
arrow = __classPrivateFieldGet(this,
|
|
209
|
+
arrow = __classPrivateFieldGet(this, _KupScrollOnHover_rightArrows, "f");
|
|
212
210
|
if (el.scrollLeft === maxScrollLeft) {
|
|
213
211
|
this.stop(el);
|
|
214
212
|
return;
|
|
@@ -218,9 +216,9 @@ export class KupScrollOnHover {
|
|
|
218
216
|
for (let i = 0; i < arrow.length; i++) {
|
|
219
217
|
arrow[i].classList.add('kup-animated');
|
|
220
218
|
}
|
|
221
|
-
__classPrivateFieldSet(this,
|
|
219
|
+
__classPrivateFieldSet(this, _KupScrollOnHover_rAF, requestAnimationFrame(function () {
|
|
222
220
|
dom.ketchup.scrollOnHover.run(el, maxScrollLeft, percRight, percLeft, direction);
|
|
223
|
-
}));
|
|
221
|
+
}), "f");
|
|
224
222
|
}
|
|
225
223
|
/**
|
|
226
224
|
* Scrolls children of the element having the "hover-scrolling-child" class
|
|
@@ -232,4 +230,4 @@ export class KupScrollOnHover {
|
|
|
232
230
|
}
|
|
233
231
|
}
|
|
234
232
|
}
|
|
235
|
-
|
|
233
|
+
_KupScrollOnHover_arrowsContainer = new WeakMap(), _KupScrollOnHover_leftArrows = new WeakMap(), _KupScrollOnHover_rightArrows = new WeakMap(), _KupScrollOnHover_scrollEvent = new WeakMap(), _KupScrollOnHover_mousemoveEvent = new WeakMap(), _KupScrollOnHover_mouseleaveEvent = new WeakMap(), _KupScrollOnHover_rAF = new WeakMap(), _KupScrollOnHover_timeout = new WeakMap();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const searchStartEvent = 'kup-search-start';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { KupCardFamily, } from '../../components/kup-card/kup-card-declarations';
|
|
2
|
+
import { searchStartEvent, } from './kup-search-declarations';
|
|
3
|
+
/**
|
|
4
|
+
* Handles operations and formatting of dates.
|
|
5
|
+
* @module KupSearch
|
|
6
|
+
*/
|
|
7
|
+
export class KupSearch {
|
|
8
|
+
/**
|
|
9
|
+
* Initializes KupSearch.
|
|
10
|
+
*/
|
|
11
|
+
constructor() {
|
|
12
|
+
this.container = document.createElement('div');
|
|
13
|
+
this.container.setAttribute('kup-search', '');
|
|
14
|
+
document.body.appendChild(this.container);
|
|
15
|
+
this.activeCards = new Set();
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Starts the search process.
|
|
19
|
+
* @param {Function} callback - The callback that must be invoked when the search is over.
|
|
20
|
+
* @param {Partial<KupCard>} props - The props of the search card. When missing, the search will display a spinner in place of the data table.
|
|
21
|
+
* @returns {HTMLKupCardElement} The search card created by this method.
|
|
22
|
+
*/
|
|
23
|
+
start(callback, props) {
|
|
24
|
+
const card = document.createElement('kup-card');
|
|
25
|
+
card.data = {};
|
|
26
|
+
card.isMenu = true;
|
|
27
|
+
card.layoutFamily = KupCardFamily.DIALOG;
|
|
28
|
+
card.layoutNumber = 6;
|
|
29
|
+
card.menuVisible = false;
|
|
30
|
+
card.sizeX = '50vw';
|
|
31
|
+
card.sizeY = '50vh';
|
|
32
|
+
if (props) {
|
|
33
|
+
for (const key in props) {
|
|
34
|
+
const prop = props[key];
|
|
35
|
+
card[key] = prop;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
const e = new CustomEvent(searchStartEvent, {
|
|
40
|
+
bubbles: true,
|
|
41
|
+
cancelable: true,
|
|
42
|
+
detail: {
|
|
43
|
+
card: card,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
document.dispatchEvent(e);
|
|
47
|
+
}
|
|
48
|
+
card.style.position = 'fixed';
|
|
49
|
+
card.style.left = '0';
|
|
50
|
+
card.style.top = '0';
|
|
51
|
+
this.activeCards.add(card);
|
|
52
|
+
card.addEventListener('kup-card-close', () => {
|
|
53
|
+
this.activeCards.delete(card);
|
|
54
|
+
});
|
|
55
|
+
card.addEventListener('kup-card-event', (e) => {
|
|
56
|
+
const cardDetail = e.detail;
|
|
57
|
+
const datatableDetail = cardDetail.event.detail;
|
|
58
|
+
if (cardDetail.event.type === 'kup-datatable-rowselected') {
|
|
59
|
+
callback(datatableDetail);
|
|
60
|
+
this.activeCards.delete(card);
|
|
61
|
+
card.remove();
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
card.addEventListener('kup-card-ready', () => {
|
|
65
|
+
const x = card.clientWidth / 2;
|
|
66
|
+
const y = card.clientHeight / 2;
|
|
67
|
+
card.setAttribute('data-x', x.toString());
|
|
68
|
+
card.setAttribute('data-y', y.toString());
|
|
69
|
+
card.style.transform = 'translate(' + x + 'px,' + y + 'px)';
|
|
70
|
+
card.menuVisible = true;
|
|
71
|
+
});
|
|
72
|
+
this.container.appendChild(card);
|
|
73
|
+
return card;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -12,6 +12,7 @@ export var KupThemeColorValues;
|
|
|
12
12
|
KupThemeColorValues["BACKGROUND"] = "--kup-background-color";
|
|
13
13
|
KupThemeColorValues["NAV_BAR"] = "--kup-navbar-color";
|
|
14
14
|
KupThemeColorValues["NAV_BAR_BACKGROUND"] = "--kup-navbar-background-color";
|
|
15
|
+
KupThemeColorValues["DRAWER"] = "--kup-drawer-color";
|
|
15
16
|
KupThemeColorValues["DRAWER_BACKGROUND"] = "--kup-drawer-background-color";
|
|
16
17
|
KupThemeColorValues["TEXT"] = "--kup-text-color";
|
|
17
18
|
KupThemeColorValues["TEXT_ON_PRIMARY"] = "--kup-text-on-primary-color";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getAssetPath } from '@stencil/core';
|
|
2
2
|
import * as themesJson from './themes.json';
|
|
3
|
+
import * as globalCSS from '../../style/global.css';
|
|
3
4
|
import * as themeCSS from './kup-theme.css';
|
|
4
5
|
import { masterCustomStyle, } from './kup-theme-declarations';
|
|
5
6
|
import { KupDebugCategory } from '../kup-debug/kup-debug-declarations';
|
|
@@ -175,13 +176,13 @@ export class KupTheme {
|
|
|
175
176
|
}
|
|
176
177
|
}
|
|
177
178
|
/**
|
|
178
|
-
* Combines theme's and component's customStyles, returning the result.
|
|
179
|
+
* Combines global (style every component should have), theme's and component's customStyles, returning the result.
|
|
179
180
|
* @param comp - The component calling this function.
|
|
180
181
|
* @returns {string} Combined customStyle.
|
|
181
182
|
*/
|
|
182
|
-
|
|
183
|
+
setKupStyle(comp) {
|
|
183
184
|
const styles = this.list[this.name].customStyles;
|
|
184
|
-
let completeStyle = '';
|
|
185
|
+
let completeStyle = globalCSS['default'];
|
|
185
186
|
if (styles && styles[masterCustomStyle]) {
|
|
186
187
|
completeStyle += styles[masterCustomStyle];
|
|
187
188
|
}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver,
|
|
2
|
-
if (
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return value;
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
6
|
};
|
|
8
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver,
|
|
9
|
-
if (!
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return privateMap.get(receiver);
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
13
11
|
};
|
|
14
|
-
var
|
|
12
|
+
var _KupToolbar_keyEvent;
|
|
15
13
|
import { KupToolbarModifierKeys } from './kup-toolbar-declarations';
|
|
16
14
|
const dom = document.documentElement;
|
|
17
15
|
/**
|
|
@@ -23,14 +21,14 @@ export class KupToolbar {
|
|
|
23
21
|
* Initializes KupToolbar.
|
|
24
22
|
*/
|
|
25
23
|
constructor() {
|
|
26
|
-
|
|
24
|
+
_KupToolbar_keyEvent.set(this, void 0);
|
|
27
25
|
this.active = false;
|
|
28
26
|
this.managedElements = new Set();
|
|
29
27
|
this.modifiers = [
|
|
30
28
|
KupToolbarModifierKeys.ALT,
|
|
31
29
|
KupToolbarModifierKeys.CTRL,
|
|
32
30
|
];
|
|
33
|
-
__classPrivateFieldSet(this,
|
|
31
|
+
__classPrivateFieldSet(this, _KupToolbar_keyEvent, function (e) {
|
|
34
32
|
const toolbar = dom.ketchup.toolbar;
|
|
35
33
|
if (toolbar.managedElements) {
|
|
36
34
|
for (let index = 0; index < toolbar.modifiers.length; index++) {
|
|
@@ -52,9 +50,9 @@ export class KupToolbar {
|
|
|
52
50
|
}
|
|
53
51
|
toolbar.show();
|
|
54
52
|
}
|
|
55
|
-
});
|
|
56
|
-
document.addEventListener('keydown', __classPrivateFieldGet(this,
|
|
57
|
-
document.addEventListener('keyup', __classPrivateFieldGet(this,
|
|
53
|
+
}, "f");
|
|
54
|
+
document.addEventListener('keydown', __classPrivateFieldGet(this, _KupToolbar_keyEvent, "f"));
|
|
55
|
+
document.addEventListener('keyup', __classPrivateFieldGet(this, _KupToolbar_keyEvent, "f"));
|
|
58
56
|
}
|
|
59
57
|
/**
|
|
60
58
|
* Shows components' toolbar.
|
|
@@ -105,4 +103,4 @@ export class KupToolbar {
|
|
|
105
103
|
return !this.managedElements ? false : this.managedElements.has(el);
|
|
106
104
|
}
|
|
107
105
|
}
|
|
108
|
-
|
|
106
|
+
_KupToolbar_keyEvent = new WeakMap();
|