@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,12 +1,16 @@
1
- class e extends HTMLElement {
1
+ class a extends HTMLElement {
2
2
  static get observedAttributes() {
3
- return ["columns"];
3
+ return ["columns", "size"];
4
4
  }
5
5
  constructor() {
6
6
  super(), this.attachShadow({ mode: "open" });
7
7
  }
8
8
  connectedCallback() {
9
- this.setAttribute("role", "row"), this.syncContextAttributes(), this.render();
9
+ this.setAttribute("role", "row"), this.syncContextAttributes(), this.syncActionColumnState(), this.observeTableChanges(), this.render();
10
+ }
11
+ disconnectedCallback() {
12
+ var t;
13
+ (t = this.tableObserver) == null || t.disconnect(), this.tableObserver = void 0;
10
14
  }
11
15
  attributeChangedCallback() {
12
16
  this.render();
@@ -15,6 +19,48 @@ class e extends HTMLElement {
15
19
  const t = !!this.closest("mui-card");
16
20
  this.toggleAttribute("in-card", t);
17
21
  }
22
+ observeTableChanges() {
23
+ var e;
24
+ const t = this.closest("mui-table");
25
+ t && ((e = this.tableObserver) == null || e.disconnect(), this.tableObserver = new MutationObserver(() => {
26
+ this.syncActionColumnState();
27
+ }), this.tableObserver.observe(t, {
28
+ subtree: !0,
29
+ childList: !0,
30
+ attributes: !0,
31
+ attributeFilter: ["action"],
32
+ characterData: !0
33
+ }));
34
+ }
35
+ clearActionPlaceholderStyles(t) {
36
+ const e = t;
37
+ e.style.removeProperty("width"), e.style.removeProperty("height"), e.style.removeProperty("display"), e.style.removeProperty("align-items"), e.style.removeProperty("justify-content");
38
+ }
39
+ syncActionColumnState() {
40
+ const t = this.closest("mui-table");
41
+ if (!t) return;
42
+ const e = !!t.querySelector("mui-cell[action]");
43
+ this.toggleAttribute("has-action-column", e);
44
+ const o = Array.from(this.children).filter(
45
+ (i) => i.tagName.toLowerCase() === "mui-cell"
46
+ ), r = o[o.length - 1];
47
+ if (!r) return;
48
+ const s = o.some(
49
+ (i) => i.hasAttribute("action")
50
+ );
51
+ if (!e || s) {
52
+ this.clearActionPlaceholderStyles(r);
53
+ return;
54
+ }
55
+ const n = Array.from(r.children).some(
56
+ (i) => i.nodeType === Node.ELEMENT_NODE
57
+ ), l = (r.textContent || "").trim();
58
+ if (!(!n && l.length === 0)) {
59
+ this.clearActionPlaceholderStyles(r);
60
+ return;
61
+ }
62
+ r.style.width = "var(--row-action-size)", r.style.height = "var(--row-action-size)", r.style.display = "inline-flex", r.style.alignItems = "center", r.style.justifyContent = "center";
63
+ }
18
64
  render() {
19
65
  this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
20
66
  `
@@ -27,7 +73,43 @@ class e extends HTMLElement {
27
73
  padding: var(--space-300) var(--space-000);
28
74
  border-top: var(--border-thin);
29
75
  align-items: center;
30
- min-height: 4.4rem;
76
+ min-height: var(--row-min-height, var(--row-action-size, var(--row-action-xs)));
77
+ }
78
+ :host(:not([size])) {
79
+ --row-action-size: var(--row-action-m);
80
+ --row-cell-font-size: var(--text-font-size-m);
81
+ --row-cell-line-height: var(--text-line-height-m);
82
+ --row-min-height: var(--row-action-m);
83
+ }
84
+ :host([size="xx-small"]) {
85
+ --row-action-size: var(--row-action-xxs);
86
+ --row-cell-font-size: var(--text-font-size-xs);
87
+ --row-cell-line-height: var(--text-line-height-xs);
88
+ --row-min-height: var(--row-action-xxs);
89
+ }
90
+ :host([size="x-small"]) {
91
+ --row-action-size: var(--row-action-xs);
92
+ --row-cell-font-size: var(--text-font-size-xs);
93
+ --row-cell-line-height: var(--text-line-height-xs);
94
+ --row-min-height: var(--row-action-xs);
95
+ }
96
+ :host([size="small"]) {
97
+ --row-action-size: var(--row-action-s);
98
+ --row-cell-font-size: var(--text-font-size-s);
99
+ --row-cell-line-height: var(--text-line-height-s);
100
+ --row-min-height: var(--row-action-s);
101
+ }
102
+ :host([size="medium"]) {
103
+ --row-action-size: var(--row-action-m);
104
+ --row-cell-font-size: var(--text-font-size-m);
105
+ --row-cell-line-height: var(--text-line-height-m);
106
+ --row-min-height: var(--row-action-m);
107
+ }
108
+ :host([size="large"]) {
109
+ --row-action-size: var(--row-action-l);
110
+ --row-cell-font-size: var(--text-font-size-l);
111
+ --row-cell-line-height: var(--text-line-height-l);
112
+ --row-min-height: var(--row-action-l);
31
113
  }
32
114
  :host([in-card]) {
33
115
  border-top-color: color-mix(in srgb, var(--border-color) 50%, transparent);
@@ -37,4 +119,4 @@ class e extends HTMLElement {
37
119
  `);
38
120
  }
39
121
  }
40
- customElements.get("mui-row") || customElements.define("mui-row", e);
122
+ customElements.get("mui-row") || customElements.define("mui-row", a);
@@ -1,6 +1,6 @@
1
1
 
2
2
  /* ================================================================================================== */
3
- /* Don't edit directly • Generated on Sat, 21 Mar 2026 05:19:16 GMT • muibook.com */
3
+ /* Don't edit directly • Generated on Tue, 24 Mar 2026 09:58:22 GMT • muibook.com */
4
4
  /* ================================================================================================== */
5
5
 
6
6
  /* ================================================================================================== */
@@ -796,6 +796,11 @@ html[data-theme="dark"] {
796
796
  --action-after-slot-padding: var(--space-300);
797
797
  --action-icon-only-padding: var(--space-000);
798
798
  --action-icon-only-size: 4.4rem;
799
+ --row-action-xxs: calc(var(--action-icon-only-size-x-small) - var(--space-100));
800
+ --row-action-xs: var(--action-icon-only-size-x-small);
801
+ --row-action-s: var(--action-icon-only-size-small);
802
+ --row-action-m: var(--action-icon-only-size);
803
+ --row-action-l: var(--action-icon-only-size-large);
799
804
 
800
805
  /* SIZE: LARGE */
801
806
  --action-radius-large: var(--radius-300);