@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.
@@ -1,4 +1,4 @@
1
- class d extends HTMLElement {
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 l = t.tagName.toLowerCase() === "mui-slat-group" ? [t] : Array.from(t.querySelectorAll("mui-slat-group"));
36
- l.length && (r = !0, l.forEach((e) => {
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
- :host([has-card-slat-group]) {
68
- padding-bottom: var(--space-500);
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", d);
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((l) => l.trim()).filter(Boolean);
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 l = this.normalizeOption(a);
91
- return l ? i.get(l.value.toLowerCase()) || l : null;
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 l = a.value.toLowerCase();
95
- return r.has(l) ? !1 : (r.add(l), !0);
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
- t && (t.oninput = (e) => {
232
- var n;
233
- const i = this.getInnerInput(), s = (i == null ? void 0 : i.selectionStart) ?? null, r = (i == null ? void 0 : i.selectionEnd) ?? null, a = (n = e.detail) == null ? void 0 : n.value, l = t.getAttribute("value") || "";
234
- this.inputValue = a ?? l, this.highlightedIndex = -1, this.emitQueryChange(), this.rerenderAndPreserveFocus(s, r);
235
- }, t.onkeydown = (e) => {
236
- this.handleKeyboard(e);
237
- }, this.shadowRoot.querySelectorAll("[data-option-value]").forEach((e) => {
238
- e.addEventListener("mousedown", (i) => {
239
- i.preventDefault();
240
- const s = e.getAttribute("data-option-value");
241
- s && this.addValue(s);
242
- });
243
- }), this.shadowRoot.querySelectorAll("[data-remove-value]").forEach((e) => {
244
- e.addEventListener("dismiss", (i) => {
245
- i.stopPropagation();
246
- const s = e.getAttribute("data-remove-value");
247
- s && !this.disabled && this.removeValue(s);
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
- render() {
252
- 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") || "", l = this.filteredOptions, n = `${t}-listbox`, d = !this.disabled && (l.length > 0 || this.showCreateOption) && this.inputValue.trim().length > 0, c = l.map((o, v) => {
253
- const h = v === this.highlightedIndex;
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
- type="button"
259
- class="option ${h ? "active" : ""}"
267
+ <mui-button
268
+ variant="${n ? "secondary" : "tertiary"}"
269
+ size="small"
270
+ class="option ${n ? "active" : ""}"
260
271
  role="option"
261
- aria-selected="${h ? "true" : "false"}"
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(""), u = l.length, p = this.showCreateOption ? (
308
+ }).join(""), h = o.length, p = this.showCreateOption ? (
267
309
  /*html*/
268
310
  `
269
- <button
270
- type="button"
271
- class="option ${this.highlightedIndex === u ? "active" : ""}"
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 === u ? "true" : "false"}"
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", g = this.selectedItems.length ? (
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
- (o) => (
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="${o.value}"
296
- aria-label="Remove ${o.label}"
297
- >${o.label}</mui-chip>
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
- ) : "", f = a ? this.selectedValues.map((o) => `<input type="hidden" name="${a}" value="${o}" />`).join("") : "";
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
- text-align: left;
366
- border: none;
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="${n}"
429
+ aria-controls="${u}"
395
430
  aria-autocomplete="list"
396
431
  >
397
- ${g}
432
+ ${f}
398
433
  </mui-input>
399
434
 
400
- ${d ? `<div id="${n}" class="listbox" role="listbox">${c}${p}</div>` : ""}
435
+ <div id="${u}" class="listbox" role="listbox" ${n ? "" : "hidden"}>
436
+ ${n ? `${c}${p}` : ""}
437
+ </div>
401
438
  </div>
402
439
 
403
- ${f}
440
+ ${g}
404
441
  `;
405
442
  }
406
443
  }
@@ -1,10 +1,28 @@
1
1
  import "../mui-button/index.js";
2
- class r extends HTMLElement {
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.getAttribute("acceptedFileTypes") || "", this.currentFileName = this.getAttribute("currentFileName") || "", this.selectedFileName = null;
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(i) {
99
- var t;
100
- const e = (t = i.target.files) == null ? void 0 : t[0];
101
- e && (this.selectedFileName = e.name, this.label.textContent = e.name, this.dispatchEvent(
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: e },
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", r);
128
+ customElements.get("mui-file-upload") || customElements.define("mui-file-upload", a);
@@ -1,42 +1,61 @@
1
- class c extends HTMLElement {
1
+ class a extends HTMLElement {
2
2
  constructor() {
3
- super(), this.slotEl = null, this.mqlLow = null, this.mqlHigh = null, this.mqlSingle = null;
4
- const e = this.attachShadow({ mode: "open" }), s = (
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
- e.innerHTML = `
10
+ t.innerHTML = `
11
11
  <style>${s}</style>
12
12
  <slot></slot>
13
- `, this.slotEl = e.querySelector("slot");
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
- const e = this.getAttribute("breakpoint"), s = this.getAttribute("breakpoint-low"), l = this.getAttribute("breakpoint-high");
20
- if (this.slotEl) {
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 o = parseInt(s), i = parseInt(l);
23
- this.mqlLow = window.matchMedia(`(max-width: ${o}px)`), this.mqlHigh = window.matchMedia(`(min-width: ${i}px)`);
24
- const t = () => {
25
- const n = this.mqlLow.matches, h = this.mqlHigh.matches, a = n ? "showBelow" : h ? "showAbove" : "showMiddle";
26
- this.slotEl.setAttribute("name", a);
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
- t(), this.mqlLow.addEventListener("change", t), this.mqlHigh.addEventListener("change", t);
29
- } else if (e) {
30
- const o = parseInt(e);
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
- i(this.mqlSingle.matches), this.mqlSingle.addEventListener("change", (t) => {
36
- i(t.matches);
37
- });
38
- }
39
- }
57
+ } else
58
+ this.slotEl.removeAttribute("name");
40
59
  }
41
60
  }
42
- customElements.get("mui-responsive") || customElements.define("mui-responsive", c);
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([condensed-slot]) .action::part(border-radius) {
112
- border-radius: 0;
111
+ :host([radius="none"]) .action::part(border-radius) {
112
+ border-radius: 0;
113
113
  }
114
114
 
115
- :host([condensed-slot]:last-of-type) .action::part(border-radius) {
116
- border-bottom-left-radius: var(--card-radius);
117
- border-bottom-right-radius: var(--card-radius);
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 = (i) => {
4
- const s = this.steps;
5
- if (!s.length) return;
6
- const e = i.key, n = this.activeStepIndex;
7
- e === "ArrowRight" || e === "ArrowDown" ? (i.preventDefault(), this.setActiveStep(n + 1, "keyboard")) : e === "ArrowLeft" || e === "ArrowUp" ? (i.preventDefault(), this.setActiveStep(n - 1, "keyboard")) : e === "Home" ? (i.preventDefault(), this.setActiveStep(0, "keyboard")) : e === "End" && (i.preventDefault(), this.setActiveStep(s.length - 1, "keyboard"));
8
- }, this.attachShadow({ mode: "open" }), this.setAttribute("direction", this.getAttribute("direction") || "horizontal"), this.setAttribute("active-step", this.getAttribute("active-step") || "1");
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.addEventListener("keydown", this.onKeyDown), this.render();
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
- width: 4.4rem;
60
- height: 4.4rem;
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
  }