ep-craft 0.1.20 → 0.1.21

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 (203) hide show
  1. package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
  2. package/dist/components/button/EpButton.vue.d.ts +6 -6
  3. package/dist/components/button/EpButton.vue.js +122 -0
  4. package/dist/components/button/EpButton2.vue.js +4 -0
  5. package/dist/components/button/button.d.ts +3 -3
  6. package/dist/components/button/button.js +95 -0
  7. package/dist/components/button/index.d.ts +2 -2
  8. package/dist/components/button/index.js +3 -4
  9. package/dist/components/button/use-button-custom.js +66 -0
  10. package/dist/components/check-tag/EpCheckTag.vue.js +29 -0
  11. package/dist/components/check-tag/EpCheckTag2.vue.js +4 -0
  12. package/dist/components/check-tag/check-tag.js +20 -0
  13. package/dist/components/check-tag/index.d.ts +2 -2
  14. package/dist/components/check-tag/index.js +3 -4
  15. package/dist/components/collapse-transition/index.d.ts +20 -3
  16. package/dist/components/collapse-transition/index.js +6 -4
  17. package/dist/components/collapse-transition/src/collapse-transition.vue.d.ts +12 -0
  18. package/dist/components/collapse-transition/src/collapse-transition.vue.js +55 -0
  19. package/dist/components/collapse-transition/src/collapse-transition2.vue.js +4 -0
  20. package/dist/components/config-provider/src/constants.d.ts +14 -0
  21. package/dist/components/config-provider/src/hooks/use-global-config.d.ts +32 -0
  22. package/dist/components/focus-trap/index.d.ts +81 -0
  23. package/dist/components/focus-trap/index.js +19 -0
  24. package/dist/components/focus-trap/src/focus-trap.vue.d.ts +32 -0
  25. package/dist/components/focus-trap/src/focus-trap.vue.js +10 -0
  26. package/dist/components/focus-trap/src/focus-trap2.vue.js +164 -0
  27. package/dist/components/focus-trap/src/tokens.d.ts +13 -0
  28. package/dist/components/focus-trap/src/tokens.js +17 -0
  29. package/dist/components/focus-trap/src/utils.d.ts +29 -0
  30. package/dist/components/focus-trap/src/utils.js +83 -0
  31. package/dist/components/form/index.d.ts +3 -0
  32. package/dist/components/form/index.js +4 -2
  33. package/dist/components/form/src/constants.d.ts +4 -0
  34. package/dist/components/form/src/constants.js +4 -0
  35. package/dist/components/form/src/hooks/use-form-common-props.d.ts +6 -0
  36. package/dist/components/form/src/hooks/use-form-item.d.ts +19 -0
  37. package/dist/components/form/src/types.d.ts +24 -0
  38. package/dist/components/icon/index.d.ts +21 -3
  39. package/dist/components/icon/index.js +7 -4
  40. package/dist/components/icon/src/icon.d.ts +34 -0
  41. package/dist/components/icon/src/icon.js +16 -0
  42. package/dist/components/icon/src/icon.vue.d.ts +13 -0
  43. package/dist/components/icon/src/icon.vue.js +36 -0
  44. package/dist/components/icon/src/icon2.vue.js +4 -0
  45. package/dist/components/menu/menu.d.ts +2 -2
  46. package/dist/components/popper/index.d.ts +54 -3
  47. package/dist/components/popper/index.js +30 -5
  48. package/dist/components/popper/src/arrow.d.ts +30 -0
  49. package/dist/components/popper/src/arrow.js +14 -0
  50. package/dist/components/popper/src/arrow.vue.d.ts +7 -0
  51. package/dist/components/popper/src/arrow.vue.js +4 -0
  52. package/dist/components/popper/src/arrow2.vue.js +37 -0
  53. package/dist/components/popper/src/composables/index.d.ts +4 -0
  54. package/dist/components/popper/src/composables/use-content-dom.d.ts +40 -0
  55. package/dist/components/popper/src/composables/use-content-dom.js +45 -0
  56. package/dist/components/popper/src/composables/use-content.d.ts +77 -0
  57. package/dist/components/popper/src/composables/use-content.js +76 -0
  58. package/dist/components/popper/src/composables/use-focus-trap.d.ts +12 -0
  59. package/dist/components/popper/src/composables/use-focus-trap.js +29 -0
  60. package/dist/components/popper/src/constants.d.ts +23 -0
  61. package/dist/components/popper/src/constants.js +5 -0
  62. package/dist/components/popper/src/content.d.ts +234 -0
  63. package/dist/components/popper/src/content.js +129 -0
  64. package/dist/components/popper/src/content.vue.d.ts +61 -0
  65. package/dist/components/popper/src/content.vue.js +4 -0
  66. package/dist/components/popper/src/content2.vue.js +151 -0
  67. package/dist/components/popper/src/popper.d.ts +35 -0
  68. package/dist/components/popper/src/popper.js +22 -0
  69. package/dist/components/popper/src/popper.vue.d.ts +22 -0
  70. package/dist/components/popper/src/popper.vue.js +38 -0
  71. package/dist/components/popper/src/popper2.vue.js +4 -0
  72. package/dist/components/popper/src/trigger.d.ts +130 -0
  73. package/dist/components/popper/src/trigger.js +36 -0
  74. package/dist/components/popper/src/trigger.vue.d.ts +18 -0
  75. package/dist/components/popper/src/trigger.vue.js +4 -0
  76. package/dist/components/popper/src/trigger2.vue.js +134 -0
  77. package/dist/components/popper/src/utils.d.ts +48 -0
  78. package/dist/components/popper/src/utils.js +57 -0
  79. package/dist/components/slot/index.d.ts +3 -0
  80. package/dist/components/slot/src/only-child.d.ts +7 -0
  81. package/dist/components/slot/src/only-child.js +55 -0
  82. package/dist/components/tabs/tabs.d.ts +1 -1
  83. package/dist/components/tag/EpTag.vue.js +96 -0
  84. package/dist/components/tag/EpTag2.vue.js +4 -0
  85. package/dist/components/tag/index.d.ts +2 -2
  86. package/dist/components/tag/index.js +2 -3
  87. package/dist/components/tag/tag.js +38 -0
  88. package/dist/components/tooltip/index.d.ts +174 -3
  89. package/dist/components/tooltip/index.js +18 -5
  90. package/dist/components/tooltip/src/constants.d.ts +18 -0
  91. package/dist/components/tooltip/src/constants.js +4 -0
  92. package/dist/components/tooltip/src/content.d.ts +327 -0
  93. package/dist/components/tooltip/src/content.js +72 -0
  94. package/dist/components/tooltip/src/content.vue.d.ts +47 -0
  95. package/dist/components/tooltip/src/content.vue.js +188 -0
  96. package/dist/components/tooltip/src/content2.vue.js +4 -0
  97. package/dist/components/tooltip/src/tooltip.d.ts +346 -0
  98. package/dist/components/tooltip/src/tooltip.js +47 -0
  99. package/dist/components/tooltip/src/tooltip.vue.d.ts +90 -0
  100. package/dist/components/tooltip/src/tooltip.vue.js +236 -0
  101. package/dist/components/tooltip/src/tooltip2.vue.js +4 -0
  102. package/dist/components/tooltip/src/trigger.d.ts +94 -0
  103. package/dist/components/tooltip/src/trigger.js +41 -0
  104. package/dist/components/tooltip/src/trigger.vue.d.ts +26 -0
  105. package/dist/components/tooltip/src/trigger.vue.js +104 -0
  106. package/dist/components/tooltip/src/trigger2.vue.js +4 -0
  107. package/dist/components/tooltip/src/utils.d.ts +5 -0
  108. package/dist/components/tooltip/src/utils.js +9 -0
  109. package/dist/constants/aria.d.ts +17 -0
  110. package/dist/constants/aria.js +24 -0
  111. package/dist/constants/column-alignment.d.ts +2 -0
  112. package/dist/constants/date.d.ts +3 -0
  113. package/dist/constants/event.d.ts +3 -0
  114. package/dist/constants/form.d.ts +2 -0
  115. package/dist/constants/index.d.ts +7 -0
  116. package/dist/constants/key.d.ts +1 -0
  117. package/dist/constants/size.d.ts +7 -0
  118. package/dist/constants/size.js +4 -0
  119. package/dist/directives/click-outside/index.d.ts +3 -0
  120. package/dist/directives/index.d.ts +5 -0
  121. package/dist/directives/mousewheel/index.d.ts +11 -0
  122. package/dist/directives/repeat-click/index.d.ts +17 -0
  123. package/dist/directives/trap-focus/index.d.ts +9 -0
  124. package/dist/hooks/index.d.ts +17 -0
  125. package/dist/hooks/use-aria/index.d.ts +37 -0
  126. package/dist/hooks/use-aria/index.js +24 -0
  127. package/dist/hooks/use-delayed-toggle/index.d.ts +36 -0
  128. package/dist/hooks/use-delayed-toggle/index.js +63 -0
  129. package/dist/hooks/use-deprecated/index.d.ts +11 -0
  130. package/dist/hooks/use-empty-values/index.d.ts +29 -0
  131. package/dist/hooks/use-empty-values/index.js +23 -0
  132. package/dist/hooks/use-escape-keydown/index.d.ts +1 -0
  133. package/dist/hooks/use-escape-keydown/index.js +21 -0
  134. package/dist/hooks/use-forward-ref/index.d.ts +9 -0
  135. package/dist/hooks/use-forward-ref/index.js +23 -0
  136. package/dist/hooks/use-id/index.d.ts +8 -0
  137. package/dist/hooks/use-id/index.js +27 -0
  138. package/dist/hooks/use-locale/index.d.ts +17 -0
  139. package/dist/hooks/use-model-toggle/index.d.ts +46 -0
  140. package/dist/hooks/use-model-toggle/index.js +67 -0
  141. package/dist/hooks/use-namespace/index.d.ts +23 -0
  142. package/dist/hooks/use-namespace/index.js +45 -0
  143. package/dist/hooks/use-ordered-children/index.d.ts +14 -0
  144. package/dist/hooks/use-popper/index.d.ts +78 -0
  145. package/dist/hooks/use-popper/index.js +97 -0
  146. package/dist/hooks/use-popper-container/index.d.ts +8 -0
  147. package/dist/hooks/use-popper-container/index.js +26 -0
  148. package/dist/hooks/use-prop/index.d.ts +2 -0
  149. package/dist/hooks/use-size/index.d.ts +21 -0
  150. package/dist/hooks/use-size/index.js +8 -0
  151. package/dist/hooks/use-timeout/index.d.ts +4 -0
  152. package/dist/hooks/use-timeout/index.js +16 -0
  153. package/dist/hooks/use-z-index/index.d.ts +13 -0
  154. package/dist/hooks/use-z-index/index.js +27 -0
  155. package/dist/node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/button/index.js +2 -2
  156. package/dist/resolver.js +13 -12
  157. package/dist/utils/arrays.d.ts +6 -0
  158. package/dist/utils/arrays.js +5 -0
  159. package/dist/utils/browser.d.ts +4 -0
  160. package/dist/utils/browser.js +6 -0
  161. package/dist/utils/dom/aria.d.ts +26 -0
  162. package/dist/utils/dom/aria.js +26 -0
  163. package/dist/utils/dom/element.d.ts +3 -0
  164. package/dist/utils/dom/event.d.ts +8 -0
  165. package/dist/utils/dom/event.js +32 -0
  166. package/dist/utils/dom/index.d.ts +7 -0
  167. package/dist/utils/dom/position.d.ts +7 -0
  168. package/dist/utils/dom/scroll.d.ts +11 -0
  169. package/dist/utils/dom/style.d.ts +9 -0
  170. package/dist/utils/dom/style.js +15 -0
  171. package/dist/utils/easings.d.ts +1 -0
  172. package/dist/utils/error.d.ts +3 -0
  173. package/dist/utils/error.js +15 -0
  174. package/dist/utils/functions.d.ts +2 -0
  175. package/dist/utils/i18n.d.ts +4 -0
  176. package/dist/utils/index.d.ts +31 -0
  177. package/dist/utils/numbers.d.ts +6 -0
  178. package/dist/utils/objects.d.ts +7 -0
  179. package/dist/utils/raf.d.ts +2 -0
  180. package/dist/utils/rand.d.ts +12 -0
  181. package/dist/utils/strings.d.ts +8 -0
  182. package/dist/utils/throttleByRaf.d.ts +4 -0
  183. package/dist/utils/types.d.ts +9 -0
  184. package/dist/utils/types.js +16 -0
  185. package/dist/utils/typescript.d.ts +93 -0
  186. package/dist/utils/vue/global-node.d.ts +3 -0
  187. package/dist/utils/vue/icon.d.ts +27 -0
  188. package/dist/utils/vue/index.d.ts +9 -0
  189. package/dist/utils/vue/install.d.ts +7 -0
  190. package/dist/utils/vue/install.js +34 -0
  191. package/dist/utils/vue/props/index.d.ts +2 -0
  192. package/dist/utils/vue/props/runtime.d.ts +29 -0
  193. package/dist/utils/vue/props/runtime.js +36 -0
  194. package/dist/utils/vue/props/types.d.ts +85 -0
  195. package/dist/utils/vue/props/util.d.ts +7 -0
  196. package/dist/utils/vue/refs.d.ts +2 -0
  197. package/dist/utils/vue/size.d.ts +2 -0
  198. package/dist/utils/vue/typescript.d.ts +25 -0
  199. package/dist/utils/vue/validator.d.ts +3 -0
  200. package/dist/utils/vue/vnode.d.ts +48 -0
  201. package/dist/vendored-components.d.ts +13 -0
  202. package/dist/vendored-components.js +22 -0
  203. package/package.json +11 -3
