@ac-design/design-system 2.3.0 → 2.4.0

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.
Files changed (60) hide show
  1. package/dist/lib/compat.css +211 -0
  2. package/dist/lib/components/AcAppSwitcher.vue.d.ts +1 -1
  3. package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +23 -23
  4. package/dist/lib/components/AcAreaChart.vue.d.ts +1 -1
  5. package/dist/lib/components/AcBarChart.vue.d.ts +1 -1
  6. package/dist/lib/components/AcButton.vue.d.ts +7 -1
  7. package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +90 -69
  8. package/dist/lib/components/AcCellValue.vue.d.ts +3 -3
  9. package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +20 -20
  10. package/dist/lib/components/AcCheckBox.vue.d.ts +4 -1
  11. package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +50 -50
  12. package/dist/lib/components/AcCircularProgress.vue.d.ts +1 -1
  13. package/dist/lib/components/AcCodeEditor.vue.d.ts +12 -0
  14. package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +240 -207
  15. package/dist/lib/components/AcColorInput.vue.d.ts +3 -3
  16. package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +72 -66
  17. package/dist/lib/components/AcCostSummary.vue.d.ts +1 -1
  18. package/dist/lib/components/AcDatePicker.vue.d.ts +14 -7
  19. package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +417 -372
  20. package/dist/lib/components/AcDeleteModal.vue.d.ts +1 -1
  21. package/dist/lib/components/AcDonutChart.vue.d.ts +2 -2
  22. package/dist/lib/components/AcDropdown.vue.d.ts +1 -1
  23. package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +8 -8
  24. package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +8 -8
  25. package/dist/lib/components/AcGraphChart.vue.d.ts +2 -2
  26. package/dist/lib/components/AcInput.vue.d.ts +75 -54
  27. package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +253 -89
  28. package/dist/lib/components/AcKeyValueInput.vue.d.ts +34 -54
  29. package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +134 -106
  30. package/dist/lib/components/AcLineChart.vue.d.ts +1 -1
  31. package/dist/lib/components/AcMapChart.vue.d.ts +2 -2
  32. package/dist/lib/components/AcModal.vue.d.ts +1 -1
  33. package/dist/lib/components/AcNotificationMenu.vue.d.ts +1 -1
  34. package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +24 -24
  35. package/dist/lib/components/AcNumberInput.vue.d.ts +55 -45
  36. package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +159 -99
  37. package/dist/lib/components/AcRadioCard.vue.d.ts +2 -2
  38. package/dist/lib/components/AcRadioCard.vue_vue_type_script_setup_true_lang.js +1 -1
  39. package/dist/lib/components/AcSelect.vue.d.ts +35 -6
  40. package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +272 -176
  41. package/dist/lib/components/AcSidePanel.vue.d.ts +1 -1
  42. package/dist/lib/components/AcSlider.vue.d.ts +2 -2
  43. package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +23 -23
  44. package/dist/lib/components/AcTable.vue.d.ts +37 -4
  45. package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +239 -131
  46. package/dist/lib/components/AcTagInput.vue.d.ts +22 -3
  47. package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +126 -114
  48. package/dist/lib/components/AcTaintInput.js +5 -0
  49. package/dist/lib/components/AcTaintInput.vue.d.ts +44 -0
  50. package/dist/lib/components/AcTaintInput.vue_vue_type_script_setup_true_lang.js +208 -0
  51. package/dist/lib/components/AcTextarea.vue.d.ts +38 -4
  52. package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +113 -53
  53. package/dist/lib/components/AcTimePicker.vue.d.ts +15 -8
  54. package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +102 -70
  55. package/dist/lib/components/AcTooltip.vue.d.ts +3 -3
  56. package/dist/lib/components/index.d.ts +1 -0
  57. package/dist/lib/composables/useToast.d.ts +2 -2
  58. package/dist/lib/index.d.ts +2 -1
  59. package/dist/lib/index.js +31 -30
  60. package/package.json +1 -1
@@ -1,41 +1,52 @@
1
- import e from "./AcCellValue.js";
2
- import { Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, mergeModels as u, normalizeClass as d, normalizeStyle as f, openBlock as p, renderList as m, renderSlot as h, resolveDynamicComponent as g, toDisplayString as _, unref as v, useId as ee, useModel as y, withModifiers as b } from "vue";
3
- import { Check as x, ChevronDown as te, ChevronRight as ne, ChevronUp as re, Minus as S } from "@lucide/vue";
1
+ import e from "./AcTooltip.js";
2
+ import t from "./AcCellValue.js";
3
+ import n from "./AcPagination.js";
4
+ import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, getCurrentInstance as f, mergeModels as p, mergeProps as ee, normalizeClass as m, normalizeStyle as h, openBlock as g, renderList as _, renderSlot as v, resolveDynamicComponent as y, toDisplayString as b, unref as x, useId as te, useModel as S, useSlots as ne, watch as re, withCtx as C, withModifiers as w } from "vue";
5
+ import { Check as T, ChevronDown as ie, ChevronRight as ae, ChevronUp as oe, Minus as se } from "@lucide/vue";
4
6
  //#region src/lib/components/AcTable.vue?vue&type=script&setup=true&lang.ts
