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