ep-craft 0.1.22 → 0.1.23

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 (111) hide show
  1. package/dist/components/affix/affix.d.ts +19 -19
  2. package/dist/components/affix/affix.js +61 -53
  3. package/dist/components/alert/alert.d.ts +71 -17
  4. package/dist/components/alert/alert.js +99 -43
  5. package/dist/components/anchor/anchor.d.ts +19 -19
  6. package/dist/components/anchor/anchor.js +166 -102
  7. package/dist/components/anchor/constants.d.ts +15 -0
  8. package/dist/components/anchor/constants.js +4 -0
  9. package/dist/components/anchor-link/anchor-link.d.ts +1 -1
  10. package/dist/components/anchor-link/anchor-link.js +39 -26
  11. package/dist/components/button/EpButton.vue.d.ts +8 -8
  12. package/dist/components/button/EpButton.vue.js +5 -5
  13. package/dist/components/button/constants.d.ts +7 -0
  14. package/dist/components/button/constants.js +6 -0
  15. package/dist/components/check-tag/EpCheckTag.vue.d.ts +1 -1
  16. package/dist/components/collapse-transition/index.js +2 -2
  17. package/dist/components/config-provider/src/constants.js +4 -0
  18. package/dist/components/config-provider/src/hooks/use-global-config.d.ts +1 -1
  19. package/dist/components/config-provider/src/hooks/use-global-config.js +24 -0
  20. package/dist/components/form/src/constants.js +2 -1
  21. package/dist/components/form/src/hooks/use-form-common-props.d.ts +2 -2
  22. package/dist/components/form/src/hooks/use-form-common-props.js +17 -0
  23. package/dist/components/form/src/hooks/use-form-item.js +51 -0
  24. package/dist/components/icon/index.js +5 -5
  25. package/dist/components/menu/menu-collapse-transition.vue.js +10 -6
  26. package/dist/components/menu/menu.d.ts +47 -47
  27. package/dist/components/menu/menu.js +59 -52
  28. package/dist/components/menu/use-menu-color.d.ts +2 -0
  29. package/dist/components/menu/use-menu-color.js +11 -0
  30. package/dist/components/menu/use-menu-css-var.d.ts +2 -0
  31. package/dist/components/menu/use-menu-css-var.js +30 -0
  32. package/dist/components/menu/utils/menu-bar.d.ts +7 -0
  33. package/dist/components/menu/utils/menu-bar.js +15 -0
  34. package/dist/components/menu/utils/menu-item.d.ts +9 -0
  35. package/dist/components/menu/utils/menu-item.js +50 -0
  36. package/dist/components/menu/utils/submenu.d.ts +11 -0
  37. package/dist/components/menu/utils/submenu.js +49 -0
  38. package/dist/components/menu-item/EpMenuItem.vue.js +17 -13
  39. package/dist/components/menu-item-group/EpMenuItemGroup.vue.js +1 -1
  40. package/dist/components/popper/src/composables/use-content.d.ts +6 -6
  41. package/dist/components/popper/src/content.vue.d.ts +6 -6
  42. package/dist/components/popper/src/popper.d.ts +2 -2
  43. package/dist/components/radio/constants.d.ts +64 -0
  44. package/dist/components/radio/constants.js +4 -0
  45. package/dist/components/radio/radio.d.ts +98 -19
  46. package/dist/components/radio/radio.js +101 -43
  47. package/dist/components/radio/use-radio.d.ts +13 -0
  48. package/dist/components/radio/use-radio.js +43 -0
  49. package/dist/components/radio-button/radio-button.d.ts +46 -16
  50. package/dist/components/radio-button/radio-button.js +37 -29
  51. package/dist/components/radio-group/radio-group.d.ts +142 -28
  52. package/dist/components/radio-group/radio-group.js +136 -55
  53. package/dist/components/sub-menu/sub-menu.d.ts +19 -19
  54. package/dist/components/sub-menu/sub-menu.js +65 -58
  55. package/dist/components/tab-pane/tab-pane.d.ts +45 -8
  56. package/dist/components/tab-pane/tab-pane.js +66 -32
  57. package/dist/components/tabs/composables/use-tab-nav-touch.d.ts +19 -0
  58. package/dist/components/tabs/composables/use-tab-nav-touch.js +58 -0
  59. package/dist/components/tabs/constants.d.ts +63 -0
  60. package/dist/components/tabs/constants.js +4 -0
  61. package/dist/components/tabs/tab-bar.d.ts +97 -0
  62. package/dist/components/tabs/tab-bar.vue.d.ts +14 -0
  63. package/dist/components/tabs/tab-bar.vue.js +80 -0
  64. package/dist/components/tabs/tab-bar2.vue.js +4 -0
  65. package/dist/components/tabs/tab-nav.d.ts +295 -0
  66. package/dist/components/tabs/tab-nav.js +297 -0
  67. package/dist/components/tabs/tabs.d.ts +71 -28
  68. package/dist/components/tabs/tabs.js +165 -93
  69. package/dist/components/tag/EpTag.vue.d.ts +3 -3
  70. package/dist/components/tag/EpTag.vue.js +3 -3
  71. package/dist/components/tooltip/index.d.ts +34 -34
  72. package/dist/components/tooltip/index.js +12 -12
  73. package/dist/components/tooltip/src/content.vue.d.ts +8 -8
  74. package/dist/components/tooltip/src/tooltip.d.ts +2 -2
  75. package/dist/components/tooltip/src/tooltip.vue.d.ts +12 -12
  76. package/dist/components/tooltip/src/trigger.d.ts +1 -1
  77. package/dist/constants/event.js +5 -0
  78. package/dist/directives/click-outside/index.js +49 -0
  79. package/dist/hooks/index.d.ts +1 -0
  80. package/dist/hooks/use-deprecated/index.js +25 -0
  81. package/dist/hooks/use-locale/index.js +24 -0
  82. package/dist/hooks/use-ordered-children/index.js +53 -0
  83. package/dist/hooks/use-popper/index.d.ts +6 -6
  84. package/dist/hooks/use-prop/index.js +11 -0
  85. package/dist/hooks/use-size/index.d.ts +3 -3
  86. package/dist/hooks/use-size/index.js +14 -6
  87. package/dist/hooks/use-wheel/defaults.d.ts +27 -0
  88. package/dist/hooks/use-wheel/defaults.js +4 -0
  89. package/dist/hooks/use-wheel/index.d.ts +13 -0
  90. package/dist/hooks/use-wheel/index.js +26 -0
  91. package/dist/utils/browser.js +6 -5
  92. package/dist/utils/dom/aria.js +13 -6
  93. package/dist/utils/dom/element.js +16 -0
  94. package/dist/utils/dom/position.js +18 -0
  95. package/dist/utils/dom/scroll.js +50 -0
  96. package/dist/utils/dom/style.js +40 -13
  97. package/dist/utils/easings.js +7 -0
  98. package/dist/utils/error.js +11 -7
  99. package/dist/utils/numbers.js +6 -0
  100. package/dist/utils/objects.js +7 -0
  101. package/dist/utils/raf.js +6 -0
  102. package/dist/utils/strings.js +8 -0
  103. package/dist/utils/throttleByRaf.js +15 -0
  104. package/dist/utils/types.js +19 -16
  105. package/dist/utils/typescript.js +4 -0
  106. package/dist/utils/vue/icon.js +20 -0
  107. package/dist/utils/vue/vnode.d.ts +4 -4
  108. package/dist/utils/vue/vnode.js +17 -0
  109. package/dist/vendored-components.d.ts +6 -3
  110. package/dist/vendored-components.js +11 -5
  111. package/package.json +1 -1
