@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
|
@@ -1,61 +1,62 @@
|
|
|
1
1
|
import e from "./AcSpinner.js";
|
|
2
|
-
import { Fragment as t, Teleport as n, Transition as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as
|
|
3
|
-
import { Check as
|
|
2
|
+
import { Fragment as t, Teleport as n, Transition as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as ee, createVNode as l, defineComponent as u, mergeModels as d, mergeProps as te, nextTick as f, normalizeClass as p, normalizeStyle as ne, onBeforeUnmount as re, openBlock as m, ref as h, renderList as g, renderSlot as ie, resolveDynamicComponent as ae, toDisplayString as _, unref as v, useAttrs as oe, useId as se, useModel as ce, vModelText as le, watch as ue, withCtx as de, withDirectives as fe, withModifiers as y } from "vue";
|
|
3
|
+
import { Check as pe, ChevronDown as me, ChevronUp as he, Plus as ge, RefreshCw as _e, X as ve } from "@lucide/vue";
|
|
4
4
|
//#region src/lib/components/AcSelect.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var ye = {
|
|
5
|
+
var ye = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
|
|
8
|
+
}, be = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "text-danger",
|
|
11
|
+
"aria-hidden": "true"
|
|
12
|
+
}, xe = [
|
|
6
13
|
"id",
|
|
7
14
|
"tabindex",
|
|
8
15
|
"aria-expanded",
|
|
9
16
|
"aria-labelledby",
|
|
10
17
|
"aria-label",
|
|
18
|
+
"aria-describedby",
|
|
11
19
|
"aria-disabled",
|
|
12
20
|
"aria-invalid",
|
|
13
21
|
"aria-required",
|
|
14
22
|
"aria-activedescendant"
|
|
15
|
-
],
|
|
23
|
+
], Se = { class: "flex min-w-0 flex-1 flex-wrap items-center gap-2" }, Ce = { class: "truncate" }, we = [
|
|
16
24
|
"aria-label",
|
|
17
25
|
"disabled",
|
|
18
26
|
"onClick"
|
|
19
|
-
],
|
|
27
|
+
], Te = {
|
|
20
28
|
key: 1,
|
|
21
29
|
class: "truncate"
|
|
22
|
-
},
|
|
30
|
+
}, Ee = {
|
|
23
31
|
key: 2,
|
|
24
32
|
class: "truncate text-muted"
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
class: "text-danger",
|
|
33
|
+
}, De = { class: "flex shrink-0 items-center gap-1 text-muted" }, Oe = ["disabled"], ke = {
|
|
34
|
+
class: "inline-flex rounded-full p-1 transition-colors hover:bg-accent-hover hover:text-primary",
|
|
28
35
|
"aria-hidden": "true"
|
|
29
36
|
}, Ae = {
|
|
30
37
|
key: 0,
|
|
31
|
-
class: "
|
|
32
|
-
}, je = {
|
|
33
|
-
key: 1,
|
|
34
|
-
class: "mt-1.5 text-xs text-muted"
|
|
35
|
-
}, Me = {
|
|
36
|
-
key: 0,
|
|
37
|
-
class: "border-b border-border-light p-1.5"
|
|
38
|
-
}, Ne = { class: "relative" }, Pe = ["aria-activedescendant"], Fe = ["aria-multiselectable", "aria-labelledby"], Ie = {
|
|
38
|
+
class: "border-b border-border p-3"
|
|
39
|
+
}, je = ["aria-activedescendant"], Me = ["aria-multiselectable", "aria-labelledby"], Ne = {
|
|
39
40
|
key: 0,
|
|
40
41
|
role: "presentation",
|
|
41
|
-
class: "px-
|
|
42
|
-
},
|
|
42
|
+
class: "px-4 pt-2 pb-1 text-sm font-semibold tracking-[0.08em] text-muted uppercase"
|
|
43
|
+
}, Pe = [
|
|
43
44
|
"id",
|
|
44
45
|
"aria-selected",
|
|
45
46
|
"aria-disabled",
|
|
46
47
|
"onMouseenter",
|
|
47
48
|
"onClick"
|
|
48
|
-
],
|
|
49
|
+
], Fe = { class: "min-w-0 flex-1" }, Ie = { class: "block truncate" }, Le = {
|
|
49
50
|
key: 0,
|
|
50
|
-
class: "block truncate text-xs text-muted"
|
|
51
|
-
},
|
|
51
|
+
class: "block truncate text-xs font-normal text-muted"
|
|
52
|
+
}, Re = ["id"], ze = { class: "min-w-0 flex-1 truncate" }, Be = {
|
|
52
53
|
key: 1,
|
|
53
54
|
role: "presentation",
|
|
54
|
-
class: "px-
|
|
55
|
-
},
|
|
55
|
+
class: "px-4 py-3 text-center text-base text-muted"
|
|
56
|
+
}, b = /*@__PURE__*/ u({
|
|
56
57
|
inheritAttrs: !1,
|
|
57
58
|
__name: "AcSelect",
|
|
58
|
-
props: /*@__PURE__*/
|
|
59
|
+
props: /*@__PURE__*/ d({
|
|
59
60
|
options: {},
|
|
60
61
|
by: {
|
|
61
62
|
type: [String, Function],
|
|
@@ -98,58 +99,58 @@ var ye = { class: "relative" }, be = [
|
|
|
98
99
|
},
|
|
99
100
|
errorMsg: { default: "" },
|
|
100
101
|
hint: { default: "" },
|
|
101
|
-
size: { default: "
|
|
102
|
+
size: { default: "normal" },
|
|
102
103
|
noResultText: { default: "No results" }
|
|
103
104
|
}, {
|
|
104
105
|
modelValue: { default: null },
|
|
105
106
|
modelModifiers: {}
|
|
106
107
|
}),
|
|
107
|
-
emits: /*@__PURE__*/
|
|
108
|
+
emits: /*@__PURE__*/ d([
|
|
108
109
|
"select",
|
|
109
110
|
"create",
|
|
110
111
|
"remove",
|
|
111
112
|
"search",
|
|
112
113
|
"refresh"
|
|
113
114
|
], ["update:modelValue"]),
|
|
114
|
-
setup(
|
|
115
|
-
let
|
|
116
|
-
class:
|
|
117
|
-
style:
|
|
118
|
-
})),
|
|
119
|
-
let { class: e, style: t, ...n } =
|
|
115
|
+
setup(u, { expose: d, emit: b }) {
|
|
116
|
+
let x = u, S = b, C = ce(u, "modelValue"), w = se(), T = oe(), Ve = i(() => ({
|
|
117
|
+
class: T.class,
|
|
118
|
+
style: T.style
|
|
119
|
+
})), He = i(() => {
|
|
120
|
+
let { class: e, style: t, ...n } = T;
|
|
120
121
|
return n;
|
|
121
|
-
}),
|
|
122
|
+
}), E = `${w}-list`, D = `${w}-label`, Ue = `${w}-hint`, We = `${w}-msg`, Ge = h(null), O = h(null), k = h(null), Ke = h(null), A = h(!1), j = h(""), M = h(-1), N = h({
|
|
122
123
|
left: 0,
|
|
123
124
|
width: 0,
|
|
124
|
-
maxHeight:
|
|
125
|
-
}),
|
|
126
|
-
let e =
|
|
125
|
+
maxHeight: 288
|
|
126
|
+
}), P = i(() => {
|
|
127
|
+
let e = C.value;
|
|
127
128
|
return e == null || e === "" ? [] : Array.isArray(e) ? e : [e];
|
|
128
|
-
}),
|
|
129
|
-
let n =
|
|
129
|
+
}), F = (e, t) => {
|
|
130
|
+
let n = x.by;
|
|
130
131
|
return typeof n == "function" ? n(e, t) : n && e && t && typeof e == "object" && typeof t == "object" ? e[n] === t[n] : e === t;
|
|
131
|
-
},
|
|
132
|
-
let t =
|
|
132
|
+
}, I = (e) => {
|
|
133
|
+
let t = x.by;
|
|
133
134
|
return String(typeof t == "string" && e && typeof e == "object" ? e[t] : e);
|
|
134
|
-
},
|
|
135
|
-
let n =
|
|
135
|
+
}, qe = (e, t) => {
|
|
136
|
+
let n = x.by;
|
|
136
137
|
return e && typeof e == "object" ? typeof n == "string" ? String(e[n]) : `i${t}` : String(e);
|
|
137
|
-
},
|
|
138
|
+
}, L = (e) => P.value.some((t) => F(t, e.value)), R = i(() => P.value.map((e) => x.options.find((t) => F(t.value, e)) ?? {
|
|
138
139
|
value: e,
|
|
139
|
-
label:
|
|
140
|
-
})),
|
|
140
|
+
label: I(e)
|
|
141
|
+
})), z = i(() => P.value.length > 0), Je = (e) => {
|
|
141
142
|
if (!e.some((e) => e.group)) return e;
|
|
142
143
|
let t = [];
|
|
143
144
|
return e.forEach((e) => {
|
|
144
145
|
let n = e.group ?? "";
|
|
145
146
|
t.includes(n) || t.push(n);
|
|
146
147
|
}), [...e].sort((e, n) => t.indexOf(e.group ?? "") - t.indexOf(n.group ?? ""));
|
|
147
|
-
},
|
|
148
|
-
let e =
|
|
149
|
-
return
|
|
150
|
-
}),
|
|
148
|
+
}, B = i(() => {
|
|
149
|
+
let e = j.value.trim().toLowerCase();
|
|
150
|
+
return Je(e ? x.options.filter((t) => t.label.toLowerCase().includes(e) || t.description?.toLowerCase().includes(e) || t.group?.toLowerCase().includes(e)) : x.options);
|
|
151
|
+
}), Ye = i(() => {
|
|
151
152
|
let e = [];
|
|
152
|
-
return
|
|
153
|
+
return B.value.forEach((t, n) => {
|
|
153
154
|
let r = t.group ?? "", i = e.find((e) => e.name === r);
|
|
154
155
|
i || e.push(i = {
|
|
155
156
|
name: r,
|
|
@@ -159,283 +160,274 @@ var ye = { class: "relative" }, be = [
|
|
|
159
160
|
index: n
|
|
160
161
|
});
|
|
161
162
|
}), e;
|
|
162
|
-
}),
|
|
163
|
-
let e =
|
|
164
|
-
if (!
|
|
165
|
-
let t =
|
|
163
|
+
}), V = (e) => `${w}-opt-${e}`, H = i(() => j.value.trim()), U = i(() => {
|
|
164
|
+
let e = H.value.toLowerCase();
|
|
165
|
+
if (!x.creatable || !x.searchable || !e) return !1;
|
|
166
|
+
let t = x.options.some((t) => t.label.toLowerCase() === e || I(t.value).toLowerCase() === e), n = P.value.some((t) => I(t).toLowerCase() === e);
|
|
166
167
|
return !t && !n;
|
|
167
|
-
}),
|
|
168
|
-
let e =
|
|
168
|
+
}), W = i(() => B.value.length + +!!U.value - 1), G = i(() => B.value.length), Xe = () => {
|
|
169
|
+
let e = O.value;
|
|
169
170
|
if (!e) return;
|
|
170
|
-
let t = e.getBoundingClientRect(), n = window.innerHeight - t.bottom -
|
|
171
|
-
|
|
172
|
-
bottom: window.innerHeight - t.top +
|
|
171
|
+
let t = e.getBoundingClientRect(), n = window.innerHeight - t.bottom - 4 - 8, r = t.top - 4 - 8;
|
|
172
|
+
N.value = n < 180 && r > n ? {
|
|
173
|
+
bottom: window.innerHeight - t.top + 4,
|
|
173
174
|
left: t.left,
|
|
174
175
|
width: t.width,
|
|
175
|
-
maxHeight: Math.min(
|
|
176
|
+
maxHeight: Math.min(288, r)
|
|
176
177
|
} : {
|
|
177
|
-
top: t.bottom +
|
|
178
|
+
top: t.bottom + 4,
|
|
178
179
|
left: t.left,
|
|
179
180
|
width: t.width,
|
|
180
|
-
maxHeight: Math.min(
|
|
181
|
+
maxHeight: Math.min(288, n)
|
|
181
182
|
};
|
|
182
|
-
},
|
|
183
|
-
for (let n = e; n >= 0 && n <=
|
|
183
|
+
}, K = (e = 0, t = 1) => {
|
|
184
|
+
for (let n = e; n >= 0 && n <= W.value; n += t) if (!B.value[n]?.disabled) return n;
|
|
184
185
|
return -1;
|
|
185
|
-
},
|
|
186
|
-
if (
|
|
187
|
-
|
|
188
|
-
let e =
|
|
189
|
-
|
|
190
|
-
},
|
|
191
|
-
|
|
192
|
-
},
|
|
186
|
+
}, Ze = async () => {
|
|
187
|
+
if (x.disabled || x.loading || A.value) return;
|
|
188
|
+
A.value = !0, j.value = "", Xe();
|
|
189
|
+
let e = B.value.findIndex((e) => L(e));
|
|
190
|
+
M.value = e >= 0 ? e : K(), await f(), x.searchable && Ke.value?.focus(), X();
|
|
191
|
+
}, q = (e = !0) => {
|
|
192
|
+
A.value && (A.value = !1, M.value = -1, e && O.value?.focus());
|
|
193
|
+
}, Qe = () => A.value ? q() : Ze(), $e = (e) => {
|
|
193
194
|
if (!e.disabled) {
|
|
194
|
-
if (
|
|
195
|
-
let t = [...
|
|
196
|
-
n >= 0 ? (t.splice(n, 1),
|
|
197
|
-
} else
|
|
195
|
+
if (x.multiple) {
|
|
196
|
+
let t = [...P.value], n = t.findIndex((t) => F(t, e.value));
|
|
197
|
+
n >= 0 ? (t.splice(n, 1), S("remove", e)) : (t.push(e.value), S("select", e)), C.value = t;
|
|
198
|
+
} else C.value = e.value, S("select", e), q();
|
|
198
199
|
}
|
|
199
|
-
},
|
|
200
|
-
|
|
201
|
-
},
|
|
202
|
-
let e =
|
|
203
|
-
if (!
|
|
200
|
+
}, J = (e) => {
|
|
201
|
+
C.value = x.multiple ? P.value.filter((t) => !F(t, e.value)) : null, S("remove", e);
|
|
202
|
+
}, et = () => {
|
|
203
|
+
let e = H.value;
|
|
204
|
+
if (!U.value || !e) return;
|
|
204
205
|
let t = e, n = {
|
|
205
206
|
value: t,
|
|
206
207
|
label: e
|
|
207
208
|
};
|
|
208
|
-
|
|
209
|
-
},
|
|
210
|
-
|
|
211
|
-
},
|
|
212
|
-
let t =
|
|
209
|
+
x.multiple ? (C.value = [...P.value, t], j.value = "") : (C.value = t, q()), S("select", n), S("create", e);
|
|
210
|
+
}, tt = () => {
|
|
211
|
+
R.value.forEach((e) => S("remove", e)), C.value = x.multiple ? [] : null, O.value?.focus();
|
|
212
|
+
}, Y = "", nt, X = () => f(() => k.value?.querySelector(`#${CSS.escape(V(M.value))}`)?.scrollIntoView({ block: "nearest" })), rt = (e) => {
|
|
213
|
+
let t = W.value + 1;
|
|
213
214
|
if (!t) return;
|
|
214
|
-
let n =
|
|
215
|
-
for (let r = 0; r < t && (n = (n + e + t) % t,
|
|
216
|
-
|
|
217
|
-
},
|
|
218
|
-
if (
|
|
215
|
+
let n = M.value;
|
|
216
|
+
for (let r = 0; r < t && (n = (n + e + t) % t, B.value[n]?.disabled); r++);
|
|
217
|
+
M.value = n, X();
|
|
218
|
+
}, it = (e) => {
|
|
219
|
+
if (x.disabled) return;
|
|
219
220
|
let t = e.key;
|
|
220
|
-
if (!
|
|
221
|
+
if (!A.value) {
|
|
221
222
|
[
|
|
222
223
|
"Enter",
|
|
223
224
|
" ",
|
|
224
225
|
"ArrowDown",
|
|
225
226
|
"ArrowUp"
|
|
226
|
-
].includes(t) ? (e.preventDefault(),
|
|
227
|
+
].includes(t) ? (e.preventDefault(), Ze()) : t === "Backspace" && x.multiple && z.value && e.target === O.value && J(R.value[R.value.length - 1]);
|
|
227
228
|
return;
|
|
228
229
|
}
|
|
229
|
-
if (t === "ArrowDown") e.preventDefault(),
|
|
230
|
-
else if (t === "ArrowUp") e.preventDefault(),
|
|
231
|
-
else if (t === "Home") e.preventDefault(),
|
|
232
|
-
else if (t === "End") e.preventDefault(),
|
|
233
|
-
else if (t === "Enter" || t === " " && !
|
|
230
|
+
if (t === "ArrowDown") e.preventDefault(), rt(1);
|
|
231
|
+
else if (t === "ArrowUp") e.preventDefault(), rt(-1);
|
|
232
|
+
else if (t === "Home") e.preventDefault(), M.value = K(), X();
|
|
233
|
+
else if (t === "End") e.preventDefault(), M.value = K(W.value, -1), X();
|
|
234
|
+
else if (t === "Enter" || t === " " && !x.searchable) {
|
|
234
235
|
e.preventDefault();
|
|
235
|
-
let t =
|
|
236
|
-
t ?
|
|
237
|
-
} else if (t === "Escape") e.preventDefault(),
|
|
238
|
-
else if (t === "Tab")
|
|
239
|
-
else if (!
|
|
240
|
-
|
|
241
|
-
let e =
|
|
242
|
-
e >= 0 && (
|
|
236
|
+
let t = B.value[M.value];
|
|
237
|
+
t ? $e(t) : U.value && et();
|
|
238
|
+
} else if (t === "Escape") e.preventDefault(), q();
|
|
239
|
+
else if (t === "Tab") q(!1);
|
|
240
|
+
else if (!x.searchable && t.length === 1 && !e.metaKey && !e.ctrlKey) {
|
|
241
|
+
Y += t.toLowerCase(), clearTimeout(nt), nt = setTimeout(() => Y = "", 500);
|
|
242
|
+
let e = B.value.findIndex((e) => !e.disabled && e.label.toLowerCase().startsWith(Y));
|
|
243
|
+
e >= 0 && (M.value = e, X());
|
|
243
244
|
}
|
|
244
|
-
},
|
|
245
|
+
}, at = (e) => {
|
|
245
246
|
let t = e.target;
|
|
246
|
-
|
|
247
|
-
},
|
|
248
|
-
e &&
|
|
249
|
-
},
|
|
250
|
-
document.removeEventListener("pointerdown",
|
|
247
|
+
Ge.value?.contains(t) || k.value?.contains(t) || q(!1);
|
|
248
|
+
}, Z = (e) => {
|
|
249
|
+
e?.target instanceof Node && k.value?.contains(e.target) || Xe();
|
|
250
|
+
}, ot = () => {
|
|
251
|
+
document.removeEventListener("pointerdown", at, !0), window.removeEventListener("scroll", Z, !0), window.removeEventListener("resize", Z);
|
|
251
252
|
};
|
|
252
|
-
|
|
253
|
-
if (!e) return
|
|
254
|
-
document.addEventListener("pointerdown",
|
|
255
|
-
}),
|
|
256
|
-
|
|
257
|
-
}), re(
|
|
258
|
-
let
|
|
259
|
-
return
|
|
253
|
+
ue(A, (e) => {
|
|
254
|
+
if (!e) return ot();
|
|
255
|
+
document.addEventListener("pointerdown", at, !0), window.addEventListener("scroll", Z, !0), window.addEventListener("resize", Z);
|
|
256
|
+
}), ue(j, (e) => {
|
|
257
|
+
S("search", e), M.value = K();
|
|
258
|
+
}), re(ot);
|
|
259
|
+
let Q = h(!1), st = i(() => A.value || Q.value), ct = i(() => [x.hint && Ue, x.errorMsg && We].filter(Boolean).join(" ") || void 0), $ = i(() => !x.multiple && R.value[0]?.label || "");
|
|
260
|
+
return d({ focus: () => O.value?.focus() }), (i, d) => (m(), s("div", te({
|
|
260
261
|
ref_key: "root",
|
|
261
|
-
ref:
|
|
262
|
-
},
|
|
263
|
-
class: ["w-full",
|
|
262
|
+
ref: Ge
|
|
263
|
+
}, Ve.value, {
|
|
264
|
+
class: ["w-full", u.disabled && "opacity-50"],
|
|
264
265
|
"data-ac-ds": "",
|
|
265
266
|
"data-testid": "ac-select"
|
|
266
267
|
}), [
|
|
267
|
-
|
|
268
|
-
id:
|
|
268
|
+
u.label ? (m(), s("div", ye, [c("label", {
|
|
269
|
+
id: D,
|
|
270
|
+
onClick: d[0] ||= (e) => O.value?.focus()
|
|
271
|
+
}, _(u.label), 1), u.required ? (m(), s("span", be, "*")) : o("", !0)])) : o("", !0),
|
|
272
|
+
u.hint ? (m(), s("p", {
|
|
273
|
+
key: 1,
|
|
274
|
+
id: Ue,
|
|
275
|
+
class: "mb-2 text-base text-muted"
|
|
276
|
+
}, _(u.hint), 1)) : o("", !0),
|
|
277
|
+
c("div", te({
|
|
278
|
+
id: `${v(w)}-trigger`,
|
|
269
279
|
ref_key: "trigger",
|
|
270
|
-
ref:
|
|
271
|
-
},
|
|
280
|
+
ref: O
|
|
281
|
+
}, He.value, {
|
|
272
282
|
role: "combobox",
|
|
273
|
-
tabindex:
|
|
283
|
+
tabindex: u.disabled ? -1 : 0,
|
|
274
284
|
"aria-haspopup": "listbox",
|
|
275
|
-
"aria-expanded":
|
|
276
|
-
"aria-controls":
|
|
277
|
-
"aria-labelledby":
|
|
278
|
-
"aria-label":
|
|
279
|
-
"aria-
|
|
280
|
-
"aria-
|
|
281
|
-
"aria-
|
|
282
|
-
"aria-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
285
|
+
"aria-expanded": A.value,
|
|
286
|
+
"aria-controls": E,
|
|
287
|
+
"aria-labelledby": u.label ? D : void 0,
|
|
288
|
+
"aria-label": u.label ? void 0 : v(T)["aria-label"] ?? u.placeholder,
|
|
289
|
+
"aria-describedby": ct.value,
|
|
290
|
+
"aria-disabled": u.disabled || void 0,
|
|
291
|
+
"aria-invalid": !!u.errorMsg || void 0,
|
|
292
|
+
"aria-required": u.required || void 0,
|
|
293
|
+
"aria-activedescendant": A.value && !u.searchable && M.value >= 0 ? V(M.value) : void 0,
|
|
294
|
+
class: ["group flex w-full items-center gap-2 rounded-10 border bg-background text-left text-base font-medium text-heading transition-[color,background-color,border-color,box-shadow] duration-200 outline-none", [
|
|
295
|
+
u.size === "compact" ? "min-h-8 pr-1 pl-3" : u.size === "small" ? "min-h-9 pr-1 pl-4" : "min-h-10.5 pr-1 pl-5",
|
|
296
|
+
u.multiple && z.value && (u.size === "normal" ? "py-1.5" : "py-1"),
|
|
297
|
+
u.disabled || u.loading ? "cursor-not-allowed" : "cursor-pointer",
|
|
298
|
+
u.errorMsg ? ["border-danger/50", st.value && "border-danger shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]"] : st.value ? "focus-ring" : ["border-border", !u.disabled && "hover:border-accent-active"]
|
|
289
299
|
]],
|
|
290
|
-
onClick:
|
|
291
|
-
onKeydown:
|
|
292
|
-
onFocus:
|
|
293
|
-
onBlur:
|
|
294
|
-
}), [c("div",
|
|
295
|
-
key:
|
|
296
|
-
class: "inline-flex
|
|
297
|
-
}, [c("span",
|
|
300
|
+
onClick: Qe,
|
|
301
|
+
onKeydown: it,
|
|
302
|
+
onFocus: d[2] ||= (e) => Q.value = !0,
|
|
303
|
+
onBlur: d[3] ||= (e) => Q.value = !1
|
|
304
|
+
}), [c("div", Se, [u.multiple && z.value ? (m(!0), s(t, { key: 0 }, g(R.value, (e, t) => (m(), s("span", {
|
|
305
|
+
key: qe(e.value, t),
|
|
306
|
+
class: "inline-flex max-w-full items-center gap-2 rounded-10 bg-accent px-2 text-xs text-heading"
|
|
307
|
+
}, [c("span", Ce, _(e.label), 1), c("button", {
|
|
298
308
|
type: "button",
|
|
299
|
-
class: "inline-flex
|
|
309
|
+
class: "inline-flex shrink-0 cursor-pointer items-center justify-center rounded-full p-1 transition-colors hover:bg-accent-hover hover:text-primary focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
300
310
|
"aria-label": `Remove ${e.label}`,
|
|
301
|
-
disabled:
|
|
302
|
-
onClick: y((t) =>
|
|
303
|
-
}, [
|
|
304
|
-
class: "size-
|
|
305
|
-
"stroke-width": 2.5,
|
|
311
|
+
disabled: u.disabled,
|
|
312
|
+
onClick: y((t) => J(e), ["stop"])
|
|
313
|
+
}, [l(v(ve), {
|
|
314
|
+
class: "size-4",
|
|
306
315
|
"aria-hidden": "true"
|
|
307
|
-
})], 8,
|
|
308
|
-
|
|
316
|
+
})], 8, we)]))), 128)) : $.value ? (m(), s("span", Te, _($.value), 1)) : (m(), s("span", Ee, _(u.placeholder), 1))]), c("span", De, [
|
|
317
|
+
u.loading ? (m(), a(e, {
|
|
309
318
|
key: 0,
|
|
310
319
|
class: "text-primary"
|
|
311
|
-
})) :
|
|
320
|
+
})) : u.refreshable ? (m(), s("button", {
|
|
312
321
|
key: 1,
|
|
313
322
|
type: "button",
|
|
314
|
-
class: "inline-flex size-6 cursor-pointer items-center justify-center rounded-
|
|
323
|
+
class: "inline-flex size-6 cursor-pointer items-center justify-center rounded-full transition-colors hover:bg-accent-hover hover:text-primary focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
315
324
|
"aria-label": "Refresh options",
|
|
316
|
-
disabled:
|
|
317
|
-
onClick:
|
|
318
|
-
}, [
|
|
319
|
-
class: "size-
|
|
325
|
+
disabled: u.disabled,
|
|
326
|
+
onClick: d[1] ||= y((e) => S("refresh"), ["stop"])
|
|
327
|
+
}, [l(v(_e), {
|
|
328
|
+
class: "size-4",
|
|
320
329
|
"aria-hidden": "true"
|
|
321
|
-
})], 8,
|
|
322
|
-
|
|
330
|
+
})], 8, Oe)) : o("", !0),
|
|
331
|
+
u.clearable && z.value && !u.disabled && !u.loading ? (m(), s("button", {
|
|
323
332
|
key: 2,
|
|
324
333
|
type: "button",
|
|
325
|
-
class: "inline-flex size-6 cursor-pointer items-center justify-center rounded-
|
|
334
|
+
class: "inline-flex size-6 cursor-pointer items-center justify-center rounded-full transition-colors hover:bg-accent-hover hover:text-primary focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
326
335
|
"aria-label": "Clear selection",
|
|
327
|
-
onClick: y(
|
|
328
|
-
}, [
|
|
329
|
-
class: "size-
|
|
336
|
+
onClick: y(tt, ["stop"])
|
|
337
|
+
}, [l(v(ve), {
|
|
338
|
+
class: "size-4",
|
|
330
339
|
"aria-hidden": "true"
|
|
331
340
|
})])) : o("", !0),
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
class: "
|
|
344
|
-
"aria-hidden": "true"
|
|
345
|
-
}), l(" " + _(d.errorMsg), 1)])) : d.hint ? (m(), s("p", je, _(d.hint), 1)) : o("", !0),
|
|
346
|
-
(m(), a(n, { to: "body" }, [u(r, {
|
|
347
|
-
"enter-active-class": "transition duration-150 ease-out",
|
|
348
|
-
"enter-from-class": "opacity-0 -translate-y-1 scale-[0.98]",
|
|
349
|
-
"leave-active-class": "transition duration-100 ease-in",
|
|
341
|
+
c("span", ke, [(m(), a(ae(A.value ? v(he) : v(me)), { class: "size-4" }))])
|
|
342
|
+
])], 16, xe),
|
|
343
|
+
u.errorMsg ? (m(), s("p", {
|
|
344
|
+
key: 2,
|
|
345
|
+
id: We,
|
|
346
|
+
class: "mt-1 text-base text-danger-strong",
|
|
347
|
+
role: "alert"
|
|
348
|
+
}, _(u.errorMsg), 1)) : o("", !0),
|
|
349
|
+
(m(), a(n, { to: "body" }, [l(r, {
|
|
350
|
+
"enter-active-class": "transition-opacity duration-100 ease-out motion-reduce:transition-none",
|
|
351
|
+
"enter-from-class": "opacity-0",
|
|
352
|
+
"leave-active-class": "transition-opacity duration-75 ease-in motion-reduce:transition-none",
|
|
350
353
|
"leave-to-class": "opacity-0"
|
|
351
354
|
}, {
|
|
352
|
-
default:
|
|
355
|
+
default: de(() => [A.value ? (m(), s("div", {
|
|
353
356
|
key: 0,
|
|
354
357
|
ref_key: "panel",
|
|
355
|
-
ref:
|
|
356
|
-
class: "fixed z-[90] flex flex-col overflow-hidden rounded-
|
|
358
|
+
ref: k,
|
|
359
|
+
class: "fixed z-[90] flex flex-col overflow-hidden rounded-10 border border-border bg-background shadow-lg",
|
|
357
360
|
style: ne({
|
|
358
|
-
top:
|
|
359
|
-
bottom:
|
|
360
|
-
left: `${
|
|
361
|
-
width: `${
|
|
362
|
-
maxHeight: `${
|
|
361
|
+
top: N.value.top === void 0 ? void 0 : `${N.value.top}px`,
|
|
362
|
+
bottom: N.value.bottom === void 0 ? void 0 : `${N.value.bottom}px`,
|
|
363
|
+
left: `${N.value.left}px`,
|
|
364
|
+
width: `${N.value.width}px`,
|
|
365
|
+
maxHeight: `${N.value.maxHeight}px`
|
|
363
366
|
}),
|
|
364
367
|
"data-ac-ds": "",
|
|
365
368
|
"data-testid": "ac-select-panel"
|
|
366
|
-
}, [
|
|
367
|
-
class: "pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted",
|
|
368
|
-
"aria-hidden": "true"
|
|
369
|
-
}), de(c("input", {
|
|
369
|
+
}, [u.searchable ? (m(), s("div", Ae, [fe(c("input", {
|
|
370
370
|
ref_key: "searchInput",
|
|
371
|
-
ref:
|
|
372
|
-
"onUpdate:modelValue":
|
|
371
|
+
ref: Ke,
|
|
372
|
+
"onUpdate:modelValue": d[4] ||= (e) => j.value = e,
|
|
373
373
|
type: "text",
|
|
374
374
|
placeholder: "Search…",
|
|
375
375
|
"aria-label": "Search options",
|
|
376
|
-
"aria-controls":
|
|
377
|
-
"aria-activedescendant":
|
|
378
|
-
class: "h-
|
|
379
|
-
onKeydown:
|
|
380
|
-
}, null, 40,
|
|
381
|
-
id:
|
|
376
|
+
"aria-controls": E,
|
|
377
|
+
"aria-activedescendant": M.value >= 0 ? V(M.value) : void 0,
|
|
378
|
+
class: "h-9.5 w-full rounded-10 border border-border bg-background px-3 text-base text-heading transition-[border-color,box-shadow] duration-200 outline-none placeholder:text-muted/80 hover:border-accent-active focus:focus-ring",
|
|
379
|
+
onKeydown: it
|
|
380
|
+
}, null, 40, je), [[le, j.value]])])) : o("", !0), c("ul", {
|
|
381
|
+
id: E,
|
|
382
382
|
role: "listbox",
|
|
383
|
-
"aria-multiselectable":
|
|
384
|
-
"aria-labelledby":
|
|
385
|
-
class: "ac-scrollbar min-h-0 flex-1 p-1"
|
|
383
|
+
"aria-multiselectable": u.multiple || void 0,
|
|
384
|
+
"aria-labelledby": u.label ? D : void 0,
|
|
385
|
+
class: "ac-scrollbar max-h-60 min-h-0 flex-1 p-1"
|
|
386
386
|
}, [
|
|
387
|
-
(m(!0), s(t, null, g(
|
|
388
|
-
id:
|
|
389
|
-
key:
|
|
387
|
+
(m(!0), s(t, null, g(Ye.value, (e) => (m(), s(t, { key: e.name }, [e.name ? (m(), s("li", Ne, _(e.name), 1)) : o("", !0), (m(!0), s(t, null, g(e.items, ({ option: e, index: t }) => (m(), s("li", {
|
|
388
|
+
id: V(t),
|
|
389
|
+
key: qe(e.value, t),
|
|
390
390
|
role: "option",
|
|
391
|
-
"aria-selected":
|
|
391
|
+
"aria-selected": L(e),
|
|
392
392
|
"aria-disabled": e.disabled || void 0,
|
|
393
|
-
class: p(["flex cursor-pointer items-start gap-2.5 rounded-6 px-
|
|
394
|
-
onMouseenter: (n) => !e.disabled && (
|
|
395
|
-
onMousedown:
|
|
396
|
-
onClick: (t) =>
|
|
397
|
-
}, [
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
}, () => [c("span", { class: p(["block truncate", I(e) && "font-medium"]) }, _(e.label), 3), e.description ? (m(), s("span", ze, _(e.description), 1)) : o("", !0)])]),
|
|
413
|
-
!d.multiple && I(e) ? (m(), a(v(fe), {
|
|
414
|
-
key: 1,
|
|
415
|
-
class: "mt-0.5 size-4 shrink-0 text-primary",
|
|
416
|
-
"aria-hidden": "true"
|
|
417
|
-
})) : o("", !0)
|
|
418
|
-
], 42, Le))), 128))], 64))), 128)),
|
|
419
|
-
H.value ? (m(), s("li", {
|
|
393
|
+
class: p(["flex cursor-pointer items-start gap-2.5 rounded-6 px-4 py-2 text-base text-heading transition-colors", [e.disabled && "cursor-not-allowed opacity-50", t === M.value ? "bg-accent-hover" : L(e) && "bg-accent"]]),
|
|
394
|
+
onMouseenter: (n) => !e.disabled && (M.value = t),
|
|
395
|
+
onMousedown: d[5] ||= y(() => {}, ["prevent"]),
|
|
396
|
+
onClick: (t) => $e(e)
|
|
397
|
+
}, [u.multiple ? (m(), s("span", {
|
|
398
|
+
key: 0,
|
|
399
|
+
class: p(["mt-0.5 inline-flex size-4 shrink-0 items-center justify-center rounded-4 border transition-colors", L(e) ? "border-primary bg-primary text-white" : "border-muted/70 bg-surface"]),
|
|
400
|
+
"aria-hidden": "true"
|
|
401
|
+
}, [L(e) ? (m(), a(v(pe), {
|
|
402
|
+
key: 0,
|
|
403
|
+
class: "size-3",
|
|
404
|
+
"stroke-width": 3,
|
|
405
|
+
"aria-hidden": "true"
|
|
406
|
+
})) : o("", !0)], 2)) : o("", !0), c("span", Fe, [ie(i.$slots, "option", {
|
|
407
|
+
option: e,
|
|
408
|
+
selected: L(e),
|
|
409
|
+
active: t === M.value
|
|
410
|
+
}, () => [c("span", Ie, _(e.label), 1), e.description ? (m(), s("span", Le, _(e.description), 1)) : o("", !0)])])], 42, Pe))), 128))], 64))), 128)),
|
|
411
|
+
U.value ? (m(), s("li", {
|
|
420
412
|
key: 0,
|
|
421
|
-
id:
|
|
413
|
+
id: V(G.value),
|
|
422
414
|
role: "option",
|
|
423
415
|
"aria-selected": "false",
|
|
424
|
-
class: p(["flex cursor-pointer items-center gap-2 rounded-6 px-
|
|
416
|
+
class: p(["flex cursor-pointer items-center gap-2.5 rounded-6 px-4 py-2 text-base text-heading transition-colors", G.value === M.value && "bg-accent-hover"]),
|
|
425
417
|
"data-testid": "ac-select-create",
|
|
426
|
-
onMouseenter:
|
|
427
|
-
onMousedown:
|
|
428
|
-
onClick:
|
|
429
|
-
}, [
|
|
430
|
-
class: "size-4 shrink-0 text-primary",
|
|
418
|
+
onMouseenter: d[6] ||= (e) => M.value = G.value,
|
|
419
|
+
onMousedown: d[7] ||= y(() => {}, ["prevent"]),
|
|
420
|
+
onClick: et
|
|
421
|
+
}, [l(v(ge), {
|
|
422
|
+
class: "size-4 shrink-0 text-primary-strong",
|
|
431
423
|
"aria-hidden": "true"
|
|
432
|
-
}), c("span",
|
|
433
|
-
!
|
|
434
|
-
], 8,
|
|
424
|
+
}), c("span", ze, _(u.createText) + " “" + _(H.value) + "”", 1)], 42, Re)) : o("", !0),
|
|
425
|
+
!B.value.length && !U.value ? (m(), s("li", Be, [ie(i.$slots, "empty", { query: j.value }, () => [ee(_(j.value ? `${u.noResultText} for “${j.value}”` : "No options"), 1)])])) : o("", !0)
|
|
426
|
+
], 8, Me)], 4)) : o("", !0)]),
|
|
435
427
|
_: 3
|
|
436
428
|
})]))
|
|
437
429
|
], 16));
|
|
438
430
|
}
|
|
439
431
|
});
|
|
440
432
|
//#endregion
|
|
441
|
-
export {
|
|
433
|
+
export { b as default };
|