vft 0.0.310 → 0.0.311

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 (150) hide show
  1. package/es/components/affix/affix.d.ts +1 -1
  2. package/es/components/affix/affix.vue.d.ts +3 -3
  3. package/es/components/affix/index.d.ts +6 -6
  4. package/es/components/autocomplete/autocomplete.vue.d.ts +7 -7
  5. package/es/components/autocomplete/index.d.ts +20 -20
  6. package/es/components/avatar/index.d.ts +3 -3
  7. package/es/components/button/button.vue.d.ts +1 -1
  8. package/es/components/button/index.d.ts +21 -21
  9. package/es/components/button/use-button.d.ts +1 -1
  10. package/es/components/cascader/cascader.d.ts +2 -2
  11. package/es/components/cascader/cascader.vue.d.ts +6 -6
  12. package/es/components/checkbox/index.d.ts +36 -36
  13. package/es/components/col/col.vue.d.ts +1 -1
  14. package/es/components/col/index.d.ts +9 -9
  15. package/es/components/collapse/collapse-item.vue.d.ts +1 -1
  16. package/es/components/color-picker/index.d.ts +6 -6
  17. package/es/components/date-picker/date-picker.d.ts +6 -6
  18. package/es/components/date-picker/index.d.ts +12 -12
  19. package/es/components/date-picker/props/date-picker.d.ts +2 -2
  20. package/es/components/divider/index.d.ts +3 -3
  21. package/es/components/dropdown/dropdown-item-impl.vue.d.ts +59 -101
  22. package/es/components/dropdown/dropdown-item-impl.vue.js +2 -31
  23. package/es/components/dropdown/dropdown-item-impl.vue2.js +71 -57
  24. package/es/components/dropdown/dropdown-item.vue.d.ts +61 -0
  25. package/es/components/dropdown/dropdown-item.vue.js +2 -33
  26. package/es/components/dropdown/dropdown-item.vue2.js +60 -51
  27. package/es/components/dropdown/dropdown-menu.vue.d.ts +21 -20
  28. package/es/components/dropdown/dropdown-menu.vue.js +2 -22
  29. package/es/components/dropdown/dropdown-menu.vue2.js +70 -65
  30. package/es/components/dropdown/dropdown.vue.d.ts +1 -1
  31. package/es/components/dropdown/index.d.ts +596 -0
  32. package/es/components/dropdown/index.js +8 -8
  33. package/es/components/form/form-item.vue.d.ts +1 -1
  34. package/es/components/form/index.d.ts +39 -39
  35. package/es/components/input/index.d.ts +8 -8
  36. package/es/components/input/input.vue.d.ts +2 -2
  37. package/es/components/input-number/index.d.ts +3 -3
  38. package/es/components/input-number/input-number.vue.d.ts +1 -1
  39. package/es/components/input-tag/input-tag.d.ts +1 -1
  40. package/es/components/input-tag/input-tag.vue.d.ts +4 -4
  41. package/es/components/popconfirm/index.d.ts +15 -15
  42. package/es/components/popconfirm/popconfirm.vue.d.ts +1 -1
  43. package/es/components/popper/composables/use-content.d.ts +3 -3
  44. package/es/components/radio/index.d.ts +42 -42
  45. package/es/components/radio/radio.d.ts +1 -1
  46. package/es/components/radio/radio.vue.d.ts +5 -5
  47. package/es/components/roving-focus-group/roving-focus-group-impl.vue.d.ts +2 -2
  48. package/es/components/search/index.d.ts +3 -3
  49. package/es/components/search/search.vue.d.ts +1 -1
  50. package/es/components/segmented/index.d.ts +6 -6
  51. package/es/components/segmented/segmented.d.ts +1 -1
  52. package/es/components/segmented/segmented.vue.d.ts +3 -3
  53. package/es/components/select/index.d.ts +9 -9
  54. package/es/components/select/select.vue.d.ts +9 -9
  55. package/es/components/select/useSelect.d.ts +8 -8
  56. package/es/components/slider/index.d.ts +1 -1
  57. package/es/components/slider/slider.vue.d.ts +1 -1
  58. package/es/components/space/index.d.ts +3 -3
  59. package/es/components/space/space.d.ts +4 -4
  60. package/es/components/switch/index.d.ts +15 -15
  61. package/es/components/switch/switch.vue.d.ts +3 -3
  62. package/es/components/tabs/index.d.ts +2 -2
  63. package/es/components/time-picker/common/picker-range-trigger.vue.d.ts +2 -2
  64. package/es/components/time-picker/common/picker.vue.d.ts +6 -6
  65. package/es/components/time-picker/common/props.d.ts +2 -2
  66. package/es/components/time-picker/index.d.ts +12 -12
  67. package/es/components/time-picker/time-picker.d.ts +6 -6
  68. package/es/components/time-select/time-select.vue.d.ts +1 -1
  69. package/es/components/timeline/index.d.ts +6 -6
  70. package/es/components/tree/tree-node.vue.d.ts +27 -27
  71. package/es/components/upload/index.d.ts +18 -18
  72. package/es/hooks/use-popper/index.d.ts +3 -3
  73. package/es/package.json.d.ts +1 -1
  74. package/es/package.json.js +1 -1
  75. package/lib/components/affix/affix.d.ts +1 -1
  76. package/lib/components/affix/affix.vue.d.ts +3 -3
  77. package/lib/components/affix/index.d.ts +6 -6
  78. package/lib/components/autocomplete/autocomplete.vue.d.ts +7 -7
  79. package/lib/components/autocomplete/index.d.ts +20 -20
  80. package/lib/components/avatar/index.d.ts +3 -3
  81. package/lib/components/button/button.vue.d.ts +1 -1
  82. package/lib/components/button/index.d.ts +21 -21
  83. package/lib/components/button/use-button.d.ts +1 -1
  84. package/lib/components/cascader/cascader.d.ts +2 -2
  85. package/lib/components/cascader/cascader.vue.d.ts +6 -6
  86. package/lib/components/checkbox/index.d.ts +36 -36
  87. package/lib/components/col/col.vue.d.ts +1 -1
  88. package/lib/components/col/index.d.ts +9 -9
  89. package/lib/components/collapse/collapse-item.vue.d.ts +1 -1
  90. package/lib/components/color-picker/index.d.ts +6 -6
  91. package/lib/components/date-picker/date-picker.d.ts +6 -6
  92. package/lib/components/date-picker/index.d.ts +12 -12
  93. package/lib/components/date-picker/props/date-picker.d.ts +2 -2
  94. package/lib/components/divider/index.d.ts +3 -3
  95. package/lib/components/dropdown/dropdown-item-impl.vue.cjs +1 -1
  96. package/lib/components/dropdown/dropdown-item-impl.vue.d.ts +59 -101
  97. package/lib/components/dropdown/dropdown-item-impl.vue2.cjs +1 -1
  98. package/lib/components/dropdown/dropdown-item.vue.cjs +1 -1
  99. package/lib/components/dropdown/dropdown-item.vue.d.ts +61 -0
  100. package/lib/components/dropdown/dropdown-item.vue2.cjs +1 -1
  101. package/lib/components/dropdown/dropdown-menu.vue.cjs +1 -1
  102. package/lib/components/dropdown/dropdown-menu.vue.d.ts +21 -20
  103. package/lib/components/dropdown/dropdown-menu.vue2.cjs +1 -1
  104. package/lib/components/dropdown/dropdown.vue.d.ts +1 -1
  105. package/lib/components/dropdown/index.cjs +1 -1
  106. package/lib/components/dropdown/index.d.ts +596 -0
  107. package/lib/components/form/form-item.vue.d.ts +1 -1
  108. package/lib/components/form/index.d.ts +39 -39
  109. package/lib/components/input/index.d.ts +8 -8
  110. package/lib/components/input/input.vue.d.ts +2 -2
  111. package/lib/components/input-number/index.d.ts +3 -3
  112. package/lib/components/input-number/input-number.vue.d.ts +1 -1
  113. package/lib/components/input-tag/input-tag.d.ts +1 -1
  114. package/lib/components/input-tag/input-tag.vue.d.ts +4 -4
  115. package/lib/components/popconfirm/index.d.ts +15 -15
  116. package/lib/components/popconfirm/popconfirm.vue.d.ts +1 -1
  117. package/lib/components/popper/composables/use-content.d.ts +3 -3
  118. package/lib/components/radio/index.d.ts +42 -42
  119. package/lib/components/radio/radio.d.ts +1 -1
  120. package/lib/components/radio/radio.vue.d.ts +5 -5
  121. package/lib/components/roving-focus-group/roving-focus-group-impl.vue.d.ts +2 -2
  122. package/lib/components/search/index.d.ts +3 -3
  123. package/lib/components/search/search.vue.d.ts +1 -1
  124. package/lib/components/segmented/index.d.ts +6 -6
  125. package/lib/components/segmented/segmented.d.ts +1 -1
  126. package/lib/components/segmented/segmented.vue.d.ts +3 -3
  127. package/lib/components/select/index.d.ts +9 -9
  128. package/lib/components/select/select.vue.d.ts +9 -9
  129. package/lib/components/select/useSelect.d.ts +8 -8
  130. package/lib/components/slider/index.d.ts +1 -1
  131. package/lib/components/slider/slider.vue.d.ts +1 -1
  132. package/lib/components/space/index.d.ts +3 -3
  133. package/lib/components/space/space.d.ts +4 -4
  134. package/lib/components/switch/index.d.ts +15 -15
  135. package/lib/components/switch/switch.vue.d.ts +3 -3
  136. package/lib/components/tabs/index.d.ts +2 -2
  137. package/lib/components/time-picker/common/picker-range-trigger.vue.d.ts +2 -2
  138. package/lib/components/time-picker/common/picker.vue.d.ts +6 -6
  139. package/lib/components/time-picker/common/props.d.ts +2 -2
  140. package/lib/components/time-picker/index.d.ts +12 -12
  141. package/lib/components/time-picker/time-picker.d.ts +6 -6
  142. package/lib/components/time-select/time-select.vue.d.ts +1 -1
  143. package/lib/components/timeline/index.d.ts +6 -6
  144. package/lib/components/tree/tree-node.vue.d.ts +27 -27
  145. package/lib/components/upload/index.d.ts +18 -18
  146. package/lib/hooks/use-popper/index.d.ts +3 -3
  147. package/lib/package.json.cjs +1 -1
  148. package/lib/package.json.d.ts +1 -1
  149. package/package.json +5 -5
  150. package/web-types.json +1 -1
