asma-ui-core 3.43.1 → 3.43.2

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,121 +1,129 @@
1
- import { resolveToolbarActionWidth as C } from "./planToolbarActions.js";
2
- var l = 8, g = 12, G = 160, H = 44, Y = 92, D = 44, V = 148, J = 44, K = 168, j = 9, q = 56, E = 360, z = 12;
3
- function L(t) {
1
+ import { resolveToolbarActionWidth as G } from "./planToolbarActions.js";
2
+ var r = 8, O = 12, H = 160, Y = 44, D = 92, V = 44, J = 148, K = 44, j = 168, q = 9, z = 56, N = 360, Q = 12;
3
+ function T(t) {
4
4
  return {
5
- leading: t?.leadingUtilityWidthPx ?? H,
6
- search: t?.searchWidthPx ?? G,
7
- selectionIndicator: t?.selectionIndicatorWidthPx ?? K,
8
- filter: (i) => i ? t?.filterIconWidthPx ?? D : t?.filterLabelWidthPx ?? Y,
9
- trailing: (i) => i ? t?.trailingIconWidthPx ?? J : t?.trailingLabelWidthPx ?? V
5
+ leading: t?.leadingUtilityWidthPx ?? Y,
6
+ search: t?.searchWidthPx ?? H,
7
+ selectionIndicator: t?.selectionIndicatorWidthPx ?? j,
8
+ filter: (i) => i ? t?.filterIconWidthPx ?? V : t?.filterLabelWidthPx ?? D,
9
+ trailing: (i) => i ? t?.trailingIconWidthPx ?? K : t?.trailingLabelWidthPx ?? J
10
10
  };
11
11
  }
12
- function Q(t) {
13
- return t ? typeof t == "string" ? t.length : z : 0;
12
+ function Z(t) {
13
+ return t ? typeof t == "string" ? t.length : Q : 0;
14
14
  }
15
- function k(t) {
16
- const i = Q(t);
15
+ function B(t) {
16
+ const i = Z(t);
17
17
  if (i === 0) return 0;
18
- const e = i > 0 ? i * j + 24 : 0;
19
- return Math.min(E, Math.max(q, e));
18
+ const e = i > 0 ? i * q + 24 : 0;
19
+ return Math.min(N, Math.max(z, e));
20
20
  }
21
- function Z(t, i) {
22
- return typeof t == "string" ? k(t) : i != null && i > 0 ? Math.min(E, i) : k(t);
21
+ function $(t, i) {
22
+ return typeof t == "string" ? B(t) : i != null && i > 0 ? Math.min(N, i) : B(t);
23
23
  }
24
- function T(t, i, e) {
25
- const n = t.filter((r) => !r.hidden);
26
- return n.length ? n.reduce((r, c) => r + C(c, i, e) + l, 0) - l : 0;
24
+ function S(t, i, e) {
25
+ const n = t.filter((o) => !o.hidden);
26
+ return n.length ? n.reduce((o, a) => o + G(a, i, e) + r, 0) - r : 0;
27
27
  }
28
28
  function F(t, i, e) {
29
- const n = t.filter((s) => !s.hidden).sort((s, u) => (u.priority ?? 0) - (s.priority ?? 0));
29
+ const n = t.filter((s) => !s.hidden).sort((s, I) => (I.priority ?? 0) - (s.priority ?? 0));
30
30
  if (!n.length) return 0;
31
- const r = n.slice(0, i), c = T(r, !0, e);
32
- return n.length === r.length ? c : c + (r.length ? l : 0) + 40;
31
+ const o = n.slice(0, i), a = S(o, !0, e);
32
+ return n.length === o.length ? a : a + (o.length ? r : 0) + 40;
33
33
  }
34
- function it(t, i, e, n = 3) {
34
+ function nt(t, i, e, n = 3) {
35
35
  return t > 0 ? t : F(i, n, e);
36
36
  }
37
- function B(t) {
38
- const { hasLeadingUtility: i, hasFilter: e, hasSearch: n, hasTrailingUtility: r, showPageActions: c, showBulkActions: s, filterIconOnly: u, trailingIconOnly: h, pageActionsWidthPx: I, bulkActionsWidthPx: O, searchBeforeFilter: W = !1, measured: y } = t, d = L(y);
39
- let o = 0;
40
- c && i && (o += d.leading + l);
41
- const f = e ? d.filter(u) + l : 0, p = n ? d.search + l : 0;
42
- return W ? o += p + f : o += f + p, c && (I > 0 && (o += I + l), r && (o += d.trailing(h) + l)), s && O > 0 && (o += O + l), Math.max(0, o - l);
37
+ function M(t) {
38
+ const { hasLeadingUtility: i, hasFilter: e, hasSearch: n, hasTrailingUtility: o, showPageActions: a, showBulkActions: s, filterIconOnly: I, trailingIconOnly: h, pageActionsWidthPx: u, bulkActionsWidthPx: P, searchBeforeFilter: A = !1, measured: W } = t, d = T(W);
39
+ let c = 0;
40
+ a && i && (c += d.leading + r);
41
+ const f = e ? d.filter(I) + r : 0, p = n ? d.search + r : 0;
42
+ return A ? c += p + f : c += f + p, a && (u > 0 && (c += u + r), o && (c += d.trailing(h) + r)), s && P > 0 && (c += P + r), Math.max(0, c - r);
43
43
  }
44
- function nt(t) {
45
- const { containerWidth: i, isMobile: e, isSelectionMode: n, compactBreakpointPx: r, reserveBulkActionsWidthPx: c, title: s, hasLeadingUtility: u, hasFilter: h, hasSearch: I, hasTrailingUtility: O, pageActions: W, bulkActions: y, maxVisibleBulkActions: d = 2, measured: o } = t, f = i > 0 ? i : Number.POSITIVE_INFINITY, p = !n, M = n, N = n ? 0 : c, v = L(o), _ = Z(s, o?.titleWidthPx), P = T(W, !0, o?.actionWidthPx), b = T(W, !1, o?.actionWidthPx), S = F(y, d, o?.actionWidthPx), A = (a) => B({
46
- hasLeadingUtility: u,
44
+ function et(t) {
45
+ const { containerWidth: i, isMobile: e, isSelectionMode: n, compactBreakpointPx: o, reserveBulkActionsWidthPx: a, title: s, hasLeadingUtility: I, hasFilter: h, hasSearch: u, hasTrailingUtility: P, pageActions: A, bulkActions: W, maxVisibleBulkActions: d = 2, measured: c } = t, f = i > 0 ? i : Number.POSITIVE_INFINITY, p = !n, X = n, R = n ? 0 : a, b = T(c), x = $(s, c?.titleWidthPx), g = S(A, !0, c?.actionWidthPx), k = S(A, !1, c?.actionWidthPx), E = F(W, d, c?.actionWidthPx), _ = (l) => M({
46
+ hasLeadingUtility: I,
47
47
  hasFilter: h,
48
- hasSearch: I,
49
- hasTrailingUtility: O,
48
+ hasSearch: u,
49
+ hasTrailingUtility: P,
50
50
  showPageActions: p,
51
- showBulkActions: M,
51
+ showBulkActions: X,
52
52
  bulkActionsWidthPx: 0,
53
- measured: o,
54
- ...a
53
+ measured: c,
54
+ ...l
55
55
  });
56
- if (e || f < r) {
57
- const a = (x) => f >= A({
58
- ...x,
56
+ if (e || f < o) {
57
+ const l = (y) => f >= _({
58
+ ...y,
59
59
  searchBeforeFilter: !0
60
- }), m = (x) => n ? !0 : x;
61
- return a({
62
- filterIconOnly: !1,
63
- trailingIconOnly: !1,
64
- pageActionsWidthPx: P
65
- }) ? {
66
- mode: "compact",
67
- filterIconOnly: !1,
68
- trailingIconOnly: m(!1)
69
- } : a({
70
- filterIconOnly: !1,
71
- trailingIconOnly: !0,
72
- pageActionsWidthPx: P
73
- }) ? {
74
- mode: "compact",
75
- filterIconOnly: !1,
76
- trailingIconOnly: !0
77
- } : a({
78
- filterIconOnly: !1,
79
- trailingIconOnly: !0,
80
- pageActionsWidthPx: b
81
- }) ? {
82
- mode: "compact",
83
- filterIconOnly: !1,
84
- trailingIconOnly: !0
85
- } : {
60
+ }), m = (y) => n ? !0 : y, v = [
61
+ {
62
+ filterIconOnly: !1,
63
+ trailingIconOnly: !1,
64
+ pageActionsWidthPx: g
65
+ },
66
+ {
67
+ filterIconOnly: !0,
68
+ trailingIconOnly: !1,
69
+ pageActionsWidthPx: g
70
+ },
71
+ {
72
+ filterIconOnly: !0,
73
+ trailingIconOnly: !0,
74
+ pageActionsWidthPx: g
75
+ },
76
+ {
77
+ filterIconOnly: !0,
78
+ trailingIconOnly: !0,
79
+ pageActionsWidthPx: k
80
+ }
81
+ ];
82
+ for (const y of v) {
83
+ const L = m(y.trailingIconOnly);
84
+ if (l({
85
+ ...y,
86
+ trailingIconOnly: L
87
+ })) return {
88
+ mode: "compact",
89
+ filterIconOnly: y.filterIconOnly,
90
+ trailingIconOnly: L
91
+ };
92
+ }
93
+ return {
86
94
  mode: "compact",
87
95
  filterIconOnly: !0,
88
96
  trailingIconOnly: !0
89
97
  };
90
98
  }
91
99
  if (n) {
92
- const a = (w) => B({
100
+ const l = (L) => M({
93
101
  hasLeadingUtility: !1,
94
102
  hasFilter: h,
95
- hasSearch: I,
103
+ hasSearch: u,
96
104
  hasTrailingUtility: !1,
97
105
  showPageActions: !1,
98
106
  showBulkActions: !1,
99
- filterIconOnly: w,
107
+ filterIconOnly: L,
100
108
  trailingIconOnly: !0,
101
109
  pageActionsWidthPx: 0,
102
110
  bulkActionsWidthPx: 0,
103
- measured: o
104
- }), m = s ? g : 0;
105
- if (f >= _ + v.selectionIndicator + m + A({
111
+ measured: c
112
+ }), m = s ? O : 0;
113
+ if (f >= x + b.selectionIndicator + m + _({
106
114
  filterIconOnly: !1,
107
115
  trailingIconOnly: !0,
108
116
  pageActionsWidthPx: 0,
109
- bulkActionsWidthPx: S
110
- }) + g) return {
117
+ bulkActionsWidthPx: E
118
+ }) + O) return {
111
119
  mode: "inline",
112
120
  filterIconOnly: !1,
113
121
  trailingIconOnly: !0
114
122
  };
115
- const x = _ + a(!1) + g, U = v.selectionIndicator + S + g;
116
- return f >= Math.max(x, U) ? {
123
+ const v = x + l(!1) + O, y = b.selectionIndicator + E + O;
124
+ return f >= Math.max(v, y) ? {
117
125
  mode: "selection-split",
118
- filterIconOnly: f < _ + a(!0) + g,
126
+ filterIconOnly: f < x + l(!0) + O,
119
127
  trailingIconOnly: !0
120
128
  } : {
121
129
  mode: "compact",
@@ -123,64 +131,76 @@ function nt(t) {
123
131
  trailingIconOnly: !0
124
132
  };
125
133
  }
126
- const X = (a) => f >= _ + A(a) + N + g, R = [
134
+ const U = (l) => f >= x + _(l) + R + O, w = [
127
135
  {
128
136
  filterIconOnly: !1,
129
137
  trailingIconOnly: !1,
130
- pageActionsWidthPx: P
138
+ pageActionsWidthPx: g
131
139
  },
132
140
  {
133
- filterIconOnly: !1,
134
- trailingIconOnly: !0,
135
- pageActionsWidthPx: P
141
+ filterIconOnly: !0,
142
+ trailingIconOnly: !1,
143
+ pageActionsWidthPx: g
136
144
  },
137
145
  {
138
146
  filterIconOnly: !0,
139
147
  trailingIconOnly: !0,
140
- pageActionsWidthPx: P
148
+ pageActionsWidthPx: g
141
149
  }
142
150
  ];
143
- for (const a of R) if (X(a)) return {
151
+ for (const l of w) if (U(l)) return {
144
152
  mode: "inline",
145
- filterIconOnly: a.filterIconOnly,
146
- trailingIconOnly: a.trailingIconOnly
153
+ filterIconOnly: l.filterIconOnly,
154
+ trailingIconOnly: l.trailingIconOnly
147
155
  };
148
- return f >= A({
149
- filterIconOnly: !1,
150
- trailingIconOnly: !1,
151
- pageActionsWidthPx: P,
152
- searchBeforeFilter: !0
153
- }) ? {
154
- mode: "stacked",
155
- filterIconOnly: !1,
156
- trailingIconOnly: !1
157
- } : f >= A({
158
- filterIconOnly: !0,
159
- trailingIconOnly: !0,
160
- pageActionsWidthPx: b,
156
+ const C = [
157
+ {
158
+ filterIconOnly: !1,
159
+ trailingIconOnly: !1,
160
+ pageActionsWidthPx: g
161
+ },
162
+ {
163
+ filterIconOnly: !0,
164
+ trailingIconOnly: !1,
165
+ pageActionsWidthPx: g
166
+ },
167
+ {
168
+ filterIconOnly: !0,
169
+ trailingIconOnly: !0,
170
+ pageActionsWidthPx: g
171
+ },
172
+ {
173
+ filterIconOnly: !0,
174
+ trailingIconOnly: !0,
175
+ pageActionsWidthPx: k
176
+ }
177
+ ];
178
+ for (const l of C) if (f >= _({
179
+ ...l,
161
180
  searchBeforeFilter: !0
162
- }) ? {
181
+ })) return {
163
182
  mode: "stacked",
164
- filterIconOnly: !0,
165
- trailingIconOnly: !0
166
- } : {
183
+ filterIconOnly: l.filterIconOnly,
184
+ trailingIconOnly: l.trailingIconOnly
185
+ };
186
+ return {
167
187
  mode: "compact",
168
188
  filterIconOnly: !0,
169
189
  trailingIconOnly: !0
170
190
  };
171
191
  }
172
- function et(t) {
173
- const { layoutMode: i, containerWidth: e, titleWidth: n, filterIconOnly: r, trailingIconOnly: c, hasFilter: s, hasSearch: u, hasLeadingUtility: h, hasTrailingUtility: I, reserveBulkActionsWidthPx: O, measured: W } = t, y = L(W), d = (h ? y.leading + l : 0) + (s ? y.filter(r) + l : 0) + (u ? y.search + l : 0) + (I ? y.trailing(c) + l : 0);
174
- return i === "stacked" || i === "compact" ? Math.max(80, e - d) : Math.max(80, e - n - d - g - O);
175
- }
176
192
  function lt(t) {
177
- const { layoutMode: i, containerWidth: e, titleWidth: n, filterIconOnly: r, hasFilter: c, hasSearch: s, measured: u } = t, h = L(u), I = (c ? h.filter(r) + l : 0) + (s ? h.search + l : 0);
178
- return i === "inline" ? Math.max(120, e - n - h.selectionIndicator - I - g * 2) : Math.max(120, e - h.selectionIndicator - g);
193
+ const { layoutMode: i, containerWidth: e, titleWidth: n, filterIconOnly: o, trailingIconOnly: a, hasFilter: s, hasSearch: I, hasLeadingUtility: h, hasTrailingUtility: u, reserveBulkActionsWidthPx: P, measured: A } = t, W = T(A), d = (h ? W.leading + r : 0) + (s ? W.filter(o) + r : 0) + (I ? W.search + r : 0) + (u ? W.trailing(a) + r : 0);
194
+ return i === "stacked" || i === "compact" ? Math.max(80, e - d) : Math.max(80, e - n - d - O - P);
195
+ }
196
+ function rt(t) {
197
+ const { layoutMode: i, containerWidth: e, titleWidth: n, filterIconOnly: o, hasFilter: a, hasSearch: s, measured: I } = t, h = T(I), u = (a ? h.filter(o) + r : 0) + (s ? h.search + r : 0);
198
+ return i === "inline" ? Math.max(120, e - n - h.selectionIndicator - u - O * 2) : Math.max(120, e - h.selectionIndicator - O);
179
199
  }
180
200
  export {
181
- lt as resolveBulkActionsAvailableWidth,
182
- et as resolvePageActionsAvailableWidth,
183
- it as resolveReserveBulkActionsWidthPx,
184
- Z as resolveTitleAreaWidth,
185
- nt as resolveToolbarLayout
201
+ rt as resolveBulkActionsAvailableWidth,
202
+ lt as resolvePageActionsAvailableWidth,
203
+ nt as resolveReserveBulkActionsWidthPx,
204
+ $ as resolveTitleAreaWidth,
205
+ et as resolveToolbarLayout
186
206
  };
@@ -10,19 +10,19 @@ function A(t, e, n) {
10
10
  function p(t) {
11
11
  return t.length ? t.reduce((e, n) => e + n.width, 0) + (t.length - 1) * 8 : 0;
12
12
  }
13
- function g(t, e, n) {
13
+ function x(t, e, n) {
14
14
  const i = p(t);
15
15
  return e ? i + (t.length ? 8 : 0) + n : i;
16
16
  }
17
17
  function w(t) {
18
18
  return t.filter((e) => !e.hidden).sort((e, n) => (n.priority ?? 0) - (e.priority ?? 0));
19
19
  }
20
- function x(t) {
20
+ function g(t) {
21
21
  return [...t].sort((e, n) => (n.priority ?? 0) - (e.priority ?? 0));
22
22
  }
23
23
  function N(t, e, n) {
24
24
  const i = [...t];
25
- for (let s = i.length - 1; s >= 0 && p(i) > e; s -= 1) {
25
+ for (let s = 0; s < i.length && p(i) > e; s += 1) {
26
26
  const r = i[s];
27
27
  !r || !r.showLabel || r.action.canHideLabel === !1 || (i[s] = {
28
28
  ...r,
@@ -34,24 +34,24 @@ function N(t, e, n) {
34
34
  }
35
35
  function O(t) {
36
36
  const { planned: e, availableWidth: n, preOverflow: i, moreButtonWidthPx: s, ignoreKeepVisible: r = !1 } = t, o = [...e], l = [], h = () => {
37
- let d = -1, c = Number.POSITIVE_INFINITY;
37
+ let f = -1, c = Number.POSITIVE_INFINITY;
38
38
  for (let u = o.length - 1; u >= 0; u -= 1) {
39
39
  const v = o[u];
40
40
  if (!v || !r && (v.action.keepVisible || v.action.canOverflow === !1)) continue;
41
- const f = v.action.priority ?? 0;
42
- f < c && (c = f, d = u);
41
+ const d = v.action.priority ?? 0;
42
+ d < c && (c = d, f = u);
43
43
  }
44
- return d;
44
+ return f;
45
45
  }, a = () => i.length > 0 || l.length > 0;
46
- for (; o.length && g(o, a(), s) > n; ) {
47
- const d = h();
48
- if (d < 0) break;
49
- const [c] = o.splice(d, 1);
46
+ for (; o.length && x(o, a(), s) > n; ) {
47
+ const f = h();
48
+ if (f < 0) break;
49
+ const [c] = o.splice(f, 1);
50
50
  c && l.unshift(c.action);
51
51
  }
52
52
  return {
53
53
  inlineActions: o,
54
- overflowActions: x([...i, ...l])
54
+ overflowActions: g([...i, ...l])
55
55
  };
56
56
  }
57
57
  function M(t) {
@@ -76,11 +76,11 @@ function M(t) {
76
76
  };
77
77
  }
78
78
  function B(t) {
79
- const { actions: e, availableWidth: n, maxInlineActions: i, collapseLabels: s = !0, resolveActionWidth: r, moreButtonWidthPx: o = 40 } = t, l = w(e), h = i ? l.slice(0, i) : l, a = i ? l.slice(i) : [], d = new Set(h.map((f) => f.id));
80
- let c = e.filter((f) => !f.hidden && d.has(f.id)).map((f) => ({
81
- action: f,
79
+ const { actions: e, availableWidth: n, maxInlineActions: i, collapseLabels: s = !0, resolveActionWidth: r, moreButtonWidthPx: o = 40 } = t, l = w(e), h = i ? l.slice(0, i) : l, a = i ? l.slice(i) : [], f = new Set(h.map((d) => d.id));
80
+ let c = e.filter((d) => !d.hidden && f.has(d.id)).map((d) => ({
81
+ action: d,
82
82
  showLabel: !0,
83
- width: A(f, !0, r)
83
+ width: A(d, !0, r)
84
84
  }));
85
85
  s && (c = N(c, n, r));
86
86
  const { inlineActions: u, overflowActions: v } = O({
@@ -96,14 +96,14 @@ function B(t) {
96
96
  resolveActionWidth: r
97
97
  });
98
98
  }
99
- function X(t) {
99
+ function L(t) {
100
100
  const { actions: e, availableWidth: n, maxVisibleBulkActions: i = 3, resolveActionWidth: s, moreButtonWidthPx: r = 40 } = t, o = w(e);
101
101
  if (o.length === 0) return {
102
102
  inlineActions: [],
103
103
  overflowActions: [],
104
104
  showMoreMenu: !1
105
105
  };
106
- const l = o.slice(0, i), h = o.slice(i), { inlineActions: a, overflowActions: d } = O({
106
+ const l = o.slice(0, i), h = o.slice(i), { inlineActions: a, overflowActions: f } = O({
107
107
  planned: l.map((c) => ({
108
108
  action: c,
109
109
  showLabel: !0,
@@ -116,15 +116,15 @@ function X(t) {
116
116
  });
117
117
  return {
118
118
  inlineActions: a,
119
- overflowActions: d,
120
- showMoreMenu: d.length >= 1
119
+ overflowActions: f,
120
+ showMoreMenu: f.length >= 1
121
121
  };
122
122
  }
123
123
  export {
124
124
  y as ACTION_GAP_PX,
125
125
  C as MORE_BUTTON_PX,
126
126
  T as estimateToolbarActionWidth,
127
- X as planBulkToolbarActions,
127
+ L as planBulkToolbarActions,
128
128
  B as planToolbarActions,
129
129
  A as resolveToolbarActionWidth
130
130
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.43.1",
6
+ "version": "3.43.2",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",