vft 0.0.344 → 0.0.346

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.
Files changed (67) hide show
  1. package/dist/index.css +1 -1
  2. package/es/components/carousel/use-carousel.js +1 -1
  3. package/es/components/dropdown/dropdown-item-impl.vue.d.ts +106 -60
  4. package/es/components/dropdown/dropdown-item-impl.vue.js +34 -2
  5. package/es/components/dropdown/dropdown-item-impl.vue2.js +50 -72
  6. package/es/components/dropdown/dropdown-item.vue.js +33 -2
  7. package/es/components/dropdown/dropdown-item.vue2.js +40 -61
  8. package/es/components/dropdown/dropdown-menu.vue.d.ts +26 -21
  9. package/es/components/dropdown/dropdown-menu.vue.js +22 -2
  10. package/es/components/dropdown/dropdown-menu.vue2.js +68 -76
  11. package/es/components/dropdown/dropdown.js +182 -0
  12. package/es/components/dropdown/dropdown.vue.js +126 -2
  13. package/es/components/dropdown/dropdown.vue2.js +114 -233
  14. package/es/components/dropdown/index.js +13 -12
  15. package/es/components/dropdown/instance.d.ts +2 -0
  16. package/es/components/dropdown/instance.js +1 -0
  17. package/es/components/dropdown/tokens.d.ts +5 -4
  18. package/es/components/dropdown/tokens.js +3 -2
  19. package/es/components/dropdown/useDropdown.d.ts +1 -2
  20. package/es/components/dropdown/useDropdown.js +10 -51
  21. package/es/components/index.js +179 -178
  22. package/es/components/input/input.vue2.js +4 -4
  23. package/es/components/input-tag/composables/use-input-tag.js +1 -1
  24. package/es/components/roving-focus-group/index.js +11 -11
  25. package/es/components/roving-focus-group/roving-focus-group.vue.js +5 -5
  26. package/es/components/super-form/super-form-item.vue2.js +1 -1
  27. package/es/components/super-form/use/helper.js +1 -1
  28. package/es/index.js +247 -246
  29. package/es/package.json.d.ts +1 -1
  30. package/es/package.json.js +1 -1
  31. package/es/utils/vue/vnode.js +1 -1
  32. package/lib/components/dropdown/dropdown-item-impl.vue.cjs +1 -1
  33. package/lib/components/dropdown/dropdown-item-impl.vue.d.ts +106 -60
  34. package/lib/components/dropdown/dropdown-item-impl.vue2.cjs +1 -1
  35. package/lib/components/dropdown/dropdown-item.vue.cjs +1 -1
  36. package/lib/components/dropdown/dropdown-item.vue2.cjs +1 -1
  37. package/lib/components/dropdown/dropdown-menu.vue.cjs +1 -1
  38. package/lib/components/dropdown/dropdown-menu.vue.d.ts +26 -21
  39. package/lib/components/dropdown/dropdown-menu.vue2.cjs +1 -1
  40. package/lib/components/dropdown/dropdown.cjs +1 -0
  41. package/lib/components/dropdown/dropdown.vue.cjs +1 -1
  42. package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
  43. package/lib/components/dropdown/index.cjs +1 -1
  44. package/lib/components/dropdown/instance.cjs +1 -0
  45. package/lib/components/dropdown/instance.d.ts +2 -0
  46. package/lib/components/dropdown/tokens.cjs +1 -1
  47. package/lib/components/dropdown/tokens.d.ts +5 -4
  48. package/lib/components/dropdown/useDropdown.cjs +1 -1
  49. package/lib/components/dropdown/useDropdown.d.ts +1 -2
  50. package/lib/components/index.cjs +1 -1
  51. package/lib/components/input/input.vue2.cjs +1 -1
  52. package/lib/index.cjs +1 -1
  53. package/lib/package.json.cjs +1 -1
  54. package/lib/package.json.d.ts +1 -1
  55. package/package.json +5 -5
  56. package/theme-style/index.css +1 -1
  57. package/theme-style/src/dropdown.scss +49 -45
  58. package/theme-style/vft-dropdown.css +1 -1
  59. package/web-types.json +1 -1
  60. package/es/components/dropdown/dropdown-item.vue.d.ts +0 -61
  61. package/es/components/dropdown/dropdown.vue.d.ts +0 -86
  62. package/es/components/dropdown/index.d.ts +0 -596
  63. package/es/components/dropdown/types.js +0 -21
  64. package/lib/components/dropdown/dropdown-item.vue.d.ts +0 -61
  65. package/lib/components/dropdown/dropdown.vue.d.ts +0 -86
  66. package/lib/components/dropdown/index.d.ts +0 -596
  67. package/lib/components/dropdown/types.cjs +0 -1