@@ -1,105 +1,63 @@
1
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
- command: {
3
- type: (ObjectConstructor | StringConstructor | NumberConstructor)[];
4
- default: () => {};
5
- };
6
- disabled: BooleanConstructor;
7
- divided: BooleanConstructor;
8
- textValue: StringConstructor;
9
- icon: StringConstructor;
10
- }>, {
11
- ns: {
12
- namespace: import("vue").ComputedRef<string>;
13
- b: (blockSuffix?: string) => string;
14
- e: (element?: string) => string;
15
- m: (modifier?: string) => string;
16
- be: (blockSuffix?: string, element?: string) => string;
17
- em: (element?: string, modifier?: string) => string;
18
- bm: (blockSuffix?: string, modifier?: string) => string;
19
- bem: (blockSuffix?: string, element?: string, modifier?: string) => string;
20
- is: {
21
- (name: string, state: boolean | undefined): string;
22
- (name: string): string;
23
- };
24
- cssVar: (object: Record<string, string>) => Record<string, string>;
25
- cssVarName: (name: string) => string;
26
- cssVarBlock: (object: Record<string, string>) => Record<string, string>;
27
- cssVarBlockName: (name: string) => string;
28
- };
29
- itemRef: (el: Element | import("vue").ComponentPublicInstance | null) => void;
30
- dataset: {
31
- "data-vft-collection-item": string;
32
- };
33
- role: import("vue").ComputedRef<string>;
34
- tabIndex: import("vue").Ref<number, number>;
35
- handleFocus: (e: Event) => void;
36
- handleKeydown: (event: KeyboardEvent) => void;
37
- handleMousedown: (e: Event) => void;
38
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "pointerleave" | "pointermove" | "clickimpl")[], "click" | "pointerleave" | "pointermove" | "clickimpl", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
39
- command: {
40
- type: (ObjectConstructor | StringConstructor | NumberConstructor)[];
41
- default: () => {};
42
- };
43
- disabled: BooleanConstructor;
44
- divided: BooleanConstructor;
45
- textValue: StringConstructor;
46
- icon: StringConstructor;
47
- }>> & Readonly<{
48
- onClick?: ((...args: any[]) => any) | undefined;
49
- onPointerleave?: ((...args: any[]) => any) | undefined;
50
- onPointermove?: ((...args: any[]) => any) | undefined;
51
- onClickimpl?: ((...args: any[]) => any) | undefined;
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;
52
33
  }>, {
53
34
  disabled: boolean;
54
- command: string | number | Record<string, any>;
35
+ icon: string;
36
+ command: object | string | number;
55
37
  divided: boolean;
56
- }, {}, {
57
- DropIcon: import("vft/es/utils").SFCWithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
58
- icon: {
59
- type: import("vue").PropType<string>;
60
- required: true;
61
- };
62
- size: {
63
- type: import("vue").PropType<string | number>;
64
- };
65
- color: {
66
- type: import("vue").PropType<string>;
67
- };
68
- rotate: {
69
- type: import("vue").PropType<boolean>;
70
- };
71
- rotateSpeed: {
72
- type: import("vue").PropType<number>;
73
- };
74
- pointer: {
75
- type: import("vue").PropType<boolean>;
76
- };
77
- hoverColor: {
78
- type: import("vue").PropType<string>;
79
- };
80
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
81
- icon: {
82
- type: import("vue").PropType<string>;
83
- required: true;
84
- };
85
- size: {
86
- type: import("vue").PropType<string | number>;
87
- };
88
- color: {
89
- type: import("vue").PropType<string>;
90
- };
91
- rotate: {
92
- type: import("vue").PropType<boolean>;
93
- };
94
- rotateSpeed: {
95
- type: import("vue").PropType<number>;
96
- };
97
- pointer: {
98
- type: import("vue").PropType<boolean>;
99
- };
100
- hoverColor: {
101
- type: import("vue").PropType<string>;
102
- };
103
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>> & Record<string, any>;
104
- }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
38
+ textValue: string;
39
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
40
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
105
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;
49
+ };
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;
62
+ };
63
+ };
@@ -1,33 +1,4 @@
1
- import m from "./dropdown-item-impl.vue2.js";
2
- import { resolveComponent as a, createElementBlock as i, openBlock as r, Fragment as t, createCommentVNode as l, createElementVNode as p, mergeProps as d, withModifiers as u, createBlock as f, renderSlot as b, normalizeProps as $ } from "vue";
3
- import w from "../../_virtual/_plugin-vue_export-helper.js";
4
- const k = ["aria-disabled", "tabindex", "role"];
5
- function v(e, o, y, F, M, P) {
6
- const s = a("drop-icon");
7
- return r(), i(t, null, [
8
- e.divided ? (r(), i("li", d({
9
- key: 0,
10
- role: "separator",
11
- class: e.ns.bem("menu", "item", "divided")
12
- }, e.$attrs), null, 16)) : l("", !0),
13
- p("li", d({ 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] = u((...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 ? (r(), f(s, $(d({ key: 0 }, e.icon)), null, 16)) : l("", !0),
26
- b(e.$slots, "default")
27
- ], 16, k)
28
- ], 64);
29
- }
30
- const K = /* @__PURE__ */ w(m, [["render", v]]);
1
+ import f from "./dropdown-item-impl.vue2.js";
31
2
  export {
32
- K as default
3
+ f as default
33
4
  };
@@ -1,76 +1,90 @@
1
- import { COLLECTION_ITEM_SIGN as O } from "../collection/collection.js";
2
- import { VftIcon as u } from "../icon/index.js";
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";
3
4
  import "../roving-focus-group/roving-focus-group.vue2.js";
4
- import { defineComponent as N, inject as e, computed as C } from "vue";
5
5
  import "../roving-focus-group/roving-focus-group-impl.vue2.js";
6
6
  import "../roving-focus-group/roving-focus-item.vue2.js";
7
- import { ROVING_FOCUS_ITEM_COLLECTION_INJECTION_KEY as T } from "../roving-focus-group/types.js";
8
- import { ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY as v } from "../roving-focus-group/tokens.js";
9
- import { EVENT_CODE as r } from "../../constants/aria.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";
10
10
  import "@vueuse/core";
11
- import "@vft/utils";
12
- import { composeEventHandlers as R } from "../../utils/event.js";
11
+ import { singleAttrToObj as G } from "@vft/utils";
12
+ import { composeEventHandlers as S } from "../../utils/event.js";
13
13
  import "../../utils/ns-cover.js";
14
14
  import "lodash-es";
15
- import { composeRefs as L } from "../../utils/vue/refs.js";
16
- import { useNamespace as K } from "../../hooks/use-namespace/index.js";
15
+ import { composeRefs as U } from "../../utils/vue/refs.js";
16
+ import { useNamespace as j } 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 D } from "./tokens.js";
21
- import { DROPDOWN_COLLECTION_ITEM_INJECTION_KEY as g } from "./types.js";
22
- const A = N({
23
- name: "DropdownItemImpl",
24
- components: {
25
- DropIcon: u
26
- },
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,
27
26
  props: {
28
- command: {
29
- type: [Object, String, Number],
30
- default: () => ({})
31
- },
32
- disabled: Boolean,
33
- divided: Boolean,
34
- textValue: String,
35
- icon: String
27
+ command: { default: () => ({}) },
28
+ disabled: { type: Boolean, default: !1 },
29
+ divided: { type: Boolean, default: !1 },
30
+ textValue: { default: "" },
31
+ icon: { default: "" }
36
32
  },
37
33
  emits: ["pointermove", "pointerleave", "click", "clickimpl"],
38
- setup(w, { emit: m }) {
39
- const i = K("dropdown"), { role: t } = e(D, void 0), { collectionItemRef: p } = e(
40
- g,
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,
41
37
  void 0
42
- ), { collectionItemRef: c } = e(
43
- T,
38
+ ), { collectionItemRef: b } = i(
39
+ Y,
44
40
  void 0
45
41
  ), {
46
- rovingFocusGroupItemRef: I,
47
- tabIndex: l,
48
- handleFocus: s,
49
- handleKeydown: a,
50
- handleMousedown: d
51
- } = e(v, void 0), _ = L(
52
- p,
53
- c,
54
- I
55
- ), f = C(() => t.value === "menu" ? "menuitem" : t.value === "navigation" ? "link" : "button"), E = R((o) => {
56
- const { code: n } = o;
57
- if (n === r.enter || n === r.space)
58
- return o.preventDefault(), o.stopImmediatePropagation(), m("clickimpl", o), !0;
59
- }, a);
60
- return {
61
- ns: i,
62
- itemRef: _,
63
- dataset: {
64
- [O]: ""
65
- },
66
- role: f,
67
- tabIndex: l,
68
- handleFocus: s,
69
- handleKeydown: E,
70
- handleMousedown: d
71
- };
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));
72
86
  }
73
87
  });
