@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,12 +1,12 @@
|
|
|
1
1
|
import { Component, Element, Event, forceUpdate, h, Host, Listen, Method, Prop, State, Watch, } from '@stencil/core';
|
|
2
|
-
import { kupDynamicPositionAttribute, } from '../../utils/kup-dynamic-position/kup-dynamic-position-declarations';
|
|
3
2
|
import { kupManagerInstance, } from '../../utils/kup-manager/kup-manager';
|
|
4
|
-
import {
|
|
5
|
-
import { KupDatePickerProps, SourceEvent, } from './kup-date-picker-declarations';
|
|
6
|
-
import { FButtonStyling } from '../../f-components/f-button/f-button-declarations';
|
|
3
|
+
import { KupDatePickerProps, } from './kup-date-picker-declarations';
|
|
7
4
|
import { KupDebugCategory } from '../../utils/kup-debug/kup-debug-declarations';
|
|
8
5
|
import { componentWrapperId } from '../../variables/GenericVariables';
|
|
9
6
|
import { KupDatesFormats, KupDatesNormalize, } from '../../utils/kup-dates/kup-dates-declarations';
|
|
7
|
+
import { FTextField } from '../../f-components/f-text-field/f-text-field';
|
|
8
|
+
import { FTextFieldMDC } from '../../f-components/f-text-field/f-text-field-mdc';
|
|
9
|
+
import { KupDynamicPositionPlacement } from '../../utils/kup-dynamic-position/kup-dynamic-position-declarations';
|
|
10
10
|
export class KupDatePicker {
|
|
11
11
|
constructor() {
|
|
12
12
|
/*-------------------------------------------------*/
|
|
@@ -51,17 +51,15 @@ export class KupDatePicker {
|
|
|
51
51
|
* Instance of the KupManager class.
|
|
52
52
|
*/
|
|
53
53
|
this.kupManager = kupManagerInstance();
|
|
54
|
-
this.
|
|
55
|
-
this.
|
|
56
|
-
this.pickerContainerEl = undefined;
|
|
54
|
+
this.textfieldEl = null;
|
|
55
|
+
this.pickerContainerEl = null;
|
|
57
56
|
this.pickerEl = {
|
|
58
57
|
value: new Date().toISOString(),
|
|
59
58
|
date: new Date(),
|
|
60
59
|
};
|
|
61
|
-
this.
|
|
60
|
+
this.clickCb = null;
|
|
62
61
|
}
|
|
63
|
-
onKupDatePickerItemClick(
|
|
64
|
-
e.stopPropagation();
|
|
62
|
+
onKupDatePickerItemClick(value) {
|
|
65
63
|
this.setPickerValueSelected(value);
|
|
66
64
|
this.kupChange.emit({
|
|
67
65
|
comp: this,
|
|
@@ -73,9 +71,9 @@ export class KupDatePicker {
|
|
|
73
71
|
id: this.rootElement.id,
|
|
74
72
|
value: this.value,
|
|
75
73
|
});
|
|
74
|
+
this.setFocus();
|
|
76
75
|
}
|
|
77
|
-
onKupClearIconClick(
|
|
78
|
-
e.stopPropagation();
|
|
76
|
+
onKupClearIconClick() {
|
|
79
77
|
this.setPickerValueSelected('');
|
|
80
78
|
this.kupChange.emit({
|
|
81
79
|
comp: this,
|
|
@@ -87,22 +85,7 @@ export class KupDatePicker {
|
|
|
87
85
|
id: this.rootElement.id,
|
|
88
86
|
});
|
|
89
87
|
}
|
|
90
|
-
onKupDatePickerMonthYearItemClick(e, value) {
|
|
91
|
-
e.stopPropagation();
|
|
92
|
-
switch (this.calendarView) {
|
|
93
|
-
case SourceEvent.MONTH: {
|
|
94
|
-
this.calendarView = SourceEvent.DATE;
|
|
95
|
-
break;
|
|
96
|
-
}
|
|
97
|
-
case SourceEvent.YEAR: {
|
|
98
|
-
this.calendarView = SourceEvent.MONTH;
|
|
99
|
-
break;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
this.refreshPickerComponentValue(value);
|
|
103
|
-
}
|
|
104
88
|
onKupBlur() {
|
|
105
|
-
this.closePicker();
|
|
106
89
|
this.kupBlur.emit({
|
|
107
90
|
id: this.rootElement.id,
|
|
108
91
|
value: this.value,
|
|
@@ -110,19 +93,16 @@ export class KupDatePicker {
|
|
|
110
93
|
});
|
|
111
94
|
}
|
|
112
95
|
onKupChange(e) {
|
|
113
|
-
e.
|
|
114
|
-
this.refreshPickerValue(e.detail.value, this.kupChange);
|
|
96
|
+
this.refreshPickerValue(e.target.value, this.kupChange);
|
|
115
97
|
}
|
|
116
|
-
onKupClick(
|
|
117
|
-
e.stopPropagation();
|
|
98
|
+
onKupClick() {
|
|
118
99
|
this.kupClick.emit({
|
|
119
100
|
comp: this,
|
|
120
101
|
id: this.rootElement.id,
|
|
121
102
|
value: this.value,
|
|
122
103
|
});
|
|
123
104
|
}
|
|
124
|
-
onKupFocus(
|
|
125
|
-
e.stopPropagation();
|
|
105
|
+
onKupFocus() {
|
|
126
106
|
this.kupFocus.emit({
|
|
127
107
|
comp: this,
|
|
128
108
|
id: this.rootElement.id,
|
|
@@ -130,15 +110,14 @@ export class KupDatePicker {
|
|
|
130
110
|
});
|
|
131
111
|
}
|
|
132
112
|
onKupInput(e) {
|
|
133
|
-
e.
|
|
134
|
-
this.refreshPickerValue(e.detail.value, this.kupInput, true);
|
|
113
|
+
this.refreshPickerValue(e.target.value, this.kupInput, true);
|
|
135
114
|
}
|
|
136
115
|
onkupTextFieldSubmit(e) {
|
|
137
|
-
e.
|
|
138
|
-
|
|
116
|
+
if (e.key === 'Enter') {
|
|
117
|
+
this.refreshPickerValue(e.target.value, this.kupTextFieldSubmit);
|
|
118
|
+
}
|
|
139
119
|
}
|
|
140
|
-
onKupIconClick(
|
|
141
|
-
e.stopPropagation();
|
|
120
|
+
onKupIconClick() {
|
|
142
121
|
if (this.isPickerOpened()) {
|
|
143
122
|
this.closePicker();
|
|
144
123
|
}
|
|
@@ -160,7 +139,6 @@ export class KupDatePicker {
|
|
|
160
139
|
this.closePicker();
|
|
161
140
|
}
|
|
162
141
|
if (e.key === 'Enter') {
|
|
163
|
-
e.stopPropagation();
|
|
164
142
|
this.setPickerValueSelected();
|
|
165
143
|
}
|
|
166
144
|
}
|
|
@@ -216,7 +194,7 @@ export class KupDatePicker {
|
|
|
216
194
|
*/
|
|
217
195
|
async setFocus() {
|
|
218
196
|
if (this.textfieldEl != null) {
|
|
219
|
-
this.textfieldEl.
|
|
197
|
+
this.textfieldEl.focus();
|
|
220
198
|
}
|
|
221
199
|
}
|
|
222
200
|
/**
|
|
@@ -225,14 +203,12 @@ export class KupDatePicker {
|
|
|
225
203
|
*/
|
|
226
204
|
async setValue(value) {
|
|
227
205
|
this.value = value;
|
|
228
|
-
this.setTextFieldInitalValue(this.getDateForOutput());
|
|
229
206
|
}
|
|
230
207
|
/*-------------------------------------------------*/
|
|
231
208
|
/* P r i v a t e M e t h o d s */
|
|
232
209
|
/*-------------------------------------------------*/
|
|
233
210
|
refreshPickerValue(eventDetailValue, eventToRaise, isOnInputEvent) {
|
|
234
211
|
let newValue = eventDetailValue;
|
|
235
|
-
let dayJs = this.kupManager.dates.normalize(eventDetailValue, KupDatesNormalize.DATE);
|
|
236
212
|
if (this.kupManager.dates.isValid(eventDetailValue)) {
|
|
237
213
|
newValue = this.kupManager.dates.format(this.kupManager.dates.normalize(eventDetailValue, KupDatesNormalize.DATE), KupDatesFormats.ISO_DATE);
|
|
238
214
|
this.refreshPickerComponentValue(newValue);
|
|
@@ -280,72 +256,65 @@ export class KupDatePicker {
|
|
|
280
256
|
getPickerValueSelected() {
|
|
281
257
|
return this.pickerEl.value;
|
|
282
258
|
}
|
|
283
|
-
setTextFieldInitalValue(value) {
|
|
284
|
-
if (this.textfieldEl !== undefined) {
|
|
285
|
-
this.textfieldEl.setValue(value);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
259
|
getValueForPickerComponent() {
|
|
289
260
|
return this.value;
|
|
290
261
|
}
|
|
291
262
|
openPicker() {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
263
|
+
const textfieldEl = this.textfieldEl;
|
|
264
|
+
this.pickerContainerEl.menuVisible = true;
|
|
265
|
+
const elStyle = this.pickerContainerEl.style;
|
|
266
|
+
elStyle.height = 'auto';
|
|
267
|
+
elStyle.minWidth = this.textfieldEl.parentElement.clientWidth + 'px';
|
|
296
268
|
this.refreshPickerComponentValue(this.getValueForPickerComponent());
|
|
297
|
-
let textFieldWidth = null;
|
|
298
269
|
if (textfieldEl != null) {
|
|
299
|
-
textFieldWidth =
|
|
300
|
-
textfieldEl.shadowRoot.querySelector('.mdc-text-field').clientWidth;
|
|
301
270
|
textfieldEl.classList.add('toggled');
|
|
302
|
-
textfieldEl.emitSubmitEventOnEnter = false;
|
|
303
271
|
}
|
|
304
|
-
if (
|
|
305
|
-
this.kupManager.dynamicPosition.
|
|
306
|
-
containerEl.classList.add('visible');
|
|
307
|
-
let elStyle = containerEl.style;
|
|
308
|
-
elStyle.height = 'auto';
|
|
309
|
-
if (textFieldWidth != null) {
|
|
310
|
-
elStyle.minWidth = textFieldWidth + 'px';
|
|
311
|
-
}
|
|
272
|
+
if (this.kupManager.dynamicPosition.isRegistered(this.pickerContainerEl)) {
|
|
273
|
+
this.kupManager.dynamicPosition.changeAnchor(this.pickerContainerEl, this.textfieldEl.parentElement);
|
|
312
274
|
}
|
|
275
|
+
else {
|
|
276
|
+
this.kupManager.dynamicPosition.register(this.pickerContainerEl, this.textfieldEl.parentElement, 0, KupDynamicPositionPlacement.AUTO, true);
|
|
277
|
+
}
|
|
278
|
+
this.kupManager.dynamicPosition.start(this.pickerContainerEl);
|
|
279
|
+
if (!this.clickCb) {
|
|
280
|
+
this.clickCb = {
|
|
281
|
+
cb: () => {
|
|
282
|
+
this.closePicker();
|
|
283
|
+
},
|
|
284
|
+
el: this.pickerContainerEl,
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
this.kupManager.addClickCallback(this.clickCb, true);
|
|
313
288
|
}
|
|
314
289
|
closePicker() {
|
|
290
|
+
this.kupManager.removeClickCallback(this.clickCb);
|
|
315
291
|
if (!this.isPickerOpened()) {
|
|
316
292
|
return;
|
|
317
293
|
}
|
|
318
294
|
let textfieldEl = this.textfieldEl;
|
|
319
|
-
let containerEl = this.pickerContainerEl;
|
|
320
|
-
this.pickerOpened = false;
|
|
321
295
|
if (textfieldEl != null) {
|
|
322
296
|
textfieldEl.classList.remove('toggled');
|
|
323
|
-
textfieldEl.emitSubmitEventOnEnter = true;
|
|
324
|
-
}
|
|
325
|
-
if (containerEl != null) {
|
|
326
|
-
this.kupManager.dynamicPosition.stop(containerEl);
|
|
327
|
-
containerEl.classList.remove('visible');
|
|
328
297
|
}
|
|
298
|
+
this.pickerContainerEl.menuVisible = false;
|
|
299
|
+
this.kupManager.dynamicPosition.stop(this.pickerContainerEl);
|
|
329
300
|
}
|
|
330
301
|
isPickerOpened() {
|
|
331
|
-
return this.
|
|
302
|
+
return this.pickerContainerEl.menuVisible == true;
|
|
332
303
|
}
|
|
333
304
|
getTextFieldId() {
|
|
334
305
|
return this.textfieldEl.id;
|
|
335
306
|
}
|
|
336
|
-
prepDateTextfield() {
|
|
337
|
-
return this.prepTextfield(this.getDateForOutput());
|
|
338
|
-
}
|
|
339
307
|
prepTextfield(initialValue) {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
308
|
+
const fullHeight = this.rootElement.classList.contains('kup-full-height');
|
|
309
|
+
const fullWidth = this.rootElement.classList.contains('kup-full-width');
|
|
310
|
+
const textfieldData = Object.assign({}, this.data['kup-text-field']);
|
|
311
|
+
if (!textfieldData.icon) {
|
|
312
|
+
textfieldData.icon = 'calendar';
|
|
343
313
|
}
|
|
344
|
-
if (textfieldData
|
|
345
|
-
textfieldData
|
|
314
|
+
if (textfieldData.icon) {
|
|
315
|
+
textfieldData.trailingIcon = true;
|
|
346
316
|
}
|
|
347
|
-
|
|
348
|
-
return comp;
|
|
317
|
+
return (h(FTextField, Object.assign({}, textfieldData, { disabled: this.disabled, fullHeight: fullHeight, fullWidth: fullWidth, id: this.rootElement.id + '_text-field', value: initialValue, onBlur: () => this.onKupBlur(), onChange: (e) => this.onKupChange(e), onClearIconClick: () => this.onKupClearIconClick(), onClick: () => this.onKupClick(), onFocus: () => this.onKupFocus(), onIconClick: () => this.onKupIconClick(), onKeyDown: (e) => this.onkupTextFieldSubmit(e), onInput: (e) => this.onKupInput(e) }), this.prepDatePicker()));
|
|
349
318
|
}
|
|
350
319
|
getInitEndYear(curYear) {
|
|
351
320
|
let initYear = curYear - (curYear % 10);
|
|
@@ -367,275 +336,17 @@ export class KupDatePicker {
|
|
|
367
336
|
return idConc.indexOf('#' + id + '#') >= 0;
|
|
368
337
|
}
|
|
369
338
|
prepDatePicker() {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
break;
|
|
382
|
-
}
|
|
383
|
-
case SourceEvent.MONTH: {
|
|
384
|
-
changeViewButtonLabel = curYear.toString();
|
|
385
|
-
break;
|
|
386
|
-
}
|
|
387
|
-
case SourceEvent.YEAR: {
|
|
388
|
-
changeViewButtonLabel =
|
|
389
|
-
initYear.toString() + ' - ' + endYear.toString();
|
|
390
|
-
break;
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
let prevButtonComp = null;
|
|
394
|
-
let nextButtonComp = null;
|
|
395
|
-
prevButtonComp = (h("kup-button", { id: "prev-page", icon: "chevron_left", "onkup-button-click": (e) => this.prevPage(e) }));
|
|
396
|
-
nextButtonComp = (h("kup-button", { id: "next-page", icon: "chevron_right", "onkup-button-click": (e) => this.nextPage(e) }));
|
|
397
|
-
return (h("div", { tabindex: "0", id: "date-picker-div", ref: (el) => (this.pickerContainerEl = el), onBlur: (e) => {
|
|
398
|
-
if (!this.isRelatedTargetInThisComponent(e)) {
|
|
399
|
-
this.onKupBlur();
|
|
400
|
-
}
|
|
401
|
-
} },
|
|
402
|
-
h("div", { class: "section-1" },
|
|
403
|
-
h("div", { class: "sub-1 nav" },
|
|
404
|
-
prevButtonComp,
|
|
405
|
-
h("kup-button", { customStyle: "#kup-component button {text-transform:capitalize}", id: "change-view-button", styling: FButtonStyling.FLAT, label: changeViewButtonLabel, "onkup-button-click": (e) => this.changeView(e) }),
|
|
406
|
-
nextButtonComp)),
|
|
407
|
-
h("div", { class: "section-2" }, this.createCalendar())));
|
|
408
|
-
}
|
|
409
|
-
createCalendar() {
|
|
410
|
-
switch (this.calendarView) {
|
|
411
|
-
case SourceEvent.DATE: {
|
|
412
|
-
return this.createDaysCalendar();
|
|
413
|
-
}
|
|
414
|
-
case SourceEvent.MONTH: {
|
|
415
|
-
return this.createMonthsCalendar();
|
|
416
|
-
}
|
|
417
|
-
case SourceEvent.YEAR: {
|
|
418
|
-
return this.createYearsCalendar();
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
createDaysCalendar() {
|
|
423
|
-
let days = getDaysOfWeekAsStringByLocale(this.firstDayIndex);
|
|
424
|
-
let date = this.pickerEl.date;
|
|
425
|
-
let selecteDate = new Date(date);
|
|
426
|
-
let thead = [];
|
|
427
|
-
let tbody = [];
|
|
428
|
-
for (let index = 0; index < days.length; index++) {
|
|
429
|
-
thead.push(h("th", null,
|
|
430
|
-
h("span", { class: "item-text" }, days[index])));
|
|
431
|
-
}
|
|
432
|
-
let firstMonthDay = new Date(date.getFullYear(), date.getMonth(), 1);
|
|
433
|
-
let lastMonthDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
434
|
-
let finish = false;
|
|
435
|
-
let currentDayIndex = this.firstDayIndex;
|
|
436
|
-
let firstMonthDayIndex = firstMonthDay.getDay();
|
|
437
|
-
let row = [];
|
|
438
|
-
let daysForRowAdded = 0;
|
|
439
|
-
while (!finish) {
|
|
440
|
-
if (currentDayIndex == firstMonthDayIndex) {
|
|
441
|
-
break;
|
|
442
|
-
}
|
|
443
|
-
row.push(h("td", { class: "item empty" }));
|
|
444
|
-
currentDayIndex++;
|
|
445
|
-
daysForRowAdded++;
|
|
446
|
-
if (currentDayIndex > 6) {
|
|
447
|
-
currentDayIndex = 0;
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
let dayCount = 1;
|
|
451
|
-
while (dayCount <= lastMonthDay.getDate()) {
|
|
452
|
-
for (let i = daysForRowAdded; i < 7; i++) {
|
|
453
|
-
let dayClass = 'item';
|
|
454
|
-
let dataIndex = {
|
|
455
|
-
'data-index': date.getFullYear().toString() +
|
|
456
|
-
'-' +
|
|
457
|
-
fillString((date.getMonth() + 1).toString(), '0', 2, true) +
|
|
458
|
-
'-' +
|
|
459
|
-
fillString(dayCount.toString(), '0', 2, true),
|
|
460
|
-
};
|
|
461
|
-
if (dayCount === selecteDate.getDate() &&
|
|
462
|
-
date.getMonth() === selecteDate.getMonth() &&
|
|
463
|
-
date.getFullYear() === selecteDate.getFullYear()) {
|
|
464
|
-
dayClass += ' selected';
|
|
465
|
-
}
|
|
466
|
-
row.push(h("td", { class: dayClass },
|
|
467
|
-
h("span", Object.assign({}, dataIndex, { class: "item-number", onClick: (e) => {
|
|
468
|
-
this.onKupDatePickerItemClick(e, dataIndex['data-index']);
|
|
469
|
-
} }), dayCount)));
|
|
470
|
-
dayCount++;
|
|
471
|
-
if (dayCount > lastMonthDay.getDate()) {
|
|
472
|
-
break;
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
if (row.length > 0) {
|
|
476
|
-
tbody.push(h("tr", null, row));
|
|
477
|
-
row = [];
|
|
478
|
-
}
|
|
479
|
-
daysForRowAdded = 0;
|
|
480
|
-
}
|
|
481
|
-
return (h("table", { id: "calendar" },
|
|
482
|
-
h("thead", null, thead),
|
|
483
|
-
h("tbody", null, tbody)));
|
|
484
|
-
}
|
|
485
|
-
createMonthsCalendar() {
|
|
486
|
-
let months = getMonthsAsStringByLocale(DateTimeFormatOptionsMonth.SHORT);
|
|
487
|
-
let date = this.pickerEl.date;
|
|
488
|
-
let selecteDate;
|
|
489
|
-
if (this.value == null || this.value.trim() == '') {
|
|
490
|
-
selecteDate = new Date();
|
|
491
|
-
}
|
|
492
|
-
else {
|
|
493
|
-
selecteDate = new Date(this.value);
|
|
494
|
-
}
|
|
495
|
-
let tbody = [];
|
|
496
|
-
let row = [];
|
|
497
|
-
let monthCount = 0;
|
|
498
|
-
while (monthCount < 12) {
|
|
499
|
-
for (let i = 0; i < 4; i++) {
|
|
500
|
-
let monthClass = 'item';
|
|
501
|
-
let dataIndex = {
|
|
502
|
-
'data-index': date.getFullYear().toString() +
|
|
503
|
-
'-' +
|
|
504
|
-
fillString((monthCount + 1).toString(), '0', 2, true) +
|
|
505
|
-
'-' +
|
|
506
|
-
fillString(date.getDate().toString(), '0', 2, true),
|
|
507
|
-
};
|
|
508
|
-
if (monthCount === selecteDate.getMonth() &&
|
|
509
|
-
date.getFullYear() == selecteDate.getFullYear()) {
|
|
510
|
-
monthClass += ' selected';
|
|
511
|
-
}
|
|
512
|
-
row.push(h("td", { class: monthClass },
|
|
513
|
-
h("span", Object.assign({}, dataIndex, { class: "item-number", onClick: (e) => {
|
|
514
|
-
this.onKupDatePickerMonthYearItemClick(e, dataIndex['data-index']);
|
|
515
|
-
} }), months[monthCount])));
|
|
516
|
-
monthCount++;
|
|
517
|
-
}
|
|
518
|
-
if (row.length > 0) {
|
|
519
|
-
tbody.push(h("tr", null, row));
|
|
520
|
-
row = [];
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
return (h("table", { id: "calendar" },
|
|
524
|
-
h("tbody", null, tbody)));
|
|
525
|
-
}
|
|
526
|
-
createYearsCalendar() {
|
|
527
|
-
let date = this.pickerEl.date;
|
|
528
|
-
let curYear = date.getFullYear();
|
|
529
|
-
let yearRange = this.getInitEndYear(curYear);
|
|
530
|
-
let initYear = yearRange.initYear;
|
|
531
|
-
let endYear = yearRange.endYear;
|
|
532
|
-
let selecteDate;
|
|
533
|
-
if (this.value == null || this.value.trim() == '') {
|
|
534
|
-
selecteDate = new Date();
|
|
535
|
-
}
|
|
536
|
-
else {
|
|
537
|
-
selecteDate = new Date(this.value);
|
|
538
|
-
}
|
|
539
|
-
let tbody = [];
|
|
540
|
-
let row = [];
|
|
541
|
-
let yearCount = initYear;
|
|
542
|
-
while (yearCount <= endYear) {
|
|
543
|
-
for (let i = 0; i < 4; i++) {
|
|
544
|
-
let yearClass = 'item';
|
|
545
|
-
let dataIndex = {
|
|
546
|
-
'data-index': yearCount.toString() +
|
|
547
|
-
'-' +
|
|
548
|
-
fillString((date.getMonth() + 1).toString(), '0', 2, true) +
|
|
549
|
-
'-' +
|
|
550
|
-
fillString(date.getDate().toString(), '0', 2, true),
|
|
551
|
-
};
|
|
552
|
-
if (yearCount === selecteDate.getFullYear()) {
|
|
553
|
-
yearClass += ' selected';
|
|
554
|
-
}
|
|
555
|
-
row.push(h("td", { class: yearClass },
|
|
556
|
-
h("span", Object.assign({}, dataIndex, { class: "item-number", onClick: (e) => {
|
|
557
|
-
this.onKupDatePickerMonthYearItemClick(e, dataIndex['data-index']);
|
|
558
|
-
} }), yearCount)));
|
|
559
|
-
yearCount++;
|
|
560
|
-
}
|
|
561
|
-
if (row.length > 0) {
|
|
562
|
-
tbody.push(h("tr", null, row));
|
|
563
|
-
row = [];
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
return (h("table", { id: "calendar" },
|
|
567
|
-
h("tbody", null, tbody)));
|
|
568
|
-
}
|
|
569
|
-
changeView(e) {
|
|
570
|
-
e.stopPropagation();
|
|
571
|
-
switch (this.calendarView) {
|
|
572
|
-
case SourceEvent.DATE: {
|
|
573
|
-
this.calendarView = SourceEvent.MONTH;
|
|
574
|
-
break;
|
|
575
|
-
}
|
|
576
|
-
case SourceEvent.MONTH: {
|
|
577
|
-
this.calendarView = SourceEvent.YEAR;
|
|
578
|
-
break;
|
|
579
|
-
}
|
|
580
|
-
case SourceEvent.YEAR: {
|
|
581
|
-
this.calendarView = SourceEvent.DATE;
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
this.refresh();
|
|
585
|
-
}
|
|
586
|
-
prevPage(e) {
|
|
587
|
-
e.stopPropagation();
|
|
588
|
-
let date = this.pickerEl.date;
|
|
589
|
-
let yy = date.getFullYear();
|
|
590
|
-
let mm = date.getMonth();
|
|
591
|
-
if (this.calendarView == SourceEvent.DATE) {
|
|
592
|
-
if (mm < 1) {
|
|
593
|
-
mm = 11;
|
|
594
|
-
yy--;
|
|
595
|
-
}
|
|
596
|
-
else {
|
|
597
|
-
mm--;
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
if (this.calendarView == SourceEvent.MONTH) {
|
|
601
|
-
yy--;
|
|
602
|
-
}
|
|
603
|
-
if (this.calendarView == SourceEvent.YEAR) {
|
|
604
|
-
let yearRange = this.getInitEndYear(yy);
|
|
605
|
-
yy = yearRange.initYear - 1;
|
|
606
|
-
}
|
|
607
|
-
date.setFullYear(yy);
|
|
608
|
-
date.setMonth(mm);
|
|
609
|
-
this.pickerEl.value = date.toISOString();
|
|
610
|
-
this.pickerEl.date = date;
|
|
611
|
-
this.refresh();
|
|
612
|
-
}
|
|
613
|
-
nextPage(e) {
|
|
614
|
-
e.stopPropagation();
|
|
615
|
-
let date = this.pickerEl.date;
|
|
616
|
-
let yy = date.getFullYear();
|
|
617
|
-
let mm = date.getMonth();
|
|
618
|
-
if (this.calendarView == SourceEvent.DATE) {
|
|
619
|
-
if (mm > 10) {
|
|
620
|
-
mm = 0;
|
|
621
|
-
yy++;
|
|
622
|
-
}
|
|
623
|
-
else {
|
|
624
|
-
mm++;
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
if (this.calendarView == SourceEvent.MONTH) {
|
|
628
|
-
yy++;
|
|
629
|
-
}
|
|
630
|
-
if (this.calendarView == SourceEvent.YEAR) {
|
|
631
|
-
let yearRange = this.getInitEndYear(yy);
|
|
632
|
-
yy = yearRange.endYear + 1;
|
|
633
|
-
}
|
|
634
|
-
date.setFullYear(yy);
|
|
635
|
-
date.setMonth(mm);
|
|
636
|
-
this.pickerEl.value = date.toISOString();
|
|
637
|
-
this.pickerEl.date = date;
|
|
638
|
-
this.refresh();
|
|
339
|
+
const data = {
|
|
340
|
+
options: {
|
|
341
|
+
initialValue: this.value,
|
|
342
|
+
firstDayIndex: this.firstDayIndex,
|
|
343
|
+
resetStatus: true,
|
|
344
|
+
},
|
|
345
|
+
};
|
|
346
|
+
return (h("kup-card", { ref: (el) => (this.pickerContainerEl = el), data: data, "layout-family": "builtin", "layout-number": "1", "size-x": "300px", "size-y": "300px", "is-menu": true, "onkup-card-click": (ev) => {
|
|
347
|
+
if (ev.detail.value != null && ev.detail.value != '')
|
|
348
|
+
this.onKupDatePickerItemClick(ev.detail.value);
|
|
349
|
+
} }));
|
|
639
350
|
}
|
|
640
351
|
getDateForOutput() {
|
|
641
352
|
if (this.value == null || this.value.trim() == '') {
|
|
@@ -644,11 +355,6 @@ export class KupDatePicker {
|
|
|
644
355
|
let v1 = this.kupManager.dates.format(this.value);
|
|
645
356
|
return v1;
|
|
646
357
|
}
|
|
647
|
-
recalcPosition() {
|
|
648
|
-
if (this.pickerContainerEl != null && this.textfieldEl != null) {
|
|
649
|
-
this.kupManager.dynamicPosition.register(this.pickerContainerEl, this.textfieldEl);
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
358
|
/*-------------------------------------------------*/
|
|
653
359
|
/* L i f e c y c l e H o o k s */
|
|
654
360
|
/*-------------------------------------------------*/
|
|
@@ -670,34 +376,25 @@ export class KupDatePicker {
|
|
|
670
376
|
this.kupManager.debug.logRender(this, false);
|
|
671
377
|
}
|
|
672
378
|
componentDidRender() {
|
|
673
|
-
this.
|
|
379
|
+
const root = this.rootElement.shadowRoot;
|
|
380
|
+
if (root) {
|
|
381
|
+
const f = root.querySelector('.f-text-field');
|
|
382
|
+
if (f) {
|
|
383
|
+
this.textfieldEl = f.querySelector('input');
|
|
384
|
+
FTextFieldMDC(f);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
674
387
|
this.kupManager.debug.logRender(this, true);
|
|
675
388
|
}
|
|
676
389
|
render() {
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
this.
|
|
680
|
-
this.data['kup-text-field']['className'] &&
|
|
681
|
-
this.data['kup-text-field']['className'].indexOf('kup-full-height') > -1) {
|
|
682
|
-
hostClass['kup-full-height'] = true;
|
|
683
|
-
}
|
|
684
|
-
if (this.data &&
|
|
685
|
-
this.data['kup-text-field'] &&
|
|
686
|
-
this.data['kup-text-field']['fullWidth']) {
|
|
687
|
-
hostClass['kup-full-width'] = true;
|
|
688
|
-
}
|
|
689
|
-
const customStyle = this.kupManager.theme.setCustomStyle(this.rootElement);
|
|
690
|
-
return (h(Host, { class: hostClass, onBlur: () => this.onKupBlur() },
|
|
691
|
-
customStyle ? h("style", null, customStyle) : null,
|
|
692
|
-
h("div", { id: componentWrapperId },
|
|
693
|
-
this.prepDateTextfield(),
|
|
694
|
-
this.prepDatePicker())));
|
|
390
|
+
return (h(Host, null,
|
|
391
|
+
h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)),
|
|
392
|
+
h("div", { id: componentWrapperId }, this.prepTextfield(this.getDateForOutput()))));
|
|
695
393
|
}
|
|
696
394
|
disconnectedCallback() {
|
|
697
395
|
this.kupManager.theme.unregister(this);
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
this.kupManager.dynamicPosition.unregister(Array.prototype.slice.call(dynamicPositionElements));
|
|
396
|
+
if (this.pickerContainerEl) {
|
|
397
|
+
this.pickerContainerEl.remove();
|
|
701
398
|
}
|
|
702
399
|
}
|
|
703
400
|
static get is() { return "kup-date-picker"; }
|
|
@@ -721,11 +418,11 @@ export class KupDatePicker {
|
|
|
721
418
|
"optional": false,
|
|
722
419
|
"docs": {
|
|
723
420
|
"tags": [{
|
|
724
|
-
"
|
|
725
|
-
"
|
|
421
|
+
"name": "default",
|
|
422
|
+
"text": "\"\""
|
|
726
423
|
}, {
|
|
727
|
-
"
|
|
728
|
-
"
|
|
424
|
+
"name": "see",
|
|
425
|
+
"text": "https://ketchup.smeup.com/ketchup-showcase/#/customization"
|
|
729
426
|
}],
|
|
730
427
|
"text": "Custom style of the component."
|
|
731
428
|
},
|
|
@@ -749,8 +446,8 @@ export class KupDatePicker {
|
|
|
749
446
|
"optional": false,
|
|
750
447
|
"docs": {
|
|
751
448
|
"tags": [{
|
|
752
|
-
"
|
|
753
|
-
"
|
|
449
|
+
"name": "default",
|
|
450
|
+
"text": "null"
|
|
754
451
|
}],
|
|
755
452
|
"text": "Props of the sub-components."
|
|
756
453
|
},
|
|
@@ -768,8 +465,8 @@ export class KupDatePicker {
|
|
|
768
465
|
"optional": false,
|
|
769
466
|
"docs": {
|
|
770
467
|
"tags": [{
|
|
771
|
-
"
|
|
772
|
-
"
|
|
468
|
+
"name": "default",
|
|
469
|
+
"text": "false"
|
|
773
470
|
}],
|
|
774
471
|
"text": "Defaults at false. When set to true, the component is disabled."
|
|
775
472
|
},
|
|
@@ -789,8 +486,8 @@ export class KupDatePicker {
|
|
|
789
486
|
"optional": false,
|
|
790
487
|
"docs": {
|
|
791
488
|
"tags": [{
|
|
792
|
-
"
|
|
793
|
-
"
|
|
489
|
+
"name": "default",
|
|
490
|
+
"text": "1"
|
|
794
491
|
}],
|
|
795
492
|
"text": "First day number (0 - sunday, 1 - monday, ...)\nTODO: manage with kupDates.locale, remove prop"
|
|
796
493
|
},
|
|
@@ -810,8 +507,8 @@ export class KupDatePicker {
|
|
|
810
507
|
"optional": false,
|
|
811
508
|
"docs": {
|
|
812
509
|
"tags": [{
|
|
813
|
-
"
|
|
814
|
-
"
|
|
510
|
+
"name": "default",
|
|
511
|
+
"text": "\"\""
|
|
815
512
|
}],
|
|
816
513
|
"text": "Sets the initial value of the component"
|
|
817
514
|
},
|
|
@@ -1030,8 +727,8 @@ export class KupDatePicker {
|
|
|
1030
727
|
"signature": "(descriptions?: boolean) => Promise<GenericObject>",
|
|
1031
728
|
"parameters": [{
|
|
1032
729
|
"tags": [{
|
|
1033
|
-
"
|
|
1034
|
-
"
|
|
730
|
+
"name": "param",
|
|
731
|
+
"text": "descriptions - When provided and true, the result will be the list of props with their description."
|
|
1035
732
|
}],
|
|
1036
733
|
"text": "- When provided and true, the result will be the list of props with their description."
|
|
1037
734
|
}],
|
|
@@ -1094,8 +791,8 @@ export class KupDatePicker {
|
|
|
1094
791
|
"signature": "(value: string) => Promise<void>",
|
|
1095
792
|
"parameters": [{
|
|
1096
793
|
"tags": [{
|
|
1097
|
-
"
|
|
1098
|
-
"
|
|
794
|
+
"name": "param",
|
|
795
|
+
"text": "value - Value to be set."
|
|
1099
796
|
}],
|
|
1100
797
|
"text": "- Value to be set."
|
|
1101
798
|
}],
|
|
@@ -1123,7 +820,7 @@ export class KupDatePicker {
|
|
|
1123
820
|
static get listeners() { return [{
|
|
1124
821
|
"name": "keyup",
|
|
1125
822
|
"method": "listenKeyup",
|
|
1126
|
-
"target":
|
|
823
|
+
"target": undefined,
|
|
1127
824
|
"capture": false,
|
|
1128
825
|
"passive": false
|
|
1129
826
|
}]; }
|