@@ -1,26 +1,140 @@
1
+ import type { ComponentSize } from '@element-plus/constants';
2
+ /**
3
+ * EpRadioGroup —— 从 element-plus 的 radio-group 源码 vendored 而来
4
+ * (el -> ep 命名),样式复用仓库内置的 theme-chalk/src/radio.scss(命名空间为 el)。
5
+ *
6
+ * 注意:内部通过 provide(radioGroupKey) 向 EpRadio / EpRadioButton 提供上下文,
7
+ * options 渲染时直接引用 vendored 的 EpRadio / EpRadioButton。
8
+ *
9
+ * 以下 props/emits/defaults 与类型定义从 element-plus 的 radio/src/radio-group.ts
10
+ * vendored 而来(内联到本文件顶部),替换 element-plus 的深引用 import。
11
+ */
12
+ export type radioOptionProp = {
13
+ value?: string;
14
+ label?: string;
15
+ disabled?: string;
16
+ };
17
+ export declare const radioDefaultProps: Required<radioOptionProp>;
18
+ export type radioOption = Record<string, any>;
19
+ export interface RadioGroupProps {
20
+ /**
21
+ * @description native `id` attribute
22
+ */
23
+ id?: string;
24
+ /**
25
+ * @description the size of radio buttons or bordered radios
26
+ */
27
+ size?: ComponentSize;
28
+ /**
29
+ * @description whether the nesting radios are disabled
30
+ */
31
+ disabled?: boolean;
32
+ /**
33
+ * @description binding value
34
+ */
35
+ modelValue?: string | number | boolean;
36
+ /**
37
+ * @description border and background color when button is active
38
+ */
39
+ fill?: string;
40
+ /**
41
+ * @description font color when button is active
42
+ */
43
+ textColor?: string;
44
+ /**
45
+ * @description native `name` attribute
46
+ */
47
+ name?: string;
48
+ /**
49
+ * @description whether to trigger form validation
50
+ */
51
+ validateEvent?: boolean;
52
+ /**
53
+ * @description radio options
54
+ */
55
+ options?: radioOption[];
56
+ /**
57
+ * @description custom prop names for options
58
+ */
59
+ props?: radioOptionProp;
60
+ /**
61
+ * @description radio type
62
+ */
63
+ type?: 'radio' | 'button';
64
+ /**
65
+ * @description native `aria-label` attribute
66
+ */
67
+ ariaLabel?: string;
68
+ }
69
+ /**
70
+ * @deprecated Removed after 3.0.0, Use `RadioGroupProps` instead.
71
+ */
72
+ export declare const radioGroupProps: {
73
+ readonly ariaLabel: StringConstructor;
74
+ readonly id: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
75
+ readonly size: {
76
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
77
+ readonly required: false;
78
+ readonly validator: ((val: unknown) => boolean) | undefined;
79
+ __epPropKey: true;
80
+ };
81
+ readonly disabled: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
82
+ readonly modelValue: import("@element-plus/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor, BooleanConstructor], unknown, unknown, undefined, boolean>;
83
+ readonly fill: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
84
+ readonly textColor: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
85
+ readonly name: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
86
+ readonly validateEvent: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
87
+ readonly options: {
88
+ readonly type: import("vue").PropType<radioOption[]>;
89
+ readonly required: false;
90
+ readonly validator: ((val: unknown) => boolean) | undefined;
91
+ __epPropKey: true;
92
+ };
93
+ readonly props: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => radioOptionProp) | (() => radioOptionProp) | (((new (...args: any[]) => radioOptionProp) | (() => radioOptionProp)) | null)[], unknown, unknown, () => Required<radioOptionProp>, boolean>;
94
+ readonly type: import("@element-plus/utils").EpPropFinalized<StringConstructor, "button" | "radio", unknown, "radio", boolean>;
95
+ };
96
+ export declare const radioGroupEmits: {
97
+ "update:modelValue": (val: string | number | boolean | undefined) => val is string | number | boolean;
98
+ change: (val: string | number | boolean | undefined) => val is string | number | boolean;
99
+ };
100
+ export type RadioGroupEmits = typeof radioGroupEmits;
101
+ /**
102
+ * @description default values for RadioGroupProps
103
+ */
104
+ export declare const radioGroupPropsDefaults: {
105
+ readonly id: undefined;
106
+ readonly disabled: undefined;
107
+ readonly modelValue: undefined;
108
+ readonly fill: "";
109
+ readonly textColor: "";
110
+ readonly name: undefined;
111
+ readonly validateEvent: true;
112
+ readonly props: () => Required<radioOptionProp>;
113
+ readonly type: "radio";
114
+ };
1
115
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
116
  readonly ariaLabel: StringConstructor;
