@ac-design/design-system 2.0.0 → 2.1.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/charts/ChartFrame.vue.d.ts +2 -0
- package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +42 -37
- package/dist/lib/charts/cartesian.d.ts +324 -0
- package/dist/lib/charts/cartesian.js +137 -0
- package/dist/lib/charts/echarts.d.ts +86 -0
- package/dist/lib/charts/echarts.js +173 -0
- package/dist/lib/charts/graph.d.ts +77 -0
- package/dist/lib/charts/graph.js +155 -0
- package/dist/lib/charts/index.d.ts +4 -0
- package/dist/lib/charts/index.js +3 -1
- package/dist/lib/charts/shared.d.ts +0 -7
- package/dist/lib/charts/shared.js +1 -19
- package/dist/lib/charts/xy.d.ts +11 -7
- package/dist/lib/charts/xy.js +53 -72
- package/dist/lib/compat.css +1322 -278
- package/dist/lib/components/AcAlert.vue.d.ts +9 -0
- package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +121 -21
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcAreaChart.vue.d.ts +3 -0
- package/dist/lib/components/AcAreaChart.vue_vue_type_script_setup_true_lang.js +132 -142
- package/dist/lib/components/AcAvatar.vue.d.ts +7 -4
- package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +59 -54
- package/dist/lib/components/AcBadge.vue.d.ts +7 -3
- package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +35 -28
- package/dist/lib/components/AcBarChart.vue.d.ts +3 -0
- package/dist/lib/components/AcBarChart.vue_vue_type_script_setup_true_lang.js +142 -146
- package/dist/lib/components/AcBreadcrumb.vue.d.ts +4 -1
- package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +18 -17
- package/dist/lib/components/AcBulkActionBar.vue.d.ts +2 -0
- package/dist/lib/components/AcBulkActionBar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcButton.vue.d.ts +12 -6
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +85 -47
- package/dist/lib/components/AcCard.vue.d.ts +34 -3
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +169 -34
- package/dist/lib/components/AcCellValue.vue.d.ts +3 -3
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +171 -165
- package/dist/lib/components/AcCheckBox.vue.d.ts +1 -1
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +58 -72
- package/dist/lib/components/AcCheckList.js +5 -0
- package/dist/lib/components/AcCheckList.vue.d.ts +45 -0
- package/dist/lib/components/AcCheckList.vue_vue_type_script_setup_true_lang.js +64 -0
- package/dist/lib/components/AcCheckRadio.vue.d.ts +30 -5
- package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +100 -36
- package/dist/lib/components/AcCircularProgress.vue.d.ts +4 -4
- package/dist/lib/components/AcCircularProgress.vue_vue_type_script_setup_true_lang.js +12 -9
- package/dist/lib/components/AcColorInput.vue.d.ts +5 -2
- package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +127 -97
- package/dist/lib/components/AcCommandBlock.js +5 -0
- package/dist/lib/components/AcCommandBlock.vue.d.ts +34 -0
- package/dist/lib/components/AcCommandBlock.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/lib/components/AcConfirmModal.vue.d.ts +1 -1
- package/dist/lib/components/AcConfirmModal.vue_vue_type_script_setup_true_lang.js +7 -3
- package/dist/lib/components/AcCopyButton.vue.d.ts +2 -2
- package/dist/lib/components/AcCopyButton.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcCostSummary.js +5 -0
- package/dist/lib/components/AcCostSummary.vue.d.ts +102 -0
- package/dist/lib/components/AcCostSummary.vue_vue_type_script_setup_true_lang.js +179 -0
- package/dist/lib/components/AcDatePicker.vue.d.ts +3 -3
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +606 -380
- package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +47 -41
- package/dist/lib/components/AcDonutChart.vue.d.ts +10 -0
- package/dist/lib/components/AcDonutChart.vue_vue_type_script_setup_true_lang.js +116 -89
- package/dist/lib/components/AcDropdown.vue.d.ts +5 -2
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +88 -75
- package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +11 -10
- package/dist/lib/components/AcDropdownItem.vue.d.ts +1 -1
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +17 -17
- package/dist/lib/components/AcEmptyState.vue.d.ts +1 -1
- package/dist/lib/components/AcErrorState.js +5 -0
- package/dist/lib/components/AcErrorState.vue.d.ts +46 -0
- package/dist/lib/components/AcErrorState.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/lib/components/AcFeatureCard.vue.d.ts +6 -0
- package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +136 -114
- package/dist/lib/components/AcFooter.vue.d.ts +1 -1
- package/dist/lib/components/AcFooter.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcFormFooter.vue.d.ts +1 -1
- package/dist/lib/components/AcFormSection.vue.d.ts +1 -1
- package/dist/lib/components/AcGraphChart.js +5 -0
- package/dist/lib/components/AcGraphChart.vue.d.ts +124 -0
- package/dist/lib/components/AcGraphChart.vue_vue_type_script_setup_true_lang.js +578 -0
- package/dist/lib/components/AcHeader.vue.d.ts +20 -2
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +84 -26
- package/dist/lib/components/AcInfoTable.vue.d.ts +1 -1
- package/dist/lib/components/AcInput.vue.d.ts +1 -1
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +76 -79
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +4 -4
- package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +199 -183
- package/dist/lib/components/AcLineChart.vue.d.ts +6 -0
- package/dist/lib/components/AcLineChart.vue_vue_type_script_setup_true_lang.js +113 -125
- package/dist/lib/components/AcLoader.js +5 -0
- package/dist/lib/components/AcLoader.vue.d.ts +15 -0
- package/dist/lib/components/AcLoader.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +3 -1
- package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +44 -36
- package/dist/lib/components/AcMapChart.js +5 -0
- package/dist/lib/components/AcMapChart.vue.d.ts +136 -0
- package/dist/lib/components/AcMapChart.vue_vue_type_script_setup_true_lang.js +518 -0
- package/dist/lib/components/AcModal.vue.d.ts +6 -3
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +85 -61
- package/dist/lib/components/AcNavbar.vue.d.ts +8 -5
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +25 -17
- package/dist/lib/components/AcNavbarItem.vue.d.ts +2 -2
- package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/lib/components/AcNotificationMenu.vue.d.ts +3 -3
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +133 -168
- package/dist/lib/components/AcNumberInput.vue.d.ts +2 -2
- package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +137 -147
- package/dist/lib/components/AcPage.vue.d.ts +2 -2
- package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcPagination.vue.d.ts +5 -5
- package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +59 -56
- package/dist/lib/components/AcPreloader.vue.d.ts +3 -3
- package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +15 -16
- package/dist/lib/components/AcProductHero.js +5 -0
- package/dist/lib/components/AcProductHero.vue.d.ts +56 -0
- package/dist/lib/components/AcProductHero.vue_vue_type_script_setup_true_lang.js +95 -0
- package/dist/lib/components/AcProgress.vue.d.ts +17 -2
- package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +83 -29
- package/dist/lib/components/AcResourceCard.vue.d.ts +1 -1
- package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcSearchBar.vue.d.ts +1 -1
- package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +8 -4
- package/dist/lib/components/AcSelect.vue.d.ts +3 -3
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +232 -243
- package/dist/lib/components/AcSettingsRow.js +5 -0
- package/dist/lib/components/AcSettingsRow.vue.d.ts +29 -0
- package/dist/lib/components/AcSettingsRow.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebar.vue.d.ts +4 -1
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +104 -94
- package/dist/lib/components/AcSidebarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +42 -42
- package/dist/lib/components/AcSidebarSection.vue.d.ts +2 -2
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +23 -18
- package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcSwitch.vue.d.ts +3 -0
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +46 -39
- package/dist/lib/components/AcSwitchCard.vue.d.ts +3 -3
- package/dist/lib/components/AcSwitchCard.vue_vue_type_script_setup_true_lang.js +9 -7
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +65 -65
- package/dist/lib/components/AcTabs.vue.d.ts +9 -2
- package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +42 -27
- package/dist/lib/components/AcTag.vue.d.ts +1 -1
- package/dist/lib/components/AcTagInput.vue.d.ts +5 -5
- package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +140 -142
- package/dist/lib/components/AcTextarea.vue.d.ts +1 -1
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +69 -72
- package/dist/lib/components/AcThemeMode.vue.d.ts +3 -3
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +54 -22
- package/dist/lib/components/AcTimePicker.vue.d.ts +1 -1
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +177 -185
- package/dist/lib/components/AcToaster.vue.d.ts +6 -3
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +103 -64
- package/dist/lib/components/AcTooltip.vue.d.ts +34 -14
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +184 -70
- package/dist/lib/components/AcUserMenu.vue.d.ts +23 -1
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +181 -138
- package/dist/lib/components/index.d.ts +7 -0
- package/dist/lib/components/status.d.ts +3 -1
- package/dist/lib/components/status.js +20 -5
- package/dist/lib/composables/useToast.d.ts +17 -1
- package/dist/lib/composables/useToast.js +10 -2
- package/dist/lib/index.d.ts +7 -3
- package/dist/lib/index.js +80 -73
- package/dist/lib/theme.css +39 -54
- package/package.json +12 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export interface Props {
|
|
2
|
-
/** Small uppercase heading above the items. Hidden in the collapsed rail, where a divider takes its place. */
|
|
2
|
+
/** Small uppercase heading above the items. Hidden in the collapsed rail, where a divider takes its place. A section inside another section is a sub-group, like cloud-ui's Networking → VPC. */
|
|
3
3
|
label?: string;
|
|
4
4
|
/** Turns the heading into a button that shows and hides the items. */
|
|
5
5
|
collapsible?: boolean;
|
|
6
6
|
}
|
|
7
7
|
type __VLS_Props = Props;
|
|
8
8
|
type __VLS_Slots = {
|
|
9
|
-
/** The section's `AcSidebarItem`s. */
|
|
9
|
+
/** The section's `AcSidebarItem`s, or nested `AcSidebarSection`s for sub-groups. */
|
|
10
10
|
default?: () => unknown;
|
|
11
11
|
};
|
|
12
12
|
type __VLS_ModelProps = {
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, inject as s, mergeModels as c, normalizeClass as l, openBlock as u,
|
|
2
|
-
import { ChevronRight as
|
|
1
|
+
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, inject as s, mergeModels as c, normalizeClass as l, openBlock as u, provide as d, renderSlot as f, toDisplayString as p, unref as m, useId as h, useModel as g } from "vue";
|
|
2
|
+
import { ChevronRight as _ } from "@lucide/vue";
|
|
3
3
|
//#region src/lib/components/AcSidebarSection.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
5
|
-
key: 1,
|
|
6
|
-
class: "mb-2 truncate px-1 py-0.5 text-sm font-semibold tracking-[0.08em] text-muted uppercase"
|
|
7
|
-
}, b = ["id", "aria-label"], x = /*@__PURE__*/ o({
|
|
4
|
+
var v = ["aria-expanded", "aria-controls"], y = { class: "truncate" }, b = ["inert"], x = ["id", "aria-label"], S = /*@__PURE__*/ o({
|
|
8
5
|
__name: "AcSidebarSection",
|
|
9
6
|
props: /*@__PURE__*/ c({
|
|
10
7
|
label: { default: "" },
|
|
@@ -21,28 +18,36 @@ var _ = ["aria-expanded", "aria-controls"], v = { class: "truncate" }, y = {
|
|
|
21
18
|
}),
|
|
22
19
|
emits: ["update:open"],
|
|
23
20
|
setup(o) {
|
|
24
|
-
let c =
|
|
21
|
+
let c = g(o, "open"), S = s("ac-sidebar", null), C = s("ac-sidebar-section", !1);
|
|
22
|
+
d("ac-sidebar-section", !0), d("ac-sidebar-subgroup", C);
|
|
23
|
+
let w = h(), T = t(() => S?.rail.value ?? !1), E = t(() => c.value || T.value), D = t(() => C ? "mt-2 first:mt-0" : T.value ? "mt-2 border-t border-muted/20 pt-2 first:mt-0 first:border-0 first:pt-0" : "mt-4 first:mt-0 [[data-testid=ac-sidebar-section]+&]:mt-5 [[data-testid=ac-sidebar-section]+&]:border-t [[data-testid=ac-sidebar-section]+&]:border-muted/20 [[data-testid=ac-sidebar-section]+&]:pt-4");
|
|
25
24
|
return (t, s) => (u(), r("li", {
|
|
26
|
-
class: l(["list-none",
|
|
25
|
+
class: l(["list-none", D.value]),
|
|
27
26
|
"data-ac-ds": "",
|
|
28
27
|
"data-testid": "ac-sidebar-section"
|
|
29
|
-
}, [o.label && !
|
|
28
|
+
}, [o.label && !T.value ? (u(), r(e, { key: 0 }, [o.collapsible ? (u(), r("button", {
|
|
30
29
|
key: 0,
|
|
31
30
|
type: "button",
|
|
32
|
-
class: "
|
|
31
|
+
class: l(["flex w-full cursor-pointer items-center justify-between gap-2 rounded-8 px-1 py-0.5 text-left font-semibold tracking-[0.08em] uppercase transition-colors duration-200 hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-inset", m(C) ? "mb-1 text-xm text-muted/80" : "mb-2 text-sm text-muted"]),
|
|
33
32
|
"aria-expanded": c.value,
|
|
34
|
-
"aria-controls": `${
|
|
33
|
+
"aria-controls": `${m(w)}-items`,
|
|
35
34
|
onClick: s[0] ||= (e) => c.value = !c.value
|
|
36
|
-
}, [i("span",
|
|
37
|
-
class: l(["
|
|
35
|
+
}, [i("span", y, p(o.label), 1), a(m(_), {
|
|
36
|
+
class: l(["shrink-0 text-muted/70 transition-transform duration-200 ease-out motion-reduce:transition-none", [m(C) ? "size-3.5" : "size-4", c.value && "rotate-90"]]),
|
|
38
37
|
"aria-hidden": "true"
|
|
39
|
-
}, null, 8, ["class"])],
|
|
40
|
-
|
|
38
|
+
}, null, 8, ["class"])], 10, v)) : (u(), r("p", {
|
|
39
|
+
key: 1,
|
|
40
|
+
class: l(["truncate px-1 py-0.5 font-semibold tracking-[0.08em] uppercase", m(C) ? "mb-1 text-xm text-muted/80" : "mb-2 text-sm text-muted"])
|
|
41
|
+
}, p(o.label), 3))], 64)) : n("", !0), i("div", {
|
|
42
|
+
class: l(["grid transition-[grid-template-rows,opacity] duration-300 ease-out-soft motion-reduce:transition-none", E.value ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"]),
|
|
43
|
+
inert: !E.value || void 0
|
|
44
|
+
}, [i("ul", {
|
|
45
|
+
id: `${m(w)}-items`,
|
|
41
46
|
role: "list",
|
|
42
47
|
"aria-label": o.label || void 0,
|
|
43
|
-
class: l(["flex-col gap-1",
|
|
44
|
-
}, [
|
|
48
|
+
class: l(["flex min-h-0 flex-col gap-1 overflow-hidden", [m(C) && !T.value && "pl-1", E.value && "pb-0.5"]])
|
|
49
|
+
}, [f(t.$slots, "default")], 10, x)], 10, b)], 2));
|
|
45
50
|
}
|
|
46
51
|
});
|
|
47
52
|
//#endregion
|
|
48
|
-
export {
|
|
53
|
+
export { S as default };
|
|
@@ -76,7 +76,7 @@ var f = {
|
|
|
76
76
|
class: "flex items-center gap-2 py-1",
|
|
77
77
|
"aria-current": e.id === a.activeSubstep ? "step" : void 0
|
|
78
78
|
}, [i("span", {
|
|
79
|
-
class: o(["inline-flex size-5 shrink-0 items-center justify-center rounded-full transition-colors duration-200", c < T(f) ? "bg-primary text-white" : c === T(f) ? "bg-surface text-primary ring-2 ring-primary" : "bg-surface text-muted ring-1 ring-border-dark"]),
|
|
79
|
+
class: o(["inline-flex size-5 shrink-0 items-center justify-center rounded-full transition-colors duration-200", c < T(f) ? "bg-primary text-white" : c === T(f) ? "bg-surface text-primary-strong ring-2 ring-primary" : "bg-surface text-muted ring-1 ring-border-dark"]),
|
|
80
80
|
"aria-hidden": "true"
|
|
81
81
|
}, [c < T(f) ? (s(), t(u(d), {
|
|
82
82
|
key: 0,
|
|
@@ -7,6 +7,8 @@ export interface Props {
|
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
/** Error text under the switch. */
|
|
9
9
|
errorMsg?: string;
|
|
10
|
+
/** Pulses the track and blocks changes, e.g. while the new value is saved. Sets `aria-busy`. */
|
|
11
|
+
loading?: boolean;
|
|
10
12
|
}
|
|
11
13
|
type __VLS_Props = Props;
|
|
12
14
|
type __VLS_Slots = {
|
|
@@ -32,6 +34,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
32
34
|
label: string;
|
|
33
35
|
disabled: boolean;
|
|
34
36
|
name: string;
|
|
37
|
+
loading: boolean;
|
|
35
38
|
errorMsg: string;
|
|
36
39
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
37
40
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,26 +1,31 @@
|
|
|
1
|
-
import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r,
|
|
2
|
-
import { CircleAlert as v } from "@lucide/vue";
|
|
1
|
+
import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, mergeModels as a, mergeProps as o, normalizeClass as s, openBlock as c, ref as l, renderSlot as u, toDisplayString as d, unref as f, useAttrs as p, useId as m, useModel as h } from "vue";
|
|
3
2
|
//#region src/lib/components/AcSwitch.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
3
|
+
var g = { class: "flex items-center gap-2" }, _ = ["for"], v = [
|
|
5
4
|
"id",
|
|
6
5
|
"name",
|
|
7
6
|
"aria-checked",
|
|
7
|
+
"aria-busy",
|
|
8
|
+
"aria-disabled",
|
|
8
9
|
"disabled"
|
|
9
|
-
],
|
|
10
|
+
], y = {
|
|
10
11
|
key: 0,
|
|
11
|
-
class: "mt-1
|
|
12
|
+
class: "mt-1 text-base text-danger-strong",
|
|
12
13
|
role: "alert"
|
|
13
|
-
},
|
|
14
|
+
}, b = /*@__PURE__*/ i({
|
|
14
15
|
inheritAttrs: !1,
|
|
15
16
|
__name: "AcSwitch",
|
|
16
|
-
props: /*@__PURE__*/
|
|
17
|
+
props: /*@__PURE__*/ a({
|
|
17
18
|
label: { default: "" },
|
|
18
19
|
name: { default: "" },
|
|
19
20
|
disabled: {
|
|
20
21
|
type: Boolean,
|
|
21
22
|
default: !1
|
|
22
23
|
},
|
|
23
|
-
errorMsg: { default: "" }
|
|
24
|
+
errorMsg: { default: "" },
|
|
25
|
+
loading: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: !1
|
|
28
|
+
}
|
|
24
29
|
}, {
|
|
25
30
|
modelValue: {
|
|
26
31
|
type: Boolean,
|
|
@@ -29,44 +34,46 @@ var y = { class: "flex items-center gap-2" }, b = ["for"], x = [
|
|
|
29
34
|
modelModifiers: {}
|
|
30
35
|
}),
|
|
31
36
|
emits: ["update:modelValue"],
|
|
32
|
-
setup(
|
|
33
|
-
let
|
|
34
|
-
class:
|
|
35
|
-
style:
|
|
36
|
-
})),
|
|
37
|
-
let { class: e, style: t, ...n } =
|
|
37
|
+
setup(i, { expose: a }) {
|
|
38
|
+
let b = i, x = h(i, "modelValue"), S = m(), C = p(), w = e(() => ({
|
|
39
|
+
class: C.class,
|
|
40
|
+
style: C.style
|
|
41
|
+
})), T = e(() => {
|
|
42
|
+
let { class: e, style: t, ...n } = C;
|
|
38
43
|
return n;
|
|
39
|
-
}),
|
|
40
|
-
|
|
44
|
+
}), E = l(null);
|
|
45
|
+
function D() {
|
|
46
|
+
b.disabled || b.loading || (x.value = !x.value);
|
|
47
|
+
}
|
|
48
|
+
return a({ focus: () => E.value?.focus() }), (e, a) => (c(), n("div", o(w.value, {
|
|
41
49
|
"data-ac-ds": "",
|
|
42
50
|
"data-testid": "ac-switch"
|
|
43
|
-
}), [r("div",
|
|
44
|
-
|
|
45
|
-
|
|
51
|
+
}), [r("div", g, [
|
|
52
|
+
u(e.$slots, "left"),
|
|
53
|
+
i.label ? (c(), n("label", {
|
|
46
54
|
key: 0,
|
|
47
|
-
for:
|
|
48
|
-
class:
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
r("button",
|
|
52
|
-
id:
|
|
55
|
+
for: f(S),
|
|
56
|
+
class: s(["cursor-pointer text-base font-medium text-heading", i.disabled && "cursor-not-allowed opacity-50"])
|
|
57
|
+
}, d(i.label), 11, _)) : t("", !0),
|
|
58
|
+
u(e.$slots, "middle"),
|
|
59
|
+
r("button", o({
|
|
60
|
+
id: f(S),
|
|
53
61
|
ref_key: "button",
|
|
54
|
-
ref:
|
|
55
|
-
},
|
|
62
|
+
ref: E
|
|
63
|
+
}, T.value, {
|
|
56
64
|
type: "button",
|
|
57
65
|
role: "switch",
|
|
58
|
-
name:
|
|
59
|
-
"aria-checked":
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}), i(" " + p(o.errorMsg), 1)])) : t("", !0)], 16));
|
|
66
|
+
name: i.name,
|
|
67
|
+
"aria-checked": x.value,
|
|
68
|
+
"aria-busy": i.loading || void 0,
|
|
69
|
+
"aria-disabled": i.loading && !i.disabled || void 0,
|
|
70
|
+
disabled: i.disabled,
|
|
71
|
+
class: ["relative h-6 w-11 shrink-0 rounded-full transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none motion-reduce:transition-none", [x.value ? "bg-primary" : "bg-slate-80", i.disabled ? "cursor-not-allowed opacity-50" : i.loading ? "cursor-wait animate-pulse motion-reduce:animate-none" : "cursor-pointer"]],
|
|
72
|
+
onClick: D
|
|
73
|
+
}), [r("span", { class: s(["pointer-events-none absolute top-0.5 left-0.5 size-5 rounded-full border bg-white transition-transform duration-200 ease-out motion-reduce:transition-none", x.value ? "translate-x-5 border-white" : "translate-x-0 border-slate-70"]) }, null, 2)], 16, v),
|
|
74
|
+
u(e.$slots, "right")
|
|
75
|
+
]), i.errorMsg ? (c(), n("p", y, d(i.errorMsg), 1)) : t("", !0)], 16));
|
|
69
76
|
}
|
|
70
77
|
});
|
|
71
78
|
//#endregion
|
|
72
|
-
export {
|
|
79
|
+
export { b as default };
|
|
@@ -12,11 +12,11 @@ export interface Props {
|
|
|
12
12
|
icon?: Component;
|
|
13
13
|
/** Adds a "Recommended" pill after the title. */
|
|
14
14
|
recommended?: boolean;
|
|
15
|
-
/** The
|
|
15
|
+
/** The choice won't take effect yet: tints the card and status amber instead of primary, on or off. Explain why in the default slot. */
|
|
16
16
|
warning?: boolean;
|
|
17
17
|
/** Turns the switch and the card click off. */
|
|
18
18
|
disabled?: boolean;
|
|
19
|
-
/** Shows a spinner beside the switch and blocks changes, e.g. while the change is saved. */
|
|
19
|
+
/** Shows a spinner beside the switch, pulses it and blocks changes, e.g. while the change is saved. */
|
|
20
20
|
loading?: boolean;
|
|
21
21
|
}
|
|
22
22
|
type __VLS_Props = Props;
|
|
@@ -25,7 +25,7 @@ type __VLS_Slots = {
|
|
|
25
25
|
badges?: () => unknown;
|
|
26
26
|
/** Replaces the `status` text, e.g. a price with a muted unit. */
|
|
27
27
|
status?: () => unknown;
|
|
28
|
-
/** Content under the row,
|
|
28
|
+
/** Content under the row, e.g. a warning about the choice. Wrap it in `v-if="model"` to show settings only while the switch is on. */
|
|
29
29
|
default?: () => unknown;
|
|
30
30
|
};
|
|
31
31
|
type __VLS_ModelProps = {
|
|
@@ -5,13 +5,13 @@ import { Sparkles as T } from "@lucide/vue";
|
|
|
5
5
|
//#region src/lib/components/AcSwitchCard.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var E = ["aria-busy"], D = { class: "flex min-w-[200px] flex-1 items-start gap-3" }, O = { class: "min-w-0 flex-1" }, k = { class: "flex flex-wrap items-center gap-x-2 gap-y-1 text-base font-semibold text-heading" }, A = {
|
|
7
7
|
key: 0,
|
|
8
|
-
class: "inline-flex items-center gap-1 rounded-full bg-primary/15 px-2 py-0.5 text-
|
|
8
|
+
class: "inline-flex items-center gap-1 rounded-full bg-primary/15 px-2 py-0.5 text-xm font-bold tracking-wide text-primary-strong uppercase"
|
|
9
9
|
}, j = { class: "ml-auto flex shrink-0 items-center gap-3" }, M = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "text-sm text-muted"
|
|
12
12
|
}, N = {
|
|
13
13
|
key: 0,
|
|
14
|
-
class: "mt-
|
|
14
|
+
class: "mt-3"
|
|
15
15
|
}, P = "a, button, input, select, textarea, label, [tabindex], [contenteditable]", F = /*@__PURE__*/ d({
|
|
16
16
|
inheritAttrs: !1,
|
|
17
17
|
__name: "AcSwitchCard",
|
|
@@ -52,12 +52,12 @@ var E = ["aria-busy"], D = { class: "flex min-w-[200px] flex-1 items-start gap-3
|
|
|
52
52
|
})), W = i(() => {
|
|
53
53
|
let { class: e, style: t, ...n } = H;
|
|
54
54
|
return n;
|
|
55
|
-
}), G = g(null), K = i(() => F.disabled || F.loading), q = i(() => I.value && !F.disabled && !F.warning), J = i(() => !!(F.status || F.statusDetail || L.status)), Y = i(() => [F.description && B, J.value && V].filter(Boolean).join(" ") || void 0), X = i(() =>
|
|
55
|
+
}), G = g(null), K = i(() => F.disabled || F.loading), q = i(() => I.value && !F.disabled && !F.warning), J = i(() => !!(F.status || F.statusDetail || L.status)), Y = i(() => [F.description && B, J.value && V].filter(Boolean).join(" ") || void 0), X = i(() => F.warning ? "border-warning/40 bg-[color-mix(in_srgb,var(--color-warning)_5%,var(--color-surface))]" : q.value ? "border-primary/40 bg-[color-mix(in_srgb,var(--color-primary)_5%,var(--color-surface))]" : "border-border bg-surface-sunken/5"), Z = i(() => F.warning ? "text-warning-strong" : q.value ? "text-heading" : "text-muted");
|
|
56
56
|
function Q(e) {
|
|
57
57
|
return !!e?.some((e) => e.type !== n && (e.type !== r || Q(e.children)));
|
|
58
58
|
}
|
|
59
59
|
function $() {
|
|
60
|
-
return
|
|
60
|
+
return Q(L.default?.());
|
|
61
61
|
}
|
|
62
62
|
function ee(e) {
|
|
63
63
|
if (K.value) return;
|
|
@@ -65,12 +65,12 @@ var E = ["aria-busy"], D = { class: "flex min-w-[200px] flex-1 items-start gap-3
|
|
|
65
65
|
t && e.currentTarget.contains(t) || window.getSelection()?.toString() || (I.value = !I.value, G.value?.focus());
|
|
66
66
|
}
|
|
67
67
|
return f({ focus: () => G.value?.focus() }), (n, r) => (h(), s("div", p(U.value, {
|
|
68
|
-
class: ["rounded-14 border
|
|
68
|
+
class: ["rounded-14 border px-4 py-3 transition-colors duration-200 motion-reduce:transition-none", X.value],
|
|
69
69
|
"aria-busy": d.loading || void 0,
|
|
70
70
|
"data-ac-ds": "",
|
|
71
71
|
"data-testid": "ac-switch-card"
|
|
72
72
|
}), [c("div", {
|
|
73
|
-
class: m(["flex flex-wrap items-center justify-between gap-x-4 gap-y-3",
|
|
73
|
+
class: m(["flex flex-wrap items-center justify-between gap-x-4 gap-y-3", d.disabled ? "cursor-not-allowed" : d.loading ? "cursor-wait" : "cursor-pointer"]),
|
|
74
74
|
onClick: ee
|
|
75
75
|
}, [c("div", D, [d.icon ? (h(), s("span", {
|
|
76
76
|
key: 0,
|
|
@@ -104,12 +104,14 @@ var E = ["aria-busy"], D = { class: "flex min-w-[200px] flex-1 items-start gap-3
|
|
|
104
104
|
}, W.value, {
|
|
105
105
|
modelValue: I.value,
|
|
106
106
|
"onUpdate:modelValue": r[0] ||= (e) => I.value = e,
|
|
107
|
-
disabled:
|
|
107
|
+
disabled: d.disabled,
|
|
108
|
+
loading: d.loading,
|
|
108
109
|
"aria-labelledby": z,
|
|
109
110
|
"aria-describedby": Y.value
|
|
110
111
|
}), null, 16, [
|
|
111
112
|
"modelValue",
|
|
112
113
|
"disabled",
|
|
114
|
+
"loading",
|
|
113
115
|
"aria-describedby"
|
|
114
116
|
])
|
|
115
117
|
])], 2), $() ? (h(), s("div", N, [_(n.$slots, "default")])) : o("", !0)], 16, E));
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import e from "./AcCellValue.js";
|
|
2
2
|
import { Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, mergeModels as u, normalizeClass as d, normalizeStyle as f, openBlock as p, renderList as m, renderSlot as h, resolveDynamicComponent as g, toDisplayString as _, unref as v, useId as ee, useModel as y, withModifiers as b } from "vue";
|
|
3
|
-
import {
|
|
3
|
+
import { Check as x, ChevronDown as S, ChevronRight as C, ChevronUp as w, Minus as te } from "@lucide/vue";
|
|
4
4
|
//#region src/lib/components/AcTable.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var ne = { class: "ac-scrollbar" }, re = { class: "w-full border-separate border-spacing-0 text-base" }, ie = { class: "relative flex size-
|
|
5
|
+
var ne = { class: "ac-scrollbar" }, re = { class: "w-full border-separate border-spacing-0 text-base" }, ie = { class: "relative flex size-[18px]" }, ae = [
|
|
6
6
|
"checked",
|
|
7
7
|
"indeterminate",
|
|
8
8
|
"disabled"
|
|
9
|
-
], oe = ["aria-sort", "onClick"], se = {
|
|
9
|
+
], oe = ["aria-sort", "onClick"], se = { class: "inline-flex items-center gap-2" }, ce = {
|
|
10
10
|
key: 0,
|
|
11
|
-
class: "h-
|
|
12
|
-
},
|
|
11
|
+
class: "h-11 border-b border-border pl-4 [tr:last-child_&]:border-0"
|
|
12
|
+
}, T = {
|
|
13
13
|
key: 1,
|
|
14
|
-
class: "h-
|
|
15
|
-
},
|
|
14
|
+
class: "h-11 border-b border-border pl-4 [tr:last-child_&]:border-0"
|
|
15
|
+
}, E = [
|
|
16
16
|
"aria-current",
|
|
17
17
|
"aria-disabled",
|
|
18
18
|
"onClick"
|
|
19
|
-
],
|
|
19
|
+
], le = [
|
|
20
20
|
"aria-expanded",
|
|
21
21
|
"aria-controls",
|
|
22
22
|
"aria-label",
|
|
23
23
|
"onClick"
|
|
24
|
-
],
|
|
24
|
+
], ue = { class: "relative flex size-[18px]" }, D = [
|
|
25
25
|
"checked",
|
|
26
26
|
"disabled",
|
|
27
27
|
"aria-label",
|
|
28
28
|
"onChange"
|
|
29
|
-
],
|
|
29
|
+
], O = {
|
|
30
30
|
key: 0,
|
|
31
31
|
class: "group",
|
|
32
32
|
"data-testid": "ac-table-detail"
|
|
33
|
-
},
|
|
33
|
+
}, k = ["colspan"], de = ["id", "aria-label"], fe = {
|
|
34
34
|
key: 0,
|
|
35
35
|
class: "px-6 py-12 text-center text-muted"
|
|
36
|
-
},
|
|
36
|
+
}, A = "border-border", j = "peer size-[18px] cursor-pointer appearance-none rounded-4 border border-muted/70 bg-background align-middle transition-colors duration-150 hover:border-primary/60 checked:border-primary checked:bg-primary indeterminate:border-primary indeterminate:bg-primary focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50", M = /*@__PURE__*/ l({
|
|
37
37
|
__name: "AcTable",
|
|
38
38
|
props: /*@__PURE__*/ u({
|
|
39
39
|
columns: {},
|
|
@@ -95,17 +95,17 @@ var ne = { class: "ac-scrollbar" }, re = { class: "w-full border-separate border
|
|
|
95
95
|
"update:sortBy"
|
|
96
96
|
]),
|
|
97
97
|
setup(l, { emit: u }) {
|
|
98
|
-
let
|
|
98
|
+
let M = l, N = y(l, "selected"), P = y(l, "expanded"), F = u, I = ee(), L = y(l, "sortBy"), R = n(() => L.value?.key ?? ""), z = n(() => L.value?.mode ?? "asc"), B = (e) => {
|
|
99
99
|
if (!e.sortable) return;
|
|
100
|
-
let t =
|
|
101
|
-
|
|
100
|
+
let t = R.value === e.key && z.value === "asc" ? "desc" : "asc";
|
|
101
|
+
L.value = {
|
|
102
102
|
key: e.key,
|
|
103
103
|
mode: t
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
if (!
|
|
107
|
-
let e =
|
|
108
|
-
return [...
|
|
104
|
+
}, F("sort", e.key, t);
|
|
105
|
+
}, pe = n(() => {
|
|
106
|
+
if (!R.value || M.manualSort) return M.rows;
|
|
107
|
+
let e = R.value, t = z.value === "asc" ? 1 : -1;
|
|
108
|
+
return [...M.rows].sort((n, r) => String(H(n[e]) ?? "").localeCompare(String(H(r[e]) ?? ""), void 0, { numeric: !0 }) * t);
|
|
109
109
|
});
|
|
110
110
|
function V(e) {
|
|
111
111
|
return typeof e == "object" && !!e && !Array.isArray(e) && "data" in e;
|
|
@@ -113,23 +113,23 @@ var ne = { class: "ac-scrollbar" }, re = { class: "w-full border-separate border
|
|
|
113
113
|
function H(e) {
|
|
114
114
|
return V(e) ? e.sort ?? e.data : e;
|
|
115
115
|
}
|
|
116
|
-
let U = (e) => !!
|
|
117
|
-
function
|
|
116
|
+
let U = (e) => !!M.rowDisabled?.(e), W = n(() => M.rows.filter((e) => !U(e)).map((e) => e[M.rowKey])), G = n(() => new Set(N.value)), K = n(() => W.value.length > 0 && W.value.every((e) => G.value.has(e))), q = n(() => !K.value && W.value.some((e) => G.value.has(e)));
|
|
117
|
+
function me() {
|
|
118
118
|
let e = new Set(W.value);
|
|
119
|
-
|
|
119
|
+
N.value = K.value ? N.value.filter((t) => !e.has(t)) : [...N.value, ...W.value.filter((e) => !G.value.has(e))];
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
let t = e[
|
|
123
|
-
|
|
121
|
+
function he(e) {
|
|
122
|
+
let t = e[M.rowKey];
|
|
123
|
+
N.value = G.value.has(t) ? N.value.filter((e) => e !== t) : [...N.value, t];
|
|
124
124
|
}
|
|
125
|
-
let J = n(() => new Set(
|
|
126
|
-
function
|
|
127
|
-
let t = e[
|
|
128
|
-
|
|
125
|
+
let J = n(() => new Set(P.value)), Y = (e) => M.expandable && J.value.has(e[M.rowKey]), X = (e) => !M.canExpand || M.canExpand(e), Z = (e) => `${I}-detail-${String(e[M.rowKey])}`, ge = n(() => M.columns.length + +!!M.selectable + +!!M.expandable);
|
|
126
|
+
function _e(e) {
|
|
127
|
+
let t = e[M.rowKey];
|
|
128
|
+
P.value = J.value.has(t) ? P.value.filter((e) => e !== t) : [...P.value, t];
|
|
129
129
|
}
|
|
130
130
|
function Q(e) {
|
|
131
|
-
let t = e[
|
|
132
|
-
return typeof n == "string" || typeof n == "number" ? n : String(e[
|
|
131
|
+
let t = e[M.columns[0]?.key ?? ""], n = V(t) ? t.data : t;
|
|
132
|
+
return typeof n == "string" || typeof n == "number" ? n : String(e[M.rowKey]);
|
|
133
133
|
}
|
|
134
134
|
let $ = (e) => ({
|
|
135
135
|
left: "text-left",
|
|
@@ -144,22 +144,22 @@ var ne = { class: "ac-scrollbar" }, re = { class: "w-full border-separate border
|
|
|
144
144
|
l.expandable ? (p(), a("th", {
|
|
145
145
|
key: 0,
|
|
146
146
|
scope: "col",
|
|
147
|
-
class: d(["h-11 w-10 border-b bg-surface-sunken/50 pr-0 pl-4", [
|
|
147
|
+
class: d(["h-11 w-10 border-b bg-surface-sunken/50 pr-0 pl-4", [A, !l.flat && "first:rounded-tl-10"]])
|
|
148
148
|
}, [...u[2] ||= [o("span", { class: "sr-only" }, "Expand", -1)]], 2)) : i("", !0),
|
|
149
149
|
l.selectable ? (p(), a("th", {
|
|
150
150
|
key: 1,
|
|
151
151
|
scope: "col",
|
|
152
|
-
class: d(["h-11 w-10 border-b bg-surface-sunken/50 pr-1 pl-4", [
|
|
152
|
+
class: d(["h-11 w-10 border-b bg-surface-sunken/50 pr-1 pl-4", [A, !l.flat && "first:rounded-tl-10"]])
|
|
153
153
|
}, [o("span", ie, [o("input", {
|
|
154
154
|
type: "checkbox",
|
|
155
|
-
class: d(
|
|
155
|
+
class: d(j),
|
|
156
156
|
checked: K.value,
|
|
157
157
|
indeterminate: q.value,
|
|
158
158
|
disabled: l.loading || !l.rows.length,
|
|
159
159
|
"aria-label": "Select all rows",
|
|
160
|
-
onChange:
|
|
161
|
-
}, null, 40, ae), (p(), r(g(q.value ? v(te) : v(
|
|
162
|
-
class: "pointer-events-none absolute inset-0 m-auto size-3 text-white opacity-0 peer-checked:opacity-100 peer-indeterminate:opacity-100",
|
|
160
|
+
onChange: me
|
|
161
|
+
}, null, 40, ae), (p(), r(g(q.value ? v(te) : v(x)), {
|
|
162
|
+
class: "pointer-events-none absolute inset-0 m-auto size-3.5 text-white opacity-0 peer-checked:opacity-100 peer-indeterminate:opacity-100",
|
|
163
163
|
"stroke-width": 3,
|
|
164
164
|
"aria-hidden": "true"
|
|
165
165
|
}))])], 2)) : i("", !0),
|
|
@@ -167,44 +167,44 @@ var ne = { class: "ac-scrollbar" }, re = { class: "w-full border-separate border
|
|
|
167
167
|
key: e.key,
|
|
168
168
|
scope: "col",
|
|
169
169
|
class: d(["h-11 border-b bg-surface-sunken/50 px-6 text-base font-semibold whitespace-nowrap text-muted", [
|
|
170
|
-
|
|
170
|
+
A,
|
|
171
171
|
!l.flat && "first:rounded-tl-10 last:rounded-tr-10",
|
|
172
172
|
$(e),
|
|
173
173
|
e.sortable && "cursor-pointer select-none transition-colors hover:text-heading"
|
|
174
174
|
]]),
|
|
175
175
|
style: f(e.width ? { width: e.width } : void 0),
|
|
176
|
-
"aria-sort":
|
|
177
|
-
onClick: (t) =>
|
|
178
|
-
}, [o("span",
|
|
176
|
+
"aria-sort": R.value === e.key ? z.value === "asc" ? "ascending" : "descending" : void 0,
|
|
177
|
+
onClick: (t) => B(e)
|
|
178
|
+
}, [o("span", se, [h(n.$slots, `header-${e.key}`, { column: e }, () => [s(_(e.label), 1)]), e.sortable ? (p(), r(g(R.value === e.key && z.value === "asc" ? v(w) : v(S)), {
|
|
179
179
|
key: 0,
|
|
180
|
-
class: d(["size-4 shrink-0
|
|
180
|
+
class: d(["size-4 shrink-0", R.value === e.key ? "text-primary-strong" : "text-muted"]),
|
|
181
181
|
"aria-hidden": "true"
|
|
182
|
-
}, null, 8, ["class"])) : i("", !0)]
|
|
182
|
+
}, null, 8, ["class"])) : i("", !0)])], 14, oe))), 128))
|
|
183
183
|
])]), o("tbody", null, [l.loading ? (p(!0), a(t, { key: 0 }, m(l.loaderRows, (e) => (p(), a("tr", { key: `loader-${e}` }, [
|
|
184
|
-
l.expandable ? (p(), a("td",
|
|
185
|
-
l.selectable ? (p(), a("td",
|
|
184
|
+
l.expandable ? (p(), a("td", ce)) : i("", !0),
|
|
185
|
+
l.selectable ? (p(), a("td", T)) : i("", !0),
|
|
186
186
|
(p(!0), a(t, null, m(l.columns, (t, n) => (p(), a("td", {
|
|
187
187
|
key: t.key,
|
|
188
|
-
class: "h-
|
|
188
|
+
class: "h-11 border-b border-border px-6 [tr:last-child_&]:border-0"
|
|
189
189
|
}, [o("span", {
|
|
190
190
|
class: "block h-2.5 animate-pulse rounded-full bg-surface-sunken",
|
|
191
191
|
style: f({ width: `${50 + (e * 17 + n * 23) % 40}%` })
|
|
192
192
|
}, null, 4)]))), 128))
|
|
193
|
-
]))), 128)) : (p(!0), a(t, { key: 1 }, m(
|
|
193
|
+
]))), 128)) : (p(!0), a(t, { key: 1 }, m(pe.value, (f, g) => (p(), a(t, { key: String(f[l.rowKey] ?? g) }, [o("tr", {
|
|
194
194
|
"data-testid": "ac-table-row",
|
|
195
|
-
class: d(["group transition-colors duration-150
|
|
196
|
-
l.clickable && "cursor-pointer",
|
|
195
|
+
class: d(["group transition-colors duration-150", [
|
|
196
|
+
l.clickable && "cursor-pointer hover:bg-surface-sunken/40",
|
|
197
197
|
(l.rowActive?.(f) || l.selectable && G.value.has(f[l.rowKey])) && "bg-primary/5",
|
|
198
198
|
l.rowActive?.(f) && "shadow-[inset_0_0_0_1px_var(--color-primary)]",
|
|
199
199
|
U(f) && "pointer-events-none cursor-not-allowed opacity-50"
|
|
200
200
|
]]),
|
|
201
201
|
"aria-current": l.rowActive?.(f) ? "true" : void 0,
|
|
202
202
|
"aria-disabled": U(f) || void 0,
|
|
203
|
-
onClick: (e) => l.clickable && !U(f) &&
|
|
203
|
+
onClick: (e) => l.clickable && !U(f) && F("row-click", f)
|
|
204
204
|
}, [
|
|
205
205
|
l.expandable ? (p(), a("td", {
|
|
206
206
|
key: 0,
|
|
207
|
-
class: "h-
|
|
207
|
+
class: "h-11 w-10 border-b border-border pr-0 pl-4 group-last:border-0",
|
|
208
208
|
onClick: u[0] ||= b(() => {}, ["stop"])
|
|
209
209
|
}, [X(f) ? (p(), a("button", {
|
|
210
210
|
key: 0,
|
|
@@ -214,30 +214,30 @@ var ne = { class: "ac-scrollbar" }, re = { class: "w-full border-separate border
|
|
|
214
214
|
"aria-controls": Z(f),
|
|
215
215
|
"aria-label": `${Y(f) ? "Collapse" : "Expand"} ${Q(f)}`,
|
|
216
216
|
"data-testid": "ac-table-expand",
|
|
217
|
-
onClick: (e) =>
|
|
217
|
+
onClick: (e) => _e(f)
|
|
218
218
|
}, [c(v(C), {
|
|
219
219
|
class: d(["size-4 transition-transform duration-150 motion-reduce:transition-none", Y(f) && "rotate-90"]),
|
|
220
220
|
"aria-hidden": "true"
|
|
221
|
-
}, null, 8, ["class"])], 8,
|
|
221
|
+
}, null, 8, ["class"])], 8, le)) : i("", !0)])) : i("", !0),
|
|
222
222
|
l.selectable ? (p(), a("td", {
|
|
223
223
|
key: 1,
|
|
224
|
-
class: "h-
|
|
224
|
+
class: "h-11 w-10 border-b border-border pr-1 pl-4 group-last:border-0",
|
|
225
225
|
onClick: u[1] ||= b(() => {}, ["stop"])
|
|
226
|
-
}, [o("span",
|
|
226
|
+
}, [o("span", ue, [o("input", {
|
|
227
227
|
type: "checkbox",
|
|
228
|
-
class: d(
|
|
228
|
+
class: d(j),
|
|
229
229
|
checked: G.value.has(f[l.rowKey]),
|
|
230
230
|
disabled: U(f),
|
|
231
231
|
"aria-label": `Select ${Q(f)}`,
|
|
232
|
-
onChange: (e) =>
|
|
233
|
-
}, null, 40,
|
|
234
|
-
class: "pointer-events-none absolute inset-0 m-auto size-3 text-white opacity-0 peer-checked:opacity-100",
|
|
232
|
+
onChange: (e) => he(f)
|
|
233
|
+
}, null, 40, D), c(v(x), {
|
|
234
|
+
class: "pointer-events-none absolute inset-0 m-auto size-3.5 text-white opacity-0 peer-checked:opacity-100",
|
|
235
235
|
"stroke-width": 3,
|
|
236
236
|
"aria-hidden": "true"
|
|
237
237
|
})])])) : i("", !0),
|
|
238
238
|
(p(!0), a(t, null, m(l.columns, (i) => (p(), a("td", {
|
|
239
239
|
key: i.key,
|
|
240
|
-
class: d(["h-
|
|
240
|
+
class: d(["h-11 border-b border-border px-6 whitespace-nowrap text-body tabular-nums group-last:border-0", $(i)])
|
|
241
241
|
}, [h(n.$slots, `cell-${i.key}`, {
|
|
242
242
|
row: f,
|
|
243
243
|
value: f[i.key]
|
|
@@ -257,16 +257,16 @@ var ne = { class: "ac-scrollbar" }, re = { class: "w-full border-separate border
|
|
|
257
257
|
"title",
|
|
258
258
|
"resolve-link"
|
|
259
259
|
])) : (p(), a(t, { key: 1 }, [s(_(f[i.key]), 1)], 64))])], 2))), 128))
|
|
260
|
-
], 10,
|
|
261
|
-
colspan:
|
|
260
|
+
], 10, E), Y(f) && X(f) ? (p(), a("tr", O, [o("td", {
|
|
261
|
+
colspan: ge.value,
|
|
262
262
|
class: "border-b border-border bg-surface-muted p-0 group-last:border-0"
|
|
263
263
|
}, [o("div", {
|
|
264
264
|
id: Z(f),
|
|
265
265
|
role: "region",
|
|
266
266
|
"aria-label": `Details for ${Q(f)}`,
|
|
267
267
|
class: "px-6 py-4 text-body"
|
|
268
|
-
}, [h(n.$slots, "expanded", { row: f })], 8,
|
|
268
|
+
}, [h(n.$slots, "expanded", { row: f })], 8, de)], 8, k)])) : i("", !0)], 64))), 128))])])]), !l.loading && !l.rows.length ? (p(), a("div", fe, [h(n.$slots, "empty", {}, () => [s(_(l.emptyText), 1)])])) : i("", !0)], 2));
|
|
269
269
|
}
|
|
270
270
|
});
|
|
271
271
|
//#endregion
|
|
272
|
-
export {
|
|
272
|
+
export { M as default };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
1
2
|
export interface TabItem {
|
|
2
3
|
key: string;
|
|
3
4
|
label: string;
|
|
5
|
+
/** A Lucide icon shown at 16px before the label, in the tab's colour. */
|
|
6
|
+
icon?: Component;
|
|
4
7
|
count?: number;
|
|
5
8
|
disabled?: boolean;
|
|
6
9
|
/** Makes the tab a `RouterLink` to this route (needs vue-router in the app). The tab for the current route becomes active by itself. */
|
|
@@ -11,8 +14,10 @@ export interface TabItem {
|
|
|
11
14
|
testid?: string;
|
|
12
15
|
}
|
|
13
16
|
export interface Props {
|
|
14
|
-
/** The tabs: `{ key, label, count?, disabled?, to?, href?, testid? }`. `v-model` holds the active `key`. With `to`, it follows the current route. */
|
|
17
|
+
/** The tabs: `{ key, label, icon?, count?, disabled?, to?, href?, testid? }`. `v-model` holds the active `key`. With `to`, it follows the current route. */
|
|
15
18
|
items: TabItem[];
|
|
19
|
+
/** `soft` is cloud-ui's tab: a tinted active tab with rounded top corners, 4px apart, wrapping onto a second line when crowded. `underline` is a bare label with a 2px line under the active tab, 24px apart, scrolling sideways. */
|
|
20
|
+
variant?: "soft" | "underline";
|
|
16
21
|
}
|
|
17
22
|
type __VLS_Props = Props;
|
|
18
23
|
type __VLS_Slots = {
|
|
@@ -29,7 +34,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
29
34
|
"update:modelValue": (value: string) => any;
|
|
30
35
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
31
36
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
32
|
-
}>, {
|
|
37
|
+
}>, {
|
|
38
|
+
variant: "soft" | "underline";
|
|
39
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
40
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
34
41
|
declare const _default: typeof __VLS_export;
|
|
35
42
|
export default _default;
|