@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,4 +1,4 @@
|
|
|
1
|
-
import { Component, Element, Event, forceUpdate, getAssetPath, h, Method, Prop, } from '@stencil/core';
|
|
1
|
+
import { Component, Element, Event, forceUpdate, getAssetPath, h, Host, Method, Prop, } from '@stencil/core';
|
|
2
2
|
import { Calendar, } from '@fullcalendar/core';
|
|
3
3
|
import dayGridPlugin from '@fullcalendar/daygrid';
|
|
4
4
|
import interactionPlugin from '@fullcalendar/interaction';
|
|
@@ -365,20 +365,22 @@ export class KupCalendar {
|
|
|
365
365
|
this.kupManager.debug.logRender(this, true);
|
|
366
366
|
}
|
|
367
367
|
render() {
|
|
368
|
-
return (h(
|
|
369
|
-
h("
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
h(
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
368
|
+
return (h(Host, null,
|
|
369
|
+
h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)),
|
|
370
|
+
h("div", { id: componentWrapperId },
|
|
371
|
+
h("div", { class: "navigation" },
|
|
372
|
+
!this.hideNavigation ? (h("div", { class: "navigation__left" },
|
|
373
|
+
h(FButton, { icon: "chevron_left", onClick: () => this.onPrev(), title: this.kupManager.language.translate(KupLanguageGeneric.PREVIOUS), wrapperClass: "navigation__prev" }),
|
|
374
|
+
h(FButton, { icon: "calendar", onClick: () => this.onToday(), title: this.kupManager.language.translate(KupLanguageGeneric.TODAY), wrapperClass: "navigation__today" }),
|
|
375
|
+
h(FButton, { icon: "chevron_right", onClick: () => this.onNext(), title: this.kupManager.language.translate(KupLanguageGeneric.NEXT), wrapperClass: "navigation__next" }))) : null,
|
|
376
|
+
h("div", { class: `navigation__title ${this.hideNavigation
|
|
377
|
+
? 'navigation__title--centered'
|
|
378
|
+
: ''}`, ref: (el) => {
|
|
379
|
+
this.navTitle = el;
|
|
380
|
+
} }),
|
|
381
|
+
!this.hideNavigation ? (h("div", { class: "navigation__right" },
|
|
382
|
+
h(FChip, Object.assign({}, this.setChipProps())))) : null),
|
|
383
|
+
h("div", { class: "calendar", ref: (el) => (this.calendarContainer = el) }))));
|
|
382
384
|
}
|
|
383
385
|
disconnectedCallback() {
|
|
384
386
|
if (this.calendar) {
|
|
@@ -409,11 +411,11 @@ export class KupCalendar {
|
|
|
409
411
|
"optional": false,
|
|
410
412
|
"docs": {
|
|
411
413
|
"tags": [{
|
|
412
|
-
"
|
|
413
|
-
"
|
|
414
|
+
"name": "default",
|
|
415
|
+
"text": "\"\""
|
|
414
416
|
}, {
|
|
415
|
-
"
|
|
416
|
-
"
|
|
417
|
+
"name": "see",
|
|
418
|
+
"text": "https://ketchup.smeup.com/ketchup-showcase/#/customization"
|
|
417
419
|
}],
|
|
418
420
|
"text": "Custom style of the component."
|
|
419
421
|
},
|
|
@@ -438,8 +440,8 @@ export class KupCalendar {
|
|
|
438
440
|
"optional": false,
|
|
439
441
|
"docs": {
|
|
440
442
|
"tags": [{
|
|
441
|
-
"
|
|
442
|
-
"
|
|
443
|
+
"name": "default",
|
|
444
|
+
"text": "null"
|
|
443
445
|
}],
|
|
444
446
|
"text": "Actual data of the calendar."
|
|
445
447
|
},
|
|
@@ -457,8 +459,8 @@ export class KupCalendar {
|
|
|
457
459
|
"optional": false,
|
|
458
460
|
"docs": {
|
|
459
461
|
"tags": [{
|
|
460
|
-
"
|
|
461
|
-
"
|
|
462
|
+
"name": "default",
|
|
463
|
+
"text": "null"
|
|
462
464
|
}],
|
|
463
465
|
"text": "Column containing events' dates."
|
|
464
466
|
},
|
|
@@ -478,8 +480,8 @@ export class KupCalendar {
|
|
|
478
480
|
"optional": false,
|
|
479
481
|
"docs": {
|
|
480
482
|
"tags": [{
|
|
481
|
-
"
|
|
482
|
-
"
|
|
483
|
+
"name": "default",
|
|
484
|
+
"text": "null"
|
|
483
485
|
}],
|
|
484
486
|
"text": "Column containing events' descriptions."
|
|
485
487
|
},
|
|
@@ -499,8 +501,8 @@ export class KupCalendar {
|
|
|
499
501
|
"optional": false,
|
|
500
502
|
"docs": {
|
|
501
503
|
"tags": [{
|
|
502
|
-
"
|
|
503
|
-
"
|
|
504
|
+
"name": "default",
|
|
505
|
+
"text": "null"
|
|
504
506
|
}],
|
|
505
507
|
"text": "Column containing events' ending time."
|
|
506
508
|
},
|
|
@@ -520,8 +522,8 @@ export class KupCalendar {
|
|
|
520
522
|
"optional": false,
|
|
521
523
|
"docs": {
|
|
522
524
|
"tags": [{
|
|
523
|
-
"
|
|
524
|
-
"
|
|
525
|
+
"name": "default",
|
|
526
|
+
"text": "false"
|
|
525
527
|
}],
|
|
526
528
|
"text": "When disabled, the navigation toolbar won't be displayed."
|
|
527
529
|
},
|
|
@@ -541,8 +543,8 @@ export class KupCalendar {
|
|
|
541
543
|
"optional": false,
|
|
542
544
|
"docs": {
|
|
543
545
|
"tags": [{
|
|
544
|
-
"
|
|
545
|
-
"
|
|
546
|
+
"name": "default",
|
|
547
|
+
"text": "null"
|
|
546
548
|
}],
|
|
547
549
|
"text": "Column containing events' icons. There can be multiple icons, divided by \";\"."
|
|
548
550
|
},
|
|
@@ -562,8 +564,8 @@ export class KupCalendar {
|
|
|
562
564
|
"optional": false,
|
|
563
565
|
"docs": {
|
|
564
566
|
"tags": [{
|
|
565
|
-
"
|
|
566
|
-
"
|
|
567
|
+
"name": "default",
|
|
568
|
+
"text": "null"
|
|
567
569
|
}],
|
|
568
570
|
"text": "Column containing events' images. There can be multiple images, divided by \";\"."
|
|
569
571
|
},
|
|
@@ -583,8 +585,8 @@ export class KupCalendar {
|
|
|
583
585
|
"optional": false,
|
|
584
586
|
"docs": {
|
|
585
587
|
"tags": [{
|
|
586
|
-
"
|
|
587
|
-
"
|
|
588
|
+
"name": "default",
|
|
589
|
+
"text": "null"
|
|
588
590
|
}],
|
|
589
591
|
"text": "Sets the initial date of the calendar. Must be in ISO format (YYYY-MM-DD)."
|
|
590
592
|
},
|
|
@@ -604,8 +606,8 @@ export class KupCalendar {
|
|
|
604
606
|
"optional": false,
|
|
605
607
|
"docs": {
|
|
606
608
|
"tags": [{
|
|
607
|
-
"
|
|
608
|
-
"
|
|
609
|
+
"name": "default",
|
|
610
|
+
"text": "null"
|
|
609
611
|
}],
|
|
610
612
|
"text": "Column containing events' starting time."
|
|
611
613
|
},
|
|
@@ -625,8 +627,8 @@ export class KupCalendar {
|
|
|
625
627
|
"optional": false,
|
|
626
628
|
"docs": {
|
|
627
629
|
"tags": [{
|
|
628
|
-
"
|
|
629
|
-
"
|
|
630
|
+
"name": "default",
|
|
631
|
+
"text": "null"
|
|
630
632
|
}],
|
|
631
633
|
"text": "Column containing events' CSS styles."
|
|
632
634
|
},
|
|
@@ -651,8 +653,8 @@ export class KupCalendar {
|
|
|
651
653
|
"optional": false,
|
|
652
654
|
"docs": {
|
|
653
655
|
"tags": [{
|
|
654
|
-
"
|
|
655
|
-
"
|
|
656
|
+
"name": "default",
|
|
657
|
+
"text": "KupCalendarViewTypes.MONTH"
|
|
656
658
|
}],
|
|
657
659
|
"text": "Type of the view."
|
|
658
660
|
},
|
|
@@ -748,8 +750,8 @@ export class KupCalendar {
|
|
|
748
750
|
"signature": "(descriptions?: boolean) => Promise<GenericObject>",
|
|
749
751
|
"parameters": [{
|
|
750
752
|
"tags": [{
|
|
751
|
-
"
|
|
752
|
-
"
|
|
753
|
+
"name": "param",
|
|
754
|
+
"text": "descriptions - When provided and true, the result will be the list of props with their description."
|
|
753
755
|
}],
|
|
754
756
|
"text": "- When provided and true, the result will be the list of props with their description."
|
|
755
757
|
}],
|
|
@@ -812,8 +814,8 @@ export class KupCalendar {
|
|
|
812
814
|
"signature": "(props: GenericObject) => Promise<void>",
|
|
813
815
|
"parameters": [{
|
|
814
816
|
"tags": [{
|
|
815
|
-
"
|
|
816
|
-
"
|
|
817
|
+
"name": "param",
|
|
818
|
+
"text": "props - Object containing props that will be set to the component."
|
|
817
819
|
}],
|
|
818
820
|
"text": "- Object containing props that will be set to the component."
|
|
819
821
|
}],
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { KupCardCSSClasses } from '../kup-card-declarations';
|
|
3
|
+
import { prepareCalendar } from './kup-card-calendar';
|
|
4
|
+
import { prepareClock } from './kup-card-clock';
|
|
5
|
+
/**
|
|
6
|
+
* 1st builtin card layout, calendar view.
|
|
7
|
+
* @param {KupCard} component - Card component.
|
|
8
|
+
* @returns {VNode} 1st builtin layout virtual node.
|
|
9
|
+
*/
|
|
10
|
+
export function create1(component) {
|
|
11
|
+
return (h("div", { class: `builtin-layout-${component.layoutNumber} ${KupCardCSSClasses.BUILTIN_CARD}` }, prepareCalendar(component)));
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 2st builtin card layout, time view.
|
|
15
|
+
* @param {KupCard} component - Card component.
|
|
16
|
+
* @returns {VNode} 2st builtin layout virtual node.
|
|
17
|
+
*/
|
|
18
|
+
export function create2(component) {
|
|
19
|
+
return (h("div", { class: `builtin-layout-${component.layoutNumber} ${KupCardCSSClasses.BUILTIN_CARD}` }, prepareClock(component)));
|
|
20
|
+
}
|
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { FButton } from '../../../f-components/f-button/f-button';
|
|
3
|
+
import { FButtonStyling, } from '../../../f-components/f-button/f-button-declarations';
|
|
4
|
+
import { KupDatesFormats } from '../../../utils/kup-dates/kup-dates-declarations';
|
|
5
|
+
import { DateTimeFormatOptionsMonth, getMonthsAsStringByLocale, } from '../../../utils/utils';
|
|
6
|
+
import { SourceEvent } from '../../kup-date-picker/kup-date-picker-declarations';
|
|
7
|
+
const dom = document.documentElement;
|
|
8
|
+
export function prepareCalendar(component) {
|
|
9
|
+
const el = component.rootElement;
|
|
10
|
+
if (!el.kupData)
|
|
11
|
+
el.kupData = {};
|
|
12
|
+
if (component.data && component.data.options) {
|
|
13
|
+
const opts = component.data.options;
|
|
14
|
+
if (opts.resetStatus) {
|
|
15
|
+
el.kupData = {};
|
|
16
|
+
const obj = opts.initialValue;
|
|
17
|
+
if (opts.initialValue) {
|
|
18
|
+
if (obj && obj.k)
|
|
19
|
+
setValue(component, new Date(obj.k));
|
|
20
|
+
else
|
|
21
|
+
setValue(component, new Date(opts.initialValue));
|
|
22
|
+
}
|
|
23
|
+
if (opts.firstDayIndex)
|
|
24
|
+
el.kupData.firstDayIndex = opts.firstDayIndex;
|
|
25
|
+
opts.resetStatus = false;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (!el.kupData.value)
|
|
29
|
+
setValue(component, new Date());
|
|
30
|
+
const months = getMonthsAsStringByLocale();
|
|
31
|
+
const curYear = getYear(component);
|
|
32
|
+
const curMonth = getMonth(component);
|
|
33
|
+
const yearRange = getInitEndYear(curYear);
|
|
34
|
+
const initYear = yearRange.initYear;
|
|
35
|
+
const endYear = yearRange.endYear;
|
|
36
|
+
let changeViewButtonLabel = 'not-set';
|
|
37
|
+
switch (getView(component)) {
|
|
38
|
+
case SourceEvent.DATE: {
|
|
39
|
+
changeViewButtonLabel =
|
|
40
|
+
months[curMonth] + ', ' + curYear.toString();
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
case SourceEvent.MONTH: {
|
|
44
|
+
changeViewButtonLabel = curYear.toString();
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
case SourceEvent.YEAR: {
|
|
48
|
+
changeViewButtonLabel =
|
|
49
|
+
initYear.toString() + ' - ' + endYear.toString();
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const prevButtonProp = {
|
|
54
|
+
icon: 'chevron_left',
|
|
55
|
+
wrapperClass: 'prev-page',
|
|
56
|
+
onClick: () => prevPage(component),
|
|
57
|
+
};
|
|
58
|
+
const prevButtonComp = h(FButton, Object.assign({}, prevButtonProp));
|
|
59
|
+
const nextButtonProp = {
|
|
60
|
+
icon: 'chevron_right',
|
|
61
|
+
wrapperClass: 'next-page',
|
|
62
|
+
onClick: () => nextPage(component),
|
|
63
|
+
};
|
|
64
|
+
const nextButtonComp = h(FButton, Object.assign({}, nextButtonProp));
|
|
65
|
+
const changeViewButtonProp = {
|
|
66
|
+
wrapperClass: 'change-view-button',
|
|
67
|
+
styling: FButtonStyling.FLAT,
|
|
68
|
+
label: changeViewButtonLabel,
|
|
69
|
+
onClick: () => changeView(component),
|
|
70
|
+
id: 'change-view-button',
|
|
71
|
+
};
|
|
72
|
+
//text-transform:capitalize
|
|
73
|
+
return (h("div", { id: component.rootElement.id + '_calendar' },
|
|
74
|
+
h("div", { class: "section-1" },
|
|
75
|
+
h("div", { class: "sub-1 nav" },
|
|
76
|
+
prevButtonComp,
|
|
77
|
+
h(FButton, Object.assign({}, changeViewButtonProp)),
|
|
78
|
+
nextButtonComp)),
|
|
79
|
+
h("div", { class: "section-2" }, createCalendar(component))));
|
|
80
|
+
}
|
|
81
|
+
function setValue(component, value) {
|
|
82
|
+
const el = component.rootElement;
|
|
83
|
+
el.kupData.value = value;
|
|
84
|
+
el.kupData.day = el.kupData.value.getDate();
|
|
85
|
+
el.kupData.month = el.kupData.value.getMonth();
|
|
86
|
+
el.kupData.year = el.kupData.value.getFullYear();
|
|
87
|
+
}
|
|
88
|
+
function getValue(component) {
|
|
89
|
+
const el = component.rootElement;
|
|
90
|
+
if (el.kupData.value == null)
|
|
91
|
+
setValue(component, new Date());
|
|
92
|
+
return el.kupData.value;
|
|
93
|
+
}
|
|
94
|
+
function getDay(component) {
|
|
95
|
+
const el = component.rootElement;
|
|
96
|
+
if (el.kupData.day != null)
|
|
97
|
+
return el.kupData.day;
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
function getMonth(component) {
|
|
101
|
+
const el = component.rootElement;
|
|
102
|
+
if (el.kupData.month != null)
|
|
103
|
+
return el.kupData.month;
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
function getYear(component) {
|
|
107
|
+
const el = component.rootElement;
|
|
108
|
+
if (el.kupData.year != null)
|
|
109
|
+
return el.kupData.year;
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
function setDay(component, value) {
|
|
113
|
+
const el = component.rootElement;
|
|
114
|
+
el.kupData.day = value;
|
|
115
|
+
}
|
|
116
|
+
function setMonth(component, value) {
|
|
117
|
+
const el = component.rootElement;
|
|
118
|
+
el.kupData.month = value;
|
|
119
|
+
}
|
|
120
|
+
function setYear(component, value) {
|
|
121
|
+
const el = component.rootElement;
|
|
122
|
+
el.kupData.year = value;
|
|
123
|
+
}
|
|
124
|
+
function getFirstDayIndex(component) {
|
|
125
|
+
const el = component.rootElement;
|
|
126
|
+
if (el.kupData.firstDayIndex)
|
|
127
|
+
return el.kupData.firstDayIndex;
|
|
128
|
+
return 1;
|
|
129
|
+
}
|
|
130
|
+
function getView(component) {
|
|
131
|
+
const el = component.rootElement;
|
|
132
|
+
if (el.kupData.calendarView)
|
|
133
|
+
return el.kupData.calendarView;
|
|
134
|
+
return SourceEvent.DATE;
|
|
135
|
+
}
|
|
136
|
+
function setView(component, value) {
|
|
137
|
+
const el = component.rootElement;
|
|
138
|
+
el.kupData.calendarView = value;
|
|
139
|
+
}
|
|
140
|
+
function createCalendar(component) {
|
|
141
|
+
switch (getView(component)) {
|
|
142
|
+
case SourceEvent.DATE: {
|
|
143
|
+
return createDaysCalendar(component);
|
|
144
|
+
}
|
|
145
|
+
case SourceEvent.MONTH: {
|
|
146
|
+
return createMonthsCalendar(component);
|
|
147
|
+
}
|
|
148
|
+
case SourceEvent.YEAR: {
|
|
149
|
+
return createYearsCalendar(component);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function createDaysCalendar(component) {
|
|
154
|
+
const days = getDaysOfWeekAsStringByLocale(getFirstDayIndex(component));
|
|
155
|
+
const selectedDate = getValue(component);
|
|
156
|
+
const selectedDay = getDay(component);
|
|
157
|
+
const selectedMonth = getMonth(component);
|
|
158
|
+
const selectedYear = getYear(component);
|
|
159
|
+
const thead = [];
|
|
160
|
+
const tbody = [];
|
|
161
|
+
for (let index = 0; index < days.length; index++) {
|
|
162
|
+
thead.push(h("th", null,
|
|
163
|
+
h("span", { class: "item-text" }, days[index])));
|
|
164
|
+
}
|
|
165
|
+
const firstMonthDay = new Date(selectedYear, selectedMonth, 1);
|
|
166
|
+
const lastMonthDay = new Date(selectedYear, selectedMonth + 1, 0);
|
|
167
|
+
const finish = false;
|
|
168
|
+
let currentDayIndex = getFirstDayIndex(component);
|
|
169
|
+
const firstMonthDayIndex = firstMonthDay.getDay();
|
|
170
|
+
let row = [];
|
|
171
|
+
let daysForRowAdded = 0;
|
|
172
|
+
while (!finish) {
|
|
173
|
+
if (currentDayIndex == firstMonthDayIndex) {
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
row.push(h("td", { class: "item empty" }));
|
|
177
|
+
currentDayIndex++;
|
|
178
|
+
daysForRowAdded++;
|
|
179
|
+
if (currentDayIndex > 6) {
|
|
180
|
+
currentDayIndex = 0;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
let dayCount = 1;
|
|
184
|
+
while (dayCount <= lastMonthDay.getDate()) {
|
|
185
|
+
for (let i = daysForRowAdded; i < 7; i++) {
|
|
186
|
+
let dayClass = 'item';
|
|
187
|
+
let dataIndex = {
|
|
188
|
+
'data-index': selectedYear.toString() +
|
|
189
|
+
'-' +
|
|
190
|
+
fillString((selectedMonth + 1).toString(), '0', 2, true) +
|
|
191
|
+
'-' +
|
|
192
|
+
fillString(dayCount.toString(), '0', 2, true),
|
|
193
|
+
};
|
|
194
|
+
if ((selectedDay != null && dayCount === selectedDay) ||
|
|
195
|
+
(dayCount === selectedDate.getDate() &&
|
|
196
|
+
selectedMonth === selectedDate.getMonth() &&
|
|
197
|
+
selectedYear === selectedDate.getFullYear())) {
|
|
198
|
+
dayClass += ' selected';
|
|
199
|
+
}
|
|
200
|
+
row.push(h("td", { class: dayClass },
|
|
201
|
+
h("span", Object.assign({}, dataIndex, { class: "item-number", onClick: () => {
|
|
202
|
+
onCalendarItemClick(component, dataIndex['data-index']);
|
|
203
|
+
} }), dayCount)));
|
|
204
|
+
dayCount++;
|
|
205
|
+
if (dayCount > lastMonthDay.getDate()) {
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (row.length > 0) {
|
|
210
|
+
tbody.push(h("tr", null, row));
|
|
211
|
+
row = [];
|
|
212
|
+
}
|
|
213
|
+
daysForRowAdded = 0;
|
|
214
|
+
}
|
|
215
|
+
return (h("table", { class: "calendar" },
|
|
216
|
+
h("thead", null, thead),
|
|
217
|
+
h("tbody", null, tbody)));
|
|
218
|
+
}
|
|
219
|
+
function createMonthsCalendar(component) {
|
|
220
|
+
const months = getMonthsAsStringByLocale(DateTimeFormatOptionsMonth.SHORT);
|
|
221
|
+
let selectedDay = getDay(component);
|
|
222
|
+
const selectedMonth = getMonth(component);
|
|
223
|
+
const selectedYear = getYear(component);
|
|
224
|
+
if (selectedDay == null)
|
|
225
|
+
selectedDay = 1;
|
|
226
|
+
const tbody = [];
|
|
227
|
+
let row = [];
|
|
228
|
+
let monthCount = 0;
|
|
229
|
+
while (monthCount < 12) {
|
|
230
|
+
for (let i = 0; i < 4; i++) {
|
|
231
|
+
let monthClass = 'item';
|
|
232
|
+
const dataIndex = {
|
|
233
|
+
'data-index': selectedYear.toString() +
|
|
234
|
+
'-' +
|
|
235
|
+
fillString((monthCount + 1).toString(), '0', 2, true) +
|
|
236
|
+
'-' +
|
|
237
|
+
fillString(selectedDay.toString(), '0', 2, true),
|
|
238
|
+
};
|
|
239
|
+
if (monthCount === selectedMonth) {
|
|
240
|
+
monthClass += ' selected';
|
|
241
|
+
}
|
|
242
|
+
row.push(h("td", { class: monthClass },
|
|
243
|
+
h("span", Object.assign({}, dataIndex, { class: "item-number", onClick: () => {
|
|
244
|
+
onCalendarMonthYearItemClick(component, dataIndex['data-index']);
|
|
245
|
+
} }), months[monthCount])));
|
|
246
|
+
monthCount++;
|
|
247
|
+
}
|
|
248
|
+
if (row.length > 0) {
|
|
249
|
+
tbody.push(h("tr", null, row));
|
|
250
|
+
row = [];
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return (h("table", { class: "calendar" },
|
|
254
|
+
h("tbody", null, tbody)));
|
|
255
|
+
}
|
|
256
|
+
function createYearsCalendar(component) {
|
|
257
|
+
let selectedDay = getDay(component);
|
|
258
|
+
const selectedMonth = getMonth(component);
|
|
259
|
+
const selectedYear = getYear(component);
|
|
260
|
+
if (selectedDay == null)
|
|
261
|
+
selectedDay = 1;
|
|
262
|
+
const yearRange = getInitEndYear(selectedYear);
|
|
263
|
+
const initYear = yearRange.initYear;
|
|
264
|
+
const endYear = yearRange.endYear;
|
|
265
|
+
const tbody = [];
|
|
266
|
+
let row = [];
|
|
267
|
+
let yearCount = initYear;
|
|
268
|
+
while (yearCount <= endYear) {
|
|
269
|
+
for (let i = 0; i < 4; i++) {
|
|
270
|
+
let yearClass = 'item';
|
|
271
|
+
let dataIndex = {
|
|
272
|
+
'data-index': yearCount.toString() +
|
|
273
|
+
'-' +
|
|
274
|
+
fillString((selectedMonth + 1).toString(), '0', 2, true) +
|
|
275
|
+
'-' +
|
|
276
|
+
fillString(selectedDay.toString(), '0', 2, true),
|
|
277
|
+
};
|
|
278
|
+
if (yearCount === selectedYear) {
|
|
279
|
+
yearClass += ' selected';
|
|
280
|
+
}
|
|
281
|
+
row.push(h("td", { class: yearClass },
|
|
282
|
+
h("span", Object.assign({}, dataIndex, { class: "item-number", onClick: () => {
|
|
283
|
+
onCalendarMonthYearItemClick(component, dataIndex['data-index']);
|
|
284
|
+
} }), yearCount)));
|
|
285
|
+
yearCount++;
|
|
286
|
+
}
|
|
287
|
+
if (row.length > 0) {
|
|
288
|
+
tbody.push(h("tr", null, row));
|
|
289
|
+
row = [];
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return (h("table", { class: "calendar" },
|
|
293
|
+
h("tbody", null, tbody)));
|
|
294
|
+
}
|
|
295
|
+
function getDaysOfWeekAsStringByLocale(firstDayIndex) {
|
|
296
|
+
const thisWeekDays = thisWeek(firstDayIndex);
|
|
297
|
+
const monday = thisWeekDays.startDate;
|
|
298
|
+
const days = [];
|
|
299
|
+
for (var i = 0; i < 7; i++) {
|
|
300
|
+
var date = new Date(monday.toISOString());
|
|
301
|
+
date.setDate(date.getDate() + i);
|
|
302
|
+
days[i] = getDayAsStringByLocale(date);
|
|
303
|
+
}
|
|
304
|
+
return days;
|
|
305
|
+
}
|
|
306
|
+
function thisWeek(firstDayIndex) {
|
|
307
|
+
const firstDay = firstDayThisWeek(firstDayIndex);
|
|
308
|
+
return {
|
|
309
|
+
startDate: firstDay,
|
|
310
|
+
endDate: offsetDate(firstDay, 6),
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
function firstDayThisWeek(firstDayIndex) {
|
|
314
|
+
const d = new Date();
|
|
315
|
+
const day = d.getDay();
|
|
316
|
+
// dayIndex0
|
|
317
|
+
d.setDate(d.getDate() - day);
|
|
318
|
+
// dayIndexX
|
|
319
|
+
d.setDate(d.getDate() + firstDayIndex);
|
|
320
|
+
return d;
|
|
321
|
+
}
|
|
322
|
+
const offsetDate = (base, count) => {
|
|
323
|
+
const date = new Date(base);
|
|
324
|
+
date.setDate(base.getDate() + count);
|
|
325
|
+
return date;
|
|
326
|
+
};
|
|
327
|
+
function getDayAsStringByLocale(date) {
|
|
328
|
+
if (date == null) {
|
|
329
|
+
return '';
|
|
330
|
+
}
|
|
331
|
+
const options = {
|
|
332
|
+
weekday: 'narrow',
|
|
333
|
+
/** weekday: 'narrow' 'short' 'long' */
|
|
334
|
+
};
|
|
335
|
+
const dateTimeFormat = new Intl.DateTimeFormat(dom.ketchup.dates.getLocale(), options);
|
|
336
|
+
return dateTimeFormat.format(date);
|
|
337
|
+
}
|
|
338
|
+
function fillString(stringIn, stringForFill, finalLen, addBefore) {
|
|
339
|
+
const initSize = stringIn.length;
|
|
340
|
+
let stringOut = '';
|
|
341
|
+
for (let i = initSize; i < finalLen; i += stringForFill.length) {
|
|
342
|
+
stringOut += stringForFill;
|
|
343
|
+
}
|
|
344
|
+
if (addBefore) {
|
|
345
|
+
return stringOut + stringIn;
|
|
346
|
+
}
|
|
347
|
+
else {
|
|
348
|
+
return stringIn + stringOut;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
function prevPage(component) {
|
|
352
|
+
let mm = getMonth(component);
|
|
353
|
+
let yy = getYear(component);
|
|
354
|
+
if (getView(component) == SourceEvent.DATE) {
|
|
355
|
+
if (mm < 1) {
|
|
356
|
+
mm = 11;
|
|
357
|
+
yy--;
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
mm--;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
if (getView(component) == SourceEvent.MONTH) {
|
|
364
|
+
yy--;
|
|
365
|
+
}
|
|
366
|
+
if (getView(component) == SourceEvent.YEAR) {
|
|
367
|
+
let yearRange = getInitEndYear(yy);
|
|
368
|
+
yy = yearRange.initYear - 1;
|
|
369
|
+
}
|
|
370
|
+
setDay(component, null);
|
|
371
|
+
setMonth(component, mm);
|
|
372
|
+
setYear(component, yy);
|
|
373
|
+
refresh(component);
|
|
374
|
+
}
|
|
375
|
+
function nextPage(component) {
|
|
376
|
+
let mm = getMonth(component);
|
|
377
|
+
let yy = getYear(component);
|
|
378
|
+
if (getView(component) == SourceEvent.DATE) {
|
|
379
|
+
if (mm > 10) {
|
|
380
|
+
mm = 0;
|
|
381
|
+
yy++;
|
|
382
|
+
}
|
|
383
|
+
else {
|
|
384
|
+
mm++;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
if (getView(component) == SourceEvent.MONTH) {
|
|
388
|
+
yy++;
|
|
389
|
+
}
|
|
390
|
+
if (getView(component) == SourceEvent.YEAR) {
|
|
391
|
+
const yearRange = getInitEndYear(yy);
|
|
392
|
+
yy = yearRange.endYear + 1;
|
|
393
|
+
}
|
|
394
|
+
setDay(component, null);
|
|
395
|
+
setMonth(component, mm);
|
|
396
|
+
setYear(component, yy);
|
|
397
|
+
refresh(component);
|
|
398
|
+
}
|
|
399
|
+
function getInitEndYear(curYear) {
|
|
400
|
+
const initYear = curYear - (curYear % 10);
|
|
401
|
+
const endYear = initYear + 16 - 1;
|
|
402
|
+
return { initYear: initYear, endYear: endYear };
|
|
403
|
+
}
|
|
404
|
+
function changeView(component) {
|
|
405
|
+
setDay(component, null);
|
|
406
|
+
switch (getView(component)) {
|
|
407
|
+
case SourceEvent.DATE: {
|
|
408
|
+
setView(component, SourceEvent.MONTH);
|
|
409
|
+
break;
|
|
410
|
+
}
|
|
411
|
+
case SourceEvent.MONTH: {
|
|
412
|
+
setView(component, SourceEvent.YEAR);
|
|
413
|
+
break;
|
|
414
|
+
}
|
|
415
|
+
case SourceEvent.YEAR: {
|
|
416
|
+
setView(component, SourceEvent.DATE);
|
|
417
|
+
break;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
refresh(component);
|
|
421
|
+
}
|
|
422
|
+
function refresh(component) {
|
|
423
|
+
component.refresh();
|
|
424
|
+
}
|
|
425
|
+
function onCalendarMonthYearItemClick(component, value) {
|
|
426
|
+
let d;
|
|
427
|
+
if (dom.ketchup.dates.isValid(value, KupDatesFormats.ISO_DATE)) {
|
|
428
|
+
d = new Date(value);
|
|
429
|
+
}
|
|
430
|
+
else {
|
|
431
|
+
d = new Date();
|
|
432
|
+
}
|
|
433
|
+
setMonth(component, d.getMonth());
|
|
434
|
+
setYear(component, d.getFullYear());
|
|
435
|
+
switch (getView(component)) {
|
|
436
|
+
case SourceEvent.MONTH: {
|
|
437
|
+
setView(component, SourceEvent.DATE);
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
case SourceEvent.YEAR: {
|
|
441
|
+
setView(component, SourceEvent.MONTH);
|
|
442
|
+
break;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
refresh(component);
|
|
446
|
+
}
|
|
447
|
+
function onCalendarItemClick(component, value) {
|
|
448
|
+
let d;
|
|
449
|
+
if (dom.ketchup.dates.isValid(value, KupDatesFormats.ISO_DATE)) {
|
|
450
|
+
d = new Date(value);
|
|
451
|
+
}
|
|
452
|
+
else {
|
|
453
|
+
d = new Date();
|
|
454
|
+
}
|
|
455
|
+
setValue(component, d);
|
|
456
|
+
component.onKupClick(component.rootElement.id, value);
|
|
457
|
+
refresh(component);
|
|
458
|
+
}
|