@scania/tegel 1.1.0 → 1.3.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/README.md +3 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/tds-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/tds-breadcrumbs.cjs.entry.js +3 -1
- package/dist/cjs/tds-button.cjs.entry.js +1 -1
- package/dist/cjs/tds-checkbox.cjs.entry.js +16 -3
- package/dist/cjs/tds-dropdown-option.cjs.entry.js +5 -3
- package/dist/cjs/tds-dropdown.cjs.entry.js +13 -3
- package/dist/cjs/tds-footer-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-slider.cjs.entry.js +60 -104
- package/dist/cjs/tds-step.cjs.entry.js +12 -7
- package/dist/cjs/tds-table-header.cjs.entry.js +3 -1
- package/dist/cjs/tds-toast.cjs.entry.js +4 -1
- package/dist/cjs/tegel.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/accordion/test/basic/accordion.e2e.js +19 -0
- package/dist/collection/components/accordion/test/disabled/accordion.e2e.js +19 -0
- package/dist/collection/components/accordion/test/expanded/accordion.e2e.js +24 -0
- package/dist/collection/components/accordion/test/padding-reset/accordion.e2e.js +24 -0
- package/dist/collection/components/badge/test/basic/badge.e2e.js +10 -0
- package/dist/collection/components/badge/test/value/badge.e2e.js +11 -0
- package/dist/collection/components/banner/test/basic/banner.e2e.js +10 -0
- package/dist/collection/components/breadcrumbs/breadcrumb/breadcrumb.css +4 -3
- package/dist/collection/components/breadcrumbs/breadcrumbs.js +3 -1
- package/dist/collection/components/button/button.css +0 -4
- package/dist/collection/components/checkbox/checkbox.css +19 -0
- package/dist/collection/components/checkbox/checkbox.js +39 -5
- package/dist/collection/components/checkbox/checkbox.stories.js +25 -12
- package/dist/collection/components/datetime/datetime.stories.js +4 -4
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.css +26 -16
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +4 -2
- package/dist/collection/components/dropdown/dropdown.css +28 -0
- package/dist/collection/components/dropdown/dropdown.js +12 -2
- package/dist/collection/components/footer/footer-item/footer-item.css +4 -6
- package/dist/collection/components/slider/slider.js +61 -105
- package/dist/collection/components/stepper/step/step.js +13 -8
- package/dist/collection/components/table/table-component-multiselect.stories.js +18 -2
- package/dist/collection/components/table/table-header/table-header.js +43 -3
- package/dist/collection/components/text-field/text-field.stories.js +1 -1
- package/dist/collection/components/toast/toast.js +4 -1
- package/dist/collection/components/toast/toast.stories.js +10 -1
- package/dist/collection/stories/Installation/angular.stories.js +111 -0
- package/dist/collection/stories/Installation/javascript.stories.js +99 -0
- package/dist/collection/stories/Installation/react.stories.js +117 -0
- package/dist/collection/stories/announcements/announce-tegel.stories.js +5 -5
- package/dist/collection/stories/tegel.stories.js +7 -8
- package/dist/components/checkbox.js +20 -4
- package/dist/components/tds-breadcrumb.js +1 -1
- package/dist/components/tds-breadcrumbs.js +3 -1
- package/dist/components/tds-button.js +1 -1
- package/dist/components/tds-dropdown-option.js +5 -3
- package/dist/components/tds-dropdown.js +13 -3
- package/dist/components/tds-footer-item.js +1 -1
- package/dist/components/tds-slider.js +61 -105
- package/dist/components/tds-step.js +13 -8
- package/dist/components/tds-table-header.js +5 -1
- package/dist/components/tds-toast.js +4 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tds-breadcrumb.entry.js +1 -1
- package/dist/esm/tds-breadcrumbs.entry.js +3 -1
- package/dist/esm/tds-button.entry.js +1 -1
- package/dist/esm/tds-checkbox.entry.js +16 -3
- package/dist/esm/tds-dropdown-option.entry.js +5 -3
- package/dist/esm/tds-dropdown.entry.js +13 -3
- package/dist/esm/tds-footer-item.entry.js +1 -1
- package/dist/esm/tds-slider.entry.js +60 -104
- package/dist/esm/tds-step.entry.js +12 -7
- package/dist/esm/tds-table-header.entry.js +3 -1
- package/dist/esm/tds-toast.entry.js +4 -1
- package/dist/esm/tegel.js +1 -1
- package/dist/tegel/p-1aaf365d.entry.js +1 -0
- package/dist/tegel/p-24f22b04.entry.js +1 -0
- package/dist/tegel/p-3a930215.entry.js +1 -0
- package/dist/tegel/p-6361ae3a.entry.js +1 -0
- package/dist/tegel/{p-e3c5a663.entry.js → p-952a9830.entry.js} +1 -1
- package/dist/tegel/p-99327b6c.entry.js +1 -0
- package/dist/tegel/p-abe23e76.entry.js +1 -0
- package/dist/tegel/p-bf32d97c.entry.js +1 -0
- package/dist/tegel/p-c420b0a9.entry.js +1 -0
- package/dist/tegel/p-d6c1d080.entry.js +1 -0
- package/dist/tegel/p-fbd856ca.entry.js +1 -0
- package/dist/tegel/tegel.css +1 -1
- package/dist/tegel/tegel.esm.js +1 -1
- package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +5 -0
- package/dist/types/components/checkbox/checkbox.stories.d.ts +13 -0
- package/dist/types/components/slider/slider.d.ts +19 -22
- package/dist/types/components/stepper/step/step.d.ts +1 -1
- package/dist/types/components/table/table-component-batch-actions.stories.d.ts +1 -1
- package/dist/types/components/table/table-component-multiselect.stories.d.ts +16 -0
- package/dist/types/components/table/table-header/table-header.d.ts +5 -1
- package/dist/types/components/toast/toast.stories.d.ts +8 -0
- package/dist/types/components.d.ts +27 -2
- package/dist/types/stories/Installation/angular.stories.d.ts +6 -0
- package/dist/types/stories/Installation/{installation.stories.d.ts → javascript.stories.d.ts} +1 -1
- package/dist/types/stories/Installation/react.stories.d.ts +6 -0
- package/dist/types/stories/formatHtmlPreview.d.ts +1 -1
- package/package.json +7 -7
- package/dist/collection/components/accordion/accordion.spec.js +0 -6
- package/dist/collection/components/divider/divider.spec.js +0 -28
- package/dist/collection/components/dropdown/test/dropdown.e2e.js +0 -32
- package/dist/collection/components/dropdown/test/dropdown.filter.spec.js +0 -49
- package/dist/collection/components/dropdown/test/dropdown.multiselect.e2e.js +0 -31
- package/dist/collection/components/dropdown/test/dropdown.multiselect.spec.js +0 -51
- package/dist/collection/components/dropdown/test/dropdown.spec.js +0 -51
- package/dist/collection/components/table/table.filtering.spec.js +0 -23
- package/dist/collection/components/table/table.spec.js +0 -16
- package/dist/collection/stories/Installation/installation.stories.js +0 -218
- package/dist/tegel/p-016d07b2.entry.js +0 -1
- package/dist/tegel/p-1a978a31.entry.js +0 -1
- package/dist/tegel/p-78f42968.entry.js +0 -1
- package/dist/tegel/p-80b501e3.entry.js +0 -1
- package/dist/tegel/p-8f1a037c.entry.js +0 -1
- package/dist/tegel/p-a0f3086c.entry.js +0 -1
- package/dist/tegel/p-be7119d3.entry.js +0 -1
- package/dist/tegel/p-c0b7acbb.entry.js +0 -1
- package/dist/tegel/p-e4db065d.entry.js +0 -1
- package/dist/tegel/p-eda7ecf6.entry.js +0 -1
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
color: var(--tds-breadcrumb-color-hover);
|
|
8
8
|
text-decoration: underline;
|
|
9
9
|
}
|
|
10
|
-
[role=listitem]
|
|
10
|
+
[role=listitem] ::slotted(*:focus-visible) {
|
|
11
11
|
outline: 2px solid var(--tds-blue-400);
|
|
12
12
|
outline-offset: -2px;
|
|
13
|
+
outline-offset: 0;
|
|
13
14
|
}
|
|
14
15
|
[role=listitem].current ::slotted(*),
|
|
15
16
|
[role=listitem] [aria-current=page] ::slotted(*) {
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
text-decoration: none;
|
|
23
24
|
cursor: not-allowed;
|
|
24
25
|
}
|
|
25
|
-
[role=listitem]
|
|
26
|
+
[role=listitem]::after {
|
|
26
27
|
content: "›";
|
|
27
28
|
color: var(--tds-breadcrumb-separator-color);
|
|
28
29
|
margin-right: 4px;
|
|
@@ -32,6 +33,6 @@
|
|
|
32
33
|
height: 8px;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
:host(
|
|
36
|
+
:host(.last) [role=listitem]::after {
|
|
36
37
|
display: none;
|
|
37
38
|
}
|
|
@@ -4,6 +4,8 @@ import { h } from "@stencil/core";
|
|
|
4
4
|
*/
|
|
5
5
|
export class TdsBreadcrumbs {
|
|
6
6
|
render() {
|
|
7
|
+
var _a;
|
|
8
|
+
(_a = this.host.children[this.host.children.length - 1]) === null || _a === void 0 ? void 0 : _a.classList.add('last');
|
|
7
9
|
return (h("nav", null, h("div", { role: "list", class: 'tds-breadcrumb' }, h("slot", null))));
|
|
8
10
|
}
|
|
9
11
|
static get is() { return "tds-breadcrumbs"; }
|
|
@@ -18,5 +20,5 @@ export class TdsBreadcrumbs {
|
|
|
18
20
|
"$": ["breadcrumbs.css"]
|
|
19
21
|
};
|
|
20
22
|
}
|
|
21
|
-
static get elementRef() { return "
|
|
23
|
+
static get elementRef() { return "host"; }
|
|
22
24
|
}
|
|
@@ -288,7 +288,6 @@ button.primary.icon {
|
|
|
288
288
|
color: var(--tds-btn-icon-primary-fill);
|
|
289
289
|
fill: var(--tds-btn-icon-primary-color);
|
|
290
290
|
color: var(--tds-btn-icon-primary-color);
|
|
291
|
-
font-size: 16px;
|
|
292
291
|
}
|
|
293
292
|
button.primary:hover {
|
|
294
293
|
background: var(--tds-btn-primary-background-hover);
|
|
@@ -347,7 +346,6 @@ button.secondary.icon {
|
|
|
347
346
|
color: var(--tds-btn-icon-secondary-fill);
|
|
348
347
|
fill: var(--tds-btn-icon-secondary-color);
|
|
349
348
|
color: var(--tds-btn-icon-secondary-color);
|
|
350
|
-
font-size: 16px;
|
|
351
349
|
}
|
|
352
350
|
button.secondary:hover {
|
|
353
351
|
background: var(--tds-btn-secondary-background-hover);
|
|
@@ -406,7 +404,6 @@ button.ghost.icon {
|
|
|
406
404
|
color: var(--tds-btn-icon-ghost-fill);
|
|
407
405
|
fill: var(--tds-btn-icon-ghost-color);
|
|
408
406
|
color: var(--tds-btn-icon-ghost-color);
|
|
409
|
-
font-size: 16px;
|
|
410
407
|
}
|
|
411
408
|
button.ghost:hover {
|
|
412
409
|
background: var(--tds-btn-ghost-background-hover);
|
|
@@ -465,7 +462,6 @@ button.danger.icon {
|
|
|
465
462
|
color: var(--tds-btn-icon-danger-fill);
|
|
466
463
|
fill: var(--tds-btn-icon-danger-color);
|
|
467
464
|
color: var(--tds-btn-icon-danger-color);
|
|
468
|
-
font-size: 16px;
|
|
469
465
|
}
|
|
470
466
|
button.danger:hover {
|
|
471
467
|
background: var(--tds-btn-danger-background-hover);
|
|
@@ -111,4 +111,23 @@
|
|
|
111
111
|
background-image: var(--tds-checkbox-background-img-disabled);
|
|
112
112
|
background-color: var(--tds-checkbox-interaction-02);
|
|
113
113
|
color: var(--tds-checkbox-color-disabled-after);
|
|
114
|
+
}
|
|
115
|
+
.tds-checkbox input[type=checkbox]:indeterminate::after {
|
|
116
|
+
background-image: var(--tds-checkbox-background-img-indeterminate);
|
|
117
|
+
background-color: var(--tds-checkbox-interaction-01);
|
|
118
|
+
background-repeat: no-repeat;
|
|
119
|
+
background-position: center;
|
|
120
|
+
}
|
|
121
|
+
.tds-checkbox input[type=checkbox]:indeterminate:disabled:hover::before, .tds-checkbox input[type=checkbox]:indeterminate:disabled::before {
|
|
122
|
+
display: block;
|
|
123
|
+
width: 16px;
|
|
124
|
+
height: 16px;
|
|
125
|
+
left: 4px;
|
|
126
|
+
top: 4px;
|
|
127
|
+
border: 1px solid #b0b7c4;
|
|
128
|
+
}
|
|
129
|
+
.tds-checkbox input[type=checkbox]:indeterminate:disabled::after {
|
|
130
|
+
background-image: var(--tds-checkbox-background-img-indeterminate-disabled);
|
|
131
|
+
background-color: var(--tds-checkbox-interaction-02);
|
|
132
|
+
color: var(--tds-checkbox-color-disabled-after);
|
|
114
133
|
}
|
|
@@ -7,9 +7,11 @@ export class TdsCheckbox {
|
|
|
7
7
|
constructor() {
|
|
8
8
|
this.handleChange = () => {
|
|
9
9
|
this.checked = !this.checked;
|
|
10
|
+
this.indeterminate = false;
|
|
10
11
|
this.tdsChange.emit({
|
|
11
12
|
checkboxId: this.checkboxId,
|
|
12
13
|
checked: this.checked,
|
|
14
|
+
indeterminate: this.indeterminate,
|
|
13
15
|
value: this.value,
|
|
14
16
|
});
|
|
15
17
|
};
|
|
@@ -18,16 +20,21 @@ export class TdsCheckbox {
|
|
|
18
20
|
this.disabled = false;
|
|
19
21
|
this.required = false;
|
|
20
22
|
this.checked = false;
|
|
23
|
+
this.indeterminate = false;
|
|
21
24
|
this.value = undefined;
|
|
22
25
|
}
|
|
23
26
|
/** Toggles the checked value of the component. */
|
|
24
27
|
async toggleCheckbox() {
|
|
25
28
|
this.checked = !this.checked;
|
|
29
|
+
this.indeterminate = false;
|
|
26
30
|
return {
|
|
27
31
|
checkboxId: this.checkboxId,
|
|
28
32
|
checked: this.checked,
|
|
29
33
|
};
|
|
30
34
|
}
|
|
35
|
+
handleIndeterminateState() {
|
|
36
|
+
this.inputElement.indeterminate = this.indeterminate;
|
|
37
|
+
}
|
|
31
38
|
/** Set the input as focus when clicking the component */
|
|
32
39
|
handleFocus(event) {
|
|
33
40
|
this.tdsFocus.emit(event);
|
|
@@ -37,9 +44,12 @@ export class TdsCheckbox {
|
|
|
37
44
|
this.tdsBlur.emit(event);
|
|
38
45
|
}
|
|
39
46
|
render() {
|
|
40
|
-
return (h("div", { class: "tds-checkbox" }, h("input", {
|
|
47
|
+
return (h("div", { class: "tds-checkbox" }, h("input", {
|
|
48
|
+
// eslint-disable-next-line no-return-assign
|
|
49
|
+
ref: (inputElement) => (this.inputElement = inputElement), indeterminate: this.indeterminate, "aria-checked": this.checked, "aria-required": this.required, "aria-describedby": this.host.getAttribute('aria-describedby'), "aria-labelledby": this.host.getAttribute('aria-labelledby'), required: this.required, type: "checkbox", name: this.name, value: this.value, id: this.checkboxId, checked: this.checked, disabled: this.disabled, onFocus: (event) => this.handleFocus(event), onBlur: (event) => this.handleBlur(event), onChange: () => {
|
|
41
50
|
this.handleChange();
|
|
42
|
-
}
|
|
51
|
+
}
|
|
52
|
+
}), h("label", { htmlFor: this.checkboxId }, h("slot", { name: "label" }))));
|
|
43
53
|
}
|
|
44
54
|
static get is() { return "tds-checkbox"; }
|
|
45
55
|
static get encapsulation() { return "scoped"; }
|
|
@@ -128,7 +138,7 @@ export class TdsCheckbox {
|
|
|
128
138
|
},
|
|
129
139
|
"checked": {
|
|
130
140
|
"type": "boolean",
|
|
131
|
-
"mutable":
|
|
141
|
+
"mutable": true,
|
|
132
142
|
"complexType": {
|
|
133
143
|
"original": "boolean",
|
|
134
144
|
"resolved": "boolean",
|
|
@@ -144,6 +154,24 @@ export class TdsCheckbox {
|
|
|
144
154
|
"reflect": true,
|
|
145
155
|
"defaultValue": "false"
|
|
146
156
|
},
|
|
157
|
+
"indeterminate": {
|
|
158
|
+
"type": "boolean",
|
|
159
|
+
"mutable": true,
|
|
160
|
+
"complexType": {
|
|
161
|
+
"original": "boolean",
|
|
162
|
+
"resolved": "boolean",
|
|
163
|
+
"references": {}
|
|
164
|
+
},
|
|
165
|
+
"required": false,
|
|
166
|
+
"optional": false,
|
|
167
|
+
"docs": {
|
|
168
|
+
"tags": [],
|
|
169
|
+
"text": "Sets the Checkbox as indeterminate"
|
|
170
|
+
},
|
|
171
|
+
"attribute": "indeterminate",
|
|
172
|
+
"reflect": false,
|
|
173
|
+
"defaultValue": "false"
|
|
174
|
+
},
|
|
147
175
|
"value": {
|
|
148
176
|
"type": "string",
|
|
149
177
|
"mutable": false,
|
|
@@ -175,8 +203,8 @@ export class TdsCheckbox {
|
|
|
175
203
|
"text": "Sends unique Checkbox identifier and checked status when it is checked/unchecked."
|
|
176
204
|
},
|
|
177
205
|
"complexType": {
|
|
178
|
-
"original": "{\n checkboxId: string;\n checked: boolean;\n value?: string;\n }",
|
|
179
|
-
"resolved": "{ checkboxId: string; checked: boolean; value?: string; }",
|
|
206
|
+
"original": "{\n checkboxId: string;\n checked: boolean;\n indeterminate: boolean;\n value?: string;\n }",
|
|
207
|
+
"resolved": "{ checkboxId: string; checked: boolean; indeterminate: boolean; value?: string; }",
|
|
180
208
|
"references": {}
|
|
181
209
|
}
|
|
182
210
|
}, {
|
|
@@ -243,4 +271,10 @@ export class TdsCheckbox {
|
|
|
243
271
|
};
|
|
244
272
|
}
|
|
245
273
|
static get elementRef() { return "host"; }
|
|
274
|
+
static get watchers() {
|
|
275
|
+
return [{
|
|
276
|
+
"propName": "indeterminate",
|
|
277
|
+
"methodName": "handleIndeterminateState"
|
|
278
|
+
}];
|
|
279
|
+
}
|
|
246
280
|
}
|
|
@@ -37,6 +37,16 @@ export default {
|
|
|
37
37
|
defaultValue: { summary: false },
|
|
38
38
|
},
|
|
39
39
|
},
|
|
40
|
+
indeterminate: {
|
|
41
|
+
name: 'Indeterminate',
|
|
42
|
+
description: 'Sets the checkbox in a intederminte state.',
|
|
43
|
+
control: {
|
|
44
|
+
type: 'boolean',
|
|
45
|
+
},
|
|
46
|
+
table: {
|
|
47
|
+
defaultValue: { summary: false },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
40
50
|
disabled: {
|
|
41
51
|
name: 'Disabled',
|
|
42
52
|
description: 'Disables the Checkbox.',
|
|
@@ -52,29 +62,32 @@ export default {
|
|
|
52
62
|
label: 'Label',
|
|
53
63
|
checked: false,
|
|
54
64
|
disabled: false,
|
|
65
|
+
indeterminate: false,
|
|
55
66
|
},
|
|
56
67
|
};
|
|
57
|
-
const Template = ({ label, checked, disabled }) => formatHtmlPreview(`
|
|
68
|
+
const Template = ({ label, checked, disabled, indeterminate }) => formatHtmlPreview(`
|
|
58
69
|
<tds-checkbox
|
|
59
70
|
${checked ? 'checked' : ''}
|
|
60
71
|
${disabled ? 'disabled' : ''}
|
|
61
|
-
|
|
72
|
+
${indeterminate ? 'indeterminate' : ''}
|
|
73
|
+
value="checkbox-1"
|
|
74
|
+
checkbox-id="first-checkbox"
|
|
62
75
|
>
|
|
63
76
|
<div slot="label">${label}</div>
|
|
64
77
|
</tds-checkbox>
|
|
65
78
|
|
|
66
79
|
<!-- Script tag with event listener for demo purposes. -->
|
|
67
80
|
<script>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
81
|
+
checkboxElement = document.querySelector("tds-checkbox");
|
|
82
|
+
checkboxElement.addEventListener("tdsChange", (event) => {
|
|
83
|
+
console.log("Checkbox with id: ", event.detail.checkboxId, " is ", event.detail.checked);
|
|
84
|
+
});
|
|
85
|
+
checkboxElement.addEventListener("tdsFocus", (event) => {
|
|
86
|
+
console.log(event);
|
|
87
|
+
});
|
|
88
|
+
checkboxElement.addEventListener("tdsBlur", (event) => {
|
|
89
|
+
console.log(event);
|
|
90
|
+
});
|
|
78
91
|
</script>
|
|
79
92
|
`);
|
|
80
93
|
export const Default = Template.bind({});
|
|
@@ -64,7 +64,7 @@ export default {
|
|
|
64
64
|
},
|
|
65
65
|
defaultValue: {
|
|
66
66
|
name: 'Default value',
|
|
67
|
-
description: '
|
|
67
|
+
description: 'Default value of the component. Format for time: HH-MM. Format for date: YY-MM-DD. Format for date-time: YY-MM-DDTHH-MM.',
|
|
68
68
|
control: {
|
|
69
69
|
type: 'radio',
|
|
70
70
|
},
|
|
@@ -84,7 +84,7 @@ export default {
|
|
|
84
84
|
},
|
|
85
85
|
},
|
|
86
86
|
maxValue: {
|
|
87
|
-
description: 'Example for different types: datetime="2023-01-31T00:00" date="2023-01-01" time="15:00"',
|
|
87
|
+
description: 'Sets max value. Example for different types: datetime="2023-01-31T00:00" date="2023-01-01" time="15:00"',
|
|
88
88
|
name: 'Max value',
|
|
89
89
|
control: {
|
|
90
90
|
type: 'text',
|
|
@@ -183,14 +183,14 @@ const datetimeTemplate = ({ modeVariant, state, type, size, defaultValue, minVal
|
|
|
183
183
|
</style>
|
|
184
184
|
|
|
185
185
|
<div class="demo-wrapper">
|
|
186
|
-
|
|
186
|
+
|
|
187
187
|
<tds-datetime
|
|
188
188
|
id="datetime"
|
|
189
189
|
${defaultValue !== 'None' ? `default-value="${getDefaultValue(defaultValue, type)}"` : ''}
|
|
190
190
|
${modeVariant !== 'Inherit from parent' ? `mode-variant="${modeVariant.toLowerCase()}"` : ''}
|
|
191
191
|
type="${typeLookup[type]}"
|
|
192
192
|
${minValue ? `min=${minValue}` : ''}
|
|
193
|
-
${maxValue ? `
|
|
193
|
+
${maxValue ? `max=${maxValue}` : ''}
|
|
194
194
|
size="${sizeLookup[size]}"
|
|
195
195
|
state="${stateLookup[state]}"
|
|
196
196
|
${disabled ? 'disabled' : ''}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
:host {
|
|
2
|
+
box-sizing: border-box;
|
|
2
3
|
display: block;
|
|
3
4
|
background-color: var(--tds-dropdown-option-background);
|
|
4
5
|
}
|
|
6
|
+
:host * {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
}
|
|
5
9
|
:host .dropdown-option {
|
|
6
|
-
display: flex;
|
|
7
|
-
align-items: center;
|
|
8
10
|
color: var(--tds-dropdown-option-color);
|
|
9
11
|
border-bottom: 1px solid var(--tds-dropdown-option-border);
|
|
10
12
|
font: var(--tds-detail-02);
|
|
11
13
|
letter-spacing: var(--tds-detail-02-ls);
|
|
14
|
+
overflow-wrap: anywhere;
|
|
12
15
|
}
|
|
13
16
|
:host .dropdown-option.selected {
|
|
14
17
|
background-color: var(--tds-dropdown-option-background-selected);
|
|
@@ -16,19 +19,22 @@
|
|
|
16
19
|
:host .dropdown-option.disabled {
|
|
17
20
|
color: var(--tds-dropdown-option-color-disabled);
|
|
18
21
|
}
|
|
19
|
-
:host .dropdown-option
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
:host .dropdown-option.md {
|
|
23
|
-
height: 47px;
|
|
24
|
-
}
|
|
25
|
-
:host .dropdown-option.sm {
|
|
26
|
-
height: 39px;
|
|
22
|
+
:host .dropdown-option button:focus {
|
|
23
|
+
outline: 2px solid var(--tds-blue-400);
|
|
24
|
+
outline-offset: -2px;
|
|
27
25
|
}
|
|
28
26
|
:host .dropdown-option button {
|
|
29
27
|
all: unset;
|
|
30
28
|
width: 100%;
|
|
31
|
-
|
|
29
|
+
}
|
|
30
|
+
:host .dropdown-option button.lg {
|
|
31
|
+
padding: 19px 0 20px;
|
|
32
|
+
}
|
|
33
|
+
:host .dropdown-option button.md {
|
|
34
|
+
padding: 15px 0 16px;
|
|
35
|
+
}
|
|
36
|
+
:host .dropdown-option button.sm {
|
|
37
|
+
padding: 11px 0 12px;
|
|
32
38
|
}
|
|
33
39
|
:host .dropdown-option button .single-select {
|
|
34
40
|
display: flex;
|
|
@@ -36,10 +42,6 @@
|
|
|
36
42
|
justify-content: space-between;
|
|
37
43
|
padding: 0 16px;
|
|
38
44
|
}
|
|
39
|
-
:host .dropdown-option button:focus {
|
|
40
|
-
outline: 2px solid var(--tds-blue-400);
|
|
41
|
-
outline-offset: -2px;
|
|
42
|
-
}
|
|
43
45
|
:host .dropdown-option .multiselect {
|
|
44
46
|
width: 100%;
|
|
45
47
|
height: 100%;
|
|
@@ -48,7 +50,15 @@
|
|
|
48
50
|
display: flex;
|
|
49
51
|
height: 100%;
|
|
50
52
|
width: 100%;
|
|
51
|
-
|
|
53
|
+
}
|
|
54
|
+
:host .dropdown-option .multiselect tds-checkbox.lg {
|
|
55
|
+
padding: 15px 16px 16px;
|
|
56
|
+
}
|
|
57
|
+
:host .dropdown-option .multiselect tds-checkbox.md {
|
|
58
|
+
padding: 11px 16px 12px;
|
|
59
|
+
}
|
|
60
|
+
:host .dropdown-option .multiselect tds-checkbox.sm {
|
|
61
|
+
padding: 7px 16px 8px;
|
|
52
62
|
}
|
|
53
63
|
:host .dropdown-option:hover {
|
|
54
64
|
background-color: var(--tds-dropdown-option-background-hover);
|
|
@@ -72,9 +72,11 @@ export class TdsDropdownOption {
|
|
|
72
72
|
}
|
|
73
73
|
} }, h("tds-checkbox", { onTdsChange: (event) => {
|
|
74
74
|
this.handleMultiselect(event);
|
|
75
|
-
}, disabled: this.disabled, checked: this.selected
|
|
75
|
+
}, disabled: this.disabled, checked: this.selected, class: {
|
|
76
|
+
[this.size]: true,
|
|
77
|
+
} }, h("div", { slot: "label" }, h("slot", null))))) : (h("button", { onClick: () => {
|
|
76
78
|
this.handleSingleSelect();
|
|
77
|
-
}, onFocus: (event) => this.handleFocus(event), onBlur: (event) => this.handleBlur(event), disabled: this.disabled }, h("div", { class: "single-select" }, h("slot", null), this.selected && h("tds-icon", { name: "tick", size: "16px" })))))));
|
|
79
|
+
}, onFocus: (event) => this.handleFocus(event), onBlur: (event) => this.handleBlur(event), disabled: this.disabled, class: this.size }, h("div", { class: "single-select" }, h("slot", null), this.selected && h("tds-icon", { name: "tick", size: "16px" })))))));
|
|
78
80
|
}
|
|
79
81
|
static get is() { return "tds-dropdown-option"; }
|
|
80
82
|
static get encapsulation() { return "shadow"; }
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
:host button.placeholder {
|
|
19
19
|
color: var(--tds-dropdown-placeholder-color);
|
|
20
|
+
line-height: 1.3;
|
|
20
21
|
}
|
|
21
22
|
:host button.value {
|
|
22
23
|
color: var(--tds-dropdown-value-color);
|
|
@@ -41,6 +42,18 @@
|
|
|
41
42
|
:host button.error {
|
|
42
43
|
border-bottom: 1px solid var(--tds-negative);
|
|
43
44
|
}
|
|
45
|
+
:host button.error:focus {
|
|
46
|
+
border-bottom-color: transparent;
|
|
47
|
+
}
|
|
48
|
+
:host button.error:focus::before {
|
|
49
|
+
content: "";
|
|
50
|
+
position: absolute;
|
|
51
|
+
bottom: 0;
|
|
52
|
+
left: 0;
|
|
53
|
+
width: 100%;
|
|
54
|
+
height: 2px;
|
|
55
|
+
background: var(--tds-negative);
|
|
56
|
+
}
|
|
44
57
|
:host button:disabled {
|
|
45
58
|
color: var(--tds-dropdown-disabled-color);
|
|
46
59
|
border-bottom: 1px solid transparent;
|
|
@@ -111,6 +124,21 @@
|
|
|
111
124
|
height: 2px;
|
|
112
125
|
background: var(--tds-dropdown-border-bottom-open);
|
|
113
126
|
}
|
|
127
|
+
:host .filter.error {
|
|
128
|
+
border-bottom: 1px solid var(--tds-negative);
|
|
129
|
+
}
|
|
130
|
+
:host .filter.error.focus {
|
|
131
|
+
border-bottom-color: transparent;
|
|
132
|
+
}
|
|
133
|
+
:host .filter.error.focus::before {
|
|
134
|
+
content: "";
|
|
135
|
+
position: absolute;
|
|
136
|
+
bottom: 0;
|
|
137
|
+
left: 0;
|
|
138
|
+
width: 100%;
|
|
139
|
+
height: 2px;
|
|
140
|
+
background: var(--tds-negative);
|
|
141
|
+
}
|
|
114
142
|
:host .filter input {
|
|
115
143
|
flex: 1;
|
|
116
144
|
all: unset;
|
|
@@ -60,6 +60,9 @@ export class TdsDropdown {
|
|
|
60
60
|
};
|
|
61
61
|
this.getValue = () => {
|
|
62
62
|
const labels = this.getSelectedChildrenLabels();
|
|
63
|
+
if (!labels) {
|
|
64
|
+
return '';
|
|
65
|
+
}
|
|
63
66
|
return this.filter ? labels === null || labels === void 0 ? void 0 : labels.join(', ') : labels === null || labels === void 0 ? void 0 : labels.toString();
|
|
64
67
|
};
|
|
65
68
|
this.setValueAttribute = () => {
|
|
@@ -294,8 +297,12 @@ export class TdsDropdown {
|
|
|
294
297
|
render() {
|
|
295
298
|
var _a, _b, _c, _d;
|
|
296
299
|
appendHiddenInput(this.host, this.name, (_a = this.value) === null || _a === void 0 ? void 0 : _a.map((value) => value).toString(), this.disabled);
|
|
297
|
-
return (h(Host, { role: "select", class: `${this.modeVariant ? `tds-mode-variant-${this.modeVariant}` : ''}` }, this.label && this.labelPosition === 'outside' && (h("div", { class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { class: `dropdown-select ${this.size} ${this.disabled ? 'disabled' : ''}` }, this.filter ? (h("div", { class:
|
|
298
|
-
|
|
300
|
+
return (h(Host, { role: "select", class: `${this.modeVariant ? `tds-mode-variant-${this.modeVariant}` : ''}` }, this.label && this.labelPosition === 'outside' && (h("div", { class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { class: `dropdown-select ${this.size} ${this.disabled ? 'disabled' : ''}` }, this.filter ? (h("div", { class: {
|
|
301
|
+
filter: true,
|
|
302
|
+
focus: this.filterFocus,
|
|
303
|
+
disabled: this.disabled,
|
|
304
|
+
error: this.error,
|
|
305
|
+
} }, h("div", { class: "value-wrapper" }, this.label && this.labelPosition === 'inside' && this.placeholder && (h("div", { class: `label-inside ${this.size}` }, this.label)), this.label && this.labelPosition === 'inside' && !this.placeholder && (h("div", { class: `
|
|
299
306
|
label-inside-as-placeholder
|
|
300
307
|
${this.size}
|
|
301
308
|
${((_b = this.value) === null || _b === void 0 ? void 0 : _b.length) ? 'selected' : ''}
|
|
@@ -315,6 +322,9 @@ export class TdsDropdown {
|
|
|
315
322
|
}
|
|
316
323
|
})), h("tds-icon", { onClick: () => {
|
|
317
324
|
this.open = !this.open;
|
|
325
|
+
if (this.open) {
|
|
326
|
+
this.inputElement.focus();
|
|
327
|
+
}
|
|
318
328
|
}, class: `${this.open ? 'open' : 'closed'}`, name: "chevron_down", size: "16px" }))) : (h("button", { onClick: () => {
|
|
319
329
|
this.open = !this.open;
|
|
320
330
|
}, onKeyDown: (event) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[role=listitem] ::slotted(a),
|
|
2
2
|
[role=listitem] ::slotted(button) {
|
|
3
|
-
font: var(--tds-headline-
|
|
4
|
-
letter-spacing: var(--tds-headline-
|
|
3
|
+
font: var(--tds-headline-07);
|
|
4
|
+
letter-spacing: var(--tds-headline-07-ls);
|
|
5
5
|
color: var(--tds-footer-main-links);
|
|
6
6
|
opacity: var(--tds-footer-main-links-opacity);
|
|
7
7
|
text-decoration: none;
|
|
@@ -17,11 +17,9 @@
|
|
|
17
17
|
}
|
|
18
18
|
[role=listitem].top-part-child ::slotted(a),
|
|
19
19
|
[role=listitem].top-part-child ::slotted(button) {
|
|
20
|
+
font: var(--tds-headline-07);
|
|
21
|
+
letter-spacing: var(--tds-headline-07-ls);
|
|
20
22
|
color: var(--tds-footer-top-links);
|
|
21
|
-
font-family: "Scania Sans Semi Condensed", "Scania Sans Condensed", arial, helvetica, sans-serif;
|
|
22
|
-
font-weight: bold;
|
|
23
|
-
font-size: 14px;
|
|
24
|
-
line-height: 18px;
|
|
25
23
|
}
|
|
26
24
|
[role=listitem].top-part-child ::slotted(a:focus-visible),
|
|
27
25
|
[role=listitem].top-part-child ::slotted(button:focus-visible) {
|