@ac-design/design-system 2.2.1 → 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.
- package/dist/lib/compat.css +421 -0
- 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 +25 -13
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +122 -71
- 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/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 +4 -4
- 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 +41 -10
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +554 -446
- 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/AcErrorState.vue.d.ts +1 -1
- 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/AcHeader.vue.d.ts +1 -1
- package/dist/lib/components/AcInput.vue.d.ts +86 -44
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +319 -86
- 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/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/AcMapChart.vue.d.ts +2 -2
- package/dist/lib/components/AcModal.vue.d.ts +1 -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.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.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 +46 -6
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +309 -197
- package/dist/lib/components/AcSidePanel.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 +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 +50 -5
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +257 -129
- package/dist/lib/components/AcTagInput.vue.d.ts +23 -4
- 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 +64 -4
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +159 -68
- 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 +36 -11
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +232 -168
- package/dist/lib/components/AcTooltip.vue.d.ts +3 -3
- package/dist/lib/components/AcUserMenu.vue.d.ts +8 -0
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +126 -109
- package/dist/lib/components/index.d.ts +2 -0
- package/dist/lib/components/types.d.ts +2 -0
- package/dist/lib/composables/useToast.d.ts +2 -2
- package/dist/lib/index.d.ts +2 -1
- package/dist/lib/index.js +51 -49
- package/package.json +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Comment as e, Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o,
|
|
1
|
+
import { Comment as e, Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, defineComponent as c, normalizeClass as l, openBlock as u, renderSlot as d, resolveDynamicComponent as f, toDisplayString as p, useSlots as m, withCtx as h } from "vue";
|
|
2
2
|
//#region src/lib/components/AcCard.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var
|
|
3
|
+
var g = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "pointer-events-none absolute inset-0 -z-10 overflow-hidden rounded-[inherit]",
|
|
6
6
|
"aria-hidden": "true"
|
|
7
|
-
},
|
|
7
|
+
}, _ = { class: "min-w-0 flex-1" }, v = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "mt-0.5 text-xs leading-4 text-muted"
|
|
10
|
-
},
|
|
10
|
+
}, y = {
|
|
11
11
|
key: 1,
|
|
12
12
|
class: "mt-0.5 text-xs leading-4 text-muted"
|
|
13
|
-
},
|
|
13
|
+
}, b = {
|
|
14
14
|
key: 1,
|
|
15
15
|
class: "flex shrink-0 flex-wrap items-center gap-2"
|
|
16
|
-
},
|
|
16
|
+
}, x = /*@__PURE__*/ c({
|
|
17
17
|
__name: "AcCard",
|
|
18
18
|
props: {
|
|
19
19
|
title: { default: "" },
|
|
@@ -28,6 +28,11 @@ var h = {
|
|
|
28
28
|
variant: { default: "default" },
|
|
29
29
|
color: { default: "primary" },
|
|
30
30
|
headerSize: { default: "normal" },
|
|
31
|
+
titleTag: { default: "h3" },
|
|
32
|
+
bare: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: !1
|
|
35
|
+
},
|
|
31
36
|
hoverable: {
|
|
32
37
|
type: Boolean,
|
|
33
38
|
default: !1
|
|
@@ -42,12 +47,17 @@ var h = {
|
|
|
42
47
|
},
|
|
43
48
|
as: { default: "section" }
|
|
44
49
|
},
|
|
45
|
-
setup(
|
|
46
|
-
let
|
|
50
|
+
setup(c) {
|
|
51
|
+
let x = c, S = m(), C = {
|
|
47
52
|
default: "border-border bg-surface",
|
|
48
53
|
muted: "border-border bg-surface-sunken/40",
|
|
49
54
|
dashed: "border-dashed border-border bg-transparent",
|
|
50
55
|
danger: "border-danger/30 bg-danger/5"
|
|
56
|
+
}, w = {
|
|
57
|
+
default: "border-border [:where(&)]:bg-surface",
|
|
58
|
+
muted: "border-border [:where(&)]:bg-surface-sunken/40",
|
|
59
|
+
dashed: "border-dashed border-border [:where(&)]:bg-transparent",
|
|
60
|
+
danger: "border-danger/30 [:where(&)]:bg-danger/5"
|
|
51
61
|
}, T = {
|
|
52
62
|
none: "",
|
|
53
63
|
xs: "p-3",
|
|
@@ -113,77 +123,115 @@ var h = {
|
|
|
113
123
|
washSm: "from-warning/[0.07]",
|
|
114
124
|
watermark: "text-warning/5"
|
|
115
125
|
}
|
|
116
|
-
}, A = n(() =>
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
126
|
+
}, A = n(() => x.headerSize === "bar"), j = n(() => x.headerSize === "small" || A.value), M = n(() => k[x.color]), N = n(() => x.description || x.subtitle), P = n(() => [
|
|
127
|
+
C[x.variant],
|
|
128
|
+
x.as !== "section" && "w-full text-left no-underline outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
129
|
+
x.hoverable && "cursor-pointer hover:border-primary/30 hover:bg-accent-hover/60",
|
|
130
|
+
x.shadow && "shadow-xs hover:shadow-card",
|
|
131
|
+
x.hoverable && x.shadow && "hover:-translate-y-0.5 motion-reduce:hover:translate-y-0"
|
|
122
132
|
]);
|
|
123
|
-
function
|
|
124
|
-
return !!(
|
|
125
|
-
}
|
|
126
|
-
function F(n) {
|
|
127
|
-
return n.some((n) => n.type === e ? !1 : n.type !== t || F(n.children));
|
|
133
|
+
function F() {
|
|
134
|
+
return !!(x.title || N.value || x.icon || S.icon || S.actions || S.badges || S.description);
|
|
128
135
|
}
|
|
129
136
|
function I() {
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
function L() {
|
|
133
|
-
let e = I(), t = S.padding;
|
|
137
|
+
let e = x.padding ?? (x.padded ? "md" : "none"), t = x.as !== "section" && x.as !== "div";
|
|
134
138
|
return [
|
|
139
|
+
w[x.variant],
|
|
140
|
+
T[e],
|
|
141
|
+
t && "block no-underline outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
142
|
+
x.hoverable && "cursor-pointer hover:border-primary/30 hover:bg-accent-hover/60",
|
|
143
|
+
x.shadow && "shadow-xs hover:shadow-card",
|
|
144
|
+
x.hoverable && x.shadow && "hover:-translate-y-0.5 motion-reduce:hover:translate-y-0"
|
|
145
|
+
];
|
|
146
|
+
}
|
|
147
|
+
function L(n) {
|
|
148
|
+
return n.some((n) => n.type === e ? !1 : n.type !== t || L(n.children));
|
|
149
|
+
}
|
|
150
|
+
function R() {
|
|
151
|
+
return L(S.default?.() ?? []);
|
|
152
|
+
}
|
|
153
|
+
function z() {
|
|
154
|
+
let e = R(), t = x.padding;
|
|
155
|
+
return A.value ? [
|
|
156
|
+
"items-center gap-2.5 px-4 py-2.5",
|
|
157
|
+
e && "border-b border-border",
|
|
158
|
+
!e && !S.footer && "rounded-b-[calc(var(--radius-14)-1px)]",
|
|
159
|
+
x.accent && ["bg-linear-to-r to-transparent", M.value.washSm]
|
|
160
|
+
] : [
|
|
135
161
|
t ? [
|
|
136
162
|
"items-start gap-3",
|
|
137
163
|
E[t],
|
|
138
164
|
D[t],
|
|
139
|
-
!
|
|
140
|
-
] :
|
|
165
|
+
!j.value && "border-border/60"
|
|
166
|
+
] : j.value ? "items-start gap-3 px-5 pt-5" : "items-start gap-3 border-border/60 px-6 pt-5",
|
|
141
167
|
!e && (t ? O[t] : "pb-5"),
|
|
142
|
-
e && !
|
|
143
|
-
!e && !
|
|
144
|
-
|
|
168
|
+
e && !j.value && "border-b pb-3",
|
|
169
|
+
!e && !S.footer && "rounded-b-[calc(var(--radius-14)-1px)]",
|
|
170
|
+
x.accent && (j.value ? ["bg-linear-to-r to-transparent", M.value.washSm] : ["bg-linear-to-br to-transparent", M.value.wash])
|
|
145
171
|
];
|
|
146
172
|
}
|
|
147
|
-
function
|
|
148
|
-
return
|
|
173
|
+
function B() {
|
|
174
|
+
return x.padding && x.padding !== "none" ? T[x.padding] : x.padded && x.padding !== "none" ? j.value ? "p-5" : "p-6" : [
|
|
149
175
|
"overflow-hidden",
|
|
150
|
-
!
|
|
151
|
-
!
|
|
176
|
+
!S.footer && "rounded-b-14",
|
|
177
|
+
!F() && "rounded-t-14"
|
|
152
178
|
];
|
|
153
179
|
}
|
|
154
|
-
return (e, t) => (
|
|
155
|
-
|
|
180
|
+
return (e, t) => c.bare ? (u(), r(f(c.as), {
|
|
181
|
+
key: 0,
|
|
182
|
+
class: l(["rounded-14 border text-body transition-[background-color,border-color,box-shadow,translate] duration-200 ease-out motion-reduce:transition-none", I()]),
|
|
156
183
|
"data-ac-ds": "",
|
|
157
184
|
"data-testid": "ac-card"
|
|
158
185
|
}, {
|
|
159
|
-
default:
|
|
160
|
-
|
|
186
|
+
default: h(() => [d(e.$slots, "default")]),
|
|
187
|
+
_: 3
|
|
188
|
+
}, 8, ["class"])) : (u(), r(f(c.as), {
|
|
189
|
+
key: 1,
|
|
190
|
+
class: l(["flex flex-col rounded-14 border text-body transition-[background-color,border-color,box-shadow,translate] duration-200 ease-out motion-reduce:transition-none", P.value]),
|
|
191
|
+
"data-ac-ds": "",
|
|
192
|
+
"data-testid": "ac-card"
|
|
193
|
+
}, {
|
|
194
|
+
default: h(() => [
|
|
195
|
+
F() ? (u(), a("header", {
|
|
161
196
|
key: 0,
|
|
162
|
-
class:
|
|
197
|
+
class: l(["relative isolate flex flex-wrap justify-between rounded-t-[calc(var(--radius-14)-1px)]", z()])
|
|
163
198
|
}, [
|
|
164
|
-
|
|
165
|
-
|
|
199
|
+
c.accent && (c.icon || e.$slots.icon) && !j.value ? (u(), a("div", g, [c.icon ? (u(), r(f(c.icon), {
|
|
200
|
+
key: 0,
|
|
201
|
+
class: l(["absolute -top-4 -right-4 size-24", M.value.watermark])
|
|
202
|
+
}, null, 8, ["class"])) : (u(), a("span", {
|
|
203
|
+
key: 1,
|
|
204
|
+
class: l(["absolute -top-4 -right-4 [&_svg]:size-24!", M.value.watermark])
|
|
205
|
+
}, [d(e.$slots, "icon")], 2))])) : i("", !0),
|
|
206
|
+
o("div", { class: l(["flex min-w-0 flex-1 items-center", A.value ? "gap-2.5" : "gap-3"]) }, [c.icon || e.$slots.icon ? (u(), a("span", {
|
|
166
207
|
key: 0,
|
|
167
|
-
class:
|
|
208
|
+
class: l(["flex shrink-0 items-center justify-center", [
|
|
209
|
+
M.value.tile,
|
|
210
|
+
j.value ? ["size-7 rounded-8 ring-1 ring-inset", M.value.ring] : ["size-8 rounded-10 border", M.value.border],
|
|
211
|
+
c.headerSize === "small" ? "[:where(&)_svg]:size-3.5" : "[:where(&)_svg]:size-4"
|
|
212
|
+
]]),
|
|
168
213
|
"aria-hidden": "true"
|
|
169
|
-
}, [
|
|
214
|
+
}, [d(e.$slots, "icon", {}, () => [(u(), r(f(c.icon), { class: l(c.headerSize === "small" ? "size-3.5" : "size-4") }, null, 8, ["class"]))])], 2)) : i("", !0), o("div", _, [o("div", { class: l(["flex flex-wrap items-center", A.value ? "gap-2.5" : "gap-2"]) }, [c.title ? (u(), r(f(c.titleTag), {
|
|
170
215
|
key: 0,
|
|
171
|
-
class:
|
|
172
|
-
},
|
|
173
|
-
|
|
216
|
+
class: l(["truncate font-heading font-semibold tracking-tight text-heading", j.value ? "text-base" : "text-lg leading-tight"])
|
|
217
|
+
}, {
|
|
218
|
+
default: h(() => [s(p(c.title), 1)]),
|
|
219
|
+
_: 1
|
|
220
|
+
}, 8, ["class"])) : i("", !0), d(e.$slots, "badges")], 2), e.$slots.description ? (u(), a("div", v, [d(e.$slots, "description")])) : N.value ? (u(), a("p", y, p(N.value), 1)) : i("", !0)])], 2),
|
|
221
|
+
e.$slots.actions ? (u(), a("div", b, [d(e.$slots, "actions")])) : i("", !0)
|
|
174
222
|
], 2)) : i("", !0),
|
|
175
|
-
|
|
223
|
+
R() ? (u(), a("div", {
|
|
176
224
|
key: 1,
|
|
177
|
-
class:
|
|
178
|
-
}, [
|
|
179
|
-
e.$slots.footer ? (
|
|
225
|
+
class: l(["flex-1", B()])
|
|
226
|
+
}, [d(e.$slots, "default")], 2)) : i("", !0),
|
|
227
|
+
e.$slots.footer ? (u(), a("footer", {
|
|
180
228
|
key: 2,
|
|
181
|
-
class:
|
|
182
|
-
}, [
|
|
229
|
+
class: l(["flex flex-wrap items-center gap-3 border-t border-border py-3 text-base text-muted", c.padding ? E[c.padding] : j.value ? "px-5" : "px-6"])
|
|
230
|
+
}, [d(e.$slots, "footer")], 2)) : i("", !0)
|
|
183
231
|
]),
|
|
184
232
|
_: 3
|
|
185
233
|
}, 8, ["class"]));
|
|
186
234
|
}
|
|
187
235
|
});
|
|
188
236
|
//#endregion
|
|
189
|
-
export {
|
|
237
|
+
export { x as default };
|
|
@@ -126,12 +126,12 @@ declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {},
|
|
|
126
126
|
icon: string;
|
|
127
127
|
color: string;
|
|
128
128
|
href: string;
|
|
129
|
-
loading: boolean;
|
|
130
129
|
align: "left" | "center" | "right";
|
|
131
|
-
maxItems: number;
|
|
132
|
-
plain: boolean;
|
|
133
130
|
maxWidth: string;
|
|
134
131
|
tooltip: string;
|
|
132
|
+
loading: boolean;
|
|
133
|
+
maxItems: number;
|
|
134
|
+
plain: boolean;
|
|
135
135
|
column: ResourceColumn;
|
|
136
136
|
emptyText: string;
|
|
137
137
|
cell: ResourceCell;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "./
|
|
3
|
-
import n from "./
|
|
4
|
-
import r from "./
|
|
5
|
-
import i from "./
|
|
1
|
+
import e from "./AcTooltip.js";
|
|
2
|
+
import { statusMeta as t } from "./status.js";
|
|
3
|
+
import n from "./AcBadge.js";
|
|
4
|
+
import r from "./AcModal.js";
|
|
5
|
+
import i from "./AcSkeleton.js";
|
|
6
6
|
import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as ee, defineAsyncComponent as te, defineComponent as f, getCurrentInstance as ne, h as re, mergeProps as p, nextTick as ie, normalizeClass as m, normalizeStyle as ae, onBeforeUnmount as oe, onMounted as se, openBlock as h, ref as g, renderList as ce, resolveDynamicComponent as _, toDisplayString as v, unref as y, watch as b, withCtx as x, withModifiers as S } from "vue";
|
|
7
7
|
import { Braces as le, Check as ue, LoaderCircle as de, Minus as fe, Tag as pe } from "@lucide/vue";
|
|
8
8
|
//#region src/lib/components/AcCellValue.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -112,7 +112,7 @@ var A = /*@__PURE__*/ f({
|
|
|
112
112
|
timeStyle: "long"
|
|
113
113
|
}), je = te({
|
|
114
114
|
loader: () => import("../editor/index.js").then((e) => e.AcCodeEditor),
|
|
115
|
-
loadingComponent: () => re(
|
|
115
|
+
loadingComponent: () => re(i, {
|
|
116
116
|
shape: "editor",
|
|
117
117
|
height: "240px"
|
|
118
118
|
}),
|
|
@@ -127,7 +127,7 @@ var A = /*@__PURE__*/ f({
|
|
|
127
127
|
} : B.value === "a" ? { href: z.value } : { to: z.value } : null), H = o(() => {
|
|
128
128
|
let e = (w.color || w.cell?.color || "").trim().split(/\s+/)[0].replace(/^is-/, "");
|
|
129
129
|
return e ? D[e] ?? "default" : void 0;
|
|
130
|
-
}), U = o(() => G.value === "status" ?
|
|
130
|
+
}), U = o(() => G.value === "status" ? t(String(F.value)) : null), W = o(() => !!U.value?.transient), Le = o(() => H.value ? H.value : U.value ? W.value ? "primary" : U.value.tone : null), Re = o(() => !H.value && !!U.value?.hollow), G = o(() => {
|
|
131
131
|
let e = F.value;
|
|
132
132
|
if (Ke(e)) return "empty";
|
|
133
133
|
if (w.color || w.cell?.color) return "status";
|
|
@@ -229,7 +229,7 @@ var A = /*@__PURE__*/ f({
|
|
|
229
229
|
G.value === "date" && Te();
|
|
230
230
|
}), oe(() => {
|
|
231
231
|
G.value === "date" && E(), j.value && k(j.value);
|
|
232
|
-
}), (
|
|
232
|
+
}), (t, o) => (h(), l("span", {
|
|
233
233
|
class: m(["max-w-full min-w-0 items-center gap-1.5 align-middle", [
|
|
234
234
|
R.value ? "flex w-full" : "inline-flex",
|
|
235
235
|
R.value === "center" && "justify-center",
|
|
@@ -238,7 +238,7 @@ var A = /*@__PURE__*/ f({
|
|
|
238
238
|
]]),
|
|
239
239
|
"data-ac-ds": "",
|
|
240
240
|
"data-testid": "ac-cell-value"
|
|
241
|
-
}, [f.loading ? (h(), s(
|
|
241
|
+
}, [f.loading ? (h(), s(i, {
|
|
242
242
|
key: 0,
|
|
243
243
|
width: "96px"
|
|
244
244
|
})) : (h(), l(a, { key: 1 }, [
|
|
@@ -263,7 +263,7 @@ var A = /*@__PURE__*/ f({
|
|
|
263
263
|
key: 1,
|
|
264
264
|
class: m(["size-1.5 shrink-0 rounded-full", Re.value ? "border border-muted bg-transparent" : Q.value[0]]),
|
|
265
265
|
"aria-hidden": "true"
|
|
266
|
-
}, null, 2)), d(v(q.value), 1)], 2)) : (h(), s(
|
|
266
|
+
}, null, 2)), d(v(q.value), 1)], 2)) : (h(), s(n, {
|
|
267
267
|
key: 1,
|
|
268
268
|
status: String(F.value),
|
|
269
269
|
label: q.value,
|
|
@@ -278,7 +278,7 @@ var A = /*@__PURE__*/ f({
|
|
|
278
278
|
"rounded"
|
|
279
279
|
]))]),
|
|
280
280
|
_: 1
|
|
281
|
-
}, 16, ["class"])) : G.value === "status" ? (h(), s(
|
|
281
|
+
}, 16, ["class"])) : G.value === "status" ? (h(), s(e, {
|
|
282
282
|
key: 3,
|
|
283
283
|
content: L.value
|
|
284
284
|
}, {
|
|
@@ -296,7 +296,7 @@ var A = /*@__PURE__*/ f({
|
|
|
296
296
|
key: 1,
|
|
297
297
|
class: m(["size-1.5 shrink-0 rounded-full", Re.value ? "border border-muted bg-transparent" : Q.value[0]]),
|
|
298
298
|
"aria-hidden": "true"
|
|
299
|
-
}, null, 2)), d(v(q.value), 1)], 2)) : (h(), s(
|
|
299
|
+
}, null, 2)), d(v(q.value), 1)], 2)) : (h(), s(n, {
|
|
300
300
|
key: 1,
|
|
301
301
|
status: String(F.value),
|
|
302
302
|
label: q.value,
|
|
@@ -319,7 +319,7 @@ var A = /*@__PURE__*/ f({
|
|
|
319
319
|
key: 1,
|
|
320
320
|
class: "size-3.5 text-muted",
|
|
321
321
|
"aria-hidden": "true"
|
|
322
|
-
})), u("span", { class: m(!$(F.value) && "text-muted") }, v(q.value), 3)])) : G.value === "date" ? (h(), s(
|
|
322
|
+
})), u("span", { class: m(!$(F.value) && "text-muted") }, v(q.value), 3)])) : G.value === "date" ? (h(), s(e, {
|
|
323
323
|
key: 5,
|
|
324
324
|
content: J.value
|
|
325
325
|
}, {
|
|
@@ -340,16 +340,16 @@ var A = /*@__PURE__*/ f({
|
|
|
340
340
|
key: 6,
|
|
341
341
|
class: m(["flex w-max min-w-0 items-center gap-2", M.value ? "flex-wrap" : "flex-nowrap"]),
|
|
342
342
|
style: ae({ maxWidth: f.maxWidth })
|
|
343
|
-
}, [(h(!0), l(a, null, ce(Ve.value, (
|
|
344
|
-
key: `${
|
|
345
|
-
content:
|
|
343
|
+
}, [(h(!0), l(a, null, ce(Ve.value, (t, n) => (h(), s(e, {
|
|
344
|
+
key: `${t.text}-${n}`,
|
|
345
|
+
content: t.text.length > 28 && !M.value ? t.text : "",
|
|
346
346
|
class: m(!M.value && "max-w-48 min-w-0")
|
|
347
347
|
}, {
|
|
348
348
|
default: x(() => [u("span", be, [G.value === "labels" ? (h(), s(y(pe), {
|
|
349
349
|
key: 0,
|
|
350
350
|
class: "size-3 shrink-0",
|
|
351
351
|
"aria-hidden": "true"
|
|
352
|
-
})) : c("", !0), u("span", xe, v(
|
|
352
|
+
})) : c("", !0), u("span", xe, v(t.text), 1)])]),
|
|
353
353
|
_: 2
|
|
354
354
|
}, 1032, ["content", "class"]))), 128)), X.value > 0 ? (h(), l("button", {
|
|
355
355
|
key: 0,
|
|
@@ -358,7 +358,7 @@ var A = /*@__PURE__*/ f({
|
|
|
358
358
|
"aria-expanded": M.value,
|
|
359
359
|
"aria-label": M.value ? `Show fewer ${Ge.value}` : `Show ${X.value} more ${Ge.value}`,
|
|
360
360
|
onClick: o[2] ||= S((e) => M.value = !M.value, ["stop"])
|
|
361
|
-
}, v(M.value ? "Show less" : `+${X.value} more`), 9, Se)) : c("", !0)], 6)) : (h(), s(
|
|
361
|
+
}, v(M.value ? "Show less" : `+${X.value} more`), 9, Se)) : c("", !0)], 6)) : (h(), s(e, {
|
|
362
362
|
key: 7,
|
|
363
363
|
content: ze.value,
|
|
364
364
|
class: "min-w-0"
|
|
@@ -386,7 +386,7 @@ var A = /*@__PURE__*/ f({
|
|
|
386
386
|
}, v(q.value), 15, Ce))]),
|
|
387
387
|
_: 1
|
|
388
388
|
}, 8, ["content"])),
|
|
389
|
-
He.value ? (h(), s(
|
|
389
|
+
He.value ? (h(), s(e, {
|
|
390
390
|
key: 8,
|
|
391
391
|
content: "View as JSON"
|
|
392
392
|
}, {
|
|
@@ -402,7 +402,7 @@ var A = /*@__PURE__*/ f({
|
|
|
402
402
|
})], 8, we)]),
|
|
403
403
|
_: 1
|
|
404
404
|
})) : c("", !0),
|
|
405
|
-
N.value ? (h(), s(
|
|
405
|
+
N.value ? (h(), s(r, {
|
|
406
406
|
key: 9,
|
|
407
407
|
open: P.value,
|
|
408
408
|
"onUpdate:open": o[4] ||= (e) => P.value = e,
|
|
@@ -31,7 +31,10 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
31
31
|
} ? P : {});
|
|
32
32
|
expose: (exposed: {}) => void;
|
|
33
33
|
attrs: any;
|
|
34
|
-
slots: {
|
|
34
|
+
slots: {
|
|
35
|
+
/** Single checkbox: rich content beside the box in place of `label`, e.g. an icon and text. It's the checkbox's accessible name. */
|
|
36
|
+
label?: () => unknown;
|
|
37
|
+
};
|
|
35
38
|
emit: ((event: "update:modelValue", value: T[]) => void) & ((event: "update:checked", value: boolean) => void);
|
|
36
39
|
}>) => import("vue").VNode & {
|
|
37
40
|
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, mergeModels as s, mergeProps as c, nextTick as l, normalizeClass as u, openBlock as d, ref as f, renderList as p,
|
|
2
|
-
import { Check as
|
|
1
|
+
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, mergeModels as s, mergeProps as c, nextTick as l, normalizeClass as u, openBlock as d, ref as f, renderList as p, renderSlot as m, toDisplayString as h, unref as g, useAttrs as _, useId as v, useModel as y, useSlots as b, vModelCheckbox as x, withDirectives as S, withModifiers as C } from "vue";
|
|
2
|
+
import { Check as w, Minus as T } from "@lucide/vue";
|
|
3
3
|
//#region src/lib/components/AcCheckBox.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
4
|
+
var E = { class: "flex flex-col gap-3" }, D = ["for"], O = [
|
|
5
5
|
"id",
|
|
6
6
|
"name",
|
|
7
7
|
"value",
|
|
8
8
|
"disabled"
|
|
9
|
-
],
|
|
9
|
+
], k = { class: "flex min-w-0 flex-col gap-1" }, A = { class: "font-medium" }, j = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "text-xs text-muted"
|
|
12
|
-
},
|
|
12
|
+
}, M = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "mt-1 text-base text-danger-strong",
|
|
15
15
|
role: "alert"
|
|
16
|
-
},
|
|
16
|
+
}, N = [
|
|
17
17
|
"name",
|
|
18
18
|
"checked",
|
|
19
19
|
"indeterminate",
|
|
20
20
|
"disabled",
|
|
21
21
|
"aria-invalid",
|
|
22
22
|
"aria-describedby"
|
|
23
|
-
],
|
|
23
|
+
], P = {
|
|
24
24
|
key: 0,
|
|
25
25
|
class: "flex min-w-0 flex-col gap-1"
|
|
26
|
-
},
|
|
27
|
-
key: 0,
|
|
28
|
-
class: "font-medium"
|
|
29
|
-
}, P = {
|
|
26
|
+
}, F = { key: 0 }, I = {
|
|
30
27
|
key: 1,
|
|
28
|
+
class: "font-medium"
|
|
29
|
+
}, L = {
|
|
30
|
+
key: 2,
|
|
31
31
|
class: "text-xs text-muted"
|
|
32
|
-
},
|
|
32
|
+
}, R = ["id"], z = /*@__PURE__*/ o({
|
|
33
33
|
inheritAttrs: !1,
|
|
34
34
|
__name: "AcCheckBox",
|
|
35
35
|
props: /*@__PURE__*/ s({
|
|
@@ -58,75 +58,75 @@ var w = { class: "flex flex-col gap-3" }, T = ["for"], E = [
|
|
|
58
58
|
}),
|
|
59
59
|
emits: ["update:modelValue", "update:checked"],
|
|
60
60
|
setup(o) {
|
|
61
|
-
let s = o,
|
|
62
|
-
class:
|
|
63
|
-
style:
|
|
64
|
-
}),
|
|
65
|
-
let { class: e, style: t, ...n } =
|
|
66
|
-
return s.label || n["aria-label"] || n["aria-labelledby"] ? n : {
|
|
61
|
+
let s = o, z = y(o, "modelValue"), B = y(o, "checked"), V = b(), H = v(), U = _(), W = f(null), G = t(() => s.size === "small"), K = t(() => s.indeterminate && !B.value), q = t(() => s.options ? U : {
|
|
62
|
+
class: U.class,
|
|
63
|
+
style: U.style
|
|
64
|
+
}), J = t(() => {
|
|
65
|
+
let { class: e, style: t, ...n } = U;
|
|
66
|
+
return s.label || V.label || n["aria-label"] || n["aria-labelledby"] ? n : {
|
|
67
67
|
"aria-label": "Select",
|
|
68
68
|
...n
|
|
69
69
|
};
|
|
70
|
-
}),
|
|
71
|
-
"peer cursor-pointer appearance-none rounded-4 border border-muted/70 transition-colors duration-200 group-hover:enabled:not-checked:not-indeterminate: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:bg-surface-sunken",
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
]),
|
|
75
|
-
async function
|
|
76
|
-
|
|
70
|
+
}), Y = t(() => G.value ? "size-[18px]" : "size-6"), X = t(() => [
|
|
71
|
+
"peer cursor-pointer appearance-none rounded-4 border border-muted/70 transition-colors duration-200 group-hover:enabled:not-checked:not-indeterminate: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:not-checked:not-indeterminate:bg-surface-sunken",
|
|
72
|
+
Y.value,
|
|
73
|
+
G.value ? "bg-background" : "bg-transparent"
|
|
74
|
+
]), Z = t(() => ["pointer-events-none absolute inset-0 m-auto text-white opacity-0 transition-opacity duration-150 motion-reduce:transition-none", G.value ? "size-3.5" : "size-5"]), Q = t(() => ["cursor-not-allowed", G.value ? "opacity-40" : "opacity-50"]);
|
|
75
|
+
async function $(e) {
|
|
76
|
+
B.value = e.target.checked, await l(), W.value && (W.value.checked = B.value, W.value.indeterminate = K.value);
|
|
77
77
|
}
|
|
78
78
|
return (t, s) => o.options ? (d(), r("div", c({
|
|
79
79
|
key: 0,
|
|
80
80
|
"data-ac-ds": "",
|
|
81
81
|
"data-testid": "ac-checkbox"
|
|
82
|
-
},
|
|
82
|
+
}, q.value), [i("div", E, [(d(!0), r(e, null, p(o.options, (e, t) => (d(), r("label", {
|
|
83
83
|
key: e.label,
|
|
84
|
-
for: `${
|
|
85
|
-
class: u(["group inline-flex w-fit cursor-pointer items-start text-base text-heading select-none", [e.disabled &&
|
|
86
|
-
}, [i("span", { class: u(["relative inline-flex shrink-0",
|
|
87
|
-
id: `${
|
|
88
|
-
"onUpdate:modelValue": s[0] ||= (e) =>
|
|
84
|
+
for: `${g(H)}-${t}`,
|
|
85
|
+
class: u(["group inline-flex w-fit cursor-pointer items-start text-base text-heading select-none", [e.disabled && Q.value, G.value ? "gap-2.5" : "gap-3"]])
|
|
86
|
+
}, [i("span", { class: u(["relative inline-flex shrink-0", Y.value]) }, [S(i("input", {
|
|
87
|
+
id: `${g(H)}-${t}`,
|
|
88
|
+
"onUpdate:modelValue": s[0] ||= (e) => z.value = e,
|
|
89
89
|
type: "checkbox",
|
|
90
90
|
name: o.name,
|
|
91
91
|
value: e.value,
|
|
92
92
|
disabled: e.disabled,
|
|
93
|
-
class: u(
|
|
94
|
-
}, null, 10,
|
|
95
|
-
class: u([
|
|
93
|
+
class: u(X.value)
|
|
94
|
+
}, null, 10, O), [[x, z.value]]), a(g(w), {
|
|
95
|
+
class: u([Z.value, "peer-checked:opacity-100"]),
|
|
96
96
|
"aria-hidden": "true"
|
|
97
|
-
}, null, 8, ["class"])], 2), i("span",
|
|
97
|
+
}, null, 8, ["class"])], 2), i("span", k, [i("span", A, h(e.label), 1), e.description ? (d(), r("span", j, h(e.description), 1)) : n("", !0)])], 10, D))), 128))]), o.errorMsg ? (d(), r("p", M, h(o.errorMsg), 1)) : n("", !0)], 16)) : (d(), r("div", c({
|
|
98
98
|
key: 1,
|
|
99
99
|
class: "inline-flex flex-col",
|
|
100
100
|
"data-ac-ds": "",
|
|
101
101
|
"data-testid": "ac-checkbox"
|
|
102
|
-
},
|
|
102
|
+
}, q.value, { onClick: s[1] ||= C(() => {}, ["stop"]) }), [i("label", { class: u(["group inline-flex w-fit cursor-pointer items-start text-base text-heading select-none", [o.disabled && Q.value, G.value ? "gap-2.5" : "gap-3"]]) }, [i("span", { class: u(["relative inline-flex shrink-0", Y.value]) }, [
|
|
103
103
|
i("input", c({
|
|
104
104
|
ref_key: "single",
|
|
105
|
-
ref:
|
|
105
|
+
ref: W,
|
|
106
106
|
type: "checkbox",
|
|
107
107
|
name: o.name,
|
|
108
|
-
checked:
|
|
109
|
-
indeterminate:
|
|
108
|
+
checked: B.value,
|
|
109
|
+
indeterminate: K.value,
|
|
110
110
|
disabled: o.disabled,
|
|
111
111
|
"aria-invalid": o.errorMsg ? !0 : void 0,
|
|
112
|
-
"aria-describedby": o.errorMsg ? `${
|
|
113
|
-
class:
|
|
114
|
-
},
|
|
115
|
-
a(
|
|
116
|
-
class: u([
|
|
112
|
+
"aria-describedby": o.errorMsg ? `${g(H)}-error` : void 0,
|
|
113
|
+
class: X.value
|
|
114
|
+
}, J.value, { onChange: $ }), null, 16, N),
|
|
115
|
+
a(g(w), {
|
|
116
|
+
class: u([Z.value, "peer-checked:opacity-100"]),
|
|
117
117
|
"aria-hidden": "true"
|
|
118
118
|
}, null, 8, ["class"]),
|
|
119
|
-
a(
|
|
120
|
-
class: u([
|
|
119
|
+
a(g(T), {
|
|
120
|
+
class: u([Z.value, "peer-indeterminate:opacity-100"]),
|
|
121
121
|
"aria-hidden": "true"
|
|
122
122
|
}, null, 8, ["class"])
|
|
123
|
-
], 2), o.label || o.description ? (d(), r("span",
|
|
123
|
+
], 2), o.label || t.$slots.label || o.description ? (d(), r("span", P, [t.$slots.label ? (d(), r("span", F, [m(t.$slots, "label")])) : o.label ? (d(), r("span", I, h(o.label), 1)) : n("", !0), o.description ? (d(), r("span", L, h(o.description), 1)) : n("", !0)])) : n("", !0)], 2), o.errorMsg ? (d(), r("p", {
|
|
124
124
|
key: 0,
|
|
125
|
-
id: `${
|
|
125
|
+
id: `${g(H)}-error`,
|
|
126
126
|
class: "mt-1 text-base text-danger-strong",
|
|
127
127
|
role: "alert"
|
|
128
|
-
},
|
|
128
|
+
}, h(o.errorMsg), 9, R)) : n("", !0)], 16));
|
|
129
129
|
}
|
|
130
130
|
});
|
|
131
131
|
//#endregion
|
|
132
|
-
export {
|
|
132
|
+
export { z as default };
|
|
@@ -30,8 +30,8 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
|
|
|
30
30
|
max: number;
|
|
31
31
|
size: "small" | "normal" | "large" | number;
|
|
32
32
|
strokeWidth: number;
|
|
33
|
-
indeterminate: boolean;
|
|
34
33
|
showLabel: boolean;
|
|
34
|
+
indeterminate: boolean;
|
|
35
35
|
valueText: string;
|
|
36
36
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
37
37
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -31,6 +31,14 @@ export interface Props {
|
|
|
31
31
|
label?: string;
|
|
32
32
|
/** Draws the border and rounded corners. Turn off inside a card or modal body that has its own. */
|
|
33
33
|
bordered?: boolean;
|
|
34
|
+
/** Shows `label` above the editor as a form field label, as cloud-ui's editor field. */
|
|
35
|
+
showLabel?: boolean;
|
|
36
|
+
/** Adds a red asterisk after the shown label and sets `aria-required`. */
|
|
37
|
+
required?: boolean;
|
|
38
|
+
/** Error text under the editor, e.g. "Paste a kubeconfig". Sets `aria-invalid` on the text area. */
|
|
39
|
+
errorMsg?: string;
|
|
40
|
+
/** Lists each problem under the editor, with a button that jumps to it. Turn off for cloud-ui's look, where the underlines and gutter marks are the only sign. */
|
|
41
|
+
showProblems?: boolean;
|
|
34
42
|
}
|
|
35
43
|
type __VLS_Props = Props;
|
|
36
44
|
type __VLS_Slots = {
|
|
@@ -63,6 +71,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
63
71
|
"onUpdate:view"?: ((value: "edit" | "changes") => any) | undefined;
|
|
64
72
|
}>, {
|
|
65
73
|
bordered: boolean;
|
|
74
|
+
required: boolean;
|
|
66
75
|
label: string;
|
|
67
76
|
title: string;
|
|
68
77
|
height: string;
|
|
@@ -77,6 +86,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
77
86
|
placeholder: string;
|
|
78
87
|
copyable: boolean;
|
|
79
88
|
diffLayout: "unified" | "split";
|
|
89
|
+
showLabel: boolean;
|
|
90
|
+
errorMsg: string;
|
|
91
|
+
showProblems: boolean;
|
|
80
92
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
81
93
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
82
94
|
declare const _default: typeof __VLS_export;
|