74
88
  export {
75
- A as default
89
+ Ee as default
76
90
  };
@@ -0,0 +1,61 @@
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: PointerEvent) => void;
21
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
22
+ command: () => {};
23
+ disabled: boolean;
24
+ divided: boolean;
25
+ textValue: string;
26
+ icon: string;
27
+ }>>> & Readonly<{
28
+ onClick?: ((event: PointerEvent) => any) | undefined;
29
+ onPointerleave?: ((event: PointerEvent) => any) | undefined;
30
+ onPointermove?: ((event: PointerEvent) => any) | undefined;
31
+ }>, {
32
+ disabled: boolean;
33
+ icon: string;
34
+ command: object | string | number;
35
+ divided: boolean;
36
+ textValue: string;
37
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
38
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
39
+ export default _default;
40
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
41
+ type __VLS_TypePropsToRuntimeProps<T> = {
42
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
43
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
44
+ } : {
45
+ type: import('vue').PropType<T[K]>;
46
+ required: true;
47
+ };
48
+ };
49
+ type __VLS_WithDefaults<P, D> = {
50
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
51
+ default: D[K];
52
+ }> : P[K];
53
+ };
54
+ type __VLS_Prettify<T> = {
55
+ [K in keyof T]: T[K];
56
+ } & {};
57
+ type __VLS_WithTemplateSlots<T, S> = T & {
58
+ new (): {
59
+ $slots: S;
60
+ };
61
+ };
@@ -1,35 +1,4 @@
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]]);
1
+ import f from "./dropdown-item.vue2.js";
33
2
  export {
34
- k as default
3
+ f as default
35
4
  };