@@ -0,0 +1,81 @@
1
+ import ElFocusTrap from './src/focus-trap.vue';
2
+ export { ElFocusTrap };
3
+ export declare const EpFocusTrap: {
4
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
5
+ loop: BooleanConstructor;
6
+ trapped: BooleanConstructor;
7
+ focusTrapEl: import("vue").PropType<HTMLElement>;
8
+ focusStartEl: {
9
+ type: import("vue").PropType<"container" | "first" | HTMLElement>;
10
+ default: string;
11
+ };
12
+ }>> & Readonly<{
13
+ onFocusin?: ((...args: any[]) => any) | undefined;
14
+ onFocusout?: ((...args: any[]) => any) | undefined;
15
+ onFocusAfterTrapped?: ((...args: any[]) => any) | undefined;
16
+ onFocusAfterReleased?: ((...args: any[]) => any) | undefined;
17
+ "onFocusout-prevented"?: ((...args: any[]) => any) | undefined;
18
+ "onRelease-requested"?: ((...args: any[]) => any) | undefined;
19
+ }>, {
20
+ onKeydown: (e: KeyboardEvent) => void;
21
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focusin" | "focusout" | "focusAfterTrapped" | "focusAfterReleased" | "focusout-prevented" | "release-requested")[], import("vue").PublicProps, {
22
+ loop: boolean;
23
+ trapped: boolean;
24
+ focusStartEl: HTMLElement | "first" | "container";
25
+ }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
26
+ P: {};
27
+ B: {};
28
+ D: {};
29
+ C: {};
30
+ M: {};
31
+ Defaults: {};
32
+ }, Readonly<import("vue").ExtractPropTypes<{
33
+ loop: BooleanConstructor;
34
+ trapped: BooleanConstructor;
35
+ focusTrapEl: import("vue").PropType<HTMLElement>;
36
+ focusStartEl: {
37
+ type: import("vue").PropType<"container" | "first" | HTMLElement>;
38
+ default: string;
39
+ };
40
+ }>> & Readonly<{
41
+ onFocusin?: ((...args: any[]) => any) | undefined;
42
+ onFocusout?: ((...args: any[]) => any) | undefined;
43
+ onFocusAfterTrapped?: ((...args: any[]) => any) | undefined;
44
+ onFocusAfterReleased?: ((...args: any[]) => any) | undefined;
45
+ "onFocusout-prevented"?: ((...args: any[]) => any) | undefined;
46
+ "onRelease-requested"?: ((...args: any[]) => any) | undefined;
47
+ }>, {
48
+ onKeydown: (e: KeyboardEvent) => void;
49
+ }, {}, {}, {}, {
50
+ loop: boolean;
51
+ trapped: boolean;
52
+ focusStartEl: HTMLElement | "first" | "container";
53
+ }>;
54
+ __isFragment?: never;
55
+ __isTeleport?: never;
56
+ __isSuspense?: never;
57
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
58
+ loop: BooleanConstructor;
59
+ trapped: BooleanConstructor;
60
+ focusTrapEl: import("vue").PropType<HTMLElement>;
61
+ focusStartEl: {
62
+ type: import("vue").PropType<"container" | "first" | HTMLElement>;
63
+ default: string;
64
+ };
65
+ }>> & Readonly<{
66
+ onFocusin?: ((...args: any[]) => any) | undefined;
67
+ onFocusout?: ((...args: any[]) => any) | undefined;
68
+ onFocusAfterTrapped?: ((...args: any[]) => any) | undefined;
69
+ onFocusAfterReleased?: ((...args: any[]) => any) | undefined;
70
+ "onFocusout-prevented"?: ((...args: any[]) => any) | undefined;
71
+ "onRelease-requested"?: ((...args: any[]) => any) | undefined;
72
+ }>, {
73
+ onKeydown: (e: KeyboardEvent) => void;
74
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focusin" | "focusout" | "focusAfterTrapped" | "focusAfterReleased" | "focusout-prevented" | "release-requested")[], "focusin" | "focusout" | "focusAfterTrapped" | "focusAfterReleased" | "focusout-prevented" | "release-requested", {
75
+ loop: boolean;
76
+ trapped: boolean;
77
+ focusStartEl: HTMLElement | "first" | "container";
78
+ }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin;
79
+ export default EpFocusTrap;
80
+ export * from './src/tokens';
81
+ export * from './src/utils';
@@ -0,0 +1,19 @@
1
+ import { withInstall as e } from "../../utils/with-install.js";
2
+ import s from "./src/focus-trap.vue.js";
3
+ import { createFocusOutPreventedEvent as u, focusFirstDescendant as n, focusableStack as l, getEdges as i, getVisibleElement as p, isFocusCausedByUserEvent as F, isHidden as d, obtainAllFocusableElements as f, tryFocus as m, useFocusReason as E } from "./src/utils.js";
4
+ const r = e(s, "ep-focus-trap");
5
+ export {
6
+ s as ElFocusTrap,
7
+ r as EpFocusTrap,
8
+ u as createFocusOutPreventedEvent,
9
+ r as default,
10
+ n as focusFirstDescendant,
11
+ l as focusableStack,
12
+ i as getEdges,
13
+ p as getVisibleElement,
14
+ F as isFocusCausedByUserEvent,
15
+ d as isHidden,
16
+ f as obtainAllFocusableElements,
17
+ m as tryFocus,
18
+ E as useFocusReason
19
+ };
@@ -0,0 +1,32 @@
1
+ import type { PropType } from 'vue';
2
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
+ loop: BooleanConstructor;
4
+ trapped: BooleanConstructor;
5
+ focusTrapEl: PropType<HTMLElement>;
6
+ focusStartEl: {
7
+ type: PropType<"container" | "first" | HTMLElement>;
8
+ default: string;
9
+ };
10
+ }>, {
11
+ onKeydown: (e: KeyboardEvent) => void;
12
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focusin" | "focusout" | "focusAfterTrapped" | "focusAfterReleased" | "focusout-prevented" | "release-requested")[], "focusin" | "focusout" | "focusAfterTrapped" | "focusAfterReleased" | "focusout-prevented" | "release-requested", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
13
+ loop: BooleanConstructor;
14
+ trapped: BooleanConstructor;
15
+ focusTrapEl: PropType<HTMLElement>;
16
+ focusStartEl: {
17
+ type: PropType<"container" | "first" | HTMLElement>;
18
+ default: string;
19
+ };
20
+ }>> & Readonly<{
21
+ onFocusin?: ((...args: any[]) => any) | undefined;
22
+ onFocusout?: ((...args: any[]) => any) | undefined;
23
+ onFocusAfterTrapped?: ((...args: any[]) => any) | undefined;
24
+ onFocusAfterReleased?: ((...args: any[]) => any) | undefined;
25
+ "onFocusout-prevented"?: ((...args: any[]) => any) | undefined;
26
+ "onRelease-requested"?: ((...args: any[]) => any) | undefined;
27
+ }>, {
28
+ loop: boolean;
29
+ trapped: boolean;
30
+ focusStartEl: HTMLElement | "first" | "container";
31
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
32
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import r from "./focus-trap2.vue.js";
2
+ import { renderSlot as e } from "vue";
3
+ import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ function n(o, s, p, a, d, f) {
5
+ return e(o.$slots, "default", { handleKeydown: o.onKeydown });
6
+ }
7
+ const l = /* @__PURE__ */ t(r, [["render", n]]);
8
+ export {
9
+ l as default
10
+ };
@@ -0,0 +1,164 @@
1
+ import { defineComponent as w, ref as V, provide as j, watch as g, unref as m, onMounted as q, onBeforeUnmount as x, nextTick as I } from "vue";
2
+ import { EVENT_CODE as J } from "../../../constants/aria.js";
3
+ import { isString as M } from "../../../node_modules/.pnpm/@vue_shared@3.5.40/node_modules/@vue/shared/dist/shared.esm-bundler.js";
4
+ import { getEventCode as Y } from "../../../utils/dom/event.js";
5
+ import "../../../hooks/use-size/index.js";
6
+ import "../../../hooks/use-z-index/index.js";
7
+ import "../../../hooks/use-delayed-toggle/index.js";
8
+ import "../../../hooks/use-aria/index.js";
9
+ import "../../../hooks/use-model-toggle/index.js";
10
+ import "../../../hooks/use-empty-values/index.js";
11
+ import { useEscapeKeydown as z } from "../../../hooks/use-escape-keydown/index.js";
12
+ import { useFocusReason as G, tryFocus as f, createFocusOutPreventedEvent as T, getEdges as H, focusableStack as U, focusFirstDescendant as Q, obtainAllFocusableElements as W, isFocusCausedByUserEvent as X } from "./utils.js";
13
+ import { ON_TRAP_FOCUS_EVT as K, ON_RELEASE_FOCUS_EVT as k, FOCUS_TRAP_INJECTION_KEY as Z, FOCUS_AFTER_TRAPPED as y, FOCUS_AFTER_TRAPPED_OPTS as N, FOCUS_AFTER_RELEASED as L } from "./tokens.js";
14
+ import $ from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNil.js";
15
+ const me = w({
16
+ name: "ElFocusTrap",
17
+ inheritAttrs: !1,
18
+ props: {
19
+ loop: Boolean,
20
+ trapped: Boolean,
21
+ focusTrapEl: Object,
22
+ focusStartEl: {
23
+ type: [Object, String],
24
+ default: "first"
25
+ }
26
+ },
27
+ emits: [
28
+ K,
29
+ k,
30
+ "focusin",
31
+ "focusout",
32
+ "focusout-prevented",
33
+ "release-requested"
34
+ ],
35
+ setup(n, { emit: u }) {
36
+ const o = V();
37
+ let d, v;
38
+ const { focusReason: l } = G();
39
+ z((e) => {
40
+ n.trapped && !i.paused && u("release-requested", e);
41
+ });
42
+ const i = {
43
+ paused: !1,
44
+ pause() {
45
+ this.paused = !0;
46
+ },
47
+ resume() {
48
+ this.paused = !1;
49
+ }
50
+ }, p = (e) => {
51
+ if (!n.loop && !n.trapped || i.paused) return;
52
+ const { altKey: t, ctrlKey: s, metaKey: r, currentTarget: a, shiftKey: _ } = e, { loop: D } = n, B = Y(e) === J.tab && !t && !s && !r, E = document.activeElement;
53
+ if (B && E) {
54
+ const C = a, [O, b] = H(C);
55
+ if (O && b) {
56
+ if (!_ && E === b) {
57
+ const c = T({
58
+ focusReason: l.value
59
+ });
60
+ u("focusout-prevented", c), c.defaultPrevented || (e.preventDefault(), D && f(O, !0));
61
+ } else if (_ && [O, C].includes(E)) {
62
+ const c = T({
63
+ focusReason: l.value
64
+ });
65
+ u("focusout-prevented", c), c.defaultPrevented || (e.preventDefault(), D && f(b, !0));
66
+ }
67
+ } else if (E === C) {
68
+ const c = T({
69
+ focusReason: l.value
70
+ });
71
+ u("focusout-prevented", c), c.defaultPrevented || e.preventDefault();
72
+ }
73
+ }
74
+ };
75
+ j(Z, {
76
+ focusTrapRef: o,
77
+ onKeydown: p
78
+ }), g(
79
+ () => n.focusTrapEl,
80
+ (e) => {
81
+ e && (o.value = e);
82
+ },
83
+ { immediate: !0 }
84
+ ), g([o], ([e], [t]) => {
85
+ e && (e.addEventListener("keydown", p), e.addEventListener("focusin", F), e.addEventListener("focusout", P)), t && (t.removeEventListener("keydown", p), t.removeEventListener("focusin", F), t.removeEventListener("focusout", P));
86
+ });
87
+ const S = (e) => {
88
+ u(K, e);
89
+ }, A = (e) => u(k, e), F = (e) => {
90
+ const t = m(o);
91
+ if (!t) return;
92
+ const s = e.target, r = e.relatedTarget, a = s && t.contains(s);
93
+ n.trapped || r && t.contains(r) || (d = r), a && u("focusin", e), !i.paused && n.trapped && (a ? v = s : f(v, !0));
94
+ }, P = (e) => {
95
+ const t = m(o);
96
+ if (!(i.paused || !t))
97
+ if (n.trapped) {
98
+ const s = e.relatedTarget;
99
+ !$(s) && !t.contains(s) && setTimeout(() => {
100
+ if (!i.paused && n.trapped) {
101
+ const r = T({
102
+ focusReason: l.value
103
+ });
104
+ u("focusout-prevented", r), r.defaultPrevented || f(v, !0);
105
+ }
106
+ }, 0);
107
+ } else {
108
+ const s = e.target;
109
+ s && t.contains(s) || u("focusout", e);
110
+ }
111
+ };
112
+ async function R() {
113
+ await I();
114
+ const e = m(o);
115
+ if (e) {
116
+ U.push(i);
117
+ const t = e.contains(
118
+ document.activeElement
119
+ ) ? d : document.activeElement;
120
+ if (d = t, !e.contains(t)) {
121
+ const r = new Event(
122
+ y,
123
+ N
124
+ );
125
+ e.addEventListener(y, S), e.dispatchEvent(r), r.defaultPrevented || I(() => {
126
+ let a = n.focusStartEl;
127
+ M(a) || (f(a), document.activeElement !== a && (a = "first")), a === "first" && Q(
128
+ W(e),
129
+ !0
130
+ ), (document.activeElement === t || a === "container") && f(e);
131
+ });
132
+ }
133
+ }
134
+ }
135
+ function h() {
136
+ const e = m(o);
137
+ if (e) {
138
+ e.removeEventListener(y, S);
139
+ const t = new CustomEvent(L, {
140
+ ...N,
141
+ detail: {
142
+ focusReason: l.value
143
+ }
144
+ });
145
+ e.addEventListener(L, A), e.dispatchEvent(t), !t.defaultPrevented && (l.value == "keyboard" || !X() || e.contains(document.activeElement)) && f(d ?? document.body), e.removeEventListener(L, A), U.remove(i), d = null, v = null;
146
+ }
147
+ }
148
+ return q(() => {
149
+ n.trapped && R(), g(
150
+ () => n.trapped,
151
+ (e) => {
152
+ e ? R() : h();
153
+ }
154
+ );
155
+ }), x(() => {
156
+ n.trapped && h(), o.value && (o.value.removeEventListener("keydown", p), o.value.removeEventListener("focusin", F), o.value.removeEventListener("focusout", P), o.value = void 0), d = null, v = null;
157
+ }), {
158
+ onKeydown: p
159
+ };
160
+ }
161
+ });
162
+ export {
163
+ me as default
164
+ };
@@ -0,0 +1,13 @@
1
+ import type { InjectionKey, Ref } from 'vue';
2
+ export declare const FOCUS_AFTER_TRAPPED = "focus-trap.focus-after-trapped";
3
+ export declare const FOCUS_AFTER_RELEASED = "focus-trap.focus-after-released";
4
+ export declare const FOCUSOUT_PREVENTED = "focus-trap.focusout-prevented";
5
+ export declare const FOCUS_AFTER_TRAPPED_OPTS: EventInit;
6
+ export declare const FOCUSOUT_PREVENTED_OPTS: EventInit;
7
+ export declare const ON_TRAP_FOCUS_EVT = "focusAfterTrapped";
8
+ export declare const ON_RELEASE_FOCUS_EVT = "focusAfterReleased";
9
+ export type FocusTrapInjectionContext = {
10
+ focusTrapRef: Ref<HTMLElement | undefined>;
11
+ onKeydown: (e: KeyboardEvent) => void;
12
+ };
13
+ export declare const FOCUS_TRAP_INJECTION_KEY: InjectionKey<FocusTrapInjectionContext>;
@@ -0,0 +1,17 @@
1
+ const e = "focus-trap.focus-after-trapped", s = "focus-trap.focus-after-released", c = "focus-trap.focusout-prevented", t = {
2
+ cancelable: !0,
3
+ bubbles: !1
4
+ }, E = {
5
+ cancelable: !0,
6
+ bubbles: !1
7
+ }, o = "focusAfterTrapped", _ = "focusAfterReleased", T = Symbol("elFocusTrap");
8
+ export {
9
+ c as FOCUSOUT_PREVENTED,
10
+ E as FOCUSOUT_PREVENTED_OPTS,
11
+ s as FOCUS_AFTER_RELEASED,
12
+ e as FOCUS_AFTER_TRAPPED,
13
+ t as FOCUS_AFTER_TRAPPED_OPTS,
14
+ T as FOCUS_TRAP_INJECTION_KEY,
15
+ _ as ON_RELEASE_FOCUS_EVT,
16
+ o as ON_TRAP_FOCUS_EVT
17
+ };
@@ -0,0 +1,29 @@
1
+ declare const focusReason: import("vue").Ref<"pointer" | "keyboard" | undefined, "pointer" | "keyboard" | undefined>;
2
+ declare const lastUserFocusTimestamp: import("vue").Ref<number, number>;
3
+ declare const lastAutomatedFocusTimestamp: import("vue").Ref<number, number>;
4
+ export type FocusLayer = {
5
+ paused: boolean;
6
+ pause: () => void;
7
+ resume: () => void;
8
+ };
9
+ export type FocusStack = FocusLayer[];
10
+ export declare const obtainAllFocusableElements: (element: HTMLElement) => HTMLElement[];
11
+ export declare const getVisibleElement: (elements: HTMLElement[], container: HTMLElement) => HTMLElement | undefined;
12
+ export declare const isHidden: (element: HTMLElement, container: HTMLElement) => boolean;
13
+ export declare const getEdges: (container: HTMLElement) => (HTMLElement | undefined)[];
14
+ export declare const tryFocus: (element?: HTMLElement | {
15
+ focus: () => void;
16
+ } | null, shouldSelect?: boolean) => void;
17
+ export declare const focusFirstDescendant: (elements: HTMLElement[], shouldSelect?: boolean) => void;
18
+ export declare const focusableStack: {
19
+ push: (layer: FocusLayer) => void;
20
+ remove: (layer: FocusLayer) => void;
21
+ };
22
+ export declare const isFocusCausedByUserEvent: () => boolean;
23
+ export declare const useFocusReason: () => {
24
+ focusReason: typeof focusReason;
25
+ lastUserFocusTimestamp: typeof lastUserFocusTimestamp;
26
+ lastAutomatedFocusTimestamp: typeof lastAutomatedFocusTimestamp;
27
+ };
28
+ export declare const createFocusOutPreventedEvent: (detail: CustomEventInit["detail"]) => CustomEvent<any>;
29
+ export {};
@@ -0,0 +1,83 @@
1
+ import { ref as i, onMounted as v, onBeforeUnmount as p } from "vue";
2
+ import { focusElement as F } from "../../../utils/dom/aria.js";
3
+ import { FOCUSOUT_PREVENTED as w, FOCUSOUT_PREVENTED_OPTS as T } from "./tokens.js";
4
+ const a = i(), u = i(0), d = i(0);
5
+ let r = 0;
6
+ const N = (e) => {
7
+ const n = [], o = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
8
+ acceptNode: (t) => {
9
+ const s = t.tagName === "INPUT" && t.type === "hidden";
10
+ return t.disabled || t.hidden || s ? NodeFilter.FILTER_SKIP : t.tabIndex >= 0 || t === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
11
+ }
12
+ });
13
+ for (; o.nextNode(); ) n.push(o.currentNode);
14
+ return n;
15
+ }, m = (e, n) => {
16
+ for (const o of e)
17
+ if (!y(o, n)) return o;
18
+ }, y = (e, n) => {
19
+ if (process.env.NODE_ENV === "test") return !1;
20
+ if (getComputedStyle(e).visibility === "hidden") return !0;
21
+ for (; e; ) {
22
+ if (n && e === n) return !1;
23
+ if (getComputedStyle(e).display === "none") return !0;
24
+ e = e.parentElement;
25
+ }
26
+ return !1;
27
+ }, C = (e) => {
28
+ const n = N(e), o = m(n, e), t = m(n.reverse(), e);
29
+ return [o, t];
30
+ }, S = (e) => e instanceof HTMLInputElement && "select" in e, L = (e, n) => {
31
+ if (e) {
32
+ const o = document.activeElement;
33
+ F(e, { preventScroll: !0 }), d.value = window.performance.now(), e !== o && S(e) && n && e.select();
34
+ }
35
+ };
36
+ function f(e, n) {
37
+ const o = [...e], t = e.indexOf(n);
38
+ return t !== -1 && o.splice(t, 1), o;
39
+ }
40
+ const b = () => {
41
+ let e = [];
42
+ return {
43
+ push: (t) => {
44
+ const s = e[0];
45
+ s && t !== s && s.pause(), e = f(e, t), e.unshift(t);
46
+ },
47
+ remove: (t) => {
48
+ var s, l;
49
+ e = f(e, t), (l = (s = e[0]) == null ? void 0 : s.resume) == null || l.call(s);
50
+ }
51
+ };
52
+ }, I = (e, n = !1) => {
53
+ const o = document.activeElement;
54
+ for (const t of e)
55
+ if (L(t, n), document.activeElement !== o) return;
56
+ }, O = b(), P = () => u.value > d.value, c = () => {
57
+ a.value = "pointer", u.value = window.performance.now();
58
+ }, E = () => {
59
+ a.value = "keyboard", u.value = window.performance.now();
60
+ }, U = () => (v(() => {
61
+ r === 0 && (document.addEventListener("mousedown", c), document.addEventListener("touchstart", c), document.addEventListener("keydown", E)), r++;
62
+ }), p(() => {
63
+ r--, r <= 0 && (document.removeEventListener("mousedown", c), document.removeEventListener("touchstart", c), document.removeEventListener("keydown", E));
64
+ }), {
65
+ focusReason: a,
66
+ lastUserFocusTimestamp: u,
67
+ lastAutomatedFocusTimestamp: d
68
+ }), _ = (e) => new CustomEvent(w, {
69
+ ...T,
70
+ detail: e
71
+ });
72
+ export {
73
+ _ as createFocusOutPreventedEvent,
74
+ I as focusFirstDescendant,
75
+ O as focusableStack,
76
+ C as getEdges,
77
+ m as getVisibleElement,
78
+ P as isFocusCausedByUserEvent,
79
+ y as isHidden,
80
+ N as obtainAllFocusableElements,
81
+ L as tryFocus,
82
+ U as useFocusReason
83
+ };
@@ -2,3 +2,6 @@ import type { Plugin } from 'vue';
2
2
  import { ElForm } from 'element-plus';
