@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
|
@@ -0,0 +1,321 @@
|
|
|
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 { KupCardBuiltinClockElements, KupCardCSSClasses, } from '../kup-card-declarations';
|
|
6
|
+
const dom = document.documentElement;
|
|
7
|
+
export function prepareClock(component) {
|
|
8
|
+
const el = component.rootElement;
|
|
9
|
+
el.kupData = {};
|
|
10
|
+
if (component.data && component.data.options) {
|
|
11
|
+
const opts = component.data.options;
|
|
12
|
+
const obj = opts.initialValue;
|
|
13
|
+
if (opts.initialValue) {
|
|
14
|
+
if (obj && obj.k)
|
|
15
|
+
el.kupData.value = obj.k;
|
|
16
|
+
else
|
|
17
|
+
el.kupData.value = opts.initialValue;
|
|
18
|
+
}
|
|
19
|
+
if (opts.manageSeconds != null)
|
|
20
|
+
el.kupData.manageSeconds = opts.manageSeconds;
|
|
21
|
+
if (opts.hoursActive != null)
|
|
22
|
+
el.kupData.hoursActive = opts.hoursActive;
|
|
23
|
+
if (opts.minutesActive != null)
|
|
24
|
+
el.kupData.minutesActive = opts.minutesActive;
|
|
25
|
+
if (opts.secondsActive != null)
|
|
26
|
+
el.kupData.secondsActive = opts.secondsActive;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
el.kupData.hoursActive = true;
|
|
30
|
+
}
|
|
31
|
+
return prepTimeArea(component);
|
|
32
|
+
}
|
|
33
|
+
function isManageSeconds(component) {
|
|
34
|
+
const el = component.rootElement;
|
|
35
|
+
if (el.kupData.manageSeconds != null)
|
|
36
|
+
return el.kupData.manageSeconds;
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
function getValue(component) {
|
|
40
|
+
const el = component.rootElement;
|
|
41
|
+
if (el.kupData.value)
|
|
42
|
+
return el.kupData.value;
|
|
43
|
+
return '';
|
|
44
|
+
}
|
|
45
|
+
function setValue(component, value) {
|
|
46
|
+
const el = component.rootElement;
|
|
47
|
+
el.kupData.value = value;
|
|
48
|
+
}
|
|
49
|
+
function getHoursActive(component) {
|
|
50
|
+
const el = component.rootElement;
|
|
51
|
+
if (el.kupData.hoursActive != null)
|
|
52
|
+
return el.kupData.hoursActive;
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
function getMinutesActive(component) {
|
|
56
|
+
const el = component.rootElement;
|
|
57
|
+
if (el.kupData.minutesActive != null)
|
|
58
|
+
return el.kupData.minutesActive;
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
function getSecondsActive(component) {
|
|
62
|
+
const el = component.rootElement;
|
|
63
|
+
if (el.kupData.secondsActive != null)
|
|
64
|
+
return el.kupData.secondsActive;
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
function setElement(component, elem) {
|
|
68
|
+
if (elem) {
|
|
69
|
+
const el = component.rootElement;
|
|
70
|
+
el.kupData[elem.id] = elem;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function getElement(component, elemId) {
|
|
74
|
+
return component.rootElement.shadowRoot.getElementById(elemId);
|
|
75
|
+
}
|
|
76
|
+
function prepTimeArea(component) {
|
|
77
|
+
return (h("div", { id: "clock-div", onBlur: (e) => {
|
|
78
|
+
if (!isRelatedTargetInThisComponent(e, component)) {
|
|
79
|
+
onKupBlur(component);
|
|
80
|
+
}
|
|
81
|
+
} }, createClock(component)));
|
|
82
|
+
}
|
|
83
|
+
function onKupClockItemClick(e, component, value) {
|
|
84
|
+
if (e != null) {
|
|
85
|
+
if (value == null) {
|
|
86
|
+
value = e.detail.selected.value;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
setClockValueSelected(component, value);
|
|
90
|
+
component.onKupClick(component.rootElement.id, value);
|
|
91
|
+
}
|
|
92
|
+
function setClockValueSelected(component, newValue) {
|
|
93
|
+
if (newValue == null) {
|
|
94
|
+
newValue = getValue(component);
|
|
95
|
+
}
|
|
96
|
+
if (newValue == null) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
setValue(component, newValue);
|
|
100
|
+
}
|
|
101
|
+
function isRelatedTargetInThisComponent(e, component) {
|
|
102
|
+
if (!e.relatedTarget) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
let id = e.relatedTarget.id;
|
|
106
|
+
if (id == null || id.trim() == '') {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
if (id == getElement(component, KupCardBuiltinClockElements.CLOCK).id) {
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
let idConc = '#clock-div#confirm#';
|
|
113
|
+
return idConc.indexOf('#' + id + '#') >= 0;
|
|
114
|
+
}
|
|
115
|
+
function onKupBlur(component) {
|
|
116
|
+
component.onKupClick(component.rootElement.id, getValue(component));
|
|
117
|
+
}
|
|
118
|
+
function createClock(component) {
|
|
119
|
+
let selectedTime;
|
|
120
|
+
if (getValue(component)) {
|
|
121
|
+
selectedTime = dom.ketchup.dates.toDate(getValue(component), isManageSeconds(component)
|
|
122
|
+
? KupDatesFormats.ISO_TIME
|
|
123
|
+
: KupDatesFormats.ISO_TIME_WITHOUT_SECONDS);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
selectedTime = new Date();
|
|
127
|
+
}
|
|
128
|
+
let hh = selectedTime.getHours().toString();
|
|
129
|
+
let mm = selectedTime.getMinutes().toString();
|
|
130
|
+
if (hh.length === 1) {
|
|
131
|
+
hh = '0' + hh;
|
|
132
|
+
}
|
|
133
|
+
if (mm.length === 1) {
|
|
134
|
+
mm = '0' + mm;
|
|
135
|
+
}
|
|
136
|
+
let ss = '';
|
|
137
|
+
if (isManageSeconds(component)) {
|
|
138
|
+
ss = selectedTime.getSeconds().toString();
|
|
139
|
+
if (ss.length === 1) {
|
|
140
|
+
ss = '0' + ss;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
let seconds;
|
|
144
|
+
let time = [
|
|
145
|
+
h("span", { id: KupCardBuiltinClockElements.HOURS, class: `h ${getHoursActive(component) ? KupCardCSSClasses.VISIBLE : ''}`, ref: (el) => {
|
|
146
|
+
setElement(component, el);
|
|
147
|
+
}, onClick: () => {
|
|
148
|
+
setClockViewActive(component, true, false, false);
|
|
149
|
+
switchView(component, KupCardBuiltinClockElements.HOURS, KupCardBuiltinClockElements.HOURSCIRCLE);
|
|
150
|
+
}, innerHTML: hh }),
|
|
151
|
+
':',
|
|
152
|
+
h("span", { id: KupCardBuiltinClockElements.MINUTES, class: `m ${getMinutesActive(component) ? KupCardCSSClasses.VISIBLE : ''}`, ref: (el) => {
|
|
153
|
+
setElement(component, el);
|
|
154
|
+
}, onClick: () => {
|
|
155
|
+
setClockViewActive(component, false, true, false);
|
|
156
|
+
switchView(component, KupCardBuiltinClockElements.MINUTES, KupCardBuiltinClockElements.MINUTESCIRCLE);
|
|
157
|
+
}, innerHTML: mm }),
|
|
158
|
+
];
|
|
159
|
+
if (isManageSeconds(component)) {
|
|
160
|
+
seconds = (h("div", { id: KupCardBuiltinClockElements.SECONDSCIRCLE, class: `circle seconds ${getSecondsActive(component) ? KupCardCSSClasses.VISIBLE : ''}`, ref: (el) => {
|
|
161
|
+
setElement(component, el);
|
|
162
|
+
} },
|
|
163
|
+
buildClock(60, 101, 115, 115, 'sec unit', 0, 5, ss, component),
|
|
164
|
+
h("div", { class: "mid" })));
|
|
165
|
+
time.push(':', h("span", { id: KupCardBuiltinClockElements.SECONDS, class: `s ${getSecondsActive(component) ? KupCardCSSClasses.VISIBLE : ''}`, ref: (el) => {
|
|
166
|
+
setElement(component, el);
|
|
167
|
+
}, onClick: () => {
|
|
168
|
+
setClockViewActive(component, false, false, true);
|
|
169
|
+
switchView(component, KupCardBuiltinClockElements.SECONDS, KupCardBuiltinClockElements.SECONDSCIRCLE);
|
|
170
|
+
}, innerHTML: ss }));
|
|
171
|
+
}
|
|
172
|
+
const confirmButtonProp = {
|
|
173
|
+
label: 'Ok',
|
|
174
|
+
styling: FButtonStyling.FLAT,
|
|
175
|
+
onClick: (e) => {
|
|
176
|
+
setTimeFromClock(e, component);
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
return (h("div", { class: "clock", id: KupCardBuiltinClockElements.CLOCK, ref: (el) => {
|
|
180
|
+
setElement(component, el);
|
|
181
|
+
} },
|
|
182
|
+
h("div", { class: "top" }, time),
|
|
183
|
+
h("div", { id: KupCardBuiltinClockElements.HOURSCIRCLE, class: `circle hours ${getHoursActive(component) ? KupCardCSSClasses.VISIBLE : ''}`, ref: (el) => {
|
|
184
|
+
setElement(component, el);
|
|
185
|
+
} },
|
|
186
|
+
buildClock(12, 101, 105, 105, 'hour', 0, 1, hh, component),
|
|
187
|
+
buildClock(12, 64, 110, 110, 'hour2', 12, 1, hh, component),
|
|
188
|
+
h("div", { class: "mid" })),
|
|
189
|
+
h("div", { id: KupCardBuiltinClockElements.MINUTESCIRCLE, class: `circle minutes ${getMinutesActive(component) ? KupCardCSSClasses.VISIBLE : ''}`, ref: (el) => {
|
|
190
|
+
setElement(component, el);
|
|
191
|
+
} },
|
|
192
|
+
buildClock(60, 101, 115, 115, 'min unit', 0, 5, mm, component),
|
|
193
|
+
h("div", { class: "mid" })),
|
|
194
|
+
seconds,
|
|
195
|
+
h("div", { class: "actions" },
|
|
196
|
+
h(FButton, Object.assign({}, confirmButtonProp)))));
|
|
197
|
+
}
|
|
198
|
+
function setClockViewActive(component, hoursAct, minutesAct, secondsAct) {
|
|
199
|
+
const el = component.rootElement;
|
|
200
|
+
el.kupData.hoursActive = hoursAct;
|
|
201
|
+
el.kupData.minutesActive = minutesAct;
|
|
202
|
+
el.kupData.secondsActive = secondsAct;
|
|
203
|
+
}
|
|
204
|
+
function switchView(component, elId, elCircleId) {
|
|
205
|
+
getElement(component, KupCardBuiltinClockElements.HOURS).classList.remove(KupCardCSSClasses.VISIBLE);
|
|
206
|
+
getElement(component, KupCardBuiltinClockElements.HOURSCIRCLE).classList.remove(KupCardCSSClasses.VISIBLE);
|
|
207
|
+
getElement(component, KupCardBuiltinClockElements.MINUTES).classList.remove(KupCardCSSClasses.VISIBLE);
|
|
208
|
+
getElement(component, KupCardBuiltinClockElements.MINUTESCIRCLE).classList.remove(KupCardCSSClasses.VISIBLE);
|
|
209
|
+
if (isManageSeconds(component)) {
|
|
210
|
+
getElement(component, KupCardBuiltinClockElements.SECONDS).classList.remove(KupCardCSSClasses.VISIBLE);
|
|
211
|
+
getElement(component, KupCardBuiltinClockElements.SECONDSCIRCLE).classList.remove(KupCardCSSClasses.VISIBLE);
|
|
212
|
+
}
|
|
213
|
+
getElement(component, elId).classList.add(KupCardCSSClasses.VISIBLE);
|
|
214
|
+
getElement(component, elCircleId).classList.add(KupCardCSSClasses.VISIBLE);
|
|
215
|
+
}
|
|
216
|
+
function buildClock(num, radius, offsetX, offsetY, className, add, separator, selectedValue, component) {
|
|
217
|
+
let x, y;
|
|
218
|
+
const divsArray = [];
|
|
219
|
+
for (let n = 0; n < num; n++) {
|
|
220
|
+
x = radius * Math.cos((n / num) * 2 * Math.PI);
|
|
221
|
+
y = radius * Math.sin((n / num) * 2 * Math.PI);
|
|
222
|
+
let text;
|
|
223
|
+
let dataValue = {};
|
|
224
|
+
let style = {};
|
|
225
|
+
if (separator == 1) {
|
|
226
|
+
if (n + 3 > 12) {
|
|
227
|
+
text = n + 3 - 12 + add + '';
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
let calc = n + 3 + add;
|
|
231
|
+
if (calc !== 24) {
|
|
232
|
+
text = n + 3 + add + '';
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
text = '00';
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
dataValue['data-value'] = text;
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
if (n % separator == 0) {
|
|
242
|
+
if (n + 15 >= 60) {
|
|
243
|
+
dataValue['data-value'] = n + 15 - 60 + '';
|
|
244
|
+
text = n + 15 - 60 + add + '';
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
dataValue['data-value'] = n + 15 + '';
|
|
248
|
+
text = n + 15 + add + '';
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
if (n + 15 >= 60) {
|
|
253
|
+
dataValue['data-value'] = n + 15 - 60 + '';
|
|
254
|
+
text = '⋅';
|
|
255
|
+
}
|
|
256
|
+
else {
|
|
257
|
+
dataValue['data-value'] = n + 15 + '';
|
|
258
|
+
text = '\u00B7';
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
style['left'] = x + offsetX + 'px';
|
|
263
|
+
style['top'] = y + offsetY + 'px';
|
|
264
|
+
if (dataValue['data-value'].length === 1) {
|
|
265
|
+
dataValue['data-value'] = '0' + dataValue['data-value'];
|
|
266
|
+
}
|
|
267
|
+
let elClass = className;
|
|
268
|
+
if (dataValue['data-value'] === selectedValue) {
|
|
269
|
+
elClass += ' selected';
|
|
270
|
+
}
|
|
271
|
+
let div = (h("div", Object.assign({ class: elClass, style: style }, dataValue, { onClick: (e) => setClockTime(e, component) }), text));
|
|
272
|
+
divsArray.push(div);
|
|
273
|
+
}
|
|
274
|
+
return divsArray;
|
|
275
|
+
}
|
|
276
|
+
function setTimeFromClock(e, component) {
|
|
277
|
+
const hoursEl = getElement(component, KupCardBuiltinClockElements.HOURS);
|
|
278
|
+
const minutesEl = getElement(component, KupCardBuiltinClockElements.MINUTES);
|
|
279
|
+
const secondsEl = getElement(component, KupCardBuiltinClockElements.SECONDS);
|
|
280
|
+
let text = hoursEl.innerText + ':' + minutesEl.innerText;
|
|
281
|
+
if (isManageSeconds(component)) {
|
|
282
|
+
text += ':' + secondsEl.innerText;
|
|
283
|
+
}
|
|
284
|
+
onKupClockItemClick(e, component, text);
|
|
285
|
+
}
|
|
286
|
+
function setClockTime(e, component) {
|
|
287
|
+
const hoursEl = getElement(component, KupCardBuiltinClockElements.HOURS);
|
|
288
|
+
const minutesEl = getElement(component, KupCardBuiltinClockElements.MINUTES);
|
|
289
|
+
const hoursCircleEl = getElement(component, KupCardBuiltinClockElements.HOURSCIRCLE);
|
|
290
|
+
const minutesCircleEl = getElement(component, KupCardBuiltinClockElements.MINUTESCIRCLE);
|
|
291
|
+
const secondsEl = getElement(component, KupCardBuiltinClockElements.SECONDS);
|
|
292
|
+
const secondsCircleEl = getElement(component, KupCardBuiltinClockElements.SECONDSCIRCLE);
|
|
293
|
+
let time = e.target.getAttribute('data-value');
|
|
294
|
+
if (getHoursActive(component)) {
|
|
295
|
+
hoursEl.innerText = time;
|
|
296
|
+
hoursCircleEl.querySelector('.selected').classList.remove('selected');
|
|
297
|
+
setClockViewActive(component, false, true, false);
|
|
298
|
+
switchView(component, KupCardBuiltinClockElements.MINUTES, KupCardBuiltinClockElements.MINUTESCIRCLE);
|
|
299
|
+
}
|
|
300
|
+
else if (getMinutesActive(component)) {
|
|
301
|
+
minutesEl.innerText = time;
|
|
302
|
+
minutesCircleEl.querySelector('.selected').classList.remove('selected');
|
|
303
|
+
if (isManageSeconds(component)) {
|
|
304
|
+
setClockViewActive(component, false, false, true);
|
|
305
|
+
switchView(component, KupCardBuiltinClockElements.SECONDS, KupCardBuiltinClockElements.SECONDSCIRCLE);
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
setTimeFromClock(e, component);
|
|
309
|
+
setClockViewActive(component, true, false, false);
|
|
310
|
+
switchView(component, KupCardBuiltinClockElements.HOURS, KupCardBuiltinClockElements.HOURSCIRCLE);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
secondsEl.innerText = time;
|
|
315
|
+
secondsCircleEl.querySelector('.selected').classList.remove('selected');
|
|
316
|
+
setTimeFromClock(e, component);
|
|
317
|
+
setClockViewActive(component, true, false, false);
|
|
318
|
+
switchView(component, KupCardBuiltinClockElements.HOURS, KupCardBuiltinClockElements.HOURSCIRCLE);
|
|
319
|
+
}
|
|
320
|
+
e.target.classList.add('selected');
|
|
321
|
+
}
|
|
@@ -125,6 +125,24 @@ export function create5(component) {
|
|
|
125
125
|
listArray[0] ? (h("div", { class: "section-2" },
|
|
126
126
|
h("kup-list", Object.assign({ id: "list1" }, listArray[0])))) : null)));
|
|
127
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* 6th dialog card layout, a datatable or a spinner in its place.
|
|
130
|
+
* @param {KupCard} component - Card component.
|
|
131
|
+
* @returns {VNode} 1st standard layout virtual node.
|
|
132
|
+
*/
|
|
133
|
+
export function create6(component) {
|
|
134
|
+
//Datatable
|
|
135
|
+
const datatableArray = component.data['datatable']
|
|
136
|
+
? component.data['datatable']
|
|
137
|
+
: [];
|
|
138
|
+
//Dialog title
|
|
139
|
+
const textArray = component.data['text']
|
|
140
|
+
? component.data['text']
|
|
141
|
+
: [];
|
|
142
|
+
return (h("div", { class: `dialog-layout-${component.layoutNumber}` },
|
|
143
|
+
textArray[0] ? dialogHeader(textArray[0]) : dialogHeader(''),
|
|
144
|
+
h("div", { class: "section-1" }, datatableArray.length > 0 ? (h("kup-data-table", Object.assign({ id: "datatable1" }, datatableArray[0]))) : (h("kup-spinner", { active: true, dimensions: "7px", layout: 14 })))));
|
|
145
|
+
}
|
|
128
146
|
/**
|
|
129
147
|
* Invoked by 4th layout to switch to the previous record of the original data table.
|
|
130
148
|
* Reminder: data table inside 4th layout should be transposed and valid columns should be named with numbers (strings, but numerical).
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { compList } from '../kup-card-helper';
|
|
3
|
+
const dom = document.documentElement;
|
|
4
|
+
/**
|
|
5
|
+
* 1st free card layout, only slots.
|
|
6
|
+
* @param {KupCard} component - Card component.
|
|
7
|
+
* @returns {VNode} 1st standard layout virtual node.
|
|
8
|
+
*/
|
|
9
|
+
export function create1(component) {
|
|
10
|
+
//Slot list
|
|
11
|
+
const slots = Array.prototype.slice.call(component.rootElement.children, 0);
|
|
12
|
+
return (h("div", { class: `free-layout-${component.layoutNumber}` }, slots.length > 0 ? compList(slots, 'slot') : null));
|
|
13
|
+
}
|
|
@@ -13,17 +13,35 @@ export var KupCardProps;
|
|
|
13
13
|
KupCardProps["sizeX"] = "The width of the card, defaults to 100%. Accepts any valid CSS format (px, %, vw, etc.).";
|
|
14
14
|
KupCardProps["sizeY"] = "The height of the card, defaults to 100%. Accepts any valid CSS format (px, %, vh, etc.).";
|
|
15
15
|
})(KupCardProps || (KupCardProps = {}));
|
|
16
|
+
/**
|
|
17
|
+
* Element ids for kup-card clock builtin.
|
|
18
|
+
*/
|
|
19
|
+
export var KupCardBuiltinClockElements;
|
|
20
|
+
(function (KupCardBuiltinClockElements) {
|
|
21
|
+
KupCardBuiltinClockElements["CLOCK"] = "clockEl";
|
|
22
|
+
KupCardBuiltinClockElements["HOURS"] = "hoursEl";
|
|
23
|
+
KupCardBuiltinClockElements["MINUTES"] = "minutesEl";
|
|
24
|
+
KupCardBuiltinClockElements["SECONDS"] = "secondsEl";
|
|
25
|
+
KupCardBuiltinClockElements["HOURSCIRCLE"] = "hoursCircleEl";
|
|
26
|
+
KupCardBuiltinClockElements["MINUTESCIRCLE"] = "minutesCircleEl";
|
|
27
|
+
KupCardBuiltinClockElements["SECONDSCIRCLE"] = "secondsCircleEl";
|
|
28
|
+
})(KupCardBuiltinClockElements || (KupCardBuiltinClockElements = {}));
|
|
16
29
|
/**
|
|
17
30
|
* Layout families of the kup-card component.
|
|
18
31
|
* @enum {string}
|
|
32
|
+
* @property {string} BUILTIN - Cards belonging to this family will created automatically by library.
|
|
19
33
|
* @property {string} COLLAPSIBLE - Cards belonging to this family will display an area usable to expand the content of the card.
|
|
34
|
+
* @property {string} DIALOG - Cards belonging to this family will be movable and usually closable.
|
|
35
|
+
* @property {string} FREE - This family of card will only receive slots, usually already arranged from the outside style.
|
|
20
36
|
* @property {string} SCALABLE - Content will fit its container, resizing itself automatically.
|
|
21
37
|
* @property {string} STANDARD - Stndard layouts.
|
|
22
38
|
*/
|
|
23
39
|
export var KupCardFamily;
|
|
24
40
|
(function (KupCardFamily) {
|
|
41
|
+
KupCardFamily["BUILTIN"] = "builtin";
|
|
25
42
|
KupCardFamily["COLLAPSIBLE"] = "collapsible";
|
|
26
43
|
KupCardFamily["DIALOG"] = "dialog";
|
|
44
|
+
KupCardFamily["FREE"] = "free";
|
|
27
45
|
KupCardFamily["SCALABLE"] = "scalable";
|
|
28
46
|
KupCardFamily["STANDARD"] = "standard";
|
|
29
47
|
})(KupCardFamily || (KupCardFamily = {}));
|
|
@@ -47,6 +65,7 @@ export var KupCardIds;
|
|
|
47
65
|
*/
|
|
48
66
|
export var KupCardCSSClasses;
|
|
49
67
|
(function (KupCardCSSClasses) {
|
|
68
|
+
KupCardCSSClasses["BUILTIN_CARD"] = "builtin-card";
|
|
50
69
|
KupCardCSSClasses["CARD_VIEW"] = "card-view";
|
|
51
70
|
KupCardCSSClasses["CLICKABLE_LINK"] = "clickable-link";
|
|
52
71
|
KupCardCSSClasses["COLLAPSIBLE_ACTIVE"] = "collapsible-active";
|
|
@@ -2,6 +2,7 @@ import { h } from '@stencil/core';
|
|
|
2
2
|
import { FImage } from '../../f-components/f-image/f-image';
|
|
3
3
|
import { KupCardCSSClasses, KupCardIds, KupCardSubEvents, } from './kup-card-declarations';
|
|
4
4
|
import { KupColumnMenuIds } from '../../utils/kup-column-menu/kup-column-menu-declarations';
|
|
5
|
+
import { KupThemeColorValues } from '../../utils/kup-theme/kup-theme-declarations';
|
|
5
6
|
/**
|
|
6
7
|
* This function returns a list of components.
|
|
7
8
|
* @param {GenericObject[]} compArray - Components' props.
|
|
@@ -57,7 +58,7 @@ export function compList(compArray, compType) {
|
|
|
57
58
|
export function dialogHeader(title) {
|
|
58
59
|
return (h("div", { id: KupCardIds.DRAG_HANDLE, class: KupCardCSSClasses.HEADER_BAR },
|
|
59
60
|
title ? (h("div", { class: KupCardCSSClasses.DIALOG_TITLE }, title)) : null,
|
|
60
|
-
h(FImage, { sizeX: "1.25em", sizeY: "
|
|
61
|
+
h(FImage, { color: `var(${KupThemeColorValues.TITLE})`, sizeX: "1.25em", sizeY: "100%", resource: "clear", id: KupCardIds.DIALOG_CLOSE })));
|
|
61
62
|
}
|
|
62
63
|
/**
|
|
63
64
|
* Creates the bar used to expand/collapse the card.
|
|
@@ -180,4 +181,21 @@ export function layoutSpecificEvents(component, e) {
|
|
|
180
181
|
e.detail.id === KupCardIds.PREVIOUS_ROW)) {
|
|
181
182
|
component.refresh();
|
|
182
183
|
}
|
|
184
|
+
/*-------------------------------------------------*/
|
|
185
|
+
/* 1 5t h S t a n d a r d L a y o u t */
|
|
186
|
+
/*-------------------------------------------------*/
|
|
187
|
+
// Tab change: when a tab is clicked, the corresponding view will be activated while the others will become hidden.
|
|
188
|
+
if (root &&
|
|
189
|
+
e.type === KupCardSubEvents.BUTTON_CLICK &&
|
|
190
|
+
e.detail.id === KupCardIds.VIEW_SELECTOR) {
|
|
191
|
+
const views = root.querySelectorAll('.' + KupCardCSSClasses.CARD_VIEW);
|
|
192
|
+
if (e.detail.value === 'on') {
|
|
193
|
+
views[0].classList.remove(KupCardCSSClasses.VISIBLE);
|
|
194
|
+
views[1].classList.add(KupCardCSSClasses.VISIBLE);
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
views[1].classList.remove(KupCardCSSClasses.VISIBLE);
|
|
198
|
+
views[0].classList.add(KupCardCSSClasses.VISIBLE);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
183
201
|
}
|