@ac-design/design-system 1.0.3 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -18
- package/dist/lib/charts/ChartFrame.js +5 -0
- package/dist/lib/charts/ChartFrame.vue.d.ts +71 -0
- package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +173 -0
- package/dist/lib/charts/cartesian.d.ts +324 -0
- package/dist/lib/charts/cartesian.js +137 -0
- package/dist/lib/charts/echarts.d.ts +86 -0
- package/dist/lib/charts/echarts.js +173 -0
- package/dist/lib/charts/graph.d.ts +77 -0
- package/dist/lib/charts/graph.js +155 -0
- package/dist/lib/charts/index.d.ts +11 -0
- package/dist/lib/charts/index.js +7 -0
- package/dist/lib/charts/shared.d.ts +53 -0
- package/dist/lib/charts/shared.js +96 -0
- package/dist/lib/charts/xy.d.ts +69 -0
- package/dist/lib/charts/xy.js +73 -0
- package/dist/lib/compat.css +2770 -1061
- package/dist/lib/components/AcAccordion.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcAccordionItem.vue.d.ts +1 -1
- package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/lib/components/AcAlert.vue.d.ts +10 -1
- package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +139 -45
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +19 -19
- package/dist/lib/components/AcAreaChart.js +5 -0
- package/dist/lib/components/AcAreaChart.vue.d.ts +47 -0
- package/dist/lib/components/AcAreaChart.vue_vue_type_script_setup_true_lang.js +205 -0
- package/dist/lib/components/AcAvatar.vue.d.ts +7 -4
- package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +66 -61
- package/dist/lib/components/AcBadge.vue.d.ts +20 -7
- package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +67 -44
- package/dist/lib/components/AcBanner.vue.d.ts +1 -1
- package/dist/lib/components/AcBanner.vue_vue_type_script_setup_true_lang.js +30 -30
- package/dist/lib/components/AcBarChart.js +5 -0
- package/dist/lib/components/AcBarChart.vue.d.ts +46 -0
- package/dist/lib/components/AcBarChart.vue_vue_type_script_setup_true_lang.js +213 -0
- package/dist/lib/components/AcBreadcrumb.vue.d.ts +4 -1
- package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +36 -34
- package/dist/lib/components/AcBulkActionBar.js +5 -0
- package/dist/lib/components/AcBulkActionBar.vue.d.ts +45 -0
- package/dist/lib/components/AcBulkActionBar.vue_vue_type_script_setup_true_lang.js +84 -0
- package/dist/lib/components/AcButton.vue.d.ts +13 -7
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +93 -47
- package/dist/lib/components/AcButtons.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcCard.vue.d.ts +42 -3
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +175 -14
- package/dist/lib/components/AcCellValue.vue.d.ts +6 -3
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +219 -178
- package/dist/lib/components/AcCheckBox.vue.d.ts +17 -3
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +113 -30
- package/dist/lib/components/AcCheckList.js +5 -0
- package/dist/lib/components/AcCheckList.vue.d.ts +45 -0
- package/dist/lib/components/AcCheckList.vue_vue_type_script_setup_true_lang.js +64 -0
- package/dist/lib/components/AcCheckRadio.vue.d.ts +30 -5
- package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +102 -26
- package/dist/lib/components/AcCircularProgress.js +5 -0
- package/dist/lib/components/AcCircularProgress.vue.d.ts +44 -0
- package/dist/lib/components/AcCircularProgress.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +142 -167
- package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/lib/components/AcColorInput.js +5 -0
- package/dist/lib/components/AcColorInput.vue.d.ts +57 -0
- package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +217 -0
- package/dist/lib/components/AcCommandBlock.js +5 -0
- package/dist/lib/components/AcCommandBlock.vue.d.ts +34 -0
- package/dist/lib/components/AcCommandBlock.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/lib/components/AcConfirmModal.js +5 -0
- package/dist/lib/components/AcConfirmModal.vue.d.ts +56 -0
- package/dist/lib/components/AcConfirmModal.vue_vue_type_script_setup_true_lang.js +96 -0
- package/dist/lib/components/AcContentHeader.vue.d.ts +1 -1
- package/dist/lib/components/AcContentHeader.vue_vue_type_script_setup_true_lang.js +5 -4
- package/dist/lib/components/AcContentLayout.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcCopyButton.js +5 -0
- package/dist/lib/components/AcCopyButton.vue.d.ts +43 -0
- package/dist/lib/components/AcCopyButton.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/lib/components/AcCostSummary.js +5 -0
- package/dist/lib/components/AcCostSummary.vue.d.ts +102 -0
- package/dist/lib/components/AcCostSummary.vue_vue_type_script_setup_true_lang.js +179 -0
- package/dist/lib/components/AcDatePicker.vue.d.ts +8 -8
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +634 -417
- package/dist/lib/components/AcDeleteModal.vue.d.ts +4 -4
- package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +57 -60
- package/dist/lib/components/AcDonutChart.js +5 -0
- package/dist/lib/components/AcDonutChart.vue.d.ts +83 -0
- package/dist/lib/components/AcDonutChart.vue_vue_type_script_setup_true_lang.js +237 -0
- package/dist/lib/components/AcDropdown.vue.d.ts +5 -2
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +91 -78
- package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +11 -10
- package/dist/lib/components/AcDropdownItem.vue.d.ts +2 -2
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +18 -18
- package/dist/lib/components/AcEmptyState.vue.d.ts +4 -1
- package/dist/lib/components/AcEmptyState.vue_vue_type_script_setup_true_lang.js +50 -39
- package/dist/lib/components/AcErrorState.js +5 -0
- package/dist/lib/components/AcErrorState.vue.d.ts +46 -0
- package/dist/lib/components/AcErrorState.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/lib/components/AcFeatureCard.vue.d.ts +6 -0
- package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +139 -116
- package/dist/lib/components/AcFileEditor.vue_vue_type_script_setup_true_lang.js +16 -16
- package/dist/lib/components/AcFileUpload.vue.d.ts +2 -2
- package/dist/lib/components/AcFileUpload.vue_vue_type_script_setup_true_lang.js +55 -53
- package/dist/lib/components/AcFontScale.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcFooter.js +5 -0
- package/dist/lib/components/AcFooter.vue.d.ts +37 -0
- package/dist/lib/components/AcFooter.vue_vue_type_script_setup_true_lang.js +107 -0
- package/dist/lib/components/AcForm.vue.d.ts +3 -0
- package/dist/lib/components/AcForm.vue_vue_type_script_setup_true_lang.js +4 -2
- package/dist/lib/components/AcFormArray.vue.d.ts +2 -2
- package/dist/lib/components/AcFormArray.vue_vue_type_script_setup_true_lang.js +149 -147
- package/dist/lib/components/AcFormFooter.vue.d.ts +3 -3
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcFormSection.vue.d.ts +8 -1
- package/dist/lib/components/AcFormSection.vue_vue_type_script_setup_true_lang.js +31 -21
- package/dist/lib/components/AcGraphChart.js +5 -0
- package/dist/lib/components/AcGraphChart.vue.d.ts +124 -0
- package/dist/lib/components/AcGraphChart.vue_vue_type_script_setup_true_lang.js +578 -0
- package/dist/lib/components/AcHeader.vue.d.ts +20 -5
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +82 -28
- package/dist/lib/components/AcInfoTable.vue.d.ts +1 -1
- package/dist/lib/components/AcInfoTable.vue_vue_type_script_setup_true_lang.js +17 -13
- package/dist/lib/components/AcInput.vue.d.ts +4 -4
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +99 -91
- package/dist/lib/components/AcKbd.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcKeyValueInput.js +5 -0
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +114 -0
- package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +336 -0
- package/dist/lib/components/AcLineChart.js +5 -0
- package/dist/lib/components/AcLineChart.vue.d.ts +44 -0
- package/dist/lib/components/AcLineChart.vue_vue_type_script_setup_true_lang.js +175 -0
- package/dist/lib/components/AcLoader.js +5 -0
- package/dist/lib/components/AcLoader.vue.d.ts +15 -0
- package/dist/lib/components/AcLoader.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/lib/components/AcLocaleSwitcher.js +5 -0
- package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +48 -0
- package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +111 -0
- package/dist/lib/components/AcMapChart.js +5 -0
- package/dist/lib/components/AcMapChart.vue.d.ts +136 -0
- package/dist/lib/components/AcMapChart.vue_vue_type_script_setup_true_lang.js +518 -0
- package/dist/lib/components/AcModal.vue.d.ts +6 -3
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +88 -64
- package/dist/lib/components/AcNavbar.vue.d.ts +8 -5
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +29 -21
- package/dist/lib/components/AcNavbarItem.vue.d.ts +2 -2
- package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +23 -24
- package/dist/lib/components/AcNotificationMenu.vue.d.ts +3 -3
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +139 -174
- package/dist/lib/components/AcNumberInput.js +5 -0
- package/dist/lib/components/AcNumberInput.vue.d.ts +79 -0
- package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +241 -0
- package/dist/lib/components/AcPage.vue.d.ts +2 -2
- package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcPagination.vue.d.ts +22 -5
- package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +87 -56
- package/dist/lib/components/AcPreloader.vue.d.ts +3 -3
- package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +15 -16
- package/dist/lib/components/AcProductHero.js +5 -0
- package/dist/lib/components/AcProductHero.vue.d.ts +56 -0
- package/dist/lib/components/AcProductHero.vue_vue_type_script_setup_true_lang.js +95 -0
- package/dist/lib/components/AcProgress.vue.d.ts +19 -4
- package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +85 -31
- package/dist/lib/components/AcResourceCard.vue.d.ts +3 -3
- package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +17 -17
- package/dist/lib/components/AcSearchBar.vue.d.ts +1 -1
- package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +14 -9
- package/dist/lib/components/AcSectionContent.vue.d.ts +2 -2
- package/dist/lib/components/AcSectionContent.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcSegmentedControl.vue.d.ts +1 -1
- package/dist/lib/components/AcSegmentedControl.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcSelect.vue.d.ts +6 -6
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +246 -254
- package/dist/lib/components/AcSettingsRow.js +5 -0
- package/dist/lib/components/AcSettingsRow.vue.d.ts +29 -0
- package/dist/lib/components/AcSettingsRow.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +32 -32
- package/dist/lib/components/AcSideTabs.vue.d.ts +2 -2
- package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +37 -37
- package/dist/lib/components/AcSidebar.vue.d.ts +6 -3
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +67 -57
- package/dist/lib/components/AcSidebarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +46 -45
- package/dist/lib/components/AcSidebarSection.vue.d.ts +2 -2
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +23 -18
- package/dist/lib/components/AcSkeleton.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcSlider.vue.d.ts +1 -1
- package/dist/lib/components/AcSlider.vue_vue_type_script_setup_true_lang.js +174 -172
- package/dist/lib/components/AcStatCard.vue.d.ts +3 -3
- package/dist/lib/components/AcStatCard.vue_vue_type_script_setup_true_lang.js +90 -85
- package/dist/lib/components/AcStatusBar.vue.d.ts +1 -1
- package/dist/lib/components/AcStatusBar.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +28 -28
- package/dist/lib/components/AcSwitch.vue.d.ts +3 -0
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +31 -19
- package/dist/lib/components/AcSwitchCard.js +5 -0
- package/dist/lib/components/AcSwitchCard.vue.d.ts +59 -0
- package/dist/lib/components/AcSwitchCard.vue_vue_type_script_setup_true_lang.js +121 -0
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +97 -97
- package/dist/lib/components/AcTabs.vue.d.ts +9 -2
- package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +43 -28
- package/dist/lib/components/AcTag.vue.d.ts +2 -2
- package/dist/lib/components/AcTag.vue_vue_type_script_setup_true_lang.js +22 -22
- package/dist/lib/components/AcTagInput.js +5 -0
- package/dist/lib/components/AcTagInput.vue.d.ts +74 -0
- package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +289 -0
- package/dist/lib/components/AcTextarea.vue.d.ts +4 -4
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +85 -63
- package/dist/lib/components/AcThemeMode.vue.d.ts +3 -3
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +56 -24
- package/dist/lib/components/AcTimePicker.js +5 -0
- package/dist/lib/components/AcTimePicker.vue.d.ts +65 -0
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +455 -0
- package/dist/lib/components/AcToaster.vue.d.ts +6 -3
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +115 -82
- package/dist/lib/components/AcTooltip.vue.d.ts +34 -14
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +203 -79
- package/dist/lib/components/AcUsageCard.vue_vue_type_script_setup_true_lang.js +27 -27
- package/dist/lib/components/AcUserMenu.vue.d.ts +23 -1
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +166 -115
- package/dist/lib/components/index.d.ts +21 -2
- package/dist/lib/components/status.d.ts +28 -0
- package/dist/lib/components/status.js +125 -0
- package/dist/lib/composables/copyText.d.ts +2 -1
- package/dist/lib/composables/copyText.js +2 -2
- package/dist/lib/composables/useApiPagination.d.ts +55 -0
- package/dist/lib/composables/useApiPagination.js +58 -0
- package/dist/lib/composables/useBulkSelection.d.ts +44 -0
- package/dist/lib/composables/useBulkSelection.js +41 -0
- package/dist/lib/composables/useFormValidation.d.ts +65 -0
- package/dist/lib/composables/useFormValidation.js +148 -0
- package/dist/lib/composables/useTablePagination.d.ts +49 -0
- package/dist/lib/composables/useTablePagination.js +41 -0
- package/dist/lib/composables/useToast.d.ts +17 -1
- package/dist/lib/composables/useToast.js +10 -2
- package/dist/lib/editor/theme.js +65 -62
- package/dist/lib/index.d.ts +21 -3
- package/dist/lib/index.js +99 -75
- package/dist/lib/theme.css +377 -273
- package/package.json +20 -4
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createVNode as i, defineComponent as a, mergeModels as o, mergeProps as s, normalizeClass as c, onBeforeUnmount as l, openBlock as u, ref as d, renderSlot as f, toDisplayString as p, unref as m, useAttrs as h, useId as g, useModel as _, watch as ee } from "vue";
|
|
2
|
+
import { Minus as te, Plus as ne } from "@lucide/vue";
|
|
3
|
+
//#region src/lib/components/AcNumberInput.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var re = ["for"], v = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "text-muted"
|
|
7
|
+
}, ie = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "text-danger",
|
|
10
|
+
"aria-hidden": "true"
|
|
11
|
+
}, y = ["id"], b = { class: "flex items-center gap-3" }, ae = [
|
|
12
|
+
"id",
|
|
13
|
+
"inputmode",
|
|
14
|
+
"value",
|
|
15
|
+
"name",
|
|
16
|
+
"disabled",
|
|
17
|
+
"readonly",
|
|
18
|
+
"required",
|
|
19
|
+
"aria-valuenow",
|
|
20
|
+
"aria-valuemin",
|
|
21
|
+
"aria-valuemax",
|
|
22
|
+
"aria-valuetext",
|
|
23
|
+
"aria-invalid",
|
|
24
|
+
"aria-describedby"
|
|
25
|
+
], oe = { key: 0 }, se = ["id"], x = /*@__PURE__*/ a({
|
|
26
|
+
inheritAttrs: !1,
|
|
27
|
+
__name: "AcNumberInput",
|
|
28
|
+
props: /*@__PURE__*/ o({
|
|
29
|
+
label: { default: "" },
|
|
30
|
+
name: { default: "" },
|
|
31
|
+
min: { default: void 0 },
|
|
32
|
+
max: { default: void 0 },
|
|
33
|
+
step: { default: 1 },
|
|
34
|
+
precision: { default: void 0 },
|
|
35
|
+
unit: { default: "" },
|
|
36
|
+
stepButtons: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: !1
|
|
39
|
+
},
|
|
40
|
+
holdDelay: { default: 300 },
|
|
41
|
+
holdIntervalDelay: { default: 100 },
|
|
42
|
+
required: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: !1
|
|
45
|
+
},
|
|
46
|
+
disabled: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: !1
|
|
49
|
+
},
|
|
50
|
+
readonly: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: !1
|
|
53
|
+
},
|
|
54
|
+
errorMsg: { default: "" },
|
|
55
|
+
hint: { default: "" },
|
|
56
|
+
size: { default: "normal" }
|
|
57
|
+
}, {
|
|
58
|
+
modelValue: { default: null },
|
|
59
|
+
modelModifiers: {}
|
|
60
|
+
}),
|
|
61
|
+
emits: /*@__PURE__*/ o(["change"], ["update:modelValue"]),
|
|
62
|
+
setup(a, { expose: o, emit: x }) {
|
|
63
|
+
let S = a, C = _(a, "modelValue"), w = x, T = g(), E = h(), D = e(() => ({
|
|
64
|
+
class: E.class,
|
|
65
|
+
style: E.style
|
|
66
|
+
})), O = e(() => {
|
|
67
|
+
let { class: e, style: t, ...n } = E;
|
|
68
|
+
return n;
|
|
69
|
+
}), k = d(null), A = d(G(C.value)), j = d(!1), M, N, P = e(() => S.precision ?? W(S.step)), F = e(() => S.min === void 0 || S.min < 0), I = e(() => S.disabled || S.readonly), L = e(() => S.min !== void 0 && C.value !== null && C.value <= S.min), R = e(() => S.max !== void 0 && C.value !== null && C.value >= S.max), z = e(() => {
|
|
70
|
+
let e = C.value;
|
|
71
|
+
if (!j.value || e === null) return "";
|
|
72
|
+
let { min: t, max: n } = S;
|
|
73
|
+
return (t === void 0 || e >= t) && (n === void 0 || e <= n) ? "" : t !== void 0 && n !== void 0 ? `Enter a value from ${t} to ${n}` : t === void 0 ? `Enter ${n} or less` : `Enter ${t} or more`;
|
|
74
|
+
}), B = e(() => S.errorMsg || z.value), V = e(() => [S.hint && `${T}-hint`, B.value && `${T}-msg`].filter(Boolean).join(" ") || void 0), H = e(() => ["inline-flex shrink-0 cursor-pointer items-center justify-center rounded-10 border border-border bg-accent text-heading transition-colors duration-200 select-none hover:bg-accent-hover active:bg-accent-active disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-accent", S.size === "small" ? "h-9 px-3" : "h-10.5 px-5"]), U = e(() => C.value === null ? void 0 : [A.value, S.unit].filter(Boolean).join(" "));
|
|
75
|
+
function W(e) {
|
|
76
|
+
let t = String(e);
|
|
77
|
+
return t.includes("e-") ? Number(t.split("e-")[1]) : t.split(".")[1]?.length ?? 0;
|
|
78
|
+
}
|
|
79
|
+
function G(e) {
|
|
80
|
+
return e === null ? "" : String(e);
|
|
81
|
+
}
|
|
82
|
+
function K(e) {
|
|
83
|
+
return Number(e.toFixed(P.value));
|
|
84
|
+
}
|
|
85
|
+
function q(e) {
|
|
86
|
+
return S.min !== void 0 && e < S.min ? S.min : S.max !== void 0 && e > S.max ? S.max : e;
|
|
87
|
+
}
|
|
88
|
+
function J(e) {
|
|
89
|
+
if (e === "" || e === "-" || e === "." || e === "-.") return null;
|
|
90
|
+
let t = Number(e);
|
|
91
|
+
return Number.isNaN(t) ? null : t;
|
|
92
|
+
}
|
|
93
|
+
function Y(e) {
|
|
94
|
+
let t = e !== C.value;
|
|
95
|
+
C.value = e, A.value = G(e), t && w("change", e);
|
|
96
|
+
}
|
|
97
|
+
function X(e, t = 1) {
|
|
98
|
+
I.value || Y(q(K((C.value ?? 0) + e * S.step * t)));
|
|
99
|
+
}
|
|
100
|
+
function ce(e) {
|
|
101
|
+
let t = e.target;
|
|
102
|
+
if (!RegExp(`^${F.value ? "-?" : ""}\\d*${P.value > 0 ? "(\\.\\d*)?" : ""}$`).test(t.value)) {
|
|
103
|
+
t.value = A.value;
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
A.value = t.value;
|
|
107
|
+
let n = J(t.value);
|
|
108
|
+
(n !== null || t.value === "") && (C.value = n);
|
|
109
|
+
}
|
|
110
|
+
function Z() {
|
|
111
|
+
let e = J(A.value);
|
|
112
|
+
Y(e === null ? null : q(K(e)));
|
|
113
|
+
}
|
|
114
|
+
function le() {
|
|
115
|
+
j.value = !1, Z();
|
|
116
|
+
}
|
|
117
|
+
function ue(e) {
|
|
118
|
+
let t = {
|
|
119
|
+
ArrowUp: () => X(1),
|
|
120
|
+
ArrowDown: () => X(-1),
|
|
121
|
+
PageUp: () => X(1, 10),
|
|
122
|
+
PageDown: () => X(-1, 10)
|
|
123
|
+
};
|
|
124
|
+
if (S.min !== void 0 && (t.Home = () => !I.value && Y(S.min)), S.max !== void 0 && (t.End = () => !I.value && Y(S.max)), e.key === "Enter") return Z();
|
|
125
|
+
let n = t[e.key];
|
|
126
|
+
n && (e.preventDefault(), n());
|
|
127
|
+
}
|
|
128
|
+
function Q() {
|
|
129
|
+
clearTimeout(M), clearInterval(N);
|
|
130
|
+
}
|
|
131
|
+
function de(e, t) {
|
|
132
|
+
e.button !== 0 || I.value || (Q(), X(t), M = setTimeout(() => {
|
|
133
|
+
N = setInterval(() => {
|
|
134
|
+
X(t), (t > 0 && R.value || t < 0 && L.value) && Q();
|
|
135
|
+
}, S.holdIntervalDelay);
|
|
136
|
+
}, S.holdDelay));
|
|
137
|
+
}
|
|
138
|
+
function fe(e, t) {
|
|
139
|
+
e.detail === 0 && X(t);
|
|
140
|
+
}
|
|
141
|
+
function $(e) {
|
|
142
|
+
let t = e < 0 ? "Decrease" : "Increase";
|
|
143
|
+
return {
|
|
144
|
+
"aria-label": t,
|
|
145
|
+
"aria-controls": T,
|
|
146
|
+
"data-testid": `ac-number-input-${t.toLowerCase()}`,
|
|
147
|
+
disabled: I.value || (e < 0 ? L.value : R.value),
|
|
148
|
+
onMousedown: (e) => e.preventDefault(),
|
|
149
|
+
onPointerdown: (t) => de(t, e),
|
|
150
|
+
onPointerup: Q,
|
|
151
|
+
onPointerleave: Q,
|
|
152
|
+
onPointercancel: Q,
|
|
153
|
+
onClick: (t) => fe(t, e)
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
return ee(C, (e) => {
|
|
157
|
+
J(A.value) !== e && (A.value = G(e));
|
|
158
|
+
}), l(Q), o({ focus: () => k.value?.focus() }), (e, o) => (u(), n("div", s(D.value, {
|
|
159
|
+
class: ["w-full", a.disabled && "opacity-50"],
|
|
160
|
+
"data-ac-ds": "",
|
|
161
|
+
"data-testid": "ac-number-input"
|
|
162
|
+
}), [
|
|
163
|
+
a.label ? (u(), n("label", {
|
|
164
|
+
key: 0,
|
|
165
|
+
for: m(T),
|
|
166
|
+
class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
|
|
167
|
+
}, [
|
|
168
|
+
r("span", null, p(a.label), 1),
|
|
169
|
+
a.readonly ? (u(), n("span", v, "(read only)")) : t("", !0),
|
|
170
|
+
a.required ? (u(), n("span", ie, "*")) : t("", !0)
|
|
171
|
+
], 8, re)) : t("", !0),
|
|
172
|
+
a.hint ? (u(), n("p", {
|
|
173
|
+
key: 1,
|
|
174
|
+
id: `${m(T)}-hint`,
|
|
175
|
+
class: "mb-2 text-base text-muted"
|
|
176
|
+
}, p(a.hint), 9, y)) : t("", !0),
|
|
177
|
+
r("div", b, [
|
|
178
|
+
a.stepButtons ? (u(), n("button", s({
|
|
179
|
+
key: 0,
|
|
180
|
+
type: "button",
|
|
181
|
+
tabindex: "-1",
|
|
182
|
+
class: H.value
|
|
183
|
+
}, $(-1)), [i(m(te), {
|
|
184
|
+
class: c(a.size === "small" ? "size-4" : "size-6"),
|
|
185
|
+
"aria-hidden": "true"
|
|
186
|
+
}, null, 8, ["class"])], 16)) : t("", !0),
|
|
187
|
+
r("div", { class: c(["relative flex min-w-0 flex-1 items-center rounded-10 border transition-[border-color,box-shadow,background-color] duration-200", [
|
|
188
|
+
a.size === "small" ? "h-9" : "h-10.5",
|
|
189
|
+
a.readonly ? "bg-surface-muted" : "bg-background",
|
|
190
|
+
B.value ? "border-danger focus-within:shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]" : ["border-border focus-within:focus-ring", !a.disabled && "hover:border-accent-active"]
|
|
191
|
+
]]) }, [r("input", s({
|
|
192
|
+
id: m(T),
|
|
193
|
+
ref_key: "input",
|
|
194
|
+
ref: k
|
|
195
|
+
}, O.value, {
|
|
196
|
+
type: "text",
|
|
197
|
+
role: "spinbutton",
|
|
198
|
+
autocomplete: "off",
|
|
199
|
+
inputmode: P.value > 0 || F.value ? "decimal" : "numeric",
|
|
200
|
+
value: A.value,
|
|
201
|
+
name: a.name,
|
|
202
|
+
disabled: a.disabled,
|
|
203
|
+
readonly: a.readonly,
|
|
204
|
+
required: a.required,
|
|
205
|
+
"aria-valuenow": C.value ?? void 0,
|
|
206
|
+
"aria-valuemin": a.min,
|
|
207
|
+
"aria-valuemax": a.max,
|
|
208
|
+
"aria-valuetext": U.value,
|
|
209
|
+
"aria-invalid": !!B.value || void 0,
|
|
210
|
+
"aria-describedby": V.value,
|
|
211
|
+
class: "block h-full w-full min-w-0 flex-1 rounded-10 bg-transparent px-2 text-center text-base font-normal text-heading tabular-nums outline-none placeholder:text-muted/80 disabled:cursor-not-allowed",
|
|
212
|
+
onInput: ce,
|
|
213
|
+
onKeydown: ue,
|
|
214
|
+
onFocus: o[0] ||= (e) => j.value = !0,
|
|
215
|
+
onBlur: le
|
|
216
|
+
}), null, 16, ae), a.unit || e.$slots.suffix ? (u(), n("span", {
|
|
217
|
+
key: 0,
|
|
218
|
+
class: c(["flex h-full shrink-0 items-center gap-1.5 text-base whitespace-nowrap text-muted select-none [&_svg]:size-4", a.size === "small" ? "pr-3" : "pr-4"]),
|
|
219
|
+
"aria-hidden": "true"
|
|
220
|
+
}, [f(e.$slots, "suffix"), a.unit ? (u(), n("span", oe, p(a.unit), 1)) : t("", !0)], 2)) : t("", !0)], 2),
|
|
221
|
+
a.stepButtons ? (u(), n("button", s({
|
|
222
|
+
key: 1,
|
|
223
|
+
type: "button",
|
|
224
|
+
tabindex: "-1",
|
|
225
|
+
class: H.value
|
|
226
|
+
}, $(1)), [i(m(ne), {
|
|
227
|
+
class: c(a.size === "small" ? "size-4" : "size-6"),
|
|
228
|
+
"aria-hidden": "true"
|
|
229
|
+
}, null, 8, ["class"])], 16)) : t("", !0)
|
|
230
|
+
]),
|
|
231
|
+
B.value ? (u(), n("p", {
|
|
232
|
+
key: 2,
|
|
233
|
+
id: `${m(T)}-msg`,
|
|
234
|
+
class: "mt-1 text-base text-danger-strong",
|
|
235
|
+
role: "alert"
|
|
236
|
+
}, p(B.value), 9, se)) : t("", !0)
|
|
237
|
+
], 16));
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
//#endregion
|
|
241
|
+
export { x as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export interface Props {
|
|
2
|
-
/** Pads the page on
|
|
2
|
+
/** Pads the page like cloud-ui's page container: 16px on the sides, 32px top and bottom. Turn off when a parent already pads it. */
|
|
3
3
|
padded?: boolean;
|
|
4
4
|
/** Space between the page's direct children: `small` 12px, `normal` 20px, `large` 32px. */
|
|
5
5
|
gap?: "small" | "normal" | "large";
|
|
6
|
-
/** Caps the content width and centres it: `narrow` 768px, `normal` 1024px, `wide`
|
|
6
|
+
/** Caps the content width and centres it: `narrow` 768px, `normal` 1024px, `wide` 1200px (cloud-ui's page column, the same as its `custom-container` and our `page-container` utility), `full` fills the area. Use `wide` for new cloud-ui-style pages. */
|
|
7
7
|
width?: "full" | "wide" | "normal" | "narrow";
|
|
8
8
|
}
|
|
9
9
|
type __VLS_Slots = {
|
|
@@ -17,7 +17,7 @@ var a = /*@__PURE__*/ t({
|
|
|
17
17
|
large: "gap-8"
|
|
18
18
|
}, o = {
|
|
19
19
|
full: "",
|
|
20
|
-
wide: "mx-auto max-w-
|
|
20
|
+
wide: "mx-auto max-w-page",
|
|
21
21
|
normal: "mx-auto max-w-5xl",
|
|
22
22
|
narrow: "mx-auto max-w-3xl"
|
|
23
23
|
};
|
|
@@ -25,7 +25,7 @@ var a = /*@__PURE__*/ t({
|
|
|
25
25
|
class: n(["flex w-full min-w-0 flex-col", [
|
|
26
26
|
a[t.gap],
|
|
27
27
|
o[t.width],
|
|
28
|
-
t.padded && "
|
|
28
|
+
t.padded && "px-4 py-8"
|
|
29
29
|
]]),
|
|
30
30
|
"data-ac-ds": "",
|
|
31
31
|
"data-testid": "ac-page"
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
export interface Props {
|
|
2
|
-
/** Total number of items across all pages. */
|
|
3
|
-
total
|
|
2
|
+
/** Total number of items across all pages. Leave it out when the API returns only a next-page token: the summary becomes "Page 3" (or "Showing 41 to 60" with `items-on-page`) and Next follows `has-next`. */
|
|
3
|
+
total?: number;
|
|
4
|
+
/** Whether a page after the current one exists, e.g. the response had a next-page token. Overrides the count worked out from `total`. */
|
|
5
|
+
hasNext?: boolean;
|
|
6
|
+
/** Whether a page before the current one exists. Defaults to any page after 1. */
|
|
7
|
+
hasPrev?: boolean;
|
|
8
|
+
/** Pages the viewer can jump to, e.g. those whose tokens you've cached. Other page numbers are disabled, and a page-size change goes back to page 1. Leave it out when every page is reachable. */
|
|
9
|
+
knownPages?: number[];
|
|
10
|
+
/** Rows on the current page, for "Showing 41 to 60" when `total` is unknown. Cloud-ui's `pagination.count`. */
|
|
11
|
+
itemsOnPage?: number;
|
|
4
12
|
/** Choices in the page-size select. */
|
|
5
13
|
pageSizes?: number[];
|
|
6
|
-
/** Hides the "
|
|
14
|
+
/** Hides the "Items per page" select. */
|
|
7
15
|
hidePageSize?: boolean;
|
|
8
16
|
/** How many page numbers to show on each side of the current one before an ellipsis. */
|
|
9
17
|
siblings?: number;
|
|
10
18
|
/** Always use the compact "‹ 3 / 6 ›" control. It's used automatically below 640px. */
|
|
11
19
|
compact?: boolean;
|
|
12
|
-
/** Noun after the count: "Showing 1
|
|
20
|
+
/** Noun after the count: "Showing 1 to 10 of 57 databases". Defaults to "results". */
|
|
13
21
|
itemLabel?: string;
|
|
14
22
|
/** Disables every control, e.g. while a page loads. */
|
|
15
23
|
disabled?: boolean;
|
|
16
|
-
/** `small` makes the
|
|
24
|
+
/** `small` makes the buttons 28px high with 14px text (default `normal` is 34px with 16px text, as cloud-ui's table pager). Use it inside cards and dense tables. */
|
|
17
25
|
size?: "normal" | "small";
|
|
18
26
|
}
|
|
19
27
|
type __VLS_Props = Props;
|
|
@@ -25,23 +33,32 @@ type __VLS_ModelProps = {
|
|
|
25
33
|
};
|
|
26
34
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
27
35
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
36
|
+
next: (page: number) => any;
|
|
28
37
|
range: (range: {
|
|
29
38
|
start: number;
|
|
30
39
|
end: number;
|
|
31
40
|
}) => any;
|
|
41
|
+
prev: (page: number) => any;
|
|
32
42
|
"update:page": (value: number) => any;
|
|
33
43
|
"update:pageSize": (value: number) => any;
|
|
34
44
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
45
|
+
onNext?: ((page: number) => any) | undefined;
|
|
35
46
|
onRange?: ((range: {
|
|
36
47
|
start: number;
|
|
37
48
|
end: number;
|
|
38
49
|
}) => any) | undefined;
|
|
50
|
+
onPrev?: ((page: number) => any) | undefined;
|
|
39
51
|
"onUpdate:page"?: ((value: number) => any) | undefined;
|
|
40
52
|
"onUpdate:pageSize"?: ((value: number) => any) | undefined;
|
|
41
53
|
}>, {
|
|
42
54
|
disabled: boolean;
|
|
43
55
|
size: "normal" | "small";
|
|
44
56
|
compact: boolean;
|
|
57
|
+
total: number;
|
|
58
|
+
hasNext: boolean;
|
|
59
|
+
hasPrev: boolean;
|
|
60
|
+
knownPages: number[];
|
|
61
|
+
itemsOnPage: number;
|
|
45
62
|
pageSizes: number[];
|
|
46
63
|
hidePageSize: boolean;
|
|
47
64
|
siblings: number;
|
|
@@ -3,27 +3,40 @@ import { Fragment as t, computed as n, createCommentVNode as r, createElementBlo
|
|
|
3
3
|
import { ChevronLeft as _, ChevronRight as v } from "@lucide/vue";
|
|
4
4
|
//#region src/lib/components/AcPagination.vue?vue&type=script&setup=true&lang.ts
|
|
5
5
|
var y = {
|
|
6
|
-
class: "flex flex-wrap items-center justify-between gap-x-6 gap-y-3 text-base",
|
|
6
|
+
class: "flex flex-wrap items-center justify-between gap-x-6 gap-y-3 text-base text-muted",
|
|
7
7
|
"data-ac-ds": "",
|
|
8
8
|
"data-testid": "ac-pagination"
|
|
9
|
-
}, b = { class: "flex min-w-0 flex-wrap items-center gap-x-
|
|
9
|
+
}, b = { class: "flex min-w-0 flex-wrap items-center gap-x-4 gap-y-2" }, x = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "flex items-center gap-2"
|
|
12
12
|
}, S = { class: "w-18" }, C = {
|
|
13
|
-
class: "
|
|
13
|
+
class: "whitespace-nowrap tabular-nums",
|
|
14
14
|
"aria-live": "polite"
|
|
15
15
|
}, w = {
|
|
16
16
|
"aria-label": "Pagination",
|
|
17
17
|
class: "ml-auto"
|
|
18
|
-
}, T = { class: "flex items-center gap-
|
|
18
|
+
}, T = { class: "flex items-center gap-2" }, E = ["disabled"], D = { class: "px-2 whitespace-nowrap tabular-nums" }, O = { class: "font-medium text-heading" }, k = { class: "font-medium text-heading" }, A = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "hidden sm:flex"
|
|
21
|
+
}, ee = { class: "flex items-center gap-1" }, j = [
|
|
19
22
|
"aria-label",
|
|
20
23
|
"aria-current",
|
|
21
24
|
"disabled",
|
|
22
25
|
"onClick"
|
|
23
|
-
],
|
|
26
|
+
], M = ["disabled"], N = /*@__PURE__*/ c({
|
|
24
27
|
__name: "AcPagination",
|
|
25
28
|
props: /*@__PURE__*/ l({
|
|
26
|
-
total: {},
|
|
29
|
+
total: { default: void 0 },
|
|
30
|
+
hasNext: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: void 0
|
|
33
|
+
},
|
|
34
|
+
hasPrev: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: void 0
|
|
37
|
+
},
|
|
38
|
+
knownPages: { default: void 0 },
|
|
39
|
+
itemsOnPage: { default: void 0 },
|
|
27
40
|
pageSizes: { default: () => [
|
|
28
41
|
10,
|
|
29
42
|
20,
|
|
@@ -51,19 +64,29 @@ var y = {
|
|
|
51
64
|
pageSize: { default: 10 },
|
|
52
65
|
pageSizeModifiers: {}
|
|
53
66
|
}),
|
|
54
|
-
emits: /*@__PURE__*/ l([
|
|
67
|
+
emits: /*@__PURE__*/ l([
|
|
68
|
+
"range",
|
|
69
|
+
"next",
|
|
70
|
+
"prev"
|
|
71
|
+
], ["update:page", "update:pageSize"]),
|
|
55
72
|
setup(c, { emit: l }) {
|
|
56
|
-
let
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
73
|
+
let N = c, P = h(c, "page"), F = h(c, "pageSize"), I = l, L = n(() => [N.size === "small" ? "h-7 min-w-7 px-1.5 text-base" : "h-8.5 min-w-8.5 px-2 text-lg", !N.compact && (N.size === "small" ? "sm:px-2.5" : "sm:px-3")]), R = n(() => N.size === "small" ? "h-7 min-w-7 px-2.5 text-base" : "h-8.5 min-w-8.5 px-3 text-lg"), z = n(() => typeof N.total == "number"), B = n(() => Math.max(0, N.total ?? 0)), V = n(() => Math.max(1, F.value)), H = n(() => !z.value || N.knownPages !== void 0), U = n(() => z.value ? Math.max(1, Math.ceil(B.value / V.value)) : Math.max(1, P.value, ...N.knownPages ?? [])), W = n(() => Math.min(Math.max(1, P.value), U.value)), G = n(() => N.hasPrev ?? W.value > 1), K = n(() => N.hasNext ?? W.value < U.value), q = n(() => {
|
|
74
|
+
let e = (W.value - 1) * V.value;
|
|
75
|
+
return z.value ? {
|
|
76
|
+
start: Math.min(e, B.value),
|
|
77
|
+
end: Math.min(W.value * V.value, B.value)
|
|
78
|
+
} : {
|
|
79
|
+
start: e,
|
|
80
|
+
end: e + Math.max(0, N.itemsOnPage ?? V.value)
|
|
81
|
+
};
|
|
82
|
+
}), J = n(() => {
|
|
83
|
+
let e = ` ${N.itemLabel || "results"}`;
|
|
84
|
+
return z.value ? B.value ? `Showing ${q.value.start + 1} to ${q.value.end} of ${B.value}${e}` : `0${e}` : N.itemsOnPage === void 0 ? `Page ${W.value}` : N.itemsOnPage ? `Showing ${q.value.start + 1} to ${q.value.end}${N.itemLabel ? e : ""}` : W.value === 1 ? `0${e}` : `Page ${W.value}`;
|
|
85
|
+
}), Y = n(() => (N.pageSizes.includes(F.value) ? N.pageSizes : [...N.pageSizes, F.value].sort((e, t) => e - t)).map((e) => ({
|
|
63
86
|
value: e,
|
|
64
87
|
label: String(e)
|
|
65
|
-
}))),
|
|
66
|
-
let e =
|
|
88
|
+
}))), X = n(() => {
|
|
89
|
+
let e = U.value, t = W.value, n = Math.max(0, N.siblings);
|
|
67
90
|
if (e <= 5 + 2 * n) return Array.from({ length: e }, (e, t) => t + 1);
|
|
68
91
|
let r = Math.max(t - n, 1), i = Math.min(t + n, e), a = r > 3, o = i < e - 2, s = (e, t) => Array.from({ length: t - e + 1 }, (t, n) => e + n);
|
|
69
92
|
return a ? o ? [
|
|
@@ -82,79 +105,87 @@ var y = {
|
|
|
82
105
|
e
|
|
83
106
|
];
|
|
84
107
|
});
|
|
85
|
-
function
|
|
86
|
-
|
|
108
|
+
function Z(e) {
|
|
109
|
+
return e === W.value || !N.knownPages || N.knownPages.includes(e);
|
|
110
|
+
}
|
|
111
|
+
function Q(e) {
|
|
112
|
+
if (N.disabled) return;
|
|
113
|
+
let t = z.value ? U.value : Infinity;
|
|
114
|
+
P.value = Math.min(Math.max(1, e), t);
|
|
115
|
+
}
|
|
116
|
+
function $(e) {
|
|
117
|
+
!N.disabled && (e > 0 ? K.value : G.value) && (Q(W.value + e), I(e > 0 ? "next" : "prev", P.value));
|
|
87
118
|
}
|
|
88
|
-
function
|
|
119
|
+
function te(e) {
|
|
89
120
|
let t = Number(e);
|
|
90
|
-
if (!t || t ===
|
|
91
|
-
let n =
|
|
92
|
-
|
|
121
|
+
if (!t || t === F.value) return;
|
|
122
|
+
let n = q.value.start;
|
|
123
|
+
F.value = t, P.value = H.value ? 1 : Math.floor(n / t) + 1;
|
|
93
124
|
}
|
|
94
|
-
return g(
|
|
95
|
-
|
|
96
|
-
}), g(
|
|
97
|
-
class: "
|
|
125
|
+
return g(U, (e) => {
|
|
126
|
+
z.value && P.value > e && (P.value = e);
|
|
127
|
+
}), g(q, (e) => I("range", { ...e }), { immediate: !0 }), (n, l) => (d(), i("div", y, [a("div", b, [c.hidePageSize ? r("", !0) : (d(), i("div", x, [l[2] ||= a("span", {
|
|
128
|
+
class: "whitespace-nowrap",
|
|
98
129
|
"aria-hidden": "true"
|
|
99
|
-
}, "
|
|
100
|
-
"model-value":
|
|
101
|
-
options:
|
|
130
|
+
}, "Items per page", -1), a("div", S, [s(e, {
|
|
131
|
+
"model-value": F.value,
|
|
132
|
+
options: Y.value,
|
|
102
133
|
size: "compact",
|
|
103
|
-
placeholder: "
|
|
134
|
+
placeholder: "Items per page",
|
|
104
135
|
disabled: c.disabled,
|
|
105
|
-
"onUpdate:modelValue":
|
|
136
|
+
"onUpdate:modelValue": te
|
|
106
137
|
}, null, 8, [
|
|
107
138
|
"model-value",
|
|
108
139
|
"options",
|
|
109
140
|
"disabled"
|
|
110
|
-
])])])), a("p", C, p(
|
|
141
|
+
])])])), a("p", C, p(J.value), 1)]), a("nav", w, [a("ul", T, [
|
|
111
142
|
a("li", null, [a("button", {
|
|
112
143
|
type: "button",
|
|
113
|
-
class: u(["inline-flex cursor-pointer items-center justify-center rounded-
|
|
144
|
+
class: u(["inline-flex cursor-pointer items-center justify-center rounded-4 border border-border bg-transparent font-medium text-heading transition-colors duration-200 hover:bg-accent-hover focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent", L.value]),
|
|
114
145
|
"aria-label": "Previous page",
|
|
115
|
-
disabled: c.disabled ||
|
|
146
|
+
disabled: c.disabled || !G.value,
|
|
116
147
|
"data-ac-ds": "",
|
|
117
148
|
"data-testid": "ac-pagination-prev",
|
|
118
|
-
onClick: l[0] ||= (e) =>
|
|
149
|
+
onClick: l[0] ||= (e) => $(-1)
|
|
119
150
|
}, [s(m(_), {
|
|
120
|
-
class: "size-4",
|
|
151
|
+
class: u(["size-4 shrink-0", !c.compact && "sm:hidden"]),
|
|
121
152
|
"aria-hidden": "true"
|
|
122
|
-
})], 10, E)]),
|
|
123
|
-
a("li", { class: u(c.compact ? "flex" : "flex sm:hidden") }, [a("span", D, [
|
|
153
|
+
}, null, 8, ["class"]), a("span", { class: u(c.compact ? "hidden" : "hidden sm:inline") }, "Previous", 2)], 10, E)]),
|
|
154
|
+
a("li", { class: u(c.compact ? "flex" : "flex sm:hidden") }, [a("span", D, [z.value ? (d(), i(t, { key: 0 }, [
|
|
124
155
|
l[3] ||= a("span", { class: "sr-only" }, "Page ", -1),
|
|
125
|
-
a("span", O, p(
|
|
126
|
-
o(" / " + p(
|
|
127
|
-
])], 2),
|
|
128
|
-
c.compact ? r("", !0) : (d(
|
|
156
|
+
a("span", O, p(W.value), 1),
|
|
157
|
+
o(" / " + p(U.value), 1)
|
|
158
|
+
], 64)) : (d(), i(t, { key: 1 }, [l[4] ||= o("Page ", -1), a("span", k, p(W.value), 1)], 64))])], 2),
|
|
159
|
+
c.compact ? r("", !0) : (d(), i("li", A, [a("ul", ee, [(d(!0), i(t, null, f(X.value, (e) => (d(), i("li", {
|
|
129
160
|
key: e,
|
|
130
|
-
class: "
|
|
161
|
+
class: "flex"
|
|
131
162
|
}, [typeof e == "string" ? (d(), i("span", {
|
|
132
163
|
key: 0,
|
|
133
|
-
class: u(["inline-flex
|
|
164
|
+
class: u(["inline-flex items-center justify-center px-2 text-muted", c.size === "small" ? "h-7" : "h-8.5"]),
|
|
134
165
|
"aria-hidden": "true"
|
|
135
166
|
}, "…", 2)) : (d(), i("button", {
|
|
136
167
|
key: 1,
|
|
137
168
|
type: "button",
|
|
138
|
-
class: u(["inline-flex cursor-pointer items-center justify-center rounded-
|
|
169
|
+
class: u(["inline-flex cursor-pointer items-center justify-center rounded-4 border font-medium tabular-nums transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-40", [R.value, e === W.value ? "border-primary bg-primary text-white" : "border-border bg-transparent text-heading hover:bg-accent-hover disabled:hover:bg-transparent"]]),
|
|
139
170
|
"aria-label": `Page ${e}`,
|
|
140
|
-
"aria-current": e ===
|
|
141
|
-
disabled: c.disabled,
|
|
142
|
-
onClick: (t) =>
|
|
143
|
-
}, p(e), 11,
|
|
171
|
+
"aria-current": e === W.value ? "page" : void 0,
|
|
172
|
+
disabled: c.disabled || !Z(e),
|
|
173
|
+
onClick: (t) => Q(e)
|
|
174
|
+
}, p(e), 11, j))]))), 128))])])),
|
|
144
175
|
a("li", null, [a("button", {
|
|
145
176
|
type: "button",
|
|
146
|
-
class: u(["inline-flex cursor-pointer items-center justify-center rounded-
|
|
177
|
+
class: u(["inline-flex cursor-pointer items-center justify-center rounded-4 border border-border bg-transparent font-medium text-heading transition-colors duration-200 hover:bg-accent-hover focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent", L.value]),
|
|
147
178
|
"aria-label": "Next page",
|
|
148
|
-
disabled: c.disabled ||
|
|
179
|
+
disabled: c.disabled || !K.value,
|
|
149
180
|
"data-ac-ds": "",
|
|
150
181
|
"data-testid": "ac-pagination-next",
|
|
151
|
-
onClick: l[1] ||= (e) =>
|
|
152
|
-
}, [s(m(v), {
|
|
153
|
-
class: "size-4",
|
|
182
|
+
onClick: l[1] ||= (e) => $(1)
|
|
183
|
+
}, [a("span", { class: u(c.compact ? "hidden" : "hidden sm:inline") }, "Next", 2), s(m(v), {
|
|
184
|
+
class: u(["size-4 shrink-0", !c.compact && "sm:hidden"]),
|
|
154
185
|
"aria-hidden": "true"
|
|
155
|
-
})], 10,
|
|
186
|
+
}, null, 8, ["class"])], 10, M)])
|
|
156
187
|
])])]));
|
|
157
188
|
}
|
|
158
189
|
});
|
|
159
190
|
//#endregion
|
|
160
|
-
export {
|
|
191
|
+
export { N as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export interface Props {
|
|
2
|
-
/** Text under the
|
|
2
|
+
/** Text under the loader, e.g. "Fetching resource layout". Also announced to screen readers. */
|
|
3
3
|
message?: string;
|
|
4
|
-
/** Shows the
|
|
4
|
+
/** Shows the loader: cloud-ui's ring and dots. Turn off to show the message alone. */
|
|
5
5
|
showSpinner?: boolean;
|
|
6
|
-
/** Covers the whole viewport on a
|
|
6
|
+
/** Covers the whole viewport on the page background with a 60px loader, for app start-up and sign-in checks. Inline, the ring is 40px. */
|
|
7
7
|
fullPage?: boolean;
|
|
8
8
|
/** CSS minimum height when not `fullPage`. The preloader also grows to fill its container. */
|
|
9
9
|
minHeight?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import e from "./
|
|
2
|
-
import { Teleport as t, createBlock as n, createCommentVNode as r,
|
|
1
|
+
import e from "./AcLoader.js";
|
|
2
|
+
import { Teleport as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, mergeProps as l, openBlock as u, renderSlot as d, toDisplayString as f } from "vue";
|
|
3
3
|
//#region src/lib/components/AcPreloader.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
4
|
+
var p = { key: 0 }, m = { class: "max-w-80 text-base text-muted" }, h = /*@__PURE__*/ c({
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "AcPreloader",
|
|
7
7
|
props: {
|
|
@@ -16,24 +16,23 @@ var d = { class: "max-w-80 text-base text-muted" }, f = /*@__PURE__*/ o({
|
|
|
16
16
|
},
|
|
17
17
|
minHeight: { default: "240px" }
|
|
18
18
|
},
|
|
19
|
-
setup(
|
|
20
|
-
return (
|
|
19
|
+
setup(c) {
|
|
20
|
+
return (h, g) => (u(), n(t, {
|
|
21
21
|
to: "body",
|
|
22
|
-
disabled: !
|
|
23
|
-
}, [
|
|
22
|
+
disabled: !c.fullPage
|
|
23
|
+
}, [a("div", l(h.$attrs, {
|
|
24
24
|
role: "status",
|
|
25
25
|
"aria-live": "polite",
|
|
26
|
-
class: ["flex flex-col items-center justify-center gap-
|
|
27
|
-
style:
|
|
26
|
+
class: ["flex flex-col items-center justify-center gap-4 px-4 text-center", c.fullPage ? "fixed inset-0 z-[80] bg-background" : "size-full"],
|
|
27
|
+
style: c.fullPage ? void 0 : { minHeight: c.minHeight },
|
|
28
28
|
"data-ac-ds": "",
|
|
29
29
|
"data-testid": "ac-preloader"
|
|
30
|
-
}), [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
})) : r("", !0), i("div", d, [l(f.$slots, "default", {}, () => [a(u(o.message), 1)])])], 16)], 8, ["disabled"]));
|
|
30
|
+
}), [c.showSpinner ? (u(), i("div", p, [s(e, {
|
|
31
|
+
size: c.fullPage ? "large" : "normal",
|
|
32
|
+
label: "",
|
|
33
|
+
"aria-hidden": "true"
|
|
34
|
+
}, null, 8, ["size"])])) : r("", !0), a("div", m, [d(h.$slots, "default", {}, () => [o(f(c.message), 1)])])], 16)], 8, ["disabled"]));
|
|
36
35
|
}
|
|
37
36
|
});
|
|
38
37
|
//#endregion
|
|
39
|
-
export {
|
|
38
|
+
export { h as default };
|