3
3
  export declare const EpForm: typeof ElForm & Plugin;
4
4
  export default EpForm;
5
+ export * from './src/constants';
6
+ export * from './src/hooks/use-form-common-props';
7
+ export * from './src/hooks/use-form-item';
@@ -1,7 +1,9 @@
1
1
  import "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/index.js";
2
2
  import { withInstall as o } from "../../utils/with-install.js";
3
+ import "vue";
4
+ import "../../hooks/use-size/index.js";
3
5
  import { ElForm as m } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/form/index.js";
4
- const r = Object.assign({}, m, { name: "EpForm" }), n = o(r, "ep-form");
6
+ const r = Object.assign({}, m, { name: "EpForm" }), e = o(r, "ep-form");
5
7
  export {
6
- n as EpForm
8
+ e as EpForm
7
9
  };
@@ -0,0 +1,4 @@
1
+ import type { InjectionKey } from 'vue';
2
+ import type { FormContext, FormItemContext } from './types';
3
+ export declare const formContextKey: InjectionKey<FormContext>;
4
+ export declare const formItemContextKey: InjectionKey<FormItemContext | undefined>;
@@ -0,0 +1,4 @@
1
+ const t = Symbol("formItemContextKey");
2
+ export {
3
+ t as formItemContextKey
4
+ };
@@ -0,0 +1,6 @@
1
+ import type { ComponentSize } from '@element-plus/constants';
2
+ import type { MaybeRef } from 'vue';
3
+ export declare const useFormSize: (fallback?: MaybeRef<ComponentSize | undefined>, ignore?: Partial<Record<"prop" | "form" | "formItem" | "global", boolean>>) => import("vue").ComputedRef<"" | "default" | "small" | "large">;
4
+ export declare const useFormDisabled: (fallback?: MaybeRef<boolean | undefined>) => import("vue").ComputedRef<boolean>;
5
+ export declare const useSize: (fallback?: MaybeRef<ComponentSize | undefined>, ignore?: Partial<Record<"prop" | "form" | "formItem" | "global", boolean>>) => import("vue").ComputedRef<"" | "default" | "small" | "large">;
6
+ export declare const useDisabled: (fallback?: MaybeRef<boolean | undefined>) => import("vue").ComputedRef<boolean>;
@@ -0,0 +1,19 @@
1
+ import type { ComputedRef, Ref } from 'vue';
2
+ import type { FormItemContext } from '../types';
3
+ export declare const useFormItem: () => {
4
+ form: import("../types").FormContext | undefined;
5
+ formItem: FormItemContext | undefined;
6
+ };
7
+ export type IUseFormItemInputCommonProps = {
8
+ id?: string;
9
+ label?: string | number | boolean | Record<string, any>;
10
+ ariaLabel?: string | number | boolean | Record<string, any>;
11
+ };
12
+ export declare const useFormItemInputId: (props: Partial<IUseFormItemInputCommonProps>, { formItemContext, disableIdGeneration, disableIdManagement, }: {
13
+ formItemContext?: FormItemContext;
14
+ disableIdGeneration?: ComputedRef<boolean> | Ref<boolean>;
15
+ disableIdManagement?: ComputedRef<boolean> | Ref<boolean>;
16
+ }) => {
17
+ isLabeledByFormItem: ComputedRef<boolean>;
18
+ inputId: Ref<string | undefined, string | undefined>;
19
+ };
@@ -0,0 +1,24 @@
1
+ import type { ComponentSize } from '@element-plus/constants';
2
+ export interface FormContext {
3
+ size?: ComponentSize;
4
+ disabled?: boolean;
5
+ [key: string]: any;
6
+ }
7
+ export interface FormItemContext {
8
+ size?: ComponentSize;
9
+ $el?: HTMLDivElement | undefined;
10
+ validateMessage?: string;
11
+ validateState?: string;
12
+ isGroup?: boolean;
13
+ labelId?: string;
14
+ inputIds?: string[];
15
+ hasLabel?: boolean;
16
+ fieldValue?: any;
17
+ propString?: string;
18
+ addInputId: (id: string) => void;
19
+ removeInputId: (id: string) => void;
20
+ validate?: (...args: any[]) => any;
21
+ resetField?: () => void;
22
+ clearValidate?: () => void;
23
+ [key: string]: any;
24
+ }
@@ -1,4 +1,22 @@
1
- import type { Plugin } from 'vue';
2
- import { ElIcon } from 'element-plus';
3
- export declare const EpIcon: typeof ElIcon & Plugin;
1
+ import Icon from './src/icon.vue';
2
+ import type { SFCWithInstall } from '@element-plus/utils';
3
+ export declare const ElIcon: SFCWithInstall<typeof Icon>;
4
+ export declare const EpIcon: {
5
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import(".").IconProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
6
+ P: {};
7
+ B: {};
8
+ D: {};
9
+ C: {};
10
+ M: {};
11
+ Defaults: {};
12
+ }, Readonly<import(".").IconProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
13
+ __isFragment?: never;
14
+ __isTeleport?: never;
15
+ __isSuspense?: never;
16
+ } & import("vue").ComponentOptionsBase<Readonly<import(".").IconProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
17
+ $slots: {
18
+ default?: (props: {}) => any;
19
+ };
20
+ }) & import("vue").Plugin;
4
21
  export default EpIcon;