@@ -10,7 +10,7 @@ import "../../hooks/use-model-toggle/index.js";
10
10
  import { useOrderedChildren as Ie } from "../../hooks/use-ordered-children/index.js";
11
11
  import "@popperjs/core";
12
12
  import "../../hooks/use-z-index/index.js";
13
- import { CAROUSEL_ITEM_NAME as H, carouselContextKey as ge } from "./constants.js";
13
+ import { carouselContextKey as ge, CAROUSEL_ITEM_NAME as H } from "./constants.js";
14
14
  const L = 300, _e = (t, O, M) => {
15
15
  const {
16
16
  children: o,
@@ -1,63 +1,109 @@
1
- interface Props {
2
- command?: object | string | number;
3
- disabled?: boolean;
4
- divided?: boolean;
5
- textValue?: string;
6
- icon?: string;
7
- }
8
- declare function __VLS_template(): {
9
- default?(_: {}): any;
10
- };
11
- declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
12
- command: () => {};
13
- disabled: boolean;
14
- divided: boolean;
15
- textValue: string;
16
- icon: string;
17
- }>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
- pointermove: (event: PointerEvent) => void;
19
- pointerleave: (event: PointerEvent) => void;
20
- click: (event: MouseEvent) => void;
21
- clickimpl: (event: MouseEvent) => void;
22
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
23
- command: () => {};
24
- disabled: boolean;
25
- divided: boolean;
26
- textValue: string;
27
- icon: string;
28
- }>>> & Readonly<{
29
- onClick?: ((event: MouseEvent) => any) | undefined;
30
- onPointerleave?: ((event: PointerEvent) => any) | undefined;
31
- onPointermove?: ((event: PointerEvent) => any) | undefined;
32
- onClickimpl?: ((event: MouseEvent) => any) | undefined;
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ readonly command: import("vft/es/utils").EpPropFinalized<readonly [ObjectConstructor, StringConstructor, NumberConstructor], unknown, unknown, () => {}, boolean>;
3
+ readonly disabled: BooleanConstructor;
4
+ readonly divided: BooleanConstructor;
5
+ readonly textValue: StringConstructor;
6
+ readonly icon: {
7
+ readonly type: import("vue").PropType<string>;
8
+ readonly required: false;
9
+ readonly validator: ((val: unknown) => boolean) | undefined;
10
+ __epPropKey: true;
11
+ };
33
12
  }>, {
34
- disabled: boolean;
35
- icon: string;
36
- command: object | string | number;
37
- divided: boolean;
38
- textValue: string;
39
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
40
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
41
- export default _default;
42
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
43
- type __VLS_TypePropsToRuntimeProps<T> = {
44
- [K in keyof T]-?: {} extends Pick<T, K> ? {
45
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
46
- } : {
47
- type: import('vue').PropType<T[K]>;
48
- required: true;
13
+ ns: {
14
+ namespace: import("vue").ComputedRef<string>;
15
+ b: (blockSuffix?: string) => string;
16
+ e: (element?: string) => string;
17
+ m: (modifier?: string) => string;
18
+ be: (blockSuffix?: string, element?: string) => string;
19
+ em: (element?: string, modifier?: string) => string;
20
+ bm: (blockSuffix?: string, modifier?: string) => string;
21
+ bem: (blockSuffix?: string, element?: string, modifier?: string) => string;
22
+ is: {
23
+ (name: string, state: boolean | undefined): string;
24
+ (name: string): string;
25
+ };
26
+ cssVar: (object: Record<string, string>) => Record<string, string>;
27
+ cssVarName: (name: string) => string;
28
+ cssVarBlock: (object: Record<string, string>) => Record<string, string>;
29
+ cssVarBlockName: (name: string) => string;
30
+ };
31
+ itemRef: (el: Element | import("vue").ComponentPublicInstance | null) => void;
32
+ dataset: {
33
+ "data-vft-collection-item": string;
49
34
  };
50
- };
51
- type __VLS_WithDefaults<P, D> = {
52
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
53
- default: D[K];
54
- }> : P[K];
55
- };
56
- type __VLS_Prettify<T> = {
57
- [K in keyof T]: T[K];
58
- } & {};
59
- type __VLS_WithTemplateSlots<T, S> = T & {
60
- new (): {
61
- $slots: S;
35
+ role: import("vue").ComputedRef<string>;
36
+ tabIndex: import("vue").Ref<number, number>;
37
+ handleFocus: (e: Event) => void;
38
+ handleKeydown: (event: KeyboardEvent) => void;
39
+ handleMousedown: (e: Event) => void;
40
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "pointerleave" | "pointermove" | "clickimpl")[], "click" | "pointerleave" | "pointermove" | "clickimpl", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
41
+ readonly command: import("vft/es/utils").EpPropFinalized<readonly [ObjectConstructor, StringConstructor, NumberConstructor], unknown, unknown, () => {}, boolean>;
42
+ readonly disabled: BooleanConstructor;
43
+ readonly divided: BooleanConstructor;
44
+ readonly textValue: StringConstructor;
45
+ readonly icon: {
46
+ readonly type: import("vue").PropType<string>;
47
+ readonly required: false;
48
+ readonly validator: ((val: unknown) => boolean) | undefined;
49
+ __epPropKey: true;
62
50
  };
63
- };
51
+ }>> & Readonly<{
52
+ onClick?: ((...args: any[]) => any) | undefined;
53
+ onPointerleave?: ((...args: any[]) => any) | undefined;
54
+ onPointermove?: ((...args: any[]) => any) | undefined;
55
+ onClickimpl?: ((...args: any[]) => any) | undefined;
56
+ }>, {
57
+ readonly disabled: boolean;
58
+ readonly command: import("vft/es/utils").EpPropMergeType<readonly [ObjectConstructor, StringConstructor, NumberConstructor], unknown, unknown>;
59
+ readonly divided: boolean;
60
+ }, {}, {
61
+ VftIcon: import("vft/es/utils").SFCWithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
62
+ icon: {
63
+ type: import("vue").PropType<string>;
64
+ required: true;
65
+ };
66
+ size: {
67
+ type: import("vue").PropType<string | number>;
68
+ };
69
+ color: {
70
+ type: import("vue").PropType<string>;
71
+ };
72
+ rotate: {
73
+ type: import("vue").PropType<boolean>;
74
+ };
75
+ rotateSpeed: {
76
+ type: import("vue").PropType<number>;
77
+ };
78
+ pointer: {
79
+ type: import("vue").PropType<boolean>;
80
+ };
81
+ hoverColor: {
82
+ type: import("vue").PropType<string>;
83
+ };
84
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
85
+ icon: {
86
+ type: import("vue").PropType<string>;
87
+ required: true;
88
+ };
89
+ size: {
90
+ type: import("vue").PropType<string | number>;
91
+ };
92
+ color: {
93
+ type: import("vue").PropType<string>;
94
+ };
95
+ rotate: {
96
+ type: import("vue").PropType<boolean>;
97
+ };
98
+ rotateSpeed: {
99
+ type: import("vue").PropType<number>;
100
+ };
101
+ pointer: {
102
+ type: import("vue").PropType<boolean>;
103
+ };
104
+ hoverColor: {
105
+ type: import("vue").PropType<string>;
106
+ };
107
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>> & Record<string, any>;
108
+ }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
109
+ export default _default;
@@ -1,4 +1,36 @@
1
- import f from "./dropdown-item-impl.vue2.js";
1
+ import s from "./dropdown-item-impl.vue2.js";
2
+ import { resolveComponent as t, createElementBlock as r, openBlock as i, Fragment as m, createCommentVNode as d, createElementVNode as a, normalizeClass as p, mergeProps as u, withModifiers as f, createBlock as b, renderSlot as v } from "vue";
3
+ import $ from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const w = ["aria-disabled", "tabindex", "role"];
5
+ function k(e, o, y, C, F, M) {
6
+ const l = t("vft-icon");
7
+ return i(), r(m, null, [
8
+ e.divided ? (i(), r("li", {
9
+ key: 0,
10
+ role: "separator",
11
+ class: p(e.ns.bem("menu", "item", "divided"))
12
+ }, null, 2)) : d("", !0),
13
+ a("li", u({ ref: e.itemRef }, { ...e.dataset, ...e.$attrs }, {
14
+ "aria-disabled": e.disabled,
15
+ class: [e.ns.be("menu", "item"), e.ns.is("disabled", e.disabled)],
16
+ tabindex: e.tabIndex,
17
+ role: e.role,
18
+ onClick: o[0] || (o[0] = (n) => e.$emit("clickimpl", n)),
19
+ onFocus: o[1] || (o[1] = (...n) => e.handleFocus && e.handleFocus(...n)),
20
+ onKeydown: o[2] || (o[2] = f((...n) => e.handleKeydown && e.handleKeydown(...n), ["self"])),
21
+ onMousedown: o[3] || (o[3] = (...n) => e.handleMousedown && e.handleMousedown(...n)),
22
+ onPointermove: o[4] || (o[4] = (n) => e.$emit("pointermove", n)),
23
+ onPointerleave: o[5] || (o[5] = (n) => e.$emit("pointerleave", n))
24
+ }), [
25
+ e.icon ? (i(), b(l, {
26
+ key: 0,
27
+ icon: "icon"
28
+ })) : d("", !0),
29
+ v(e.$slots, "default")
30
+ ], 16, w)
31
+ ], 64);
32
+ }
33
+ const P = /* @__PURE__ */ $(s, [["render", k]]);
2
34
  export {
3
- f as default
35
+ P as default
4
36
  };
