@scania/tegel 0.0.11 → 0.0.12
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/loader.cjs.js +1 -1
- package/dist/cjs/tds-banner.cjs.entry.js +2 -2
- package/dist/cjs/tds-body-cell_2.cjs.entry.js +4 -8
- package/dist/cjs/tds-button.cjs.entry.js +4 -7
- package/dist/cjs/tds-chip.cjs.entry.js +1 -1
- package/dist/cjs/tds-datetime.cjs.entry.js +3 -1
- package/dist/cjs/tds-dropdown-option.cjs.entry.js +1 -1
- package/dist/cjs/tds-dropdown.cjs.entry.js +23 -6
- package/dist/cjs/tds-header-cell.cjs.entry.js +5 -5
- package/dist/cjs/tds-header-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-launcher.cjs.entry.js +1 -1
- package/dist/cjs/tds-modal.cjs.entry.js +1 -1
- package/dist/cjs/tds-popover-canvas.cjs.entry.js +1 -1
- package/dist/cjs/tds-popover-menu.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-overlay.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu.cjs.entry.js +6 -2
- package/dist/cjs/tds-table-body-row-expandable.cjs.entry.js +1 -3
- package/dist/cjs/tds-table-body.cjs.entry.js +6 -9
- package/dist/cjs/tds-table-header.cjs.entry.js +5 -5
- package/dist/cjs/tds-table-toolbar.cjs.entry.js +2 -2
- package/dist/cjs/tds-table.cjs.entry.js +13 -9
- package/dist/cjs/tds-text-field.cjs.entry.js +1 -1
- package/dist/cjs/tds-toast.cjs.entry.js +1 -1
- package/dist/cjs/tds-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/tegel.cjs.js +1 -1
- package/dist/collection/components/banner/banner.css +1 -1
- package/dist/collection/components/banner/banner.js +4 -4
- package/dist/collection/components/banner/banner.stories.js +1 -1
- package/dist/collection/components/button/button.css +33 -4
- package/dist/collection/components/button/button.js +3 -6
- package/dist/collection/components/chip/chip.js +1 -1
- package/dist/collection/components/datetime/datetime.js +38 -2
- package/dist/collection/components/datetime/datetime.stories.js +27 -3
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +1 -1
- package/dist/collection/components/dropdown/dropdown.js +30 -7
- package/dist/collection/components/header/header-dropdown/header-dropdown.css +1 -1
- package/dist/collection/components/header/header-launcher/header-launcher.css +1 -1
- package/dist/collection/components/modal/modal.css +2 -2
- package/dist/collection/components/popover-canvas/popover-canvas.css +1 -1
- package/dist/collection/components/popover-menu/popover-menu.css +1 -1
- package/dist/collection/components/popover-menu/popover-menu.js +1 -1
- package/dist/collection/components/side-menu/side-menu-overlay/side-menu-overlay.css +8 -1
- package/dist/collection/components/side-menu/side-menu.css +12 -11
- package/dist/collection/components/side-menu/side-menu.js +8 -4
- package/dist/collection/components/table/table/table.js +19 -15
- package/dist/collection/components/table/table-body/table-body.js +8 -11
- package/dist/collection/components/table/table-body-row/table-body-row.css +2 -2
- package/dist/collection/components/table/table-body-row/table-body-row.js +4 -9
- package/dist/collection/components/table/table-body-row-expandable/table-body-row-expandable.css +4 -0
- package/dist/collection/components/table/table-body-row-expandable/table-body-row-expandable.js +0 -2
- package/dist/collection/components/table/table-component-basic.stories.js +1 -1
- package/dist/collection/components/table/table-component-batch-actions.stories.js +2 -2
- package/dist/collection/components/table/table-component-bodydata.stories.js +1 -1
- package/dist/collection/components/table/table-component-custom-width.stories.js +1 -1
- package/dist/collection/components/table/table-component-event-listeners.stories.js +1 -1
- package/dist/collection/components/table/table-component-expandable-rows.stories.js +2 -2
- package/dist/collection/components/table/table-component-filtering.stories.js +6 -4
- package/dist/collection/components/table/table-component-multiselect.stories.js +5 -5
- package/dist/collection/components/table/table-component-pagination.stories.js +1 -1
- package/dist/collection/components/table/table-component-sorting.stories.js +1 -1
- package/dist/collection/components/table/table-header/table-header.js +7 -7
- package/dist/collection/components/table/table-header-cell/table-header-cell.js +7 -7
- package/dist/collection/components/table/table-toolbar/table-toolbar.js +4 -4
- package/dist/collection/components/table/table.filtering.spec.js +1 -1
- package/dist/collection/components/text-field/text-field.css +8 -6
- package/dist/collection/components/toast/toast.css +1 -1
- package/dist/collection/components/tooltip/tooltip.css +1 -1
- package/dist/collection/stories/patterns/navigation/navigation-manyitems.stories.js +2 -1
- package/dist/components/popover-canvas.js +1 -1
- package/dist/components/table-body-row.js +5 -10
- package/dist/components/tds-banner.js +2 -2
- package/dist/components/tds-button.js +4 -7
- package/dist/components/tds-chip.js +1 -1
- package/dist/components/tds-datetime.js +5 -1
- package/dist/components/tds-dropdown-option.js +1 -1
- package/dist/components/tds-dropdown.js +23 -6
- package/dist/components/tds-header-cell.js +7 -7
- package/dist/components/tds-header-dropdown.js +1 -1
- package/dist/components/tds-header-launcher.js +1 -1
- package/dist/components/tds-modal.js +1 -1
- package/dist/components/tds-popover-menu.js +1 -1
- package/dist/components/tds-side-menu-overlay.js +1 -1
- package/dist/components/tds-side-menu.js +9 -5
- package/dist/components/tds-table-body-row-expandable.js +1 -3
- package/dist/components/tds-table-body.js +8 -11
- package/dist/components/tds-table-header.js +7 -7
- package/dist/components/tds-table-toolbar.js +3 -3
- package/dist/components/tds-table.js +16 -12
- package/dist/components/tds-text-field.js +1 -1
- package/dist/components/tds-toast.js +1 -1
- package/dist/components/tds-tooltip.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tds-banner.entry.js +2 -2
- package/dist/esm/tds-body-cell_2.entry.js +4 -8
- package/dist/esm/tds-button.entry.js +4 -7
- package/dist/esm/tds-chip.entry.js +1 -1
- package/dist/esm/tds-datetime.entry.js +3 -1
- package/dist/esm/tds-dropdown-option.entry.js +1 -1
- package/dist/esm/tds-dropdown.entry.js +23 -6
- package/dist/esm/tds-header-cell.entry.js +5 -5
- package/dist/esm/tds-header-dropdown.entry.js +1 -1
- package/dist/esm/tds-header-launcher.entry.js +1 -1
- package/dist/esm/tds-modal.entry.js +1 -1
- package/dist/esm/tds-popover-canvas.entry.js +1 -1
- package/dist/esm/tds-popover-menu.entry.js +1 -1
- package/dist/esm/tds-side-menu-overlay.entry.js +1 -1
- package/dist/esm/tds-side-menu.entry.js +6 -2
- package/dist/esm/tds-table-body-row-expandable.entry.js +1 -3
- package/dist/esm/tds-table-body.entry.js +6 -9
- package/dist/esm/tds-table-header.entry.js +5 -5
- package/dist/esm/tds-table-toolbar.entry.js +2 -2
- package/dist/esm/tds-table.entry.js +13 -9
- package/dist/esm/tds-text-field.entry.js +1 -1
- package/dist/esm/tds-toast.entry.js +1 -1
- package/dist/esm/tds-tooltip.entry.js +1 -1
- package/dist/esm/tegel.js +1 -1
- package/dist/tegel/p-129ad2a4.entry.js +1 -0
- package/dist/tegel/{p-2e5f6086.entry.js → p-13db5228.entry.js} +1 -1
- package/dist/tegel/p-24488e72.entry.js +1 -0
- package/dist/tegel/{p-1a907ae9.entry.js → p-284d950d.entry.js} +1 -1
- package/dist/tegel/p-28a07d46.entry.js +1 -0
- package/dist/tegel/p-39e17b32.entry.js +1 -0
- package/dist/tegel/p-5e0a3931.entry.js +1 -0
- package/dist/tegel/p-5e4b20ea.entry.js +1 -0
- package/dist/tegel/p-5ed7d376.entry.js +1 -0
- package/dist/tegel/p-6caac101.entry.js +1 -0
- package/dist/tegel/{p-43320d81.entry.js → p-76c000e3.entry.js} +1 -1
- package/dist/tegel/p-7a03d28c.entry.js +1 -0
- package/dist/tegel/p-7c35af1b.entry.js +1 -0
- package/dist/tegel/{p-f64ff692.entry.js → p-86028bac.entry.js} +1 -1
- package/dist/tegel/p-8e82be94.entry.js +1 -0
- package/dist/tegel/p-9f8aac62.entry.js +1 -0
- package/dist/tegel/p-afde572b.entry.js +1 -0
- package/dist/tegel/{p-65ab407b.entry.js → p-b63b9baa.entry.js} +1 -1
- package/dist/tegel/{p-cb5a4d7d.entry.js → p-c0ac4d0a.entry.js} +1 -1
- package/dist/tegel/p-c2566d65.entry.js +1 -0
- package/dist/tegel/p-d3c3633b.entry.js +1 -0
- package/dist/tegel/{p-0641ac24.entry.js → p-d735c39f.entry.js} +1 -1
- package/dist/tegel/p-fe4ac74c.entry.js +1 -0
- package/dist/tegel/tegel.css +2 -2
- package/dist/tegel/tegel.esm.js +1 -1
- package/dist/types/components/banner/banner.d.ts +1 -1
- package/dist/types/components/button/button.d.ts +0 -1
- package/dist/types/components/datetime/datetime.d.ts +5 -1
- package/dist/types/components/datetime/datetime.stories.d.ts +26 -0
- package/dist/types/components/dropdown/dropdown-option/dropdown-option.d.ts +1 -1
- package/dist/types/components/dropdown/dropdown.d.ts +2 -1
- package/dist/types/components/popover-menu/popover-menu.d.ts +4 -1
- package/dist/types/components/table/table/table.d.ts +6 -6
- package/dist/types/components/table/table-body/table-body.d.ts +2 -2
- package/dist/types/components/table/table-body-row/table-body-row.d.ts +1 -2
- package/dist/types/components/table/table-component-multiselect.stories.d.ts +2 -2
- package/dist/types/components/table/table-header/table-header.d.ts +2 -2
- package/dist/types/components/table/table-header-cell/table-header-cell.d.ts +2 -2
- package/dist/types/components/table/table-toolbar/table-toolbar.d.ts +1 -1
- package/dist/types/components.d.ts +43 -27
- package/package.json +1 -1
- package/dist/tegel/p-22b2c81a.entry.js +0 -1
- package/dist/tegel/p-2707da38.entry.js +0 -1
- package/dist/tegel/p-4163997b.entry.js +0 -1
- package/dist/tegel/p-44a2664d.entry.js +0 -1
- package/dist/tegel/p-49a084db.entry.js +0 -1
- package/dist/tegel/p-6200fc54.entry.js +0 -1
- package/dist/tegel/p-674009bd.entry.js +0 -1
- package/dist/tegel/p-79b1bb29.entry.js +0 -1
- package/dist/tegel/p-8c194dd8.entry.js +0 -1
- package/dist/tegel/p-8e745d73.entry.js +0 -1
- package/dist/tegel/p-cacdd03f.entry.js +0 -1
- package/dist/tegel/p-d5bd9b2e.entry.js +0 -1
- package/dist/tegel/p-da6f310c.entry.js +0 -1
- package/dist/tegel/p-e4d6a4c5.entry.js +0 -1
- package/dist/tegel/p-f36ec03b.entry.js +0 -1
- package/dist/tegel/p-fa30061f.entry.js +0 -1
|
@@ -22,6 +22,8 @@ export class TdsDatetime {
|
|
|
22
22
|
};
|
|
23
23
|
this.type = 'datetime-local';
|
|
24
24
|
this.value = '';
|
|
25
|
+
this.min = undefined;
|
|
26
|
+
this.max = undefined;
|
|
25
27
|
this.defaultValue = 'none';
|
|
26
28
|
this.disabled = false;
|
|
27
29
|
this.size = 'lg';
|
|
@@ -85,7 +87,7 @@ export class TdsDatetime {
|
|
|
85
87
|
? `tds-form-datetime-${this.state}`
|
|
86
88
|
: ''}
|
|
87
89
|
${this.modeVariant !== null ? `tds-mode-variant-${this.modeVariant}` : ''}
|
|
88
|
-
` }, this.label && (h("label", { htmlFor: this.name, class: "tds-datetime-label" }, this.label)), h("div", { onClick: (e) => this.handleFocusClick(e), class: "tds-datetime-container" }, h("div", { class: "tds-datetime-input-container" }, h("input", { ref: (inputEl) => (this.textInput = inputEl), class: className, type: this.type, disabled: this.disabled, value: this.value, autofocus: this.autofocus, name: this.name, onInput: (e) => this.handleInput(e), onBlur: (e) => this.handleBlur(e), onChange: (e) => this.handleChange(e) }), h("div", { class: "datetime-icon icon-datetime-local" }, h("tds-icon", { size: "20px", name: "calendar" })), h("div", { class: "datetime-icon icon-time" }, h("tds-icon", { size: "20px", name: "clock" }))), h("div", { class: "tds-datetime-bar" })), h("div", { class: "tds-datetime-helper" }, this.helper && (h("div", { class: "tds-helper" }, this.state === 'error' && h("tds-icon", { name: "error", size: "16px" }), this.helper)))));
|
|
90
|
+
` }, this.label && (h("label", { htmlFor: this.name, class: "tds-datetime-label" }, this.label)), h("div", { onClick: (e) => this.handleFocusClick(e), class: "tds-datetime-container" }, h("div", { class: "tds-datetime-input-container" }, h("input", { ref: (inputEl) => (this.textInput = inputEl), class: className, type: this.type, disabled: this.disabled, value: this.value, min: this.min, max: this.max, autofocus: this.autofocus, name: this.name, onInput: (e) => this.handleInput(e), onBlur: (e) => this.handleBlur(e), onChange: (e) => this.handleChange(e) }), h("div", { class: "datetime-icon icon-datetime-local" }, h("tds-icon", { size: "20px", name: "calendar" })), h("div", { class: "datetime-icon icon-time" }, h("tds-icon", { size: "20px", name: "clock" }))), h("div", { class: "tds-datetime-bar" })), h("div", { class: "tds-datetime-helper" }, this.helper && (h("div", { class: "tds-helper" }, this.state === 'error' && h("tds-icon", { name: "error", size: "16px" }), this.helper)))));
|
|
89
91
|
}
|
|
90
92
|
static get is() { return "tds-datetime"; }
|
|
91
93
|
static get encapsulation() { return "scoped"; }
|
|
@@ -113,7 +115,7 @@ export class TdsDatetime {
|
|
|
113
115
|
"optional": false,
|
|
114
116
|
"docs": {
|
|
115
117
|
"tags": [],
|
|
116
|
-
"text": "
|
|
118
|
+
"text": "Sets input type"
|
|
117
119
|
},
|
|
118
120
|
"attribute": "type",
|
|
119
121
|
"reflect": true,
|
|
@@ -137,6 +139,40 @@ export class TdsDatetime {
|
|
|
137
139
|
"reflect": true,
|
|
138
140
|
"defaultValue": "''"
|
|
139
141
|
},
|
|
142
|
+
"min": {
|
|
143
|
+
"type": "string",
|
|
144
|
+
"mutable": false,
|
|
145
|
+
"complexType": {
|
|
146
|
+
"original": "string",
|
|
147
|
+
"resolved": "string",
|
|
148
|
+
"references": {}
|
|
149
|
+
},
|
|
150
|
+
"required": false,
|
|
151
|
+
"optional": false,
|
|
152
|
+
"docs": {
|
|
153
|
+
"tags": [],
|
|
154
|
+
"text": "Sets min value. Example for different types: datetime=\"2023-01-31T00:00\" date=\"2023-01-01\" time=\"15:00\""
|
|
155
|
+
},
|
|
156
|
+
"attribute": "min",
|
|
157
|
+
"reflect": false
|
|
158
|
+
},
|
|
159
|
+
"max": {
|
|
160
|
+
"type": "string",
|
|
161
|
+
"mutable": false,
|
|
162
|
+
"complexType": {
|
|
163
|
+
"original": "string",
|
|
164
|
+
"resolved": "string",
|
|
165
|
+
"references": {}
|
|
166
|
+
},
|
|
167
|
+
"required": false,
|
|
168
|
+
"optional": false,
|
|
169
|
+
"docs": {
|
|
170
|
+
"tags": [],
|
|
171
|
+
"text": "Sets max value. Example for different types: datetime=\"2023-01-31T00:00\" date=\"2023-01-01\" time=\"15:00\""
|
|
172
|
+
},
|
|
173
|
+
"attribute": "max",
|
|
174
|
+
"reflect": false
|
|
175
|
+
},
|
|
140
176
|
"defaultValue": {
|
|
141
177
|
"type": "string",
|
|
142
178
|
"mutable": false,
|
|
@@ -64,7 +64,7 @@ export default {
|
|
|
64
64
|
},
|
|
65
65
|
defaultValue: {
|
|
66
66
|
name: 'Default value',
|
|
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.',
|
|
67
|
+
description: 'Sets max value. 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
|
},
|
|
@@ -73,6 +73,26 @@ export default {
|
|
|
73
73
|
defaultValue: { summary: 'none' },
|
|
74
74
|
},
|
|
75
75
|
},
|
|
76
|
+
minValue: {
|
|
77
|
+
description: 'Sets min value. Example for different types: datetime="2023-01-31T00:00" date="2023-01-01" time="15:00"',
|
|
78
|
+
name: 'Min value',
|
|
79
|
+
control: {
|
|
80
|
+
type: 'text',
|
|
81
|
+
},
|
|
82
|
+
table: {
|
|
83
|
+
defaultValue: { summary: undefined },
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
maxValue: {
|
|
87
|
+
description: 'Example for different types: datetime="2023-01-31T00:00" date="2023-01-01" time="15:00"',
|
|
88
|
+
name: 'Max value',
|
|
89
|
+
control: {
|
|
90
|
+
type: 'text',
|
|
91
|
+
},
|
|
92
|
+
table: {
|
|
93
|
+
defaultValue: { summary: undefined },
|
|
94
|
+
},
|
|
95
|
+
},
|
|
76
96
|
noMinWidth: {
|
|
77
97
|
name: 'No minimum width',
|
|
78
98
|
description: 'Enables component to shrink below 208px which is the default width.',
|
|
@@ -114,13 +134,15 @@ export default {
|
|
|
114
134
|
type: 'Datetime',
|
|
115
135
|
size: 'Large',
|
|
116
136
|
defaultValue: 'None',
|
|
137
|
+
minValue: '',
|
|
138
|
+
maxValue: '',
|
|
117
139
|
noMinWidth: false,
|
|
118
140
|
label: 'Label text',
|
|
119
141
|
helper: 'Helper text',
|
|
120
142
|
disabled: false,
|
|
121
143
|
},
|
|
122
144
|
};
|
|
123
|
-
const datetimeTemplate = ({ modeVariant, state, type, size, defaultValue, noMinWidth, label, helper, disabled, }) => {
|
|
145
|
+
const datetimeTemplate = ({ modeVariant, state, type, size, defaultValue, minValue, maxValue, noMinWidth, label, helper, disabled, }) => {
|
|
124
146
|
const typeLookup = {
|
|
125
147
|
Datetime: 'datetime-local',
|
|
126
148
|
Date: 'date',
|
|
@@ -166,7 +188,9 @@ const datetimeTemplate = ({ modeVariant, state, type, size, defaultValue, noMinW
|
|
|
166
188
|
id="datetime"
|
|
167
189
|
${defaultValue !== 'None' ? `default-value="${getDefaultValue(defaultValue, type)}"` : ''}
|
|
168
190
|
${modeVariant !== 'Inherit from parent' ? `mode-variant="${modeVariant.toLowerCase()}"` : ''}
|
|
169
|
-
type="${typeLookup[type]}"
|
|
191
|
+
type="${typeLookup[type]}"
|
|
192
|
+
${minValue ? `min=${minValue}` : ''}
|
|
193
|
+
${maxValue ? `min=${maxValue}` : ''}
|
|
170
194
|
size="${sizeLookup[size]}"
|
|
171
195
|
state="${stateLookup[state]}"
|
|
172
196
|
${disabled ? 'disabled' : ''}
|
|
@@ -4,7 +4,7 @@ import { Host, h } from '@stencil/core';
|
|
|
4
4
|
*/
|
|
5
5
|
export class TdsDropdownOption {
|
|
6
6
|
constructor() {
|
|
7
|
-
this.
|
|
7
|
+
this.componentWillRender = () => {
|
|
8
8
|
this.parentElement =
|
|
9
9
|
this.host.parentElement.tagName === 'TDS-DROPDOWN'
|
|
10
10
|
? this.host.parentElement
|
|
@@ -10,11 +10,16 @@ export class TdsDropdown {
|
|
|
10
10
|
this.children = Array.from(this.host.children);
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
|
+
this.componentWillRender = () => {
|
|
14
|
+
if (!this.options) {
|
|
15
|
+
this.children = Array.from(this.host.children);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
13
18
|
this.setDefaultOption = () => {
|
|
14
19
|
this.children = this.children.map((element) => {
|
|
15
20
|
if (this.multiselect) {
|
|
16
|
-
this.defaultValue.split(',').forEach((
|
|
17
|
-
if (
|
|
21
|
+
this.defaultValue.split(',').forEach((value) => {
|
|
22
|
+
if (value === element.value) {
|
|
18
23
|
element.setSelected(true);
|
|
19
24
|
this.selection = this.selection
|
|
20
25
|
? [...this.selection, { value: element.value, label: element.textContent }]
|
|
@@ -114,10 +119,16 @@ export class TdsDropdown {
|
|
|
114
119
|
this.filterResult = undefined;
|
|
115
120
|
this.filterFocus = undefined;
|
|
116
121
|
}
|
|
117
|
-
/** Method that resets the Dropdown. */
|
|
122
|
+
/** Method that resets the Dropdown, marks all children as non-selected and resets the value to null. */
|
|
118
123
|
async reset() {
|
|
119
|
-
this.children
|
|
124
|
+
this.children = Array.from(this.host.children)
|
|
125
|
+
.filter((element) => element.tagName === 'TDS-DROPDOWN-OPTION')
|
|
126
|
+
.map((element) => {
|
|
127
|
+
element.setSelected(false);
|
|
128
|
+
return element;
|
|
129
|
+
});
|
|
120
130
|
this.selection = null;
|
|
131
|
+
this.host.setAttribute('value', null);
|
|
121
132
|
this.handleChange();
|
|
122
133
|
}
|
|
123
134
|
/** Method for setting the value of the Dropdown. */
|
|
@@ -129,7 +140,9 @@ export class TdsDropdown {
|
|
|
129
140
|
}
|
|
130
141
|
else {
|
|
131
142
|
this.selection = [{ value: newValue, label: newValueLabel }];
|
|
132
|
-
this.children = this.children
|
|
143
|
+
this.children = Array.from(this.host.children)
|
|
144
|
+
.filter((element) => element.tagName === 'TDS-DROPDOWN-OPTION')
|
|
145
|
+
.map((element) => {
|
|
133
146
|
if (element.value !== newValue) {
|
|
134
147
|
element.setSelected(false);
|
|
135
148
|
}
|
|
@@ -137,16 +150,20 @@ export class TdsDropdown {
|
|
|
137
150
|
});
|
|
138
151
|
}
|
|
139
152
|
this.handleChange();
|
|
153
|
+
this.host.setAttribute('value', this.selection.map((selection) => selection.value).toString());
|
|
140
154
|
return this.selection;
|
|
141
155
|
}
|
|
142
156
|
/** Method for removing a selected value in the Dropdown. */
|
|
143
157
|
async removeValue(oldValue) {
|
|
144
158
|
if (this.multiselect) {
|
|
145
|
-
this.children.
|
|
159
|
+
this.children = Array.from(this.host.children)
|
|
160
|
+
.filter((element) => element.tagName === 'TDS-DROPDOWN-OPTION')
|
|
161
|
+
.map((element) => {
|
|
146
162
|
if (element.value === oldValue) {
|
|
147
163
|
this.selection = this.selection.filter((item) => item.value !== element.value);
|
|
148
164
|
element.setSelected(false);
|
|
149
165
|
}
|
|
166
|
+
return element;
|
|
150
167
|
});
|
|
151
168
|
}
|
|
152
169
|
else {
|
|
@@ -638,12 +655,15 @@ export class TdsDropdown {
|
|
|
638
655
|
"references": {
|
|
639
656
|
"Promise": {
|
|
640
657
|
"location": "global"
|
|
658
|
+
},
|
|
659
|
+
"HTMLTdsDropdownOptionElement": {
|
|
660
|
+
"location": "global"
|
|
641
661
|
}
|
|
642
662
|
},
|
|
643
663
|
"return": "Promise<void>"
|
|
644
664
|
},
|
|
645
665
|
"docs": {
|
|
646
|
-
"text": "Method that resets the Dropdown.",
|
|
666
|
+
"text": "Method that resets the Dropdown, marks all children as non-selected and resets the value to null.",
|
|
647
667
|
"tags": []
|
|
648
668
|
}
|
|
649
669
|
},
|
|
@@ -682,6 +702,9 @@ export class TdsDropdown {
|
|
|
682
702
|
"references": {
|
|
683
703
|
"Promise": {
|
|
684
704
|
"location": "global"
|
|
705
|
+
},
|
|
706
|
+
"HTMLTdsDropdownOptionElement": {
|
|
707
|
+
"location": "global"
|
|
685
708
|
}
|
|
686
709
|
},
|
|
687
710
|
"return": "Promise<{ value: string; label: string; }[]>"
|
|
@@ -224,7 +224,7 @@ slot[name=header]::slotted(*) {
|
|
|
224
224
|
position: fixed;
|
|
225
225
|
height: 100%;
|
|
226
226
|
width: 100%;
|
|
227
|
-
z-index:
|
|
227
|
+
z-index: 700;
|
|
228
228
|
background-color: var(--tds-modal-backdrop);
|
|
229
229
|
padding: 0 16px;
|
|
230
230
|
}
|
|
@@ -303,7 +303,7 @@ button.tds-modal-close {
|
|
|
303
303
|
position: fixed;
|
|
304
304
|
height: 100%;
|
|
305
305
|
width: 100%;
|
|
306
|
-
z-index:
|
|
306
|
+
z-index: 700;
|
|
307
307
|
background-color: var(--tds-modal-backdrop);
|
|
308
308
|
padding: 0 16px;
|
|
309
309
|
}
|
|
@@ -86,7 +86,7 @@ export class TdsPopoverMenu {
|
|
|
86
86
|
"optional": false,
|
|
87
87
|
"docs": {
|
|
88
88
|
"tags": [],
|
|
89
|
-
"text": "
|
|
89
|
+
"text": "Controls whether the Popover is shown or not. If this is set hiding and showing\nwill be decided by this prop and will need to be controlled from the outside. This\nalso means that clicking outside of the popover won't close it."
|
|
90
90
|
},
|
|
91
91
|
"attribute": "show",
|
|
92
92
|
"reflect": false,
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
:host {
|
|
2
|
-
position:
|
|
2
|
+
position: fixed;
|
|
3
3
|
width: 100%;
|
|
4
4
|
height: 100%;
|
|
5
5
|
background-color: black;
|
|
6
6
|
transition: opacity 0.4s linear;
|
|
7
7
|
opacity: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
div {
|
|
11
|
+
position: fixed;
|
|
12
|
+
width: 100%;
|
|
13
|
+
height: 100%;
|
|
14
|
+
pointer-events: none;
|
|
8
15
|
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
top: 0;
|
|
10
10
|
width: 100%;
|
|
11
11
|
height: 100%;
|
|
12
|
+
z-index: 400;
|
|
12
13
|
}
|
|
13
14
|
:host .wrapper {
|
|
14
15
|
height: inherit;
|
|
@@ -48,41 +49,41 @@
|
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
@media (max-width: 992px) {
|
|
51
|
-
:host(
|
|
52
|
+
:host(.menu-opened) {
|
|
52
53
|
pointer-events: auto;
|
|
53
|
-
z-index:
|
|
54
|
+
z-index: 400;
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
57
|
@media (min-width: 992px) {
|
|
57
|
-
:host(
|
|
58
|
+
:host(.menu-persistent) {
|
|
58
59
|
pointer-events: auto;
|
|
59
60
|
position: static;
|
|
60
61
|
width: 272px;
|
|
61
62
|
height: auto;
|
|
62
63
|
border-right: 1px solid var(--tds-sidebar-side-menu-bottom-menu-border-top);
|
|
63
64
|
}
|
|
64
|
-
:host(
|
|
65
|
+
:host(.menu-persistent) .wrapper slot[name=overlay]::slotted(tds-side-menu-overlay) {
|
|
65
66
|
display: none;
|
|
66
67
|
}
|
|
67
|
-
:host(
|
|
68
|
+
:host(.menu-persistent) .wrapper slot[name=close-button]::slotted(tds-side-menu-close-button) {
|
|
68
69
|
display: none;
|
|
69
70
|
}
|
|
70
|
-
:host(
|
|
71
|
+
:host(.menu-persistent) .wrapper .tds-side-menu-wrapper {
|
|
71
72
|
transform: none;
|
|
72
73
|
}
|
|
73
|
-
:host(
|
|
74
|
+
:host(.menu-persistent) .menu {
|
|
74
75
|
width: 272px;
|
|
75
76
|
}
|
|
76
|
-
:host(
|
|
77
|
+
:host(.menu-persistent) .state-closed {
|
|
77
78
|
display: block;
|
|
78
79
|
}
|
|
79
|
-
:host(
|
|
80
|
+
:host(.menu-persistent):host(.menu-collapsed) {
|
|
80
81
|
width: 69px;
|
|
81
82
|
}
|
|
82
|
-
:host(
|
|
83
|
+
:host(.menu-persistent):host(.menu-collapsed) .menu {
|
|
83
84
|
width: 68px;
|
|
84
85
|
}
|
|
85
|
-
:host(
|
|
86
|
+
:host(.menu-persistent) slot[name=end]::slotted(*) {
|
|
86
87
|
display: none;
|
|
87
88
|
}
|
|
88
89
|
}
|
|
@@ -93,7 +93,11 @@ export class TdsSideMenu {
|
|
|
93
93
|
this.isClosed = true;
|
|
94
94
|
}
|
|
95
95
|
render() {
|
|
96
|
-
return (h(Host, { role: "navigation"
|
|
96
|
+
return (h(Host, { role: "navigation", class: {
|
|
97
|
+
'menu-opened': this.open,
|
|
98
|
+
'menu-persistent': this.persistent,
|
|
99
|
+
'menu-collapsed': this.collapsed,
|
|
100
|
+
} }, h("div", { class: {
|
|
97
101
|
'wrapper': true,
|
|
98
102
|
'state-upper-slot-empty': this.isUpperSlotEmpty,
|
|
99
103
|
'state-open': this.isOpen || this.isOpening,
|
|
@@ -129,7 +133,7 @@ export class TdsSideMenu {
|
|
|
129
133
|
"text": "Applicable only for mobile. If the Side Menu is open or not."
|
|
130
134
|
},
|
|
131
135
|
"attribute": "open",
|
|
132
|
-
"reflect":
|
|
136
|
+
"reflect": false,
|
|
133
137
|
"defaultValue": "false"
|
|
134
138
|
},
|
|
135
139
|
"persistent": {
|
|
@@ -147,7 +151,7 @@ export class TdsSideMenu {
|
|
|
147
151
|
"text": "Applicable only for desktop. If the Side Menu should always be shown."
|
|
148
152
|
},
|
|
149
153
|
"attribute": "persistent",
|
|
150
|
-
"reflect":
|
|
154
|
+
"reflect": false,
|
|
151
155
|
"defaultValue": "false"
|
|
152
156
|
},
|
|
153
157
|
"collapsed": {
|
|
@@ -165,7 +169,7 @@ export class TdsSideMenu {
|
|
|
165
169
|
"text": "If the Side Menu is collapsed. Only a persistent desktop menu can be collapsed.\nNOTE: Only use this if you have prevented the automatic collapsing with preventDefault on the tds-Collapse event."
|
|
166
170
|
},
|
|
167
171
|
"attribute": "collapsed",
|
|
168
|
-
"reflect":
|
|
172
|
+
"reflect": false,
|
|
169
173
|
"defaultValue": "false"
|
|
170
174
|
}
|
|
171
175
|
};
|
|
@@ -10,9 +10,9 @@ export class TdsTable {
|
|
|
10
10
|
this.verticalDividers = false;
|
|
11
11
|
this.compactDesign = false;
|
|
12
12
|
this.noMinWidth = undefined;
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
15
|
-
this.
|
|
13
|
+
this.multiselect = false;
|
|
14
|
+
this.expandableRows = false;
|
|
15
|
+
this.responsive = false;
|
|
16
16
|
this.modeVariant = null;
|
|
17
17
|
this.tableId = generateUniqueId();
|
|
18
18
|
}
|
|
@@ -24,10 +24,10 @@ export class TdsTable {
|
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
enableMultiselectChanged(newValue) {
|
|
27
|
-
this.emitInternalTdsPropChange('
|
|
27
|
+
this.emitInternalTdsPropChange('multiselect', newValue);
|
|
28
28
|
}
|
|
29
29
|
enableExpandableRowsChanged(newValue) {
|
|
30
|
-
this.emitInternalTdsPropChange('
|
|
30
|
+
this.emitInternalTdsPropChange('expandableRows', newValue);
|
|
31
31
|
}
|
|
32
32
|
compactDesignChanged(newValue) {
|
|
33
33
|
this.emitInternalTdsPropChange('compactDesign', newValue);
|
|
@@ -42,12 +42,16 @@ export class TdsTable {
|
|
|
42
42
|
this.emitInternalTdsPropChange('modeVariant', newValue);
|
|
43
43
|
}
|
|
44
44
|
render() {
|
|
45
|
-
return (h(Host, { class: {
|
|
45
|
+
return (h(Host, { class: {
|
|
46
|
+
'tds-table--responsive': this.responsive,
|
|
47
|
+
'tds-mode-variant-primary': this.modeVariant === 'primary',
|
|
48
|
+
'tds-mode-variant-secondary': this.modeVariant === 'secondary',
|
|
49
|
+
} }, h("table", { class: {
|
|
46
50
|
'tds-table': true,
|
|
47
51
|
'tds-table--compact': this.compactDesign,
|
|
48
52
|
'tds-table--divider': this.verticalDividers,
|
|
49
53
|
'tds-table--no-min-width': this.noMinWidth,
|
|
50
|
-
'tds-table--responsive': this.
|
|
54
|
+
'tds-table--responsive': this.responsive,
|
|
51
55
|
} }, h("slot", null))));
|
|
52
56
|
}
|
|
53
57
|
static get is() { return "tds-table"; }
|
|
@@ -117,7 +121,7 @@ export class TdsTable {
|
|
|
117
121
|
"attribute": "no-min-width",
|
|
118
122
|
"reflect": true
|
|
119
123
|
},
|
|
120
|
-
"
|
|
124
|
+
"multiselect": {
|
|
121
125
|
"type": "boolean",
|
|
122
126
|
"mutable": false,
|
|
123
127
|
"complexType": {
|
|
@@ -131,11 +135,11 @@ export class TdsTable {
|
|
|
131
135
|
"tags": [],
|
|
132
136
|
"text": "Enables multiselect feature of Table"
|
|
133
137
|
},
|
|
134
|
-
"attribute": "
|
|
138
|
+
"attribute": "multiselect",
|
|
135
139
|
"reflect": true,
|
|
136
140
|
"defaultValue": "false"
|
|
137
141
|
},
|
|
138
|
-
"
|
|
142
|
+
"expandableRows": {
|
|
139
143
|
"type": "boolean",
|
|
140
144
|
"mutable": false,
|
|
141
145
|
"complexType": {
|
|
@@ -149,11 +153,11 @@ export class TdsTable {
|
|
|
149
153
|
"tags": [],
|
|
150
154
|
"text": "Enables extended row feature of Table"
|
|
151
155
|
},
|
|
152
|
-
"attribute": "
|
|
156
|
+
"attribute": "expandable-rows",
|
|
153
157
|
"reflect": true,
|
|
154
158
|
"defaultValue": "false"
|
|
155
159
|
},
|
|
156
|
-
"
|
|
160
|
+
"responsive": {
|
|
157
161
|
"type": "boolean",
|
|
158
162
|
"mutable": false,
|
|
159
163
|
"complexType": {
|
|
@@ -167,7 +171,7 @@ export class TdsTable {
|
|
|
167
171
|
"tags": [],
|
|
168
172
|
"text": "Enables Table to take 100% available width with equal spacing of columns"
|
|
169
173
|
},
|
|
170
|
-
"attribute": "
|
|
174
|
+
"attribute": "responsive",
|
|
171
175
|
"reflect": true,
|
|
172
176
|
"defaultValue": "false"
|
|
173
177
|
},
|
|
@@ -238,10 +242,10 @@ export class TdsTable {
|
|
|
238
242
|
static get elementRef() { return "host"; }
|
|
239
243
|
static get watchers() {
|
|
240
244
|
return [{
|
|
241
|
-
"propName": "
|
|
245
|
+
"propName": "multiselect",
|
|
242
246
|
"methodName": "enableMultiselectChanged"
|
|
243
247
|
}, {
|
|
244
|
-
"propName": "
|
|
248
|
+
"propName": "expandableRows",
|
|
245
249
|
"methodName": "enableExpandableRowsChanged"
|
|
246
250
|
}, {
|
|
247
251
|
"propName": "compactDesign",
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { h, Host, } from '@stencil/core';
|
|
2
|
-
const relevantTableProps = [
|
|
3
|
-
'enableMultiselect',
|
|
4
|
-
'enableExpandableRows',
|
|
5
|
-
];
|
|
2
|
+
const relevantTableProps = ['multiselect', 'expandableRows'];
|
|
6
3
|
/**
|
|
7
4
|
* @slot <default> - <b>Unnamed slot.</b> For table rows.
|
|
8
5
|
* @slot no-result - Slot for no result message when using filtering.
|
|
@@ -39,9 +36,9 @@ export class TdsTableBody {
|
|
|
39
36
|
this.bodyData = undefined;
|
|
40
37
|
this.noResultMessage = undefined;
|
|
41
38
|
this.rowsPerPage = 1;
|
|
42
|
-
this.
|
|
39
|
+
this.multiselect = false;
|
|
43
40
|
this.enablePaginationTableBody = false;
|
|
44
|
-
this.
|
|
41
|
+
this.expandableRows = false;
|
|
45
42
|
this.innerBodyData = [];
|
|
46
43
|
this.bodyDataManipulated = [];
|
|
47
44
|
this.bodyDataOriginal = [];
|
|
@@ -98,7 +95,7 @@ export class TdsTableBody {
|
|
|
98
95
|
};
|
|
99
96
|
}
|
|
100
97
|
sortData(keyValue, sortingDirection) {
|
|
101
|
-
if (this.
|
|
98
|
+
if (this.multiselect) {
|
|
102
99
|
// Uncheck all checkboxes as the state of checkbox is lost on sorting. Do it only in case multiSelect is True.
|
|
103
100
|
this.uncheckAll();
|
|
104
101
|
}
|
|
@@ -125,7 +122,7 @@ export class TdsTableBody {
|
|
|
125
122
|
}
|
|
126
123
|
searchFunction(searchTerm) {
|
|
127
124
|
// grab all rows in body
|
|
128
|
-
const dataRowsFiltering = this.host.querySelectorAll('tds-table-body-row');
|
|
125
|
+
const dataRowsFiltering = this.host.querySelectorAll('tds-table-body-row, tds-table-body-row-expandable');
|
|
129
126
|
if (searchTerm.length > 0) {
|
|
130
127
|
if (this.enablePaginationTableBody) {
|
|
131
128
|
this.tempPaginationDisable = true;
|
|
@@ -190,7 +187,7 @@ export class TdsTableBody {
|
|
|
190
187
|
componentWillRender() {
|
|
191
188
|
const headerColumnsNo = this.host.parentElement.querySelector('tds-table-header').children.length;
|
|
192
189
|
// multiselect and expended features requires one extra column for controls...
|
|
193
|
-
if (this.
|
|
190
|
+
if (this.multiselect || this.expandableRows) {
|
|
194
191
|
this.columnsNumber = headerColumnsNo + 1;
|
|
195
192
|
}
|
|
196
193
|
else {
|
|
@@ -252,9 +249,9 @@ export class TdsTableBody {
|
|
|
252
249
|
static get states() {
|
|
253
250
|
return {
|
|
254
251
|
"rowsPerPage": {},
|
|
255
|
-
"
|
|
252
|
+
"multiselect": {},
|
|
256
253
|
"enablePaginationTableBody": {},
|
|
257
|
-
"
|
|
254
|
+
"expandableRows": {},
|
|
258
255
|
"innerBodyData": {},
|
|
259
256
|
"bodyDataManipulated": {},
|
|
260
257
|
"bodyDataOriginal": {},
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
:host(.tds-table__row--selected) {
|
|
23
|
-
background-color: var(--tds-table-body-row-background-
|
|
23
|
+
background-color: var(--tds-table-body-row-background-selected);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
:host(.tds-table__row--selected:hover) {
|
|
27
|
-
background-color: var(--tds-table-body-row-background-
|
|
27
|
+
background-color: var(--tds-table-body-row-background-selected-hover);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
:host(.tds-table__row--hidden) {
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { h, Host } from '@stencil/core';
|
|
2
2
|
const relevantTableProps = [
|
|
3
|
-
'
|
|
3
|
+
'multiselect',
|
|
4
4
|
'verticalDividers',
|
|
5
5
|
'compactDesign',
|
|
6
|
-
'modeVariant',
|
|
7
6
|
];
|
|
8
7
|
/**
|
|
9
8
|
* @slot <default> - <b>Unnamed slot.</b> For the cells.
|
|
10
9
|
*/
|
|
11
10
|
export class TdsTableBodyRow {
|
|
12
11
|
constructor() {
|
|
13
|
-
this.
|
|
12
|
+
this.multiselect = false;
|
|
14
13
|
this.bodyCheckBoxStatus = false;
|
|
15
14
|
this.mainCheckBoxStatus = false;
|
|
16
15
|
this.verticalDividers = false;
|
|
17
16
|
this.compactDesign = false;
|
|
18
17
|
this.noMinWidth = false;
|
|
19
|
-
this.modeVariant = null;
|
|
20
18
|
this.tableId = '';
|
|
21
19
|
}
|
|
22
20
|
bodyCheckBoxClicked(event) {
|
|
@@ -82,9 +80,7 @@ export class TdsTableBodyRow {
|
|
|
82
80
|
'tds-table__row': true,
|
|
83
81
|
'tds-table__compact': this.compactDesign,
|
|
84
82
|
'tds-table--divider': this.verticalDividers,
|
|
85
|
-
|
|
86
|
-
'tds-mode-variant-secondary': this.modeVariant === 'secondary',
|
|
87
|
-
} }, this.enableMultiselect && (h("td", { class: "tds-table__body-cell tds-table__body-cell--checkbox tds-form-label tds-form-label--table" }, h("tds-checkbox", { onTdsChange: (event) => this.bodyCheckBoxClicked(event), checked: this.bodyCheckBoxStatus }))), h("slot", null)));
|
|
83
|
+
} }, this.multiselect && (h("td", { class: "tds-table__body-cell tds-table__body-cell--checkbox tds-form-label tds-form-label--table" }, h("tds-checkbox", { onTdsChange: (event) => this.bodyCheckBoxClicked(event), checked: this.bodyCheckBoxStatus }))), h("slot", null)));
|
|
88
84
|
}
|
|
89
85
|
static get is() { return "tds-table-body-row"; }
|
|
90
86
|
static get encapsulation() { return "shadow"; }
|
|
@@ -100,13 +96,12 @@ export class TdsTableBodyRow {
|
|
|
100
96
|
}
|
|
101
97
|
static get states() {
|
|
102
98
|
return {
|
|
103
|
-
"
|
|
99
|
+
"multiselect": {},
|
|
104
100
|
"bodyCheckBoxStatus": {},
|
|
105
101
|
"mainCheckBoxStatus": {},
|
|
106
102
|
"verticalDividers": {},
|
|
107
103
|
"compactDesign": {},
|
|
108
104
|
"noMinWidth": {},
|
|
109
|
-
"modeVariant": {},
|
|
110
105
|
"tableId": {}
|
|
111
106
|
};
|
|
112
107
|
}
|