@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
|
@@ -1,23 +1,21 @@
|
|
|
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 _KupDebug_debugWidget;
|
|
15
13
|
import { KupCardFamily } from '../../components/kup-card/kup-card-declarations';
|
|
16
14
|
import { KupLanguageDebug } from '../kup-language/kup-language-declarations';
|
|
17
15
|
import { KupDebugCategory, KupDebugLogColor, } from './kup-debug-declarations';
|
|
18
16
|
const dom = document.documentElement;
|
|
19
17
|
/**
|
|
20
|
-
* Debugging suite, used to log messages and statuses from the
|
|
18
|
+
* Debugging suite, used to log messages and statuses from the Ketchup components.
|
|
21
19
|
* @module KupDebug
|
|
22
20
|
*/
|
|
23
21
|
export class KupDebug {
|
|
@@ -28,7 +26,7 @@ export class KupDebug {
|
|
|
28
26
|
* @param {number} logLimit - Maximum amount of logs stored, when they exceed the number specified in logLimit the cache will be automatically cleared.
|
|
29
27
|
*/
|
|
30
28
|
constructor(active, autoprint, logLimit) {
|
|
31
|
-
|
|
29
|
+
_KupDebug_debugWidget.set(this, void 0);
|
|
32
30
|
this.active = active ? true : false;
|
|
33
31
|
this.autoPrint = autoprint ? true : false;
|
|
34
32
|
this.container = document.createElement('div');
|
|
@@ -36,9 +34,9 @@ export class KupDebug {
|
|
|
36
34
|
document.body.appendChild(this.container);
|
|
37
35
|
this.logLimit = logLimit ? logLimit : 250;
|
|
38
36
|
this.logs = [];
|
|
39
|
-
__classPrivateFieldSet(this,
|
|
37
|
+
__classPrivateFieldSet(this, _KupDebug_debugWidget, null, "f");
|
|
40
38
|
document.addEventListener('kup-language-change', () => {
|
|
41
|
-
if (this.active && __classPrivateFieldGet(this,
|
|
39
|
+
if (this.active && __classPrivateFieldGet(this, _KupDebug_debugWidget, "f")) {
|
|
42
40
|
this.hideWidget();
|
|
43
41
|
this.showWidget();
|
|
44
42
|
}
|
|
@@ -82,6 +80,15 @@ export class KupDebug {
|
|
|
82
80
|
selected: themes[index] === dom.ketchup.theme.name ? true : false,
|
|
83
81
|
});
|
|
84
82
|
}
|
|
83
|
+
const locales = dom.ketchup.dates.getLocales();
|
|
84
|
+
const localesListData = [];
|
|
85
|
+
for (let index = 0; index < locales.length; index++) {
|
|
86
|
+
localesListData.push({
|
|
87
|
+
text: locales[index],
|
|
88
|
+
value: locales[index],
|
|
89
|
+
selected: locales[index] === dom.ketchup.dates.locale ? true : false,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
85
92
|
debugWidget.data = {
|
|
86
93
|
button: [
|
|
87
94
|
{
|
|
@@ -179,6 +186,24 @@ export class KupDebug {
|
|
|
179
186
|
initialValue: dom.ketchup.language.name,
|
|
180
187
|
isSelect: true,
|
|
181
188
|
},
|
|
189
|
+
{
|
|
190
|
+
className: 'kup-full-height',
|
|
191
|
+
data: {
|
|
192
|
+
'kup-list': {
|
|
193
|
+
data: localesListData,
|
|
194
|
+
id: 'kup-debug-locale-changer-list',
|
|
195
|
+
},
|
|
196
|
+
'kup-text-field': {
|
|
197
|
+
className: 'kup-full-height',
|
|
198
|
+
emitSubmitEventOnEnter: false,
|
|
199
|
+
inputType: 'text',
|
|
200
|
+
label: dom.ketchup.language.translate(KupLanguageDebug.LOCALE_CHANGER),
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
id: 'kup-debug-locale-changer',
|
|
204
|
+
initialValue: dom.ketchup.dates.locale,
|
|
205
|
+
isSelect: true,
|
|
206
|
+
},
|
|
182
207
|
],
|
|
183
208
|
textfield: [
|
|
184
209
|
{
|
|
@@ -192,7 +217,7 @@ export class KupDebug {
|
|
|
192
217
|
],
|
|
193
218
|
};
|
|
194
219
|
debugWidget.customStyle =
|
|
195
|
-
'#kup-debug-log-limit {width: 120px;} #kup-debug-theme-changer {width: 190px;} #kup-debug-language-changer {width: 190px;}';
|
|
220
|
+
'#kup-debug-log-limit {width: 120px;} #kup-debug-theme-changer {width: 190px;} #kup-debug-language-changer {width: 190px;} #kup-debug-locale-changer {width: 190px;}';
|
|
196
221
|
debugWidget.id = 'kup-debug-widget';
|
|
197
222
|
debugWidget.layoutFamily = KupCardFamily.DIALOG;
|
|
198
223
|
debugWidget.layoutNumber = 3;
|
|
@@ -200,20 +225,20 @@ export class KupDebug {
|
|
|
200
225
|
debugWidget.sizeY = 'auto';
|
|
201
226
|
debugWidget.addEventListener('kup-card-event', (e) => this.handleEvents(e));
|
|
202
227
|
this.container.append(debugWidget);
|
|
203
|
-
__classPrivateFieldSet(this,
|
|
228
|
+
__classPrivateFieldSet(this, _KupDebug_debugWidget, debugWidget, "f");
|
|
204
229
|
}
|
|
205
230
|
/**
|
|
206
231
|
* Closes the debug widget.
|
|
207
232
|
*/
|
|
208
233
|
hideWidget() {
|
|
209
|
-
__classPrivateFieldGet(this,
|
|
210
|
-
__classPrivateFieldSet(this,
|
|
234
|
+
__classPrivateFieldGet(this, _KupDebug_debugWidget, "f").remove();
|
|
235
|
+
__classPrivateFieldSet(this, _KupDebug_debugWidget, null, "f");
|
|
211
236
|
}
|
|
212
237
|
/**
|
|
213
238
|
* Clears all the printed logs inside the debug widget.
|
|
214
239
|
*/
|
|
215
240
|
widgetClear() {
|
|
216
|
-
const children = Array.prototype.slice.call(__classPrivateFieldGet(this,
|
|
241
|
+
const children = Array.prototype.slice.call(__classPrivateFieldGet(this, _KupDebug_debugWidget, "f").children, 0);
|
|
217
242
|
for (let index = 0; index < children.length; index++) {
|
|
218
243
|
children[index].remove();
|
|
219
244
|
}
|
|
@@ -277,7 +302,7 @@ export class KupDebug {
|
|
|
277
302
|
}
|
|
278
303
|
slots.reverse();
|
|
279
304
|
for (let index = 0; index < slots.length; index++) {
|
|
280
|
-
__classPrivateFieldGet(this,
|
|
305
|
+
__classPrivateFieldGet(this, _KupDebug_debugWidget, "f").append(slots[index]);
|
|
281
306
|
}
|
|
282
307
|
}
|
|
283
308
|
/**
|
|
@@ -352,13 +377,13 @@ export class KupDebug {
|
|
|
352
377
|
}
|
|
353
378
|
if (this.active) {
|
|
354
379
|
document.dispatchEvent(new CustomEvent('kup-debug-active'));
|
|
355
|
-
if (!__classPrivateFieldGet(this,
|
|
380
|
+
if (!__classPrivateFieldGet(this, _KupDebug_debugWidget, "f")) {
|
|
356
381
|
this.showWidget();
|
|
357
382
|
}
|
|
358
383
|
}
|
|
359
384
|
else {
|
|
360
385
|
document.dispatchEvent(new CustomEvent('kup-debug-inactive'));
|
|
361
|
-
if (__classPrivateFieldGet(this,
|
|
386
|
+
if (__classPrivateFieldGet(this, _KupDebug_debugWidget, "f")) {
|
|
362
387
|
this.hideWidget();
|
|
363
388
|
}
|
|
364
389
|
}
|
|
@@ -378,7 +403,7 @@ export class KupDebug {
|
|
|
378
403
|
break;
|
|
379
404
|
case 'kup-debug-clear':
|
|
380
405
|
this.widgetClear();
|
|
381
|
-
__classPrivateFieldGet(this,
|
|
406
|
+
__classPrivateFieldGet(this, _KupDebug_debugWidget, "f").refresh();
|
|
382
407
|
break;
|
|
383
408
|
case 'kup-debug-dl-props':
|
|
384
409
|
this.getProps().then((res) => {
|
|
@@ -402,7 +427,7 @@ export class KupDebug {
|
|
|
402
427
|
case 'kup-debug-print':
|
|
403
428
|
this.widgetClear();
|
|
404
429
|
this.widgetPrint();
|
|
405
|
-
__classPrivateFieldGet(this,
|
|
430
|
+
__classPrivateFieldGet(this, _KupDebug_debugWidget, "f").refresh();
|
|
406
431
|
break;
|
|
407
432
|
}
|
|
408
433
|
break;
|
|
@@ -411,6 +436,9 @@ export class KupDebug {
|
|
|
411
436
|
case 'kup-debug-language-changer':
|
|
412
437
|
dom.ketchup.language.set(compEvent.detail.value);
|
|
413
438
|
break;
|
|
439
|
+
case 'kup-debug-locale-changer':
|
|
440
|
+
dom.ketchup.dates.setLocale(compEvent.detail.value);
|
|
441
|
+
break;
|
|
414
442
|
case 'kup-debug-theme-changer':
|
|
415
443
|
dom.ketchup.theme.set(compEvent.detail.value);
|
|
416
444
|
break;
|
|
@@ -560,10 +588,10 @@ export class KupDebug {
|
|
|
560
588
|
this.dump();
|
|
561
589
|
}
|
|
562
590
|
this.logs.push(log);
|
|
563
|
-
if (this.autoPrint && __classPrivateFieldGet(this,
|
|
591
|
+
if (this.autoPrint && __classPrivateFieldGet(this, _KupDebug_debugWidget, "f")) {
|
|
564
592
|
this.widgetClear();
|
|
565
593
|
this.widgetPrint();
|
|
566
|
-
__classPrivateFieldGet(this,
|
|
594
|
+
__classPrivateFieldGet(this, _KupDebug_debugWidget, "f").refresh();
|
|
567
595
|
}
|
|
568
596
|
}
|
|
569
597
|
switch (category) {
|
|
@@ -678,4 +706,4 @@ export class KupDebug {
|
|
|
678
706
|
}
|
|
679
707
|
}
|
|
680
708
|
}
|
|
681
|
-
|
|
709
|
+
_KupDebug_debugWidget = new WeakMap();
|
|
@@ -33,9 +33,7 @@ export class KupDynamicPosition {
|
|
|
33
33
|
*/
|
|
34
34
|
register(el, anchorEl, margin, placement, detach) {
|
|
35
35
|
if (this.isRegistered(el)) {
|
|
36
|
-
|
|
37
|
-
this.changeAnchor(el, anchorEl);
|
|
38
|
-
}
|
|
36
|
+
this.changeAnchor(el, anchorEl);
|
|
39
37
|
return;
|
|
40
38
|
}
|
|
41
39
|
el.setAttribute(kupDynamicPositionAttribute, '');
|
|
@@ -49,7 +47,7 @@ export class KupDynamicPosition {
|
|
|
49
47
|
else {
|
|
50
48
|
el.style.position = 'fixed';
|
|
51
49
|
}
|
|
52
|
-
el.style.zIndex =
|
|
50
|
+
el.style.zIndex = `calc(var(--kup-navbar-zindex) - 1)`;
|
|
53
51
|
el.kupDynamicPosition = {
|
|
54
52
|
anchor: anchorEl,
|
|
55
53
|
detach: detach ? true : false,
|
|
@@ -74,7 +72,7 @@ export class KupDynamicPosition {
|
|
|
74
72
|
/**
|
|
75
73
|
* Changes the anchor point of the given element.
|
|
76
74
|
* @param {KupDynamicPositionElement} elements - Dynamically positioned element previously registered.
|
|
77
|
-
* @param {
|
|
75
|
+
* @param {KupDynamicPositionAnchor} anchorEl - New anchor point.
|
|
78
76
|
*/
|
|
79
77
|
changeAnchor(el, anchorEl) {
|
|
80
78
|
el.kupDynamicPosition.anchor = anchorEl;
|
|
@@ -181,7 +179,7 @@ export class KupDynamicPosition {
|
|
|
181
179
|
el.style.top = `${bottom + el.kupDynamicPosition.margin}px`;
|
|
182
180
|
}
|
|
183
181
|
else {
|
|
184
|
-
if (window.innerHeight - bottom < offsetH) {
|
|
182
|
+
if (window.innerHeight - rect.bottom < offsetH) {
|
|
185
183
|
el.style.bottom = `${window.innerHeight - top + el.kupDynamicPosition.margin}px`;
|
|
186
184
|
}
|
|
187
185
|
else {
|
|
@@ -210,7 +208,7 @@ export class KupDynamicPosition {
|
|
|
210
208
|
el.style.right = `${window.innerWidth - scrollbarWidth - right}px`;
|
|
211
209
|
}
|
|
212
210
|
else {
|
|
213
|
-
if (window.innerWidth - left < offsetW) {
|
|
211
|
+
if (window.innerWidth - rect.left < offsetW) {
|
|
214
212
|
let scrollbarWidth = window.innerWidth - document.documentElement.offsetWidth;
|
|
215
213
|
if (scrollbarWidth > 30) {
|
|
216
214
|
scrollbarWidth = 0;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTML Attribute attached to dialogs.
|
|
3
|
+
* Referenced by kup-theme.css
|
|
4
|
+
*/
|
|
5
|
+
export const kupDialogAttribute = 'kup-dialog';
|
|
6
|
+
/**
|
|
7
|
+
* CSS class attached to resizable dialogs.
|
|
8
|
+
* Referenced by kup-theme.css
|
|
9
|
+
*/
|
|
10
|
+
export const kupDialogResizableClass = 'kup-resizable';
|
|
11
|
+
/**
|
|
12
|
+
* Drag & drop variables.
|
|
13
|
+
*/
|
|
14
|
+
export const kupDropEvent = 'kup-drop';
|
|
15
|
+
export const kupDragActiveAttr = 'kup-drag-active';
|
|
16
|
+
export const kupDragOverAttr = 'kup-drag-over';
|
|
17
|
+
export const kupDraggableAttr = 'kup-draggable';
|
|
18
|
+
export const kupDraggableCellAttr = 'kup-draggable-cell';
|
|
19
|
+
export const kupDraggableColumnAttr = 'kup-draggable-column';
|
|
20
|
+
export const kupDraggableRowAttr = 'kup-draggable-row';
|
|
21
|
+
/**
|
|
22
|
+
* Available effects fro dragging.
|
|
23
|
+
*/
|
|
24
|
+
export var KupDragEffect;
|
|
25
|
+
(function (KupDragEffect) {
|
|
26
|
+
KupDragEffect["BADGE"] = "badge";
|
|
27
|
+
KupDragEffect["CLONE"] = "clone";
|
|
28
|
+
KupDragEffect["MOVE"] = "move";
|
|
29
|
+
KupDragEffect["NONE"] = "none";
|
|
30
|
+
})(KupDragEffect || (KupDragEffect = {}));
|
|
31
|
+
/**
|
|
32
|
+
* Supported types of pointer events.
|
|
33
|
+
*/
|
|
34
|
+
export var KupPointerEventTypes;
|
|
35
|
+
(function (KupPointerEventTypes) {
|
|
36
|
+
KupPointerEventTypes["DOUBLETAP"] = "doubletap";
|
|
37
|
+
KupPointerEventTypes["HOLD"] = "hold";
|
|
38
|
+
KupPointerEventTypes["TAP"] = "tap";
|
|
39
|
+
})(KupPointerEventTypes || (KupPointerEventTypes = {}));
|
|
40
|
+
/**
|
|
41
|
+
* Supported types of drop event.
|
|
42
|
+
*/
|
|
43
|
+
export var KupDropEventTypes;
|
|
44
|
+
(function (KupDropEventTypes) {
|
|
45
|
+
KupDropEventTypes["BOX"] = "text/kup-box-drag";
|
|
46
|
+
KupDropEventTypes["DATATABLE"] = "text/kup-data-table-row-drag";
|
|
47
|
+
KupDropEventTypes["MAGICBOX"] = "text/kup-magic-box-drag";
|
|
48
|
+
})(KupDropEventTypes || (KupDropEventTypes = {}));
|
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import interact from 'interactjs';
|
|
2
|
+
import { kupDialogAttribute, kupDialogResizableClass, KupDragEffect, kupDraggableAttr, kupDraggableCellAttr, kupDraggableColumnAttr, kupDraggableRowAttr, kupDragOverAttr, kupDropEvent, } from './kup-interact-declarations';
|
|
3
|
+
const dom = document.documentElement;
|
|
4
|
+
/**
|
|
5
|
+
* This class handles elements as dialogs, making them resizable and movable.
|
|
6
|
+
* @module KupInteract
|
|
7
|
+
*/
|
|
8
|
+
export class KupInteract {
|
|
9
|
+
/**
|
|
10
|
+
* Initializes KupInteract.
|
|
11
|
+
* @param {number} zIndex - The starting z-index assigned to dialogs.
|
|
12
|
+
* @param {RectResolvable<[number, number, Interaction<keyof ActionMap>]>} restrictContainer - The container setting the restriction's boundary.
|
|
13
|
+
*/
|
|
14
|
+
constructor(zIndex, restrictContainer) {
|
|
15
|
+
interact.dynamicDrop(true);
|
|
16
|
+
this.container = document.createElement('div');
|
|
17
|
+
this.container.setAttribute('kup-interact', '');
|
|
18
|
+
document.body.appendChild(this.container);
|
|
19
|
+
this.managedElements = new Set();
|
|
20
|
+
this.zIndex = zIndex ? zIndex : 200;
|
|
21
|
+
this.restrictContainer = restrictContainer ? restrictContainer : null;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Sets up a new draggable element.
|
|
25
|
+
* @param {HTMLElement} el - The draggable element.
|
|
26
|
+
* @param {Partial<DraggableOptions>} options - Options of the draggable element.
|
|
27
|
+
* @param {KupDragEventData} eventData - Property used to transfer data for the drop event. The callback is used to return information of the starting item - such as cell, column and row info.
|
|
28
|
+
* @param {KupDragEffect} effect - Visual effect of the drag action.
|
|
29
|
+
* @param {KupDragCallbacks} callbacks - Additional callbacks to invoke.
|
|
30
|
+
* @see https://interactjs.io/docs/action-options/ For more options
|
|
31
|
+
*/
|
|
32
|
+
draggable(el, options, eventData, effect, callbacks) {
|
|
33
|
+
el.style.touchAction = 'none';
|
|
34
|
+
el.style.userSelect = 'none';
|
|
35
|
+
if (!options) {
|
|
36
|
+
options = {};
|
|
37
|
+
}
|
|
38
|
+
if (!effect) {
|
|
39
|
+
effect = KupDragEffect.MOVE;
|
|
40
|
+
}
|
|
41
|
+
options.listeners = {
|
|
42
|
+
move(e) {
|
|
43
|
+
if (callbacks && callbacks.move) {
|
|
44
|
+
callbacks.move(e);
|
|
45
|
+
}
|
|
46
|
+
if (effect.toLowerCase() !== KupDragEffect.NONE) {
|
|
47
|
+
const draggable = e.target;
|
|
48
|
+
const ghostImage = draggable.kupDragDrop &&
|
|
49
|
+
draggable.kupDragDrop.ghostImage
|
|
50
|
+
? draggable.kupDragDrop.ghostImage
|
|
51
|
+
: e.target;
|
|
52
|
+
const oldTransform = ghostImage.style.transform;
|
|
53
|
+
let x = parseFloat(ghostImage.getAttribute('data-x')) || 0;
|
|
54
|
+
let y = parseFloat(ghostImage.getAttribute('data-y')) || 0;
|
|
55
|
+
x = x + e.dx;
|
|
56
|
+
y = y + e.dy;
|
|
57
|
+
ghostImage.style.transform = `translate(${x}px, ${y}px)`;
|
|
58
|
+
if (dom.ketchup.interact.isInViewport(el, oldTransform, e.delta)) {
|
|
59
|
+
ghostImage.setAttribute('data-x', x.toString());
|
|
60
|
+
ghostImage.setAttribute('data-y', y.toString());
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
start(e) {
|
|
65
|
+
if (callbacks && callbacks.start) {
|
|
66
|
+
callbacks.start(e);
|
|
67
|
+
}
|
|
68
|
+
const draggable = e.target;
|
|
69
|
+
const draggableDetails = eventData && eventData.callback
|
|
70
|
+
? eventData.callback(e)
|
|
71
|
+
: {};
|
|
72
|
+
draggable.kupDragDrop = draggableDetails;
|
|
73
|
+
draggable.setAttribute(kupDraggableAttr, '');
|
|
74
|
+
if (draggableDetails.cell) {
|
|
75
|
+
draggable.setAttribute(kupDraggableCellAttr, '');
|
|
76
|
+
}
|
|
77
|
+
if (draggableDetails.column) {
|
|
78
|
+
draggable.setAttribute(kupDraggableColumnAttr, '');
|
|
79
|
+
}
|
|
80
|
+
if (draggableDetails.row) {
|
|
81
|
+
draggable.setAttribute(kupDraggableRowAttr, '');
|
|
82
|
+
}
|
|
83
|
+
let ghostImage = null;
|
|
84
|
+
switch (effect) {
|
|
85
|
+
case KupDragEffect.BADGE:
|
|
86
|
+
ghostImage = document.createElement('kup-badge');
|
|
87
|
+
if (draggable.kupDragDrop.multiple) {
|
|
88
|
+
ghostImage.text = draggable.kupDragDrop.selectedRows
|
|
89
|
+
? draggable.kupDragDrop.selectedRows.length.toString()
|
|
90
|
+
: '0';
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
ghostImage.text = '1';
|
|
94
|
+
}
|
|
95
|
+
ghostImage.style.left =
|
|
96
|
+
e.clientX - ghostImage.clientWidth / 2 + 'px';
|
|
97
|
+
ghostImage.style.pointerEvents = 'none';
|
|
98
|
+
ghostImage.style.position = 'fixed';
|
|
99
|
+
ghostImage.style.top =
|
|
100
|
+
e.clientY - ghostImage.clientHeight / 2 + 'px';
|
|
101
|
+
ghostImage.style.transition = 'none';
|
|
102
|
+
ghostImage.style.zIndex =
|
|
103
|
+
'calc(var(--kup-navbar-zindex) + 1)';
|
|
104
|
+
dom.ketchup.interact.container.appendChild(ghostImage);
|
|
105
|
+
draggable.kupDragDrop.ghostImage = ghostImage;
|
|
106
|
+
break;
|
|
107
|
+
case KupDragEffect.CLONE:
|
|
108
|
+
ghostImage = draggable.cloneNode(true);
|
|
109
|
+
setComputedStyle(draggable, ghostImage);
|
|
110
|
+
ghostImage.style.cursor = 'grabbing';
|
|
111
|
+
ghostImage.style.height = draggable.clientHeight + 'px';
|
|
112
|
+
ghostImage.style.left =
|
|
113
|
+
e.clientX - draggable.clientWidth / 2 + 'px';
|
|
114
|
+
ghostImage.style.opacity = '0.75';
|
|
115
|
+
ghostImage.style.position = 'fixed';
|
|
116
|
+
ghostImage.style.top =
|
|
117
|
+
e.clientY - draggable.clientHeight / 2 + 'px';
|
|
118
|
+
ghostImage.style.width = draggable.clientWidth + 'px';
|
|
119
|
+
ghostImage.style.zIndex =
|
|
120
|
+
'calc(var(--kup-navbar-zindex) + 1)';
|
|
121
|
+
dom.ketchup.interact.container.appendChild(ghostImage);
|
|
122
|
+
draggable.kupDragDrop.ghostImage = ghostImage;
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
end(e) {
|
|
127
|
+
if (callbacks && callbacks.end) {
|
|
128
|
+
callbacks.end(e);
|
|
129
|
+
}
|
|
130
|
+
const draggable = e.target;
|
|
131
|
+
const ghostImage = draggable.kupDragDrop
|
|
132
|
+
? draggable.kupDragDrop.ghostImage
|
|
133
|
+
: null;
|
|
134
|
+
if (ghostImage) {
|
|
135
|
+
ghostImage.setAttribute('style', '');
|
|
136
|
+
ghostImage.remove();
|
|
137
|
+
}
|
|
138
|
+
draggable.removeAttribute(kupDraggableAttr);
|
|
139
|
+
draggable.removeAttribute(kupDraggableCellAttr);
|
|
140
|
+
draggable.removeAttribute(kupDraggableColumnAttr);
|
|
141
|
+
draggable.removeAttribute(kupDraggableRowAttr);
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
interact(el).draggable(options);
|
|
145
|
+
this.managedElements.add(el);
|
|
146
|
+
function setComputedStyle(draggable, ghostImage) {
|
|
147
|
+
recursive(draggable, ghostImage);
|
|
148
|
+
function recursive(source, target) {
|
|
149
|
+
const styles = getComputedStyle(source);
|
|
150
|
+
for (const key in styles) {
|
|
151
|
+
if (Object.prototype.hasOwnProperty.call(styles, key)) {
|
|
152
|
+
const s = styles[key];
|
|
153
|
+
try {
|
|
154
|
+
target.style[s] = styles[s];
|
|
155
|
+
}
|
|
156
|
+
catch (error) { }
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
for (let index = 0; index < source.children.length; index++) {
|
|
160
|
+
const sourceChild = source.children[index];
|
|
161
|
+
const targetChild = target.children[index];
|
|
162
|
+
recursive(sourceChild, targetChild);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Sets up a new dropzone.
|
|
169
|
+
* @param {HTMLElement} el - The dropzone element.
|
|
170
|
+
* @param {DropzoneOptions} options - Options of the dropzone.
|
|
171
|
+
* @param {KupDropEventData} eventData - Argument used to transfer data for the drop event. The callback is used to return information of the receiving item - such as cell, column and row info.
|
|
172
|
+
* @param {KupDropCallbacks} callbacks - Additional callbacks to invoke.
|
|
173
|
+
* @see https://interactjs.io/docs/action-options/ For more options
|
|
174
|
+
*/
|
|
175
|
+
dropzone(el, options, eventData, callbacks) {
|
|
176
|
+
if (!options) {
|
|
177
|
+
options = {};
|
|
178
|
+
}
|
|
179
|
+
options.listeners = {
|
|
180
|
+
drop(e) {
|
|
181
|
+
if (callbacks && callbacks.drop) {
|
|
182
|
+
callbacks.drop(e);
|
|
183
|
+
}
|
|
184
|
+
if (eventData) {
|
|
185
|
+
const draggableDetails = e.relatedTarget.kupDragDrop ||
|
|
186
|
+
{};
|
|
187
|
+
const dropzoneDetails = eventData.callback
|
|
188
|
+
? eventData.callback()
|
|
189
|
+
: {};
|
|
190
|
+
const ketchupDropEvent = new CustomEvent(kupDropEvent, {
|
|
191
|
+
bubbles: true,
|
|
192
|
+
cancelable: true,
|
|
193
|
+
detail: {
|
|
194
|
+
dataType: eventData.type,
|
|
195
|
+
sourceElement: {
|
|
196
|
+
id: draggableDetails.id
|
|
197
|
+
? draggableDetails.id
|
|
198
|
+
: '',
|
|
199
|
+
row: draggableDetails.row
|
|
200
|
+
? draggableDetails.row
|
|
201
|
+
: null,
|
|
202
|
+
selectedRows: draggableDetails.selectedRows
|
|
203
|
+
? draggableDetails.selectedRows
|
|
204
|
+
: null,
|
|
205
|
+
cell: draggableDetails.cell
|
|
206
|
+
? draggableDetails.cell
|
|
207
|
+
: null,
|
|
208
|
+
column: draggableDetails.column
|
|
209
|
+
? draggableDetails.column
|
|
210
|
+
: null,
|
|
211
|
+
},
|
|
212
|
+
targetElement: {
|
|
213
|
+
id: dropzoneDetails.id
|
|
214
|
+
? dropzoneDetails.id
|
|
215
|
+
: '',
|
|
216
|
+
row: dropzoneDetails.row
|
|
217
|
+
? dropzoneDetails.row
|
|
218
|
+
: null,
|
|
219
|
+
cell: dropzoneDetails.cell
|
|
220
|
+
? dropzoneDetails.cell
|
|
221
|
+
: null,
|
|
222
|
+
column: dropzoneDetails.column
|
|
223
|
+
? dropzoneDetails.column
|
|
224
|
+
: null,
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
});
|
|
228
|
+
e.currentTarget.removeAttribute(kupDragOverAttr);
|
|
229
|
+
eventData.dispatcher.dispatchEvent(ketchupDropEvent);
|
|
230
|
+
}
|
|
231
|
+
e.currentTarget.removeAttribute(kupDragOverAttr);
|
|
232
|
+
},
|
|
233
|
+
enter(e) {
|
|
234
|
+
if (callbacks && callbacks.enter) {
|
|
235
|
+
callbacks.enter(e);
|
|
236
|
+
}
|
|
237
|
+
e.currentTarget.setAttribute(kupDragOverAttr, '');
|
|
238
|
+
},
|
|
239
|
+
leave(e) {
|
|
240
|
+
if (callbacks && callbacks.leave) {
|
|
241
|
+
callbacks.leave(e);
|
|
242
|
+
}
|
|
243
|
+
e.currentTarget.removeAttribute(kupDragOverAttr);
|
|
244
|
+
},
|
|
245
|
+
};
|
|
246
|
+
interact(el).dropzone(options);
|
|
247
|
+
this.managedElements.add(el);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Sets up a new resizable element.
|
|
251
|
+
* @param {HTMLElement} el - The resizable element.
|
|
252
|
+
* @param {Partial<ResizableOptions>} options - Options of the resize action.
|
|
253
|
+
* @param {KupResizeCallbacks} callbacks - Additional callbacks to invoke.
|
|
254
|
+
* @param {boolean} moveOnResize - When true, the element will be moved when resizing in order to keep its position.
|
|
255
|
+
* @see https://interactjs.io/docs/action-options/ For more options
|
|
256
|
+
*/
|
|
257
|
+
resizable(el, options, callbacks, moveOnResize) {
|
|
258
|
+
if (!options) {
|
|
259
|
+
options = {};
|
|
260
|
+
}
|
|
261
|
+
options.listeners = {
|
|
262
|
+
move(e) {
|
|
263
|
+
if (callbacks && callbacks.move) {
|
|
264
|
+
callbacks.move(e);
|
|
265
|
+
}
|
|
266
|
+
if (moveOnResize) {
|
|
267
|
+
const el = e.target;
|
|
268
|
+
const oldTransform = e.target.style.transform;
|
|
269
|
+
let x = parseFloat(el.getAttribute('data-x')) || 0;
|
|
270
|
+
let y = parseFloat(el.getAttribute('data-y')) || 0;
|
|
271
|
+
el.style.width = e.rect.width + 'px';
|
|
272
|
+
el.style.height = e.rect.height + 'px';
|
|
273
|
+
x += e.deltaRect.left;
|
|
274
|
+
y += e.deltaRect.top;
|
|
275
|
+
el.style.transform = 'translate(' + x + 'px,' + y + 'px)';
|
|
276
|
+
if (dom.ketchup.interact.isInViewport(el, oldTransform, e.delta)) {
|
|
277
|
+
el.setAttribute('data-x', x.toString());
|
|
278
|
+
el.setAttribute('data-y', y.toString());
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
};
|
|
283
|
+
interact(el).resizable(options);
|
|
284
|
+
this.managedElements.add(el);
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Adds a new interact.js event listener to the given argument.
|
|
288
|
+
* @param {HTMLElement} el - The element on which the event listener will be added.
|
|
289
|
+
* @param {KupPointerEventTypes} event - Supported events.
|
|
290
|
+
* @param {KupResizeCallbacks} callback - Callback to invoke when the event fires.
|
|
291
|
+
*/
|
|
292
|
+
on(el, event, callback) {
|
|
293
|
+
interact(el).on(event, callback);
|
|
294
|
+
this.managedElements.add(el);
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* This method checks whether the element is breaking the viewport boundaries.
|
|
298
|
+
* @param {HTMLElement} el - Element to check.
|
|
299
|
+
* @param {string} oldTransform - Previously set transform, used to rollback in case element breaks viewport boundaries.
|
|
300
|
+
* @param {Point} delta - X and Y delta values of the last movement.
|
|
301
|
+
*/
|
|
302
|
+
isInViewport(el, oldTransform, delta) {
|
|
303
|
+
const style = window.getComputedStyle(el);
|
|
304
|
+
const isFixed = !!(style.position === 'fixed');
|
|
305
|
+
const rect = el.getBoundingClientRect();
|
|
306
|
+
if (rect.left < 0 ||
|
|
307
|
+
rect.top < 0 ||
|
|
308
|
+
(isFixed && rect.right > window.innerWidth && delta.x >= 0) ||
|
|
309
|
+
(isFixed && rect.bottom > window.innerHeight && delta.y >= 0)) {
|
|
310
|
+
el.style.transform = oldTransform;
|
|
311
|
+
return false;
|
|
312
|
+
}
|
|
313
|
+
return true;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* This method treats the given element as a dialog, by activating moving-on-drag and, optionally, its resize.
|
|
317
|
+
* @param {HTMLElement} el - Dialog element.
|
|
318
|
+
* @param {HTMLElement} handleEl - Element that must be dragged in order to trigger movement. When not provided, dragging anywhere on "el" will move it.
|
|
319
|
+
* @param {boolean} unresizable - When true, the dialog can't be resized.
|
|
320
|
+
* @param {RectResolvable<[number, number, Interaction<keyof ActionMap>]>} restrictContainer - When present, it will set the constraint of "el": it can't be moved outside this container.
|
|
321
|
+
*/
|
|
322
|
+
dialogify(el, handleEl, unresizable, restrictContainer) {
|
|
323
|
+
el.setAttribute(kupDialogAttribute, '');
|
|
324
|
+
el.style.zIndex = (this.zIndex++).toString();
|
|
325
|
+
const callbacks = {
|
|
326
|
+
start(e) {
|
|
327
|
+
const el = e.currentTarget;
|
|
328
|
+
el.style.zIndex = (dom.ketchup.interact.zIndex++).toString();
|
|
329
|
+
},
|
|
330
|
+
};
|
|
331
|
+
this.draggable(el, {
|
|
332
|
+
allowFrom: handleEl ? handleEl : null,
|
|
333
|
+
modifiers: [
|
|
334
|
+
interact.modifiers.restrictRect({
|
|
335
|
+
restriction: restrictContainer
|
|
336
|
+
? restrictContainer
|
|
337
|
+
: dom.ketchup.interact.restrictContainer,
|
|
338
|
+
endOnly: true,
|
|
339
|
+
}),
|
|
340
|
+
],
|
|
341
|
+
}, null, KupDragEffect.MOVE, callbacks);
|
|
342
|
+
if (!unresizable) {
|
|
343
|
+
el.classList.add(kupDialogResizableClass);
|
|
344
|
+
this.resizable(el, {
|
|
345
|
+
edges: {
|
|
346
|
+
left: true,
|
|
347
|
+
right: true,
|
|
348
|
+
bottom: true,
|
|
349
|
+
top: false,
|
|
350
|
+
},
|
|
351
|
+
modifiers: [
|
|
352
|
+
interact.modifiers.restrictSize({
|
|
353
|
+
min: { width: 100, height: 100 },
|
|
354
|
+
}),
|
|
355
|
+
],
|
|
356
|
+
}, null, true);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Removes the elements from the MoveOnDrag class watchlist.
|
|
361
|
+
* @param {HTMLElement[]} elements - Elements to remove.
|
|
362
|
+
*/
|
|
363
|
+
unregister(elements) {
|
|
364
|
+
if (this.managedElements) {
|
|
365
|
+
for (let index = 0; index < elements.length; index++) {
|
|
366
|
+
this.managedElements.delete(elements[index]);
|
|
367
|
+
interact(elements[index]).unset();
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Returns whether an element was previously registered or not.
|
|
373
|
+
* @param {HTMLElement} el - Element to test.
|
|
374
|
+
* @returns {boolean} True if the element was registered.
|
|
375
|
+
*/
|
|
376
|
+
isRegistered(el) {
|
|
377
|
+
return !this.managedElements ? false : this.managedElements.has(el);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
@@ -43,6 +43,7 @@ export var KupLanguageDebug;
|
|
|
43
43
|
KupLanguageDebug["DL_PROPS"] = "debugDLProps";
|
|
44
44
|
KupLanguageDebug["DL_PROPS_COMP"] = "debugDLPropsComp";
|
|
45
45
|
KupLanguageDebug["LANGUAGE_CHANGER"] = "debugLanguageChanger";
|
|
46
|
+
KupLanguageDebug["LOCALE_CHANGER"] = "debugLocaleChanger";
|
|
46
47
|
KupLanguageDebug["LOG_LIMIT"] = "debugLogLimit";
|
|
47
48
|
KupLanguageDebug["MAGIC_BOX"] = "debugMagicBox";
|
|
48
49
|
KupLanguageDebug["OFF"] = "debugOff";
|
|
@@ -83,6 +84,7 @@ export var KupLanguageGeneric;
|
|
|
83
84
|
KupLanguageGeneric["EDITABLE"] = "genericEditable";
|
|
84
85
|
KupLanguageGeneric["EDITABLE_FIELD"] = "genericEditableField";
|
|
85
86
|
KupLanguageGeneric["EMPTY_DATA"] = "genericEmptyData";
|
|
87
|
+
KupLanguageGeneric["EMPTY_OBJECT"] = "genericEmptyObject";
|
|
86
88
|
KupLanguageGeneric["EXPAND"] = "genericExpand";
|
|
87
89
|
KupLanguageGeneric["EXPERIMENTAL_FEAT"] = "genericExperimentalFeat";
|
|
88
90
|
KupLanguageGeneric["FILTERS"] = "genericFilters";
|