@muibook/components 18.2.0 → 19.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/mui-card/body/index.js +13 -6
- package/dist/esm/components/mui-chip-input/index.js +103 -66
- package/dist/esm/components/mui-file-upload/index.js +28 -10
- package/dist/esm/components/mui-responsive/index.js +43 -24
- package/dist/esm/components/mui-slat/slat/index.js +10 -5
- package/dist/esm/components/mui-stepper/stepper/index.js +9 -9
- package/dist/esm/components/mui-table/cell/index.js +22 -3
- package/dist/esm/components/mui-table/row/index.js +87 -5
- package/dist/esm/css/mui-brand.css +1 -1
- package/dist/esm/css/mui-tokens.css +5 -0
- package/dist/esm/custom-elements.json +2939 -2858
- package/dist/esm/dynamic-attrs.json +32 -17
- package/dist/types/components/mui-chip-input/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class l extends HTMLElement {
|
|
2
2
|
static get observedAttributes() {
|
|
3
3
|
return ["condensed"];
|
|
4
4
|
}
|
|
@@ -32,8 +32,8 @@ class d extends HTMLElement {
|
|
|
32
32
|
c instanceof HTMLElement && (c.querySelectorAll("mui-cell").forEach((o) => {
|
|
33
33
|
o.setAttribute("card-slot", "");
|
|
34
34
|
}), r = !0);
|
|
35
|
-
const
|
|
36
|
-
|
|
35
|
+
const d = t.tagName.toLowerCase() === "mui-slat-group" ? [t] : Array.from(t.querySelectorAll("mui-slat-group"));
|
|
36
|
+
d.length && (r = !0, d.forEach((e) => {
|
|
37
37
|
e.setAttribute("usage", "card"), e.closest("mui-accordion-block") ? this.setAttribute("has-accordion-slat-group", "") : (this.setAttribute("inner-space", ""), this.setAttribute("has-card-slat-group", ""));
|
|
38
38
|
}));
|
|
39
39
|
}
|
|
@@ -64,9 +64,16 @@ class d extends HTMLElement {
|
|
|
64
64
|
padding-bottom: var(--space-200);
|
|
65
65
|
}
|
|
66
66
|
@media (min-width: 768px) {
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
:host([has-card-slat-group]) {
|
|
68
|
+
padding-bottom: var(--space-500);
|
|
69
|
+
}
|
|
69
70
|
}
|
|
71
|
+
|
|
72
|
+
:host([condensed]),
|
|
73
|
+
:host([condensed][inner-space]),
|
|
74
|
+
:host([condensed][has-card-slat-group]),
|
|
75
|
+
:host([condensed][has-accordion-slat-group]) {
|
|
76
|
+
padding: var(--space-000);
|
|
70
77
|
}
|
|
71
78
|
|
|
72
79
|
</style>
|
|
@@ -76,4 +83,4 @@ class d extends HTMLElement {
|
|
|
76
83
|
this.shadowRoot.innerHTML = s, this.updateSlottedContent();
|
|
77
84
|
}
|
|
78
85
|
}
|
|
79
|
-
customElements.get("mui-card-body") || customElements.define("mui-card-body",
|
|
86
|
+
customElements.get("mui-card-body") || customElements.define("mui-card-body", l);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "../mui-input/index.js";
|
|
2
2
|
import "../mui-chip/index.js";
|
|
3
|
+
import "../mui-button/index.js";
|
|
3
4
|
import "../mui-stack/hstack/index.js";
|
|
4
5
|
class w extends HTMLElement {
|
|
5
6
|
constructor() {
|
|
@@ -83,16 +84,16 @@ class w extends HTMLElement {
|
|
|
83
84
|
try {
|
|
84
85
|
e = JSON.parse(t);
|
|
85
86
|
} catch {
|
|
86
|
-
e = t.split(",").map((
|
|
87
|
+
e = t.split(",").map((o) => o.trim()).filter(Boolean);
|
|
87
88
|
}
|
|
88
89
|
if (!Array.isArray(e)) return [];
|
|
89
90
|
const i = new Map(this.parseOptions().map((a) => [a.value.toLowerCase(), a])), s = e.map((a) => {
|
|
90
|
-
const
|
|
91
|
-
return
|
|
91
|
+
const o = this.normalizeOption(a);
|
|
92
|
+
return o ? i.get(o.value.toLowerCase()) || o : null;
|
|
92
93
|
}).filter((a) => !!a), r = /* @__PURE__ */ new Set();
|
|
93
94
|
return s.filter((a) => {
|
|
94
|
-
const
|
|
95
|
-
return r.has(
|
|
95
|
+
const o = a.value.toLowerCase();
|
|
96
|
+
return r.has(o) ? !1 : (r.add(o), !0);
|
|
96
97
|
});
|
|
97
98
|
}
|
|
98
99
|
syncSelectedFromAttribute() {
|
|
@@ -115,6 +116,10 @@ class w extends HTMLElement {
|
|
|
115
116
|
get placement() {
|
|
116
117
|
return this.getAttribute("placement") === "after" ? "after" : "before";
|
|
117
118
|
}
|
|
119
|
+
set placement(t) {
|
|
120
|
+
const e = t === "after" ? "after" : "before";
|
|
121
|
+
this.setAttribute("placement", e);
|
|
122
|
+
}
|
|
118
123
|
get useStackLayout() {
|
|
119
124
|
if (this.hasAttribute("mobile-stack")) return !0;
|
|
120
125
|
const t = this.getAttribute("breakpoint");
|
|
@@ -196,21 +201,15 @@ class w extends HTMLElement {
|
|
|
196
201
|
handleKeyboard(t) {
|
|
197
202
|
const e = this.filteredOptions, i = e.length + (this.showCreateOption ? 1 : 0);
|
|
198
203
|
if (t.key === "ArrowDown" && i > 0) {
|
|
199
|
-
t.preventDefault(), this.highlightedIndex = (this.highlightedIndex + 1 + i) % i;
|
|
200
|
-
const s = this.inputValue.length;
|
|
201
|
-
this.rerenderAndPreserveFocus(s, s);
|
|
204
|
+
t.preventDefault(), this.highlightedIndex = (this.highlightedIndex + 1 + i) % i, this.updateListbox();
|
|
202
205
|
return;
|
|
203
206
|
}
|
|
204
207
|
if (t.key === "ArrowUp" && i > 0) {
|
|
205
|
-
t.preventDefault(), this.highlightedIndex = (this.highlightedIndex - 1 + i) % i;
|
|
206
|
-
const s = this.inputValue.length;
|
|
207
|
-
this.rerenderAndPreserveFocus(s, s);
|
|
208
|
+
t.preventDefault(), this.highlightedIndex = (this.highlightedIndex - 1 + i) % i, this.updateListbox();
|
|
208
209
|
return;
|
|
209
210
|
}
|
|
210
211
|
if (t.key === "Escape") {
|
|
211
|
-
this.highlightedIndex = -1;
|
|
212
|
-
const s = this.inputValue.length;
|
|
213
|
-
this.rerenderAndPreserveFocus(s, s);
|
|
212
|
+
this.highlightedIndex = -1, this.updateListbox();
|
|
214
213
|
return;
|
|
215
214
|
}
|
|
216
215
|
if (t.key === "Backspace" && !this.inputValue && this.selectedItems.length > 0) {
|
|
@@ -228,53 +227,97 @@ class w extends HTMLElement {
|
|
|
228
227
|
setupListeners() {
|
|
229
228
|
if (!this.shadowRoot) return;
|
|
230
229
|
const t = this.shadowRoot.querySelector("mui-input");
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
230
|
+
if (!t) return;
|
|
231
|
+
t.oninput = (i) => {
|
|
232
|
+
var a;
|
|
233
|
+
const s = (a = i.detail) == null ? void 0 : a.value, r = t.getAttribute("value") || "";
|
|
234
|
+
this.inputValue = s ?? r, this.highlightedIndex = -1, this.emitQueryChange(), this.updateListbox();
|
|
235
|
+
}, t.onkeydown = (i) => {
|
|
236
|
+
this.handleKeyboard(i);
|
|
237
|
+
};
|
|
238
|
+
const e = this.shadowRoot.querySelector(".listbox");
|
|
239
|
+
e && (e.onmousedown = (i) => {
|
|
240
|
+
const s = i.target, r = s == null ? void 0 : s.closest("[data-option-value]");
|
|
241
|
+
if (!r) return;
|
|
242
|
+
i.preventDefault();
|
|
243
|
+
const a = r.getAttribute("data-option-value");
|
|
244
|
+
a && this.addValue(a);
|
|
245
|
+
}), this.shadowRoot.querySelectorAll("[data-remove-value]").forEach((i) => {
|
|
246
|
+
i.addEventListener("dismiss", (s) => {
|
|
247
|
+
s.stopPropagation();
|
|
248
|
+
const r = i.getAttribute("data-remove-value");
|
|
249
|
+
r && !this.disabled && this.removeValue(r);
|
|
248
250
|
});
|
|
249
|
-
})
|
|
251
|
+
});
|
|
250
252
|
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
253
|
+
updateListbox() {
|
|
254
|
+
if (!this.shadowRoot) return;
|
|
255
|
+
const t = this.shadowRoot.querySelector(".listbox");
|
|
256
|
+
if (!t) return;
|
|
257
|
+
const e = this.filteredOptions;
|
|
258
|
+
if (!(!this.disabled && (e.length > 0 || this.showCreateOption) && this.inputValue.trim().length > 0)) {
|
|
259
|
+
t.hidden = !0, t.innerHTML = "";
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
const s = e.map((o, u) => {
|
|
263
|
+
const n = u === this.highlightedIndex;
|
|
254
264
|
return (
|
|
255
265
|
/*html*/
|
|
256
266
|
`
|
|
257
|
-
<button
|
|
258
|
-
|
|
259
|
-
|
|
267
|
+
<mui-button
|
|
268
|
+
variant="${n ? "secondary" : "tertiary"}"
|
|
269
|
+
size="small"
|
|
270
|
+
class="option ${n ? "active" : ""}"
|
|
260
271
|
role="option"
|
|
261
|
-
aria-selected="${
|
|
272
|
+
aria-selected="${n ? "true" : "false"}"
|
|
262
273
|
data-option-value="${o.value}"
|
|
263
|
-
>${o.label}</button>
|
|
274
|
+
>${o.label}</mui-button>
|
|
275
|
+
`
|
|
276
|
+
);
|
|
277
|
+
}).join(""), r = e.length, a = this.showCreateOption ? (
|
|
278
|
+
/*html*/
|
|
279
|
+
`
|
|
280
|
+
<mui-button
|
|
281
|
+
variant="${this.highlightedIndex === r ? "secondary" : "tertiary"}"
|
|
282
|
+
size="small"
|
|
283
|
+
class="option ${this.highlightedIndex === r ? "active" : ""}"
|
|
284
|
+
role="option"
|
|
285
|
+
aria-selected="${this.highlightedIndex === r ? "true" : "false"}"
|
|
286
|
+
data-option-value="${this.inputValue.trim()}"
|
|
287
|
+
>Add "${this.inputValue.trim()}"</mui-button>
|
|
288
|
+
`
|
|
289
|
+
) : "";
|
|
290
|
+
t.hidden = !1, t.innerHTML = `${s}${a}`;
|
|
291
|
+
}
|
|
292
|
+
render() {
|
|
293
|
+
const t = this.getAttribute("id") || "", e = this.getAttribute("label") || "", i = this.getAttribute("placeholder") || "Type to add", s = this.hasAttribute("hide-label"), r = this.useStackLayout, a = this.getAttribute("name") || "", o = this.filteredOptions, u = `${t}-listbox`, n = !this.disabled && (o.length > 0 || this.showCreateOption) && this.inputValue.trim().length > 0, c = o.map((l, v) => {
|
|
294
|
+
const d = v === this.highlightedIndex;
|
|
295
|
+
return (
|
|
296
|
+
/*html*/
|
|
297
|
+
`
|
|
298
|
+
<mui-button
|
|
299
|
+
variant="${d ? "secondary" : "tertiary"}"
|
|
300
|
+
size="small"
|
|
301
|
+
class="option ${d ? "active" : ""}"
|
|
302
|
+
role="option"
|
|
303
|
+
aria-selected="${d ? "true" : "false"}"
|
|
304
|
+
data-option-value="${l.value}"
|
|
305
|
+
>${l.label}</mui-button>
|
|
264
306
|
`
|
|
265
307
|
);
|
|
266
|
-
}).join(""),
|
|
308
|
+
}).join(""), h = o.length, p = this.showCreateOption ? (
|
|
267
309
|
/*html*/
|
|
268
310
|
`
|
|
269
|
-
<button
|
|
270
|
-
|
|
271
|
-
|
|
311
|
+
<mui-button
|
|
312
|
+
variant="${this.highlightedIndex === h ? "secondary" : "tertiary"}"
|
|
313
|
+
size="small"
|
|
314
|
+
class="option ${this.highlightedIndex === h ? "active" : ""}"
|
|
272
315
|
role="option"
|
|
273
|
-
aria-selected="${this.highlightedIndex ===
|
|
316
|
+
aria-selected="${this.highlightedIndex === h ? "true" : "false"}"
|
|
274
317
|
data-option-value="${this.inputValue.trim()}"
|
|
275
|
-
>Add "${this.inputValue.trim()}"</button>
|
|
318
|
+
>Add "${this.inputValue.trim()}"</mui-button>
|
|
276
319
|
`
|
|
277
|
-
) : "", m = this.placement, b = this.placement === "after" ? "chip-slot-shell after-shell" : "chip-slot-shell before-shell",
|
|
320
|
+
) : "", m = this.placement, b = this.placement === "after" ? "chip-slot-shell after-shell" : "chip-slot-shell before-shell", f = this.selectedItems.length ? (
|
|
278
321
|
/*html*/
|
|
279
322
|
`
|
|
280
323
|
<mui-h-stack
|
|
@@ -284,7 +327,7 @@ class w extends HTMLElement {
|
|
|
284
327
|
aligny="center"
|
|
285
328
|
>
|
|
286
329
|
${this.selectedItems.map(
|
|
287
|
-
(
|
|
330
|
+
(l) => (
|
|
288
331
|
/*html*/
|
|
289
332
|
`
|
|
290
333
|
<mui-chip
|
|
@@ -292,15 +335,15 @@ class w extends HTMLElement {
|
|
|
292
335
|
size="${this.normalizedSize}"
|
|
293
336
|
dismiss
|
|
294
337
|
${this.disabled ? "disabled" : ""}
|
|
295
|
-
data-remove-value="${
|
|
296
|
-
aria-label="Remove ${
|
|
297
|
-
>${
|
|
338
|
+
data-remove-value="${l.value}"
|
|
339
|
+
aria-label="Remove ${l.label}"
|
|
340
|
+
>${l.label}</mui-chip>
|
|
298
341
|
`
|
|
299
342
|
)
|
|
300
343
|
).join("")}
|
|
301
344
|
</mui-h-stack>
|
|
302
345
|
`
|
|
303
|
-
) : "",
|
|
346
|
+
) : "", g = a ? this.selectedValues.map((l) => `<input type="hidden" name="${a}" value="${l}" />`).join("") : "";
|
|
304
347
|
this.shadowRoot.innerHTML = /*html*/
|
|
305
348
|
`
|
|
306
349
|
<style>
|
|
@@ -362,16 +405,8 @@ class w extends HTMLElement {
|
|
|
362
405
|
}
|
|
363
406
|
.option {
|
|
364
407
|
width: 100%;
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
background: transparent;
|
|
368
|
-
padding: var(--space-200) var(--space-300);
|
|
369
|
-
cursor: pointer;
|
|
370
|
-
color: var(--text-color);
|
|
371
|
-
}
|
|
372
|
-
.option.active,
|
|
373
|
-
.option:hover {
|
|
374
|
-
background: var(--surface-elevated-200);
|
|
408
|
+
justify-content: flex-start;
|
|
409
|
+
--button-width: 100%;
|
|
375
410
|
}
|
|
376
411
|
</style>
|
|
377
412
|
|
|
@@ -391,16 +426,18 @@ class w extends HTMLElement {
|
|
|
391
426
|
value="${this.inputValue}"
|
|
392
427
|
${r ? 'slot-layout="stack-mobile"' : ""}
|
|
393
428
|
${this.disabled ? "disabled" : ""}
|
|
394
|
-
aria-controls="${
|
|
429
|
+
aria-controls="${u}"
|
|
395
430
|
aria-autocomplete="list"
|
|
396
431
|
>
|
|
397
|
-
${
|
|
432
|
+
${f}
|
|
398
433
|
</mui-input>
|
|
399
434
|
|
|
400
|
-
|
|
435
|
+
<div id="${u}" class="listbox" role="listbox" ${n ? "" : "hidden"}>
|
|
436
|
+
${n ? `${c}${p}` : ""}
|
|
437
|
+
</div>
|
|
401
438
|
</div>
|
|
402
439
|
|
|
403
|
-
${
|
|
440
|
+
${g}
|
|
404
441
|
`;
|
|
405
442
|
}
|
|
406
443
|
}
|
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
import "../mui-button/index.js";
|
|
2
|
-
class
|
|
2
|
+
class a extends HTMLElement {
|
|
3
|
+
static get observedAttributes() {
|
|
4
|
+
return ["accepted-file-types", "current-file-name", "acceptedfiletypes", "currentfilename"];
|
|
5
|
+
}
|
|
3
6
|
constructor() {
|
|
4
|
-
super(), this.attachShadow({ mode: "open" }), this.acceptedFileTypes = this.
|
|
7
|
+
super(), this.attachShadow({ mode: "open" }), this.acceptedFileTypes = this.readAcceptedFileTypes(), this.currentFileName = this.readCurrentFileName(), this.selectedFileName = null;
|
|
8
|
+
}
|
|
9
|
+
readAcceptedFileTypes() {
|
|
10
|
+
return this.getAttribute("accepted-file-types") || this.getAttribute("acceptedFileTypes") || this.getAttribute("acceptedfiletypes") || "";
|
|
11
|
+
}
|
|
12
|
+
readCurrentFileName() {
|
|
13
|
+
return this.getAttribute("current-file-name") || this.getAttribute("currentFileName") || this.getAttribute("currentfilename") || "";
|
|
14
|
+
}
|
|
15
|
+
attributeChangedCallback(e, i, t) {
|
|
16
|
+
if (i !== t) {
|
|
17
|
+
if (e === "accepted-file-types" || e === "acceptedfiletypes") {
|
|
18
|
+
this.acceptedFileTypes = this.readAcceptedFileTypes(), this.input && (this.input.accept = this.acceptedFileTypes);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
(e === "current-file-name" || e === "currentfilename") && (this.currentFileName = this.readCurrentFileName(), !this.selectedFileName && this.label && (this.label.textContent = this.currentFileName || "No file selected"));
|
|
22
|
+
}
|
|
5
23
|
}
|
|
6
24
|
connectedCallback() {
|
|
7
|
-
this.render(), this.cacheElements(), this.attachEvents();
|
|
25
|
+
this.acceptedFileTypes = this.readAcceptedFileTypes(), this.currentFileName = this.readCurrentFileName(), this.render(), this.cacheElements(), this.attachEvents();
|
|
8
26
|
}
|
|
9
27
|
disconnectedCallback() {
|
|
10
28
|
this.cleanupListeners();
|
|
@@ -78,7 +96,7 @@ class r extends HTMLElement {
|
|
|
78
96
|
}
|
|
79
97
|
</style>
|
|
80
98
|
<div class="wrapper">
|
|
81
|
-
<span class="label">${this.currentFileName}</span>
|
|
99
|
+
<span class="label">${this.selectedFileName || this.currentFileName || "No file selected"}</span>
|
|
82
100
|
<mui-button variant="tertiary">Browse</mui-button>
|
|
83
101
|
<input type="file" accept="${this.acceptedFileTypes}" />
|
|
84
102
|
</div>
|
|
@@ -95,16 +113,16 @@ class r extends HTMLElement {
|
|
|
95
113
|
this.input.click();
|
|
96
114
|
}, this._inputChangeHandler = this.handleFileChange.bind(this), this.wrapper.addEventListener("click", this._wrapperClickHandler), this.input.addEventListener("change", this._inputChangeHandler);
|
|
97
115
|
}
|
|
98
|
-
handleFileChange(
|
|
99
|
-
var
|
|
100
|
-
const
|
|
101
|
-
|
|
116
|
+
handleFileChange(e) {
|
|
117
|
+
var r;
|
|
118
|
+
const t = (r = e.target.files) == null ? void 0 : r[0];
|
|
119
|
+
t && (this.selectedFileName = t.name, this.label.textContent = t.name, this.dispatchEvent(
|
|
102
120
|
new CustomEvent("file-upload", {
|
|
103
|
-
detail: { file:
|
|
121
|
+
detail: { file: t },
|
|
104
122
|
bubbles: !0,
|
|
105
123
|
composed: !0
|
|
106
124
|
})
|
|
107
125
|
));
|
|
108
126
|
}
|
|
109
127
|
}
|
|
110
|
-
customElements.get("mui-file-upload") || customElements.define("mui-file-upload",
|
|
128
|
+
customElements.get("mui-file-upload") || customElements.define("mui-file-upload", a);
|
|
@@ -1,42 +1,61 @@
|
|
|
1
|
-
class
|
|
1
|
+
class a extends HTMLElement {
|
|
2
2
|
constructor() {
|
|
3
|
-
super(), this.slotEl = null, this.mqlLow = null, this.mqlHigh = null, this.mqlSingle = null;
|
|
4
|
-
const
|
|
3
|
+
super(), this.slotEl = null, this.mqlLow = null, this.mqlHigh = null, this.mqlSingle = null, this.cleanup = null;
|
|
4
|
+
const t = this.attachShadow({ mode: "open" }), s = (
|
|
5
5
|
/*css*/
|
|
6
6
|
`
|
|
7
7
|
:host { display: block; }
|
|
8
8
|
`
|
|
9
9
|
);
|
|
10
|
-
|
|
10
|
+
t.innerHTML = `
|
|
11
11
|
<style>${s}</style>
|
|
12
12
|
<slot></slot>
|
|
13
|
-
`, this.slotEl =
|
|
13
|
+
`, this.slotEl = t.querySelector("slot");
|
|
14
14
|
}
|
|
15
15
|
static get observedAttributes() {
|
|
16
16
|
return ["breakpoint", "breakpoint-low", "breakpoint-high"];
|
|
17
17
|
}
|
|
18
18
|
connectedCallback() {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
this.setupResponsive();
|
|
20
|
+
}
|
|
21
|
+
disconnectedCallback() {
|
|
22
|
+
this.teardownResponsive();
|
|
23
|
+
}
|
|
24
|
+
attributeChangedCallback(t, s, l) {
|
|
25
|
+
s !== l && a.observedAttributes.includes(t) && this.setupResponsive();
|
|
26
|
+
}
|
|
27
|
+
teardownResponsive() {
|
|
28
|
+
var t;
|
|
29
|
+
(t = this.cleanup) == null || t.call(this), this.cleanup = null, this.mqlLow = null, this.mqlHigh = null, this.mqlSingle = null;
|
|
30
|
+
}
|
|
31
|
+
setupResponsive() {
|
|
32
|
+
const t = this.getAttribute("breakpoint"), s = this.getAttribute("breakpoint-low"), l = this.getAttribute("breakpoint-high");
|
|
33
|
+
if (this.teardownResponsive(), !!this.slotEl)
|
|
21
34
|
if (s && l) {
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
this.
|
|
35
|
+
const n = parseInt(s), i = parseInt(l);
|
|
36
|
+
if (Number.isNaN(n) || Number.isNaN(i)) return;
|
|
37
|
+
this.mqlLow = window.matchMedia(`(max-width: ${n}px)`), this.mqlHigh = window.matchMedia(`(min-width: ${i}px)`);
|
|
38
|
+
const e = () => {
|
|
39
|
+
const o = this.mqlLow.matches, h = this.mqlHigh.matches, r = o ? "showBelow" : h ? "showAbove" : "showMiddle";
|
|
40
|
+
this.slotEl.setAttribute("name", r);
|
|
41
|
+
};
|
|
42
|
+
e(), this.mqlLow.addEventListener("change", e), this.mqlHigh.addEventListener("change", e), this.cleanup = () => {
|
|
43
|
+
var o, h;
|
|
44
|
+
(o = this.mqlLow) == null || o.removeEventListener("change", e), (h = this.mqlHigh) == null || h.removeEventListener("change", e);
|
|
45
|
+
};
|
|
46
|
+
} else if (t) {
|
|
47
|
+
const n = parseInt(t);
|
|
48
|
+
if (Number.isNaN(n)) return;
|
|
49
|
+
this.mqlSingle = window.matchMedia(`(max-width: ${n}px)`);
|
|
50
|
+
const i = () => {
|
|
51
|
+
this.slotEl.setAttribute("name", this.mqlSingle.matches ? "showBelow" : "showAbove");
|
|
27
52
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
this.mqlSingle = window.matchMedia(`(max-width: ${o}px)`);
|
|
32
|
-
const i = (t) => {
|
|
33
|
-
this.slotEl.setAttribute("name", t ? "showBelow" : "showAbove");
|
|
53
|
+
i(), this.mqlSingle.addEventListener("change", i), this.cleanup = () => {
|
|
54
|
+
var e;
|
|
55
|
+
(e = this.mqlSingle) == null || e.removeEventListener("change", i);
|
|
34
56
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}
|
|
57
|
+
} else
|
|
58
|
+
this.slotEl.removeAttribute("name");
|
|
40
59
|
}
|
|
41
60
|
}
|
|
42
|
-
customElements.get("mui-responsive") || customElements.define("mui-responsive",
|
|
61
|
+
customElements.get("mui-responsive") || customElements.define("mui-responsive", a);
|
|
@@ -108,13 +108,18 @@ class i extends HTMLElement {
|
|
|
108
108
|
--slat-background-hover: var(--slat-card-background-hover);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
:host([
|
|
112
|
-
border-radius: 0;
|
|
111
|
+
:host([radius="none"]) .action::part(border-radius) {
|
|
112
|
+
border-radius: 0;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
:host([condensed-slot]:
|
|
116
|
-
border-
|
|
117
|
-
border-
|
|
115
|
+
:host([radius="none"][condensed-slot]:first-of-type) .action::part(border-radius) {
|
|
116
|
+
border-top-left-radius: var(--card-radius);
|
|
117
|
+
border-top-right-radius: var(--card-radius);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
:host([radius="none"][condensed-slot]:last-of-type) .action::part(border-radius) {
|
|
121
|
+
border-bottom-left-radius: var(--card-radius);
|
|
122
|
+
border-bottom-right-radius: var(--card-radius);
|
|
118
123
|
}
|
|
119
124
|
|
|
120
125
|
::slotted(mui-avatar) {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
class u extends HTMLElement {
|
|
2
2
|
constructor() {
|
|
3
|
-
super(), this.onKeyDown = (
|
|
4
|
-
const
|
|
5
|
-
if (!
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
}, this.attachShadow({ mode: "open" })
|
|
9
|
-
const t = this.getAttribute("size");
|
|
10
|
-
this.setAttribute("size", t === "x-small" || t === "small" ? t : "medium");
|
|
3
|
+
super(), this.onKeyDown = (t) => {
|
|
4
|
+
const i = this.steps;
|
|
5
|
+
if (!i.length) return;
|
|
6
|
+
const s = t.key, e = this.activeStepIndex;
|
|
7
|
+
s === "ArrowRight" || s === "ArrowDown" ? (t.preventDefault(), this.setActiveStep(e + 1, "keyboard")) : s === "ArrowLeft" || s === "ArrowUp" ? (t.preventDefault(), this.setActiveStep(e - 1, "keyboard")) : s === "Home" ? (t.preventDefault(), this.setActiveStep(0, "keyboard")) : s === "End" && (t.preventDefault(), this.setActiveStep(i.length - 1, "keyboard"));
|
|
8
|
+
}, this.attachShadow({ mode: "open" });
|
|
11
9
|
}
|
|
12
10
|
static get observedAttributes() {
|
|
13
11
|
return ["direction", "active-step", "linear", "interactive", "size"];
|
|
14
12
|
}
|
|
15
13
|
connectedCallback() {
|
|
16
|
-
this.
|
|
14
|
+
this.hasAttribute("direction") || this.setAttribute("direction", "horizontal"), this.hasAttribute("active-step") || this.setAttribute("active-step", "1");
|
|
15
|
+
const t = this.getAttribute("size");
|
|
16
|
+
t === "x-small" || t === "small" || t === "medium" || this.setAttribute("size", "medium"), this.addEventListener("keydown", this.onKeyDown), this.render();
|
|
17
17
|
}
|
|
18
18
|
disconnectedCallback() {
|
|
19
19
|
this.removeEventListener("keydown", this.onKeyDown);
|
|
@@ -20,8 +20,17 @@ class t extends HTMLElement {
|
|
|
20
20
|
justify-content: space-between;
|
|
21
21
|
align-self: ${this.getAttribute("align-y") || "initial"};
|
|
22
22
|
text-align: left;
|
|
23
|
+
font-size: var(--row-cell-font-size, var(--text-font-size-m));
|
|
24
|
+
line-height: var(--row-cell-line-height, var(--text-line-height-m));
|
|
23
25
|
|
|
24
26
|
}
|
|
27
|
+
.inner {
|
|
28
|
+
display: inherit;
|
|
29
|
+
width: 100%;
|
|
30
|
+
min-width: 0;
|
|
31
|
+
align-items: inherit;
|
|
32
|
+
justify-content: inherit;
|
|
33
|
+
}
|
|
25
34
|
:host(*:first-of-type) {
|
|
26
35
|
padding-left: var(--space-400);
|
|
27
36
|
}
|
|
@@ -56,11 +65,21 @@ class t extends HTMLElement {
|
|
|
56
65
|
text-align: center;
|
|
57
66
|
}
|
|
58
67
|
:host([action]) {
|
|
59
|
-
|
|
60
|
-
|
|
68
|
+
display: inline-flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: flex-end;
|
|
71
|
+
}
|
|
72
|
+
:host([action]) .inner {
|
|
73
|
+
width: var(--row-action-size);
|
|
74
|
+
height: var(--row-action-size);
|
|
75
|
+
display: inline-flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
box-sizing: border-box;
|
|
79
|
+
margin-left: auto;
|
|
61
80
|
}
|
|
62
81
|
</style>
|
|
63
|
-
<slot></slot>
|
|
82
|
+
<div class="inner"><slot></slot></div>
|
|
64
83
|
`;
|
|
65
84
|
}
|
|
66
85
|
}
|