@@ -1,77 +1,86 @@
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
2
  import "../roving-focus-group/roving-focus-group.vue2.js";
2
- import { defineComponent as g, getCurrentInstance as P, ref as h, computed as d, unref as w, inject as D } from "vue";
3
3
  import "../roving-focus-group/roving-focus-group-impl.vue2.js";
4
- import b from "../roving-focus-group/roving-focus-item.vue.js";
4
+ import N 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 i, whenMouse as a } from "../../utils/event.js";
8
+ import { composeEventHandlers as l, whenMouse as c } from "../../utils/event.js";
9
9
  import "../../utils/ns-cover.js";
10
10
  import "lodash-es";
11
- import k from "./dropdown-item-impl.vue.js";
12
- import { DROPDOWN_INJECTION_KEY as E } from "./tokens.js";
13
- import { VftCollectionItem as O } from "./types.js";
14
- import { useDropdown as _ } from "./useDropdown.js";
15
- const J = g({
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({
16
16
  name: "VftDropdownItem",
17
- components: {
18
- DropdownCollectionItem: O,
19
- RovingFocusItem: b,
20
- DropdownItemImpl: k
21
- },
22
- inheritAttrs: !1,
17
+ inheritAttrs: !1
18
+ }), X = /* @__PURE__ */ u({
19
+ ...M,
23
20
  props: {
24
- command: {
25
- type: [Object, String, Number],
26
- default: () => ({})
27
- },
28
- disabled: Boolean,
29
- divided: Boolean,
30
- textValue: String,
31
- icon: String
21
+ command: { default: () => ({}) },
22
+ disabled: { type: Boolean, default: !1 },
23
+ divided: { type: Boolean, default: !1 },
24
+ textValue: { default: "" },
25
+ icon: { default: "" }
32
26
  },
33
27
  emits: ["pointermove", "pointerleave", "click"],
34
- setup(t, { emit: n, attrs: c }) {
35
- const { elDropdown: o } = _(), l = P(), s = h(null), p = d(() => w(s)?.textContent ?? ""), { onItemEnter: u, onItemLeave: m } = D(
36
- E,
37
- void 0
38
- ), f = i(
39
- (e) => (n("pointermove", e), e.defaultPrevented),
40
- a((e) => {
41
- if (t.disabled) {
42
- m(e);
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),
31
+ c((e) => {
32
+ if (o.disabled) {
33
+ d(e);
43
34
  return;
44
35
  }
45
- const r = e.currentTarget;
46
- r === document.activeElement || r.contains(document.activeElement) || (u(e), e.defaultPrevented || r?.focus());
36
+ const n = e.currentTarget;
37
+ n === document.activeElement || n.contains(document.activeElement) || (b(e), e.defaultPrevented || n?.focus());
47
38
  })
48
- ), v = i(
49
- (e) => (n("pointerleave", e), e.defaultPrevented),
50
- a((e) => {
51
- m(e);
39
+ ), h = l(
40
+ (e) => (r("pointerleave", e), e.defaultPrevented),
41
+ c((e) => {
42
+ d(e);
52
43
  })
53
- ), I = i(
44
+ ), I = l(
54
45
  (e) => {
55
- if (!t.disabled)
56
- return n("click", e), e.type !== "keydown" && e.defaultPrevented;
46
+ if (!o.disabled)
47
+ return r("click", e), e.type !== "keydown" && e.defaultPrevented;
57
48
  },
58
49
  (e) => {
59
- if (t.disabled) {
50
+ if (o.disabled) {
60
51
  e.stopImmediatePropagation();
61
52
  return;
62
53
  }
63
- o?.hideOnClick?.value && o.handleClick?.(), o.commandHandler?.(t.command, l, e);
54
+ i?.hideOnClick?.value && i.handleClick?.(), i.commandHandler?.(o.command, P, e);
64
55
  }
65
- ), C = d(() => ({ ...t, ...c }));
66
- return {
67
- handleClick: I,
68
- handlePointerMove: f,
69
- handlePointerLeave: v,
70
- textContent: p,
71
- propsAndAttrs: C
72
- };
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"]));
73
82
  }
74
83
  });
75
84
  export {
76
- J as default
85
+ X as default
77
86
  };
@@ -1,22 +1,23 @@
1
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
- onKeydown: {
3
- type: FunctionConstructor;
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;
4
17
  };
5
- }>, {
6
- size: import("vue").ComputedRef<string> | undefined;
7
- rovingFocusGroupRootStyle: import("vue").Ref<import("vue").StyleValue, import("vue").StyleValue>;
8
- tabIndex: import("vue").Ref<number, number>;
9
- dropdownKls: import("vue").ComputedRef<string[]>;
10
- role: import("vue").ComputedRef<string>;
11
- triggerId: import("vue").ComputedRef<string>;
12
- dropdownListWrapperRef: (el: Element | import("vue").ComponentPublicInstance | null) => void;
13
- handleKeydown: (e: KeyboardEvent) => void;
14
- onBlur: (e: Event) => void;
15
- onFocus: (e: FocusEvent) => void;
16
- onMousedown: (e: Event) => void;
17
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
18
- onKeydown: {
19
- type: FunctionConstructor;
18
+ };
19
+ type __VLS_WithTemplateSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
20
22
  };
21
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
22
- export default _default;
23
+ };