@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,39 +1,39 @@
|
|
|
1
1
|
import e from "./AcButton.js";
|
|
2
2
|
import t from "./AcInput.js";
|
|
3
3
|
import n from "./AcSelect.js";
|
|
4
|
-
import { Fragment as r, TransitionGroup as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, mergeModels as f, nextTick as p, normalizeClass as m, openBlock as h, ref as g, renderList as ee, renderSlot as
|
|
5
|
-
import { Plus as
|
|
4
|
+
import { Fragment as r, TransitionGroup as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, mergeModels as f, nextTick as p, normalizeClass as m, openBlock as h, ref as g, renderList as ee, renderSlot as te, toDisplayString as _, unref as v, useId as ne, useModel as re, watch as y, withCtx as b, withKeys as x } from "vue";
|
|
5
|
+
import { Plus as ie, Trash as ae } from "@lucide/vue";
|
|
6
6
|
//#region src/lib/components/AcKeyValueInput.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var
|
|
7
|
+
var oe = [
|
|
8
8
|
"aria-labelledby",
|
|
9
9
|
"aria-label",
|
|
10
10
|
"aria-describedby"
|
|
11
|
-
],
|
|
11
|
+
], se = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "font-normal text-muted"
|
|
14
|
-
},
|
|
14
|
+
}, ce = {
|
|
15
15
|
key: 1,
|
|
16
16
|
class: "text-danger",
|
|
17
17
|
"aria-hidden": "true"
|
|
18
|
-
},
|
|
18
|
+
}, le = {
|
|
19
19
|
key: 2,
|
|
20
20
|
class: "mb-1.5 hidden grid-cols-[minmax(0,1fr)_auto] gap-x-4 sm:grid",
|
|
21
21
|
"aria-hidden": "true"
|
|
22
|
-
},
|
|
22
|
+
}, ue = { key: 0 }, de = [
|
|
23
23
|
"data-row",
|
|
24
24
|
"onFocusin",
|
|
25
25
|
"onFocusout"
|
|
26
|
-
],
|
|
26
|
+
], fe = [
|
|
27
27
|
"aria-label",
|
|
28
28
|
"title",
|
|
29
29
|
"onClick"
|
|
30
|
-
],
|
|
30
|
+
], pe = {
|
|
31
31
|
key: 4,
|
|
32
32
|
class: "text-base text-muted"
|
|
33
|
-
},
|
|
33
|
+
}, me = {
|
|
34
34
|
class: "sr-only",
|
|
35
35
|
"aria-live": "polite"
|
|
36
|
-
},
|
|
36
|
+
}, S = /*@__PURE__*/ d({
|
|
37
37
|
__name: "AcKeyValueInput",
|
|
38
38
|
props: /*@__PURE__*/ f({
|
|
39
39
|
label: { default: "" },
|
|
@@ -77,117 +77,142 @@ var T = [
|
|
|
77
77
|
readonly: {
|
|
78
78
|
type: Boolean,
|
|
79
79
|
default: !1
|
|
80
|
+
},
|
|
81
|
+
plain: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: !1
|
|
80
84
|
}
|
|
81
85
|
}, {
|
|
82
86
|
modelValue: { default: () => [] },
|
|
83
87
|
modelModifiers: {}
|
|
84
88
|
}),
|
|
85
89
|
emits: /*@__PURE__*/ f(["add", "remove"], ["update:modelValue"]),
|
|
86
|
-
setup(d, { expose: f, emit:
|
|
87
|
-
let
|
|
90
|
+
setup(d, { expose: f, emit: S }) {
|
|
91
|
+
let C = d, w = re(d, "modelValue"), T = S, E = ne(), D = `${E}-label`, O = `${E}-hint`, k = `${E}-msg`, A = g(null), j = 0, M = g([]), N = g(null), P = g(""), F = g([]), I = {}, L = a(() => !!w.value && !Array.isArray(w.value)), R = a(() => L.value ? F.value : w.value ?? []), z = a(() => !!C.options?.length), B = a(() => !C.disabled && !C.readonly), V = a(() => C.max !== void 0 && R.value.length >= C.max), he = a(() => C.addLabel || "Add new"), ge = a(() => [C.hint && O, C.errorMsg && k].filter(Boolean).join(" ") || void 0), H = a(() => C.plain ? z.value ? "grid-cols-[minmax(0,1fr)_minmax(0,1fr)_256px]" : "grid-cols-2" : z.value ? "sm:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_256px]" : "sm:grid-cols-2"), U = a(() => C.plain ? "[&>label:first-child]:sr-only" : "sm:[&>label:first-child]:sr-only"), _e = a(() => C.size === "small" ? "size-[34px]" : "size-[38px]"), W = a(() => {
|
|
88
92
|
let e = /* @__PURE__ */ new Set();
|
|
89
|
-
return
|
|
93
|
+
return R.value.map((t, n) => {
|
|
90
94
|
let r = {}, i = t.key.trim();
|
|
91
95
|
if (i) {
|
|
92
|
-
let a =
|
|
93
|
-
!
|
|
94
|
-
} else t.value &&
|
|
95
|
-
return (i || t.value) && (r.value =
|
|
96
|
+
let a = z.value ? `${i}\u0000${t.option ?? ""}` : i;
|
|
97
|
+
!C.allowDuplicateKeys && e.has(a) && (r.key = z.value && t.option ? `“${i}” with ${G(t.option)} is already used.` : `“${i}” is already used. Keys must be unique.`), e.add(a), r.key ||= C.validateKey?.(t.key, n, R.value) || void 0;
|
|
98
|
+
} else t.value && N.value !== M.value[n] && (r.key = `Enter a key, or remove this ${C.itemName}.`);
|
|
99
|
+
return (i || t.value) && (r.value = C.validateValue?.(t.value, t.key, n, R.value) || void 0), r;
|
|
96
100
|
});
|
|
97
|
-
}),
|
|
98
|
-
function
|
|
99
|
-
return
|
|
101
|
+
}), ve = a(() => W.value.some((e) => e.key || e.value));
|
|
102
|
+
function G(e) {
|
|
103
|
+
return C.options?.find((t) => t.value === e)?.label ?? e;
|
|
100
104
|
}
|
|
101
|
-
function
|
|
102
|
-
let t =
|
|
103
|
-
return t ? `${
|
|
105
|
+
function K(e) {
|
|
106
|
+
let t = R.value[e]?.key.trim();
|
|
107
|
+
return t ? `${C.itemName} ${t}` : `${C.itemName} ${e + 1}`;
|
|
104
108
|
}
|
|
105
|
-
function
|
|
109
|
+
function q(e) {
|
|
106
110
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
107
111
|
}
|
|
108
|
-
function
|
|
109
|
-
|
|
112
|
+
function J(e) {
|
|
113
|
+
P.value = "", p(() => P.value = e);
|
|
110
114
|
}
|
|
111
|
-
function
|
|
115
|
+
function Y(e, t) {
|
|
112
116
|
p(() => {
|
|
113
|
-
([...
|
|
117
|
+
([...A.value?.querySelectorAll(`[data-row="${e}"]`) ?? []].at(-1)?.querySelector(t === "remove" ? "[data-action='remove']" : `[data-cell="${t}"]`) ?? A.value?.querySelector("[data-action='add']"))?.focus();
|
|
114
118
|
});
|
|
115
119
|
}
|
|
120
|
+
function X(e) {
|
|
121
|
+
let t = {};
|
|
122
|
+
for (let n of e) n.key && (t[n.key] = n.value);
|
|
123
|
+
return t;
|
|
124
|
+
}
|
|
125
|
+
function ye(e, t) {
|
|
126
|
+
let n = Object.keys(e);
|
|
127
|
+
return n.length === Object.keys(t).length && n.every((n) => n in t && e[n] === t[n]);
|
|
128
|
+
}
|
|
129
|
+
function Z(e) {
|
|
130
|
+
if (!L.value) {
|
|
131
|
+
w.value = e;
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
F.value = e, I = X(e), w.value = I;
|
|
135
|
+
}
|
|
116
136
|
function Q(e, t) {
|
|
117
|
-
|
|
137
|
+
Z(R.value.map((n, r) => r === e ? {
|
|
118
138
|
...n,
|
|
119
139
|
...t
|
|
120
|
-
} : n);
|
|
140
|
+
} : n));
|
|
121
141
|
}
|
|
122
142
|
function $() {
|
|
123
|
-
if (!
|
|
143
|
+
if (!B.value || V.value) return;
|
|
124
144
|
let e = {
|
|
125
145
|
key: "",
|
|
126
146
|
value: ""
|
|
127
147
|
};
|
|
128
|
-
|
|
129
|
-
let t =
|
|
130
|
-
|
|
148
|
+
z.value && (e.option = C.defaultOption ?? C.options[0].value), M.value = [...M.value, j++], Z([...R.value, e]);
|
|
149
|
+
let t = R.value.length;
|
|
150
|
+
T("add", t), J(`${q(C.itemName)} ${t + 1} added.`), Y(t, "key");
|
|
131
151
|
}
|
|
132
|
-
function
|
|
133
|
-
if (!
|
|
134
|
-
let t =
|
|
152
|
+
function be(e) {
|
|
153
|
+
if (!B.value) return;
|
|
154
|
+
let t = R.value[e];
|
|
135
155
|
if (!t) return;
|
|
136
|
-
let n =
|
|
137
|
-
|
|
138
|
-
let r =
|
|
139
|
-
r ?
|
|
156
|
+
let n = K(e);
|
|
157
|
+
M.value = M.value.filter((t, n) => n !== e), Z(R.value.filter((t, n) => n !== e)), T("remove", t, e), J(`${q(n)} removed.`);
|
|
158
|
+
let r = R.value.length;
|
|
159
|
+
r ? Y(Math.min(e, r - 1), "remove") : p(() => A.value?.querySelector("[data-action='add']")?.focus());
|
|
140
160
|
}
|
|
141
|
-
function
|
|
142
|
-
e.isComposing || (e.preventDefault(),
|
|
161
|
+
function xe(e, t) {
|
|
162
|
+
e.isComposing || (e.preventDefault(), Y(t, "value"));
|
|
143
163
|
}
|
|
144
|
-
function
|
|
145
|
-
e.isComposing || (e.preventDefault(), t <
|
|
164
|
+
function Se(e, t) {
|
|
165
|
+
e.isComposing || (e.preventDefault(), t < R.value.length - 1 ? Y(t + 1, "key") : V.value || $());
|
|
146
166
|
}
|
|
147
|
-
function
|
|
167
|
+
function Ce(e, t) {
|
|
148
168
|
let n = e.currentTarget, r = e.relatedTarget;
|
|
149
|
-
r && (n.contains(r) || r instanceof Element && r.closest("[data-testid='ac-select-panel']")) ||
|
|
169
|
+
r && (n.contains(r) || r instanceof Element && r.closest("[data-testid='ac-select-panel']")) || N.value === t && (N.value = null);
|
|
150
170
|
}
|
|
151
|
-
return
|
|
152
|
-
|
|
171
|
+
return y(w, (e) => {
|
|
172
|
+
!e || Array.isArray(e) || ye(e, I) || (F.value = Object.entries(e).map(([e, t]) => ({
|
|
173
|
+
key: e,
|
|
174
|
+
value: String(t)
|
|
175
|
+
})), I = X(F.value));
|
|
176
|
+
}, { immediate: !0 }), y(() => R.value.length, (e) => {
|
|
177
|
+
M.value.length !== e && (M.value = Array.from({ length: e }, () => j++));
|
|
153
178
|
}, { immediate: !0 }), f({
|
|
154
179
|
add: $,
|
|
155
|
-
focus: () =>
|
|
156
|
-
hasErrors: () =>
|
|
180
|
+
focus: () => Y(0, "key"),
|
|
181
|
+
hasErrors: () => ve.value
|
|
157
182
|
}), (a, f) => (h(), c("div", {
|
|
158
183
|
ref_key: "root",
|
|
159
|
-
ref:
|
|
184
|
+
ref: A,
|
|
160
185
|
role: "group",
|
|
161
|
-
"aria-labelledby": d.label ?
|
|
162
|
-
"aria-label": d.label ? void 0 : `${
|
|
163
|
-
"aria-describedby":
|
|
186
|
+
"aria-labelledby": d.label ? D : void 0,
|
|
187
|
+
"aria-label": d.label ? void 0 : `${q(d.itemName)}s`,
|
|
188
|
+
"aria-describedby": ge.value,
|
|
164
189
|
class: m(d.disabled && "opacity-50"),
|
|
165
190
|
"data-ac-ds": "",
|
|
166
191
|
"data-testid": "ac-key-value-input"
|
|
167
192
|
}, [
|
|
168
193
|
d.label ? (h(), c("div", {
|
|
169
194
|
key: 0,
|
|
170
|
-
id:
|
|
195
|
+
id: D,
|
|
171
196
|
class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
|
|
172
197
|
}, [
|
|
173
|
-
l("span", null,
|
|
174
|
-
d.readonly ? (h(), c("span",
|
|
175
|
-
d.required ? (h(), c("span",
|
|
198
|
+
l("span", null, _(d.label), 1),
|
|
199
|
+
d.readonly ? (h(), c("span", se, "(read only)")) : s("", !0),
|
|
200
|
+
d.required ? (h(), c("span", ce, "*")) : s("", !0)
|
|
176
201
|
])) : s("", !0),
|
|
177
202
|
d.hint ? (h(), c("p", {
|
|
178
203
|
key: 1,
|
|
179
|
-
id:
|
|
204
|
+
id: O,
|
|
180
205
|
class: "mb-2 text-base text-muted"
|
|
181
|
-
},
|
|
182
|
-
|
|
183
|
-
l("span", null,
|
|
184
|
-
l("span", null,
|
|
185
|
-
|
|
186
|
-
], 2),
|
|
206
|
+
}, _(d.hint), 1)) : s("", !0),
|
|
207
|
+
R.value.length && !d.plain ? (h(), c("div", le, [l("div", { class: m(["grid gap-x-4 text-base font-medium text-muted", H.value]) }, [
|
|
208
|
+
l("span", null, _(d.keyLabel), 1),
|
|
209
|
+
l("span", null, _(d.valueLabel), 1),
|
|
210
|
+
z.value ? (h(), c("span", ue, _(d.optionLabel), 1)) : s("", !0)
|
|
211
|
+
], 2), B.value ? (h(), c("span", {
|
|
187
212
|
key: 0,
|
|
188
213
|
class: m(d.size === "small" ? "w-[34px]" : "w-[38px]")
|
|
189
214
|
}, null, 2)) : s("", !0)])) : s("", !0),
|
|
190
|
-
|
|
215
|
+
R.value.length || B.value ? (h(), o(i, {
|
|
191
216
|
key: 3,
|
|
192
217
|
tag: "div",
|
|
193
218
|
class: "relative space-y-4",
|
|
@@ -197,13 +222,13 @@ var T = [
|
|
|
197
222
|
"leave-to-class": "translate-x-5 opacity-0",
|
|
198
223
|
"move-class": "transition-transform duration-300 ease-out motion-reduce:transition-none"
|
|
199
224
|
}, {
|
|
200
|
-
default:
|
|
201
|
-
key:
|
|
225
|
+
default: b(() => [(h(!0), c(r, null, ee(R.value, (e, r) => (h(), c("div", {
|
|
226
|
+
key: M.value[r] ?? r,
|
|
202
227
|
"data-row": r,
|
|
203
|
-
class: "grid grid-cols-[minmax(0,1fr)_auto] items-start gap-x-4 max-sm:rounded-10 max-sm:border max-sm:border-border max-sm:bg-surface max-sm:p-3",
|
|
204
|
-
onFocusin: (e) =>
|
|
205
|
-
onFocusout: (e) =>
|
|
206
|
-
}, [l("div", { class: m(["grid items-start gap-x-4 gap-y-3 [&_div:has(>input)]:rounded-8 [&_input]:rounded-8 [&_input]:font-medium",
|
|
228
|
+
class: m(["grid grid-cols-[minmax(0,1fr)_auto] items-start gap-x-4", !d.plain && "max-sm:rounded-10 max-sm:border max-sm:border-border max-sm:bg-surface max-sm:p-3"]),
|
|
229
|
+
onFocusin: (e) => N.value = M.value[r] ?? null,
|
|
230
|
+
onFocusout: (e) => Ce(e, M.value[r] ?? -1)
|
|
231
|
+
}, [l("div", { class: m(["grid items-start gap-x-4 gap-y-3 [&_div:has(>input)]:rounded-8 [&_input]:rounded-8 [&_input]:font-medium", [H.value, d.plain && "[&_input]:pr-3 [&_input]:pl-3"]]) }, [
|
|
207
232
|
u(t, {
|
|
208
233
|
"data-cell": "key",
|
|
209
234
|
"model-value": e.key,
|
|
@@ -212,12 +237,12 @@ var T = [
|
|
|
212
237
|
size: d.size,
|
|
213
238
|
disabled: d.disabled,
|
|
214
239
|
readonly: d.readonly,
|
|
215
|
-
"error-msg":
|
|
240
|
+
"error-msg": W.value[r]?.key,
|
|
216
241
|
autocomplete: "off",
|
|
217
242
|
spellcheck: "false",
|
|
218
|
-
class: m([
|
|
243
|
+
class: m([U.value, d.mono && "[&_input]:font-mono"]),
|
|
219
244
|
"onUpdate:modelValue": (e) => Q(r, { key: String(e) }),
|
|
220
|
-
onKeydown:
|
|
245
|
+
onKeydown: x((e) => xe(e, r), ["enter"])
|
|
221
246
|
}, null, 8, [
|
|
222
247
|
"model-value",
|
|
223
248
|
"label",
|
|
@@ -238,12 +263,12 @@ var T = [
|
|
|
238
263
|
size: d.size,
|
|
239
264
|
disabled: d.disabled,
|
|
240
265
|
readonly: d.readonly,
|
|
241
|
-
"error-msg":
|
|
266
|
+
"error-msg": W.value[r]?.value,
|
|
242
267
|
autocomplete: "off",
|
|
243
268
|
spellcheck: "false",
|
|
244
|
-
class:
|
|
269
|
+
class: m(U.value),
|
|
245
270
|
"onUpdate:modelValue": (e) => Q(r, { value: String(e) }),
|
|
246
|
-
onKeydown:
|
|
271
|
+
onKeydown: x((e) => Se(e, r), ["enter"])
|
|
247
272
|
}, null, 8, [
|
|
248
273
|
"model-value",
|
|
249
274
|
"label",
|
|
@@ -252,22 +277,24 @@ var T = [
|
|
|
252
277
|
"disabled",
|
|
253
278
|
"readonly",
|
|
254
279
|
"error-msg",
|
|
280
|
+
"class",
|
|
255
281
|
"onUpdate:modelValue",
|
|
256
282
|
"onKeydown"
|
|
257
283
|
]),
|
|
258
|
-
|
|
284
|
+
z.value && d.readonly ? (h(), o(t, {
|
|
259
285
|
key: 0,
|
|
260
286
|
"data-cell": "option",
|
|
261
|
-
"model-value": e.option ?
|
|
287
|
+
"model-value": e.option ? G(e.option) : "",
|
|
262
288
|
label: `${d.optionLabel} ${r + 1}`,
|
|
263
289
|
size: d.size,
|
|
264
290
|
readonly: "",
|
|
265
|
-
class:
|
|
291
|
+
class: m(U.value)
|
|
266
292
|
}, null, 8, [
|
|
267
293
|
"model-value",
|
|
268
294
|
"label",
|
|
269
|
-
"size"
|
|
270
|
-
|
|
295
|
+
"size",
|
|
296
|
+
"class"
|
|
297
|
+
])) : z.value ? (h(), o(n, {
|
|
271
298
|
key: 1,
|
|
272
299
|
"data-cell": "option",
|
|
273
300
|
"model-value": e.option ?? null,
|
|
@@ -275,7 +302,7 @@ var T = [
|
|
|
275
302
|
label: `${d.optionLabel} ${r + 1}`,
|
|
276
303
|
size: d.size,
|
|
277
304
|
disabled: d.disabled,
|
|
278
|
-
class: "sm:[&>div:first-child]:sr-only",
|
|
305
|
+
class: m(d.plain ? "[&>div:first-child]:sr-only" : "sm:[&>div:first-child]:sr-only"),
|
|
279
306
|
"onUpdate:modelValue": (e) => Q(r, { option: e ?? void 0 })
|
|
280
307
|
}, null, 8, [
|
|
281
308
|
"model-value",
|
|
@@ -283,36 +310,37 @@ var T = [
|
|
|
283
310
|
"label",
|
|
284
311
|
"size",
|
|
285
312
|
"disabled",
|
|
313
|
+
"class",
|
|
286
314
|
"onUpdate:modelValue"
|
|
287
315
|
])) : s("", !0)
|
|
288
|
-
], 2),
|
|
316
|
+
], 2), B.value ? (h(), c("button", {
|
|
289
317
|
key: 0,
|
|
290
318
|
type: "button",
|
|
291
319
|
"data-action": "remove",
|
|
292
|
-
class: m(["inline-flex shrink-0 cursor-pointer items-center justify-center rounded-8 bg-danger/5 text-danger/60 transition-all duration-200 hover:bg-danger/10 hover:text-danger focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none max-sm:mt-7"
|
|
293
|
-
"aria-label": `Remove ${
|
|
320
|
+
class: m(["inline-flex shrink-0 cursor-pointer items-center justify-center rounded-8 bg-danger/5 text-danger/60 transition-all duration-200 hover:bg-danger/10 hover:text-danger focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none", [_e.value, !d.plain && "max-sm:mt-7"]]),
|
|
321
|
+
"aria-label": `Remove ${K(r)}`,
|
|
294
322
|
title: `Remove ${d.itemName}`,
|
|
295
|
-
onClick: (e) =>
|
|
296
|
-
}, [u(
|
|
323
|
+
onClick: (e) => be(r)
|
|
324
|
+
}, [u(v(ae), {
|
|
297
325
|
class: "size-[18px]",
|
|
298
326
|
"aria-hidden": "true"
|
|
299
|
-
})], 10,
|
|
327
|
+
})], 10, fe)) : s("", !0)], 42, de))), 128))]),
|
|
300
328
|
_: 1
|
|
301
|
-
})) : (h(), c("p",
|
|
302
|
-
|
|
303
|
-
|
|
329
|
+
})) : (h(), c("p", pe, "No " + _(d.itemName) + "s.", 1)),
|
|
330
|
+
te(a.$slots, "footer"),
|
|
331
|
+
B.value ? (h(), c("div", {
|
|
304
332
|
key: 5,
|
|
305
|
-
class: m(["flex items-center gap-3",
|
|
333
|
+
class: m(["flex items-center gap-3", R.value.length || a.$slots.footer ? "mt-2" : ""])
|
|
306
334
|
}, [u(e, {
|
|
307
335
|
"data-action": "add",
|
|
308
|
-
title:
|
|
336
|
+
title: he.value,
|
|
309
337
|
"aria-label": d.addLabel ? void 0 : `Add new ${d.itemName}`,
|
|
310
338
|
size: "small",
|
|
311
339
|
variant: "light",
|
|
312
|
-
disabled:
|
|
340
|
+
disabled: V.value,
|
|
313
341
|
onClick: $
|
|
314
342
|
}, {
|
|
315
|
-
icon:
|
|
343
|
+
icon: b(() => [u(v(ie), { "aria-hidden": "true" })]),
|
|
316
344
|
_: 1
|
|
317
345
|
}, 8, [
|
|
318
346
|
"title",
|
|
@@ -320,17 +348,17 @@ var T = [
|
|
|
320
348
|
"disabled"
|
|
321
349
|
]), d.max === void 0 ? s("", !0) : (h(), c("span", {
|
|
322
350
|
key: 0,
|
|
323
|
-
class: m(["text-xs text-muted tabular-nums",
|
|
324
|
-
},
|
|
351
|
+
class: m(["text-xs text-muted tabular-nums", V.value && "font-medium text-heading"])
|
|
352
|
+
}, _(R.value.length) + " of " + _(d.max), 3))], 2)) : s("", !0),
|
|
325
353
|
d.errorMsg ? (h(), c("p", {
|
|
326
354
|
key: 6,
|
|
327
|
-
id:
|
|
355
|
+
id: k,
|
|
328
356
|
class: "mt-1 text-base text-danger-strong",
|
|
329
357
|
role: "alert"
|
|
330
|
-
},
|
|
331
|
-
l("p",
|
|
332
|
-
], 10,
|
|
358
|
+
}, _(d.errorMsg), 1)) : s("", !0),
|
|
359
|
+
l("p", me, _(P.value), 1)
|
|
360
|
+
], 10, oe));
|
|
333
361
|
}
|
|
334
362
|
});
|
|
335
363
|
//#endregion
|
|
336
|
-
export {
|
|
364
|
+
export { S as default };
|
|
@@ -19,9 +19,9 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
|
|
|
19
19
|
description: string;
|
|
20
20
|
height: number;
|
|
21
21
|
points: boolean | "auto";
|
|
22
|
-
loading: boolean;
|
|
23
22
|
animation: boolean;
|
|
24
23
|
tooltip: boolean;
|
|
24
|
+
loading: boolean;
|
|
25
25
|
emptyText: string;
|
|
26
26
|
lineWidth: number;
|
|
27
27
|
renderer: "canvas" | "svg";
|
|
@@ -107,10 +107,10 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
|
|
|
107
107
|
title: string;
|
|
108
108
|
description: string;
|
|
109
109
|
height: number;
|
|
110
|
-
loading: boolean;
|
|
111
110
|
animation: boolean;
|
|
112
|
-
pulse: boolean | string[];
|
|
113
111
|
tooltip: boolean;
|
|
112
|
+
loading: boolean;
|
|
113
|
+
pulse: boolean | string[];
|
|
114
114
|
emptyText: string;
|
|
115
115
|
labels: boolean;
|
|
116
116
|
valueLabel: string;
|
|
@@ -5,7 +5,7 @@ export interface Props {
|
|
|
5
5
|
description?: string;
|
|
6
6
|
/** Width: `xsmall` 384px, `small` 448px, `normal` 576px, `medium` 800px, `large` 1000px, `xlarge` 1152px, `full` viewport minus 64px. */
|
|
7
7
|
size?: "xsmall" | "small" | "normal" | "medium" | "large" | "xlarge" | "full";
|
|
8
|
-
/** `framed` has a header and footer bar and a close button; `plain` is one padded card (title, body, buttons)
|
|
8
|
+
/** `framed` has a header and footer bar and a close button; `plain` is one padded card (title, body, buttons), as cloud-ui's confirm dialogs. */
|
|
9
9
|
variant?: "framed" | "plain";
|
|
10
10
|
/** Shows the close button and allows Escape to close. Turn off while a required action runs. */
|
|
11
11
|
closable?: boolean;
|
|
@@ -49,11 +49,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
49
49
|
title: string;
|
|
50
50
|
description: string;
|
|
51
51
|
size: "xsmall" | "small" | "normal" | "medium" | "large" | "xlarge" | "full";
|
|
52
|
+
maxWidth: "xsm" | "sm" | "md" | "lg" | "xl" | "xxl";
|
|
52
53
|
bodyClass: string;
|
|
53
54
|
closable: boolean;
|
|
54
55
|
closeOnOutsideClick: boolean;
|
|
55
56
|
hideFooter: boolean;
|
|
56
|
-
maxWidth: "xsm" | "sm" | "md" | "lg" | "xl" | "xxl";
|
|
57
57
|
showCloseButton: boolean;
|
|
58
58
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
59
59
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -84,8 +84,8 @@ var w = [
|
|
|
84
84
|
let e = window.innerWidth - document.documentElement.clientWidth;
|
|
85
85
|
t.style.overflow = "hidden";
|
|
86
86
|
let n = getComputedStyle(document.documentElement).scrollbarGutter.includes("stable");
|
|
87
|
-
e > 0 && !n && (t.style.paddingRight = `${e}px`);
|
|
88
|
-
} else !e && n <= 0 && (t.style.overflow = "", t.style.paddingRight = "");
|
|
87
|
+
e > 0 && !n && (t.style.paddingRight = `${e}px`), n && t.getBoundingClientRect().height >= window.innerHeight && (document.documentElement.style.backgroundColor = `color-mix(in srgb, ${getComputedStyle(t).backgroundColor} 50%, black)`);
|
|
88
|
+
} else !e && n <= 0 && (t.style.overflow = "", t.style.paddingRight = "", document.documentElement.style.backgroundColor = "");
|
|
89
89
|
}
|
|
90
90
|
return b(V, async (e, t) => {
|
|
91
91
|
if (e) {
|
|
@@ -103,7 +103,7 @@ var w = [
|
|
|
103
103
|
}, {
|
|
104
104
|
default: x(() => [V.value ? (p(), a("div", {
|
|
105
105
|
key: 0,
|
|
106
|
-
class:
|
|
106
|
+
class: "fixed inset-0 z-[80] overflow-y-auto bg-black/50",
|
|
107
107
|
"data-ac-ds": "",
|
|
108
108
|
"data-testid": "ac-modal",
|
|
109
109
|
onKeydown: Z,
|
|
@@ -160,7 +160,7 @@ var w = [
|
|
|
160
160
|
class: d(["ac-scrollbar min-h-0 flex-1 p-6", c.bodyClass])
|
|
161
161
|
}, [h(l.$slots, "default")], 2),
|
|
162
162
|
!c.hideFooter && (l.$slots.footer || l.$slots["footer-left"]) ? (p(), a("footer", I, [o("div", L, [h(l.$slots, "footer-left")]), o("div", R, [h(l.$slots, "footer")])])) : i("", !0)
|
|
163
|
-
], 64))], 10, w)], 32)],
|
|
163
|
+
], 64))], 10, w)], 32)], 32)) : i("", !0)]),
|
|
164
164
|
_: 3
|
|
165
165
|
})]));
|
|
166
166
|
}
|
|
@@ -71,8 +71,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
71
71
|
onViewAll?: (() => any) | undefined;
|
|
72
72
|
}>, {
|
|
73
73
|
label: string;
|
|
74
|
-
loading: boolean;
|
|
75
74
|
align: "start" | "end";
|
|
75
|
+
loading: boolean;
|
|
76
76
|
emptyText: string;
|
|
77
77
|
notifications: NotificationItem[];
|
|
78
78
|
unreadCount: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import e from "./
|
|
2
|
-
import
|
|
1
|
+
import { fixedFrame as e } from "./fixedFrame.js";
|
|
2
|
+
import t from "./AcNavbarItem.js";
|
|
3
3
|
import n from "./AcSkeleton.js";
|
|
4
4
|
import { Fragment as r, Teleport as i, Transition as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, getCurrentInstance as m, mergeModels as h, mergeProps as g, nextTick as _, normalizeClass as v, normalizeStyle as ee, onBeforeUnmount as te, openBlock as y, ref as b, renderList as x, renderSlot as S, resolveDynamicComponent as C, toDisplayString as w, unref as T, useId as ne, useModel as re, watch as E, withCtx as D } from "vue";
|
|
5
5
|
import { ArrowRight as ie, Bell as ae, BellOff as oe } from "@lucide/vue";
|
|
@@ -146,9 +146,9 @@ var se = {
|
|
|
146
146
|
t.length && t[(e + t.length) % t.length].focus();
|
|
147
147
|
}
|
|
148
148
|
function Y() {
|
|
149
|
-
let
|
|
150
|
-
if (!
|
|
151
|
-
let n =
|
|
149
|
+
let t = K();
|
|
150
|
+
if (!t || !L.value) return;
|
|
151
|
+
let n = t.getBoundingClientRect(), r = e(), { offsetWidth: i, offsetHeight: a } = L.value, o = r.bottom - n.bottom - 6 - 8, s = n.top - r.top - 6 - 8, c = o < a && s > o, l = (O.align === "end" ? n.right - i : n.left) - r.left;
|
|
152
152
|
z.value = !c, R.value = {
|
|
153
153
|
[c ? "bottom" : "top"]: `${c ? r.bottom - n.top + 6 : n.bottom + 6 - r.top}px`,
|
|
154
154
|
left: `${Math.max(8, Math.min(l, r.width - i - 8))}px`,
|
|
@@ -194,7 +194,7 @@ var se = {
|
|
|
194
194
|
B.value = Date.now(), await _(), Y();
|
|
195
195
|
let t = q()[0];
|
|
196
196
|
t ? t.focus() : L.value?.focus();
|
|
197
|
-
}), E(() => [O.notifications.length, O.loading], () => k.value && _(Y)), te(() => $(!1)), (
|
|
197
|
+
}), E(() => [O.notifications.length, O.loading], () => k.value && _(Y)), te(() => $(!1)), (e, o) => (y(), l("div", se, [f(t, {
|
|
198
198
|
ref_key: "trigger",
|
|
199
199
|
ref: I,
|
|
200
200
|
label: p.label,
|
|
@@ -253,44 +253,44 @@ var se = {
|
|
|
253
253
|
lines: 3,
|
|
254
254
|
height: "10px",
|
|
255
255
|
label: ""
|
|
256
|
-
})), 64))])) : p.notifications.length ? (y(), l("ul", me, [(y(!0), l(r, null, x(p.notifications, (
|
|
256
|
+
})), 64))])) : p.notifications.length ? (y(), l("ul", me, [(y(!0), l(r, null, x(p.notifications, (t) => (y(), l("li", { key: t.id }, [(y(), s(C(W(t.to, t.href)), g({ ref_for: !0 }, G(t.to, t.href), {
|
|
257
257
|
"data-notification-item": "",
|
|
258
|
-
class: ["relative block w-full cursor-pointer p-3 text-left no-underline outline-none transition-colors duration-200 hover:bg-surface-sunken focus-visible:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", !
|
|
258
|
+
class: ["relative block w-full cursor-pointer p-3 text-left no-underline outline-none transition-colors duration-200 hover:bg-surface-sunken focus-visible:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", !t.read && "bg-primary/8"],
|
|
259
259
|
"data-ac-ds": "",
|
|
260
260
|
"data-testid": "ac-notification-menu-item",
|
|
261
|
-
onClick: (
|
|
261
|
+
onClick: (e) => Le(t)
|
|
262
262
|
}), {
|
|
263
|
-
default: D(() => [S(
|
|
263
|
+
default: D(() => [S(e.$slots, "item", { item: t }, () => [
|
|
264
264
|
u("span", he, [
|
|
265
|
-
|
|
265
|
+
t.icon ? (y(), s(C(t.icon), {
|
|
266
266
|
key: 0,
|
|
267
267
|
class: "size-4 shrink-0 text-muted",
|
|
268
268
|
"aria-hidden": "true"
|
|
269
269
|
})) : c("", !0),
|
|
270
|
-
u("span", ge, w(
|
|
271
|
-
|
|
272
|
-
|
|
270
|
+
u("span", ge, w(t.title || t.msg), 1),
|
|
271
|
+
t.read ? c("", !0) : (y(), l("span", _e)),
|
|
272
|
+
t.read ? c("", !0) : (y(), l("span", ve, "(unread)"))
|
|
273
273
|
]),
|
|
274
|
-
|
|
274
|
+
t.title && t.msg ? (y(), l("span", ye, w(t.msg), 1)) : c("", !0),
|
|
275
275
|
u("span", be, [
|
|
276
|
-
|
|
276
|
+
t.status ? (y(), l("span", {
|
|
277
277
|
key: 0,
|
|
278
|
-
class: v(["font-medium", De[Me(
|
|
279
|
-
}, w(
|
|
280
|
-
|
|
278
|
+
class: v(["font-medium", De[Me(t)]])
|
|
279
|
+
}, w(t.status), 3)) : c("", !0),
|
|
280
|
+
t.status ? (y(), l("span", xe, "·")) : c("", !0),
|
|
281
281
|
u("time", {
|
|
282
|
-
datetime: Fe(
|
|
283
|
-
title: Pe(
|
|
284
|
-
}, w(Ne(
|
|
282
|
+
datetime: Fe(t.time),
|
|
283
|
+
title: Pe(t.time)
|
|
284
|
+
}, w(Ne(t.time)), 9, Se)
|
|
285
285
|
])
|
|
286
286
|
])]),
|
|
287
287
|
_: 2
|
|
288
|
-
}, 1040, ["class", "onClick"]))]))), 128))])) : (y(), l("div", de, [S(
|
|
288
|
+
}, 1040, ["class", "onClick"]))]))), 128))])) : (y(), l("div", de, [S(e.$slots, "empty", {}, () => [
|
|
289
289
|
u("span", fe, [f(T(oe), { class: "size-6" })]),
|
|
290
290
|
u("p", pe, w(p.emptyText), 1),
|
|
291
291
|
o[2] ||= u("p", { class: "max-w-64 text-base text-muted" }, "Backups, upgrades and alerts from your clusters show up here.", -1)
|
|
292
292
|
])])),
|
|
293
|
-
|
|
293
|
+
e.$slots.footer || je.value ? (y(), l("div", Ce, [S(e.$slots, "footer", { close: X }, () => [(y(), s(C(W(p.viewAllTo, p.viewAllHref)), g(G(p.viewAllTo, p.viewAllHref), {
|
|
294
294
|
class: "group/link flex h-9 w-full cursor-pointer items-center justify-center gap-1.5 rounded-8 text-base font-semibold text-primary-strong no-underline outline-none transition-colors duration-200 hover:bg-surface-sunken focus-visible:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",
|
|
295
295
|
"data-ac-ds": "",
|
|
296
296
|
"data-testid": "ac-notification-menu-view-all",
|