@scania/tegel 1.37.1 → 1.38.0-handleValueChange-correct-logic-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 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/tds-core-header-item_2.cjs.entry.js +1 -1
- package/dist/cjs/tds-dropdown_2.cjs.entry.js +49 -21
- package/dist/cjs/tds-folder-tab.cjs.entry.js +1 -1
- package/dist/cjs/tds-folder-tabs.cjs.entry.js +1 -1
- package/dist/cjs/tds-inline-tab.cjs.entry.js +1 -1
- package/dist/cjs/tds-message.cjs.entry.js +3 -4
- package/dist/cjs/tds-navigation-tab.cjs.entry.js +1 -1
- package/dist/cjs/tds-navigation-tabs.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-collapse-button.cjs.entry.js +4 -6
- package/dist/cjs/tds-side-menu-dropdown-list-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-slider.cjs.entry.js +39 -10
- package/dist/cjs/tegel.cjs.js +1 -1
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +13 -3
- package/dist/collection/components/dropdown/dropdown.js +48 -18
- package/dist/collection/components/header/header-item/header-item.css +3 -3
- package/dist/collection/components/message/message.css +0 -20
- package/dist/collection/components/message/message.js +2 -3
- package/dist/collection/components/side-menu/side-menu-collapse-button/side-menu-collapse-button.js +4 -6
- package/dist/collection/components/side-menu/side-menu-dropdown-list-item/side-menu-dropdown-list-item.css +84 -6
- package/dist/collection/components/side-menu/side-menu-item/side-menu-item.css +82 -6
- package/dist/collection/components/slider/slider.css +24 -28
- package/dist/collection/components/slider/slider.js +38 -9
- package/dist/collection/components/tabs/folder-tabs/folder-tab/folder-tab.css +34 -8
- package/dist/collection/components/tabs/folder-tabs/folder-tabs.css +12 -2
- package/dist/collection/components/tabs/inline-tabs/inline-tab/inline-tab.css +14 -9
- package/dist/collection/components/tabs/navigation-tabs/navigation-tab/navigation-tab.css +16 -10
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.css +12 -2
- package/dist/components/{p-63437b77.js → p-072bf53a.js} +1 -1
- package/dist/components/{p-ea381f94.js → p-92c2da85.js} +1 -1
- package/dist/components/{p-94bfc9f4.js → p-9a47d831.js} +37 -19
- package/dist/components/p-a0c21704.js +187 -0
- package/dist/components/{p-6adb1ce3.js → p-ad6babcd.js} +1 -1
- package/dist/components/{p-d64878cb.js → p-c4318e35.js} +13 -3
- package/dist/components/tds-dropdown-option.js +1 -1
- package/dist/components/tds-dropdown.js +1 -1
- package/dist/components/tds-folder-tab.js +1 -1
- package/dist/components/tds-folder-tabs.js +1 -1
- package/dist/components/tds-header-brand-symbol.js +1 -1
- package/dist/components/tds-header-dropdown.js +1 -1
- package/dist/components/tds-header-hamburger.js +1 -1
- package/dist/components/tds-header-item.js +1 -1
- package/dist/components/tds-header-launcher-button.js +1 -1
- package/dist/components/tds-header-launcher.js +2 -2
- package/dist/components/tds-inline-tab.js +1 -1
- package/dist/components/tds-message.js +3 -4
- package/dist/components/tds-navigation-tab.js +1 -1
- package/dist/components/tds-navigation-tabs.js +1 -1
- package/dist/components/tds-side-menu-collapse-button.js +5 -7
- package/dist/components/tds-side-menu-dropdown-list-item.js +1 -1
- package/dist/components/tds-side-menu-dropdown.js +1 -1
- package/dist/components/tds-side-menu-item.js +1 -1
- package/dist/components/tds-slider.js +59 -12
- package/dist/components/tds-table-footer.js +2 -2
- package/dist/components/tds-text-field.js +1 -185
- package/dist/esm/index-51d04e39.js +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tds-core-header-item_2.entry.js +1 -1
- package/dist/esm/tds-dropdown_2.entry.js +49 -21
- package/dist/esm/tds-folder-tab.entry.js +1 -1
- package/dist/esm/tds-folder-tabs.entry.js +1 -1
- package/dist/esm/tds-inline-tab.entry.js +1 -1
- package/dist/esm/tds-message.entry.js +3 -4
- package/dist/esm/tds-navigation-tab.entry.js +1 -1
- package/dist/esm/tds-navigation-tabs.entry.js +1 -1
- package/dist/esm/tds-side-menu-collapse-button.entry.js +4 -6
- package/dist/esm/tds-side-menu-dropdown-list-item.entry.js +1 -1
- package/dist/esm/tds-side-menu-item.entry.js +1 -1
- package/dist/esm/tds-slider.entry.js +39 -10
- package/dist/esm/tegel.js +1 -1
- package/dist/tegel/{p-c0b26507.entry.js → p-25f4b4ca.entry.js} +1 -1
- package/dist/tegel/p-2c9ea0be.entry.js +1 -0
- package/dist/tegel/p-2f9b15f6.entry.js +1 -0
- package/dist/tegel/p-336f2de3.entry.js +1 -0
- package/dist/tegel/p-7368906f.entry.js +1 -0
- package/dist/tegel/p-8ae4e03c.entry.js +1 -0
- package/dist/tegel/p-b2b9561f.entry.js +1 -0
- package/dist/tegel/{p-52adc30c.entry.js → p-bb9445ff.entry.js} +1 -1
- package/dist/tegel/p-c465f9b8.entry.js +1 -0
- package/dist/tegel/p-c4f701f6.entry.js +1 -0
- package/dist/tegel/{p-8c841698.entry.js → p-d184a3f0.entry.js} +1 -1
- package/dist/tegel/p-db38b4f2.entry.js +1 -0
- package/dist/tegel/tegel.css +1 -1
- package/dist/tegel/tegel.esm.js +1 -1
- package/dist/types/components/dropdown/dropdown.d.ts +3 -0
- package/dist/types/components/slider/slider.d.ts +2 -0
- package/package.json +1 -1
- package/dist/tegel/p-06d3490c.entry.js +0 -1
- package/dist/tegel/p-106e048d.entry.js +0 -1
- package/dist/tegel/p-397c8969.entry.js +0 -1
- package/dist/tegel/p-5c077bb9.entry.js +0 -1
- package/dist/tegel/p-61a1dc59.entry.js +0 -1
- package/dist/tegel/p-a0591e58.entry.js +0 -1
- package/dist/tegel/p-ae438c2e.entry.js +0 -1
- package/dist/tegel/p-dc375d3e.entry.js +0 -1
- package/dist/tegel/p-e3c2b6b4.entry.js +0 -1
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
/* !important is needed here to prevent this from being overwritten by our CSS-reset. */
|
|
11
11
|
font: var(--tds-headline-07) !important;
|
|
12
12
|
letter-spacing: var(--tds-headline-07-ls) !important;
|
|
13
|
-
color: var(--tds-navigation-tabs-tab-color)
|
|
13
|
+
color: var(--tds-navigation-tabs-tab-color);
|
|
14
14
|
text-decoration: none;
|
|
15
15
|
display: block;
|
|
16
16
|
position: relative;
|
|
@@ -19,16 +19,19 @@
|
|
|
19
19
|
background-color: transparent;
|
|
20
20
|
border: 0;
|
|
21
21
|
width: 100%;
|
|
22
|
-
padding: 26px
|
|
22
|
+
padding: 26px 0;
|
|
23
23
|
}
|
|
24
24
|
:host ::slotted(*:focus-visible)::before {
|
|
25
25
|
content: "";
|
|
26
26
|
position: absolute;
|
|
27
27
|
left: 0;
|
|
28
28
|
right: 0;
|
|
29
|
-
top:
|
|
30
|
-
bottom:
|
|
31
|
-
outline: 2px solid var(--tds-
|
|
29
|
+
top: 3px;
|
|
30
|
+
bottom: 3px;
|
|
31
|
+
outline: 2px solid var(--tds-focus-outline-color);
|
|
32
|
+
box-shadow: 0 0 0 1px var(--tds-white);
|
|
33
|
+
outline-offset: 1px;
|
|
34
|
+
z-index: 1;
|
|
32
35
|
}
|
|
33
36
|
:host .navigation-tab-item:not(.selected)::after {
|
|
34
37
|
width: 0%;
|
|
@@ -36,11 +39,13 @@
|
|
|
36
39
|
}
|
|
37
40
|
:host .navigation-tab-item {
|
|
38
41
|
position: relative;
|
|
39
|
-
margin-right: 32px;
|
|
40
42
|
}
|
|
41
43
|
:host .navigation-tab-item:hover {
|
|
42
44
|
cursor: pointer;
|
|
43
45
|
}
|
|
46
|
+
:host .navigation-tab-item:hover ::slotted(*) {
|
|
47
|
+
color: var(--tds-navigation-tabs-tab-color-hover);
|
|
48
|
+
}
|
|
44
49
|
:host .navigation-tab-item:hover::after {
|
|
45
50
|
width: 100%;
|
|
46
51
|
}
|
|
@@ -57,6 +62,9 @@
|
|
|
57
62
|
background-color: var(--tds-navigation-tabs-tab-indicator-background-hover);
|
|
58
63
|
z-index: 1;
|
|
59
64
|
}
|
|
65
|
+
:host .navigation-tab-item:focus-visible::after {
|
|
66
|
+
bottom: 3px;
|
|
67
|
+
}
|
|
60
68
|
:host .selected ::slotted(*) {
|
|
61
69
|
color: var(--tds-navigation-tabs-tab-color-selected);
|
|
62
70
|
}
|
|
@@ -64,17 +72,15 @@
|
|
|
64
72
|
width: 100%;
|
|
65
73
|
background-color: var(--tds-navigation-tabs-tab-indicator-background-active);
|
|
66
74
|
}
|
|
67
|
-
:host .disabled {
|
|
68
|
-
color: var(--tds-navigation-tabs-tab-color-disabled);
|
|
69
|
-
}
|
|
70
75
|
:host .disabled ::slotted(*) {
|
|
71
|
-
|
|
76
|
+
color: var(--tds-navigation-tabs-tab-color-disabled);
|
|
72
77
|
}
|
|
73
78
|
:host .disabled::after {
|
|
74
79
|
content: none;
|
|
75
80
|
}
|
|
76
81
|
:host .disabled ::slotted(*:hover) {
|
|
77
82
|
cursor: not-allowed;
|
|
83
|
+
color: var(--tds-navigation-tabs-tab-color-disabled);
|
|
78
84
|
}
|
|
79
85
|
:host .disabled ::slotted(*:focus-visible) {
|
|
80
86
|
outline: none;
|
|
@@ -65,13 +65,23 @@
|
|
|
65
65
|
:host .scroll-left-button:active {
|
|
66
66
|
background-color: var(--tds-folder-tabs-scroll-btn-background-active);
|
|
67
67
|
}
|
|
68
|
-
:host .scroll-right-button:focus,
|
|
69
|
-
:host .scroll-left-button:focus {
|
|
68
|
+
:host .scroll-right-button:focus::before,
|
|
69
|
+
:host .scroll-left-button:focus::before {
|
|
70
|
+
content: "";
|
|
71
|
+
position: absolute;
|
|
72
|
+
left: 3px;
|
|
73
|
+
right: 3px;
|
|
74
|
+
top: 3px;
|
|
75
|
+
bottom: 3px;
|
|
70
76
|
outline: 2px solid var(--tds-focus-outline-color);
|
|
71
77
|
box-shadow: 0 0 0 1px var(--tds-white);
|
|
72
78
|
outline-offset: 1px;
|
|
73
79
|
z-index: 1;
|
|
74
80
|
}
|
|
81
|
+
:host .scroll-right-button:focus,
|
|
82
|
+
:host .scroll-left-button:focus {
|
|
83
|
+
outline: 0;
|
|
84
|
+
}
|
|
75
85
|
:host .scroll-right-button svg,
|
|
76
86
|
:host .scroll-left-button svg {
|
|
77
87
|
fill: var(--tds-folder-tabs-scroll-btn-color);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
|
|
2
2
|
import { i as inheritAriaAttributes } from './p-0bd4c19c.js';
|
|
3
3
|
import { d as defineCustomElement$3 } from './p-9ad61cb5.js';
|
|
4
|
-
import { d as defineCustomElement$2 } from './p-
|
|
4
|
+
import { d as defineCustomElement$2 } from './p-ad6babcd.js';
|
|
5
5
|
import { d as defineCustomElement$1 } from './p-b390ece5.js';
|
|
6
6
|
|
|
7
7
|
const headerLauncherButtonCss = ":host{display:block}:host tds-header-item{display:block}:host .icon{position:relative;margin-left:-6px;left:3px;transition:all 0.2s ease-in-out}";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
|
|
2
2
|
import { d as dfs } from './p-52bf0fdf.js';
|
|
3
3
|
|
|
4
|
-
const sideMenuItemCss = ":host{display:block}:host .component ::slotted(a),:host .component ::slotted(button){all:unset;box-sizing:border-box;height:68px;width:100%;display:flex;align-items:center;gap:10px;padding:0 22px;border:none;background-color:var(--tds-sidebar-side-menu-background-cover);font:var(--tds-headline-07);letter-spacing:var(--tds-headline-07-ls);color:var(--tds-sidebar-side-menu-single-item-color);cursor:pointer}:host .component ::slotted(tds-side-menu-user),:host .component-has-user ::slotted(button){all:unset;box-sizing:border-box;height:68px;width:100%;display:flex;align-items:center;gap:16px;padding:0 22px 0 16px;border:none;background-color:var(--tds-sidebar-side-menu-background-cover);font:var(--tds-headline-07);letter-spacing:var(--tds-headline-07-ls);color:var(--tds-sidebar-side-menu-single-item-color);cursor:pointer}:host .component tds-icon{color:red !important}:host .component ::slotted(a:focus-visible),:host .component ::slotted(button:focus-visible){outline:2px solid var(--tds-focus-outline-color);box-shadow:0 0 0
|
|
4
|
+
const sideMenuItemCss = ":host{display:block}:host .component ::slotted(a),:host .component ::slotted(button){all:unset;box-sizing:border-box;height:68px;width:100%;display:flex;align-items:center;gap:10px;padding:0 22px;border:none;background-color:var(--tds-sidebar-side-menu-background-cover);font:var(--tds-headline-07);letter-spacing:var(--tds-headline-07-ls);color:var(--tds-sidebar-side-menu-single-item-color);cursor:pointer}:host .component ::slotted(tds-side-menu-user),:host .component-has-user ::slotted(button){all:unset;box-sizing:border-box;height:68px;width:100%;display:flex;align-items:center;gap:16px;padding:0 22px 0 16px;border:none;background-color:var(--tds-sidebar-side-menu-background-cover);font:var(--tds-headline-07);letter-spacing:var(--tds-headline-07-ls);color:var(--tds-sidebar-side-menu-single-item-color);cursor:pointer}:host .component tds-icon{color:red !important}:host .component ::slotted(a:focus-visible),:host .component ::slotted(button:focus-visible){outline:2px solid var(--tds-focus-outline-color);box-shadow:inset 0 0 0 3px var(--tds-white);outline-offset:-2px}:host .component:hover ::slotted(a),:host .component:hover ::slotted(button),:host .component:hover ::slotted(tds-side-menu-user){background-color:var(--tds-sidebar-item-state-hover);position:relative}:host .component:hover ::slotted(a)::before,:host .component:hover ::slotted(button)::before,:host .component:hover ::slotted(tds-side-menu-user)::before{content:\"\";position:absolute;top:0;left:0;width:4px;height:100%;background-color:var(--tds-side-menu-item-hover-indicator)}:host .component:hover ::slotted(a:focus-visible),:host .component:hover ::slotted(button:focus-visible),:host .component:hover ::slotted(tds-side-menu-user:focus-visible){background-color:var(--tds-sidebar-item-state-hover);position:relative}:host .component:hover ::slotted(a:focus-visible)::before,:host .component:hover ::slotted(button:focus-visible)::before,:host .component:hover ::slotted(tds-side-menu-user:focus-visible)::before{content:\"\";position:absolute;top:3px;left:3px;width:4px;height:calc(100% - 6px);background-color:var(--tds-side-menu-item-hover-indicator)}:host .component:active ::slotted(a),:host .component:active ::slotted(button),:host .component:active ::slotted(tds-side-menu-user){background-color:var(--tds-sidemenu-item-state-active);position:relative}:host .component:active ::slotted(a)::before,:host .component:active ::slotted(button)::before,:host .component:active ::slotted(tds-side-menu-user)::before{content:\"\";position:absolute;top:0;left:0;width:4px;height:100%;background-color:var(--tds-side-menu-item-pressed-indicator)}:host .component:active ::slotted(a:focus-visible),:host .component:active ::slotted(button:focus-visible),:host .component:active ::slotted(tds-side-menu-user:focus-visible){background-color:var(--tds-sidemenu-item-state-active);position:relative}:host .component:active ::slotted(a:focus-visible)::before,:host .component:active ::slotted(button:focus-visible)::before,:host .component:active ::slotted(tds-side-menu-user:focus-visible)::before{content:\"\";position:absolute;top:3px;left:3px;width:4px;height:calc(100% - 6px);background-color:var(--tds-side-menu-item-pressed-indicator)}:host .component-collapsed ::slotted(a),:host .component-collapsed ::slotted(button){padding:0;display:flex;justify-content:center;align-items:center;position:relative}:host .component-selected:not(:host .component-active) ::slotted(a),:host .component-selected:not(:host .component-active) ::slotted(button),:host .component-selected:not(:host .component-active) ::slotted(tds-side-menu-user){background-color:var(--tds-sidebar-item-state-selected);position:relative}:host .component-selected:not(:host .component-active) ::slotted(a)::before,:host .component-selected:not(:host .component-active) ::slotted(button)::before,:host .component-selected:not(:host .component-active) ::slotted(tds-side-menu-user)::before{content:\"\";position:absolute;top:0;left:0;width:4px;height:100%;background-color:var(--tds-sidebar-side-menu-single-subitem-selected-border-color)}:host .component-selected:not(:host .component-active) ::slotted(a:focus-visible),:host .component-selected:not(:host .component-active) ::slotted(button:focus-visible),:host .component-selected:not(:host .component-active) ::slotted(tds-side-menu-user:focus-visible){background-color:var(--tds-sidebar-item-state-selected);position:relative}:host .component-selected:not(:host .component-active) ::slotted(a:focus-visible)::before,:host .component-selected:not(:host .component-active) ::slotted(button:focus-visible)::before,:host .component-selected:not(:host .component-active) ::slotted(tds-side-menu-user:focus-visible)::before{content:\"\";position:absolute;top:3px;left:3px;width:4px;height:calc(100% - 6px);background-color:var(--tds-sidebar-side-menu-single-subitem-selected-border-color)}@media (min-width: 992px){:host .component.component-collapsed ::slotted(a),:host .component.component-collapsed ::slotted(button){color:rgba(90, 90, 90, 0);overflow:hidden}}";
|
|
5
5
|
const TdsSideMenuItemStyle0 = sideMenuItemCss;
|
|
6
6
|
|
|
7
7
|
const TdsSideMenuItem = /*@__PURE__*/ proxyCustomElement(class TdsSideMenuItem extends H {
|
|
@@ -67,7 +67,7 @@ const TdsDropdownStyle0 = dropdownCss;
|
|
|
67
67
|
function hasValueChanged(newValue, currentValue) {
|
|
68
68
|
if (newValue.length !== currentValue.length)
|
|
69
69
|
return true;
|
|
70
|
-
return newValue.some((val) =>
|
|
70
|
+
return newValue.some((val, i) => val !== currentValue[i]);
|
|
71
71
|
}
|
|
72
72
|
const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H {
|
|
73
73
|
constructor() {
|
|
@@ -78,6 +78,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
78
78
|
this.tdsFocus = createEvent(this, "tdsFocus", 6);
|
|
79
79
|
this.tdsBlur = createEvent(this, "tdsBlur", 6);
|
|
80
80
|
this.tdsInput = createEvent(this, "tdsInput", 6);
|
|
81
|
+
this.hasFocus = false;
|
|
81
82
|
this.setDefaultOption = () => {
|
|
82
83
|
if (this.internalDefaultValue) {
|
|
83
84
|
// Convert the internal default value to an array if it's not already
|
|
@@ -192,19 +193,23 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
192
193
|
// Add this line to ensure internal value is cleared
|
|
193
194
|
this.internalValue = '';
|
|
194
195
|
};
|
|
195
|
-
this.handleFocus = (
|
|
196
|
+
this.handleFocus = () => {
|
|
196
197
|
this.open = true;
|
|
197
198
|
this.filterFocus = true;
|
|
198
199
|
if (this.multiselect && this.inputElement) {
|
|
199
200
|
this.inputElement.value = '';
|
|
200
201
|
}
|
|
201
|
-
|
|
202
|
+
// Focus event is now handled by focusin listener
|
|
202
203
|
if (this.filter) {
|
|
203
204
|
this.handleFilter({ target: { value: '' } });
|
|
204
205
|
}
|
|
205
206
|
};
|
|
206
|
-
this.handleBlur = (
|
|
207
|
-
|
|
207
|
+
this.handleBlur = () => {
|
|
208
|
+
// Handle internal state changes when component loses focus
|
|
209
|
+
this.filterFocus = false;
|
|
210
|
+
if (this.multiselect && this.inputElement) {
|
|
211
|
+
this.inputElement.value = this.getValue();
|
|
212
|
+
}
|
|
208
213
|
};
|
|
209
214
|
this.resetInput = () => {
|
|
210
215
|
const inputEl = this.host.querySelector('input');
|
|
@@ -379,7 +384,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
379
384
|
}
|
|
380
385
|
}
|
|
381
386
|
// Always trigger the focus event to open the dropdown
|
|
382
|
-
this.handleFocus(
|
|
387
|
+
this.handleFocus();
|
|
383
388
|
}
|
|
384
389
|
/** Method for closing the Dropdown. */
|
|
385
390
|
async close() {
|
|
@@ -401,6 +406,25 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
401
406
|
}
|
|
402
407
|
}
|
|
403
408
|
}
|
|
409
|
+
onFocusIn(event) {
|
|
410
|
+
// Check if the focus is within this dropdown component
|
|
411
|
+
if (this.host.contains(event.target)) {
|
|
412
|
+
if (!this.hasFocus) {
|
|
413
|
+
this.hasFocus = true;
|
|
414
|
+
this.tdsFocus.emit(event);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
onFocusOut(event) {
|
|
419
|
+
// Only emit blur if focus is actually leaving the entire dropdown component
|
|
420
|
+
const relatedTarget = event.relatedTarget;
|
|
421
|
+
// If relatedTarget is null (focus going to body/window) or outside the component, emit blur
|
|
422
|
+
if (this.hasFocus && (!relatedTarget || !this.host.contains(relatedTarget))) {
|
|
423
|
+
this.hasFocus = false;
|
|
424
|
+
this.handleBlur();
|
|
425
|
+
this.tdsBlur.emit(event);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
404
428
|
async onKeyDown(event) {
|
|
405
429
|
var _a;
|
|
406
430
|
// Get the active element
|
|
@@ -520,9 +544,9 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
520
544
|
// Generate unique IDs for associating labels and helpers with the input/button
|
|
521
545
|
const labelId = this.label ? `dropdown-label-${this.name || generateUniqueId()}` : undefined;
|
|
522
546
|
const helperId = this.helper ? `dropdown-helper-${this.name || generateUniqueId()}` : undefined;
|
|
523
|
-
return (h(Host, { key: '
|
|
547
|
+
return (h(Host, { key: 'fc01da19c2eeb9c225dea61e473e4c8c64adce9a', class: {
|
|
524
548
|
[`tds-mode-variant-${this.modeVariant}`]: Boolean(this.modeVariant),
|
|
525
|
-
} }, this.label && this.labelPosition === 'outside' && (h("div", { key: '
|
|
549
|
+
} }, this.label && this.labelPosition === 'outside' && (h("div", { key: 'f6a3c12162a750dfdaf7069b4c31b1b8e64d6d31', id: labelId, class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: 'c31cab097be72ebebeb9538a721e281f36365405', class: {
|
|
526
550
|
'dropdown-select': true,
|
|
527
551
|
[this.size]: true,
|
|
528
552
|
'disabled': this.disabled,
|
|
@@ -539,13 +563,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
539
563
|
// eslint-disable-next-line no-return-assign
|
|
540
564
|
ref: (inputEl) => (this.inputElement = inputEl), class: {
|
|
541
565
|
placeholder: this.labelPosition === 'inside',
|
|
542
|
-
}, type: "text", placeholder: this.filterFocus ? '' : this.placeholder, value: this.multiselect && this.filterFocus ? '' : this.getValue(), disabled: this.disabled, onInput: (event) => this.handleFilter(event),
|
|
543
|
-
this.filterFocus = false;
|
|
544
|
-
if (this.multiselect) {
|
|
545
|
-
this.inputElement.value = this.getValue();
|
|
546
|
-
}
|
|
547
|
-
this.handleBlur(event);
|
|
548
|
-
}, onFocus: (event) => this.handleFocus(event), onKeyDown: (event) => {
|
|
566
|
+
}, type: "text", placeholder: this.filterFocus ? '' : this.placeholder, value: this.multiselect && this.filterFocus ? '' : this.getValue(), disabled: this.disabled, onInput: (event) => this.handleFilter(event), onFocus: () => this.handleFocus(), onKeyDown: (event) => {
|
|
549
567
|
if (event.key === 'Escape') {
|
|
550
568
|
this.open = false;
|
|
551
569
|
}
|
|
@@ -572,7 +590,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
572
590
|
label-inside-as-placeholder
|
|
573
591
|
${this.size}
|
|
574
592
|
${this.selectedOptions.length ? 'selected' : ''}
|
|
575
|
-
` }, this.label)), h("div", { class: `placeholder ${this.size}` }, this.selectedOptions.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: '
|
|
593
|
+
` }, this.label)), h("div", { class: `placeholder ${this.size}` }, this.selectedOptions.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: 'd4fe7a4e58238ff30e1d2edd1adda57363cd35ca', role: "listbox", "aria-label": this.tdsAriaLabel, inert: !this.open, "aria-orientation": "vertical", "aria-multiselectable": this.multiselect, ref: (element) => {
|
|
576
594
|
this.dropdownList = element;
|
|
577
595
|
}, class: {
|
|
578
596
|
'dropdown-list': true,
|
|
@@ -583,11 +601,11 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
583
601
|
'closed': !this.open,
|
|
584
602
|
[`animation-enter-${this.animation}`]: this.animation !== 'none' && this.open,
|
|
585
603
|
[`animation-exit-${this.animation}`]: this.animation !== 'none' && !this.open,
|
|
586
|
-
} }, h("slot", { key: '
|
|
604
|
+
} }, h("slot", { key: '883d2ffb1497304b8c3ef8131062769a91516d97', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: 'cc808c5d33b97f400cd4d6e0544f3da78f81f7a8', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: '66226ce4194e4e0c8d7e618b874c52180aa007f2', id: helperId, class: {
|
|
587
605
|
helper: true,
|
|
588
606
|
error: this.error,
|
|
589
607
|
disabled: this.disabled,
|
|
590
|
-
} }, this.error && h("tds-icon", { key: '
|
|
608
|
+
} }, this.error && h("tds-icon", { key: 'c2dd9ccb39957ef4cd2e9e0e0af3dbfdf531f20e', name: "error", size: "16px" }), this.helper))));
|
|
591
609
|
}
|
|
592
610
|
get host() { return this; }
|
|
593
611
|
static get watchers() { return {
|
|
@@ -628,7 +646,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
628
646
|
"close": [64],
|
|
629
647
|
"updateDisplay": [64],
|
|
630
648
|
"appendValue": [64]
|
|
631
|
-
}, [[9, "mousedown", "onAnyClick"], [0, "keydown", "onKeyDown"]], {
|
|
649
|
+
}, [[9, "mousedown", "onAnyClick"], [0, "focusin", "onFocusIn"], [0, "focusout", "onFocusOut"], [0, "keydown", "onKeyDown"]], {
|
|
632
650
|
"value": ["handleValueChange"],
|
|
633
651
|
"open": ["handleOpenState"],
|
|
634
652
|
"defaultValue": ["handleDefaultValueChange"]
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, d as createEvent, h } from './p-28ef5186.js';
|
|
2
|
+
import { h as hasSlot } from './p-ae110fc2.js';
|
|
3
|
+
import { g as generateUniqueId } from './p-11648030.js';
|
|
4
|
+
import { d as defineCustomElement$3 } from './p-b390ece5.js';
|
|
5
|
+
import { d as defineCustomElement$2 } from './p-d3866be7.js';
|
|
6
|
+
import { d as defineCustomElement$1 } from './p-40253725.js';
|
|
7
|
+
|
|
8
|
+
const textFieldCss = ".text-field-input-lg.sc-tds-text-field{all:unset;border-radius:4px 4px 0 0;width:100%;box-sizing:border-box;margin:0;border:none;outline:none;height:100%;color:var(--tds-text-field-color);background-color:var(--tds-text-field-background);font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);padding:var(--tds-spacing-element-20) var(--tds-spacing-element-16)}.text-field-input-lg.sc-tds-text-field::placeholder{color:var(--tds-text-field-placeholder)}.text-field-input-lg.sc-tds-text-field:disabled{user-select:none;pointer-events:none;background-color:var(--tds-text-field-background-disabled);color:var(--tds-text-field-color-disabled)}.text-field-input-lg.sc-tds-text-field:disabled::placeholder{color:var(--tds-text-field-placeholder-disabled)}.text-field-input-lg.sc-tds-text-field:disabled~.text-field-label-inside.sc-tds-text-field{color:var(--tds-text-field-label-disabled)}.text-field-input-md.sc-tds-text-field{all:unset;border-radius:4px 4px 0 0;width:100%;box-sizing:border-box;margin:0;border:none;outline:none;height:100%;color:var(--tds-text-field-color);background-color:var(--tds-text-field-background);font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);padding:var(--tds-spacing-element-16)}.text-field-input-md.sc-tds-text-field::placeholder{color:var(--tds-text-field-placeholder)}.text-field-input-md.sc-tds-text-field:disabled{user-select:none;pointer-events:none;background-color:var(--tds-text-field-background-disabled);color:var(--tds-text-field-color-disabled)}.text-field-input-md.sc-tds-text-field:disabled::placeholder{color:var(--tds-text-field-placeholder-disabled)}.text-field-input-md.sc-tds-text-field:disabled~.text-field-label-inside.sc-tds-text-field{color:var(--tds-text-field-label-disabled)}.text-field-input-sm.sc-tds-text-field{all:unset;border-radius:4px 4px 0 0;width:100%;box-sizing:border-box;margin:0;border:none;outline:none;height:100%;color:var(--tds-text-field-color);background-color:var(--tds-text-field-background);font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);padding:var(--tds-spacing-element-16)}.text-field-input-sm.sc-tds-text-field::placeholder{color:var(--tds-text-field-placeholder)}.text-field-input-sm.sc-tds-text-field:disabled{user-select:none;pointer-events:none;background-color:var(--tds-text-field-background-disabled);color:var(--tds-text-field-color-disabled)}.text-field-input-sm.sc-tds-text-field:disabled::placeholder{color:var(--tds-text-field-placeholder-disabled)}.text-field-input-sm.sc-tds-text-field:disabled~.text-field-label-inside.sc-tds-text-field{color:var(--tds-text-field-label-disabled)}.text-field-container.sc-tds-text-field{border-radius:4px 4px 0 0;display:flex;position:relative;height:56px;box-sizing:border-box;background-color:var(--tds-text-field-background);border-bottom:1px solid var(--tds-text-field-border-bottom);border-top:1px solid transparent;transition:border-bottom-color 200ms ease}.text-field-container.sc-tds-text-field:hover{border-bottom-color:var(--tds-text-field-border-bottom-hover)}.form-text-field-md.sc-tds-text-field .text-field-container.sc-tds-text-field{height:48px}.form-text-field-sm.sc-tds-text-field .text-field-container.sc-tds-text-field{height:40px}.text-field-container.sc-tds-text-field:focus-within{border:2px solid var(--tds-focus-outline-color);margin:0 -2px}.text-field-input-container.sc-tds-text-field{position:relative;width:100%}.text-field-data.sc-tds-text-field,.text-field-input.sc-tds-text-field{color:var(--tds-text-field-data-color)}.text-field-label-outside.sc-tds-text-field>*.sc-tds-text-field{font:var(--tds-detail-05);letter-spacing:var(--tds-detail-05-ls);display:block;margin-bottom:var(--tds-spacing-element-8);color:var(--tds-text-field-label-color)}.text-field-label-inside.sc-tds-text-field{font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);position:absolute;pointer-events:none;color:var(--tds-text-field-label-inside-color);left:16px}.form-text-field.sc-tds-text-field{display:block;min-width:208px}.form-text-field-nomin.sc-tds-text-field{min-width:auto}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-lg.sc-tds-text-field{padding-top:var(--tds-spacing-element-24);padding-bottom:15px}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-lg.sc-tds-text-field~.text-field-label-inside.sc-tds-text-field{top:20px}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-lg.sc-tds-text-field::placeholder{color:transparent}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-lg.sc-tds-text-field .sc-tds-text-field::placeholder{color:transparent}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-lg.sc-tds-text-field:focus::placeholder{transition:color 0.35s ease;color:var(--tds-text-field-placeholder)}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-md.sc-tds-text-field{padding-top:var(--tds-spacing-element-20);padding-bottom:11px}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-md.sc-tds-text-field~.text-field-label-inside.sc-tds-text-field{top:16px}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-md.sc-tds-text-field::placeholder{color:transparent}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-md.sc-tds-text-field .sc-tds-text-field::placeholder{color:transparent}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-md.sc-tds-text-field:focus::placeholder{transition:color 0.35s ease;color:var(--tds-text-field-placeholder)}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-sm.sc-tds-text-field{padding-top:var(--tds-spacing-element-20);padding-bottom:11px}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-sm.sc-tds-text-field~.text-field-label-inside.sc-tds-text-field{top:16px}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-sm.sc-tds-text-field::placeholder{color:transparent}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-sm.sc-tds-text-field .sc-tds-text-field::placeholder{color:transparent}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-sm.sc-tds-text-field:focus::placeholder{transition:color 0.35s ease;color:var(--tds-text-field-placeholder)}.form-text-field.text-field-container-label-inside.text-field-focus.sc-tds-text-field .text-field-input-sm.sc-tds-text-field~.text-field-label-inside.sc-tds-text-field,.form-text-field.text-field-container-label-inside.text-field-data.sc-tds-text-field .text-field-input-sm.sc-tds-text-field~.text-field-label-inside.sc-tds-text-field{font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls);transition:0.1s ease all;top:8px}.form-text-field.text-field-container-label-inside.text-field-focus.sc-tds-text-field .text-field-input-md.sc-tds-text-field~.text-field-label-inside.sc-tds-text-field,.form-text-field.text-field-container-label-inside.text-field-data.sc-tds-text-field .text-field-input-md.sc-tds-text-field~.text-field-label-inside.sc-tds-text-field{font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls);transition:0.1s ease all;top:8px}.form-text-field.text-field-container-label-inside.text-field-focus.sc-tds-text-field .text-field-input-lg.sc-tds-text-field~.text-field-label-inside.sc-tds-text-field,.form-text-field.text-field-container-label-inside.text-field-data.sc-tds-text-field .text-field-input-lg.sc-tds-text-field~.text-field-label-inside.sc-tds-text-field{font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls);transition:0.1s ease all;top:12px}.text-field-helper.sc-tds-text-field{font:var(--tds-detail-05);letter-spacing:var(--tds-detail-05-ls);display:flex;gap:8px;justify-content:space-between;flex-basis:100%;padding-top:var(--tds-spacing-element-4);color:var(--tds-text-field-helper)}.text-field-helper.sc-tds-text-field .text-field-textcounter.sc-tds-text-field{margin-left:auto}.form-text-field-disabled.sc-tds-text-field .text-field-container.sc-tds-text-field{cursor:not-allowed;border-bottom-color:transparent}.form-text-field-disabled.sc-tds-text-field .text-field-slot-wrap-prefix.sc-tds-text-field>*.sc-tds-text-field,.form-text-field-disabled.sc-tds-text-field .text-field-slot-wrap-suffix.sc-tds-text-field>*.sc-tds-text-field{color:var(--tds-text-field-ps-color-disabled)}.form-text-field-disabled.sc-tds-text-field .text-field-label-outside.sc-tds-text-field>*.sc-tds-text-field{color:var(--tds-text-field-label-disabled)}.form-text-field-disabled.sc-tds-text-field .text-field-helper.sc-tds-text-field{color:var(--tds-text-field-helper-disabled)}.text-field-icon__readonly.sc-tds-text-field{display:none;position:absolute;right:18px;top:50%;transform:translateY(-50%);color:var(--tds-text-field-icon-read-only-label-color)}.text-field-icon__readonly.sc-tds-text-field .tds-tooltip.sc-tds-text-field{min-width:150px}.form-text-field-readonly.sc-tds-text-field{user-select:auto;caret-color:transparent;cursor:default}.form-text-field-readonly.sc-tds-text-field .text-field-container.sc-tds-text-field{border-bottom-color:var(--tds-text-field-border-bottom-readonly)}.form-text-field-readonly.sc-tds-text-field .text-field-icon__readonly.sc-tds-text-field{display:block}.form-text-field-readonly.sc-tds-text-field .text-field-icon__readonly.sc-tds-text-field:hover~.text-field-icon__readonly-label.sc-tds-text-field{display:block}.form-text-field-readonly.sc-tds-text-field .text-field-input.sc-tds-text-field{background-color:transparent}.form-text-field-readonly.sc-tds-text-field:has(.text-field-icon__readonly) .text-field-input.sc-tds-text-field{padding-right:54px}.form-text-field-success.sc-tds-text-field:not(.form-text-field-readonly) .text-field-container.sc-tds-text-field{border-bottom-color:var(--tds-text-field-border-bottom-success)}.form-text-field-error.sc-tds-text-field:not(.form-text-field-readonly) .text-field-helper.sc-tds-text-field{color:var(--tds-text-field-helper-error)}.form-text-field-error.sc-tds-text-field:not(.form-text-field-readonly) .text-field-container.sc-tds-text-field{border-bottom-color:var(--tds-text-field-border-bottom-error)}.text-field-helper-error-state.sc-tds-text-field{display:flex;gap:8px;flex-wrap:nowrap}.text-field-textcounter-disabled.sc-tds-text-field{color:var(--tds-text-field-textcounter-disabled)}.text-field-textcounter.sc-tds-text-field{font:var(--tds-detail-05);letter-spacing:var(--tds-detail-05-ls);color:var(--tds-text-field-textcounter);float:right}.text-field-textcounter.text-field-textcounter-disabled.sc-tds-text-field{color:var(--tds-text-field-textcounter-disabled)}.text-field-textcounter.text-field-textcounter-divider.sc-tds-text-field{color:var(--tds-text-field-textcounter-divider)}.text-field-textcounter.text-field-textcounter-divider-disabled.sc-tds-text-field{color:var(--tds-text-field-textcounter-divider-disabled)}.text-field-slot-wrap-prefix.sc-tds-text-field,.text-field-slot-wrap-suffix.sc-tds-text-field{align-self:center;font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);margin:0 0 0 14px;color:var(--tds-text-field-ps-color)}.text-field-slot-wrap-prefix.sc-tds-text-field-s>:not(tds-icon),.text-field-slot-wrap-suffix.sc-tds-text-field-s>:not(tds-icon){margin:0 0 0 2px}.text-field-slot-wrap-prefix.text-field-error.sc-tds-text-field,.text-field-slot-wrap-suffix.text-field-error.sc-tds-text-field{color:var(--tds-text-field-ps-color-error)}.text-field-slot-wrap-suffix.sc-tds-text-field{margin:0 14px 0 0}.text-field-slot-wrap-suffix.sc-tds-text-field-s>:not(tds-icon){margin:0 2px 0 0}";
|
|
9
|
+
const TdsTextFieldStyle0 = textFieldCss;
|
|
10
|
+
|
|
11
|
+
const TdsTextField = /*@__PURE__*/ proxyCustomElement(class TdsTextField extends H {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this.__registerHost();
|
|
15
|
+
this.tdsChange = createEvent(this, "tdsChange", 6);
|
|
16
|
+
this.tdsInput = createEvent(this, "tdsInput", 6);
|
|
17
|
+
this.tdsFocus = createEvent(this, "tdsFocus", 6);
|
|
18
|
+
this.tdsBlur = createEvent(this, "tdsBlur", 6);
|
|
19
|
+
this.uuid = generateUniqueId();
|
|
20
|
+
this.type = 'text';
|
|
21
|
+
this.labelPosition = 'no-label';
|
|
22
|
+
this.label = '';
|
|
23
|
+
this.min = undefined;
|
|
24
|
+
this.max = undefined;
|
|
25
|
+
this.helper = undefined;
|
|
26
|
+
this.placeholder = '';
|
|
27
|
+
this.value = '';
|
|
28
|
+
this.disabled = false;
|
|
29
|
+
this.readOnly = false;
|
|
30
|
+
this.hideReadOnlyIcon = false;
|
|
31
|
+
this.size = 'lg';
|
|
32
|
+
this.modeVariant = null;
|
|
33
|
+
this.noMinWidth = false;
|
|
34
|
+
this.name = '';
|
|
35
|
+
this.state = 'default';
|
|
36
|
+
this.maxLength = undefined;
|
|
37
|
+
this.autofocus = false;
|
|
38
|
+
this.tdsAriaLabel = undefined;
|
|
39
|
+
this.focusInput = false;
|
|
40
|
+
}
|
|
41
|
+
handleChange(event) {
|
|
42
|
+
this.tdsChange.emit(event);
|
|
43
|
+
}
|
|
44
|
+
// Data input event in value prop
|
|
45
|
+
handleInput(event) {
|
|
46
|
+
const inputEl = event.target;
|
|
47
|
+
let { value } = inputEl;
|
|
48
|
+
// Custom handling of number inputs when min/max are set
|
|
49
|
+
if (this.type === 'number') {
|
|
50
|
+
const numericValue = Number(value);
|
|
51
|
+
if (this.min !== undefined && numericValue < Number(this.min)) {
|
|
52
|
+
value = String(this.min);
|
|
53
|
+
}
|
|
54
|
+
if (this.max !== undefined && numericValue > Number(this.max)) {
|
|
55
|
+
value = String(this.max);
|
|
56
|
+
}
|
|
57
|
+
inputEl.value = value;
|
|
58
|
+
}
|
|
59
|
+
this.value = value;
|
|
60
|
+
this.tdsInput.emit(event);
|
|
61
|
+
}
|
|
62
|
+
/** Set the input as focus when clicking the whole Text Field with suffix/prefix */
|
|
63
|
+
handleFocus(event) {
|
|
64
|
+
this.textInput.focus();
|
|
65
|
+
this.focusInput = true;
|
|
66
|
+
this.tdsFocus.emit(event);
|
|
67
|
+
}
|
|
68
|
+
/** Set the input as focus when clicking the whole Text Field with suffix/prefix */
|
|
69
|
+
handleBlur(event) {
|
|
70
|
+
this.focusInput = false;
|
|
71
|
+
this.tdsBlur.emit(event);
|
|
72
|
+
}
|
|
73
|
+
/** Method to handle focus */
|
|
74
|
+
async focusElement() {
|
|
75
|
+
if (this.textInput) {
|
|
76
|
+
this.textInput.focus();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
render() {
|
|
80
|
+
var _a;
|
|
81
|
+
const usesPrefixSlot = hasSlot('prefix', this.host);
|
|
82
|
+
const usesSuffixSlot = hasSlot('suffix', this.host);
|
|
83
|
+
return (h("div", { key: 'b9fa2b03ce2a0b196dc6083614420d6f83675e3d', class: {
|
|
84
|
+
'form-text-field': true,
|
|
85
|
+
'form-text-field-nomin': this.noMinWidth,
|
|
86
|
+
'text-field-focus': this.focusInput && !this.disabled,
|
|
87
|
+
'text-field-data': this.value !== '' && this.value !== null,
|
|
88
|
+
'text-field-container-label-inside': this.labelPosition === 'inside' && this.size !== 'sm',
|
|
89
|
+
'form-text-field-disabled': this.disabled,
|
|
90
|
+
'form-text-field-readonly': this.disabled ? false : this.readOnly,
|
|
91
|
+
'tds-mode-variant-primary': this.readOnly
|
|
92
|
+
? this.modeVariant === 'secondary'
|
|
93
|
+
: this.modeVariant === 'primary',
|
|
94
|
+
'tds-mode-variant-secondary': this.readOnly
|
|
95
|
+
? this.modeVariant === 'primary'
|
|
96
|
+
: this.modeVariant === 'secondary',
|
|
97
|
+
'form-text-field-md': this.size === 'md',
|
|
98
|
+
'form-text-field-sm': this.size === 'sm',
|
|
99
|
+
'form-text-field-error': this.state === 'error',
|
|
100
|
+
'form-text-field-success': this.state === 'success',
|
|
101
|
+
} }, this.labelPosition === 'outside' && (h("div", { key: '7110b867aba9a9ba62b796f67caeccf22a4a8060', class: "text-field-label-outside" }, h("label", { key: '6b0b6c7d17bb236f1203dfaf793ba0a3bc2d8efb', htmlFor: `text-field-input-element-${this.uuid}` }, this.label))), h("div", { key: '5603d3e78b290a78d7c482a0dac7e1f0efb9af7f', onClick: () => this.textInput.focus(), class: "text-field-container" }, usesPrefixSlot && (h("div", { key: '9accb59dffa061d7947d4392310cb1717a395363', class: {
|
|
102
|
+
'text-field-slot-wrap-prefix': true,
|
|
103
|
+
'text-field-error': this.state === 'error',
|
|
104
|
+
'text-field-success': this.state === 'success',
|
|
105
|
+
'text-field-default': this.state === 'default',
|
|
106
|
+
} }, h("slot", { key: '739e089cdb9798dc108b68c4858c90bf75e18958', name: "prefix" }))), h("div", { key: 'e4229be4e4bf421319184e798b98afcbaa361413', class: "text-field-input-container" }, h("input", { key: 'f462b4c0d49e4e070090f6a14df52af66b87648d', ref: (inputEl) => {
|
|
107
|
+
this.textInput = inputEl;
|
|
108
|
+
}, class: {
|
|
109
|
+
'text-field-input': true,
|
|
110
|
+
'text-field-input-sm': this.size === 'sm',
|
|
111
|
+
'text-field-input-md': this.size === 'md',
|
|
112
|
+
'text-field-input-lg': this.size === 'lg',
|
|
113
|
+
}, type: this.type, disabled: this.disabled, readonly: this.disabled ? false : this.readOnly, placeholder: this.placeholder, value: this.value, autofocus: this.autofocus, maxlength: this.maxLength, name: this.name, min: this.min, max: this.max, onInput: (event) => this.handleInput(event), onChange: (event) => this.handleChange(event), onFocus: (event) => {
|
|
114
|
+
if (!this.readOnly) {
|
|
115
|
+
this.handleFocus(event);
|
|
116
|
+
}
|
|
117
|
+
}, onBlur: (event) => {
|
|
118
|
+
if (!this.readOnly) {
|
|
119
|
+
this.handleBlur(event);
|
|
120
|
+
}
|
|
121
|
+
}, "aria-label": this.tdsAriaLabel ? this.tdsAriaLabel : this.label, "aria-describedby": `text-field-helper-element-${this.uuid}`, "aria-readonly": this.readOnly, id: `text-field-input-element-${this.uuid}` }), this.labelPosition === 'inside' && this.size !== 'sm' && (h("label", { key: 'ac16cff7856d65503fa30f7eb23d2936377e72d4', class: "text-field-label-inside", htmlFor: `text-field-input-element-${this.uuid}` }, this.label))), usesSuffixSlot && (h("div", { key: 'b70453ec36ca62f584b26b0e6dc4b3f0cde2ff54', class: {
|
|
122
|
+
'text-field-slot-wrap-suffix': true,
|
|
123
|
+
'text-field-error': this.state === 'error',
|
|
124
|
+
'text-field-success': this.state === 'success',
|
|
125
|
+
'text-field-default': this.state === 'default',
|
|
126
|
+
'tds-u-display-none': this.readOnly,
|
|
127
|
+
} }, h("slot", { key: '7e50b20d90a68f9af583b8f2ade5c742e2d52351', name: "suffix" }))), this.readOnly && !this.hideReadOnlyIcon && (h("span", { key: '72e2cf4f2872d247ac6f28e935e8185aafef6dec', class: "text-field-icon__readonly" }, h("tds-tooltip", { key: '171bdde8535c6bbd08eec60d87d9aa5bae1f98bd', placement: "top-end", text: "This field is non-editable", selector: "#readonly-tooltip" }), h("tds-icon", { key: '05e7e8898ee3fcf81fb011aa2141092e8b749e37', id: "readonly-tooltip", name: "edit_inactive", size: "20px" })))), h("div", { key: '0c16d399b376d9aebed2aabf759cb7319c5745cf', "aria-live": "assertive" }, (this.helper || this.maxLength > 0) && (h("div", { key: '280eed9185c8cffa29e3cf62425f1f1f377f3abc', class: "text-field-helper", id: `text-field-helper-element-${this.uuid}` }, this.state === 'error' && (h("div", { key: 'ddf07e469173a574a848cd2ff816bcc535940340', class: "text-field-helper-error-state" }, !this.readOnly && h("tds-icon", { key: 'b5b06dba13fb8911828153341b631facfc016c88', name: "error", size: "16px" }), this.helper)), this.state !== 'error' && this.helper, !this.readOnly && this.maxLength > 0 && (h("span", { key: 'a4c41817f19b32e575423d5bbe19c28a38031e6e', class: {
|
|
128
|
+
'text-field-textcounter-divider': true,
|
|
129
|
+
'text-field-textcounter-disabled': this.disabled,
|
|
130
|
+
} }, this.value === null ? 0 : (_a = this.value) === null || _a === void 0 ? void 0 : _a.length, " / ", this.maxLength)))))));
|
|
131
|
+
}
|
|
132
|
+
get host() { return this; }
|
|
133
|
+
static get style() { return TdsTextFieldStyle0; }
|
|
134
|
+
}, [6, "tds-text-field", {
|
|
135
|
+
"type": [513],
|
|
136
|
+
"labelPosition": [1, "label-position"],
|
|
137
|
+
"label": [1],
|
|
138
|
+
"min": [8],
|
|
139
|
+
"max": [8],
|
|
140
|
+
"helper": [1],
|
|
141
|
+
"placeholder": [1],
|
|
142
|
+
"value": [513],
|
|
143
|
+
"disabled": [4],
|
|
144
|
+
"readOnly": [4, "read-only"],
|
|
145
|
+
"hideReadOnlyIcon": [4, "hide-read-only-icon"],
|
|
146
|
+
"size": [1],
|
|
147
|
+
"modeVariant": [1, "mode-variant"],
|
|
148
|
+
"noMinWidth": [4, "no-min-width"],
|
|
149
|
+
"name": [1],
|
|
150
|
+
"state": [1],
|
|
151
|
+
"maxLength": [2, "max-length"],
|
|
152
|
+
"autofocus": [4],
|
|
153
|
+
"tdsAriaLabel": [1, "tds-aria-label"],
|
|
154
|
+
"focusInput": [32],
|
|
155
|
+
"focusElement": [64]
|
|
156
|
+
}]);
|
|
157
|
+
function defineCustomElement() {
|
|
158
|
+
if (typeof customElements === "undefined") {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const components = ["tds-text-field", "tds-icon", "tds-popover-core", "tds-tooltip"];
|
|
162
|
+
components.forEach(tagName => { switch (tagName) {
|
|
163
|
+
case "tds-text-field":
|
|
164
|
+
if (!customElements.get(tagName)) {
|
|
165
|
+
customElements.define(tagName, TdsTextField);
|
|
166
|
+
}
|
|
167
|
+
break;
|
|
168
|
+
case "tds-icon":
|
|
169
|
+
if (!customElements.get(tagName)) {
|
|
170
|
+
defineCustomElement$3();
|
|
171
|
+
}
|
|
172
|
+
break;
|
|
173
|
+
case "tds-popover-core":
|
|
174
|
+
if (!customElements.get(tagName)) {
|
|
175
|
+
defineCustomElement$2();
|
|
176
|
+
}
|
|
177
|
+
break;
|
|
178
|
+
case "tds-tooltip":
|
|
179
|
+
if (!customElements.get(tagName)) {
|
|
180
|
+
defineCustomElement$1();
|
|
181
|
+
}
|
|
182
|
+
break;
|
|
183
|
+
} });
|
|
184
|
+
}
|
|
185
|
+
defineCustomElement();
|
|
186
|
+
|
|
187
|
+
export { TdsTextField as T, defineCustomElement as d };
|
|
@@ -2,7 +2,7 @@ import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
|
|
|
2
2
|
import { d as dfs } from './p-52bf0fdf.js';
|
|
3
3
|
import { d as defineCustomElement$1 } from './p-9ad61cb5.js';
|
|
4
4
|
|
|
5
|
-
const headerItemCss = ":host ::slotted(button),:host ::slotted(a){all:unset;box-sizing:border-box;background-color:var(--tds-header-background);border-right:1px solid var(--tds-header--basic-element-border);width:100%;height:100%;cursor:pointer;padding:0 24px;display:flex;align-items:center;gap:8px}:host ::slotted(button) *,:host ::slotted(a) *{box-sizing:border-box}:host ::slotted(button:hover),:host ::slotted(a:hover){background-color:var(--tds-header-item-hover)}:host ::slotted(button:focus-visible),:host ::slotted(a:focus-visible){outline:2px solid var(--tds-focus-outline-color);box-shadow:0 0 0
|
|
5
|
+
const headerItemCss = ":host ::slotted(button),:host ::slotted(a){all:unset;box-sizing:border-box;background-color:var(--tds-header-background);border-right:1px solid var(--tds-header--basic-element-border);width:100%;height:100%;cursor:pointer;padding:0 24px;display:flex;align-items:center;gap:8px}:host ::slotted(button) *,:host ::slotted(a) *{box-sizing:border-box}:host ::slotted(button:hover),:host ::slotted(a:hover){background-color:var(--tds-header-item-hover)}:host ::slotted(button:focus-visible),:host ::slotted(a:focus-visible){border:none;outline:2px solid var(--tds-focus-outline-color);box-shadow:inset 0 0 0 3px var(--tds-white);outline-offset:-2px}:host .component-active ::slotted(button),:host .component-active ::slotted(a){background-color:var(--tds-header--basic-element-background-open);color:var(--tds-header-nav-item-dropdown-opened-color);border-color:var(--tds-header--basic-element-border-open)}:host .component-selected:not(.component-active) ::slotted(button),:host .component-selected:not(.component-active) ::slotted(a){background-color:var(--tds-header--basic-element-background-selected);padding-top:4px;border-bottom-style:solid;border-bottom-width:4px;border-bottom-color:var(--tds-nav-item-border-color-active)}";
|
|
6
6
|
const TdsHeaderItemStyle0 = headerItemCss;
|
|
7
7
|
|
|
8
8
|
const TdsHeaderItem = /*@__PURE__*/ proxyCustomElement(class TdsHeaderItem extends H {
|
|
@@ -66,10 +66,18 @@ const TdsDropdownOption = /*@__PURE__*/ proxyCustomElement(class TdsDropdownOpti
|
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
this.handleFocus = (event) => {
|
|
69
|
-
|
|
69
|
+
// Focus events are now handled by the parent dropdown component
|
|
70
|
+
// Only emit if this is a standalone option (not within a dropdown)
|
|
71
|
+
if (!this.parentElement) {
|
|
72
|
+
this.tdsFocus.emit(event);
|
|
73
|
+
}
|
|
70
74
|
};
|
|
71
75
|
this.handleBlur = (event) => {
|
|
72
|
-
|
|
76
|
+
// Blur events are now handled by the parent dropdown component
|
|
77
|
+
// Only emit if this is a standalone option (not within a dropdown)
|
|
78
|
+
if (!this.parentElement) {
|
|
79
|
+
this.tdsBlur.emit(event);
|
|
80
|
+
}
|
|
73
81
|
};
|
|
74
82
|
this.value = undefined;
|
|
75
83
|
this.internalValue = undefined;
|
|
@@ -90,7 +98,7 @@ const TdsDropdownOption = /*@__PURE__*/ proxyCustomElement(class TdsDropdownOpti
|
|
|
90
98
|
this.internalValue = convertToString(this.value);
|
|
91
99
|
}
|
|
92
100
|
render() {
|
|
93
|
-
return (h(Host, { key: '
|
|
101
|
+
return (h(Host, { key: '5448be3efbb06ae6d0fa3797f4b724c2d656d7a3' }, h("div", { key: '78945300c0bddb4ce95ab6f8de50eded1383dec7', class: `dropdown-option
|
|
94
102
|
${this.size}
|
|
95
103
|
${this.selected ? 'selected' : ''}
|
|
96
104
|
${this.disabled ? 'disabled' : ''}
|
|
@@ -100,6 +108,8 @@ const TdsDropdownOption = /*@__PURE__*/ proxyCustomElement(class TdsDropdownOpti
|
|
|
100
108
|
}
|
|
101
109
|
} }, h("tds-checkbox", { onTdsChange: (event) => {
|
|
102
110
|
this.handleMultiselect(event);
|
|
111
|
+
}, onTdsBlur: (event) => {
|
|
112
|
+
event.stopPropagation();
|
|
103
113
|
}, disabled: this.disabled, checked: this.selected, tdsAriaLabel: this.tdsAriaLabel, class: {
|
|
104
114
|
[this.size]: true,
|
|
105
115
|
} }, h("div", { slot: "label" }, h("slot", null))))) : (h("button", { role: "option", "aria-disabled": this.disabled, "aria-selected": this.selected, "aria-label": this.tdsAriaLabel, onClick: () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TdsDropdownOption$1, d as defineCustomElement$1 } from './p-
|
|
1
|
+
import { T as TdsDropdownOption$1, d as defineCustomElement$1 } from './p-c4318e35.js';
|
|
2
2
|
|
|
3
3
|
const TdsDropdownOption = TdsDropdownOption$1;
|
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
|
|
2
2
|
|
|
3
|
-
const folderTabCss = ":host{box-sizing:border-box;position:relative}:host *{box-sizing:border-box}:host ::slotted(*){all:unset;min-width:142px;display:block;width:calc(100% - 32px);font:var(--tds-headline-07) !important;letter-spacing:var(--tds-headline-07-ls) !important;cursor:pointer;padding:16px;white-space:nowrap;text-decoration:none;text-align:left;outline:none;border:none
|
|
3
|
+
const folderTabCss = ":host{box-sizing:border-box;position:relative}:host *{box-sizing:border-box}:host ::slotted(*){all:unset;min-width:142px;display:block;width:calc(100% - 32px);font:var(--tds-headline-07) !important;letter-spacing:var(--tds-headline-07-ls) !important;cursor:pointer;padding:16px;white-space:nowrap;text-decoration:none;text-align:left;outline:none;border:none}:host ::slotted(*:focus-within)::before{outline:2px solid var(--tds-focus-outline-color);box-shadow:0 0 0 1px var(--tds-white);outline-offset:1px;z-index:1;content:\"\";position:absolute;top:3px;bottom:3px;left:3px;right:3px}:host div:not(.selected){background-color:var(--tds-folder-tab-background);position:relative}:host div:not(.selected)::before{content:\"\";position:absolute;left:0;top:0;bottom:0;width:1px;background-color:var(--tds-folder-tab-divider-color)}:host div:not(.selected) ::slotted(*){border-top:2px solid transparent;color:var(--tds-folder-tab-item-color)}:host div:not(.selected):hover:not(.disabled){background-color:var(--tds-folder-tab-background-hover);cursor:pointer}:host div:not(.selected):hover:not(.disabled) ::slotted(*){border-top:2px solid var(--tds-folder-tab-top-border-hover);color:var(--tds-folder-tab-color)}:host div:not(.selected).disabled{background-color:var(--tds-folder-tab-item-background-disabled)}:host div:not(.selected).disabled ::slotted(*){color:var(--tds-folder-tab-item-color-disabled)}:host div:not(.selected).disabled ::slotted(*:focus-visible){outline:none}:host div:not(.selected).disabled ::slotted(*:hover){cursor:not-allowed}:host div:not(.selected).disabled ::slotted(*::after){content:none}:host .selected{background-color:var(--tds-folder-tab-background-selected);border-top:2px solid var(--tds-folder-tab-border-selected)}:host .selected::after{content:\" \";background-color:var(--tds-folder-tab-divider-color);width:1px;top:0;bottom:0;right:-1px;display:block;position:absolute;z-index:1}:host .selected ::slotted(*){color:var(--tds-folder-tab-color)}:host .selected:hover:not(.disabled){background-color:var(--tds-folder-tab-background-hover);cursor:pointer}:host .selected:hover:not(.disabled) ::slotted(*){color:var(--tds-folder-tab-color)}:host(.first) ::slotted(*){border-left-color:transparent}:host(.first) .selected{border-left:none}";
|
|
4
4
|
const TdsFolderTabStyle0 = folderTabCss;
|
|
5
5
|
|
|
6
6
|
const TdsFolderTab$1 = /*@__PURE__*/ proxyCustomElement(class TdsFolderTab extends H {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, d as createEvent, h, c as Host } from './p-28ef5186.js';
|
|
2
2
|
import { d as defineCustomElement$2 } from './p-b390ece5.js';
|
|
3
3
|
|
|
4
|
-
const folderTabsCss = ":host{box-sizing:border-box;overflow:hidden;outline:0}:host *{box-sizing:border-box}:host .wrapper{display:flex;overflow-x:scroll;scrollbar-width:none;position:relative}:host .wrapper::-webkit-scrollbar{display:none}:host .scroll-right-button{z-index:1;right:0}:host .scroll-left-button{z-index:1;left:0}:host .scroll-right-button,:host .scroll-left-button{height:50px;color:var(--tds-folder-tabs-scroll-btn-color);cursor:pointer;border:0;width:0;background-color:var(--tds-folder-tabs-scroll-btn-background);display:none;justify-content:center;align-items:center;opacity:0;pointer-events:none;position:sticky}:host .scroll-right-button.show,:host .scroll-left-button.show{min-width:48px;display:block;opacity:1;pointer-events:all}:host .scroll-right-button:hover,:host .scroll-left-button:hover{background-color:var(--tds-folder-tabs-scroll-btn-background-hover)}:host .scroll-right-button:active,:host .scroll-left-button:active{background-color:var(--tds-folder-tabs-scroll-btn-background-active)}:host .scroll-right-button:focus,:host .scroll-left-button:focus{outline:2px solid var(--tds-focus-outline-color);box-shadow:0 0 0 1px var(--tds-white);outline-offset:1px;z-index:1}:host .scroll-right-button svg,:host .scroll-left-button svg{fill:var(--tds-folder-tabs-scroll-btn-color)}";
|
|
4
|
+
const folderTabsCss = ":host{box-sizing:border-box;overflow:hidden;outline:0}:host *{box-sizing:border-box}:host .wrapper{display:flex;overflow-x:scroll;scrollbar-width:none;position:relative}:host .wrapper::-webkit-scrollbar{display:none}:host .scroll-right-button{z-index:1;right:0}:host .scroll-left-button{z-index:1;left:0}:host .scroll-right-button,:host .scroll-left-button{height:50px;color:var(--tds-folder-tabs-scroll-btn-color);cursor:pointer;border:0;width:0;background-color:var(--tds-folder-tabs-scroll-btn-background);display:none;justify-content:center;align-items:center;opacity:0;pointer-events:none;position:sticky}:host .scroll-right-button.show,:host .scroll-left-button.show{min-width:48px;display:block;opacity:1;pointer-events:all}:host .scroll-right-button:hover,:host .scroll-left-button:hover{background-color:var(--tds-folder-tabs-scroll-btn-background-hover)}:host .scroll-right-button:active,:host .scroll-left-button:active{background-color:var(--tds-folder-tabs-scroll-btn-background-active)}:host .scroll-right-button:focus-within::before,:host .scroll-left-button:focus-within::before{outline:2px solid var(--tds-focus-outline-color);box-shadow:0 0 0 1px var(--tds-white);outline-offset:1px;z-index:1;content:\"\";position:absolute;top:3px;bottom:3px;left:3px;right:3px}:host .scroll-right-button:focus,:host .scroll-left-button:focus{outline:0}:host .scroll-right-button svg,:host .scroll-left-button svg{fill:var(--tds-folder-tabs-scroll-btn-color)}";
|
|
5
5
|
const TdsFolderTabsStyle0 = folderTabsCss;
|
|
6
6
|
|
|
7
7
|
const TdsFolderTabs$1 = /*@__PURE__*/ proxyCustomElement(class TdsFolderTabs extends H {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
|
|
2
2
|
import { d as defineCustomElement$3 } from './p-9ad61cb5.js';
|
|
3
|
-
import { d as defineCustomElement$2 } from './p-
|
|
3
|
+
import { d as defineCustomElement$2 } from './p-ad6babcd.js';
|
|
4
4
|
|
|
5
5
|
const headerBrandSymbolCss = ":host tds-header-item{display:none}:host tds-header-item ::slotted(*){background-image:var(--tds-background-image-scania-symbol-svg-local), var(--tds-background-image-scania-symbol-svg);background-size:30px auto;background-position:center;background-repeat:no-repeat}@media (min-width: 992px){:host tds-header-item{display:block}}";
|
|
6
6
|
const TdsHeaderBrandSymbolStyle0 = headerBrandSymbolCss;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
|
|
2
2
|
import { g as generateUniqueId } from './p-11648030.js';
|
|
3
3
|
import { d as defineCustomElement$6 } from './p-9ad61cb5.js';
|
|
4
|
-
import { d as defineCustomElement$5 } from './p-
|
|
4
|
+
import { d as defineCustomElement$5 } from './p-ad6babcd.js';
|
|
5
5
|
import { d as defineCustomElement$4 } from './p-b390ece5.js';
|
|
6
6
|
import { d as defineCustomElement$3 } from './p-df84759a.js';
|
|
7
7
|
import { d as defineCustomElement$2 } from './p-d3866be7.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
|
|
2
2
|
import { i as inheritAriaAttributes } from './p-0bd4c19c.js';
|
|
3
3
|
import { d as defineCustomElement$4 } from './p-9ad61cb5.js';
|
|
4
|
-
import { d as defineCustomElement$3 } from './p-
|
|
4
|
+
import { d as defineCustomElement$3 } from './p-ad6babcd.js';
|
|
5
5
|
import { d as defineCustomElement$2 } from './p-b390ece5.js';
|
|
6
6
|
|
|
7
7
|
const headerHamburgerCss = ":host{color:var(--tds-white)}:host tds-header-item{display:block}:host .icon{position:relative;margin-left:-6px;left:3px;transition:background 0.2s ease-in-out, color 0.2s ease-in-out}@media screen and (min-width: 992px){:host tds-header-item{display:none}:host([persistent]) tds-header-item{display:block}}";
|