@spectrum-web-components/action-group 0.9.0 → 0.10.1-devmode.7
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/package.json +23 -10
- package/sp-action-group.dev.js +3 -0
- package/sp-action-group.dev.js.map +7 -0
- package/sp-action-group.js +3 -14
- package/sp-action-group.js.map +7 -1
- package/src/ActionGroup.dev.js +309 -0
- package/src/ActionGroup.dev.js.map +7 -0
- package/src/ActionGroup.js +291 -308
- package/src/ActionGroup.js.map +7 -1
- package/src/action-group.css.dev.js +149 -0
- package/src/action-group.css.dev.js.map +7 -0
- package/src/action-group.css.js +6 -33
- package/src/action-group.css.js.map +7 -1
- package/src/index.dev.js +2 -0
- package/src/index.dev.js.map +7 -0
- package/src/index.js +2 -13
- package/src/index.js.map +7 -1
- package/src/spectrum-action-group.css.dev.js +143 -0
- package/src/spectrum-action-group.css.dev.js.map +7 -0
- package/src/spectrum-action-group.css.js +3 -14
- package/src/spectrum-action-group.css.js.map +7 -1
- package/stories/action-group-tooltip.stories.js +116 -129
- package/stories/action-group-tooltip.stories.js.map +7 -1
- package/stories/action-group.stories.js +124 -135
- package/stories/action-group.stories.js.map +7 -1
- package/test/action-group-tooltip.test-vrt.js +4 -15
- package/test/action-group-tooltip.test-vrt.js.map +7 -1
- package/test/action-group.test-vrt.js +4 -15
- package/test/action-group.test-vrt.js.map +7 -1
- package/test/action-group.test.js +454 -465
- package/test/action-group.test.js.map +7 -1
- package/test/benchmark/basic-test.js +6 -17
- package/test/benchmark/basic-test.js.map +7 -1
package/src/ActionGroup.js
CHANGED
|
@@ -1,326 +1,309 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result)
|
|
9
|
+
__defProp(target, key, result);
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
import {
|
|
13
|
+
html,
|
|
14
|
+
SpectrumElement
|
|
15
|
+
} from "@spectrum-web-components/base";
|
|
16
|
+
import { property } from "@spectrum-web-components/base/src/decorators.js";
|
|
17
|
+
import { RovingTabindexController } from "@spectrum-web-components/reactive-controllers/src/RovingTabindex.js";
|
|
18
|
+
import { MutationController } from "@lit-labs/observers/mutation_controller.js";
|
|
19
|
+
import styles from "./action-group.css.js";
|
|
18
20
|
const EMPTY_SELECTION = [];
|
|
19
|
-
/**
|
|
20
|
-
* @element sp-action-group
|
|
21
|
-
* @slot - the sp-action-button elements that make up the group
|
|
22
|
-
*
|
|
23
|
-
* @fires change - Announces that selection state has been changed by user
|
|
24
|
-
*/
|
|
25
21
|
export class ActionGroup extends SpectrumElement {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
});
|
|
39
|
-
return elements[firstSelectedIndex]
|
|
40
|
-
? firstSelectedIndex
|
|
41
|
-
: firstEnabledIndex;
|
|
42
|
-
},
|
|
43
|
-
elements: () => this.buttons,
|
|
44
|
-
isFocusableElement: (el) => !el.disabled,
|
|
22
|
+
constructor() {
|
|
23
|
+
super();
|
|
24
|
+
this._buttons = [];
|
|
25
|
+
this._buttonSelector = "sp-action-button";
|
|
26
|
+
this.rovingTabindexController = new RovingTabindexController(this, {
|
|
27
|
+
focusInIndex: (elements) => {
|
|
28
|
+
let firstEnabledIndex = -1;
|
|
29
|
+
const firstSelectedIndex = elements.findIndex((el, index) => {
|
|
30
|
+
if (!elements[firstEnabledIndex] && !el.disabled) {
|
|
31
|
+
firstEnabledIndex = index;
|
|
32
|
+
}
|
|
33
|
+
return el.selected && !el.disabled;
|
|
45
34
|
});
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
// <selected> element merges selected so following paradigm here
|
|
70
|
-
const currentlySelectedButtons = [];
|
|
71
|
-
this.buttons.forEach((button) => {
|
|
72
|
-
if (button.selected) {
|
|
73
|
-
currentlySelectedButtons.push(button.value);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
this.setSelected(this.selected.concat(currentlySelectedButtons));
|
|
77
|
-
this.manageChildren();
|
|
78
|
-
this.manageSelects();
|
|
79
|
-
};
|
|
80
|
-
new MutationController(this, {
|
|
81
|
-
config: {
|
|
82
|
-
childList: true,
|
|
83
|
-
subtree: true,
|
|
84
|
-
},
|
|
85
|
-
callback: () => {
|
|
86
|
-
this.manageButtons();
|
|
87
|
-
},
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
static get styles() {
|
|
91
|
-
return [styles];
|
|
92
|
-
}
|
|
93
|
-
set buttons(tabs) {
|
|
94
|
-
if (tabs === this.buttons)
|
|
95
|
-
return;
|
|
96
|
-
this._buttons = tabs;
|
|
97
|
-
this.rovingTabindexController.clearElementCache();
|
|
98
|
-
}
|
|
99
|
-
get buttons() {
|
|
100
|
-
return this._buttons;
|
|
101
|
-
}
|
|
102
|
-
set selected(selected) {
|
|
103
|
-
this.requestUpdate('selected', this._selected);
|
|
104
|
-
this._selected = selected;
|
|
105
|
-
this.updateComplete.then(() => {
|
|
106
|
-
this.applySelects();
|
|
107
|
-
this.manageChildren();
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
get selected() {
|
|
111
|
-
return this._selected;
|
|
112
|
-
}
|
|
113
|
-
dispatchChange(old) {
|
|
114
|
-
const applyDefault = this.dispatchEvent(new Event('change', {
|
|
115
|
-
bubbles: true,
|
|
116
|
-
composed: true,
|
|
117
|
-
cancelable: true,
|
|
118
|
-
}));
|
|
119
|
-
if (!applyDefault) {
|
|
120
|
-
this.setSelected(old);
|
|
121
|
-
this.buttons.map((button) => {
|
|
122
|
-
button.selected = this.selected.includes(button.value);
|
|
123
|
-
});
|
|
35
|
+
return elements[firstSelectedIndex] ? firstSelectedIndex : firstEnabledIndex;
|
|
36
|
+
},
|
|
37
|
+
elements: () => this.buttons,
|
|
38
|
+
isFocusableElement: (el) => !el.disabled
|
|
39
|
+
});
|
|
40
|
+
this.compact = false;
|
|
41
|
+
this.emphasized = false;
|
|
42
|
+
this.justified = false;
|
|
43
|
+
this.label = "";
|
|
44
|
+
this.quiet = false;
|
|
45
|
+
this.vertical = false;
|
|
46
|
+
this._selected = EMPTY_SELECTION;
|
|
47
|
+
this.manageButtons = () => {
|
|
48
|
+
const slot = this.shadowRoot.querySelector("slot");
|
|
49
|
+
if (!slot)
|
|
50
|
+
return;
|
|
51
|
+
const assignedElements = slot.assignedElements({ flatten: true });
|
|
52
|
+
const buttons = assignedElements.reduce((acc, el) => {
|
|
53
|
+
if (el.matches(this._buttonSelector)) {
|
|
54
|
+
acc.push(el);
|
|
55
|
+
} else {
|
|
56
|
+
const buttonDescendents = Array.from(el.querySelectorAll(`:scope > ${this._buttonSelector}`));
|
|
57
|
+
acc.push(...buttonDescendents);
|
|
124
58
|
}
|
|
59
|
+
return acc;
|
|
60
|
+
}, []);
|
|
61
|
+
this.buttons = buttons;
|
|
62
|
+
const currentlySelectedButtons = [];
|
|
63
|
+
this.buttons.forEach((button) => {
|
|
64
|
+
if (button.selected) {
|
|
65
|
+
currentlySelectedButtons.push(button.value);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
this.setSelected(this.selected.concat(currentlySelectedButtons));
|
|
69
|
+
this.manageChildren();
|
|
70
|
+
this.manageSelects();
|
|
71
|
+
};
|
|
72
|
+
new MutationController(this, {
|
|
73
|
+
config: {
|
|
74
|
+
childList: true,
|
|
75
|
+
subtree: true
|
|
76
|
+
},
|
|
77
|
+
callback: () => {
|
|
78
|
+
this.manageButtons();
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
static get styles() {
|
|
83
|
+
return [styles];
|
|
84
|
+
}
|
|
85
|
+
set buttons(tabs) {
|
|
86
|
+
if (tabs === this.buttons)
|
|
87
|
+
return;
|
|
88
|
+
this._buttons = tabs;
|
|
89
|
+
this.rovingTabindexController.clearElementCache();
|
|
90
|
+
}
|
|
91
|
+
get buttons() {
|
|
92
|
+
return this._buttons;
|
|
93
|
+
}
|
|
94
|
+
set selected(selected) {
|
|
95
|
+
this.requestUpdate("selected", this._selected);
|
|
96
|
+
this._selected = selected;
|
|
97
|
+
this.updateComplete.then(() => {
|
|
98
|
+
this.applySelects();
|
|
99
|
+
this.manageChildren();
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
get selected() {
|
|
103
|
+
return this._selected;
|
|
104
|
+
}
|
|
105
|
+
dispatchChange(old) {
|
|
106
|
+
const applyDefault = this.dispatchEvent(new Event("change", {
|
|
107
|
+
bubbles: true,
|
|
108
|
+
composed: true,
|
|
109
|
+
cancelable: true
|
|
110
|
+
}));
|
|
111
|
+
if (!applyDefault) {
|
|
112
|
+
this.setSelected(old);
|
|
113
|
+
this.buttons.map((button) => {
|
|
114
|
+
button.selected = this.selected.includes(button.value);
|
|
115
|
+
});
|
|
125
116
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
117
|
+
}
|
|
118
|
+
setSelected(selected, announce) {
|
|
119
|
+
if (selected === this.selected)
|
|
120
|
+
return;
|
|
121
|
+
const old = this.selected;
|
|
122
|
+
this.requestUpdate("selected", old);
|
|
123
|
+
this._selected = selected;
|
|
124
|
+
if (!announce)
|
|
125
|
+
return;
|
|
126
|
+
this.dispatchChange(old);
|
|
127
|
+
}
|
|
128
|
+
focus(options) {
|
|
129
|
+
this.rovingTabindexController.focus(options);
|
|
130
|
+
}
|
|
131
|
+
deselectSelectedButtons() {
|
|
132
|
+
const selected = [
|
|
133
|
+
...this.querySelectorAll("[selected]")
|
|
134
|
+
];
|
|
135
|
+
selected.forEach((el) => {
|
|
136
|
+
el.selected = false;
|
|
137
|
+
el.tabIndex = -1;
|
|
138
|
+
el.setAttribute("aria-checked", "false");
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
handleClick(event) {
|
|
142
|
+
const target = event.target;
|
|
143
|
+
if (typeof target.value === "undefined") {
|
|
144
|
+
return;
|
|
148
145
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
target.setAttribute('aria-checked', target.selected ? 'true' : 'false');
|
|
168
|
-
if (target.selected) {
|
|
169
|
-
selected.push(target.value);
|
|
170
|
-
}
|
|
171
|
-
else {
|
|
172
|
-
selected.splice(this.selected.indexOf(target.value), 1);
|
|
173
|
-
}
|
|
174
|
-
this.setSelected(selected, true);
|
|
175
|
-
this.buttons.forEach((button) => {
|
|
176
|
-
button.tabIndex = -1;
|
|
177
|
-
});
|
|
178
|
-
target.tabIndex = 0;
|
|
179
|
-
break;
|
|
180
|
-
}
|
|
181
|
-
default:
|
|
182
|
-
break;
|
|
146
|
+
switch (this.selects) {
|
|
147
|
+
case "single": {
|
|
148
|
+
this.deselectSelectedButtons();
|
|
149
|
+
target.selected = true;
|
|
150
|
+
target.tabIndex = 0;
|
|
151
|
+
target.setAttribute("aria-checked", "true");
|
|
152
|
+
this.setSelected([target.value], true);
|
|
153
|
+
target.focus();
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
case "multiple": {
|
|
157
|
+
const selected = [...this.selected];
|
|
158
|
+
target.selected = !target.selected;
|
|
159
|
+
target.setAttribute("aria-checked", target.selected ? "true" : "false");
|
|
160
|
+
if (target.selected) {
|
|
161
|
+
selected.push(target.value);
|
|
162
|
+
} else {
|
|
163
|
+
selected.splice(this.selected.indexOf(target.value), 1);
|
|
183
164
|
}
|
|
165
|
+
this.setSelected(selected, true);
|
|
166
|
+
this.buttons.forEach((button) => {
|
|
167
|
+
button.tabIndex = -1;
|
|
168
|
+
});
|
|
169
|
+
target.tabIndex = 0;
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
default:
|
|
173
|
+
break;
|
|
184
174
|
}
|
|
185
|
-
|
|
186
|
-
|
|
175
|
+
}
|
|
176
|
+
async applySelects() {
|
|
177
|
+
await this.manageSelects(true);
|
|
178
|
+
}
|
|
179
|
+
async manageSelects(applied) {
|
|
180
|
+
if (!this.buttons.length) {
|
|
181
|
+
return;
|
|
187
182
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
183
|
+
const options = this.buttons;
|
|
184
|
+
switch (this.selects) {
|
|
185
|
+
case "single": {
|
|
186
|
+
this.setAttribute("role", "radiogroup");
|
|
187
|
+
const selections = [];
|
|
188
|
+
const updates = options.map(async (option) => {
|
|
189
|
+
await option.updateComplete;
|
|
190
|
+
option.setAttribute("role", "radio");
|
|
191
|
+
option.setAttribute("aria-checked", option.selected ? "true" : "false");
|
|
192
|
+
if (option.selected) {
|
|
193
|
+
selections.push(option);
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
if (applied)
|
|
197
|
+
break;
|
|
198
|
+
await Promise.all(updates);
|
|
199
|
+
const selected = selections.map((button) => {
|
|
200
|
+
return button.value;
|
|
201
|
+
});
|
|
202
|
+
this.setSelected(selected || EMPTY_SELECTION);
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
case "multiple": {
|
|
206
|
+
this.setAttribute("role", "group");
|
|
207
|
+
const selection = [];
|
|
208
|
+
const selections = [];
|
|
209
|
+
const updates = options.map(async (option) => {
|
|
210
|
+
await option.updateComplete;
|
|
211
|
+
option.setAttribute("role", "checkbox");
|
|
212
|
+
option.setAttribute("aria-checked", option.selected ? "true" : "false");
|
|
213
|
+
if (option.selected) {
|
|
214
|
+
selection.push(option.value);
|
|
215
|
+
selections.push(option);
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
if (applied)
|
|
219
|
+
break;
|
|
220
|
+
await Promise.all(updates);
|
|
221
|
+
const selected = !!selection.length ? selection : EMPTY_SELECTION;
|
|
222
|
+
this.setSelected(selected);
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
225
|
+
default:
|
|
226
|
+
if (this.selected.length) {
|
|
227
|
+
const selections = [];
|
|
228
|
+
const updates = options.map(async (option) => {
|
|
229
|
+
await option.updateComplete;
|
|
230
|
+
option.setAttribute("aria-checked", option.selected ? "true" : "false");
|
|
231
|
+
option.setAttribute("role", "button");
|
|
232
|
+
if (option.selected) {
|
|
233
|
+
selections.push(option);
|
|
235
234
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
break;
|
|
250
|
-
await Promise.all(updates);
|
|
251
|
-
this.setSelected(selections.map((button) => {
|
|
252
|
-
return button.value;
|
|
253
|
-
}));
|
|
254
|
-
}
|
|
255
|
-
else {
|
|
256
|
-
this.buttons.forEach((option) => {
|
|
257
|
-
option.setAttribute('role', 'button');
|
|
258
|
-
});
|
|
259
|
-
this.removeAttribute('role');
|
|
260
|
-
break;
|
|
261
|
-
}
|
|
235
|
+
});
|
|
236
|
+
if (applied)
|
|
237
|
+
break;
|
|
238
|
+
await Promise.all(updates);
|
|
239
|
+
this.setSelected(selections.map((button) => {
|
|
240
|
+
return button.value;
|
|
241
|
+
}));
|
|
242
|
+
} else {
|
|
243
|
+
this.buttons.forEach((option) => {
|
|
244
|
+
option.setAttribute("role", "button");
|
|
245
|
+
});
|
|
246
|
+
this.removeAttribute("role");
|
|
247
|
+
break;
|
|
262
248
|
}
|
|
263
249
|
}
|
|
264
|
-
|
|
265
|
-
|
|
250
|
+
}
|
|
251
|
+
render() {
|
|
252
|
+
return html`
|
|
266
253
|
<slot role="presentation" @slotchange=${this.manageButtons}></slot>
|
|
267
254
|
`;
|
|
255
|
+
}
|
|
256
|
+
firstUpdated(changes) {
|
|
257
|
+
super.firstUpdated(changes);
|
|
258
|
+
this.addEventListener("click", this.handleClick);
|
|
259
|
+
}
|
|
260
|
+
updated(changes) {
|
|
261
|
+
super.updated(changes);
|
|
262
|
+
if (changes.has("selects")) {
|
|
263
|
+
this.manageSelects();
|
|
264
|
+
this.manageChildren();
|
|
268
265
|
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
this.addEventListener('click', this.handleClick);
|
|
266
|
+
if (changes.has("quiet") && this.quiet || changes.has("emphasized") && this.emphasized) {
|
|
267
|
+
this.manageChildren();
|
|
272
268
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
if ((changes.has('quiet') && this.quiet) ||
|
|
280
|
-
(changes.has('emphasized') && this.emphasized)) {
|
|
281
|
-
this.manageChildren();
|
|
282
|
-
}
|
|
283
|
-
// Update `aria-label` when `label` available or not first `updated`
|
|
284
|
-
if (changes.has('label') &&
|
|
285
|
-
(this.label || typeof changes.get('label') !== 'undefined')) {
|
|
286
|
-
if (this.label.length) {
|
|
287
|
-
this.setAttribute('aria-label', this.label);
|
|
288
|
-
}
|
|
289
|
-
else {
|
|
290
|
-
this.removeAttribute('aria-label');
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
manageChildren() {
|
|
295
|
-
this.buttons.forEach((button) => {
|
|
296
|
-
button.quiet = this.quiet;
|
|
297
|
-
button.emphasized = this.emphasized;
|
|
298
|
-
button.selected = this.selected.includes(button.value);
|
|
299
|
-
});
|
|
269
|
+
if (changes.has("label") && (this.label || typeof changes.get("label") !== "undefined")) {
|
|
270
|
+
if (this.label.length) {
|
|
271
|
+
this.setAttribute("aria-label", this.label);
|
|
272
|
+
} else {
|
|
273
|
+
this.removeAttribute("aria-label");
|
|
274
|
+
}
|
|
300
275
|
}
|
|
276
|
+
}
|
|
277
|
+
manageChildren() {
|
|
278
|
+
this.buttons.forEach((button) => {
|
|
279
|
+
button.quiet = this.quiet;
|
|
280
|
+
button.emphasized = this.emphasized;
|
|
281
|
+
button.selected = this.selected.includes(button.value);
|
|
282
|
+
});
|
|
283
|
+
}
|
|
301
284
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
], ActionGroup.prototype, "compact",
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
], ActionGroup.prototype, "emphasized",
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
], ActionGroup.prototype, "justified",
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
], ActionGroup.prototype, "label",
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
], ActionGroup.prototype, "quiet",
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
], ActionGroup.prototype, "selects",
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
], ActionGroup.prototype, "vertical",
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
], ActionGroup.prototype, "selected",
|
|
326
|
-
//# sourceMappingURL=ActionGroup.js.map
|
|
285
|
+
__decorateClass([
|
|
286
|
+
property({ type: Boolean, reflect: true })
|
|
287
|
+
], ActionGroup.prototype, "compact", 2);
|
|
288
|
+
__decorateClass([
|
|
289
|
+
property({ type: Boolean, reflect: true })
|
|
290
|
+
], ActionGroup.prototype, "emphasized", 2);
|
|
291
|
+
__decorateClass([
|
|
292
|
+
property({ type: Boolean, reflect: true })
|
|
293
|
+
], ActionGroup.prototype, "justified", 2);
|
|
294
|
+
__decorateClass([
|
|
295
|
+
property({ type: String })
|
|
296
|
+
], ActionGroup.prototype, "label", 2);
|
|
297
|
+
__decorateClass([
|
|
298
|
+
property({ type: Boolean, reflect: true })
|
|
299
|
+
], ActionGroup.prototype, "quiet", 2);
|
|
300
|
+
__decorateClass([
|
|
301
|
+
property({ type: String })
|
|
302
|
+
], ActionGroup.prototype, "selects", 2);
|
|
303
|
+
__decorateClass([
|
|
304
|
+
property({ type: Boolean, reflect: true })
|
|
305
|
+
], ActionGroup.prototype, "vertical", 2);
|
|
306
|
+
__decorateClass([
|
|
307
|
+
property({ type: Array })
|
|
308
|
+
], ActionGroup.prototype, "selected", 1);
|
|
309
|
+
//# sourceMappingURL=ActionGroup.js.map
|