5
- var C = { class: "ac-scrollbar" }, w = { class: "w-full border-separate border-spacing-0 text-base" }, T = { class: "relative flex size-[18px]" }, E = [
7
+ var ce = { class: "ac-scrollbar" }, le = { class: "w-full border-separate border-spacing-0 text-base" }, ue = { class: "relative flex size-[18px]" }, de = [
6
8
  "checked",
7
9
  "indeterminate",
8
10
  "disabled"
9
- ], ie = ["aria-sort", "onClick"], ae = { class: "inline-flex items-center gap-2" }, oe = {
11
+ ], fe = ["aria-sort", "onClick"], pe = { class: "inline-flex items-center gap-2" }, me = {
10
12
  key: 0,
11
13
  class: "h-11 border-b border-border pl-4 [tr:last-child_&]:border-0"
12
- }, se = {
14
+ }, he = {
13
15
  key: 1,
14
16
  class: "h-11 border-b border-border pl-4 [tr:last-child_&]:border-0"
15
- }, ce = [
17
+ }, ge = {
18
+ key: 2,
19
+ class: "h-11 border-b border-border [tr:last-child_&]:border-0"
20
+ }, _e = [
16
21
  "aria-current",
17
22
  "aria-disabled",
18
23
  "onClick"
19
- ], le = [
24
+ ], ve = [
20
25
  "aria-expanded",
21
26
  "aria-controls",
22
27
  "aria-label",
23
28
  "onClick"
24
- ], ue = { class: "relative flex size-[18px]" }, de = [
29
+ ], ye = { class: "relative flex size-[18px]" }, be = [
25
30
  "checked",
26
31
  "disabled",
27
32
  "aria-label",
28
33
  "onChange"
29
- ], fe = {
34
+ ], xe = {
35
+ key: 2,
36
+ class: "flex min-w-0 items-center"
37
+ }, Se = {
38
+ key: 1,
39
+ class: "block truncate"
40
+ }, Ce = {
30
41
  key: 0,
31
42
  class: "group",
32
43
  "data-testid": "ac-table-detail"
33
- }, pe = ["colspan"], me = ["id", "aria-label"], he = {
44
+ }, we = ["colspan"], Te = ["id", "aria-label"], Ee = {
34
45
  key: 0,
35
46
  class: "px-6 py-12 text-center text-muted"
36
- }, D = "border-border", O = "peer size-[18px] cursor-pointer appearance-none rounded-4 border border-muted/70 bg-background align-middle transition-colors duration-150 hover:border-primary/60 checked:border-primary checked:bg-primary indeterminate:border-primary indeterminate:bg-primary focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50", k = /*@__PURE__*/ l({
47
+ }, E = "border-border", D = "peer size-[18px] cursor-pointer appearance-none rounded-4 border border-muted/70 bg-background align-middle transition-colors duration-150 hover:border-primary/60 checked:border-primary checked:bg-primary indeterminate:border-primary indeterminate:bg-primary focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50", O = /*@__PURE__*/ d({
37
48
  __name: "AcTable",
38
- props: /*@__PURE__*/ u({
49
+ props: /*@__PURE__*/ p({
39
50
  columns: {},
40
51
  rows: {},
41
52
  rowKey: { default: "id" },
@@ -92,183 +103,249 @@ var C = { class: "ac-scrollbar" }, w = { class: "w-full border-separate border-s
92
103
  resolveLink: {
93
104
  type: Function,
94
105
  default: void 0
95
- }
106
+ },
107
+ search: { default: void 0 },
108
+ pageSize: { default: void 0 },
109
+ relaxed: {
110
+ type: Boolean,
111
+ default: !1
112
+ },
113
+ truncate: { default: void 0 },
114
+ placeholder: { default: "" },
115
+ placeholderFor: { default: "empty" }
96
116
  }, {
97
117
  selected: { default: () => [] },
98
118
  selectedModifiers: {},
99
119
  expanded: { default: () => [] },
100
120
  expandedModifiers: {},
121
+ page: { default: 1 },
122
+ pageModifiers: {},
101
123
  sortBy: { default: null },
102
124
  sortByModifiers: {}
103
125
  }),
104
- emits: /*@__PURE__*/ u(["row-click", "sort"], [
126
+ emits: /*@__PURE__*/ p(["row-click", "sort"], [
105
127
  "update:selected",
106
128
  "update:expanded",
129
+ "update:page",
107
130
  "update:sortBy"
108
131
  ]),
109
- setup(l, { emit: u }) {
110
- let k = l, A = y(l, "selected"), j = y(l, "expanded"), M = u, N = ee(), P = y(l, "sortBy"), F = n(() => P.value?.key ?? ""), I = n(() => P.value?.mode ?? "asc"), L = (e) => {
132
+ setup(d, { emit: p }) {
133
+ let O = d, k = S(d, "selected"), A = S(d, "expanded"), j = S(d, "page"), M = p, N = ne(), P = f()?.appContext.components.RouterLink, De = te(), F = S(d, "sortBy"), I = i(() => F.value?.key ?? ""), L = i(() => F.value?.mode ?? "asc"), Oe = (e) => {
111
134
  if (!e.sortable) return;
112
- let t = F.value === e.key && I.value === "asc" ? "desc" : "asc";
113
- P.value = {
135
+ let t = I.value === e.key && L.value === "asc" ? "desc" : "asc";
136
+ F.value = {
114
137
  key: e.key,
115
138
  mode: t
116
139
  }, M("sort", e.key, t);
117
- }, ge = n(() => {
118
- if (!F.value || k.manualSort) return k.rows;
119
- let e = F.value, t = I.value === "asc" ? 1 : -1;
120
- return [...k.rows].sort((n, r) => String(z(n[e]) ?? "").localeCompare(String(z(r[e]) ?? ""), void 0, { numeric: !0 }) * t);
140
+ }, R = i(() => {
141
+ let e = O.search ?? [];
142
+ return e.length ? O.rows.filter((t) => e.every((e) => {
143
+ let n = W(t[e.key]);
144
+ return n != null && String(n).toLowerCase().includes(e.searchText.toLowerCase());
145
+ })) : O.rows;
146
+ }), z = i(() => {
147
+ if (!I.value || O.manualSort) return R.value;
148
+ let e = I.value, t = L.value === "asc" ? 1 : -1, n = O.columns.find((t) => t.key === e)?.sortType;
149
+ return n ? [...R.value].sort((r, i) => {
150
+ let a = W(r[e]), o = W(i[e]);
151
+ return a == null ? 1 : o == null ? -1 : Ae(a, o, n) * t;
152
+ }) : [...R.value].sort((n, r) => String(W(n[e]) ?? "").localeCompare(String(W(r[e]) ?? ""), void 0, { numeric: !0 }) * t);
153
+ }), B = i(() => O.pageSize ? Math.max(1, Math.ceil(z.value.length / O.pageSize)) : 1), V = i(() => Math.min(Math.max(1, j.value), B.value)), H = i(() => {
154
+ if (!O.pageSize) return z.value;
155
+ let e = (V.value - 1) * O.pageSize;
156
+ return z.value.slice(e, e + O.pageSize);
121
157
  });
122
- function R(e) {
158
+ function U(e) {
123
159
  return typeof e == "object" && !!e && !Array.isArray(e) && "data" in e;
124
160
  }
125
- function z(e) {
126
- return R(e) ? e.sort ?? e.data : e;
161
+ function W(e) {
162
+ return U(e) ? e.sort ?? e.data : e;
163
+ }
164
+ function ke(e) {
165
+ return O.placeholderFor === "falsy" ? !e : e === null || e === "";
127
166
  }
128
- let B = (e) => !!k.rowDisabled?.(e), V = (e) => !B(e) && (!k.rowSelectable || k.rowSelectable(e)), H = n(() => k.rows.filter(V).map((e) => e[k.rowKey])), U = n(() => new Set(A.value)), W = n(() => H.value.length > 0 && H.value.every((e) => U.value.has(e))), G = n(() => !W.value && H.value.some((e) => U.value.has(e)));
129
- function _e() {
130
- let e = new Set(H.value);
131
- A.value = W.value ? A.value.filter((t) => !e.has(t)) : [...A.value, ...H.value.filter((e) => !U.value.has(e))];
167
+ function Ae(e, t, n) {
168
+ return n === "number" ? Number(e) - Number(t) : n === "date" ? new Date(String(e)).getTime() - new Date(String(t)).getTime() : String(e).toLowerCase().localeCompare(String(t).toLowerCase());
132
169
  }
133
- function ve(e) {
134
- let t = e[k.rowKey];
135
- A.value = U.value.has(t) ? A.value.filter((e) => e !== t) : [...A.value, t];
170
+ let G = (e) => !!O.rowDisabled?.(e), je = (e) => !G(e) && (!O.rowSelectable || O.rowSelectable(e)), K = i(() => H.value.filter(je).map((e) => e[O.rowKey])), q = i(() => new Set(k.value)), J = i(() => K.value.length > 0 && K.value.every((e) => q.value.has(e))), Me = i(() => !J.value && K.value.some((e) => q.value.has(e)));
171
+ function Ne() {
172
+ let e = new Set(K.value);
173
+ k.value = J.value ? k.value.filter((t) => !e.has(t)) : [...k.value, ...K.value.filter((e) => !q.value.has(e))];
136
174
  }
137
- let K = n(() => new Set(j.value)), q = (e) => k.expandable && K.value.has(e[k.rowKey]), J = (e) => !k.canExpand || k.canExpand(e), Y = (e) => `${N}-detail-${String(e[k.rowKey])}`, ye = n(() => k.columns.length + +!!k.selectable + +!!k.expandable);
138
- function X(e) {
139
- let t = e[k.rowKey];
140
- j.value = K.value.has(t) ? j.value.filter((e) => e !== t) : [...j.value, t];
175
+ function Pe(e) {
176
+ let t = e[O.rowKey];
177
+ k.value = q.value.has(t) ? k.value.filter((e) => e !== t) : [...k.value, t];
178
+ }
179
+ let Fe = i(() => new Set(A.value)), Y = (e) => O.expandable && Fe.value.has(e[O.rowKey]), Ie = (e) => !O.canExpand || O.canExpand(e), Le = (e) => `${De}-detail-${String(e[O.rowKey])}`, X = i(() => !!N.actions), Re = i(() => O.columns.length + +!!O.selectable + +!!O.expandable + +!!X.value);
180
+ function ze(e) {
181
+ let t = e[O.rowKey];
182
+ A.value = Fe.value.has(t) ? A.value.filter((e) => e !== t) : [...A.value, t];
141
183
  }
142
184
  function Z(e) {
143
- let t = e[k.columns[0]?.key ?? ""], n = R(t) ? t.data : t;
144
- return typeof n == "string" || typeof n == "number" ? n : String(e[k.rowKey]);
185
+ let t = e[O.columns[0]?.key ?? ""], n = U(t) ? t.data : t;
186
+ return typeof n == "string" || typeof n == "number" ? n : String(e[O.rowKey]);
187
+ }
188
+ let Be = i(() => O.expandable ? "py-3 [tbody_&]:h-[51px]" : "py-3"), Ve = (e) => e.wrap ?? O.relaxed ? "whitespace-normal" : "whitespace-nowrap";
189
+ function He(e) {
190
+ return !!(e.link || O.truncate || O.placeholder || N[`before-${e.key}`]);
191
+ }
192
+ function Ue(e) {
193
+ let t = String(e ?? "");
194
+ return O.truncate && t.length > O.truncate ? `${t.slice(0, O.truncate)}...` : t;
195
+ }
196
+ function We(e, t) {
197
+ let n = e[t.link] || t.linkFallback;
198
+ return typeof n != "string" || !n ? {
199
+ is: "span",
200
+ attrs: {}
201
+ } : P && !/^https?:/.test(n) ? {
202
+ is: P,
203
+ attrs: { to: n }
204
+ } : {
205
+ is: "a",
206
+ attrs: { href: n }
207
+ };
145
208
  }
146
- let Q = (e) => ({
209
+ let Ge = i(() => ["overflow-hidden bg-surface", !O.flat && "rounded-10 border border-border"]), Q = (e) => ({
147
210
  left: "text-left",
148
211
  center: "text-center",
149
212
  right: "text-right"
150
213
  })[e.align ?? "left"], $ = (e) => e.compact ? "px-2" : "px-6";
151
- return (n, u) => (p(), a("div", {
152
- class: d(["w-full overflow-hidden bg-surface", !l.flat && "rounded-10 border border-border"]),
214
+ return re(() => `${JSON.stringify(O.search?.map((e) => [e.key, e.searchText]) ?? [])}|${I.value}|${L.value}`, () => {
215
+ O.pageSize && (j.value = 1);
216
+ }), (i, f) => (g(), s("div", {
217
+ class: m(["w-full", !d.pageSize && Ge.value]),
153
218
  "data-ac-ds": "",
154
219
  "data-testid": "ac-table"
155
- }, [o("div", C, [o("table", w, [o("thead", null, [o("tr", null, [
156
- l.expandable ? (p(), a("th", {
220
+ }, [c("div", { class: m(!!d.pageSize && Ge.value) }, [c("div", ce, [c("table", le, [c("thead", null, [c("tr", null, [
221
+ d.expandable ? (g(), s("th", {
157
222
  key: 0,
158
223
  scope: "col",
159
- class: d(["h-11 w-10 border-b bg-surface-sunken/50 pr-0 pl-4", [D, !l.flat && "first:rounded-tl-10"]])
160
- }, [...u[2] ||= [o("span", { class: "sr-only" }, "Expand", -1)]], 2)) : i("", !0),
161
- l.selectable ? (p(), a("th", {
224
+ class: m(["h-11 w-10 border-b bg-surface-sunken/50 pr-0 pl-4", [E, !d.flat && "first:rounded-tl-10"]])
225
+ }, [...f[4] ||= [c("span", { class: "sr-only" }, "Expand", -1)]], 2)) : o("", !0),
226
+ d.selectable ? (g(), s("th", {
162
227
  key: 1,
163
228
  scope: "col",
164
- class: d(["h-11 w-10 border-b bg-surface-sunken/50 pr-1 pl-4", [D, !l.flat && "first:rounded-tl-10"]])
165
- }, [o("span", T, [o("input", {
229
+ class: m(["h-11 w-10 border-b bg-surface-sunken/50 pr-1 pl-4", [E, !d.flat && "first:rounded-tl-10"]])
230
+ }, [c("span", ue, [c("input", {
166
231
  type: "checkbox",
167
- class: d(O),
168
- checked: W.value,
169
- indeterminate: G.value,
170
- disabled: l.loading || !H.value.length,
232
+ class: m(D),
233
+ checked: J.value,
234
+ indeterminate: Me.value,
235
+ disabled: d.loading || !K.value.length,
171
236
  "aria-label": "Select all rows",
172
- onChange: _e
173
- }, null, 40, E), (p(), r(g(G.value ? v(S) : v(x)), {
237
+ onChange: Ne
238
+ }, null, 40, de), (g(), a(y(Me.value ? x(se) : x(T)), {
174
239
  class: "pointer-events-none absolute inset-0 m-auto size-3.5 text-white opacity-0 peer-checked:opacity-100 peer-indeterminate:opacity-100",
175
240
  "stroke-width": 3,
176
241
  "aria-hidden": "true"
177
- }))])], 2)) : i("", !0),
178
- (p(!0), a(t, null, m(l.columns, (e) => (p(), a("th", {
242
+ }))])], 2)) : o("", !0),
243
+ (g(!0), s(r, null, _(d.columns, (e) => (g(), s("th", {
179
244
  key: e.key,
180
245
  scope: "col",
181
- class: d(["h-11 border-b bg-surface-sunken/50 text-base font-semibold whitespace-nowrap text-muted", [
182
- D,
183
- !l.flat && "first:rounded-tl-10 last:rounded-tr-10",
246
+ class: m(["h-11 border-b bg-surface-sunken/50 text-base font-semibold whitespace-nowrap text-muted", [
247
+ E,
248
+ !d.flat && "first:rounded-tl-10 last:rounded-tr-10",
184
249
  $(e),
185
250
  Q(e),
251
+ d.relaxed && "py-3",
186
252
  e.class,
187
253
  e.sortable && "cursor-pointer select-none transition-colors hover:text-heading"
188
254
  ]]),
189
- style: f(e.width ? { width: e.width } : void 0),
190
- "aria-sort": F.value === e.key ? I.value === "asc" ? "ascending" : "descending" : void 0,
191
- onClick: (t) => L(e)
192
- }, [o("span", ae, [h(n.$slots, `header-${e.key}`, { column: e }, () => [s(_(e.label), 1)]), e.sortable ? (p(), r(g(F.value === e.key && I.value === "asc" ? v(re) : v(te)), {
255
+ style: h(e.width ? { width: e.width } : void 0),
256
+ "aria-sort": I.value === e.key ? L.value === "asc" ? "ascending" : "descending" : void 0,
257
+ onClick: (t) => Oe(e)
258
+ }, [c("span", pe, [v(i.$slots, `header-${e.key}`, { column: e }, () => [l(b(e.label), 1)]), e.sortable ? (g(), a(y(I.value === e.key && L.value === "asc" ? x(oe) : x(ie)), {
193
259
  key: 0,
194
- class: d(["size-4 shrink-0", F.value === e.key ? "text-primary-strong" : "text-muted"]),
260
+ class: m(["size-4 shrink-0", I.value === e.key ? "text-primary-strong" : "text-muted"]),
195
261
  "aria-hidden": "true"
196
- }, null, 8, ["class"])) : i("", !0)])], 14, ie))), 128))
197
- ])]), o("tbody", null, [l.loading ? (p(!0), a(t, { key: 0 }, m(l.loaderRows, (e) => (p(), a("tr", { key: `loader-${e}` }, [
198
- l.expandable ? (p(), a("td", oe)) : i("", !0),
199
- l.selectable ? (p(), a("td", se)) : i("", !0),
200
- (p(!0), a(t, null, m(l.columns, (t, n) => (p(), a("td", {
262
+ }, null, 8, ["class"])) : o("", !0)])], 14, fe))), 128)),
263
+ X.value ? (g(), s("th", {
264
+ key: 2,
265
+ scope: "col",
266
+ class: m(["h-11 w-20 border-b bg-surface-sunken/50 px-2 lg:w-[120px]", [
267
+ E,
268
+ !d.flat && "last:rounded-tr-10",
269
+ d.relaxed && "py-3"
270
+ ]])
271
+ }, [...f[5] ||= [c("span", { class: "sr-only" }, "Actions", -1)]], 2)) : o("", !0)
272
+ ])]), c("tbody", null, [d.loading ? (g(!0), s(r, { key: 0 }, _(d.loaderRows, (e) => (g(), s("tr", { key: `loader-${e}` }, [
273
+ d.expandable ? (g(), s("td", me)) : o("", !0),
274
+ d.selectable ? (g(), s("td", he)) : o("", !0),
275
+ (g(!0), s(r, null, _(d.columns, (t, n) => (g(), s("td", {
201
276
  key: t.key,
202
- class: d(["h-11 border-b border-border [tr:last-child_&]:border-0", [$(t), t.class]])
203
- }, [o("span", {
277
+ class: m(["h-11 border-b border-border [tr:last-child_&]:border-0", [$(t), t.class]])
278
+ }, [c("span", {
204
279
  class: "block h-2.5 animate-pulse rounded-full bg-surface-sunken",
205
- style: f({ width: `${50 + (e * 17 + n * 23) % 40}%` })
206
- }, null, 4)], 2))), 128))
207
- ]))), 128)) : (p(!0), a(t, { key: 1 }, m(ge.value, (f, g) => (p(), a(t, { key: String(f[l.rowKey] ?? g) }, [o("tr", {
280
+ style: h({ width: `${50 + (e * 17 + n * 23) % 40}%` })
281
+ }, null, 4)], 2))), 128)),
282
+ X.value ? (g(), s("td", ge)) : o("", !0)
283
+ ]))), 128)) : (g(!0), s(r, { key: 1 }, _(H.value, (n, p) => (g(), s(r, { key: String(n[d.rowKey] ?? p) }, [c("tr", {
208
284
  "data-testid": "ac-table-row",
209
- class: d(["group transition-colors duration-150", [
210
- l.clickable && "cursor-pointer hover:bg-surface-sunken/40",
211
- (l.rowActive?.(f) || l.selectable && U.value.has(f[l.rowKey])) && "bg-primary/5",
212
- l.rowActive?.(f) && "shadow-[inset_0_0_0_1px_var(--color-primary)]",
213
- B(f) && "pointer-events-none cursor-not-allowed opacity-50",
214
- l.rowClass?.(f)
285
+ class: m(["group transition-colors duration-150", [
286
+ d.clickable && "cursor-pointer hover:bg-surface-sunken/40",
287
+ (d.rowActive?.(n) || d.selectable && q.value.has(n[d.rowKey])) && "bg-primary/5",
288
+ d.rowActive?.(n) && "shadow-[inset_0_0_0_1px_var(--color-primary)]",
289
+ G(n) && "pointer-events-none cursor-not-allowed opacity-50",
290
+ d.rowClass?.(n)
215
291
  ]]),
216
- "aria-current": l.rowActive?.(f) ? "true" : void 0,
217
- "aria-disabled": B(f) || void 0,
218
- onClick: (e) => l.clickable && !B(f) && M("row-click", f)
292
+ "aria-current": d.rowActive?.(n) ? "true" : void 0,
293
+ "aria-disabled": G(n) || void 0,
294
+ onClick: (e) => d.clickable && !G(n) && M("row-click", n)
219
295
  }, [
220
- l.expandable ? (p(), a("td", {
296
+ d.expandable ? (g(), s("td", {
221
297
  key: 0,
222
298
  class: "h-11 w-10 border-b border-border pr-0 pl-4 group-last:border-0",
223
- onClick: u[0] ||= b(() => {}, ["stop"])
224
- }, [J(f) ? (p(), a("button", {
299
+ onClick: f[0] ||= w(() => {}, ["stop"])
300
+ }, [Ie(n) ? (g(), s("button", {
225
301
  key: 0,
226
302
  type: "button",
227
303
  class: "inline-flex size-7 cursor-pointer items-center justify-center rounded-8 text-muted transition-colors hover:bg-surface-sunken hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
228
- "aria-expanded": q(f),
229
- "aria-controls": Y(f),
230
- "aria-label": `${q(f) ? "Collapse" : "Expand"} ${Z(f)}`,
304
+ "aria-expanded": Y(n),
305
+ "aria-controls": Le(n),
306
+ "aria-label": `${Y(n) ? "Collapse" : "Expand"} ${Z(n)}`,
231
307
  "data-testid": "ac-table-expand",
232
- onClick: (e) => X(f)
233
- }, [c(v(ne), {
234
- class: d(["size-4 transition-transform duration-150 motion-reduce:transition-none", q(f) && "rotate-90"]),
308
+ onClick: (e) => ze(n)
309
+ }, [u(x(ae), {
310
+ class: m(["size-4 transition-transform duration-150 motion-reduce:transition-none", Y(n) && "rotate-90"]),
235
311
  "aria-hidden": "true"
236
- }, null, 8, ["class"])], 8, le)) : i("", !0)])) : i("", !0),
237
- l.selectable ? (p(), a("td", {
312
+ }, null, 8, ["class"])], 8, ve)) : o("", !0)])) : o("", !0),
313
+ d.selectable ? (g(), s("td", {
238
314
  key: 1,
239
315
  class: "h-11 w-10 border-b border-border pr-1 pl-4 group-last:border-0",
240
- onClick: u[1] ||= b(() => {}, ["stop"])
241
- }, [o("span", ue, [o("input", {
316
+ onClick: f[1] ||= w(() => {}, ["stop"])
317
+ }, [c("span", ye, [c("input", {
242
318
  type: "checkbox",
243
- class: d(O),
244
- checked: U.value.has(f[l.rowKey]),
245
- disabled: !V(f),
246
- "aria-label": `Select ${Z(f)}`,
247
- onChange: (e) => ve(f)
248
- }, null, 40, de), c(v(x), {
319
+ class: m(D),
320
+ checked: q.value.has(n[d.rowKey]),
321
+ disabled: !je(n),
322
+ "aria-label": `Select ${Z(n)}`,
323
+ onChange: (e) => Pe(n)
324
+ }, null, 40, be), u(x(T), {
249
325
  class: "pointer-events-none absolute inset-0 m-auto size-3.5 text-white opacity-0 peer-checked:opacity-100",
250
326
  "stroke-width": 3,
251
327
  "aria-hidden": "true"
252
- })])])) : i("", !0),
253
- (p(!0), a(t, null, m(l.columns, (i) => (p(), a("td", {
254
- key: i.key,
255
- class: d(["h-11 border-b border-border text-body tabular-nums group-last:border-0", [
256
- $(i),
257
- i.wrap ? "whitespace-normal" : "whitespace-nowrap",
258
- Q(i),
259
- i.class
328
+ })])])) : o("", !0),
329
+ (g(!0), s(r, null, _(d.columns, (o) => (g(), s("td", {
330
+ key: o.key,
331
+ class: m(["h-11 border-b border-border text-body tabular-nums group-last:border-0", [
332
+ $(o),
333
+ Ve(o),
334
+ d.relaxed && Be.value,
335
+ Q(o),
336
+ o.class
260
337
  ]])
261
- }, [h(n.$slots, `cell-${i.key}`, {
262
- row: f,
263
- value: f[i.key]
264
- }, () => [i.type || i.descriptor ? (p(), r(e, {
338
+ }, [v(i.$slots, `cell-${o.key}`, {
339
+ row: n,
340
+ value: n[o.key]
341
+ }, () => [o.type || o.descriptor ? (g(), a(t, {
265
342
  key: 0,
266
- value: R(f[i.key]) ? void 0 : f[i.key],
267
- cell: R(f[i.key]) ? f[i.key] : void 0,
268
- column: i.descriptor,
269
- type: i.type,
270
- title: i.label,
271
- "resolve-link": l.resolveLink
343
+ value: U(n[o.key]) ? void 0 : n[o.key],
344
+ cell: U(n[o.key]) ? n[o.key] : void 0,
345
+ column: o.descriptor,
346
+ type: o.type,
347
+ title: o.label,
348
+ "resolve-link": d.resolveLink
272
349
  }, null, 8, [
273
350
  "value",
274
351
  "cell",
@@ -276,17 +353,48 @@ var C = { class: "ac-scrollbar" }, w = { class: "w-full border-separate border-s
276
353
  "type",
277
354
  "title",
278
355
  "resolve-link"
279
- ])) : (p(), a(t, { key: 1 }, [s(_(f[i.key]), 1)], 64))])], 2))), 128))
280
- ], 10, ce), q(f) && J(f) ? (p(), a("tr", fe, [o("td", {
281
- colspan: ye.value,
282
- class: d(["border-b border-border p-0 group-last:border-0", !l.expandedBare && "bg-surface-muted"])
283
- }, [o("div", {
284
- id: Y(f),
356
+ ])) : He(o) && n[o.key] === void 0 ? (g(), s(r, { key: 1 }, [], 64)) : He(o) ? (g(), s("span", xe, [v(i.$slots, `before-${o.key}`, { row: n }), !o.link && ke(n[o.key]) ? (g(), s(r, { key: 0 }, [l(b(d.placeholder), 1)], 64)) : (g(), a(e, {
357
+ key: 1,
358
+ content: String(n[o.key]),
359
+ disabled: !d.truncate,
360
+ placement: "top"
361
+ }, {
362
+ default: C(() => [o.link ? (g(), a(y(We(n, o).is), ee({
363
+ key: 0,
364
+ ref_for: !0
365
+ }, We(n, o).attrs, { class: "cursor-pointer truncate font-medium text-primary-strong no-underline hover:underline" }), {
366
+ default: C(() => [l(b(Ue(n[o.key])), 1)]),
367
+ _: 2
368
+ }, 1040)) : (g(), s("span", Se, b(Ue(n[o.key])), 1))]),
369
+ _: 2
370
+ }, 1032, ["content", "disabled"]))])) : (g(), s(r, { key: 3 }, [l(b(n[o.key]), 1)], 64))])], 2))), 128)),
371
+ X.value ? (g(), s("td", {
372
+ key: 2,
373
+ class: m(["h-11 w-20 border-b border-border px-2 group-last:border-0 lg:w-[120px]", d.relaxed ? [Be.value, "whitespace-normal"] : "whitespace-nowrap"]),
374
+ onClick: f[2] ||= w(() => {}, ["stop"])
375
+ }, [v(i.$slots, "actions", { row: n })], 2)) : o("", !0)
376
+ ], 10, _e), Y(n) && Ie(n) ? (g(), s("tr", Ce, [c("td", {
377
+ colspan: Re.value,
378
+ class: m(["border-b border-border p-0 group-last:border-0", !d.expandedBare && "bg-surface-muted"])
379
+ }, [c("div", {
380
+ id: Le(n),
285
381
  role: "region",
286
- "aria-label": `Details for ${Z(f)}`,
287
- class: d(["text-body", !l.expandedBare && "px-6 py-4"])
288
- }, [h(n.$slots, "expanded", { row: f })], 10, me)], 10, pe)])) : i("", !0)], 64))), 128))])])]), !l.loading && !l.rows.length ? (p(), a("div", he, [h(n.$slots, "empty", {}, () => [s(_(l.emptyText), 1)])])) : i("", !0)], 2));
382
+ "aria-label": `Details for ${Z(n)}`,
383
+ class: m(["text-body", !d.expandedBare && "px-6 py-4"])
384
+ }, [v(i.$slots, "expanded", { row: n })], 10, Te)], 10, we)])) : o("", !0)], 64))), 128))])])]), !d.loading && !z.value.length ? (g(), s("div", Ee, [v(i.$slots, "empty", {}, () => [l(b(d.emptyText), 1)])])) : o("", !0)], 2), d.pageSize && B.value > 1 && !d.loading ? (g(), a(n, {
385
+ key: 0,
386
+ page: V.value,
387
+ "page-size": d.pageSize,
388
+ total: z.value.length,
389
+ "hide-page-size": "",
390
+ class: "border-t border-border px-6 py-4",
391
+ "onUpdate:page": f[3] ||= (e) => j.value = e
392
+ }, null, 8, [
393
+ "page",
394
+ "page-size",
395
+ "total"
396
+ ])) : o("", !0)], 2));
289
397
  }
290
398
  });
291
399
  //#endregion
292
- export { k as default };
400
+ export { O as default };
@@ -1,6 +1,6 @@
1
1
  export interface Props {
2
- /** Label above the field. Also the accessible name of the input and of the list of values. */
3
- label: string;
2
+ /** Label above the field. Also the accessible name of the input and of the list of values. Without one, pass `aria-label`. */
3
+ label?: string;
4
4
  /** Native `name` attribute of the text input. */
5
5
  name?: string;
6
6
  /** Example value shown in the empty input, e.g. "e.g. 10.0.0.0/16". Defaults to "Add item and press Enter". */
@@ -31,14 +31,24 @@ export interface Props {
31
31
  disabled?: boolean;
32
32
  /** Shows the input on a muted fill and the chips without remove buttons. Was `is-read-only` in cloud-ui. */
33
33
  readonly?: boolean;
34
+ /** Puts new values first instead of last, as cloud-ui's list field did. */
35
+ prepend?: boolean;
36
+ /** Error shown when a `required` field is left with no values: on leaving the input, or after removing the last value. Cleared by typing or adding. E.g. "This field is required. Please input at least one". */
37
+ requiredMessage?: string;
34
38
  }
35
39
  type __VLS_Props = Props;
40
+ type __VLS_Slots = {
41
+ /** Content before the label text, such as a 14px icon. Was `icon` in cloud-ui. */
42
+ "label-icon"?: () => unknown;
43
+ /** Content after the label text, such as an info tooltip. Was `labelInfo` in cloud-ui. */
44
+ "label-extra"?: () => unknown;
45
+ };
36
46
  type __VLS_ModelProps = {
37
47
  /** The values, in the order they were added. Replaced with a new array on every change. */
38
48
  modelValue?: string[];
39
49
  };
40
50
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
41
- declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
51
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
42
52
  /** Moves focus to the text input. */
43
53
  focus: () => void | undefined;
44
54
  /** Adds the typed text now, e.g. before submitting. Returns `false` when text was rejected and is still in the input. */
@@ -55,6 +65,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
55
65
  onRemove?: ((value: string, index: number) => any) | undefined;
56
66
  }>, {
57
67
  required: boolean;
68
+ label: string;
58
69
  disabled: boolean;
59
70
  name: string;
60
71
  transform: (value: string) => string;
@@ -66,9 +77,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
66
77
  placeholder: string;
67
78
  errorMsg: string;
68
79
  mono: boolean;
80
+ requiredMessage: string;
69
81
  allowDuplicates: boolean;
70
82
  showClear: boolean;
71
83
  addOnBlur: boolean;
84
+ prepend: boolean;
72
85
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
86
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
73
87
  declare const _default: typeof __VLS_export;
74
88
  export default _default;
89
+ type __VLS_WithSlots<T, S> = T & {
90
+ new (): {
91
+ $slots: S;
92
+ };
93
+ };