@scania/tegel 1.23.0-value-prop.beta.3 → 1.23.0-value-prop.beta.4

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.
Files changed (31) hide show
  1. package/dist/cjs/tds-block.cjs.entry.js +17 -13
  2. package/dist/cjs/tds-dropdown_2.cjs.entry.js +7 -5
  3. package/dist/cjs/tds-popover-core.cjs.entry.js +1 -1
  4. package/dist/collection/components/block/block.css +11 -5
  5. package/dist/collection/components/block/block.js +16 -12
  6. package/dist/collection/components/dropdown/dropdown.js +7 -5
  7. package/dist/collection/components/popover-core/tds-popover-core.css +18 -16
  8. package/dist/components/{p-a7a89410.js → p-5e1a9abc.js} +1 -1
  9. package/dist/components/{p-5eaae628.js → p-aea7fa6b.js} +1 -1
  10. package/dist/components/{p-aa12ddb9.js → p-d8c96665.js} +7 -5
  11. package/dist/components/tds-block.js +17 -13
  12. package/dist/components/tds-dropdown.js +1 -1
  13. package/dist/components/tds-header-dropdown.js +2 -2
  14. package/dist/components/tds-header-launcher.js +2 -2
  15. package/dist/components/tds-popover-canvas.js +1 -1
  16. package/dist/components/tds-popover-core.js +1 -1
  17. package/dist/components/tds-popover-menu.js +1 -1
  18. package/dist/components/tds-table-footer.js +1 -1
  19. package/dist/components/tds-tooltip.js +1 -1
  20. package/dist/esm/tds-block.entry.js +17 -13
  21. package/dist/esm/tds-dropdown_2.entry.js +7 -5
  22. package/dist/esm/tds-popover-core.entry.js +1 -1
  23. package/dist/tegel/{p-370f899b.entry.js → p-4e3e2601.entry.js} +1 -1
  24. package/dist/tegel/p-5bc85f3e.entry.js +1 -0
  25. package/dist/tegel/p-9aefb942.entry.js +1 -0
  26. package/dist/tegel/tegel.css +1 -1
  27. package/dist/tegel/tegel.esm.js +1 -1
  28. package/dist/types/components/block/block.d.ts +1 -2
  29. package/package.json +1 -1
  30. package/dist/tegel/p-be8d494d.entry.js +0 -1
  31. package/dist/tegel/p-db00f607.entry.js +0 -1
@@ -1,6 +1,6 @@
1
1
  import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
2
2
  import { i as inheritAttributes } from './p-3fe9cbbf.js';
3
- import { d as defineCustomElement$1 } from './p-a7a89410.js';
3
+ import { d as defineCustomElement$1 } from './p-5e1a9abc.js';
4
4
 
5
5
  const popoverCanvasCss = ".tds-popover-canvas.sc-tds-popover-canvas{box-sizing:border-box;display:inline-block;color:var(--tds-popover-canvas-color);background-color:var(--tds-popover-canvas-background);box-shadow:0 3px 3px rgba(0, 0, 0, 0.15), 0 -1px 1px rgba(0, 0, 0, 0.1);border-radius:4px;z-index:900}.tds-popover-canvas.sc-tds-popover-canvas *.sc-tds-popover-canvas{box-sizing:border-box}";
6
6
  const TdsPopoverCanvasStyle0 = popoverCanvasCss;
@@ -174,8 +174,10 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
174
174
  this.handleFilterReset = () => {
175
175
  this.reset();
176
176
  this.inputElement.value = '';
177
- this.handleFilter({ target: { value: this.inputElement.value } });
177
+ this.handleFilter({ target: { value: '' } });
178
178
  this.inputElement.focus();
179
+ // Add this line to ensure internal value is cleared
180
+ this.internalValue = '';
179
181
  };