@@ -1,90 +1,68 @@
1
- import { defineComponent as c, computed as m, inject as i, createElementBlock as f, openBlock as l, Fragment as y, createCommentVNode as I, createElementVNode as P, mergeProps as s, unref as t, withModifiers as g, createBlock as D, renderSlot as F, normalizeProps as V } from "vue";
2
- import { COLLECTION_ITEM_SIGN as $ } from "../collection/collection.js";
3
- import { VftIcon as J } from "../icon/index.js";
1
+ import { defineComponent as f, inject as e, computed as O } from "vue";
4
2
  import "../roving-focus-group/roving-focus-group.vue2.js";
5
3
  import "../roving-focus-group/roving-focus-group-impl.vue2.js";
6
4
  import "../roving-focus-group/roving-focus-item.vue2.js";
7
- import { ROVING_FOCUS_ITEM_COLLECTION_INJECTION_KEY as Y } from "../roving-focus-group/types.js";
8
- import { ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY as B } from "../roving-focus-group/tokens.js";
9
- import { EVENT_CODE as E } from "../../constants/aria.js";
5
+ import { ROVING_FOCUS_ITEM_COLLECTION_INJECTION_KEY as u } from "../roving-focus-group/types.js";
6
+ import { ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY as N } from "../roving-focus-group/tokens.js";
7
+ import { EVENT_CODE as t } from "../../constants/aria.js";
8
+ import { COLLECTION_ITEM_SIGN as C } from "../collection/collection.js";
9
+ import { VftIcon as T } from "../icon/index.js";
10
10
  import "@vueuse/core";
