@scania/tegel 1.38.0 → 1.39.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/getAriaInvalid-66a2eade.js +25 -0
- package/dist/cjs/index-ca8040ad.js +6 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/tds-accordion-item.cjs.entry.js +1 -1
- package/dist/cjs/{tds-button.cjs.entry.js → tds-button_2.cjs.entry.js} +25 -0
- package/dist/cjs/tds-card.cjs.entry.js +10 -3
- package/dist/cjs/tds-core-header-item_2.cjs.entry.js +1 -1
- package/dist/cjs/tds-dropdown_2.cjs.entry.js +55 -22
- package/dist/cjs/tds-link.cjs.entry.js +1 -1
- package/dist/cjs/tds-navigation-tab.cjs.entry.js +1 -1
- package/dist/cjs/tds-popover-canvas.cjs.entry.js +6 -3
- 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/tds-text-field.cjs.entry.js +6 -5
- package/dist/cjs/tds-textarea.cjs.entry.js +5 -3
- package/dist/cjs/tds-toast.cjs.entry.js +1 -1
- package/dist/cjs/tegel.cjs.js +1 -1
- package/dist/collection/components/accordion/accordion-item/accordion-item.css +8 -4
- package/dist/collection/components/card/card.css +12 -0
- package/dist/collection/components/card/card.js +45 -2
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +13 -3
- package/dist/collection/components/dropdown/dropdown.js +56 -20
- package/dist/collection/components/header/header-item/header-item.css +3 -3
- package/dist/collection/components/link/link.css +13 -15
- package/dist/collection/components/popover-canvas/popover-canvas.css +1 -1
- package/dist/collection/components/popover-canvas/popover-canvas.js +26 -10
- 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/navigation-tabs/navigation-tab/navigation-tab.css +1 -1
- package/dist/collection/components/text-field/text-field.js +6 -5
- package/dist/collection/components/textarea/textarea.js +5 -3
- package/dist/collection/components/toast/toast.css +7 -7
- package/dist/collection/utils/getAriaInvalid.js +21 -0
- package/dist/components/{p-63437b77.js → p-072bf53a.js} +1 -1
- package/dist/components/p-3b58a9f3.js +188 -0
- package/dist/components/{p-ea381f94.js → p-92c2da85.js} +1 -1
- package/dist/components/{p-6adb1ce3.js → p-ad6babcd.js} +1 -1
- package/dist/components/p-bbf9492a.js +23 -0
- package/dist/components/{p-d64878cb.js → p-c4318e35.js} +13 -3
- package/dist/{esm/tds-button.entry.js → components/p-c8dc3566.js} +37 -9
- package/dist/components/{p-94bfc9f4.js → p-de36fc8a.js} +44 -20
- package/dist/components/{p-df84759a.js → p-f04f04b5.js} +7 -3
- package/dist/components/tds-accordion-item.js +1 -1
- package/dist/components/tds-button.js +1 -89
- package/dist/components/tds-card.js +27 -6
- package/dist/components/tds-dropdown-option.js +1 -1
- package/dist/components/tds-dropdown.js +1 -1
- package/dist/components/tds-header-brand-symbol.js +1 -1
- package/dist/components/tds-header-dropdown.js +2 -2
- 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 +3 -3
- package/dist/components/tds-link.js +1 -1
- package/dist/components/tds-navigation-tab.js +1 -1
- package/dist/components/tds-popover-canvas.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/components/tds-textarea.js +5 -3
- package/dist/components/tds-toast.js +1 -1
- package/dist/esm/getAriaInvalid-a9944cb9.js +23 -0
- package/dist/esm/index-51d04e39.js +6 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tds-accordion-item.entry.js +1 -1
- package/dist/esm/tds-button_2.entry.js +87 -0
- package/dist/esm/tds-card.entry.js +10 -3
- package/dist/esm/tds-core-header-item_2.entry.js +1 -1
- package/dist/esm/tds-dropdown_2.entry.js +55 -22
- package/dist/esm/tds-link.entry.js +1 -1
- package/dist/esm/tds-navigation-tab.entry.js +1 -1
- package/dist/esm/tds-popover-canvas.entry.js +6 -3
- 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/tds-text-field.entry.js +6 -5
- package/dist/esm/tds-textarea.entry.js +6 -4
- package/dist/esm/tds-toast.entry.js +1 -1
- package/dist/esm/tegel.js +1 -1
- package/dist/tegel/p-1859156f.entry.js +1 -0
- package/dist/tegel/p-2c9ea0be.entry.js +1 -0
- package/dist/tegel/p-2f9b15f6.entry.js +1 -0
- package/dist/tegel/p-30901c4d.entry.js +1 -0
- package/dist/tegel/p-336f2de3.entry.js +1 -0
- package/dist/tegel/p-35293420.entry.js +1 -0
- package/dist/tegel/p-4a666337.entry.js +1 -0
- package/dist/tegel/p-628dc7f7.entry.js +1 -0
- package/dist/tegel/p-83e6e31f.entry.js +1 -0
- package/dist/tegel/p-87740f23.entry.js +1 -0
- package/dist/tegel/{p-a74cb560.entry.js → p-af63a774.entry.js} +1 -1
- package/dist/tegel/p-bbf9492a.js +1 -0
- package/dist/tegel/p-c465f9b8.entry.js +1 -0
- package/dist/tegel/p-c4f701f6.entry.js +1 -0
- package/dist/tegel/{p-5734c6ef.entry.js → p-c61ecc8e.entry.js} +1 -1
- package/dist/tegel/{p-db38b4f2.entry.js → p-ecb34850.entry.js} +1 -1
- package/dist/tegel/tegel.css +2 -2
- package/dist/tegel/tegel.esm.js +1 -1
- package/dist/types/components/card/card.d.ts +10 -0
- package/dist/types/components/dropdown/dropdown.d.ts +4 -0
- package/dist/types/components/popover-canvas/popover-canvas.d.ts +3 -1
- package/dist/types/components/slider/slider.d.ts +2 -0
- package/dist/types/components/textarea/textarea.d.ts +1 -0
- package/dist/types/components.d.ts +26 -2
- package/dist/types/utils/getAriaInvalid.d.ts +14 -0
- package/package.json +1 -1
- package/dist/cjs/tds-divider.cjs.entry.js +0 -31
- package/dist/esm/tds-divider.entry.js +0 -27
- package/dist/tegel/p-06d3490c.entry.js +0 -1
- package/dist/tegel/p-25d026a6.entry.js +0 -1
- package/dist/tegel/p-397c8969.entry.js +0 -1
- package/dist/tegel/p-49364819.entry.js +0 -1
- package/dist/tegel/p-4a77edf1.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-a98767ea.entry.js +0 -1
- package/dist/tegel/p-abad3489.entry.js +0 -1
- package/dist/tegel/p-ae438c2e.entry.js +0 -1
- package/dist/tegel/p-b994e7ac.entry.js +0 -1
- package/dist/tegel/p-cd5103e3.entry.js +0 -1
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, d as createEvent, h } from './p-28ef5186.js';
|
|
2
2
|
import { g as generateUniqueId } from './p-11648030.js';
|
|
3
|
-
import { d as defineCustomElement$
|
|
3
|
+
import { d as defineCustomElement$5 } from './p-b390ece5.js';
|
|
4
|
+
import { d as defineCustomElement$4 } from './p-d3866be7.js';
|
|
5
|
+
import { d as defineCustomElement$3 } from './p-3b58a9f3.js';
|
|
6
|
+
import { d as defineCustomElement$2 } from './p-40253725.js';
|
|
4
7
|
|
|
5
|
-
const sliderCss = "tds-slider{box-sizing:border-box;width:100%}tds-slider *{box-sizing:border-box}tds-slider input[type=range].tds-slider-native-element{display:none}tds-slider .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.tds-slider-wrapper{width:100%}.tds-slider-wrapper.read-only{pointer-events:none}.tds-slider
|
|
8
|
+
const sliderCss = "tds-slider{box-sizing:border-box;width:100%}tds-slider *{box-sizing:border-box}tds-slider input[type=range].tds-slider-native-element{display:none}tds-slider .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.tds-slider-wrapper{width:100%}.tds-slider-wrapper.read-only{pointer-events:none}.tds-slider{width:100%;display:flex;flex-wrap:nowrap;padding-top:65px}.tds-slider .tds-slider-inner{width:100%;height:20px;position:relative}.tds-slider .tds-slider-inner:focus-within .tds-slider__thumb-inner{outline:var(--tds-slider-thumb-focus-outline);box-shadow:var(--tds-slider-thumb-focus-box-shadow);outline-offset:var(--tds-slider-thumb-focus-outline-offset);z-index:1}.tds-slider .tds-slider__controls{position:relative;top:-25px}.tds-slider .tds-slider__controls .tds-slider__control{cursor:pointer}.tds-slider .tds-slider__controls .tds-slider__control.tds-slider__control-minus{padding:18px 18px 18px 0}.tds-slider .tds-slider__controls .tds-slider__control.tds-slider__control-plus{padding:18px 0 18px 18px}.tds-slider .tds-slider__input-values{position:relative;top:-25px;display:flex;flex-wrap:nowrap;align-items:center}.tds-slider .tds-slider__input-values .tds-slider__input-value{user-select:none;padding:18px;color:var(--tds-slider-input-value-color);font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls)}.tds-slider .tds-slider__input-values .tds-slider__input-value.min-value{padding-left:0}.tds-slider .tds-slider__input-values .tds-slider__input-field-wrapper{background-color:var(--tds-slider-inputfield-background);display:flex;align-items:center;justify-content:center;border-radius:4px 4px 0 0}.tds-slider .tds-slider__input-values .tds-slider__input-field-wrapper tds-text-field .text-field-input[type=number]{width:auto;padding:12px;text-align:center;appearance:textfield}.tds-slider .tds-slider__input-values .tds-slider__input-field-wrapper tds-text-field .text-field-input[type=number]::-webkit-outer-spin-button,.tds-slider .tds-slider__input-values .tds-slider__input-field-wrapper tds-text-field .text-field-input[type=number]::-webkit-inner-spin-button{appearance:none;margin:0}.tds-slider .tds-slider__input-values .tds-slider__input-field-wrapper tds-text-field .text-field-input:read-only{text-align:left}.tds-slider .tds-slider__input-values .tds-slider__input-field-wrapper tds-text-field .text-field-icon__readonly{right:12px}.tds-slider label{font:var(--tds-detail-05);letter-spacing:var(--tds-detail-05-ls);user-select:none;position:absolute;color:var(--tds-slider-label-color);padding-bottom:16px;transform:translateY(-100%)}.tds-slider label.offset{padding-bottom:34px}.tds-slider .tds-slider__value{font:var(--tds-detail-01);letter-spacing:var(--tds-detail-01-ls);user-select:none;border-radius:4px;padding:8px 11px;position:absolute;transform:translate(-50%, -100%);top:-24px;background-color:var(--tds-slider-value-tooltip-background);color:var(--tds-slider-value-tooltip-color)}.tds-slider .tds-slider__value svg{color:var(--tds-slider-value-tooltip-background);position:absolute;left:50%;transform:translateX(-50%);top:34px}.tds-slider .tds-slider__thumb{position:absolute}.tds-slider .tds-slider__thumb:hover .tds-slider__value{display:block}.tds-slider .tds-slider__thumb .tds-slider__thumb-inner{width:20px;height:20px;border-radius:100%;background-color:var(--tds-slider-thumb-color);position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);cursor:pointer}.tds-slider .tds-slider__thumb .tds-slider__thumb-inner::before{content:\" \";display:none;width:48px;height:48px;background-color:var(--tds-slider-thumb-color);position:absolute;border-radius:100%;top:50%;left:50%;transform:translate(-50%, -50%)}.tds-slider .tds-slider__thumb .tds-slider__thumb-inner:hover::before{display:block;background-color:var(--tds-slider-thumb-hover)}.tds-slider .tds-slider__thumb .tds-slider__thumb-inner.pressed{width:24px;height:24px}.tds-slider .tds-slider__thumb .tds-slider__thumb-inner.pressed::before{display:block;background-color:var(--tds-slider-thumb-pressed)}.tds-slider .tds-slider__value-dividers-wrapper{position:relative;width:100%;pointer-events:none}.tds-slider .tds-slider__value-dividers{pointer-events:none;position:absolute;display:flex;justify-content:space-between;width:100%}.tds-slider .tds-slider__value-dividers .tds-slider__value-divider{transform:translateY(-50%);height:16px;background-color:var(--tds-slider-divider-color);color:var(--tds-slider-divider-values-color);width:1px}.tds-slider .tds-slider__value-dividers .tds-slider__value-divider span{display:block;user-select:none;color:var(-tds-grey-700);font:var(--tds-detail-05);letter-spacing:var(--tds-detail-05-ls);position:relative;top:-7px;left:50%;transform:translate(-50%, -100%);width:50px;text-align:center}.tds-slider .tds-slider__track{width:100%;height:2px;border-radius:1px;background-color:var(--tds-slider-track-color);position:relative;cursor:pointer}.tds-slider .tds-slider__track::after{content:\"\";position:absolute;left:0;right:0;top:-10px;bottom:-10px;cursor:pointer;z-index:0}.tds-slider .tds-slider__track:focus{outline:0}.tds-slider .tds-slider__track:focus .tds-slider__thumb .tds-slider__thumb-inner{width:24px;height:24px}.tds-slider .tds-slider__track:focus .tds-slider__thumb .tds-slider__thumb-inner::before{display:block;opacity:0.08}.tds-slider .tds-slider__track .tds-slider__track-fill{background-color:var(--tds-slider-track-fill-color);border-radius:2px;height:4px;position:absolute;left:0;top:-1px}.tds-slider .tds-slider__track .tds-slider__thumb{z-index:1}.tds-slider.disabled{cursor:not-allowed}.tds-slider.disabled>*{pointer-events:none}.tds-slider.disabled label{color:var(--tds-slider-label-disabled)}.tds-slider.disabled .tds-slider__controls .tds-slider__control{cursor:default}.tds-slider.disabled .tds-slider__input-values .tds-slider__input-value{color:var(--tds-slider-input-value-disabled)}.tds-slider.disabled .tds-slider__input-values .tds-slider__input-field-wrapper{pointer-events:none}.tds-slider.disabled .tds-slider__input-values .tds-slider__input-field-wrapper input.tds-slider__input-field{color:var(--tds-slider-inputfield-number-disabled);box-shadow:none;pointer-events:none;background:var(--tds-slider-inputfield-background-disabled)}.tds-slider.disabled .tds-slider__value{display:none}.tds-slider.disabled .tds-slider__track{cursor:not-allowed;background-color:var(--tds-slider-track-disabled)}.tds-slider.disabled .tds-slider__track .tds-slider__track-fill{background-color:var(--tds-slider-track-disabled)}.tds-slider.disabled .tds-slider__value-dividers .tds-slider__value-divider{background-color:var(--tds-slider-divider-disabled)}.tds-slider.disabled .tds-slider__value-dividers .tds-slider__value-divider span{color:var(--tds-slider-divider-values-disabled)}.tds-slider.disabled .tds-slider__thumb{pointer-events:none}.tds-slider.disabled .tds-slider__thumb .tds-slider__thumb-inner{background-color:var(--tds-slider-thumb-disabled);cursor:default}.tds-slider.tds-slider-small .tds-slider__thumb .tds-slider__thumb-inner{width:16px;height:16px}.tds-slider.tds-slider-small .tds-slider__thumb .tds-slider__thumb-inner::before{width:40px;height:40px}.tds-slider.tds-slider-small .tds-slider__thumb .tds-slider__thumb-inner.pressed{width:20px;height:20px}.tds-slider .tds-slider__controls .tds-slider__control{cursor:pointer}.tds-slider .tds-slider__controls .tds-slider__control.tds-slider__control-minus tds-icon,.tds-slider .tds-slider__controls .tds-slider__control.tds-slider__control-plus tds-icon{color:var(--tds-slider-controls-color)}.tds-slider.disabled .tds-slider__controls .tds-slider__control{cursor:default}.tds-slider.disabled .tds-slider__controls .tds-slider__control.tds-slider__control-minus tds-icon,.tds-slider.disabled .tds-slider__controls .tds-slider__control.tds-slider__control-plus tds-icon{color:var(--tds-slider-controls-disabled)}";
|
|
6
9
|
const TdsSliderStyle0 = sliderCss;
|
|
7
10
|
|
|
8
11
|
const TdsSlider$1 = /*@__PURE__*/ proxyCustomElement(class TdsSlider extends H {
|
|
@@ -274,6 +277,25 @@ const TdsSlider$1 = /*@__PURE__*/ proxyCustomElement(class TdsSlider extends H {
|
|
|
274
277
|
const rounded = this.roundToStep(newValue);
|
|
275
278
|
this.forceValueUpdate(rounded.toString());
|
|
276
279
|
}
|
|
280
|
+
/** Updates the slider value when using tds-text-field (reads value from host element) */
|
|
281
|
+
updateSliderValueFromTextField(event) {
|
|
282
|
+
const hostEl = event.target; // tds-text-field host element exposes a value prop
|
|
283
|
+
const raw = hostEl && typeof hostEl.value !== 'undefined' ? hostEl.value : '';
|
|
284
|
+
let newValue = parseFloat(raw);
|
|
285
|
+
if (Number.isNaN(newValue)) {
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
const minNum = parseFloat(this.min);
|
|
289
|
+
const maxNum = parseFloat(this.max);
|
|
290
|
+
if (newValue < minNum) {
|
|
291
|
+
newValue = minNum;
|
|
292
|
+
}
|
|
293
|
+
else if (newValue > maxNum) {
|
|
294
|
+
newValue = maxNum;
|
|
295
|
+
}
|
|
296
|
+
const rounded = this.roundToStep(newValue);
|
|
297
|
+
this.forceValueUpdate(rounded.toString());
|
|
298
|
+
}
|
|
277
299
|
/** Updates the slider value based on the current input value when enter is pressed */
|
|
278
300
|
handleInputFieldEnterPress(event) {
|
|
279
301
|
event.stopPropagation();
|
|
@@ -294,7 +316,16 @@ const TdsSlider$1 = /*@__PURE__*/ proxyCustomElement(class TdsSlider extends H {
|
|
|
294
316
|
}
|
|
295
317
|
}
|
|
296
318
|
calculateInputSizeFromMax() {
|
|
297
|
-
|
|
319
|
+
const input = this.host.querySelector('tds-text-field input[type="number"]');
|
|
320
|
+
if (input) {
|
|
321
|
+
if (this.readOnly) {
|
|
322
|
+
// explicit size to fit suffix icon
|
|
323
|
+
input.style.width = `${52 + this.max.length * 8}px`;
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
input.setAttribute('size', `${this.max.length}`);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
298
329
|
}
|
|
299
330
|
controlsStep(delta, event) {
|
|
300
331
|
if (this.readOnly || this.disabled) {
|
|
@@ -365,6 +396,7 @@ const TdsSlider$1 = /*@__PURE__*/ proxyCustomElement(class TdsSlider extends H {
|
|
|
365
396
|
}
|
|
366
397
|
}
|
|
367
398
|
componentDidLoad() {
|
|
399
|
+
this.calculateInputSizeFromMax();
|
|
368
400
|
if (!this.resizeObserverAdded) {
|
|
369
401
|
this.resizeObserverAdded = true;
|
|
370
402
|
const resizeObserver = new ResizeObserver(() => {
|
|
@@ -408,30 +440,30 @@ const TdsSlider$1 = /*@__PURE__*/ proxyCustomElement(class TdsSlider extends H {
|
|
|
408
440
|
}
|
|
409
441
|
render() {
|
|
410
442
|
const ariaLabel = this.readOnly ? this.tdsReadOnlyAriaLabel : this.label || this.tdsAriaLabel;
|
|
411
|
-
return (h("div", { key: '
|
|
443
|
+
return (h("div", { key: '6077f356c7723ce54bdee208039af07154499684', class: {
|
|
412
444
|
'tds-slider-wrapper': true,
|
|
413
445
|
'read-only': this.readOnly,
|
|
414
|
-
} }, h("input", { key: '
|
|
446
|
+
} }, h("input", { key: '0ee6d0f1c8661bdcae6a3df5eca7b154306338eb', class: "tds-slider-native-element", type: "range", name: this.name, min: this.min, max: this.max, step: this.step, value: this.value, disabled: this.disabled }), h("div", { key: 'cfb2700cf9d16c204182a72f9f00ccd03b58ef89', class: "sr-only", "aria-live": "assertive", ref: (el) => {
|
|
415
447
|
this.ariaLiveElement = el;
|
|
416
|
-
} }), h("div", { key: '
|
|
448
|
+
} }), h("div", { key: 'b90c1d06afd96682a108b24506660e7544c4be38', class: {
|
|
417
449
|
'tds-slider': true,
|
|
418
450
|
'disabled': this.disabled,
|
|
419
451
|
'tds-slider-small': this.useSmall,
|
|
420
452
|
}, ref: (el) => {
|
|
421
453
|
this.wrapperElement = el;
|
|
422
|
-
}, "aria-disabled": this.disabled ? 'true' : 'false' }, h("label", { key: '
|
|
454
|
+
}, "aria-disabled": this.disabled ? 'true' : 'false' }, h("label", { key: '3d0bc3f42de59e4397dc8da0edf7ec29802ee8ab', id: `${this.sliderId}-label`, class: this.showTickNumbers && 'offset' }, this.label), this.useInput && (h("div", { key: 'c3868e2225cc4dacf60d23e31bdb2b106b85ce22', class: "tds-slider__input-values" }, h("div", { key: 'af100279435087101f37043ea083e5e33d930079', class: "tds-slider__input-value min-value" }, this.min))), this.useControls && (h("div", { key: '83c0078ec0ae39d29582e1ff1f4c3fc5f3a09483', class: "tds-slider__controls" }, h("div", { key: '31947e6cd76c35b8b8e7c0fb92b777e3bf8538b7', class: "tds-slider__control tds-slider__control-minus", onClick: (event) => this.stepLeft(event), role: "button", "aria-label": "Decrease value", tabindex: this.disabled || this.readOnly ? '-1' : '0' }, h("tds-icon", { key: '4c005f8c628236482eecdac51bd43a860f9e38d9', name: "minus", size: "16px" })))), h("div", { key: 'c6f21ded71244d202e255a90039f03872af09d5a', class: "tds-slider-inner", tabIndex: -1 }, this.tickValues.length > 0 && (h("div", { key: 'df1e820e1077ccec24826e38ba1b1fdd8dc0ae90', class: "tds-slider__value-dividers-wrapper" }, h("div", { key: 'f8cadf57f46068f61d1afc2bbcc30997a750705b', class: "tds-slider__value-dividers" }, this.tickValues.map((value) => (h("div", { class: "tds-slider__value-divider" }, this.showTickNumbers && h("span", null, value))))))), h("div", { key: '389ba385948b6772e803b7b9ec858061451f7534', class: "tds-slider__track", ref: (el) => {
|
|
423
455
|
this.trackElement = el;
|
|
424
456
|
}, tabindex: this.disabled ? '-1' : '0', role: "presentation", onFocus: () => {
|
|
425
457
|
if (this.thumbElement) {
|
|
426
458
|
this.thumbElement.focus();
|
|
427
459
|
}
|
|
428
|
-
} }, h("div", { key: '
|
|
460
|
+
} }, h("div", { key: '5409aec334156fc5c5ac6a2cdbcb38ee50e35259', class: "tds-slider__track-fill", ref: (el) => {
|
|
429
461
|
this.trackFillElement = el;
|
|
430
|
-
} }), h("div", { key: '
|
|
462
|
+
} }), h("div", { key: '8e0953ed9771846db11b9f79f6844065494f1b01', class: "tds-slider__thumb", ref: (el) => {
|
|
431
463
|
this.thumbElement = el;
|
|
432
|
-
}, onMouseDown: () => this.grabThumb(), onTouchStart: () => this.grabThumb(), role: "slider", "aria-valuemin": this.min, "aria-valuemax": this.max, "aria-valuenow": this.value, "aria-valuetext": `${this.value} of ${this.max}`, "aria-labelledby": `${this.sliderId}-label`, "aria-grabbed": this.thumbGrabbed ? 'true' : 'false', "aria-label": ariaLabel, tabindex: this.disabled ? '-1' : '0' }, this.tooltip && (h("div", { key: '
|
|
464
|
+
}, onMouseDown: () => this.grabThumb(), onTouchStart: () => this.grabThumb(), role: "slider", "aria-valuemin": this.min, "aria-valuemax": this.max, "aria-valuenow": this.value, "aria-valuetext": `${this.value} of ${this.max}`, "aria-labelledby": `${this.sliderId}-label`, "aria-grabbed": this.thumbGrabbed ? 'true' : 'false', "aria-label": ariaLabel, tabindex: this.disabled ? '-1' : '0' }, this.tooltip && (h("div", { key: 'ed08cca6219adff68babc9c535aff278a1b3325e', class: "tds-slider__value" }, this.value, h("svg", { key: 'dc46d041d7c123400a42ea9c9472cf0a329eb4a1', width: "18", height: "14", viewBox: "0 0 18 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '3d46edb2069bd056a2ae09efa4bfa7f6319afe3b', d: "M8.15882 12.6915L0.990487 1.54076C0.562658 0.875246 1.0405 0 1.83167 0H16.1683C16.9595 0 17.4373 0.875246 17.0095 1.54076L9.84118 12.6915C9.44754 13.3038 8.55246 13.3038 8.15882 12.6915Z", fill: "currentColor" })))), h("div", { key: '202f2b005a969cd7eb3396c14ef6f72224fcd56a', class: "tds-slider__thumb-inner", ref: (el) => {
|
|
433
465
|
this.thumbInnerElement = el;
|
|
434
|
-
} })))), this.useInput && (h("div", { key: '
|
|
466
|
+
} })))), this.useInput && (h("div", { key: 'ca2e84c4bccc24ebbc58a4915f62b5ecb77462c9', class: "tds-slider__input-values" }, h("div", { key: '58fdb8a9a25b9f15314aab8ffaee9424fbb26458', class: "tds-slider__input-value", onClick: (event) => this.stepLeft(event) }, this.max), h("div", { key: '4cba8f4c2b8a89922dbaa9eec4c2f9d12f43b62c', class: "tds-slider__input-field-wrapper" }, h("tds-text-field", { key: '65d311769aa5202134676cf9c4652132fbfc364d', noMinWidth: true, size: "sm", type: "number", value: this.value, min: this.min, max: this.max, readOnly: this.readOnly, disabled: this.disabled, onTdsChange: (e) => console.log(e), tdsAriaLabel: this.readOnly ? this.tdsReadOnlyAriaLabel : undefined, onTdsBlur: (event) => this.updateSliderValueFromTextField(event), onKeyDown: (event) => this.handleInputFieldEnterPress(event) })))), this.useControls && (h("div", { key: 'da8881158bee1aec2724a0e71af3faa88bc0eb17', class: "tds-slider__controls" }, h("div", { key: '241b11a3bee6ce8cf3e53ba77a095e2fb0cdb8a6', class: "tds-slider__control tds-slider__control-plus", onClick: (event) => this.stepRight(event), role: "button", "aria-label": "Increase value", tabindex: this.disabled || this.readOnly ? '-1' : '0' }, h("tds-icon", { key: 'c8e5466b53a1fe6abaaab77741e4adb7ec197341', name: "plus", size: "16px" })))))));
|
|
435
467
|
}
|
|
436
468
|
get host() { return this; }
|
|
437
469
|
static get watchers() { return {
|
|
@@ -465,7 +497,7 @@ function defineCustomElement$1() {
|
|
|
465
497
|
if (typeof customElements === "undefined") {
|
|
466
498
|
return;
|
|
467
499
|
}
|
|
468
|
-
const components = ["tds-slider", "tds-icon"];
|
|
500
|
+
const components = ["tds-slider", "tds-icon", "tds-popover-core", "tds-text-field", "tds-tooltip"];
|
|
469
501
|
components.forEach(tagName => { switch (tagName) {
|
|
470
502
|
case "tds-slider":
|
|
471
503
|
if (!customElements.get(tagName)) {
|
|
@@ -473,6 +505,21 @@ function defineCustomElement$1() {
|
|
|
473
505
|
}
|
|
474
506
|
break;
|
|
475
507
|
case "tds-icon":
|
|
508
|
+
if (!customElements.get(tagName)) {
|
|
509
|
+
defineCustomElement$5();
|
|
510
|
+
}
|
|
511
|
+
break;
|
|
512
|
+
case "tds-popover-core":
|
|
513
|
+
if (!customElements.get(tagName)) {
|
|
514
|
+
defineCustomElement$4();
|
|
515
|
+
}
|
|
516
|
+
break;
|
|
517
|
+
case "tds-text-field":
|
|
518
|
+
if (!customElements.get(tagName)) {
|
|
519
|
+
defineCustomElement$3();
|
|
520
|
+
}
|
|
521
|
+
break;
|
|
522
|
+
case "tds-tooltip":
|
|
476
523
|
if (!customElements.get(tagName)) {
|
|
477
524
|
defineCustomElement$2();
|
|
478
525
|
}
|
|
@@ -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$5 } from './p-44f5b5e1.js';
|
|
3
|
-
import { d as defineCustomElement$4 } from './p-
|
|
4
|
-
import { d as defineCustomElement$3 } from './p-
|
|
3
|
+
import { d as defineCustomElement$4 } from './p-de36fc8a.js';
|
|
4
|
+
import { d as defineCustomElement$3 } from './p-c4318e35.js';
|
|
5
5
|
import { d as defineCustomElement$2 } from './p-b390ece5.js';
|
|
6
6
|
|
|
7
7
|
const tableFooterCss = ":host{box-sizing:border-box;display:table-footer-group;height:var(--tds-spacing-element-48)}:host *{box-sizing:border-box}:host .tds-table__footer-row{background-color:var(--tds-table-footer-background);color:var(--tds-table-color)}:host .tds-table__footer-cell{padding:0 var(--tds-spacing-element-16)}:host .tds-table__footer-cell .tds-table__pagination{height:var(--tds-spacing-element-48);display:flex;align-items:center;justify-content:space-between}:host .tds-table__footer-cell .tds-table__pagination .tds-table__row-selector,:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector{display:flex;align-items:center}:host .tds-table__footer-cell .tds-table__pagination .tds-table__row-selector .rows-per-page,:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector .rows-per-page{display:flex;align-items:center;margin-right:var(--tds-spacing-element-16)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__row-selector .rows-per-page p,:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector .rows-per-page p{margin-right:var(--tds-spacing-element-8)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input{font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);background-color:var(--tds-table-footer-page-selector-input-background);color:var(--tds-table-color);width:74px;height:30px;border:none;border-radius:var(--tds-spacing-element-4);transition:background-color 250ms ease;margin-right:var(--tds-spacing-element-4);padding-left:var(--tds-spacing-element-16)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input:hover{background-color:var(--tds-table-footer-page-selector-input-background-hover)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input:disabled{color:var(--tds-table-footer-page-selector-input-color-disabled)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input--shake{animation:tds-shake-animation 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;transform:translate3d(0, 0, 0);backface-visibility:hidden;perspective:1000px}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-text{font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);padding:1px 8px 0 0}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn{display:flex;justify-content:center;align-items:center;border:none;background-color:transparent;cursor:pointer;height:var(--tds-spacing-element-32);width:var(--tds-spacing-element-32);border-radius:var(--tds-spacing-element-4);transition:background-color 250ms ease;color:var(--tds-table-footer-page-selector-icon)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn:hover{background-color:var(--tds-table-footer-btn-hover)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn:disabled{cursor:default;color:var(--tds-table-footer-page-selector-icon-disabled)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn:disabled:hover{background-color:transparent}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn-svg{height:var(--tds-spacing-element-20);width:var(--tds-spacing-element-20);fill:var(--tds-table-color)}:host(.tds-table--compact){height:var(--tds-spacing-element-32)}:host(.tds-table--compact) .tds-table__footer-cell .tds-table__pagination{height:var(--tds-spacing-element-32)}:host(.tds-table--compact) .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input{height:var(--tds-spacing-element-24)}:host(.tds-table--compact) .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn{height:28px;width:28px}:host(.footer__horizontal-scroll){display:inline-table;position:absolute;margin-top:10px}@keyframes tds-shake-animation{10%,90%{transform:translate3d(-1px, 0, 0)}20%,80%{transform:translate3d(2px, 0, 0)}30%,50%,70%{transform:translate3d(-4px, 0, 0)}40%,60%{transform:translate3d(4px, 0, 0)}}";
|
|
@@ -1,188 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { h as hasSlot } from './p-ae110fc2.js';
|
|
3
|
-
import { g as generateUniqueId } from './p-11648030.js';
|
|
4
|
-
import { d as defineCustomElement$4 } from './p-b390ece5.js';
|
|
5
|
-
import { d as defineCustomElement$3 } from './p-d3866be7.js';
|
|
6
|
-
import { d as defineCustomElement$2 } 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$1 = /*@__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$1() {
|
|
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$1);
|
|
166
|
-
}
|
|
167
|
-
break;
|
|
168
|
-
case "tds-icon":
|
|
169
|
-
if (!customElements.get(tagName)) {
|
|
170
|
-
defineCustomElement$4();
|
|
171
|
-
}
|
|
172
|
-
break;
|
|
173
|
-
case "tds-popover-core":
|
|
174
|
-
if (!customElements.get(tagName)) {
|
|
175
|
-
defineCustomElement$3();
|
|
176
|
-
}
|
|
177
|
-
break;
|
|
178
|
-
case "tds-tooltip":
|
|
179
|
-
if (!customElements.get(tagName)) {
|
|
180
|
-
defineCustomElement$2();
|
|
181
|
-
}
|
|
182
|
-
break;
|
|
183
|
-
} });
|
|
184
|
-
}
|
|
185
|
-
defineCustomElement$1();
|
|
1
|
+
import { T as TdsTextField$1, d as defineCustomElement$1 } from './p-3b58a9f3.js';
|
|
186
2
|
|
|
187
3
|
const TdsTextField = TdsTextField$1;
|
|
188
4
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, d as createEvent, h } from './p-28ef5186.js';
|
|
2
2
|
import { g as generateUniqueId } from './p-11648030.js';
|
|
3
|
+
import { g as getAriaInvalid } from './p-bbf9492a.js';
|
|
3
4
|
import { d as defineCustomElement$4 } from './p-b390ece5.js';
|
|
4
5
|
import { d as defineCustomElement$3 } from './p-d3866be7.js';
|
|
5
6
|
import { d as defineCustomElement$2 } from './p-40253725.js';
|
|
@@ -73,7 +74,7 @@ const TdsTextarea$1 = /*@__PURE__*/ proxyCustomElement(class TdsTextarea extends
|
|
|
73
74
|
}
|
|
74
75
|
render() {
|
|
75
76
|
var _a;
|
|
76
|
-
return (h("div", { key: '
|
|
77
|
+
return (h("div", { key: '68eb00fd2e149732b8d47b72e8b60b2a30dd4d76', class: {
|
|
77
78
|
'textarea-container': true,
|
|
78
79
|
'textarea-label-inside': this.labelPosition === 'inside',
|
|
79
80
|
'textarea-focus': this.focusInput,
|
|
@@ -83,7 +84,7 @@ const TdsTextarea$1 = /*@__PURE__*/ proxyCustomElement(class TdsTextarea extends
|
|
|
83
84
|
'textarea-data': this.value !== '',
|
|
84
85
|
[`textarea-${this.state}`]: this.state === 'error' || this.state === 'success',
|
|
85
86
|
'no-min-width': this.noMinWidth,
|
|
86
|
-
} }, this.labelPosition !== 'no-label' && (h("label", { key: '
|
|
87
|
+
} }, this.labelPosition !== 'no-label' && (h("label", { key: '883255abac1da6cec05779b200d5347b6fa740dc', htmlFor: `textarea-element-${this.uuid}`, class: 'textarea-label' }, this.label)), h("div", { key: 'c0eacdcf4b575d14ebd5905785dade6a3f151f0e', class: "textarea-wrapper" }, h("textarea", { key: '940ea2fc206cd567bd2f181e71236cce216ec669', id: `textarea-element-${this.uuid}`, class: 'textarea-input', ref: (inputEl) => {
|
|
87
88
|
this.textEl = inputEl;
|
|
88
89
|
}, disabled: this.disabled, readonly: !this.disabled && this.readOnly, placeholder: this.placeholder, value: this.value, name: this.name, autofocus: this.autofocus, maxlength: this.maxLength, cols: this.cols, rows: this.rows, onFocus: (event) => {
|
|
89
90
|
if (!this.readOnly) {
|
|
@@ -93,8 +94,9 @@ const TdsTextarea$1 = /*@__PURE__*/ proxyCustomElement(class TdsTextarea extends
|
|
|
93
94
|
if (!this.readOnly) {
|
|
94
95
|
this.handleBlur(event);
|
|
95
96
|
}
|
|
96
|
-
}, onInput: (event) => this.handleInput(event), onChange: (event) => this.handleChange(event), "aria-invalid": this.state
|
|
97
|
+
}, onInput: (event) => this.handleInput(event), onChange: (event) => this.handleChange(event), "aria-invalid": getAriaInvalid(this.host, this.state), "aria-readonly": this.readOnly ? 'true' : 'false', "aria-label": this.tdsAriaLabel ? this.tdsAriaLabel : this.label, "aria-describedby": `textarea-helper-element-${this.uuid}` }), h("span", { key: 'b821544e95ac75383e05d5fd54b605306f5c6790', class: "textarea-resizer-icon" }, h("svg", { key: '11d6fa83c05cc2511b391bab21d229d057516571', width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '95e8fd6c73070e318d0c5c589fa326ef3480e282', "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M11.8536 0.853553C12.0488 0.658291 12.0488 0.341709 11.8536 0.146447C11.6583 -0.0488155 11.3417 -0.0488155 11.1464 0.146447L0.146447 11.1464C-0.0488155 11.3417 -0.0488155 11.6583 0.146447 11.8536C0.341709 12.0488 0.658291 12.0488 0.853553 11.8536L11.8536 0.853553ZM11.8536 4.64645C12.0488 4.84171 12.0488 5.15829 11.8536 5.35355L5.35355 11.8536C5.15829 12.0488 4.84171 12.0488 4.64645 11.8536C4.45118 11.6583 4.45118 11.3417 4.64645 11.1464L11.1464 4.64645C11.3417 4.45118 11.6583 4.45118 11.8536 4.64645ZM11.8536 8.64645C12.0488 8.84171 12.0488 9.15829 11.8536 9.35355L9.35355 11.8536C9.15829 12.0488 8.84171 12.0488 8.64645 11.8536C8.45118 11.6583 8.45118 11.3417 8.64645 11.1464L11.1464 8.64645C11.3417 8.45118 11.6583 8.45118 11.8536 8.64645Z", fill: "currentColor" }))), !this.disabled && !this.hideReadOnlyIcon && this.readOnly && (h("span", { key: '8628c6ab7310a8dcf7bb2e9f95660a93dc4da3b4', class: "textarea-icon__readonly" }, h("tds-tooltip", { key: '50f5e91b88f8e5e97ec656bed783949464ef8723', placement: "top-end", text: "This field is non-editable", selector: "#readonly-tooltip" }), h("tds-icon", { key: '3c86f76ddfe425385c9c9b93b0ed3a1e0baf2b20', id: "readonly-tooltip", name: "edit_inactive", svgTitle: "inactive" })))), h("span", { key: '42d22b4fd71e5db663d775e930ae6cc7323a89ec', class: 'textarea-helper', "aria-live": "assertive", id: `textarea-helper-element-${this.uuid}` }, this.state === 'error' && this.helper && !this.readOnly && (h("tds-icon", { key: '088af2b39b4864f48e751d4b44c6d069ebf8ccd6', name: "error", size: "16px" })), this.helper), this.maxLength > 0 && (h("div", { key: 'f425416cfdaed26d6b7b7c619babe478bf63593b', class: 'textarea-textcounter' }, this.value === null ? 0 : (_a = this.value) === null || _a === void 0 ? void 0 : _a.length, h("span", { key: '4d68979b2b8a5601f3b62612f09eb5223cc0490b', class: "textfield-textcounter-divider" }, " / "), " ", this.maxLength))));
|
|
97
98
|
}
|
|
99
|
+
get host() { return this; }
|
|
98
100
|
static get style() { return TdsTextareaStyle0; }
|
|
99
101
|
}, [2, "tds-textarea", {
|
|
100
102
|
"label": [1],
|
|
@@ -3,7 +3,7 @@ import { g as generateUniqueId } from './p-11648030.js';
|
|
|
3
3
|
import { h as hasSlot } from './p-ae110fc2.js';
|
|
4
4
|
import { d as defineCustomElement$2 } from './p-b390ece5.js';
|
|
5
5
|
|
|
6
|
-
const toastCss = ":host(.hide){display:none;visibility:hidden}:host{z-index:800}:host .wrapper{display:flex;width:348px;background-color:var(--tds-toast-background-color);border-radius:4px}:host .wrapper.information{border-left:4px solid var(--tds-toast-
|
|
6
|
+
const toastCss = ":host(.hide){display:none;visibility:hidden}:host{z-index:800}:host .wrapper{display:flex;width:348px;background-color:var(--tds-toast-background-color);border-radius:4px}:host .wrapper.information{border-left:4px solid var(--tds-toast-color-info)}:host .wrapper.information tds-icon{color:var(--tds-toast-color-info)}:host .wrapper.success{border-left:4px solid var(--tds-toast-color-success)}:host .wrapper.success tds-icon{color:var(--tds-toast-color-success)}:host .wrapper.error{border-left:4px solid var(--tds-toast-color-error)}:host .wrapper.error tds-icon{color:var(--tds-toast-color-error)}:host .wrapper.warning{border-left:4px solid var(--tds-toast-color-warning)}:host .wrapper.warning tds-icon{color:var(--tds-toast-icon-color-warning)}:host .wrapper button.close{height:20px;width:20px;display:flex;align-items:center;justify-content:center;margin:14px 14px 0 22px;border:none;background:transparent}:host .wrapper button.close:hover{cursor:pointer}:host .wrapper button.close: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 .wrapper button.close tds-icon{color:var(--tds-toast-dissmiss-color);padding:0}:host tds-icon{padding:14px 0 0 12px}:host .content{padding:16px 0 16px 10px;display:flex;flex-direction:column;flex:1;max-width:250px;word-break:break-word}:host .content .header-subheader{display:flex;flex-direction:column;gap:4px}:host .content .header,:host .content slot[name=header]::slotted(*){font:var(--tds-headline-07) !important;letter-spacing:var(--tds-headline-07-ls) !important;color:var(--tds-toast-headline-color)}:host .content .subheader,:host .content slot[name=subheader]::slotted(*){color:var(--tds-toast-subheadline-color);font:var(--tds-detail-02) !important;letter-spacing:var(--tds-detail-02-ls) !important}:host .content .subheader.no-link slot::slotted(*),:host .content slot[name=subheader]::slotted(*).no-link slot::slotted(*){padding-bottom:0}:host .content .toast-bottom{padding-top:12px}:host .tds-mode-variant-primary{--tds-toast-background:var(--tds-toast-background-primary)}:host .tds-mode-variant-secondary{--tds-toast-background:var(--tds-toast-background-secondary)}";
|
|
7
7
|
const TdsToastStyle0 = toastCss;
|
|
8
8
|
|
|
9
9
|
const TdsToast$1 = /*@__PURE__*/ proxyCustomElement(class TdsToast extends H {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gets the appropriate aria-invalid value for form components.
|
|
3
|
+
*
|
|
4
|
+
* This utility handles cross-framework compatibility by checking for an explicit
|
|
5
|
+
* aria-invalid attribute on the host element first, then falling back to the
|
|
6
|
+
* component's state. It properly handles both string and boolean values that
|
|
7
|
+
* may be passed from different frameworks (especially React).
|
|
8
|
+
*
|
|
9
|
+
* @param host - The host element to check for aria-invalid attribute
|
|
10
|
+
* @param state - The component's state ('error', 'success', 'default')
|
|
11
|
+
* @returns The aria-invalid value as a string ('true' or 'false')
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
const getAriaInvalid = (host, state) => {
|
|
15
|
+
const hostAriaInvalid = host.getAttribute('aria-invalid');
|
|
16
|
+
if (hostAriaInvalid !== null) {
|
|
17
|
+
return String(hostAriaInvalid);
|
|
18
|
+
}
|
|
19
|
+
// Fallback to state-based aria-invalid
|
|
20
|
+
return state === 'error' ? 'true' : 'false';
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { getAriaInvalid as g };
|
|
@@ -84,10 +84,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
84
84
|
return import(
|
|
85
85
|
/* webpackMode: "lazy" */
|
|
86
86
|
'./tds-breadcrumbs.entry.js').then(processMod, consoleError);
|
|
87
|
-
case 'tds-button':
|
|
88
|
-
return import(
|
|
89
|
-
/* webpackMode: "lazy" */
|
|
90
|
-
'./tds-button.entry.js').then(processMod, consoleError);
|
|
91
87
|
case 'tds-card':
|
|
92
88
|
return import(
|
|
93
89
|
/* webpackMode: "lazy" */
|
|
@@ -304,10 +300,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
304
300
|
return import(
|
|
305
301
|
/* webpackMode: "lazy" */
|
|
306
302
|
'./tds-tag.entry.js').then(processMod, consoleError);
|
|
307
|
-
case 'tds-text-field':
|
|
308
|
-
return import(
|
|
309
|
-
/* webpackMode: "lazy" */
|
|
310
|
-
'./tds-text-field.entry.js').then(processMod, consoleError);
|
|
311
303
|
case 'tds-textarea':
|
|
312
304
|
return import(
|
|
313
305
|
/* webpackMode: "lazy" */
|
|
@@ -320,10 +312,10 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
320
312
|
return import(
|
|
321
313
|
/* webpackMode: "lazy" */
|
|
322
314
|
'./tds-toggle.entry.js').then(processMod, consoleError);
|
|
323
|
-
case 'tds-
|
|
315
|
+
case 'tds-button_2':
|
|
324
316
|
return import(
|
|
325
317
|
/* webpackMode: "lazy" */
|
|
326
|
-
'./tds-
|
|
318
|
+
'./tds-button_2.entry.js').then(processMod, consoleError);
|
|
327
319
|
case 'tds-dropdown_2':
|
|
328
320
|
return import(
|
|
329
321
|
/* webpackMode: "lazy" */
|
|
@@ -344,6 +336,10 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
344
336
|
return import(
|
|
345
337
|
/* webpackMode: "lazy" */
|
|
346
338
|
'./tds-side-menu-user-image_2.entry.js').then(processMod, consoleError);
|
|
339
|
+
case 'tds-text-field':
|
|
340
|
+
return import(
|
|
341
|
+
/* webpackMode: "lazy" */
|
|
342
|
+
'./tds-text-field.entry.js').then(processMod, consoleError);
|
|
347
343
|
case 'tds-popover-canvas':
|
|
348
344
|
return import(
|
|
349
345
|
/* webpackMode: "lazy" */
|