3
- readonly id: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
117
+ readonly id: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
4
118
  readonly size: {
5
- readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
119
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
6
120
  readonly required: false;
7
121
  readonly validator: ((val: unknown) => boolean) | undefined;
8
122
  __epPropKey: true;
9
123
  };
10
- readonly disabled: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
11
- readonly modelValue: import("element-plus/es/utils/index.mjs").EpPropFinalized<readonly [StringConstructor, NumberConstructor, BooleanConstructor], unknown, unknown, undefined, boolean>;
12
- readonly fill: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
13
- readonly textColor: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
14
- readonly name: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
15
- readonly validateEvent: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
124
+ readonly disabled: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
125
+ readonly modelValue: import("@element-plus/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor, BooleanConstructor], unknown, unknown, undefined, boolean>;
126
+ readonly fill: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
127
+ readonly textColor: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
128
+ readonly name: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
129
+ readonly validateEvent: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
16
130
  readonly options: {
17
- readonly type: import("vue").PropType<import("element-plus").radioOption[]>;
131
+ readonly type: import("vue").PropType<radioOption[]>;
18
132
  readonly required: false;
19
133
  readonly validator: ((val: unknown) => boolean) | undefined;
20
134
  __epPropKey: true;
21
135
  };
22
- readonly props: import("element-plus/es/utils/index.mjs").EpPropFinalized<(new (...args: any[]) => import("element-plus").radioOptionProp) | (() => import("element-plus").radioOptionProp) | (((new (...args: any[]) => import("element-plus").radioOptionProp) | (() => import("element-plus").radioOptionProp)) | null)[], unknown, unknown, () => Required<import("element-plus").radioOptionProp>, boolean>;
23
- readonly type: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "button" | "radio", unknown, "radio", boolean>;
136
+ readonly props: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => radioOptionProp) | (() => radioOptionProp) | (((new (...args: any[]) => radioOptionProp) | (() => radioOptionProp)) | null)[], unknown, unknown, () => Required<radioOptionProp>, boolean>;
137
+ readonly type: import("@element-plus/utils").EpPropFinalized<StringConstructor, "button" | "radio", unknown, "radio", boolean>;
24
138
  }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
