@siemens/ix 1.2.1 → 1.3.0-beta.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/dist/cjs/alignment-24ae2e63.js +1372 -0
- package/dist/cjs/{index-354a8c3d.js → index-17eb8998.js} +4 -3
- package/dist/cjs/index.cjs.js +5 -2
- package/dist/cjs/ix-animated-tab_2.cjs.entry.js +1 -1
- package/dist/cjs/ix-application-header.cjs.entry.js +1 -1
- package/dist/cjs/ix-basic-navigation.cjs.entry.js +1 -1
- package/dist/cjs/ix-blind.cjs.entry.js +1 -1
- package/dist/cjs/ix-breadcrumb_2.cjs.entry.js +1 -1
- package/dist/cjs/ix-button.cjs.entry.js +5 -3
- package/dist/cjs/ix-category-filter.cjs.entry.js +9 -9
- package/dist/cjs/ix-chip.cjs.entry.js +22 -9
- package/dist/cjs/ix-counter-pill.cjs.entry.js +2 -2
- package/dist/cjs/ix-date-picker_2.cjs.entry.js +1 -1
- package/dist/cjs/ix-date-time-card.cjs.entry.js +1 -1
- package/dist/cjs/ix-datetime-picker.cjs.entry.js +1 -1
- package/dist/cjs/ix-drawer.cjs.entry.js +1 -1
- package/dist/cjs/ix-dropdown-button.cjs.entry.js +40 -0
- package/dist/cjs/ix-dropdown_2.cjs.entry.js +88 -42
- package/dist/cjs/ix-event-list_2.cjs.entry.js +1 -1
- package/dist/cjs/ix-expanding-search.cjs.entry.js +3 -3
- package/dist/cjs/ix-filter-chip.cjs.entry.js +1 -1
- package/dist/cjs/ix-flip-tile_2.cjs.entry.js +1 -1
- package/dist/cjs/ix-group-context-menu.cjs.entry.js +1 -1
- package/dist/cjs/ix-group_3.cjs.entry.js +1 -1
- package/dist/cjs/ix-icon-button.cjs.entry.js +3 -3
- package/dist/cjs/ix-icon.cjs.entry.js +1 -1
- package/dist/cjs/ix-input-group.cjs.entry.js +1 -1
- package/dist/cjs/ix-kpi.cjs.entry.js +1 -1
- package/dist/cjs/ix-map-navigation_2.cjs.entry.js +5 -4
- package/dist/cjs/ix-menu_9.cjs.entry.js +14 -95
- package/dist/cjs/ix-message-bar.cjs.entry.js +1 -1
- package/dist/cjs/ix-modal-example.cjs.entry.js +1 -1
- package/dist/cjs/ix-modal_2.cjs.entry.js +2 -2
- package/dist/cjs/ix-pill.cjs.entry.js +6 -3
- package/dist/cjs/ix-select_2.cjs.entry.js +36 -15
- package/dist/cjs/ix-spinner.cjs.entry.js +1 -1
- package/dist/cjs/ix-split-button_2.cjs.entry.js +7 -36
- package/dist/cjs/ix-tab-item.cjs.entry.js +1 -1
- package/dist/cjs/ix-tabs.cjs.entry.js +1 -1
- package/dist/cjs/ix-tile.cjs.entry.js +1 -1
- package/dist/cjs/ix-toast_2.cjs.entry.js +1 -1
- package/dist/cjs/ix-toggle.cjs.entry.js +1 -1
- package/dist/cjs/ix-tree_2.cjs.entry.js +1 -1
- package/dist/cjs/ix-upload.cjs.entry.js +1 -1
- package/dist/cjs/ix-validation-tooltip.cjs.entry.js +72 -27
- package/dist/cjs/ix-workflow-step_2.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{modal-a5b22d3f.js → modal-dda2f6be.js} +9 -3
- package/dist/cjs/my-component.cjs.entry.js +1 -1
- package/dist/cjs/siemens-ix.cjs.js +2 -2
- package/dist/cjs/theme-switcher-6b45e082.js +92 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/button/button.css +1 -1
- package/dist/collection/components/button/button.js +4 -2
- package/dist/collection/components/category-filter/category-filter.css +4 -4
- package/dist/collection/components/category-filter/category-filter.js +7 -7
- package/dist/collection/components/chip/chip.css +20 -0
- package/dist/collection/components/chip/chip.js +22 -9
- package/dist/collection/components/counter-pill/counter-pill.css +10 -0
- package/dist/collection/components/dropdown/alignment.js +9 -0
- package/dist/collection/components/dropdown/dropdown.css +1 -0
- package/dist/collection/components/dropdown/dropdown.js +113 -50
- package/dist/collection/components/dropdown/placement.js +1 -0
- package/dist/collection/components/dropdown-button/dropdown-button.css +81 -0
- package/dist/collection/components/dropdown-button/dropdown-button.js +191 -0
- package/dist/collection/components/expanding-search/expanding-search.css +1 -0
- package/dist/collection/components/expanding-search/expanding-search.js +1 -1
- package/dist/collection/components/icon-button/icon-button.css +3 -30
- package/dist/collection/components/icon-button/icon-button.js +2 -2
- package/dist/collection/components/map-navigation/map-navigation.js +3 -2
- package/dist/collection/components/map-navigation-overlay/map-navigation-overlay.css +9 -4
- package/dist/collection/components/menu/menu.css +1 -1
- package/dist/collection/components/menu/menu.js +6 -21
- package/dist/collection/components/menu-avatar/menu-avatar.js +4 -30
- package/dist/collection/components/modal/modal.css +1 -0
- package/dist/collection/components/modal/modal.js +7 -1
- package/dist/collection/components/pill/pill.css +10 -0
- package/dist/collection/components/pill/pill.js +4 -1
- package/dist/collection/components/select/select.css +0 -3
- package/dist/collection/components/select/select.js +13 -12
- package/dist/collection/components/select-item/events.js +16 -0
- package/dist/collection/components/select-item/select-item.js +23 -4
- package/dist/collection/components/split-button/split-button.js +7 -36
- package/dist/collection/components/tree/tree.js +1 -1
- package/dist/collection/components/utils/theme-switcher.js +86 -0
- package/dist/collection/components/validation-tooltip/validation-tooltip.css +4 -24
- package/dist/collection/components/validation-tooltip/validation-tooltip.js +75 -28
- package/dist/collection/exports.js +1 -0
- package/dist/components/alignment.js +1363 -0
- package/dist/components/button.js +5 -3
- package/dist/components/dropdown.js +88 -41
- package/dist/components/icon-button.js +3 -3
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +2 -1
- package/dist/components/ix-category-filter.js +18 -12
- package/dist/components/ix-chip.js +21 -8
- package/dist/components/ix-counter-pill.js +1 -1
- package/dist/components/ix-dropdown-button.d.ts +11 -0
- package/dist/components/ix-dropdown-button.js +86 -0
- package/dist/components/ix-expanding-search.js +2 -2
- package/dist/components/ix-map-navigation.js +3 -2
- package/dist/components/ix-menu-avatar.js +6 -19
- package/dist/components/ix-menu.js +93 -46
- package/dist/components/ix-pill.js +5 -2
- package/dist/components/ix-select.js +9 -14
- package/dist/components/ix-split-button.js +6 -35
- package/dist/components/ix-validation-tooltip.js +74 -27
- package/dist/components/map-navigation-overlay.js +1 -1
- package/dist/components/modal.js +8 -2
- package/dist/components/select-item.js +27 -1
- package/dist/esm/alignment-f63c1b89.js +1363 -0
- package/dist/esm/{index-7746a810.js → index-6f4f3582.js} +5 -3
- package/dist/esm/index.js +3 -2
- package/dist/esm/ix-animated-tab_2.entry.js +1 -1
- package/dist/esm/ix-application-header.entry.js +1 -1
- package/dist/esm/ix-basic-navigation.entry.js +1 -1
- package/dist/esm/ix-blind.entry.js +1 -1
- package/dist/esm/ix-breadcrumb_2.entry.js +1 -1
- package/dist/esm/ix-button.entry.js +5 -3
- package/dist/esm/ix-category-filter.entry.js +9 -9
- package/dist/esm/ix-chip.entry.js +22 -9
- package/dist/esm/ix-counter-pill.entry.js +2 -2
- package/dist/esm/ix-date-picker_2.entry.js +1 -1
- package/dist/esm/ix-date-time-card.entry.js +1 -1
- package/dist/esm/ix-datetime-picker.entry.js +1 -1
- package/dist/esm/ix-drawer.entry.js +1 -1
- package/dist/esm/ix-dropdown-button.entry.js +36 -0
- package/dist/esm/ix-dropdown_2.entry.js +88 -42
- package/dist/esm/ix-event-list_2.entry.js +1 -1
- package/dist/esm/ix-expanding-search.entry.js +3 -3
- package/dist/esm/ix-filter-chip.entry.js +1 -1
- package/dist/esm/ix-flip-tile_2.entry.js +1 -1
- package/dist/esm/ix-group-context-menu.entry.js +1 -1
- package/dist/esm/ix-group_3.entry.js +1 -1
- package/dist/esm/ix-icon-button.entry.js +3 -3
- package/dist/esm/ix-icon.entry.js +1 -1
- package/dist/esm/ix-input-group.entry.js +1 -1
- package/dist/esm/ix-kpi.entry.js +1 -1
- package/dist/esm/ix-map-navigation_2.entry.js +5 -4
- package/dist/esm/ix-menu_9.entry.js +14 -95
- package/dist/esm/ix-message-bar.entry.js +1 -1
- package/dist/esm/ix-modal-example.entry.js +1 -1
- package/dist/esm/ix-modal_2.entry.js +2 -2
- package/dist/esm/ix-pill.entry.js +6 -3
- package/dist/esm/ix-select_2.entry.js +36 -15
- package/dist/esm/ix-spinner.entry.js +1 -1
- package/dist/esm/ix-split-button_2.entry.js +7 -36
- package/dist/esm/ix-tab-item.entry.js +1 -1
- package/dist/esm/ix-tabs.entry.js +1 -1
- package/dist/esm/ix-tile.entry.js +1 -1
- package/dist/esm/ix-toast_2.entry.js +1 -1
- package/dist/esm/ix-toggle.entry.js +1 -1
- package/dist/esm/ix-tree_2.entry.js +1 -1
- package/dist/esm/ix-upload.entry.js +1 -1
- package/dist/esm/ix-validation-tooltip.entry.js +72 -27
- package/dist/esm/ix-workflow-step_2.entry.js +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{modal-9c9eaf8e.js → modal-df0a62f2.js} +9 -3
- package/dist/esm/my-component.entry.js +1 -1
- package/dist/esm/siemens-ix.js +2 -2
- package/dist/esm/theme-switcher-dce1aaec.js +89 -0
- package/dist/siemens-ix/index.esm.js +1 -1
- package/dist/siemens-ix/p-03d38416.entry.js +1 -0
- package/dist/siemens-ix/{p-5e4c3828.js → p-05c16b94.js} +2 -2
- package/dist/siemens-ix/p-0e357d27.entry.js +1 -0
- package/dist/siemens-ix/{p-963c5690.entry.js → p-150d7a02.entry.js} +1 -1
- package/dist/siemens-ix/p-18d02e6f.entry.js +1 -0
- package/dist/siemens-ix/{p-b2ecf415.entry.js → p-23d79e3d.entry.js} +1 -1
- package/dist/siemens-ix/{p-91eb1fdd.entry.js → p-2bc72119.entry.js} +1 -1
- package/dist/siemens-ix/p-2bd88760.entry.js +1 -0
- package/dist/siemens-ix/p-2c5abec1.js +1 -0
- package/dist/siemens-ix/{p-dfb5730f.entry.js → p-2e24ae23.entry.js} +1 -1
- package/dist/siemens-ix/{p-4d61503b.entry.js → p-33283dbf.entry.js} +1 -1
- package/dist/siemens-ix/p-35990ac7.js +1 -0
- package/dist/siemens-ix/{p-6e915c70.entry.js → p-3663f989.entry.js} +1 -1
- package/dist/siemens-ix/{p-2f3294b8.entry.js → p-418e2d14.entry.js} +1 -1
- package/dist/siemens-ix/p-43616759.entry.js +1 -0
- package/dist/siemens-ix/{p-03687070.entry.js → p-4b170382.entry.js} +1 -1
- package/dist/siemens-ix/p-4fcb5f2b.entry.js +1 -0
- package/dist/siemens-ix/p-5631ae88.entry.js +1 -0
- package/dist/siemens-ix/{p-5871e480.entry.js → p-5661957c.entry.js} +1 -1
- package/dist/siemens-ix/{p-56771b32.entry.js → p-592f1ed3.entry.js} +1 -1
- package/dist/siemens-ix/p-5bbe9943.entry.js +1 -0
- package/dist/siemens-ix/{p-05f3c48e.entry.js → p-65e61684.entry.js} +1 -1
- package/dist/siemens-ix/p-6fe3bb9c.entry.js +1 -0
- package/dist/siemens-ix/{p-5e3700c3.entry.js → p-72f851ae.entry.js} +1 -1
- package/dist/siemens-ix/{p-e5397173.entry.js → p-7f842cdc.entry.js} +1 -1
- package/dist/siemens-ix/{p-412dbb89.entry.js → p-8a7141a6.entry.js} +1 -1
- package/dist/siemens-ix/{p-10879145.entry.js → p-8b4e4718.entry.js} +1 -1
- package/dist/siemens-ix/{p-ded3a35d.entry.js → p-9b5290d4.entry.js} +1 -1
- package/dist/siemens-ix/{p-c885685e.entry.js → p-a5fa7ae5.entry.js} +1 -1
- package/dist/siemens-ix/{p-61cb7ab7.entry.js → p-a88618e3.entry.js} +1 -1
- package/dist/siemens-ix/p-ab7949ff.entry.js +1 -0
- package/dist/siemens-ix/{p-23578bb6.entry.js → p-b242bd39.entry.js} +1 -1
- package/dist/siemens-ix/p-b3d00feb.entry.js +1 -0
- package/dist/siemens-ix/p-be641020.entry.js +1 -0
- package/dist/siemens-ix/{p-19cc942a.entry.js → p-c3e90c06.entry.js} +1 -1
- package/dist/siemens-ix/{p-558623ce.entry.js → p-c993560f.entry.js} +1 -1
- package/dist/siemens-ix/{p-35d7f18d.entry.js → p-cc0f6f6b.entry.js} +1 -1
- package/dist/siemens-ix/{p-f24f1eb7.entry.js → p-d0bb8225.entry.js} +1 -1
- package/dist/siemens-ix/p-d20119c1.entry.js +1 -0
- package/dist/siemens-ix/p-dec6114f.js +1 -0
- package/dist/siemens-ix/{p-91ecd6ac.entry.js → p-e2925222.entry.js} +1 -1
- package/dist/siemens-ix/{p-1ba8c910.entry.js → p-e7621b0a.entry.js} +1 -1
- package/dist/siemens-ix/{p-494512c0.entry.js → p-ea333007.entry.js} +1 -1
- package/dist/siemens-ix/{p-8f6809f1.entry.js → p-eb150313.entry.js} +1 -1
- package/dist/siemens-ix/{p-b0c95c22.entry.js → p-eed28e55.entry.js} +1 -1
- package/dist/siemens-ix/p-f35ce089.entry.js +1 -0
- package/dist/siemens-ix/{p-2995294d.entry.js → p-f7be9635.entry.js} +1 -1
- package/dist/siemens-ix/{p-712e8945.entry.js → p-fecf0ade.entry.js} +1 -1
- package/dist/siemens-ix/siemens-ix.css +25 -3
- package/dist/siemens-ix/siemens-ix.esm.js +1 -1
- package/dist/types/components/category-filter/category-filter.d.ts +1 -0
- package/dist/types/components/chip/chip.d.ts +2 -1
- package/dist/types/components/dropdown/alignment.d.ts +2 -0
- package/dist/types/components/dropdown/dropdown.d.ts +19 -6
- package/dist/types/components/dropdown/placement.d.ts +8 -0
- package/dist/types/components/dropdown-button/dropdown-button.d.ts +37 -0
- package/dist/types/components/menu/menu.d.ts +0 -2
- package/dist/types/components/menu-avatar/menu-avatar.d.ts +1 -5
- package/dist/types/components/modal/modal.d.ts +1 -0
- package/dist/types/components/select/select.d.ts +2 -1
- package/dist/types/components/select-item/events.d.ts +9 -0
- package/dist/types/components/select-item/select-item.d.ts +3 -2
- package/dist/types/components/split-button/split-button.d.ts +4 -6
- package/dist/types/components/tree/tree.d.ts +1 -1
- package/dist/types/components/utils/theme-switcher.d.ts +19 -0
- package/dist/types/components/validation-tooltip/validation-tooltip.d.ts +12 -4
- package/dist/types/components.d.ts +86 -15
- package/dist/types/exports.d.ts +1 -0
- package/package.json +5 -6
- package/scss/components/_buttons.scss +23 -0
- package/scss/components/_dropdown.scss +2 -0
- package/dist/cjs/popper-d7a0f999.js +0 -1801
- package/dist/collection/components/utils/popover.util.js +0 -33
- package/dist/collection/components/utils/toggle-theme.js +0 -24
- package/dist/components/popover.util.js +0 -36
- package/dist/components/popper.js +0 -1799
- package/dist/esm/popper-42db9fbd.js +0 -1799
- package/dist/siemens-ix/p-080c00b1.entry.js +0 -1
- package/dist/siemens-ix/p-263949b1.js +0 -1
- package/dist/siemens-ix/p-2709fafd.entry.js +0 -1
- package/dist/siemens-ix/p-2b69b027.entry.js +0 -1
- package/dist/siemens-ix/p-6da1e24d.entry.js +0 -1
- package/dist/siemens-ix/p-7b103473.entry.js +0 -1
- package/dist/siemens-ix/p-80d27c08.entry.js +0 -1
- package/dist/siemens-ix/p-842a7652.entry.js +0 -1
- package/dist/siemens-ix/p-9a98369e.entry.js +0 -1
- package/dist/siemens-ix/p-af8213cc.entry.js +0 -1
- package/dist/siemens-ix/p-aff5f463.entry.js +0 -1
- package/dist/siemens-ix/p-bf387a1f.entry.js +0 -1
- package/dist/siemens-ix/p-f3996fc1.entry.js +0 -1
- package/dist/siemens-ix/p-f86fcdf4.js +0 -1
- package/dist/siemens-ix/p-fe28a2be.entry.js +0 -1
- package/dist/types/components/utils/popover.util.d.ts +0 -9
- package/dist/types/components/utils/toggle-theme.d.ts +0 -1
- package/src/components/animated-tab/readme.md +0 -24
- package/src/components/animated-tabs/readme.md +0 -31
- package/src/components/application-header/readme.md +0 -21
- package/src/components/basic-navigation/readme.md +0 -22
- package/src/components/blind/readme.md +0 -29
- package/src/components/breadcrumb/readme.md +0 -33
- package/src/components/breadcrumb-item/readme.md +0 -22
- package/src/components/button/readme.md +0 -27
- package/src/components/category-filter/readme.md +0 -39
- package/src/components/chip/readme.md +0 -36
- package/src/components/counter-pill/readme.md +0 -25
- package/src/components/date-picker/readme.md +0 -53
- package/src/components/date-time-card/readme.md +0 -22
- package/src/components/datetime-picker/readme.md +0 -45
- package/src/components/drawer/readme.md +0 -47
- package/src/components/dropdown/readme.md +0 -49
- package/src/components/dropdown-item/readme.md +0 -45
- package/src/components/event-list/readme.md +0 -24
- package/src/components/event-list-item/readme.md +0 -32
- package/src/components/expanding-search/readme.md +0 -32
- package/src/components/filter-chip/readme.md +0 -30
- package/src/components/flip-tile/readme.md +0 -22
- package/src/components/flip-tile-content/readme.md +0 -14
- package/src/components/group/readme.md +0 -14
- package/src/components/group-dropdown-item/readme.md +0 -22
- package/src/components/group-item/readme.md +0 -34
- package/src/components/icon/readme.md +0 -23
- package/src/components/icon-button/readme.md +0 -31
- package/src/components/input-group/readme.md +0 -14
- package/src/components/kpi/readme.md +0 -27
- package/src/components/map-navigation/readme.md +0 -54
- package/src/components/map-navigation-overlay/readme.md +0 -30
- package/src/components/menu/readme.md +0 -86
- package/src/components/menu-about/readme.md +0 -30
- package/src/components/menu-about-item/readme.md +0 -21
- package/src/components/menu-about-news/readme.md +0 -34
- package/src/components/menu-avatar/readme.md +0 -30
- package/src/components/menu-avatar-item/readme.md +0 -29
- package/src/components/menu-item/readme.md +0 -26
- package/src/components/menu-settings/readme.md +0 -30
- package/src/components/menu-settings-item/readme.md +0 -21
- package/src/components/message-bar/readme.md +0 -31
- package/src/components/modal/readme.md +0 -67
- package/src/components/modal-container/readme.md +0 -29
- package/src/components/my-component/readme.md +0 -16
- package/src/components/pill/readme.md +0 -26
- package/src/components/select/readme.md +0 -37
- package/src/components/select-item/readme.md +0 -44
- package/src/components/spinner/readme.md +0 -22
- package/src/components/split-button/readme.md +0 -36
- package/src/components/split-button-item/readme.md +0 -29
- package/src/components/tab-item/readme.md +0 -28
- package/src/components/tabs/readme.md +0 -25
- package/src/components/tile/readme.md +0 -21
- package/src/components/time-picker/readme.md +0 -51
- package/src/components/toast/readme.md +0 -36
- package/src/components/toggle/readme.md +0 -35
- package/src/components/tree/readme.md +0 -32
- package/src/components/tree-item/readme.md +0 -31
- package/src/components/upload/readme.md +0 -51
- package/src/components/validation-tooltip/readme.md +0 -31
- package/src/components/workflow-step/readme.md +0 -28
- package/src/components/workflow-steps/readme.md +0 -33
|
@@ -6,37 +6,10 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* SPDX-License-Identifier: MIT
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the MIT license found in the
|
|
15
|
-
* LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/
|
|
17
|
-
/* Dimensions */
|
|
18
|
-
/* Font sizes */
|
|
19
|
-
/* Line heights */
|
|
20
|
-
/* Animation timings */
|
|
9
|
+
:host.disabled {
|
|
10
|
+
pointer-events: none;
|
|
11
|
+
}
|
|
21
12
|
:host .icon-button {
|
|
22
13
|
padding: 0;
|
|
23
14
|
overflow: hidden;
|
|
24
|
-
}
|
|
25
|
-
:host .btn-icon-12 {
|
|
26
|
-
height: 1rem;
|
|
27
|
-
width: 1rem;
|
|
28
|
-
min-width: 1rem;
|
|
29
|
-
min-height: 1rem;
|
|
30
|
-
}
|
|
31
|
-
:host .btn-icon-16 {
|
|
32
|
-
height: 1.5rem;
|
|
33
|
-
width: 1.5rem;
|
|
34
|
-
min-width: 1.5rem;
|
|
35
|
-
min-height: 1.5rem;
|
|
36
|
-
}
|
|
37
|
-
:host .btn-icon-32 {
|
|
38
|
-
height: 2rem;
|
|
39
|
-
width: 2rem;
|
|
40
|
-
min-width: 2rem;
|
|
41
|
-
min-height: 2rem;
|
|
42
15
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
import { h } from '@stencil/core';
|
|
9
|
+
import { h, Host } from '@stencil/core';
|
|
10
10
|
import { getButtonClasses } from '../button/base-button';
|
|
11
11
|
export class IconButton {
|
|
12
12
|
constructor() {
|
|
@@ -26,7 +26,7 @@ export class IconButton {
|
|
|
26
26
|
return Object.assign(Object.assign({}, getButtonClasses(this.variant, this.outline, this.ghost || this.invisible, true, this.oval, this.selected, this.disabled)), { 'icon-button': true, 'btn-icon-12': this.size === '12', 'btn-icon-16': this.size === '16', 'btn-icon-32': this.size === '32' || this.size === '24' || !this.size });
|
|
27
27
|
}
|
|
28
28
|
render() {
|
|
29
|
-
return (h("button", { class: this.getIconButtonClasses(), type: this.type }, h("ix-icon", { size: this.size, name: this.icon, color: this.color }), h("div", { style: { display: 'none' } }, h("slot", null))));
|
|
29
|
+
return (h(Host, { class: { disabled: this.disabled } }, h("button", { class: this.getIconButtonClasses(), type: this.type }, h("ix-icon", { size: this.size, name: this.icon, color: this.color }), h("div", { style: { display: 'none' } }, h("slot", null)))));
|
|
30
30
|
}
|
|
31
31
|
static get is() { return "ix-icon-button"; }
|
|
32
32
|
static get encapsulation() { return "scoped"; }
|
|
@@ -107,9 +107,10 @@ export class MapNavigation {
|
|
|
107
107
|
overlayInstance.setAttribute('color', color);
|
|
108
108
|
overlayInstance.setAttribute('name', name);
|
|
109
109
|
overlayInstance.setAttribute('icon', icon);
|
|
110
|
+
overlayInstance.setAttribute('slot', 'overlay');
|
|
110
111
|
overlayInstance.addEventListener('closeClick', () => this.closeOverlay());
|
|
111
112
|
overlayInstance.appendChild(component);
|
|
112
|
-
this.
|
|
113
|
+
this.hostElement.appendChild(overlayInstance);
|
|
113
114
|
}
|
|
114
115
|
/**
|
|
115
116
|
* Close current shown overlay
|
|
@@ -134,7 +135,7 @@ export class MapNavigation {
|
|
|
134
135
|
});
|
|
135
136
|
}
|
|
136
137
|
render() {
|
|
137
|
-
return (h(Host, null, h("div", { id: "menu-placeholder" }), h("div", { class: "map-nav" }, h("div", { class: "map-nav-sidebar" }, h("div", { class: "map-nav-header" }, h("ix-application-header", { name: this.applicationName, class: "map-nav-header-brand" }, h("slot", { name: "logo" }))), h("div", { class: "map-nav-sidebar-content" }, h("div", { class: "map-nav-sidebar-static-content" }, h("div", { class: "map-nav-title" }, this.navigationTitle), this.hideContextMenu ? ('') : (h("ix-icon-button", { icon: "context-menu", ghost: true, size: "24", variant: "Secondary", onClick: (_) => this.contextMenuClick.emit() }))), h("div", { class: "map-nav-sidebar-user-content" }, h("slot", { name: "sidebar-content" })))), h("div", { class: "content" }, h("div", { class: "map-nav-header-content bg-2" }, h("slot", { name: "content-header" })), h("main", null, h("slot", null))))));
|
|
138
|
+
return (h(Host, null, h("div", { id: "menu-placeholder" }), h("div", { class: "map-nav" }, h("div", { class: "map-nav-sidebar" }, h("div", { class: "map-nav-header" }, h("ix-application-header", { name: this.applicationName, class: "map-nav-header-brand" }, h("slot", { name: "logo" }))), h("div", { class: "map-nav-sidebar-content" }, h("div", { class: "map-nav-sidebar-static-content" }, h("div", { class: "map-nav-title" }, this.navigationTitle), this.hideContextMenu ? ('') : (h("ix-icon-button", { icon: "context-menu", ghost: true, size: "24", variant: "Secondary", onClick: (_) => this.contextMenuClick.emit() }))), h("div", { class: "map-nav-sidebar-user-content" }, h("slot", { name: "sidebar-content" })))), h("div", { class: "content" }, h("div", { class: "map-nav-header-content bg-2" }, h("slot", { name: "content-header" })), h("main", null, h("slot", null), h("slot", { name: "overlay" }))))));
|
|
138
139
|
}
|
|
139
140
|
static get is() { return "ix-map-navigation"; }
|
|
140
141
|
static get encapsulation() { return "scoped"; }
|
|
@@ -192,6 +192,7 @@ a {
|
|
|
192
192
|
height: 100%;
|
|
193
193
|
z-index: 2;
|
|
194
194
|
top: 0;
|
|
195
|
+
left: 0;
|
|
195
196
|
background-color: var(--theme-overlay--background);
|
|
196
197
|
}
|
|
197
198
|
:host .overlay-header {
|
|
@@ -208,7 +209,8 @@ a {
|
|
|
208
209
|
min-width: 0;
|
|
209
210
|
}
|
|
210
211
|
:host .overlay-header-content ix-icon {
|
|
211
|
-
margin-
|
|
212
|
+
-webkit-margin-start: 1rem;
|
|
213
|
+
margin-inline-start: 1rem;
|
|
212
214
|
color: var(--theme-overlay-header--color);
|
|
213
215
|
}
|
|
214
216
|
:host .overlay-header-content .overlay-header-title {
|
|
@@ -223,7 +225,8 @@ a {
|
|
|
223
225
|
text-overflow: ellipsis;
|
|
224
226
|
white-space: nowrap;
|
|
225
227
|
color: var(--theme-overlay-header--color);
|
|
226
|
-
margin-
|
|
228
|
+
-webkit-margin-start: 1rem;
|
|
229
|
+
margin-inline-start: 1rem;
|
|
227
230
|
}
|
|
228
231
|
:host .color-indicator {
|
|
229
232
|
display: inline-block;
|
|
@@ -233,6 +236,8 @@ a {
|
|
|
233
236
|
background-color: var(--theme-color-neutral);
|
|
234
237
|
}
|
|
235
238
|
:host .overlay-close {
|
|
236
|
-
margin-
|
|
237
|
-
|
|
239
|
+
-webkit-margin-start: auto;
|
|
240
|
+
margin-inline-start: auto;
|
|
241
|
+
-webkit-margin-end: 1rem;
|
|
242
|
+
margin-inline-end: 1rem;
|
|
238
243
|
}
|
|
@@ -94,7 +94,7 @@ ix-menu .menu-overlay {
|
|
|
94
94
|
-webkit-backdrop-filter: blur(1rem);
|
|
95
95
|
backdrop-filter: blur(1rem);
|
|
96
96
|
background-color: var(--theme-sidebar-overlay-blur);
|
|
97
|
-
transition: all
|
|
97
|
+
transition: all 300ms ease-out;
|
|
98
98
|
}
|
|
99
99
|
ix-menu .menu-overlay-invisible {
|
|
100
100
|
display: none;
|
|
@@ -7,9 +7,8 @@
|
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
import { h, Host, } from '@stencil/core';
|
|
10
|
-
import { Popover } from '../utils/popover.util';
|
|
11
10
|
import { convertToRemString } from '../utils/rwd.util';
|
|
12
|
-
import {
|
|
11
|
+
import { themeSwitcher } from '../utils/theme-switcher';
|
|
13
12
|
export class Menu {
|
|
14
13
|
constructor() {
|
|
15
14
|
this.domObserver = new MutationObserver(this.onDomChange.bind(this));
|
|
@@ -131,10 +130,6 @@ export class Menu {
|
|
|
131
130
|
}
|
|
132
131
|
componentDidLoad() {
|
|
133
132
|
var _a, _b, _c, _d;
|
|
134
|
-
const anchor = this.hostElement.querySelector('#more-tab');
|
|
135
|
-
this.popoverListener = new Popover(anchor, this.moreItemsDropdown, () => {
|
|
136
|
-
this.showMoreItems = false;
|
|
137
|
-
});
|
|
138
133
|
(_a = this.settings) === null || _a === void 0 ? void 0 : _a.addEventListener('close', () => {
|
|
139
134
|
this.showSettings = false;
|
|
140
135
|
this.settings.show = this.showSettings;
|
|
@@ -163,10 +158,7 @@ export class Menu {
|
|
|
163
158
|
subtree: true,
|
|
164
159
|
});
|
|
165
160
|
}
|
|
166
|
-
disconnectedCallback() {
|
|
167
|
-
var _a;
|
|
168
|
-
(_a = this.popoverListener) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
169
|
-
}
|
|
161
|
+
disconnectedCallback() { }
|
|
170
162
|
componentWillRender() {
|
|
171
163
|
this.appendTabs();
|
|
172
164
|
}
|
|
@@ -329,13 +321,6 @@ export class Menu {
|
|
|
329
321
|
}
|
|
330
322
|
return Math.min(visibleCount - 2, this.maxVisibleMenuItems);
|
|
331
323
|
}
|
|
332
|
-
toggleShowMoreDropdown() {
|
|
333
|
-
if (this.moreItemsDropdown.querySelectorAll('.appended').length === 0) {
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
this.popoverListener.open();
|
|
337
|
-
this.showMoreItems = !this.showMoreItems;
|
|
338
|
-
}
|
|
339
324
|
/**
|
|
340
325
|
* Toggle map sidebar expand
|
|
341
326
|
* @param show
|
|
@@ -451,7 +436,7 @@ export class Menu {
|
|
|
451
436
|
isMenuItemClicked(event) {
|
|
452
437
|
const path = event.composedPath();
|
|
453
438
|
const menuItems = path
|
|
454
|
-
.filter((element) => element.id !== 'more-tab')
|
|
439
|
+
.filter((element) => element.id !== 'ix-menu-more-tab')
|
|
455
440
|
.filter((element) => {
|
|
456
441
|
return element.tagName === 'IX-MENU-ITEM';
|
|
457
442
|
});
|
|
@@ -474,11 +459,11 @@ export class Menu {
|
|
|
474
459
|
if (this.isMenuItemClicked(event)) {
|
|
475
460
|
this.resetOverlay();
|
|
476
461
|
}
|
|
477
|
-
} }, h("div", { class: "tabs-top" }), h("slot", null), h("div", { class: "active-more-tab" }, this.activeTab ? (h("ix-menu-item", { class: "internal-tab", active: true, tabIcon: this.activeTab.tabIcon }, this.activeTab.innerText)) : null), h("ix-menu-item", { id: "more-tab", tabIcon: "more-menu", class: {
|
|
462
|
+
} }, h("div", { class: "tabs-top" }), h("slot", null), h("div", { class: "active-more-tab" }, this.activeTab ? (h("ix-menu-item", { class: "internal-tab", active: true, tabIcon: this.activeTab.tabIcon }, this.activeTab.innerText)) : null), h("ix-menu-item", { id: "ix-menu-more-tab", tabIcon: "more-menu", class: {
|
|
478
463
|
'internal-tab': true,
|
|
479
464
|
}, style: {
|
|
480
465
|
display: this.showMoreButton() ? 'block' : 'none',
|
|
481
|
-
}, title: "Show more", notifications: this.countMoreNotifications
|
|
466
|
+
}, title: "Show more", notifications: this.countMoreNotifications }, this.i18nMore, h("ix-dropdown", { trigger: 'ix-menu-more-tab', positioningStrategy: 'fixed', placement: 'right-start' }, this.menuItems
|
|
482
467
|
.filter((elm, index) => !this.showTab(index) &&
|
|
483
468
|
!this.isMenuItemActive(elm) &&
|
|
484
469
|
this.isVisible(elm))
|
|
@@ -492,7 +477,7 @@ export class Menu {
|
|
|
492
477
|
'internal-tab': true,
|
|
493
478
|
'bottom-tab': true,
|
|
494
479
|
active: this.showAbout,
|
|
495
|
-
}, tabIcon: "info", onClick: async () => this.toggleAbout(!this.showAbout) }, this.i18nLegal)) : null, this.enableToggleTheme ? (h("ix-menu-item", { id: "toggleTheme", onClick: () =>
|
|
480
|
+
}, tabIcon: "info", onClick: async () => this.toggleAbout(!this.showAbout) }, this.i18nLegal)) : null, this.enableToggleTheme ? (h("ix-menu-item", { id: "toggleTheme", onClick: () => themeSwitcher.toggleMode(), class: "internal-tab bottom-tab", tabIcon: "bulb" }, this.i18nToggleTheme)) : null, this.enableMapExpand ? (h("ix-menu-item", { id: "menu-collapse", onClick: () => this.mapExpandChange.emit(this.mapExpand), class: "internal-tab bottom-tab", tabIcon: `${this.getCollapseIcon()}` }, this.getCollapseText())) : null), h("div", { class: {
|
|
496
481
|
'menu-overlay': true,
|
|
497
482
|
expanded: this.expand,
|
|
498
483
|
'd-block': this.showAbout || this.showSettings,
|
|
@@ -7,29 +7,17 @@
|
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
import { h, Host, } from '@stencil/core';
|
|
10
|
-
import { Popover } from '../utils/popover.util';
|
|
11
10
|
export class MenuAvatar {
|
|
12
11
|
constructor() {
|
|
13
|
-
this.
|
|
12
|
+
this.avatarElementId = 'ix-menu-avatar-id';
|
|
14
13
|
this.top = undefined;
|
|
15
14
|
this.bottom = undefined;
|
|
16
15
|
this.i18nLogout = 'Logout';
|
|
17
16
|
}
|
|
18
|
-
toggleMenu() {
|
|
19
|
-
this.outsideListener.open();
|
|
20
|
-
this.displayMenu = !this.displayMenu;
|
|
21
|
-
}
|
|
22
|
-
componentDidLoad() {
|
|
23
|
-
this.outsideListener = new Popover(this.hostElement, this.hostElement.querySelector('ix-dropdown'), () => {
|
|
24
|
-
this.displayMenu = false;
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
disconnectedCallback() {
|
|
28
|
-
var _a;
|
|
29
|
-
(_a = this.outsideListener) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
30
|
-
}
|
|
31
17
|
render() {
|
|
32
|
-
return (h(Host, null, h("li", { class: "nav-item top-item avatar no-hover", title: this.top }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "32", height: "32", viewBox: "0 0 32 32" }, h("g", { fill: "none", "fill-rule": "evenodd" }, h("path", { id: "avatar-path-background", d: "M16 0C7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163\n 16-16c0-4.243-1.686-8.313-4.686-11.314C24.314 1.686 20.244 0 16 0z" }), h("path", { id: "avatar-path-person", d: "M17.897 17.91c3.8-.018 7.358 1.875 9.485 5.046-2.417 3.999-6.734 6.434-11.382\n 6.42-4.648.014-8.965-2.421-11.382-6.42 2.127-3.171 5.685-5.064\n 9.485-5.045h3.794zM15.821 2.129c3.682 0 6.667 2.984 6.667 6.666 0 3.682-2.985\n 6.667-6.667 6.667s-6.667-2.985-6.667-6.667 2.985-6.666 6.667-6.666z" }))), h("div", { class: "avatar-name" }, h("span", { class: "text-default-single", title: this.top }, this.top), h("span", { class: "text-default-single", title: this.bottom }, this.bottom))), h("ix-dropdown", {
|
|
18
|
+
return (h(Host, null, h("li", { class: "nav-item top-item avatar no-hover", title: this.top, id: this.avatarElementId }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "32", height: "32", viewBox: "0 0 32 32" }, h("g", { fill: "none", "fill-rule": "evenodd" }, h("path", { id: "avatar-path-background", d: "M16 0C7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163\n 16-16c0-4.243-1.686-8.313-4.686-11.314C24.314 1.686 20.244 0 16 0z" }), h("path", { id: "avatar-path-person", d: "M17.897 17.91c3.8-.018 7.358 1.875 9.485 5.046-2.417 3.999-6.734 6.434-11.382\n 6.42-4.648.014-8.965-2.421-11.382-6.42 2.127-3.171 5.685-5.064\n 9.485-5.045h3.794zM15.821 2.129c3.682 0 6.667 2.984 6.667 6.666 0 3.682-2.985\n 6.667-6.667 6.667s-6.667-2.985-6.667-6.667 2.985-6.666 6.667-6.666z" }))), h("div", { class: "avatar-name" }, h("span", { class: "text-default-single", title: this.top }, this.top), h("span", { class: "text-default-single", title: this.bottom }, this.bottom))), h("ix-dropdown", { trigger: this.avatarElementId, placement: 'right-start', offset: {
|
|
19
|
+
mainAxis: 12,
|
|
20
|
+
} }, h("slot", null), h("ix-menu-avatar-item", { label: this.i18nLogout, icon: "log-out", onClick: (e) => {
|
|
33
21
|
this.logoutClick.emit(e);
|
|
34
22
|
} }))));
|
|
35
23
|
}
|
|
@@ -101,11 +89,6 @@ export class MenuAvatar {
|
|
|
101
89
|
}
|
|
102
90
|
};
|
|
103
91
|
}
|
|
104
|
-
static get states() {
|
|
105
|
-
return {
|
|
106
|
-
"displayMenu": {}
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
92
|
static get events() {
|
|
110
93
|
return [{
|
|
111
94
|
"method": "logoutClick",
|
|
@@ -125,13 +108,4 @@ export class MenuAvatar {
|
|
|
125
108
|
}];
|
|
126
109
|
}
|
|
127
110
|
static get elementRef() { return "hostElement"; }
|
|
128
|
-
static get listeners() {
|
|
129
|
-
return [{
|
|
130
|
-
"name": "click",
|
|
131
|
-
"method": "toggleMenu",
|
|
132
|
-
"target": undefined,
|
|
133
|
-
"capture": false,
|
|
134
|
-
"passive": true
|
|
135
|
-
}];
|
|
136
|
-
}
|
|
137
111
|
}
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
background-color: var(--theme-modal--background);
|
|
56
56
|
border: var(--modal--border-thickness) solid var(--theme-modal--border-color);
|
|
57
57
|
padding: 1.5rem;
|
|
58
|
+
max-height: 100vh;
|
|
58
59
|
}
|
|
59
60
|
:host .modal .modal-content .state-icon-container {
|
|
60
61
|
-webkit-margin-end: 1rem;
|
|
@@ -66,9 +66,15 @@ export class Modal {
|
|
|
66
66
|
},
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
+
onBackdropClick(event) {
|
|
70
|
+
const target = event.target;
|
|
71
|
+
if (target.classList.contains('backdrop')) {
|
|
72
|
+
this.dismiss(event);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
69
75
|
componentDidLoad() {
|
|
70
76
|
if (this.backdrop === 'static') {
|
|
71
|
-
this.modalBackdrop.addEventListener('click', this.
|
|
77
|
+
this.modalBackdrop.addEventListener('click', (event) => this.onBackdropClick(event));
|
|
72
78
|
}
|
|
73
79
|
if (this.backdropClass) {
|
|
74
80
|
this.modalBackdrop.classList.add(this.backdropClass);
|
|
@@ -36,6 +36,8 @@
|
|
|
36
36
|
*/
|
|
37
37
|
:host {
|
|
38
38
|
display: inline-flex;
|
|
39
|
+
width: -moz-fit-content;
|
|
40
|
+
width: fit-content;
|
|
39
41
|
position: relative;
|
|
40
42
|
align-items: center;
|
|
41
43
|
justify-content: center;
|
|
@@ -262,8 +264,16 @@
|
|
|
262
264
|
:host[variant=success].outline.active, :host[variant=success].outline:active {
|
|
263
265
|
background-color: var(--theme-chip-outline--background--active);
|
|
264
266
|
}
|
|
267
|
+
:host[variant=custom].outline {
|
|
268
|
+
border: solid 1px transparent;
|
|
269
|
+
background-color: transparent;
|
|
270
|
+
}
|
|
265
271
|
:host .slot {
|
|
266
272
|
overflow: hidden;
|
|
267
273
|
text-overflow: ellipsis;
|
|
268
274
|
white-space: nowrap;
|
|
275
|
+
}
|
|
276
|
+
:host .hidden {
|
|
277
|
+
width: 0px;
|
|
278
|
+
margin-right: 0px;
|
|
269
279
|
}
|
|
@@ -25,7 +25,10 @@ export class Pill {
|
|
|
25
25
|
color: this.color,
|
|
26
26
|
backgroundColor: this.background,
|
|
27
27
|
}
|
|
28
|
-
: {}, title: this.el.textContent },
|
|
28
|
+
: {}, title: this.el.textContent }, h("ix-icon", { class: {
|
|
29
|
+
'with-icon': true,
|
|
30
|
+
hidden: this.icon === undefined || this.icon === '',
|
|
31
|
+
}, name: this.icon, size: '16' }), h("div", { class: "slot" }, h("slot", null))));
|
|
29
32
|
}
|
|
30
33
|
static get is() { return "ix-pill"; }
|
|
31
34
|
static get encapsulation() { return "scoped"; }
|
|
@@ -112,17 +112,12 @@ export class Select {
|
|
|
112
112
|
: [this.selectedIndices]);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
this.labelMutationObserver.observe(this.hostElement, {
|
|
122
|
-
subtree: true,
|
|
123
|
-
attributes: true,
|
|
124
|
-
attributeFilter: ['label'],
|
|
125
|
-
});
|
|
115
|
+
onLabelChange(event) {
|
|
116
|
+
event.preventDefault();
|
|
117
|
+
event.stopImmediatePropagation();
|
|
118
|
+
this.selectValue(Array.isArray(this.selectedIndices)
|
|
119
|
+
? this.selectedIndices
|
|
120
|
+
: [this.selectedIndices]);
|
|
126
121
|
}
|
|
127
122
|
disconnectedCallback() {
|
|
128
123
|
if (this.labelMutationObserver) {
|
|
@@ -259,7 +254,7 @@ export class Select {
|
|
|
259
254
|
'd-none': this.disabled ||
|
|
260
255
|
this.readonly ||
|
|
261
256
|
(this.isDropdownEmpty && !this.editable),
|
|
262
|
-
}, anchor: this.dropdownAnchor, trigger: this.dropdownWrapperRef, onShowChanged: (e) => this.dropdownVisibilityChanged(e), placement: "bottom", positioningStrategy: '
|
|
257
|
+
}, anchor: this.dropdownAnchor, trigger: this.dropdownWrapperRef, onShowChanged: (e) => this.dropdownVisibilityChanged(e), placement: "bottom-start", positioningStrategy: 'absolute' }, h("div", { class: "select-list-header", title: this.i18nSelectListHeader }, this.i18nSelectListHeader), h("slot", null), h("div", { ref: (ref) => (this.addItemRef = ref), class: "d-contents" }), this.itemExists(this.inputFilterText) ? ('') : (h("ix-dropdown-item", { "data-testid": "add-item", icon: "plus", class: {
|
|
263
258
|
'add-item': true,
|
|
264
259
|
'd-none': !(this.editable && this.inputFilterText),
|
|
265
260
|
}, label: this.inputFilterText, onItemClick: (e) => {
|
|
@@ -509,6 +504,12 @@ export class Select {
|
|
|
509
504
|
"target": undefined,
|
|
510
505
|
"capture": false,
|
|
511
506
|
"passive": false
|
|
507
|
+
}, {
|
|
508
|
+
"name": "ix-select-item:labelChange",
|
|
509
|
+
"method": "onLabelChange",
|
|
510
|
+
"target": undefined,
|
|
511
|
+
"capture": false,
|
|
512
|
+
"passive": false
|
|
512
513
|
}, {
|
|
513
514
|
"name": "keydown",
|
|
514
515
|
"method": "onKeyDown",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: 2023 Siemens AG
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
export class IxSelectItemLabelChangeEvent extends CustomEvent {
|
|
10
|
+
constructor(detail) {
|
|
11
|
+
super('ix-select-item:labelChange', {
|
|
12
|
+
bubbles: true,
|
|
13
|
+
detail,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
import { h, Host, } from '@stencil/core';
|
|
10
|
+
import { IxSelectItemLabelChangeEvent } from './events';
|
|
10
11
|
export class SelectItem {
|
|
11
12
|
constructor() {
|
|
12
13
|
this.label = undefined;
|
|
@@ -15,7 +16,7 @@ export class SelectItem {
|
|
|
15
16
|
this.hover = false;
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
18
|
-
*
|
|
19
|
+
* @internal
|
|
19
20
|
* @param event
|
|
20
21
|
*/
|
|
21
22
|
async onItemClick(event) {
|
|
@@ -28,6 +29,12 @@ export class SelectItem {
|
|
|
28
29
|
throw Error('ix-select-item must have a `value` property');
|
|
29
30
|
}
|
|
30
31
|
}
|
|
32
|
+
labelChange(newValue, oldValue) {
|
|
33
|
+
this.hostElement.dispatchEvent(new IxSelectItemLabelChangeEvent({
|
|
34
|
+
newValue: newValue,
|
|
35
|
+
oldValue: oldValue,
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
31
38
|
render() {
|
|
32
39
|
return (h(Host, null, h("ix-dropdown-item", { checked: this.selected, hover: this.hover, label: this.label ? this.label : this.value, onItemClick: (e) => this.onItemClick(e) })));
|
|
33
40
|
}
|
|
@@ -108,8 +115,11 @@ export class SelectItem {
|
|
|
108
115
|
"required": false,
|
|
109
116
|
"optional": false,
|
|
110
117
|
"docs": {
|
|
111
|
-
"tags": [
|
|
112
|
-
|
|
118
|
+
"tags": [{
|
|
119
|
+
"name": "internal",
|
|
120
|
+
"text": undefined
|
|
121
|
+
}],
|
|
122
|
+
"text": ""
|
|
113
123
|
},
|
|
114
124
|
"attribute": "hover",
|
|
115
125
|
"reflect": false,
|
|
@@ -161,8 +171,11 @@ export class SelectItem {
|
|
|
161
171
|
"return": "Promise<void>"
|
|
162
172
|
},
|
|
163
173
|
"docs": {
|
|
164
|
-
"text": "
|
|
174
|
+
"text": "",
|
|
165
175
|
"tags": [{
|
|
176
|
+
"name": "internal",
|
|
177
|
+
"text": undefined
|
|
178
|
+
}, {
|
|
166
179
|
"name": "param",
|
|
167
180
|
"text": "event"
|
|
168
181
|
}]
|
|
@@ -171,4 +184,10 @@ export class SelectItem {
|
|
|
171
184
|
};
|
|
172
185
|
}
|
|
173
186
|
static get elementRef() { return "hostElement"; }
|
|
187
|
+
static get watchers() {
|
|
188
|
+
return [{
|
|
189
|
+
"propName": "label",
|
|
190
|
+
"methodName": "labelChange"
|
|
191
|
+
}];
|
|
192
|
+
}
|
|
174
193
|
}
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
import { createPopper, } from '@popperjs/core';
|
|
10
9
|
import { h, Host, } from '@stencil/core';
|
|
11
10
|
import { getButtonClasses } from '../button/base-button';
|
|
12
11
|
export class SplitButton {
|
|
@@ -25,46 +24,18 @@ export class SplitButton {
|
|
|
25
24
|
get splitItems() {
|
|
26
25
|
return Array.from(this.hostElement.querySelectorAll('ix-split-button-item'));
|
|
27
26
|
}
|
|
28
|
-
|
|
29
|
-
if (
|
|
30
|
-
this.
|
|
27
|
+
linkTriggerRef() {
|
|
28
|
+
if (this.triggerElement && this.dropdownElement) {
|
|
29
|
+
this.dropdownElement.trigger = this.triggerElement;
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
componentDidLoad() {
|
|
34
|
-
|
|
35
|
-
this.popover = this.hostElement.querySelector('ix-dropdown');
|
|
36
|
-
this.popperInstance = createPopper(element, this.popover, {
|
|
37
|
-
strategy: 'fixed',
|
|
38
|
-
placement: this.placement,
|
|
39
|
-
modifiers: [
|
|
40
|
-
{
|
|
41
|
-
name: 'offset',
|
|
42
|
-
options: {
|
|
43
|
-
offset: [0, 0],
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
name: 'flip',
|
|
48
|
-
options: {
|
|
49
|
-
padding: 8,
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
});
|
|
54
|
-
window.addEventListener('click', this.clickOutside.bind(this));
|
|
55
|
-
}
|
|
56
|
-
disconnectedCallback() {
|
|
57
|
-
var _a;
|
|
58
|
-
(_a = this.popperInstance) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
59
|
-
window.removeEventListener('click', this.clickOutside.bind(this));
|
|
60
|
-
}
|
|
61
|
-
toggleDropdown() {
|
|
62
|
-
this.toggle = !this.toggle;
|
|
33
|
+
this.linkTriggerRef();
|
|
63
34
|
}
|
|
64
35
|
render() {
|
|
65
|
-
return (h(Host, { class: "btn-group" }, h("button", { class: getButtonClasses(this.variant, this.outline, this.ghost || this.invisible, !this.label, false, false, this.disabled), onClick: (e) => this.buttonClick.emit(e) }, this.icon ? h("ix-icon", { name: this.icon }) : null, " ", this.label), h("button", { class: Object.assign(Object.assign({}, getButtonClasses(this.variant, this.outline, this.ghost || this.invisible, true, false, false, this.disabled)), {
|
|
36
|
+
return (h(Host, { class: "btn-group" }, h("button", { class: getButtonClasses(this.variant, this.outline, this.ghost || this.invisible, !this.label, false, false, this.disabled), onClick: (e) => this.buttonClick.emit(e) }, this.icon ? h("ix-icon", { name: this.icon }) : null, " ", this.label), h("button", { ref: (r) => (this.triggerElement = r), class: Object.assign(Object.assign({}, getButtonClasses(this.variant, this.outline, this.ghost || this.invisible, true, false, false, this.disabled)), {
|
|
66
37
|
anchor: true,
|
|
67
|
-
})
|
|
38
|
+
}) }, h("ix-icon", { name: this.splitIcon }), h("ix-dropdown", { ref: (r) => (this.dropdownElement = r) }, h("slot", null)))));
|
|
68
39
|
}
|
|
69
40
|
static get is() { return "ix-split-button"; }
|
|
70
41
|
static get encapsulation() { return "scoped"; }
|
|
@@ -240,7 +211,7 @@ export class SplitButton {
|
|
|
240
211
|
"references": {
|
|
241
212
|
"Placement": {
|
|
242
213
|
"location": "import",
|
|
243
|
-
"path": "
|
|
214
|
+
"path": "../dropdown/placement"
|
|
244
215
|
}
|
|
245
216
|
}
|
|
246
217
|
},
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { TypedEvent } from './typed-event';
|
|
2
|
+
export class ThemeSwitcher {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.prefixTheme = 'theme-';
|
|
5
|
+
this.suffixLight = '-light';
|
|
6
|
+
this.suffixDark = '-dark';
|
|
7
|
+
this.defaultTheme = 'theme-classic-dark';
|
|
8
|
+
this._themeChanged = new TypedEvent();
|
|
9
|
+
this.registerMutationObserver();
|
|
10
|
+
}
|
|
11
|
+
get themeChanged() {
|
|
12
|
+
return this._themeChanged;
|
|
13
|
+
}
|
|
14
|
+
hasVariantSuffix(className) {
|
|
15
|
+
return (className.endsWith(this.suffixDark) ||
|
|
16
|
+
className.endsWith(this.suffixLight));
|
|
17
|
+
}
|
|
18
|
+
isThemeClass(className) {
|
|
19
|
+
return (className.startsWith(this.prefixTheme) && this.hasVariantSuffix(className));
|
|
20
|
+
}
|
|
21
|
+
setTheme(themeName) {
|
|
22
|
+
if (!this.isThemeClass(themeName)) {
|
|
23
|
+
throw Error(`Provided theme name ${themeName} does not match our naming conventions. (theme-<name>-(dark,light))`);
|
|
24
|
+
}
|
|
25
|
+
const oldThemes = [];
|
|
26
|
+
document.body.classList.forEach((className) => {
|
|
27
|
+
if (this.isThemeClass(className)) {
|
|
28
|
+
oldThemes.push(className);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
document.body.classList.remove(...oldThemes);
|
|
32
|
+
document.body.classList.add(themeName);
|
|
33
|
+
}
|
|
34
|
+
toggleMode() {
|
|
35
|
+
const oldThemes = [];
|
|
36
|
+
document.body.classList.forEach((className) => {
|
|
37
|
+
if (this.isThemeClass(className)) {
|
|
38
|
+
oldThemes.push(className);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
if (oldThemes.length === 0) {
|
|
42
|
+
document.body.classList.add(this.getOppositeMode(this.defaultTheme));
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
oldThemes.forEach((themeName) => {
|
|
46
|
+
document.body.classList.replace(themeName, this.getOppositeMode(themeName));
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
getOppositeMode(themeName) {
|
|
50
|
+
if (themeName.endsWith(this.suffixDark)) {
|
|
51
|
+
return themeName.replace(/-dark$/g, this.suffixLight);
|
|
52
|
+
}
|
|
53
|
+
if (themeName.endsWith(this.suffixLight)) {
|
|
54
|
+
return themeName.replace(/-light$/g, this.suffixDark);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
handleMutations(mutations) {
|
|
58
|
+
return mutations.forEach((mutation) => {
|
|
59
|
+
const { target } = mutation;
|
|
60
|
+
target.classList.forEach((className) => {
|
|
61
|
+
var _a;
|
|
62
|
+
if (this.isThemeClass(className) &&
|
|
63
|
+
!((_a = mutation.oldValue) === null || _a === void 0 ? void 0 : _a.includes(className))) {
|
|
64
|
+
this._themeChanged.emit(className);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
registerMutationObserver() {
|
|
70
|
+
if (typeof window === 'undefined') {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (!('MutationOberver' in window)) {
|
|
74
|
+
console.warn('ThemeSwitcher not supported by your browser. Missing MutationObserver API');
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
this.mutationObserver = new MutationObserver((mutations) => {
|
|
78
|
+
this.handleMutations(mutations);
|
|
79
|
+
});
|
|
80
|
+
this.mutationObserver.observe(document.body, {
|
|
81
|
+
attributeFilter: ['class'],
|
|
82
|
+
attributeOldValue: true,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
export const themeSwitcher = new ThemeSwitcher();
|