@scania/tegel 1.27.0 → 1.27.1
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-dropdown_2.cjs.entry.js +8 -8
- package/dist/cjs/tds-footer-group.cjs.entry.js +27 -5
- package/dist/cjs/tds-footer-item.cjs.entry.js +2 -2
- package/dist/cjs/tds-footer.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-brand-symbol.cjs.entry.js +6 -2
- package/dist/cjs/tds-header-dropdown.cjs.entry.js +26 -3
- package/dist/cjs/tds-header-hamburger.cjs.entry.js +7 -1
- package/dist/cjs/tds-header-launcher-button.cjs.entry.js +2 -1
- package/dist/cjs/tds-header-launcher.cjs.entry.js +23 -2
- package/dist/cjs/tds-icon.cjs.entry.js +3 -2
- package/dist/cjs/tds-inline-tabs.cjs.entry.js +1 -1
- package/dist/cjs/tds-modal.cjs.entry.js +75 -3
- package/dist/cjs/tds-navigation-tabs.cjs.entry.js +1 -1
- package/dist/cjs/tds-popover-canvas.cjs.entry.js +3 -2
- package/dist/cjs/tds-popover-core.cjs.entry.js +55 -11
- package/dist/cjs/tds-popover-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/tds-popover-menu.cjs.entry.js +1 -1
- package/dist/cjs/tds-radio-button.cjs.entry.js +3 -1
- package/dist/cjs/tds-spinner.cjs.entry.js +1 -1
- package/dist/cjs/tds-step.cjs.entry.js +2 -1
- package/dist/cjs/tds-stepper.cjs.entry.js +2 -1
- package/dist/cjs/tds-text-field.cjs.entry.js +31 -16
- package/dist/cjs/tds-textarea.cjs.entry.js +27 -9
- package/dist/cjs/tds-toast.cjs.entry.js +10 -3
- package/dist/cjs/tds-toggle.cjs.entry.js +2 -2
- package/dist/cjs/tds-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/tegel.cjs.js +1 -1
- package/dist/collection/components/dropdown/dropdown.js +8 -8
- package/dist/collection/components/footer/footer-group/footer-group.css +23 -21
- package/dist/collection/components/footer/footer-group/footer-group.js +55 -5
- package/dist/collection/components/footer/footer-item/footer-item.css +17 -17
- package/dist/collection/components/footer/footer-item/footer-item.js +2 -2
- package/dist/collection/components/footer/footer.css +1 -1
- package/dist/collection/components/header/header-brand-symbol/header-brand-symbol.css +1 -1
- package/dist/collection/components/header/header-brand-symbol/header-brand-symbol.js +6 -2
- package/dist/collection/components/header/header-dropdown/header-dropdown.js +49 -3
- package/dist/collection/components/header/header-hamburger/header-hamburger.js +30 -1
- package/dist/collection/components/header/header-launcher/header-launcher.js +50 -2
- package/dist/collection/components/header/header-launcher-button/header-launcher-button.js +19 -1
- package/dist/collection/components/icon/icon.js +21 -2
- package/dist/collection/components/modal/modal.css +48 -43
- package/dist/collection/components/modal/modal.js +103 -3
- package/dist/collection/components/popover-canvas/popover-canvas.js +21 -2
- package/dist/collection/components/popover-core/popover-core.js +63 -10
- package/dist/collection/components/popover-core/tds-popover-core.css +123 -66
- package/dist/collection/components/popover-menu/popover-menu-item/popover-menu-item.js +2 -2
- package/dist/collection/components/popover-menu/popover-menu.js +1 -1
- package/dist/collection/components/radio-button/radio-button.js +37 -1
- package/dist/collection/components/spinner/spinner.css +62 -39
- package/dist/collection/components/stepper/step/step.js +19 -1
- package/dist/collection/components/stepper/stepper.js +20 -1
- package/dist/collection/components/tabs/inline-tabs/inline-tabs.css +0 -1
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.css +2 -3
- package/dist/collection/components/text-field/text-field.css +21 -9
- package/dist/collection/components/text-field/text-field.js +48 -15
- package/dist/collection/components/textarea/textarea.css +11 -6
- package/dist/collection/components/textarea/textarea.js +61 -8
- package/dist/collection/components/toast/toast.js +45 -3
- package/dist/collection/components/toggle/toggle.js +2 -2
- package/dist/collection/components/tooltip/tooltip.js +2 -2
- package/dist/components/{p-2d93a742.js → p-1c606f82.js} +1 -1
- package/dist/components/p-252f3d4d.js +2098 -0
- package/dist/components/p-3dcfe1f4.js +115 -0
- package/dist/components/{p-53e4cdcf.js → p-789bb453.js} +5 -3
- package/dist/components/{p-4487c541.js → p-92fb75a7.js} +4 -2
- package/dist/components/{p-663b8e51.js → p-c0b84c59.js} +9 -9
- package/dist/components/{p-83db8b35.js → p-f8a36676.js} +5 -3
- package/dist/components/tds-accordion-item.js +1 -1
- package/dist/components/tds-banner.js +1 -1
- package/dist/components/tds-datetime.js +1 -1
- package/dist/components/tds-dropdown-option.js +1 -1
- package/dist/components/tds-dropdown.js +1 -1
- package/dist/components/tds-folder-tabs.js +1 -1
- package/dist/components/tds-footer-group.js +32 -8
- package/dist/components/tds-footer-item.js +3 -3
- package/dist/components/tds-footer.js +1 -1
- package/dist/components/tds-header-brand-symbol.js +6 -2
- package/dist/components/tds-header-cell.js +1 -1
- package/dist/components/tds-header-dropdown.js +31 -7
- package/dist/components/tds-header-hamburger.js +11 -3
- package/dist/components/tds-header-launcher-button.js +1 -1
- package/dist/components/tds-header-launcher.js +29 -7
- package/dist/components/tds-icon.js +1 -1
- package/dist/components/tds-inline-tabs.js +2 -2
- package/dist/components/tds-message.js +1 -1
- package/dist/components/tds-modal.js +79 -5
- package/dist/components/tds-navigation-tabs.js +2 -2
- package/dist/components/tds-popover-canvas.js +1 -1
- package/dist/components/tds-popover-core.js +1 -1
- package/dist/components/tds-popover-menu-item.js +2 -2
- package/dist/components/tds-popover-menu.js +2 -2
- package/dist/components/tds-radio-button.js +6 -2
- package/dist/components/tds-side-menu-close-button.js +1 -1
- package/dist/components/tds-side-menu-dropdown.js +1 -1
- package/dist/components/tds-slider.js +1 -1
- package/dist/components/tds-spinner.js +1 -1
- package/dist/components/tds-step.js +4 -2
- package/dist/components/tds-stepper.js +4 -2
- package/dist/components/tds-table-body-input-wrapper.js +1 -1
- package/dist/components/tds-table-footer.js +3 -3
- package/dist/components/tds-table-header-input-wrapper.js +1 -1
- package/dist/components/tds-table-toolbar.js +1 -1
- package/dist/components/tds-text-field.js +33 -17
- package/dist/components/tds-textarea.js +43 -11
- package/dist/components/tds-toast.js +13 -4
- package/dist/components/tds-toggle.js +2 -2
- package/dist/components/tds-tooltip.js +1 -113
- package/dist/esm/index-51d04e39.js +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tds-dropdown_2.entry.js +8 -8
- package/dist/esm/tds-footer-group.entry.js +27 -5
- package/dist/esm/tds-footer-item.entry.js +3 -3
- package/dist/esm/tds-footer.entry.js +1 -1
- package/dist/esm/tds-header-brand-symbol.entry.js +6 -2
- package/dist/esm/tds-header-dropdown.entry.js +26 -3
- package/dist/esm/tds-header-hamburger.entry.js +7 -1
- package/dist/esm/tds-header-launcher-button.entry.js +2 -1
- package/dist/esm/tds-header-launcher.entry.js +23 -2
- package/dist/esm/tds-icon.entry.js +3 -2
- package/dist/esm/tds-inline-tabs.entry.js +1 -1
- package/dist/esm/tds-modal.entry.js +75 -3
- package/dist/esm/tds-navigation-tabs.entry.js +1 -1
- package/dist/esm/tds-popover-canvas.entry.js +3 -2
- package/dist/esm/tds-popover-core.entry.js +55 -11
- package/dist/esm/tds-popover-menu-item.entry.js +2 -2
- package/dist/esm/tds-popover-menu.entry.js +1 -1
- package/dist/esm/tds-radio-button.entry.js +3 -1
- package/dist/esm/tds-spinner.entry.js +1 -1
- package/dist/esm/tds-step.entry.js +2 -1
- package/dist/esm/tds-stepper.entry.js +2 -1
- package/dist/esm/tds-text-field.entry.js +31 -16
- package/dist/esm/tds-textarea.entry.js +27 -9
- package/dist/esm/tds-toast.entry.js +10 -3
- package/dist/esm/tds-toggle.entry.js +2 -2
- package/dist/esm/tds-tooltip.entry.js +2 -2
- package/dist/esm/tegel.js +1 -1
- package/dist/tegel/p-033d991e.entry.js +1 -0
- package/dist/tegel/p-24db6b5b.entry.js +1 -0
- package/dist/tegel/p-27a4a7d0.entry.js +1 -0
- package/dist/tegel/p-28cf7204.entry.js +1 -0
- package/dist/tegel/p-302fea99.entry.js +1 -0
- package/dist/tegel/p-31bc440c.entry.js +1 -0
- package/dist/tegel/p-3e9ca19a.entry.js +1 -0
- package/dist/tegel/p-44ac6a20.entry.js +1 -0
- package/dist/tegel/{p-769d0503.entry.js → p-46205cfb.entry.js} +1 -1
- package/dist/tegel/p-54a20280.entry.js +1 -0
- package/dist/tegel/p-5a3ff0d3.entry.js +1 -0
- package/dist/tegel/p-660176d6.entry.js +1 -0
- package/dist/tegel/p-68e10acc.entry.js +1 -0
- package/dist/tegel/{p-eaa279dd.entry.js → p-81111221.entry.js} +1 -1
- package/dist/tegel/{p-668b7662.entry.js → p-8d7bf652.entry.js} +1 -1
- package/dist/tegel/p-b58f68f0.entry.js +1 -0
- package/dist/tegel/{p-5ba254ee.entry.js → p-c10be10e.entry.js} +1 -1
- package/dist/tegel/p-c71acb02.entry.js +1 -0
- package/dist/tegel/p-e1abd593.entry.js +1 -0
- package/dist/tegel/p-e3c3bdac.entry.js +1 -0
- package/dist/tegel/p-e46744bc.entry.js +1 -0
- package/dist/tegel/p-ea9e7345.entry.js +1 -0
- package/dist/tegel/{p-97f10223.entry.js → p-eec22b6b.entry.js} +1 -1
- package/dist/tegel/p-f034fc0c.entry.js +1 -0
- package/dist/tegel/p-fa342278.entry.js +1 -0
- package/dist/tegel/{p-b9f81e53.entry.js → p-fc6196c4.entry.js} +1 -1
- package/dist/tegel/tegel.css +4 -4
- package/dist/tegel/tegel.esm.js +1 -1
- package/dist/types/components/footer/footer-group/footer-group.d.ts +7 -0
- package/dist/types/components/header/header-brand-symbol/header-brand-symbol.d.ts +1 -1
- package/dist/types/components/header/header-dropdown/header-dropdown.d.ts +4 -0
- package/dist/types/components/header/header-hamburger/header-hamburger.d.ts +3 -0
- package/dist/types/components/header/header-launcher/header-launcher.d.ts +4 -0
- package/dist/types/components/header/header-launcher-button/header-launcher-button.d.ts +2 -0
- package/dist/types/components/icon/icon.d.ts +2 -0
- package/dist/types/components/modal/modal.d.ts +6 -0
- package/dist/types/components/popover-canvas/popover-canvas.d.ts +2 -0
- package/dist/types/components/popover-core/popover-core.d.ts +4 -0
- package/dist/types/components/radio-button/radio-button.d.ts +4 -0
- package/dist/types/components/stepper/step/step.d.ts +1 -0
- package/dist/types/components/stepper/stepper.d.ts +2 -0
- package/dist/types/components/text-field/text-field.d.ts +6 -4
- package/dist/types/components/textarea/textarea.d.ts +10 -4
- package/dist/types/components/toast/toast.d.ts +5 -0
- package/dist/types/components.d.ts +130 -0
- package/package.json +1 -1
- package/dist/components/p-90dbeab3.js +0 -2052
- package/dist/tegel/p-035e58e6.entry.js +0 -1
- package/dist/tegel/p-22c592eb.entry.js +0 -1
- package/dist/tegel/p-288a09ef.entry.js +0 -1
- package/dist/tegel/p-4f5f152a.entry.js +0 -1
- package/dist/tegel/p-542d7b3e.entry.js +0 -1
- package/dist/tegel/p-5a7110b8.entry.js +0 -1
- package/dist/tegel/p-5db5c8f4.entry.js +0 -1
- package/dist/tegel/p-654785d2.entry.js +0 -1
- package/dist/tegel/p-66f394a2.entry.js +0 -1
- package/dist/tegel/p-727f873f.entry.js +0 -1
- package/dist/tegel/p-746e2927.entry.js +0 -1
- package/dist/tegel/p-754a4921.entry.js +0 -1
- package/dist/tegel/p-aef6b130.entry.js +0 -1
- package/dist/tegel/p-b114ec3d.entry.js +0 -1
- package/dist/tegel/p-b39ffad4.entry.js +0 -1
- package/dist/tegel/p-b686f1ad.entry.js +0 -1
- package/dist/tegel/p-c56be8d1.entry.js +0 -1
- package/dist/tegel/p-dfbbaefd.entry.js +0 -1
- package/dist/tegel/p-ea3e071f.entry.js +0 -1
- package/dist/tegel/p-ee7f07ae.entry.js +0 -1
|
@@ -11,11 +11,13 @@ export class TdsTextarea {
|
|
|
11
11
|
this.value = '';
|
|
12
12
|
this.disabled = false;
|
|
13
13
|
this.readOnly = false;
|
|
14
|
+
this.hideReadOnlyIcon = false;
|
|
14
15
|
this.state = 'default';
|
|
15
16
|
this.maxLength = undefined;
|
|
16
17
|
this.modeVariant = null;
|
|
17
18
|
this.autofocus = false;
|
|
18
19
|
this.noMinWidth = false;
|
|
20
|
+
this.tdsAriaLabel = undefined;
|
|
19
21
|
this.focusInput = undefined;
|
|
20
22
|
}
|
|
21
23
|
handleChange(event) {
|
|
@@ -27,8 +29,10 @@ export class TdsTextarea {
|
|
|
27
29
|
}
|
|
28
30
|
// Data input event in value prop
|
|
29
31
|
handleInput(event) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
if (event.target instanceof HTMLInputElement) {
|
|
33
|
+
this.value = event.target.value;
|
|
34
|
+
this.tdsInput.emit(event);
|
|
35
|
+
}
|
|
32
36
|
}
|
|
33
37
|
/* Set the input as focus when clicking the whole textarea with suffix/prefix */
|
|
34
38
|
handleFocus(event) {
|
|
@@ -36,21 +40,35 @@ export class TdsTextarea {
|
|
|
36
40
|
this.focusInput = true;
|
|
37
41
|
this.tdsFocus.emit(event);
|
|
38
42
|
}
|
|
43
|
+
setModeVariant(modeVariant) {
|
|
44
|
+
if (this.readOnly && modeVariant === 'primary') {
|
|
45
|
+
return 'secondary';
|
|
46
|
+
}
|
|
47
|
+
if (this.readOnly && modeVariant === 'secondary') {
|
|
48
|
+
return 'primary';
|
|
49
|
+
}
|
|
50
|
+
return modeVariant;
|
|
51
|
+
}
|
|
52
|
+
connectedCallback() {
|
|
53
|
+
if (!this.tdsAriaLabel && !this.label) {
|
|
54
|
+
console.warn('Tegel Textarea component: specify label or tdsAriaLabel prop for accessibility');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
39
57
|
render() {
|
|
40
58
|
var _a;
|
|
41
|
-
return (h("div", { key: '
|
|
59
|
+
return (h("div", { key: 'b50538b818f0e82cca94db22f91a8ee73e009ca7', class: {
|
|
42
60
|
'textarea-container': true,
|
|
43
61
|
'textarea-label-inside': this.labelPosition === 'inside',
|
|
44
62
|
'textarea-focus': this.focusInput,
|
|
45
63
|
'textarea-disabled': this.disabled,
|
|
46
|
-
'textarea-readonly': this.readOnly,
|
|
47
|
-
[`tds-mode-variant-${this.modeVariant}`]:
|
|
64
|
+
'textarea-readonly': !this.disabled && this.readOnly,
|
|
65
|
+
[`tds-mode-variant-${this.setModeVariant(this.modeVariant)}`]: true,
|
|
48
66
|
'textarea-data': this.value !== '',
|
|
49
67
|
[`textarea-${this.state}`]: this.state === 'error' || this.state === 'success',
|
|
50
68
|
'no-min-width': this.noMinWidth,
|
|
51
|
-
} }, this.labelPosition !== 'no-label' && h("
|
|
69
|
+
} }, this.labelPosition !== 'no-label' && (h("label", { key: 'f96e68827795a3402d4261ffab997e5c9292fd20', htmlFor: "textarea-element", class: 'textarea-label' }, this.label)), h("div", { key: '0ed06e68cc15d78d4afead9404e89040229edb6e', class: "textarea-wrapper" }, h("textarea", { key: 'a15b5762cc8288e0b0e9631707055091062d0e95', id: "textarea-element", class: 'textarea-input', ref: (inputEl) => {
|
|
52
70
|
this.textEl = inputEl;
|
|
53
|
-
}, disabled: this.disabled, readonly: 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) => {
|
|
71
|
+
}, 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) => {
|
|
54
72
|
if (!this.readOnly) {
|
|
55
73
|
this.handleFocus(event);
|
|
56
74
|
}
|
|
@@ -58,7 +76,7 @@ export class TdsTextarea {
|
|
|
58
76
|
if (!this.readOnly) {
|
|
59
77
|
this.handleBlur(event);
|
|
60
78
|
}
|
|
61
|
-
}, onInput: (event) => this.handleInput(event), onChange: (event) => this.handleChange(event) }), h("span", { key: '
|
|
79
|
+
}, onInput: (event) => this.handleInput(event), onChange: (event) => this.handleChange(event), "aria-invalid": this.state === 'error' ? 'true' : 'false', "aria-readonly": this.readOnly ? 'true' : 'false', "aria-label": this.tdsAriaLabel ? this.tdsAriaLabel : this.label, "aria-describedby": "textarea-helper-element" }), h("span", { key: '904e38bce9b98c8ea06428c26083bc3d7476b845', class: "textarea-resizer-icon" }, h("svg", { key: '59e3404d79da1dfad42788e5f6e90e47752d603e', width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '8e91b396a4337c0c56b0e8131d96aae5595506d9', "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: '4c4629c89b4b2545a8482a0cd6c59b7c57888aa8', class: "textarea-icon__readonly" }, h("tds-tooltip", { key: 'cae2de2a71c2891067303188f54d7c1b186886ff', placement: "top-end", text: "This field is non-editable", selector: "#readonly-tooltip" }), h("tds-icon", { key: 'a09a265f4684d2356886a23cdef4a570d8323c04', id: "readonly-tooltip", name: "edit_inactive" })))), h("span", { key: '5862f0cb512faf37724629642c6560bdde90e47e', class: 'textarea-helper', "aria-live": "assertive", id: "textarea-helper-element" }, this.state === 'error' && !this.readOnly && h("tds-icon", { key: 'cc0202e6e28daf0664fb3446fd4118e453e89cff', name: "error", size: "16px" }), this.helper), this.maxLength > 0 && (h("div", { key: '6e1c683c4036b8aa9924ca69d4dda6b2b3a5fd8a', class: 'textarea-textcounter' }, this.value === null ? 0 : (_a = this.value) === null || _a === void 0 ? void 0 : _a.length, h("span", { key: '2eb15f11eb7b8abe3741bc9d4dde13ba2fa02d8a', class: "textfield-textcounter-divider" }, " / "), " ", this.maxLength))));
|
|
62
80
|
}
|
|
63
81
|
static get is() { return "tds-textarea"; }
|
|
64
82
|
static get encapsulation() { return "scoped"; }
|
|
@@ -251,6 +269,24 @@ export class TdsTextarea {
|
|
|
251
269
|
"reflect": false,
|
|
252
270
|
"defaultValue": "false"
|
|
253
271
|
},
|
|
272
|
+
"hideReadOnlyIcon": {
|
|
273
|
+
"type": "boolean",
|
|
274
|
+
"mutable": false,
|
|
275
|
+
"complexType": {
|
|
276
|
+
"original": "boolean",
|
|
277
|
+
"resolved": "boolean",
|
|
278
|
+
"references": {}
|
|
279
|
+
},
|
|
280
|
+
"required": false,
|
|
281
|
+
"optional": false,
|
|
282
|
+
"docs": {
|
|
283
|
+
"tags": [],
|
|
284
|
+
"text": "Hide the readonly icon"
|
|
285
|
+
},
|
|
286
|
+
"attribute": "hide-read-only-icon",
|
|
287
|
+
"reflect": false,
|
|
288
|
+
"defaultValue": "false"
|
|
289
|
+
},
|
|
254
290
|
"state": {
|
|
255
291
|
"type": "string",
|
|
256
292
|
"mutable": false,
|
|
@@ -339,6 +375,23 @@ export class TdsTextarea {
|
|
|
339
375
|
"attribute": "no-min-width",
|
|
340
376
|
"reflect": false,
|
|
341
377
|
"defaultValue": "false"
|
|
378
|
+
},
|
|
379
|
+
"tdsAriaLabel": {
|
|
380
|
+
"type": "string",
|
|
381
|
+
"mutable": false,
|
|
382
|
+
"complexType": {
|
|
383
|
+
"original": "string",
|
|
384
|
+
"resolved": "string",
|
|
385
|
+
"references": {}
|
|
386
|
+
},
|
|
387
|
+
"required": false,
|
|
388
|
+
"optional": false,
|
|
389
|
+
"docs": {
|
|
390
|
+
"tags": [],
|
|
391
|
+
"text": "Value to be used for the aria-label attribute. Can be used for announcing that readOnly prop is set to true."
|
|
392
|
+
},
|
|
393
|
+
"attribute": "tds-aria-label",
|
|
394
|
+
"reflect": false
|
|
342
395
|
}
|
|
343
396
|
};
|
|
344
397
|
}
|
|
@@ -45,6 +45,8 @@ export class TdsToast {
|
|
|
45
45
|
this.hidden = false;
|
|
46
46
|
this.closable = true;
|
|
47
47
|
this.toastRole = 'alert';
|
|
48
|
+
this.tdsCloseAriaLabel = undefined;
|
|
49
|
+
this.tdsAriaLive = 'polite';
|
|
48
50
|
}
|
|
49
51
|
/** Hides the Toast. */
|
|
50
52
|
async hideToast() {
|
|
@@ -54,16 +56,21 @@ export class TdsToast {
|
|
|
54
56
|
async showToast() {
|
|
55
57
|
this.hidden = false;
|
|
56
58
|
}
|
|
59
|
+
connectedCallback() {
|
|
60
|
+
if (!this.tdsCloseAriaLabel) {
|
|
61
|
+
console.warn('tds-toast: tdsCloseAriaLabel is required');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
57
64
|
render() {
|
|
58
65
|
const usesHeaderSlot = hasSlot('header', this.host);
|
|
59
66
|
const usesSubheaderSlot = hasSlot('subheader', this.host);
|
|
60
67
|
const usesActionsSlot = hasSlot('actions', this.host);
|
|
61
|
-
return (h(Host, { key: '
|
|
68
|
+
return (h(Host, { key: '57126c13e4498e7862026978aab347dbe7e24d63', "aria-live": this.tdsAriaLive, toastRole: this.toastRole, "aria-describedby": this.host.getAttribute('aria-describedby'), class: {
|
|
62
69
|
hide: this.hidden,
|
|
63
70
|
show: !this.hidden,
|
|
64
|
-
} }, h("div", { key: '
|
|
71
|
+
} }, h("div", { key: '099c769d8f2e54b76eada969978e641b3f5c18ea', class: `
|
|
65
72
|
wrapper
|
|
66
|
-
${this.variant}` }, h("tds-icon", { key: '
|
|
73
|
+
${this.variant}` }, h("tds-icon", { key: '60fe4a91c42741be76f882fd82daa4ae3f5de545', name: this.getIconName(), size: "20px" }), h("div", { key: '5c5f4221726b14a38a6fb440a7f15570bb17b3cf', class: `content` }, h("div", { key: '2b53199e99ab3417160af38d81301a61e66eaef0', class: "header-subheader" }, this.header && h("div", { key: 'c98f680755ba45a8661ca46f6064c696ee61b6bb', class: "header" }, this.header), usesHeaderSlot && h("slot", { key: '5420edf38e156a811187eb6f5838bd8611818673', name: "header" }), this.subheader && h("div", { key: '9dc6d054f0f2ee3d179f25a8e75134d73ab426e2', class: "subheader" }, this.subheader), usesSubheaderSlot && h("slot", { key: '726eec99d5f05bea48b5a30bf7e91a71099960f8', name: "subheader" })), usesActionsSlot && (h("div", { key: '1cb83584cdb4cc8e3d383ebdf5d470135f7573ab', class: `toast-bottom ${usesSubheaderSlot || this.subheader ? 'subheader' : 'no-subheader'}` }, h("slot", { key: '0950f174a2e62ffbec229ef24e4a999a318798cd', name: "actions" })))), this.closable && (h("button", { key: 'ee90c96c48a11e38f17acd8cb66a1619bd770e83', id: "my-button", "aria-label": this.tdsCloseAriaLabel, onClick: this.handleClose, class: "close" }, h("tds-icon", { key: '632aefc906f17bd0993c832f9c4c5a1ec8db1ccc', name: "cross", size: "20px" }))))));
|
|
67
74
|
}
|
|
68
75
|
static get is() { return "tds-toast"; }
|
|
69
76
|
static get encapsulation() { return "shadow"; }
|
|
@@ -202,6 +209,41 @@ export class TdsToast {
|
|
|
202
209
|
"attribute": "toast-role",
|
|
203
210
|
"reflect": false,
|
|
204
211
|
"defaultValue": "'alert'"
|
|
212
|
+
},
|
|
213
|
+
"tdsCloseAriaLabel": {
|
|
214
|
+
"type": "string",
|
|
215
|
+
"mutable": false,
|
|
216
|
+
"complexType": {
|
|
217
|
+
"original": "string",
|
|
218
|
+
"resolved": "string",
|
|
219
|
+
"references": {}
|
|
220
|
+
},
|
|
221
|
+
"required": false,
|
|
222
|
+
"optional": false,
|
|
223
|
+
"docs": {
|
|
224
|
+
"tags": [],
|
|
225
|
+
"text": "Provides an accessible name for the components close button"
|
|
226
|
+
},
|
|
227
|
+
"attribute": "tds-close-aria-label",
|
|
228
|
+
"reflect": false
|
|
229
|
+
},
|
|
230
|
+
"tdsAriaLive": {
|
|
231
|
+
"type": "string",
|
|
232
|
+
"mutable": false,
|
|
233
|
+
"complexType": {
|
|
234
|
+
"original": "'polite' | 'assertive'",
|
|
235
|
+
"resolved": "\"assertive\" | \"polite\"",
|
|
236
|
+
"references": {}
|
|
237
|
+
},
|
|
238
|
+
"required": false,
|
|
239
|
+
"optional": false,
|
|
240
|
+
"docs": {
|
|
241
|
+
"tags": [],
|
|
242
|
+
"text": "ARIA live for the Toast."
|
|
243
|
+
},
|
|
244
|
+
"attribute": "tds-aria-live",
|
|
245
|
+
"reflect": false,
|
|
246
|
+
"defaultValue": "'polite'"
|
|
205
247
|
}
|
|
206
248
|
};
|
|
207
249
|
}
|
|
@@ -38,10 +38,10 @@ export class TdsToggle {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
render() {
|
|
41
|
-
return (h("div", { key: '
|
|
41
|
+
return (h("div", { key: '8f8a77827f524c049aa004d15372a78e7fad41e2', class: "tds-toggle" }, this.headline && (h("div", { key: '8e254412e80362807046a893fc3f7c42a0c376ba', class: {
|
|
42
42
|
'toggle-headline': true,
|
|
43
43
|
'disabled': this.disabled,
|
|
44
|
-
} }, this.headline)), h("input", { key: '
|
|
44
|
+
} }, this.headline)), h("input", { key: '47ed1307b67b61b1594006449fb1b4ccf6d031b8', "aria-label": this.tdsAriaLabel, "aria-describedby": this.host.getAttribute('aria-describedby'), "aria-labelledby": this.host.getAttribute('aria-labelledby'), "aria-checked": this.checked, "aria-required": this.required, onChange: () => this.handleToggle(), class: `${this.size}`, checked: this.checked, disabled: this.disabled, required: this.required, type: "checkbox", name: this.name, id: this.toggleId, role: "switch" }), this.labelSlot && (h("label", { key: '75964d686710d6b4f8bbe365cc51c8aab3234d26', class: { disabled: this.disabled }, htmlFor: this.toggleId }, h("slot", { key: 'aeeaed1f37a160ce792df3f5115c75eaa0fd2c0a', name: "label" })))));
|
|
45
45
|
}
|
|
46
46
|
static get is() { return "tds-toggle"; }
|
|
47
47
|
static get encapsulation() { return "scoped"; }
|
|
@@ -58,7 +58,7 @@ export class TdsTooltip {
|
|
|
58
58
|
}
|
|
59
59
|
render() {
|
|
60
60
|
var _a;
|
|
61
|
-
return (h(Host, { key: '
|
|
61
|
+
return (h(Host, { key: '59eff46fa8b6f26ac7b43fff50f8f388d45d16a7', role: "tooltip", "aria-describedby": this.tdsAriaDescribedby, "aria-label": this.text }, h("tds-popover-core", Object.assign({ key: 'b6fb24abddaa4d7a804876891993b463a36e8610' }, this.inheritedAttributes, { class: {
|
|
62
62
|
'tds-tooltip': true,
|
|
63
63
|
[`tds-tooltip-${this.border}`]: true,
|
|
64
64
|
[(_a = this.inheritedAttributes.class) !== null && _a !== void 0 ? _a : '']: true,
|
|
@@ -71,7 +71,7 @@ export class TdsTooltip {
|
|
|
71
71
|
// @ts-ignore
|
|
72
72
|
onInternalTdsClose: () => {
|
|
73
73
|
this.show = false;
|
|
74
|
-
}, defaultShow: this.defaultShow }), this.text, h("slot", { key: '
|
|
74
|
+
}, defaultShow: this.defaultShow }), this.text, h("slot", { key: 'a1b4e5f08a1239a6a0d522b4057f6d529c9e79d9' }))));
|
|
75
75
|
}
|
|
76
76
|
static get is() { return "tds-tooltip"; }
|
|
77
77
|
static get encapsulation() { return "scoped"; }
|
|
@@ -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 { c as convertToString } from './p-a1181b1f.js';
|
|
3
3
|
import { d as defineCustomElement$2 } from './p-14ab9663.js';
|
|
4
|
-
import { d as defineCustomElement$1 } from './p-
|
|
4
|
+
import { d as defineCustomElement$1 } from './p-92fb75a7.js';
|
|
5
5
|
|
|
6
6
|
const dropdownOptionCss = ":host{box-sizing:border-box;display:block;background-color:var(--tds-dropdown-option-background)}:host *{box-sizing:border-box}:host .dropdown-option{color:var(--tds-dropdown-option-color);border-bottom:1px solid var(--tds-dropdown-option-border);font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);overflow-wrap:anywhere;transition:background-color var(--tds-motion-duration-fast-02) var(--tds-motion-easing-scania)}:host .dropdown-option.selected{background-color:var(--tds-dropdown-option-background-selected)}:host .dropdown-option.disabled{color:var(--tds-dropdown-option-color-disabled)}:host .dropdown-option button:focus{outline:2px solid var(--tds-blue-400);outline-offset:-2px}:host .dropdown-option button{all:unset;width:100%}:host .dropdown-option button.lg{padding:19px 0 20px}:host .dropdown-option button.md{padding:15px 0 16px}:host .dropdown-option button.sm{padding:11px 0 12px}:host .dropdown-option button.xs{padding:7px 0 8px}:host .dropdown-option button .single-select{display:flex;align-items:center;justify-content:space-between;padding:0 16px}:host .dropdown-option .multiselect{width:100%;height:100%}:host .dropdown-option .multiselect tds-checkbox{display:flex;height:100%;width:100%}:host .dropdown-option .multiselect tds-checkbox.lg{padding:15px 16px 16px}:host .dropdown-option .multiselect tds-checkbox.md{padding:11px 16px 12px}:host .dropdown-option .multiselect tds-checkbox.sm{padding:7px 16px 8px}:host .dropdown-option .multiselect tds-checkbox.xs{padding:7px 16px 8px}:host .dropdown-option:hover{background-color:var(--tds-dropdown-option-background-hover);cursor:pointer}:host .dropdown-option:hover.disabled{background-color:var(--tds-dropdown-option-background);cursor:not-allowed}:host([hidden]){display:none}";
|
|
7
7
|
const TdsDropdownOptionStyle0 = dropdownOptionCss;
|