@ac-design/design-system 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +160 -2
- package/dist/lib/compat.css +4441 -0
- package/dist/lib/components/AcAccordion.js +5 -0
- package/dist/lib/components/AcAccordion.vue.d.ts +35 -0
- package/dist/lib/components/AcAccordion.vue_vue_type_script_setup_true_lang.js +61 -0
- package/dist/lib/components/AcAccordionItem.js +5 -0
- package/dist/lib/components/AcAccordionItem.vue.d.ts +49 -0
- package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/lib/components/AcAlert.js +5 -0
- package/dist/lib/components/AcAlert.vue.d.ts +52 -0
- package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +121 -0
- package/dist/lib/components/AcAppSwitcher.js +5 -0
- package/dist/lib/components/AcAppSwitcher.vue.d.ts +83 -0
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +303 -0
- package/dist/lib/components/AcAvatar.js +5 -0
- package/dist/lib/components/AcAvatar.vue.d.ts +27 -0
- package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +116 -0
- package/dist/lib/components/AcBadge.js +5 -0
- package/dist/lib/components/AcBadge.vue.d.ts +32 -0
- package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/lib/components/AcBanner.js +5 -0
- package/dist/lib/components/AcBanner.vue.d.ts +57 -0
- package/dist/lib/components/AcBanner.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/lib/components/AcBreadcrumb.js +5 -0
- package/dist/lib/components/AcBreadcrumb.vue.d.ts +25 -0
- package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/lib/components/AcButton.js +5 -0
- package/dist/lib/components/AcButton.vue.d.ts +49 -0
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/lib/components/AcButtons.js +5 -0
- package/dist/lib/components/AcButtons.vue.d.ts +31 -0
- package/dist/lib/components/AcButtons.vue_vue_type_script_setup_true_lang.js +44 -0
- package/dist/lib/components/AcCard.js +5 -0
- package/dist/lib/components/AcCard.vue.d.ts +27 -0
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/lib/components/AcCellValue.js +5 -0
- package/dist/lib/components/AcCellValue.vue.d.ts +139 -0
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +386 -0
- package/dist/lib/components/AcCheckBox.js +5 -0
- package/dist/lib/components/AcCheckBox.vue.d.ts +31 -0
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/lib/components/AcCheckRadio.js +5 -0
- package/dist/lib/components/AcCheckRadio.vue.d.ts +35 -0
- package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +56 -0
- package/dist/lib/components/AcClusterSwitcher.js +5 -0
- package/dist/lib/components/AcClusterSwitcher.vue.d.ts +95 -0
- package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +416 -0
- package/dist/lib/components/AcCodeEditor.js +5 -0
- package/dist/lib/components/AcCodeEditor.vue.d.ts +88 -0
- package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +381 -0
- package/dist/lib/components/AcContentHeader.js +5 -0
- package/dist/lib/components/AcContentHeader.vue.d.ts +29 -0
- package/dist/lib/components/AcContentHeader.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/lib/components/AcContentLayout.js +5 -0
- package/dist/lib/components/AcContentLayout.vue.d.ts +21 -0
- package/dist/lib/components/AcContentLayout.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/lib/components/AcContentTable.js +5 -0
- package/dist/lib/components/AcContentTable.vue.d.ts +54 -0
- package/dist/lib/components/AcContentTable.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/lib/components/AcDatePicker.js +5 -0
- package/dist/lib/components/AcDatePicker.vue.d.ts +88 -0
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +794 -0
- package/dist/lib/components/AcDeleteModal.js +5 -0
- package/dist/lib/components/AcDeleteModal.vue.d.ts +51 -0
- package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +110 -0
- package/dist/lib/components/AcDivider.js +5 -0
- package/dist/lib/components/AcDivider.vue.d.ts +25 -0
- package/dist/lib/components/AcDivider.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/lib/components/AcDropdown.js +5 -0
- package/dist/lib/components/AcDropdown.vue.d.ts +45 -0
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +152 -0
- package/dist/lib/components/AcDropdownDivider.js +5 -0
- package/dist/lib/components/AcDropdownDivider.vue.d.ts +9 -0
- package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +20 -0
- package/dist/lib/components/AcDropdownItem.js +5 -0
- package/dist/lib/components/AcDropdownItem.vue.d.ts +50 -0
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/lib/components/AcEmptyState.js +5 -0
- package/dist/lib/components/AcEmptyState.vue.d.ts +42 -0
- package/dist/lib/components/AcEmptyState.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/lib/components/AcFeatureCard.js +5 -0
- package/dist/lib/components/AcFeatureCard.vue.d.ts +84 -0
- package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +218 -0
- package/dist/lib/components/AcFileEditor.js +5 -0
- package/dist/lib/components/AcFileEditor.vue.d.ts +95 -0
- package/dist/lib/components/AcFileEditor.vue_vue_type_script_setup_true_lang.js +556 -0
- package/dist/lib/components/AcFileUpload.js +5 -0
- package/dist/lib/components/AcFileUpload.vue.d.ts +67 -0
- package/dist/lib/components/AcFileUpload.vue_vue_type_script_setup_true_lang.js +274 -0
- package/dist/lib/components/AcFontScale.js +5 -0
- package/dist/lib/components/AcFontScale.vue.d.ts +17 -0
- package/dist/lib/components/AcFontScale.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/lib/components/AcForm.js +5 -0
- package/dist/lib/components/AcForm.vue.d.ts +31 -0
- package/dist/lib/components/AcForm.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/lib/components/AcFormArray.js +5 -0
- package/dist/lib/components/AcFormArray.vue.d.ts +124 -0
- package/dist/lib/components/AcFormArray.vue_vue_type_script_setup_true_lang.js +485 -0
- package/dist/lib/components/AcFormFooter.js +5 -0
- package/dist/lib/components/AcFormFooter.vue.d.ts +48 -0
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/lib/components/AcFormSection.js +5 -0
- package/dist/lib/components/AcFormSection.vue.d.ts +32 -0
- package/dist/lib/components/AcFormSection.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/lib/components/AcHeader.js +5 -0
- package/dist/lib/components/AcHeader.vue.d.ts +46 -0
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/lib/components/AcHeaderItem.js +5 -0
- package/dist/lib/components/AcHeaderItem.vue.d.ts +13 -0
- package/dist/lib/components/AcHeaderItem.vue_vue_type_script_setup_true_lang.js +14 -0
- package/dist/lib/components/AcHeaderItems.js +5 -0
- package/dist/lib/components/AcHeaderItems.vue.d.ts +13 -0
- package/dist/lib/components/AcHeaderItems.vue_vue_type_script_setup_true_lang.js +14 -0
- package/dist/lib/components/AcInfoTable.js +5 -0
- package/dist/lib/components/AcInfoTable.vue.d.ts +59 -0
- package/dist/lib/components/AcInfoTable.vue_vue_type_script_setup_true_lang.js +127 -0
- package/dist/lib/components/AcInput.js +5 -0
- package/dist/lib/components/AcInput.vue.d.ts +68 -0
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +143 -0
- package/dist/lib/components/AcKbd.js +5 -0
- package/dist/lib/components/AcKbd.vue.d.ts +25 -0
- package/dist/lib/components/AcKbd.vue_vue_type_script_setup_true_lang.js +134 -0
- package/dist/lib/components/AcLogo.js +5 -0
- package/dist/lib/components/AcLogo.vue.d.ts +18 -0
- package/dist/lib/components/AcLogo.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/lib/components/AcModal.js +5 -0
- package/dist/lib/components/AcModal.vue.d.ts +54 -0
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +125 -0
- package/dist/lib/components/AcNavbar.js +5 -0
- package/dist/lib/components/AcNavbar.vue.d.ts +41 -0
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/lib/components/AcNavbarItem.js +5 -0
- package/dist/lib/components/AcNavbarItem.vue.d.ts +44 -0
- package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/lib/components/AcNotificationMenu.js +5 -0
- package/dist/lib/components/AcNotificationMenu.vue.d.ts +90 -0
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +345 -0
- package/dist/lib/components/AcPage.js +5 -0
- package/dist/lib/components/AcPage.vue.d.ts +25 -0
- package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +36 -0
- package/dist/lib/components/AcPagination.js +5 -0
- package/dist/lib/components/AcPagination.vue.d.ts +51 -0
- package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +160 -0
- package/dist/lib/components/AcPreloader.js +5 -0
- package/dist/lib/components/AcPreloader.vue.d.ts +28 -0
- package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/lib/components/AcProgress.js +5 -0
- package/dist/lib/components/AcProgress.vue.d.ts +31 -0
- package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/lib/components/AcResourceCard.js +5 -0
- package/dist/lib/components/AcResourceCard.vue.d.ts +106 -0
- package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +203 -0
- package/dist/lib/components/AcSearchBar.js +5 -0
- package/dist/lib/components/AcSearchBar.vue.d.ts +41 -0
- package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/lib/components/AcSectionContent.js +5 -0
- package/dist/lib/components/AcSectionContent.vue.d.ts +55 -0
- package/dist/lib/components/AcSectionContent.vue_vue_type_script_setup_true_lang.js +74 -0
- package/dist/lib/components/AcSegmentedControl.js +5 -0
- package/dist/lib/components/AcSegmentedControl.vue.d.ts +46 -0
- package/dist/lib/components/AcSegmentedControl.vue_vue_type_script_setup_true_lang.js +104 -0
- package/dist/lib/components/AcSelect.js +5 -0
- package/dist/lib/components/AcSelect.vue.d.ts +78 -0
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +441 -0
- package/dist/lib/components/AcSidePanel.js +5 -0
- package/dist/lib/components/AcSidePanel.vue.d.ts +57 -0
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +128 -0
- package/dist/lib/components/AcSideTabs.js +5 -0
- package/dist/lib/components/AcSideTabs.vue.d.ts +93 -0
- package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +373 -0
- package/dist/lib/components/AcSidebar.js +5 -0
- package/dist/lib/components/AcSidebar.vue.d.ts +63 -0
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +221 -0
- package/dist/lib/components/AcSidebarItem.js +5 -0
- package/dist/lib/components/AcSidebarItem.vue.d.ts +55 -0
- package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +155 -0
- package/dist/lib/components/AcSidebarSection.js +5 -0
- package/dist/lib/components/AcSidebarSection.vue.d.ts +32 -0
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/lib/components/AcSkeleton.js +5 -0
- package/dist/lib/components/AcSkeleton.vue.d.ts +27 -0
- package/dist/lib/components/AcSkeleton.vue_vue_type_script_setup_true_lang.js +142 -0
- package/dist/lib/components/AcSlider.js +5 -0
- package/dist/lib/components/AcSlider.vue.d.ts +72 -0
- package/dist/lib/components/AcSlider.vue_vue_type_script_setup_true_lang.js +327 -0
- package/dist/lib/components/AcSpinner.js +5 -0
- package/dist/lib/components/AcSpinner.vue.d.ts +12 -0
- package/dist/lib/components/AcSpinner.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/lib/components/AcStatCard.js +5 -0
- package/dist/lib/components/AcStatCard.vue.d.ts +84 -0
- package/dist/lib/components/AcStatCard.vue_vue_type_script_setup_true_lang.js +225 -0
- package/dist/lib/components/AcStatusBar.js +5 -0
- package/dist/lib/components/AcStatusBar.vue.d.ts +66 -0
- package/dist/lib/components/AcStatusBar.vue_vue_type_script_setup_true_lang.js +145 -0
- package/dist/lib/components/AcSteps.js +5 -0
- package/dist/lib/components/AcSteps.vue.d.ts +28 -0
- package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +91 -0
- package/dist/lib/components/AcSwitch.js +5 -0
- package/dist/lib/components/AcSwitch.vue.d.ts +44 -0
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/lib/components/AcTable.js +5 -0
- package/dist/lib/components/AcTable.vue.d.ts +98 -0
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +272 -0
- package/dist/lib/components/AcTabs.js +5 -0
- package/dist/lib/components/AcTabs.vue.d.ts +40 -0
- package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +72 -0
- package/dist/lib/components/AcTag.js +5 -0
- package/dist/lib/components/AcTag.vue.d.ts +41 -0
- package/dist/lib/components/AcTag.vue_vue_type_script_setup_true_lang.js +99 -0
- package/dist/lib/components/AcTextarea.js +5 -0
- package/dist/lib/components/AcTextarea.vue.d.ts +53 -0
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +120 -0
- package/dist/lib/components/AcThemeMode.js +5 -0
- package/dist/lib/components/AcThemeMode.vue.d.ts +17 -0
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/lib/components/AcToaster.js +5 -0
- package/dist/lib/components/AcToaster.vue.d.ts +15 -0
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +166 -0
- package/dist/lib/components/AcTooltip.js +5 -0
- package/dist/lib/components/AcTooltip.vue.d.ts +30 -0
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +117 -0
- package/dist/lib/components/AcUsageCard.js +5 -0
- package/dist/lib/components/AcUsageCard.vue.d.ts +85 -0
- package/dist/lib/components/AcUsageCard.vue_vue_type_script_setup_true_lang.js +230 -0
- package/dist/lib/components/AcUserMenu.js +5 -0
- package/dist/lib/components/AcUserMenu.vue.d.ts +77 -0
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +258 -0
- package/dist/lib/components/index.d.ts +76 -0
- package/dist/lib/components/types.d.ts +16 -0
- package/dist/lib/composables/copyText.d.ts +6 -0
- package/dist/lib/composables/copyText.js +16 -0
- package/dist/lib/composables/useBrandColor.d.ts +53 -0
- package/dist/lib/composables/useBrandColor.js +148 -0
- package/dist/lib/composables/useColorMode.d.ts +12 -0
- package/dist/lib/composables/useColorMode.js +40 -0
- package/dist/lib/composables/useFontScale.d.ts +16 -0
- package/dist/lib/composables/useFontScale.js +43 -0
- package/dist/lib/composables/useToast.d.ts +68 -0
- package/dist/lib/composables/useToast.js +36 -0
- package/dist/lib/editor/index.d.ts +4 -0
- package/dist/lib/editor/index.js +3 -0
- package/dist/lib/editor/theme.d.ts +3 -0
- package/dist/lib/editor/theme.js +309 -0
- package/dist/lib/editor/validate.d.ts +19 -0
- package/dist/lib/editor/validate.js +127 -0
- package/dist/lib/index.d.ts +29 -0
- package/dist/lib/index.js +78 -0
- package/dist/lib/theme.css +556 -0
- package/package.json +82 -4
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/** How a value is shown. `auto` picks one from the value itself. */
|
|
2
|
+
export type CellType = "auto" | "string" | "number" | "integer" | "boolean" | "date" | "object" | "array" | "labels" | "status";
|
|
3
|
+
/** One cell of a server-side resource table (the old `AcTableCell`). */
|
|
4
|
+
export interface ResourceCell {
|
|
5
|
+
/** The value: a string, number, boolean, map, list or null. */
|
|
6
|
+
data: unknown;
|
|
7
|
+
/** Value to sort by, when it differs from `data` (e.g. a Unix time for an age). */
|
|
8
|
+
sort?: string | number;
|
|
9
|
+
/** Where the value links to. May hold `${placeholders}`; resolve them with `resolveLink`. */
|
|
10
|
+
link?: string;
|
|
11
|
+
/** Hover text for the value. */
|
|
12
|
+
tooltip?: string;
|
|
13
|
+
/** URL of a 16px image shown before the value. */
|
|
14
|
+
icon?: string;
|
|
15
|
+
/** Status colour, e.g. `success` or `danger`. Shows the value as a badge. */
|
|
16
|
+
color?: string;
|
|
17
|
+
/** Shows the value in bold. */
|
|
18
|
+
isBold?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** One column of a server-side resource table (the old `AcTableCol`). */
|
|
21
|
+
export interface ResourceColumn {
|
|
22
|
+
/** Header text. Also titles the JSON viewer. */
|
|
23
|
+
name: string;
|
|
24
|
+
/** OpenAPI type from the server (`string`, `integer`, `number`, `boolean`, `date`, `object`), or any `CellType`. */
|
|
25
|
+
type?: CellType | "string" | "integer" | "number" | "boolean" | "date" | "object";
|
|
26
|
+
/** OpenAPI format. `name` marks the resource-name column, which is shown bold. */
|
|
27
|
+
format?: string;
|
|
28
|
+
/** Lower numbers matter more. Hide high numbers on narrow screens. */
|
|
29
|
+
priority?: number;
|
|
30
|
+
/** Server template the value came from. Not used by the UI. */
|
|
31
|
+
pathTemplate?: string;
|
|
32
|
+
/** Alignment of the value. */
|
|
33
|
+
textAlign?: "left" | "center" | "right" | string;
|
|
34
|
+
/** Badge shape for coloured cells: `Pill` (default) or `Rectangle`. */
|
|
35
|
+
shape?: "Pill" | "Rectangle" | string;
|
|
36
|
+
/** Column width in pixels. */
|
|
37
|
+
width?: number;
|
|
38
|
+
/** Server-side sort settings. */
|
|
39
|
+
sort?: {
|
|
40
|
+
enable?: boolean;
|
|
41
|
+
template?: string;
|
|
42
|
+
type?: string;
|
|
43
|
+
};
|
|
44
|
+
/** Present when cells in this column carry links. */
|
|
45
|
+
link?: boolean | Record<string, unknown>;
|
|
46
|
+
/** Present when cells in this column carry tooltips. */
|
|
47
|
+
tooltip?: boolean | Record<string, unknown>;
|
|
48
|
+
/** Present when cells in this column carry icons. */
|
|
49
|
+
icon?: boolean | Record<string, unknown>;
|
|
50
|
+
/** A Grafana dashboard for the row. The app renders the button, e.g. in an AcTable cell slot. */
|
|
51
|
+
dashboard?: {
|
|
52
|
+
status: string;
|
|
53
|
+
title: string;
|
|
54
|
+
message?: string;
|
|
55
|
+
};
|
|
56
|
+
/** A shell into the row's pod or service. The app renders the button. */
|
|
57
|
+
exec?: Record<string, unknown>;
|
|
58
|
+
}
|
|
59
|
+
/** One row of a server-side resource table (the old `AcTableRow`). */
|
|
60
|
+
export interface ResourceRow {
|
|
61
|
+
cells: ResourceCell[];
|
|
62
|
+
namespace?: string;
|
|
63
|
+
ctx?: Record<string, unknown>;
|
|
64
|
+
}
|
|
65
|
+
/** A server-side resource table: column descriptors and rows of cells (the old `AcTable` type). */
|
|
66
|
+
export interface ResourceTable {
|
|
67
|
+
columns: ResourceColumn[];
|
|
68
|
+
rows: ResourceRow[];
|
|
69
|
+
name?: string;
|
|
70
|
+
}
|
|
71
|
+
/** @deprecated Use `ResourceCell`. */
|
|
72
|
+
export type AcTableCell = ResourceCell;
|
|
73
|
+
/** @deprecated Use `ResourceColumn`. */
|
|
74
|
+
export type AcTableCol = ResourceColumn;
|
|
75
|
+
/** @deprecated Use `ResourceRow`. */
|
|
76
|
+
export type AcTableRow = ResourceRow;
|
|
77
|
+
export interface Props {
|
|
78
|
+
/** The value to show: text, a number, a boolean, a date, a map, a list, or null for a dash. */
|
|
79
|
+
value?: unknown;
|
|
80
|
+
/** How to show it. `auto` detects booleans, numbers, ISO dates, lists and maps (a map of plain values becomes label chips). */
|
|
81
|
+
type?: CellType;
|
|
82
|
+
/** A server-side cell `{ data, link, tooltip, icon, color, isBold }` (the old `cellValue`). Its fields fill in the props of the same meaning. */
|
|
83
|
+
cell?: ResourceCell;
|
|
84
|
+
/** A server-side column `{ name, type, format, textAlign, shape }` (the old `cellDescriptor`). Fills in `type`, `title` and `align`. */
|
|
85
|
+
column?: ResourceColumn;
|
|
86
|
+
/** What the value is, e.g. the column name. Titles the JSON viewer and labels its button. */
|
|
87
|
+
title?: string;
|
|
88
|
+
/** Makes the value a link. `http(s)` links open in a new tab; paths starting with `/` use `RouterLink` when vue-router is installed. */
|
|
89
|
+
href?: string;
|
|
90
|
+
/** Turns a link template into a URL, e.g. to fill `${username}` and `${clustername}` from the current route. */
|
|
91
|
+
resolveLink?: (link: string) => string;
|
|
92
|
+
/** Status colour. Shows the value as a badge. Accepts the old Bulma names too (`is-success`, `light`, `dark`). */
|
|
93
|
+
color?: string;
|
|
94
|
+
/** Hover and focus text. Truncated values show their full text when this is empty. */
|
|
95
|
+
tooltip?: string;
|
|
96
|
+
/** URL of a 16px image before the value, e.g. a cloud provider logo. */
|
|
97
|
+
icon?: string;
|
|
98
|
+
/** Shows the value in bold heading colour, e.g. a resource name. */
|
|
99
|
+
bold?: boolean;
|
|
100
|
+
/** Shows text in the monospace font, for IDs, images and hashes. */
|
|
101
|
+
mono?: boolean;
|
|
102
|
+
/** Alignment inside a wider container. Tables align through their column instead. */
|
|
103
|
+
align?: "left" | "center" | "right";
|
|
104
|
+
/** CSS max width. Longer text is cut with an ellipsis and a tooltip shows it in full. */
|
|
105
|
+
maxWidth?: string;
|
|
106
|
+
/** How many label or list chips show before a “+N more” button. */
|
|
107
|
+
maxItems?: number;
|
|
108
|
+
/** Text after a number, e.g. `%` or ` GiB`. */
|
|
109
|
+
unit?: string;
|
|
110
|
+
/** Shows dates as “3d ago” with the exact time on hover. Turn off to show the exact time. */
|
|
111
|
+
relative?: boolean;
|
|
112
|
+
/** Shown for null, empty text, empty lists and maps, and the server's `<none>` / `<unknown>`. */
|
|
113
|
+
emptyText?: string;
|
|
114
|
+
/** Shows a placeholder bar while the value loads. */
|
|
115
|
+
loading?: boolean;
|
|
116
|
+
}
|
|
117
|
+
declare const _default: typeof __VLS_export;
|
|
118
|
+
export default _default;
|
|
119
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
120
|
+
type: CellType;
|
|
121
|
+
bold: boolean;
|
|
122
|
+
title: string;
|
|
123
|
+
value: undefined;
|
|
124
|
+
icon: string;
|
|
125
|
+
color: string;
|
|
126
|
+
href: string;
|
|
127
|
+
loading: boolean;
|
|
128
|
+
align: "left" | "center" | "right";
|
|
129
|
+
maxItems: number;
|
|
130
|
+
tooltip: string;
|
|
131
|
+
column: ResourceColumn;
|
|
132
|
+
relative: boolean;
|
|
133
|
+
emptyText: string;
|
|
134
|
+
cell: ResourceCell;
|
|
135
|
+
resolveLink: (link: string) => string;
|
|
136
|
+
mono: boolean;
|
|
137
|
+
maxWidth: string;
|
|
138
|
+
unit: string;
|
|
139
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
import e from "./AcBadge.js";
|
|
2
|
+
import t from "./AcModal.js";
|
|
3
|
+
import n from "./AcSkeleton.js";
|
|
4
|
+
import r from "./AcTag.js";
|
|
5
|
+
import i from "./AcTooltip.js";
|
|
6
|
+
import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as ee, createVNode as d, defineAsyncComponent as f, defineComponent as p, getCurrentInstance as te, h as ne, mergeProps as m, nextTick as re, normalizeClass as h, normalizeStyle as g, onBeforeUnmount as ie, onMounted as ae, openBlock as _, ref as v, renderList as oe, resolveDynamicComponent as y, toDisplayString as b, unref as x, watch as S, withCtx as C, withModifiers as w } from "vue";
|
|
7
|
+
import { Braces as se, Check as ce, Minus as le } from "@lucide/vue";
|
|
8
|
+
//#region src/lib/components/AcCellValue.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
var ue = ["src"], de = {
|
|
10
|
+
key: 1,
|
|
11
|
+
class: "text-muted"
|
|
12
|
+
}, fe = ["tabindex"], pe = {
|
|
13
|
+
key: 4,
|
|
14
|
+
class: "inline-flex items-center gap-1"
|
|
15
|
+
}, me = ["datetime"], he = ["datetime", "tabindex"], ge = ["aria-expanded", "aria-label"], _e = ["tabindex"], ve = ["aria-label"], T = v(Date.now()), E = 0, D;
|
|
16
|
+
function ye() {
|
|
17
|
+
E++ === 0 && (D = setInterval(() => T.value = Date.now(), 3e4));
|
|
18
|
+
}
|
|
19
|
+
function O() {
|
|
20
|
+
--E === 0 && clearInterval(D);
|
|
21
|
+
}
|
|
22
|
+
var k = /* @__PURE__ */ new WeakMap(), A;
|
|
23
|
+
function be(e, t) {
|
|
24
|
+
if (typeof ResizeObserver > "u") return t();
|
|
25
|
+
A ??= new ResizeObserver((e) => e.forEach((e) => k.get(e.target)?.())), k.set(e, t), A.observe(e);
|
|
26
|
+
}
|
|
27
|
+
function j(e) {
|
|
28
|
+
k.delete(e), A?.unobserve(e);
|
|
29
|
+
}
|
|
30
|
+
var M = /*@__PURE__*/ p({
|
|
31
|
+
__name: "AcCellValue",
|
|
32
|
+
props: {
|
|
33
|
+
value: { default: void 0 },
|
|
34
|
+
type: { default: "auto" },
|
|
35
|
+
cell: { default: void 0 },
|
|
36
|
+
column: { default: void 0 },
|
|
37
|
+
title: { default: "" },
|
|
38
|
+
href: { default: "" },
|
|
39
|
+
resolveLink: {
|
|
40
|
+
type: Function,
|
|
41
|
+
default: void 0
|
|
42
|
+
},
|
|
43
|
+
color: { default: "" },
|
|
44
|
+
tooltip: { default: "" },
|
|
45
|
+
icon: { default: "" },
|
|
46
|
+
bold: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: !1
|
|
49
|
+
},
|
|
50
|
+
mono: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: !1
|
|
53
|
+
},
|
|
54
|
+
align: { default: void 0 },
|
|
55
|
+
maxWidth: { default: "calc(280px * var(--ac-scale))" },
|
|
56
|
+
maxItems: { default: 3 },
|
|
57
|
+
unit: { default: "" },
|
|
58
|
+
relative: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: !0
|
|
61
|
+
},
|
|
62
|
+
emptyText: { default: "—" },
|
|
63
|
+
loading: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: !1
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
setup(p) {
|
|
69
|
+
let E = p, D = /* @__PURE__ */ new Set([
|
|
70
|
+
"",
|
|
71
|
+
"<none>",
|
|
72
|
+
"<unknown>",
|
|
73
|
+
"<nil>",
|
|
74
|
+
"null",
|
|
75
|
+
"undefined"
|
|
76
|
+
]), k = {
|
|
77
|
+
primary: "primary",
|
|
78
|
+
secondary: "secondary",
|
|
79
|
+
info: "info",
|
|
80
|
+
link: "info",
|
|
81
|
+
success: "success",
|
|
82
|
+
warning: "warning",
|
|
83
|
+
danger: "danger",
|
|
84
|
+
dark: "dark",
|
|
85
|
+
black: "dark",
|
|
86
|
+
light: "default",
|
|
87
|
+
white: "default",
|
|
88
|
+
gray: "default",
|
|
89
|
+
default: "default",
|
|
90
|
+
neutral: "default"
|
|
91
|
+
}, A = [
|
|
92
|
+
["success", /^(ready|running|succeeded|success|successful|healthy|active|available|approved|bound|completed?|current|provisioned|synced|true)$/],
|
|
93
|
+
["danger", /^(failed|failure|error|critical|notready|not ready|unhealthy|crashloopbackoff|lost|rejected|false)$/],
|
|
94
|
+
["warning", /^(pending|provisioning|progressing|updating|degraded|warning|halted|paused|terminating|waiting|suspended)$/]
|
|
95
|
+
], M = /^-?[\d.]+\s?[a-zA-Z%]{0,3}$/, xe = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/, Se = new Intl.NumberFormat(void 0, { maximumFractionDigits: 2 }), Ce = new Intl.NumberFormat(void 0, { maximumFractionDigits: 0 }), N = new Intl.DateTimeFormat(void 0, {
|
|
96
|
+
dateStyle: "medium",
|
|
97
|
+
timeStyle: "long"
|
|
98
|
+
}), we = f({
|
|
99
|
+
loader: () => import("../editor/index.js").then((e) => e.AcCodeEditor),
|
|
100
|
+
loadingComponent: () => ne(n, {
|
|
101
|
+
shape: "editor",
|
|
102
|
+
height: "240px"
|
|
103
|
+
}),
|
|
104
|
+
delay: 150
|
|
105
|
+
}), P = te()?.appContext.components.RouterLink, F = v(null), I = v(!1), L = v(!1), R = v(!1), z = v(!1), B = o(() => E.cell ? E.cell.data : E.value), V = o(() => E.title || E.column?.name || ""), H = o(() => E.tooltip || E.cell?.tooltip || ""), Te = o(() => E.icon || E.cell?.icon || ""), Ee = o(() => E.bold || !!E.cell?.isBold || E.column?.format === "name"), U = o(() => E.align ?? E.column?.textAlign), W = o(() => {
|
|
106
|
+
let e = E.href || E.cell?.link || "";
|
|
107
|
+
return e && E.resolveLink ? E.resolveLink(e) : e;
|
|
108
|
+
}), De = o(() => /^https?:\/\//.test(W.value)), G = o(() => P && W.value.startsWith("/") ? P : "a"), K = o(() => W.value ? De.value ? {
|
|
109
|
+
href: W.value,
|
|
110
|
+
target: "_blank",
|
|
111
|
+
rel: "noopener noreferrer"
|
|
112
|
+
} : G.value === "a" ? { href: W.value } : { to: W.value } : null), Oe = o(() => {
|
|
113
|
+
let e = (E.color || E.cell?.color || "").trim().split(/\s+/)[0].replace(/^is-/, "");
|
|
114
|
+
if (e) return k[e] ?? "default";
|
|
115
|
+
if (q.value !== "status") return null;
|
|
116
|
+
let t = String(B.value).trim().toLowerCase();
|
|
117
|
+
return A.find(([, e]) => e.test(t))?.[0] ?? "default";
|
|
118
|
+
}), q = o(() => {
|
|
119
|
+
let e = B.value;
|
|
120
|
+
if (Fe(e)) return "empty";
|
|
121
|
+
if (E.color || E.cell?.color) return "status";
|
|
122
|
+
if (E.type !== "auto") return E.type;
|
|
123
|
+
let t = typeof e == "object" ? void 0 : E.column?.type;
|
|
124
|
+
return t && t !== "auto" && t !== "object" ? t : typeof e == "boolean" ? "boolean" : typeof e == "number" ? "number" : Array.isArray(e) ? "array" : typeof e == "object" ? Ie(e) ? "labels" : "object" : typeof e == "string" && xe.test(e) && !Number.isNaN(Date.parse(e)) ? "date" : "string";
|
|
125
|
+
}), J = o(() => q.value === "date" ? Le(B.value) : null), Y = o(() => {
|
|
126
|
+
let e = B.value;
|
|
127
|
+
switch (q.value) {
|
|
128
|
+
case "number":
|
|
129
|
+
case "integer": {
|
|
130
|
+
let t = typeof e == "number" ? e : Number(e);
|
|
131
|
+
return Number.isNaN(t) ? `${String(e)}${E.unit}` : `${(q.value === "integer" ? Ce : Se).format(t)}${E.unit}`;
|
|
132
|
+
}
|
|
133
|
+
case "boolean": return $(e) ? "true" : "false";
|
|
134
|
+
case "date": return J.value ? E.relative ? Re(J.value, T.value) : N.format(J.value) : String(e);
|
|
135
|
+
case "object": return Be(e);
|
|
136
|
+
default: return typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
137
|
+
}
|
|
138
|
+
}), X = o(() => J.value ? H.value || (E.relative ? N.format(J.value) : Re(J.value, T.value)) : H.value), ke = o(() => H.value || (I.value ? Y.value : "")), Z = o(() => {
|
|
139
|
+
let e = B.value;
|
|
140
|
+
return q.value === "labels" ? Object.entries(e).map(([e, t]) => ({
|
|
141
|
+
key: e,
|
|
142
|
+
value: String(t ?? ""),
|
|
143
|
+
text: `${e}=${t ?? ""}`
|
|
144
|
+
})) : q.value === "array" ? e.map((e) => {
|
|
145
|
+
let t = Ve(e);
|
|
146
|
+
return {
|
|
147
|
+
key: "",
|
|
148
|
+
value: t,
|
|
149
|
+
text: t
|
|
150
|
+
};
|
|
151
|
+
}) : [];
|
|
152
|
+
}), Ae = o(() => L.value ? Z.value : Z.value.slice(0, E.maxItems)), Q = o(() => Z.value.length - Math.min(Z.value.length, E.maxItems)), je = o(() => q.value === "object" || q.value === "array" && B.value.some((e) => typeof e == "object" && !!e)), Me = o(() => R.value ? JSON.stringify(B.value, null, 2) : ""), Ne = o(() => q.value === "number" || q.value === "integer" || q.value === "string" && M.test(Y.value)), Pe = o(() => q.value === "labels" ? "labels" : "items");
|
|
153
|
+
function Fe(e) {
|
|
154
|
+
return e == null ? !0 : typeof e == "string" ? D.has(e.trim()) : Array.isArray(e) ? e.length === 0 : typeof e == "object" && Object.keys(e).length === 0;
|
|
155
|
+
}
|
|
156
|
+
function Ie(e) {
|
|
157
|
+
return Object.values(e).every((e) => e === null || [
|
|
158
|
+
"string",
|
|
159
|
+
"number",
|
|
160
|
+
"boolean"
|
|
161
|
+
].includes(typeof e));
|
|
162
|
+
}
|
|
163
|
+
function $(e) {
|
|
164
|
+
return e === !0 || String(e).toLowerCase() === "true";
|
|
165
|
+
}
|
|
166
|
+
function Le(e) {
|
|
167
|
+
if (e instanceof Date) return Number.isNaN(e.getTime()) ? null : e;
|
|
168
|
+
if (typeof e == "number") return new Date(e < 0xe8d4a51000 ? e * 1e3 : e);
|
|
169
|
+
if (typeof e == "string" && /^\d+$/.test(e)) return Le(Number(e));
|
|
170
|
+
let t = typeof e == "string" ? Date.parse(e) : NaN;
|
|
171
|
+
return Number.isNaN(t) ? null : new Date(t);
|
|
172
|
+
}
|
|
173
|
+
function Re(e, t) {
|
|
174
|
+
let n = Math.round((t - e.getTime()) / 1e3), r = Math.abs(n);
|
|
175
|
+
if (r < 45) return "just now";
|
|
176
|
+
let i = [
|
|
177
|
+
[60, "m"],
|
|
178
|
+
[3600, "h"],
|
|
179
|
+
[86400, "d"],
|
|
180
|
+
[2592e3, "mo"],
|
|
181
|
+
[31536e3, "y"]
|
|
182
|
+
], a = i[0];
|
|
183
|
+
for (let e of i) r >= e[0] && (a = e);
|
|
184
|
+
let o = Math.floor(r / a[0]);
|
|
185
|
+
return n >= 0 ? `${o}${a[1]} ago` : `in ${o}${a[1]}`;
|
|
186
|
+
}
|
|
187
|
+
function ze(e) {
|
|
188
|
+
return Array.isArray(e) ? `[${e.length}]` : typeof e == "object" && e ? "{…}" : typeof e == "string" ? e : String(e);
|
|
189
|
+
}
|
|
190
|
+
function Be(e) {
|
|
191
|
+
return Object.entries(e).map(([e, t]) => `${e}: ${ze(t)}`).join(", ");
|
|
192
|
+
}
|
|
193
|
+
function Ve(e) {
|
|
194
|
+
if (typeof e != "object" || !e) return String(e);
|
|
195
|
+
let t = e, n = t.name ?? t.Name ?? Object.values(t)[0];
|
|
196
|
+
return n === void 0 || typeof n == "object" ? "{…}" : String(n);
|
|
197
|
+
}
|
|
198
|
+
function He(e) {
|
|
199
|
+
F.value = e && "$el" in e ? e.$el : e;
|
|
200
|
+
}
|
|
201
|
+
function Ue() {
|
|
202
|
+
let e = F.value;
|
|
203
|
+
I.value = !!e && e.scrollWidth > e.clientWidth + 1;
|
|
204
|
+
}
|
|
205
|
+
function We() {
|
|
206
|
+
R.value = !0, z.value = !0;
|
|
207
|
+
}
|
|
208
|
+
return S(F, (e, t) => {
|
|
209
|
+
t && j(t), e && be(e, Ue);
|
|
210
|
+
}), S(Y, () => re(Ue)), S(() => q.value === "date", (e, t) => {
|
|
211
|
+
e && !t ? ye() : !e && t && O();
|
|
212
|
+
}), ae(() => {
|
|
213
|
+
q.value === "date" && ye();
|
|
214
|
+
}), ie(() => {
|
|
215
|
+
q.value === "date" && O(), F.value && j(F.value);
|
|
216
|
+
}), (o, f) => (_(), l("span", {
|
|
217
|
+
class: h(["max-w-full min-w-0 items-center gap-1.5 align-middle", [
|
|
218
|
+
U.value ? "flex w-full" : "inline-flex",
|
|
219
|
+
U.value === "center" && "justify-center",
|
|
220
|
+
U.value === "right" && "justify-end",
|
|
221
|
+
Ee.value && "font-semibold text-heading"
|
|
222
|
+
]]),
|
|
223
|
+
"data-ac-ds": "",
|
|
224
|
+
"data-testid": "ac-cell-value"
|
|
225
|
+
}, [p.loading ? (_(), s(n, {
|
|
226
|
+
key: 0,
|
|
227
|
+
width: "96px"
|
|
228
|
+
})) : (_(), l(a, { key: 1 }, [
|
|
229
|
+
Te.value ? (_(), l("img", {
|
|
230
|
+
key: 0,
|
|
231
|
+
src: Te.value,
|
|
232
|
+
alt: "",
|
|
233
|
+
class: "size-4 shrink-0 object-contain"
|
|
234
|
+
}, null, 8, ue)) : c("", !0),
|
|
235
|
+
q.value === "empty" ? (_(), l("span", de, b(p.emptyText), 1)) : q.value === "status" && K.value ? (_(), s(y(G.value), m({ key: 2 }, K.value, {
|
|
236
|
+
class: "inline-flex rounded-6 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring",
|
|
237
|
+
onClick: f[0] ||= w(() => {}, ["stop"])
|
|
238
|
+
}), {
|
|
239
|
+
default: C(() => [d(e, {
|
|
240
|
+
label: Y.value,
|
|
241
|
+
color: Oe.value ?? "default",
|
|
242
|
+
variant: "light",
|
|
243
|
+
rounded: p.column?.shape !== "Rectangle",
|
|
244
|
+
dot: ""
|
|
245
|
+
}, null, 8, [
|
|
246
|
+
"label",
|
|
247
|
+
"color",
|
|
248
|
+
"rounded"
|
|
249
|
+
])]),
|
|
250
|
+
_: 1
|
|
251
|
+
}, 16)) : q.value === "status" ? (_(), s(i, {
|
|
252
|
+
key: 3,
|
|
253
|
+
content: H.value
|
|
254
|
+
}, {
|
|
255
|
+
default: C(() => [u("span", {
|
|
256
|
+
tabindex: H.value ? 0 : void 0,
|
|
257
|
+
class: "inline-flex rounded-6 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring"
|
|
258
|
+
}, [d(e, {
|
|
259
|
+
label: Y.value,
|
|
260
|
+
color: Oe.value ?? "default",
|
|
261
|
+
variant: "light",
|
|
262
|
+
rounded: p.column?.shape !== "Rectangle",
|
|
263
|
+
dot: ""
|
|
264
|
+
}, null, 8, [
|
|
265
|
+
"label",
|
|
266
|
+
"color",
|
|
267
|
+
"rounded"
|
|
268
|
+
])], 8, fe)]),
|
|
269
|
+
_: 1
|
|
270
|
+
}, 8, ["content"])) : q.value === "boolean" ? (_(), l("span", pe, [$(B.value) ? (_(), s(x(ce), {
|
|
271
|
+
key: 0,
|
|
272
|
+
class: "size-3.5 text-success",
|
|
273
|
+
"aria-hidden": "true"
|
|
274
|
+
})) : (_(), s(x(le), {
|
|
275
|
+
key: 1,
|
|
276
|
+
class: "size-3.5 text-muted",
|
|
277
|
+
"aria-hidden": "true"
|
|
278
|
+
})), u("span", { class: h(!$(B.value) && "text-muted") }, b(Y.value), 3)])) : q.value === "date" ? (_(), s(i, {
|
|
279
|
+
key: 5,
|
|
280
|
+
content: X.value
|
|
281
|
+
}, {
|
|
282
|
+
default: C(() => [K.value ? (_(), s(y(G.value), m({ key: 0 }, K.value, {
|
|
283
|
+
class: "font-medium whitespace-nowrap text-primary-20 tabular-nums underline-offset-2 hover:underline focus-visible:rounded-2 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring",
|
|
284
|
+
onClick: f[1] ||= w(() => {}, ["stop"])
|
|
285
|
+
}), {
|
|
286
|
+
default: C(() => [u("time", { datetime: J.value?.toISOString() }, b(Y.value), 9, me)]),
|
|
287
|
+
_: 1
|
|
288
|
+
}, 16)) : (_(), l("time", {
|
|
289
|
+
key: 1,
|
|
290
|
+
datetime: J.value?.toISOString(),
|
|
291
|
+
tabindex: X.value ? 0 : void 0,
|
|
292
|
+
class: h(["whitespace-nowrap tabular-nums focus-visible:rounded-2 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring", X.value && "cursor-default decoration-border-dark decoration-dotted underline-offset-4 hover:underline"])
|
|
293
|
+
}, b(Y.value), 11, he))]),
|
|
294
|
+
_: 1
|
|
295
|
+
}, 8, ["content"])) : q.value === "labels" || q.value === "array" ? (_(), l("span", {
|
|
296
|
+
key: 6,
|
|
297
|
+
class: "flex w-max min-w-0 flex-wrap items-center gap-1",
|
|
298
|
+
style: g({ maxWidth: p.maxWidth })
|
|
299
|
+
}, [(_(!0), l(a, null, oe(Ae.value, (e, t) => (_(), s(i, {
|
|
300
|
+
key: `${e.text}-${t}`,
|
|
301
|
+
content: e.text.length > 28 && !L.value ? e.text : "",
|
|
302
|
+
class: h(!L.value && "max-w-48")
|
|
303
|
+
}, {
|
|
304
|
+
default: C(() => [e.key ? (_(), s(r, {
|
|
305
|
+
key: 0,
|
|
306
|
+
"key-label": e.key,
|
|
307
|
+
"value-label": e.value
|
|
308
|
+
}, null, 8, ["key-label", "value-label"])) : (_(), s(r, {
|
|
309
|
+
key: 1,
|
|
310
|
+
label: e.value
|
|
311
|
+
}, null, 8, ["label"]))]),
|
|
312
|
+
_: 2
|
|
313
|
+
}, 1032, ["content", "class"]))), 128)), Q.value > 0 ? (_(), l("button", {
|
|
314
|
+
key: 0,
|
|
315
|
+
type: "button",
|
|
316
|
+
class: "inline-flex h-6 shrink-0 cursor-pointer items-center rounded-6 px-1.5 text-xs font-medium whitespace-nowrap text-label transition hover:bg-surface-sunken hover:text-heading focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring",
|
|
317
|
+
"aria-expanded": L.value,
|
|
318
|
+
"aria-label": L.value ? `Show fewer ${Pe.value}` : `Show ${Q.value} more ${Pe.value}`,
|
|
319
|
+
onClick: f[2] ||= w((e) => L.value = !L.value, ["stop"])
|
|
320
|
+
}, b(L.value ? "Show less" : `+${Q.value} more`), 9, ge)) : c("", !0)], 4)) : (_(), s(i, {
|
|
321
|
+
key: 7,
|
|
322
|
+
content: ke.value,
|
|
323
|
+
class: "min-w-0"
|
|
324
|
+
}, {
|
|
325
|
+
default: C(() => [K.value ? (_(), s(y(G.value), m({
|
|
326
|
+
key: 0,
|
|
327
|
+
ref: He
|
|
328
|
+
}, K.value, {
|
|
329
|
+
class: ["block truncate font-medium text-primary-20 underline-offset-2 hover:underline focus-visible:rounded-2 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring", [(p.mono || q.value === "object") && "font-mono text-xs", Ne.value && "tabular-nums"]],
|
|
330
|
+
style: { maxWidth: p.maxWidth },
|
|
331
|
+
onClick: f[3] ||= w(() => {}, ["stop"])
|
|
332
|
+
}), {
|
|
333
|
+
default: C(() => [ee(b(Y.value), 1)]),
|
|
334
|
+
_: 1
|
|
335
|
+
}, 16, ["class", "style"])) : (_(), l("span", {
|
|
336
|
+
key: 1,
|
|
337
|
+
ref: He,
|
|
338
|
+
tabindex: ke.value ? 0 : void 0,
|
|
339
|
+
class: h(["block truncate focus-visible:rounded-2 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring", [
|
|
340
|
+
(p.mono || q.value === "object") && "font-mono text-xs",
|
|
341
|
+
Ne.value && "tabular-nums",
|
|
342
|
+
q.value === "object" && "text-label"
|
|
343
|
+
]]),
|
|
344
|
+
style: g({ maxWidth: p.maxWidth })
|
|
345
|
+
}, b(Y.value), 15, _e))]),
|
|
346
|
+
_: 1
|
|
347
|
+
}, 8, ["content"])),
|
|
348
|
+
je.value ? (_(), s(i, {
|
|
349
|
+
key: 8,
|
|
350
|
+
content: "View as JSON"
|
|
351
|
+
}, {
|
|
352
|
+
default: C(() => [u("button", {
|
|
353
|
+
type: "button",
|
|
354
|
+
class: "inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-6 text-muted transition hover:bg-surface-sunken hover:text-heading focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring",
|
|
355
|
+
"aria-label": V.value ? `View ${V.value} as JSON` : "View as JSON",
|
|
356
|
+
"aria-haspopup": "dialog",
|
|
357
|
+
onClick: w(We, ["stop"])
|
|
358
|
+
}, [d(x(se), {
|
|
359
|
+
class: "size-3.5",
|
|
360
|
+
"aria-hidden": "true"
|
|
361
|
+
})], 8, ve)]),
|
|
362
|
+
_: 1
|
|
363
|
+
})) : c("", !0),
|
|
364
|
+
R.value ? (_(), s(t, {
|
|
365
|
+
key: 9,
|
|
366
|
+
open: z.value,
|
|
367
|
+
"onUpdate:open": f[4] ||= (e) => z.value = e,
|
|
368
|
+
title: V.value || "Value",
|
|
369
|
+
size: "medium"
|
|
370
|
+
}, {
|
|
371
|
+
default: C(() => [d(x(we), {
|
|
372
|
+
"model-value": Me.value,
|
|
373
|
+
language: "json",
|
|
374
|
+
readonly: "",
|
|
375
|
+
copyable: "",
|
|
376
|
+
height: "auto",
|
|
377
|
+
"max-height": "60vh",
|
|
378
|
+
label: `${V.value || "Value"} as JSON`
|
|
379
|
+
}, null, 8, ["model-value", "label"])]),
|
|
380
|
+
_: 1
|
|
381
|
+
}, 8, ["open", "title"])) : c("", !0)
|
|
382
|
+
], 64))], 2));
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
//#endregion
|
|
386
|
+
export { M as default };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Option } from "./types";
|
|
2
|
+
export interface Props<V> {
|
|
3
|
+
/** The checkboxes to render: `{ value, label, disabled? }`. */
|
|
4
|
+
options: Option<V>[];
|
|
5
|
+
/** Native `name` shared by every checkbox. */
|
|
6
|
+
name?: string;
|
|
7
|
+
/** Error text under the group. */
|
|
8
|
+
errorMsg?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
11
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<(Props<T> & {
|
|
12
|
+
modelValue?: T[];
|
|
13
|
+
}) & {
|
|
14
|
+
"onUpdate:modelValue"?: ((value: T[]) => any) | undefined;
|
|
15
|
+
}> & (typeof globalThis extends {
|
|
16
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
17
|
+
} ? P : {});
|
|
18
|
+
expose: (exposed: {}) => void;
|
|
19
|
+
attrs: any;
|
|
20
|
+
slots: {};
|
|
21
|
+
emit: (event: "update:modelValue", value: T[]) => void;
|
|
22
|
+
}>) => import("vue").VNode & {
|
|
23
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
24
|
+
};
|
|
25
|
+
declare const _default: typeof __VLS_export;
|
|
26
|
+
export default _default;
|
|
27
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
28
|
+
[K in keyof T]: T[K];
|
|
29
|
+
} : {
|
|
30
|
+
[K in keyof T as K]: T[K];
|
|
31
|
+
}) & {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Fragment as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createVNode as i, defineComponent as a, mergeModels as o, normalizeClass as s, openBlock as c, renderList as l, toDisplayString as u, unref as d, useId as f, useModel as p, vModelCheckbox as m, withDirectives as h } from "vue";
|
|
2
|
+
import { Check as g } from "@lucide/vue";
|
|
3
|
+
//#region src/lib/components/AcCheckBox.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var _ = {
|
|
5
|
+
class: "flex flex-col gap-2.5",
|
|
6
|
+
"data-ac-ds": "",
|
|
7
|
+
"data-testid": "ac-checkbox"
|
|
8
|
+
}, v = ["for"], y = { class: "relative inline-flex size-4 shrink-0" }, b = [
|
|
9
|
+
"id",
|
|
10
|
+
"name",
|
|
11
|
+
"value",
|
|
12
|
+
"disabled"
|
|
13
|
+
], x = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "text-xs text-red-30"
|
|
16
|
+
}, S = /*@__PURE__*/ a({
|
|
17
|
+
__name: "AcCheckBox",
|
|
18
|
+
props: /*@__PURE__*/ o({
|
|
19
|
+
options: {},
|
|
20
|
+
name: { default: "checkbox" },
|
|
21
|
+
errorMsg: { default: "" }
|
|
22
|
+
}, {
|
|
23
|
+
modelValue: { default: () => [] },
|
|
24
|
+
modelModifiers: {}
|
|
25
|
+
}),
|
|
26
|
+
emits: ["update:modelValue"],
|
|
27
|
+
setup(a) {
|
|
28
|
+
let o = p(a, "modelValue"), S = f();
|
|
29
|
+
return (f, p) => (c(), n("div", _, [(c(!0), n(e, null, l(a.options, (e, t) => (c(), n("label", {
|
|
30
|
+
key: e.label,
|
|
31
|
+
for: `${d(S)}-${t}`,
|
|
32
|
+
class: s(["group inline-flex w-fit cursor-pointer items-center gap-2.5 text-base text-heading", e.disabled && "cursor-not-allowed opacity-50"])
|
|
33
|
+
}, [r("span", y, [h(r("input", {
|
|
34
|
+
id: `${d(S)}-${t}`,
|
|
35
|
+
"onUpdate:modelValue": p[0] ||= (e) => o.value = e,
|
|
36
|
+
type: "checkbox",
|
|
37
|
+
name: a.name,
|
|
38
|
+
value: e.value,
|
|
39
|
+
disabled: e.disabled,
|
|
40
|
+
class: "peer size-4 cursor-pointer appearance-none rounded-4 border border-border-dark bg-surface shadow-xs transition-[background-color,border-color,box-shadow] duration-150 group-hover:border-slate-60 checked:border-primary checked:bg-primary checked:shadow-button focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring disabled:cursor-not-allowed"
|
|
41
|
+
}, null, 8, b), [[m, o.value]]), i(d(g), {
|
|
42
|
+
class: "pointer-events-none absolute inset-0 m-auto size-3 scale-75 text-white opacity-0 transition duration-150 peer-checked:scale-100 peer-checked:opacity-100",
|
|
43
|
+
"stroke-width": 3,
|
|
44
|
+
"aria-hidden": "true"
|
|
45
|
+
})]), r("span", null, u(e.label), 1)], 10, v))), 128)), a.errorMsg ? (c(), n("p", x, u(a.errorMsg), 1)) : t("", !0)]));
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
//#endregion
|
|
49
|
+
export { S as default };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Option } from "./types";
|
|
2
|
+
export interface Props<V> {
|
|
3
|
+
/** The radios to render: `{ value, label, description?, disabled? }`. */
|
|
4
|
+
options: Option<V>[];
|
|
5
|
+
/** Base `name` for the radio group. */
|
|
6
|
+
name?: string;
|
|
7
|
+
/** Lays the options out horizontally. */
|
|
8
|
+
row?: boolean;
|
|
9
|
+
/** Card style with each option's description, like the source's hasDescription. */
|
|
10
|
+
cards?: boolean;
|
|
11
|
+
/** Error text under the group. */
|
|
12
|
+
errorMsg?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
15
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<(Props<T> & {
|
|
16
|
+
modelValue?: T;
|
|
17
|
+
}) & {
|
|
18
|
+
"onUpdate:modelValue"?: ((value: T | undefined) => any) | undefined;
|
|
19
|
+
}> & (typeof globalThis extends {
|
|
20
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
21
|
+
} ? P : {});
|
|
22
|
+
expose: (exposed: {}) => void;
|
|
23
|
+
attrs: any;
|
|
24
|
+
slots: {};
|
|
25
|
+
emit: (event: "update:modelValue", value: T | undefined) => void;
|
|
26
|
+
}>) => import("vue").VNode & {
|
|
27
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
28
|
+
};
|
|
29
|
+
declare const _default: typeof __VLS_export;
|
|
30
|
+
export default _default;
|
|
31
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
32
|
+
[K in keyof T]: T[K];
|
|
33
|
+
} : {
|
|
34
|
+
[K in keyof T as K]: T[K];
|
|
35
|
+
}) & {};
|