@scania/tegel 1.38.0-handleValueChange-correct-logic-beta.0 → 1.38.0-support-paste-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/handlePasteEvent-901439bf.js +33 -0
- package/dist/cjs/index-ca8040ad.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/tds-core-header-item_2.cjs.entry.js +1 -1
- package/dist/cjs/tds-dropdown_2.cjs.entry.js +21 -49
- package/dist/cjs/tds-side-menu-collapse-button.cjs.entry.js +6 -4
- 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 +10 -39
- package/dist/cjs/tds-text-field.cjs.entry.js +31 -6
- package/dist/cjs/tds-textarea.cjs.entry.js +18 -3
- package/dist/cjs/tegel.cjs.js +1 -1
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +3 -13
- package/dist/collection/components/dropdown/dropdown.js +18 -48
- package/dist/collection/components/header/header-item/header-item.css +3 -3
- package/dist/collection/components/side-menu/side-menu-collapse-button/side-menu-collapse-button.js +6 -4
- package/dist/collection/components/side-menu/side-menu-dropdown-list-item/side-menu-dropdown-list-item.css +6 -84
- package/dist/collection/components/side-menu/side-menu-item/side-menu-item.css +6 -82
- package/dist/collection/components/slider/slider.css +28 -24
- package/dist/collection/components/slider/slider.js +9 -38
- package/dist/collection/components/text-field/text-field.js +31 -6
- package/dist/collection/components/textarea/textarea.js +18 -3
- package/dist/collection/utils/handlePasteEvent.js +29 -0
- package/dist/components/p-0cf97292.js +31 -0
- package/dist/components/{p-072bf53a.js → p-63437b77.js} +1 -1
- package/dist/components/{p-ad6babcd.js → p-6adb1ce3.js} +1 -1
- package/dist/components/{p-9a47d831.js → p-94bfc9f4.js} +19 -37
- package/dist/components/{p-c4318e35.js → p-d64878cb.js} +3 -13
- package/dist/components/{p-92c2da85.js → p-ea381f94.js} +1 -1
- 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 +1 -1
- package/dist/components/tds-header-hamburger.js +1 -1
- package/dist/components/tds-header-item.js +1 -1
- package/dist/components/tds-header-launcher-button.js +1 -1
- package/dist/components/tds-header-launcher.js +2 -2
- package/dist/components/tds-side-menu-collapse-button.js +7 -5
- 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 +12 -59
- package/dist/components/tds-table-footer.js +2 -2
- package/dist/components/tds-text-field.js +210 -1
- package/dist/components/tds-textarea.js +18 -3
- package/dist/esm/handlePasteEvent-eefa3884.js +31 -0
- package/dist/esm/index-51d04e39.js +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tds-core-header-item_2.entry.js +1 -1
- package/dist/esm/tds-dropdown_2.entry.js +21 -49
- package/dist/esm/tds-side-menu-collapse-button.entry.js +6 -4
- 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 +10 -39
- package/dist/esm/tds-text-field.entry.js +31 -6
- package/dist/esm/tds-textarea.entry.js +19 -4
- package/dist/esm/tegel.js +1 -1
- package/dist/tegel/p-06d3490c.entry.js +1 -0
- package/dist/tegel/p-0cf97292.js +1 -0
- package/dist/tegel/p-397c8969.entry.js +1 -0
- package/dist/tegel/p-5c077bb9.entry.js +1 -0
- package/dist/tegel/p-61a1dc59.entry.js +1 -0
- package/dist/tegel/p-a0591e58.entry.js +1 -0
- package/dist/tegel/p-a4f83463.entry.js +1 -0
- package/dist/tegel/p-a7a4fb4b.entry.js +1 -0
- package/dist/tegel/p-ae438c2e.entry.js +1 -0
- package/dist/tegel/tegel.css +1 -1
- package/dist/tegel/tegel.esm.js +1 -1
- package/dist/types/components/dropdown/dropdown.d.ts +0 -3
- package/dist/types/components/slider/slider.d.ts +0 -2
- package/dist/types/components/text-field/text-field.d.ts +1 -0
- package/dist/types/components/textarea/textarea.d.ts +2 -0
- package/dist/types/utils/handlePasteEvent.d.ts +9 -0
- package/package.json +1 -1
- package/dist/components/p-a0c21704.js +0 -187
- package/dist/tegel/p-2c9ea0be.entry.js +0 -1
- package/dist/tegel/p-2f9b15f6.entry.js +0 -1
- package/dist/tegel/p-336f2de3.entry.js +0 -1
- package/dist/tegel/p-7368906f.entry.js +0 -1
- package/dist/tegel/p-a98767ea.entry.js +0 -1
- package/dist/tegel/p-c465f9b8.entry.js +0 -1
- package/dist/tegel/p-c4f701f6.entry.js +0 -1
- package/dist/tegel/p-cd5103e3.entry.js +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import hasSlot from "../../utils/hasSlot";
|
|
3
3
|
import generateUniqueId from "../../utils/generateUniqueId";
|
|
4
|
+
import { handlePasteEvent } from "../../utils/handlePasteEvent";
|
|
4
5
|
/**
|
|
5
6
|
* @slot prefix - Slot for the prefix in the component.
|
|
6
7
|
* @slot suffix - Slot for the suffix in the component. Suffix is hidden when the input is in readonly state.
|
|
@@ -50,6 +51,30 @@ export class TdsTextField {
|
|
|
50
51
|
this.value = value;
|
|
51
52
|
this.tdsInput.emit(event);
|
|
52
53
|
}
|
|
54
|
+
// Handle paste events to ensure input events are triggered
|
|
55
|
+
handlePaste(event) {
|
|
56
|
+
const inputEl = event.target;
|
|
57
|
+
// Create a value processor for number inputs with min/max validation
|
|
58
|
+
const valueProcessor = (value) => {
|
|
59
|
+
if (this.type === 'number') {
|
|
60
|
+
const numericValue = Number(value);
|
|
61
|
+
if (this.min !== undefined && numericValue < Number(this.min)) {
|
|
62
|
+
return String(this.min);
|
|
63
|
+
}
|
|
64
|
+
if (this.max !== undefined && numericValue > Number(this.max)) {
|
|
65
|
+
return String(this.max);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return value;
|
|
69
|
+
};
|
|
70
|
+
// Create a callback to handle the synthetic input event
|
|
71
|
+
const onInputCallback = (syntheticEvent) => {
|
|
72
|
+
this.value = inputEl.value;
|
|
73
|
+
this.tdsInput.emit(syntheticEvent);
|
|
74
|
+
};
|
|
75
|
+
// Use the utility function
|
|
76
|
+
handlePasteEvent(inputEl, onInputCallback, valueProcessor);
|
|
77
|
+
}
|
|
53
78
|
/** Set the input as focus when clicking the whole Text Field with suffix/prefix */
|
|
54
79
|
handleFocus(event) {
|
|
55
80
|
this.textInput.focus();
|
|
@@ -71,7 +96,7 @@ export class TdsTextField {
|
|
|
71
96
|
var _a;
|
|
72
97
|
const usesPrefixSlot = hasSlot('prefix', this.host);
|
|
73
98
|
const usesSuffixSlot = hasSlot('suffix', this.host);
|
|
74
|
-
return (h("div", { key: '
|
|
99
|
+
return (h("div", { key: 'b37e6dd9aa339eeee50726de43b819c9a0dafad3', class: {
|
|
75
100
|
'form-text-field': true,
|
|
76
101
|
'form-text-field-nomin': this.noMinWidth,
|
|
77
102
|
'text-field-focus': this.focusInput && !this.disabled,
|
|
@@ -89,19 +114,19 @@ export class TdsTextField {
|
|
|
89
114
|
'form-text-field-sm': this.size === 'sm',
|
|
90
115
|
'form-text-field-error': this.state === 'error',
|
|
91
116
|
'form-text-field-success': this.state === 'success',
|
|
92
|
-
} }, this.labelPosition === 'outside' && (h("div", { key: '
|
|
117
|
+
} }, this.labelPosition === 'outside' && (h("div", { key: '7ac5bf6dec464b5216e77a1fefe765b5ebfabfbd', class: "text-field-label-outside" }, h("label", { key: '6b4e66e93f67a3e299e6777006c468bc17c7bef1', htmlFor: `text-field-input-element-${this.uuid}` }, this.label))), h("div", { key: '2e14fcb37fecca77461e15cece8ae0086aa26ad4', onClick: () => this.textInput.focus(), class: "text-field-container" }, usesPrefixSlot && (h("div", { key: 'f6a4d22482c7a036e25386ed2173c9d8689664f7', class: {
|
|
93
118
|
'text-field-slot-wrap-prefix': true,
|
|
94
119
|
'text-field-error': this.state === 'error',
|
|
95
120
|
'text-field-success': this.state === 'success',
|
|
96
121
|
'text-field-default': this.state === 'default',
|
|
97
|
-
} }, h("slot", { key: '
|
|
122
|
+
} }, h("slot", { key: '2ab91f5db4dcea2ee7c24e0705593b34f6eccc51', name: "prefix" }))), h("div", { key: '7a6114e3cce7c286292b7f16301a2d11e0ef535b', class: "text-field-input-container" }, h("input", { key: '51c00d7f54c8b49051d50ff5375da082ca4482b0', ref: (inputEl) => {
|
|
98
123
|
this.textInput = inputEl;
|
|
99
124
|
}, class: {
|
|
100
125
|
'text-field-input': true,
|
|
101
126
|
'text-field-input-sm': this.size === 'sm',
|
|
102
127
|
'text-field-input-md': this.size === 'md',
|
|
103
128
|
'text-field-input-lg': this.size === 'lg',
|
|
104
|
-
}, 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) => {
|
|
129
|
+
}, 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), onPaste: (event) => this.handlePaste(event), onFocus: (event) => {
|
|
105
130
|
if (!this.readOnly) {
|
|
106
131
|
this.handleFocus(event);
|
|
107
132
|
}
|
|
@@ -109,13 +134,13 @@ export class TdsTextField {
|
|
|
109
134
|
if (!this.readOnly) {
|
|
110
135
|
this.handleBlur(event);
|
|
111
136
|
}
|
|
112
|
-
}, "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: '
|
|
137
|
+
}, "aria-invalid": this.state === 'error' ? 'true' : 'false', "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: 'bcdcbaa0abfe6d15519c5bdf4a713c672e4ae039', class: "text-field-label-inside", htmlFor: `text-field-input-element-${this.uuid}` }, this.label))), usesSuffixSlot && (h("div", { key: '186d2831637d2e5817879a1b8f578c36fba07e06', class: {
|
|
113
138
|
'text-field-slot-wrap-suffix': true,
|
|
114
139
|
'text-field-error': this.state === 'error',
|
|
115
140
|
'text-field-success': this.state === 'success',
|
|
116
141
|
'text-field-default': this.state === 'default',
|
|
117
142
|
'tds-u-display-none': this.readOnly,
|
|
118
|
-
} }, h("slot", { key: '
|
|
143
|
+
} }, h("slot", { key: 'ddb3f21a1189e36530ab62a3166115f0c805974a', name: "suffix" }))), this.readOnly && !this.hideReadOnlyIcon && (h("span", { key: '0a03400c53cdde6795474e38b55ac4a62c738f22', class: "text-field-icon__readonly" }, h("tds-tooltip", { key: 'f06d7f697adfe89a46b9255f5b2d1fc68c5c391b', placement: "top-end", text: "This field is non-editable", selector: "#readonly-tooltip" }), h("tds-icon", { key: 'b1a9cbadc4723e339835685a977978f268c497d3', id: "readonly-tooltip", name: "edit_inactive", size: "20px" })))), h("div", { key: 'bd0fe776e4b7d0500a9c6755635eb6b81dae1b31', "aria-live": "assertive" }, (this.helper || this.maxLength > 0) && (h("div", { key: '9e6db2662ec9e2e7f4045ae95b6d5c3de2cddc0f', class: "text-field-helper", id: `text-field-helper-element-${this.uuid}` }, this.state === 'error' && (h("div", { key: '498d9d7f555466aa7c32f7f68c63e06c56470b4e', class: "text-field-helper-error-state" }, !this.readOnly && h("tds-icon", { key: '3b90488f2e7e26317789b00d6e33bbb2b329e571', name: "error", size: "16px" }), this.helper)), this.state !== 'error' && this.helper, !this.readOnly && this.maxLength > 0 && (h("span", { key: '0f6d239f926f0287b6e6be3806f57a44a64a422b', class: {
|
|
119
144
|
'text-field-textcounter-divider': true,
|
|
120
145
|
'text-field-textcounter-disabled': this.disabled,
|
|
121
146
|
} }, this.value === null ? 0 : (_a = this.value) === null || _a === void 0 ? void 0 : _a.length, " / ", this.maxLength)))))));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import generateUniqueId from "../../utils/generateUniqueId";
|
|
3
|
+
import { handlePasteEvent } from "../../utils/handlePasteEvent";
|
|
3
4
|
export class TdsTextarea {
|
|
4
5
|
constructor() {
|
|
5
6
|
this.uuid = generateUniqueId();
|
|
@@ -36,6 +37,19 @@ export class TdsTextarea {
|
|
|
36
37
|
this.tdsInput.emit(event);
|
|
37
38
|
}
|
|
38
39
|
}
|
|
40
|
+
// Handle paste events to ensure input events are triggered
|
|
41
|
+
handlePaste(event) {
|
|
42
|
+
if (event.target instanceof HTMLTextAreaElement) {
|
|
43
|
+
const textareaEl = event.target;
|
|
44
|
+
// Create a callback to handle the synthetic input event
|
|
45
|
+
const onInputCallback = (syntheticEvent) => {
|
|
46
|
+
this.value = textareaEl.value;
|
|
47
|
+
this.tdsInput.emit(syntheticEvent);
|
|
48
|
+
};
|
|
49
|
+
// Use the utility function (no value processor needed for textarea)
|
|
50
|
+
handlePasteEvent(textareaEl, onInputCallback);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
39
53
|
/* Set the input as focus when clicking the whole textarea with suffix/prefix */
|
|
40
54
|
handleFocus(event) {
|
|
41
55
|
this.textEl.focus();
|
|
@@ -60,7 +74,7 @@ export class TdsTextarea {
|
|
|
60
74
|
}
|
|
61
75
|
render() {
|
|
62
76
|
var _a;
|
|
63
|
-
return (h("div", { key: '
|
|
77
|
+
return (h("div", { key: 'e723f8a641f578ffa97ada5746d900e49eb79252', class: {
|
|
64
78
|
'textarea-container': true,
|
|
65
79
|
'textarea-label-inside': this.labelPosition === 'inside',
|
|
66
80
|
'textarea-focus': this.focusInput,
|
|
@@ -70,7 +84,7 @@ export class TdsTextarea {
|
|
|
70
84
|
'textarea-data': this.value !== '',
|
|
71
85
|
[`textarea-${this.state}`]: this.state === 'error' || this.state === 'success',
|
|
72
86
|
'no-min-width': this.noMinWidth,
|
|
73
|
-
} }, this.labelPosition !== 'no-label' && (h("label", { key: '
|
|
87
|
+
} }, this.labelPosition !== 'no-label' && (h("label", { key: 'd2dbcc394a2790218f31738d5b5b9525b1fc0846', htmlFor: `textarea-element-${this.uuid}`, class: 'textarea-label' }, this.label)), h("div", { key: '163cd6db0ad8bcbe3d50444c78eea1c38463c450', class: "textarea-wrapper" }, h("textarea", { key: 'b1311130a28ec0a9053d98aff1afd009f22628fb', id: `textarea-element-${this.uuid}`, class: 'textarea-input', ref: (inputEl) => {
|
|
74
88
|
this.textEl = inputEl;
|
|
75
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) => {
|
|
76
90
|
if (!this.readOnly) {
|
|
@@ -80,7 +94,7 @@ export class TdsTextarea {
|
|
|
80
94
|
if (!this.readOnly) {
|
|
81
95
|
this.handleBlur(event);
|
|
82
96
|
}
|
|
83
|
-
}, 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-${this.uuid}` }), h("span", { key: '
|
|
97
|
+
}, onInput: (event) => this.handleInput(event), onChange: (event) => this.handleChange(event), onPaste: (event) => this.handlePaste(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-${this.uuid}` }), h("span", { key: 'b423c1b6f9652c3aa95447f33100eba166b7de06', class: "textarea-resizer-icon" }, h("svg", { key: 'c254d5ac9fc72500c2263b49c3c4e3642b9097bb', width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: 'a6ee4ec8cbb32d6fbc11fb03cbdc9af6f456805b', "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: '0e28490b93e622ad1322c1adc591329fde3920cd', class: "textarea-icon__readonly" }, h("tds-tooltip", { key: '792b4866942b26634f8cef72d00ca11b03ba3fbe', placement: "top-end", text: "This field is non-editable", selector: "#readonly-tooltip" }), h("tds-icon", { key: '2b809a91f13c09be470feafd622389e78f1ed4ca', id: "readonly-tooltip", name: "edit_inactive", svgTitle: "inactive" })))), h("span", { key: '0c8937b9279a72d4805bb880b38be59e086c5e39', class: 'textarea-helper', "aria-live": "assertive", id: `textarea-helper-element-${this.uuid}` }, this.state === 'error' && this.helper && !this.readOnly && (h("tds-icon", { key: '77ab9eff4a502d6ebd6959bd4ed957b9a1aa1a58', name: "error", size: "16px" })), this.helper), this.maxLength > 0 && (h("div", { key: 'a011f0e2c0e7a22fe243c967f67e022e0439d9b2', class: 'textarea-textcounter' }, this.value === null ? 0 : (_a = this.value) === null || _a === void 0 ? void 0 : _a.length, h("span", { key: 'cba5a9f73a0c74826f8722eb1ae861e8ddce5bb5', class: "textfield-textcounter-divider" }, " / "), " ", this.maxLength))));
|
|
84
98
|
}
|
|
85
99
|
static get is() { return "tds-textarea"; }
|
|
86
100
|
static get encapsulation() { return "scoped"; }
|
|
@@ -503,4 +517,5 @@ export class TdsTextarea {
|
|
|
503
517
|
}
|
|
504
518
|
};
|
|
505
519
|
}
|
|
520
|
+
static get elementRef() { return "host"; }
|
|
506
521
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility function to handle paste events and trigger input events
|
|
3
|
+
* This ensures that paste operations properly trigger tdsInput events
|
|
4
|
+
*
|
|
5
|
+
* @param element - The HTMLInputElement or HTMLTextAreaElement that received the paste
|
|
6
|
+
* @param onInputCallback - Callback function to handle the input event
|
|
7
|
+
* @param valueProcessor - Optional function to process the value before setting it
|
|
8
|
+
*/
|
|
9
|
+
export function handlePasteEvent(element, onInputCallback, valueProcessor) {
|
|
10
|
+
// Use setTimeout to ensure the paste content is processed before we trigger the input event
|
|
11
|
+
setTimeout(() => {
|
|
12
|
+
let value = element.value;
|
|
13
|
+
// Apply value processing if provided (e.g., for number inputs with min/max validation)
|
|
14
|
+
if (valueProcessor) {
|
|
15
|
+
value = valueProcessor(value);
|
|
16
|
+
element.value = value;
|
|
17
|
+
}
|
|
18
|
+
// Create a synthetic input event to maintain consistency
|
|
19
|
+
const syntheticInputEvent = new InputEvent('input', {
|
|
20
|
+
bubbles: true,
|
|
21
|
+
cancelable: true,
|
|
22
|
+
inputType: 'insertFromPaste',
|
|
23
|
+
data: null,
|
|
24
|
+
isComposing: false,
|
|
25
|
+
});
|
|
26
|
+
// Trigger the callback with the synthetic event
|
|
27
|
+
onInputCallback(syntheticInputEvent);
|
|
28
|
+
}, 0);
|
|
29
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility function to handle paste events and trigger input events
|
|
3
|
+
* This ensures that paste operations properly trigger tdsInput events
|
|
4
|
+
*
|
|
5
|
+
* @param element - The HTMLInputElement or HTMLTextAreaElement that received the paste
|
|
6
|
+
* @param onInputCallback - Callback function to handle the input event
|
|
7
|
+
* @param valueProcessor - Optional function to process the value before setting it
|
|
8
|
+
*/
|
|
9
|
+
function handlePasteEvent(element, onInputCallback, valueProcessor) {
|
|
10
|
+
// Use setTimeout to ensure the paste content is processed before we trigger the input event
|
|
11
|
+
setTimeout(() => {
|
|
12
|
+
let value = element.value;
|
|
13
|
+
// Apply value processing if provided (e.g., for number inputs with min/max validation)
|
|
14
|
+
if (valueProcessor) {
|
|
15
|
+
value = valueProcessor(value);
|
|
16
|
+
element.value = value;
|
|
17
|
+
}
|
|
18
|
+
// Create a synthetic input event to maintain consistency
|
|
19
|
+
const syntheticInputEvent = new InputEvent('input', {
|
|
20
|
+
bubbles: true,
|
|
21
|
+
cancelable: true,
|
|
22
|
+
inputType: 'insertFromPaste',
|
|
23
|
+
data: null,
|
|
24
|
+
isComposing: false,
|
|
25
|
+
});
|
|
26
|
+
// Trigger the callback with the synthetic event
|
|
27
|
+
onInputCallback(syntheticInputEvent);
|
|
28
|
+
}, 0);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { handlePasteEvent as h };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
|
|
2
2
|
import { i as inheritAriaAttributes } from './p-0bd4c19c.js';
|
|
3
3
|
import { d as defineCustomElement$3 } from './p-9ad61cb5.js';
|
|
4
|
-
import { d as defineCustomElement$2 } from './p-
|
|
4
|
+
import { d as defineCustomElement$2 } from './p-6adb1ce3.js';
|
|
5
5
|
import { d as defineCustomElement$1 } from './p-b390ece5.js';
|
|
6
6
|
|
|
7
7
|
const headerLauncherButtonCss = ":host{display:block}:host tds-header-item{display:block}:host .icon{position:relative;margin-left:-6px;left:3px;transition:all 0.2s ease-in-out}";
|
|
@@ -2,7 +2,7 @@ import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
|
|
|
2
2
|
import { d as dfs } from './p-52bf0fdf.js';
|
|
3
3
|
import { d as defineCustomElement$1 } from './p-9ad61cb5.js';
|
|
4
4
|
|
|
5
|
-
const headerItemCss = ":host ::slotted(button),:host ::slotted(a){all:unset;box-sizing:border-box;background-color:var(--tds-header-background);border-right:1px solid var(--tds-header--basic-element-border);width:100%;height:100%;cursor:pointer;padding:0 24px;display:flex;align-items:center;gap:8px}:host ::slotted(button) *,:host ::slotted(a) *{box-sizing:border-box}:host ::slotted(button:hover),:host ::slotted(a:hover){background-color:var(--tds-header-item-hover)}:host ::slotted(button:focus-visible),:host ::slotted(a:focus-visible){
|
|
5
|
+
const headerItemCss = ":host ::slotted(button),:host ::slotted(a){all:unset;box-sizing:border-box;background-color:var(--tds-header-background);border-right:1px solid var(--tds-header--basic-element-border);width:100%;height:100%;cursor:pointer;padding:0 24px;display:flex;align-items:center;gap:8px}:host ::slotted(button) *,:host ::slotted(a) *{box-sizing:border-box}:host ::slotted(button:hover),:host ::slotted(a:hover){background-color:var(--tds-header-item-hover)}:host ::slotted(button:focus-visible),:host ::slotted(a:focus-visible){outline:2px solid var(--tds-focus-outline-color);box-shadow:0 0 0 1px var(--tds-white);outline-offset:1px;z-index:1}:host .component-active ::slotted(button),:host .component-active ::slotted(a){background-color:var(--tds-header--basic-element-background-open);color:var(--tds-header-nav-item-dropdown-opened-color);border-color:var(--tds-header--basic-element-border-open)}:host .component-selected:not(.component-active) ::slotted(button),:host .component-selected:not(.component-active) ::slotted(a){background-color:var(--tds-header--basic-element-background-selected);padding-top:4px;border-bottom-style:solid;border-bottom-width:4px;border-bottom-color:var(--tds-nav-item-border-color-active)}";
|
|
6
6
|
const TdsHeaderItemStyle0 = headerItemCss;
|
|
7
7
|
|
|
8
8
|
const TdsHeaderItem = /*@__PURE__*/ proxyCustomElement(class TdsHeaderItem extends H {
|
|
@@ -67,7 +67,7 @@ const TdsDropdownStyle0 = dropdownCss;
|
|
|
67
67
|
function hasValueChanged(newValue, currentValue) {
|
|
68
68
|
if (newValue.length !== currentValue.length)
|
|
69
69
|
return true;
|
|
70
|
-
return newValue.some((val
|
|
70
|
+
return newValue.some((val) => !currentValue.includes(val));
|
|
71
71
|
}
|
|
72
72
|
const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H {
|
|
73
73
|
constructor() {
|
|
@@ -78,7 +78,6 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
78
78
|
this.tdsFocus = createEvent(this, "tdsFocus", 6);
|
|
79
79
|
this.tdsBlur = createEvent(this, "tdsBlur", 6);
|
|
80
80
|
this.tdsInput = createEvent(this, "tdsInput", 6);
|
|
81
|
-
this.hasFocus = false;
|
|
82
81
|
this.setDefaultOption = () => {
|
|
83
82
|
if (this.internalDefaultValue) {
|
|
84
83
|
// Convert the internal default value to an array if it's not already
|
|
@@ -193,23 +192,19 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
193
192
|
// Add this line to ensure internal value is cleared
|
|
194
193
|
this.internalValue = '';
|
|
195
194
|
};
|
|
196
|
-
this.handleFocus = () => {
|
|
195
|
+
this.handleFocus = (event) => {
|
|
197
196
|
this.open = true;
|
|
198
197
|
this.filterFocus = true;
|
|
199
198
|
if (this.multiselect && this.inputElement) {
|
|
200
199
|
this.inputElement.value = '';
|
|
201
200
|
}
|
|
202
|
-
|
|
201
|
+
this.tdsFocus.emit(event);
|
|
203
202
|
if (this.filter) {
|
|
204
203
|
this.handleFilter({ target: { value: '' } });
|
|
205
204
|
}
|
|
206
205
|
};
|
|
207
|
-
this.handleBlur = () => {
|
|
208
|
-
|
|
209
|
-
this.filterFocus = false;
|
|
210
|
-
if (this.multiselect && this.inputElement) {
|
|
211
|
-
this.inputElement.value = this.getValue();
|
|
212
|
-
}
|
|
206
|
+
this.handleBlur = (event) => {
|
|
207
|
+
this.tdsBlur.emit(event);
|
|
213
208
|
};
|
|
214
209
|
this.resetInput = () => {
|
|
215
210
|
const inputEl = this.host.querySelector('input');
|
|
@@ -384,7 +379,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
384
379
|
}
|
|
385
380
|
}
|
|
386
381
|
// Always trigger the focus event to open the dropdown
|
|
387
|
-
this.handleFocus();
|
|
382
|
+
this.handleFocus({});
|
|
388
383
|
}
|
|
389
384
|
/** Method for closing the Dropdown. */
|
|
390
385
|
async close() {
|
|
@@ -406,25 +401,6 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
406
401
|
}
|
|
407
402
|
}
|
|
408
403
|
}
|
|
409
|
-
onFocusIn(event) {
|
|
410
|
-
// Check if the focus is within this dropdown component
|
|
411
|
-
if (this.host.contains(event.target)) {
|
|
412
|
-
if (!this.hasFocus) {
|
|
413
|
-
this.hasFocus = true;
|
|
414
|
-
this.tdsFocus.emit(event);
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
onFocusOut(event) {
|
|
419
|
-
// Only emit blur if focus is actually leaving the entire dropdown component
|
|
420
|
-
const relatedTarget = event.relatedTarget;
|
|
421
|
-
// If relatedTarget is null (focus going to body/window) or outside the component, emit blur
|
|
422
|
-
if (this.hasFocus && (!relatedTarget || !this.host.contains(relatedTarget))) {
|
|
423
|
-
this.hasFocus = false;
|
|
424
|
-
this.handleBlur();
|
|
425
|
-
this.tdsBlur.emit(event);
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
404
|
async onKeyDown(event) {
|
|
429
405
|
var _a;
|
|
430
406
|
// Get the active element
|
|
@@ -544,9 +520,9 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
544
520
|
// Generate unique IDs for associating labels and helpers with the input/button
|
|
545
521
|
const labelId = this.label ? `dropdown-label-${this.name || generateUniqueId()}` : undefined;
|
|
546
522
|
const helperId = this.helper ? `dropdown-helper-${this.name || generateUniqueId()}` : undefined;
|
|
547
|
-
return (h(Host, { key: '
|
|
523
|
+
return (h(Host, { key: '69cdc96b6983b9556b4a9133ef8a0d2fa1e9e18e', class: {
|
|
548
524
|
[`tds-mode-variant-${this.modeVariant}`]: Boolean(this.modeVariant),
|
|
549
|
-
} }, this.label && this.labelPosition === 'outside' && (h("div", { key: '
|
|
525
|
+
} }, this.label && this.labelPosition === 'outside' && (h("div", { key: '1cc3f825bc81ca34af7bbe845bd900531f724172', id: labelId, class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: '213f3149de4b9bc4c147ab658d6d5199d3360181', class: {
|
|
550
526
|
'dropdown-select': true,
|
|
551
527
|
[this.size]: true,
|
|
552
528
|
'disabled': this.disabled,
|
|
@@ -563,7 +539,13 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
563
539
|
// eslint-disable-next-line no-return-assign
|
|
564
540
|
ref: (inputEl) => (this.inputElement = inputEl), class: {
|
|
565
541
|
placeholder: this.labelPosition === 'inside',
|
|
566
|
-
}, type: "text", placeholder: this.filterFocus ? '' : this.placeholder, value: this.multiselect && this.filterFocus ? '' : this.getValue(), disabled: this.disabled, onInput: (event) => this.handleFilter(event),
|
|
542
|
+
}, type: "text", placeholder: this.filterFocus ? '' : this.placeholder, value: this.multiselect && this.filterFocus ? '' : this.getValue(), disabled: this.disabled, onInput: (event) => this.handleFilter(event), onBlur: (event) => {
|
|
543
|
+
this.filterFocus = false;
|
|
544
|
+
if (this.multiselect) {
|
|
545
|
+
this.inputElement.value = this.getValue();
|
|
546
|
+
}
|
|
547
|
+
this.handleBlur(event);
|
|
548
|
+
}, onFocus: (event) => this.handleFocus(event), onKeyDown: (event) => {
|
|
567
549
|
if (event.key === 'Escape') {
|
|
568
550
|
this.open = false;
|
|
569
551
|
}
|
|
@@ -590,7 +572,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
590
572
|
label-inside-as-placeholder
|
|
591
573
|
${this.size}
|
|
592
574
|
${this.selectedOptions.length ? 'selected' : ''}
|
|
593
|
-
` }, this.label)), h("div", { class: `placeholder ${this.size}` }, this.selectedOptions.length ? this.getValue() : this.placeholder), h("tds-icon", { "aria-label": "Open/Close dropdown", svgTitle: "Open/Close dropdown", class: `menu-icon ${this.open ? 'open' : 'closed'}`, name: "chevron_down", size: "16px" }))))), h("div", { key: '
|
|
575
|
+
` }, this.label)), h("div", { class: `placeholder ${this.size}` }, this.selectedOptions.length ? this.getValue() : this.placeholder), h("tds-icon", { "aria-label": "Open/Close dropdown", svgTitle: "Open/Close dropdown", class: `menu-icon ${this.open ? 'open' : 'closed'}`, name: "chevron_down", size: "16px" }))))), h("div", { key: 'af7815b0cb8b36e37278965094d5198a9ff5aba9', role: "listbox", "aria-label": this.tdsAriaLabel, inert: !this.open, "aria-orientation": "vertical", "aria-multiselectable": this.multiselect, ref: (element) => {
|
|
594
576
|
this.dropdownList = element;
|
|
595
577
|
}, class: {
|
|
596
578
|
'dropdown-list': true,
|
|
@@ -601,11 +583,11 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
601
583
|
'closed': !this.open,
|
|
602
584
|
[`animation-enter-${this.animation}`]: this.animation !== 'none' && this.open,
|
|
603
585
|
[`animation-exit-${this.animation}`]: this.animation !== 'none' && !this.open,
|
|
604
|
-
} }, h("slot", { key: '
|
|
586
|
+
} }, h("slot", { key: '736b82b5f716fa818c17ae161341bc6b131d9cf2', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: 'f1c1471cbec4a6dd8830a8540f54e142c559d539', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: 'aa138a349c073158785ae1177c0879604f6b8d90', id: helperId, class: {
|
|
605
587
|
helper: true,
|
|
606
588
|
error: this.error,
|
|
607
589
|
disabled: this.disabled,
|
|
608
|
-
} }, this.error && h("tds-icon", { key: '
|
|
590
|
+
} }, this.error && h("tds-icon", { key: '936a8bd7db8a0ed994d6827c26bbb6732420fea4', name: "error", size: "16px" }), this.helper))));
|
|
609
591
|
}
|
|
610
592
|
get host() { return this; }
|
|
611
593
|
static get watchers() { return {
|
|
@@ -646,7 +628,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
646
628
|
"close": [64],
|
|
647
629
|
"updateDisplay": [64],
|
|
648
630
|
"appendValue": [64]
|
|
649
|
-
}, [[9, "mousedown", "onAnyClick"], [0, "
|
|
631
|
+
}, [[9, "mousedown", "onAnyClick"], [0, "keydown", "onKeyDown"]], {
|
|
650
632
|
"value": ["handleValueChange"],
|
|
651
633
|
"open": ["handleOpenState"],
|
|
652
634
|
"defaultValue": ["handleDefaultValueChange"]
|
|
@@ -66,18 +66,10 @@ const TdsDropdownOption = /*@__PURE__*/ proxyCustomElement(class TdsDropdownOpti
|
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
this.handleFocus = (event) => {
|
|
69
|
-
|
|
70
|
-
// Only emit if this is a standalone option (not within a dropdown)
|
|
71
|
-
if (!this.parentElement) {
|
|
72
|
-
this.tdsFocus.emit(event);
|
|
73
|
-
}
|
|
69
|
+
this.tdsFocus.emit(event);
|
|
74
70
|
};
|
|
75
71
|
this.handleBlur = (event) => {
|
|
76
|
-
|
|
77
|
-
// Only emit if this is a standalone option (not within a dropdown)
|
|
78
|
-
if (!this.parentElement) {
|
|
79
|
-
this.tdsBlur.emit(event);
|
|
80
|
-
}
|
|
72
|
+
this.tdsBlur.emit(event);
|
|
81
73
|
};
|
|
82
74
|
this.value = undefined;
|
|
83
75
|
this.internalValue = undefined;
|
|
@@ -98,7 +90,7 @@ const TdsDropdownOption = /*@__PURE__*/ proxyCustomElement(class TdsDropdownOpti
|
|
|
98
90
|
this.internalValue = convertToString(this.value);
|
|
99
91
|
}
|
|
100
92
|
render() {
|
|
101
|
-
return (h(Host, { key: '
|
|
93
|
+
return (h(Host, { key: 'd35a3153be292b1656d0efca93f06bfc1357041b' }, h("div", { key: '384353f9868a3fb559ca4140d5cd4f5553e024ad', class: `dropdown-option
|
|
102
94
|
${this.size}
|
|
103
95
|
${this.selected ? 'selected' : ''}
|
|
104
96
|
${this.disabled ? 'disabled' : ''}
|
|
@@ -108,8 +100,6 @@ const TdsDropdownOption = /*@__PURE__*/ proxyCustomElement(class TdsDropdownOpti
|
|
|
108
100
|
}
|
|
109
101
|
} }, h("tds-checkbox", { onTdsChange: (event) => {
|
|
110
102
|
this.handleMultiselect(event);
|
|
111
|
-
}, onTdsBlur: (event) => {
|
|
112
|
-
event.stopPropagation();
|
|
113
103
|
}, disabled: this.disabled, checked: this.selected, tdsAriaLabel: this.tdsAriaLabel, class: {
|
|
114
104
|
[this.size]: true,
|
|
115
105
|
} }, h("div", { slot: "label" }, h("slot", null))))) : (h("button", { role: "option", "aria-disabled": this.disabled, "aria-selected": this.selected, "aria-label": this.tdsAriaLabel, onClick: () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
|
|
2
2
|
import { d as dfs } from './p-52bf0fdf.js';
|
|
3
3
|
|
|
4
|
-
const sideMenuItemCss = ":host{display:block}:host .component ::slotted(a),:host .component ::slotted(button){all:unset;box-sizing:border-box;height:68px;width:100%;display:flex;align-items:center;gap:10px;padding:0 22px;border:none;background-color:var(--tds-sidebar-side-menu-background-cover);font:var(--tds-headline-07);letter-spacing:var(--tds-headline-07-ls);color:var(--tds-sidebar-side-menu-single-item-color);cursor:pointer}:host .component ::slotted(tds-side-menu-user),:host .component-has-user ::slotted(button){all:unset;box-sizing:border-box;height:68px;width:100%;display:flex;align-items:center;gap:16px;padding:0 22px 0 16px;border:none;background-color:var(--tds-sidebar-side-menu-background-cover);font:var(--tds-headline-07);letter-spacing:var(--tds-headline-07-ls);color:var(--tds-sidebar-side-menu-single-item-color);cursor:pointer}:host .component tds-icon{color:red !important}:host .component ::slotted(a:focus-visible),:host .component ::slotted(button:focus-visible){outline:2px solid var(--tds-focus-outline-color);box-shadow:
|
|
4
|
+
const sideMenuItemCss = ":host{display:block}:host .component ::slotted(a),:host .component ::slotted(button){all:unset;box-sizing:border-box;height:68px;width:100%;display:flex;align-items:center;gap:10px;padding:0 22px;border:none;background-color:var(--tds-sidebar-side-menu-background-cover);font:var(--tds-headline-07);letter-spacing:var(--tds-headline-07-ls);color:var(--tds-sidebar-side-menu-single-item-color);cursor:pointer}:host .component ::slotted(tds-side-menu-user),:host .component-has-user ::slotted(button){all:unset;box-sizing:border-box;height:68px;width:100%;display:flex;align-items:center;gap:16px;padding:0 22px 0 16px;border:none;background-color:var(--tds-sidebar-side-menu-background-cover);font:var(--tds-headline-07);letter-spacing:var(--tds-headline-07-ls);color:var(--tds-sidebar-side-menu-single-item-color);cursor:pointer}:host .component tds-icon{color:red !important}:host .component ::slotted(a:focus-visible),:host .component ::slotted(button:focus-visible){outline:2px solid var(--tds-focus-outline-color);box-shadow:0 0 0 1px var(--tds-white);outline-offset:1px;z-index:1}:host .component:hover ::slotted(a),:host .component:hover ::slotted(button){background-color:var(--tds-sidebar-item-state-hover)}:host .component:active ::slotted(a),:host .component:active ::slotted(button){background-color:var(--tds-sidemenu-item-state-active)}:host .component-collapsed ::slotted(a),:host .component-collapsed ::slotted(button){padding:0;display:flex;justify-content:center;align-items:center;position:relative}:host .component-selected:not(:host .component-active) ::slotted(a),:host .component-selected:not(:host .component-active) ::slotted(button),:host .component-selected:not(:host .component-active) ::slotted(tds-side-menu-user){position:relative;background-color:var(--tds-sidebar-item-state-selected)}:host .component-selected:not(:host .component-active) ::slotted(a)::before,:host .component-selected:not(:host .component-active) ::slotted(button)::before,:host .component-selected:not(:host .component-active) ::slotted(tds-side-menu-user)::before{content:\"\";position:absolute;top:0;left:0;width:4px;height:100%;background-color:var(--tds-sidebar-side-menu-single-subitem-selected-border-color)}@media (min-width: 992px){:host .component.component-collapsed ::slotted(a),:host .component.component-collapsed ::slotted(button){color:rgba(90, 90, 90, 0);overflow:hidden}}";
|
|
5
5
|
const TdsSideMenuItemStyle0 = sideMenuItemCss;
|
|
6
6
|
|
|
7
7
|
const TdsSideMenuItem = /*@__PURE__*/ proxyCustomElement(class TdsSideMenuItem extends H {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TdsDropdownOption$1, d as defineCustomElement$1 } from './p-
|
|
1
|
+
import { T as TdsDropdownOption$1, d as defineCustomElement$1 } from './p-d64878cb.js';
|
|
2
2
|
|
|
3
3
|
const TdsDropdownOption = TdsDropdownOption$1;
|
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
|
|
2
2
|
import { d as defineCustomElement$3 } from './p-9ad61cb5.js';
|
|
3
|
-
import { d as defineCustomElement$2 } from './p-
|
|
3
|
+
import { d as defineCustomElement$2 } from './p-6adb1ce3.js';
|
|
4
4
|
|
|
5
5
|
const headerBrandSymbolCss = ":host tds-header-item{display:none}:host tds-header-item ::slotted(*){background-image:var(--tds-background-image-scania-symbol-svg-local), var(--tds-background-image-scania-symbol-svg);background-size:30px auto;background-position:center;background-repeat:no-repeat}@media (min-width: 992px){:host tds-header-item{display:block}}";
|
|
6
6
|
const TdsHeaderBrandSymbolStyle0 = headerBrandSymbolCss;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
|
|
2
2
|
import { g as generateUniqueId } from './p-11648030.js';
|
|
3
3
|
import { d as defineCustomElement$6 } from './p-9ad61cb5.js';
|
|
4
|
-
import { d as defineCustomElement$5 } from './p-
|
|
4
|
+
import { d as defineCustomElement$5 } from './p-6adb1ce3.js';
|
|
5
5
|
import { d as defineCustomElement$4 } from './p-b390ece5.js';
|
|
6
6
|
import { d as defineCustomElement$3 } from './p-df84759a.js';
|
|
7
7
|
import { d as defineCustomElement$2 } from './p-d3866be7.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
|
|
2
2
|
import { i as inheritAriaAttributes } from './p-0bd4c19c.js';
|
|
3
3
|
import { d as defineCustomElement$4 } from './p-9ad61cb5.js';
|
|
4
|
-
import { d as defineCustomElement$3 } from './p-
|
|
4
|
+
import { d as defineCustomElement$3 } from './p-6adb1ce3.js';
|
|
5
5
|
import { d as defineCustomElement$2 } from './p-b390ece5.js';
|
|
6
6
|
|
|
7
7
|
const headerHamburgerCss = ":host{color:var(--tds-white)}:host tds-header-item{display:block}:host .icon{position:relative;margin-left:-6px;left:3px;transition:background 0.2s ease-in-out, color 0.2s ease-in-out}@media screen and (min-width: 992px){:host tds-header-item{display:none}:host([persistent]) tds-header-item{display:block}}";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TdsHeaderLauncherButton$1, d as defineCustomElement$1 } from './p-
|
|
1
|
+
import { T as TdsHeaderLauncherButton$1, d as defineCustomElement$1 } from './p-63437b77.js';
|
|
2
2
|
|
|
3
3
|
const TdsHeaderLauncherButton = TdsHeaderLauncherButton$1;
|
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -2,8 +2,8 @@ import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
|
|
|
2
2
|
import { g as generateUniqueId } from './p-11648030.js';
|
|
3
3
|
import { i as inheritAriaAttributes } from './p-0bd4c19c.js';
|
|
4
4
|
import { d as defineCustomElement$7 } from './p-9ad61cb5.js';
|
|
5
|
-
import { d as defineCustomElement$6 } from './p-
|
|
6
|
-
import { d as defineCustomElement$5 } from './p-
|
|
5
|
+
import { d as defineCustomElement$6 } from './p-6adb1ce3.js';
|
|
6
|
+
import { d as defineCustomElement$5 } from './p-63437b77.js';
|
|
7
7
|
import { d as defineCustomElement$4 } from './p-b390ece5.js';
|
|
8
8
|
import { d as defineCustomElement$3 } from './p-df84759a.js';
|
|
9
9
|
import { d as defineCustomElement$2 } from './p-d3866be7.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, d as createEvent, h, c as Host } from './p-28ef5186.js';
|
|
2
|
-
import { d as defineCustomElement$2 } from './p-
|
|
2
|
+
import { d as defineCustomElement$2 } from './p-ea381f94.js';
|
|
3
3
|
|
|
4
4
|
const sideMenuCollapseButtonCss = ":host{position:sticky;bottom:0;display:none;height:68px;border-top:1px solid var(--tds-sidebar-side-menu-bottom-menu-border-top)}:host .icon{transform:rotateZ(90deg);transition:all 0.2s ease-in-out;width:20px;height:20px}:host .state-collapsed .icon{transform:translateX(-50%) rotateZ(90deg) rotateX(180deg);color:var(--tds-sidebar-side-menu-single-item-color);margin-left:0;position:absolute;left:50%}@media (min-width: 992px){:host{display:block}}";
|
|
5
5
|
const TdsSideMenuCollapseButtonStyle0 = sideMenuCollapseButtonCss;
|
|
@@ -35,12 +35,14 @@ const TdsSideMenuCollapseButton$1 = /*@__PURE__*/ proxyCustomElement(class TdsSi
|
|
|
35
35
|
this.collapsed = this.sideMenuEl.collapsed;
|
|
36
36
|
}
|
|
37
37
|
render() {
|
|
38
|
-
return (h(Host, { key: '
|
|
38
|
+
return (h(Host, { key: 'fecd00dc0ef2ce899b82ce304034b5b6f75704ed', role: "button", tabindex: "0", "aria-expanded": !this.collapsed ? 'true' : 'false', onClick: () => {
|
|
39
|
+
this.handleClick();
|
|
40
|
+
} }, h("div", { key: '6d7ae7bd95d8c4c37895d06ce8d4eaebe08e91dd', class: {
|
|
39
41
|
'wrapper': true,
|
|
40
42
|
'state-collapsed': this.collapsed,
|
|
41
|
-
} }, h("tds-side-menu-item", { key: '
|
|
42
|
-
|
|
43
|
-
} }, h("svg", { key: '
|
|
43
|
+
} }, h("tds-side-menu-item", { key: '2cc8087248c6f9eee7943039092c5a45f9c2376d', class: {
|
|
44
|
+
button: true,
|
|
45
|
+
} }, h("a", { key: 'e2510c1f475b5f6ff3d1de367360fc2e34e0c0c0' }, h("svg", { key: '7ea54a6bcfb144cab3045fb34316eac400c59e43', class: "icon", slot: "icon", fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" }, h("path", { key: '3db930370416d9906ccdf821e6d43d0e6633534a', "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M16 1.975a1 1 0 0 1 1 1v20.3l9.311-9.312a1 1 0 0 1 1.415 1.414l-9.887 9.887a2.6 2.6 0 0 1-3.677 0l-9.887-9.887a1 1 0 1 1 1.414-1.414L15 23.274V2.975a1 1 0 0 1 1-1ZM5.188 28.001a1 1 0 0 0 0 2h21.62a1 1 0 1 0 0-2H5.188Z", fill: "currentColor" })), !this.collapsed && h("slot", { key: '7fba28f202ca8089ffce93c051c8d6afc23afef7' }))))));
|
|
44
46
|
}
|
|
45
47
|
get host() { return this; }
|
|
46
48
|
static get style() { return TdsSideMenuCollapseButtonStyle0; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
|
|
2
2
|
|
|
3
|
-
const sideMenuDropdownListItemCss = ":host{display:block;box-sizing:border-box;height:48px;width:100%}:host .component{height:100%;width:100%}:host .component ::slotted(a),:host .component ::slotted(button){all:unset;box-sizing:border-box;border-right:1px solid var(--tds-nav-item-border-color);display:flex;align-items:center;height:100%;padding:0 24px;width:100%;font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);background-color:var(--tds-header-nav-item-dropdown-opened-background);color:var(--tds-header-nav-item-dropdown-opened-color);border:none}:host .component ::slotted(a:hover),:host .component ::slotted(button:hover){background-color:var(--tds-
|
|
3
|
+
const sideMenuDropdownListItemCss = ":host{display:block;box-sizing:border-box;height:48px;width:100%}:host .component{height:100%;width:100%}:host .component ::slotted(a),:host .component ::slotted(button){all:unset;box-sizing:border-box;border-right:1px solid var(--tds-nav-item-border-color);display:flex;align-items:center;height:100%;padding:0 24px;width:100%;font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);background-color:var(--tds-header-nav-item-dropdown-opened-background);color:var(--tds-header-nav-item-dropdown-opened-color);border:none}:host .component ::slotted(a:hover),:host .component ::slotted(button:hover){background-color:var(--tds-header-nav-item-dropdown-opened-background-hover);cursor:pointer}:host .component ::slotted(a:active),:host .component ::slotted(button:active){background-color:var(--tds-header-nav-item-dropdown-opened-background-active) !important;cursor:pointer}:host .component ::slotted(a:focus-visible){outline:2px solid var(--tds-focus-outline-color);box-shadow:0 0 0 1px var(--tds-white);outline-offset:1px;z-index:1}:host .component.component-selected ::slotted(a),:host .component.component-selected ::slotted(button){box-shadow:inset 4px 0 0 var(--tds-nav-item-border-color-active);background-color:var(--tds-header-nav-item-dropdown-opened-background-selected)}:host .component.component-dropdown-has-icon:not(.component-collapsed) ::slotted(a),:host .component.component-dropdown-has-icon:not(.component-collapsed) ::slotted(button){padding:16px 48px 16px 58px}:host .component.component-dropdown-has-user:not(.component-collapsed) ::slotted(a),:host .component.component-dropdown-has-user:not(.component-collapsed) ::slotted(button){padding:16px 48px 16px 64px}";
|
|
4
4
|
const TdsSideMenuDropdownListItemStyle0 = sideMenuDropdownListItemCss;
|
|
5
5
|
|
|
6
6
|
const TdsSideMenuDropdownListItem$1 = /*@__PURE__*/ proxyCustomElement(class TdsSideMenuDropdownListItem extends H {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, F as Fragment, c as Host } from './p-28ef5186.js';
|
|
2
2
|
import { d as defineCustomElement$3 } from './p-b390ece5.js';
|
|
3
|
-
import { d as defineCustomElement$2 } from './p-
|
|
3
|
+
import { d as defineCustomElement$2 } from './p-ea381f94.js';
|
|
4
4
|
|
|
5
5
|
const sideMenuDropdownCss = ":host{display:block}:host .wrapper{display:flex;flex-direction:column}:host .dropdown-icon{margin-left:auto;transition:all 0.2s ease-in-out}:host .state-open .dropdown-icon{transform:rotateZ(180deg)}:host .state-open .menu{display:block}:host .state-collapsed .menu{--side-menu-width:69px;position:absolute;left:var(--side-menu-width);box-shadow:var(--tds-nav-dropdown-menu-box);background-color:var(--tds-sidebar-side-menu-subnav-background)}:host .state-collapsed .menu .heading-collapsed{all:unset;box-sizing:border-box;padding:16px 24px 15px;min-height:48px;display:flex;align-items:center;border-bottom:1px solid var(--tds-sidebar-side-menu-bottom-menu-border-top);font:var(--tds-headline-07);letter-spacing:var(--tds-headline-07-ls)}:host :not(.state-collapsed) .menu ::slotted(tds-side-menu-dropdown-list){width:100%}:host .menu{display:none;flex-direction:column}";
|
|
6
6
|
const TdsSideMenuDropdownStyle0 = sideMenuDropdownCss;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TdsSideMenuItem$1, d as defineCustomElement$1 } from './p-
|
|
1
|
+
import { T as TdsSideMenuItem$1, d as defineCustomElement$1 } from './p-ea381f94.js';
|
|
2
2
|
|
|
3
3
|
const TdsSideMenuItem = TdsSideMenuItem$1;
|
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|