@ac-design/design-system 2.3.0 → 2.4.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/lib/compat.css +211 -6
- package/dist/lib/components/AcAppSwitcher.vue.d.ts +1 -1
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +23 -23
- package/dist/lib/components/AcAreaChart.vue.d.ts +1 -1
- package/dist/lib/components/AcBarChart.vue.d.ts +1 -1
- package/dist/lib/components/AcButton.vue.d.ts +7 -1
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +90 -69
- package/dist/lib/components/AcCellValue.vue.d.ts +3 -3
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +20 -20
- package/dist/lib/components/AcCheckBox.vue.d.ts +4 -1
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +50 -50
- package/dist/lib/components/AcCircularProgress.vue.d.ts +1 -1
- package/dist/lib/components/AcCodeEditor.vue.d.ts +12 -0
- package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +240 -207
- package/dist/lib/components/AcColorInput.vue.d.ts +3 -3
- package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +72 -66
- package/dist/lib/components/AcCostSummary.vue.d.ts +1 -1
- package/dist/lib/components/AcDatePicker.vue.d.ts +14 -7
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +417 -372
- package/dist/lib/components/AcDeleteModal.vue.d.ts +1 -1
- package/dist/lib/components/AcDonutChart.vue.d.ts +2 -2
- package/dist/lib/components/AcDropdown.vue.d.ts +1 -1
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +27 -30
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcGraphChart.vue.d.ts +2 -2
- package/dist/lib/components/AcInput.vue.d.ts +75 -54
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +253 -89
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +34 -54
- package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +134 -106
- package/dist/lib/components/AcLineChart.vue.d.ts +1 -1
- package/dist/lib/components/AcMapChart.vue.d.ts +2 -2
- package/dist/lib/components/AcModal.vue.d.ts +2 -2
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcNotificationMenu.vue.d.ts +1 -1
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +24 -24
- package/dist/lib/components/AcNumberInput.vue.d.ts +55 -45
- package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +159 -99
- package/dist/lib/components/AcRadioCard.vue.d.ts +2 -2
- package/dist/lib/components/AcRadioCard.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcSelect.vue.d.ts +35 -6
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +272 -176
- package/dist/lib/components/AcSidePanel.vue.d.ts +1 -1
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcSlider.vue.d.ts +2 -2
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +23 -23
- package/dist/lib/components/AcTable.vue.d.ts +37 -4
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +239 -131
- package/dist/lib/components/AcTagInput.vue.d.ts +22 -3
- package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +126 -114
- package/dist/lib/components/AcTaintInput.js +5 -0
- package/dist/lib/components/AcTaintInput.vue.d.ts +44 -0
- package/dist/lib/components/AcTaintInput.vue_vue_type_script_setup_true_lang.js +208 -0
- package/dist/lib/components/AcTextarea.vue.d.ts +38 -4
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +113 -53
- package/dist/lib/components/AcTimePicker.vue.d.ts +15 -8
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +102 -70
- package/dist/lib/components/AcTooltip.vue.d.ts +3 -3
- package/dist/lib/components/index.d.ts +1 -0
- package/dist/lib/composables/useToast.d.ts +2 -2
- package/dist/lib/index.d.ts +2 -1
- package/dist/lib/index.js +31 -30
- package/package.json +1 -1
|
@@ -1,41 +1,52 @@
|
|
|
1
|
-
import e from "./
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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
|
|
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
|
-
],
|
|
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
|
-
},
|
|
14
|
+
}, he = {
|
|
13
15
|
key: 1,
|
|
14
16
|
class: "h-11 border-b border-border pl-4 [tr:last-child_&]:border-0"
|
|
15
|
-
},
|
|
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
|
-
],
|
|
24
|
+
], ve = [
|
|
20
25
|
"aria-expanded",
|
|
21
26
|
"aria-controls",
|
|
22
27
|
"aria-label",
|
|
23
28
|
"onClick"
|
|
24
|
-
],
|
|
29
|
+
], ye = { class: "relative flex size-[18px]" }, be = [
|
|
25
30
|
"checked",
|
|
26
31
|
"disabled",
|
|
27
32
|
"aria-label",
|
|
28
33
|
"onChange"
|
|
29
|
-
],
|
|
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
|
-
},
|
|
44
|
+
}, we = ["colspan"], Te = ["id", "aria-label"], Ee = {
|
|
34
45
|
key: 0,
|
|
35
46
|
class: "px-6 py-12 text-center text-muted"
|
|
36
|
-
},
|
|
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__*/
|
|
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__*/
|
|
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(
|
|
110
|
-
let k =
|
|
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 =
|
|
113
|
-
|
|
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
|
-
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
|
158
|
+
function U(e) {
|
|
123
159
|
return typeof e == "object" && !!e && !Array.isArray(e) && "data" in e;
|
|
124
160
|
}
|
|
125
|
-
function
|
|
126
|
-
return
|
|
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
|
-
|
|
129
|
-
|
|
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
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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[
|
|
144
|
-
return typeof n == "string" || typeof n == "number" ? n : String(e[
|
|
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 (
|
|
152
|
-
|
|
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
|
-
}, [
|
|
156
|
-
|
|
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:
|
|
160
|
-
}, [...
|
|
161
|
-
|
|
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:
|
|
165
|
-
}, [
|
|
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:
|
|
168
|
-
checked:
|
|
169
|
-
indeterminate:
|
|
170
|
-
disabled:
|
|
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:
|
|
173
|
-
}, null, 40,
|
|
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)) :
|
|
178
|
-
(
|
|
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:
|
|
182
|
-
|
|
183
|
-
!
|
|
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:
|
|
190
|
-
"aria-sort":
|
|
191
|
-
onClick: (t) =>
|
|
192
|
-
}, [
|
|
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:
|
|
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"])) :
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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:
|
|
203
|
-
}, [
|
|
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:
|
|
206
|
-
}, null, 4)], 2))), 128))
|
|
207
|
-
|
|
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:
|
|
210
|
-
|
|
211
|
-
(
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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":
|
|
217
|
-
"aria-disabled":
|
|
218
|
-
onClick: (e) =>
|
|
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
|
-
|
|
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:
|
|
224
|
-
}, [
|
|
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":
|
|
229
|
-
"aria-controls":
|
|
230
|
-
"aria-label": `${
|
|
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) =>
|
|
233
|
-
}, [
|
|
234
|
-
class:
|
|
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,
|
|
237
|
-
|
|
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:
|
|
241
|
-
}, [
|
|
316
|
+
onClick: f[1] ||= w(() => {}, ["stop"])
|
|
317
|
+
}, [c("span", ye, [c("input", {
|
|
242
318
|
type: "checkbox",
|
|
243
|
-
class:
|
|
244
|
-
checked:
|
|
245
|
-
disabled: !
|
|
246
|
-
"aria-label": `Select ${Z(
|
|
247
|
-
onChange: (e) =>
|
|
248
|
-
}, null, 40,
|
|
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
|
-
})])])) :
|
|
253
|
-
(
|
|
254
|
-
key:
|
|
255
|
-
class:
|
|
256
|
-
$(
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
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
|
-
}, [
|
|
262
|
-
row:
|
|
263
|
-
value:
|
|
264
|
-
}, () => [
|
|
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:
|
|
267
|
-
cell:
|
|
268
|
-
column:
|
|
269
|
-
type:
|
|
270
|
-
title:
|
|
271
|
-
"resolve-link":
|
|
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
|
-
])) : (
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
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(
|
|
287
|
-
class:
|
|
288
|
-
}, [
|
|
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 {
|
|
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
|
|
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
|
|
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
|
+
};
|