25
139
  [key: string]: any;
26
140
  }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -28,39 +142,39 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
28
142
  change: (val: string | number | boolean | undefined) => val is string | number | boolean;
29
143
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
30
144
  readonly ariaLabel: StringConstructor;
31
- readonly id: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
145
+ readonly id: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
32
146
  readonly size: {
33
- readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
147
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
34
148
  readonly required: false;
35
149
  readonly validator: ((val: unknown) => boolean) | undefined;
36
150
  __epPropKey: true;
37
151
  };
38
- readonly disabled: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
39
- readonly modelValue: import("element-plus/es/utils/index.mjs").EpPropFinalized<readonly [StringConstructor, NumberConstructor, BooleanConstructor], unknown, unknown, undefined, boolean>;
40
- readonly fill: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
41
- readonly textColor: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
42
- readonly name: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
43
- readonly validateEvent: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
152
+ readonly disabled: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
153
+ readonly modelValue: import("@element-plus/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor, BooleanConstructor], unknown, unknown, undefined, boolean>;
154
+ readonly fill: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
155
+ readonly textColor: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
156
+ readonly name: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
157
+ readonly validateEvent: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
44
158
  readonly options: {
45
- readonly type: import("vue").PropType<import("element-plus").radioOption[]>;
159
+ readonly type: import("vue").PropType<radioOption[]>;
46
160
  readonly required: false;
47
161
  readonly validator: ((val: unknown) => boolean) | undefined;
48
162
  __epPropKey: true;
49
163
  };
50
- readonly props: import("element-plus/es/utils/index.mjs").EpPropFinalized<(new (...args: any[]) => import("element-plus").radioOptionProp) | (() => import("element-plus").radioOptionProp) | (((new (...args: any[]) => import("element-plus").radioOptionProp) | (() => import("element-plus").radioOptionProp)) | null)[], unknown, unknown, () => Required<import("element-plus").radioOptionProp>, boolean>;
51
- readonly type: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "button" | "radio", unknown, "radio", boolean>;
164
+ readonly props: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => radioOptionProp) | (() => radioOptionProp) | (((new (...args: any[]) => radioOptionProp) | (() => radioOptionProp)) | null)[], unknown, unknown, () => Required<radioOptionProp>, boolean>;
165
+ readonly type: import("@element-plus/utils").EpPropFinalized<StringConstructor, "button" | "radio", unknown, "radio", boolean>;
52
166
  }>> & Readonly<{
53
- onChange?: ((val: string | number | boolean | undefined) => any) | undefined;
54
167
  "onUpdate:modelValue"?: ((val: string | number | boolean | undefined) => any) | undefined;
168
+ onChange?: ((val: string | number | boolean | undefined) => any) | undefined;
55
169
  }>, {
56
- readonly props: import("element-plus").radioOptionProp;
170
+ readonly props: radioOptionProp;
57
171
  readonly name: string;
58
- readonly type: import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "button" | "radio", unknown>;
59
172
  readonly fill: string;
60
- readonly disabled: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
173
+ readonly disabled: import("@element-plus/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
61
174
  readonly id: string;
62
- readonly modelValue: import("element-plus/es/utils/index.mjs").EpPropMergeType<readonly [StringConstructor, NumberConstructor, BooleanConstructor], unknown, unknown>;
63
- readonly validateEvent: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
175
+ readonly type: import("@element-plus/utils").EpPropMergeType<StringConstructor, "button" | "radio", unknown>;
176
+ readonly modelValue: import("@element-plus/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor, BooleanConstructor], unknown, unknown>;
177
+ readonly validateEvent: import("@element-plus/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
64
178
  readonly textColor: string;
65
179
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
66
180
  export default _default;
@@ -1,81 +1,159 @@
1
- import { defineComponent as h, ref as G, onMounted as P, computed as u, provide as R, reactive as _, toRefs as L, watch as x, h as s, renderSlot as A, Fragment as C, renderList as F, mergeProps as N, nextTick as T } from "vue";
2
- import { UPDATE_MODEL_EVENT as k, CHANGE_EVENT as D } from "element-plus/es/constants/event.mjs";
3
- import { useNamespace as V } from "element-plus/es/hooks/use-namespace/index.mjs";
4
- import { useId as B } from "element-plus/es/hooks/use-id/index.mjs";
5
- import { useFormItem as M, useFormItemInputId as O } from "element-plus/es/components/form/src/hooks/use-form-item.mjs";
6
- import { radioGroupKey as S } from "element-plus/es/components/radio/src/constants.mjs";
7
- import { radioGroupEmits as q, radioGroupProps as w, radioDefaultProps as H } from "element-plus/es/components/radio/src/radio-group.mjs";
8
- import K from "../radio/radio.js";
9
- import U from "../radio-button/radio-button.js";
10
- const j = (o, i) => {
11
- const n = { ...o };
12
- return i.forEach((l) => delete n[l]), n;
13
- }, oe = h({
1
+ import { defineComponent as G, ref as I, onMounted as A, computed as u, provide as L, reactive as R, toRefs as _, watch as x, h as s, renderSlot as B, Fragment as C, renderList as N, mergeProps as T, nextTick as F } from "vue";
2
+ import { UPDATE_MODEL_EVENT as V, CHANGE_EVENT as k } from "../../constants/event.js";
3
+ import { useNamespace as D } from "../../hooks/use-namespace/index.js";
4
+ import { useId as O } from "../../hooks/use-id/index.js";
5
+ import { useFormItem as z, useFormItemInputId as M } from "../form/src/hooks/use-form-item.js";
6
+ import { useAriaProps as j } from "../../hooks/use-aria/index.js";
7
+ import { useSizeProp as q } from "../../hooks/use-size/index.js";
8
+ import "@vue/shared";
9
+ import "lodash-unified";
10
+ import "@vueuse/core";
11
+ import "@element-plus/icons-vue";
12
+ import { buildProps as w, definePropType as c } from "../../utils/vue/props/runtime.js";
13
+ import { radioGroupKey as H } from "../radio/constants.js";
14
+ import K, { radioEmits as U } from "../radio/radio.js";
15
+ import J from "../radio-button/radio-button.js";
16
+ const f = {
17
+ label: "label",
18
+ value: "value",
19
+ disabled: "disabled"
20
+ }, Q = w({
21
+ /**
22
+ * @description native `id` attribute
23
+ */
24
+ id: {
25
+ type: String,
26
+ default: void 0
27
+ },
28
+ /**
29
+ * @description the size of radio buttons or bordered radios
30
+ */
31
+ size: q,
32
+ /**
33
+ * @description whether the nesting radios are disabled
34
+ */
35
+ disabled: {
36
+ type: Boolean,
37
+ default: void 0
38
+ },
39
+ /**
40
+ * @description binding value
41
+ */
42
+ modelValue: {
43
+ type: [String, Number, Boolean],
44
+ default: void 0
45
+ },
46
+ /**
47
+ * @description border and background color when button is active
48
+ */
49
+ fill: {
50
+ type: String,
51
+ default: ""
52
+ },
53
+ /**
54
+ * @description font color when button is active
55
+ */
56
+ textColor: {
57
+ type: String,
58
+ default: ""
59
+ },
60
+ /**
61
+ * @description native `name` attribute
62
+ */
63
+ name: {
64
+ type: String,
65
+ default: void 0
66
+ },
67
+ /**
68
+ * @description whether to trigger form validation
69
+ */
70
+ validateEvent: {
71
+ type: Boolean,
72
+ default: !0
73
+ },
74
+ options: {
75
+ type: c(Array)
76
+ },
77
+ props: {
78
+ type: c(Object),
79
+ default: () => f
80
+ },
81
+ type: {
82
+ type: String,
83
+ values: ["radio", "button"],
84
+ default: "radio"
85
+ },
86
+ ...j(["ariaLabel"])
87
+ }), W = U, X = (o, l) => {
88
+ const d = { ...o };
89
+ return l.forEach((n) => delete d[n]), d;
90
+ }, me = G({
14
91
  name: "EpRadioGroup",
15
- props: w,
16
- emits: q,
17
- setup(o, { emit: i, slots: n }) {
18
- const l = V("radio"), p = B(), m = G(), { formItem: r } = M(), { inputId: f, isLabeledByFormItem: c } = O(o, {
19
- formItemContext: r
20
- }), v = (e) => {
21
- i(k, e), T(() => i(D, e));
92
+ props: Q,
93
+ emits: W,
94
+ setup(o, { emit: l, slots: d }) {
95
+ const n = D("radio"), v = O(), p = I(), { formItem: t } = z(), { inputId: b, isLabeledByFormItem: m } = M(o, {
96
+ formItemContext: t
97
+ }), y = (e) => {
98
+ l(V, e), F(() => l(k, e));
22
99
  };
23
- P(() => {
24
- var a;
25
- const e = (a = m.value) == null ? void 0 : a.querySelectorAll("[type=radio]"), t = e == null ? void 0 : e[0];
100
+ A(() => {
101
+ var r;
102
+ const e = (r = p.value) == null ? void 0 : r.querySelectorAll("[type=radio]"), a = e == null ? void 0 : e[0];
26
103
  !Array.from(e ?? []).some(
27
- (d) => d.checked
28
- ) && t && (t.tabIndex = 0);
104
+ (i) => i.checked
105
+ ) && a && (a.tabIndex = 0);
29
106
  });
30
- const b = u(() => o.name || p.value), E = u(() => ({
31
- ...H,
107
+ const E = u(() => o.name || v.value), g = u(() => ({
108
+ ...f,
32
109
  ...o.props
33
- })), g = (e) => {
34
- const { label: t, value: a, disabled: d } = E.value, y = {
35
- label: e[t],
36
- value: e[a],
37
- disabled: e[d]
110
+ })), P = (e) => {
111
+ const { label: a, value: r, disabled: i } = g.value, h = {
112
+ label: e[a],
113
+ value: e[r],
114
+ disabled: e[i]
38
115
  };
39
116
  return {
40
- ...j(e, [t, a, d]),
41
- ...y
117
+ ...X(e, [a, r, i]),
118
+ ...h
42
119
  };
43
- }, I = u(
44
- () => o.type === "button" ? U : K
120
+ }, S = u(
121
+ () => o.type === "button" ? J : K
45
122
  );
46
- return R(
47
- S,
48
- _({
49
- ...L(o),
50
- changeEvent: v,
51
- name: b
123
+ return L(
124
+ H,
125
+ R({
126
+ ..._(o),
127
+ changeEvent: y,
128
+ name: E
52
129
  })
53
130
  ), x(
54
131
  () => o.modelValue,
55
- (e, t) => {
56
- o.validateEvent && e !== t && (r == null || r.validate("change").catch(() => {
132
+ (e, a) => {
133
+ var r, i;
134
+ o.validateEvent && e !== a && ((i = (r = t == null ? void 0 : t.validate) == null ? void 0 : r.call(t, "change")) == null || i.catch(() => {
57
135
  }));
58
136
  }
59
137
  ), () => s(
60
138
  "div",
61
139
  {
62
- id: f.value,
63
- ref: m,
64
- class: l.b("group"),
140
+ id: b.value,
141
+ ref: p,
142
+ class: n.b("group"),
65
143
  role: "radiogroup",
66
- "aria-label": c.value ? void 0 : o.ariaLabel || "radio-group",
67
- "aria-labelledby": c.value ? r == null ? void 0 : r.labelId : void 0
144
+ "aria-label": m.value ? void 0 : o.ariaLabel || "radio-group",
145
+ "aria-labelledby": m.value ? t == null ? void 0 : t.labelId : void 0
68
146
  },
69
147
  [
70
- A(n, "default", {}, () => [
148
+ B(d, "default", {}, () => [
71
149
  s(
72
150
  C,
73
151
  null,
74
- F(
152
+ N(
75
153
  o.options,
76
- (e, t) => s(
77
- I.value,
78
- N({ key: t }, g(e))
154
+ (e, a) => s(
155
+ S.value,
156
+ T({ key: a }, P(e))
79
157
  )
80
158
  )
81
159
  )
@@ -85,5 +163,8 @@ const j = (o, i) => {
85
163
  }
86
164
  });
87
165
  export {
88
- oe as default
166
+ me as default,
167
+ f as radioDefaultProps,
168
+ W as radioGroupEmits,
169
+ Q as radioGroupProps
89
170
  };
@@ -10,34 +10,34 @@ export declare const subMenuProps: {
10
10
  readonly hideTimeout: NumberConstructor;
11
11
  readonly popperClass: StringConstructor;
12
12
  readonly popperStyle: {
13
- readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties) | (((new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties)) | null)[], unknown, unknown>>;
13
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties) | (((new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties)) | null)[], unknown, unknown>>;
14
14
  readonly required: false;
15
15
  readonly validator: ((val: unknown) => boolean) | undefined;
16
16
  __epPropKey: true;
17
17
  };
18
18
  readonly disabled: BooleanConstructor;
19
- readonly teleported: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
19
+ readonly teleported: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
20
20
  readonly popperOffset: NumberConstructor;
21
21
  readonly expandCloseIcon: {
22
- readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
22
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
23
23
  readonly required: false;
24
24
  readonly validator: ((val: unknown) => boolean) | undefined;
25
25
  __epPropKey: true;
26
26
  };
27
27
  readonly expandOpenIcon: {
28
- readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
28
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
29
29
  readonly required: false;
30
30
  readonly validator: ((val: unknown) => boolean) | undefined;
31
31
  __epPropKey: true;
32
32
  };
33
33
  readonly collapseCloseIcon: {
34
- readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
34
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
35
35
  readonly required: false;
36
36
  readonly validator: ((val: unknown) => boolean) | undefined;
37
37
  __epPropKey: true;
38
38
  };
39
39
  readonly collapseOpenIcon: {
40
- readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
40
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
41
41
  readonly required: false;
42
42
  readonly validator: ((val: unknown) => boolean) | undefined;
43
43
  __epPropKey: true;
@@ -55,34 +55,34 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
55
55
  readonly hideTimeout: NumberConstructor;
56
56
  readonly popperClass: StringConstructor;
57
57
  readonly popperStyle: {
58
- readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties) | (((new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties)) | null)[], unknown, unknown>>;
58
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties) | (((new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties)) | null)[], unknown, unknown>>;
59
59
  readonly required: false;
60
60
  readonly validator: ((val: unknown) => boolean) | undefined;
61
61
  __epPropKey: true;
62
62
  };
63
63
  readonly disabled: BooleanConstructor;
64
- readonly teleported: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
64
+ readonly teleported: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
65
65
  readonly popperOffset: NumberConstructor;
66
66
  readonly expandCloseIcon: {
67
- readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
67
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
68
68
  readonly required: false;
69
69
  readonly validator: ((val: unknown) => boolean) | undefined;
70
70
  __epPropKey: true;
71
71
  };
72
72
  readonly expandOpenIcon: {
73
- readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
73
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
74
74
  readonly required: false;
75
75
  readonly validator: ((val: unknown) => boolean) | undefined;
76
76
  __epPropKey: true;
77
77
  };
78
78
  readonly collapseCloseIcon: {
79
- readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
79
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
80
80
  readonly required: false;
81
81
  readonly validator: ((val: unknown) => boolean) | undefined;
82
82
  __epPropKey: true;
83
83
  };
84
84
  readonly collapseOpenIcon: {
85
- readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
85
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
86
86
  readonly required: false;
87
87
  readonly validator: ((val: unknown) => boolean) | undefined;
88
88
  __epPropKey: true;
@@ -100,40 +100,40 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
100
100
  readonly hideTimeout: NumberConstructor;
101
101
  readonly popperClass: StringConstructor;
102
102
  readonly popperStyle: {
103
- readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties) | (((new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties)) | null)[], unknown, unknown>>;
103
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties) | (((new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties)) | null)[], unknown, unknown>>;
104
104
  readonly required: false;
105
105
  readonly validator: ((val: unknown) => boolean) | undefined;
106
106
  __epPropKey: true;
107
107
  };
108
108
  readonly disabled: BooleanConstructor;
109
- readonly teleported: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
109
+ readonly teleported: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
110
110
  readonly popperOffset: NumberConstructor;
111
111
  readonly expandCloseIcon: {
112
- readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
112
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
113
113
  readonly required: false;
114
114
  readonly validator: ((val: unknown) => boolean) | undefined;
115
115
  __epPropKey: true;
116
116
  };
117
117
  readonly expandOpenIcon: {
118
- readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
118
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
119
119
  readonly required: false;
120
120
  readonly validator: ((val: unknown) => boolean) | undefined;
121
121
  __epPropKey: true;
122
122
  };
123
123
  readonly collapseCloseIcon: {
124
- readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
124
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
125
125
  readonly required: false;
126
126
  readonly validator: ((val: unknown) => boolean) | undefined;
127
127
  __epPropKey: true;
128
128
  };
129
129
  readonly collapseOpenIcon: {
130
- readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
130
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
131
131
  readonly required: false;
132
132
  readonly validator: ((val: unknown) => boolean) | undefined;
133
133
  __epPropKey: true;
134
134
  };
135
135
  }>> & Readonly<{}>, {
136
- readonly teleported: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
137
136
  readonly disabled: boolean;
137
+ readonly teleported: import("@element-plus/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
138
138
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
139
139
  export default _default;