@scania/tegel 1.15.0-table-issue-beta.0 → 1.16.0-tdsheaderitems-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index-ca8040ad.js +4 -8
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/tds-body-cell.cjs.entry.js +2 -3
- package/dist/cjs/{tds-dropdown.cjs.entry.js → tds-dropdown_2.cjs.entry.js} +93 -4
- package/dist/cjs/tds-folder-tab.cjs.entry.js +2 -2
- package/dist/cjs/tds-folder-tabs.cjs.entry.js +2 -2
- package/dist/cjs/tds-header-cell.cjs.entry.js +1 -1
- package/dist/cjs/tds-header.cjs.entry.js +10 -1
- package/dist/cjs/tds-inline-tab.cjs.entry.js +2 -2
- package/dist/cjs/tds-inline-tabs.cjs.entry.js +2 -2
- package/dist/cjs/tds-navigation-tab.cjs.entry.js +2 -2
- package/dist/cjs/tds-navigation-tabs.cjs.entry.js +2 -2
- package/dist/cjs/tds-table-body-row-expandable.cjs.entry.js +10 -7
- package/dist/cjs/tds-table-body.cjs.entry.js +14 -7
- package/dist/cjs/tds-table-footer.cjs.entry.js +41 -16
- package/dist/cjs/tds-table-header-input-wrapper.cjs.entry.js +1 -1
- package/dist/cjs/tds-table-header.cjs.entry.js +2 -2
- package/dist/cjs/tds-table-toolbar.cjs.entry.js +2 -2
- package/dist/cjs/tds-table.cjs.entry.js +8 -3
- package/dist/cjs/tds-text-field.cjs.entry.js +5 -5
- package/dist/cjs/tds-textarea.cjs.entry.js +3 -3
- package/dist/cjs/tds-toast.cjs.entry.js +3 -3
- package/dist/cjs/tds-toggle.cjs.entry.js +1 -1
- package/dist/cjs/tds-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/tegel.cjs.js +1 -1
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.css +6 -0
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +1 -1
- package/dist/collection/components/dropdown/dropdown.css +13 -0
- package/dist/collection/components/dropdown/dropdown.js +5 -5
- package/dist/collection/components/header/header.js +10 -1
- package/dist/collection/components/table/table/table.js +28 -3
- package/dist/collection/components/table/table-body/table-body.css +28 -0
- package/dist/collection/components/table/table-body/table-body.js +14 -6
- package/dist/collection/components/table/table-body-cell/table-body-cell.js +2 -4
- package/dist/collection/components/table/table-body-row-expandable/table-body-row-expandable.css +1 -1
- package/dist/collection/components/table/table-body-row-expandable/table-body-row-expandable.js +29 -8
- package/dist/collection/components/table/table-footer/table-footer.css +10 -0
- package/dist/collection/components/table/table-footer/table-footer.js +78 -18
- package/dist/collection/components/table/table-header/table-header.js +2 -2
- package/dist/collection/components/table/table-header-cell/table-header-cell.js +1 -1
- package/dist/collection/components/table/table-header-input-wrapper/table-header-input-wrapper.js +1 -1
- package/dist/collection/components/table/table-toolbar/table-toolbar.js +2 -2
- package/dist/collection/components/tabs/folder-tabs/folder-tab/folder-tab.js +2 -2
- package/dist/collection/components/tabs/folder-tabs/folder-tabs.js +2 -2
- package/dist/collection/components/tabs/inline-tabs/inline-tab/inline-tab.js +2 -2
- package/dist/collection/components/tabs/inline-tabs/inline-tabs.js +2 -2
- package/dist/collection/components/tabs/navigation-tabs/navigation-tab/navigation-tab.js +2 -2
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.js +2 -2
- package/dist/collection/components/text-field/text-field.js +5 -5
- package/dist/collection/components/textarea/textarea.js +3 -3
- package/dist/collection/components/toast/toast.js +3 -3
- package/dist/collection/components/toggle/toggle.js +1 -1
- package/dist/collection/components/tooltip/tooltip.js +2 -2
- package/dist/{esm/tds-dropdown-option.entry.js → components/p-1c256b8d.js} +45 -10
- package/dist/{esm/tds-dropdown.entry.js → components/p-e7eab204.js} +61 -12
- package/dist/components/tds-body-cell.js +2 -4
- package/dist/components/tds-dropdown-option.js +1 -124
- package/dist/components/tds-dropdown.js +1 -509
- package/dist/components/tds-folder-tab.js +2 -2
- package/dist/components/tds-folder-tabs.js +2 -2
- package/dist/components/tds-header-cell.js +1 -1
- package/dist/components/tds-header.js +10 -1
- package/dist/components/tds-inline-tab.js +2 -2
- package/dist/components/tds-inline-tabs.js +2 -2
- package/dist/components/tds-navigation-tab.js +2 -2
- package/dist/components/tds-navigation-tabs.js +2 -2
- package/dist/components/tds-table-body-row-expandable.js +11 -7
- package/dist/components/tds-table-body.js +15 -7
- package/dist/components/tds-table-footer.js +64 -18
- package/dist/components/tds-table-header-input-wrapper.js +1 -1
- package/dist/components/tds-table-header.js +2 -2
- package/dist/components/tds-table-toolbar.js +2 -2
- package/dist/components/tds-table.js +10 -3
- package/dist/components/tds-text-field.js +5 -5
- package/dist/components/tds-textarea.js +3 -3
- package/dist/components/tds-toast.js +3 -3
- package/dist/components/tds-toggle.js +1 -1
- package/dist/components/tds-tooltip.js +2 -2
- package/dist/esm/index-51d04e39.js +4 -8
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tds-body-cell.entry.js +2 -3
- package/dist/esm/tds-dropdown_2.entry.js +550 -0
- package/dist/esm/tds-folder-tab.entry.js +2 -2
- package/dist/esm/tds-folder-tabs.entry.js +2 -2
- package/dist/esm/tds-header-cell.entry.js +1 -1
- package/dist/esm/tds-header.entry.js +10 -1
- package/dist/esm/tds-inline-tab.entry.js +2 -2
- package/dist/esm/tds-inline-tabs.entry.js +2 -2
- package/dist/esm/tds-navigation-tab.entry.js +2 -2
- package/dist/esm/tds-navigation-tabs.entry.js +2 -2
- package/dist/esm/tds-table-body-row-expandable.entry.js +10 -7
- package/dist/esm/tds-table-body.entry.js +14 -7
- package/dist/esm/tds-table-footer.entry.js +41 -16
- package/dist/esm/tds-table-header-input-wrapper.entry.js +1 -1
- package/dist/esm/tds-table-header.entry.js +2 -2
- package/dist/esm/tds-table-toolbar.entry.js +2 -2
- package/dist/esm/tds-table.entry.js +8 -3
- package/dist/esm/tds-text-field.entry.js +5 -5
- package/dist/esm/tds-textarea.entry.js +3 -3
- package/dist/esm/tds-toast.entry.js +3 -3
- package/dist/esm/tds-toggle.entry.js +1 -1
- package/dist/esm/tds-tooltip.entry.js +2 -2
- package/dist/esm/tegel.js +1 -1
- package/dist/tegel/{p-480c6c28.entry.js → p-088bfcd4.entry.js} +1 -1
- package/dist/tegel/{p-a97dd06a.entry.js → p-1634247e.entry.js} +1 -1
- package/dist/tegel/{p-5c0bb8e1.entry.js → p-19571a64.entry.js} +1 -1
- package/dist/tegel/p-24f63399.entry.js +1 -0
- package/dist/tegel/p-51e49417.entry.js +1 -0
- package/dist/tegel/{p-b34cf70d.entry.js → p-52be41ce.entry.js} +1 -1
- package/dist/tegel/{p-e237cdcc.entry.js → p-73dd2dbb.entry.js} +1 -1
- package/dist/tegel/p-7a83cf55.entry.js +1 -0
- package/dist/tegel/{p-c12eaac3.entry.js → p-831111e9.entry.js} +1 -1
- package/dist/tegel/{p-08642415.entry.js → p-91dcddd5.entry.js} +1 -1
- package/dist/tegel/{p-f823777e.entry.js → p-987084a5.entry.js} +1 -1
- package/dist/tegel/{p-c1f8f523.entry.js → p-a642c800.entry.js} +1 -1
- package/dist/tegel/p-aed1c5cf.entry.js +1 -0
- package/dist/tegel/{p-7c75d8d3.entry.js → p-b00bcf39.entry.js} +1 -1
- package/dist/tegel/{p-6b04a919.entry.js → p-bb129d43.entry.js} +1 -1
- package/dist/tegel/{p-578f6d73.entry.js → p-c790ef93.entry.js} +1 -1
- package/dist/tegel/p-d3541e17.entry.js +1 -0
- package/dist/tegel/{p-98f5b520.entry.js → p-e4343e51.entry.js} +1 -1
- package/dist/tegel/{p-1ba22b41.entry.js → p-e86f2d31.entry.js} +1 -1
- package/dist/tegel/p-f4b640af.entry.js +1 -0
- package/dist/tegel/{p-0a4fe3db.entry.js → p-ff5cd75f.entry.js} +1 -1
- package/dist/tegel/{p-f3f1f357.entry.js → p-ff7ae8a3.entry.js} +1 -1
- package/dist/tegel/tegel.css +2 -2
- package/dist/tegel/tegel.esm.js +1 -1
- package/dist/types/components/dropdown/dropdown-option/dropdown-option.d.ts +1 -1
- package/dist/types/components/dropdown/dropdown.d.ts +1 -1
- package/dist/types/components/header/header.d.ts +2 -0
- package/dist/types/components/table/table/table.d.ts +4 -0
- package/dist/types/components/table/table-body/table-body.d.ts +1 -0
- package/dist/types/components/table/table-body-cell/table-body-cell.d.ts +0 -1
- package/dist/types/components/table/table-body-row-expandable/table-body-row-expandable.d.ts +5 -4
- package/dist/types/components/table/table-footer/table-footer.d.ts +10 -0
- package/dist/types/components.d.ts +46 -4
- package/package.json +1 -1
- package/dist/cjs/tds-dropdown-option.cjs.entry.js +0 -95
- package/dist/tegel/p-36e88ce8.entry.js +0 -1
- package/dist/tegel/p-3e859e33.entry.js +0 -1
- package/dist/tegel/p-7cb43ebe.entry.js +0 -1
- package/dist/tegel/p-957c8b27.entry.js +0 -1
- package/dist/tegel/p-c7b2773d.entry.js +0 -1
- package/dist/tegel/p-e1842d99.entry.js +0 -1
- package/dist/tegel/p-e7fac8ad.entry.js +0 -1
|
@@ -1,512 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as defineCustomElement$2 } from './p-3e74be57.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Find the next focusable element index in a list of focusable elements.
|
|
6
|
-
* @param items List of focusable elements, element with a attribute of disabled that is true will be skipped over.
|
|
7
|
-
* @param nextItemIndex The index in the list to start the search on.
|
|
8
|
-
*/
|
|
9
|
-
const findNextFocusableElement = (items, nextItemIndex) => {
|
|
10
|
-
if (items[nextItemIndex] === undefined) {
|
|
11
|
-
return 0;
|
|
12
|
-
}
|
|
13
|
-
for (let index = nextItemIndex; index < items.length; index++) {
|
|
14
|
-
if (!items[index].disabled) {
|
|
15
|
-
return index;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Find the previous focusable element index in a list of focusable elements.
|
|
22
|
-
*
|
|
23
|
-
* @param items List of focusable elements, element with a attribute of disabled that is true will be skipped over.
|
|
24
|
-
* @param nextItemIndex The index in the list to start the search on.
|
|
25
|
-
*/
|
|
26
|
-
const findPreviousFocusableElement = (items, previousItemIndex) => {
|
|
27
|
-
if (items[previousItemIndex] === undefined) {
|
|
28
|
-
return items.length - 1;
|
|
29
|
-
}
|
|
30
|
-
for (let index = previousItemIndex; index >= 0; index--) {
|
|
31
|
-
if (!items[index].disabled) {
|
|
32
|
-
return index;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
/** reference: https://github.com/ionic-team/ionic-framework/blob/main/core/src/utils/helpers.ts#L346
|
|
38
|
-
*
|
|
39
|
-
* Appends a hidden input element to allow the component
|
|
40
|
-
* work within and get picked up by a <form>.
|
|
41
|
-
* @param element The element on which the input with be appended.
|
|
42
|
-
* @param name Name of the input.
|
|
43
|
-
* @param value The value of the input.
|
|
44
|
-
* @param disabled Disables the input if true.
|
|
45
|
-
* @param additionalAttributes Additional attributes that should be passed to the input.
|
|
46
|
-
*/
|
|
47
|
-
const appendHiddenInput = (element, name, value, disabled, additionalAttributes) => {
|
|
48
|
-
let input = element.querySelector('input');
|
|
49
|
-
if (!element.querySelector('input')) {
|
|
50
|
-
input = element.ownerDocument.createElement('input');
|
|
51
|
-
input.type = 'hidden';
|
|
52
|
-
if (additionalAttributes) {
|
|
53
|
-
additionalAttributes.forEach((attr) => input.setAttribute(attr.key, attr.value));
|
|
54
|
-
}
|
|
55
|
-
element.appendChild(input);
|
|
56
|
-
}
|
|
57
|
-
input.disabled = disabled;
|
|
58
|
-
input.name = name;
|
|
59
|
-
input.value = value || '';
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const dropdownCss = "@charset \"UTF-8\";:host button{all:unset;height:100%;width:100%;background-color:var(--tds-dropdown-bg);border-bottom:1px solid var(--tds-dropdown-border-bottom);border-radius:4px 4px 0 0}:host button:hover{border-bottom:1px solid var(--tds-dropdown-border-bottom-hover)}:host button .value-wrapper{padding:0 16px;display:flex;align-items:center;justify-content:space-between}:host button.placeholder{color:var(--tds-dropdown-placeholder-color);line-height:1.3}:host button.value{color:var(--tds-dropdown-value-color);font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);line-height:1.3}:host button:focus{border-bottom-color:var(--tds-dropdown-border-bottom-open)}:host button:focus::before{content:\"\";position:absolute;bottom:0;left:0;width:100%;height:1px;background:var(--tds-dropdown-border-bottom-open)}:host button.error{border-bottom:1px solid var(--tds-negative)}:host button.error:focus{border-bottom-color:transparent}:host button.error:focus::before{content:\"\";position:absolute;bottom:0;left:0;width:100%;height:2px;background:var(--tds-negative)}:host button:disabled{color:var(--tds-dropdown-disabled-color);border-bottom:1px solid transparent}:host button .menu-icon{margin-right:0}:host .filter{display:flex;align-items:center;justify-content:space-between;height:100%;background-color:var(--tds-dropdown-bg);border-bottom:1px solid var(--tds-dropdown-border-bottom);padding-left:16px;border-radius:4px 4px 0 0}:host .filter:hover{border-bottom:1px solid var(--tds-dropdown-border-bottom-hover)}:host .filter.disabled{color:var(--tds-dropdown-disabled-color);border-bottom:1px solid transparent}:host .filter .value-wrapper{display:flex;width:100%;height:100%}:host .filter .label-inside-as-placeholder{position:absolute;font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);line-height:1.3;color:var(--tds-dropdown-placeholder-color)}:host .filter .label-inside-as-placeholder.lg{top:20px}:host .filter .label-inside-as-placeholder.md{top:16px}:host .filter .label-inside-as-placeholder.sm{display:none}:host .filter .label-inside-as-placeholder.selected{font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls);transition:all 0.2s ease-in-out}:host .filter .label-inside-as-placeholder.selected.lg{top:12px}:host .filter .label-inside-as-placeholder.selected.md{top:8px}:host .filter .label-inside-as-placeholder.selected.sm{display:none}:host .filter .label-inside-as-placeholder.selected+.placeholder:not(.sm){margin-top:8px}:host .filter.focus{border-bottom-color:transparent}:host .filter.focus::before{content:\"\";position:absolute;bottom:0;left:0;width:100%;height:2px;background:var(--tds-dropdown-border-bottom-open)}:host .filter.error{border-bottom:1px solid var(--tds-negative)}:host .filter.error.focus{border-bottom-color:transparent}:host .filter.error.focus::before{content:\"\";position:absolute;bottom:0;left:0;width:100%;height:2px;background:var(--tds-negative)}:host .filter input{flex:1;all:unset;width:100%}:host .filter input::placeholder{color:var(--tds-dropdown-placeholder-color)}:host .filter input:disabled::placeholder{color:var(--tds-dropdown-disabled-color)}:host .filter tds-icon{cursor:pointer}:host .filter .menu-icon{margin-right:16px}:host .filter .clear-icon{margin:0 8px;color:var(--tds-dropdown-clear-icon-color);padding-right:8px;border-right:1px solid var(--tds-dropdown-clear-icon-color)}:host .filter .clear-icon:hover{color:var(--tds-dropdown-clear-icon-hover-color)}:host .filter .clear-icon.hide{display:none;visibility:hidden}:host{--tds-scrollbar-width-standard:thin;--tds-scrollbar-width:10px;--tds-scrollbar-height:10px;--tds-scrollbar-thumb-border-width:3px;--tds-scrollbar-thumb-border-hover-width:2px}body{scrollbar-width:thin}:host{display:block;position:relative;font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls)}:host .label-outside{font:var(--tds-detail-05);letter-spacing:var(--tds-detail-05-ls);color:var(--tds-dropdown-label-color);margin-bottom:8px}:host .label-outside.disabled{color:var(--tds-dropdown-disabled-color)}:host .dropdown-select{position:relative}:host .dropdown-select.disabled .label-inside,:host .dropdown-select.disabled .placeholder,:host .dropdown-select.disabled .label-inside-as-placeholder,:host .dropdown-select.disabled .value-wrapper{color:var(--tds-dropdown-disabled-color)}:host .dropdown-select .label-inside{position:absolute;font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls);color:var(--tds-dropdown-label-inside-color)}:host .dropdown-select .label-inside.lg{top:12px;left:16px}:host .dropdown-select .label-inside.md{top:8px;left:16px}:host .dropdown-select .label-inside.sm{display:none}:host .dropdown-select .label-inside+.placeholder:not(.sm){margin-top:8px}:host .dropdown-select .placeholder{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .dropdown-select .label-inside-as-placeholder{color:var(--tds-dropdown-placeholder-color)}:host .dropdown-select .label-inside-as-placeholder.selected{position:absolute;font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls);transition:all 0.2s ease-in-out}:host .dropdown-select .label-inside-as-placeholder.selected.lg{top:12px}:host .dropdown-select .label-inside-as-placeholder.selected.md{top:8px}:host .dropdown-select .label-inside-as-placeholder.selected.sm{display:none}:host .dropdown-select .label-inside-as-placeholder.selected+.placeholder:not(.sm){margin-top:8px}:host .dropdown-select.lg{height:55px}:host .dropdown-select.md{height:47px}:host .dropdown-select.sm{height:39px}:host .helper{margin-top:4px;color:var(--tds-dropdown-helper-color);font:var(--tds-detail-05);letter-spacing:var(--tds-detail-05-ls);display:flex;align-items:center;gap:8px}:host .helper.error{color:var(--tds-negative)}:host .helper.disabled{color:var(--tds-dropdown-disabled-color)}:host .dropdown-list{z-index:100;position:absolute;margin-top:1px;width:100%;transform-origin:top;transition:transform 0.2s ease-in-out;box-shadow:rgba(0, 0, 0, 0.1) 0 2px 3px 0;border-radius:0 0 4px 4px;overflow-y:auto}:host .dropdown-list:hover::-webkit-scrollbar-thumb{border:var(--tds-scrollbar-thumb-border-hover-width) solid transparent;background:var(--tds-scrollbar-hover-thumb-color);background-clip:padding-box}:host .dropdown-list::-webkit-scrollbar{width:var(--tds-scrollbar-width)}:host .dropdown-list::-webkit-scrollbar-track{background:var(--tds-scrollbar-track-color)}:host .dropdown-list::-webkit-scrollbar-thumb{border-radius:40px;background:var(--tds-scrollbar-thumb-color);border:var(--tds-scrollbar-thumb-border-width) solid transparent;background-clip:padding-box}:host .dropdown-list::-webkit-scrollbar-button{height:0;width:0}@supports not selector(::-webkit-scrollbar){:host .dropdown-list{scrollbar-color:var(--tds-scrollbar-thumb-color) var(--tds-scrollbar-track-color);scrollbar-width:var(--tds-scrollbar-width-standard)}}:host .dropdown-list.lg{max-height:312px}:host .dropdown-list.md{max-height:312px}:host .dropdown-list.sm{max-height:260px}:host .dropdown-list.up{bottom:100%;margin-top:0;margin-bottom:1px;transform-origin:bottom;display:flex;flex-direction:column-reverse;box-shadow:rgba(0, 0, 0, 0.1) 0 -1px 3px 0;border-radius:4px 4px 0 0}:host .dropdown-list.up.label-outside{bottom:calc(100% - 24px)}:host .dropdown-list.closed{transform:scaleY(0);visibility:hidden}:host .dropdown-list.open{transform:scaleY(1)}:host .dropdown-list .no-result{font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);display:flex;align-items:center;padding:0 16px;background-color:var(--tds-dropdown-bg)}:host .dropdown-list .no-result.lg{height:56px}:host .dropdown-list .no-result.md{height:48px}:host .dropdown-list .no-result.sm{height:40px}:host .menu-icon{color:var(--tds-dropdown-menu-icon-color)}:host tds-icon{transition:transform 0.2s ease-in-out}:host tds-icon.open{transform:rotateZ(180deg)}";
|
|
63
|
-
const TdsDropdownStyle0 = dropdownCss;
|
|
64
|
-
|
|
65
|
-
const TdsDropdown$1 = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H {
|
|
66
|
-
constructor() {
|
|
67
|
-
super();
|
|
68
|
-
this.__registerHost();
|
|
69
|
-
this.__attachShadow();
|
|
70
|
-
this.tdsChange = createEvent(this, "tdsChange", 6);
|
|
71
|
-
this.tdsFocus = createEvent(this, "tdsFocus", 6);
|
|
72
|
-
this.tdsBlur = createEvent(this, "tdsBlur", 6);
|
|
73
|
-
this.tdsInput = createEvent(this, "tdsInput", 6);
|
|
74
|
-
this.setDefaultOption = () => {
|
|
75
|
-
if (this.defaultValue) {
|
|
76
|
-
const children = Array.from(this.host.children).filter((element) => element.tagName === 'TDS-DROPDOWN-OPTION');
|
|
77
|
-
if (children.length === 0) {
|
|
78
|
-
console.warn('TDS DROPDOWN: No options found. Disregard if loading data asynchronously.');
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
const defaultValues = this.multiselect
|
|
82
|
-
? new Set(this.defaultValue.split(','))
|
|
83
|
-
: [this.defaultValue];
|
|
84
|
-
const childrenMap = new Map(children.map((element) => [element.value, element]));
|
|
85
|
-
const matchedValues = Array.from(defaultValues).filter((value) => {
|
|
86
|
-
const element = childrenMap.get(value);
|
|
87
|
-
if (element) {
|
|
88
|
-
element.setSelected(true);
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
return false;
|
|
92
|
-
});
|
|
93
|
-
if (matchedValues.length > 0) {
|
|
94
|
-
this.value = [...new Set(this.value ? [...this.value, ...matchedValues] : matchedValues)];
|
|
95
|
-
this.setValueAttribute();
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
console.warn(`TDS DROPDOWN: No matching option found for defaultValue "${this.defaultValue}"`);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
/* Returns a list of all children that are tds-dropdown-option elements */
|
|
103
|
-
this.getChildren = () => {
|
|
104
|
-
const tdsDropdownOptions = Array.from(this.host.children).filter((element) => element.tagName === 'TDS-DROPDOWN-OPTION');
|
|
105
|
-
if (tdsDropdownOptions.length === 0) {
|
|
106
|
-
console.warn('TDS DROPDOWN: Data missing. Disregard if loading data asynchronously.');
|
|
107
|
-
}
|
|
108
|
-
else
|
|
109
|
-
return tdsDropdownOptions;
|
|
110
|
-
};
|
|
111
|
-
this.getOpenDirection = () => {
|
|
112
|
-
var _a, _b, _c, _d, _e;
|
|
113
|
-
if (this.openDirection === 'auto' || !this.openDirection) {
|
|
114
|
-
const dropdownMenuHeight = (_b = (_a = this.dropdownList) === null || _a === void 0 ? void 0 : _a.offsetHeight) !== null && _b !== void 0 ? _b : 0;
|
|
115
|
-
const distanceToBottom = (_e = (_d = (_c = this.host).getBoundingClientRect) === null || _d === void 0 ? void 0 : _d.call(_c).top) !== null && _e !== void 0 ? _e : 0;
|
|
116
|
-
const viewportHeight = window.innerHeight;
|
|
117
|
-
if (distanceToBottom + dropdownMenuHeight + 57 > viewportHeight) {
|
|
118
|
-
return 'up';
|
|
119
|
-
}
|
|
120
|
-
return 'down';
|
|
121
|
-
}
|
|
122
|
-
return this.openDirection;
|
|
123
|
-
};
|
|
124
|
-
/* Toggles the open state of the Dropdown and sets focus to the input element */
|
|
125
|
-
this.handleToggleOpen = () => {
|
|
126
|
-
if (!this.disabled) {
|
|
127
|
-
this.open = !this.open;
|
|
128
|
-
if (this.open) {
|
|
129
|
-
this.focusInputElement();
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
/* Focuses the input element in the Dropdown, if the reference is present. */
|
|
134
|
-
this.focusInputElement = () => {
|
|
135
|
-
if (this.inputElement)
|
|
136
|
-
this.inputElement.focus();
|
|
137
|
-
};
|
|
138
|
-
this.getSelectedChildren = () => {
|
|
139
|
-
var _a;
|
|
140
|
-
return (_a = this.value) === null || _a === void 0 ? void 0 : _a.map((stringValue) => {
|
|
141
|
-
const matchingElement = this.getChildren().find((element) => element.value === stringValue);
|
|
142
|
-
return matchingElement;
|
|
143
|
-
}).filter(Boolean);
|
|
144
|
-
};
|
|
145
|
-
this.getSelectedChildrenLabels = () => {
|
|
146
|
-
var _a;
|
|
147
|
-
return (_a = this.getSelectedChildren()) === null || _a === void 0 ? void 0 : _a.map((element) => element.textContent.trim());
|
|
148
|
-
};
|
|
149
|
-
this.getValue = () => {
|
|
150
|
-
const labels = this.getSelectedChildrenLabels();
|
|
151
|
-
if (!labels) {
|
|
152
|
-
return '';
|
|
153
|
-
}
|
|
154
|
-
return this.filter ? labels === null || labels === void 0 ? void 0 : labels.join(', ') : labels === null || labels === void 0 ? void 0 : labels.toString();
|
|
155
|
-
};
|
|
156
|
-
this.setValueAttribute = () => {
|
|
157
|
-
var _a, _b, _c;
|
|
158
|
-
if (((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString()) === '')
|
|
159
|
-
this.value = null;
|
|
160
|
-
this.host.setAttribute('value', (_c = (_b = this.value) === null || _b === void 0 ? void 0 : _b.map((val) => val).toString()) !== null && _c !== void 0 ? _c : null);
|
|
161
|
-
};
|
|
162
|
-
this.handleFilter = (event) => {
|
|
163
|
-
this.tdsInput.emit(event);
|
|
164
|
-
const query = event.target.value.toLowerCase();
|
|
165
|
-
/* Check if the query is empty, and if so, show all options */
|
|
166
|
-
const children = this.getChildren();
|
|
167
|
-
if (query === '') {
|
|
168
|
-
children.forEach((element) => {
|
|
169
|
-
element.removeAttribute('hidden');
|
|
170
|
-
return element;
|
|
171
|
-
});
|
|
172
|
-
this.filterResult = null;
|
|
173
|
-
/* Hide the options that do not match the query */
|
|
174
|
-
}
|
|
175
|
-
else {
|
|
176
|
-
this.filterResult = children.filter((element) => {
|
|
177
|
-
if (!this.normalizeString(element.textContent)
|
|
178
|
-
.toLowerCase()
|
|
179
|
-
.includes(this.normalizeString(query).toLowerCase())) {
|
|
180
|
-
element.setAttribute('hidden', '');
|
|
181
|
-
}
|
|
182
|
-
else {
|
|
183
|
-
element.removeAttribute('hidden');
|
|
184
|
-
}
|
|
185
|
-
return !element.hasAttribute('hidden');
|
|
186
|
-
}).length;
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
this.handleFilterReset = () => {
|
|
190
|
-
this.reset();
|
|
191
|
-
this.inputElement.value = '';
|
|
192
|
-
this.handleFilter({ target: { value: this.inputElement.value } });
|
|
193
|
-
this.inputElement.focus();
|
|
194
|
-
};
|
|
195
|
-
this.handleFocus = (event) => {
|
|
196
|
-
this.tdsFocus.emit(event);
|
|
197
|
-
};
|
|
198
|
-
this.handleBlur = (event) => {
|
|
199
|
-
this.tdsBlur.emit(event);
|
|
200
|
-
};
|
|
201
|
-
this.handleChange = () => {
|
|
202
|
-
var _a, _b;
|
|
203
|
-
this.tdsChange.emit({
|
|
204
|
-
name: this.name,
|
|
205
|
-
value: (_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.map((value) => value).toString()) !== null && _b !== void 0 ? _b : null,
|
|
206
|
-
});
|
|
207
|
-
};
|
|
208
|
-
this.name = undefined;
|
|
209
|
-
this.disabled = false;
|
|
210
|
-
this.helper = undefined;
|
|
211
|
-
this.label = undefined;
|
|
212
|
-
this.labelPosition = undefined;
|
|
213
|
-
this.modeVariant = null;
|
|
214
|
-
this.openDirection = 'auto';
|
|
215
|
-
this.placeholder = undefined;
|
|
216
|
-
this.size = 'lg';
|
|
217
|
-
this.error = false;
|
|
218
|
-
this.multiselect = false;
|
|
219
|
-
this.filter = false;
|
|
220
|
-
this.normalizeText = true;
|
|
221
|
-
this.noResultText = 'No result';
|
|
222
|
-
this.defaultValue = undefined;
|
|
223
|
-
this.open = false;
|
|
224
|
-
this.value = undefined;
|
|
225
|
-
this.filterResult = undefined;
|
|
226
|
-
this.filterFocus = undefined;
|
|
227
|
-
}
|
|
228
|
-
/** Method that resets the Dropdown, marks all children as non-selected and resets the value to null. */
|
|
229
|
-
async reset() {
|
|
230
|
-
this.dropdownList.scrollTop = 0;
|
|
231
|
-
this.internalReset();
|
|
232
|
-
this.handleChange();
|
|
233
|
-
}
|
|
234
|
-
/** Method for setting the value of the Dropdown.
|
|
235
|
-
*
|
|
236
|
-
* Single selection example:
|
|
237
|
-
*
|
|
238
|
-
* <code>
|
|
239
|
-
* dropdown.setValue('option-1', 'Option 1');
|
|
240
|
-
* </code>
|
|
241
|
-
*
|
|
242
|
-
* Multiselect example:
|
|
243
|
-
*
|
|
244
|
-
* <code>
|
|
245
|
-
* dropdown.setValue(['option-1', 'option-2']);
|
|
246
|
-
* </code>
|
|
247
|
-
*/
|
|
248
|
-
// The label is optional here ONLY to not break the API. Should be removed for 2.0.
|
|
249
|
-
// @ts-ignore
|
|
250
|
-
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
|
251
|
-
async setValue(value, label) {
|
|
252
|
-
let nextValue;
|
|
253
|
-
if (typeof value === 'string')
|
|
254
|
-
nextValue = [value];
|
|
255
|
-
else
|
|
256
|
-
nextValue = value;
|
|
257
|
-
if (!this.multiselect && nextValue.length > 1) {
|
|
258
|
-
console.warn('Tried to select multiple items, but multiselect is not enabled.');
|
|
259
|
-
nextValue = [nextValue[0]];
|
|
260
|
-
}
|
|
261
|
-
nextValue = [...new Set(nextValue)];
|
|
262
|
-
this.internalReset();
|
|
263
|
-
for (let i = 0; i < nextValue.length; i++) {
|
|
264
|
-
const optionExist = this.getChildren().some((element) => element.value === nextValue[i]);
|
|
265
|
-
if (!optionExist) {
|
|
266
|
-
nextValue.splice(i, 1);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
this.value = nextValue;
|
|
270
|
-
this.setValueAttribute();
|
|
271
|
-
this.selectChildrenAsSelectedBasedOnSelectionProp();
|
|
272
|
-
this.handleChange();
|
|
273
|
-
/* This returns an array of object with a value and label pair. This is ONLY to not break the API. Should be removed for 2.0. */
|
|
274
|
-
/* https://tegel.atlassian.net/browse/CDEP-2703 */
|
|
275
|
-
const selection = this.getSelectedChildren().map((element) => ({
|
|
276
|
-
value: element.value,
|
|
277
|
-
label: element.textContent.trim(),
|
|
278
|
-
}));
|
|
279
|
-
// Update inputElement value and placeholder text
|
|
280
|
-
if (this.filter) {
|
|
281
|
-
this.inputElement.value = this.getValue();
|
|
282
|
-
}
|
|
283
|
-
return selection;
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* @internal
|
|
287
|
-
*/
|
|
288
|
-
async appendValue(value) {
|
|
289
|
-
if (this.multiselect && this.value) {
|
|
290
|
-
this.setValue([...this.value, value]);
|
|
291
|
-
}
|
|
292
|
-
else {
|
|
293
|
-
this.setValue(value);
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
/** Method for removing a selected value in the Dropdown. */
|
|
297
|
-
async removeValue(oldValue) {
|
|
298
|
-
var _a, _b;
|
|
299
|
-
let label;
|
|
300
|
-
if (this.multiselect) {
|
|
301
|
-
(_a = this.getChildren()) === null || _a === void 0 ? void 0 : _a.forEach((element) => {
|
|
302
|
-
var _a;
|
|
303
|
-
if (element.value === oldValue) {
|
|
304
|
-
this.value = (_a = this.value) === null || _a === void 0 ? void 0 : _a.filter((value) => value !== element.value);
|
|
305
|
-
label = element.textContent.trim();
|
|
306
|
-
element.setSelected(false);
|
|
307
|
-
}
|
|
308
|
-
return element;
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
else {
|
|
312
|
-
this.reset();
|
|
313
|
-
}
|
|
314
|
-
this.handleChange();
|
|
315
|
-
this.setValueAttribute();
|
|
316
|
-
/* This returns an array of object with a value and label pair. This is ONLY to not break the API. Should be removed for 2.0. */
|
|
317
|
-
/* https://tegel.atlassian.net/browse/CDEP-2703 */
|
|
318
|
-
return (_b = this.value) === null || _b === void 0 ? void 0 : _b.map((value) => ({ value, label }));
|
|
319
|
-
}
|
|
320
|
-
/** Method for closing the Dropdown. */
|
|
321
|
-
async close() {
|
|
322
|
-
this.open = false;
|
|
323
|
-
}
|
|
324
|
-
onAnyClick(event) {
|
|
325
|
-
if (this.open) {
|
|
326
|
-
// Source: https://lamplightdev.com/blog/2021/04/10/how-to-detect-clicks-outside-of-a-web-component/
|
|
327
|
-
const isClickOutside = !event.composedPath().includes(this.host);
|
|
328
|
-
if (isClickOutside) {
|
|
329
|
-
this.open = false;
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
async onKeyDown(event) {
|
|
334
|
-
// Get the active element
|
|
335
|
-
const { activeElement } = document;
|
|
336
|
-
if (!activeElement) {
|
|
337
|
-
return;
|
|
338
|
-
}
|
|
339
|
-
const children = this.getChildren();
|
|
340
|
-
if (event.key === 'ArrowDown') {
|
|
341
|
-
/* Get the index of the current focus index, if there is no
|
|
342
|
-
nextElementSibling return the index for the first child in our Dropdown. */
|
|
343
|
-
const startingIndex = activeElement.nextElementSibling
|
|
344
|
-
? children.findIndex((element) => element === activeElement.nextElementSibling)
|
|
345
|
-
: 0;
|
|
346
|
-
const elementIndex = findNextFocusableElement(children, startingIndex);
|
|
347
|
-
children[elementIndex].focus();
|
|
348
|
-
}
|
|
349
|
-
else if (event.key === 'ArrowUp') {
|
|
350
|
-
/* Get the index of the current focus index, if there is no
|
|
351
|
-
previousElementSibling return the index for the first last in our Dropdown. */
|
|
352
|
-
const startingIndex = activeElement.nextElementSibling
|
|
353
|
-
? this.getChildren().findIndex((element) => element === activeElement.previousElementSibling)
|
|
354
|
-
: 0;
|
|
355
|
-
const elementIndex = findPreviousFocusableElement(children, startingIndex);
|
|
356
|
-
children[elementIndex].focus();
|
|
357
|
-
}
|
|
358
|
-
else if (event.key === 'Escape') {
|
|
359
|
-
this.open = false;
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
// If the Dropdown gets closed,
|
|
363
|
-
// this sets the value of the dropdown to the current selection labels or null if no selection is made.
|
|
364
|
-
handleOpenState() {
|
|
365
|
-
if (this.filter && this.multiselect) {
|
|
366
|
-
if (!this.open) {
|
|
367
|
-
this.inputElement.value = this.getValue();
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
componentWillLoad() {
|
|
372
|
-
this.setDefaultOption();
|
|
373
|
-
}
|
|
374
|
-
/** Method to handle slot changes */
|
|
375
|
-
handleSlotChange() {
|
|
376
|
-
this.setDefaultOption();
|
|
377
|
-
}
|
|
378
|
-
/** Method to check if we should normalize text */
|
|
379
|
-
normalizeString(text) {
|
|
380
|
-
return this.normalizeText ? text.normalize('NFD').replace(/\p{Diacritic}/gu, '') : text;
|
|
381
|
-
}
|
|
382
|
-
/** Method that resets the dropdown without emitting an event. */
|
|
383
|
-
internalReset() {
|
|
384
|
-
this.getChildren().forEach((element) => {
|
|
385
|
-
element.setSelected(false);
|
|
386
|
-
return element;
|
|
387
|
-
});
|
|
388
|
-
this.value = null;
|
|
389
|
-
this.setValueAttribute();
|
|
390
|
-
}
|
|
391
|
-
selectChildrenAsSelectedBasedOnSelectionProp() {
|
|
392
|
-
this.getChildren().forEach((element) => {
|
|
393
|
-
this.value.forEach((selection) => {
|
|
394
|
-
if (element.value !== selection) {
|
|
395
|
-
// If not multiselect, we need to unselect all other options.
|
|
396
|
-
if (!this.multiselect) {
|
|
397
|
-
element.setSelected(false);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
else {
|
|
401
|
-
element.setSelected(true);
|
|
402
|
-
}
|
|
403
|
-
});
|
|
404
|
-
});
|
|
405
|
-
}
|
|
406
|
-
render() {
|
|
407
|
-
var _a, _b, _c, _d;
|
|
408
|
-
appendHiddenInput(this.host, this.name, (_a = this.value) === null || _a === void 0 ? void 0 : _a.map((value) => value).toString(), this.disabled);
|
|
409
|
-
return (h(Host, { key: '62778591bba0279591717580456056657bb96e44', role: "select", class: `${this.modeVariant ? `tds-mode-variant-${this.modeVariant}` : ''}` }, this.label && this.labelPosition === 'outside' && (h("div", { key: 'd511a016571d4aa5b1b6db2e183356612c354a0b', class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: 'e9a1f512fc81191d66918f967bc90cff26f13080', class: `dropdown-select ${this.size} ${this.disabled ? 'disabled' : ''}` }, this.filter ? (h("div", { class: {
|
|
410
|
-
filter: true,
|
|
411
|
-
focus: this.filterFocus,
|
|
412
|
-
disabled: this.disabled,
|
|
413
|
-
error: this.error,
|
|
414
|
-
} }, h("div", { class: "value-wrapper" }, this.label && this.labelPosition === 'inside' && this.placeholder && (h("div", { class: `label-inside ${this.size}` }, this.label)), this.label && this.labelPosition === 'inside' && !this.placeholder && (h("div", { class: `
|
|
415
|
-
label-inside-as-placeholder
|
|
416
|
-
${this.size}
|
|
417
|
-
${((_b = this.value) === null || _b === void 0 ? void 0 : _b.length) ? 'selected' : ''}
|
|
418
|
-
` }, this.label)), h("input", {
|
|
419
|
-
// eslint-disable-next-line no-return-assign
|
|
420
|
-
ref: (inputEl) => (this.inputElement = inputEl), class: `${this.labelPosition === 'inside' ? 'placeholder' : ''}`, type: "text", placeholder: this.placeholder, value: this.getValue(), disabled: this.disabled, onInput: (event) => this.handleFilter(event), onBlur: (event) => {
|
|
421
|
-
this.filterFocus = false;
|
|
422
|
-
this.handleBlur(event);
|
|
423
|
-
}, onFocus: (event) => {
|
|
424
|
-
this.open = true;
|
|
425
|
-
this.filterFocus = true;
|
|
426
|
-
this.handleFocus(event);
|
|
427
|
-
}, onKeyDown: (event) => {
|
|
428
|
-
if (event.key === 'Escape') {
|
|
429
|
-
this.open = false;
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
})), h("tds-icon", { tabIndex: 0, role: "button", "aria-label": "Clear filter", svgTitle: "Clear filter", onClick: this.handleFilterReset, onKeyDown: (event) => {
|
|
433
|
-
if (event.key === 'Enter') {
|
|
434
|
-
this.handleFilterReset();
|
|
435
|
-
}
|
|
436
|
-
}, class: `clear-icon ${this.open && this.inputElement.value !== '' ? '' : 'hide'}`, name: "cross", size: "16px" }), h("tds-icon", { tabIndex: 0, role: "button", "aria-label": "Open/Close dropdown", svgTitle: "Open/Close dropdown", onClick: this.handleToggleOpen, onKeyDown: (event) => {
|
|
437
|
-
if (event.key === 'Enter') {
|
|
438
|
-
this.handleToggleOpen();
|
|
439
|
-
}
|
|
440
|
-
}, class: `menu-icon ${this.open ? 'open' : 'closed'}`, name: "chevron_down", size: "16px" }))) : (h("button", { onClick: () => this.handleToggleOpen(), onKeyDown: (event) => {
|
|
441
|
-
if (event.key === 'Escape') {
|
|
442
|
-
this.open = false;
|
|
443
|
-
}
|
|
444
|
-
}, class: `
|
|
445
|
-
${this.value ? 'value' : 'placeholder'}
|
|
446
|
-
${this.open ? 'open' : 'closed'}
|
|
447
|
-
${this.error ? 'error' : ''}
|
|
448
|
-
`, disabled: this.disabled }, h("div", { class: `value-wrapper ${this.size}` }, this.label && this.labelPosition === 'inside' && this.placeholder && (h("div", { class: `label-inside ${this.size}` }, this.label)), this.label && this.labelPosition === 'inside' && !this.placeholder && (h("div", { class: `
|
|
449
|
-
label-inside-as-placeholder
|
|
450
|
-
${this.size}
|
|
451
|
-
${((_c = this.value) === null || _c === void 0 ? void 0 : _c.length) ? 'selected' : ''}
|
|
452
|
-
` }, this.label)), h("div", { class: `placeholder ${this.size}` }, ((_d = this.value) === null || _d === void 0 ? void 0 : _d.length) ? this.getValue() : this.placeholder), h("tds-icon", { "aria-label": "Open/Close dropdown", svgTitle: "Open/Close dropdown", class: `menu-icon ${this.open ? 'open' : 'closed'}`, name: "chevron_down", size: "16px" }))))), h("div", { key: '33d624c7a3669842e5f3c10fff22182185a81eb6', ref: (element) => (this.dropdownList = element), class: `dropdown-list
|
|
453
|
-
${this.size}
|
|
454
|
-
${this.open ? 'open' : 'closed'}
|
|
455
|
-
${this.getOpenDirection()}
|
|
456
|
-
${this.label && this.labelPosition === 'outside' ? 'label-outside' : ''}` }, h("slot", { key: 'f65db159240901a2df850c299d926fe2b21d48df', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: 'a1f2a9b42feea0ca9a332c4ec765b2053a186637', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: '173ddb47f30e6901198a58221c274ddf4502cf15', class: `helper ${this.error ? 'error' : ''} ${this.disabled ? 'disabled' : ''}` }, this.error && h("tds-icon", { key: 'f68ef6f14584bca3c932655be7e63451aac3863e', name: "error", size: "16px" }), this.helper))));
|
|
457
|
-
}
|
|
458
|
-
get host() { return this; }
|
|
459
|
-
static get watchers() { return {
|
|
460
|
-
"open": ["handleOpenState"]
|
|
461
|
-
}; }
|
|
462
|
-
static get style() { return TdsDropdownStyle0; }
|
|
463
|
-
}, [1, "tds-dropdown", {
|
|
464
|
-
"name": [1],
|
|
465
|
-
"disabled": [4],
|
|
466
|
-
"helper": [1],
|
|
467
|
-
"label": [1],
|
|
468
|
-
"labelPosition": [1, "label-position"],
|
|
469
|
-
"modeVariant": [1, "mode-variant"],
|
|
470
|
-
"openDirection": [1, "open-direction"],
|
|
471
|
-
"placeholder": [1],
|
|
472
|
-
"size": [1],
|
|
473
|
-
"error": [4],
|
|
474
|
-
"multiselect": [4],
|
|
475
|
-
"filter": [4],
|
|
476
|
-
"normalizeText": [4, "normalize-text"],
|
|
477
|
-
"noResultText": [1, "no-result-text"],
|
|
478
|
-
"defaultValue": [1, "default-value"],
|
|
479
|
-
"open": [32],
|
|
480
|
-
"value": [32],
|
|
481
|
-
"filterResult": [32],
|
|
482
|
-
"filterFocus": [32],
|
|
483
|
-
"reset": [64],
|
|
484
|
-
"setValue": [64],
|
|
485
|
-
"appendValue": [64],
|
|
486
|
-
"removeValue": [64],
|
|
487
|
-
"close": [64]
|
|
488
|
-
}, [[9, "mousedown", "onAnyClick"], [0, "keydown", "onKeyDown"]], {
|
|
489
|
-
"open": ["handleOpenState"]
|
|
490
|
-
}]);
|
|
491
|
-
function defineCustomElement$1() {
|
|
492
|
-
if (typeof customElements === "undefined") {
|
|
493
|
-
return;
|
|
494
|
-
}
|
|
495
|
-
const components = ["tds-dropdown", "tds-icon"];
|
|
496
|
-
components.forEach(tagName => { switch (tagName) {
|
|
497
|
-
case "tds-dropdown":
|
|
498
|
-
if (!customElements.get(tagName)) {
|
|
499
|
-
customElements.define(tagName, TdsDropdown$1);
|
|
500
|
-
}
|
|
501
|
-
break;
|
|
502
|
-
case "tds-icon":
|
|
503
|
-
if (!customElements.get(tagName)) {
|
|
504
|
-
defineCustomElement$2();
|
|
505
|
-
}
|
|
506
|
-
break;
|
|
507
|
-
} });
|
|
508
|
-
}
|
|
509
|
-
defineCustomElement$1();
|
|
1
|
+
import { T as TdsDropdown$1, d as defineCustomElement$1 } from './p-e7eab204.js';
|
|
510
2
|
|
|
511
3
|
const TdsDropdown = TdsDropdown$1;
|
|
512
4
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -21,8 +21,8 @@ const TdsFolderTab$1 = /*@__PURE__*/ proxyCustomElement(class TdsFolderTab exten
|
|
|
21
21
|
this.selected = selected;
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
|
-
return (h(Host, { key: '
|
|
25
|
-
${this.selected ? 'selected' : ''}`, style: { width: `${this.tabWidth}px` } }, h("slot", { key: '
|
|
24
|
+
return (h(Host, { key: '37ae53ec0d9c0bc3674365d14d61c6b1fbafe168', role: "listitem" }, h("div", { key: 'a977243b499569668ef7428829644f3f2ca23033', class: `${this.disabled ? 'disabled' : ''}
|
|
25
|
+
${this.selected ? 'selected' : ''}`, style: { width: `${this.tabWidth}px` } }, h("slot", { key: '1e8b9cc10f032a64ffef70bb061f57ddc8a4a1a5' }))));
|
|
26
26
|
}
|
|
27
27
|
static get style() { return TdsFolderTabStyle0; }
|
|
28
28
|
}, [1, "tds-folder-tab", {
|
|
@@ -166,9 +166,9 @@ const TdsFolderTabs$1 = /*@__PURE__*/ proxyCustomElement(class TdsFolderTabs ext
|
|
|
166
166
|
this.removeEventListenerFromTabs();
|
|
167
167
|
}
|
|
168
168
|
render() {
|
|
169
|
-
return (h(Host, { key: '
|
|
169
|
+
return (h(Host, { key: '3164044436f7029d85c4eed0ff7e0cc2b4e35752', role: "list", class: `${this.modeVariant ? `tds-mode-variant-${this.modeVariant}` : ''}` }, h("div", { key: '59beaa0776ff83a30e84b69c5715a2f0d62ec6d9', class: "wrapper", ref: (el) => {
|
|
170
170
|
this.navWrapperElement = el;
|
|
171
|
-
} }, h("button", { key: '
|
|
171
|
+
} }, h("button", { key: '0bd461d469592983e08043c23e295c21df04c80f', class: `scroll-left-button ${this.showLeftScroll ? 'show' : ''}`, disabled: !this.showLeftScroll, onClick: () => this.scrollLeft() }, h("tds-icon", { key: 'd21448eea9cab4d73087fec72d29270b52bf0999', name: "chevron_left", size: "20px" })), h("slot", { key: 'efe348a98b964486a73d1aac235ce894277c6249', onSlotchange: () => this.handleSlotChange() }), h("button", { key: 'ea819f59668994e328410941b5b7455620ecb321', class: `scroll-right-button ${this.showRightScroll ? 'show' : ''}`, disabled: !this.showRightScroll, onClick: () => this.scrollRight() }, h("tds-icon", { key: 'c52241bb7c77eabbdb8de5a19bb4400c32aa2062', name: "chevron_right", size: "20px" })))));
|
|
172
172
|
}
|
|
173
173
|
get host() { return this; }
|
|
174
174
|
static get watchers() { return {
|
|
@@ -114,7 +114,7 @@ const TdsTableHeaderCell = /*@__PURE__*/ proxyCustomElement(class TdsTableHeader
|
|
|
114
114
|
this.host.closest('tds-table').getElementsByTagName('tds-table-toolbar').length >= 1;
|
|
115
115
|
}
|
|
116
116
|
render() {
|
|
117
|
-
return (h(Host, { key: '
|
|
117
|
+
return (h(Host, { key: 'c40924cf774a94e3f78d114eb91632fe57388ba2', class: {
|
|
118
118
|
'tds-table__header-cell': true,
|
|
119
119
|
'tds-table__header-cell--sortable': this.sortable,
|
|
120
120
|
'tds-table__header-cell--is-sorted': this.sortedByMyKey,
|
|
@@ -32,6 +32,15 @@ const TdsHeader$1 = /*@__PURE__*/ proxyCustomElement(class TdsHeader extends H {
|
|
|
32
32
|
};
|
|
33
33
|
this.observer = new MutationObserver(callback);
|
|
34
34
|
}
|
|
35
|
+
updateRoles() {
|
|
36
|
+
const navElement = this.host.querySelector('.tds-header-component-list');
|
|
37
|
+
if (navElement) {
|
|
38
|
+
updateListChildrenRoles(navElement);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
handleSlotChange() {
|
|
42
|
+
this.updateRoles();
|
|
43
|
+
}
|
|
35
44
|
componentDidLoad() {
|
|
36
45
|
const hostElement = this.host;
|
|
37
46
|
const navElement = hostElement.querySelector('.tds-header-component-list');
|
|
@@ -46,7 +55,7 @@ const TdsHeader$1 = /*@__PURE__*/ proxyCustomElement(class TdsHeader extends H {
|
|
|
46
55
|
}
|
|
47
56
|
render() {
|
|
48
57
|
const navAttributes = Object.assign({}, inheritAriaAttributes(this.host));
|
|
49
|
-
return (h(Host, { key: '
|
|
58
|
+
return (h(Host, { key: '9444edcd74ab89d00450b398c6cb1a4f25ed9cd1' }, h("slot", { key: '9ee5c071427d56d71ebed3f4fb28540f26f756f4', name: "hamburger" }), h("slot", { key: 'ba6cb45780392f5682ff13b889c5500fc90dd1ce', name: "title" }), h("nav", Object.assign({ key: '1017dce61683cb6b9e1c80ef35332b6ea741c809' }, navAttributes), h("ul", { key: '043975c96c36ca0e4947d3c087f53ca05a594378', class: "tds-header-component-list" }, h("slot", { key: 'd45bd8a53521589985897a68f70532392cd71649' }), h("li", { key: '66053c3aebea63b8121e59236f9ec39bb1a5cf45', class: "tds-header-middle-spacer" }), h("slot", { key: '7101e62647bdbaf9da4a784f622d6c4295bc787d', name: "end", onSlotchange: () => this.handleSlotChange() })))));
|
|
50
59
|
}
|
|
51
60
|
get host() { return this; }
|
|
52
61
|
static get style() { return TdsHeaderStyle0; }
|
|
@@ -16,8 +16,8 @@ const TdsInlineTab$1 = /*@__PURE__*/ proxyCustomElement(class TdsInlineTab exten
|
|
|
16
16
|
this.selected = selected;
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
return (h(Host, { key: '
|
|
20
|
-
${this.disabled ? 'disabled' : ''}` }, h("slot", { key: '
|
|
19
|
+
return (h(Host, { key: 'd15c7d658b9f90d01743d8f4fe6d14714a73e3f8', role: "listitem" }, h("div", { key: 'cc3324aa2ee065c9c9fd78c0e55c5c096a975d4d', class: `inline-tab-item ${this.selected ? 'selected' : ''}
|
|
20
|
+
${this.disabled ? 'disabled' : ''}` }, h("slot", { key: '68bed317582717cb72d40f6b91d304a3a3df9d47' }))));
|
|
21
21
|
}
|
|
22
22
|
static get style() { return TdsInlineTabStyle0; }
|
|
23
23
|
}, [1, "tds-inline-tab", {
|
|
@@ -173,9 +173,9 @@ const TdsInlineTabs$1 = /*@__PURE__*/ proxyCustomElement(class TdsInlineTabs ext
|
|
|
173
173
|
this.removeEventListenerFromTabs();
|
|
174
174
|
}
|
|
175
175
|
render() {
|
|
176
|
-
return (h(Host, { key: '
|
|
176
|
+
return (h(Host, { key: '71f42e22f75a1fe4ca4f906b2151ed1a4c324e51', role: "list", class: `${this.modeVariant ? `tds-mode-variant-${this.modeVariant}` : ''}` }, h("div", { key: '33e457be72862e642f2a867243f6325f94d210e8', class: "wrapper", ref: (el) => {
|
|
177
177
|
this.navWrapperElement = el;
|
|
178
|
-
}, style: { paddingLeft: `${this.leftPadding}px` } }, h("button", { key: '
|
|
178
|
+
}, style: { paddingLeft: `${this.leftPadding}px` } }, h("button", { key: '786a1655c5efe5f2a079c62cb89300a99149c3fb', class: `scroll-left-button ${this.showLeftScroll ? 'show' : ''}`, onClick: () => this.scrollLeft(), disabled: !this.showLeftScroll }, h("tds-icon", { key: 'df2f3798cb6cb4ea446932cdf8ce84ac068c57ff', name: "chevron_left", size: "20px" })), h("slot", { key: 'b5e14ca573a2ac7a4e20defd05b412a941e72f0b', onSlotchange: () => this.handleSlotChange() }), h("button", { key: 'da0b823e674c5eacd325f69e98e14f4def9c477f', class: `scroll-right-button ${this.showRightScroll ? 'show' : ''}`, onClick: () => this.scrollRight(), disabled: !this.showRightScroll }, h("tds-icon", { key: '2bdd7110bb4b22c4dfabc1a5ef2acf9e7592b9b9', name: "chevron_right", size: "20px" })))));
|
|
179
179
|
}
|
|
180
180
|
get host() { return this; }
|
|
181
181
|
static get watchers() { return {
|
|
@@ -16,8 +16,8 @@ const TdsNavigationTab$1 = /*@__PURE__*/ proxyCustomElement(class TdsNavigationT
|
|
|
16
16
|
this.selected = selected;
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
return (h(Host, { key: '
|
|
20
|
-
${this.disabled ? 'disabled' : ''}` }, h("slot", { key: '
|
|
19
|
+
return (h(Host, { key: '46ce3b8e878eca4c970f29371cb17a0c7ec1789a', role: "listitem" }, h("div", { key: '51331675d8898d5bca9758ed9c09194c6dbfde23', class: `navigation-tab-item ${this.selected ? 'selected' : ''}
|
|
20
|
+
${this.disabled ? 'disabled' : ''}` }, h("slot", { key: 'd326748125d8e6a366268c581139bb859ef8feeb' }))));
|
|
21
21
|
}
|
|
22
22
|
static get style() { return TdsNavigationTabStyle0; }
|
|
23
23
|
}, [1, "tds-navigation-tab", {
|
|
@@ -173,9 +173,9 @@ const TdsNavigationTabs$1 = /*@__PURE__*/ proxyCustomElement(class TdsNavigation
|
|
|
173
173
|
this.removeEventListenerFromTabs();
|
|
174
174
|
}
|
|
175
175
|
render() {
|
|
176
|
-
return (h(Host, { key: '
|
|
176
|
+
return (h(Host, { key: 'fa440271f692e4893d4374ccd081308b5b4623e5', role: "list", class: `${this.modeVariant ? `tds-mode-variant-${this.modeVariant}` : ''}` }, h("div", { key: '434fba65da78ac84c018252c52440d20984ab7b3', class: "wrapper", ref: (el) => {
|
|
177
177
|
this.navWrapperElement = el;
|
|
178
|
-
}, style: { paddingLeft: `${this.leftPadding}px` } }, h("button", { key: '
|
|
178
|
+
}, style: { paddingLeft: `${this.leftPadding}px` } }, h("button", { key: '29d8d76a06c82f06b1c2aa15a3d023d238b05f10', class: `scroll-left-button ${this.showLeftScroll ? 'show' : ''}`, onClick: () => this.scrollLeft(), disabled: !this.showLeftScroll }, h("tds-icon", { key: '1936dee5d3476a0d2c46b4d64a7a26848320c9d7', name: "chevron_left", size: "20px" })), h("slot", { key: '9e4cffce9188a7d517636e4b32ef8574a8bea78a', onSlotchange: () => this.handleSlotChange() }), h("button", { key: '3af05aee3183425bdcd5c2f5f65f0c8920ba8622', class: `scroll-right-button ${this.showRightScroll ? 'show' : ''}`, onClick: () => this.scrollRight(), disabled: !this.showRightScroll }, h("tds-icon", { key: '075726ba4074a4e9452248115968d3b21104e929', name: "chevron_right", size: "20px" })))));
|
|
179
179
|
}
|
|
180
180
|
get host() { return this; }
|
|
181
181
|
static get watchers() { return {
|