180
182
  this.handleFocus = (event) => {
181
183
  this.open = true;
@@ -352,7 +354,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
352
354
  handleOpenState() {
353
355
  if (this.filter && this.multiselect) {
354
356
  if (!this.open) {
355
- this.inputElement.value = this.getValue();
357
+ this.inputElement.value = this.selectedOptions.length ? this.getValue() : '';
356
358
  }
357
359
  }
358
360
  }
@@ -392,7 +394,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
392
394
  }
393
395
  render() {
394
396
  appendHiddenInput(this.host, this.name, this.selectedOptions.join(','), this.disabled);
395
- return (h(Host, { key: 'b80b938a7e06df4883e939cf9cf06cbb5d2dc12b', role: "select", class: `${this.modeVariant ? `tds-mode-variant-${this.modeVariant}` : ''}` }, this.label && this.labelPosition === 'outside' && (h("div", { key: '75172f55ac3adc34a050bbeba543165b6c6ec445', class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: 'd0498b07c2446b7ccde5bd09a95157454ffc2331', class: `dropdown-select ${this.size} ${this.disabled ? 'disabled' : ''}` }, this.filter ? (h("div", { class: {
397
+ return (h(Host, { key: '198e38f89945016a0305584262b751053a00ac2e', role: "select", class: `${this.modeVariant ? `tds-mode-variant-${this.modeVariant}` : ''}` }, this.label && this.labelPosition === 'outside' && (h("div", { key: 'f785bd85282f653e9da367ced8aac22b62061b6d', class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: '9a93fa9b9c343bb748de3324cf3fda0839d24b5b', class: `dropdown-select ${this.size} ${this.disabled ? 'disabled' : ''}` }, this.filter ? (h("div", { class: {
396
398
  filter: true,
397
399
  focus: this.filterFocus,
398
400
  disabled: this.disabled,
@@ -434,7 +436,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
434
436
  label-inside-as-placeholder
435
437
  ${this.size}
436
438
  ${this.selectedOptions.length ? 'selected' : ''}
437
- ` }, 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: '999a08cee6035f37217270681b58411badc1596d', ref: (element) => (this.dropdownList = element), class: {
439
+ ` }, 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: '38ea3153aa17144d03c3472600f7c22b9e7d1ee8', ref: (element) => (this.dropdownList = element), class: {
438
440
  'dropdown-list': true,
439
441
  [this.size]: true,
440
442
  [this.getOpenDirection()]: true,
@@ -443,7 +445,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
443
445
  'closed': !this.open,
444
446
  [`animation-enter-${this.animation}`]: this.animation !== 'none' && this.open,
445
447
  [`animation-exit-${this.animation}`]: this.animation !== 'none' && !this.open,
446
- } }, h("slot", { key: 'f6e55be5581a1b5a24da4643508c4fe76767c9c7', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: '6184dce7e827ee6c2c0403e8531ea8ac782e3073', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: '33bd5d3695247cfaaa66bb67b6ac6a5ced795c72', class: `helper ${this.error ? 'error' : ''} ${this.disabled ? 'disabled' : ''}` }, this.error && h("tds-icon", { key: '6f3681a038fc95bb90e7877c54eff0b4c807b877', name: "error", size: "16px" }), this.helper))));
448
+ } }, h("slot", { key: 'dfe65bc02f12a01b4ef4d710c3e8fabe68d36530', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: '5d4d52a9dc9a1ac4c35ae62a2543c15d8f252a08', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: 'f48a3d2320ebe64c439127898eb4540ccd21b421', class: `helper ${this.error ? 'error' : ''} ${this.disabled ? 'disabled' : ''}` }, this.error && h("tds-icon", { key: 'ca396e64d54c1f4fe95b0407eab80e78a7249c43', name: "error", size: "16px" }), this.helper))));
447
449
  }
448
450
  get host() { return this; }
449
451
  static get watchers() { return {
@@ -1,6 +1,6 @@
1
1
  import { p as proxyCustomElement, H, h } from './p-28ef5186.js';
2
2
 
3
- const blockCss = ".tds-block{box-sizing:border-box;color:var(--tds-block-color);border-radius:4px;padding:16px;font:var(--tds-body-01);letter-spacing:var(--tds-body-01-ls);background-color:var(--tds-block-background)}.tds-block *{box-sizing:border-box}.tds-mode-variant-primary{--tds-block-background:var(--tds-block-background-primary);--tds-block-background-nested:var(--tds-block-background-nested-primary)}.tds-mode-variant-secondary{--tds-block-background:var(--tds-block-background-secondary);--tds-block-background-nested:var(--tds-block-background-nested-secondary)}";
3
+ const blockCss = ".tds-block{box-sizing:border-box;color:var(--tds-block-color);background-color:var(--tds-block-background);border-radius:4px;padding:16px;font:var(--tds-body-01);letter-spacing:var(--tds-body-01-ls)}.tds-block *{box-sizing:border-box}.tds-mode-variant-primary{background-color:var(--tds-block-background-primary)}.tds-mode-variant-secondary{background-color:var(--tds-block-background-secondary)}.tds-block-even{background-color:var(--tds-block-background-even)}.tds-block-odd{background-color:var(--tds-block-background-odd)}";
4
4
  const TdsBlockStyle0 = blockCss;
5
5
 
6
6
  const TdsBlock$1 = /*@__PURE__*/ proxyCustomElement(class TdsBlock extends H {
@@ -10,21 +10,25 @@ const TdsBlock$1 = /*@__PURE__*/ proxyCustomElement(class TdsBlock extends H {
10
10
  this.__attachShadow();
11
11
  this.modeVariant = null;
12
12
  }
13
- setModeVariantOnChildBlocks() {
14
- var _a;
15
- this.children = Array.from(this.host.children).filter((item) => item.tagName === 'TDS-BLOCK');
16
- (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach((item) => {
17
- if (!this.modeVariant) {
18
- item.setAttribute('mode-variant', 'secondary');
13
+ getNestingLevel() {
14
+ let level = 0;
15
+ let parent = this.host.parentElement;
16
+ while (parent) {
17
+ if (parent.tagName.toLowerCase() === 'tds-block') {
18
+ level++;
19
19
  }
20
- else {
21
- item.setAttribute('mode-variant', this.modeVariant === 'primary' ? 'secondary' : 'primary');
22
- }
23
- });
20
+ parent = parent.parentElement;
21
+ }
22
+ return level;
24
23
  }
25
24
  render() {
26
- this.setModeVariantOnChildBlocks();
27
- return (h("div", { key: 'a40067afde48258475108cb9785555e7c2bd0a47', class: `tds-block ${this.modeVariant !== null ? `tds-mode-variant-${this.modeVariant}` : ''}` }, h("slot", { key: 'aaf62c59a3a01a0c41a594c15257e4746a049418' })));
25
+ const nestingLevel = this.getNestingLevel();
26
+ const evenOddClass = this.modeVariant === null
27
+ ? nestingLevel % 2 === 0
28
+ ? 'tds-block-even'
29
+ : 'tds-block-odd'
30
+ : '';
31
+ return (h("div", { key: '5f22f1b8ae254a577a151563deadd969e90e3d20', class: `tds-block ${evenOddClass} ${this.modeVariant !== null ? `tds-mode-variant-${this.modeVariant}` : ''}` }, h("slot", { key: '52367d3055296ebd2b6e8291786554f34253750f' })));
28
32
  }
29
33
  get host() { return this; }
30
34
  static get style() { return TdsBlockStyle0; }
@@ -1,4 +1,4 @@
1
- import { T as TdsDropdown$1, d as defineCustomElement$1 } from './p-aa12ddb9.js';
1
+ import { T as TdsDropdown$1, d as defineCustomElement$1 } from './p-d8c96665.js';
2
2
 
3
3
  const TdsDropdown = TdsDropdown$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -3,8 +3,8 @@ import { g as generateUniqueId } from './p-11648030.js';
3
3
  import { d as defineCustomElement$6 } from './p-30de8ac4.js';
4
4
  import { d as defineCustomElement$5 } from './p-0676aa23.js';
5
5
  import { d as defineCustomElement$4 } from './p-18c1245b.js';
6
- import { d as defineCustomElement$3 } from './p-5eaae628.js';
7
- import { d as defineCustomElement$2 } from './p-a7a89410.js';
6
+ import { d as defineCustomElement$3 } from './p-aea7fa6b.js';
7
+ import { d as defineCustomElement$2 } from './p-5e1a9abc.js';
8
8
 
9
9
  const headerDropdownCss = ":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{height:var(--tds-header-height);position:relative}:host .menu{flex-direction:column;overflow-y:auto;max-height:calc(100vh - var(--tds-header-height));box-shadow:var(--tds-nav-dropdown-menu-box);background-color:var(--tds-header-app-launcher-menu-background);border-top-right-radius:0;border-top-left-radius:0}:host .menu: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 .menu::-webkit-scrollbar{width:var(--tds-scrollbar-width)}:host .menu::-webkit-scrollbar-track{background:var(--tds-scrollbar-track-color)}:host .menu::-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 .menu::-webkit-scrollbar-button{height:0;width:0}@supports not selector(::-webkit-scrollbar){:host .menu{scrollbar-color:var(--tds-scrollbar-thumb-color) var(--tds-scrollbar-track-color);scrollbar-width:var(--tds-scrollbar-width-standard)}}:host .state-open .dropdown-icon{transform:rotate(180deg)}:host .state-open .button{position:relative;z-index:901}";
10
10
  const TdsHeaderDropdownStyle0 = headerDropdownCss;
@@ -5,8 +5,8 @@ import { d as defineCustomElement$7 } from './p-30de8ac4.js';
5
5
  import { d as defineCustomElement$6 } from './p-0676aa23.js';
6
6
  import { d as defineCustomElement$5 } from './p-c48c68b3.js';
7
7
  import { d as defineCustomElement$4 } from './p-18c1245b.js';
8
- import { d as defineCustomElement$3 } from './p-5eaae628.js';
9
- import { d as defineCustomElement$2 } from './p-a7a89410.js';
8
+ import { d as defineCustomElement$3 } from './p-aea7fa6b.js';
9
+ import { d as defineCustomElement$2 } from './p-5e1a9abc.js';
10
10
 
11
11
  const headerLauncherCss = ":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 .wrapper{height:var(--tds-header-height);position:relative}:host .wrapper .menu{flex-direction:column;overflow-y:auto;max-height:calc(100vh - var(--tds-header-height));box-shadow:var(--tds-nav-dropdown-menu-box);background-color:var(--tds-header-app-launcher-menu-background);border-radius:0}:host .wrapper .menu: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 .wrapper .menu::-webkit-scrollbar{width:var(--tds-scrollbar-width)}:host .wrapper .menu::-webkit-scrollbar-track{background:var(--tds-scrollbar-track-color)}:host .wrapper .menu::-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 .wrapper .menu::-webkit-scrollbar-button{height:0;width:0}@supports not selector(::-webkit-scrollbar){:host .wrapper .menu{scrollbar-color:var(--tds-scrollbar-thumb-color) var(--tds-scrollbar-track-color);scrollbar-width:var(--tds-scrollbar-width-standard)}}@media all and (max-width: 384px){:host .wrapper .menu{width:100vw}}:host .wrapper.state-list-type-menu .menu{height:calc(100vh - var(--tds-header-height))}:host .wrapper.state-open .button{position:relative;z-index:901}";
12
12
  const TdsHeaderLauncherStyle0 = headerLauncherCss;
@@ -1,4 +1,4 @@
1
- import { T as TdsPopoverCanvas$1, d as defineCustomElement$1 } from './p-5eaae628.js';
1
+ import { T as TdsPopoverCanvas$1, d as defineCustomElement$1 } from './p-aea7fa6b.js';
2
2
 
3
3
  const TdsPopoverCanvas = TdsPopoverCanvas$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,4 +1,4 @@
1
- import { T as TdsPopoverCore$1, d as defineCustomElement$1 } from './p-a7a89410.js';
1
+ import { T as TdsPopoverCore$1, d as defineCustomElement$1 } from './p-5e1a9abc.js';
2
2
 
3
3
  const TdsPopoverCore = TdsPopoverCore$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
  import { i as inheritAttributes } from './p-3fe9cbbf.js';
3
- import { d as defineCustomElement$2 } from './p-a7a89410.js';
3
+ import { d as defineCustomElement$2 } from './p-5e1a9abc.js';
4
4
 
5
5
  const popoverMenuCss = ".tds-popover-menu.sc-tds-popover-menu{box-sizing:border-box;overflow:hidden;width:160px;background-color:var(--tds-popover-menu-background);padding:16px 6px;box-shadow:0 3px 3px rgba(0, 0, 0, 0.15), 0 -1px 1px rgba(0, 0, 0, 0.1);border-radius:4px;z-index:900}.tds-popover-menu.sc-tds-popover-menu *.sc-tds-popover-menu{box-sizing:border-box}.tds-popover-menu.fluid-width.sc-tds-popover-menu{width:unset}tds-popover-core.sc-tds-popover-menu{padding:6px 0 !important}.sc-tds-popover-menu-s>tds-divider{display:block;padding:6px !important}";
6
6
  const TdsPopoverMenuStyle0 = popoverMenuCss;
@@ -1,6 +1,6 @@
1
1
  import { p as proxyCustomElement, H, d as createEvent, h, c as Host } from './p-28ef5186.js';
2
2
  import { d as defineCustomElement$5 } from './p-d921fe75.js';
3
- import { d as defineCustomElement$4 } from './p-aa12ddb9.js';
3
+ import { d as defineCustomElement$4 } from './p-d8c96665.js';
4
4
  import { d as defineCustomElement$3 } from './p-e7868876.js';
5
5
  import { d as defineCustomElement$2 } from './p-18c1245b.js';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
2
2
  import { i as inheritAttributes } from './p-3fe9cbbf.js';
3
- import { d as defineCustomElement$2 } from './p-a7a89410.js';
3
+ import { d as defineCustomElement$2 } from './p-5e1a9abc.js';
4
4
 
5
5
  const tooltipCss = ".sc-tds-tooltip-h{position:absolute}.tds-tooltip.sc-tds-tooltip{box-sizing:border-box;font:var(--tds-detail-05);letter-spacing:var(--tds-detail-05-ls);color:var(--tds-tooltip-color);background-color:var(--tds-tooltip-background);border-radius:4px;padding:8px;word-wrap:break-word;white-space:normal;max-width:192px;z-index:900;opacity:0;visibility:hidden;transition:opacity 200ms ease-in, visibility 200ms ease-in}.tds-tooltip.sc-tds-tooltip *.sc-tds-tooltip{box-sizing:border-box}.tds-tooltip.tds-tooltip-top-left.sc-tds-tooltip{border-radius:0 4px 4px}.tds-tooltip.tds-tooltip-top-right.sc-tds-tooltip{border-radius:4px 0 4px 4px}.tds-tooltip.tds-tooltip-bottom-right.sc-tds-tooltip{border-radius:4px 4px 0}.tds-tooltip.tds-tooltip-bottom-left.sc-tds-tooltip{border-radius:4px 4px 4px 0}.tds-tooltip-show.sc-tds-tooltip{opacity:1;visibility:visible}";
6
6
  const TdsTooltipStyle0 = tooltipCss;
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h, g as getElement } from './index-51d04e39.js';
2
2
 
3
- const blockCss = ".tds-block{box-sizing:border-box;color:var(--tds-block-color);border-radius:4px;padding:16px;font:var(--tds-body-01);letter-spacing:var(--tds-body-01-ls);background-color:var(--tds-block-background)}.tds-block *{box-sizing:border-box}.tds-mode-variant-primary{--tds-block-background:var(--tds-block-background-primary);--tds-block-background-nested:var(--tds-block-background-nested-primary)}.tds-mode-variant-secondary{--tds-block-background:var(--tds-block-background-secondary);--tds-block-background-nested:var(--tds-block-background-nested-secondary)}";
3
+ const blockCss = ".tds-block{box-sizing:border-box;color:var(--tds-block-color);background-color:var(--tds-block-background);border-radius:4px;padding:16px;font:var(--tds-body-01);letter-spacing:var(--tds-body-01-ls)}.tds-block *{box-sizing:border-box}.tds-mode-variant-primary{background-color:var(--tds-block-background-primary)}.tds-mode-variant-secondary{background-color:var(--tds-block-background-secondary)}.tds-block-even{background-color:var(--tds-block-background-even)}.tds-block-odd{background-color:var(--tds-block-background-odd)}";
4
4
  const TdsBlockStyle0 = blockCss;
5
5
 
6
6
  const TdsBlock = class {
@@ -8,21 +8,25 @@ const TdsBlock = class {
8
8
  registerInstance(this, hostRef);
9
9
  this.modeVariant = null;
10
10
  }
11
- setModeVariantOnChildBlocks() {
12
- var _a;
13
- this.children = Array.from(this.host.children).filter((item) => item.tagName === 'TDS-BLOCK');
14
- (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach((item) => {
15
- if (!this.modeVariant) {
16
- item.setAttribute('mode-variant', 'secondary');
11
+ getNestingLevel() {
12
+ let level = 0;
13
+ let parent = this.host.parentElement;
14
+ while (parent) {
15
+ if (parent.tagName.toLowerCase() === 'tds-block') {
16
+ level++;
17
17
  }
18
- else {
19
- item.setAttribute('mode-variant', this.modeVariant === 'primary' ? 'secondary' : 'primary');
20
- }
21
- });
18
+ parent = parent.parentElement;
19
+ }
20
+ return level;
22
21
  }
23
22
  render() {
24
- this.setModeVariantOnChildBlocks();
25
- return (h("div", { key: 'a40067afde48258475108cb9785555e7c2bd0a47', class: `tds-block ${this.modeVariant !== null ? `tds-mode-variant-${this.modeVariant}` : ''}` }, h("slot", { key: 'aaf62c59a3a01a0c41a594c15257e4746a049418' })));
23
+ const nestingLevel = this.getNestingLevel();
24
+ const evenOddClass = this.modeVariant === null
25
+ ? nestingLevel % 2 === 0
26
+ ? 'tds-block-even'
27
+ : 'tds-block-odd'
28
+ : '';
29
+ return (h("div", { key: '5f22f1b8ae254a577a151563deadd969e90e3d20', class: `tds-block ${evenOddClass} ${this.modeVariant !== null ? `tds-mode-variant-${this.modeVariant}` : ''}` }, h("slot", { key: '52367d3055296ebd2b6e8291786554f34253750f' })));
26
30
  }
27
31
  get host() { return getElement(this); }
28
32
  };
@@ -171,8 +171,10 @@ const TdsDropdown = class {
171
171
  this.handleFilterReset = () => {
172
172
  this.reset();
173
173
  this.inputElement.value = '';
174
- this.handleFilter({ target: { value: this.inputElement.value } });
174
+ this.handleFilter({ target: { value: '' } });
175
175
  this.inputElement.focus();
176
+ // Add this line to ensure internal value is cleared
177
+ this.internalValue = '';
176
178
  };
177
179
  this.handleFocus = (event) => {
178
180
  this.open = true;
@@ -349,7 +351,7 @@ const TdsDropdown = class {
349
351
  handleOpenState() {
350
352
  if (this.filter && this.multiselect) {
351
353
  if (!this.open) {
352
- this.inputElement.value = this.getValue();
354
+ this.inputElement.value = this.selectedOptions.length ? this.getValue() : '';
353
355
  }
354
356
  }
355
357
  }
@@ -389,7 +391,7 @@ const TdsDropdown = class {
389
391
  }
390
392
  render() {
391
393
  appendHiddenInput(this.host, this.name, this.selectedOptions.join(','), this.disabled);
392
- return (h(Host, { key: 'b80b938a7e06df4883e939cf9cf06cbb5d2dc12b', role: "select", class: `${this.modeVariant ? `tds-mode-variant-${this.modeVariant}` : ''}` }, this.label && this.labelPosition === 'outside' && (h("div", { key: '75172f55ac3adc34a050bbeba543165b6c6ec445', class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: 'd0498b07c2446b7ccde5bd09a95157454ffc2331', class: `dropdown-select ${this.size} ${this.disabled ? 'disabled' : ''}` }, this.filter ? (h("div", { class: {
394
+ return (h(Host, { key: '198e38f89945016a0305584262b751053a00ac2e', role: "select", class: `${this.modeVariant ? `tds-mode-variant-${this.modeVariant}` : ''}` }, this.label && this.labelPosition === 'outside' && (h("div", { key: 'f785bd85282f653e9da367ced8aac22b62061b6d', class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: '9a93fa9b9c343bb748de3324cf3fda0839d24b5b', class: `dropdown-select ${this.size} ${this.disabled ? 'disabled' : ''}` }, this.filter ? (h("div", { class: {
393
395
  filter: true,
394
396
  focus: this.filterFocus,
395
397
  disabled: this.disabled,
@@ -431,7 +433,7 @@ const TdsDropdown = class {
431
433
  label-inside-as-placeholder
432
434
  ${this.size}
433
435
  ${this.selectedOptions.length ? 'selected' : ''}
434
- ` }, 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: '999a08cee6035f37217270681b58411badc1596d', ref: (element) => (this.dropdownList = element), class: {
436
+ ` }, 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: '38ea3153aa17144d03c3472600f7c22b9e7d1ee8', ref: (element) => (this.dropdownList = element), class: {
435
437
  'dropdown-list': true,
436
438
  [this.size]: true,
437
439
  [this.getOpenDirection()]: true,
@@ -440,7 +442,7 @@ const TdsDropdown = class {
440
442
  'closed': !this.open,
441
443
  [`animation-enter-${this.animation}`]: this.animation !== 'none' && this.open,
442
444
  [`animation-exit-${this.animation}`]: this.animation !== 'none' && !this.open,
443
- } }, h("slot", { key: 'f6e55be5581a1b5a24da4643508c4fe76767c9c7', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: '6184dce7e827ee6c2c0403e8531ea8ac782e3073', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: '33bd5d3695247cfaaa66bb67b6ac6a5ced795c72', class: `helper ${this.error ? 'error' : ''} ${this.disabled ? 'disabled' : ''}` }, this.error && h("tds-icon", { key: '6f3681a038fc95bb90e7877c54eff0b4c807b877', name: "error", size: "16px" }), this.helper))));
445
+ } }, h("slot", { key: 'dfe65bc02f12a01b4ef4d710c3e8fabe68d36530', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: '5d4d52a9dc9a1ac4c35ae62a2543c15d8f252a08', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: 'f48a3d2320ebe64c439127898eb4540ccd21b421', class: `helper ${this.error ? 'error' : ''} ${this.disabled ? 'disabled' : ''}` }, this.error && h("tds-icon", { key: 'ca396e64d54c1f4fe95b0407eab80e78a7249c43', name: "error", size: "16px" }), this.helper))));
444
446
  }
445
447
  get host() { return getElement(this); }
446
448
  static get watchers() { return {