@siemens/ix 1.5.0-beta.0 → 1.5.0-beta.1
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/index-478a4b66.js +8 -0
- package/dist/cjs/index.cjs.js +12 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/ix-blind.cjs.entry.js +6 -3
- package/dist/cjs/ix-blind.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-breadcrumb_2.cjs.entry.js +1 -1
- package/dist/cjs/ix-breadcrumb_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-category-filter.cjs.entry.js +2 -2
- package/dist/cjs/ix-category-filter.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-chip.cjs.entry.js +6 -1
- package/dist/cjs/ix-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-dropdown_2.cjs.entry.js +1 -1
- package/dist/cjs/ix-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-filter-chip.cjs.entry.js +2 -2
- package/dist/cjs/ix-filter-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-flip-tile_2.cjs.entry.js +11 -2
- package/dist/cjs/ix-flip-tile_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-index-button.cjs.entry.js +28 -0
- package/dist/cjs/ix-index-button.cjs.entry.js.map +1 -0
- package/dist/cjs/ix-input-group.cjs.entry.js +1 -1
- package/dist/cjs/ix-input-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-menu_9.cjs.entry.js +1 -1
- package/dist/cjs/ix-menu_9.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-pagination.cjs.entry.js +115 -0
- package/dist/cjs/ix-pagination.cjs.entry.js.map +1 -0
- package/dist/cjs/ix-select_2.cjs.entry.js +3 -3
- package/dist/cjs/ix-select_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-toast_2.cjs.entry.js +10 -1
- package/dist/cjs/ix-toast_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-tooltip.cjs.entry.js +31 -27
- package/dist/cjs/ix-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-tree_2.cjs.entry.js +4 -0
- package/dist/cjs/ix-tree_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-upload.cjs.entry.js +8 -23
- package/dist/cjs/ix-upload.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-workflow-step_2.cjs.entry.js +1 -1
- package/dist/cjs/ix-workflow-step_2.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/siemens-ix.cjs.js +1 -1
- package/dist/cjs/upload-file-state-a79acf2b.js +19 -0
- package/dist/cjs/upload-file-state-a79acf2b.js.map +1 -0
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/blind/blind.css +12 -6
- package/dist/collection/components/blind/blind.js +25 -2
- package/dist/collection/components/blind/blind.js.map +1 -1
- package/dist/collection/components/breadcrumb/breadcrumb.css +1 -2
- package/dist/collection/components/category-filter/category-filter.js +2 -2
- package/dist/collection/components/category-filter/category-filter.js.map +1 -1
- package/dist/collection/components/chip/chip.js +27 -2
- package/dist/collection/components/chip/chip.js.map +1 -1
- package/dist/collection/components/dropdown-item/dropdown-item.js +1 -1
- package/dist/collection/components/dropdown-item/dropdown-item.js.map +1 -1
- package/dist/collection/components/filter-chip/filter-chip.css +14 -7
- package/dist/collection/components/filter-chip/filter-chip.js +1 -1
- package/dist/collection/components/filter-chip/filter-chip.js.map +1 -1
- package/dist/collection/components/flip-tile/flip-tile.css +0 -4
- package/dist/collection/components/flip-tile/flip-tile.js +56 -2
- package/dist/collection/components/flip-tile/flip-tile.js.map +1 -1
- package/dist/collection/components/index-button/index-button.css +31 -0
- package/dist/collection/components/index-button/index-button.js +83 -0
- package/dist/collection/components/index-button/index-button.js.map +1 -0
- package/dist/collection/components/input-group/input-group.css +3 -0
- package/dist/collection/components/menu-item/menu-item.css +15 -10
- package/dist/collection/components/pagination/pagination.css +58 -0
- package/dist/collection/components/pagination/pagination.js +303 -0
- package/dist/collection/components/pagination/pagination.js.map +1 -0
- package/dist/collection/components/select/select.js +3 -3
- package/dist/collection/components/select/select.js.map +1 -1
- package/dist/collection/components/toast/toast-container.js +16 -4
- package/dist/collection/components/toast/toast-container.js.map +1 -1
- package/dist/collection/components/toast/toast-utils.js +4 -1
- package/dist/collection/components/toast/toast-utils.js.map +1 -1
- package/dist/collection/components/tooltip/tooltip.css +8 -7
- package/dist/collection/components/tooltip/tooltip.js +31 -27
- package/dist/collection/components/tooltip/tooltip.js.map +1 -1
- package/dist/collection/components/tree/tree.js +38 -0
- package/dist/collection/components/tree/tree.js.map +1 -1
- package/dist/collection/components/workflow-step/workflow-step.css +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/components/dropdown-item.js +1 -1
- package/dist/components/dropdown-item.js.map +1 -1
- package/dist/components/filter-chip.js +2 -2
- package/dist/components/filter-chip.js.map +1 -1
- package/dist/components/index-button.js +41 -0
- package/dist/components/index-button.js.map +1 -0
- package/dist/components/index.js +5 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/ix-blind.js +15 -5
- package/dist/components/ix-blind.js.map +1 -1
- package/dist/components/ix-breadcrumb.js +1 -1
- package/dist/components/ix-breadcrumb.js.map +1 -1
- package/dist/components/ix-category-filter.js +2 -2
- package/dist/components/ix-category-filter.js.map +1 -1
- package/dist/components/ix-chip.js +6 -1
- package/dist/components/ix-chip.js.map +1 -1
- package/dist/components/ix-flip-tile.js +13 -2
- package/dist/components/ix-flip-tile.js.map +1 -1
- package/dist/components/ix-index-button.d.ts +11 -0
- package/dist/components/ix-index-button.js +8 -0
- package/dist/components/ix-index-button.js.map +1 -0
- package/dist/components/ix-input-group.js +1 -1
- package/dist/components/ix-input-group.js.map +1 -1
- package/dist/components/ix-pagination.d.ts +11 -0
- package/dist/components/ix-pagination.js +185 -0
- package/dist/components/ix-pagination.js.map +1 -0
- package/dist/components/ix-select.js +1 -341
- package/dist/components/ix-select.js.map +1 -1
- package/dist/components/ix-toast-container.js +10 -1
- package/dist/components/ix-toast-container.js.map +1 -1
- package/dist/components/ix-tooltip.js +32 -28
- package/dist/components/ix-tooltip.js.map +1 -1
- package/dist/components/ix-tree.js +4 -0
- package/dist/components/ix-tree.js.map +1 -1
- package/dist/components/ix-upload.js +1 -16
- package/dist/components/ix-upload.js.map +1 -1
- package/dist/components/ix-workflow-step.js +1 -1
- package/dist/components/ix-workflow-step.js.map +1 -1
- package/dist/components/menu-item.js +1 -1
- package/dist/components/menu-item.js.map +1 -1
- package/dist/components/select.js +345 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/upload-file-state.js +19 -0
- package/dist/components/upload-file-state.js.map +1 -0
- package/dist/esm/index-3d163acd.js +8 -0
- package/dist/esm/index.js +5 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/ix-blind.entry.js +6 -3
- package/dist/esm/ix-blind.entry.js.map +1 -1
- package/dist/esm/ix-breadcrumb_2.entry.js +1 -1
- package/dist/esm/ix-breadcrumb_2.entry.js.map +1 -1
- package/dist/esm/ix-category-filter.entry.js +2 -2
- package/dist/esm/ix-category-filter.entry.js.map +1 -1
- package/dist/esm/ix-chip.entry.js +6 -1
- package/dist/esm/ix-chip.entry.js.map +1 -1
- package/dist/esm/ix-dropdown_2.entry.js +1 -1
- package/dist/esm/ix-dropdown_2.entry.js.map +1 -1
- package/dist/esm/ix-filter-chip.entry.js +2 -2
- package/dist/esm/ix-filter-chip.entry.js.map +1 -1
- package/dist/esm/ix-flip-tile_2.entry.js +11 -2
- package/dist/esm/ix-flip-tile_2.entry.js.map +1 -1
- package/dist/esm/ix-index-button.entry.js +24 -0
- package/dist/esm/ix-index-button.entry.js.map +1 -0
- package/dist/esm/ix-input-group.entry.js +1 -1
- package/dist/esm/ix-input-group.entry.js.map +1 -1
- package/dist/esm/ix-menu_9.entry.js +1 -1
- package/dist/esm/ix-menu_9.entry.js.map +1 -1
- package/dist/esm/ix-pagination.entry.js +111 -0
- package/dist/esm/ix-pagination.entry.js.map +1 -0
- package/dist/esm/ix-select_2.entry.js +3 -3
- package/dist/esm/ix-select_2.entry.js.map +1 -1
- package/dist/esm/ix-toast_2.entry.js +10 -1
- package/dist/esm/ix-toast_2.entry.js.map +1 -1
- package/dist/esm/ix-tooltip.entry.js +32 -28
- package/dist/esm/ix-tooltip.entry.js.map +1 -1
- package/dist/esm/ix-tree_2.entry.js +4 -0
- package/dist/esm/ix-tree_2.entry.js.map +1 -1
- package/dist/esm/ix-upload.entry.js +1 -16
- package/dist/esm/ix-upload.entry.js.map +1 -1
- package/dist/esm/ix-workflow-step_2.entry.js +1 -1
- package/dist/esm/ix-workflow-step_2.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/siemens-ix.js +1 -1
- package/dist/esm/upload-file-state-532a36d3.js +19 -0
- package/dist/esm/upload-file-state-532a36d3.js.map +1 -0
- package/dist/siemens-ix/index.esm.js +1 -1
- package/dist/siemens-ix/index.esm.js.map +1 -1
- package/dist/siemens-ix/p-030078b4.entry.js +2 -0
- package/dist/siemens-ix/p-030078b4.entry.js.map +1 -0
- package/dist/siemens-ix/p-076c29d1.js +2 -0
- package/dist/siemens-ix/p-076c29d1.js.map +1 -0
- package/dist/siemens-ix/p-0f864265.entry.js +2 -0
- package/dist/siemens-ix/p-0f864265.entry.js.map +1 -0
- package/dist/siemens-ix/p-16ec6f50.entry.js +2 -0
- package/dist/siemens-ix/p-16ec6f50.entry.js.map +1 -0
- package/dist/siemens-ix/p-1701b127.entry.js +2 -0
- package/dist/siemens-ix/p-1701b127.entry.js.map +1 -0
- package/dist/siemens-ix/p-24d2d95e.entry.js +2 -0
- package/dist/siemens-ix/p-24d2d95e.entry.js.map +1 -0
- package/dist/siemens-ix/{p-11af475f.entry.js → p-28f50519.entry.js} +2 -2
- package/dist/siemens-ix/p-28f50519.entry.js.map +1 -0
- package/dist/siemens-ix/{p-6790d123.entry.js → p-34e3a10e.entry.js} +2 -2
- package/dist/siemens-ix/{p-6790d123.entry.js.map → p-34e3a10e.entry.js.map} +1 -1
- package/dist/siemens-ix/p-446a0a3f.entry.js +2 -0
- package/dist/siemens-ix/p-446a0a3f.entry.js.map +1 -0
- package/dist/siemens-ix/p-55d0fabf.entry.js +2 -0
- package/dist/siemens-ix/p-55d0fabf.entry.js.map +1 -0
- package/dist/siemens-ix/{p-9f55716d.entry.js → p-58ef1328.entry.js} +2 -2
- package/dist/siemens-ix/p-58ef1328.entry.js.map +1 -0
- package/dist/siemens-ix/{p-aafd18a8.entry.js → p-62b4d696.entry.js} +2 -2
- package/dist/siemens-ix/p-62b4d696.entry.js.map +1 -0
- package/dist/siemens-ix/p-6facc3cc.entry.js +2 -0
- package/dist/siemens-ix/p-6facc3cc.entry.js.map +1 -0
- package/dist/siemens-ix/p-73f7ef87.entry.js +2 -0
- package/dist/siemens-ix/p-73f7ef87.entry.js.map +1 -0
- package/dist/siemens-ix/{p-1811d669.entry.js → p-88a47c9b.entry.js} +2 -2
- package/dist/siemens-ix/p-88a47c9b.entry.js.map +1 -0
- package/dist/siemens-ix/p-9546cbdd.entry.js +2 -0
- package/dist/siemens-ix/p-9546cbdd.entry.js.map +1 -0
- package/dist/siemens-ix/{p-5ce07b8b.entry.js → p-afd1f351.entry.js} +2 -2
- package/dist/siemens-ix/p-afd1f351.entry.js.map +1 -0
- package/dist/siemens-ix/p-b9fbd029.entry.js +2 -0
- package/dist/siemens-ix/p-b9fbd029.entry.js.map +1 -0
- package/dist/siemens-ix/siemens-ix.css +6 -0
- package/dist/siemens-ix/siemens-ix.esm.js +1 -1
- package/dist/siemens-ix/siemens-ix.esm.js.map +1 -1
- package/dist/types/components/blind/blind.d.ts +5 -0
- package/dist/types/components/chip/chip.d.ts +8 -0
- package/dist/types/components/flip-tile/flip-tile.d.ts +11 -0
- package/dist/types/components/index-button/index-button.d.ts +16 -0
- package/dist/types/components/pagination/pagination.d.ts +55 -0
- package/dist/types/components/toast/toast-container.d.ts +3 -1
- package/dist/types/components/toast/toast-utils.d.ts +3 -0
- package/dist/types/components/tree/tree.d.ts +13 -0
- package/dist/types/components.d.ts +182 -2
- package/dist/types/index.d.ts +1 -0
- package/package.json +3 -2
- package/scss/components/_forms.scss +1 -1
- package/dist/siemens-ix/p-0d15aa1a.entry.js +0 -2
- package/dist/siemens-ix/p-0d15aa1a.entry.js.map +0 -1
- package/dist/siemens-ix/p-11af475f.entry.js.map +0 -1
- package/dist/siemens-ix/p-1259ea24.entry.js +0 -2
- package/dist/siemens-ix/p-1259ea24.entry.js.map +0 -1
- package/dist/siemens-ix/p-1811d669.entry.js.map +0 -1
- package/dist/siemens-ix/p-29bd1814.entry.js +0 -2
- package/dist/siemens-ix/p-29bd1814.entry.js.map +0 -1
- package/dist/siemens-ix/p-5845a03c.entry.js +0 -2
- package/dist/siemens-ix/p-5845a03c.entry.js.map +0 -1
- package/dist/siemens-ix/p-5ce07b8b.entry.js.map +0 -1
- package/dist/siemens-ix/p-7ce0c0e2.entry.js +0 -2
- package/dist/siemens-ix/p-7ce0c0e2.entry.js.map +0 -1
- package/dist/siemens-ix/p-967f7d5d.entry.js +0 -2
- package/dist/siemens-ix/p-967f7d5d.entry.js.map +0 -1
- package/dist/siemens-ix/p-9f55716d.entry.js.map +0 -1
- package/dist/siemens-ix/p-aafd18a8.entry.js.map +0 -1
- package/dist/siemens-ix/p-d7def96c.entry.js +0 -2
- package/dist/siemens-ix/p-d7def96c.entry.js.map +0 -1
- package/dist/siemens-ix/p-f961c22a.entry.js +0 -2
- package/dist/siemens-ix/p-f961c22a.entry.js.map +0 -1
- package/dist/siemens-ix/p-fe690347.entry.js +0 -2
- package/dist/siemens-ix/p-fe690347.entry.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["blindCss","Blind","constructor","hostRef","registerInstance","this","collapsedChange","createEvent","collapsed","label","undefined","onHeaderClick","e","preventDefault","stopImmediatePropagation","emit","componentDidLoad","animateCollapse","content","hostElement","querySelector","animation","isCollapsed","rotateChevronRight","rotateChevronDown","anime","targets","chevronRef","duration","easing","rotateZ","opacity","render","h","Host","class","closed","onClick","ref","glyph","name","hide"],"sources":["./src/components/blind/blind.scss?tag=ix-blind&encapsulation=scoped","./src/components/blind/blind.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n@import 'common-variables';\n@import 'mixins/fonts';\n@import 'mixins/hover';\n@import 'mixins/text-truncation';\n\n:host {\n display: flex;\n flex-direction: column;\n background-color: var(--theme-blind-base--background);\n border: solid var(--theme-blind--border-thickness)\n var(--theme-blind-base--border-color);\n border-radius: var(--theme-blind--border-radius);\n overflow: hidden;\n\n .blind-header {\n @include ellipsis;\n\n display: flex;\n align-items: center;\n min-height: 3rem;\n height: 3rem;\n border: solid var(--theme-blind--border-thickness) transparent;\n border-radius: var(--theme-blind--border-radius)\n var(--theme-blind--border-radius) 0 0;\n padding-right: $default-space;\n transition: border-radius $default-time;\n cursor: pointer;\n\n z-index: 1;\n\n color: var(--theme-blind-header-closed--color);\n background-color: var(--theme-blind-header-closed--background);\n\n .glyph {\n color: var(--theme-blind-header-icon-closed--color);\n padding: $tiny-space $small-space;\n }\n\n .blind-header-title {\n @include ellipsis;\n\n .blind-header-title-default {\n @include text-l-title;\n }\n }\n\n @include hover {\n background-color: var(--theme-blind-header-open--background--hover);\n\n .glyph {\n color: var(--theme-blind-header-icon-open--color--hover);\n }\n }\n\n @include active {\n background-color: var(--theme-blind-header-open--background--active);\n\n .glyph {\n color: var(--theme-blind-header-icon-open--color--active);\n }\n }\n\n @include focus-visible {\n border-color: var(--theme-focus--border-color);\n }\n\n &.closed {\n border-radius: var(--theme-blind--border-radius);\n\n @include hover {\n background-color: var(--theme-blind-header-open--background--hover);\n\n .glyph {\n color: var(--theme-blind-header-icon-closed--color--hover);\n }\n }\n\n @include active {\n background-color: var(--theme-blind-header-open--background--active);\n\n .glyph {\n color: var(--theme-blind-header-icon-closed--color--active);\n }\n }\n }\n }\n\n .blind-custom-header {\n display: flex;\n align-items: center;\n }\n\n .blind-content {\n display: block;\n padding: 1rem;\n transition-property: padding;\n transition-duration: $default-time;\n transition-timing-function: ease-in;\n\n &.hide {\n max-height: 0;\n padding-top: 0px;\n padding-bottom: 0px;\n }\n }\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n Watch,\n} from '@stencil/core';\nimport anime from 'animejs';\n\n@Component({\n tag: 'ix-blind',\n styleUrl: 'blind.scss',\n scoped: true,\n})\nexport class Blind {\n /**\n * Collapsed state\n */\n @Prop({ mutable: true, reflect: true }) collapsed = false;\n\n /**\n * Label of blind\n */\n @Prop() label: string;\n\n /**\n * Collapsed state changed\n */\n @Event() collapsedChange: EventEmitter<boolean>;\n\n @Element() hostElement!: HTMLIxBlindElement;\n\n private chevronRef: HTMLElement;\n\n constructor() {}\n\n private onHeaderClick(e: Event) {\n e.preventDefault();\n e.stopImmediatePropagation();\n\n this.collapsed = !this.collapsed;\n this.collapsedChange.emit(this.collapsed);\n }\n\n componentDidLoad() {\n this.animateCollapse(this.collapsed);\n }\n\n get content() {\n return this.hostElement.querySelector('.blind-content');\n }\n\n @Watch('collapsed')\n animation(isCollapsed: boolean) {\n this.animateCollapse(isCollapsed);\n }\n\n private animateCollapse(isCollapsed: boolean) {\n if (isCollapsed) {\n this.rotateChevronRight();\n } else {\n this.rotateChevronDown();\n }\n }\n\n private rotateChevronDown() {\n anime({\n targets: this.chevronRef,\n duration: 150,\n easing: 'easeInOutSine',\n rotateZ: 90,\n });\n anime({\n targets: this.content,\n duration: 150,\n easing: 'easeInOutSine',\n opacity: 1,\n });\n }\n\n private rotateChevronRight() {\n anime({\n targets: this.chevronRef,\n duration: 150,\n easing: 'easeInOutSine',\n rotateZ: 0,\n });\n anime({\n targets: this.content,\n duration: 150,\n easing: 'easeInOutSine',\n opacity: 0,\n });\n }\n\n render() {\n return (\n <Host>\n <div\n class={{\n 'blind-header': true,\n closed: this.collapsed,\n }}\n onClick={(e) => this.onHeaderClick(e)}\n >\n <span\n ref={(ref) => (this.chevronRef = ref)}\n class={{\n glyph: true,\n 'glyph-chevron-right-small': true,\n }}\n ></span>\n <div class=\"blind-header-title\">\n {this.label !== undefined ? (\n <span class=\"blind-header-title-default\">{this.label}</span>\n ) : (\n <slot name=\"custom-header\"></slot>\n )}\n </div>\n </div>\n <div\n class={{\n 'blind-content': true,\n hide: this.collapsed,\n }}\n >\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"oGAAA,MAAMA,EAAW,g4G,MC0BJC,EAAK,MAoBhBC,YAAAC,GAAAC,EAAAC,KAAAF,GAAAE,KAAAC,gBAAAC,EAAAF,KAAA,qBAAAA,KAAAG,UAhBoD,MAAKH,KAAAI,MAAAC,SAAA,CAkBjDC,cAAcC,GACpBA,EAAEC,iBACFD,EAAEE,2BAEFT,KAAKG,WAAaH,KAAKG,UACvBH,KAAKC,gBAAgBS,KAAKV,KAAKG,U,CAGjCQ,mBACEX,KAAKY,gBAAgBZ,KAAKG,U,CAGxBU,cACF,OAAOb,KAAKc,YAAYC,cAAc,iB,CAIxCC,UAAUC,GACRjB,KAAKY,gBAAgBK,E,CAGfL,gBAAgBK,GACtB,GAAIA,EAAa,CACfjB,KAAKkB,oB,KACA,CACLlB,KAAKmB,mB,EAIDA,oBACNC,EAAM,CACJC,QAASrB,KAAKsB,WACdC,SAAU,IACVC,OAAQ,gBACRC,QAAS,KAEXL,EAAM,CACJC,QAASrB,KAAKa,QACdU,SAAU,IACVC,OAAQ,gBACRE,QAAS,G,CAILR,qBACNE,EAAM,CACJC,QAASrB,KAAKsB,WACdC,SAAU,IACVC,OAAQ,gBACRC,QAAS,IAEXL,EAAM,CACJC,QAASrB,KAAKa,QACdU,SAAU,IACVC,OAAQ,gBACRE,QAAS,G,CAIbC,SACE,OACEC,EAACC,EAAI,KACHD,EAAA,OACEE,MAAO,CACL,eAAgB,KAChBC,OAAQ/B,KAAKG,WAEf6B,QAAUzB,GAAMP,KAAKM,cAAcC,IAEnCqB,EAAA,QACEK,IAAMA,GAASjC,KAAKsB,WAAaW,EACjCH,MAAO,CACLI,MAAO,KACP,4BAA6B,QAGjCN,EAAA,OAAKE,MAAM,sBACR9B,KAAKI,QAAUC,UACduB,EAAA,QAAME,MAAM,8BAA8B9B,KAAKI,OAE/CwB,EAAA,QAAMO,KAAK,oBAIjBP,EAAA,OACEE,MAAO,CACL,gBAAiB,KACjBM,KAAMpC,KAAKG,YAGbyB,EAAA,c"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["f","module","exports","r","e","n","t","o","i","c","require","u","a","Error","code","p","call","length","_dereq_","Object","defineProperty","value","_createClass","defineProperties","target","props","descriptor","enumerable","configurable","writable","key","Constructor","protoProps","staticProps","prototype","_defineProperty","obj","_classCallCheck","instance","TypeError","defaultConfig","width","height","isNumber","input","Number","addClass","document","documentElement","element","className","classList","add","oldClass","getAttribute","setAttribute","HyperList","create","userProvidedConfig","mergeStyle","style","getMaxBrowserHeight","wrapper","createElement","fixture","position","opacity","appendChild","body","maxElementHeight","offsetHeight","removeChild","_this","this","_config","_lastRepaint","_maxElementHeight","refresh","config","render","scrollTop","_getScrollPosition","lastRepaint","_renderAnimationFrame","window","requestAnimationFrame","diff","_averageHeight","rendered","_renderChunk","afterRender","destroy","cancelAnimationFrame","_scrollerStyle","assign","nodeType","_element","scroller","_scroller","scrollerTagName","useFragment","generate","total","Array","isArray","itemHeight","trim","_itemHeights","fill","keys","filter","prop","forEach","isValueNumber","msg","isHoriz","Boolean","horizontal","isValuePercent","slice","numberValue","parseInt","replace","innerSize","_containerSize","scrollContainer","scrollerHeight","console","warn","join","elementStyle","overflow","scrollerStyle","padding","_computeScrollPadding","_scrollPaddingBottom","bottom","_scrollPaddingTop","top","_scrollHeight","_computeScrollHeight","_itemPositions","_computePositions","_getRow","item","undefined","rowClassName","overrideScrollPosition","force","from","reverse","_getReverseFrom","_getFrom","_screenItemsLen","_lastFrom","to","_cachedItemsLen","fragment","createDocumentFragment","row","applyPatch","innerHTML","arguments","_HyperList$mergeStyle2","_this2","scrollHeight","reduce","b","sortedItemHeights","sort","middle","Math","floor","averageHeight","clientProp","containerHeight","ceil","max","scrollLeft","isReverse","styles","getComputedStyle","location","cssValue","getPropertyValue","default","treeCss","Tree","toggleListener","Map","itemClickListener","updates","hasFirstRender","getVirtualizerOptions","list","buildTreeList","model","root","setToggleListener","el","index","hasChildren","has","toggleCallback","preventDefault","stopPropagation","context","getContext","id","isExpanded","setContext","addEventListener","set","renderedTreeItem","host","querySelector","doUpdate","get","update","callback","innerElement","renderItem","renderDefaultItem","paddingLeft","level","paddingRight","itemClickCallback","values","isSelected","contextChange","emit","itemList","newLevel","children","push","componentDidLoad","initList","observer","MutationObserver","records","removed","record","removedNodes","addedNodes","an","indexOf","splice","nodeRemoved","observe","childList","componentWillRender","isListInitialized","refreshList","disconnectedCallback","hyperlist","disconnect","modelChange","itemPositions","_a","some","isNaN","Hyperlist","h","Host","treeItemCss","TreeItem","class","selected","onClick","toggle","name","size","_b","color","_c","itemClick","text"],"sources":["../../node_modules/hyperlist/dist/hyperlist.js","./src/components/tree/tree.css?tag=ix-tree&encapsulation=scoped","./src/components/tree/tree.tsx","./src/components/tree-item/tree-item.scss?tag=ix-tree-item&encapsulation=scoped","./src/components/tree-item/tree-item.tsx"],"sourcesContent":["(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.HyperList = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(_dereq_,module,exports){\n'use strict';\n\n// Default configuration.\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar defaultConfig = {\n width: '100%',\n height: '100%'\n\n // Check for valid number.\n};var isNumber = function isNumber(input) {\n return Number(input) === Number(input);\n};\n\n// Add a class to an element.\nvar addClass = 'classList' in document.documentElement ? function (element, className) {\n element.classList.add(className);\n} : function (element, className) {\n var oldClass = element.getAttribute('class') || '';\n element.setAttribute('class', oldClass + ' ' + className);\n};\n\n/**\n * Creates a HyperList instance that virtually scrolls very large amounts of\n * data effortlessly.\n */\n\nvar HyperList = function () {\n _createClass(HyperList, null, [{\n key: 'create',\n value: function create(element, userProvidedConfig) {\n return new HyperList(element, userProvidedConfig);\n }\n\n /**\n * Merge given css style on an element\n * @param {DOMElement} element\n * @param {Object} style\n */\n\n }, {\n key: 'mergeStyle',\n value: function mergeStyle(element, style) {\n for (var i in style) {\n if (element.style[i] !== style[i]) {\n element.style[i] = style[i];\n }\n }\n }\n }, {\n key: 'getMaxBrowserHeight',\n value: function getMaxBrowserHeight() {\n // Create two elements, the wrapper is `1px` tall and is transparent and\n // positioned at the top of the page. Inside that is an element that gets\n // set to 1 billion pixels. Then reads the max height the browser can\n // calculate.\n var wrapper = document.createElement('div');\n var fixture = document.createElement('div');\n\n // As said above, these values get set to put the fixture elements into the\n // right visual state.\n HyperList.mergeStyle(wrapper, { position: 'absolute', height: '1px', opacity: 0 });\n HyperList.mergeStyle(fixture, { height: '1e7px' });\n\n // Add the fixture into the wrapper element.\n wrapper.appendChild(fixture);\n\n // Apply to the page, the values won't kick in unless this is attached.\n document.body.appendChild(wrapper);\n\n // Get the maximum element height in pixels.\n var maxElementHeight = fixture.offsetHeight;\n\n // Remove the element immediately after reading the value.\n document.body.removeChild(wrapper);\n\n return maxElementHeight;\n }\n }]);\n\n function HyperList(element, userProvidedConfig) {\n var _this = this;\n\n _classCallCheck(this, HyperList);\n\n this._config = {};\n this._lastRepaint = null;\n this._maxElementHeight = HyperList.getMaxBrowserHeight();\n\n this.refresh(element, userProvidedConfig);\n\n var config = this._config;\n\n // Create internal render loop.\n var render = function render() {\n var scrollTop = _this._getScrollPosition();\n var lastRepaint = _this._lastRepaint;\n\n _this._renderAnimationFrame = window.requestAnimationFrame(render);\n\n if (scrollTop === lastRepaint) {\n return;\n }\n\n var diff = lastRepaint ? scrollTop - lastRepaint : 0;\n if (!lastRepaint || diff < 0 || diff > _this._averageHeight) {\n var rendered = _this._renderChunk();\n\n _this._lastRepaint = scrollTop;\n\n if (rendered !== false && typeof config.afterRender === 'function') {\n config.afterRender();\n }\n }\n };\n\n render();\n }\n\n _createClass(HyperList, [{\n key: 'destroy',\n value: function destroy() {\n window.cancelAnimationFrame(this._renderAnimationFrame);\n }\n }, {\n key: 'refresh',\n value: function refresh(element, userProvidedConfig) {\n var _scrollerStyle;\n\n Object.assign(this._config, defaultConfig, userProvidedConfig);\n\n if (!element || element.nodeType !== 1) {\n throw new Error('HyperList requires a valid DOM Node container');\n }\n\n this._element = element;\n\n var config = this._config;\n\n var scroller = this._scroller || config.scroller || document.createElement(config.scrollerTagName || 'tr');\n\n // Default configuration option `useFragment` to `true`.\n if (typeof config.useFragment !== 'boolean') {\n this._config.useFragment = true;\n }\n\n if (!config.generate) {\n throw new Error('Missing required `generate` function');\n }\n\n if (!isNumber(config.total)) {\n throw new Error('Invalid required `total` value, expected number');\n }\n\n if (!Array.isArray(config.itemHeight) && !isNumber(config.itemHeight)) {\n throw new Error('\\n Invalid required `itemHeight` value, expected number or array\\n '.trim());\n } else if (isNumber(config.itemHeight)) {\n this._itemHeights = Array(config.total).fill(config.itemHeight);\n } else {\n this._itemHeights = config.itemHeight;\n }\n\n // Width and height should be coerced to string representations. Either in\n // `%` or `px`.\n Object.keys(defaultConfig).filter(function (prop) {\n return prop in config;\n }).forEach(function (prop) {\n var value = config[prop];\n var isValueNumber = isNumber(value);\n\n if (value && typeof value !== 'string' && typeof value !== 'number') {\n var msg = 'Invalid optional `' + prop + '`, expected string or number';\n throw new Error(msg);\n } else if (isValueNumber) {\n config[prop] = value + 'px';\n }\n });\n\n var isHoriz = Boolean(config.horizontal);\n var value = config[isHoriz ? 'width' : 'height'];\n\n if (value) {\n var isValueNumber = isNumber(value);\n var isValuePercent = isValueNumber ? false : value.slice(-1) === '%';\n // Compute the containerHeight as number\n var numberValue = isValueNumber ? value : parseInt(value.replace(/px|%/, ''), 10);\n var innerSize = window[isHoriz ? 'innerWidth' : 'innerHeight'];\n\n if (isValuePercent) {\n this._containerSize = innerSize * numberValue / 100;\n } else {\n this._containerSize = isNumber(value) ? value : numberValue;\n }\n }\n\n var scrollContainer = config.scrollContainer;\n var scrollerHeight = config.itemHeight * config.total;\n var maxElementHeight = this._maxElementHeight;\n\n if (scrollerHeight > maxElementHeight) {\n console.warn(['HyperList: The maximum element height', maxElementHeight + 'px has', 'been exceeded; please reduce your item height.'].join(' '));\n }\n\n // Decorate the container element with styles that will match\n // the user supplied configuration.\n var elementStyle = {\n width: '' + config.width,\n height: scrollContainer ? scrollerHeight + 'px' : '' + config.height,\n overflow: scrollContainer ? 'none' : 'auto',\n position: 'relative'\n };\n\n HyperList.mergeStyle(element, elementStyle);\n\n if (scrollContainer) {\n HyperList.mergeStyle(config.scrollContainer, { overflow: 'auto' });\n }\n\n var scrollerStyle = (_scrollerStyle = {\n opacity: '0',\n position: 'absolute'\n }, _defineProperty(_scrollerStyle, isHoriz ? 'height' : 'width', '1px'), _defineProperty(_scrollerStyle, isHoriz ? 'width' : 'height', scrollerHeight + 'px'), _scrollerStyle);\n\n HyperList.mergeStyle(scroller, scrollerStyle);\n\n // Only append the scroller element once.\n if (!this._scroller) {\n element.appendChild(scroller);\n }\n\n var padding = this._computeScrollPadding();\n this._scrollPaddingBottom = padding.bottom;\n this._scrollPaddingTop = padding.top;\n\n // Set the scroller instance.\n this._scroller = scroller;\n this._scrollHeight = this._computeScrollHeight();\n\n // Reuse the item positions if refreshed, otherwise set to empty array.\n this._itemPositions = this._itemPositions || Array(config.total).fill(0);\n\n // Each index in the array should represent the position in the DOM.\n this._computePositions(0);\n\n // Render after refreshing. Force render if we're calling refresh manually.\n this._renderChunk(this._lastRepaint !== null);\n\n if (typeof config.afterRender === 'function') {\n config.afterRender();\n }\n }\n }, {\n key: '_getRow',\n value: function _getRow(i) {\n var config = this._config;\n var item = config.generate(i);\n var height = item.height;\n\n if (height !== undefined && isNumber(height)) {\n item = item.element;\n\n // The height isn't the same as predicted, compute positions again\n if (height !== this._itemHeights[i]) {\n this._itemHeights[i] = height;\n this._computePositions(i);\n this._scrollHeight = this._computeScrollHeight(i);\n }\n } else {\n height = this._itemHeights[i];\n }\n\n if (!item || item.nodeType !== 1) {\n throw new Error('Generator did not return a DOM Node for index: ' + i);\n }\n\n addClass(item, config.rowClassName || 'vrow');\n\n var top = this._itemPositions[i] + this._scrollPaddingTop;\n\n HyperList.mergeStyle(item, _defineProperty({\n position: 'absolute'\n }, config.horizontal ? 'left' : 'top', top + 'px'));\n\n return item;\n }\n }, {\n key: '_getScrollPosition',\n value: function _getScrollPosition() {\n var config = this._config;\n\n if (typeof config.overrideScrollPosition === 'function') {\n return config.overrideScrollPosition();\n }\n\n return this._element[config.horizontal ? 'scrollLeft' : 'scrollTop'];\n }\n }, {\n key: '_renderChunk',\n value: function _renderChunk(force) {\n var config = this._config;\n var element = this._element;\n var scrollTop = this._getScrollPosition();\n var total = config.total;\n\n var from = config.reverse ? this._getReverseFrom(scrollTop) : this._getFrom(scrollTop) - 1;\n\n if (from < 0 || from - this._screenItemsLen < 0) {\n from = 0;\n }\n\n if (!force && this._lastFrom === from) {\n return false;\n }\n\n this._lastFrom = from;\n\n var to = from + this._cachedItemsLen;\n\n if (to > total || to + this._cachedItemsLen > total) {\n to = total;\n }\n\n // Append all the new rows in a document fragment that we will later append\n // to the parent node\n var fragment = config.useFragment ? document.createDocumentFragment() : []\n // Sometimes you'll pass fake elements to this tool and Fragments require\n // real elements.\n\n\n // The element that forces the container to scroll.\n ;var scroller = this._scroller;\n\n // Keep the scroller in the list of children.\n fragment[config.useFragment ? 'appendChild' : 'push'](scroller);\n\n for (var i = from; i < to; i++) {\n var row = this._getRow(i);\n\n fragment[config.useFragment ? 'appendChild' : 'push'](row);\n }\n\n if (config.applyPatch) {\n return config.applyPatch(element, fragment);\n }\n\n element.innerHTML = '';\n element.appendChild(fragment);\n }\n }, {\n key: '_computePositions',\n value: function _computePositions() {\n var from = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;\n\n var config = this._config;\n var total = config.total;\n var reverse = config.reverse;\n\n if (from < 1 && !reverse) {\n from = 1;\n }\n\n for (var i = from; i < total; i++) {\n if (reverse) {\n if (i === 0) {\n this._itemPositions[0] = this._scrollHeight - this._itemHeights[0];\n } else {\n this._itemPositions[i] = this._itemPositions[i - 1] - this._itemHeights[i];\n }\n } else {\n this._itemPositions[i] = this._itemHeights[i - 1] + this._itemPositions[i - 1];\n }\n }\n }\n }, {\n key: '_computeScrollHeight',\n value: function _computeScrollHeight() {\n var _HyperList$mergeStyle2,\n _this2 = this;\n\n var config = this._config;\n var isHoriz = Boolean(config.horizontal);\n var total = config.total;\n var scrollHeight = this._itemHeights.reduce(function (a, b) {\n return a + b;\n }, 0) + this._scrollPaddingBottom + this._scrollPaddingTop;\n\n HyperList.mergeStyle(this._scroller, (_HyperList$mergeStyle2 = {\n opacity: 0,\n position: 'absolute',\n top: '0px'\n }, _defineProperty(_HyperList$mergeStyle2, isHoriz ? 'height' : 'width', '1px'), _defineProperty(_HyperList$mergeStyle2, isHoriz ? 'width' : 'height', scrollHeight + 'px'), _HyperList$mergeStyle2));\n\n // Calculate the height median\n var sortedItemHeights = this._itemHeights.slice(0).sort(function (a, b) {\n return a - b;\n });\n var middle = Math.floor(total / 2);\n var averageHeight = total % 2 === 0 ? (sortedItemHeights[middle] + sortedItemHeights[middle - 1]) / 2 : sortedItemHeights[middle];\n\n var clientProp = isHoriz ? 'clientWidth' : 'clientHeight';\n var element = config.scrollContainer ? config.scrollContainer : this._element;\n var containerHeight = element[clientProp] ? element[clientProp] : this._containerSize;\n this._screenItemsLen = Math.ceil(containerHeight / averageHeight);\n this._containerSize = containerHeight;\n\n // Cache 3 times the number of items that fit in the container viewport.\n this._cachedItemsLen = Math.max(this._cachedItemsLen || 0, this._screenItemsLen * 3);\n this._averageHeight = averageHeight;\n\n if (config.reverse) {\n window.requestAnimationFrame(function () {\n if (isHoriz) {\n _this2._element.scrollLeft = scrollHeight;\n } else {\n _this2._element.scrollTop = scrollHeight;\n }\n });\n }\n\n return scrollHeight;\n }\n }, {\n key: '_computeScrollPadding',\n value: function _computeScrollPadding() {\n var config = this._config;\n var isHoriz = Boolean(config.horizontal);\n var isReverse = config.reverse;\n var styles = window.getComputedStyle(this._element);\n\n var padding = function padding(location) {\n var cssValue = styles.getPropertyValue('padding-' + location);\n return parseInt(cssValue, 10) || 0;\n };\n\n if (isHoriz && isReverse) {\n return {\n bottom: padding('left'),\n top: padding('right')\n };\n } else if (isHoriz) {\n return {\n bottom: padding('right'),\n top: padding('left')\n };\n } else if (isReverse) {\n return {\n bottom: padding('top'),\n top: padding('bottom')\n };\n } else {\n return {\n bottom: padding('bottom'),\n top: padding('top')\n };\n }\n }\n }, {\n key: '_getFrom',\n value: function _getFrom(scrollTop) {\n var i = 0;\n\n while (this._itemPositions[i] < scrollTop) {\n i++;\n }\n\n return i;\n }\n }, {\n key: '_getReverseFrom',\n value: function _getReverseFrom(scrollTop) {\n var i = this._config.total - 1;\n\n while (i > 0 && this._itemPositions[i] < scrollTop + this._containerSize) {\n i--;\n }\n\n return i;\n }\n }]);\n\n return HyperList;\n}();\n\nexports.default = HyperList;\nmodule.exports = exports['default'];\n\n},{}]},{},[1])(1)\n});\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n:host {\n display: block;\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n Watch,\n} from '@stencil/core';\nimport Hyperlist from 'hyperlist';\nimport { renderDefaultItem } from '../tree-item/default-tree-item';\nimport {\n TreeContext,\n TreeItem,\n TreeItemContext,\n TreeItemVisual,\n TreeModel,\n UpdateCallback,\n} from './tree-model';\n\n@Component({\n tag: 'ix-tree',\n styleUrl: 'tree.css',\n scoped: true,\n})\nexport class Tree {\n @Element() host!: HTMLIxTreeElement;\n\n /**\n * Initial root element will not be rendered\n */\n @Prop() root: string;\n\n /**\n * Tree model\n */\n @Prop() model: TreeModel<any>;\n\n /**\n * Render function of tree items\n */\n @Prop() renderItem: <T = any>(\n index: number,\n data: T,\n dataList: Array<T>,\n context: TreeContext,\n update: (callback: UpdateCallback) => void\n ) => HTMLElement;\n\n /**\n * Selection and collapsed state management\n */\n @Prop({ mutable: true }) context: TreeContext = {};\n\n /**\n * Context changed\n */\n @Event() contextChange: EventEmitter<TreeContext>;\n\n /**\n * Emits removed nodes\n */\n @Event() nodeRemoved: EventEmitter<any>;\n\n private hyperlist: Hyperlist;\n\n private toggleListener = new Map<HTMLElement, Function>();\n private itemClickListener = new Map<HTMLElement, Function>();\n private updates = new Map<string, UpdateCallback>();\n\n private observer: MutationObserver;\n\n private hasFirstRender = false;\n\n private getVirtualizerOptions() {\n const list = this.buildTreeList(this.model[this.root]);\n\n let setToggleListener = (\n item: TreeItemVisual<any>,\n el: HTMLElement,\n index: number\n ) => {\n if (item.hasChildren && !this.toggleListener.has(el)) {\n const toggleCallback = (e: Event) => {\n e.preventDefault();\n e.stopPropagation();\n const context = this.getContext(list[index].id);\n context.isExpanded = !context.isExpanded;\n this.setContext(item.id, context);\n };\n el.addEventListener('toggle', toggleCallback);\n this.toggleListener.set(el, toggleCallback);\n }\n };\n\n return {\n itemHeight: 32,\n total: list.length,\n generate: (index: number) => {\n const item = list[index];\n const renderedTreeItem = this.host.querySelector(\n `[data-tree-node-id=\"${item.id}\"]`\n ) as HTMLIxTreeItemElement;\n\n const context = this.getContext(item.id);\n\n if (renderedTreeItem) {\n renderedTreeItem.hasChildren = item.hasChildren;\n renderedTreeItem.context = { ...context };\n\n setToggleListener(item, renderedTreeItem, index);\n\n if (this.updates.has(item.id)) {\n const doUpdate = this.updates.get(item.id);\n doUpdate(item, { ...this.context });\n }\n\n return renderedTreeItem;\n }\n\n const update = (callback: UpdateCallback) => {\n this.updates.set(item.id, callback);\n };\n\n let innerElement: HTMLElement | null = null;\n if (this.renderItem) {\n innerElement = this.renderItem(\n index,\n item,\n list,\n { ...this.context },\n update\n );\n }\n\n if (innerElement === null) {\n innerElement = renderDefaultItem(item, context, update);\n }\n\n const el = innerElement;\n el.setAttribute('data-tree-node-id', item.id);\n el.style.paddingLeft = item.level + 'rem';\n el.style.paddingRight = '1rem';\n\n if (!this.itemClickListener.has(el)) {\n const itemClickCallback = (e: Event) => {\n e.preventDefault();\n e.stopPropagation();\n Object.values(this.context).forEach((c) => (c.isSelected = false));\n const context = this.getContext(item.id);\n context.isSelected = true;\n this.setContext(item.id, context);\n };\n el.addEventListener('itemClick', itemClickCallback);\n this.itemClickListener.set(el, itemClickCallback);\n }\n\n setToggleListener(item, el, index);\n\n return el;\n },\n };\n }\n\n private setContext(id: string, context: TreeItemContext) {\n this.context = {\n ...this.context,\n [id]: context,\n };\n\n this.contextChange.emit(this.context);\n }\n\n private getContext(id: string): TreeItemContext {\n if (!this.context) {\n return {\n isExpanded: false,\n isSelected: false,\n };\n }\n if (!this.context[id]) {\n this.context[id] = {\n isExpanded: false,\n isSelected: false,\n };\n }\n return this.context[id];\n }\n\n private buildTreeList(\n root: TreeItem<any>,\n level: number = 0\n ): TreeItemVisual<any>[] {\n const itemList: TreeItemVisual<any>[] = [];\n\n if (root?.hasChildren) {\n const newLevel = level + 1;\n root.children.forEach((id: string) => {\n const item = this.model[id];\n const context = this.getContext(id);\n itemList.push({ ...item, level });\n if (item.hasChildren && context.isExpanded) {\n itemList.push(...this.buildTreeList(item, newLevel));\n }\n });\n }\n\n return itemList;\n }\n\n componentDidLoad() {\n this.initList();\n\n this.observer = new MutationObserver((records) => {\n let removed = [];\n\n records.forEach((record) => {\n removed = [...removed, ...Array.from(record.removedNodes)];\n\n record.addedNodes.forEach((an) => {\n const index = removed.indexOf(an);\n if (index >= 0) {\n removed.splice(index, 1);\n }\n });\n });\n\n this.nodeRemoved.emit(removed);\n });\n\n this.observer.observe(this.host, {\n childList: true,\n });\n }\n\n componentWillRender() {\n this.hasFirstRender = true;\n\n if (this.isListInitialized()) {\n this.refreshList();\n } else {\n this.initList();\n }\n }\n\n disconnectedCallback() {\n this.hyperlist.destroy();\n this.observer.disconnect();\n }\n\n @Watch('model')\n modelChange() {\n if (this.hasFirstRender && !this.isListInitialized()) {\n this.initList();\n }\n }\n\n private isListInitialized() {\n const itemPositions = this.hyperlist?._itemPositions;\n\n return (\n itemPositions !== undefined &&\n itemPositions.length &&\n !itemPositions?.some(\n (item: number) => item === undefined || Number.isNaN(item)\n )\n );\n }\n\n private refreshList() {\n if (this.hyperlist) {\n this.hyperlist.refresh(this.host, this.getVirtualizerOptions());\n }\n }\n\n private initList() {\n this.hyperlist?.destroy();\n const config = this.getVirtualizerOptions();\n this.hyperlist = new Hyperlist(this.host, config);\n }\n\n render() {\n return (\n <Host>\n <slot></slot>\n </Host>\n );\n }\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n@import 'mixins/hover';\n@import 'common-variables';\n@import 'mixins/hover';\n@import 'mixins/text-truncation';\n\n:host {\n display: flex;\n align-items: center;\n\n height: 32px;\n width: 100%;\n\n cursor: pointer;\n\n &:not(.disabled):not(:disabled):not(.selected) {\n &.hover,\n &:hover {\n background-color: var(--theme-tree-item--background--hover);\n }\n\n &.active,\n &:active {\n background-color: var(--theme-tree-item--background--active);\n }\n }\n\n &.selected {\n background-color: var(--theme-tree-item--background--selected);\n\n &.hover,\n &:hover {\n background-color: var(--theme-tree-item--background--selected-hover);\n }\n\n &.active,\n &:active {\n background-color: var(--theme-tree-item--background--selected-active);\n }\n }\n\n .tree-node-container {\n display: flex;\n align-items: center;\n height: $x-large-space;\n flex-grow: 1;\n align-items: center;\n }\n\n .icon-toggle-container {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 2rem;\n height: 2rem;\n\n ix-icon {\n transition: transform $default-time ease-in-out;\n\n &.icon-toggle-down {\n transform: rotate(90deg);\n }\n }\n }\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { Component, Event, EventEmitter, h, Host, Prop } from '@stencil/core';\nimport { TreeItemContext } from '../tree/tree-model';\n\n@Component({\n tag: 'ix-tree-item',\n styleUrl: 'tree-item.scss',\n scoped: true,\n})\nexport class TreeItem {\n /**\n * Text\n */\n @Prop() text: string;\n\n /**\n * Has tree item children\n */\n @Prop() hasChildren: boolean;\n\n /**\n * Context\n */\n @Prop() context: TreeItemContext;\n\n /**\n * Expand/Collapsed toggled\n */\n @Event() toggle: EventEmitter<void>;\n\n /**\n * Clicked\n */\n @Event() itemClick: EventEmitter<void>;\n\n render() {\n return (\n <Host\n class={{\n selected: this.context?.isSelected,\n }}\n >\n <div\n class=\"icon-toggle-container\"\n onClick={(e) => {\n e.preventDefault();\n this.toggle.emit();\n }}\n >\n {this.hasChildren ? (\n <ix-icon\n name=\"chevron-right\"\n size=\"16\"\n class={{\n ['icon-toggle-down']: this.context?.isExpanded,\n }}\n color={`color-${\n this.context?.isExpanded ? 'primary' : 'std-text'\n }`}\n />\n ) : null}\n </div>\n <div\n class=\"tree-node-container\"\n onClick={() => {\n this.itemClick.emit();\n }}\n >\n {this.text}\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"8KAAA,SAAUA,GAA6D,CAACC,EAAAC,QAAeF,GAAG,CAAyO,EAAnU,EAAqU,WAAqC,OAAO,WAAY,SAASG,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAER,GAAG,IAAIK,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIC,EAAE,mBAAmBC,GAASA,EAAQ,IAAIV,GAAGS,EAAE,OAAOA,EAAED,GAAG,GAAG,GAAGG,EAAE,OAAOA,EAAEH,GAAG,GAAG,IAAII,EAAE,IAAIC,MAAM,uBAAuBL,EAAE,KAAK,MAAMI,EAAEE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M,wBACNE,QAAUxQ,IACRA,EAAEwM,iBACFnI,KAAKoM,OAAOvC,MAAM,GAGnB7J,KAAKgI,YACJ6D,EAAA,WACEQ,KAAK,gBACLC,KAAK,KACLL,MAAO,CACL,CAAC,qBAAqBM,EAAAvM,KAAKqI,WAAO,MAAAkE,SAAA,SAAAA,EAAE/D,YAEtCgE,MAAO,WACLC,EAAAzM,KAAKqI,WAAO,MAAAoE,SAAA,SAAAA,EAAEjE,YAAa,UAAY,eAGzC,MAENqD,EAAA,OACEI,MAAM,sBACNE,QAAS,KACPnM,KAAK0M,UAAU7C,MAAM,GAGtB7J,KAAK2M,KACNd,EAAA,c"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as s,h as e,F as o,H as t,g as r,c as i}from"./p-8fcd6f85.js";const l=".sc-ix-workflow-step-h .step.sc-ix-workflow-step{display:flex;flex-direction:column;align-items:center;background-color:var(--theme-workflow-step--background);border-radius:var(--theme-workflow--border-radius);width:auto;padding:1.125rem 0 0.5rem 0;height:4rem;width:12.75rem}.sc-ix-workflow-step-h .step.sc-ix-workflow-step .wrapper.sc-ix-workflow-step{display:flex;width:100%;align-items:center;justify-content:center}.sc-ix-workflow-step-h .step.sc-ix-workflow-step .wrapper.sc-ix-workflow-step .line.sc-ix-workflow-step{width:100%;height:0.125rem;background-color:var(--theme-workflow-step-icon-default--color)}.sc-ix-workflow-step-h .step.sc-ix-workflow-step .wrapper.sc-ix-workflow-step .line.first.sc-ix-workflow-step,.sc-ix-workflow-step-h .step.sc-ix-workflow-step .wrapper.sc-ix-workflow-step .line.last.sc-ix-workflow-step{width:50%;margin:0 0 0 auto}.sc-ix-workflow-step-h .step.sc-ix-workflow-step .wrapper.sc-ix-workflow-step .line.last.sc-ix-workflow-step{margin:0 auto 0 0}.sc-ix-workflow-step-h .step.sc-ix-workflow-step .wrapper.sc-ix-workflow-step .line.selected.sc-ix-workflow-step{background-color:var(--theme-workflow-step-icon-default--color--selected)}.sc-ix-workflow-step-h .step.sc-ix-workflow-step .wrapper.sc-ix-workflow-step .line.done.sc-ix-workflow-step{background-color:var(--theme-workflow-step-icon-done--color)}.sc-ix-workflow-step-h .step.sc-ix-workflow-step .wrapper.sc-ix-workflow-step .line.done.selected.sc-ix-workflow-step{background-color:var(--theme-workflow-step-icon-done--color--selected)}.sc-ix-workflow-step-h .step.sc-ix-workflow-step .wrapper.sc-ix-workflow-step .line.warning.sc-ix-workflow-step{background-color:var(--theme-color-warning)}.sc-ix-workflow-step-h .step.sc-ix-workflow-step .wrapper.sc-ix-workflow-step .line.success.sc-ix-workflow-step{background-color:var(--theme-color-success)}.sc-ix-workflow-step-h .step.sc-ix-workflow-step .wrapper.sc-ix-workflow-step .line.error.sc-ix-workflow-step{background-color:var(--theme-color-alarm)}.sc-ix-workflow-step-h .step.sc-ix-workflow-step .wrapper.sc-ix-workflow-step .iconWrapper.sc-ix-workflow-step{display:flex;align-items:center;justify-content:center;position:absolute}.sc-ix-workflow-step-h .step.sc-ix-workflow-step .wrapper.sc-ix-workflow-step .iconWrapper.sc-ix-workflow-step .absolute.sc-ix-workflow-step{position:absolute}.sc-ix-workflow-step-h .step.sc-ix-workflow-step .text.sc-ix-workflow-step{margin-top:1rem;width:auto;padding:0 0.5rem}.sc-ix-workflow-step-h .step.vertical.sc-ix-workflow-step{flex-direction:row;padding:0}.sc-ix-workflow-step-h .step.vertical.sc-ix-workflow-step .wrapper.sc-ix-workflow-step{width:auto;padding-left:1.125rem;height:4rem}.sc-ix-workflow-step-h .step.vertical.sc-ix-workflow-step .wrapper.sc-ix-workflow-step .line.sc-ix-workflow-step{width:0.125rem;height:100%}.sc-ix-workflow-step-h .step.vertical.sc-ix-workflow-step .wrapper.sc-ix-workflow-step .line.first.sc-ix-workflow-step,.sc-ix-workflow-step-h .step.vertical.sc-ix-workflow-step .wrapper.sc-ix-workflow-step .line.last.sc-ix-workflow-step{height:50%;margin:auto 0 0 0}.sc-ix-workflow-step-h .step.vertical.sc-ix-workflow-step .wrapper.sc-ix-workflow-step .line.last.sc-ix-workflow-step{margin:0 0 auto 0}.sc-ix-workflow-step-h .step.vertical.sc-ix-workflow-step .text.sc-ix-workflow-step{margin-top:0;margin-left:1rem;padding:0}.sc-ix-workflow-step-h .step.sc-ix-workflow-step:hover{background-color:var(--theme-workflow-step--background--hover)}.sc-ix-workflow-step-h .step.sc-ix-workflow-step:active{background-color:var(--theme-workflow-step--background--active)}.sc-ix-workflow-step-h .step.sc-ix-workflow-step:focus-visible{outline:1px solid var(--focus--border-color);border-radius:0}.sc-ix-workflow-step-h .step.selected.sc-ix-workflow-step{background-color:var(--theme-workflow-step--background--selected)}.sc-ix-workflow-step-h .step.disabled.sc-ix-workflow-step{background-color:var(--theme-workflow-step--background--disabled)}.sc-ix-workflow-step-h .step.disabled.sc-ix-workflow-step .line.sc-ix-workflow-step{background-color:var(--theme-workflow-step-icon-default--color--disabled) !important}.sc-ix-workflow-step-h .step.disabled.sc-ix-workflow-step .text.sc-ix-workflow-step{color:var(--theme-workflow-step--color--disabled)}";const c=class{constructor(e){s(this,e);this.vertical=false;this.disabled=false;this.status="open";this.clickable=false;this.selected=false;this.position="undefined";this.iconName="circle";this.iconColor="workflow-step-icon-default--color"}select(){if(!this.clickable)return;if(this.disabled)return;this.selected=true;this.selectedHandler()}selectedHandler(){const s=this.selected?"--selected":"";if(this.status==="open"){this.iconName=this.selected?"circle-dot":"circle";this.iconColor=`workflow-step-icon-default--color${s}`}if(this.status==="done"&&!this.disabled){this.iconColor=`workflow-step-icon-done--color${s}`}}watchPropHandler(){switch(this.status){case"open":this.iconName="circle";this.iconColor="workflow-step-icon-default--color";break;case"success":this.iconName="success";this.iconColor="color-success";break;case"done":this.iconName="success";this.iconColor="workflow-step-icon-done--color";break;case"warning":this.iconName="warning";this.iconColor="color-warning";break;case"error":this.iconName="error";this.iconColor="color-alarm";break;default:this.iconName="circle";break}if(this.disabled){this.iconColor="workflow-step-icon-success--color--disabled"}}componentDidLoad(){this.watchPropHandler();this.selectedHandler();this.customIconSlot=!!this.hostElement.querySelector('[slot="custom-icon"]')}render(){const s=!this.customIconSlot?e(o,null,e("ix-icon",{color:"color-1",name:this.iconName==="warning"?"triangle-filled":"circle-filled",class:"absolute",size:"24"}),e("ix-icon",{color:this.iconColor,name:this.iconName,class:"absolute",size:"24"})):"";return e(t,null,e("div",{tabIndex:0,onClick:()=>this.select(),class:{step:true,selected:this.selected,vertical:this.vertical,disabled:this.disabled}},e("div",{class:"wrapper"},e("div",{class:{line:true,selected:this.selected,[this.status]:true,[this.position]:true}}),e("div",{class:"iconWrapper"},s,e("slot",{name:"custom-icon"}))),e("div",{class:"text"},e("slot",null))))}get hostElement(){return r(this)}static get watchers(){return{selected:["selectedHandler"],status:["watchPropHandler"]}}};c.style=l;const w=".sc-ix-workflow-steps-h .steps.sc-ix-workflow-steps{display:flex}.sc-ix-workflow-steps-h .steps.vertical.sc-ix-workflow-steps{display:block}";const p=class{constructor(e){s(this,e);this.stepSelected=i(this,"stepSelected",7);this.vertical=false;this.linear=false;this.clickable=false;this.selectedIndex=0}getSteps(){return Array.from(this.hostElement.querySelectorAll("ix-workflow-step"))}deselectAll(){const s=this.getSteps();s.forEach((s=>{s.setAttribute("selected","false")}))}componentDidRender(){const s=this.getSteps();s.forEach(((e,o)=>{e.setAttribute("vertical",this.vertical===true?"true":"false");e.setAttribute("clickable",this.clickable===true?"true":"false");e.setAttribute("selected",this.selectedIndex===o?"true":"false");if(o===0)e.setAttribute("position","first");if(o===s.length-1)e.setAttribute("position","last")}))}componentWillRender(){const s=this.getSteps();s.forEach(((e,o)=>{e.addEventListener("click",(()=>{if(!this.clickable)return;const t=s[o-1];if(this.linear&&t&&!["done","success"].includes(t===null||t===void 0?void 0:t.status)){return e.setAttribute("selected","false")}this.deselectAll();e.setAttribute("selected","true");this.stepSelected.emit(o)}))}))}render(){return e(t,null,e("div",{class:{steps:true,vertical:this.vertical}},e("slot",null)))}get hostElement(){return r(this)}};p.style=w;export{c as ix_workflow_step,p as ix_workflow_steps};
|
|
2
|
-
//# sourceMappingURL=p-7ce0c0e2.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["workflowStepCss","WorkflowStep","select","this","clickable","disabled","selected","selectedHandler","selectedStyle","status","iconName","iconColor","watchPropHandler","componentDidLoad","customIconSlot","hostElement","querySelector","render","icons","h","Fragment","color","name","class","size","Host","tabIndex","onClick","step","vertical","line","position","workflowStepsCss","WorkflowSteps","getSteps","Array","from","querySelectorAll","deselectAll","steps","forEach","element","setAttribute","componentDidRender","index","selectedIndex","length","componentWillRender","addEventListener","previousElement","linear","includes","stepSelected","emit"],"sources":["./src/components/workflow-step/workflow-step.scss?tag=ix-workflow-step&encapsulation=scoped","./src/components/workflow-step/workflow-step.tsx","./src/components/workflow-steps/workflow-steps.scss?tag=ix-workflow-steps&encapsulation=scoped","./src/components/workflow-steps/workflow-steps.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/*\n * COPYRIGHT (c) Siemens AG 2018-2022 ALL RIGHTS RESERVED.\n */\n\n@import 'common-variables';\n\n:host {\n .step {\n display: flex;\n flex-direction: column;\n align-items: center;\n background-color: var(--theme-workflow-step--background);\n border-radius: var(--theme-workflow--border-radius);\n width: auto;\n padding: 1.125rem 0 $small-space 0;\n height: 4rem;\n width: 12.75rem;\n\n .wrapper {\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n\n .line {\n width: 100%;\n height: 0.125rem;\n background-color: var(--theme-workflow-step-icon-default--color);\n\n &.first,\n &.last {\n width: 50%;\n margin: 0 0 0 auto;\n }\n\n &.last {\n margin: 0 auto 0 0;\n }\n\n &.selected {\n background-color: var(\n --theme-workflow-step-icon-default--color--selected\n );\n }\n\n &.done {\n background-color: var(--theme-workflow-step-icon-done--color);\n\n &.selected {\n background-color: var(\n --theme-workflow-step-icon-done--color--selected\n );\n }\n }\n\n &.warning {\n background-color: var(--theme-color-warning);\n }\n\n &.success {\n background-color: var(--theme-color-success);\n }\n\n &.error {\n background-color: var(--theme-color-alarm);\n }\n }\n\n .iconWrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n\n .absolute {\n position: absolute;\n }\n }\n }\n\n .text {\n margin-top: $default-space;\n width: auto;\n padding: 0 $small-space;\n }\n\n &.vertical {\n flex-direction: row;\n padding: 0;\n\n .wrapper {\n width: auto;\n padding-left: 1.125rem;\n height: 4rem;\n\n .line {\n width: 0.125rem;\n height: 100%;\n\n &.first,\n &.last {\n height: 50%;\n margin: auto 0 0 0;\n }\n\n &.last {\n margin: 0 0 auto 0;\n }\n }\n }\n\n .text {\n margin-top: 0;\n margin-left: $default-space;\n padding: 0;\n }\n }\n\n &:hover {\n background-color: var(--theme-workflow-step--background--hover);\n }\n\n &:active {\n background-color: var(--theme-workflow-step--background--active);\n }\n\n &:focus-visible {\n outline: 1px solid var(--focus--border-color);\n border-radius: 0;\n }\n\n &.selected {\n background-color: var(--theme-workflow-step--background--selected);\n }\n\n &.disabled {\n background-color: var(--theme-workflow-step--background--disabled);\n\n .line {\n background-color: var(\n --theme-workflow-step-icon-default--color--disabled\n ) !important;\n }\n\n .text {\n color: var(--theme-workflow-step--color--disabled);\n }\n }\n }\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/*\n * COPYRIGHT (c) Siemens AG 2018-2022 ALL RIGHTS RESERVED.\n */\n\nimport {\n Component,\n Element,\n Fragment,\n h,\n Host,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\n\n@Component({\n tag: 'ix-workflow-step',\n styleUrl: 'workflow-step.scss',\n scoped: true,\n})\nexport class WorkflowStep {\n @Element() hostElement: HTMLIxWorkflowStepElement;\n\n /**\n * Select orientation\n */\n @Prop() vertical: boolean = false;\n\n /**\n * Set disabled\n */\n @Prop() disabled: boolean = false;\n\n /**\n * Set status\n */\n @Prop() status: 'open' | 'success' | 'done' | 'warning' | 'error' = 'open';\n\n /**\n * Activate navigation click\n */\n @Prop() clickable: boolean = false;\n\n /**\n * Set selected\n */\n @Prop({ mutable: true }) selected: boolean = false;\n\n /**\n * Activate navigation click\n */\n @Prop() position: 'first' | 'last' | 'undefined' = 'undefined';\n\n @State() iconName: 'circle' | 'circle-dot' | 'success' | 'warning' | 'error' =\n 'circle';\n @State() iconColor: string = 'workflow-step-icon-default--color';\n\n private customIconSlot: boolean;\n\n private select() {\n if (!this.clickable) return;\n if (this.disabled) return;\n\n this.selected = true;\n this.selectedHandler();\n }\n\n @Watch('selected')\n selectedHandler() {\n const selectedStyle = this.selected ? '--selected' : '';\n\n if (this.status === 'open') {\n this.iconName = this.selected ? 'circle-dot' : 'circle';\n this.iconColor = `workflow-step-icon-default--color${selectedStyle}`;\n }\n\n if (this.status === 'done' && !this.disabled) {\n this.iconColor = `workflow-step-icon-done--color${selectedStyle}`;\n }\n }\n\n @Watch('status')\n watchPropHandler() {\n switch (this.status) {\n case 'open':\n this.iconName = 'circle';\n this.iconColor = 'workflow-step-icon-default--color';\n break;\n case 'success':\n this.iconName = 'success';\n this.iconColor = 'color-success';\n break;\n case 'done':\n this.iconName = 'success';\n this.iconColor = 'workflow-step-icon-done--color';\n break;\n case 'warning':\n this.iconName = 'warning';\n this.iconColor = 'color-warning';\n break;\n case 'error':\n this.iconName = 'error';\n this.iconColor = 'color-alarm';\n break;\n\n default:\n this.iconName = 'circle';\n break;\n }\n\n if (this.disabled) {\n this.iconColor = 'workflow-step-icon-success--color--disabled';\n }\n }\n\n componentDidLoad() {\n this.watchPropHandler();\n this.selectedHandler();\n\n this.customIconSlot = !!this.hostElement.querySelector(\n '[slot=\"custom-icon\"]'\n );\n }\n\n render() {\n const icons = !this.customIconSlot ? (\n <Fragment>\n <ix-icon\n color=\"color-1\"\n name={\n this.iconName === 'warning' ? 'triangle-filled' : 'circle-filled'\n }\n class=\"absolute\"\n size=\"24\"\n ></ix-icon>\n <ix-icon\n color={this.iconColor}\n name={this.iconName}\n class=\"absolute\"\n size=\"24\"\n ></ix-icon>\n </Fragment>\n ) : (\n ''\n );\n\n return (\n <Host>\n <div\n tabIndex={0}\n onClick={() => this.select()}\n class={{\n step: true,\n selected: this.selected,\n vertical: this.vertical,\n disabled: this.disabled,\n }}\n >\n <div class=\"wrapper\">\n <div\n class={{\n line: true,\n selected: this.selected,\n [this.status]: true,\n [this.position]: true,\n }}\n ></div>\n <div class=\"iconWrapper\">\n {icons}\n <slot name=\"custom-icon\"></slot>\n </div>\n </div>\n <div class=\"text\">\n <slot></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/*\n * COPYRIGHT (c) Siemens AG 2018-2022 ALL RIGHTS RESERVED.\n */\n\n@import 'common-variables';\n\n:host {\n .steps {\n display: flex;\n\n &.vertical {\n display: block;\n }\n }\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/*\n * COPYRIGHT (c) Siemens AG 2018-2022 ALL RIGHTS RESERVED.\n */\n\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n} from '@stencil/core';\n\n@Component({\n tag: 'ix-workflow-steps',\n styleUrl: 'workflow-steps.scss',\n scoped: true,\n})\nexport class WorkflowSteps {\n @Element() hostElement!: HTMLIxWorkflowStepsElement;\n\n /**\n * Select orientation\n */\n @Prop() vertical: boolean = false;\n\n /**\n * Select linear mode\n */\n @Prop() linear: boolean = false;\n\n /**\n * Activate navigation click\n */\n @Prop() clickable: boolean = false;\n\n /**\n * Activate navigation click\n */\n @Prop() selectedIndex: number = 0;\n\n /**\n * On step selected event\n */\n @Event() stepSelected: EventEmitter<number>;\n\n private getSteps() {\n return Array.from(this.hostElement.querySelectorAll('ix-workflow-step'));\n }\n\n private deselectAll() {\n const steps = this.getSteps();\n steps.forEach((element) => {\n element.setAttribute('selected', 'false');\n });\n }\n\n componentDidRender() {\n const steps = this.getSteps();\n\n steps.forEach((element, index) => {\n element.setAttribute(\n 'vertical',\n this.vertical === true ? 'true' : 'false'\n );\n element.setAttribute(\n 'clickable',\n this.clickable === true ? 'true' : 'false'\n );\n element.setAttribute(\n 'selected',\n this.selectedIndex === index ? 'true' : 'false'\n );\n if (index === 0) element.setAttribute('position', 'first');\n if (index === steps.length - 1) element.setAttribute('position', 'last');\n });\n }\n\n componentWillRender() {\n const steps = this.getSteps();\n steps.forEach((element, index) => {\n element.addEventListener('click', () => {\n if (!this.clickable) return;\n const previousElement = steps[index - 1];\n if (\n this.linear &&\n previousElement &&\n !['done', 'success'].includes(previousElement?.status)\n ) {\n return element.setAttribute('selected', 'false');\n }\n this.deselectAll();\n element.setAttribute('selected', 'true');\n this.stepSelected.emit(index);\n });\n // const isEnabled = element.getAttribute('first');\n // if(isEnabled){\n\n // }\n // console.log(isEnabled)\n // const isDisabled = element.getAttribute('disabled') !== null;\n // if (!isDisabled) element.addEventListener('click', () => '');\n //element.addEventListener('mousedown', event => this.clicked(element, index));\n });\n }\n\n render() {\n return (\n <Host>\n <div class={{ steps: true, vertical: this.vertical }}>\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"uEAAA,MAAMA,EAAkB,sqI,MC6BXC,EAAY,M,uCAMK,M,cAKA,M,YAKwC,O,eAKvC,M,cAKgB,M,cAKM,Y,cAGjD,S,eAC2B,mC,CAIrBC,SACN,IAAKC,KAAKC,UAAW,OACrB,GAAID,KAAKE,SAAU,OAEnBF,KAAKG,SAAW,KAChBH,KAAKI,iB,CAIPA,kBACE,MAAMC,EAAgBL,KA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@@
|
|
|
1
|
-
import{r as e,c as i,h as a,H as s,g as l}from"./p-8fcd6f85.js";var t;(function(e){e["SELECT_FILE"]="SELECT_FILE";e["LOADING"]="LOADING";e["UPLOAD_FAILED"]="UPLOAD_FAILED";e["UPLOAD_SUCCESSED"]="UPLOAD_SUCCESSED"})(t||(t={}));const o=".sc-ix-upload-h{display:block;min-height:4rem;height:4rem}.sc-ix-upload-h .file-upload-area.sc-ix-upload{display:flex;flex-direction:row;align-items:center;justify-content:space-between;overflow:hidden;height:100%;width:100%;padding:1rem;border:1px dashed var(--theme-upload--border-color);border-radius:var(--theme-upload--border-radius);color:var(--theme-upload-text--color)}.sc-ix-upload-h .file-upload-area.multiline.sc-ix-upload{max-height:unset;height:auto}.sc-ix-upload-h .file-upload-area.multiline.sc-ix-upload .glyph.sc-ix-upload{align-self:flex-start;-webkit-margin-before:3px;margin-block-start:3px}.sc-ix-upload-h .file-upload-area.multiline.sc-ix-upload>div.sc-ix-upload{align-self:flex-start}.sc-ix-upload-h .file-upload-area.sc-ix-upload:not(.multiline) .state.sc-ix-upload,.sc-ix-upload-h .file-upload-area.sc-ix-upload:not(.multiline) .upload-text.sc-ix-upload{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sc-ix-upload-h .file-upload-area.file-over.sc-ix-upload{border-color:var(--theme-upload--border-color--dragover);border-style:solid}.sc-ix-upload-h .file-upload-area.checking.sc-ix-upload{color:var(--theme-upload-text--color--checking);border-style:solid}.sc-ix-upload-h .file-upload-area.disabled.sc-ix-upload{border-style:solid;color:var(--theme-upload-text--color--disabled)}.sc-ix-upload-h .file-upload-area.sc-ix-upload ix-button.sc-ix-upload{-webkit-margin-start:1rem;margin-inline-start:1rem}.sc-ix-upload-h .file-upload-area.sc-ix-upload .upload-browser.sc-ix-upload{opacity:0;overflow:hidden;position:absolute;z-index:-1}.sc-ix-upload-h .file-upload-area.sc-ix-upload .loader.sc-ix-upload{margin:2.187rem auto;font-size:0.937rem;width:1rem;height:1rem;border-radius:50%;position:relative;text-indent:-9999em;animation:optimise-loading 1.1s infinite ease;transform:translateZ(0)}.sc-ix-upload-h .file-upload-area.sc-ix-upload .upload-filename.sc-ix-upload{margin-bottom:1rem}.sc-ix-upload-h .file-upload-area.sc-ix-upload .state.sc-ix-upload{display:flex;align-items:center}.sc-ix-upload-h .file-upload-area.sc-ix-upload .state.sc-ix-upload>ix-spinner.sc-ix-upload{-webkit-margin-end:0.5rem;margin-inline-end:0.5rem;height:1.5rem;width:1.5rem}.sc-ix-upload-h .file-upload-area.sc-ix-upload .state.sc-ix-upload>i.sc-ix-upload{-webkit-margin-end:0.5rem;margin-inline-end:0.5rem}.sc-ix-upload-h .file-upload-area.sc-ix-upload .state.sc-ix-upload>i.glyph-error.sc-ix-upload{color:var(--theme-color-alarm)}.sc-ix-upload-h .file-upload-area.sc-ix-upload .state.sc-ix-upload>i.glyph-success.sc-ix-upload{color:var(--theme-color-success)}";const r=class{get inputElement(){return this.hostElement.querySelector("#upload-browser")}constructor(a){e(this,a);this.filesChanged=i(this,"filesChanged",7);this.accept=undefined;this.multiple=false;this.multiline=false;this.disabled=false;this.state=t.SELECT_FILE;this.selectFileText="+ Drag files here or…";this.loadingText="Checking files…";this.uploadFailedText="Upload failed. Please try again.";this.uploadSuccessText="Upload successful";this.i18nUploadFile="Upload file…";this.i18nUploadDisabled="File upload currently not possible.";this.isFileOver=false}fileDropped(e){e.preventDefault();const i=e.dataTransfer.files;this.isFileOver=false;this.filesToUpload=this.convertToFileArray(i);this.filesChanged.emit(this.filesToUpload)}fileOver(e){e.preventDefault();e.dataTransfer.dropEffect="move";if(!this.multiple&&e.dataTransfer.items.length>1){e.preventDefault();e.stopPropagation();e.dataTransfer.effectAllowed="none";e.dataTransfer.dropEffect="none"}else{this.isFileOver=true}}fileLeave(){this.isFileOver=false}fileChangeEvent(e){this.filesToUpload=this.convertToFileArray(e.target.files);this.filesChanged.emit(this.filesToUpload);this.inputElement.type="";this.inputElement.type="file"}convertToFileArray(e){let i=[];if(e instanceof FileList){i=Array.from(e)}else{i=[e]}return i}renderUploadState(){if(this.disabled){return a("span",{class:"state"},a("span",{class:"upload-text"},this.i18nUploadDisabled))}switch(this.state){case t.SELECT_FILE:return a("span",{class:"state"},a("span",{class:"upload-text"},this.selectFileText));case t.LOADING:return a("span",{class:"state"},a("ix-spinner",{variant:"primary"}),a("span",{class:"upload-text"},this.loadingText));case t.UPLOAD_FAILED:return a("span",{class:"state"},a("i",{class:"glyph glyph-error"}),a("span",{class:"upload-text"},this.uploadFailedText));case t.UPLOAD_SUCCESSED:return a("span",{class:"state"},a("i",{class:"glyph glyph-success"}),a("span",{class:"upload-text"},this.uploadSuccessText));default:return""}}async setFilesToUpload(e){this.filesToUpload=e}render(){return a(s,null,a("div",{class:{"file-upload-area":true,"file-over":this.isFileOver,checking:this.state===t.LOADING,disabled:this.disabled,multiline:this.multiline},onDrop:e=>this.fileDropped(e),onDragOver:e=>this.fileOver(e),onDragLeave:()=>this.fileLeave(),draggable:!this.disabled},this.renderUploadState(),a("div",null,a("input",{multiple:this.multiple,type:"file",class:"upload-browser",id:"upload-browser",onChange:e=>{this.fileChangeEvent(e)},accept:this.accept}),a("ix-button",{tabindex:"-1",outline:true,onClick:()=>this.inputElement.click(),disabled:this.disabled||this.state===t.LOADING},this.i18nUploadFile))))}get hostElement(){return l(this)}};r.style=o;export{r as ix_upload};
|
|
2
|
-
//# sourceMappingURL=p-967f7d5d.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["UploadFileState","uploadCss","Upload","inputElement","this","hostElement","querySelector","constructor","hostRef","registerInstance","filesChanged","createEvent","accept","undefined","multiple","multiline","disabled","state","SELECT_FILE","selectFileText","loadingText","uploadFailedText","uploadSuccessText","i18nUploadFile","i18nUploadDisabled","isFileOver","fileDropped","evt","preventDefault","file","dataTransfer","files","filesToUpload","convertToFileArray","emit","fileOver","event","dropEffect","items","length","stopPropagation","effectAllowed","fileLeave","fileChangeEvent","target","type","filesFromEvent","FileList","Array","from","renderUploadState","h","class","LOADING","variant","UPLOAD_FAILED","UPLOAD_SUCCESSED","async","obj","render","Host","checking","onDrop","e","onDragOver","onDragLeave","draggable","id","onChange","tabindex","outline","onClick","click"],"sources":["./src/components/upload/upload-file-state.ts","./src/components/upload/upload.scss?tag=ix-upload&encapsulation=scoped","./src/components/upload/upload.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport enum UploadFileState {\n SELECT_FILE = 'SELECT_FILE',\n LOADING = 'LOADING',\n UPLOAD_FAILED = 'UPLOAD_FAILED',\n UPLOAD_SUCCESSED = 'UPLOAD_SUCCESSED',\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n@import 'common-variables';\n@import 'mixins/text-truncation';\n\n:host {\n display: block;\n min-height: 4rem;\n height: 4rem;\n\n .file-upload-area {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n\n overflow: hidden;\n\n height: 100%;\n width: 100%;\n\n padding: $default-space;\n\n border: 1px dashed var(--theme-upload--border-color);\n border-radius: var(--theme-upload--border-radius);\n color: var(--theme-upload-text--color);\n\n &.multiline {\n max-height: unset;\n height: auto;\n\n .glyph {\n align-self: flex-start;\n margin-block-start: 3px;\n }\n\n > div {\n align-self: flex-start;\n }\n }\n\n &:not(.multiline) {\n .state,\n .upload-text {\n @include ellipsis;\n }\n }\n\n &.file-over {\n border-color: var(--theme-upload--border-color--dragover);\n border-style: solid;\n }\n\n &.checking {\n color: var(--theme-upload-text--color--checking);\n border-style: solid;\n }\n\n &.disabled {\n border-style: solid;\n color: var(--theme-upload-text--color--disabled);\n }\n\n ix-button {\n margin-inline-start: $default-space;\n }\n\n .upload-browser {\n opacity: 0;\n overflow: hidden;\n position: absolute;\n z-index: -1;\n }\n\n .loader {\n margin: 2.187rem auto;\n font-size: 0.937rem;\n width: $default-space;\n height: $default-space;\n border-radius: 50%;\n position: relative;\n text-indent: -9999em;\n animation: optimise-loading 1.1s infinite ease;\n transform: translateZ(0);\n }\n\n .upload-filename {\n margin-bottom: $default-space;\n }\n\n .state {\n display: flex;\n align-items: center;\n\n > ix-spinner {\n margin-inline-end: $small-space;\n height: $large-space;\n width: $large-space;\n }\n\n > i {\n margin-inline-end: $small-space;\n\n &.glyph-error {\n color: var(--theme-color-alarm);\n }\n\n &.glyph-success {\n color: var(--theme-color-success);\n }\n }\n }\n }\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n} from '@stencil/core';\nimport { UploadFileState } from './upload-file-state';\n\n@Component({\n tag: 'ix-upload',\n styleUrl: 'upload.scss',\n scoped: true,\n})\nexport class Upload {\n /**\n * The accept attribute specifies the types of files that the server accepts (that can be submitted through a file upload).\n * [accept]{@link \"https://www.w3schools.com/tags/att_input_accept.asp\"}\n */\n @Prop() accept: string;\n\n /**\n * If multiple is true the user can drop or select multiple files\n */\n @Prop() multiple = false;\n\n /**\n * Whether the text should wrap to more than one line\n */\n @Prop() multiline = false;\n\n /**\n * Disable all input events\n */\n @Prop() disabled = false;\n\n /**\n * After a file is uploaded you can set the upload component to a defined state\n */\n @Prop() state: UploadFileState = UploadFileState.SELECT_FILE;\n\n /**\n * Will be used by state = UploadFileState.SELECT_FILE\n */\n @Prop() selectFileText = '+ Drag files here or…';\n\n /**\n * Will be used by state = UploadFileState.LOADING\n */\n @Prop() loadingText = 'Checking files…';\n\n /**\n * Will be used by state = UploadFileState.UPLOAD_FAILED\n */\n @Prop() uploadFailedText = 'Upload failed. Please try again.';\n\n /**\n * Will be used by state = UploadFileState.UPLOAD_SUCCESSED\n */\n @Prop() uploadSuccessText = 'Upload successful';\n\n /**\n * Label for upload file button\n */\n @Prop() i18nUploadFile = 'Upload file…';\n\n /**\n * Text for disabled state\n */\n @Prop() i18nUploadDisabled = 'File upload currently not possible.';\n\n /**\n * You get an array of Files after drop-action or browse action is finished\n */\n @Event() filesChanged: EventEmitter<Array<File>>;\n\n @Element() hostElement!: HTMLIxUploadElement;\n\n get inputElement(): HTMLInputElement {\n return this.hostElement.querySelector('#upload-browser');\n }\n\n @State() isFileOver = false;\n\n private filesToUpload: Array<File>;\n\n constructor() {}\n\n private fileDropped(evt: DragEvent) {\n evt.preventDefault();\n\n const file: File | FileList = evt.dataTransfer.files;\n this.isFileOver = false;\n\n this.filesToUpload = this.convertToFileArray(file);\n\n this.filesChanged.emit(this.filesToUpload);\n }\n\n private fileOver(event: DragEvent) {\n event.preventDefault();\n event.dataTransfer.dropEffect = 'move';\n\n if (!this.multiple && event.dataTransfer.items.length > 1) {\n event.preventDefault();\n event.stopPropagation();\n event.dataTransfer.effectAllowed = 'none';\n event.dataTransfer.dropEffect = 'none';\n } else {\n this.isFileOver = true;\n }\n }\n\n private fileLeave() {\n this.isFileOver = false;\n }\n\n private fileChangeEvent(event: any) {\n this.filesToUpload = this.convertToFileArray(event.target.files);\n\n this.filesChanged.emit(this.filesToUpload);\n\n // Workaround for bug in native input element, that prevents the user from uploading\n // a file with the same name as the most recent one, but with changed content.\n this.inputElement.type = '';\n this.inputElement.type = 'file';\n }\n\n private convertToFileArray(filesFromEvent: FileList | File): File[] {\n let files = [];\n if (filesFromEvent instanceof FileList) {\n files = Array.from(filesFromEvent);\n } else {\n files = [filesFromEvent];\n }\n return files;\n }\n\n private renderUploadState() {\n if (this.disabled) {\n return (\n <span class=\"state\">\n <span class=\"upload-text\">{this.i18nUploadDisabled}</span>\n </span>\n );\n }\n\n switch (this.state) {\n case UploadFileState.SELECT_FILE:\n return (\n <span class=\"state\">\n <span class=\"upload-text\">{this.selectFileText}</span>\n </span>\n );\n case UploadFileState.LOADING:\n return (\n <span class=\"state\">\n <ix-spinner variant=\"primary\"></ix-spinner>\n <span class=\"upload-text\">{this.loadingText}</span>\n </span>\n );\n case UploadFileState.UPLOAD_FAILED:\n return (\n <span class=\"state\">\n <i class=\"glyph glyph-error\"></i>\n <span class=\"upload-text\">{this.uploadFailedText}</span>\n </span>\n );\n case UploadFileState.UPLOAD_SUCCESSED:\n return (\n <span class=\"state\">\n <i class=\"glyph glyph-success\"></i>\n <span class=\"upload-text\">{this.uploadSuccessText}</span>\n </span>\n );\n default:\n return '';\n }\n }\n\n /**\n * Set files\n * @param obj\n */\n @Method()\n async setFilesToUpload(obj: any) {\n this.filesToUpload = obj;\n }\n\n render() {\n return (\n <Host>\n <div\n class={{\n 'file-upload-area': true,\n 'file-over': this.isFileOver,\n checking: this.state === UploadFileState.LOADING,\n disabled: this.disabled,\n multiline: this.multiline,\n }}\n onDrop={(e) => this.fileDropped(e)}\n onDragOver={(e) => this.fileOver(e)}\n onDragLeave={() => this.fileLeave()}\n draggable={!this.disabled}\n >\n {this.renderUploadState()}\n <div>\n <input\n multiple={this.multiple}\n type=\"file\"\n class=\"upload-browser\"\n id=\"upload-browser\"\n onChange={(e) => {\n this.fileChangeEvent(e);\n }}\n accept={this.accept}\n />\n <ix-button\n tabindex=\"-1\"\n outline\n onClick={() => this.inputElement.click()}\n disabled={this.disabled || this.state === UploadFileState.LOADING}\n >\n {this.i18nUploadFile}\n </ix-button>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"gEASA,IAAYA,GAAZ,SAAYA,GACVA,EAAA,6BACAA,EAAA,qBACAA,EAAA,iCACAA,EAAA,sCACD,EALD,CAAYA,MAAe,KCT3B,MAAMC,EAAY,mhF,MC2BLC,EAAM,MAgEbC,mBACF,OAAOC,KAAKC,YAAYC,cAAc,kB,CAOxCC,YAAAC,GAAAC,EAAAL,KAAAI,GAAAJ,KAAAM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-
{"version":3,"names":["selectCss","Select","items","Array","from","this","hostElement","querySelectorAll","selectedItems","filter","item","selected","addItemButton","querySelector","isSingleMode","mode","isMultipleMode","watchSelectedIndices","newId","selectValue","isArray","onItemClicked","event","detail","emitItemClick","watchInputText","newValue","editable","itemExists","selectedIndices","includes","i","itemSelectionChange","emit","emitAddItem","value","trim","test","document","createElement","label","addItemRef","appendChild","clearInput","addItem","ids","forEach","some","map","inputValue","_a","length","componentWillLoad","onLabelChange","preventDefault","stopImmediatePropagation","disconnectedCallback","labelMutationObserver","disconnect","find","dropdownVisibilityChanged","dropdownShow","inputRef","focus","select","navigationItem","setHoverEffectForNavigatedSelectItem","removeHiddenFromItems","hasFocus","async","code","onArrowNavigation","onEnterNavigation","inputFilterText","onItemClick","_b","dropdownRef","updatePosition","stopPropagation","selectItems","classList","contains","index","indexOf","hover","filterItemsWithTypeahead","remove","toLowerCase","add","isDropdownEmpty","every","clear","render","h","Host","class","disabled","readonly","ref","dropdownAnchor","dropdownWrapperRef","onCloseClick","e","readOnly","type","allowClear","placeholder","i18nPlaceholderEditable","i18nPlaceholder","onInput","_c","icon","ghost","oval","size","onClick","name","show","anchor","trigger","onShowChanged","placement","overwriteDropdownStyle","delegateConfig","width","triggerRef","clientWidth","title","i18nSelectListHeader","IxSelectItemLabelChangeEvent","CustomEvent","constructor","super","bubbles","selectItemCss","SelectItem","itemClick","componentDidRender","Error","labelChange","oldValue","dispatchEvent","checked"],"sources":["./src/components/select/select.scss?tag=ix-select&encapsulation=scoped","./src/components/select/select.tsx","./src/components/select-item/events.ts","./src/components/select-item/select-item.scss?tag=ix-select-item&encapsulation=scoped","./src/components/select-item/select-item.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n@import 'common-variables';\n@import 'mixins/fonts';\n@import 'mixins/hover';\n@import 'mixins/text-truncation';\n\n:host {\n display: inline-block;\n position: relative;\n height: auto;\n width: 100%;\n\n .select {\n position: relative;\n display: flex;\n align-items: center;\n height: auto;\n background-color: var(--theme-input--background);\n border: var(--theme-input--border-thickness) solid\n var(--theme-input--border-color);\n border-radius: var(--theme-input--border-radius);\n padding: 0 0 0 $small-space;\n\n @include hover {\n background-color: var(--theme-input--background--hover);\n border-color: var(--theme-input--border-color--hover);\n }\n\n &:focus-within {\n background-color: var(--theme-input--background--focus);\n border-color: var(--theme-input--border-color--focus);\n outline: 1px solid #119fff !important;\n outline-offset: var(--theme-input--focus--outline-offset);\n }\n }\n\n .trigger {\n display: flex;\n align-items: center;\n flex-grow: 1;\n height: 100%;\n }\n\n .input-container {\n display: flex;\n position: relative;\n align-items: flex-start;\n width: 100%;\n\n .chips {\n position: relative;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n height: 100%;\n max-height: 3.5rem;\n flex-grow: 1;\n overflow-y: auto;\n\n > ix-filter-chip {\n margin: 0 0.1rem;\n }\n }\n\n input {\n @include ellipsis;\n @include text-default;\n background: transparent;\n height: 1.75rem;\n width: 100%;\n\n &,\n &:hover,\n &:focus-visible {\n border: none;\n outline: none;\n }\n\n &::placeholder {\n color: var(--theme-input-select-icon--color);\n }\n\n &.hide-placeholder::placeholder {\n opacity: 0;\n }\n }\n }\n\n .chevron-down-container {\n display: flex;\n align-items: center;\n justify-content: center;\n width: $x-large-space;\n min-width: $x-large-space;\n height: 100%;\n }\n\n .editable {\n .chevron-down-container {\n @include hover {\n background-color: var(\n --theme-btn-invisible-secondary--background--hover\n );\n }\n\n @include active {\n background-color: var(\n --theme-btn-invisible-secondary--background--active\n );\n }\n }\n }\n\n .add-item {\n display: flex;\n justify-content: flex-start;\n align-items: center;\n position: relative;\n width: 100%;\n }\n\n .select-list-header {\n @include ellipsis;\n display: flex;\n align-items: center;\n height: $default-control-height;\n color: var(--theme-select-list-item-hint--color);\n margin: 0 $small-space 0 $x-large-space;\n }\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { IxSelectItemLabelChangeEvent } from '../select-item/events';\n\n@Component({\n tag: 'ix-select',\n styleUrl: 'select.scss',\n scoped: true,\n})\nexport class Select {\n @Element() hostElement!: HTMLIxSelectElement;\n\n /**\n * Indices of selected items\n */\n @Prop({ mutable: true }) selectedIndices: string | string[] = [];\n\n /**\n * Show clear button\n */\n @Prop() allowClear = false;\n\n /**\n * Selection mode\n */\n @Prop() mode: 'single' | 'multiple' = 'single';\n\n /**\n * Select is extendable\n */\n @Prop() editable = false;\n\n /**\n * If true the select will be in disabled state\n */\n @Prop() disabled = false;\n\n /**\n * If true the select will be in readonly mode\n */\n @Prop() readonly = false;\n\n /**\n * Input field placeholder\n */\n @Prop() i18nPlaceholder = 'Select an option';\n\n /**\n * Input field placeholder for editable select\n */\n @Prop() i18nPlaceholderEditable = 'Type of select option';\n\n /**\n * Select list header\n */\n @Prop() i18nSelectListHeader = 'Please select an option';\n\n /**\n * Item selection changed\n */\n @Event() itemSelectionChange: EventEmitter<string | string[]>;\n\n /**\n * Item added to selection\n */\n @Event() addItem: EventEmitter<string>;\n\n @State() dropdownShow = false;\n @State() value: string[];\n @State() dropdownWrapperRef!: HTMLElement;\n @State() dropdownAnchor!: HTMLElement;\n @State() isDropdownEmpty = false;\n @State() hasFocus = false;\n @State() navigationItem: HTMLIxSelectItemElement;\n @State() inputFilterText: string;\n @State() inputValue: string;\n\n private inputRef!: HTMLInputElement;\n private dropdownRef!: HTMLIxDropdownElement;\n private addItemRef!: HTMLDivElement;\n\n private labelMutationObserver: MutationObserver;\n\n get items() {\n return Array.from(this.hostElement.querySelectorAll('ix-select-item'));\n }\n\n get selectedItems() {\n return this.items.filter((item) => item.selected);\n }\n\n get addItemButton() {\n return this.hostElement.querySelector('.add-item');\n }\n\n get isSingleMode() {\n return this.mode === 'single';\n }\n\n get isMultipleMode() {\n return this.mode === 'multiple';\n }\n\n @Watch('selectedIndices')\n watchSelectedIndices(newId: string | string[]) {\n if (!newId) {\n this.selectValue([]);\n return;\n }\n\n if (Array.isArray(newId)) {\n this.selectValue([...newId]);\n return;\n }\n\n this.selectValue([newId]);\n }\n\n @Listen('itemClick')\n onItemClicked(event: CustomEvent<string>) {\n const newId = event.detail;\n this.emitItemClick(newId);\n }\n\n @Watch('inputFilterText')\n watchInputText(newValue: string) {\n if (!this.editable) {\n return;\n }\n\n if (this.itemExists(newValue)) {\n return;\n }\n }\n\n private emitItemClick(newId: string) {\n if (this.isMultipleMode && Array.isArray(this.selectedIndices)) {\n if (this.selectedIndices.includes(newId)) {\n this.selectedIndices = this.selectedIndices.filter((i) => i !== newId);\n } else {\n this.selectedIndices = [...this.selectedIndices, newId];\n }\n } else {\n this.selectedIndices = [newId];\n }\n\n this.selectValue(this.selectedIndices);\n this.itemSelectionChange.emit(this.selectedIndices);\n }\n\n private emitAddItem(value: string) {\n if (value.trim() === '') {\n return;\n }\n\n const test = document.createElement('ix-select-item');\n test.value = value;\n test.label = value;\n\n this.addItemRef.appendChild(test);\n\n this.clearInput();\n this.emitItemClick(value);\n this.addItem.emit(value);\n }\n\n private selectValue(ids: string[]) {\n this.items.forEach((item) => {\n item.selected = ids.some((i) => i === item.value);\n });\n\n this.value = this.selectedItems.map((item) => item.label);\n\n if (this.isSingleMode) {\n this.inputValue = this.value?.length ? this.value[0] : null;\n return;\n }\n\n this.inputValue = null;\n }\n\n componentWillLoad() {\n if (this.selectedIndices) {\n this.selectValue(\n Array.isArray(this.selectedIndices)\n ? this.selectedIndices\n : [this.selectedIndices]\n );\n }\n }\n\n @Listen('ix-select-item:labelChange')\n onLabelChange(event: IxSelectItemLabelChangeEvent) {\n event.preventDefault();\n event.stopImmediatePropagation();\n this.selectValue(\n Array.isArray(this.selectedIndices)\n ? this.selectedIndices\n : [this.selectedIndices]\n );\n }\n\n disconnectedCallback() {\n if (this.labelMutationObserver) {\n this.labelMutationObserver.disconnect();\n }\n }\n\n private itemExists(item: string) {\n return this.items.find((i) => i.label === item);\n }\n\n private dropdownVisibilityChanged(event: CustomEvent<boolean>) {\n this.dropdownShow = event.detail;\n\n if (event.detail) {\n this.inputRef.focus();\n this.inputRef.select();\n\n this.navigationItem = this.items[0];\n this.setHoverEffectForNavigatedSelectItem();\n this.removeHiddenFromItems();\n }\n this.hasFocus = event.detail;\n }\n\n @Listen('keydown', {\n target: 'window',\n })\n async onKeyDown(event: KeyboardEvent) {\n if (!this.dropdownShow) {\n return;\n }\n\n if (event.code === 'ArrowDown' || event.code === 'ArrowUp') {\n this.onArrowNavigation(event);\n }\n\n if (event.code === 'Enter' || event.code === 'NumpadEnter') {\n await this.onEnterNavigation();\n }\n\n if (event.code === 'Escape') {\n this.dropdownShow = false;\n }\n }\n\n private async onEnterNavigation() {\n if (this.isMultipleMode) {\n return;\n }\n\n if (this.editable && !this.itemExists(this.inputFilterText)) {\n this.emitAddItem(this.inputFilterText);\n this.navigationItem = this.items[this.items.length - 1];\n }\n\n this.navigationItem?.onItemClick();\n await this.dropdownRef?.updatePosition();\n\n if (this.isSingleMode && !this.editable) {\n this.dropdownShow = false;\n }\n }\n\n private onArrowNavigation(event: KeyboardEvent) {\n event.stopPropagation();\n event.preventDefault();\n\n const selectItems = this.items.filter(\n (i) => !i.classList.contains('d-none')\n );\n\n const index = selectItems.indexOf(this.navigationItem);\n\n if (event.code === 'ArrowDown' && index < selectItems.length - 1) {\n this.navigationItem = selectItems[index + 1];\n } else if (event.code === 'ArrowUp' && index > 0) {\n this.navigationItem = selectItems[index - 1];\n }\n\n this.setHoverEffectForNavigatedSelectItem();\n }\n\n private setHoverEffectForNavigatedSelectItem() {\n this.items.forEach((item: HTMLIxSelectItemElement) => {\n item.hover = item === this.navigationItem;\n });\n }\n\n private filterItemsWithTypeahead() {\n this.inputFilterText = this.inputRef.value;\n if (this.inputFilterText) {\n this.items.forEach((item) => {\n item.classList.remove('d-none');\n if (\n !item.label.toLowerCase().includes(this.inputFilterText.toLowerCase())\n ) {\n item.classList.add('d-none');\n }\n });\n } else {\n this.removeHiddenFromItems();\n }\n this.isDropdownEmpty = this.items.every((item) =>\n item.classList.contains('d-none')\n );\n }\n\n private removeHiddenFromItems() {\n this.items.forEach((item) => {\n item.classList.remove('d-none');\n });\n }\n\n private clearInput() {\n this.inputRef.value = '';\n this.inputFilterText = '';\n }\n\n private clear() {\n this.clearInput();\n this.value = [];\n this.selectedIndices = [];\n this.itemSelectionChange.emit(null);\n this.dropdownShow = false;\n }\n\n render() {\n return (\n <Host>\n <div\n class={{\n 'form-control': true,\n select: true,\n focus: this.hasFocus,\n editable: this.editable,\n disabled: this.disabled,\n readonly: this.readonly,\n }}\n ref={(ref) => {\n this.dropdownAnchor = ref;\n if (!this.editable) this.dropdownWrapperRef = ref;\n }}\n >\n <div class=\"input-container\">\n <div class=\"chips\">\n {this.isMultipleMode\n ? this.selectedItems?.map((item) => (\n <ix-filter-chip\n disabled={this.disabled || this.readonly}\n onCloseClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n this.emitItemClick(item.value);\n }}\n >\n {item.label}\n </ix-filter-chip>\n ))\n : ''}\n <div class=\"trigger\">\n <input\n data-testid=\"input\"\n disabled={this.disabled}\n readOnly={this.readonly}\n type=\"text\"\n class={{\n 'allow-clear': this.allowClear && !!this.value?.length,\n }}\n placeholder={\n this.editable\n ? this.i18nPlaceholderEditable\n : this.i18nPlaceholder\n }\n value={this.inputValue}\n ref={(ref) => (this.inputRef = ref)}\n onInput={() => this.filterItemsWithTypeahead()}\n />\n {this.isMultipleMode &&\n this.allowClear &&\n (this.value?.length || this.inputFilterText) ? (\n <ix-icon-button\n class=\"clear\"\n icon=\"clear\"\n ghost\n oval\n size=\"24\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n this.clear();\n }}\n />\n ) : null}\n {this.disabled || this.readonly ? null : (\n <div\n class=\"chevron-down-container\"\n ref={(ref) => {\n if (this.editable) this.dropdownWrapperRef = ref;\n }}\n >\n <ix-icon class=\"chevron\" name=\"chevron-down-small\" />\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n <ix-dropdown\n ref={(ref) => (this.dropdownRef = ref)}\n show={this.dropdownShow}\n class={{\n 'd-none':\n this.disabled ||\n this.readonly ||\n (this.isDropdownEmpty && !this.editable),\n }}\n anchor={this.dropdownAnchor}\n trigger={this.dropdownWrapperRef}\n onShowChanged={(e) => this.dropdownVisibilityChanged(e)}\n placement=\"auto-start\"\n overwriteDropdownStyle={async (delegateConfig) => {\n return {\n width: `${delegateConfig.triggerRef.clientWidth}px`,\n };\n }}\n >\n <div class=\"select-list-header\" title={this.i18nSelectListHeader}>\n {this.i18nSelectListHeader}\n </div>\n <slot></slot>\n <div ref={(ref) => (this.addItemRef = ref)} class=\"d-contents\"></div>\n {this.itemExists(this.inputFilterText) ? (\n ''\n ) : (\n <ix-dropdown-item\n data-testid=\"add-item\"\n icon=\"plus\"\n class={{\n 'add-item': true,\n 'd-none': !(this.editable && this.inputFilterText),\n }}\n label={this.inputFilterText}\n onItemClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n this.emitAddItem(this.inputFilterText);\n }}\n ></ix-dropdown-item>\n )}\n </ix-dropdown>\n </Host>\n );\n }\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nexport class IxSelectItemLabelChangeEvent extends CustomEvent<{\n oldValue: string;\n newValue: string;\n}> {\n constructor(detail: { oldValue: string; newValue: string }) {\n super('ix-select-item:labelChange', {\n bubbles: true,\n detail,\n });\n }\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n:host {\n display: block;\n\n ix-dropdown-item {\n button {\n margin-left: 1rem;\n }\n }\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n Watch,\n} from '@stencil/core';\nimport { IxSelectItemLabelChangeEvent } from './events';\n\n@Component({\n tag: 'ix-select-item',\n styleUrl: 'select-item.scss',\n scoped: true,\n})\nexport class SelectItem {\n @Element() hostElement: HTMLIxSelectItemElement;\n\n /**\n * Displayed name of the item\n */\n @Prop({ reflect: true }) label: string;\n\n /**\n * Item value\n */\n @Prop({ reflect: true }) value!: any;\n\n /**\n * Whether the item is selected.\n */\n @Prop() selected = false;\n\n /**\n * @internal\n */\n @Prop() hover = false;\n\n /**\n * Item clicked\n */\n @Event() itemClick: EventEmitter<string>;\n\n /**\n * @internal\n * @param event\n */\n @Method()\n async onItemClick(event?: CustomEvent<HTMLIxDropdownItemElement>) {\n event?.preventDefault();\n event?.stopPropagation();\n\n this.itemClick.emit(this.value);\n }\n\n componentDidRender() {\n if (!this.value) {\n throw Error('ix-select-item must have a `value` property');\n }\n }\n\n @Watch('label')\n labelChange(newValue: string, oldValue: string) {\n this.hostElement.dispatchEvent(\n new IxSelectItemLabelChangeEvent({\n newValue: newValue,\n oldValue: oldValue,\n })\n );\n }\n\n render() {\n return (\n <Host>\n <ix-dropdown-item\n checked={this.selected}\n hover={this.hover}\n label={this.label ? this.label : this.value}\n onItemClick={(e) => this.onItemClick(e)}\n ></ix-dropdown-item>\n </Host>\n );\n }\n}\n"],"mappings":"gEAAA,MAAMA,EAAY,0/G,MC4BLC,EAAM,M,wIAM6C,G,gBAKzC,M,UAKiB,S,cAKnB,M,cAKA,M,cAKA,M,qBAKO,mB,6BAKQ,wB,0BAKH,0B,kBAYP,M,0G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6G,MAAM,6BAA8B,CAClCC,QAAS,KACT9G,U,ECfN,MAAM+G,EAAgB,wI,MC2BTC,EAAU,M,sHAgBF,M,WAKH,K,CAYhBlE,kBAAkB/C,GAChBA,IAAK,MAALA,SAAK,SAALA,EAAOgC,iBACPhC,IAAK,MAALA,SAAK,SAALA,EAAOwD,kBAEPzE,KAAKmI,UAAUvG,KAAK5B,KAAK8B,M,CAG3BsG,qBACE,IAAKpI,KAAK8B,MAAO,CACf,MAAMuG,MAAM,8C,EAKhBC,YAAYjH,EAAkBkH,GAC5BvI,KAAKC,YAAYuI,cACf,IAAIZ,EAA6B,CAC/BvG,SAAUA,EACVkH,SAAUA,I,CAKhBhD,SACE,OACEC,EAACC,EAAI,KACHD,EAAA,oBACEiD,QAASzI,KAAKM,SACdyE,MAAO/E,KAAK+E,MACZ5C,MAAOnC,KAAKmC,MAAQnC,KAAKmC,MAAQnC,KAAK8B,MACtCuC,YAAc4B,GAAMjG,KAAKqE,YAAY4B,K"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["chipCss","Chip","getCloseButton","h","class","type","onClick","event","this","close","emit","variant","style","color","name","size","render","isInactive","active","customStyle","outline","backgroundColor","background","borderColor","Host","inactive","tabIndex","title","el","textContent","Object","assign","hidden","icon","undefined","closable"],"sources":["./src/components/chip/chip.scss?tag=ix-chip&encapsulation=scoped","./src/components/chip/chip.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n@import './chip-mixin';\n@import 'common-variables';\n@import 'mixins/text-truncation';\n\n$border-radius: 100px;\n\n:host {\n display: inline-flex;\n width: fit-content;\n position: relative;\n align-items: center;\n border-radius: $border-radius;\n padding: $small-space $medium-space;\n\n height: $default-control-height;\n max-height: $default-control-height;\n\n cursor: pointer;\n\n .with-icon {\n margin-right: $tiny-space;\n }\n\n .hidden {\n width: 0px;\n margin-right: 0px;\n }\n\n margin-left: $tiny-space;\n\n .close-button-container {\n display: inline-flex;\n flex-grow: 1;\n margin-left: $medium-space;\n }\n\n .close-button {\n position: relative;\n width: $default-space;\n height: $default-space;\n min-width: unset;\n min-height: unset;\n margin-left: auto;\n margin-right: 0;\n }\n\n @include chip();\n\n .slot-container {\n @include ellipsis;\n }\n}\n\n:host(.inactive) {\n pointer-events: none;\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n} from '@stencil/core';\n\n@Component({\n tag: 'ix-chip',\n styleUrl: 'chip.scss',\n scoped: true,\n})\nexport class Chip {\n @Element() el: HTMLIxChipElement;\n\n /**\n * Chip variant\n */\n @Prop({ reflect: true }) variant:\n | 'primary'\n | 'alarm'\n | 'critical'\n | 'warning'\n | 'info'\n | 'neutral'\n | 'success'\n | 'custom' = 'primary';\n\n /**\n * Determines if the chip is interactive. If false no user input (e.g. mouse states, keyboard navigation)\n * will be possible and also the close button will not be present.\n */\n @Prop() active = true;\n\n /**\n * Show close icon\n */\n @Prop() closable = false;\n\n /**\n * Show icon\n */\n @Prop() icon: string | undefined;\n\n /**\n * Custom color for pill. Only working for `variant='custom'`\n */\n @Prop() background: string | undefined;\n\n /**\n * Custom font color for pill. Only working for `variant='custom'`\n */\n @Prop() color: string | undefined;\n\n /**\n * Show chip with outline style\n */\n @Prop() outline = false;\n\n /**\n * Fire event if close button is clicked\n */\n @Event() close: EventEmitter;\n\n private getCloseButton() {\n return (\n <div class=\"close-button-container\">\n <button\n type=\"button\"\n class=\"btn btn-invisible-secondary btn-icon btn-oval close-button\"\n onClick={(event) => this.close.emit(event)}\n >\n {this.variant === 'custom' ? (\n <i\n class=\"glyph glyph-16 glyph-close-small\"\n style={{ color: this.color }}\n />\n ) : (\n <ix-icon name={'close-small'} size={'16'} />\n )}\n </button>\n </div>\n );\n }\n\n render() {\n const isInactive = this.active === false;\n\n let customStyle = {};\n\n if (this.variant === 'custom' && this.outline === false) {\n customStyle = {\n color: this.color,\n backgroundColor: this.background,\n };\n }\n\n if (this.variant === 'custom' && this.outline === true) {\n customStyle = {\n color: this.color,\n borderColor: this.background,\n };\n }\n\n return (\n <Host\n class={{\n outline: this.outline,\n inactive: isInactive,\n }}\n tabIndex=\"-1\"\n title={this.el.textContent}\n style={{ ...customStyle }}\n >\n <ix-icon\n class={{\n 'with-icon': true,\n hidden: this.icon === undefined || this.icon === '',\n }}\n name={this.icon}\n size={'24'}\n />\n <span class=\"slot-container\">\n <slot></slot>\n </span>\n {isInactive === false && this.closable ? this.getCloseButton() : null}\n </Host>\n );\n }\n}\n"],"mappings":"gEAAA,MAAMA,EAAU,myY,MCwBHC,EAAI,M,mEAcA,U,YAME,K,cAKE,M,gFAoBD,K,CAOVC,iBACN,OACEC,EAAA,OAAKC,MAAM,0BACTD,EAAA,UACEE,KAAK,SACLD,MAAM,6DACNE,QAAUC,GAAUC,KAAKC,MAAMC,KAAKH,IAEnCC,KAAKG,UAAY,SAChBR,EAAA,KACEC,MAAM,mCACNQ,MAAO,CAAEC,MAAOL,KAAKK,SAGvBV,EAAA,WAASW,KAAM,cAAeC,KAAM,Q,CAO9CC,SACE,MAAMC,EAAaT,KAAKU,SAAW,MAEnC,IAAIC,EAAc,GAElB,GAAIX,KAAKG,UAAY,UAAYH,KAAKY,UAAY,MAAO,CACvDD,EAAc,CACZN,MAAOL,KAAKK,MACZQ,gBAAiBb,KAAKc,W,CAI1B,GAAId,KAAKG,UAAY,UAAYH,KAAKY,UAAY,KAAM,CACtDD,EAAc,CACZN,MAAOL,KAAKK,MACZU,YAAaf,KAAKc,W,CAItB,OACEnB,EAACqB,EAAI,CACHpB,MAAO,CACLgB,QAASZ,KAAKY,QACdK,SAAUR,GAEZS,SAAS,KACTC,MAAOnB,KAAKoB,GAAGC,YACfjB,MAAKkB,OAAAC,OAAA,GAAOZ,IAEZhB,EAAA,WACEC,MAAO,CACL,YAAa,KACb4B,OAAQxB,KAAKyB,OAASC,WAAa1B,KAAKyB,OAAS,IAEnDnB,KAAMN,KAAKyB,KACXlB,KAAM,OAERZ,EAAA,QAAMC,MAAM,kBACVD,EAAA,cAEDc,IAAe,OAAST,KAAK2B,SAAW3B,KAAKN,iBAAmB,K"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,H as r,g as s}from"./p-8fcd6f85.js";import{L as o,I as n}from"./p-6f819085.js";const a=".sc-ix-category-filter-h{display:block;position:relative}.sc-ix-category-filter-h .focus.sc-ix-category-filter{border-color:var(--theme-color-primary);box-shadow:0 0 0.25rem 0 var(--theme-color-primary) !important}.sc-ix-category-filter-h .reset-button.sc-ix-category-filter{position:absolute;top:0.25rem;right:0.25rem}.sc-ix-category-filter-h .reset-button.hide-reset-button.sc-ix-category-filter{display:none}.sc-ix-category-filter-h .input-container.sc-ix-category-filter{display:flex;height:100%;max-height:3.75rem;padding:1px 1.5rem 1px 2rem}.sc-ix-category-filter-h .input-container.no-icon.sc-ix-category-filter{padding-left:0.25rem}.sc-ix-category-filter-h .token-container.sc-ix-category-filter{flex-grow:1;overflow:hidden}.sc-ix-category-filter-h .text-input.sc-ix-category-filter{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-font-smoothing:antialiased;-moz-osx-font-smooting:grayscale;font-family:Siemens Sans, sans-serif;font-size:0.875rem;font-weight:400;line-height:1.429em;color:var(--theme-color-std-text);background:transparent;flex-grow:1;height:1.75rem}.sc-ix-category-filter-h .text-input.sc-ix-category-filter,.sc-ix-category-filter-h .text-input.sc-ix-category-filter:hover,.sc-ix-category-filter-h .text-input.sc-ix-category-filter:focus-visible{border:none;outline:none}.sc-ix-category-filter-h .text-input.hide-placeholder.sc-ix-category-filter::-moz-placeholder{opacity:0}.sc-ix-category-filter-h .text-input.hide-placeholder.sc-ix-category-filter::placeholder{opacity:0}.sc-ix-category-filter-h .list-unstyled.sc-ix-category-filter{display:flex;flex-wrap:wrap;list-style:none;padding:0;margin:0;overflow-y:auto}.sc-ix-category-filter-h ix-icon.sc-ix-category-filter{position:absolute;top:0.5rem;left:0.5rem}.sc-ix-category-filter-h ix-filter-chip.sc-ix-category-filter{margin-right:0.5rem}.sc-ix-category-filter-h .category-preview.sc-ix-category-filter{display:flex;align-items:center;height:1.5rem;background-color:var(--theme-bg-3);border-top-left-radius:1rem;border-bottom-left-radius:1rem;padding:0.5rem;margin:2px 0}.sc-ix-category-filter-h ul.sc-ix-category-filter{height:100%}.sc-ix-category-filter-h ul.sc-ix-category-filter>li.sc-ix-category-filter,.sc-ix-category-filter-h input.sc-ix-category-filter{padding-top:2px;padding-bottom:2px}.sc-ix-category-filter-h ix-dropdown.sc-ix-category-filter{min-width:10rem !important}.sc-ix-category-filter-h ix-dropdown.sc-ix-category-filter .dropdown-item-container.sc-ix-category-filter{display:flex;flex-direction:column}.sc-ix-category-filter-h ix-dropdown.sc-ix-category-filter .dropdown-item-container.sc-ix-category-filter .dropdown-item.sc-ix-category-filter{-webkit-font-smoothing:antialiased;-moz-osx-font-smooting:grayscale;font-family:Siemens Sans, sans-serif;font-size:0.875rem;font-weight:400;line-height:1.143em;color:var(--theme-color-std-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;height:2.5rem;margin:0.25rem 0.5rem;padding-inline:0.5rem;border-radius:100rem;width:auto}.sc-ix-category-filter-h ix-dropdown.sc-ix-category-filter .dropdown-item-container.sc-ix-category-filter .category-item.sc-ix-category-filter{border-end-end-radius:0;border-start-end-radius:0}.sc-ix-category-filter-h ix-dropdown.sc-ix-category-filter .dropdown-item-container.sc-ix-category-filter .category-item-value.sc-ix-category-filter{border-start-start-radius:0;border-end-start-radius:0}.sc-ix-category-filter-h ix-dropdown.sc-ix-category-filter .btn-toggle-operator.sc-ix-category-filter{margin-inline:0.5rem}";const c=class{constructor(i){t(this,i);this.inputChanged=e(this,"inputChanged",7);this.filterChanged=e(this,"filterChanged",7);this.ID_CUSTOM_FILTER_VALUE="CW_CUSTOM_FILTER_VALUE";this.textInput=undefined;this.hasFocus=undefined;this.categoryLogicalOperator=o.EQUAL;this.inputValue=undefined;this.category=undefined;this.filterTokens=[];this.initialState=undefined;this.filterState=undefined;this.placeholder=undefined;this.categories=undefined;this.nonSelectableCategories={};this.suggestions=undefined;this.icon="search";this.hideIcon=undefined;this.repeatCategories=true;this.tmpDisableScrollIntoView=true;this.labelCategories="Categories";this.i18nPlainText="Filter by text"}watchFilterState(t){this.setFilterState(t)}componentDidLoad(){var t,e;if(this.initialState!==undefined){this.setFilterState(this.initialState)}else if(this.filterState!==undefined){setTimeout((()=>this.setFilterState(this.filterState)))}(t=this.hostElement)===null||t===void 0?void 0:t.addEventListener("keydown",this.handleFormElementKeyDown.bind(this));(e=this.formElement)===null||e===void 0?void 0:e.addEventListener("submit",(t=>t.preventDefault()));if(this.textInput==null){console.warn("Core UI category filter - unable to add event listeners to native input element");return}this.textInput.addEventListener("focusin",(()=>{this.hasFocus=true}));this.textInput.addEventListener("focusout",(()=>this.hasFocus=false));this.textInput.addEventListener("input",(()=>{this.inputValue=this.textInput.value;const t=new n(this.inputValue,this.category);this.inputChanged.emit(t)}));this.textInput.addEventListener("keydown",this.handleInputElementKeyDown.bind(this))}setFilterState(t){this.filterTokens=[];for(const e of t.tokens){this.addToken(e,this.ID_CUSTOM_FILTER_VALUE,this.categoryLogicalOperator,false)}for(const e of t.categories){this.addToken(e.value,e.id,e.operator,false)}this.emitFilterEvent()}closeDropdown(){this.hostElement.querySelector("ix-dropdown").show=false}handleFormElementKeyDown(t){switch(t.code){case"Enter":case"NumpadEnter":if(!document.activeElement.classList.contains("dropdown-item")){return}const e=document.activeElement.getAttribute("data-id");if(this.hasCategorySelection()){if(this.category){this.addToken(e,this.category)}else if(document.activeElement.classList.contains("category-item-id")){this.selectCategory(e)}}else{this.addToken(e)}t.preventDefault();break;case"ArrowUp":this.focusPreviousItem();t.preventDefault();break;case"ArrowDown":this.focusNextItem();t.preventDefault();break;case"Escape":this.closeDropdown();break}}focusPreviousItem(){const t=document.activeElement.previousSibling;if(t instanceof HTMLElement){t.focus()}}focusNextItem(){const t=document.activeElement.nextSibling;if(t instanceof HTMLElement){t.focus()}}handleInputElementKeyDown(t){var e;switch(t.code){case"ArrowDown":const i=`.category-item-${this.category?"value":"id"}`;let r=this.hostElement.querySelector(i);if(r instanceof HTMLElement){r.focus();t.stopPropagation()}else if((e=this.suggestions)===null||e===void 0?void 0:e.length){r=this.hostElement.querySelector(".category-item");if(r instanceof HTMLElement){r.focus();t.stopPropagation()}}break;case"Backspace":if(this.textInput.value!==""){return}if(this.category){this.category=undefined;return}const s=this.filterTokens.length;if(s>0){this.removeToken(s-1)}break;case"Enter":case"NumpadEnter":this.addToken(this.inputValue,this.category);t.preventDefault();break}}emitFilterEvent(){const t=this.filterTokens.filter((t=>t.id===this.ID_CUSTOM_FILTER_VALUE)).map((t=>t.value));const e=this.filterTokens.filter((t=>t.id!==this.ID_CUSTOM_FILTER_VALUE));const i={tokens:t,categories:e};this.filterChanged.emit(i)}addToken(t,e=this.ID_CUSTOM_FILTER_VALUE,i=this.categoryLogicalOperator,r=true){if(t===undefined||t===null){return}const s=t.trim();if(s===""){return}if(this.filterTokens.find((t=>(t===null||t===void 0?void 0:t.value)===s))){return}const n={id:e,value:s,operator:i};this.filterTokens=[...this.filterTokens,n];this.textInput.value="";this.inputValue="";this.categoryLogicalOperator=o.EQUAL;if(this.category){this.category=undefined}this.isScrollStateDirty=true;this.textInput.focus();if(r){this.emitFilterEvent()}this.closeDropdown()}removeToken(t){this.filterTokens=this.filterTokens.filter(((e,i)=>i!==t));this.emitFilterEvent()}getCategoryIds(){const t=[];for(const e in this.categories){if(Object.prototype.hasOwnProperty.call(this.categories,e)){t.push(e)}}return t}selectCategory(t){this.category=t;this.textInput.value="";this.inputValue="";this.textInput.focus()}resetFilter(){this.closeDropdown();this.filterTokens=[];this.emitFilterEvent()}filterMultiples(t){if(this.repeatCategories){return true}const e=this.filterTokens.find((e=>e.id===t));return!e}filterDuplicateTokens(t){const e=this.filterTokens.some((e=>e.value===t));return!e}filterByInput(t){if(this.inputValue===undefined||this.inputValue===""){return true}return t.toLowerCase().indexOf(this.inputValue.toLowerCase())!==-1}toggleCategoryOperator(){switch(this.categoryLogicalOperator){case o.EQUAL:this.categoryLogicalOperator=o.NOT_EQUAL;break;case o.NOT_EQUAL:this.categoryLogicalOperator=o.EQUAL;break}}getFilterChipLabel(t){var e,i,r;if(t.id===this.ID_CUSTOM_FILTER_VALUE){return t.value}const s=t.operator===o.EQUAL?"=":"!=";const n=(r=(i=(e=this.categories[t.id])===null||e===void 0?void 0:e.label)!==null&&i!==void 0?i:this.nonSelectableCategories[t.id])!==null&&r!==void 0?r:t.id;return`${n} ${s} ${t.value}`}getFilteredSuggestions(){var t,e;if(!((t=this.suggestions)===null||t===void 0?void 0:t.length)){return[]}return(e=this.suggestions)===null||e===void 0?void 0:e.filter((t=>this.filterByInput(t))).filter((t=>this.filterDuplicateTokens(t)))}hasCategorySelection(){return this.categories!==undefined}displayDropdown(){if(this.hasCategorySelection()){return true}if(this.suggestions!==undefined){return this.getFilteredSuggestions().length>0}return false}renderPlainSuggestions(){return i("div",{class:"dropdown-item-container"},this.getFilteredSuggestions().map((t=>i("button",{class:"dropdown-item","data-id":t,onClick:()=>this.addToken(t),key:t,title:t},t))))}renderCategoryValues(){var t,e;return i("div",{class:"dropdown-item-container"},i("button",{class:"btn btn-invisible-secondary btn-icon btn-toggle-operator",onClick:()=>this.toggleCategoryOperator(),tabindex:"-1"},this.categoryLogicalOperator===o.NOT_EQUAL?"=":"!="),i("div",{class:"dropdown-header"},(t=this.categories[this.category])===null||t===void 0?void 0:t.label),(e=this.categories[this.category])===null||e===void 0?void 0:e.options.filter((t=>this.filterByInput(t))).filter((t=>this.filterDuplicateTokens(t))).map((t=>i("button",{class:"dropdown-item category-item-value","data-id":t,title:t,key:t,onClick:()=>this.addToken(t,this.category)},`${this.categoryLogicalOperator===o.EQUAL?"=":"!="} ${t}`))))}renderDropdownContent(){if(this.hasCategorySelection()){if(this.category){return this.renderCategoryValues()}else{return this.renderCategorySelection()}}else return this.renderPlainSuggestions()}renderCategorySelection(){var t;return i("div",{class:"dropdown-item-container"},(t=this.getCategoryIds())===null||t===void 0?void 0:t.filter((t=>this.filterByInput(this.categories[t].label))).filter((t=>this.filterMultiples(t))).map((t=>{var e;return i("button",{class:"dropdown-item category-item category-item-id","data-id":t,title:this.categories[t].label,key:t,onClick:()=>this.selectCategory(t),tabindex:"0"},(e=this.categories[t])===null||e===void 0?void 0:e.label)})))}getDropdownHeader(){if(this.categories){if(this.category){return null}else{return this.labelCategories}}return this.i18nPlainText}componentDidRender(){if(this.isScrollStateDirty){if(!this.tmpDisableScrollIntoView){this.textInput.scrollIntoView()}this.isScrollStateDirty=false}}getResetButton(){return i("ix-icon-button",{onClick:()=>this.resetFilter(),class:{"reset-button":true,"hide-reset-button":!this.filterTokens.length&&!this.category},variant:"Secondary",ghost:true,oval:true,icon:"clear",size:"16",tabindex:"1"})}render(){var t;return i(r,null,i("form",{ref:t=>this.formElement=t},i("div",{class:{"form-control":true,"input-container":true,focus:this.hasFocus,"no-icon":this.hideIcon}},i("ix-icon",{class:{"d-none":this.hideIcon},name:this.icon,size:"16"}),i("div",{class:"token-container"},i("ul",{class:"list-unstyled"},this.filterTokens.map(((t,e)=>i("li",{key:t.toString(),class:{animate__animated:true,animate__fadein:true}},i("ix-filter-chip",{onCloseClick:()=>this.removeToken(e)},this.getFilterChipLabel(t))))),this.categories===undefined?"":i("li",{class:{"category-preview":true,"d-none":!this.category}},(t=this.categories[this.category])===null||t===void 0?void 0:t.label),i("input",{class:{"text-input":true,"hide-placeholder":this.category!==undefined},ref:t=>this.textInput=t,type:"text",placeholder:this.placeholder}))),this.getResetButton())),i("ix-dropdown",{closeBehavior:"outside",trigger:this.textInput,triggerEvent:["click","focus"],header:this.getDropdownHeader(),class:{"d-none":!this.displayDropdown()}},this.renderDropdownContent()))}get hostElement(){return s(this)}static get watchers(){return{filterState:["watchFilterState"]}}};c.style=a;export{c as ix_category_filter};
|
|
2
|
-
//# sourceMappingURL=p-d7def96c.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["categoryFilterCss","CategoryFilter","this","ID_CUSTOM_FILTER_VALUE","LogicalFilterOperator","EQUAL","watchFilterState","newValue","setFilterState","componentDidLoad","initialState","undefined","filterState","setTimeout","_a","hostElement","addEventListener","handleFormElementKeyDown","bind","_b","formElement","e","preventDefault","textInput","console","warn","hasFocus","inputValue","value","inputState","InputState","category","inputChanged","emit","handleInputElementKeyDown","state","filterTokens","token","tokens","addToken","categoryLogicalOperator","categories","id","operator","emitFilterEvent","closeDropdown","querySelector","show","code","document","activeElement","classList","contains","getAttribute","hasCategorySelection","selectCategory","focusPreviousItem","focusNextItem","sibling","previousSibling","HTMLElement","focus","nextSibling","selector","item","stopPropagation","suggestions","length","tokenCount","removeToken","filter","map","filterChanged","emitEvent","newToken","trim","find","pair","isScrollStateDirty","index","_","i","getCategoryIds","ids","Object","prototype","hasOwnProperty","call","push","resetFilter","filterMultiples","repeatCategories","isCategoryAlreadySet","filterDuplicateTokens","isTokenAlreadySet","some","filterByInput","toLowerCase","indexOf","toggleCategoryOperator","NOT_EQUAL","getFilterChipLabel","operatorString","label","_c","nonSelectableCategories","getFilteredSuggestions","displayDropdown","renderPlainSuggestions","h","class","suggestion","onClick","key","title","renderCategoryValues","tabindex","options","renderDropdownContent","renderCategorySelection","getDropdownHeader","labelCategories","i18nPlainText","componentDidRender","tmpDisableScrollIntoView","scrollIntoView","getResetButton","variant","ghost","oval","icon","size","render","Host","ref","el","hideIcon","name","toString","animate__animated","animate__fadein","onCloseClick","type","placeholder","closeBehavior","trigger","triggerEvent","header"],"sources":["./src/components/category-filter/category-filter.scss?tag=ix-category-filter&encapsulation=scoped","./src/components/category-filter/category-filter.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n@import 'common-variables';\n@import 'mixins/fonts';\n@import 'mixins/hover';\n@import 'mixins/shadows';\n@import 'mixins/text-truncation';\n\n:host {\n display: block;\n position: relative;\n\n .focus {\n border-color: var(--theme-color-primary);\n box-shadow: 0 0 $tiny-space 0 var(--theme-color-primary) !important;\n }\n\n .reset-button {\n position: absolute;\n top: $tiny-space;\n right: $tiny-space;\n }\n\n .reset-button.hide-reset-button {\n display: none;\n }\n\n .input-container {\n display: flex;\n height: 100%;\n max-height: 3.75rem;\n padding: 1px $large-space 1px $x-large-space;\n\n &.no-icon {\n padding-left: $tiny-space;\n }\n }\n\n .token-container {\n flex-grow: 1;\n overflow: hidden;\n }\n\n .text-input {\n @include ellipsis;\n @include text-default;\n background: transparent;\n flex-grow: 1;\n height: 1.75rem;\n\n &,\n &:hover,\n &:focus-visible {\n border: none;\n outline: none;\n }\n\n &.hide-placeholder::placeholder {\n opacity: 0;\n }\n }\n\n .list-unstyled {\n display: flex;\n flex-wrap: wrap;\n list-style: none;\n padding: 0;\n margin: 0;\n overflow-y: auto;\n }\n\n ix-icon {\n position: absolute;\n top: $small-space;\n left: $small-space;\n }\n\n ix-filter-chip {\n margin-right: $small-space;\n }\n\n .category-preview {\n display: flex;\n align-items: center;\n height: $large-space;\n background-color: var(--theme-bg-3);\n border-top-left-radius: $default-space;\n border-bottom-left-radius: $default-space;\n padding: $small-space;\n margin: 2px 0;\n }\n\n ul {\n height: 100%;\n }\n\n ul > li,\n input {\n padding-top: 2px;\n padding-bottom: 2px;\n }\n\n ix-dropdown {\n min-width: 10rem !important;\n\n .dropdown-item-container {\n display: flex;\n flex-direction: column;\n\n .dropdown-item {\n @include text-default-single;\n @include ellipsis;\n height: $large-control-height;\n margin: $tiny-space $small-space;\n padding-inline: $small-space;\n border-radius: 100rem;\n width: auto;\n }\n\n .category-item {\n border-end-end-radius: 0;\n border-start-end-radius: 0;\n }\n\n .category-item-value {\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n }\n }\n\n .btn-toggle-operator {\n margin-inline: $small-space;\n }\n }\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { FilterState } from './filter-state';\nimport { InputState } from './input-state';\nimport { LogicalFilterOperator } from './logical-filter-operator';\n\n@Component({\n tag: 'ix-category-filter',\n styleUrl: 'category-filter.scss',\n scoped: true,\n})\nexport class CategoryFilter {\n private readonly ID_CUSTOM_FILTER_VALUE = 'CW_CUSTOM_FILTER_VALUE';\n\n @State() private textInput?: HTMLInputElement;\n private formElement?: HTMLFormElement;\n private isScrollStateDirty: boolean;\n\n @Element() hostElement: HTMLIxCategoryFilterElement;\n\n @State() hasFocus: boolean;\n @State() categoryLogicalOperator = LogicalFilterOperator.EQUAL;\n @State() inputValue: string;\n @State() category: string;\n @State() filterTokens: Array<{\n id: string;\n value: string;\n operator: LogicalFilterOperator;\n }> = [];\n\n /**\n * When set this will initially populate the component with the provided search criteria.\n * This will trigger all input events accordingly.\n * @deprecated Will be removed with 2.0.0. Use the member filterState instead.\n */\n @Prop() initialState: FilterState;\n\n /**\n * A set of search criteria to populate the component with.\n */\n @Prop() filterState: FilterState;\n\n /**\n * Placeholder text to be displayed in an empty input field.\n */\n @Prop() placeholder: string;\n\n /**\n * Configuration object hash used to populate the dropwdown menu for typeahead and quick selection functionality.\n * Each ID maps to an object with a label and an array of options to select from.\n */\n @Prop() categories: {\n [id: string]: {\n label: string;\n options: string[];\n };\n };\n\n /**\n * In certain use cases some categories may not be available for selection anymore.\n * To allow proper display of set filters with these categories this ID to label mapping can be populated.\n *\n * Configuration object hash used to supply labels to the filter chips in the input field.\n * Each ID maps to a string representing the label to display.\n */\n @Prop() nonSelectableCategories?: {\n [id: string]: string;\n } = {};\n\n /**\n * A list of strings that will be supplied as typeahead suggestions not tied to any categories.\n */\n @Prop() suggestions: string[];\n\n /**\n * The icon next to the actual text input\n * Defaults to 'search'\n */\n @Prop() icon = 'search';\n\n /**\n * Allows to hide the icon inside the text input.\n * Defaults to false\n */\n @Prop() hideIcon: boolean;\n\n /**\n * If set to true allows that a single category can be set more than once.\n * An already set category will not appear in the category dropdown if set to false.\n *\n * Defaults to true\n */\n @Prop() repeatCategories = true;\n\n /**\n * @internal For debugging purposes only!\n */\n @Prop() tmpDisableScrollIntoView = true;\n\n /**\n * i18n\n */\n @Prop() labelCategories = 'Categories';\n\n /**\n * i18n\n */\n @Prop() i18nPlainText = 'Filter by text';\n\n /**\n * Event dispatched whenever the text input changes.\n */\n @Event() inputChanged: EventEmitter<InputState>;\n\n /**\n * Event dispatched whenever the filter state changes.\n */\n @Event() filterChanged: EventEmitter<FilterState>;\n\n @Watch('filterState')\n watchFilterState(newValue) {\n this.setFilterState(newValue);\n }\n\n componentDidLoad() {\n if (this.initialState !== undefined) {\n this.setFilterState(this.initialState);\n } else if (this.filterState !== undefined) {\n setTimeout(() => this.setFilterState(this.filterState));\n }\n\n this.hostElement?.addEventListener(\n 'keydown',\n this.handleFormElementKeyDown.bind(this)\n );\n\n this.formElement?.addEventListener('submit', (e) => e.preventDefault());\n\n if (this.textInput == null) {\n console.warn(\n 'Core UI category filter - unable to add event listeners to native input element'\n );\n return;\n }\n\n this.textInput.addEventListener('focusin', () => {\n this.hasFocus = true;\n });\n this.textInput.addEventListener('focusout', () => (this.hasFocus = false));\n this.textInput.addEventListener('input', () => {\n this.inputValue = this.textInput.value;\n const inputState = new InputState(this.inputValue, this.category);\n this.inputChanged.emit(inputState);\n });\n this.textInput.addEventListener(\n 'keydown',\n this.handleInputElementKeyDown.bind(this)\n );\n }\n\n private setFilterState(state: FilterState) {\n this.filterTokens = [];\n\n for (const token of state.tokens) {\n this.addToken(\n token,\n this.ID_CUSTOM_FILTER_VALUE,\n this.categoryLogicalOperator,\n false\n );\n }\n\n for (const category of state.categories) {\n this.addToken(category.value, category.id, category.operator, false);\n }\n\n this.emitFilterEvent();\n }\n\n private closeDropdown() {\n this.hostElement.querySelector('ix-dropdown').show = false;\n }\n\n private handleFormElementKeyDown(e: KeyboardEvent) {\n switch (e.code) {\n case 'Enter':\n case 'NumpadEnter':\n if (!document.activeElement.classList.contains('dropdown-item')) {\n return;\n }\n\n const token = document.activeElement.getAttribute('data-id');\n\n if (this.hasCategorySelection()) {\n if (this.category) {\n this.addToken(token, this.category);\n } else if (\n document.activeElement.classList.contains('category-item-id')\n ) {\n this.selectCategory(token);\n }\n } else {\n this.addToken(token);\n }\n\n e.preventDefault();\n break;\n\n case 'ArrowUp':\n this.focusPreviousItem();\n e.preventDefault();\n break;\n\n case 'ArrowDown':\n this.focusNextItem();\n e.preventDefault();\n break;\n\n case 'Escape':\n this.closeDropdown();\n break;\n }\n }\n\n private focusPreviousItem() {\n const sibling = document.activeElement.previousSibling;\n if (sibling instanceof HTMLElement) {\n sibling.focus();\n }\n }\n\n private focusNextItem() {\n const sibling = document.activeElement.nextSibling;\n if (sibling instanceof HTMLElement) {\n sibling.focus();\n }\n }\n\n private handleInputElementKeyDown(e: KeyboardEvent) {\n switch (e.code) {\n case 'ArrowDown':\n const selector = `.category-item-${this.category ? 'value' : 'id'}`;\n let item = this.hostElement.querySelector(selector);\n\n if (item instanceof HTMLElement) {\n item.focus();\n e.stopPropagation();\n } else if (this.suggestions?.length) {\n item = this.hostElement.querySelector('.category-item');\n if (item instanceof HTMLElement) {\n item.focus();\n e.stopPropagation();\n }\n }\n break;\n\n case 'Backspace':\n if (this.textInput.value !== '') {\n return;\n }\n\n if (this.category) {\n this.category = undefined;\n return;\n }\n\n const tokenCount = this.filterTokens.length;\n if (tokenCount > 0) {\n this.removeToken(tokenCount - 1);\n }\n break;\n\n case 'Enter':\n case 'NumpadEnter':\n this.addToken(this.inputValue, this.category);\n e.preventDefault();\n break;\n }\n }\n\n private emitFilterEvent() {\n const tokens = this.filterTokens\n .filter((item) => item.id === this.ID_CUSTOM_FILTER_VALUE)\n .map((item) => item.value);\n const categories = this.filterTokens.filter(\n (item) => item.id !== this.ID_CUSTOM_FILTER_VALUE\n );\n const filterState: FilterState = {\n tokens,\n categories,\n };\n\n this.filterChanged.emit(filterState);\n }\n\n private addToken(\n token: string,\n category: string = this.ID_CUSTOM_FILTER_VALUE,\n operator = this.categoryLogicalOperator,\n emitEvent = true\n ) {\n if (token === undefined || token === null) {\n return;\n }\n\n const newToken = token.trim();\n\n if (newToken === '') {\n return;\n }\n\n if (this.filterTokens.find((value) => value?.value === newToken)) {\n return;\n }\n\n const pair = { id: category, value: newToken, operator };\n this.filterTokens = [...this.filterTokens, pair];\n this.textInput.value = '';\n this.inputValue = '';\n this.categoryLogicalOperator = LogicalFilterOperator.EQUAL;\n\n if (this.category) {\n this.category = undefined;\n }\n\n this.isScrollStateDirty = true;\n\n this.textInput.focus();\n\n if (emitEvent) {\n this.emitFilterEvent();\n }\n\n this.closeDropdown();\n }\n\n private removeToken(index: number) {\n this.filterTokens = this.filterTokens.filter((_, i) => i !== index);\n this.emitFilterEvent();\n }\n\n private getCategoryIds() {\n const ids = [];\n for (const id in this.categories) {\n if (Object.prototype.hasOwnProperty.call(this.categories, id)) {\n ids.push(id);\n }\n }\n\n return ids;\n }\n\n private selectCategory(category: string) {\n this.category = category;\n this.textInput.value = '';\n this.inputValue = '';\n this.textInput.focus();\n }\n\n private resetFilter() {\n this.closeDropdown();\n this.filterTokens = [];\n this.emitFilterEvent();\n }\n\n private filterMultiples(value: string) {\n if (this.repeatCategories) {\n return true;\n }\n\n const isCategoryAlreadySet = this.filterTokens.find(\n (token) => token.id === value\n );\n\n return !isCategoryAlreadySet;\n }\n\n private filterDuplicateTokens(value: string) {\n const isTokenAlreadySet = this.filterTokens.some(\n (token) => token.value === value\n );\n return !isTokenAlreadySet;\n }\n\n private filterByInput(value: string) {\n if (this.inputValue === undefined || this.inputValue === '') {\n return true;\n }\n\n return value.toLowerCase().indexOf(this.inputValue.toLowerCase()) !== -1;\n }\n\n private toggleCategoryOperator() {\n switch (this.categoryLogicalOperator) {\n case LogicalFilterOperator.EQUAL:\n this.categoryLogicalOperator = LogicalFilterOperator.NOT_EQUAL;\n break;\n\n case LogicalFilterOperator.NOT_EQUAL:\n this.categoryLogicalOperator = LogicalFilterOperator.EQUAL;\n break;\n }\n }\n\n private getFilterChipLabel(value: {\n id: string;\n value: string;\n operator: LogicalFilterOperator;\n }): string {\n if (value.id === this.ID_CUSTOM_FILTER_VALUE) {\n return value.value;\n }\n\n const operatorString =\n value.operator === LogicalFilterOperator.EQUAL ? '=' : '!=';\n const label =\n this.categories[value.id]?.label ??\n this.nonSelectableCategories[value.id] ??\n value.id;\n\n return `${label} ${operatorString} ${value.value}`;\n }\n\n private getFilteredSuggestions() {\n if (!this.suggestions?.length) {\n return [];\n }\n\n return this.suggestions\n ?.filter((value) => this.filterByInput(value))\n .filter((value) => this.filterDuplicateTokens(value));\n }\n\n private hasCategorySelection() {\n return this.categories !== undefined;\n }\n\n private displayDropdown() {\n if (this.hasCategorySelection()) {\n return true;\n }\n\n if (this.suggestions !== undefined) {\n return this.getFilteredSuggestions().length > 0;\n }\n\n return false;\n }\n\n private renderPlainSuggestions() {\n return (\n <div class=\"dropdown-item-container\">\n {this.getFilteredSuggestions().map((suggestion) => (\n <button\n class=\"dropdown-item\"\n data-id={suggestion}\n onClick={() => this.addToken(suggestion)}\n key={suggestion}\n title={suggestion}\n >\n {suggestion}\n </button>\n ))}\n </div>\n );\n }\n\n private renderCategoryValues() {\n return (\n <div class=\"dropdown-item-container\">\n <button\n class=\"btn btn-invisible-secondary btn-icon btn-toggle-operator\"\n onClick={() => this.toggleCategoryOperator()}\n tabindex=\"-1\"\n >\n {this.categoryLogicalOperator === LogicalFilterOperator.NOT_EQUAL\n ? '='\n : '!='}\n </button>\n <div class=\"dropdown-header\">\n {this.categories[this.category]?.label}\n </div>\n {this.categories[this.category]?.options\n .filter((value) => this.filterByInput(value))\n .filter((value) => this.filterDuplicateTokens(value))\n .map((id) => (\n <button\n class=\"dropdown-item category-item-value\"\n data-id={id}\n title={id}\n key={id}\n onClick={() => this.addToken(id, this.category)}\n >\n {`${\n this.categoryLogicalOperator === LogicalFilterOperator.EQUAL\n ? '='\n : '!='\n } ${id}`}\n </button>\n ))}\n </div>\n );\n }\n\n private renderDropdownContent() {\n if (this.hasCategorySelection()) {\n if (this.category) {\n return this.renderCategoryValues();\n } else {\n return this.renderCategorySelection();\n }\n } else return this.renderPlainSuggestions();\n }\n\n private renderCategorySelection() {\n return (\n <div class=\"dropdown-item-container\">\n {this.getCategoryIds()\n ?.filter((id) => this.filterByInput(this.categories[id].label))\n .filter((id) => this.filterMultiples(id))\n .map((id) => (\n <button\n class=\"dropdown-item category-item category-item-id\"\n data-id={id}\n title={this.categories[id].label}\n key={id}\n onClick={() => this.selectCategory(id)}\n tabindex=\"0\"\n >\n {this.categories[id]?.label}\n </button>\n ))}\n </div>\n );\n }\n\n private getDropdownHeader() {\n if (this.categories) {\n if (this.category) {\n return null;\n } else {\n return this.labelCategories;\n }\n }\n\n return this.i18nPlainText;\n }\n\n componentDidRender() {\n if (this.isScrollStateDirty) {\n if (!this.tmpDisableScrollIntoView) {\n this.textInput.scrollIntoView();\n }\n this.isScrollStateDirty = false;\n }\n }\n\n private getResetButton() {\n return (\n <ix-icon-button\n onClick={() => this.resetFilter()}\n class={{\n 'reset-button': true,\n 'hide-reset-button': !this.filterTokens.length && !this.category,\n }}\n variant=\"Secondary\"\n ghost\n oval\n icon=\"clear\"\n size=\"16\"\n tabindex=\"1\"\n ></ix-icon-button>\n );\n }\n\n render() {\n return (\n <Host>\n <form ref={(el) => (this.formElement = el)}>\n <div\n class={{\n 'form-control': true,\n 'input-container': true,\n focus: this.hasFocus,\n 'no-icon': this.hideIcon,\n }}\n >\n <ix-icon\n class={{ 'd-none': this.hideIcon }}\n name={this.icon}\n size=\"16\"\n ></ix-icon>\n <div class=\"token-container\">\n <ul class=\"list-unstyled\">\n {this.filterTokens.map((value, index) => (\n <li\n key={value.toString()}\n class={{\n animate__animated: true,\n animate__fadein: true,\n }}\n >\n <ix-filter-chip\n onCloseClick={() => this.removeToken(index)}\n >\n {this.getFilterChipLabel(value)}\n </ix-filter-chip>\n </li>\n ))}\n {this.categories === undefined ? (\n ''\n ) : (\n <li\n class={{\n 'category-preview': true,\n 'd-none': !this.category,\n }}\n >\n {this.categories[this.category]?.label}\n </li>\n )}\n <input\n class={{\n 'text-input': true,\n 'hide-placeholder': this.category !== undefined,\n }}\n ref={(el) => (this.textInput = el)}\n type=\"text\"\n placeholder={this.placeholder}\n ></input>\n </ul>\n </div>\n {this.getResetButton()}\n </div>\n </form>\n\n <ix-dropdown\n closeBehavior=\"outside\"\n trigger={this.textInput}\n triggerEvent={['click', 'focus']}\n header={this.getDropdownHeader()}\n class={{ 'd-none': !this.displayDropdown() }}\n >\n {this.renderDropdownContent()}\n </ix-dropdown>\n </Host>\n );\n }\n}\n"],"mappings":"2GAAA,MAAMA,EAAoB,y8G,MC6BbC,EAAc,M,iHACRC,KAAAC,uBAAyB,yB,8EASPC,EAAsBC,M,oEAOpD,G,yIAuCD,G,qCAWW,S,8CAcY,K,8BAKQ,K,qBAKT,a,mBAKF,gB,CAaxBC,iBAAiBC,GACfL,KAAKM,eAAeD,E,CAGtBE,mB,QACE,GAAIP,KAAKQ,eAAiBC,UAAW,CACnCT,KAAKM,eAAeN,KAAKQ,a,MACpB,GAAIR,KAAKU,cAAgBD,UAAW,CACzCE,YAAW,IAAMX,KAAKM,eAAeN,KAAKU,c,EAG5CE,EAAAZ,KAAKa,eAAW,MAAAD,SAAA,SAAAA,EAAEE,iBAChB,UACAd,KAAKe,yBAAyBC,KAAKhB,QAGrCiB,EAA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EI,IAAKrF,EAAM8G,WACX5B,MAAO,CACL6B,kBAAmB,KACnBC,gBAAiB,OAGnB/B,EAAA,kBACEgC,aAAc,IAAM3I,KAAKmE,YAAYU,IAEpC7E,KAAKmG,mBAAmBzE,OAI9B1B,KAAKuC,aAAe9B,UAAS,GAG5BkG,EAAA,MACEC,MAAO,CACL,mBAAoB,KACpB,UAAW5G,KAAK6B,YAGjBjB,EAAAZ,KAAKuC,WAAWvC,KAAK6B,aAAS,MAAAjB,SAAA,SAAAA,EAAEyF,OAGrCM,EAAA,SACEC,MAAO,CACL,aAAc,KACd,mBAAoB5G,KAAK6B,WAAapB,WAExC2H,IAAMC,GAAQrI,KAAKqB,UAAYgH,EAC/BO,KAAK,OACLC,YAAa7I,KAAK6I,gBAIvB7I,KAAK4H,mBAIVjB,EAAA,eACEmC,cAAc,UACdC,QAAS/I,KAAKqB,UACd2H,aAAc,CAAC,QAAS,SACxBC,OAAQjJ,KAAKsH,oBACbV,MAAO,CAAE,UAAW5G,KAAKyG,oBAExBzG,KAAKoH,yB"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as i,c as e,h as t,H as s,g as r}from"./p-8fcd6f85.js";const c=".sc-ix-filter-chip-h{display:flex;align-items:center;justify-content:space-between;height:1.5rem;padding-left:0.5rem;border:var(--theme-focus--border-thickness) solid transparent;border-radius:2rem;background-color:var(--theme-chip--background);color:var(--theme-chip--color)}.sc-ix-filter-chip-h:not(.disabled):not(:disabled){cursor:pointer}.sc-ix-filter-chip-h:not(.disabled):not(:disabled):hover{background-color:var(--theme-chip--background--hover)}.sc-ix-filter-chip-h:not(.disabled):not(:disabled){cursor:pointer}.sc-ix-filter-chip-h:not(.disabled):not(:disabled):active{background-color:var(--theme-chip--background--active)}.sc-ix-filter-chip-h:not(.disabled):not(:disabled):focus-visible{border-color:#199fff}.sc-ix-filter-chip-h .slot-container.sc-ix-filter-chip{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sc-ix-filter-chip-h .slot-container.sc-ix-filter-chip .disabled.sc-ix-filter-chip-h,.disabled .sc-ix-filter-chip-h{color:var(--theme-chip--color-diabled)}.sc-ix-filter-chip-h .btn-oval.sc-ix-filter-chip{height:1.5rem;width:1.5rem;min-width:1.5rem;margin-left:0.25rem;padding:0;vertical-align:top}.sc-ix-filter-chip-h .btn-oval.sc-ix-filter-chip:not(.disabled):not(:disabled):focus-visible{outline:none;border-color:#199fff}";const o=class{constructor(t){i(this,t);this.closeClick=e(this,"closeClick",7);this.disabled=false}onCloseClick(i){i.preventDefault();i.stopPropagation();this.closeClick.emit()}render(){return t(s,{class:{disabled:this.disabled},title:this.el.textContent},t("div",{class:"slot-container"},t("slot",null)),t("button",{disabled:this.disabled,class:"btn btn-invisible-secondary btn-oval",onClick:i=>this.onCloseClick(i)},t("ix-icon",{name:"close-small",size:"16"})))}get el(){return r(this)}};o.style=c;export{o as ix_filter_chip};
|
|
2
|
-
//# sourceMappingURL=p-f961c22a.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["filterChipCss","FilterChip","onCloseClick","event","preventDefault","stopPropagation","this","closeClick","emit","render","h","Host","class","disabled","title","el","textContent","onClick","e","name","size"],"sources":["./src/components/filter-chip/filter-chip.scss?tag=ix-filter-chip&encapsulation=scoped","./src/components/filter-chip/filter-chip.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n@import 'common-variables';\n@import 'mixins/hover';\n@import 'mixins/text-truncation';\n\n:host {\n display: flex;\n align-items: center;\n justify-content: space-between;\n height: $large-space;\n padding-left: $small-space;\n border: var(--theme-focus--border-thickness) solid transparent;\n border-radius: $x-large-space;\n background-color: var(--theme-chip--background);\n color: var(--theme-chip--color);\n\n @include hover {\n background-color: var(--theme-chip--background--hover);\n }\n\n @include active {\n background-color: var(--theme-chip--background--active);\n }\n\n @include focus-visible {\n border-color: #199fff;\n }\n\n .slot-container {\n @include ellipsis;\n\n :host-context(.disabled) {\n color: var(--theme-chip--color-diabled);\n }\n }\n\n .btn-oval {\n height: $large-space;\n width: $large-space;\n min-width: $large-space;\n margin-left: $tiny-space;\n padding: 0;\n vertical-align: top;\n\n @include focus-visible {\n outline: none;\n border-color: #199fff;\n }\n }\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n} from '@stencil/core';\n\n@Component({\n tag: 'ix-filter-chip',\n styleUrl: 'filter-chip.scss',\n scoped: true,\n})\nexport class FilterChip {\n @Element() el: HTMLIxFilterChipElement;\n\n /**\n * If true the filter chip will be in disabled state\n */\n @Prop() disabled = false;\n\n /**\n * Close clicked\n */\n @Event() closeClick: EventEmitter<void>;\n\n private onCloseClick(event: Event) {\n event.preventDefault();\n event.stopPropagation();\n this.closeClick.emit();\n }\n\n render() {\n return (\n <Host class={{ disabled: this.disabled }} title={this.el.textContent}>\n <div class=\"slot-container\">\n <slot></slot>\n </div>\n <button\n disabled={this.disabled}\n class=\"btn btn-invisible-secondary btn-oval\"\n onClick={(e) => this.onCloseClick(e)}\n >\n <ix-icon name=\"close-small\" size=\"16\"></ix-icon>\n </button>\n </Host>\n );\n }\n}\n"],"mappings":"gEAAA,MAAMA,EAAgB,0uC,MCwBTC,EAAU,M,8EAMF,K,CAOXC,aAAaC,GACnBA,EAAMC,iBACND,EAAME,kBACNC,KAAKC,WAAWC,M,CAGlBC,SACE,OACEC,EAACC,EAAI,CAACC,MAAO,CAAEC,SAAUP,KAAKO,UAAYC,MAAOR,KAAKS,GAAGC,aACvDN,EAAA,OAAKE,MAAM,kBACTF,EAAA,cAEFA,EAAA,UACEG,SAAUP,KAAKO,SACfD,MAAM,uCACNK,QAAUC,GAAMZ,KAAKJ,aAAagB,IAElCR,EAAA,WAASS,KAAK,cAAcC,KAAK,Q"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as i,h as e,H as t,g as l}from"./p-8fcd6f85.js";import{F as r}from"./p-15bebd8a.js";const o="@keyframes flip-animation{0%{transform:rotateY(0)}50%{transform:rotateY(90deg)}51%{transform:rotateY(270deg)}100%{transform:rotateY(360deg)}}.sc-ix-flip-tile-h{display:flex;flex-direction:column;width:16rem;min-width:16rem;max-width:16rem;height:15.125rem;perspective:1000px}.sc-ix-flip-tile-h .flip-tile-header.sc-ix-flip-tile{display:flex;align-items:center;height:2.5rem;padding:0 0.5rem 0 1rem}.sc-ix-flip-tile-h .flip-tile-header.sc-ix-flip-tile .header-slot-container.sc-ix-flip-tile{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-grow:1;min-width:0}.sc-ix-flip-tile-h .content-container.sc-ix-flip-tile{flex-grow:1;margin:1rem}.sc-ix-flip-tile-h .flip-tile-container.sc-ix-flip-tile{display:flex;flex-direction:column;height:100%;background-color:var(--theme-blind-base--background);border:solid 1px var(--theme-blind-base--border-color);border-radius:var(--theme-flip-tile--border-radius) var(--theme-flip-tile--border-radius) 0 0;transform-style:preserve-3d}.sc-ix-flip-tile-h .flip-tile-container.flip-animation-active.sc-ix-flip-tile{animation:flip-animation 300ms, ease-in-out}.sc-ix-flip-tile-h .flip-tile-container.sc-ix-flip-tile .footer.sc-ix-flip-tile{display:flex;height:3rem;align-items:center;justify-content:center;padding:0 0.5rem;color:var(--theme-flip-footer--color);background-color:var(--theme-blind-base--background)}.sc-ix-flip-tile-h .flip-tile-container.sc-ix-flip-tile .footer.sc-ix-flip-tile .sc-ix-flip-tile:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;height:100%}.sc-ix-flip-tile-h .flip-tile-container .sc-ix-flip-tile-s>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:flex;flex-direction:column;align-items:center;min-width:0}.sc-ix-flip-tile-h .flip-tile-container.primary.sc-ix-flip-tile{border-color:var(--theme-color-primary)}.sc-ix-flip-tile-h .flip-tile-container.primary.sc-ix-flip-tile .footer.sc-ix-flip-tile{background-color:var(--theme-color-primary);color:var(--theme-color-primary--contrast)}.sc-ix-flip-tile-h .flip-tile-container.info.sc-ix-flip-tile{border-color:var(--theme-color-info)}.sc-ix-flip-tile-h .flip-tile-container.info.sc-ix-flip-tile .footer.sc-ix-flip-tile{background-color:var(--theme-color-info);color:var(--theme-color-info--contrast)}.sc-ix-flip-tile-h .flip-tile-container.warning.sc-ix-flip-tile{border-color:var(--theme-color-warning)}.sc-ix-flip-tile-h .flip-tile-container.warning.sc-ix-flip-tile .footer.sc-ix-flip-tile{background-color:var(--theme-color-warning);color:var(--theme-color-warning--contrast)}.sc-ix-flip-tile-h .flip-tile-container.alarm.sc-ix-flip-tile{border-color:var(--theme-color-alarm)}.sc-ix-flip-tile-h .flip-tile-container.alarm.sc-ix-flip-tile .footer.sc-ix-flip-tile{background-color:var(--theme-color-alarm);color:var(--theme-color-alarm--contrast)}.sc-ix-flip-tile-h:hover .flip-tile-container.sc-ix-flip-tile .footer.sc-ix-flip-tile ix-icon.sc-ix-flip-tile{color:var(--theme-color-std-text)}";const s=class{constructor(e){i(this,e);this.ANIMATION_DURATION=150;this.index=0;this.isFlipAnimationActive=undefined;this.state=undefined;this.footer=undefined}componentDidLoad(){this.contentItems=this.contentContainerElement.querySelectorAll("ix-flip-tile-content");this.contentItems.forEach(((i,e)=>{if(e!==this.index){this.toggleContentItem(e)}}))}toggleIndex(){this.doFlipAnimation()}toggleContentItem(i){const e=this.contentItems[i];e.classList.toggle("d-none")}doFlipAnimation(){this.isFlipAnimationActive=true;setTimeout((()=>{this.toggleContentItem(this.index);if(this.index>=this.contentItems.length-1){this.index=0}else{this.index++}this.toggleContentItem(this.index)}),this.ANIMATION_DURATION);setTimeout((()=>{this.isFlipAnimationActive=false}),2*this.ANIMATION_DURATION)}render(){return e(t,null,e("div",{class:{"flip-tile-container":true,info:this.state===r.Info,warning:this.state===r.Warning,alarm:this.state===r.Alarm,primary:this.state===r.Primary,"flip-animation-active":this.isFlipAnimationActive}},e("div",{class:"flip-tile-header"},e("div",{class:"header-slot-container text-l-title"},e("slot",{name:"header"})),e("ix-icon-button",{icon:"eye",variant:"Primary",ghost:true,onClick:()=>this.toggleIndex()})),e("div",{class:"content-container",ref:i=>this.contentContainerElement=i},e("slot",null)),e("div",{class:{footer:true,"contrast-light":this.state===r.Warning,"contrast-dark":this.state===r.Info||this.state===r.Alarm}},e("slot",{name:"footer"}))))}get hostElement(){return l(this)}};s.style=o;const n=":host{display:block}";const c=class{constructor(e){i(this,e)}render(){return e(t,null,e("slot",null))}};c.style=n;export{s as ix_flip_tile,c as ix_flip_tile_content};
|
|
2
|
-
//# sourceMappingURL=p-fe690347.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["flipTileCss","FlipTile","this","ANIMATION_DURATION","componentDidLoad","contentItems","contentContainerElement","querySelectorAll","forEach","_","index","toggleContentItem","toggleIndex","doFlipAnimation","item","classList","toggle","isFlipAnimationActive","setTimeout","length","render","h","Host","class","info","state","FlipTileState","Info","warning","Warning","alarm","Alarm","primary","Primary","name","icon","variant","ghost","onClick","ref","el","footer","flipTileContentCss","FlipTileContent"],"sources":["./src/components/flip-tile/flip-tile.scss?tag=ix-flip-tile&encapsulation=scoped","./src/components/flip-tile/flip-tile.tsx","./src/components/flip-tile-content/flip-tile-content.css?tag=ix-flip-tile-content&encapsulation=shadow","./src/components/flip-tile-content/flip-tile-content.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n@import 'common-variables';\n@import 'mixins/animations';\n@import 'mixins/text-truncation';\n\n@include keyframes(flip-animation) {\n 0% {\n transform: rotateY(0);\n }\n 50% {\n transform: rotateY(90deg);\n }\n 51% {\n transform: rotateY(270deg);\n }\n 100% {\n transform: rotateY(360deg);\n }\n}\n\n:host {\n display: flex;\n flex-direction: column;\n width: 16rem;\n min-width: 16rem;\n max-width: 16rem;\n height: 15.125rem;\n perspective: 1000px;\n\n .flip-tile-header {\n display: flex;\n align-items: center;\n height: $large-control-height;\n padding: 0 $small-space 0 $default-space;\n\n .header-slot-container {\n @include ellipsis;\n flex-grow: 1;\n min-width: 0;\n }\n }\n\n .content-container {\n flex-grow: 1;\n margin: $default-space;\n }\n\n .flip-tile-container {\n display: flex;\n flex-direction: column;\n height: 100%;\n background-color: var(--theme-blind-base--background);\n border: solid 1px var(--theme-blind-base--border-color);\n border-radius: var(--theme-flip-tile--border-radius)\n var(--theme-flip-tile--border-radius) 0 0;\n transform-style: preserve-3d;\n\n &.flip-animation-active {\n @include animation(flip-animation, 2 * $default-time, ease-in-out);\n }\n\n .footer {\n display: flex;\n height: 3rem;\n align-items: center;\n justify-content: center;\n padding: 0 $small-space;\n color: var(--theme-flip-footer--color);\n background-color: var(--theme-blind-base--background);\n\n :first-child {\n @include ellipsis;\n height: 100%;\n }\n }\n\n ::slotted(*) {\n @include ellipsis;\n display: flex;\n flex-direction: column;\n align-items: center;\n min-width: 0;\n }\n\n &.primary {\n border-color: var(--theme-color-primary);\n\n .footer {\n background-color: var(--theme-color-primary);\n color: var(--theme-color-primary--contrast);\n }\n }\n\n &.info {\n border-color: var(--theme-color-info);\n\n .footer {\n background-color: var(--theme-color-info);\n color: var(--theme-color-info--contrast);\n }\n }\n\n &.warning {\n border-color: var(--theme-color-warning);\n\n .footer {\n background-color: var(--theme-color-warning);\n color: var(--theme-color-warning--contrast);\n }\n }\n\n &.alarm {\n border-color: var(--theme-color-alarm);\n\n .footer {\n background-color: var(--theme-color-alarm);\n color: var(--theme-color-alarm--contrast);\n }\n }\n }\n\n &:hover .flip-tile-container .footer ix-icon {\n color: var(--theme-color-std-text);\n }\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { Component, Element, h, Host, Prop, State } from '@stencil/core';\nimport { FlipTileState } from './flip-tile-state';\n\n@Component({\n tag: 'ix-flip-tile',\n styleUrl: 'flip-tile.scss',\n scoped: true,\n})\nexport class FlipTile {\n private readonly ANIMATION_DURATION = 150;\n private contentContainerElement: HTMLDivElement;\n private contentItems: NodeList;\n\n @Element() hostElement: HTMLIxFlipTileElement;\n\n @State() index = 0;\n\n @State() isFlipAnimationActive: boolean;\n\n /**\n * Variation of the Flip\n */\n @Prop() state: FlipTileState;\n\n /**\n * Tmp property name\n */\n @Prop() footer: string;\n\n componentDidLoad() {\n this.contentItems = this.contentContainerElement.querySelectorAll(\n 'ix-flip-tile-content'\n );\n this.contentItems.forEach((_, index) => {\n if (index !== this.index) {\n this.toggleContentItem(index);\n }\n });\n }\n\n private toggleIndex() {\n this.doFlipAnimation();\n }\n\n private toggleContentItem(index: number) {\n const item = this.contentItems[index] as HTMLElement;\n item.classList.toggle('d-none');\n }\n\n private doFlipAnimation() {\n this.isFlipAnimationActive = true;\n\n setTimeout(() => {\n this.toggleContentItem(this.index);\n\n if (this.index >= this.contentItems.length - 1) {\n this.index = 0;\n } else {\n this.index++;\n }\n\n this.toggleContentItem(this.index);\n }, this.ANIMATION_DURATION);\n\n setTimeout(() => {\n this.isFlipAnimationActive = false;\n }, 2 * this.ANIMATION_DURATION);\n }\n\n render() {\n return (\n <Host>\n <div\n class={{\n 'flip-tile-container': true,\n info: this.state === FlipTileState.Info,\n warning: this.state === FlipTileState.Warning,\n alarm: this.state === FlipTileState.Alarm,\n primary: this.state === FlipTileState.Primary,\n 'flip-animation-active': this.isFlipAnimationActive,\n }}\n >\n <div class=\"flip-tile-header\">\n <div class=\"header-slot-container text-l-title\">\n <slot name=\"header\"></slot>\n </div>\n <ix-icon-button\n icon=\"eye\"\n variant=\"Primary\"\n ghost\n onClick={() => this.toggleIndex()}\n ></ix-icon-button>\n </div>\n\n <div\n class=\"content-container\"\n ref={(el) => (this.contentContainerElement = el)}\n >\n <slot></slot>\n </div>\n <div\n class={{\n footer: true,\n 'contrast-light': this.state === FlipTileState.Warning,\n 'contrast-dark':\n this.state === FlipTileState.Info ||\n this.state === FlipTileState.Alarm,\n }}\n >\n <slot name=\"footer\"></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n:host {\n display: block;\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { Component, h, Host } from '@stencil/core';\n\n@Component({\n tag: 'ix-flip-tile-content',\n styleUrl: 'flip-tile-content.css',\n shadow: true,\n})\nexport class FlipTileContent {\n render() {\n return (\n <Host>\n <slot></slot>\n </Host>\n );\n }\n}\n"],"mappings":"6FAAA,MAAMA,EAAc,k5F,MCiBPC,EAAQ,M,yBACFC,KAAAC,mBAAqB,I,WAMrB,E,gFAcjBC,mBACEF,KAAKG,aAAeH,KAAKI,wBAAwBC,iBAC/C,wBAEFL,KAAKG,aAAaG,SAAQ,CAACC,EAAGC,KAC5B,GAAIA,IAAUR,KAAKQ,MAAO,CACxBR,KAAKS,kBAAkBD,E,KAKrBE,cACNV,KAAKW,iB,CAGCF,kBAAkBD,GACxB,MAAMI,EAAOZ,KAAKG,aAAaK,GAC/BI,EAAKC,UAAUC,OAAO,S,CAGhBH,kBACNX,KAAKe,sBAAwB,KAE7BC,YAAW,KACThB,KAAKS,kBAAkBT,KAAKQ,OAE5B,GAAIR,KAAKQ,OAASR,KAAKG,aAAac,OAAS,EAAG,CAC9CjB,KAAKQ,MAAQ,C,KACR,CACLR,KA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