11
- import { singleAttrToObj as G } from "@vft/utils";
12
- import { composeEventHandlers as S } from "../../utils/event.js";
11
+ import "@vft/utils";
12
+ import { composeEventHandlers as v } from "../../utils/event.js";
13
13
  import "../config-provider/hooks/use-global-config.js";
14
14
  import "lodash-es";
15
- import { composeRefs as U } from "../../utils/vue/refs.js";
16
- import { useNamespace as j } from "../../hooks/use-namespace/index.js";
15
+ import { composeRefs as R } from "../../utils/vue/refs.js";
16
+ import { useNamespace as L } from "../../hooks/use-namespace/index.js";
17
17
  import "../../hooks/use-model-toggle/index.js";
18
18
  import "@popperjs/core";
19
19
  import "../../hooks/use-z-index/index.js";
20
- import { DROPDOWN_INJECTION_KEY as W } from "./tokens.js";
21
- import { DROPDOWN_COLLECTION_ITEM_INJECTION_KEY as z } from "./types.js";
22
- const A = ["aria-disabled", "tabindex", "role"], H = c({
23
- name: "DropdownItemImpl"
24
- }), Ee = /* @__PURE__ */ c({
25
- ...H,
26
- props: {
27
- command: { default: () => ({}) },
28
- disabled: { type: Boolean, default: !1 },
29
- divided: { type: Boolean, default: !1 },
30
- textValue: { default: "" },
31
- icon: { default: "" }
20
+ import { dropdownItemProps as K, DROPDOWN_COLLECTION_ITEM_INJECTION_KEY as w } from "./dropdown.js";
21
+ import { DROPDOWN_INJECTION_KEY as D } from "./tokens.js";
22
+ const B = f({
23
+ name: "DropdownItemImpl",
24
+ components: {
25
+ VftIcon: T
32
26
  },
27
+ props: K,
33
28
  emits: ["pointermove", "pointerleave", "click", "clickimpl"],
34
- setup(O, { emit: N }) {
35
- const C = O, v = N, r = j("dropdown"), T = m(() => G(C.icon, "icon")), { role: d } = i(W, void 0), { collectionItemRef: _ } = i(
36
- z,
29
+ setup(M, { emit: m }) {
30
+ const n = L("dropdown"), { role: r } = e(D, void 0), { collectionItemRef: i } = e(
31
+ w,
37
32
  void 0
38
- ), { collectionItemRef: b } = i(
39
- Y,
33
+ ), { collectionItemRef: p } = e(
34
+ u,
40
35
  void 0
41
36
  ), {
42
- rovingFocusGroupItemRef: R,
43
- tabIndex: k,
44
- handleFocus: a,
45
- handleKeydown: w,
46
- handleMousedown: p
47
- } = i(B, void 0), K = U(
48
- _,
49
- b,
50
- R
51
- ), L = m(() => d.value === "menu" ? "menuitem" : d.value === "navigation" ? "link" : "button"), u = S((e) => {
52
- const { code: o } = e;
53
- if (o === E.enter || o === E.space)
54
- return e.preventDefault(), e.stopImmediatePropagation(), v("clickimpl", e), !0;
55
- }, w), M = m(() => ({
56
- [$]: ""
57
- }));
58
- return (e, o) => (l(), f(y, null, [
59
- e.divided ? (l(), f("li", s({
60
- key: 0,
61
- role: "separator",
62
- class: t(r).bem("menu", "item", "divided")
63
- }, e.$attrs), null, 16)) : I("", !0),
64
- P("li", s({ ref: t(K) }, { ...M.value, ...e.$attrs }, {
65
- "aria-disabled": e.disabled,
66
- class: [t(r).be("menu", "item"), t(r).is("disabled", e.disabled)],
67
- tabindex: t(k),
68
- role: L.value,
69
- onClick: o[0] || (o[0] = (n) => e.$emit("clickimpl", n)),
70
- onFocus: o[1] || (o[1] = //@ts-ignore
71
- (...n) => t(a) && t(a)(...n)),
72
- onKeydown: o[2] || (o[2] = g(
73
- //@ts-ignore
74
- (...n) => t(u) && t(u)(...n),
75
- ["self"]
76
- )),
77
- onMousedown: o[3] || (o[3] = //@ts-ignore
78
- (...n) => t(p) && t(p)(...n)),
79
- onPointermove: o[4] || (o[4] = (n) => e.$emit("pointermove", n)),
80
- onPointerleave: o[5] || (o[5] = (n) => e.$emit("pointerleave", n))
81
- }), [
82
- e.icon ? (l(), D(t(J), V(s({ key: 0 }, T.value)), null, 16)) : I("", !0),
83
- F(e.$slots, "default")
84
- ], 16, A)
85
- ], 64));
37
+ rovingFocusGroupItemRef: I,
38
+ tabIndex: c,
39
+ handleFocus: s,
40
+ handleKeydown: l,
41
+ handleMousedown: d
42
+ } = e(N, void 0), a = R(
43
+ i,
44
+ p,
45
+ I
46
+ ), E = O(() => r.value === "menu" ? "menuitem" : r.value === "navigation" ? "link" : "button"), _ = v((o) => {
47
+ if ([t.enter, t.numpadEnter, t.space].includes(
48
+ o.code
49
+ ))
50
+ return o.preventDefault(), o.stopImmediatePropagation(), m("clickimpl", o), !0;
51
+ }, l);
52
+ return {
53
+ ns: n,
54
+ itemRef: a,
55
+ dataset: {
56
+ [C]: ""
57
+ },
58
+ role: E,
59
+ tabIndex: c,
60
+ handleFocus: s,
61
+ handleKeydown: _,
62
+ handleMousedown: d
63
+ };
86
64
  }
87
65
  });
88
66
  export {
89
- Ee as default
67
+ B as default
90
68
  };
@@ -1,4 +1,35 @@
1
- import f from "./dropdown-item.vue2.js";
1
+ import d from "./dropdown-item.vue2.js";
2
+ import { resolveComponent as o, createBlock as a, openBlock as p, withCtx as n, createVNode as t, mergeProps as m, renderSlot as s } from "vue";
3
+ import c from "../../_virtual/_plugin-vue_export-helper.js";
4
+ function f(e, u, _, v, P, b) {
5
+ const r = o("dropdown-item-impl"), l = o("roving-focus-item"), i = o("dropdown-collection-item");
6
+ return p(), a(i, {
7
+ disabled: e.disabled,
8
+ "text-value": e.textValue ?? e.textContent
9
+ }, {
10
+ default: n(() => [
11
+ t(l, {
12
+ focusable: !e.disabled
13
+ }, {
14
+ default: n(() => [
15
+ t(r, m(e.propsAndAttrs, {
16
+ onPointerleave: e.handlePointerLeave,
17
+ onPointermove: e.handlePointerMove,
18
+ onClickimpl: e.handleClick
19
+ }), {
20
+ default: n(() => [
21
+ s(e.$slots, "default")
22
+ ]),
23
+ _: 3
24
+ }, 16, ["onPointerleave", "onPointermove", "onClickimpl"])
25
+ ]),
26
+ _: 3
27
+ }, 8, ["focusable"])
28
+ ]),
29
+ _: 3
30
+ }, 8, ["disabled", "text-value"]);
31
+ }
32
+ const k = /* @__PURE__ */ c(d, [["render", f]]);
2
33
  export {
3
- f as default
34
+ k as default
4
35
  };
@@ -1,86 +1,65 @@
1
- import { defineComponent as u, useAttrs as w, getCurrentInstance as E, ref as x, computed as m, unref as t, inject as D, createBlock as V, openBlock as y, withCtx as a, createVNode as s, mergeProps as A, renderSlot as B } from "vue";
1
+ import { defineComponent as P, getCurrentInstance as w, ref as h, computed as d, unref as D, inject as k } from "vue";
2
2
  import "../roving-focus-group/roving-focus-group.vue2.js";
3
3
  import "../roving-focus-group/roving-focus-group-impl.vue2.js";
4
- import N from "../roving-focus-group/roving-focus-item.vue.js";
4
+ import E from "../roving-focus-group/roving-focus-item.vue.js";
5
5
  import "../roving-focus-group/types.js";
6
6
  import "@vueuse/core";
7
7
  import "@vft/utils";
8
- import { composeEventHandlers as l, whenMouse as c } from "../../utils/event.js";
8
+ import { composeEventHandlers as i, whenMouse as c } from "../../utils/event.js";
9
9
  import "../config-provider/hooks/use-global-config.js";
10
10
  import "lodash-es";
11
- import O from "./dropdown-item-impl.vue2.js";
12
- import { DROPDOWN_INJECTION_KEY as R } from "./tokens.js";
13
- import { VftCollectionItem as H } from "./types.js";
14
- import { useDropdown as L } from "./useDropdown.js";
15
- const M = u({
11
+ import g from "./dropdown-item-impl.vue.js";
12
+ import { useDropdown as _ } from "./useDropdown.js";
13
+ import { dropdownItemProps as O, VftCollectionItem as b } from "./dropdown.js";
14
+ import { DROPDOWN_INJECTION_KEY as x } from "./tokens.js";
15
+ const W = P({
16
16
  name: "VftDropdownItem",
17
- inheritAttrs: !1
18
- }), X = /* @__PURE__ */ u({
19
- ...M,
20
- props: {
21
- command: { default: () => ({}) },
22
- disabled: { type: Boolean, default: !1 },
23
- divided: { type: Boolean, default: !1 },
24
- textValue: { default: "" },
25
- icon: { default: "" }
17
+ components: {
18
+ DropdownCollectionItem: b,
19
+ RovingFocusItem: E,
20
+ DropdownItemImpl: g
26
21
  },
22
+ inheritAttrs: !1,
23
+ props: O,
27
24
  emits: ["pointermove", "pointerleave", "click"],
28
- setup(f, { emit: p }) {
29
- const o = f, r = p, v = w(), { elDropdown: i } = L(), P = E(), C = x(null), _ = m(() => t(C)?.textContent ?? ""), { onItemEnter: b, onItemLeave: d } = D(R, void 0), k = l(
30
- (e) => (r("pointermove", e), e.defaultPrevented),
25
+ setup(t, { emit: n, attrs: a }) {
26
+ const { elDropdown: o } = _(), l = w(), p = h(null), s = d(() => D(p)?.textContent ?? ""), { onItemEnter: f, onItemLeave: m } = k(
27
+ x,
28
+ void 0
29
+ ), u = i(
30
+ (e) => (n("pointermove", e), e.defaultPrevented),
31
31
  c((e) => {
32
- if (o.disabled) {
33
- d(e);
32
+ if (t.disabled) {
33
+ m(e);
34
34
  return;
35
35
  }
36
- const n = e.currentTarget;
37
- n === document.activeElement || n.contains(document.activeElement) || (b(e), e.defaultPrevented || n?.focus());
36
+ const r = e.currentTarget;
37
+ r === document.activeElement || r.contains(document.activeElement) || (f(e), e.defaultPrevented || r?.focus({
38
+ preventScroll: !0
39
+ }));
38
40
  })
39
- ), h = l(
40
- (e) => (r("pointerleave", e), e.defaultPrevented),
41
- c((e) => {
42
- d(e);
43
- })
44
- ), I = l(
41
+ ), v = i((e) => (n("pointerleave", e), e.defaultPrevented), c(m)), I = i(
45
42
  (e) => {
46
- if (!o.disabled)
47
- return r("click", e), e.type !== "keydown" && e.defaultPrevented;
43
+ if (!t.disabled)
44
+ return n("click", e), e.type !== "keydown" && e.defaultPrevented;
48
45
  },
49
46
  (e) => {
50
- if (o.disabled) {
47
+ if (t.disabled) {
51
48
  e.stopImmediatePropagation();
52
49
  return;
53
50
  }
54
- i?.hideOnClick?.value && i.handleClick?.(), i.commandHandler?.(o.command, P, e);
51
+ o?.hideOnClick?.value && o.handleClick?.(), o.commandHandler?.(t.command, l, e);
55
52
  }
56
- ), g = m(() => ({ ...o, ...v }));
57
- return (e, n) => (y(), V(t(H), {
58
- disabled: e.disabled,
59
- "text-value": e.textValue ?? _.value
60
- }, {
61
- default: a(() => [
62
- s(t(N), {
63
- focusable: !e.disabled
64
- }, {
65
- default: a(() => [
66
- s(O, A(g.value, {
67
- onPointerleave: t(h),
68
- onPointermove: t(k),
69
- onClickimpl: t(I)
70
- }), {
71
- default: a(() => [
72
- B(e.$slots, "default")
73
- ]),
74
- _: 3
75
- }, 16, ["onPointerleave", "onPointermove", "onClickimpl"])
76
- ]),
77
- _: 3
78
- }, 8, ["focusable"])
79
- ]),
80
- _: 3
81
- }, 8, ["disabled", "text-value"]));
53
+ ), C = d(() => ({ ...t, ...a }));
54
+ return {
55
+ handleClick: I,
56
+ handlePointerMove: u,
57
+ handlePointerLeave: v,
58
+ textContent: s,
59
+ propsAndAttrs: C
60
+ };
82
61
  }
83
62
  });
84
63
  export {
85
- X as default
64
+ W as default
86
65
  };
@@ -1,23 +1,28 @@
1
- interface Props {
2
- onKeydown?: (e: KeyboardEvent) => void;
3
- }
4
- declare function __VLS_template(): {
5
- default?(_: {}): any;
6
- };
7
- declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
8
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
9
- export default _default;
10
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
11
- type __VLS_TypePropsToRuntimeProps<T> = {
12
- [K in keyof T]-?: {} extends Pick<T, K> ? {
13
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
14
- } : {
15
- type: import('vue').PropType<T[K]>;
16
- required: true;
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ onKeydown: {
3
+ readonly type: import("vue").PropType<(e: KeyboardEvent) => void>;
4
+ readonly required: false;
5
+ readonly validator: ((val: unknown) => boolean) | undefined;
6
+ __epPropKey: true;
17
7
  };
18
- };
19
- type __VLS_WithTemplateSlots<T, S> = T & {
20
- new (): {
21
- $slots: S;
8
+ }>, {
9
+ size: import("vue").ComputedRef<string> | undefined;
10
+ rovingFocusGroupRootStyle: import("vue").Ref<import("vue").StyleValue, import("vue").StyleValue>;
11
+ tabIndex: import("vue").Ref<number, number>;
12
+ dropdownKls: import("vue").ComputedRef<string[]>;
13
+ role: any;
14
+ triggerId: import("vue").ComputedRef<string>;
15
+ dropdownListWrapperRef: (el: Element | import("vue").ComponentPublicInstance | null) => void;
16
+ handleKeydown: (e: KeyboardEvent) => void;
17
+ onBlur: (e: Event) => void;
18
+ onFocus: (e: FocusEvent) => void;
19
+ onMousedown: (e: Event) => void;
20
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
21
+ onKeydown: {
22
+ readonly type: import("vue").PropType<(e: KeyboardEvent) => void>;
23
+ readonly required: false;
24
+ readonly validator: ((val: unknown) => boolean) | undefined;
25
+ __epPropKey: true;
22
26
  };
23
- };
27
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
28
+ export default _default;
@@ -1,4 +1,24 @@
1
- import f from "./dropdown-menu.vue2.js";
1
+ import l from "./dropdown-menu.vue2.js";
2
+ import { createElementBlock as s, openBlock as d, withModifiers as n, normalizeStyle as i, normalizeClass as u, renderSlot as p } from "vue";
3
+ import a from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const f = ["role", "aria-labelledby"];
5
+ function t(o, e, m, w, y, b) {
6
+ return d(), s("ul", {
7
+ ref: o.dropdownListWrapperRef,
8
+ class: u(o.dropdownKls),
9
+ style: i(o.rovingFocusGroupRootStyle),
10
+ tabindex: -1,
11
+ role: o.role,
12
+ "aria-labelledby": o.triggerId,
13
+ onBlur: e[0] || (e[0] = (...r) => o.onBlur && o.onBlur(...r)),
14
+ onFocus: e[1] || (e[1] = (...r) => o.onFocus && o.onFocus(...r)),
15
+ onKeydown: e[2] || (e[2] = n((...r) => o.handleKeydown && o.handleKeydown(...r), ["self"])),
16
+ onMousedown: e[3] || (e[3] = n((...r) => o.onMousedown && o.onMousedown(...r), ["self"]))
17
+ }, [
18
+ p(o.$slots, "default")
19
+ ], 46, f);
20
+ }
21
+ const F = /* @__PURE__ */ a(l, [["render", t]]);
2
22
  export {
3
- f as default
23
+ F as default
4
24
  };