@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,48 @@
|
|
|
1
|
+
export interface LocaleOption {
|
|
2
|
+
/** Locale code the app's i18n uses, e.g. `en`, `bn`, `de`. */
|
|
3
|
+
value: string;
|
|
4
|
+
/** The language's own name, e.g. "English", "বাংলা", "Deutsch". */
|
|
5
|
+
label: string;
|
|
6
|
+
/** A muted second line, e.g. the name in English: "Bengali". */
|
|
7
|
+
description?: string;
|
|
8
|
+
/** A flag emoji shown before the name at 20px, as in cloud-ui's language menu. */
|
|
9
|
+
flag?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface Props {
|
|
12
|
+
/** Languages to offer, each named in its own language. With fewer than two, nothing renders. */
|
|
13
|
+
locales: LocaleOption[];
|
|
14
|
+
/** `icon` is cloud-ui's bare 20px icon trigger for the navbar; `button` adds the current code (EN) and a chevron. */
|
|
15
|
+
variant?: "icon" | "button";
|
|
16
|
+
/** Accessible name of the trigger. The current language is added after it. */
|
|
17
|
+
ariaLabel?: string;
|
|
18
|
+
/** Heading at the top of the menu. Pass an empty string to hide it. */
|
|
19
|
+
menuTitle?: string;
|
|
20
|
+
/** Which edge of the trigger the menu lines up with. `end` suits the right of a navbar. */
|
|
21
|
+
align?: "start" | "end";
|
|
22
|
+
/** Remembers the choice in localStorage under `storageKey` and restores it on load. */
|
|
23
|
+
persist?: boolean;
|
|
24
|
+
/** localStorage key for `persist`. cloud-ui uses `user-locale`. */
|
|
25
|
+
storageKey?: string;
|
|
26
|
+
}
|
|
27
|
+
type __VLS_Props = Props;
|
|
28
|
+
type __VLS_ModelProps = {
|
|
29
|
+
/** The current locale code. Bind it to your i18n instance's locale. */
|
|
30
|
+
modelValue?: string;
|
|
31
|
+
};
|
|
32
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
33
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
34
|
+
"update:modelValue": (value: string) => any;
|
|
35
|
+
change: (value: string) => any;
|
|
36
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
37
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
38
|
+
onChange?: ((value: string) => any) | undefined;
|
|
39
|
+
}>, {
|
|
40
|
+
variant: "icon" | "button";
|
|
41
|
+
align: "start" | "end";
|
|
42
|
+
ariaLabel: string;
|
|
43
|
+
menuTitle: string;
|
|
44
|
+
persist: boolean;
|
|
45
|
+
storageKey: string;
|
|
46
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
47
|
+
declare const _default: typeof __VLS_export;
|
|
48
|
+
export default _default;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import e from "./AcDropdown.js";
|
|
2
|
+
import t from "./AcDropdownItem.js";
|
|
3
|
+
import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, mergeModels as u, normalizeClass as d, openBlock as f, renderList as p, toDisplayString as m, unref as h, useModel as g, withCtx as _ } from "vue";
|
|
4
|
+
import { ChevronDown as v, Languages as y } from "@lucide/vue";
|
|
5
|
+
//#region src/lib/components/AcLocaleSwitcher.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var b = ["aria-label"], x = ["aria-label"], S = { class: "font-mono text-xs tracking-wide uppercase" }, C = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "mb-2 border-b border-border px-4 py-2 text-xs font-semibold text-muted",
|
|
9
|
+
"aria-hidden": "true"
|
|
10
|
+
}, w = { class: "flex items-center gap-2" }, T = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "shrink-0 text-xl leading-none",
|
|
13
|
+
"aria-hidden": "true"
|
|
14
|
+
}, E = ["lang"], D = {
|
|
15
|
+
key: 1,
|
|
16
|
+
class: "size-2 shrink-0 rounded-full bg-primary",
|
|
17
|
+
"aria-hidden": "true"
|
|
18
|
+
}, O = /*@__PURE__*/ l({
|
|
19
|
+
__name: "AcLocaleSwitcher",
|
|
20
|
+
props: /*@__PURE__*/ u({
|
|
21
|
+
locales: {},
|
|
22
|
+
variant: { default: "icon" },
|
|
23
|
+
ariaLabel: { default: "Change language" },
|
|
24
|
+
menuTitle: { default: "Select language" },
|
|
25
|
+
align: { default: "end" },
|
|
26
|
+
persist: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !1
|
|
29
|
+
},
|
|
30
|
+
storageKey: { default: "user-locale" }
|
|
31
|
+
}, {
|
|
32
|
+
modelValue: { default: "" },
|
|
33
|
+
modelModifiers: {}
|
|
34
|
+
}),
|
|
35
|
+
emits: /*@__PURE__*/ u(["change"], ["update:modelValue"]),
|
|
36
|
+
setup(l, { emit: u }) {
|
|
37
|
+
let O = l, k = g(l, "modelValue"), A = u, j = r(() => O.locales.find((e) => e.value === k.value)), M = r(() => j.value ? `${O.ariaLabel} (${j.value.label})` : O.ariaLabel);
|
|
38
|
+
function N() {
|
|
39
|
+
try {
|
|
40
|
+
return localStorage.getItem(O.storageKey);
|
|
41
|
+
} catch {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function P(e) {
|
|
46
|
+
if (e !== k.value && (k.value = e, A("change", e), O.persist)) try {
|
|
47
|
+
localStorage.setItem(O.storageKey, e);
|
|
48
|
+
} catch {}
|
|
49
|
+
}
|
|
50
|
+
if (O.persist && typeof window < "u") {
|
|
51
|
+
let e = N();
|
|
52
|
+
e && e !== k.value && O.locales.some((t) => t.value === e) && P(e);
|
|
53
|
+
}
|
|
54
|
+
return (r, u) => l.locales.length > 1 ? (f(), i(e, {
|
|
55
|
+
key: 0,
|
|
56
|
+
align: l.align,
|
|
57
|
+
"menu-label": l.ariaLabel,
|
|
58
|
+
"data-testid": "ac-locale-switcher"
|
|
59
|
+
}, {
|
|
60
|
+
trigger: _(({ open: e }) => [l.variant === "icon" ? (f(), o("button", {
|
|
61
|
+
key: 0,
|
|
62
|
+
type: "button",
|
|
63
|
+
"aria-label": M.value,
|
|
64
|
+
class: d(["inline-flex cursor-pointer items-center gap-2 rounded-10 px-2 py-0.5 transition-colors duration-200 hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none", e ? "text-heading" : "text-muted"])
|
|
65
|
+
}, [c(h(y), {
|
|
66
|
+
class: "size-5",
|
|
67
|
+
"aria-hidden": "true"
|
|
68
|
+
})], 10, b)) : (f(), o("button", {
|
|
69
|
+
key: 1,
|
|
70
|
+
type: "button",
|
|
71
|
+
"aria-label": M.value,
|
|
72
|
+
class: d(["inline-flex h-9 cursor-pointer items-center gap-1.5 rounded-10 border border-border bg-surface px-3 text-base font-medium text-heading transition-colors duration-200 hover:bg-surface-sunken/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none", e && "bg-surface-sunken/50"])
|
|
73
|
+
}, [
|
|
74
|
+
c(h(y), {
|
|
75
|
+
class: "size-4 text-muted",
|
|
76
|
+
"aria-hidden": "true"
|
|
77
|
+
}),
|
|
78
|
+
s("span", S, m(j.value?.value ?? ""), 1),
|
|
79
|
+
c(h(v), {
|
|
80
|
+
class: d(["size-4 text-muted transition-transform duration-200 motion-reduce:transition-none", e && "rotate-180"]),
|
|
81
|
+
"aria-hidden": "true"
|
|
82
|
+
}, null, 8, ["class"])
|
|
83
|
+
], 10, x))]),
|
|
84
|
+
default: _(() => [l.menuTitle ? (f(), o("p", C, m(l.menuTitle), 1)) : a("", !0), (f(!0), o(n, null, p(l.locales, (e) => (f(), i(t, {
|
|
85
|
+
key: e.value,
|
|
86
|
+
description: e.description,
|
|
87
|
+
"aria-current": e.value === k.value ? "true" : void 0,
|
|
88
|
+
class: d(e.value === k.value && "bg-surface-sunken/50"),
|
|
89
|
+
onClick: (t) => P(e.value)
|
|
90
|
+
}, {
|
|
91
|
+
default: _(() => [s("span", w, [
|
|
92
|
+
e.flag ? (f(), o("span", T, m(e.flag), 1)) : a("", !0),
|
|
93
|
+
s("span", {
|
|
94
|
+
class: "min-w-0 flex-1 truncate font-medium text-heading",
|
|
95
|
+
lang: e.value
|
|
96
|
+
}, m(e.label), 9, E),
|
|
97
|
+
e.value === k.value ? (f(), o("span", D)) : a("", !0)
|
|
98
|
+
])]),
|
|
99
|
+
_: 2
|
|
100
|
+
}, 1032, [
|
|
101
|
+
"description",
|
|
102
|
+
"aria-current",
|
|
103
|
+
"class",
|
|
104
|
+
"onClick"
|
|
105
|
+
]))), 128))]),
|
|
106
|
+
_: 1
|
|
107
|
+
}, 8, ["align", "menu-label"])) : a("", !0);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
//#endregion
|
|
111
|
+
export { O as default };
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { ChartRenderer } from "../charts/echarts";
|
|
2
|
+
import type { ChartColor, ChartLegendPosition } from "../charts/shared";
|
|
3
|
+
/** The statuses with a built-in colour and label. Any other string is matched like AcBadge's `status`: `running` is green, `down` red. */
|
|
4
|
+
export type MapPointStatus = "success" | "info" | "warning" | "danger" | "pending" | "neutral";
|
|
5
|
+
/** One location on the map. */
|
|
6
|
+
export interface MapPoint {
|
|
7
|
+
/** Unique key, e.g. the datacenter slug `nyc1`. */
|
|
8
|
+
id: string;
|
|
9
|
+
/** Name in the tooltip, data table and `labels`, e.g. "New York 1". */
|
|
10
|
+
label: string;
|
|
11
|
+
/** Degrees north; negative is south. */
|
|
12
|
+
latitude: number;
|
|
13
|
+
/** Degrees east; negative is west. */
|
|
14
|
+
longitude: number;
|
|
15
|
+
/** Sets the colour and legend group: `success`, `warning`, `danger`, `info`, `pending`, `neutral`, or a raw state such as `RUNNING` or `down`. Defaults to `neutral`. */
|
|
16
|
+
status?: MapPointStatus | (string & {});
|
|
17
|
+
/** A line under the label in the tooltip, e.g. "New York, United States". */
|
|
18
|
+
description?: string;
|
|
19
|
+
/** A number shown in the tooltip and data table, e.g. the cluster count. */
|
|
20
|
+
value?: number;
|
|
21
|
+
/** Colour of this point only. Wins over the status colour. */
|
|
22
|
+
color?: ChartColor;
|
|
23
|
+
/** Other fields, read by your `tooltip` slot. */
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
}
|
|
26
|
+
/** A GeoJSON `FeatureCollection` of the areas to draw, in longitude and latitude, e.g. countries or regions. */
|
|
27
|
+
export interface MapGeoJson {
|
|
28
|
+
type: "FeatureCollection";
|
|
29
|
+
features: {
|
|
30
|
+
type: "Feature";
|
|
31
|
+
geometry: {
|
|
32
|
+
type: string;
|
|
33
|
+
coordinates?: unknown;
|
|
34
|
+
} | null;
|
|
35
|
+
properties?: Record<string, any> | null;
|
|
36
|
+
id?: string | number;
|
|
37
|
+
}[];
|
|
38
|
+
}
|
|
39
|
+
export interface MapChartTooltipSlotProps {
|
|
40
|
+
/** The hovered point. */
|
|
41
|
+
point: MapPoint;
|
|
42
|
+
/** Its status as shown in the legend, e.g. "Healthy". */
|
|
43
|
+
statusLabel: string;
|
|
44
|
+
/** Its colour as CSS, e.g. `var(--color-success)`. */
|
|
45
|
+
color: string;
|
|
46
|
+
/** `value` run through `valueFormatter`; empty when the point has none. */
|
|
47
|
+
formattedValue: string;
|
|
48
|
+
}
|
|
49
|
+
export interface Props {
|
|
50
|
+
/** The locations to plot: `{ id, label, latitude, longitude, status?, description?, value? }`. */
|
|
51
|
+
points: MapPoint[];
|
|
52
|
+
/** Map height in px. The width fills the container; on narrow screens the world view shrinks to keep its shape. */
|
|
53
|
+
height?: number;
|
|
54
|
+
/** Point diameter in px, or a function of the point, e.g. to size by `value`. cloud-ui uses 10px. */
|
|
55
|
+
pointSize?: number | ((point: MapPoint) => number);
|
|
56
|
+
/** Legend names per status, e.g. `{ success: "Live", danger: "Disabled" }`. Defaults: success "Healthy", warning "Degraded", danger "Down", info "Info", pending "Pending", neutral "Unknown"; other states are humanized. */
|
|
57
|
+
statusLabels?: Record<string, string>;
|
|
58
|
+
/** Colour per status, overriding the status colour: `{ maintenance: "chart-4" }`. */
|
|
59
|
+
statusColors?: Record<string, ChartColor>;
|
|
60
|
+
/** Legend of statuses above or below the map, or `none`. Hidden anyway when every point shares one status; clicking an entry hides or shows those points. */
|
|
61
|
+
legend?: ChartLegendPosition;
|
|
62
|
+
/** Shows how many points have each status in the legend. */
|
|
63
|
+
legendValues?: boolean;
|
|
64
|
+
/** Pulses a ring around points to show they're live: `true` for healthy (`success`) points, or a list of statuses, e.g. `["danger"]`. Points stay still when the viewer asks for reduced motion. */
|
|
65
|
+
pulse?: boolean | string[];
|
|
66
|
+
/** Prints each point's `label` under it. Labels that would overlap are hidden. */
|
|
67
|
+
labels?: boolean;
|
|
68
|
+
/** Lets viewers drag to pan and scroll to zoom, and shows zoom buttons. Off by default, so the wheel keeps scrolling the page. */
|
|
69
|
+
zoom?: boolean;
|
|
70
|
+
/** Smallest and largest zoom, as multiples of the whole-world view. */
|
|
71
|
+
zoomExtent?: [number, number];
|
|
72
|
+
/** Starts zoomed to fit the points instead of the whole world. */
|
|
73
|
+
fitToPoints?: boolean;
|
|
74
|
+
/** Your own map in place of the built-in world, e.g. one your API serves. Without it, a 110m Natural Earth world (no Antarctica) loads on first use, about 40 KB gzipped. */
|
|
75
|
+
geoJson?: MapGeoJson;
|
|
76
|
+
/** Name of `value` in the tooltip and data table, e.g. "Clusters". */
|
|
77
|
+
valueLabel?: string;
|
|
78
|
+
/** Formats `value` in the tooltip and data table. Defaults to compact numbers: `1.2K`. */
|
|
79
|
+
valueFormatter?: (value: number) => string;
|
|
80
|
+
/** Plural noun for the points in the screen-reader summary: "World map, 10 datacenters: 8 healthy, 2 down." */
|
|
81
|
+
pointsLabel?: string;
|
|
82
|
+
/** Shows a tooltip with the point's label, description, status and value on hover. Customise it with the `tooltip` slot. */
|
|
83
|
+
tooltip?: boolean;
|
|
84
|
+
/** Shows a skeleton of the same height while data loads. */
|
|
85
|
+
loading?: boolean;
|
|
86
|
+
/** Text shown in place of the map when `points` is empty. */
|
|
87
|
+
emptyText?: string;
|
|
88
|
+
/** Accessible name, e.g. "Datacenters". Show the visible title in the surrounding card. */
|
|
89
|
+
title?: string;
|
|
90
|
+
/** A sentence for screen readers on what the map shows. Defaults to the point count per status. */
|
|
91
|
+
description?: string;
|
|
92
|
+
/** `canvas` (default) or `svg`, which is crisper when printed or zoomed. */
|
|
93
|
+
renderer?: ChartRenderer;
|
|
94
|
+
/** Fades the points in and animates changes. Always off when the viewer asks for reduced motion. */
|
|
95
|
+
animation?: boolean;
|
|
96
|
+
}
|
|
97
|
+
type __VLS_Slots = {
|
|
98
|
+
/** Replaces the tooltip body for the hovered point. */
|
|
99
|
+
tooltip?: (props: MapChartTooltipSlotProps) => unknown;
|
|
100
|
+
};
|
|
101
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
102
|
+
"point-click": (point: MapPoint) => any;
|
|
103
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
104
|
+
"onPoint-click"?: ((point: MapPoint) => any) | undefined;
|
|
105
|
+
}>, {
|
|
106
|
+
legend: ChartLegendPosition;
|
|
107
|
+
title: string;
|
|
108
|
+
description: string;
|
|
109
|
+
height: number;
|
|
110
|
+
loading: boolean;
|
|
111
|
+
animation: boolean;
|
|
112
|
+
pulse: boolean | string[];
|
|
113
|
+
tooltip: boolean;
|
|
114
|
+
emptyText: string;
|
|
115
|
+
labels: boolean;
|
|
116
|
+
valueLabel: string;
|
|
117
|
+
renderer: ChartRenderer;
|
|
118
|
+
zoom: boolean;
|
|
119
|
+
valueFormatter: (value: number) => string;
|
|
120
|
+
legendValues: boolean;
|
|
121
|
+
pointSize: number | ((point: MapPoint) => number);
|
|
122
|
+
statusLabels: Record<string, string>;
|
|
123
|
+
statusColors: Record<string, ChartColor>;
|
|
124
|
+
zoomExtent: [number, number];
|
|
125
|
+
fitToPoints: boolean;
|
|
126
|
+
geoJson: MapGeoJson;
|
|
127
|
+
pointsLabel: string;
|
|
128
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
129
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
130
|
+
declare const _default: typeof __VLS_export;
|
|
131
|
+
export default _default;
|
|
132
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
133
|
+
new (): {
|
|
134
|
+
$slots: S;
|
|
135
|
+
};
|
|
136
|
+
};
|