@infineon/infineon-design-system-stencil 37.5.1--canary.1723.34ea69810f554741126370a7b5230b9aef9d65e5.0 → 37.6.0--canary.1954.6c07dfe4ac965c782ba6feeb2957e37be53515a7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ifx-alert_2.cjs.entry.js +1 -1
- package/dist/cjs/ifx-basic-table.cjs.entry.js +1 -1
- package/dist/cjs/ifx-faq.cjs.entry.js +1 -1
- package/dist/cjs/ifx-filter-accordion.cjs.entry.js +2 -2
- package/dist/cjs/ifx-filter-bar.cjs.entry.js +1 -1
- package/dist/cjs/ifx-filter-search.cjs.entry.js +1 -1
- package/dist/cjs/ifx-filter-type-group.cjs.entry.js +1 -1
- package/dist/cjs/ifx-list-entry.cjs.entry.js +1 -1
- package/dist/cjs/ifx-multiselect_2.cjs.entry.js +4 -4
- package/dist/cjs/ifx-search-field.cjs.entry.js +348 -13
- package/dist/cjs/ifx-search-field.cjs.entry.js.map +1 -1
- package/dist/cjs/ifx-segment.cjs.entry.js +1 -1
- package/dist/cjs/ifx-segmented-control.cjs.entry.js +2 -2
- package/dist/cjs/ifx-select.cjs.entry.js +2 -2
- package/dist/cjs/ifx-slider.cjs.entry.js +2 -2
- package/dist/cjs/ifx-spinner_2.cjs.entry.js +6 -6
- package/dist/cjs/ifx-status.cjs.entry.js +1 -1
- package/dist/cjs/ifx-step.cjs.entry.js +4 -4
- package/dist/cjs/ifx-stepper.cjs.entry.js +2 -2
- package/dist/cjs/ifx-switch.cjs.entry.js +1 -1
- package/dist/cjs/ifx-tab.cjs.entry.js +1 -1
- package/dist/cjs/ifx-table.cjs.entry.js +2 -2
- package/dist/cjs/ifx-tabs.cjs.entry.js +2 -2
- package/dist/cjs/ifx-tag.cjs.entry.js +1 -1
- package/dist/cjs/ifx-templates-ui.cjs.entry.js +1 -1
- package/dist/cjs/ifx-textarea.cjs.entry.js +1 -1
- package/dist/cjs/ifx-tooltip.cjs.entry.js +4 -4
- package/dist/cjs/ifx-tree-view-item.cjs.entry.js +2 -2
- package/dist/cjs/ifx-tree-view.cjs.entry.js +1 -1
- package/dist/cjs/infineon-design-system-stencil.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/search-field/search-field.css +114 -0
- package/dist/collection/components/search-field/search-field.js +723 -18
- package/dist/collection/components/search-field/search-field.js.map +1 -1
- package/dist/collection/components/search-field/search-field.stories.js +378 -2
- package/dist/collection/components/search-field/search-field.stories.js.map +1 -1
- package/dist/collection/components/segmented-control/segment/segment.js +1 -1
- package/dist/collection/components/segmented-control/segmented-control.js +2 -2
- package/dist/collection/components/select/multi-select/multiselect-option.js +4 -4
- package/dist/collection/components/select/single-select/select.js +2 -2
- package/dist/collection/components/slider/slider.js +2 -2
- package/dist/collection/components/spinner/spinner.js +2 -2
- package/dist/collection/components/status/status.js +1 -1
- package/dist/collection/components/stepper/step/step.js +4 -4
- package/dist/collection/components/stepper/stepper.js +2 -2
- package/dist/collection/components/switch/switch.js +1 -1
- package/dist/collection/components/table-advanced-version/filter-bar/filter-bar.js +1 -1
- package/dist/collection/components/table-advanced-version/filter-type-group/filter-accordion/filter-accordion.js +2 -2
- package/dist/collection/components/table-advanced-version/filter-type-group/filter-search/filter-search.js +1 -1
- package/dist/collection/components/table-advanced-version/filter-type-group/filter-type-group.js +1 -1
- package/dist/collection/components/table-advanced-version/list/list-entry/list-entry.js +1 -1
- package/dist/collection/components/table-advanced-version/table.js +2 -2
- package/dist/collection/components/table-basic-version/table.js +1 -1
- package/dist/collection/components/tabs/tab.js +1 -1
- package/dist/collection/components/tabs/tabs.js +2 -2
- package/dist/collection/components/tag/tag.js +1 -1
- package/dist/collection/components/templates/template/template.js +1 -1
- package/dist/collection/components/templates/templates-ui/templates-ui.js +1 -1
- package/dist/collection/components/text-field/text-field.js +4 -4
- package/dist/collection/components/textarea/textarea.js +1 -1
- package/dist/collection/components/tooltip/tooltip.js +4 -4
- package/dist/collection/components/tree-view/tree-view-item.js +2 -2
- package/dist/collection/components/tree-view/tree-view.js +1 -1
- package/dist/collection/stories/setup-and-installation/faq/faq.js +1 -1
- package/dist/components/ifx-basic-table.js +1 -1
- package/dist/components/ifx-faq.js +1 -1
- package/dist/components/ifx-filter-accordion.js +2 -2
- package/dist/components/ifx-filter-bar.js +1 -1
- package/dist/components/ifx-filter-search.js +2 -2
- package/dist/components/ifx-filter-type-group.js +1 -1
- package/dist/components/ifx-icons-preview.js +1 -1
- package/dist/components/ifx-list-entry.js +1 -1
- package/dist/components/ifx-multiselect-option.js +1 -1
- package/dist/components/ifx-multiselect.js +1 -1
- package/dist/components/ifx-pagination.js +1 -1
- package/dist/components/ifx-search-bar.js +1 -1
- package/dist/components/ifx-search-field.js +1 -1
- package/dist/components/ifx-segment.js +1 -1
- package/dist/components/ifx-segmented-control.js +2 -2
- package/dist/components/ifx-select.js +1 -1
- package/dist/components/ifx-set-filter.js +5 -5
- package/dist/components/ifx-slider.js +2 -2
- package/dist/components/ifx-spinner.js +1 -1
- package/dist/components/ifx-status.js +1 -1
- package/dist/components/ifx-step.js +4 -4
- package/dist/components/ifx-stepper.js +2 -2
- package/dist/components/ifx-switch.js +1 -1
- package/dist/components/ifx-tab.js +1 -1
- package/dist/components/ifx-table.js +4 -4
- package/dist/components/ifx-tabs.js +2 -2
- package/dist/components/ifx-tag.js +1 -1
- package/dist/components/ifx-template.js +1 -1
- package/dist/components/ifx-templates-ui.js +4 -4
- package/dist/components/ifx-text-field.js +1 -1
- package/dist/components/ifx-textarea.js +1 -1
- package/dist/components/ifx-tooltip.js +4 -4
- package/dist/components/ifx-tree-view-item.js +2 -2
- package/dist/components/ifx-tree-view.js +1 -1
- package/dist/components/p-15597da9.js +470 -0
- package/dist/components/p-15597da9.js.map +1 -0
- package/dist/components/{p-4f7fbf98.js → p-1bd23a52.js} +3 -3
- package/dist/components/{p-4f7fbf98.js.map → p-1bd23a52.js.map} +1 -1
- package/dist/components/{p-60294bc5.js → p-6b139880.js} +3 -3
- package/dist/components/{p-60294bc5.js.map → p-6b139880.js.map} +1 -1
- package/dist/components/{p-a96d43ef.js → p-81265366.js} +4 -4
- package/dist/components/{p-a96d43ef.js.map → p-81265366.js.map} +1 -1
- package/dist/components/{p-46f5d4b5.js → p-9378105f.js} +2 -2
- package/dist/components/{p-46f5d4b5.js.map → p-9378105f.js.map} +1 -1
- package/dist/components/{p-c2ab000f.js → p-b57d6694.js} +2 -2
- package/dist/components/{p-c2ab000f.js.map → p-b57d6694.js.map} +1 -1
- package/dist/components/{p-4366492e.js → p-f4531a17.js} +5 -5
- package/dist/components/{p-4366492e.js.map → p-f4531a17.js.map} +1 -1
- package/dist/components/{p-b56aae98.js → p-fa8735da.js} +5 -5
- package/dist/components/{p-b56aae98.js.map → p-fa8735da.js.map} +1 -1
- package/dist/esm/ifx-alert_2.entry.js +1 -1
- package/dist/esm/ifx-basic-table.entry.js +1 -1
- package/dist/esm/ifx-faq.entry.js +1 -1
- package/dist/esm/ifx-filter-accordion.entry.js +2 -2
- package/dist/esm/ifx-filter-bar.entry.js +1 -1
- package/dist/esm/ifx-filter-search.entry.js +1 -1
- package/dist/esm/ifx-filter-type-group.entry.js +1 -1
- package/dist/esm/ifx-list-entry.entry.js +1 -1
- package/dist/esm/ifx-multiselect_2.entry.js +4 -4
- package/dist/esm/ifx-search-field.entry.js +348 -13
- package/dist/esm/ifx-search-field.entry.js.map +1 -1
- package/dist/esm/ifx-segment.entry.js +1 -1
- package/dist/esm/ifx-segmented-control.entry.js +2 -2
- package/dist/esm/ifx-select.entry.js +2 -2
- package/dist/esm/ifx-slider.entry.js +2 -2
- package/dist/esm/ifx-spinner_2.entry.js +6 -6
- package/dist/esm/ifx-status.entry.js +1 -1
- package/dist/esm/ifx-step.entry.js +4 -4
- package/dist/esm/ifx-stepper.entry.js +2 -2
- package/dist/esm/ifx-switch.entry.js +1 -1
- package/dist/esm/ifx-tab.entry.js +1 -1
- package/dist/esm/ifx-table.entry.js +2 -2
- package/dist/esm/ifx-tabs.entry.js +2 -2
- package/dist/esm/ifx-tag.entry.js +1 -1
- package/dist/esm/ifx-templates-ui.entry.js +1 -1
- package/dist/esm/ifx-textarea.entry.js +1 -1
- package/dist/esm/ifx-tooltip.entry.js +4 -4
- package/dist/esm/ifx-tree-view-item.entry.js +2 -2
- package/dist/esm/ifx-tree-view.entry.js +1 -1
- package/dist/esm/infineon-design-system-stencil.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js +1 -1
- package/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js.map +1 -1
- package/dist/infineon-design-system-stencil/{p-577289c5.entry.js → p-030215bd.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-67c9a9c0.entry.js → p-03690ea5.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-7adee2dd.entry.js → p-0cbdafca.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-012129b3.entry.js → p-24d7ff6e.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-0c1c831c.entry.js → p-253ea47f.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-09a8d63d.entry.js → p-273a91b3.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-3d037fa4.entry.js → p-33b46161.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-4097932f.entry.js → p-377996c5.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-a2a44fbe.entry.js → p-37be5d65.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-18a81f5f.entry.js → p-3bce1f22.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-e9241ef3.entry.js → p-461450ac.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-0d8a16ab.entry.js → p-5afef060.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-7311a88d.entry.js → p-65a5cdd0.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-6c2698a3.entry.js → p-6ec8258a.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-fb954440.entry.js → p-6f43f8cb.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-cf7cf03b.entry.js → p-7078cbee.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/p-7705c159.entry.js +2 -0
- package/dist/infineon-design-system-stencil/{p-28bd7e9d.entry.js → p-7958bc33.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-54e6a8d8.entry.js → p-7b2c1280.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-2facce0d.entry.js → p-bcf3f499.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-b4caad8b.entry.js → p-c303185e.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-04d8ea38.entry.js → p-caef0e47.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-36dcebde.entry.js → p-d3d6a562.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-c5de05c9.entry.js → p-e6632fdc.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-c7e86c7c.entry.js → p-ed30fb98.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-966548e9.entry.js → p-efe3e6d2.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-9675a12a.entry.js → p-effa0498.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/p-fe185620.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-fe185620.entry.js.map +1 -0
- package/dist/types/components/search-field/search-field.d.ts +53 -3
- package/dist/types/components/search-field/search-field.stories.d.ts +191 -0
- package/dist/types/components.d.ts +42 -2
- package/package.json +1 -1
- package/dist/components/p-bf74ceb8.js +0 -116
- package/dist/components/p-bf74ceb8.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-4e633224.entry.js +0 -2
- package/dist/infineon-design-system-stencil/p-4e633224.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-e571c002.entry.js +0 -2
- /package/dist/infineon-design-system-stencil/{p-577289c5.entry.js.map → p-030215bd.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-67c9a9c0.entry.js.map → p-03690ea5.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-7adee2dd.entry.js.map → p-0cbdafca.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-012129b3.entry.js.map → p-24d7ff6e.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-0c1c831c.entry.js.map → p-253ea47f.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-09a8d63d.entry.js.map → p-273a91b3.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-3d037fa4.entry.js.map → p-33b46161.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-4097932f.entry.js.map → p-377996c5.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-a2a44fbe.entry.js.map → p-37be5d65.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-18a81f5f.entry.js.map → p-3bce1f22.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-e9241ef3.entry.js.map → p-461450ac.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-0d8a16ab.entry.js.map → p-5afef060.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-7311a88d.entry.js.map → p-65a5cdd0.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-6c2698a3.entry.js.map → p-6ec8258a.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-fb954440.entry.js.map → p-6f43f8cb.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-cf7cf03b.entry.js.map → p-7078cbee.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-e571c002.entry.js.map → p-7705c159.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-28bd7e9d.entry.js.map → p-7958bc33.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-54e6a8d8.entry.js.map → p-7b2c1280.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-2facce0d.entry.js.map → p-bcf3f499.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-b4caad8b.entry.js.map → p-c303185e.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-04d8ea38.entry.js.map → p-caef0e47.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-36dcebde.entry.js.map → p-d3d6a562.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-c5de05c9.entry.js.map → p-e6632fdc.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-c7e86c7c.entry.js.map → p-ed30fb98.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-966548e9.entry.js.map → p-efe3e6d2.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-9675a12a.entry.js.map → p-effa0498.entry.js.map} +0 -0
@@ -0,0 +1,470 @@
|
|
1
|
+
import { p as proxyCustomElement, H, c as createEvent, h } from './p-f8e6a4ef.js';
|
2
|
+
import { d as detectFramework, t as trackComponent } from './p-08c92877.js';
|
3
|
+
import { i as isNestedInIfxComponent } from './p-1ecafb97.js';
|
4
|
+
import { c as classNames } from './p-5cdc6210.js';
|
5
|
+
import { d as defineCustomElement$1 } from './p-627ff0cb.js';
|
6
|
+
|
7
|
+
const searchFieldCss = ":root {\n --ifx-font-family: \"Source Sans 3\", \"Arial, sans-serif\";\n}\n\n:host {\n display: flex;\n}\n\n.search-field {\n box-sizing: border-box;\n background-color: #FFFFFF;\n width: 100%;\n font-family: var(--ifx-font-family);\n position: relative;\n}\n.search-field .search-field__wrapper {\n box-sizing: border-box;\n height: 40px;\n display: flex;\n align-items: center;\n border: 1px solid #8D8786;\n border-radius: 1px;\n padding: 8px 16px;\n gap: 12px;\n flex: none;\n order: 0;\n align-self: stretch;\n flex-grow: 0;\n position: relative;\n width: 100%;\n outline: none;\n color: #8D8786;\n}\n.search-field .search-field__wrapper.focused {\n border: 1px solid #0A8276;\n}\n.search-field .search-field__wrapper.focused ifx-icon {\n color: #575352;\n}\n.search-field .search-field__wrapper.search-field__wrapper-s {\n height: 36px;\n}\n.search-field .search-field__wrapper:hover:not(.focused, :focus) {\n border: 1px solid #3C3A39;\n}\n.search-field .search-field__wrapper:focus {\n outline: none;\n border: 1px solid #0A8276;\n}\n.search-field .search-field__wrapper .delete-icon {\n right: 12px;\n cursor: pointer;\n}\n.search-field .search-field__wrapper input[type=text] {\n font-style: normal;\n font-weight: 400;\n font-size: 16px;\n color: #8D8786;\n border: none;\n width: 100%;\n outline: none;\n height: 16px;\n}\n.search-field .search-field__wrapper input[type=text]:focus {\n outline: none;\n color: #1d1d1d;\n}\n.search-field .search-field__wrapper input[type=text]:disabled {\n background-color: #EEEDED;\n}\n.search-field .search-field__wrapper:has(input[disabled]) {\n background-color: #EEEDED;\n}\n.search-field .suggestions-dropdown {\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n background: #FFFFFF;\n margin-top: 4px;\n border: 1px solid #EEEDED;\n box-shadow: 0px 6px 9px 0px rgba(29, 29, 29, 0.1);\n z-index: 1000;\n max-height: 300px;\n overflow-y: auto;\n container-type: inline-size;\n}\n.search-field .suggestions-dropdown .suggestions-header {\n font-family: Source Sans 3;\n font-size: 0.8125rem;\n font-weight: 600;\n line-height: 1.25rem;\n letter-spacing: 0.25em;\n text-transform: uppercase;\n color: #575352;\n border-bottom: 1px solid #EEEDED;\n padding: 12px 16px;\n}\n.search-field .suggestions-dropdown .suggestion-item {\n padding: 12px 16px;\n cursor: pointer;\n transition: background-color 0.2s ease;\n}\n.search-field .suggestions-dropdown .suggestion-item:last-child {\n border-bottom: none;\n}\n.search-field .suggestions-dropdown .suggestion-item:hover, .search-field .suggestions-dropdown .suggestion-item--selected {\n background-color: #EEEDED;\n}\n.search-field .suggestions-dropdown .suggestion-item .suggestion-content {\n display: flex;\n align-items: center;\n gap: 12px;\n}\n.search-field .suggestions-dropdown .suggestion-item .suggestion-content .suggestion-icon {\n color: #575352;\n flex-shrink: 0;\n}\n.search-field .suggestions-dropdown .suggestion-item .suggestion-content .suggestion-icon--history {\n color: #575352;\n}\n.search-field .suggestions-dropdown .suggestion-item .suggestion-content .suggestion-text {\n flex: 1;\n display: flex;\n align-items: center;\n min-width: 0;\n}\n.search-field .suggestions-dropdown .suggestion-item .suggestion-content .suggestion-text .suggestion-main-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex-shrink: 1;\n min-width: 0;\n}\n.search-field .suggestions-dropdown .suggestion-item .suggestion-content .suggestion-text .suggestion-scope {\n color: #8D8786;\n flex-shrink: 0;\n white-space: nowrap;\n margin-left: 2px;\n font-weight: 600;\n font-size: 0.75rem;\n}\n@container (max-width: 320px) {\n .search-field .suggestions-dropdown .suggestion-item .suggestion-content .suggestion-text {\n flex-direction: column;\n align-items: flex-start;\n }\n .search-field .suggestions-dropdown .suggestion-item .suggestion-content .suggestion-text .suggestion-main-text {\n width: 100%;\n max-width: 100%;\n }\n .search-field .suggestions-dropdown .suggestion-item .suggestion-content .suggestion-text .suggestion-scope {\n margin-left: 0;\n margin-top: 0;\n width: 100%;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n flex-shrink: 1;\n }\n}\n.search-field .suggestions-dropdown .suggestion-item .suggestion-content .suggestion-count {\n color: #8D8786;\n margin-left: auto;\n flex-shrink: 0;\n}\n.search-field .suggestions-dropdown .suggestion-item .suggestion-content .suggestion-delete-icon {\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.2s ease, visibility 0.2s ease;\n cursor: pointer;\n margin-left: auto;\n flex-shrink: 0;\n color: #575352;\n}\n.search-field .suggestions-dropdown .suggestion-item .suggestion-content .suggestion-delete-icon:hover {\n color: #3C3A39;\n}\n.search-field .suggestions-dropdown .suggestion-item:hover .suggestion-delete-icon {\n opacity: 1;\n visibility: visible;\n}\n.search-field .search-field__wrapper.dropdown-open {\n border-radius: 1px 1px 0 0;\n border-color: #0A8276;\n}";
|
8
|
+
const IfxSearchFieldStyle0 = searchFieldCss;
|
9
|
+
|
10
|
+
const SearchField = /*@__PURE__*/ proxyCustomElement(class SearchField extends H {
|
11
|
+
constructor() {
|
12
|
+
super();
|
13
|
+
this.__registerHost();
|
14
|
+
this.__attachShadow();
|
15
|
+
this.ifxInput = createEvent(this, "ifxInput", 7);
|
16
|
+
this.ifxSuggestionRequested = createEvent(this, "ifxSuggestionRequested", 7);
|
17
|
+
this.ifxSuggestionSelected = createEvent(this, "ifxSuggestionSelected", 7);
|
18
|
+
this.ifxFocus = createEvent(this, "ifxFocus", 7);
|
19
|
+
this.ifxBlur = createEvent(this, "ifxBlur", 7);
|
20
|
+
this.value = '';
|
21
|
+
this.suggestions = [];
|
22
|
+
this.showSuggestions = false;
|
23
|
+
this.maxSuggestions = 10;
|
24
|
+
this.maxHistoryItems = 5;
|
25
|
+
this.enableHistory = true;
|
26
|
+
this.historyKey = 'ifx-search-history';
|
27
|
+
this.historyHeaderText = 'Recent Searches';
|
28
|
+
// ARIA Labels and Accessibility Props
|
29
|
+
this.ariaLabel = "Search Field";
|
30
|
+
this.deleteIconAriaLabel = 'Clear search';
|
31
|
+
this.historyDeleteAriaLabel = 'Remove from history';
|
32
|
+
this.dropdownAriaLabel = 'Search suggestions and history';
|
33
|
+
this.suggestionAriaLabel = 'Search suggestion';
|
34
|
+
this.historyItemAriaLabel = 'Search history item';
|
35
|
+
this.showDropdown = false;
|
36
|
+
this.filteredSuggestions = [];
|
37
|
+
this.selectedSuggestionIndex = -1;
|
38
|
+
this.searchHistory = [];
|
39
|
+
this.showDeleteIcon = false;
|
40
|
+
this.showDeleteIconInternalState = false;
|
41
|
+
this.disabled = false;
|
42
|
+
this.size = 'l';
|
43
|
+
this.isFocused = false;
|
44
|
+
this.placeholder = "Search...";
|
45
|
+
this.autocomplete = "off";
|
46
|
+
this.maxlength = null;
|
47
|
+
this.focusEmitted = false;
|
48
|
+
this.handleInput = () => {
|
49
|
+
const query = this.inputElement.value;
|
50
|
+
this.value = query;
|
51
|
+
this.ifxInput.emit(this.value);
|
52
|
+
if (this.showSuggestions) {
|
53
|
+
this.showDropdown = true;
|
54
|
+
this.selectedSuggestionIndex = -1;
|
55
|
+
this.requestSuggestions(query);
|
56
|
+
}
|
57
|
+
};
|
58
|
+
this.handleDelete = () => {
|
59
|
+
this.inputElement.value = '';
|
60
|
+
this.value = "";
|
61
|
+
this.ifxInput.emit(this.value);
|
62
|
+
this.hideDropdown();
|
63
|
+
};
|
64
|
+
this.handleSearch = () => {
|
65
|
+
if (this.value.trim() && this.enableHistory) {
|
66
|
+
// Only add to history if there are actual results
|
67
|
+
if (this.filteredSuggestions.length > 0) {
|
68
|
+
this.addToHistory(this.value);
|
69
|
+
}
|
70
|
+
}
|
71
|
+
this.hideDropdown();
|
72
|
+
};
|
73
|
+
// Handle click on history delete button
|
74
|
+
this.handleHistoryDelete = (event, term) => {
|
75
|
+
event.stopPropagation(); // Prevent selection of the entry
|
76
|
+
this.removeFromHistory(term);
|
77
|
+
};
|
78
|
+
}
|
79
|
+
handleOutsideClick(event) {
|
80
|
+
const path = event.composedPath();
|
81
|
+
if (!path.includes(this.inputElement) && !path.includes(this.dropdownElement)) {
|
82
|
+
this.hideDropdown();
|
83
|
+
}
|
84
|
+
}
|
85
|
+
handleKeyDown(event) {
|
86
|
+
if (!this.showDropdown)
|
87
|
+
return;
|
88
|
+
switch (event.key) {
|
89
|
+
case 'ArrowDown':
|
90
|
+
event.preventDefault();
|
91
|
+
this.navigateSuggestions(1);
|
92
|
+
break;
|
93
|
+
case 'ArrowUp':
|
94
|
+
event.preventDefault();
|
95
|
+
this.navigateSuggestions(-1);
|
96
|
+
break;
|
97
|
+
case 'Enter':
|
98
|
+
event.preventDefault();
|
99
|
+
if (this.selectedSuggestionIndex >= 0) {
|
100
|
+
this.selectSuggestion(this.filteredSuggestions[this.selectedSuggestionIndex]);
|
101
|
+
}
|
102
|
+
else {
|
103
|
+
this.handleSearch();
|
104
|
+
}
|
105
|
+
break;
|
106
|
+
case 'Escape':
|
107
|
+
this.hideDropdown();
|
108
|
+
break;
|
109
|
+
}
|
110
|
+
}
|
111
|
+
valueWatcher(newValue) {
|
112
|
+
if (this.inputElement && newValue !== this.inputElement.value) {
|
113
|
+
this.inputElement.value = newValue;
|
114
|
+
}
|
115
|
+
this.updateSuggestions();
|
116
|
+
}
|
117
|
+
suggestionsWatcher() {
|
118
|
+
this.updateSuggestions();
|
119
|
+
}
|
120
|
+
focusInput() {
|
121
|
+
// Don't call focus() if the input is already focused to prevent unnecessary operations
|
122
|
+
if (document.activeElement !== this.inputElement) {
|
123
|
+
this.inputElement.focus();
|
124
|
+
}
|
125
|
+
// Only emit focus event if it hasn't been emitted already
|
126
|
+
if (!this.focusEmitted) {
|
127
|
+
this.focusEmitted = true;
|
128
|
+
this.isFocused = true;
|
129
|
+
this.ifxFocus.emit();
|
130
|
+
}
|
131
|
+
if (this.showSuggestions) {
|
132
|
+
// On focus without input: Show only history
|
133
|
+
if (this.value.length === 0) {
|
134
|
+
this.showHistoryDropdown();
|
135
|
+
// Only show dropdown if history is actually present
|
136
|
+
this.showDropdown = this.enableHistory && this.searchHistory.length > 0;
|
137
|
+
}
|
138
|
+
else {
|
139
|
+
// With existing input: Normal suggestion logic
|
140
|
+
this.updateSuggestions();
|
141
|
+
this.showDropdown = this.filteredSuggestions.length > 0;
|
142
|
+
}
|
143
|
+
}
|
144
|
+
}
|
145
|
+
blurInput() {
|
146
|
+
setTimeout(() => {
|
147
|
+
this.isFocused = false;
|
148
|
+
this.focusEmitted = false; // Reset focus flag when blur occurs
|
149
|
+
this.ifxBlur.emit();
|
150
|
+
}, 150);
|
151
|
+
}
|
152
|
+
// Public method to update history from external sources
|
153
|
+
loadSearchHistory() {
|
154
|
+
if (this.enableHistory && typeof localStorage !== 'undefined') {
|
155
|
+
const stored = localStorage.getItem(this.historyKey);
|
156
|
+
this.searchHistory = stored ? JSON.parse(stored) : [];
|
157
|
+
// Update suggestions when history is loaded
|
158
|
+
this.updateSuggestions();
|
159
|
+
// If no input and no history left, close dropdown
|
160
|
+
if (this.value.length === 0 && this.searchHistory.length === 0) {
|
161
|
+
this.showDropdown = false;
|
162
|
+
}
|
163
|
+
}
|
164
|
+
}
|
165
|
+
// Public method to completely clear history
|
166
|
+
clearSearchHistory() {
|
167
|
+
if (this.enableHistory && typeof localStorage !== 'undefined') {
|
168
|
+
// Clear from localStorage
|
169
|
+
localStorage.removeItem(this.historyKey);
|
170
|
+
// Clear internal history
|
171
|
+
this.searchHistory = [];
|
172
|
+
// Reset all dropdown-relevant states
|
173
|
+
this.filteredSuggestions = [];
|
174
|
+
this.selectedSuggestionIndex = -1;
|
175
|
+
this.showDropdown = false;
|
176
|
+
// Update suggestions after reset
|
177
|
+
this.updateSuggestions();
|
178
|
+
}
|
179
|
+
}
|
180
|
+
// Suggestion Management Methods
|
181
|
+
addToHistory(term) {
|
182
|
+
if (!this.enableHistory || !term.trim())
|
183
|
+
return;
|
184
|
+
const history = [...this.searchHistory];
|
185
|
+
const existingIndex = history.indexOf(term);
|
186
|
+
if (existingIndex > -1) {
|
187
|
+
history.splice(existingIndex, 1);
|
188
|
+
}
|
189
|
+
history.unshift(term);
|
190
|
+
// Limit history to maxHistoryItems (default 5)
|
191
|
+
this.searchHistory = history.slice(0, this.maxHistoryItems);
|
192
|
+
if (typeof localStorage !== 'undefined') {
|
193
|
+
localStorage.setItem(this.historyKey, JSON.stringify(this.searchHistory));
|
194
|
+
}
|
195
|
+
}
|
196
|
+
// Remove individual history entry
|
197
|
+
removeFromHistory(term) {
|
198
|
+
if (!this.enableHistory)
|
199
|
+
return;
|
200
|
+
const history = [...this.searchHistory];
|
201
|
+
const index = history.indexOf(term);
|
202
|
+
if (index > -1) {
|
203
|
+
history.splice(index, 1);
|
204
|
+
this.searchHistory = history;
|
205
|
+
// Update localStorage
|
206
|
+
if (typeof localStorage !== 'undefined') {
|
207
|
+
localStorage.setItem(this.historyKey, JSON.stringify(this.searchHistory));
|
208
|
+
}
|
209
|
+
// Update suggestions after removal
|
210
|
+
this.updateSuggestions();
|
211
|
+
// Close dropdown if no history remains
|
212
|
+
if (this.searchHistory.length === 0 && this.value.length === 0) {
|
213
|
+
this.showDropdown = false;
|
214
|
+
}
|
215
|
+
}
|
216
|
+
}
|
217
|
+
requestSuggestions(query) {
|
218
|
+
this.ifxSuggestionRequested.emit(query);
|
219
|
+
this.updateSuggestions();
|
220
|
+
}
|
221
|
+
updateSuggestions() {
|
222
|
+
const query = this.value.toLowerCase();
|
223
|
+
let suggestions = [];
|
224
|
+
if (query.length > 0) {
|
225
|
+
// For text input: Mix external suggestions and relevant history
|
226
|
+
// 1. Filter external suggestions
|
227
|
+
if (this.suggestions && this.suggestions.length > 0) {
|
228
|
+
const filteredExternal = this.suggestions.filter(s => s.text.toLowerCase().includes(query));
|
229
|
+
suggestions = [...suggestions, ...filteredExternal];
|
230
|
+
}
|
231
|
+
// 2. Filter relevant history entries
|
232
|
+
if (this.enableHistory && this.searchHistory.length > 0) {
|
233
|
+
const filteredHistory = this.searchHistory
|
234
|
+
.filter(term => term.toLowerCase().includes(query))
|
235
|
+
.map((term, index) => ({
|
236
|
+
id: `history-${index}`,
|
237
|
+
text: term,
|
238
|
+
type: 'history'
|
239
|
+
}));
|
240
|
+
suggestions = [...suggestions, ...filteredHistory];
|
241
|
+
}
|
242
|
+
// 3. Sort by relevance (exact matches first, then prefix matches)
|
243
|
+
suggestions.sort((a, b) => {
|
244
|
+
const aText = a.text.toLowerCase();
|
245
|
+
const bText = b.text.toLowerCase();
|
246
|
+
// Exact match has highest priority
|
247
|
+
if (aText === query && bText !== query)
|
248
|
+
return -1;
|
249
|
+
if (bText === query && aText !== query)
|
250
|
+
return 1;
|
251
|
+
// Prefix match has second highest priority
|
252
|
+
const aStartsWith = aText.startsWith(query);
|
253
|
+
const bStartsWith = bText.startsWith(query);
|
254
|
+
if (aStartsWith && !bStartsWith)
|
255
|
+
return -1;
|
256
|
+
if (bStartsWith && !aStartsWith)
|
257
|
+
return 1;
|
258
|
+
// With equal relevance: external suggestions before history
|
259
|
+
if (a.type === 'suggestion' && b.type === 'history')
|
260
|
+
return -1;
|
261
|
+
if (a.type === 'history' && b.type === 'suggestion')
|
262
|
+
return 1;
|
263
|
+
// Alphabetical sorting as last criterion
|
264
|
+
return aText.localeCompare(bText);
|
265
|
+
});
|
266
|
+
}
|
267
|
+
else {
|
268
|
+
// For empty query: Show only history (no external suggestions)
|
269
|
+
if (this.enableHistory && this.searchHistory.length > 0) {
|
270
|
+
const historySuggestions = this.searchHistory.map((term, index) => ({
|
271
|
+
id: `history-${index}`,
|
272
|
+
text: term,
|
273
|
+
type: 'history'
|
274
|
+
}));
|
275
|
+
suggestions = historySuggestions;
|
276
|
+
}
|
277
|
+
// For empty query DO NOT show external suggestions
|
278
|
+
}
|
279
|
+
// Remove duplicates based on text and scope combination (history takes precedence over external)
|
280
|
+
const uniqueSuggestions = suggestions.reduce((unique, current) => {
|
281
|
+
const existingIndex = unique.findIndex(item => item.text.toLowerCase() === current.text.toLowerCase() &&
|
282
|
+
item.scope === current.scope);
|
283
|
+
if (existingIndex === -1) {
|
284
|
+
unique.push(current);
|
285
|
+
}
|
286
|
+
else {
|
287
|
+
// If already exists, prefer history over external suggestions
|
288
|
+
if (current.type === 'history' && unique[existingIndex].type !== 'history') {
|
289
|
+
unique[existingIndex] = current;
|
290
|
+
}
|
291
|
+
}
|
292
|
+
return unique;
|
293
|
+
}, []);
|
294
|
+
this.filteredSuggestions = uniqueSuggestions.slice(0, this.maxSuggestions);
|
295
|
+
this.selectedSuggestionIndex = -1;
|
296
|
+
}
|
297
|
+
navigateSuggestions(direction) {
|
298
|
+
const maxIndex = this.filteredSuggestions.length - 1;
|
299
|
+
if (direction > 0) {
|
300
|
+
this.selectedSuggestionIndex = this.selectedSuggestionIndex < maxIndex
|
301
|
+
? this.selectedSuggestionIndex + 1
|
302
|
+
: 0;
|
303
|
+
}
|
304
|
+
else {
|
305
|
+
this.selectedSuggestionIndex = this.selectedSuggestionIndex > 0
|
306
|
+
? this.selectedSuggestionIndex - 1
|
307
|
+
: maxIndex;
|
308
|
+
}
|
309
|
+
}
|
310
|
+
selectSuggestion(suggestion) {
|
311
|
+
this.value = suggestion.text;
|
312
|
+
this.inputElement.value = suggestion.text;
|
313
|
+
this.ifxSuggestionSelected.emit(suggestion);
|
314
|
+
this.ifxInput.emit(this.value);
|
315
|
+
if (this.enableHistory) {
|
316
|
+
// Always add selected suggestions to history since they are valid results
|
317
|
+
this.addToHistory(suggestion.text);
|
318
|
+
}
|
319
|
+
this.hideDropdown();
|
320
|
+
}
|
321
|
+
hideDropdown() {
|
322
|
+
this.showDropdown = false;
|
323
|
+
this.selectedSuggestionIndex = -1;
|
324
|
+
this.isFocused = false;
|
325
|
+
}
|
326
|
+
// Show only history in dropdown (e.g. on focus without input)
|
327
|
+
showHistoryDropdown() {
|
328
|
+
if (this.enableHistory && this.searchHistory.length > 0) {
|
329
|
+
// Show only history entries
|
330
|
+
const historySuggestions = this.searchHistory.map((term, index) => ({
|
331
|
+
id: `history-${index}`,
|
332
|
+
text: term,
|
333
|
+
type: 'history'
|
334
|
+
}));
|
335
|
+
this.filteredSuggestions = historySuggestions.slice(0, this.maxSuggestions);
|
336
|
+
this.selectedSuggestionIndex = -1;
|
337
|
+
}
|
338
|
+
else {
|
339
|
+
this.filteredSuggestions = [];
|
340
|
+
}
|
341
|
+
}
|
342
|
+
// Check if only history entries are displayed (without text input)
|
343
|
+
isShowingOnlyHistory() {
|
344
|
+
return this.value.length === 0 &&
|
345
|
+
this.filteredSuggestions.length > 0 &&
|
346
|
+
this.filteredSuggestions.every(s => s.type === 'history');
|
347
|
+
}
|
348
|
+
// Render text with highlighted matches
|
349
|
+
renderHighlightedText(text, query) {
|
350
|
+
if (!query || query.length === 0) {
|
351
|
+
return text;
|
352
|
+
}
|
353
|
+
const lowerText = text.toLowerCase();
|
354
|
+
const lowerQuery = query.toLowerCase();
|
355
|
+
const index = lowerText.indexOf(lowerQuery);
|
356
|
+
if (index === -1) {
|
357
|
+
return text;
|
358
|
+
}
|
359
|
+
const before = text.substring(0, index);
|
360
|
+
const match = text.substring(index, index + query.length);
|
361
|
+
const after = text.substring(index + query.length);
|
362
|
+
return [
|
363
|
+
before,
|
364
|
+
h("strong", null, match),
|
365
|
+
after
|
366
|
+
];
|
367
|
+
}
|
368
|
+
async componentWillLoad() {
|
369
|
+
this.loadSearchHistory();
|
370
|
+
if (!isNestedInIfxComponent(this.el)) {
|
371
|
+
const framework = detectFramework();
|
372
|
+
trackComponent('ifx-search-field', await framework);
|
373
|
+
}
|
374
|
+
}
|
375
|
+
componentWillUpdate() {
|
376
|
+
if (this.value !== "") {
|
377
|
+
this.showDeleteIconInternalState = true;
|
378
|
+
}
|
379
|
+
else
|
380
|
+
this.showDeleteIconInternalState = false;
|
381
|
+
}
|
382
|
+
render() {
|
383
|
+
return (h("div", { key: '637f2c7144beb35f9915a64fac8df66d65ec5118', "aria-disabled": this.disabled, "aria-value": this.value, class: 'search-field' }, h("div", { key: 'b5c4d373d93a9225ca08db7340e2732f585c5e80', class: this.getWrapperClassNames(), tabindex: 1, onClick: () => this.focusInput() }, h("ifx-icon", { key: '6cc46a75102036d4706d8873e4d0481d0bce263f', icon: "search-16", class: "search-icon" }), h("input", { key: 'd770d8a5dc8cf75c8a0f3f3f9d557ccf88bf525d', ref: (el) => (this.inputElement = el), type: "text", autocomplete: this.autocomplete, onInput: () => this.handleInput(), onFocus: () => this.focusInput(), onBlur: () => this.blurInput(), placeholder: this.placeholder, disabled: this.disabled, maxlength: this.maxlength, value: this.value, role: "combobox", "aria-expanded": this.showDropdown, "aria-autocomplete": "list", "aria-haspopup": "listbox", "aria-label": this.ariaLabel, "aria-labelledby": this.ariaLabelledBy, "aria-describedby": this.ariaDescribedBy, "aria-owns": this.showDropdown ? 'suggestions-dropdown' : undefined, "aria-activedescendant": this.selectedSuggestionIndex >= 0 ? `suggestion-${this.selectedSuggestionIndex}` : undefined }), this.showDeleteIcon && this.showDeleteIconInternalState ? (h("ifx-icon", { icon: "cRemove16", class: "delete-icon", onClick: this.handleDelete, role: "button", tabindex: "0", "aria-label": this.deleteIconAriaLabel, onKeyDown: (event) => {
|
384
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
385
|
+
event.preventDefault();
|
386
|
+
this.handleDelete();
|
387
|
+
}
|
388
|
+
} })) : null), this.showDropdown && this.filteredSuggestions.length > 0 && (h("div", { key: 'be15e8157313ad37d0b991ea74b46ba8a7c88880', ref: (el) => (this.dropdownElement = el), id: "suggestions-dropdown", class: "suggestions-dropdown", role: "listbox", "aria-label": this.dropdownAriaLabel }, this.isShowingOnlyHistory() && (h("div", { key: 'd3a1e06a246436ffbc239c502bd76c9250317411', class: "suggestions-header" }, this.historyHeaderText)), this.filteredSuggestions.map((suggestion, index) => (h("div", { key: suggestion.id, id: `suggestion-${index}`, class: this.getSuggestionClassNames(index), role: "option", "aria-selected": index === this.selectedSuggestionIndex, "aria-label": `${suggestion.type === 'history' ? this.historyItemAriaLabel : this.suggestionAriaLabel}: ${suggestion.text}${suggestion.scope ? `, ${suggestion.scope}` : ''}${suggestion.resultCount ? `, ${suggestion.resultCount} results` : ''}`, onClick: () => this.selectSuggestion(suggestion), onMouseEnter: () => this.selectedSuggestionIndex = index }, h("div", { class: "suggestion-content" }, suggestion.type === 'history' && (h("ifx-icon", { icon: "history-16", class: "suggestion-icon suggestion-icon--history" })), suggestion.type === 'suggestion' && (h("ifx-icon", { icon: "search-16", class: "suggestion-icon suggestion-icon--suggestion" })), h("span", { class: "suggestion-text" }, h("span", { class: "suggestion-main-text" }, this.renderHighlightedText(suggestion.text, this.value)), suggestion.scope && (h("span", { class: "suggestion-scope" }, "\u2013 ", suggestion.scope))), suggestion.resultCount !== undefined && suggestion.scope && (h("span", { class: "suggestion-count" }, suggestion.resultCount)), suggestion.type === 'history' && (h("ifx-icon", { icon: "cross16", class: "suggestion-delete-icon", role: "button", tabindex: "0", "aria-label": `${this.historyDeleteAriaLabel}: ${suggestion.text}`, onClick: (event) => this.handleHistoryDelete(event, suggestion.text), onKeyDown: (event) => {
|
389
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
390
|
+
event.preventDefault();
|
391
|
+
this.handleHistoryDelete(event, suggestion.text);
|
392
|
+
}
|
393
|
+
} }))))))))));
|
394
|
+
}
|
395
|
+
getSizeClass() {
|
396
|
+
return `${this.size}` === "s"
|
397
|
+
? "search-field__wrapper-s"
|
398
|
+
: "";
|
399
|
+
}
|
400
|
+
getWrapperClassNames() {
|
401
|
+
return classNames(`search-field__wrapper`, `search-field__wrapper ${this.getSizeClass()}`, `${this.isFocused ? 'focused' : ""}`, `${this.showDropdown ? 'dropdown-open' : ""}`);
|
402
|
+
}
|
403
|
+
getSuggestionClassNames(index) {
|
404
|
+
var _a;
|
405
|
+
return classNames('suggestion-item', {
|
406
|
+
'suggestion-item--selected': index === this.selectedSuggestionIndex,
|
407
|
+
'suggestion-item--history': ((_a = this.filteredSuggestions[index]) === null || _a === void 0 ? void 0 : _a.type) === 'history'
|
408
|
+
});
|
409
|
+
}
|
410
|
+
get el() { return this; }
|
411
|
+
static get watchers() { return {
|
412
|
+
"value": ["valueWatcher"],
|
413
|
+
"suggestions": ["suggestionsWatcher"]
|
414
|
+
}; }
|
415
|
+
static get style() { return IfxSearchFieldStyle0; }
|
416
|
+
}, [1, "ifx-search-field", {
|
417
|
+
"value": [1025],
|
418
|
+
"suggestions": [16],
|
419
|
+
"showSuggestions": [4, "show-suggestions"],
|
420
|
+
"maxSuggestions": [2, "max-suggestions"],
|
421
|
+
"maxHistoryItems": [2, "max-history-items"],
|
422
|
+
"enableHistory": [4, "enable-history"],
|
423
|
+
"historyKey": [1, "history-key"],
|
424
|
+
"historyHeaderText": [1, "history-header-text"],
|
425
|
+
"ariaLabel": [1, "aria-label"],
|
426
|
+
"ariaLabelledBy": [1, "aria-labelled-by"],
|
427
|
+
"ariaDescribedBy": [1, "aria-described-by"],
|
428
|
+
"deleteIconAriaLabel": [1, "delete-icon-aria-label"],
|
429
|
+
"historyDeleteAriaLabel": [1, "history-delete-aria-label"],
|
430
|
+
"dropdownAriaLabel": [1, "dropdown-aria-label"],
|
431
|
+
"suggestionAriaLabel": [1, "suggestion-aria-label"],
|
432
|
+
"historyItemAriaLabel": [1, "history-item-aria-label"],
|
433
|
+
"showDeleteIcon": [4, "show-delete-icon"],
|
434
|
+
"disabled": [4],
|
435
|
+
"size": [1],
|
436
|
+
"placeholder": [1],
|
437
|
+
"autocomplete": [1],
|
438
|
+
"maxlength": [2],
|
439
|
+
"showDropdown": [32],
|
440
|
+
"filteredSuggestions": [32],
|
441
|
+
"selectedSuggestionIndex": [32],
|
442
|
+
"searchHistory": [32],
|
443
|
+
"showDeleteIconInternalState": [32],
|
444
|
+
"isFocused": [32]
|
445
|
+
}, [[5, "mousedown", "handleOutsideClick"], [0, "keydown", "handleKeyDown"]], {
|
446
|
+
"value": ["valueWatcher"],
|
447
|
+
"suggestions": ["suggestionsWatcher"]
|
448
|
+
}]);
|
449
|
+
function defineCustomElement() {
|
450
|
+
if (typeof customElements === "undefined") {
|
451
|
+
return;
|
452
|
+
}
|
453
|
+
const components = ["ifx-search-field", "ifx-icon"];
|
454
|
+
components.forEach(tagName => { switch (tagName) {
|
455
|
+
case "ifx-search-field":
|
456
|
+
if (!customElements.get(tagName)) {
|
457
|
+
customElements.define(tagName, SearchField);
|
458
|
+
}
|
459
|
+
break;
|
460
|
+
case "ifx-icon":
|
461
|
+
if (!customElements.get(tagName)) {
|
462
|
+
defineCustomElement$1();
|
463
|
+
}
|
464
|
+
break;
|
465
|
+
} });
|
466
|
+
}
|
467
|
+
|
468
|
+
export { SearchField as S, defineCustomElement as d };
|
469
|
+
|
470
|
+
//# sourceMappingURL=p-15597da9.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"p-15597da9.js","mappings":";;;;;;AAAA,MAAM,cAAc,GAAG,miKAA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mB,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;iBAClD;aACF,GACS,CACb,CACG,CACF,CACP,CAAC,CACE,CACP,CACG,EACN;KACH;IAED,YAAY;QACV,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG;cACzB,yBAAyB;cACzB,EAAE,CAAC;KACR;IAED,oBAAoB;QAClB,OAAO,UAAU,CACf,uBAAuB,EACvB,yBAAyB,IAAI,CAAC,YAAY,EAAE,EAAE,EAC9C,GAAG,IAAI,CAAC,SAAS,GAAG,SAAS,GAAG,EAAE,EAAE,EACpC,GAAG,IAAI,CAAC,YAAY,GAAG,eAAe,GAAG,EAAE,EAAE,CAC9C,CAAC;KACH;IAED,uBAAuB,CAAC,KAAa;;QACnC,OAAO,UAAU,CACf,iBAAiB,EACjB;YACE,2BAA2B,EAAE,KAAK,KAAK,IAAI,CAAC,uBAAuB;YACnE,0BAA0B,EAAE,CAAA,MAAA,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,0CAAE,IAAI,MAAK,SAAS;SAChF,CACF,CAAC;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/search-field/search-field.scss?tag=ifx-search-field&encapsulation=shadow","src/components/search-field/search-field.tsx"],"sourcesContent":["@use \"~@infineon/design-system-tokens/dist/tokens\";\n@use \"../../global/font.scss\";\n\n:host {\n display: flex;\n}\n\n.search-field {\n box-sizing: border-box;\n background-color: tokens.$ifxColorBaseWhite;\n width: 100%;\n font-family: var(--ifx-font-family);\n position: relative; // Wichtig für absolute positioning des Dropdowns\n\n .search-field__wrapper {\n box-sizing: border-box;\n height: tokens.$ifxSize500;\n display: flex;\n align-items: center;\n border: 1px solid #8D8786;\n border-radius: tokens.$ifxBorderRadius12;\n padding: tokens.$ifxSpace100 tokens.$ifxSpace200;\n gap: tokens.$ifxSpace150;\n flex: none;\n order: 0;\n align-self: stretch;\n flex-grow: 0;\n position: relative;\n width: 100%;\n outline: none;\n color: tokens.$ifxColorEngineering400;\n\n &.focused {\n border: 1px solid tokens.$ifxColorOcean500;\n\n & ifx-icon {\n color: tokens.$ifxColorEngineering500;\n }\n }\n\n &.search-field__wrapper-s {\n height: 36px;\n }\n\n\n &:hover:not(.focused, :focus) {\n border: 1px solid #3C3A39;\n }\n\n &:focus {\n outline: none;\n border: 1px solid #0A8276;\n }\n\n\n .delete-icon {\n right: 12px;\n cursor: pointer;\n }\n\n input[type='text'] {\n font-style: normal;\n font-weight: 400;\n font-size: 16px;\n //line-height: 24px;\n color: #8D8786;\n border: none;\n width: 100%;\n outline: none;\n //height: 100%;\n height: 16px;\n\n &:focus {\n outline: none;\n color: #1d1d1d;\n }\n\n &:disabled {\n background-color: #EEEDED;\n }\n }\n\n &:has(input[disabled]) {\n background-color: #EEEDED;\n }\n }\n\n // Suggestions Dropdown Styles\n .suggestions-dropdown {\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n background: tokens.$ifxColorBaseWhite;\n margin-top: tokens.$ifxSpace50;\n border: 1px solid tokens.$ifxColorEngineering200;\n box-shadow: 0px 6px 9px 0px rgba(29, 29, 29, 0.10);\n z-index: 1000;\n max-height: 300px;\n overflow-y: auto;\n container-type: inline-size; // Enable container queries\n\n .suggestions-header {\n // font: tokens.$ifxEyebrowEyebrow02; TODO\n font-family: Source Sans 3;\n font-size: 0.8125rem;\n font-weight: 600;\n line-height: 1.25rem;\n\n letter-spacing: 0.25em;\n text-transform: uppercase;\n color: tokens.$ifxColorEngineering500;\n border-bottom: 1px solid tokens.$ifxColorEngineering200;\n padding: tokens.$ifxSpace150 tokens.$ifxSpace200;\n }\n\n .suggestion-item {\n padding: tokens.$ifxSpace150 tokens.$ifxSpace200;\n cursor: pointer;\n transition: background-color 0.2s ease;\n\n &:last-child {\n border-bottom: none;\n }\n\n &:hover,\n &--selected {\n background-color: tokens.$ifxColorEngineering200;\n }\n\n .suggestion-content {\n display: flex;\n align-items: center;\n gap: tokens.$ifxSpace150;\n\n .suggestion-icon {\n color: tokens.$ifxColorEngineering500;\n flex-shrink: 0;\n\n &--history {\n color: tokens.$ifxColorEngineering500;\n }\n }\n\n .suggestion-text {\n flex: 1;\n display: flex;\n align-items: center;\n min-width: 0; // Important for flexbox truncation\n\n .suggestion-main-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex-shrink: 1;\n min-width: 0;\n }\n\n .suggestion-scope {\n color: tokens.$ifxColorEngineering400;\n flex-shrink: 0; // Never truncate the scope\n white-space: nowrap;\n margin-left: tokens.$ifxSpace25; // Add space before the scope\n font-weight: tokens.$ifxFontWeightSemibold;\n font-size: tokens.$ifxFontSizeXs;\n }\n\n // When container is narrow, stack scope below main text\n @container (max-width: 320px) {\n flex-direction: column;\n align-items: flex-start;\n\n .suggestion-main-text {\n width: 100%;\n max-width: 100%;\n }\n\n .suggestion-scope {\n margin-left: 0;\n margin-top: 0;\n width: 100%;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n flex-shrink: 1; // Allow truncation when narrow\n }\n }\n }\n\n .suggestion-count {\n color: tokens.$ifxColorEngineering400;\n margin-left: auto;\n flex-shrink: 0;\n }\n\n .suggestion-delete-icon {\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.2s ease, visibility 0.2s ease;\n cursor: pointer;\n margin-left: auto;\n flex-shrink: 0;\n color: tokens.$ifxColorEngineering500;\n\n &:hover {\n color: tokens.$ifxColorEngineering600;\n }\n }\n }\n\n &:hover {\n .suggestion-delete-icon {\n opacity: 1;\n visibility: visible;\n }\n }\n }\n }\n\n // Wrapper modifications when dropdown is open\n .search-field__wrapper.dropdown-open {\n border-radius: tokens.$ifxBorderRadius12 tokens.$ifxBorderRadius12 0 0;\n border-color: tokens.$ifxColorOcean500;\n }\n}\n","import { Component, EventEmitter, h, Event, Prop, Watch, State, Listen, Element } from '@stencil/core';\nimport { trackComponent } from '../../global/utils/tracking';\nimport { isNestedInIfxComponent } from '../../global/utils/dom-utils';\nimport { detectFramework } from '../../global/utils/framework-detection';\nimport classNames from 'classnames';\n\nexport interface SuggestionItem {\n id: string;\n text: string;\n type?: 'suggestion' | 'history';\n scope?: string;\n resultCount?: number;\n metadata?: any;\n}\n\n@Component({\n tag: 'ifx-search-field',\n styleUrl: 'search-field.scss',\n shadow: true\n})\n\nexport class SearchField {\n @Element() el;\n private inputElement: HTMLInputElement;\n private dropdownElement: HTMLDivElement;\n\n @Prop({ mutable: true }) value: string = '';\n @Prop() suggestions: SuggestionItem[] = [];\n @Prop() showSuggestions: boolean = false;\n @Prop() maxSuggestions: number = 10;\n @Prop() maxHistoryItems: number = 5;\n @Prop() enableHistory: boolean = true;\n @Prop() historyKey: string = 'ifx-search-history';\n @Prop() historyHeaderText: string = 'Recent Searches';\n\n // ARIA Labels and Accessibility Props\n @Prop() ariaLabel: string | null = \"Search Field\"\n @Prop() ariaLabelledBy?: string | null;\n @Prop() ariaDescribedBy?: string | null;\n @Prop() deleteIconAriaLabel: string = 'Clear search';\n @Prop() historyDeleteAriaLabel: string = 'Remove from history';\n @Prop() dropdownAriaLabel: string = 'Search suggestions and history';\n @Prop() suggestionAriaLabel: string = 'Search suggestion';\n @Prop() historyItemAriaLabel: string = 'Search history item';\n\n @Event() ifxInput: EventEmitter<string>;\n @Event() ifxSuggestionRequested: EventEmitter<string>;\n @Event() ifxSuggestionSelected: EventEmitter<SuggestionItem>;\n @Event() ifxFocus: EventEmitter<void>;\n @Event() ifxBlur: EventEmitter<void>;\n\n @State() showDropdown: boolean = false;\n @State() filteredSuggestions: SuggestionItem[] = [];\n @State() selectedSuggestionIndex: number = -1;\n @State() searchHistory: string[] = [];\n\n @Prop() showDeleteIcon: boolean = false;\n @State() showDeleteIconInternalState: boolean = false;\n @Prop() disabled: boolean = false;\n @Prop() size: string = 'l';\n @State() isFocused: boolean = false;\n @Prop() placeholder: string = \"Search...\";\n @Prop() autocomplete: string = \"off\";\n @Prop() maxlength?: number = null;\n\n private focusEmitted: boolean = false;\n\n @Listen('mousedown', { target: 'document' })\n handleOutsideClick(event: MouseEvent) {\n const path = event.composedPath();\n if (!path.includes(this.inputElement) && !path.includes(this.dropdownElement)) {\n this.hideDropdown();\n }\n }\n\n @Listen('keydown')\n handleKeyDown(event: KeyboardEvent) {\n if (!this.showDropdown) return;\n\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n this.navigateSuggestions(1);\n break;\n case 'ArrowUp':\n event.preventDefault();\n this.navigateSuggestions(-1);\n break;\n case 'Enter':\n event.preventDefault();\n if (this.selectedSuggestionIndex >= 0) {\n this.selectSuggestion(this.filteredSuggestions[this.selectedSuggestionIndex]);\n } else {\n this.handleSearch();\n }\n break;\n case 'Escape':\n this.hideDropdown();\n break;\n }\n }\n\n @Watch('value')\n valueWatcher(newValue: string) {\n if (this.inputElement && newValue !== this.inputElement.value) {\n this.inputElement.value = newValue;\n }\n this.updateSuggestions();\n }\n\n @Watch('suggestions')\n suggestionsWatcher() {\n this.updateSuggestions();\n }\n\n\n handleInput = () => {\n const query = this.inputElement.value;\n this.value = query;\n this.ifxInput.emit(this.value);\n\n if (this.showSuggestions) {\n this.showDropdown = true;\n this.selectedSuggestionIndex = -1;\n this.requestSuggestions(query);\n }\n };\n\n handleDelete = () => {\n this.inputElement.value = '';\n this.value = \"\";\n this.ifxInput.emit(this.value);\n this.hideDropdown();\n }\n\n handleSearch = () => {\n if (this.value.trim() && this.enableHistory) {\n // Only add to history if there are actual results\n if (this.filteredSuggestions.length > 0) {\n this.addToHistory(this.value);\n }\n }\n this.hideDropdown();\n }\n\n focusInput() {\n // Don't call focus() if the input is already focused to prevent unnecessary operations\n if (document.activeElement !== this.inputElement) {\n this.inputElement.focus();\n }\n\n // Only emit focus event if it hasn't been emitted already\n if (!this.focusEmitted) {\n this.focusEmitted = true;\n this.isFocused = true;\n this.ifxFocus.emit();\n }\n\n if (this.showSuggestions) {\n // On focus without input: Show only history\n if (this.value.length === 0) {\n this.showHistoryDropdown();\n // Only show dropdown if history is actually present\n this.showDropdown = this.enableHistory && this.searchHistory.length > 0;\n } else {\n // With existing input: Normal suggestion logic\n this.updateSuggestions();\n this.showDropdown = this.filteredSuggestions.length > 0;\n }\n }\n }\n\n blurInput() {\n setTimeout(() => {\n this.isFocused = false;\n this.focusEmitted = false; // Reset focus flag when blur occurs\n this.ifxBlur.emit();\n }, 150);\n }\n\n // Public method to update history from external sources\n public loadSearchHistory() {\n if (this.enableHistory && typeof localStorage !== 'undefined') {\n const stored = localStorage.getItem(this.historyKey);\n this.searchHistory = stored ? JSON.parse(stored) : [];\n\n // Update suggestions when history is loaded\n this.updateSuggestions();\n\n // If no input and no history left, close dropdown\n if (this.value.length === 0 && this.searchHistory.length === 0) {\n this.showDropdown = false;\n }\n }\n }\n\n // Public method to completely clear history\n public clearSearchHistory() {\n if (this.enableHistory && typeof localStorage !== 'undefined') {\n // Clear from localStorage\n localStorage.removeItem(this.historyKey);\n\n // Clear internal history\n this.searchHistory = [];\n\n // Reset all dropdown-relevant states\n this.filteredSuggestions = [];\n this.selectedSuggestionIndex = -1;\n this.showDropdown = false;\n\n // Update suggestions after reset\n this.updateSuggestions();\n }\n }\n\n // Suggestion Management Methods\n private addToHistory(term: string) {\n if (!this.enableHistory || !term.trim()) return;\n\n const history = [...this.searchHistory];\n const existingIndex = history.indexOf(term);\n\n if (existingIndex > -1) {\n history.splice(existingIndex, 1);\n }\n\n history.unshift(term);\n // Limit history to maxHistoryItems (default 5)\n this.searchHistory = history.slice(0, this.maxHistoryItems);\n\n if (typeof localStorage !== 'undefined') {\n localStorage.setItem(this.historyKey, JSON.stringify(this.searchHistory));\n }\n }\n\n // Remove individual history entry\n private removeFromHistory(term: string) {\n if (!this.enableHistory) return;\n\n const history = [...this.searchHistory];\n const index = history.indexOf(term);\n\n if (index > -1) {\n history.splice(index, 1);\n this.searchHistory = history;\n\n // Update localStorage\n if (typeof localStorage !== 'undefined') {\n localStorage.setItem(this.historyKey, JSON.stringify(this.searchHistory));\n }\n\n // Update suggestions after removal\n this.updateSuggestions();\n\n // Close dropdown if no history remains\n if (this.searchHistory.length === 0 && this.value.length === 0) {\n this.showDropdown = false;\n }\n }\n }\n\n // Handle click on history delete button\n private handleHistoryDelete = (event: Event, term: string) => {\n event.stopPropagation(); // Prevent selection of the entry\n this.removeFromHistory(term);\n }\n\n private requestSuggestions(query: string) {\n this.ifxSuggestionRequested.emit(query);\n this.updateSuggestions();\n }\n\n private updateSuggestions() {\n const query = this.value.toLowerCase();\n let suggestions: SuggestionItem[] = [];\n\n if (query.length > 0) {\n // For text input: Mix external suggestions and relevant history\n\n // 1. Filter external suggestions\n if (this.suggestions && this.suggestions.length > 0) {\n const filteredExternal = this.suggestions.filter(s =>\n s.text.toLowerCase().includes(query)\n );\n suggestions = [...suggestions, ...filteredExternal];\n }\n\n // 2. Filter relevant history entries\n if (this.enableHistory && this.searchHistory.length > 0) {\n const filteredHistory = this.searchHistory\n .filter(term => term.toLowerCase().includes(query))\n .map((term, index) => ({\n id: `history-${index}`,\n text: term,\n type: 'history' as const\n }));\n suggestions = [...suggestions, ...filteredHistory];\n }\n\n // 3. Sort by relevance (exact matches first, then prefix matches)\n suggestions.sort((a, b) => {\n const aText = a.text.toLowerCase();\n const bText = b.text.toLowerCase();\n\n // Exact match has highest priority\n if (aText === query && bText !== query) return -1;\n if (bText === query && aText !== query) return 1;\n\n // Prefix match has second highest priority\n const aStartsWith = aText.startsWith(query);\n const bStartsWith = bText.startsWith(query);\n\n if (aStartsWith && !bStartsWith) return -1;\n if (bStartsWith && !aStartsWith) return 1;\n\n // With equal relevance: external suggestions before history\n if (a.type === 'suggestion' && b.type === 'history') return -1;\n if (a.type === 'history' && b.type === 'suggestion') return 1;\n\n // Alphabetical sorting as last criterion\n return aText.localeCompare(bText);\n });\n\n } else {\n // For empty query: Show only history (no external suggestions)\n if (this.enableHistory && this.searchHistory.length > 0) {\n const historySuggestions = this.searchHistory.map((term, index) => ({\n id: `history-${index}`,\n text: term,\n type: 'history' as const\n }));\n\n suggestions = historySuggestions;\n }\n // For empty query DO NOT show external suggestions\n }\n\n // Remove duplicates based on text and scope combination (history takes precedence over external)\n const uniqueSuggestions = suggestions.reduce((unique: SuggestionItem[], current) => {\n const existingIndex = unique.findIndex(item =>\n item.text.toLowerCase() === current.text.toLowerCase() &&\n item.scope === current.scope\n );\n if (existingIndex === -1) {\n unique.push(current);\n } else {\n // If already exists, prefer history over external suggestions\n if (current.type === 'history' && unique[existingIndex].type !== 'history') {\n unique[existingIndex] = current;\n }\n }\n return unique;\n }, []);\n\n this.filteredSuggestions = uniqueSuggestions.slice(0, this.maxSuggestions);\n this.selectedSuggestionIndex = -1;\n }\n\n private navigateSuggestions(direction: number) {\n const maxIndex = this.filteredSuggestions.length - 1;\n\n if (direction > 0) {\n this.selectedSuggestionIndex = this.selectedSuggestionIndex < maxIndex\n ? this.selectedSuggestionIndex + 1\n : 0;\n } else {\n this.selectedSuggestionIndex = this.selectedSuggestionIndex > 0\n ? this.selectedSuggestionIndex - 1\n : maxIndex;\n }\n }\n\n private selectSuggestion(suggestion: SuggestionItem) {\n this.value = suggestion.text;\n this.inputElement.value = suggestion.text;\n this.ifxSuggestionSelected.emit(suggestion);\n this.ifxInput.emit(this.value);\n\n if (this.enableHistory) {\n // Always add selected suggestions to history since they are valid results\n this.addToHistory(suggestion.text);\n }\n\n this.hideDropdown();\n }\n\n private hideDropdown() {\n this.showDropdown = false;\n this.selectedSuggestionIndex = -1;\n this.isFocused = false;\n }\n\n // Show only history in dropdown (e.g. on focus without input)\n private showHistoryDropdown() {\n if (this.enableHistory && this.searchHistory.length > 0) {\n // Show only history entries\n const historySuggestions = this.searchHistory.map((term, index) => ({\n id: `history-${index}`,\n text: term,\n type: 'history' as const\n }));\n\n this.filteredSuggestions = historySuggestions.slice(0, this.maxSuggestions);\n this.selectedSuggestionIndex = -1;\n } else {\n this.filteredSuggestions = [];\n }\n }\n\n // Check if only history entries are displayed (without text input)\n private isShowingOnlyHistory(): boolean {\n return this.value.length === 0 &&\n this.filteredSuggestions.length > 0 &&\n this.filteredSuggestions.every(s => s.type === 'history');\n }\n\n // Render text with highlighted matches\n private renderHighlightedText(text: string, query: string) {\n if (!query || query.length === 0) {\n return text;\n }\n\n const lowerText = text.toLowerCase();\n const lowerQuery = query.toLowerCase();\n const index = lowerText.indexOf(lowerQuery);\n\n if (index === -1) {\n return text;\n }\n\n const before = text.substring(0, index);\n const match = text.substring(index, index + query.length);\n const after = text.substring(index + query.length);\n\n return [\n before,\n <strong>{match}</strong>,\n after\n ];\n }\n\n async componentWillLoad() {\n this.loadSearchHistory();\n if(!isNestedInIfxComponent(this.el)) {\n const framework = detectFramework()\n trackComponent('ifx-search-field', await framework)\n }\n }\n\n componentWillUpdate() {\n if (this.value !== \"\") {\n this.showDeleteIconInternalState = true;\n } else this.showDeleteIconInternalState = false;\n }\n\n render() {\n return (\n <div\n aria-disabled={this.disabled}\n aria-value={this.value}\n class='search-field'\n >\n <div\n class={this.getWrapperClassNames()}\n tabindex={1}\n onClick={() => this.focusInput()}\n >\n <ifx-icon icon=\"search-16\" class=\"search-icon\"></ifx-icon>\n <input\n ref={(el) => (this.inputElement = el)}\n type=\"text\"\n autocomplete={this.autocomplete}\n onInput={() => this.handleInput()}\n onFocus={() => this.focusInput()}\n onBlur={() => this.blurInput()}\n placeholder={this.placeholder}\n disabled={this.disabled}\n maxlength={this.maxlength}\n value={this.value}\n role=\"combobox\"\n aria-expanded={this.showDropdown}\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n aria-label={this.ariaLabel}\n aria-labelledby={this.ariaLabelledBy}\n aria-describedby={this.ariaDescribedBy}\n aria-owns={this.showDropdown ? 'suggestions-dropdown' : undefined}\n aria-activedescendant={this.selectedSuggestionIndex >= 0 ? `suggestion-${this.selectedSuggestionIndex}` : undefined}\n />\n {this.showDeleteIcon && this.showDeleteIconInternalState ? (\n <ifx-icon\n icon=\"cRemove16\"\n class=\"delete-icon\"\n onClick={this.handleDelete}\n role=\"button\"\n tabindex=\"0\"\n aria-label={this.deleteIconAriaLabel}\n onKeyDown={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.handleDelete();\n }\n }}>\n </ifx-icon>\n ) : null}\n </div>\n\n {/* Suggestions Dropdown */}\n {this.showDropdown && this.filteredSuggestions.length > 0 && (\n <div\n ref={(el) => (this.dropdownElement = el)}\n id=\"suggestions-dropdown\"\n class=\"suggestions-dropdown\"\n role=\"listbox\"\n aria-label={this.dropdownAriaLabel}\n >\n {/* History Header - only show when exclusively showing history entries */}\n {this.isShowingOnlyHistory() && (\n <div class=\"suggestions-header\">\n {this.historyHeaderText}\n </div>\n )}\n\n {this.filteredSuggestions.map((suggestion, index) => (\n <div\n key={suggestion.id}\n id={`suggestion-${index}`}\n class={this.getSuggestionClassNames(index)}\n role=\"option\"\n aria-selected={index === this.selectedSuggestionIndex}\n aria-label={`${suggestion.type === 'history' ? this.historyItemAriaLabel : this.suggestionAriaLabel}: ${suggestion.text}${suggestion.scope ? `, ${suggestion.scope}` : ''}${suggestion.resultCount ? `, ${suggestion.resultCount} results` : ''}`}\n onClick={() => this.selectSuggestion(suggestion)}\n onMouseEnter={() => this.selectedSuggestionIndex = index}\n >\n <div class=\"suggestion-content\">\n {suggestion.type === 'history' && (\n <ifx-icon icon=\"history-16\" class=\"suggestion-icon suggestion-icon--history\"></ifx-icon>\n )}\n {suggestion.type === 'suggestion' && (\n <ifx-icon icon=\"search-16\" class=\"suggestion-icon suggestion-icon--suggestion\"></ifx-icon>\n )}\n <span class=\"suggestion-text\">\n <span class=\"suggestion-main-text\">\n {this.renderHighlightedText(suggestion.text, this.value)}\n </span>\n {suggestion.scope && (\n <span class=\"suggestion-scope\">– {suggestion.scope}</span>\n )}\n </span>\n\n {suggestion.resultCount !== undefined && suggestion.scope && (\n <span class=\"suggestion-count\">{suggestion.resultCount}</span>\n )}\n\n {/* Delete Button only for history entries */}\n {suggestion.type === 'history' && (\n <ifx-icon\n icon=\"cross16\"\n class=\"suggestion-delete-icon\"\n role=\"button\"\n tabindex=\"0\"\n aria-label={`${this.historyDeleteAriaLabel}: ${suggestion.text}`}\n onClick={(event) => this.handleHistoryDelete(event, suggestion.text)}\n onKeyDown={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.handleHistoryDelete(event, suggestion.text);\n }\n }}\n ></ifx-icon>\n )}\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n );\n }\n\n getSizeClass() {\n return `${this.size}` === \"s\"\n ? \"search-field__wrapper-s\"\n : \"\";\n }\n\n getWrapperClassNames() {\n return classNames(\n `search-field__wrapper`,\n `search-field__wrapper ${this.getSizeClass()}`,\n `${this.isFocused ? 'focused' : \"\"}`,\n `${this.showDropdown ? 'dropdown-open' : \"\"}`\n );\n }\n\n getSuggestionClassNames(index: number) {\n return classNames(\n 'suggestion-item',\n {\n 'suggestion-item--selected': index === this.selectedSuggestionIndex,\n 'suggestion-item--history': this.filteredSuggestions[index]?.type === 'history'\n }\n );\n }\n}\n"],"version":3}
|
@@ -20,8 +20,8 @@ const Spinner = /*@__PURE__*/ proxyCustomElement(class Spinner extends H {
|
|
20
20
|
}
|
21
21
|
}
|
22
22
|
render() {
|
23
|
-
return (h("div", { key: '
|
24
|
-
&& h("div", { key: '
|
23
|
+
return (h("div", { key: '7cec3ef86795185d14979ea67bb02b94ca428b07', "aria-label": "spinner indicating a loading process", class: this.getClassNames() }, h("div", { key: 'd8dea5acb66bde0f42beb7fe9ee69d887d5ca178', class: `${this.variant !== 'brand' ? 'border' : ""} ${this.inverted ? 'inverted' : ""}` }), this.variant === 'brand'
|
24
|
+
&& h("div", { key: '51decc3e682ab5a2bee56c06d86663865acbf42b', class: `semiconductor ${this.inverted ? 'inverted' : ""} ${this.getSizeClass()}` }, h("svg", { key: 'dd0f03cea52f1297d5f46939d2f7d205d846fe80', width: '40', height: '40', viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("g", { key: 'ceed7284918f1a9efc1e29f84b986088729cd89e', id: "spinner/conductor" }, h("path", { key: 'a0982b7a458375bcab0d8d6ebb635f6901bca7b1', id: "Vector", d: "M38.75 18.75C39.4375 18.75 40 19.3125 40 20C40 20.6875 39.4409 21.25 38.75 21.25H35V26.25H38.75C39.4375 26.25 40 26.8125 40 27.5C40 28.1875 39.4409 28.75 38.75 28.75H35V30C35 32.7617 32.7617 35 30 35H28.75V38.75C28.75 39.4409 28.1875 40 27.5 40C26.8125 40 26.25 39.4409 26.25 38.75V35H21.25V38.75C21.25 39.4409 20.6875 40 20 40C19.3125 40 18.75 39.4409 18.75 38.75V35H13.75V38.75C13.75 39.4409 13.1875 40 12.5 40C11.8125 40 11.25 39.4409 11.25 38.75V35H10C7.23828 35 5 32.7617 5 30V28.75H1.25C0.559062 28.75 0 28.1875 0 27.5C0 26.8125 0.559062 26.25 1.25 26.25H5V21.25H1.25C0.559062 21.25 0 20.6875 0 20C0 19.3125 0.559062 18.75 1.25 18.75H5V13.75H1.25C0.559062 13.75 0 13.1875 0 12.5C0 11.8125 0.559062 11.25 1.25 11.25H5V10C5 7.23828 7.23828 5 10 5H11.25V1.25C11.25 0.5625 11.8125 0 12.5 0C13.1875 0 13.75 0.559063 13.75 1.25V5H18.75V1.25C18.75 0.559063 19.3091 0 20 0C20.6909 0 21.25 0.559063 21.25 1.25V5H26.25V1.25C26.25 0.559063 26.8091 0 27.5 0C28.1909 0 28.75 0.559063 28.75 1.25V5H30C32.7617 5 35 7.23828 35 10V11.25H38.75C39.4409 11.25 40 11.8091 40 12.5C40 13.1909 39.4409 13.75 38.75 13.75H35V18.75H38.75ZM32.5 10C32.5 8.62188 31.3781 7.5 30 7.5H10C8.62187 7.5 7.5 8.62188 7.5 10V30C7.5 31.3781 8.62187 32.5 10 32.5H30C31.3781 32.5 32.5 31.3781 32.5 30V10Z" }))))));
|
25
25
|
}
|
26
26
|
getSizeClass() {
|
27
27
|
return `${this.size}` === "s"
|
@@ -54,4 +54,4 @@ function defineCustomElement() {
|
|
54
54
|
|
55
55
|
export { Spinner as S, defineCustomElement as d };
|
56
56
|
|
57
|
-
//# sourceMappingURL=p-
|
57
|
+
//# sourceMappingURL=p-1bd23a52.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"p-
|
1
|
+
{"file":"p-1bd23a52.js","mappings":";;;;;AAAA,MAAM,UAAU,GAAG,mvBAAmvB,CAAC;AACvwB,yBAAe,UAAU;;MCUZ,OAAO;IALpB;;;;QASU,aAAQ,GAAY,KAAK,CAAC;KAqCnC;IAnCC,MAAM,gBAAgB;QACpB,IAAG,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;YACnC,MAAM,SAAS,GAAG,eAAe,EAAE,CAAC;YACpC,cAAc,CAAC,aAAa,EAAE,MAAM,SAAS,CAAC,CAAA;SAC/C;KACF;IAED,MAAM;QACJ,QACE,0EAAgB,sCAAsC,EAAC,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,IAChF,4DAAK,KAAK,EAAE,GAAG,IAAI,CAAC,OAAO,KAAK,OAAO,GAAG,QAAQ,GAAG,EAAE,IAAI,IAAI,CAAC,QAAQ,GAAG,UAAU,GAAG,EAAE,EAAE,GAAQ,EACnG,IAAI,CAAC,OAAO,KAAK,OAAO;eACpB,4DAAK,KAAK,EAAE,iBAAiB,IAAI,CAAC,QAAQ,GAAG,UAAU,GAAG,EAAE,IAAI,IAAI,CAAC,YAAY,EAAE,EAAE,IACtF,4DAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,4BAA4B,IAC5F,0DAAG,EAAE,EAAC,mBAAmB,IACvB,6DAAM,EAAE,EAAC,QAAQ,EAAC,CAAC,EAAC,svCAAsvC,GAAG,CAC3wC,CACA,CACF,CACJ,EACN;KACH;IAED,YAAY;QACV,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG;cACzB,GAAG;cACH,EAAE,CAAC;KACR;IAED,aAAa;QACX,OAAO,UAAU,CACf,SAAS,EACT,IAAI,CAAC,IAAI,IAAI,WAAW,IAAI,CAAC,YAAY,EAAE,EAAE,CAC9C,CAAC;KACH;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/spinner/spinner.scss?tag=ifx-spinner&encapsulation=shadow","src/components/spinner/spinner.tsx"],"sourcesContent":["@use \"~@infineon/design-system-tokens/dist/tokens\";\n\n:host {\n display: inline-block;\n\n}\n\n.spinner {\n position: relative;\n width: tokens.$ifxSize500;\n height: tokens.$ifxSize500;\n\n}\n\n.spinner.s {\n width: tokens.$ifxSize300;\n height: tokens.$ifxSize300;\n}\n\n.border {\n box-sizing: border-box;\n position: absolute;\n width: 100%;\n height: 100%;\n border: 4px solid transparent;\n border-top-color: tokens.$ifxColorOcean500;\n border-left-color: tokens.$ifxColorOcean500;\n border-right-color: tokens.$ifxColorOcean500;\n border-top-left-radius: 1px;\n border-top-right-radius: 1px;\n border-radius: 50%;\n animation: spin 2s linear infinite;\n\n &.inverted {\n border-top-color: tokens.$ifxColorBaseWhite;\n border-left-color: tokens.$ifxColorBaseWhite;\n border-right-color: tokens.$ifxColorBaseWhite;\n }\n}\n\n.semiconductor {\n width: 100%;\n height: 100%;\n animation: spin 2s linear infinite;\n\n & svg {\n fill: tokens.$ifxColorOcean500;\n }\n\n &.inverted {\n & svg {\n fill: tokens.$ifxColorBaseWhite;\n }\n }\n\n &.s {\n & svg {\n width: tokens.$ifxSize300;\n height: tokens.$ifxSize300;\n }\n }\n}\n\n\n@keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n}","import { Component, h, Prop, Element } from '@stencil/core';\nimport { trackComponent } from '../../global/utils/tracking';\nimport { isNestedInIfxComponent } from '../../global/utils/dom-utils';\nimport { detectFramework } from '../../global/utils/framework-detection';\nimport classNames from 'classnames';\n \n@Component({\n tag: 'ifx-spinner',\n styleUrl: 'spinner.scss',\n shadow: true,\n})\nexport class Spinner {\n @Element() el;\n @Prop() size: string;\n @Prop() variant: string;\n @Prop() inverted: boolean = false;\n\n async componentDidLoad() { \n if(!isNestedInIfxComponent(this.el)) { \n const framework = detectFramework();\n trackComponent('ifx-spinner', await framework)\n }\n }\n\n render() {\n return (\n <div aria-label=\"spinner indicating a loading process\" class={this.getClassNames()}>\n <div class={`${this.variant !== 'brand' ? 'border' : \"\"} ${this.inverted ? 'inverted' : \"\"}`}></div>\n {this.variant === 'brand'\n && <div class={`semiconductor ${this.inverted ? 'inverted' : \"\"} ${this.getSizeClass()}`}>\n <svg width='40' height='40' viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g id=\"spinner/conductor\">\n <path id=\"Vector\" d=\"M38.75 18.75C39.4375 18.75 40 19.3125 40 20C40 20.6875 39.4409 21.25 38.75 21.25H35V26.25H38.75C39.4375 26.25 40 26.8125 40 27.5C40 28.1875 39.4409 28.75 38.75 28.75H35V30C35 32.7617 32.7617 35 30 35H28.75V38.75C28.75 39.4409 28.1875 40 27.5 40C26.8125 40 26.25 39.4409 26.25 38.75V35H21.25V38.75C21.25 39.4409 20.6875 40 20 40C19.3125 40 18.75 39.4409 18.75 38.75V35H13.75V38.75C13.75 39.4409 13.1875 40 12.5 40C11.8125 40 11.25 39.4409 11.25 38.75V35H10C7.23828 35 5 32.7617 5 30V28.75H1.25C0.559062 28.75 0 28.1875 0 27.5C0 26.8125 0.559062 26.25 1.25 26.25H5V21.25H1.25C0.559062 21.25 0 20.6875 0 20C0 19.3125 0.559062 18.75 1.25 18.75H5V13.75H1.25C0.559062 13.75 0 13.1875 0 12.5C0 11.8125 0.559062 11.25 1.25 11.25H5V10C5 7.23828 7.23828 5 10 5H11.25V1.25C11.25 0.5625 11.8125 0 12.5 0C13.1875 0 13.75 0.559063 13.75 1.25V5H18.75V1.25C18.75 0.559063 19.3091 0 20 0C20.6909 0 21.25 0.559063 21.25 1.25V5H26.25V1.25C26.25 0.559063 26.8091 0 27.5 0C28.1909 0 28.75 0.559063 28.75 1.25V5H30C32.7617 5 35 7.23828 35 10V11.25H38.75C39.4409 11.25 40 11.8091 40 12.5C40 13.1909 39.4409 13.75 38.75 13.75H35V18.75H38.75ZM32.5 10C32.5 8.62188 31.3781 7.5 30 7.5H10C8.62187 7.5 7.5 8.62188 7.5 10V30C7.5 31.3781 8.62187 32.5 10 32.5H30C31.3781 32.5 32.5 31.3781 32.5 30V10Z\" />\n </g>\n </svg>\n </div>}\n </div>\n );\n }\n\n getSizeClass() {\n return `${this.size}` === \"s\"\n ? \"s\"\n : \"\";\n }\n\n getClassNames() {\n return classNames(\n 'spinner',\n this.size && `spinner ${this.getSizeClass()}`\n );\n }\n}\n"],"version":3}
|