@ac-design/design-system 1.0.3 → 2.1.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 +71 -0
- package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +173 -0
- 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 +11 -0
- package/dist/lib/charts/index.js +7 -0
- package/dist/lib/charts/shared.d.ts +53 -0
- package/dist/lib/charts/shared.js +96 -0
- package/dist/lib/charts/xy.d.ts +69 -0
- package/dist/lib/charts/xy.js +73 -0
- package/dist/lib/compat.css +2770 -1061
- 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 +10 -1
- package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +139 -45
- 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 +47 -0
- package/dist/lib/components/AcAreaChart.vue_vue_type_script_setup_true_lang.js +205 -0
- package/dist/lib/components/AcAvatar.vue.d.ts +7 -4
- package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +66 -61
- package/dist/lib/components/AcBadge.vue.d.ts +20 -7
- package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +67 -44
- 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 +46 -0
- package/dist/lib/components/AcBarChart.vue_vue_type_script_setup_true_lang.js +213 -0
- package/dist/lib/components/AcBreadcrumb.vue.d.ts +4 -1
- package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +36 -34
- package/dist/lib/components/AcBulkActionBar.js +5 -0
- package/dist/lib/components/AcBulkActionBar.vue.d.ts +45 -0
- package/dist/lib/components/AcBulkActionBar.vue_vue_type_script_setup_true_lang.js +84 -0
- package/dist/lib/components/AcButton.vue.d.ts +13 -7
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +93 -47
- package/dist/lib/components/AcButtons.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcCard.vue.d.ts +42 -3
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +175 -14
- package/dist/lib/components/AcCellValue.vue.d.ts +6 -3
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +219 -178
- package/dist/lib/components/AcCheckBox.vue.d.ts +17 -3
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +113 -30
- 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 +102 -26
- 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 +114 -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 +57 -0
- package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +217 -0
- 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.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 +96 -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/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 +8 -8
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +634 -417
- package/dist/lib/components/AcDeleteModal.vue.d.ts +4 -4
- package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +57 -60
- package/dist/lib/components/AcDonutChart.js +5 -0
- package/dist/lib/components/AcDonutChart.vue.d.ts +83 -0
- package/dist/lib/components/AcDonutChart.vue_vue_type_script_setup_true_lang.js +237 -0
- package/dist/lib/components/AcDropdown.vue.d.ts +5 -2
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +91 -78
- package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +11 -10
- package/dist/lib/components/AcDropdownItem.vue.d.ts +2 -2
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +18 -18
- 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/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 +139 -116
- 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 +3 -3
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcFormSection.vue.d.ts +8 -1
- package/dist/lib/components/AcFormSection.vue_vue_type_script_setup_true_lang.js +31 -21
- 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 -5
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +82 -28
- package/dist/lib/components/AcInfoTable.vue.d.ts +1 -1
- package/dist/lib/components/AcInfoTable.vue_vue_type_script_setup_true_lang.js +17 -13
- package/dist/lib/components/AcInput.vue.d.ts +4 -4
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +99 -91
- 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 +336 -0
- package/dist/lib/components/AcLineChart.js +5 -0
- package/dist/lib/components/AcLineChart.vue.d.ts +44 -0
- package/dist/lib/components/AcLineChart.vue_vue_type_script_setup_true_lang.js +175 -0
- 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.js +5 -0
- package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +48 -0
- package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +111 -0
- 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 +88 -64
- package/dist/lib/components/AcNavbar.vue.d.ts +8 -5
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +29 -21
- package/dist/lib/components/AcNavbarItem.vue.d.ts +2 -2
- package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +23 -24
- package/dist/lib/components/AcNotificationMenu.vue.d.ts +3 -3
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +139 -174
- 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 +241 -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 +22 -5
- package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +87 -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 +19 -4
- package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +85 -31
- package/dist/lib/components/AcResourceCard.vue.d.ts +3 -3
- package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +17 -17
- package/dist/lib/components/AcSearchBar.vue.d.ts +1 -1
- package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +14 -9
- 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 +6 -6
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +246 -254
- 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 +32 -32
- package/dist/lib/components/AcSideTabs.vue.d.ts +2 -2
- package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +37 -37
- package/dist/lib/components/AcSidebar.vue.d.ts +6 -3
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +67 -57
- package/dist/lib/components/AcSidebarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +46 -45
- 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/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.d.ts +3 -0
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +31 -19
- 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 +121 -0
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +97 -97
- package/dist/lib/components/AcTabs.vue.d.ts +9 -2
- package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +43 -28
- package/dist/lib/components/AcTag.vue.d.ts +2 -2
- 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 +289 -0
- package/dist/lib/components/AcTextarea.vue.d.ts +4 -4
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +85 -63
- package/dist/lib/components/AcThemeMode.vue.d.ts +3 -3
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +56 -24
- 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 +455 -0
- package/dist/lib/components/AcToaster.vue.d.ts +6 -3
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +115 -82
- package/dist/lib/components/AcTooltip.vue.d.ts +34 -14
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +203 -79
- package/dist/lib/components/AcUsageCard.vue_vue_type_script_setup_true_lang.js +27 -27
- package/dist/lib/components/AcUserMenu.vue.d.ts +23 -1
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +166 -115
- package/dist/lib/components/index.d.ts +21 -2
- package/dist/lib/components/status.d.ts +28 -0
- package/dist/lib/components/status.js +125 -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/composables/useToast.d.ts +17 -1
- package/dist/lib/composables/useToast.js +10 -2
- package/dist/lib/editor/theme.js +65 -62
- package/dist/lib/index.d.ts +21 -3
- package/dist/lib/index.js +99 -75
- package/dist/lib/theme.css +377 -273
- package/package.json +20 -4
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import e from "./AcSpinner.js";
|
|
2
|
+
import t from "./AcSwitch.js";
|
|
3
|
+
import { Comment as n, Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, mergeModels as f, mergeProps as p, normalizeClass as m, openBlock as h, ref as g, renderSlot as _, resolveDynamicComponent as v, toDisplayString as y, unref as b, useAttrs as x, useId as S, useModel as C, useSlots as w } from "vue";
|
|
4
|
+
import { Sparkles as T } from "@lucide/vue";
|
|
5
|
+
//#region src/lib/components/AcSwitchCard.vue?vue&type=script&setup=true&lang.ts
|
|
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
|
+
key: 0,
|
|
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
|
+
}, j = { class: "ml-auto flex shrink-0 items-center gap-3" }, M = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "text-sm text-muted"
|
|
12
|
+
}, N = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "mt-3"
|
|
15
|
+
}, P = "a, button, input, select, textarea, label, [tabindex], [contenteditable]", F = /*@__PURE__*/ d({
|
|
16
|
+
inheritAttrs: !1,
|
|
17
|
+
__name: "AcSwitchCard",
|
|
18
|
+
props: /*@__PURE__*/ f({
|
|
19
|
+
title: {},
|
|
20
|
+
description: { default: "" },
|
|
21
|
+
status: { default: "" },
|
|
22
|
+
statusDetail: { default: "" },
|
|
23
|
+
icon: { default: void 0 },
|
|
24
|
+
recommended: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: !1
|
|
27
|
+
},
|
|
28
|
+
warning: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: !1
|
|
31
|
+
},
|
|
32
|
+
disabled: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: !1
|
|
35
|
+
},
|
|
36
|
+
loading: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: !1
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
modelValue: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: !1
|
|
44
|
+
},
|
|
45
|
+
modelModifiers: {}
|
|
46
|
+
}),
|
|
47
|
+
emits: ["update:modelValue"],
|
|
48
|
+
setup(d, { expose: f }) {
|
|
49
|
+
let F = d, I = C(d, "modelValue"), L = w(), R = S(), z = `${R}-title`, B = `${R}-description`, V = `${R}-status`, H = x(), U = i(() => ({
|
|
50
|
+
class: H.class,
|
|
51
|
+
style: H.style
|
|
52
|
+
})), W = i(() => {
|
|
53
|
+
let { class: e, style: t, ...n } = H;
|
|
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(() => 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
|
+
function Q(e) {
|
|
57
|
+
return !!e?.some((e) => e.type !== n && (e.type !== r || Q(e.children)));
|
|
58
|
+
}
|
|
59
|
+
function $() {
|
|
60
|
+
return Q(L.default?.());
|
|
61
|
+
}
|
|
62
|
+
function ee(e) {
|
|
63
|
+
if (K.value) return;
|
|
64
|
+
let t = e.target.closest(P);
|
|
65
|
+
t && e.currentTarget.contains(t) || window.getSelection()?.toString() || (I.value = !I.value, G.value?.focus());
|
|
66
|
+
}
|
|
67
|
+
return f({ focus: () => G.value?.focus() }), (n, r) => (h(), s("div", p(U.value, {
|
|
68
|
+
class: ["rounded-14 border px-4 py-3 transition-colors duration-200 motion-reduce:transition-none", X.value],
|
|
69
|
+
"aria-busy": d.loading || void 0,
|
|
70
|
+
"data-ac-ds": "",
|
|
71
|
+
"data-testid": "ac-switch-card"
|
|
72
|
+
}), [c("div", {
|
|
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
|
+
onClick: ee
|
|
75
|
+
}, [c("div", D, [d.icon ? (h(), s("span", {
|
|
76
|
+
key: 0,
|
|
77
|
+
class: m(["flex size-8 shrink-0 items-center justify-center rounded-10 border transition-colors duration-200", q.value ? "border-primary/25 bg-primary/10 text-primary-strong" : "border-border bg-surface-sunken text-muted"]),
|
|
78
|
+
"aria-hidden": "true"
|
|
79
|
+
}, [(h(), a(v(d.icon), { class: "size-4" }))], 2)) : o("", !0), c("div", O, [c("p", k, [
|
|
80
|
+
c("span", { id: z }, y(d.title), 1),
|
|
81
|
+
d.recommended ? (h(), s("span", A, [u(b(T), {
|
|
82
|
+
class: "size-3",
|
|
83
|
+
"aria-hidden": "true"
|
|
84
|
+
}), r[1] ||= l(" Recommended ", -1)])) : o("", !0),
|
|
85
|
+
_(n.$slots, "badges")
|
|
86
|
+
]), d.description ? (h(), s("p", {
|
|
87
|
+
key: 0,
|
|
88
|
+
id: B,
|
|
89
|
+
class: "mt-0.5 text-xs leading-snug text-muted"
|
|
90
|
+
}, y(d.description), 1)) : o("", !0)])]), c("div", j, [
|
|
91
|
+
J.value ? (h(), s("div", {
|
|
92
|
+
key: 0,
|
|
93
|
+
id: V,
|
|
94
|
+
class: "text-right"
|
|
95
|
+
}, [c("div", { class: m(["text-base font-bold tabular-nums", Z.value]) }, [_(n.$slots, "status", {}, () => [l(y(d.status), 1)])], 2), d.statusDetail ? (h(), s("div", M, y(d.statusDetail), 1)) : o("", !0)])) : o("", !0),
|
|
96
|
+
d.loading ? (h(), a(e, {
|
|
97
|
+
key: 1,
|
|
98
|
+
class: "text-muted",
|
|
99
|
+
label: "Saving"
|
|
100
|
+
})) : o("", !0),
|
|
101
|
+
u(t, p({
|
|
102
|
+
ref_key: "toggle",
|
|
103
|
+
ref: G
|
|
104
|
+
}, W.value, {
|
|
105
|
+
modelValue: I.value,
|
|
106
|
+
"onUpdate:modelValue": r[0] ||= (e) => I.value = e,
|
|
107
|
+
disabled: d.disabled,
|
|
108
|
+
loading: d.loading,
|
|
109
|
+
"aria-labelledby": z,
|
|
110
|
+
"aria-describedby": Y.value
|
|
111
|
+
}), null, 16, [
|
|
112
|
+
"modelValue",
|
|
113
|
+
"disabled",
|
|
114
|
+
"loading",
|
|
115
|
+
"aria-describedby"
|
|
116
|
+
])
|
|
117
|
+
])], 2), $() ? (h(), s("div", N, [_(n.$slots, "default")])) : o("", !0)], 16, E));
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
//#endregion
|
|
121
|
+
export { F as default };
|
|
@@ -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
|
|
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
|
-
],
|
|
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
|
-
class: "px-
|
|
36
|
-
},
|
|
35
|
+
class: "px-6 py-12 text-center text-muted"
|
|
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,156 +95,156 @@ var T = { class: "ac-scrollbar" }, ne = { 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
|
-
function
|
|
110
|
+
function V(e) {
|
|
111
111
|
return typeof e == "object" && !!e && !Array.isArray(e) && "data" in e;
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
return
|
|
113
|
+
function H(e) {
|
|
114
|
+
return V(e) ? e.sort ?? e.data : e;
|
|
115
115
|
}
|
|
116
|
-
let
|
|
117
|
-
function
|
|
118
|
-
let e = new Set(
|
|
119
|
-
|
|
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
|
+
let e = new Set(W.value);
|
|
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
|
|
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
|
-
function
|
|
131
|
-
let t = e[
|
|
132
|
-
return typeof n == "string" || typeof n == "number" ? n : String(e[
|
|
130
|
+
function Q(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
|
-
let
|
|
134
|
+
let $ = (e) => ({
|
|
135
135
|
left: "text-left",
|
|
136
136
|
center: "text-center",
|
|
137
137
|
right: "text-right"
|
|
138
138
|
})[e.align ?? "left"];
|
|
139
139
|
return (n, u) => (p(), a("div", {
|
|
140
|
-
class: d(["w-full overflow-hidden bg-surface", !l.flat && "rounded-10 border border-border
|
|
140
|
+
class: d(["w-full overflow-hidden bg-surface", !l.flat && "rounded-10 border border-border"]),
|
|
141
141
|
"data-ac-ds": "",
|
|
142
142
|
"data-testid": "ac-table"
|
|
143
|
-
}, [o("div",
|
|
143
|
+
}, [o("div", ne, [o("table", re, [o("thead", null, [o("tr", null, [
|
|
144
144
|
l.expandable ? (p(), a("th", {
|
|
145
145
|
key: 0,
|
|
146
146
|
scope: "col",
|
|
147
|
-
class: d(["h-
|
|
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-
|
|
153
|
-
}, [o("span",
|
|
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
|
+
}, [o("span", ie, [o("input", {
|
|
154
154
|
type: "checkbox",
|
|
155
|
-
class: d(
|
|
156
|
-
checked:
|
|
157
|
-
indeterminate:
|
|
155
|
+
class: d(j),
|
|
156
|
+
checked: K.value,
|
|
157
|
+
indeterminate: q.value,
|
|
158
158
|
disabled: l.loading || !l.rows.length,
|
|
159
159
|
"aria-label": "Select all rows",
|
|
160
|
-
onChange:
|
|
161
|
-
}, null, 40,
|
|
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),
|
|
166
166
|
(p(!0), a(t, null, m(l.columns, (e) => (p(), a("th", {
|
|
167
167
|
key: e.key,
|
|
168
168
|
scope: "col",
|
|
169
|
-
class: d(["h-
|
|
170
|
-
|
|
169
|
+
class: d(["h-11 border-b bg-surface-sunken/50 px-6 text-base font-semibold whitespace-nowrap text-muted", [
|
|
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-
|
|
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-
|
|
196
|
-
l.clickable && "cursor-pointer",
|
|
197
|
-
(l.rowActive?.(f) || l.selectable &&
|
|
195
|
+
class: d(["group transition-colors duration-150", [
|
|
196
|
+
l.clickable && "cursor-pointer hover:bg-surface-sunken/40",
|
|
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
|
-
"aria-disabled":
|
|
203
|
-
onClick: (e) => l.clickable && !
|
|
202
|
+
"aria-disabled": U(f) || void 0,
|
|
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,
|
|
211
211
|
type: "button",
|
|
212
|
-
class: "inline-flex size-7 cursor-pointer items-center justify-center rounded-
|
|
213
|
-
"aria-expanded":
|
|
214
|
-
"aria-controls":
|
|
215
|
-
"aria-label": `${
|
|
212
|
+
class: "inline-flex size-7 cursor-pointer items-center justify-center rounded-8 text-muted transition-colors hover:bg-surface-sunken hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
213
|
+
"aria-expanded": Y(f),
|
|
214
|
+
"aria-controls": Z(f),
|
|
215
|
+
"aria-label": `${Y(f) ? "Collapse" : "Expand"} ${Q(f)}`,
|
|
216
216
|
"data-testid": "ac-table-expand",
|
|
217
|
-
onClick: (e) =>
|
|
218
|
-
}, [c(v(
|
|
219
|
-
class: d(["size-4 transition-transform duration-150 motion-reduce:transition-none",
|
|
217
|
+
onClick: (e) => _e(f)
|
|
218
|
+
}, [c(v(C), {
|
|
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(
|
|
229
|
-
checked:
|
|
230
|
-
disabled:
|
|
231
|
-
"aria-label": `Select ${
|
|
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",
|
|
228
|
+
class: d(j),
|
|
229
|
+
checked: G.value.has(f[l.rowKey]),
|
|
230
|
+
disabled: U(f),
|
|
231
|
+
"aria-label": `Select ${Q(f)}`,
|
|
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]
|
|
244
244
|
}, () => [i.type || i.descriptor ? (p(), r(e, {
|
|
245
245
|
key: 0,
|
|
246
|
-
value:
|
|
247
|
-
cell:
|
|
246
|
+
value: V(f[i.key]) ? void 0 : f[i.key],
|
|
247
|
+
cell: V(f[i.key]) ? f[i.key] : void 0,
|
|
248
248
|
column: i.descriptor,
|
|
249
249
|
type: i.type,
|
|
250
250
|
title: i.label,
|
|
@@ -257,16 +257,16 @@ var T = { class: "ac-scrollbar" }, ne = { 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:
|
|
262
|
-
class: "border-b border-border
|
|
260
|
+
], 10, E), Y(f) && X(f) ? (p(), a("tr", O, [o("td", {
|
|
261
|
+
colspan: ge.value,
|
|
262
|
+
class: "border-b border-border bg-surface-muted p-0 group-last:border-0"
|
|
263
263
|
}, [o("div", {
|
|
264
|
-
id:
|
|
264
|
+
id: Z(f),
|
|
265
265
|
role: "region",
|
|
266
|
-
"aria-label": `Details for ${
|
|
267
|
-
class: "px-
|
|
268
|
-
}, [h(n.$slots, "expanded", { row: f })], 8, de)], 8,
|
|
266
|
+
"aria-label": `Details for ${Q(f)}`,
|
|
267
|
+
class: "px-6 py-4 text-body"
|
|
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;
|
|
@@ -4,28 +4,28 @@ var b = {
|
|
|
4
4
|
"data-ac-ds": "",
|
|
5
5
|
"data-testid": "ac-tabs"
|
|
6
6
|
}, x = {
|
|
7
|
-
role: "tablist",
|
|
8
|
-
class: "flex gap-5 overflow-x-auto overflow-y-hidden border-b border-border-light [scrollbar-width:none]"
|
|
9
|
-
}, S = {
|
|
10
7
|
key: 0,
|
|
11
8
|
role: "tabpanel",
|
|
12
|
-
class: "pt-
|
|
13
|
-
},
|
|
9
|
+
class: "pt-6"
|
|
10
|
+
}, S = /*@__PURE__*/ s({
|
|
14
11
|
__name: "AcTabs",
|
|
15
|
-
props: /*@__PURE__*/ l({
|
|
12
|
+
props: /*@__PURE__*/ l({
|
|
13
|
+
items: {},
|
|
14
|
+
variant: { default: "soft" }
|
|
15
|
+
}, {
|
|
16
16
|
modelValue: { default: "" },
|
|
17
17
|
modelModifiers: {}
|
|
18
18
|
}),
|
|
19
19
|
emits: ["update:modelValue"],
|
|
20
20
|
setup(s) {
|
|
21
|
-
let l = s,
|
|
22
|
-
if (!
|
|
23
|
-
let e =
|
|
21
|
+
let l = s, S = _(s, "modelValue"), C = c()?.appContext, w = C?.components.RouterLink, T = C?.config.globalProperties.$router, E = t(() => {
|
|
22
|
+
if (!T) return "";
|
|
23
|
+
let e = T.currentRoute.value.path, t = "", n = -1;
|
|
24
24
|
for (let r of l.items) {
|
|
25
25
|
if (r.to === void 0 || r.disabled) continue;
|
|
26
26
|
let i;
|
|
27
27
|
try {
|
|
28
|
-
i =
|
|
28
|
+
i = T.resolve(r.to).path;
|
|
29
29
|
} catch {
|
|
30
30
|
continue;
|
|
31
31
|
}
|
|
@@ -35,38 +35,53 @@ var b = {
|
|
|
35
35
|
}
|
|
36
36
|
return t;
|
|
37
37
|
});
|
|
38
|
-
v(
|
|
39
|
-
function
|
|
40
|
-
return e.to !== void 0 &&
|
|
38
|
+
v(E, (e) => e && (S.value = e), { immediate: !0 });
|
|
39
|
+
function D(e) {
|
|
40
|
+
return e.to !== void 0 && w && !e.disabled ? w : e.href || typeof e.to == "string" ? "a" : "button";
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
let t =
|
|
44
|
-
return t ===
|
|
42
|
+
function O(e) {
|
|
43
|
+
let t = D(e), n = { "data-testid": e.testid };
|
|
44
|
+
return t === w ? n.to = e.to : t === "a" ? e.disabled ? n["aria-disabled"] = "true" : n.href = e.href ?? e.to : (n.type = "button", n.disabled = e.disabled || void 0), n;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function k(e, t) {
|
|
47
47
|
if (e.disabled) {
|
|
48
48
|
t.preventDefault();
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
S.value = e.key;
|
|
52
|
+
}
|
|
53
|
+
function A(e) {
|
|
54
|
+
let t = S.value === e.key;
|
|
55
|
+
return l.variant === "soft" ? ["rounded-t-8 px-3 py-2", t ? "border-primary bg-primary/4 text-primary-strong" : "border-transparent text-muted hover:bg-accent/60 hover:text-heading"] : ["pt-1 pb-3", t ? "border-primary text-primary-strong" : "border-transparent text-muted hover:border-border hover:text-heading"];
|
|
52
56
|
}
|
|
53
|
-
return (t, c) => (f(), i("div", b, [a("div",
|
|
57
|
+
return (t, c) => (f(), i("div", b, [a("div", {
|
|
58
|
+
role: "tablist",
|
|
59
|
+
class: d(["flex border-b border-border px-1 text-base font-medium", s.variant === "soft" ? "flex-wrap gap-1" : "gap-6 overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"])
|
|
60
|
+
}, [(f(!0), i(e, null, p(s.items, (e) => (f(), n(h(D(e)), u({ key: e.key }, { ref_for: !0 }, O(e), {
|
|
54
61
|
role: "tab",
|
|
55
|
-
"aria-selected":
|
|
56
|
-
class: ["relative
|
|
57
|
-
onClick: (t) =>
|
|
62
|
+
"aria-selected": S.value === e.key,
|
|
63
|
+
class: ["relative inline-flex shrink-0 cursor-pointer items-center gap-2 border-b-2 whitespace-nowrap no-underline transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-inset disabled:cursor-not-allowed disabled:opacity-40 aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-40", A(e)],
|
|
64
|
+
onClick: (t) => k(e, t)
|
|
58
65
|
}), {
|
|
59
|
-
default: y(() => [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
default: y(() => [
|
|
67
|
+
e.icon ? (f(), n(h(e.icon), {
|
|
68
|
+
key: 0,
|
|
69
|
+
class: "-mr-0.5 size-3.5 shrink-0",
|
|
70
|
+
"aria-hidden": "true"
|
|
71
|
+
})) : r("", !0),
|
|
72
|
+
o(" " + g(e.label) + " ", 1),
|
|
73
|
+
e.count === void 0 ? r("", !0) : (f(), i("span", {
|
|
74
|
+
key: 1,
|
|
75
|
+
class: d(["inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1.5 text-xs leading-none font-medium tabular-nums", S.value === e.key ? "bg-primary/10 text-primary-strong" : "bg-surface-sunken text-muted"])
|
|
76
|
+
}, g(e.count), 3))
|
|
77
|
+
]),
|
|
63
78
|
_: 2
|
|
64
79
|
}, 1040, [
|
|
65
80
|
"aria-selected",
|
|
66
81
|
"class",
|
|
67
82
|
"onClick"
|
|
68
|
-
]))), 128))]), t.$slots.default ? (f(), i("div",
|
|
83
|
+
]))), 128))], 2), t.$slots.default ? (f(), i("div", x, [m(t.$slots, "default", { active: S.value })])) : r("", !0)]));
|
|
69
84
|
}
|
|
70
85
|
});
|
|
71
86
|
//#endregion
|
|
72
|
-
export {
|
|
87
|
+
export { S as default };
|
|
@@ -4,7 +4,7 @@ export interface Props {
|
|
|
4
4
|
label?: string;
|
|
5
5
|
/** `neutral` for most labels; a tone to group filters by kind, e.g. environment or region. */
|
|
6
6
|
color?: Tone | "neutral";
|
|
7
|
-
/** Pill shape (`rounded-
|
|
7
|
+
/** Pill shape (`rounded-full`), as cloud-ui's label chips, instead of 6px corners. */
|
|
8
8
|
rounded?: boolean;
|
|
9
9
|
/** Shows a remove button that emits `remove`. */
|
|
10
10
|
removable?: boolean;
|
|
@@ -27,9 +27,9 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
|
|
|
27
27
|
label: string;
|
|
28
28
|
color: Tone | "neutral";
|
|
29
29
|
rounded: boolean;
|
|
30
|
-
removable: boolean;
|
|
31
30
|
keyLabel: string;
|
|
32
31
|
valueLabel: string;
|
|
32
|
+
removable: boolean;
|
|
33
33
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
34
34
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
35
35
|
declare const _default: typeof __VLS_export;
|