@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
|
@@ -7,7 +7,7 @@ import { Check as le, ChevronDown as ue, ChevronRight as de, CircleAlert as fe,
|
|
|
7
7
|
//#region src/lib/components/AcFormArray.vue?vue&type=script&setup=true&lang.ts
|
|
8
8
|
var _e = ["aria-describedby"], ve = { class: "flex min-h-8 items-center justify-between gap-3" }, ye = {
|
|
9
9
|
key: 0,
|
|
10
|
-
class: "text-danger",
|
|
10
|
+
class: "ml-1 text-danger",
|
|
11
11
|
"aria-hidden": "true"
|
|
12
12
|
}, be = {
|
|
13
13
|
key: 2,
|
|
@@ -15,10 +15,10 @@ var _e = ["aria-describedby"], ve = { class: "flex min-h-8 items-center justify-
|
|
|
15
15
|
}, xe = { class: "ac-scrollbar" }, Se = { class: "w-full border-separate border-spacing-0 text-base" }, Ce = { class: "sr-only" }, we = {
|
|
16
16
|
key: 0,
|
|
17
17
|
scope: "col",
|
|
18
|
-
class: "h-
|
|
18
|
+
class: "h-10 w-px border-b border-border bg-surface-sunken/50 px-3 text-right"
|
|
19
19
|
}, Te = ["data-row"], Ee = {
|
|
20
20
|
key: 0,
|
|
21
|
-
class: "h-
|
|
21
|
+
class: "h-12 border-b border-border px-2 text-right whitespace-nowrap [tr:last-child_&]:border-b-0"
|
|
22
22
|
}, De = { class: "inline-flex items-center gap-0.5" }, Oe = [
|
|
23
23
|
"aria-expanded",
|
|
24
24
|
"aria-label",
|
|
@@ -31,18 +31,18 @@ var _e = ["aria-describedby"], ve = { class: "flex min-h-8 items-center justify-
|
|
|
31
31
|
"aria-label",
|
|
32
32
|
"disabled",
|
|
33
33
|
"onClick"
|
|
34
|
-
], je = ["aria-label"], Me = { class: "inline-flex h-
|
|
34
|
+
], je = ["aria-label"], Me = { class: "inline-flex h-10 items-center px-2 text-body" }, Ne = { class: "border-b border-border px-2 py-2 text-right align-top whitespace-nowrap [tr:last-child_&]:border-b-0" }, Pe = { class: "inline-flex h-10 items-center gap-0.5" }, Fe = ["aria-label", "disabled"], Ie = ["disabled"], Le = {
|
|
35
35
|
key: 0,
|
|
36
36
|
role: "alert",
|
|
37
|
-
class: "mt-1 max-w-48 text-left text-xs whitespace-normal text-
|
|
37
|
+
class: "mt-1 max-w-48 text-left text-xs whitespace-normal text-danger-strong"
|
|
38
38
|
}, Re = { key: 2 }, ze = ["colspan"], Be = ["aria-labelledby"], Ve = ["id"], He = {
|
|
39
39
|
"data-editor-fields": "",
|
|
40
40
|
class: "space-y-4"
|
|
41
41
|
}, Ue = {
|
|
42
42
|
key: 0,
|
|
43
43
|
role: "alert",
|
|
44
|
-
class: "mt-3 flex items-center gap-1 text-
|
|
45
|
-
}, We = { class: "mt-
|
|
44
|
+
class: "mt-3 flex items-center gap-1.5 text-base text-danger-strong"
|
|
45
|
+
}, We = { class: "mt-5 flex justify-end gap-3" }, Ge = { key: 3 }, Ke = ["colspan"], qe = {
|
|
46
46
|
class: "sr-only",
|
|
47
47
|
"aria-live": "polite"
|
|
48
48
|
}, S = -1, C = "input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [role=\"combobox\"]:not([aria-disabled=\"true\"]), button:not([disabled])", w = /*@__PURE__*/ f({
|
|
@@ -116,34 +116,34 @@ var _e = ["aria-describedby"], ve = { class: "flex min-h-8 items-center justify-
|
|
|
116
116
|
"remove"
|
|
117
117
|
], ["update:modelValue"]),
|
|
118
118
|
setup(f, { expose: p, emit: w }) {
|
|
119
|
-
let T = f, E = ie(f, "modelValue"), D = w,
|
|
119
|
+
let T = f, E = ie(f, "modelValue"), D = w, O = ae(), k = re(), A = `${k}-label`, j = `${k}-body`, Je = `${k}-msg`, Ye = `${k}-hint`, M = _(null), N = _(T.collapsible && T.defaultCollapsed), P = _(null), F = _({}), I = _({}), L = _(""), R = _(!1), z = _(/* @__PURE__ */ new Set()), B = _(""), V = a(() => E.value ?? []), H = a(() => R.value || T.loading), Xe = a(() => P.value !== null), U = a(() => Array.isArray(T.errorMsg) ? T.errorMsg : T.errorMsg ? [T.errorMsg] : []), Ze = a(() => [T.hint && Ye, U.value.length && Je].filter(Boolean).join(" ") || void 0), Qe = a(() => T.max !== void 0 && V.value.length >= T.max), $e = a(() => !T.disabled && !T.addDisabled && !Qe.value && !Xe.value && !H.value), W = a(() => T.disabled || Xe.value || H.value), G = a(() => !T.readonly || !!O.details || !!O["row-actions"]), et = a(() => V.value.length > 0 || P.value === S), tt = a(() => T.columns.length + +!!G.value), nt = a(() => T.addLabel || `Add ${T.itemName}`), rt = a(() => T.formTitle || `${P.value === S ? "New" : "Edit"} ${T.itemName}`), it = a(() => {
|
|
120
120
|
let e = [];
|
|
121
|
-
return
|
|
122
|
-
let r =
|
|
121
|
+
return V.value.forEach((t, n) => {
|
|
122
|
+
let r = P.value === n;
|
|
123
123
|
e.push({
|
|
124
124
|
kind: r && T.mode === "inline" ? "inline" : "item",
|
|
125
125
|
index: n
|
|
126
126
|
}), r && T.mode === "form" ? e.push({
|
|
127
127
|
kind: "form",
|
|
128
128
|
index: n
|
|
129
|
-
}) : !r &&
|
|
129
|
+
}) : !r && z.value.has(n) && e.push({
|
|
130
130
|
kind: "details",
|
|
131
131
|
index: n
|
|
132
132
|
});
|
|
133
|
-
}),
|
|
133
|
+
}), P.value === S && e.push({
|
|
134
134
|
kind: T.mode === "inline" ? "inline" : "form",
|
|
135
135
|
index: S
|
|
136
136
|
}), e;
|
|
137
137
|
});
|
|
138
|
-
function
|
|
139
|
-
return e === S ?
|
|
138
|
+
function K(e) {
|
|
139
|
+
return e === S ? F.value : V.value[e];
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
let t = T.columns[0], n = t ?
|
|
141
|
+
function q(e) {
|
|
142
|
+
let t = T.columns[0], n = t ? V.value[e]?.[t.key] : void 0;
|
|
143
143
|
return n == null || typeof n == "object" || n === "" ? `${T.itemName} ${e + 1}` : `${T.itemName} ${String(n)}`;
|
|
144
144
|
}
|
|
145
145
|
function at(e, t) {
|
|
146
|
-
let n =
|
|
146
|
+
let n = K(t);
|
|
147
147
|
return e.format ? e.format(n[e.key], n) : null;
|
|
148
148
|
}
|
|
149
149
|
function ot(e) {
|
|
@@ -153,118 +153,118 @@ var _e = ["aria-describedby"], ve = { class: "flex min-h-8 items-center justify-
|
|
|
153
153
|
return JSON.parse(JSON.stringify(e));
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function J(e, t) {
|
|
157
157
|
m(() => {
|
|
158
|
-
(
|
|
158
|
+
(M.value?.querySelector(e) ?? t?.())?.focus();
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
161
|
function st() {
|
|
162
162
|
m(() => {
|
|
163
|
-
let e =
|
|
163
|
+
let e = M.value?.querySelector("[data-editor]");
|
|
164
164
|
(e?.querySelector(`[data-editor-fields] :is(${C})`) ?? e?.querySelector(C))?.focus();
|
|
165
165
|
});
|
|
166
166
|
}
|
|
167
|
-
function
|
|
168
|
-
e >= 0 && e <
|
|
167
|
+
function Y(e) {
|
|
168
|
+
e >= 0 && e < V.value.length ? J(`[data-row="${e}"] [data-action="edit"], [data-row="${e}"] [data-action="remove"]`, ct) : J("[data-action='add']");
|
|
169
169
|
}
|
|
170
170
|
function ct() {
|
|
171
|
-
return
|
|
171
|
+
return M.value?.querySelector("[data-action='add']");
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
|
|
173
|
+
function X() {
|
|
174
|
+
I.value = {}, L.value = "";
|
|
175
175
|
}
|
|
176
|
-
function
|
|
177
|
-
$e.value && (
|
|
176
|
+
function lt() {
|
|
177
|
+
$e.value && (N.value = !1, X(), F.value = T.newItem(), P.value = S, st());
|
|
178
178
|
}
|
|
179
|
-
function
|
|
180
|
-
!
|
|
179
|
+
function ut(e) {
|
|
180
|
+
!W.value && T.editable && (X(), F.value = ot(V.value[e]), P.value = e, st());
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
let e =
|
|
184
|
-
e === null ||
|
|
182
|
+
function Z() {
|
|
183
|
+
let e = P.value;
|
|
184
|
+
e === null || R.value || (P.value = null, X(), Y(e));
|
|
185
185
|
}
|
|
186
|
-
async function
|
|
187
|
-
let e =
|
|
188
|
-
if (e === null ||
|
|
189
|
-
let t =
|
|
190
|
-
if (
|
|
191
|
-
|
|
186
|
+
async function Q() {
|
|
187
|
+
let e = P.value;
|
|
188
|
+
if (e === null || H.value) return;
|
|
189
|
+
let t = F.value, n = T.validate?.(t, e);
|
|
190
|
+
if (I.value = n && typeof n == "object" ? n : {}, L.value = typeof n == "string" ? n : "", L.value || Object.keys(I.value).length) {
|
|
191
|
+
J("[data-editor] [aria-invalid='true'], [data-editor] [aria-invalid='true'] input");
|
|
192
192
|
return;
|
|
193
193
|
}
|
|
194
|
-
|
|
194
|
+
R.value = !0;
|
|
195
195
|
try {
|
|
196
196
|
if (await T.beforeSave?.(t, e) === !1) return;
|
|
197
197
|
} catch (e) {
|
|
198
|
-
|
|
198
|
+
L.value = e instanceof Error ? e.message : String(e);
|
|
199
199
|
return;
|
|
200
200
|
} finally {
|
|
201
|
-
|
|
201
|
+
R.value = !1;
|
|
202
202
|
}
|
|
203
|
-
let r = [...
|
|
204
|
-
e === S ? r.push(t) : r[e] = t, E.value = r,
|
|
203
|
+
let r = [...V.value];
|
|
204
|
+
e === S ? r.push(t) : r[e] = t, E.value = r, P.value = null, X(), e === S ? (D("add", t), B.value = `${$(T.itemName)} added.`) : (D("update", t, e), B.value = `${$(T.itemName)} updated.`), Y(e === S ? r.length - 1 : e);
|
|
205
205
|
}
|
|
206
|
-
async function
|
|
207
|
-
if (
|
|
208
|
-
let t =
|
|
206
|
+
async function dt(e) {
|
|
207
|
+
if (W.value) return;
|
|
208
|
+
let t = V.value[e];
|
|
209
209
|
if (T.beforeRemove) {
|
|
210
|
-
|
|
210
|
+
R.value = !0;
|
|
211
211
|
try {
|
|
212
212
|
if (await T.beforeRemove(t, e) === !1) return;
|
|
213
213
|
} finally {
|
|
214
|
-
|
|
214
|
+
R.value = !1;
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
E.value =
|
|
217
|
+
E.value = V.value.filter((t, n) => n !== e), z.value = /* @__PURE__ */ new Set(), D("remove", t, e), B.value = `${$(T.itemName)} removed.`, Y(Math.min(e, V.value.length - 1));
|
|
218
218
|
}
|
|
219
|
-
function
|
|
220
|
-
let t = new Set(
|
|
221
|
-
t.delete(e) || t.add(e),
|
|
219
|
+
function ft(e) {
|
|
220
|
+
let t = new Set(z.value);
|
|
221
|
+
t.delete(e) || t.add(e), z.value = t;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function pt(e) {
|
|
224
224
|
if (e.defaultPrevented) return;
|
|
225
225
|
let t = e.target;
|
|
226
|
-
e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(),
|
|
226
|
+
e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), Z()) : e.key === "Enter" && t.tagName === "INPUT" && ![
|
|
227
227
|
"checkbox",
|
|
228
228
|
"radio",
|
|
229
229
|
"file"
|
|
230
|
-
].includes(t.type) && (e.preventDefault(),
|
|
230
|
+
].includes(t.type) && (e.preventDefault(), Q());
|
|
231
231
|
}
|
|
232
232
|
function $(e) {
|
|
233
233
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
234
234
|
}
|
|
235
235
|
return p({
|
|
236
|
-
add:
|
|
237
|
-
edit:
|
|
238
|
-
cancel:
|
|
236
|
+
add: lt,
|
|
237
|
+
edit: ut,
|
|
238
|
+
cancel: Z
|
|
239
239
|
}), (a, p) => (g(), c("div", {
|
|
240
240
|
ref_key: "root",
|
|
241
|
-
ref:
|
|
241
|
+
ref: M,
|
|
242
242
|
role: "group",
|
|
243
|
-
"aria-labelledby":
|
|
244
|
-
"aria-describedby":
|
|
243
|
+
"aria-labelledby": A,
|
|
244
|
+
"aria-describedby": Ze.value,
|
|
245
245
|
"data-ac-ds": "",
|
|
246
246
|
"data-testid": "ac-form-array"
|
|
247
247
|
}, [
|
|
248
248
|
l("div", ve, [(g(), o(te(f.collapsible ? "button" : "div"), {
|
|
249
249
|
type: f.collapsible ? "button" : void 0,
|
|
250
|
-
class: h(["-ml-1 flex min-w-0 items-center gap-1.5 rounded-
|
|
251
|
-
"aria-expanded": f.collapsible ? !
|
|
252
|
-
"aria-controls": f.collapsible ?
|
|
253
|
-
onClick: p[0] ||= (e) => f.collapsible && (
|
|
250
|
+
class: h(["-ml-1.5 flex min-w-0 items-center gap-1.5 rounded-8 px-1.5 py-1 text-left", f.collapsible && "cursor-pointer transition-colors duration-200 hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none"]),
|
|
251
|
+
"aria-expanded": f.collapsible ? !N.value : void 0,
|
|
252
|
+
"aria-controls": f.collapsible ? j : void 0,
|
|
253
|
+
onClick: p[0] ||= (e) => f.collapsible && (N.value = !N.value)
|
|
254
254
|
}, {
|
|
255
255
|
default: se(() => [
|
|
256
256
|
f.collapsible ? (g(), o(x(de), {
|
|
257
257
|
key: 0,
|
|
258
|
-
class: h(["size-4 shrink-0 text-muted transition-transform duration-
|
|
258
|
+
class: h(["size-4 shrink-0 text-muted transition-transform duration-200 motion-reduce:transition-none", !N.value && "rotate-90"]),
|
|
259
259
|
"aria-hidden": "true"
|
|
260
260
|
}, null, 8, ["class"])) : s("", !0),
|
|
261
261
|
l("span", {
|
|
262
|
-
id:
|
|
263
|
-
class: "truncate text-
|
|
264
|
-
}, [u(b(f.label), 1), f.required ? (g(), c("span", ye, "
|
|
265
|
-
|
|
262
|
+
id: A,
|
|
263
|
+
class: "truncate text-base font-medium text-heading"
|
|
264
|
+
}, [u(b(f.label), 1), f.required ? (g(), c("span", ye, "*")) : s("", !0)]),
|
|
265
|
+
V.value.length ? (g(), o(n, {
|
|
266
266
|
key: 1,
|
|
267
|
-
label: String(
|
|
267
|
+
label: String(V.value.length),
|
|
268
268
|
rounded: "",
|
|
269
269
|
class: "shrink-0"
|
|
270
270
|
}, null, 8, ["label"])) : s("", !0),
|
|
@@ -281,56 +281,46 @@ var _e = ["aria-describedby"], ve = { class: "flex min-h-8 items-center justify-
|
|
|
281
281
|
"data-action": "add",
|
|
282
282
|
title: nt.value,
|
|
283
283
|
size: "small",
|
|
284
|
-
|
|
284
|
+
variant: "light",
|
|
285
285
|
disabled: !$e.value,
|
|
286
|
-
onClick:
|
|
286
|
+
onClick: lt
|
|
287
287
|
}, {
|
|
288
288
|
icon: se(() => [d(x(me), { "aria-hidden": "true" })]),
|
|
289
289
|
_: 1
|
|
290
290
|
}, 8, ["title", "disabled"]))]),
|
|
291
|
-
|
|
291
|
+
f.hint ? (g(), c("p", {
|
|
292
292
|
key: 0,
|
|
293
|
-
id:
|
|
294
|
-
class: "mt-1
|
|
295
|
-
}, [(g(!0), c(i, null, v(V.value, (e) => (g(), c("p", {
|
|
296
|
-
key: e,
|
|
297
|
-
class: "flex items-center gap-1 text-xs text-red-30"
|
|
298
|
-
}, [d(x(fe), {
|
|
299
|
-
class: "size-3.5 shrink-0",
|
|
300
|
-
"aria-hidden": "true"
|
|
301
|
-
}), u(" " + b(e), 1)]))), 128))])) : f.hint ? (g(), c("p", {
|
|
302
|
-
key: 1,
|
|
303
|
-
id: k,
|
|
304
|
-
class: "mt-0.5 text-xs text-muted"
|
|
293
|
+
id: Ye,
|
|
294
|
+
class: "mt-1 text-base text-muted"
|
|
305
295
|
}, b(f.hint), 1)) : s("", !0),
|
|
306
296
|
ce(l("div", {
|
|
307
|
-
id:
|
|
297
|
+
id: j,
|
|
308
298
|
class: "mt-2"
|
|
309
299
|
}, [et.value ? (g(), c("div", {
|
|
310
300
|
key: 0,
|
|
311
|
-
class: h(["overflow-hidden rounded-10 border bg-surface
|
|
301
|
+
class: h(["overflow-hidden rounded-10 border bg-surface", U.value.length ? "border-danger/60" : "border-border"])
|
|
312
302
|
}, [l("div", xe, [l("table", Se, [
|
|
313
303
|
l("caption", Ce, b(f.label), 1),
|
|
314
304
|
l("thead", null, [l("tr", null, [(g(!0), c(i, null, v(f.columns, (e) => (g(), c("th", {
|
|
315
305
|
key: e.key,
|
|
316
306
|
scope: "col",
|
|
317
|
-
class: "h-
|
|
307
|
+
class: "h-10 border-b border-border bg-surface-sunken/50 px-4 text-left text-base font-semibold whitespace-nowrap text-muted",
|
|
318
308
|
style: ee(e.width ? { width: e.width } : void 0)
|
|
319
|
-
}, b(e.label), 5))), 128)),
|
|
309
|
+
}, b(e.label), 5))), 128)), G.value ? (g(), c("th", we, [...p[1] ||= [l("span", { class: "sr-only" }, "Actions", -1)]])) : s("", !0)])]),
|
|
320
310
|
l("tbody", null, [(g(!0), c(i, null, v(it.value, (n) => (g(), c(i, { key: `${n.kind}-${n.index}` }, [n.kind === "item" ? (g(), c("tr", {
|
|
321
311
|
key: 0,
|
|
322
312
|
"data-row": n.index,
|
|
323
|
-
class: "group/row"
|
|
313
|
+
class: "group/row transition-colors duration-150 hover:bg-surface-sunken/40"
|
|
324
314
|
}, [(g(!0), c(i, null, v(f.columns, (e) => (g(), c("td", {
|
|
325
315
|
key: e.key,
|
|
326
|
-
class: "h-
|
|
316
|
+
class: "h-12 border-b border-border px-4 whitespace-nowrap text-body [tr:last-child_&]:border-b-0"
|
|
327
317
|
}, [y(a.$slots, `cell-${e.key}`, {
|
|
328
|
-
item:
|
|
318
|
+
item: K(n.index),
|
|
329
319
|
index: n.index,
|
|
330
|
-
value:
|
|
320
|
+
value: K(n.index)[e.key]
|
|
331
321
|
}, () => [e.format ? (g(), c(i, { key: 0 }, [u(b(at(e, n.index)), 1)], 64)) : (g(), o(r, {
|
|
332
322
|
key: 1,
|
|
333
|
-
value:
|
|
323
|
+
value: K(n.index)[e.key],
|
|
334
324
|
type: e.type ?? "auto",
|
|
335
325
|
title: e.label,
|
|
336
326
|
"max-width": "220px"
|
|
@@ -338,63 +328,63 @@ var _e = ["aria-describedby"], ve = { class: "flex min-h-8 items-center justify-
|
|
|
338
328
|
"value",
|
|
339
329
|
"type",
|
|
340
330
|
"title"
|
|
341
|
-
]))])]))), 128)),
|
|
331
|
+
]))])]))), 128)), G.value ? (g(), c("td", Ee, [l("span", De, [
|
|
342
332
|
y(a.$slots, "row-actions", {
|
|
343
|
-
item:
|
|
333
|
+
item: K(n.index),
|
|
344
334
|
index: n.index
|
|
345
335
|
}),
|
|
346
336
|
a.$slots.details ? (g(), c("button", {
|
|
347
337
|
key: 0,
|
|
348
338
|
type: "button",
|
|
349
|
-
class: "inline-flex size-
|
|
350
|
-
"aria-expanded":
|
|
351
|
-
"aria-label": `Details of ${
|
|
352
|
-
onClick: (e) =>
|
|
339
|
+
class: "inline-flex size-8 cursor-pointer items-center justify-center rounded-8 text-muted transition-colors duration-200 hover:bg-surface-sunken hover:text-heading focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
340
|
+
"aria-expanded": z.value.has(n.index),
|
|
341
|
+
"aria-label": `Details of ${q(n.index)}`,
|
|
342
|
+
onClick: (e) => ft(n.index)
|
|
353
343
|
}, [d(x(ue), {
|
|
354
|
-
class: h(["size-4 transition-transform motion-reduce:transition-none",
|
|
344
|
+
class: h(["size-4 transition-transform motion-reduce:transition-none", z.value.has(n.index) && "rotate-180"]),
|
|
355
345
|
"aria-hidden": "true"
|
|
356
346
|
}, null, 8, ["class"])], 8, Oe)) : s("", !0),
|
|
357
347
|
f.editable && !f.readonly ? (g(), c("button", {
|
|
358
348
|
key: 1,
|
|
359
349
|
type: "button",
|
|
360
350
|
"data-action": "edit",
|
|
361
|
-
class: "inline-flex size-
|
|
362
|
-
"aria-label": `Edit ${
|
|
363
|
-
disabled:
|
|
364
|
-
onClick: (e) =>
|
|
351
|
+
class: "inline-flex size-8 cursor-pointer items-center justify-center rounded-8 text-muted transition-colors duration-200 hover:bg-surface-sunken hover:text-heading focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent",
|
|
352
|
+
"aria-label": `Edit ${q(n.index)}`,
|
|
353
|
+
disabled: W.value,
|
|
354
|
+
onClick: (e) => ut(n.index)
|
|
365
355
|
}, [d(x(pe), {
|
|
366
|
-
class: "size-
|
|
356
|
+
class: "size-4",
|
|
367
357
|
"aria-hidden": "true"
|
|
368
358
|
})], 8, ke)) : s("", !0),
|
|
369
359
|
f.readonly ? s("", !0) : (g(), c("button", {
|
|
370
360
|
key: 2,
|
|
371
361
|
type: "button",
|
|
372
362
|
"data-action": "remove",
|
|
373
|
-
class: "inline-flex size-
|
|
374
|
-
"aria-label": `Remove ${
|
|
375
|
-
disabled:
|
|
376
|
-
onClick: (e) =>
|
|
363
|
+
class: "inline-flex size-8 cursor-pointer items-center justify-center rounded-8 text-muted transition-colors duration-200 hover:bg-danger/10 hover:text-danger-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent disabled:hover:text-muted",
|
|
364
|
+
"aria-label": `Remove ${q(n.index)}`,
|
|
365
|
+
disabled: W.value,
|
|
366
|
+
onClick: (e) => dt(n.index)
|
|
377
367
|
}, [d(x(he), {
|
|
378
|
-
class: "size-
|
|
368
|
+
class: "size-4",
|
|
379
369
|
"aria-hidden": "true"
|
|
380
370
|
})], 8, Ae))
|
|
381
371
|
])])) : s("", !0)], 8, Te)) : n.kind === "inline" ? (g(), c("tr", {
|
|
382
372
|
key: 1,
|
|
383
373
|
"data-editor": "",
|
|
384
374
|
"aria-label": rt.value,
|
|
385
|
-
class: "bg-surface-
|
|
386
|
-
onKeydown:
|
|
375
|
+
class: "bg-surface-sunken/40",
|
|
376
|
+
onKeydown: pt
|
|
387
377
|
}, [(g(!0), c(i, null, v(f.columns, (e) => (g(), c("td", {
|
|
388
378
|
key: e.key,
|
|
389
379
|
"data-editor-fields": "",
|
|
390
|
-
class: "border-b border-border
|
|
380
|
+
class: "border-b border-border px-2 py-2 align-top [tr:last-child_&]:border-b-0 [&_[data-ac-ds]>label:first-child]:sr-only"
|
|
391
381
|
}, [y(a.$slots, `field-${e.key}`, {
|
|
392
|
-
item:
|
|
382
|
+
item: F.value,
|
|
393
383
|
index: n.index,
|
|
394
|
-
error:
|
|
395
|
-
errors:
|
|
384
|
+
error: I.value[e.key] ?? "",
|
|
385
|
+
errors: I.value
|
|
396
386
|
}, () => [l("span", Me, [d(r, {
|
|
397
|
-
value:
|
|
387
|
+
value: F.value[e.key],
|
|
398
388
|
type: e.type ?? "auto",
|
|
399
389
|
title: e.label,
|
|
400
390
|
"max-width": "220px"
|
|
@@ -404,11 +394,11 @@ var _e = ["aria-describedby"], ve = { class: "flex min-h-8 items-center justify-
|
|
|
404
394
|
"title"
|
|
405
395
|
])])])]))), 128)), l("td", Ne, [l("span", Pe, [l("button", {
|
|
406
396
|
type: "button",
|
|
407
|
-
class: "inline-flex size-
|
|
397
|
+
class: "inline-flex size-8 cursor-pointer items-center justify-center rounded-8 text-primary-strong transition-colors duration-200 hover:bg-primary/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-40",
|
|
408
398
|
"aria-label": n.index === S ? `Add ${f.itemName}` : `Save ${f.itemName}`,
|
|
409
|
-
disabled:
|
|
410
|
-
onClick:
|
|
411
|
-
}, [
|
|
399
|
+
disabled: H.value || f.disabled,
|
|
400
|
+
onClick: Q
|
|
401
|
+
}, [H.value ? (g(), o(e, {
|
|
412
402
|
key: 0,
|
|
413
403
|
class: "text-primary",
|
|
414
404
|
label: ""
|
|
@@ -418,49 +408,49 @@ var _e = ["aria-describedby"], ve = { class: "flex min-h-8 items-center justify-
|
|
|
418
408
|
"aria-hidden": "true"
|
|
419
409
|
}))], 8, Fe), l("button", {
|
|
420
410
|
type: "button",
|
|
421
|
-
class: "inline-flex size-
|
|
411
|
+
class: "inline-flex size-8 cursor-pointer items-center justify-center rounded-8 text-muted transition-colors duration-200 hover:bg-surface-sunken hover:text-heading focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-40",
|
|
422
412
|
"aria-label": "Cancel",
|
|
423
|
-
disabled:
|
|
424
|
-
onClick:
|
|
413
|
+
disabled: R.value,
|
|
414
|
+
onClick: Z
|
|
425
415
|
}, [d(x(ge), {
|
|
426
416
|
class: "size-4",
|
|
427
417
|
"aria-hidden": "true"
|
|
428
|
-
})], 8, Ie)]),
|
|
418
|
+
})], 8, Ie)]), L.value ? (g(), c("p", Le, b(L.value), 1)) : s("", !0)])], 40, je)) : n.kind === "form" ? (g(), c("tr", Re, [l("td", {
|
|
429
419
|
colspan: tt.value,
|
|
430
|
-
class: "border-b border-border
|
|
420
|
+
class: "border-b border-border bg-surface-sunken/40 p-0 [tr:last-child_&]:border-b-0"
|
|
431
421
|
}, [l("div", {
|
|
432
422
|
"data-editor": "",
|
|
433
423
|
role: "group",
|
|
434
|
-
"aria-labelledby": `${x(
|
|
435
|
-
class: "
|
|
436
|
-
onKeydown:
|
|
424
|
+
"aria-labelledby": `${x(k)}-form-title`,
|
|
425
|
+
class: "p-4",
|
|
426
|
+
onKeydown: pt
|
|
437
427
|
}, [
|
|
438
428
|
l("p", {
|
|
439
|
-
id: `${x(
|
|
440
|
-
class: "mb-
|
|
429
|
+
id: `${x(k)}-form-title`,
|
|
430
|
+
class: "mb-4 text-base font-semibold tracking-tight text-heading"
|
|
441
431
|
}, b(rt.value), 9, Ve),
|
|
442
432
|
l("div", He, [y(a.$slots, "form", {
|
|
443
|
-
item:
|
|
433
|
+
item: F.value,
|
|
444
434
|
index: n.index,
|
|
445
|
-
errors:
|
|
435
|
+
errors: I.value,
|
|
446
436
|
isNew: n.index === S
|
|
447
437
|
})]),
|
|
448
|
-
|
|
449
|
-
class: "size-
|
|
438
|
+
L.value ? (g(), c("p", Ue, [d(x(fe), {
|
|
439
|
+
class: "size-4 shrink-0",
|
|
450
440
|
"aria-hidden": "true"
|
|
451
|
-
}), u(" " + b(
|
|
441
|
+
}), u(" " + b(L.value), 1)])) : s("", !0),
|
|
452
442
|
l("div", We, [d(t, {
|
|
453
443
|
title: "Cancel",
|
|
454
444
|
size: "small",
|
|
455
445
|
color: "white",
|
|
456
|
-
disabled:
|
|
457
|
-
onClick:
|
|
446
|
+
disabled: R.value,
|
|
447
|
+
onClick: Z
|
|
458
448
|
}, null, 8, ["disabled"]), d(t, {
|
|
459
449
|
title: n.index === S ? `Add ${f.itemName}` : "Save",
|
|
460
450
|
size: "small",
|
|
461
|
-
loading:
|
|
451
|
+
loading: H.value,
|
|
462
452
|
disabled: f.disabled,
|
|
463
|
-
onClick:
|
|
453
|
+
onClick: Q
|
|
464
454
|
}, null, 8, [
|
|
465
455
|
"title",
|
|
466
456
|
"loading",
|
|
@@ -468,16 +458,28 @@ var _e = ["aria-describedby"], ve = { class: "flex min-h-8 items-center justify-
|
|
|
468
458
|
])])
|
|
469
459
|
], 40, Be)], 8, ze)])) : n.kind === "details" ? (g(), c("tr", Ge, [l("td", {
|
|
470
460
|
colspan: tt.value,
|
|
471
|
-
class: "border-b border-border
|
|
461
|
+
class: "border-b border-border bg-surface-muted px-4 py-3 text-base text-body [tr:last-child_&]:border-b-0"
|
|
472
462
|
}, [y(a.$slots, "details", {
|
|
473
|
-
item:
|
|
463
|
+
item: K(n.index),
|
|
474
464
|
index: n.index
|
|
475
465
|
})], 8, Ke)])) : s("", !0)], 64))), 128))])
|
|
476
466
|
])])], 2)) : (g(), c("div", {
|
|
477
467
|
key: 1,
|
|
478
|
-
class: h(["rounded-10 border border-dashed px-4 py-
|
|
479
|
-
}, [y(a.$slots, "empty", {}, () => [u(b(f.emptyText), 1)])], 2))], 512), [[oe, !
|
|
480
|
-
|
|
468
|
+
class: h(["rounded-10 border border-dashed bg-surface px-4 py-6 text-center text-base text-muted", U.value.length ? "border-danger/60" : "border-border"])
|
|
469
|
+
}, [y(a.$slots, "empty", {}, () => [u(b(f.emptyText), 1)])], 2))], 512), [[oe, !N.value]]),
|
|
470
|
+
U.value.length ? (g(), c("div", {
|
|
471
|
+
key: 1,
|
|
472
|
+
id: Je,
|
|
473
|
+
class: "mt-1.5 space-y-1",
|
|
474
|
+
role: "alert"
|
|
475
|
+
}, [(g(!0), c(i, null, v(U.value, (e) => (g(), c("p", {
|
|
476
|
+
key: e,
|
|
477
|
+
class: "flex items-center gap-1.5 text-base text-danger-strong"
|
|
478
|
+
}, [d(x(fe), {
|
|
479
|
+
class: "size-4 shrink-0",
|
|
480
|
+
"aria-hidden": "true"
|
|
481
|
+
}), u(" " + b(e), 1)]))), 128))])) : s("", !0),
|
|
482
|
+
l("p", qe, b(B.value), 1)
|
|
481
483
|
], 8, _e));
|
|
482
484
|
}
|
|
483
485
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface Props {
|
|
2
2
|
/** Text of the primary button. It's a `type="submit"` button, so it submits the surrounding form. */
|
|
3
3
|
submitLabel?: string;
|
|
4
|
-
/** Text of the secondary button. */
|
|
4
|
+
/** Text of the secondary button, a neutral outline button left of the primary one. */
|
|
5
5
|
cancelLabel?: string;
|
|
6
6
|
/** Hides the Cancel button. */
|
|
7
7
|
hideCancel?: boolean;
|
|
@@ -33,10 +33,10 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
|
|
|
33
33
|
form: string;
|
|
34
34
|
disabled: boolean;
|
|
35
35
|
loading: boolean;
|
|
36
|
-
submitLabel: string;
|
|
37
36
|
cancelLabel: string;
|
|
38
|
-
hideCancel: boolean;
|
|
39
37
|
sticky: "container" | "viewport" | "none";
|
|
38
|
+
submitLabel: string;
|
|
39
|
+
hideCancel: boolean;
|
|
40
40
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
41
41
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
42
42
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "./AcButton.js";
|
|
2
2
|
import { computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, inject as c, normalizeClass as l, normalizeStyle as u, onBeforeUnmount as d, onMounted as f, openBlock as p, ref as m, renderSlot as h, watch as g } from "vue";
|
|
3
3
|
//#region src/lib/components/AcFormFooter.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var _ = { class: "flex min-w-0 items-center gap-2 text-base text-muted" }, v = { class: "ml-auto flex items-center gap-
|
|
4
|
+
var _ = { class: "flex min-w-0 items-center gap-2 text-base text-muted" }, v = { class: "ml-auto flex items-center gap-3" }, y = /*@__PURE__*/ s({
|
|
5
5
|
__name: "AcFormFooter",
|
|
6
6
|
props: {
|
|
7
7
|
submitLabel: { default: "Save" },
|
|
@@ -56,7 +56,7 @@ var _ = { class: "flex min-w-0 items-center gap-2 text-base text-muted" }, v = {
|
|
|
56
56
|
}, [a("div", {
|
|
57
57
|
ref_key: "bar",
|
|
58
58
|
ref: w,
|
|
59
|
-
class: l(["border-t border-border bg-surface py-
|
|
59
|
+
class: l(["border-t border-border bg-surface py-4", s.sticky === "viewport" && "fixed bottom-0 z-40 px-4"]),
|
|
60
60
|
style: u(s.sticky === "viewport" ? {
|
|
61
61
|
left: `${T.value.left}px`,
|
|
62
62
|
width: `${T.value.width}px`
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
1
2
|
export interface Props {
|
|
2
3
|
/** Heading of the group, e.g. "Schedule" or "Retention". */
|
|
3
4
|
title?: string;
|
|
4
5
|
/** A line or two under the title explaining the group. */
|
|
5
6
|
description?: string;
|
|
7
|
+
/** A Lucide icon shown in a tinted 28px tile before the title. */
|
|
8
|
+
icon?: Component;
|
|
6
9
|
/** `stacked` puts the title above the fields; `aside` puts it in a left column from 768px up. Defaults to the AcForm's `layout`. */
|
|
7
10
|
layout?: "stacked" | "aside";
|
|
11
|
+
/** `card` is a bordered card with 20px padding; `plain` has no card and a divider above it. Defaults to the AcForm's `variant`, or `card`. */
|
|
12
|
+
variant?: "card" | "plain";
|
|
8
13
|
/** Lays the fields out in two columns from 640px up. Use `class="sm:col-span-2"` on a field to span both. */
|
|
9
14
|
columns?: 1 | 2;
|
|
10
15
|
}
|
|
@@ -17,10 +22,12 @@ type __VLS_Slots = {
|
|
|
17
22
|
actions?: () => unknown;
|
|
18
23
|
};
|
|
19
24
|
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
25
|
+
variant: "card" | "plain";
|
|
20
26
|
title: string;
|
|
21
27
|
description: string;
|
|
22
|
-
|
|
28
|
+
icon: Component;
|
|
23
29
|
columns: 1 | 2;
|
|
30
|
+
layout: "stacked" | "aside";
|
|
24
31
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
32
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
26
33
|
declare const _default: typeof __VLS_export;
|