@ac-design/design-system 2.2.0 → 2.3.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.
- package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +89 -88
- package/dist/lib/compat.css +210 -0
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +74 -73
- package/dist/lib/components/AcButton.vue.d.ts +18 -12
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +62 -32
- package/dist/lib/components/AcCard.vue.d.ts +11 -5
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +99 -51
- package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +151 -150
- package/dist/lib/components/AcColorInput.vue.d.ts +1 -1
- package/dist/lib/components/AcDatePicker.vue.d.ts +27 -3
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +518 -454
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +56 -55
- package/dist/lib/components/AcErrorState.vue.d.ts +1 -1
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +39 -38
- package/dist/lib/components/AcHeader.vue.d.ts +1 -1
- package/dist/lib/components/AcInput.vue.d.ts +28 -7
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +149 -80
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +1 -1
- package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +6 -0
- package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +74 -58
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/lib/components/AcNavbar.vue.d.ts +2 -0
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +31 -25
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +90 -89
- package/dist/lib/components/AcNumberInput.vue.d.ts +1 -1
- package/dist/lib/components/AcRadioCard.js +5 -0
- package/dist/lib/components/AcRadioCard.vue.d.ts +55 -0
- package/dist/lib/components/AcRadioCard.vue_vue_type_script_setup_true_lang.js +135 -0
- package/dist/lib/components/AcSelect.vue.d.ts +12 -1
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +237 -220
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebar.vue.d.ts +9 -0
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +113 -94
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +19 -18
- package/dist/lib/components/AcSlider.vue.d.ts +1 -1
- package/dist/lib/components/AcTable.vue.d.ts +13 -1
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +106 -86
- package/dist/lib/components/AcTagInput.vue.d.ts +1 -1
- package/dist/lib/components/AcTextarea.vue.d.ts +30 -4
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +92 -61
- package/dist/lib/components/AcThemeMode.vue.d.ts +10 -2
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +53 -42
- package/dist/lib/components/AcTimePicker.vue.d.ts +21 -3
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +234 -201
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +73 -72
- package/dist/lib/components/AcUserMenu.vue.d.ts +8 -0
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +125 -107
- package/dist/lib/components/fixedFrame.d.ts +11 -0
- package/dist/lib/components/fixedFrame.js +24 -0
- package/dist/lib/components/index.d.ts +1 -0
- package/dist/lib/components/types.d.ts +2 -0
- package/dist/lib/index.js +34 -33
- package/package.json +1 -1
|
@@ -1,50 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import t from "./
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
import { fixedFrame as e } from "./fixedFrame.js";
|
|
2
|
+
import { statusMeta as t } from "./status.js";
|
|
3
|
+
import n from "./AcSkeleton.js";
|
|
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, inject as ee, mergeModels as m, nextTick as h, normalizeClass as g, normalizeStyle as te, onBeforeUnmount as ne, openBlock as _, ref as v, renderList as re, renderSlot as y, resolveDynamicComponent as ie, toDisplayString as b, unref as x, useId as ae, useModel as oe, vModelText as se, watch as ce, withCtx as S, withDirectives as le, withModifiers as ue } from "vue";
|
|
5
|
+
import { Check as de, ChevronsUpDown as fe, Cloud as C, Plus as pe, Search as me } from "@lucide/vue";
|
|
5
6
|
//#region src/lib/components/AcClusterSwitcher.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
7
|
+
var he = [
|
|
7
8
|
"id",
|
|
8
9
|
"aria-expanded",
|
|
9
10
|
"aria-controls",
|
|
10
11
|
"aria-label",
|
|
11
12
|
"title",
|
|
12
13
|
"disabled"
|
|
13
|
-
],
|
|
14
|
+
], ge = {
|
|
14
15
|
class: "relative inline-flex size-7 shrink-0 items-center justify-center rounded-8 bg-surface ring-1 ring-border ring-inset",
|
|
15
16
|
"aria-hidden": "true"
|
|
16
|
-
},
|
|
17
|
+
}, _e = ["src"], ve = { class: "min-w-0 flex-1" }, ye = {
|
|
17
18
|
key: 0,
|
|
18
19
|
class: "block truncate text-sm text-muted"
|
|
19
|
-
},
|
|
20
|
+
}, be = {
|
|
20
21
|
key: 0,
|
|
21
22
|
class: "border-b border-border p-2"
|
|
22
|
-
},
|
|
23
|
+
}, xe = { class: "relative" }, Se = [
|
|
23
24
|
"aria-activedescendant",
|
|
24
25
|
"aria-label",
|
|
25
26
|
"placeholder"
|
|
26
|
-
],
|
|
27
|
+
], Ce = ["tabindex", "aria-activedescendant"], we = [
|
|
27
28
|
"id",
|
|
28
29
|
"aria-selected",
|
|
29
30
|
"aria-disabled",
|
|
30
31
|
"onMouseenter",
|
|
31
32
|
"onClick"
|
|
32
|
-
],
|
|
33
|
+
], Te = {
|
|
33
34
|
class: "inline-flex size-8 shrink-0 items-center justify-center rounded-8 bg-surface ring-1 ring-border ring-inset",
|
|
34
35
|
"aria-hidden": "true"
|
|
35
|
-
},
|
|
36
|
+
}, Ee = ["src", "onError"], De = { class: "min-w-0 flex-1" }, Oe = { class: "block truncate text-base leading-5 font-medium text-heading" }, ke = { class: "flex min-w-0 items-center gap-1.5 text-xs text-muted" }, Ae = {
|
|
36
37
|
key: 1,
|
|
37
38
|
"aria-hidden": "true"
|
|
38
|
-
},
|
|
39
|
+
}, je = { class: "truncate" }, Me = {
|
|
39
40
|
key: 0,
|
|
40
41
|
role: "presentation",
|
|
41
42
|
class: "px-3 py-6 text-center text-base text-muted"
|
|
42
|
-
},
|
|
43
|
+
}, Ne = {
|
|
43
44
|
key: 1,
|
|
44
45
|
class: "border-t border-border p-2"
|
|
45
|
-
},
|
|
46
|
+
}, Pe = /*@__PURE__*/ p({
|
|
46
47
|
__name: "AcClusterSwitcher",
|
|
47
|
-
props: /*@__PURE__*/
|
|
48
|
+
props: /*@__PURE__*/ m({
|
|
48
49
|
clusterOptions: { default: () => [] },
|
|
49
50
|
sidebarCollapsed: {
|
|
50
51
|
type: Boolean,
|
|
@@ -76,13 +77,13 @@ var _e = [
|
|
|
76
77
|
},
|
|
77
78
|
openModifiers: {}
|
|
78
79
|
}),
|
|
79
|
-
emits: /*@__PURE__*/
|
|
80
|
-
setup(
|
|
81
|
-
let
|
|
80
|
+
emits: /*@__PURE__*/ m(["select", "import"], ["update:modelValue", "update:open"]),
|
|
81
|
+
setup(p, { expose: m, emit: Pe }) {
|
|
82
|
+
let w = p, T = oe(p, "modelValue"), E = oe(p, "open"), D = Pe, Fe = {
|
|
82
83
|
registered: "warning",
|
|
83
84
|
unknown: "warning",
|
|
84
85
|
notconnected: "danger"
|
|
85
|
-
},
|
|
86
|
+
}, Ie = {
|
|
86
87
|
success: "bg-success",
|
|
87
88
|
danger: "bg-danger",
|
|
88
89
|
info: "bg-info",
|
|
@@ -96,37 +97,37 @@ var _e = [
|
|
|
96
97
|
warning: "text-warning-strong",
|
|
97
98
|
pending: "text-pending-strong",
|
|
98
99
|
neutral: "text-muted"
|
|
99
|
-
},
|
|
100
|
+
}, Re = ee("ac-sidebar", null), O = ae(), k = `${O}-panel`, A = `${O}-list`, j = v(null), M = v(null), ze = v(null), N = v(null), P = v(""), F = v(-1), I = v(/* @__PURE__ */ new Set()), L = v({}), R = v(!0), z = o(() => w.sidebarCollapsed ?? Re?.rail.value ?? !1), B = o(() => Re?.dark.value ?? !1), V = o(() => T.value ? w.clusterOptions.find((e) => e.name === T.value) ?? { name: T.value } : null), H = o(() => {
|
|
100
101
|
let e = P.value.trim().toLowerCase();
|
|
101
|
-
return e ?
|
|
102
|
+
return e ? w.clusterOptions.filter((t) => [
|
|
102
103
|
t.name,
|
|
103
104
|
t.displayName,
|
|
104
105
|
t.provider,
|
|
105
106
|
t.location
|
|
106
|
-
].some((t) => t?.toLowerCase().includes(e))) :
|
|
107
|
-
}),
|
|
107
|
+
].some((t) => t?.toLowerCase().includes(e))) : w.clusterOptions;
|
|
108
|
+
}), Be = o(() => V.value ? `Cluster: ${U(V.value)}${V.value.status ? `, ${V.value.status}` : ""}. Switch cluster` : "Select a cluster");
|
|
108
109
|
function U(e) {
|
|
109
110
|
return e.displayName || e.name;
|
|
110
111
|
}
|
|
111
112
|
function W(e) {
|
|
112
113
|
return !!(e.disabled || e.$isDisabled);
|
|
113
114
|
}
|
|
114
|
-
function G(
|
|
115
|
-
let n = (
|
|
115
|
+
function G(e) {
|
|
116
|
+
let n = (e ?? "").toLowerCase().replace(/[^a-z]/g, "");
|
|
116
117
|
if (!n) return "neutral";
|
|
117
|
-
let r =
|
|
118
|
+
let r = Fe[n] ?? t(e).tone;
|
|
118
119
|
return r === "default" ? "neutral" : r;
|
|
119
120
|
}
|
|
120
121
|
function K(e) {
|
|
121
|
-
return !
|
|
122
|
+
return !w.providerIconBase || !e || I.value.has(e) ? "" : `${w.providerIconBase}/${e}.png`;
|
|
122
123
|
}
|
|
123
|
-
function
|
|
124
|
+
function q(e) {
|
|
124
125
|
e && (I.value = new Set(I.value).add(e));
|
|
125
126
|
}
|
|
126
|
-
function
|
|
127
|
+
function J(e) {
|
|
127
128
|
return `${O}-opt-${e}`;
|
|
128
129
|
}
|
|
129
|
-
function
|
|
130
|
+
function Y(e = 0, t = 1) {
|
|
130
131
|
let n = H.value;
|
|
131
132
|
for (let r = e; r >= 0 && r < n.length; r += t) if (!W(n[r])) return r;
|
|
132
133
|
return -1;
|
|
@@ -136,256 +137,256 @@ var _e = [
|
|
|
136
137
|
if (!t.length) return;
|
|
137
138
|
let n = F.value;
|
|
138
139
|
for (let r = 0; r < t.length && (n = (n + e + t.length) % t.length, W(t[n])); r++);
|
|
139
|
-
F.value = n,
|
|
140
|
-
}
|
|
141
|
-
function Y() {
|
|
142
|
-
m(() => N.value?.querySelector(`#${CSS.escape(q(F.value))}`)?.scrollIntoView({ block: "nearest" }));
|
|
140
|
+
F.value = n, X();
|
|
143
141
|
}
|
|
144
142
|
function X() {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
143
|
+
h(() => N.value?.querySelector(`#${CSS.escape(J(F.value))}`)?.scrollIntoView({ block: "nearest" }));
|
|
144
|
+
}
|
|
145
|
+
function Z() {
|
|
146
|
+
let t = j.value;
|
|
147
|
+
if (!t || !M.value) return;
|
|
148
|
+
let n = t.getBoundingClientRect(), r = e(), i = Math.min(Math.max(z.value ? 288 : n.width, 288), r.width - 16);
|
|
149
|
+
M.value.style.width = `${i}px`;
|
|
150
|
+
let a = M.value.offsetHeight;
|
|
150
151
|
if (z.value) {
|
|
151
|
-
let e =
|
|
152
|
+
let e = n.top + a <= r.bottom - 8;
|
|
152
153
|
R.value = e, L.value = {
|
|
153
|
-
...e ? { top: `${
|
|
154
|
-
left: `${Math.min(
|
|
155
|
-
width: `${
|
|
156
|
-
maxHeight: `${
|
|
154
|
+
...e ? { top: `${n.top - r.top}px` } : { bottom: "8px" },
|
|
155
|
+
left: `${Math.min(n.right + 6 - r.left, r.width - i - 8)}px`,
|
|
156
|
+
width: `${i}px`,
|
|
157
|
+
maxHeight: `${r.height - 16}px`
|
|
157
158
|
};
|
|
158
159
|
return;
|
|
159
160
|
}
|
|
160
|
-
let
|
|
161
|
-
R.value = !
|
|
162
|
-
[
|
|
163
|
-
left: `${Math.max(8, Math.min(
|
|
164
|
-
width: `${
|
|
165
|
-
maxHeight: `${Math.max(
|
|
161
|
+
let o = r.bottom - n.bottom - 6 - 8, s = n.top - r.top - 6 - 8, c = o < a && s > o;
|
|
162
|
+
R.value = !c, L.value = {
|
|
163
|
+
[c ? "bottom" : "top"]: `${c ? r.bottom - n.top + 6 : n.bottom + 6 - r.top}px`,
|
|
164
|
+
left: `${Math.max(8, Math.min(n.left - r.left, r.width - i - 8))}px`,
|
|
165
|
+
width: `${i}px`,
|
|
166
|
+
maxHeight: `${Math.max(c ? s : o, 200)}px`
|
|
166
167
|
};
|
|
167
168
|
}
|
|
168
|
-
function
|
|
169
|
-
|
|
169
|
+
function Q() {
|
|
170
|
+
w.disabled || w.loading || (E.value = !0);
|
|
170
171
|
}
|
|
171
|
-
function
|
|
172
|
-
|
|
172
|
+
function $(e = !0) {
|
|
173
|
+
E.value && (E.value = !1, e && j.value?.focus());
|
|
173
174
|
}
|
|
174
|
-
function
|
|
175
|
-
W(e) || (
|
|
175
|
+
function He(e) {
|
|
176
|
+
W(e) || (T.value = e.name, D("select", e), $());
|
|
176
177
|
}
|
|
177
|
-
function
|
|
178
|
-
|
|
178
|
+
function Ue() {
|
|
179
|
+
D("import"), $(!1);
|
|
179
180
|
}
|
|
180
|
-
function
|
|
181
|
-
!
|
|
181
|
+
function We(e) {
|
|
182
|
+
!E.value && ["ArrowDown", "ArrowUp"].includes(e.key) && (e.preventDefault(), Q());
|
|
182
183
|
}
|
|
183
|
-
function
|
|
184
|
+
function Ge(e) {
|
|
184
185
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") e.preventDefault(), Ve(e.key === "ArrowDown" ? 1 : -1);
|
|
185
|
-
else if ((e.key === "Home" || e.key === "End") && !
|
|
186
|
-
else if (e.key === "Enter" || e.key === " " && !
|
|
186
|
+
else if ((e.key === "Home" || e.key === "End") && !w.searchable) e.preventDefault(), F.value = e.key === "Home" ? Y() : Y(H.value.length - 1, -1), X();
|
|
187
|
+
else if (e.key === "Enter" || e.key === " " && !w.searchable) {
|
|
187
188
|
e.preventDefault();
|
|
188
189
|
let t = H.value[F.value];
|
|
189
|
-
t &&
|
|
190
|
+
t && He(t);
|
|
190
191
|
}
|
|
191
192
|
}
|
|
192
193
|
function Ke(e) {
|
|
193
|
-
e.key === "Escape" ? (e.preventDefault(),
|
|
194
|
+
e.key === "Escape" ? (e.preventDefault(), $()) : e.key === "Tab" && qe(e);
|
|
194
195
|
}
|
|
195
196
|
function qe(e) {
|
|
196
197
|
let t = [...M.value?.querySelectorAll("input, a[href], button:not([disabled]), [tabindex=\"0\"]") ?? []], n = t[0], r = t[t.length - 1];
|
|
197
|
-
e.shiftKey && document.activeElement === n ? (e.preventDefault(),
|
|
198
|
+
e.shiftKey && document.activeElement === n ? (e.preventDefault(), $()) : !e.shiftKey && document.activeElement === r && $();
|
|
198
199
|
}
|
|
199
200
|
function Je(e) {
|
|
200
201
|
let t = e.target;
|
|
201
|
-
j.value?.contains(t) || M.value?.contains(t) ||
|
|
202
|
+
j.value?.contains(t) || M.value?.contains(t) || $(!1);
|
|
202
203
|
}
|
|
203
204
|
function Ye(e) {
|
|
204
|
-
e?.target instanceof Node && M.value?.contains(e.target) ||
|
|
205
|
+
e?.target instanceof Node && M.value?.contains(e.target) || Z();
|
|
205
206
|
}
|
|
206
|
-
function
|
|
207
|
+
function Xe(e) {
|
|
207
208
|
let t = e ? "addEventListener" : "removeEventListener";
|
|
208
209
|
document[t]("pointerdown", Je, !0), window[t]("scroll", Ye, !0), window[t]("resize", Ye);
|
|
209
210
|
}
|
|
210
|
-
return ce(
|
|
211
|
-
if (
|
|
211
|
+
return ce(E, async (e) => {
|
|
212
|
+
if (Xe(e), !e) return;
|
|
212
213
|
P.value = "";
|
|
213
|
-
let t = H.value.findIndex((e) => e.name ===
|
|
214
|
-
F.value = t >= 0 ? t :
|
|
214
|
+
let t = H.value.findIndex((e) => e.name === T.value);
|
|
215
|
+
F.value = t >= 0 ? t : Y(), await h(), Z(), (w.searchable ? ze.value : N.value)?.focus(), X();
|
|
215
216
|
}), ce(P, () => {
|
|
216
|
-
F.value =
|
|
217
|
-
}), ne(() =>
|
|
218
|
-
class:
|
|
217
|
+
F.value = Y(), h(Z);
|
|
218
|
+
}), ne(() => Xe(!1)), m({ focus: () => j.value?.focus() }), (e, t) => (_(), l("div", {
|
|
219
|
+
class: g(["min-w-0", z.value ? "inline-flex" : "flex w-full"]),
|
|
219
220
|
"data-ac-ds": "",
|
|
220
221
|
"data-testid": "ac-cluster-switcher"
|
|
221
|
-
}, [
|
|
222
|
+
}, [p.loading ? (_(), l("div", {
|
|
222
223
|
key: 0,
|
|
223
224
|
role: "status",
|
|
224
225
|
"aria-label": "Loading clusters",
|
|
225
|
-
class:
|
|
226
|
+
class: g(["flex h-10 items-center rounded-10 border", [z.value ? "size-10 justify-center" : "w-full gap-2.5 px-2", B.value ? "border-white/10" : "border-border"]]),
|
|
226
227
|
"data-ac-ds": "",
|
|
227
228
|
"data-testid": "ac-cluster-switcher-loading"
|
|
228
|
-
}, [
|
|
229
|
+
}, [f(n, {
|
|
229
230
|
shape: "rect",
|
|
230
231
|
width: "28px",
|
|
231
232
|
height: "28px",
|
|
232
233
|
label: "",
|
|
233
234
|
class: "shrink-0"
|
|
234
|
-
}), z.value ?
|
|
235
|
+
}), z.value ? c("", !0) : (_(), s(n, {
|
|
235
236
|
key: 0,
|
|
236
237
|
shape: "text",
|
|
237
238
|
width: "60%",
|
|
238
239
|
height: "10px",
|
|
239
240
|
label: ""
|
|
240
|
-
}))], 2)) : (
|
|
241
|
+
}))], 2)) : (_(), l("button", {
|
|
241
242
|
key: 1,
|
|
242
|
-
id: `${
|
|
243
|
+
id: `${x(O)}-trigger`,
|
|
243
244
|
ref_key: "trigger",
|
|
244
245
|
ref: j,
|
|
245
246
|
type: "button",
|
|
246
247
|
"aria-haspopup": "dialog",
|
|
247
|
-
"aria-expanded":
|
|
248
|
-
"aria-controls":
|
|
249
|
-
"aria-label":
|
|
248
|
+
"aria-expanded": E.value,
|
|
249
|
+
"aria-controls": E.value ? k : void 0,
|
|
250
|
+
"aria-label": Be.value,
|
|
250
251
|
title: z.value && V.value ? U(V.value) : void 0,
|
|
251
|
-
disabled:
|
|
252
|
-
class:
|
|
252
|
+
disabled: p.disabled,
|
|
253
|
+
class: g(["group relative flex h-10 min-w-0 cursor-pointer items-center rounded-10 border text-left transition-[color,background-color,border-color,box-shadow] duration-200 disabled:cursor-not-allowed disabled:opacity-50", [
|
|
253
254
|
z.value ? "size-10 justify-center" : "w-full gap-2.5 pr-2.5 pl-1.5",
|
|
254
255
|
B.value ? "border-white/10 bg-white/4 enabled:hover:bg-white/8 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" : "border-border bg-background enabled:hover:border-accent-active focus-visible:focus-ring",
|
|
255
|
-
|
|
256
|
+
E.value && (B.value ? "bg-white/8" : "focus-ring")
|
|
256
257
|
]]),
|
|
257
258
|
"data-ac-ds": "",
|
|
258
259
|
"data-testid": "ac-cluster-switcher-trigger",
|
|
259
|
-
onClick:
|
|
260
|
-
onKeydown:
|
|
261
|
-
}, [
|
|
260
|
+
onClick: t[1] ||= (e) => E.value ? $() : Q(),
|
|
261
|
+
onKeydown: We
|
|
262
|
+
}, [u("span", ge, [K(V.value?.provider) ? (_(), l("img", {
|
|
262
263
|
key: 0,
|
|
263
264
|
src: K(V.value?.provider),
|
|
264
265
|
alt: "",
|
|
265
266
|
class: "size-5 object-contain",
|
|
266
|
-
onError:
|
|
267
|
-
}, null, 40,
|
|
267
|
+
onError: t[0] ||= (e) => q(V.value?.provider)
|
|
268
|
+
}, null, 40, _e)) : (_(), s(x(C), {
|
|
268
269
|
key: 1,
|
|
269
270
|
class: "size-4 text-muted"
|
|
270
|
-
})), V.value ? (
|
|
271
|
+
})), V.value ? (_(), l("span", {
|
|
271
272
|
key: 2,
|
|
272
|
-
class:
|
|
273
|
-
}, null, 2)) :
|
|
273
|
+
class: g(["absolute -right-0.5 -bottom-0.5 size-2.5 rounded-full ring-2", [Ie[G(V.value.status)], B.value ? "ring-sidebar" : "ring-surface"]])
|
|
274
|
+
}, null, 2)) : c("", !0)]), z.value ? c("", !0) : (_(), l(r, { key: 0 }, [u("span", ve, [u("span", { class: g(["block truncate text-base leading-5 font-medium", V.value ? "text-heading" : "text-muted"]) }, b(V.value ? U(V.value) : p.placeholder), 3), V.value?.location ? (_(), l("span", ye, b(V.value.location), 1)) : c("", !0)]), f(x(fe), {
|
|
274
275
|
class: "size-4 shrink-0 text-muted transition-colors group-hover:text-heading",
|
|
275
276
|
"aria-hidden": "true"
|
|
276
|
-
})], 64))], 42,
|
|
277
|
+
})], 64))], 42, he)), (_(), s(i, { to: "body" }, [f(a, {
|
|
277
278
|
"enter-active-class": "transition duration-150 ease-out",
|
|
278
279
|
"enter-from-class": `opacity-0 motion-safe:scale-[0.98] ${z.value ? "motion-safe:-translate-x-1" : R.value ? "motion-safe:-translate-y-1" : "motion-safe:translate-y-1"}`,
|
|
279
280
|
"leave-active-class": "transition duration-100 ease-in",
|
|
280
281
|
"leave-to-class": "opacity-0"
|
|
281
282
|
}, {
|
|
282
|
-
default:
|
|
283
|
+
default: S(() => [E.value ? (_(), l("div", {
|
|
283
284
|
key: 0,
|
|
284
285
|
id: k,
|
|
285
286
|
ref_key: "panel",
|
|
286
287
|
ref: M,
|
|
287
288
|
role: "dialog",
|
|
288
289
|
"aria-label": "Switch cluster",
|
|
289
|
-
class:
|
|
290
|
+
class: g(["fixed z-[90] flex max-w-[calc(100vw-16px)] flex-col overflow-hidden rounded-14 border border-border bg-surface shadow-lg", z.value ? "origin-left" : R.value ? "origin-top" : "origin-bottom"]),
|
|
290
291
|
style: te(L.value),
|
|
291
292
|
"data-ac-ds": "",
|
|
292
293
|
"data-testid": "ac-cluster-switcher-panel",
|
|
293
294
|
onKeydown: Ke
|
|
294
295
|
}, [
|
|
295
|
-
|
|
296
|
+
p.searchable ? (_(), l("div", be, [u("div", xe, [f(x(me), {
|
|
296
297
|
class: "pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted",
|
|
297
298
|
"aria-hidden": "true"
|
|
298
|
-
}),
|
|
299
|
+
}), le(u("input", {
|
|
299
300
|
ref_key: "searchInput",
|
|
300
|
-
ref:
|
|
301
|
-
"onUpdate:modelValue":
|
|
301
|
+
ref: ze,
|
|
302
|
+
"onUpdate:modelValue": t[2] ||= (e) => P.value = e,
|
|
302
303
|
type: "text",
|
|
303
304
|
role: "combobox",
|
|
304
305
|
"aria-autocomplete": "list",
|
|
305
306
|
"aria-expanded": "true",
|
|
306
307
|
"aria-controls": A,
|
|
307
|
-
"aria-activedescendant": F.value >= 0 ?
|
|
308
|
-
"aria-label":
|
|
309
|
-
placeholder:
|
|
308
|
+
"aria-activedescendant": F.value >= 0 ? J(F.value) : void 0,
|
|
309
|
+
"aria-label": p.searchPlaceholder,
|
|
310
|
+
placeholder: p.searchPlaceholder,
|
|
310
311
|
autocomplete: "off",
|
|
311
312
|
spellcheck: "false",
|
|
312
313
|
class: "h-9 w-full rounded-10 border border-border bg-background pr-3 pl-9 text-base text-heading outline-none transition-[border-color,box-shadow] duration-200 placeholder:text-muted/80 hover:border-accent-active focus:focus-ring",
|
|
313
314
|
"data-ac-ds": "",
|
|
314
315
|
"data-testid": "ac-cluster-switcher-search",
|
|
315
|
-
onKeydown:
|
|
316
|
-
}, null, 40,
|
|
317
|
-
|
|
316
|
+
onKeydown: Ge
|
|
317
|
+
}, null, 40, Se), [[se, P.value]])])])) : c("", !0),
|
|
318
|
+
u("ul", {
|
|
318
319
|
id: A,
|
|
319
320
|
ref_key: "listEl",
|
|
320
321
|
ref: N,
|
|
321
322
|
role: "listbox",
|
|
322
323
|
"aria-label": "Clusters",
|
|
323
|
-
tabindex:
|
|
324
|
-
"aria-activedescendant": !
|
|
324
|
+
tabindex: p.searchable ? -1 : 0,
|
|
325
|
+
"aria-activedescendant": !p.searchable && F.value >= 0 ? J(F.value) : void 0,
|
|
325
326
|
class: "ac-scrollbar max-h-72 min-h-0 flex-1 p-2 outline-none",
|
|
326
|
-
onKeydown:
|
|
327
|
-
}, [(
|
|
328
|
-
id:
|
|
329
|
-
key:
|
|
327
|
+
onKeydown: Ge
|
|
328
|
+
}, [(_(!0), l(r, null, re(H.value, (n, r) => (_(), l("li", {
|
|
329
|
+
id: J(r),
|
|
330
|
+
key: n.name,
|
|
330
331
|
role: "option",
|
|
331
|
-
"aria-selected":
|
|
332
|
-
"aria-disabled": W(
|
|
333
|
-
class:
|
|
332
|
+
"aria-selected": n.name === T.value,
|
|
333
|
+
"aria-disabled": W(n) || void 0,
|
|
334
|
+
class: g(["flex items-center gap-2.5 rounded-8 px-2.5 py-2 transition-colors duration-75", [W(n) ? "cursor-not-allowed opacity-50" : "cursor-pointer", r === F.value ? "bg-accent-hover" : n.name === T.value && "bg-accent"]]),
|
|
334
335
|
"data-ac-ds": "",
|
|
335
336
|
"data-testid": "ac-cluster-switcher-option",
|
|
336
|
-
onMouseenter: (e) => !W(
|
|
337
|
-
onMousedown:
|
|
338
|
-
onClick: (e) =>
|
|
339
|
-
}, [
|
|
340
|
-
cluster:
|
|
341
|
-
selected:
|
|
342
|
-
active:
|
|
337
|
+
onMouseenter: (e) => !W(n) && (F.value = r),
|
|
338
|
+
onMousedown: t[3] ||= ue(() => {}, ["prevent"]),
|
|
339
|
+
onClick: (e) => He(n)
|
|
340
|
+
}, [y(e.$slots, "option", {
|
|
341
|
+
cluster: n,
|
|
342
|
+
selected: n.name === T.value,
|
|
343
|
+
active: r === F.value
|
|
343
344
|
}, () => [
|
|
344
|
-
|
|
345
|
+
u("span", Te, [K(n.provider) ? (_(), l("img", {
|
|
345
346
|
key: 0,
|
|
346
|
-
src: K(
|
|
347
|
+
src: K(n.provider),
|
|
347
348
|
alt: "",
|
|
348
349
|
class: "size-5 object-contain",
|
|
349
|
-
onError: (e) =>
|
|
350
|
-
}, null, 40,
|
|
350
|
+
onError: (e) => q(n.provider)
|
|
351
|
+
}, null, 40, Ee)) : (_(), s(x(C), {
|
|
351
352
|
key: 1,
|
|
352
353
|
class: "size-4 text-muted"
|
|
353
354
|
}))]),
|
|
354
|
-
|
|
355
|
-
|
|
355
|
+
u("span", De, [u("span", Oe, b(U(n)), 1), u("span", ke, [
|
|
356
|
+
n.status ? (_(), l("span", {
|
|
356
357
|
key: 0,
|
|
357
|
-
class:
|
|
358
|
-
}, [
|
|
359
|
-
class:
|
|
358
|
+
class: g(["inline-flex shrink-0 items-center gap-1", Le[G(n.status)]])
|
|
359
|
+
}, [u("span", {
|
|
360
|
+
class: g(["size-1.5 rounded-full", Ie[G(n.status)]]),
|
|
360
361
|
"aria-hidden": "true"
|
|
361
|
-
}, null, 2),
|
|
362
|
-
|
|
363
|
-
|
|
362
|
+
}, null, 2), d(" " + b(n.status), 1)], 2)) : c("", !0),
|
|
363
|
+
n.status && (n.location || n.provider) ? (_(), l("span", Ae, "·")) : c("", !0),
|
|
364
|
+
u("span", je, b([n.provider, n.location].filter(Boolean).join(" · ")), 1)
|
|
364
365
|
])]),
|
|
365
|
-
|
|
366
|
+
n.name === T.value ? (_(), s(x(de), {
|
|
366
367
|
key: 0,
|
|
367
368
|
class: "size-4 shrink-0 text-primary-strong",
|
|
368
369
|
"aria-hidden": "true"
|
|
369
|
-
})) :
|
|
370
|
-
])], 42,
|
|
371
|
-
e.$slots.footer ||
|
|
372
|
-
href:
|
|
373
|
-
type:
|
|
370
|
+
})) : c("", !0)
|
|
371
|
+
])], 42, we))), 128)), H.value.length ? c("", !0) : (_(), l("li", Me, [y(e.$slots, "empty", { query: P.value }, () => [d(b(P.value ? `No clusters match “${P.value}”` : "No clusters yet"), 1)])]))], 40, Ce),
|
|
372
|
+
e.$slots.footer || p.importLabel ? (_(), l("div", Ne, [y(e.$slots, "footer", { close: $ }, () => [(_(), s(ie(p.importUrl ? "a" : "button"), {
|
|
373
|
+
href: p.importUrl || void 0,
|
|
374
|
+
type: p.importUrl ? void 0 : "button",
|
|
374
375
|
class: "flex min-h-9 w-full cursor-pointer items-center gap-2.5 rounded-8 px-3 py-2 text-base font-medium text-heading no-underline outline-none transition-colors duration-150 hover:bg-accent-hover focus-visible:bg-accent-hover focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",
|
|
375
376
|
"data-ac-ds": "",
|
|
376
377
|
"data-testid": "ac-cluster-switcher-import",
|
|
377
|
-
onClick:
|
|
378
|
+
onClick: Ue
|
|
378
379
|
}, {
|
|
379
|
-
default:
|
|
380
|
+
default: S(() => [f(x(pe), {
|
|
380
381
|
class: "size-4 shrink-0 text-muted",
|
|
381
382
|
"aria-hidden": "true"
|
|
382
|
-
}),
|
|
383
|
+
}), d(" " + b(p.importLabel), 1)]),
|
|
383
384
|
_: 1
|
|
384
|
-
}, 8, ["href", "type"]))])])) :
|
|
385
|
-
], 38)) :
|
|
385
|
+
}, 8, ["href", "type"]))])])) : c("", !0)
|
|
386
|
+
], 38)) : c("", !0)]),
|
|
386
387
|
_: 3
|
|
387
388
|
}, 8, ["enter-from-class"])]))], 2));
|
|
388
389
|
}
|
|
389
390
|
});
|
|
390
391
|
//#endregion
|
|
391
|
-
export {
|
|
392
|
+
export { Pe as default };
|
|
@@ -47,8 +47,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
47
47
|
disabled: boolean;
|
|
48
48
|
name: string;
|
|
49
49
|
size: "small" | "normal";
|
|
50
|
-
readonly: boolean;
|
|
51
50
|
hint: string;
|
|
51
|
+
readonly: boolean;
|
|
52
52
|
errorMsg: string;
|
|
53
53
|
presets: (string | ColorPreset)[];
|
|
54
54
|
swatchOnly: boolean;
|
|
@@ -45,8 +45,22 @@ export interface Props {
|
|
|
45
45
|
size?: "small" | "normal";
|
|
46
46
|
/** Adds a hidden input with this name so plain form posts include the value. A range posts as `start/end`. */
|
|
47
47
|
name?: string;
|
|
48
|
+
/** Draws the calendar in place, with no field, popover or border. In `date` mode each click updates `v-model` at once, and there's no Today button. */
|
|
49
|
+
inline?: boolean;
|
|
50
|
+
/** Saves each pick in `datetime` mode at once, with no Apply or Cancel; the popover stays open so the time can be set too. An empty value starts at the current time. */
|
|
51
|
+
autoApply?: boolean;
|
|
52
|
+
/** `24` shows 00–23 on the Time tab; `12` shows 1–12 with an AM/PM column, and the field reads `07:30 PM`. `v-model` is unchanged. Cloud `hour12`. */
|
|
53
|
+
hourCycle?: 12 | 24;
|
|
54
|
+
/** Shows the time-zone name in the field text and under the Time tab, e.g. `GMT+6`. */
|
|
55
|
+
showTimeZone?: boolean;
|
|
48
56
|
}
|
|
49
57
|
type __VLS_Props = Props;
|
|
58
|
+
type __VLS_Slots = {
|
|
59
|
+
/** Content before the label text, such as a 14px icon. */
|
|
60
|
+
"label-icon"?: () => unknown;
|
|
61
|
+
/** Content after the label text, such as "(Optional)" or an info tooltip. */
|
|
62
|
+
"label-extra"?: () => unknown;
|
|
63
|
+
};
|
|
50
64
|
type __VLS_ModelProps = {
|
|
51
65
|
/** `date`: `"2026-09-30"`. `datetime`: `"2026-09-30T14:05:00Z"` (UTC). `duration`: `"26h30m"`. With `range`: `[start, end]`. `null` when empty. */
|
|
52
66
|
modelValue?: string | [string, string] | null;
|
|
@@ -54,9 +68,9 @@ type __VLS_ModelProps = {
|
|
|
54
68
|
"open"?: boolean;
|
|
55
69
|
};
|
|
56
70
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
57
|
-
declare const
|
|
58
|
-
/** Moves focus to the field
|
|
59
|
-
focus: () => void
|
|
71
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
72
|
+
/** Moves focus to the field, or to the calendar's current day when `inline`. */
|
|
73
|
+
focus: () => void;
|
|
60
74
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
61
75
|
"update:modelValue": (value: string | [string, string] | null) => any;
|
|
62
76
|
"update:open": (value: boolean) => any;
|
|
@@ -71,6 +85,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
71
85
|
mode: "date" | "datetime" | "duration";
|
|
72
86
|
size: "small" | "normal";
|
|
73
87
|
hint: string;
|
|
88
|
+
inline: boolean;
|
|
74
89
|
placeholder: string;
|
|
75
90
|
range: boolean;
|
|
76
91
|
clearable: boolean;
|
|
@@ -83,6 +98,15 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
83
98
|
timeZone: string;
|
|
84
99
|
weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
85
100
|
showSeconds: boolean;
|
|
101
|
+
autoApply: boolean;
|
|
102
|
+
hourCycle: 12 | 24;
|
|
103
|
+
showTimeZone: boolean;
|
|
86
104
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
105
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
87
106
|
declare const _default: typeof __VLS_export;
|
|
88
107
|
export default _default;
|
|
108
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
109
|
+
new (): {
|
|
110
|
+
$slots: S;
|
|
111
|
+
};
|
|
112
|
+
};
|