@septkit/ui 0.0.15 → 0.0.16
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/dist/_virtual/_rolldown/runtime.js +17 -0
- package/dist/dropdown/combobox.js +5 -0
- package/dist/dropdown/combobox.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/dropdown/dropdown.js +1 -1
- package/dist/dropdown/dropdown.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/dropdown/index.js +2 -0
- package/dist/external/.pnpm/@floating-ui_core@1.7.5/node_modules/@floating-ui/core/dist/floating-ui.core.js +359 -0
- package/dist/external/.pnpm/@floating-ui_dom@1.7.6/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +328 -0
- package/dist/external/.pnpm/@floating-ui_utils@0.2.11/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +97 -0
- package/dist/external/.pnpm/@floating-ui_utils@0.2.11/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +106 -0
- package/dist/external/.pnpm/@floating-ui_vue@1.1.11_vue@3.5.32_typescript@5.8.3_/node_modules/@floating-ui/vue/dist/floating-ui.vue.js +102 -0
- package/dist/external/.pnpm/@vueuse_core@14.2.1_vue@3.5.32_typescript@5.8.3_/node_modules/@vueuse/core/dist/index.js +66 -0
- package/dist/external/.pnpm/@vueuse_shared@14.2.1_vue@3.5.32_typescript@5.8.3_/node_modules/@vueuse/shared/dist/index.js +83 -0
- package/dist/external/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.js +46 -0
- package/dist/external/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.js +22 -0
- package/dist/external/.pnpm/lucide-vue-next@1.0.0_vue@3.5.32_typescript@5.8.3_/node_modules/lucide-vue-next/dist/esm/icons/check.js +8 -0
- package/dist/external/.pnpm/lucide-vue-next@1.0.0_vue@3.5.32_typescript@5.8.3_/node_modules/lucide-vue-next/dist/esm/icons/chevron-down.js +8 -0
- package/dist/external/.pnpm/ohash@2.0.11/node_modules/ohash/dist/shared/ohash.D__AXeF1.js +106 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Collection/Collection.js +62 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Combobox/ComboboxAnchor.js +41 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Combobox/ComboboxContent.js +134 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Combobox/ComboboxContentImpl.js +192 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Combobox/ComboboxEmpty.js +26 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Combobox/ComboboxGroup.js +6 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Combobox/ComboboxInput.js +115 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Combobox/ComboboxItem.js +64 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Combobox/ComboboxItemIndicator.js +26 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Combobox/ComboboxRoot.js +213 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Combobox/ComboboxTrigger.js +55 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Combobox/ComboboxViewport.js +51 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/ConfigProvider/ConfigProvider.js +6 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/DismissableLayer/DismissableLayer.js +80 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/DismissableLayer/utils.js +62 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/FocusScope/FocusScope.js +109 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/FocusScope/stack.js +22 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/FocusScope/utils.js +45 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Listbox/ListboxContent.js +65 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Listbox/ListboxFilter.js +84 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Listbox/ListboxItem.js +81 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Listbox/ListboxItemIndicator.js +33 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Listbox/ListboxRoot.js +268 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Listbox/utils.js +10 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Popper/PopperAnchor.js +37 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Popper/PopperContent.js +225 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Popper/PopperRoot.js +16 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Popper/utils.js +27 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Presence/Presence.js +39 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Presence/usePresence.js +58 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Primitive/Primitive.js +27 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Primitive/Slot.js +23 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Primitive/usePrimitiveElement.js +12 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/RovingFocus/utils.js +20 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/VisuallyHidden/VisuallyHidden.js +57 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/VisuallyHidden/VisuallyHiddenInput.js +65 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/VisuallyHidden/VisuallyHiddenInputBubble.js +55 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/shared/arrays.js +10 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/shared/createContext.js +12 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/shared/getActiveElement.js +9 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/shared/handleAndDispatchCustomEvent.js +11 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/shared/nullish.js +6 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/shared/renderSlotFragments.js +7 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/shared/useBodyScrollLock.js +63 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/shared/useDirection.js +9 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/shared/useEmitAsProps.js +10 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/shared/useFilter.js +24 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/shared/useFocusGuards.js +19 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/shared/useFormControl.js +8 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/shared/useForwardExpose.js +50 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/shared/useForwardProps.js +19 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/shared/useForwardPropsEmits.js +13 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/shared/useHideOthers.js +18 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/shared/useId.js +11 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/shared/useKbd.js +41 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/shared/useNonce.js +9 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/shared/useSize.js +33 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/shared/useStateMachine.js +16 -0
- package/dist/external/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/shared/useTypeahead.js +33 -0
- package/dist/external/.pnpm/vue-demi@0.14.10_vue@3.5.32_typescript@5.8.3_/node_modules/vue-demi/lib/index.js +28 -0
- package/dist/index.d.ts +52 -1
- package/dist/index.js +4 -2
- package/dist/ui.css +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useForwardExpose as e } from "../shared/useForwardExpose.js";
|
|
2
|
+
import { Primitive as t } from "../Primitive/Primitive.js";
|
|
3
|
+
import { injectComboboxRootContext as n } from "./ComboboxRoot.js";
|
|
4
|
+
import { useNonce as r } from "../shared/useNonce.js";
|
|
5
|
+
import { Fragment as i, createElementBlock as a, createTextVNode as o, createVNode as s, defineComponent as c, mergeProps as l, openBlock as u, renderSlot as d, toRefs as f, unref as p, withCtx as m } from "vue";
|
|
6
|
+
//#region node_modules/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Combobox/ComboboxViewport.js
|
|
7
|
+
var h = /* @__PURE__ */ c({
|
|
8
|
+
__name: "ComboboxViewport",
|
|
9
|
+
props: {
|
|
10
|
+
nonce: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: !1
|
|
13
|
+
},
|
|
14
|
+
asChild: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
required: !1
|
|
17
|
+
},
|
|
18
|
+
as: {
|
|
19
|
+
type: null,
|
|
20
|
+
required: !1
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
setup(c) {
|
|
24
|
+
let h = c, { forwardRef: g } = e(), { nonce: _ } = f(h), v = r(_), y = n();
|
|
25
|
+
return (e, n) => (u(), a(i, null, [s(p(t), l({
|
|
26
|
+
...e.$attrs,
|
|
27
|
+
...h
|
|
28
|
+
}, {
|
|
29
|
+
ref: p(g),
|
|
30
|
+
"data-reka-combobox-viewport": "",
|
|
31
|
+
role: "presentation",
|
|
32
|
+
style: {
|
|
33
|
+
position: "relative",
|
|
34
|
+
flex: p(y).isVirtual.value ? void 0 : 1,
|
|
35
|
+
overflow: "auto"
|
|
36
|
+
}
|
|
37
|
+
}), {
|
|
38
|
+
default: m(() => [d(e.$slots, "default")]),
|
|
39
|
+
_: 3
|
|
40
|
+
}, 16, ["style"]), s(p(t), {
|
|
41
|
+
as: "style",
|
|
42
|
+
nonce: p(v)
|
|
43
|
+
}, {
|
|
44
|
+
default: m(() => n[0] ||= [o(" /* Hide scrollbars cross-browser and enable momentum scroll for touch devices */ [data-reka-combobox-viewport] { scrollbar-width:none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } [data-reka-combobox-viewport]::-webkit-scrollbar { display: none; } ")]),
|
|
45
|
+
_: 1,
|
|
46
|
+
__: [0]
|
|
47
|
+
}, 8, ["nonce"])], 64));
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
//#endregion
|
|
51
|
+
export { h as ComboboxViewport_default };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createContext as e } from "../shared/createContext.js";
|
|
2
|
+
import "vue";
|
|
3
|
+
//#region node_modules/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/ConfigProvider/ConfigProvider.js
|
|
4
|
+
var [t, n] = /* @__PURE__ */ e("ConfigProvider");
|
|
5
|
+
//#endregion
|
|
6
|
+
export { t as injectConfigProviderContext };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { isNullish as e } from "../shared/nullish.js";
|
|
2
|
+
import { onKeyStroke as t } from "../../../../../@vueuse_core@14.2.1_vue@3.5.32_typescript@5.8.3_/node_modules/@vueuse/core/dist/index.js";
|
|
3
|
+
import { useForwardExpose as n } from "../shared/useForwardExpose.js";
|
|
4
|
+
import { Primitive as r } from "../Primitive/Primitive.js";
|
|
5
|
+
import { useFocusOutside as i, usePointerDownOutside as a } from "./utils.js";
|
|
6
|
+
import { computed as o, createBlock as s, defineComponent as c, nextTick as l, normalizeStyle as u, openBlock as d, reactive as f, renderSlot as p, unref as m, watchEffect as h, withCtx as g } from "vue";
|
|
7
|
+
//#region node_modules/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/DismissableLayer/DismissableLayer.js
|
|
8
|
+
var _ = /* @__PURE__ */ f({
|
|
9
|
+
layersRoot: /* @__PURE__ */ new Set(),
|
|
10
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
11
|
+
originalBodyPointerEvents: void 0,
|
|
12
|
+
branches: /* @__PURE__ */ new Set()
|
|
13
|
+
}), v = /* @__PURE__ */ c({
|
|
14
|
+
__name: "DismissableLayer",
|
|
15
|
+
props: {
|
|
16
|
+
disableOutsidePointerEvents: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
required: !1,
|
|
19
|
+
default: !1
|
|
20
|
+
},
|
|
21
|
+
asChild: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
required: !1
|
|
24
|
+
},
|
|
25
|
+
as: {
|
|
26
|
+
type: null,
|
|
27
|
+
required: !1
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
emits: [
|
|
31
|
+
"escapeKeyDown",
|
|
32
|
+
"pointerDownOutside",
|
|
33
|
+
"focusOutside",
|
|
34
|
+
"interactOutside",
|
|
35
|
+
"dismiss"
|
|
36
|
+
],
|
|
37
|
+
setup(c, { emit: f }) {
|
|
38
|
+
let v = c, y = f, { forwardRef: b, currentElement: x } = n(), S = o(() => x.value?.ownerDocument ?? globalThis.document), C = o(() => _.layersRoot), w = o(() => x.value ? Array.from(C.value).indexOf(x.value) : -1), T = o(() => _.layersWithOutsidePointerEventsDisabled.size > 0), E = o(() => {
|
|
39
|
+
let e = Array.from(C.value), [t] = [..._.layersWithOutsidePointerEventsDisabled].slice(-1), n = e.indexOf(t);
|
|
40
|
+
return w.value >= n;
|
|
41
|
+
}), D = a(async (e) => {
|
|
42
|
+
let t = [..._.branches].some((t) => t?.contains(e.target));
|
|
43
|
+
!E.value || t || (y("pointerDownOutside", e), y("interactOutside", e), await l(), e.defaultPrevented || y("dismiss"));
|
|
44
|
+
}, x), O = i((e) => {
|
|
45
|
+
[..._.branches].some((t) => t?.contains(e.target)) || (y("focusOutside", e), y("interactOutside", e), e.defaultPrevented || y("dismiss"));
|
|
46
|
+
}, x);
|
|
47
|
+
return t("Escape", (e) => {
|
|
48
|
+
w.value === C.value.size - 1 && (y("escapeKeyDown", e), e.defaultPrevented || y("dismiss"));
|
|
49
|
+
}), h((t) => {
|
|
50
|
+
x.value && (v.disableOutsidePointerEvents && (_.layersWithOutsidePointerEventsDisabled.size === 0 && (_.originalBodyPointerEvents = S.value.body.style.pointerEvents, S.value.body.style.pointerEvents = "none"), _.layersWithOutsidePointerEventsDisabled.add(x.value)), C.value.add(x.value), t(() => {
|
|
51
|
+
v.disableOutsidePointerEvents && _.layersWithOutsidePointerEventsDisabled.size === 1 && !e(_.originalBodyPointerEvents) && (S.value.body.style.pointerEvents = _.originalBodyPointerEvents);
|
|
52
|
+
}));
|
|
53
|
+
}), h((e) => {
|
|
54
|
+
e(() => {
|
|
55
|
+
x.value && (C.value.delete(x.value), _.layersWithOutsidePointerEventsDisabled.delete(x.value));
|
|
56
|
+
});
|
|
57
|
+
}), (e, t) => (d(), s(m(r), {
|
|
58
|
+
ref: m(b),
|
|
59
|
+
"as-child": e.asChild,
|
|
60
|
+
as: e.as,
|
|
61
|
+
"data-dismissable-layer": "",
|
|
62
|
+
style: u({ pointerEvents: T.value ? E.value ? "auto" : "none" : void 0 }),
|
|
63
|
+
onFocusCapture: m(O).onFocusCapture,
|
|
64
|
+
onBlurCapture: m(O).onBlurCapture,
|
|
65
|
+
onPointerdownCapture: m(D).onPointerDownCapture
|
|
66
|
+
}, {
|
|
67
|
+
default: g(() => [p(e.$slots, "default")]),
|
|
68
|
+
_: 3
|
|
69
|
+
}, 8, [
|
|
70
|
+
"as-child",
|
|
71
|
+
"as",
|
|
72
|
+
"style",
|
|
73
|
+
"onFocusCapture",
|
|
74
|
+
"onBlurCapture",
|
|
75
|
+
"onPointerdownCapture"
|
|
76
|
+
]));
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
//#endregion
|
|
80
|
+
export { v as DismissableLayer_default };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { handleAndDispatchCustomEvent as e } from "../shared/handleAndDispatchCustomEvent.js";
|
|
2
|
+
import { isClient as t } from "../../../../../@vueuse_shared@14.2.1_vue@3.5.32_typescript@5.8.3_/node_modules/@vueuse/shared/dist/index.js";
|
|
3
|
+
import { nextTick as n, ref as r, toValue as i, watchEffect as a } from "vue";
|
|
4
|
+
//#region node_modules/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/DismissableLayer/utils.js
|
|
5
|
+
var o = "dismissableLayer.pointerDownOutside", s = "dismissableLayer.focusOutside";
|
|
6
|
+
function c(e, t) {
|
|
7
|
+
if (!(t instanceof Element)) return !1;
|
|
8
|
+
let n = t.closest("[data-dismissable-layer]"), r = e.dataset.dismissableLayer === "" ? e : e.querySelector("[data-dismissable-layer]"), i = Array.from(e.ownerDocument.querySelectorAll("[data-dismissable-layer]"));
|
|
9
|
+
return !!(n && (r === n || i.indexOf(r) < i.indexOf(n)));
|
|
10
|
+
}
|
|
11
|
+
function l(n, s, l = !0) {
|
|
12
|
+
let u = s?.value?.ownerDocument ?? globalThis?.document, d = r(!1), f = r(() => {});
|
|
13
|
+
return a((r) => {
|
|
14
|
+
if (!t || !i(l)) return;
|
|
15
|
+
let a = async (t) => {
|
|
16
|
+
let r = t.target;
|
|
17
|
+
if (!(!s?.value || !r)) {
|
|
18
|
+
if (c(s.value, r)) {
|
|
19
|
+
d.value = !1;
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (t.target && !d.value) {
|
|
23
|
+
let r = { originalEvent: t };
|
|
24
|
+
function i() {
|
|
25
|
+
e(o, n, r);
|
|
26
|
+
}
|
|
27
|
+
t.pointerType === "touch" ? (u.removeEventListener("click", f.value), f.value = i, u.addEventListener("click", f.value, { once: !0 })) : i();
|
|
28
|
+
} else u.removeEventListener("click", f.value);
|
|
29
|
+
d.value = !1;
|
|
30
|
+
}
|
|
31
|
+
}, p = window.setTimeout(() => {
|
|
32
|
+
u.addEventListener("pointerdown", a);
|
|
33
|
+
}, 0);
|
|
34
|
+
r(() => {
|
|
35
|
+
window.clearTimeout(p), u.removeEventListener("pointerdown", a), u.removeEventListener("click", f.value);
|
|
36
|
+
});
|
|
37
|
+
}), { onPointerDownCapture: () => {
|
|
38
|
+
i(l) && (d.value = !0);
|
|
39
|
+
} };
|
|
40
|
+
}
|
|
41
|
+
function u(o, l, u = !0) {
|
|
42
|
+
let d = l?.value?.ownerDocument ?? globalThis?.document, f = r(!1);
|
|
43
|
+
return a((r) => {
|
|
44
|
+
if (!t || !i(u)) return;
|
|
45
|
+
let a = async (t) => {
|
|
46
|
+
if (!l?.value) return;
|
|
47
|
+
await n(), await n();
|
|
48
|
+
let r = t.target;
|
|
49
|
+
!l.value || !r || c(l.value, r) || t.target && !f.value && e(s, o, { originalEvent: t });
|
|
50
|
+
};
|
|
51
|
+
d.addEventListener("focusin", a), r(() => d.removeEventListener("focusin", a));
|
|
52
|
+
}), {
|
|
53
|
+
onFocusCapture: () => {
|
|
54
|
+
i(u) && (f.value = !0);
|
|
55
|
+
},
|
|
56
|
+
onBlurCapture: () => {
|
|
57
|
+
i(u) && (f.value = !1);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
export { u as useFocusOutside, l as usePointerDownOutside };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { getActiveElement as e } from "../shared/getActiveElement.js";
|
|
2
|
+
import { isClient as t } from "../../../../../@vueuse_shared@14.2.1_vue@3.5.32_typescript@5.8.3_/node_modules/@vueuse/shared/dist/index.js";
|
|
3
|
+
import { useForwardExpose as n } from "../shared/useForwardExpose.js";
|
|
4
|
+
import { Primitive as r } from "../Primitive/Primitive.js";
|
|
5
|
+
import { createFocusScopesStack as i } from "./stack.js";
|
|
6
|
+
import { AUTOFOCUS_ON_MOUNT as a, AUTOFOCUS_ON_UNMOUNT as o, EVENT_OPTIONS as s, focus as c, focusFirst as l, getTabbableCandidates as u, getTabbableEdges as d } from "./utils.js";
|
|
7
|
+
import { createBlock as f, defineComponent as p, nextTick as m, openBlock as h, reactive as g, ref as _, renderSlot as v, unref as y, watchEffect as b, withCtx as x } from "vue";
|
|
8
|
+
//#region node_modules/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/FocusScope/FocusScope.js
|
|
9
|
+
var S = /* @__PURE__ */ p({
|
|
10
|
+
__name: "FocusScope",
|
|
11
|
+
props: {
|
|
12
|
+
loop: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
required: !1,
|
|
15
|
+
default: !1
|
|
16
|
+
},
|
|
17
|
+
trapped: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
required: !1,
|
|
20
|
+
default: !1
|
|
21
|
+
},
|
|
22
|
+
asChild: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
required: !1
|
|
25
|
+
},
|
|
26
|
+
as: {
|
|
27
|
+
type: null,
|
|
28
|
+
required: !1
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
emits: ["mountAutoFocus", "unmountAutoFocus"],
|
|
32
|
+
setup(p, { emit: S }) {
|
|
33
|
+
let C = p, w = S, { currentRef: T, currentElement: E } = n(), D = _(null), O = i(), k = /* @__PURE__ */ g({
|
|
34
|
+
paused: !1,
|
|
35
|
+
pause() {
|
|
36
|
+
this.paused = !0;
|
|
37
|
+
},
|
|
38
|
+
resume() {
|
|
39
|
+
this.paused = !1;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
b((e) => {
|
|
43
|
+
if (!t) return;
|
|
44
|
+
let n = E.value;
|
|
45
|
+
if (!C.trapped) return;
|
|
46
|
+
function r(e) {
|
|
47
|
+
if (k.paused || !n) return;
|
|
48
|
+
let t = e.target;
|
|
49
|
+
n.contains(t) ? D.value = t : c(D.value, { select: !0 });
|
|
50
|
+
}
|
|
51
|
+
function i(e) {
|
|
52
|
+
if (k.paused || !n) return;
|
|
53
|
+
let t = e.relatedTarget;
|
|
54
|
+
t !== null && (n.contains(t) || c(D.value, { select: !0 }));
|
|
55
|
+
}
|
|
56
|
+
function a(e) {
|
|
57
|
+
let t = D.value;
|
|
58
|
+
t !== null && e.some((e) => e.removedNodes.length > 0) && (n.contains(t) || c(n));
|
|
59
|
+
}
|
|
60
|
+
document.addEventListener("focusin", r), document.addEventListener("focusout", i);
|
|
61
|
+
let o = new MutationObserver(a);
|
|
62
|
+
n && o.observe(n, {
|
|
63
|
+
childList: !0,
|
|
64
|
+
subtree: !0
|
|
65
|
+
}), e(() => {
|
|
66
|
+
document.removeEventListener("focusin", r), document.removeEventListener("focusout", i), o.disconnect();
|
|
67
|
+
});
|
|
68
|
+
}), b(async (t) => {
|
|
69
|
+
let n = E.value;
|
|
70
|
+
if (await m(), !n) return;
|
|
71
|
+
O.add(k);
|
|
72
|
+
let r = e();
|
|
73
|
+
if (!n.contains(r)) {
|
|
74
|
+
let t = new CustomEvent(a, s);
|
|
75
|
+
n.addEventListener(a, (e) => w("mountAutoFocus", e)), n.dispatchEvent(t), t.defaultPrevented || (l(u(n), { select: !0 }), e() === r && c(n));
|
|
76
|
+
}
|
|
77
|
+
t(() => {
|
|
78
|
+
n.removeEventListener(a, (e) => w("mountAutoFocus", e));
|
|
79
|
+
let e = new CustomEvent(o, s), t = (e) => {
|
|
80
|
+
w("unmountAutoFocus", e);
|
|
81
|
+
};
|
|
82
|
+
n.addEventListener(o, t), n.dispatchEvent(e), setTimeout(() => {
|
|
83
|
+
e.defaultPrevented || c(r ?? document.body, { select: !0 }), n.removeEventListener(o, t), O.remove(k);
|
|
84
|
+
}, 0);
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
function A(t) {
|
|
88
|
+
if (!C.loop && !C.trapped || k.paused) return;
|
|
89
|
+
let n = t.key === "Tab" && !t.altKey && !t.ctrlKey && !t.metaKey, r = e();
|
|
90
|
+
if (n && r) {
|
|
91
|
+
let e = t.currentTarget, [n, i] = d(e);
|
|
92
|
+
n && i ? !t.shiftKey && r === i ? (t.preventDefault(), C.loop && c(n, { select: !0 })) : t.shiftKey && r === n && (t.preventDefault(), C.loop && c(i, { select: !0 })) : r === e && t.preventDefault();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return (e, t) => (h(), f(y(r), {
|
|
96
|
+
ref_key: "currentRef",
|
|
97
|
+
ref: T,
|
|
98
|
+
tabindex: "-1",
|
|
99
|
+
"as-child": e.asChild,
|
|
100
|
+
as: e.as,
|
|
101
|
+
onKeydown: A
|
|
102
|
+
}, {
|
|
103
|
+
default: x(() => [v(e.$slots, "default")]),
|
|
104
|
+
_: 3
|
|
105
|
+
}, 8, ["as-child", "as"]));
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
//#endregion
|
|
109
|
+
export { S as FocusScope_default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createGlobalState as e } from "../../../../../@vueuse_shared@14.2.1_vue@3.5.32_typescript@5.8.3_/node_modules/@vueuse/shared/dist/index.js";
|
|
2
|
+
import { ref as t } from "vue";
|
|
3
|
+
//#region node_modules/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/FocusScope/stack.js
|
|
4
|
+
var n = e(() => t([]));
|
|
5
|
+
function r() {
|
|
6
|
+
let e = n();
|
|
7
|
+
return {
|
|
8
|
+
add(t) {
|
|
9
|
+
let n = e.value[0];
|
|
10
|
+
t !== n && n?.pause(), e.value = i(e.value, t), e.value.unshift(t);
|
|
11
|
+
},
|
|
12
|
+
remove(t) {
|
|
13
|
+
e.value = i(e.value, t), e.value[0]?.resume();
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function i(e, t) {
|
|
18
|
+
let n = [...e], r = n.indexOf(t);
|
|
19
|
+
return r !== -1 && n.splice(r, 1), n;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { r as createFocusScopesStack };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { getActiveElement as e } from "../shared/getActiveElement.js";
|
|
2
|
+
//#region node_modules/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/FocusScope/utils.js
|
|
3
|
+
var t = "focusScope.autoFocusOnMount", n = "focusScope.autoFocusOnUnmount", r = {
|
|
4
|
+
bubbles: !1,
|
|
5
|
+
cancelable: !0
|
|
6
|
+
};
|
|
7
|
+
function i(t, { select: n = !1 } = {}) {
|
|
8
|
+
let r = e();
|
|
9
|
+
for (let i of t) if (u(i, { select: n }), e() !== r) return !0;
|
|
10
|
+
}
|
|
11
|
+
function a(e) {
|
|
12
|
+
let t = o(e);
|
|
13
|
+
return [s(t, e), s(t.reverse(), e)];
|
|
14
|
+
}
|
|
15
|
+
function o(e) {
|
|
16
|
+
let t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: (e) => {
|
|
17
|
+
let t = e.tagName === "INPUT" && e.type === "hidden";
|
|
18
|
+
return e.disabled || e.hidden || t ? NodeFilter.FILTER_SKIP : e.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
19
|
+
} });
|
|
20
|
+
for (; n.nextNode();) t.push(n.currentNode);
|
|
21
|
+
return t;
|
|
22
|
+
}
|
|
23
|
+
function s(e, t) {
|
|
24
|
+
for (let n of e) if (!c(n, { upTo: t })) return n;
|
|
25
|
+
}
|
|
26
|
+
function c(e, { upTo: t }) {
|
|
27
|
+
if (getComputedStyle(e).visibility === "hidden") return !0;
|
|
28
|
+
for (; e;) {
|
|
29
|
+
if (t !== void 0 && e === t) return !1;
|
|
30
|
+
if (getComputedStyle(e).display === "none") return !0;
|
|
31
|
+
e = e.parentElement;
|
|
32
|
+
}
|
|
33
|
+
return !1;
|
|
34
|
+
}
|
|
35
|
+
function l(e) {
|
|
36
|
+
return e instanceof HTMLInputElement && "select" in e;
|
|
37
|
+
}
|
|
38
|
+
function u(t, { select: n = !1 } = {}) {
|
|
39
|
+
if (t && t.focus) {
|
|
40
|
+
let r = e();
|
|
41
|
+
t.focus({ preventScroll: !0 }), t !== r && l(t) && n && t.select();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { t as AUTOFOCUS_ON_MOUNT, n as AUTOFOCUS_ON_UNMOUNT, r as EVENT_OPTIONS, u as focus, i as focusFirst, o as getTabbableCandidates, a as getTabbableEdges };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { refAutoReset as e } from "../../../../../@vueuse_shared@14.2.1_vue@3.5.32_typescript@5.8.3_/node_modules/@vueuse/shared/dist/index.js";
|
|
2
|
+
import { Primitive as t } from "../Primitive/Primitive.js";
|
|
3
|
+
import { useCollection as n } from "../Collection/Collection.js";
|
|
4
|
+
import { injectListboxRootContext as r } from "./ListboxRoot.js";
|
|
5
|
+
import { createBlock as i, createVNode as a, defineComponent as o, openBlock as s, renderSlot as c, unref as l, withCtx as u, withKeys as d, withModifiers as f } from "vue";
|
|
6
|
+
//#region node_modules/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Listbox/ListboxContent.js
|
|
7
|
+
var p = /* @__PURE__ */ o({
|
|
8
|
+
__name: "ListboxContent",
|
|
9
|
+
props: {
|
|
10
|
+
asChild: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
required: !1
|
|
13
|
+
},
|
|
14
|
+
as: {
|
|
15
|
+
type: null,
|
|
16
|
+
required: !1
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
setup(o) {
|
|
20
|
+
let { CollectionSlot: p } = n(), m = r(), h = e(!1, 10);
|
|
21
|
+
return (e, n) => (s(), i(l(p), null, {
|
|
22
|
+
default: u(() => [a(l(t), {
|
|
23
|
+
role: "listbox",
|
|
24
|
+
as: e.as,
|
|
25
|
+
"as-child": e.asChild,
|
|
26
|
+
tabindex: l(m).focusable.value ? l(m).highlightedElement.value ? "-1" : "0" : "-1",
|
|
27
|
+
"aria-orientation": l(m).orientation.value,
|
|
28
|
+
"aria-multiselectable": !!l(m).multiple.value,
|
|
29
|
+
"data-orientation": l(m).orientation.value,
|
|
30
|
+
onMousedown: n[0] ||= f((e) => h.value = !0, ["left"]),
|
|
31
|
+
onFocus: n[1] ||= (e) => {
|
|
32
|
+
l(h) || l(m).onEnter(e);
|
|
33
|
+
},
|
|
34
|
+
onKeydown: [
|
|
35
|
+
n[2] ||= d((e) => {
|
|
36
|
+
l(m).orientation.value === "vertical" && (e.key === "ArrowLeft" || e.key === "ArrowRight") || l(m).orientation.value === "horizontal" && (e.key === "ArrowUp" || e.key === "ArrowDown") || (e.preventDefault(), l(m).focusable.value && l(m).onKeydownNavigation(e));
|
|
37
|
+
}, [
|
|
38
|
+
"down",
|
|
39
|
+
"up",
|
|
40
|
+
"left",
|
|
41
|
+
"right",
|
|
42
|
+
"home",
|
|
43
|
+
"end"
|
|
44
|
+
]),
|
|
45
|
+
d(l(m).onKeydownEnter, ["enter"]),
|
|
46
|
+
l(m).onKeydownTypeAhead
|
|
47
|
+
]
|
|
48
|
+
}, {
|
|
49
|
+
default: u(() => [c(e.$slots, "default")]),
|
|
50
|
+
_: 3
|
|
51
|
+
}, 8, [
|
|
52
|
+
"as",
|
|
53
|
+
"as-child",
|
|
54
|
+
"tabindex",
|
|
55
|
+
"aria-orientation",
|
|
56
|
+
"aria-multiselectable",
|
|
57
|
+
"data-orientation",
|
|
58
|
+
"onKeydown"
|
|
59
|
+
])]),
|
|
60
|
+
_: 3
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
//#endregion
|
|
65
|
+
export { p as ListboxContent_default };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { useVModel as e } from "../../../../../@vueuse_core@14.2.1_vue@3.5.32_typescript@5.8.3_/node_modules/@vueuse/core/dist/index.js";
|
|
2
|
+
import { Primitive as t } from "../Primitive/Primitive.js";
|
|
3
|
+
import { usePrimitiveElement as n } from "../Primitive/usePrimitiveElement.js";
|
|
4
|
+
import { injectListboxRootContext as r } from "./ListboxRoot.js";
|
|
5
|
+
import { computed as i, createBlock as a, defineComponent as o, onMounted as s, onUnmounted as c, openBlock as l, ref as u, renderSlot as d, unref as f, watchSyncEffect as p, withCtx as m, withKeys as h, withModifiers as g } from "vue";
|
|
6
|
+
//#region node_modules/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Listbox/ListboxFilter.js
|
|
7
|
+
var _ = /* @__PURE__ */ o({
|
|
8
|
+
__name: "ListboxFilter",
|
|
9
|
+
props: {
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: !1
|
|
13
|
+
},
|
|
14
|
+
autoFocus: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
required: !1
|
|
17
|
+
},
|
|
18
|
+
disabled: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
required: !1
|
|
21
|
+
},
|
|
22
|
+
asChild: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
required: !1
|
|
25
|
+
},
|
|
26
|
+
as: {
|
|
27
|
+
type: null,
|
|
28
|
+
required: !1,
|
|
29
|
+
default: "input"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
emits: ["update:modelValue"],
|
|
33
|
+
setup(o, { emit: _ }) {
|
|
34
|
+
let v = o, y = e(v, "modelValue", _, {
|
|
35
|
+
defaultValue: "",
|
|
36
|
+
passive: v.modelValue === void 0
|
|
37
|
+
}), b = r(), { primitiveElement: x, currentElement: S } = n(), C = i(() => v.disabled || b.disabled.value || !1), w = u();
|
|
38
|
+
return p(() => w.value = b.highlightedElement.value?.id), s(() => {
|
|
39
|
+
b.focusable.value = !1, setTimeout(() => {
|
|
40
|
+
v.autoFocus && S.value?.focus();
|
|
41
|
+
}, 1);
|
|
42
|
+
}), c(() => {
|
|
43
|
+
b.focusable.value = !0;
|
|
44
|
+
}), (e, n) => (l(), a(f(t), {
|
|
45
|
+
ref_key: "primitiveElement",
|
|
46
|
+
ref: x,
|
|
47
|
+
as: e.as,
|
|
48
|
+
"as-child": e.asChild,
|
|
49
|
+
value: f(y),
|
|
50
|
+
disabled: C.value ? "" : void 0,
|
|
51
|
+
"data-disabled": C.value ? "" : void 0,
|
|
52
|
+
"aria-disabled": C.value ?? void 0,
|
|
53
|
+
"aria-activedescendant": w.value,
|
|
54
|
+
type: "text",
|
|
55
|
+
onKeydown: [h(g(f(b).onKeydownNavigation, ["prevent"]), [
|
|
56
|
+
"down",
|
|
57
|
+
"up",
|
|
58
|
+
"home",
|
|
59
|
+
"end"
|
|
60
|
+
]), h(f(b).onKeydownEnter, ["enter"])],
|
|
61
|
+
onInput: n[0] ||= (e) => {
|
|
62
|
+
y.value = e.target.value, f(b).highlightFirstItem();
|
|
63
|
+
},
|
|
64
|
+
onCompositionstart: f(b).onCompositionStart,
|
|
65
|
+
onCompositionend: f(b).onCompositionEnd
|
|
66
|
+
}, {
|
|
67
|
+
default: m(() => [d(e.$slots, "default", { modelValue: f(y) })]),
|
|
68
|
+
_: 3
|
|
69
|
+
}, 8, [
|
|
70
|
+
"as",
|
|
71
|
+
"as-child",
|
|
72
|
+
"value",
|
|
73
|
+
"disabled",
|
|
74
|
+
"data-disabled",
|
|
75
|
+
"aria-disabled",
|
|
76
|
+
"aria-activedescendant",
|
|
77
|
+
"onKeydown",
|
|
78
|
+
"onCompositionstart",
|
|
79
|
+
"onCompositionend"
|
|
80
|
+
]));
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
//#endregion
|
|
84
|
+
export { _ as ListboxFilter_default };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { createContext as e } from "../shared/createContext.js";
|
|
2
|
+
import { handleAndDispatchCustomEvent as t } from "../shared/handleAndDispatchCustomEvent.js";
|
|
3
|
+
import { useForwardExpose as n } from "../shared/useForwardExpose.js";
|
|
4
|
+
import { useId as r } from "../shared/useId.js";
|
|
5
|
+
import { Primitive as i } from "../Primitive/Primitive.js";
|
|
6
|
+
import { useCollection as a } from "../Collection/Collection.js";
|
|
7
|
+
import { valueComparator as o } from "./utils.js";
|
|
8
|
+
import { injectListboxRootContext as s } from "./ListboxRoot.js";
|
|
9
|
+
import { computed as c, createBlock as l, createVNode as u, defineComponent as d, mergeProps as f, openBlock as p, renderSlot as m, unref as h, withCtx as g, withKeys as _, withMemo as v, withModifiers as y } from "vue";
|
|
10
|
+
//#region node_modules/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Listbox/ListboxItem.js
|
|
11
|
+
var b = "listbox.select", [x, S] = /* @__PURE__ */ e("ListboxItem"), C = /* @__PURE__ */ d({
|
|
12
|
+
__name: "ListboxItem",
|
|
13
|
+
props: {
|
|
14
|
+
value: {
|
|
15
|
+
type: null,
|
|
16
|
+
required: !0
|
|
17
|
+
},
|
|
18
|
+
disabled: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
required: !1
|
|
21
|
+
},
|
|
22
|
+
asChild: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
required: !1
|
|
25
|
+
},
|
|
26
|
+
as: {
|
|
27
|
+
type: null,
|
|
28
|
+
required: !1,
|
|
29
|
+
default: "div"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
emits: ["select"],
|
|
33
|
+
setup(e, { emit: d }) {
|
|
34
|
+
let x = e, C = d, w = r(void 0, "reka-listbox-item"), { CollectionItem: T } = a(), { forwardRef: E, currentElement: D } = n(), O = s(), k = c(() => D.value === O.highlightedElement.value), A = c(() => o(O.modelValue.value, x.value, O.by)), j = c(() => O.disabled.value || x.disabled);
|
|
35
|
+
async function M(e) {
|
|
36
|
+
C("select", e), !e?.defaultPrevented && !j.value && e && (O.onValueChange(x.value), O.changeHighlight(D.value));
|
|
37
|
+
}
|
|
38
|
+
function N(e) {
|
|
39
|
+
t(b, M, {
|
|
40
|
+
originalEvent: e,
|
|
41
|
+
value: x.value
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return S({ isSelected: A }), (e, t) => (p(), l(h(T), { value: e.value }, {
|
|
45
|
+
default: g(() => [v([k.value, A.value], () => u(h(i), f({ id: h(w) }, e.$attrs, {
|
|
46
|
+
ref: h(E),
|
|
47
|
+
role: "option",
|
|
48
|
+
tabindex: h(O).focusable.value ? k.value ? "0" : "-1" : -1,
|
|
49
|
+
"aria-selected": A.value,
|
|
50
|
+
as: e.as,
|
|
51
|
+
"as-child": e.asChild,
|
|
52
|
+
disabled: j.value ? "" : void 0,
|
|
53
|
+
"data-disabled": j.value ? "" : void 0,
|
|
54
|
+
"data-highlighted": k.value ? "" : void 0,
|
|
55
|
+
"data-state": A.value ? "checked" : "unchecked",
|
|
56
|
+
onClick: N,
|
|
57
|
+
onKeydown: _(y(N, ["prevent"]), ["space"]),
|
|
58
|
+
onPointermove: t[0] ||= () => {
|
|
59
|
+
h(O).highlightedElement.value !== h(D) && h(O).highlightOnHover.value && h(O).changeHighlight(h(D), !1, !1);
|
|
60
|
+
}
|
|
61
|
+
}), {
|
|
62
|
+
default: g(() => [m(e.$slots, "default")]),
|
|
63
|
+
_: 3
|
|
64
|
+
}, 16, [
|
|
65
|
+
"id",
|
|
66
|
+
"tabindex",
|
|
67
|
+
"aria-selected",
|
|
68
|
+
"as",
|
|
69
|
+
"as-child",
|
|
70
|
+
"disabled",
|
|
71
|
+
"data-disabled",
|
|
72
|
+
"data-highlighted",
|
|
73
|
+
"data-state",
|
|
74
|
+
"onKeydown"
|
|
75
|
+
]), t, 1)]),
|
|
76
|
+
_: 3
|
|
77
|
+
}, 8, ["value"]));
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
//#endregion
|
|
81
|
+
export { C as ListboxItem_default, x as injectListboxItemContext };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useForwardExpose as e } from "../shared/useForwardExpose.js";
|
|
2
|
+
import { Primitive as t } from "../Primitive/Primitive.js";
|
|
3
|
+
import { injectListboxItemContext as n } from "./ListboxItem.js";
|
|
4
|
+
import { createBlock as r, createCommentVNode as i, defineComponent as a, mergeProps as o, openBlock as s, renderSlot as c, unref as l, withCtx as u } from "vue";
|
|
5
|
+
//#region node_modules/.pnpm/reka-ui@2.9.6_vue@3.5.32_typescript@5.8.3_/node_modules/reka-ui/dist/Listbox/ListboxItemIndicator.js
|
|
6
|
+
var d = /* @__PURE__ */ a({
|
|
7
|
+
__name: "ListboxItemIndicator",
|
|
8
|
+
props: {
|
|
9
|
+
asChild: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
required: !1
|
|
12
|
+
},
|
|
13
|
+
as: {
|
|
14
|
+
type: null,
|
|
15
|
+
required: !1,
|
|
16
|
+
default: "span"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
setup(a) {
|
|
20
|
+
let d = a;
|
|
21
|
+
e();
|
|
22
|
+
let f = n();
|
|
23
|
+
return (e, n) => l(f).isSelected.value ? (s(), r(l(t), o({
|
|
24
|
+
key: 0,
|
|
25
|
+
"aria-hidden": "true"
|
|
26
|
+
}, d), {
|
|
27
|
+
default: u(() => [c(e.$slots, "default")]),
|
|
28
|
+
_: 3
|
|
29
|
+
}, 16)) : i("v-if", !0);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
//#endregion
|
|
33
|
+
export { d as ListboxItemIndicator_default };
|