22
+ export * from './src/icon';
@@ -1,7 +1,10 @@
1
- import "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/index.js";
2
1
  import { withInstall as o } from "../../utils/with-install.js";
3
- import { ElIcon as n } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/icon/index.js";
4
- const t = Object.assign({}, n, { name: "EpIcon" }), m = o(t, "ep-icon");
2
+ import "vue";
3
+ import { withInstall as i } from "../../utils/vue/install.js";
4
+ import t from "./src/icon.vue.js";
5
+ import "./src/icon.js";
6
+ i(t);
7
+ const s = o(t, "ep-icon");
5
8
  export {
6
- m as EpIcon
9
+ s as EpIcon
7
10
  };
@@ -0,0 +1,34 @@
1
+ import type { ExtractPublicPropTypes } from 'vue';
2
+ import type Icon from './icon.vue';
3
+ export interface IconProps {
4
+ /**
5
+ * @description SVG icon size, size x size
6
+ */
7
+ size?: number | string;
8
+ /**
9
+ * @description SVG tag's fill attribute
10
+ */
11
+ color?: string;
12
+ }
13
+ /**
14
+ * @deprecated Removed after 3.0.0, Use `IconProps` instead.
15
+ */
16
+ export declare const iconProps: {
17
+ readonly size: {
18
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | (((new (...args: any[]) => string | number) | (() => string | number)) | null)[], unknown, unknown>>;
19
+ readonly required: false;
20
+ readonly validator: ((val: unknown) => boolean) | undefined;
21
+ __epPropKey: true;
22
+ };
23
+ readonly color: {
24
+ readonly type: import("vue").PropType<string>;
25
+ readonly required: false;
26
+ readonly validator: ((val: unknown) => boolean) | undefined;
27
+ __epPropKey: true;
28
+ };
29
+ };
30
+ /**
31
+ * @deprecated Removed after 3.0.0, Use `IconProps` instead.
32
+ */
33
+ export type IconPropsPublic = ExtractPublicPropTypes<typeof iconProps>;
34
+ export type IconInstance = InstanceType<typeof Icon> & unknown;
@@ -0,0 +1,16 @@
1
+ import { buildProps as r, definePropType as e } from "../../../utils/vue/props/runtime.js";
2
+ import "vue";
3
+ r({
4
+ /**
5
+ * @description SVG icon size, size x size
6
+ */
7
+ size: {
8
+ type: e([Number, String])
9
+ },
10
+ /**
11
+ * @description SVG tag's fill attribute
12
+ */
13
+ color: {
14
+ type: String
15
+ }
16
+ });
@@ -0,0 +1,13 @@
1
+ import type { IconProps } from './icon';
2
+ declare var __VLS_1: {};
3
+ type __VLS_Slots = {} & {
4
+ default?: (props: typeof __VLS_1) => any;
5
+ };
6
+ declare const __VLS_component: import("vue").DefineComponent<IconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
8
+ export default _default;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };