@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,114 @@
|
|
|
1
|
+
import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, defineComponent as a, normalizeClass as o, normalizeStyle as s, openBlock as c, renderSlot as l, toDisplayString as u } from "vue";
|
|
2
|
+
//#region src/lib/components/AcCircularProgress.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var d = [
|
|
4
|
+
"aria-label",
|
|
5
|
+
"aria-valuemax",
|
|
6
|
+
"aria-valuenow",
|
|
7
|
+
"aria-valuetext",
|
|
8
|
+
"aria-busy"
|
|
9
|
+
], f = ["viewBox"], p = [
|
|
10
|
+
"cx",
|
|
11
|
+
"cy",
|
|
12
|
+
"r",
|
|
13
|
+
"stroke-width"
|
|
14
|
+
], m = [
|
|
15
|
+
"cx",
|
|
16
|
+
"cy",
|
|
17
|
+
"r",
|
|
18
|
+
"stroke-width",
|
|
19
|
+
"stroke-dashoffset"
|
|
20
|
+
], h = /*@__PURE__*/ a({
|
|
21
|
+
__name: "AcCircularProgress",
|
|
22
|
+
props: {
|
|
23
|
+
value: { default: 0 },
|
|
24
|
+
max: { default: 100 },
|
|
25
|
+
size: { default: "normal" },
|
|
26
|
+
strokeWidth: { default: void 0 },
|
|
27
|
+
showLabel: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: !0
|
|
30
|
+
},
|
|
31
|
+
valueText: { default: "" },
|
|
32
|
+
color: { default: "progress" },
|
|
33
|
+
label: { default: "" },
|
|
34
|
+
indeterminate: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: !1
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
setup(a) {
|
|
40
|
+
let h = a, g = {
|
|
41
|
+
small: {
|
|
42
|
+
px: 32,
|
|
43
|
+
stroke: 3,
|
|
44
|
+
box: "size-8",
|
|
45
|
+
text: "text-[9px]"
|
|
46
|
+
},
|
|
47
|
+
normal: {
|
|
48
|
+
px: 44,
|
|
49
|
+
stroke: 4,
|
|
50
|
+
box: "size-11",
|
|
51
|
+
text: "text-xm"
|
|
52
|
+
},
|
|
53
|
+
large: {
|
|
54
|
+
px: 80,
|
|
55
|
+
stroke: 6,
|
|
56
|
+
box: "size-20",
|
|
57
|
+
text: "text-xl"
|
|
58
|
+
}
|
|
59
|
+
}, _ = {
|
|
60
|
+
primary: "text-primary",
|
|
61
|
+
info: "text-info",
|
|
62
|
+
success: "text-success",
|
|
63
|
+
warning: "text-warning",
|
|
64
|
+
danger: "text-danger"
|
|
65
|
+
}, v = e(() => typeof h.size == "number" ? null : g[h.size]), y = e(() => v.value?.px ?? Math.max(16, h.size)), b = e(() => h.strokeWidth ?? v.value?.stroke ?? Math.max(2, Math.round(y.value / 11))), x = e(() => (y.value - b.value) / 2), S = e(() => v.value ? void 0 : {
|
|
66
|
+
width: `${y.value}px`,
|
|
67
|
+
height: `${y.value}px`
|
|
68
|
+
}), C = e(() => v.value ? void 0 : { fontSize: `${Math.min(24, Math.max(9, Math.round(y.value * .23)))}px` }), w = e(() => h.max <= 0 ? 0 : Math.min(100, Math.max(0, h.value / h.max * 100))), T = e(() => h.color === "progress" ? D() : h.color === "auto" ? w.value >= 95 ? "danger" : w.value >= 80 ? "warning" : "primary" : h.color), E = e(() => h.valueText || `${Math.round(w.value)}%`);
|
|
69
|
+
function D() {
|
|
70
|
+
return h.indeterminate ? "primary" : w.value >= 100 ? "success" : w.value >= 60 ? "info" : w.value >= 30 ? "warning" : "danger";
|
|
71
|
+
}
|
|
72
|
+
return (e, h) => (c(), n("div", {
|
|
73
|
+
role: "progressbar",
|
|
74
|
+
"aria-label": a.label || "Progress",
|
|
75
|
+
"aria-valuemin": "0",
|
|
76
|
+
"aria-valuemax": a.indeterminate ? void 0 : a.max,
|
|
77
|
+
"aria-valuenow": a.indeterminate ? void 0 : Math.min(a.max, Math.max(0, a.value)),
|
|
78
|
+
"aria-valuetext": a.indeterminate ? void 0 : E.value,
|
|
79
|
+
"aria-busy": a.indeterminate || void 0,
|
|
80
|
+
class: o(["relative inline-flex shrink-0 items-center justify-center", v.value?.box]),
|
|
81
|
+
style: s(S.value),
|
|
82
|
+
"data-ac-ds": "",
|
|
83
|
+
"data-testid": "ac-circular-progress"
|
|
84
|
+
}, [(c(), n("svg", {
|
|
85
|
+
class: o(["size-full -rotate-90", [_[T.value], a.indeterminate && "animate-spin motion-reduce:animate-none"]]),
|
|
86
|
+
viewBox: `0 0 ${y.value} ${y.value}`,
|
|
87
|
+
fill: "none",
|
|
88
|
+
"aria-hidden": "true"
|
|
89
|
+
}, [r("circle", {
|
|
90
|
+
cx: y.value / 2,
|
|
91
|
+
cy: y.value / 2,
|
|
92
|
+
r: x.value,
|
|
93
|
+
class: "stroke-border",
|
|
94
|
+
"stroke-width": b.value
|
|
95
|
+
}, null, 8, p), r("circle", {
|
|
96
|
+
cx: y.value / 2,
|
|
97
|
+
cy: y.value / 2,
|
|
98
|
+
r: x.value,
|
|
99
|
+
class: o(["stroke-current transition-[stroke-dashoffset,color,opacity] duration-[800ms] ease-[cubic-bezier(0.4,0,0.2,1)] motion-reduce:transition-none", !a.indeterminate && w.value === 0 && "opacity-0"]),
|
|
100
|
+
"stroke-width": b.value + .5,
|
|
101
|
+
"stroke-linecap": "round",
|
|
102
|
+
pathLength: "100",
|
|
103
|
+
"stroke-dasharray": "100",
|
|
104
|
+
"stroke-dashoffset": a.indeterminate ? 75 : 100 - w.value
|
|
105
|
+
}, null, 10, m)], 10, f)), e.$slots.default || a.showLabel && !a.indeterminate ? (c(), n("span", {
|
|
106
|
+
key: 0,
|
|
107
|
+
class: o(["pointer-events-none absolute inset-0 flex items-center justify-center leading-none font-bold tracking-[-0.03em] text-heading tabular-nums select-none", v.value?.text]),
|
|
108
|
+
style: s(C.value),
|
|
109
|
+
"aria-hidden": "true"
|
|
110
|
+
}, [l(e.$slots, "default", {}, () => [i(u(E.value), 1)])], 6)) : t("", !0)], 14, d));
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
//#endregion
|
|
114
|
+
export { h as default };
|
|
@@ -1,47 +1,48 @@
|
|
|
1
|
-
import e from "./
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { statusMeta as e } from "./status.js";
|
|
2
|
+
import t from "./AcSkeleton.js";
|
|
3
|
+
import { Fragment as n, Teleport as r, Transition as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, inject as ee, mergeModels as p, nextTick as m, normalizeClass as h, normalizeStyle as te, onBeforeUnmount as ne, openBlock as g, ref as _, renderList as re, renderSlot as v, resolveDynamicComponent as ie, toDisplayString as y, unref as b, useId as ae, useModel as oe, vModelText as se, watch as ce, withCtx as le, withDirectives as ue, withModifiers as de } from "vue";
|
|
4
|
+
import { Check as fe, ChevronsUpDown as pe, Cloud as me, Plus as he, Search as ge } from "@lucide/vue";
|
|
4
5
|
//#region src/lib/components/AcClusterSwitcher.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
+
var _e = [
|
|
6
7
|
"id",
|
|
7
8
|
"aria-expanded",
|
|
8
9
|
"aria-controls",
|
|
9
10
|
"aria-label",
|
|
10
11
|
"title",
|
|
11
12
|
"disabled"
|
|
12
|
-
],
|
|
13
|
-
class: "relative inline-flex size-7 shrink-0 items-center justify-center rounded-
|
|
13
|
+
], ve = {
|
|
14
|
+
class: "relative inline-flex size-7 shrink-0 items-center justify-center rounded-8 bg-surface ring-1 ring-border ring-inset",
|
|
14
15
|
"aria-hidden": "true"
|
|
15
|
-
},
|
|
16
|
+
}, ye = ["src"], be = { class: "min-w-0 flex-1" }, xe = {
|
|
16
17
|
key: 0,
|
|
17
18
|
class: "block truncate text-sm text-muted"
|
|
18
|
-
},
|
|
19
|
+
}, Se = {
|
|
19
20
|
key: 0,
|
|
20
|
-
class: "border-b border-border
|
|
21
|
-
},
|
|
21
|
+
class: "border-b border-border p-2"
|
|
22
|
+
}, Ce = { class: "relative" }, we = [
|
|
22
23
|
"aria-activedescendant",
|
|
23
24
|
"aria-label",
|
|
24
25
|
"placeholder"
|
|
25
|
-
],
|
|
26
|
+
], Te = ["tabindex", "aria-activedescendant"], Ee = [
|
|
26
27
|
"id",
|
|
27
28
|
"aria-selected",
|
|
28
29
|
"aria-disabled",
|
|
29
30
|
"onMouseenter",
|
|
30
31
|
"onClick"
|
|
31
|
-
],
|
|
32
|
-
class: "inline-flex size-
|
|
32
|
+
], De = {
|
|
33
|
+
class: "inline-flex size-8 shrink-0 items-center justify-center rounded-8 bg-surface ring-1 ring-border ring-inset",
|
|
33
34
|
"aria-hidden": "true"
|
|
34
|
-
},
|
|
35
|
+
}, Oe = ["src", "onError"], ke = { class: "min-w-0 flex-1" }, Ae = { class: "block truncate text-base leading-5 font-medium text-heading" }, je = { class: "flex min-w-0 items-center gap-1.5 text-xs text-muted" }, Me = {
|
|
35
36
|
key: 1,
|
|
36
37
|
"aria-hidden": "true"
|
|
37
|
-
},
|
|
38
|
+
}, Ne = { class: "truncate" }, Pe = {
|
|
38
39
|
key: 0,
|
|
39
40
|
role: "presentation",
|
|
40
41
|
class: "px-3 py-6 text-center text-base text-muted"
|
|
41
|
-
},
|
|
42
|
+
}, Fe = {
|
|
42
43
|
key: 1,
|
|
43
|
-
class: "border-t border-border
|
|
44
|
-
}, x = /*@__PURE__*/
|
|
44
|
+
class: "border-t border-border p-2"
|
|
45
|
+
}, x = /*@__PURE__*/ f({
|
|
45
46
|
__name: "AcClusterSwitcher",
|
|
46
47
|
props: /*@__PURE__*/ p({
|
|
47
48
|
clusterOptions: { default: () => [] },
|
|
@@ -76,48 +77,26 @@ var ge = [
|
|
|
76
77
|
openModifiers: {}
|
|
77
78
|
}),
|
|
78
79
|
emits: /*@__PURE__*/ p(["select", "import"], ["update:modelValue", "update:open"]),
|
|
79
|
-
setup(
|
|
80
|
-
let S =
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"connected",
|
|
85
|
-
"running",
|
|
86
|
-
"healthy",
|
|
87
|
-
"true"
|
|
88
|
-
],
|
|
89
|
-
danger: [
|
|
90
|
-
"notready",
|
|
91
|
-
"lost",
|
|
92
|
-
"notconnected",
|
|
93
|
-
"disconnected",
|
|
94
|
-
"error",
|
|
95
|
-
"failed",
|
|
96
|
-
"critical",
|
|
97
|
-
"unhealthy",
|
|
98
|
-
"false"
|
|
99
|
-
],
|
|
100
|
-
warning: [
|
|
101
|
-
"pending",
|
|
102
|
-
"connecting",
|
|
103
|
-
"provisioning",
|
|
104
|
-
"importing",
|
|
105
|
-
"registered",
|
|
106
|
-
"updating",
|
|
107
|
-
"deleting",
|
|
108
|
-
"unknown"
|
|
109
|
-
]
|
|
80
|
+
setup(f, { expose: p, emit: x }) {
|
|
81
|
+
let S = f, C = oe(f, "modelValue"), w = oe(f, "open"), T = x, Ie = {
|
|
82
|
+
registered: "warning",
|
|
83
|
+
unknown: "warning",
|
|
84
|
+
notconnected: "danger"
|
|
110
85
|
}, E = {
|
|
111
86
|
success: "bg-success",
|
|
112
87
|
danger: "bg-danger",
|
|
88
|
+
info: "bg-info",
|
|
113
89
|
warning: "bg-warning",
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
90
|
+
pending: "bg-pending",
|
|
91
|
+
neutral: "bg-muted"
|
|
92
|
+
}, Le = {
|
|
93
|
+
success: "text-success-strong",
|
|
94
|
+
danger: "text-danger-strong",
|
|
95
|
+
info: "text-info-strong",
|
|
96
|
+
warning: "text-warning-strong",
|
|
97
|
+
pending: "text-pending-strong",
|
|
119
98
|
neutral: "text-muted"
|
|
120
|
-
}, D =
|
|
99
|
+
}, D = ee("ac-sidebar", null), O = ae(), k = `${O}-panel`, A = `${O}-list`, j = _(null), M = _(null), Re = _(null), N = _(null), P = _(""), F = _(-1), I = _(/* @__PURE__ */ new Set()), L = _({}), R = _(!0), z = a(() => S.sidebarCollapsed ?? D?.rail.value ?? !1), B = a(() => D?.dark.value ?? !1), V = a(() => C.value ? S.clusterOptions.find((e) => e.name === C.value) ?? { name: C.value } : null), H = a(() => {
|
|
121
100
|
let e = P.value.trim().toLowerCase();
|
|
122
101
|
return e ? S.clusterOptions.filter((t) => [
|
|
123
102
|
t.name,
|
|
@@ -125,27 +104,23 @@ var ge = [
|
|
|
125
104
|
t.provider,
|
|
126
105
|
t.location
|
|
127
106
|
].some((t) => t?.toLowerCase().includes(e))) : S.clusterOptions;
|
|
128
|
-
}),
|
|
107
|
+
}), ze = a(() => V.value ? `Cluster: ${U(V.value)}${V.value.status ? `, ${V.value.status}` : ""}. Switch cluster` : "Select a cluster");
|
|
129
108
|
function U(e) {
|
|
130
109
|
return e.displayName || e.name;
|
|
131
110
|
}
|
|
132
111
|
function W(e) {
|
|
133
112
|
return !!(e.disabled || e.$isDisabled);
|
|
134
113
|
}
|
|
135
|
-
function G(
|
|
136
|
-
let
|
|
137
|
-
if (!
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
"danger",
|
|
141
|
-
"warning"
|
|
142
|
-
]) if (Pe[e].includes(t)) return e;
|
|
143
|
-
return "neutral";
|
|
114
|
+
function G(t) {
|
|
115
|
+
let n = (t ?? "").toLowerCase().replace(/[^a-z]/g, "");
|
|
116
|
+
if (!n) return "neutral";
|
|
117
|
+
let r = Ie[n] ?? e(t).tone;
|
|
118
|
+
return r === "default" ? "neutral" : r;
|
|
144
119
|
}
|
|
145
120
|
function K(e) {
|
|
146
121
|
return !S.providerIconBase || !e || I.value.has(e) ? "" : `${S.providerIconBase}/${e}.png`;
|
|
147
122
|
}
|
|
148
|
-
function
|
|
123
|
+
function Be(e) {
|
|
149
124
|
e && (I.value = new Set(I.value).add(e));
|
|
150
125
|
}
|
|
151
126
|
function q(e) {
|
|
@@ -156,7 +131,7 @@ var ge = [
|
|
|
156
131
|
for (let r = e; r >= 0 && r < n.length; r += t) if (!W(n[r])) return r;
|
|
157
132
|
return -1;
|
|
158
133
|
}
|
|
159
|
-
function
|
|
134
|
+
function Ve(e) {
|
|
160
135
|
let t = H.value;
|
|
161
136
|
if (!t.length) return;
|
|
162
137
|
let n = F.value;
|
|
@@ -190,79 +165,79 @@ var ge = [
|
|
|
190
165
|
maxHeight: `${Math.max(o ? a : i, 200)}px`
|
|
191
166
|
};
|
|
192
167
|
}
|
|
193
|
-
function
|
|
168
|
+
function He() {
|
|
194
169
|
S.disabled || S.loading || (w.value = !0);
|
|
195
170
|
}
|
|
196
|
-
function
|
|
171
|
+
function Z(e = !0) {
|
|
197
172
|
w.value && (w.value = !1, e && j.value?.focus());
|
|
198
173
|
}
|
|
199
|
-
function
|
|
200
|
-
W(e) || (C.value = e.name, T("select", e),
|
|
174
|
+
function Ue(e) {
|
|
175
|
+
W(e) || (C.value = e.name, T("select", e), Z());
|
|
201
176
|
}
|
|
202
|
-
function
|
|
203
|
-
T("import"),
|
|
177
|
+
function We() {
|
|
178
|
+
T("import"), Z(!1);
|
|
204
179
|
}
|
|
205
|
-
function
|
|
206
|
-
!w.value && ["ArrowDown", "ArrowUp"].includes(e.key) && (e.preventDefault(),
|
|
180
|
+
function Ge(e) {
|
|
181
|
+
!w.value && ["ArrowDown", "ArrowUp"].includes(e.key) && (e.preventDefault(), He());
|
|
207
182
|
}
|
|
208
|
-
function
|
|
209
|
-
if (e.key === "ArrowDown" || e.key === "ArrowUp") e.preventDefault(),
|
|
183
|
+
function Q(e) {
|
|
184
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") e.preventDefault(), Ve(e.key === "ArrowDown" ? 1 : -1);
|
|
210
185
|
else if ((e.key === "Home" || e.key === "End") && !S.searchable) e.preventDefault(), F.value = e.key === "Home" ? J() : J(H.value.length - 1, -1), Y();
|
|
211
186
|
else if (e.key === "Enter" || e.key === " " && !S.searchable) {
|
|
212
187
|
e.preventDefault();
|
|
213
188
|
let t = H.value[F.value];
|
|
214
|
-
t &&
|
|
189
|
+
t && Ue(t);
|
|
215
190
|
}
|
|
216
191
|
}
|
|
217
|
-
function
|
|
218
|
-
e.key === "Escape" ? (e.preventDefault(),
|
|
192
|
+
function Ke(e) {
|
|
193
|
+
e.key === "Escape" ? (e.preventDefault(), Z()) : e.key === "Tab" && qe(e);
|
|
219
194
|
}
|
|
220
|
-
function
|
|
195
|
+
function qe(e) {
|
|
221
196
|
let t = [...M.value?.querySelectorAll("input, a[href], button:not([disabled]), [tabindex=\"0\"]") ?? []], n = t[0], r = t[t.length - 1];
|
|
222
|
-
e.shiftKey && document.activeElement === n ? (e.preventDefault(),
|
|
197
|
+
e.shiftKey && document.activeElement === n ? (e.preventDefault(), Z()) : !e.shiftKey && document.activeElement === r && Z();
|
|
223
198
|
}
|
|
224
|
-
function
|
|
199
|
+
function Je(e) {
|
|
225
200
|
let t = e.target;
|
|
226
|
-
j.value?.contains(t) || M.value?.contains(t) ||
|
|
201
|
+
j.value?.contains(t) || M.value?.contains(t) || Z(!1);
|
|
227
202
|
}
|
|
228
|
-
function
|
|
229
|
-
e && M.value?.contains(e.target) || X();
|
|
203
|
+
function Ye(e) {
|
|
204
|
+
e?.target instanceof Node && M.value?.contains(e.target) || X();
|
|
230
205
|
}
|
|
231
206
|
function $(e) {
|
|
232
207
|
let t = e ? "addEventListener" : "removeEventListener";
|
|
233
|
-
document[t]("pointerdown",
|
|
208
|
+
document[t]("pointerdown", Je, !0), window[t]("scroll", Ye, !0), window[t]("resize", Ye);
|
|
234
209
|
}
|
|
235
|
-
return
|
|
210
|
+
return ce(w, async (e) => {
|
|
236
211
|
if ($(e), !e) return;
|
|
237
212
|
P.value = "";
|
|
238
213
|
let t = H.value.findIndex((e) => e.name === C.value);
|
|
239
|
-
F.value = t >= 0 ? t : J(), await m(), X(), (S.searchable ?
|
|
240
|
-
}),
|
|
214
|
+
F.value = t >= 0 ? t : J(), await m(), X(), (S.searchable ? Re.value : N.value)?.focus(), Y();
|
|
215
|
+
}), ce(P, () => {
|
|
241
216
|
F.value = J(), m(X);
|
|
242
|
-
}),
|
|
217
|
+
}), ne(() => $(!1)), p({ focus: () => j.value?.focus() }), (e, a) => (g(), c("div", {
|
|
243
218
|
class: h(["min-w-0", z.value ? "inline-flex" : "flex w-full"]),
|
|
244
219
|
"data-ac-ds": "",
|
|
245
220
|
"data-testid": "ac-cluster-switcher"
|
|
246
|
-
}, [
|
|
221
|
+
}, [f.loading ? (g(), c("div", {
|
|
247
222
|
key: 0,
|
|
248
223
|
role: "status",
|
|
249
224
|
"aria-label": "Loading clusters",
|
|
250
|
-
class: h(["flex h-10 items-center rounded-
|
|
225
|
+
class: h(["flex h-10 items-center rounded-10 border", [z.value ? "size-10 justify-center" : "w-full gap-2.5 px-2", B.value ? "border-white/10" : "border-border"]]),
|
|
251
226
|
"data-ac-ds": "",
|
|
252
227
|
"data-testid": "ac-cluster-switcher-loading"
|
|
253
|
-
}, [
|
|
228
|
+
}, [d(t, {
|
|
254
229
|
shape: "rect",
|
|
255
230
|
width: "28px",
|
|
256
231
|
height: "28px",
|
|
257
232
|
label: "",
|
|
258
233
|
class: "shrink-0"
|
|
259
|
-
}), z.value ?
|
|
234
|
+
}), z.value ? s("", !0) : (g(), o(t, {
|
|
260
235
|
key: 0,
|
|
261
236
|
shape: "text",
|
|
262
237
|
width: "60%",
|
|
263
238
|
height: "10px",
|
|
264
239
|
label: ""
|
|
265
|
-
}))], 2)) : (g(),
|
|
240
|
+
}))], 2)) : (g(), c("button", {
|
|
266
241
|
key: 1,
|
|
267
242
|
id: `${b(O)}-trigger`,
|
|
268
243
|
ref_key: "trigger",
|
|
@@ -271,143 +246,143 @@ var ge = [
|
|
|
271
246
|
"aria-haspopup": "dialog",
|
|
272
247
|
"aria-expanded": w.value,
|
|
273
248
|
"aria-controls": w.value ? k : void 0,
|
|
274
|
-
"aria-label":
|
|
249
|
+
"aria-label": ze.value,
|
|
275
250
|
title: z.value && V.value ? U(V.value) : void 0,
|
|
276
|
-
disabled:
|
|
277
|
-
class: h(["group relative flex h-10 min-w-0 cursor-pointer items-center rounded-
|
|
278
|
-
z.value ? "size-10 justify-center" : "w-full gap-2.5 pr-2 pl-
|
|
279
|
-
B.value ? "border-white/10 bg-white/4 enabled:hover:bg-white/8" : "border-border bg-
|
|
280
|
-
w.value && (B.value ? "bg-white/8" : "
|
|
251
|
+
disabled: f.disabled,
|
|
252
|
+
class: h(["group relative flex h-10 min-w-0 cursor-pointer items-center rounded-10 border text-left transition-[color,background-color,border-color,box-shadow] duration-200 disabled:cursor-not-allowed disabled:opacity-50", [
|
|
253
|
+
z.value ? "size-10 justify-center" : "w-full gap-2.5 pr-2.5 pl-1.5",
|
|
254
|
+
B.value ? "border-white/10 bg-white/4 enabled:hover:bg-white/8 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" : "border-border bg-background enabled:hover:border-accent-active focus-visible:focus-ring",
|
|
255
|
+
w.value && (B.value ? "bg-white/8" : "focus-ring")
|
|
281
256
|
]]),
|
|
282
257
|
"data-ac-ds": "",
|
|
283
258
|
"data-testid": "ac-cluster-switcher-trigger",
|
|
284
|
-
onClick:
|
|
285
|
-
onKeydown:
|
|
286
|
-
}, [
|
|
259
|
+
onClick: a[1] ||= (e) => w.value ? Z() : He(),
|
|
260
|
+
onKeydown: Ge
|
|
261
|
+
}, [l("span", ve, [K(V.value?.provider) ? (g(), c("img", {
|
|
287
262
|
key: 0,
|
|
288
263
|
src: K(V.value?.provider),
|
|
289
264
|
alt: "",
|
|
290
265
|
class: "size-5 object-contain",
|
|
291
|
-
onError:
|
|
292
|
-
}, null, 40,
|
|
266
|
+
onError: a[0] ||= (e) => Be(V.value?.provider)
|
|
267
|
+
}, null, 40, ye)) : (g(), o(b(me), {
|
|
293
268
|
key: 1,
|
|
294
269
|
class: "size-4 text-muted"
|
|
295
|
-
})), V.value ? (g(),
|
|
270
|
+
})), V.value ? (g(), c("span", {
|
|
296
271
|
key: 2,
|
|
297
272
|
class: h(["absolute -right-0.5 -bottom-0.5 size-2.5 rounded-full ring-2", [E[G(V.value.status)], B.value ? "ring-sidebar" : "ring-surface"]])
|
|
298
|
-
}, null, 2)) :
|
|
273
|
+
}, null, 2)) : s("", !0)]), z.value ? s("", !0) : (g(), c(n, { key: 0 }, [l("span", be, [l("span", { class: h(["block truncate text-base leading-5 font-medium", V.value ? "text-heading" : "text-muted"]) }, y(V.value ? U(V.value) : f.placeholder), 3), V.value?.location ? (g(), c("span", xe, y(V.value.location), 1)) : s("", !0)]), d(b(pe), {
|
|
299
274
|
class: "size-4 shrink-0 text-muted transition-colors group-hover:text-heading",
|
|
300
275
|
"aria-hidden": "true"
|
|
301
|
-
})], 64))], 42,
|
|
276
|
+
})], 64))], 42, _e)), (g(), o(r, { to: "body" }, [d(i, {
|
|
302
277
|
"enter-active-class": "transition duration-150 ease-out",
|
|
303
278
|
"enter-from-class": `opacity-0 motion-safe:scale-[0.98] ${z.value ? "motion-safe:-translate-x-1" : R.value ? "motion-safe:-translate-y-1" : "motion-safe:translate-y-1"}`,
|
|
304
279
|
"leave-active-class": "transition duration-100 ease-in",
|
|
305
280
|
"leave-to-class": "opacity-0"
|
|
306
281
|
}, {
|
|
307
|
-
default:
|
|
282
|
+
default: le(() => [w.value ? (g(), c("div", {
|
|
308
283
|
key: 0,
|
|
309
284
|
id: k,
|
|
310
285
|
ref_key: "panel",
|
|
311
286
|
ref: M,
|
|
312
287
|
role: "dialog",
|
|
313
288
|
"aria-label": "Switch cluster",
|
|
314
|
-
class: h(["fixed z-[90] flex max-w-[calc(100vw-16px)] flex-col overflow-hidden rounded-
|
|
315
|
-
style:
|
|
289
|
+
class: h(["fixed z-[90] flex max-w-[calc(100vw-16px)] flex-col overflow-hidden rounded-14 border border-border bg-surface shadow-lg", z.value ? "origin-left" : R.value ? "origin-top" : "origin-bottom"]),
|
|
290
|
+
style: te(L.value),
|
|
316
291
|
"data-ac-ds": "",
|
|
317
292
|
"data-testid": "ac-cluster-switcher-panel",
|
|
318
|
-
onKeydown:
|
|
293
|
+
onKeydown: Ke
|
|
319
294
|
}, [
|
|
320
|
-
|
|
321
|
-
class: "pointer-events-none absolute top-1/2 left-
|
|
295
|
+
f.searchable ? (g(), c("div", Se, [l("div", Ce, [d(b(ge), {
|
|
296
|
+
class: "pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted",
|
|
322
297
|
"aria-hidden": "true"
|
|
323
|
-
}),
|
|
298
|
+
}), ue(l("input", {
|
|
324
299
|
ref_key: "searchInput",
|
|
325
|
-
ref:
|
|
326
|
-
"onUpdate:modelValue":
|
|
300
|
+
ref: Re,
|
|
301
|
+
"onUpdate:modelValue": a[2] ||= (e) => P.value = e,
|
|
327
302
|
type: "text",
|
|
328
303
|
role: "combobox",
|
|
329
304
|
"aria-autocomplete": "list",
|
|
330
305
|
"aria-expanded": "true",
|
|
331
306
|
"aria-controls": A,
|
|
332
307
|
"aria-activedescendant": F.value >= 0 ? q(F.value) : void 0,
|
|
333
|
-
"aria-label":
|
|
334
|
-
placeholder:
|
|
308
|
+
"aria-label": f.searchPlaceholder,
|
|
309
|
+
placeholder: f.searchPlaceholder,
|
|
335
310
|
autocomplete: "off",
|
|
336
311
|
spellcheck: "false",
|
|
337
|
-
class: "h-
|
|
312
|
+
class: "h-9 w-full rounded-10 border border-border bg-background pr-3 pl-9 text-base text-heading outline-none transition-[border-color,box-shadow] duration-200 placeholder:text-muted/80 hover:border-accent-active focus:focus-ring",
|
|
338
313
|
"data-ac-ds": "",
|
|
339
314
|
"data-testid": "ac-cluster-switcher-search",
|
|
340
|
-
onKeydown:
|
|
341
|
-
}, null, 40,
|
|
342
|
-
|
|
315
|
+
onKeydown: Q
|
|
316
|
+
}, null, 40, we), [[se, P.value]])])])) : s("", !0),
|
|
317
|
+
l("ul", {
|
|
343
318
|
id: A,
|
|
344
319
|
ref_key: "listEl",
|
|
345
320
|
ref: N,
|
|
346
321
|
role: "listbox",
|
|
347
322
|
"aria-label": "Clusters",
|
|
348
|
-
tabindex:
|
|
349
|
-
"aria-activedescendant": !
|
|
350
|
-
class: "ac-scrollbar max-h-72 min-h-0 flex-1 p-
|
|
351
|
-
onKeydown:
|
|
352
|
-
}, [(g(!0),
|
|
353
|
-
id: q(
|
|
354
|
-
key:
|
|
323
|
+
tabindex: f.searchable ? -1 : 0,
|
|
324
|
+
"aria-activedescendant": !f.searchable && F.value >= 0 ? q(F.value) : void 0,
|
|
325
|
+
class: "ac-scrollbar max-h-72 min-h-0 flex-1 p-2 outline-none",
|
|
326
|
+
onKeydown: Q
|
|
327
|
+
}, [(g(!0), c(n, null, re(H.value, (t, n) => (g(), c("li", {
|
|
328
|
+
id: q(n),
|
|
329
|
+
key: t.name,
|
|
355
330
|
role: "option",
|
|
356
|
-
"aria-selected":
|
|
357
|
-
"aria-disabled": W(
|
|
358
|
-
class: h(["flex items-center gap-2.5 rounded-
|
|
331
|
+
"aria-selected": t.name === C.value,
|
|
332
|
+
"aria-disabled": W(t) || void 0,
|
|
333
|
+
class: h(["flex items-center gap-2.5 rounded-8 px-2.5 py-2 transition-colors duration-75", [W(t) ? "cursor-not-allowed opacity-50" : "cursor-pointer", n === F.value ? "bg-accent-hover" : t.name === C.value && "bg-accent"]]),
|
|
359
334
|
"data-ac-ds": "",
|
|
360
335
|
"data-testid": "ac-cluster-switcher-option",
|
|
361
|
-
onMouseenter: (
|
|
362
|
-
onMousedown:
|
|
363
|
-
onClick: (
|
|
364
|
-
}, [v(
|
|
365
|
-
cluster:
|
|
366
|
-
selected:
|
|
367
|
-
active:
|
|
336
|
+
onMouseenter: (e) => !W(t) && (F.value = n),
|
|
337
|
+
onMousedown: a[3] ||= de(() => {}, ["prevent"]),
|
|
338
|
+
onClick: (e) => Ue(t)
|
|
339
|
+
}, [v(e.$slots, "option", {
|
|
340
|
+
cluster: t,
|
|
341
|
+
selected: t.name === C.value,
|
|
342
|
+
active: n === F.value
|
|
368
343
|
}, () => [
|
|
369
|
-
|
|
344
|
+
l("span", De, [K(t.provider) ? (g(), c("img", {
|
|
370
345
|
key: 0,
|
|
371
|
-
src: K(
|
|
346
|
+
src: K(t.provider),
|
|
372
347
|
alt: "",
|
|
373
348
|
class: "size-5 object-contain",
|
|
374
|
-
onError: (
|
|
375
|
-
}, null, 40,
|
|
349
|
+
onError: (e) => Be(t.provider)
|
|
350
|
+
}, null, 40, Oe)) : (g(), o(b(me), {
|
|
376
351
|
key: 1,
|
|
377
352
|
class: "size-4 text-muted"
|
|
378
353
|
}))]),
|
|
379
|
-
|
|
380
|
-
|
|
354
|
+
l("span", ke, [l("span", Ae, y(U(t)), 1), l("span", je, [
|
|
355
|
+
t.status ? (g(), c("span", {
|
|
381
356
|
key: 0,
|
|
382
|
-
class: h(["inline-flex shrink-0 items-center gap-1",
|
|
383
|
-
}, [
|
|
384
|
-
class: h(["size-1.5 rounded-full", E[G(
|
|
357
|
+
class: h(["inline-flex shrink-0 items-center gap-1", Le[G(t.status)]])
|
|
358
|
+
}, [l("span", {
|
|
359
|
+
class: h(["size-1.5 rounded-full", E[G(t.status)]]),
|
|
385
360
|
"aria-hidden": "true"
|
|
386
|
-
}, null, 2),
|
|
387
|
-
|
|
388
|
-
|
|
361
|
+
}, null, 2), u(" " + y(t.status), 1)], 2)) : s("", !0),
|
|
362
|
+
t.status && (t.location || t.provider) ? (g(), c("span", Me, "·")) : s("", !0),
|
|
363
|
+
l("span", Ne, y([t.provider, t.location].filter(Boolean).join(" · ")), 1)
|
|
389
364
|
])]),
|
|
390
|
-
|
|
365
|
+
t.name === C.value ? (g(), o(b(fe), {
|
|
391
366
|
key: 0,
|
|
392
|
-
class: "size-4 shrink-0 text-primary",
|
|
367
|
+
class: "size-4 shrink-0 text-primary-strong",
|
|
393
368
|
"aria-hidden": "true"
|
|
394
|
-
})) :
|
|
395
|
-
])], 42,
|
|
396
|
-
|
|
397
|
-
href:
|
|
398
|
-
type:
|
|
399
|
-
class: "flex h-
|
|
369
|
+
})) : s("", !0)
|
|
370
|
+
])], 42, Ee))), 128)), H.value.length ? s("", !0) : (g(), c("li", Pe, [v(e.$slots, "empty", { query: P.value }, () => [u(y(P.value ? `No clusters match “${P.value}”` : "No clusters yet"), 1)])]))], 40, Te),
|
|
371
|
+
e.$slots.footer || f.importLabel ? (g(), c("div", Fe, [v(e.$slots, "footer", { close: Z }, () => [(g(), o(ie(f.importUrl ? "a" : "button"), {
|
|
372
|
+
href: f.importUrl || void 0,
|
|
373
|
+
type: f.importUrl ? void 0 : "button",
|
|
374
|
+
class: "flex min-h-9 w-full cursor-pointer items-center gap-2.5 rounded-8 px-3 py-2 text-base font-medium text-heading no-underline outline-none transition-colors duration-150 hover:bg-accent-hover focus-visible:bg-accent-hover focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",
|
|
400
375
|
"data-ac-ds": "",
|
|
401
376
|
"data-testid": "ac-cluster-switcher-import",
|
|
402
|
-
onClick:
|
|
377
|
+
onClick: We
|
|
403
378
|
}, {
|
|
404
|
-
default:
|
|
379
|
+
default: le(() => [d(b(he), {
|
|
405
380
|
class: "size-4 shrink-0 text-muted",
|
|
406
381
|
"aria-hidden": "true"
|
|
407
|
-
}),
|
|
382
|
+
}), u(" " + y(f.importLabel), 1)]),
|
|
408
383
|
_: 1
|
|
409
|
-
}, 8, ["href", "type"]))])])) :
|
|
410
|
-
], 38)) :
|
|
384
|
+
}, 8, ["href", "type"]))])])) : s("", !0)
|
|
385
|
+
], 38)) : s("", !0)]),
|
|
411
386
|
_: 3
|
|
412
387
|
}, 8, ["enter-from-class"])]))], 2));
|
|
413
388
|
}
|