@ac-design/design-system 1.0.3 → 2.0.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/README.md +27 -18
- package/dist/lib/charts/ChartFrame.js +5 -0
- package/dist/lib/charts/ChartFrame.vue.d.ts +69 -0
- package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +168 -0
- package/dist/lib/charts/index.d.ts +7 -0
- package/dist/lib/charts/index.js +5 -0
- package/dist/lib/charts/shared.d.ts +60 -0
- package/dist/lib/charts/shared.js +114 -0
- package/dist/lib/charts/xy.d.ts +65 -0
- package/dist/lib/charts/xy.js +92 -0
- package/dist/lib/compat.css +1707 -1042
- package/dist/lib/components/AcAccordion.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcAccordionItem.vue.d.ts +1 -1
- package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/lib/components/AcAlert.vue.d.ts +1 -1
- package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +19 -25
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +19 -19
- package/dist/lib/components/AcAreaChart.js +5 -0
- package/dist/lib/components/AcAreaChart.vue.d.ts +44 -0
- package/dist/lib/components/AcAreaChart.vue_vue_type_script_setup_true_lang.js +215 -0
- package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcBadge.vue.d.ts +16 -7
- package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +59 -43
- package/dist/lib/components/AcBanner.vue.d.ts +1 -1
- package/dist/lib/components/AcBanner.vue_vue_type_script_setup_true_lang.js +30 -30
- package/dist/lib/components/AcBarChart.js +5 -0
- package/dist/lib/components/AcBarChart.vue.d.ts +43 -0
- package/dist/lib/components/AcBarChart.vue_vue_type_script_setup_true_lang.js +217 -0
- package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +27 -26
- package/dist/lib/components/AcBulkActionBar.js +5 -0
- package/dist/lib/components/AcBulkActionBar.vue.d.ts +43 -0
- package/dist/lib/components/AcBulkActionBar.vue_vue_type_script_setup_true_lang.js +84 -0
- package/dist/lib/components/AcButton.vue.d.ts +3 -3
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +42 -34
- package/dist/lib/components/AcButtons.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcCard.vue.d.ts +10 -2
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +37 -11
- package/dist/lib/components/AcCellValue.vue.d.ts +4 -1
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +214 -179
- package/dist/lib/components/AcCheckBox.vue.d.ts +17 -3
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +126 -29
- package/dist/lib/components/AcCheckRadio.vue.d.ts +1 -1
- package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +33 -21
- package/dist/lib/components/AcCircularProgress.js +5 -0
- package/dist/lib/components/AcCircularProgress.vue.d.ts +44 -0
- package/dist/lib/components/AcCircularProgress.vue_vue_type_script_setup_true_lang.js +111 -0
- package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +142 -167
- package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/lib/components/AcColorInput.js +5 -0
- package/dist/lib/components/AcColorInput.vue.d.ts +54 -0
- package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +187 -0
- package/dist/lib/components/AcConfirmModal.js +5 -0
- package/dist/lib/components/AcConfirmModal.vue.d.ts +56 -0
- package/dist/lib/components/AcConfirmModal.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/lib/components/AcContentHeader.vue.d.ts +1 -1
- package/dist/lib/components/AcContentHeader.vue_vue_type_script_setup_true_lang.js +5 -4
- package/dist/lib/components/AcContentLayout.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcCopyButton.js +5 -0
- package/dist/lib/components/AcCopyButton.vue.d.ts +43 -0
- package/dist/lib/components/AcCopyButton.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/lib/components/AcDatePicker.vue.d.ts +5 -5
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +204 -213
- package/dist/lib/components/AcDeleteModal.vue.d.ts +4 -4
- package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +37 -46
- package/dist/lib/components/AcDonutChart.js +5 -0
- package/dist/lib/components/AcDonutChart.vue.d.ts +73 -0
- package/dist/lib/components/AcDonutChart.vue_vue_type_script_setup_true_lang.js +210 -0
- package/dist/lib/components/AcDropdown.vue.d.ts +1 -1
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcDropdownItem.vue.d.ts +1 -1
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/lib/components/AcEmptyState.vue.d.ts +4 -1
- package/dist/lib/components/AcEmptyState.vue_vue_type_script_setup_true_lang.js +50 -39
- package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +14 -13
- package/dist/lib/components/AcFileEditor.vue_vue_type_script_setup_true_lang.js +16 -16
- package/dist/lib/components/AcFileUpload.vue.d.ts +2 -2
- package/dist/lib/components/AcFileUpload.vue_vue_type_script_setup_true_lang.js +55 -53
- package/dist/lib/components/AcFontScale.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcFooter.js +5 -0
- package/dist/lib/components/AcFooter.vue.d.ts +37 -0
- package/dist/lib/components/AcFooter.vue_vue_type_script_setup_true_lang.js +107 -0
- package/dist/lib/components/AcForm.vue.d.ts +3 -0
- package/dist/lib/components/AcForm.vue_vue_type_script_setup_true_lang.js +4 -2
- package/dist/lib/components/AcFormArray.vue.d.ts +2 -2
- package/dist/lib/components/AcFormArray.vue_vue_type_script_setup_true_lang.js +149 -147
- package/dist/lib/components/AcFormFooter.vue.d.ts +2 -2
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcFormSection.vue.d.ts +7 -0
- package/dist/lib/components/AcFormSection.vue_vue_type_script_setup_true_lang.js +31 -21
- package/dist/lib/components/AcHeader.vue.d.ts +3 -3
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +22 -22
- package/dist/lib/components/AcInfoTable.vue_vue_type_script_setup_true_lang.js +17 -13
- package/dist/lib/components/AcInput.vue.d.ts +3 -3
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +98 -87
- package/dist/lib/components/AcKbd.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcKeyValueInput.js +5 -0
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +114 -0
- package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +320 -0
- package/dist/lib/components/AcLineChart.js +5 -0
- package/dist/lib/components/AcLineChart.vue.d.ts +38 -0
- package/dist/lib/components/AcLineChart.vue_vue_type_script_setup_true_lang.js +187 -0
- package/dist/lib/components/AcLocaleSwitcher.js +5 -0
- package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +46 -0
- package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +23 -23
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/lib/components/AcNavbarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +22 -22
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +26 -26
- package/dist/lib/components/AcNumberInput.js +5 -0
- package/dist/lib/components/AcNumberInput.vue.d.ts +79 -0
- package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +251 -0
- package/dist/lib/components/AcPage.vue.d.ts +2 -2
- package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcPagination.vue.d.ts +20 -3
- package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +81 -53
- package/dist/lib/components/AcPreloader.vue.d.ts +1 -1
- package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/lib/components/AcProgress.vue.d.ts +2 -2
- package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcResourceCard.vue.d.ts +2 -2
- package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +13 -13
- package/dist/lib/components/AcSearchBar.vue.d.ts +1 -1
- package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +9 -8
- package/dist/lib/components/AcSectionContent.vue.d.ts +2 -2
- package/dist/lib/components/AcSectionContent.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcSegmentedControl.vue.d.ts +1 -1
- package/dist/lib/components/AcSegmentedControl.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcSelect.vue.d.ts +4 -4
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +230 -227
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +31 -31
- package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
- package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +37 -37
- package/dist/lib/components/AcSidebar.vue.d.ts +3 -3
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +75 -75
- package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +33 -32
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/lib/components/AcSkeleton.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcSlider.vue.d.ts +1 -1
- package/dist/lib/components/AcSlider.vue_vue_type_script_setup_true_lang.js +174 -172
- package/dist/lib/components/AcStatCard.vue.d.ts +3 -3
- package/dist/lib/components/AcStatCard.vue_vue_type_script_setup_true_lang.js +90 -85
- package/dist/lib/components/AcStatusBar.vue.d.ts +1 -1
- package/dist/lib/components/AcStatusBar.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +28 -28
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +39 -34
- package/dist/lib/components/AcSwitchCard.js +5 -0
- package/dist/lib/components/AcSwitchCard.vue.d.ts +59 -0
- package/dist/lib/components/AcSwitchCard.vue_vue_type_script_setup_true_lang.js +119 -0
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +87 -87
- package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcTag.vue.d.ts +1 -1
- package/dist/lib/components/AcTag.vue_vue_type_script_setup_true_lang.js +22 -22
- package/dist/lib/components/AcTagInput.js +5 -0
- package/dist/lib/components/AcTagInput.vue.d.ts +74 -0
- package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +291 -0
- package/dist/lib/components/AcTextarea.vue.d.ts +3 -3
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +89 -64
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/lib/components/AcTimePicker.js +5 -0
- package/dist/lib/components/AcTimePicker.vue.d.ts +65 -0
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +463 -0
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +65 -71
- package/dist/lib/components/AcTooltip.vue.d.ts +1 -1
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +77 -67
- package/dist/lib/components/AcUsageCard.vue_vue_type_script_setup_true_lang.js +27 -27
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +111 -103
- package/dist/lib/components/index.d.ts +14 -2
- package/dist/lib/components/status.d.ts +26 -0
- package/dist/lib/components/status.js +110 -0
- package/dist/lib/composables/copyText.d.ts +2 -1
- package/dist/lib/composables/copyText.js +2 -2
- package/dist/lib/composables/useApiPagination.d.ts +55 -0
- package/dist/lib/composables/useApiPagination.js +58 -0
- package/dist/lib/composables/useBulkSelection.d.ts +44 -0
- package/dist/lib/composables/useBulkSelection.js +41 -0
- package/dist/lib/composables/useFormValidation.d.ts +65 -0
- package/dist/lib/composables/useFormValidation.js +148 -0
- package/dist/lib/composables/useTablePagination.d.ts +49 -0
- package/dist/lib/composables/useTablePagination.js +41 -0
- package/dist/lib/editor/theme.js +65 -62
- package/dist/lib/index.d.ts +14 -0
- package/dist/lib/index.js +95 -78
- package/dist/lib/theme.css +391 -272
- package/package.json +11 -4
|
@@ -1,88 +1,104 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { statusMeta as e } from "./status.js";
|
|
2
|
+
import { computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, defineComponent as o, normalizeClass as s, openBlock as c, renderSlot as l, toDisplayString as u } from "vue";
|
|
2
3
|
//#region src/lib/components/AcBadge.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var
|
|
4
|
+
var d = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "relative flex size-1.5 shrink-0",
|
|
7
|
+
"aria-hidden": "true"
|
|
8
|
+
}, f = /*@__PURE__*/ o({
|
|
4
9
|
__name: "AcBadge",
|
|
5
10
|
props: {
|
|
6
|
-
label: { default:
|
|
7
|
-
color: { default:
|
|
8
|
-
variant: { default:
|
|
11
|
+
label: { default: void 0 },
|
|
12
|
+
color: { default: void 0 },
|
|
13
|
+
variant: { default: void 0 },
|
|
9
14
|
rounded: {
|
|
10
15
|
type: Boolean,
|
|
11
|
-
default: !
|
|
16
|
+
default: !0
|
|
12
17
|
},
|
|
13
18
|
dot: {
|
|
14
19
|
type: Boolean,
|
|
15
|
-
default:
|
|
20
|
+
default: void 0
|
|
21
|
+
},
|
|
22
|
+
status: { default: void 0 },
|
|
23
|
+
prefix: { default: "" },
|
|
24
|
+
pulse: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: void 0
|
|
16
27
|
}
|
|
17
28
|
},
|
|
18
|
-
setup(
|
|
19
|
-
let
|
|
29
|
+
setup(o) {
|
|
30
|
+
let f = o, p = {
|
|
20
31
|
primary: [
|
|
21
32
|
"bg-primary text-white",
|
|
22
|
-
"bg-primary
|
|
23
|
-
"ring-primary
|
|
24
|
-
"bg-primary
|
|
33
|
+
"bg-primary/10 text-primary-strong ring-primary/25",
|
|
34
|
+
"ring-primary/40 text-primary-strong",
|
|
35
|
+
"bg-primary"
|
|
25
36
|
],
|
|
26
37
|
secondary: [
|
|
27
38
|
"bg-secondary text-white",
|
|
28
|
-
"bg-secondary-95 text-secondary-
|
|
39
|
+
"bg-secondary-95 text-secondary-20 ring-secondary-40/25",
|
|
29
40
|
"ring-secondary-70 text-secondary",
|
|
30
41
|
"bg-secondary-40"
|
|
31
42
|
],
|
|
32
43
|
info: [
|
|
33
44
|
"bg-info text-white",
|
|
34
|
-
"bg-
|
|
35
|
-
"ring-
|
|
36
|
-
"bg-
|
|
45
|
+
"bg-info/10 text-info-strong ring-info/25",
|
|
46
|
+
"ring-info/40 text-info-strong",
|
|
47
|
+
"bg-info"
|
|
37
48
|
],
|
|
38
49
|
success: [
|
|
39
50
|
"bg-success text-white",
|
|
40
|
-
"bg-
|
|
41
|
-
"ring-
|
|
42
|
-
"bg-
|
|
51
|
+
"bg-success/10 text-success-strong ring-success/25",
|
|
52
|
+
"ring-success/40 text-success-strong",
|
|
53
|
+
"bg-success"
|
|
43
54
|
],
|
|
44
55
|
warning: [
|
|
45
56
|
"bg-warning text-on-warning",
|
|
46
|
-
"bg-
|
|
47
|
-
"ring-
|
|
48
|
-
"bg-
|
|
57
|
+
"bg-warning/10 text-warning-strong ring-warning/30",
|
|
58
|
+
"ring-warning/45 text-warning-strong",
|
|
59
|
+
"bg-warning"
|
|
49
60
|
],
|
|
50
61
|
danger: [
|
|
51
62
|
"bg-danger text-white",
|
|
52
|
-
"bg-
|
|
53
|
-
"ring-
|
|
54
|
-
"bg-
|
|
63
|
+
"bg-danger/10 text-danger-strong ring-danger/25",
|
|
64
|
+
"ring-danger/40 text-danger-strong",
|
|
65
|
+
"bg-danger"
|
|
66
|
+
],
|
|
67
|
+
pending: [
|
|
68
|
+
"bg-pending text-white",
|
|
69
|
+
"bg-pending/10 text-pending-strong ring-pending/25",
|
|
70
|
+
"ring-pending/40 text-pending-strong",
|
|
71
|
+
"bg-pending"
|
|
55
72
|
],
|
|
56
73
|
dark: [
|
|
57
|
-
"bg-
|
|
58
|
-
"bg-
|
|
59
|
-
"ring-
|
|
60
|
-
"bg-
|
|
74
|
+
"bg-slate-20 text-surface",
|
|
75
|
+
"bg-slate-20/10 text-heading ring-slate-20/20",
|
|
76
|
+
"ring-slate-20/40 text-heading",
|
|
77
|
+
"bg-slate-20"
|
|
61
78
|
],
|
|
62
79
|
default: [
|
|
63
80
|
"bg-surface-sunken text-heading",
|
|
64
|
-
"bg-surface-
|
|
65
|
-
"ring-border
|
|
66
|
-
"bg-
|
|
81
|
+
"bg-surface-sunken text-muted ring-border",
|
|
82
|
+
"ring-border text-muted",
|
|
83
|
+
"bg-muted"
|
|
67
84
|
]
|
|
68
|
-
},
|
|
69
|
-
let [e, t, n] =
|
|
85
|
+
}, m = t(() => f.status === void 0 ? null : e(f.status, { prefix: f.prefix })), h = t(() => f.color ?? m.value?.tone ?? "default"), g = t(() => f.variant ?? (m.value ? "light" : "solid")), _ = t(() => f.label || m.value?.label || "Default"), v = t(() => f.pulse ?? m.value?.transient ?? !1), y = t(() => f.dot ?? (!!m.value || v.value)), b = t(() => {
|
|
86
|
+
let [e, t, n] = p[h.value];
|
|
70
87
|
return {
|
|
71
88
|
solid: e,
|
|
72
89
|
light: `ring-1 ring-inset ${t}`,
|
|
73
90
|
outlined: `bg-surface ring-1 ring-inset ${n}`
|
|
74
|
-
}[
|
|
75
|
-
}),
|
|
76
|
-
return (e,
|
|
77
|
-
class:
|
|
91
|
+
}[g.value];
|
|
92
|
+
}), x = t(() => g.value === "solid" && h.value !== "default" ? "bg-surface" : p[h.value][3]);
|
|
93
|
+
return (e, t) => (c(), r("span", {
|
|
94
|
+
class: s(["inline-flex h-5.5 items-center gap-1.5 px-2 text-xs leading-none font-medium whitespace-nowrap tabular-nums", [b.value, o.rounded ? "rounded-full" : "rounded-6"]]),
|
|
78
95
|
"data-ac-ds": "",
|
|
79
96
|
"data-testid": "ac-badge"
|
|
80
|
-
}, [
|
|
97
|
+
}, [y.value ? (c(), r("span", d, [v.value ? (c(), r("span", {
|
|
81
98
|
key: 0,
|
|
82
|
-
class:
|
|
83
|
-
|
|
84
|
-
}, null, 2)) : t("", !0), s(e.$slots, "default", {}, () => [r(c(i.label), 1)])], 2));
|
|
99
|
+
class: s(["absolute inset-0 rounded-full opacity-60 motion-safe:animate-ping", x.value])
|
|
100
|
+
}, null, 2)) : n("", !0), i("span", { class: s(["relative size-1.5 rounded-full", x.value]) }, null, 2)])) : n("", !0), l(e.$slots, "default", {}, () => [a(u(_.value), 1)])], 2));
|
|
85
101
|
}
|
|
86
102
|
});
|
|
87
103
|
//#endregion
|
|
88
|
-
export {
|
|
104
|
+
export { f as default };
|
|
@@ -2,7 +2,7 @@ import type { Component } from "vue";
|
|
|
2
2
|
export interface Props {
|
|
3
3
|
/** Colour of the strip. `danger` and `warning` are announced to screen readers as alerts. */
|
|
4
4
|
color?: "info" | "warning" | "danger" | "primary" | "neutral";
|
|
5
|
-
/** `subtle`
|
|
5
|
+
/** `subtle` 10% tint with a hairline and AA-contrast text, or `solid` full-colour fill for app-wide announcements. */
|
|
6
6
|
variant?: "subtle" | "solid";
|
|
7
7
|
/** Bold lead-in before the message, e.g. "Scheduled maintenance". */
|
|
8
8
|
title?: string;
|
|
@@ -2,9 +2,12 @@ import { computed as e, createBlock as t, createCommentVNode as n, createElement
|
|
|
2
2
|
import { ArrowRight as g, CircleAlert as _, Info as v, Megaphone as y, TriangleAlert as b, X as x } from "@lucide/vue";
|
|
3
3
|
//#region src/lib/components/AcBanner.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
var S = ["role"], C = { class: "flex min-w-0 flex-1 flex-col gap-x-4 gap-y-1.5 sm:flex-row sm:flex-wrap sm:items-center" }, w = { class: "min-w-0" }, T = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "font-semibold"
|
|
7
|
+
}, E = {
|
|
5
8
|
key: 1,
|
|
6
9
|
"aria-hidden": "true"
|
|
7
|
-
},
|
|
10
|
+
}, D = ["href"], O = /*@__PURE__*/ s({
|
|
8
11
|
__name: "AcBanner",
|
|
9
12
|
props: /*@__PURE__*/ c({
|
|
10
13
|
color: { default: "info" },
|
|
@@ -30,79 +33,76 @@ var S = ["role"], C = { class: "flex min-w-0 flex-1 flex-col gap-x-4 gap-y-1.5 s
|
|
|
30
33
|
}),
|
|
31
34
|
emits: /*@__PURE__*/ c(["action", "close"], ["update:open"]),
|
|
32
35
|
setup(s, { emit: c }) {
|
|
33
|
-
let
|
|
36
|
+
let O = s, k = h(s, "open"), A = c, j = {
|
|
34
37
|
info: {
|
|
35
|
-
subtle: "border-
|
|
38
|
+
subtle: "border-info/25 bg-info/10 text-info-strong",
|
|
36
39
|
solid: "border-black/15 bg-info text-white",
|
|
37
|
-
icon: "text-
|
|
40
|
+
icon: "text-info-strong",
|
|
38
41
|
glyph: v
|
|
39
42
|
},
|
|
40
43
|
warning: {
|
|
41
|
-
subtle: "border-
|
|
44
|
+
subtle: "border-warning/30 bg-warning/10 text-warning-strong",
|
|
42
45
|
solid: "border-black/15 bg-warning text-on-warning",
|
|
43
|
-
icon: "text-
|
|
46
|
+
icon: "text-warning-strong",
|
|
44
47
|
glyph: b
|
|
45
48
|
},
|
|
46
49
|
danger: {
|
|
47
|
-
subtle: "border-
|
|
50
|
+
subtle: "border-danger/25 bg-danger/10 text-danger-strong",
|
|
48
51
|
solid: "border-black/15 bg-danger text-white",
|
|
49
|
-
icon: "text-
|
|
52
|
+
icon: "text-danger-strong",
|
|
50
53
|
glyph: _
|
|
51
54
|
},
|
|
52
55
|
primary: {
|
|
53
|
-
subtle: "border-primary
|
|
56
|
+
subtle: "border-primary/25 bg-primary/10 text-primary-strong",
|
|
54
57
|
solid: "border-black/15 bg-primary text-white",
|
|
55
|
-
icon: "text-primary",
|
|
58
|
+
icon: "text-primary-strong",
|
|
56
59
|
glyph: y
|
|
57
60
|
},
|
|
58
61
|
neutral: {
|
|
59
|
-
subtle: "border-border bg-surface-
|
|
62
|
+
subtle: "border-border bg-surface-sunken text-muted",
|
|
60
63
|
solid: "border-black/15 bg-heading text-surface",
|
|
61
64
|
icon: "text-muted",
|
|
62
65
|
glyph: v
|
|
63
66
|
}
|
|
64
|
-
},
|
|
65
|
-
function
|
|
66
|
-
|
|
67
|
+
}, M = e(() => j[O.color]), N = e(() => O.icon ?? M.value.glyph);
|
|
68
|
+
function P() {
|
|
69
|
+
k.value = !1, A("close");
|
|
67
70
|
}
|
|
68
|
-
return (e, c) =>
|
|
71
|
+
return (e, c) => k.value ? (u(), r("div", {
|
|
69
72
|
key: 0,
|
|
70
|
-
class: l(["flex w-full items-start gap-3 border-b px-4 py-2.5 text-base sm:items-center sm:px-6", [
|
|
73
|
+
class: l(["flex w-full items-start gap-3 border-b px-4 py-2.5 text-base sm:items-center sm:px-6 [&_strong]:text-inherit", [M.value[s.variant], s.variant === "solid" && "[&_a]:text-inherit"]]),
|
|
71
74
|
role: s.color === "danger" || s.color === "warning" ? "alert" : "status",
|
|
72
75
|
"data-ac-ds": "",
|
|
73
76
|
"data-testid": "ac-banner"
|
|
74
77
|
}, [
|
|
75
|
-
s.hideIcon ? n("", !0) : (u(), t(f(
|
|
78
|
+
s.hideIcon ? n("", !0) : (u(), t(f(N.value), {
|
|
76
79
|
key: 0,
|
|
77
|
-
class: l(["mt-0.5 size-4 shrink-0 sm:mt-0", s.variant === "subtle" ?
|
|
80
|
+
class: l(["mt-0.5 size-4 shrink-0 sm:mt-0", s.variant === "subtle" ? M.value.icon : "opacity-90"]),
|
|
78
81
|
"aria-hidden": "true"
|
|
79
82
|
}, null, 8, ["class"])),
|
|
80
83
|
i("div", C, [i("p", w, [
|
|
81
|
-
s.title ? (u(), r("strong",
|
|
82
|
-
|
|
83
|
-
class: l(["font-semibold", s.variant === "subtle" && "text-heading"])
|
|
84
|
-
}, p(s.title), 3)) : n("", !0),
|
|
85
|
-
s.title && e.$slots.default ? (u(), r("span", T, " · ")) : n("", !0),
|
|
84
|
+
s.title ? (u(), r("strong", T, p(s.title), 1)) : n("", !0),
|
|
85
|
+
s.title && e.$slots.default ? (u(), r("span", E, " · ")) : n("", !0),
|
|
86
86
|
d(e.$slots, "default")
|
|
87
87
|
]), d(e.$slots, "action", {}, () => [s.actionLabel && s.actionHref ? (u(), r("a", {
|
|
88
88
|
key: 0,
|
|
89
89
|
href: s.actionHref,
|
|
90
|
-
class: "inline-flex shrink-0 items-center gap-1 font-medium whitespace-nowrap underline decoration-current/40 underline-offset-2 transition hover:decoration-current focus-visible:rounded-
|
|
90
|
+
class: "inline-flex shrink-0 items-center gap-1 font-medium whitespace-nowrap underline decoration-current/40 underline-offset-2 transition-colors duration-200 hover:decoration-current focus-visible:rounded-4 focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none"
|
|
91
91
|
}, [a(p(s.actionLabel), 1), o(m(g), {
|
|
92
92
|
class: "size-3.5",
|
|
93
93
|
"aria-hidden": "true"
|
|
94
|
-
})], 8,
|
|
94
|
+
})], 8, D)) : s.actionLabel ? (u(), r("button", {
|
|
95
95
|
key: 1,
|
|
96
96
|
type: "button",
|
|
97
|
-
class: l(["inline-flex h-
|
|
98
|
-
onClick: c[0] ||= (e) =>
|
|
97
|
+
class: l(["inline-flex h-8 shrink-0 cursor-pointer items-center self-start rounded-10 border px-3 text-base font-medium whitespace-nowrap transition-[color,background-color,border-color,transform] duration-200 focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none active:translate-y-px motion-reduce:active:translate-y-0 sm:-my-1.5 sm:self-auto", s.variant === "solid" ? "border-current/30 bg-current/10 hover:bg-current/20" : "border-border bg-surface text-heading hover:bg-surface-sunken"]),
|
|
98
|
+
onClick: c[0] ||= (e) => A("action")
|
|
99
99
|
}, p(s.actionLabel), 3)) : n("", !0)])]),
|
|
100
100
|
s.dismissible ? (u(), r("button", {
|
|
101
101
|
key: 1,
|
|
102
102
|
type: "button",
|
|
103
|
-
class: "-my-1 -mr-
|
|
103
|
+
class: "-my-1.5 -mr-2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-8 opacity-75 transition-[background-color,opacity] duration-200 hover:bg-current/10 hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
104
104
|
"aria-label": "Dismiss",
|
|
105
|
-
onClick:
|
|
105
|
+
onClick: P
|
|
106
106
|
}, [o(m(x), {
|
|
107
107
|
class: "size-4",
|
|
108
108
|
"aria-hidden": "true"
|
|
@@ -111,4 +111,4 @@ var S = ["role"], C = { class: "flex min-w-0 flex-1 flex-col gap-x-4 gap-y-1.5 s
|
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
113
|
//#endregion
|
|
114
|
-
export {
|
|
114
|
+
export { O as default };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ChartTooltipSlotProps } from "../charts/ChartFrame.vue";
|
|
2
|
+
import type { XYChartProps } from "../charts/xy";
|
|
3
|
+
export interface Props extends XYChartProps {
|
|
4
|
+
/** Stacks the series in one bar per row, so its length shows the total. Otherwise the series sit side by side. */
|
|
5
|
+
stacked?: boolean;
|
|
6
|
+
/** `vertical` columns, or `horizontal` bars for long category names and rankings. */
|
|
7
|
+
orientation?: "vertical" | "horizontal";
|
|
8
|
+
/** Corner radius of each bar's end, in px. */
|
|
9
|
+
radius?: number;
|
|
10
|
+
/** Widest a bar (or a group of bars) may get, in px, so a few rows don't make slabs. */
|
|
11
|
+
barMaxWidth?: number;
|
|
12
|
+
}
|
|
13
|
+
type __VLS_Slots = {
|
|
14
|
+
/** Replaces the tooltip body for the hovered row. */
|
|
15
|
+
tooltip?: (props: ChartTooltipSlotProps) => unknown;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
18
|
+
legend: import("../charts/shared").ChartLegendPosition;
|
|
19
|
+
title: string;
|
|
20
|
+
description: string;
|
|
21
|
+
height: number;
|
|
22
|
+
orientation: "vertical" | "horizontal";
|
|
23
|
+
radius: number;
|
|
24
|
+
loading: boolean;
|
|
25
|
+
tooltip: boolean;
|
|
26
|
+
emptyText: string;
|
|
27
|
+
stacked: boolean;
|
|
28
|
+
gridLines: boolean;
|
|
29
|
+
xFormatter: (value: Date | number | string) => string;
|
|
30
|
+
yFormatter: (value: number) => string;
|
|
31
|
+
xLabel: string;
|
|
32
|
+
yLabel: string;
|
|
33
|
+
yDomain: [number | undefined, number | undefined];
|
|
34
|
+
barMaxWidth: number;
|
|
35
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
36
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
37
|
+
declare const _default: typeof __VLS_export;
|
|
38
|
+
export default _default;
|
|
39
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
40
|
+
new (): {
|
|
41
|
+
$slots: S;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import e from "../charts/ChartFrame.js";
|
|
2
|
+
import { chartDuration as t } from "../charts/shared.js";
|
|
3
|
+
import { useXYChart as n } from "../charts/xy.js";
|
|
4
|
+
import { computed as r, createBlock as i, createSlots as a, createVNode as o, defineComponent as s, guardReactiveProps as c, isRef as l, normalizeProps as u, openBlock as d, ref as f, renderSlot as p, unref as m, withCtx as h } from "vue";
|
|
5
|
+
import { ChartColumn as g } from "@lucide/vue";
|
|
6
|
+
import { VisAxis as _, VisGroupedBar as v, VisStackedBar as y, VisXYContainer as b } from "@unovis/vue";
|
|
7
|
+
import { GroupedBar as x, StackedBar as S } from "@unovis/ts";
|
|
8
|
+
//#region src/lib/components/AcBarChart.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
var C = /*@__PURE__*/ s({
|
|
10
|
+
__name: "AcBarChart",
|
|
11
|
+
props: {
|
|
12
|
+
stacked: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: !1
|
|
15
|
+
},
|
|
16
|
+
orientation: { default: "vertical" },
|
|
17
|
+
radius: { default: 4 },
|
|
18
|
+
barMaxWidth: { default: 48 },
|
|
19
|
+
data: {},
|
|
20
|
+
index: {},
|
|
21
|
+
categories: {},
|
|
22
|
+
height: { default: 280 },
|
|
23
|
+
xFormatter: {
|
|
24
|
+
type: Function,
|
|
25
|
+
default: void 0
|
|
26
|
+
},
|
|
27
|
+
yFormatter: {
|
|
28
|
+
type: Function,
|
|
29
|
+
default: void 0
|
|
30
|
+
},
|
|
31
|
+
xLabel: { default: "" },
|
|
32
|
+
yLabel: { default: "" },
|
|
33
|
+
legend: { default: "top" },
|
|
34
|
+
tooltip: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: !0
|
|
37
|
+
},
|
|
38
|
+
gridLines: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: !0
|
|
41
|
+
},
|
|
42
|
+
yDomain: { default: void 0 },
|
|
43
|
+
loading: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: !1
|
|
46
|
+
},
|
|
47
|
+
emptyText: { default: "No data to show yet" },
|
|
48
|
+
title: { default: "" },
|
|
49
|
+
description: { default: "" }
|
|
50
|
+
},
|
|
51
|
+
setup(s) {
|
|
52
|
+
let C = s, w = t(), { hidden: T, width: E, visibleKeys: D, colors: O, legendItems: k, x: A, yAccessors: j, xTickValues: M, yTicks: N, xTickFormat: P, formatY: F, rowLabel: I, yDomain: L, tooltipItems: R, tooltipTotal: z, table: B, ariaLabel: V } = n(C, {
|
|
53
|
+
stacked: () => C.stacked,
|
|
54
|
+
positions: !0,
|
|
55
|
+
horizontal: () => C.orientation === "horizontal"
|
|
56
|
+
}), H = f(null), U = r(() => C.orientation === "horizontal"), W = r(() => U.value ? "y" : "x"), G = r(() => U.value ? "x" : "y"), K = r(() => U.value ? Math.max(2, Math.floor((E.value || 640) / 90)) : N.value), q = Symbol("row"), J = r(() => C.data.map((e, t) => ({
|
|
57
|
+
...e,
|
|
58
|
+
[q]: t
|
|
59
|
+
})));
|
|
60
|
+
function Y(e, t) {
|
|
61
|
+
let n = e[q], r = n === void 0 ? void 0 : C.data[n];
|
|
62
|
+
r && n !== void 0 && (H.value = {
|
|
63
|
+
clientX: t.clientX,
|
|
64
|
+
clientY: t.clientY,
|
|
65
|
+
title: I(n),
|
|
66
|
+
items: R(r),
|
|
67
|
+
total: C.stacked && D.value.length > 1 ? z(r) : void 0,
|
|
68
|
+
datum: r,
|
|
69
|
+
index: n
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function X() {
|
|
73
|
+
H.value = null;
|
|
74
|
+
}
|
|
75
|
+
let Z = r(() => ({ [C.stacked ? S.selectors.barGroup : x.selectors.barGroup]: {
|
|
76
|
+
mousemove: Y,
|
|
77
|
+
mouseleave: X
|
|
78
|
+
} }));
|
|
79
|
+
return (t, n) => (d(), i(e, {
|
|
80
|
+
hidden: m(T),
|
|
81
|
+
"onUpdate:hidden": n[0] ||= (e) => l(T) ? T.value = e : null,
|
|
82
|
+
width: m(E),
|
|
83
|
+
"onUpdate:width": n[1] ||= (e) => l(E) ? E.value = e : null,
|
|
84
|
+
testid: "ac-bar-chart",
|
|
85
|
+
height: s.height,
|
|
86
|
+
loading: s.loading,
|
|
87
|
+
empty: !s.data.length,
|
|
88
|
+
"empty-text": s.emptyText,
|
|
89
|
+
"empty-icon": m(g),
|
|
90
|
+
legend: s.legend,
|
|
91
|
+
"legend-items": m(k),
|
|
92
|
+
summary: m(V),
|
|
93
|
+
title: s.title,
|
|
94
|
+
description: s.description,
|
|
95
|
+
table: m(B),
|
|
96
|
+
tip: H.value,
|
|
97
|
+
tooltip: s.tooltip
|
|
98
|
+
}, a({
|
|
99
|
+
default: h(() => [o(m(b), {
|
|
100
|
+
data: J.value,
|
|
101
|
+
height: s.height,
|
|
102
|
+
duration: m(w),
|
|
103
|
+
"y-domain": U.value ? void 0 : m(L),
|
|
104
|
+
"x-domain": U.value ? m(L) : void 0,
|
|
105
|
+
"y-direction": U.value ? "south" : void 0,
|
|
106
|
+
padding: {
|
|
107
|
+
top: 8,
|
|
108
|
+
right: 8
|
|
109
|
+
}
|
|
110
|
+
}, {
|
|
111
|
+
default: h(() => [
|
|
112
|
+
s.stacked ? (d(), i(m(y), {
|
|
113
|
+
key: 0,
|
|
114
|
+
x: m(A),
|
|
115
|
+
y: m(j),
|
|
116
|
+
color: m(O),
|
|
117
|
+
orientation: s.orientation,
|
|
118
|
+
"rounded-corners": s.radius,
|
|
119
|
+
"bar-max-width": s.barMaxWidth,
|
|
120
|
+
"bar-padding": .3,
|
|
121
|
+
events: s.tooltip ? Z.value : void 0
|
|
122
|
+
}, null, 8, [
|
|
123
|
+
"x",
|
|
124
|
+
"y",
|
|
125
|
+
"color",
|
|
126
|
+
"orientation",
|
|
127
|
+
"rounded-corners",
|
|
128
|
+
"bar-max-width",
|
|
129
|
+
"events"
|
|
130
|
+
])) : (d(), i(m(v), {
|
|
131
|
+
key: 1,
|
|
132
|
+
x: m(A),
|
|
133
|
+
y: m(j),
|
|
134
|
+
color: m(O),
|
|
135
|
+
orientation: s.orientation,
|
|
136
|
+
"rounded-corners": s.radius,
|
|
137
|
+
"group-max-width": s.barMaxWidth * Math.max(1, m(D).length),
|
|
138
|
+
"group-padding": .3,
|
|
139
|
+
"bar-padding": .1,
|
|
140
|
+
events: s.tooltip ? Z.value : void 0
|
|
141
|
+
}, null, 8, [
|
|
142
|
+
"x",
|
|
143
|
+
"y",
|
|
144
|
+
"color",
|
|
145
|
+
"orientation",
|
|
146
|
+
"rounded-corners",
|
|
147
|
+
"group-max-width",
|
|
148
|
+
"events"
|
|
149
|
+
])),
|
|
150
|
+
o(m(_), {
|
|
151
|
+
type: W.value,
|
|
152
|
+
label: s.xLabel || void 0,
|
|
153
|
+
"tick-format": m(P),
|
|
154
|
+
"tick-values": m(M),
|
|
155
|
+
"min-max-ticks-only-when-width-is-less": 160,
|
|
156
|
+
"grid-line": !1,
|
|
157
|
+
"tick-line": !1,
|
|
158
|
+
"domain-line": !U.value,
|
|
159
|
+
"tick-text-hide-overlapping": !0
|
|
160
|
+
}, null, 8, [
|
|
161
|
+
"type",
|
|
162
|
+
"label",
|
|
163
|
+
"tick-format",
|
|
164
|
+
"tick-values",
|
|
165
|
+
"domain-line"
|
|
166
|
+
]),
|
|
167
|
+
o(m(_), {
|
|
168
|
+
type: G.value,
|
|
169
|
+
label: s.yLabel || void 0,
|
|
170
|
+
"tick-format": m(F),
|
|
171
|
+
"num-ticks": K.value,
|
|
172
|
+
"grid-line": s.gridLines,
|
|
173
|
+
"tick-line": !1,
|
|
174
|
+
"domain-line": !1
|
|
175
|
+
}, null, 8, [
|
|
176
|
+
"type",
|
|
177
|
+
"label",
|
|
178
|
+
"tick-format",
|
|
179
|
+
"num-ticks",
|
|
180
|
+
"grid-line"
|
|
181
|
+
])
|
|
182
|
+
]),
|
|
183
|
+
_: 1
|
|
184
|
+
}, 8, [
|
|
185
|
+
"data",
|
|
186
|
+
"height",
|
|
187
|
+
"duration",
|
|
188
|
+
"y-domain",
|
|
189
|
+
"x-domain",
|
|
190
|
+
"y-direction"
|
|
191
|
+
])]),
|
|
192
|
+
_: 2
|
|
193
|
+
}, [t.$slots.tooltip ? {
|
|
194
|
+
name: "tooltip",
|
|
195
|
+
fn: h((e) => [p(t.$slots, "tooltip", u(c(e)))]),
|
|
196
|
+
key: "0"
|
|
197
|
+
} : void 0]), 1032, [
|
|
198
|
+
"hidden",
|
|
199
|
+
"width",
|
|
200
|
+
"height",
|
|
201
|
+
"loading",
|
|
202
|
+
"empty",
|
|
203
|
+
"empty-text",
|
|
204
|
+
"empty-icon",
|
|
205
|
+
"legend",
|
|
206
|
+
"legend-items",
|
|
207
|
+
"summary",
|
|
208
|
+
"title",
|
|
209
|
+
"description",
|
|
210
|
+
"table",
|
|
211
|
+
"tip",
|
|
212
|
+
"tooltip"
|
|
213
|
+
]));
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
//#endregion
|
|
217
|
+
export { C as default };
|
|
@@ -5,9 +5,9 @@ var b = {
|
|
|
5
5
|
"aria-label": "Breadcrumb",
|
|
6
6
|
"data-ac-ds": "",
|
|
7
7
|
"data-testid": "ac-breadcrumb"
|
|
8
|
-
}, x = { class: "flex min-w-0 flex-wrap items-center gap-
|
|
8
|
+
}, x = { class: "flex min-w-0 flex-wrap items-center gap-0.5 text-base text-muted" }, S = {
|
|
9
9
|
key: 0,
|
|
10
|
-
class: "flex items-center text-
|
|
10
|
+
class: "flex items-center text-muted/50",
|
|
11
11
|
"aria-hidden": "true"
|
|
12
12
|
}, C = {
|
|
13
13
|
key: 1,
|
|
@@ -15,7 +15,11 @@ var b = {
|
|
|
15
15
|
}, w = {
|
|
16
16
|
key: 2,
|
|
17
17
|
class: "flex min-w-0 items-center"
|
|
18
|
-
}, T = ["aria-current"], E = { class: "truncate" }, D = {
|
|
18
|
+
}, T = ["aria-current"], E = { class: "max-w-64 truncate" }, D = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "flex size-5 shrink-0 items-center justify-center rounded-8 bg-primary/10 text-primary",
|
|
21
|
+
"aria-hidden": "true"
|
|
22
|
+
}, O = { class: "max-w-48 truncate" }, k = /*@__PURE__*/ s({
|
|
19
23
|
__name: "AcBreadcrumb",
|
|
20
24
|
props: {
|
|
21
25
|
items: {},
|
|
@@ -26,20 +30,20 @@ var b = {
|
|
|
26
30
|
maxItems: { default: 4 }
|
|
27
31
|
},
|
|
28
32
|
setup(s) {
|
|
29
|
-
let
|
|
30
|
-
let e =
|
|
33
|
+
let k = s, A = c()?.appContext.components.RouterLink, j = f(!1), M = t(() => {
|
|
34
|
+
let e = k.items.map((e, t) => ({
|
|
31
35
|
item: e,
|
|
32
36
|
index: t
|
|
33
37
|
}));
|
|
34
|
-
return
|
|
38
|
+
return j.value || e.length <= k.maxItems ? e : [
|
|
35
39
|
e[0],
|
|
36
40
|
null,
|
|
37
|
-
...e.slice(e.length - (
|
|
41
|
+
...e.slice(e.length - (k.maxItems - 2))
|
|
38
42
|
];
|
|
39
43
|
});
|
|
40
|
-
function
|
|
41
|
-
if (e.to !== void 0 &&
|
|
42
|
-
is:
|
|
44
|
+
function N(e) {
|
|
45
|
+
if (e.to !== void 0 && A) return {
|
|
46
|
+
is: A,
|
|
43
47
|
to: e.to
|
|
44
48
|
};
|
|
45
49
|
let t = e.href ?? (typeof e.to == "string" ? e.to : void 0);
|
|
@@ -48,41 +52,38 @@ var b = {
|
|
|
48
52
|
href: t
|
|
49
53
|
} : null;
|
|
50
54
|
}
|
|
51
|
-
return (t, c) => (d(), i("nav", b, [a("ol", x, [(d(!0), i(e, null, p(
|
|
55
|
+
return (t, c) => (d(), i("nav", b, [a("ol", x, [(d(!0), i(e, null, p(M.value, (t, f) => (d(), i(e, { key: t ? t.index : "ellipsis" }, [f > 0 ? (d(), i("li", S, [o(g(v), { class: "size-3.5 shrink-0" })])) : r("", !0), t ? (d(), i("li", w, [t.index === s.items.length - 1 || !N(t.item) ? (d(), i("span", {
|
|
52
56
|
key: 0,
|
|
53
|
-
class: u(["flex min-w-0 items-center gap-1", t.index === s.items.length - 1 && "font-medium text-heading"]),
|
|
57
|
+
class: u(["flex min-w-0 items-center gap-1.5 px-1.5 py-0.5", t.index === s.items.length - 1 && "font-medium text-heading"]),
|
|
54
58
|
"aria-current": t.index === s.items.length - 1 ? "page" : void 0
|
|
55
59
|
}, [t.item.icon ? (d(), n(m(t.item.icon), {
|
|
56
60
|
key: 0,
|
|
57
|
-
class: "size-
|
|
61
|
+
class: "size-4 shrink-0 text-primary",
|
|
58
62
|
"aria-hidden": "true"
|
|
59
|
-
})) : r("", !0), a("span", E, h(t.item.label), 1)], 10, T)) : (d(), n(m(
|
|
63
|
+
})) : r("", !0), a("span", E, h(t.item.label), 1)], 10, T)) : (d(), n(m(N(t.item).is), l({
|
|
60
64
|
key: 1,
|
|
61
65
|
ref_for: !0
|
|
62
66
|
}, {
|
|
63
|
-
...
|
|
67
|
+
...N(t.item),
|
|
64
68
|
is: void 0
|
|
65
69
|
}, {
|
|
66
|
-
class: "flex min-w-0 items-center gap-1 rounded-
|
|
70
|
+
class: "flex min-w-0 items-center gap-1.5 rounded-8 px-1.5 py-0.5 text-muted no-underline transition-colors duration-200 hover:bg-surface-sunken hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
71
|
+
title: t.item.label,
|
|
67
72
|
"aria-label": s.homeIcon && t.index === 0 ? t.item.label : void 0
|
|
68
73
|
}), {
|
|
69
74
|
default: _(() => [s.homeIcon && t.index === 0 ? (d(), n(g(y), {
|
|
70
75
|
key: 0,
|
|
71
|
-
class: "size-
|
|
72
|
-
"aria-hidden": "true"
|
|
73
|
-
})) : (d(), i(e, { key: 1 }, [t.item.icon ? (d(), n(m(t.item.icon), {
|
|
74
|
-
key: 0,
|
|
75
|
-
class: "size-3.5 shrink-0",
|
|
76
|
+
class: "size-4 shrink-0",
|
|
76
77
|
"aria-hidden": "true"
|
|
77
|
-
})) : r("", !0), a("span",
|
|
78
|
+
})) : (d(), i(e, { key: 1 }, [t.item.icon ? (d(), i("span", D, [(d(), n(m(t.item.icon), { class: "size-3.5" }))])) : r("", !0), a("span", O, h(t.item.label), 1)], 64))]),
|
|
78
79
|
_: 2
|
|
79
|
-
}, 1040, ["aria-label"]))])) : (d(), i("li", C, [a("button", {
|
|
80
|
+
}, 1040, ["title", "aria-label"]))])) : (d(), i("li", C, [a("button", {
|
|
80
81
|
type: "button",
|
|
81
|
-
class: "cursor-pointer rounded-
|
|
82
|
+
class: "cursor-pointer rounded-8 px-1.5 py-0.5 transition-colors duration-200 hover:bg-surface-sunken hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
82
83
|
"aria-label": "Show full path",
|
|
83
|
-
onClick: c[0] ||= (e) =>
|
|
84
|
+
onClick: c[0] ||= (e) => j.value = !0
|
|
84
85
|
}, " … ")]))], 64))), 128))])]));
|
|
85
86
|
}
|
|
86
87
|
});
|
|
87
88
|
//#endregion
|
|
88
|
-
export {
|
|
89
|
+
export { k as default };
|