@yimou6/common-ui 1.12.15 → 1.12.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/cdn/index.cdn.js +2 -2
  2. package/cdn/index.cdn.js.map +1 -1
  3. package/cdn/index.cdn.mjs +2 -2
  4. package/cdn/index.cdn.mjs.map +1 -1
  5. package/es/components/form/src/form.d.ts +12 -12
  6. package/es/components/form/src/form.mjs.map +1 -1
  7. package/es/components/radio/index.d.ts +7 -3
  8. package/es/components/radio/src/radio.d.ts +2 -1
  9. package/es/components/radio/src/radio.mjs +4 -3
  10. package/es/components/radio/src/radio.mjs.map +1 -1
  11. package/es/components/radio/src/radio.vue.d.ts +7 -3
  12. package/es/components/radio/src/radio.vue2.mjs +3 -2
  13. package/es/components/radio/src/radio.vue2.mjs.map +1 -1
  14. package/es/components/select/index.d.ts +9 -0
  15. package/es/components/select/src/select.d.ts +5 -2
  16. package/es/components/select/src/select.mjs +4 -1
  17. package/es/components/select/src/select.mjs.map +1 -1
  18. package/es/components/select/src/select.vue.d.ts +9 -0
  19. package/es/components/select/src/select.vue2.mjs +5 -1
  20. package/es/components/select/src/select.vue2.mjs.map +1 -1
  21. package/es/element-plus.types.d.ts +161 -32
  22. package/lib/components/form/src/form.d.ts +12 -12
  23. package/lib/components/form/src/form.js.map +1 -1
  24. package/lib/components/radio/index.d.ts +7 -3
  25. package/lib/components/radio/src/radio.d.ts +2 -1
  26. package/lib/components/radio/src/radio.js +4 -3
  27. package/lib/components/radio/src/radio.js.map +1 -1
  28. package/lib/components/radio/src/radio.vue.d.ts +7 -3
  29. package/lib/components/radio/src/radio.vue2.js +3 -2
  30. package/lib/components/radio/src/radio.vue2.js.map +1 -1
  31. package/lib/components/select/index.d.ts +9 -0
  32. package/lib/components/select/src/select.d.ts +5 -2
  33. package/lib/components/select/src/select.js +4 -1
  34. package/lib/components/select/src/select.js.map +1 -1
  35. package/lib/components/select/src/select.vue.d.ts +9 -0
  36. package/lib/components/select/src/select.vue2.js +5 -1
  37. package/lib/components/select/src/select.vue2.js.map +1 -1
  38. package/lib/element-plus.types.d.ts +161 -32
  39. package/package.json +1 -1
@@ -1,5 +1,7 @@
1
1
  import type { Component } from "vue";
2
2
  export interface ElInputProps {
3
+ ariaLabel?: string;
4
+ id?: string;
3
5
  size?: "" | "default" | "small" | "large";
4
6
  disabled?: boolean;
5
7
  modelValue?: string | number | null | undefined;
@@ -7,8 +9,9 @@ export interface ElInputProps {
7
9
  minlength?: string | number;
8
10
  type?: string;
9
11
  resize?: "none" | "both" | "horizontal" | "vertical";
10
- autosize?: boolean | object;
12
+ autosize?: boolean | Record<string, number>;
11
13
  autocomplete?: string;
14
+ name?: string;
12
15
  formatter?: Function;
13
16
  parser?: Function;
14
17
  placeholder?: string;
@@ -19,14 +22,17 @@ export interface ElInputProps {
19
22
  showWordLimit?: boolean;
20
23
  suffixIcon?: string | Component;
21
24
  prefixIcon?: string | Component;
22
- containerRole?: string | undefined;
25
+ containerRole?: string;
23
26
  tabindex?: string | number;
24
27
  validateEvent?: boolean;
25
28
  autofocus?: boolean;
26
- inputStyle?: object | any[] | string;
29
+ inputStyle?: Record<string, unknown> | string;
27
30
  rows?: number;
28
31
  }
29
32
  export interface ElSelectProps {
33
+ ariaLabel?: string;
34
+ id?: string;
35
+ modelValue?: string | number | boolean | Record<string, unknown> | unknown[];
30
36
  multiple?: boolean;
31
37
  disabled?: boolean;
32
38
  valueKey?: string;
@@ -34,30 +40,44 @@ export interface ElSelectProps {
34
40
  clearable?: boolean;
35
41
  collapseTags?: boolean;
36
42
  collapseTagsTooltip?: boolean;
43
+ maxCollapseTags?: number;
37
44
  multipleLimit?: number;
38
45
  name?: string;
39
- effect?: "dark" | "light";
46
+ effect?: "dark" | "light" | string;
40
47
  autocomplete?: string;
41
48
  placeholder?: string;
42
49
  filterable?: boolean;
43
50
  allowCreate?: boolean;
44
- filterMethod?: () => void;
51
+ filterMethod?: Function;
45
52
  remote?: boolean;
46
- remoteMethod?: () => void;
53
+ remoteMethod?: Function;
47
54
  remoteShowSuffix?: boolean;
48
55
  loading?: boolean;
49
56
  loadingText?: string;
50
57
  noMatchText?: string;
51
58
  noDataText?: string;
52
59
  popperClass?: string;
60
+ popperOptions?: Record<string, unknown>;
53
61
  reserveKeyword?: boolean;
54
62
  defaultFirstOption?: boolean;
55
63
  teleported?: boolean;
56
64
  persistent?: boolean;
57
- clearIcon?: string | object;
65
+ clearIcon?: string | Component;
58
66
  fitInputWidth?: boolean;
67
+ suffixIcon?: string | Component;
68
+ tagType?: "success" | "info" | "warning" | "danger" | "" | undefined;
69
+ emptyValues?: unknown[];
70
+ valueOnClear?: string | number | boolean | (() => string | number | boolean);
71
+ placement?: "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end";
72
+ offset?: number;
73
+ fallbackPlacements?: string[];
74
+ suffixTransition?: boolean;
75
+ automaticDropdown?: boolean;
59
76
  }
60
77
  export interface ElInputNumberProps {
78
+ ariaLabel?: string;
79
+ id?: string;
80
+ modelValue?: number | undefined;
61
81
  min?: number;
62
82
  max?: number;
63
83
  step?: number;
@@ -68,8 +88,15 @@ export interface ElInputNumberProps {
68
88
  disabled?: boolean;
69
89
  controls?: boolean;
70
90
  controlsPosition?: "" | "right";
91
+ name?: string;
92
+ placeholder?: string;
93
+ valueOnClear?: number | null | "min" | "max";
94
+ validateEvent?: boolean;
71
95
  }
72
96
  export interface ElDatePickerProps {
97
+ ariaLabel?: string;
98
+ id?: string;
99
+ modelValue?: Date | number | string | [Date, Date] | [number, number] | [string, string];
73
100
  readonly?: boolean;
74
101
  disabled?: boolean;
75
102
  size?: "" | "large" | "default" | "small";
@@ -81,48 +108,69 @@ export interface ElDatePickerProps {
81
108
  type?: "year" | "years" | "month" | "months" | "date" | "dates" | "datetime" | "week" | "datetimerange" | "daterange" | "monthrange" | "yearrange";
82
109
  format?: string;
83
110
  popperClass?: string;
84
- popperOptions?: object;
111
+ popperOptions?: Record<string, unknown>;
85
112
  rangeSeparator?: string;
86
- defaultValue?: object;
87
- defaultTime?: object;
113
+ defaultValue?: Date | [Date, Date];
114
+ defaultTime?: Date | [Date, Date];
88
115
  valueFormat?: string;
89
116
  unlinkPanels?: boolean;
90
- shortcuts?: object;
117
+ shortcuts?: {
118
+ text: string;
119
+ value: Date | (() => Date);
120
+ }[];
91
121
  teleported?: boolean;
92
- disabledDate?: (date: any) => boolean;
122
+ disabledDate?: Function;
123
+ cellClassName?: Function;
124
+ prefixIcon?: string | Component;
125
+ clearIcon?: string | Component;
126
+ suffixIcon?: string | Component;
127
+ name?: string;
93
128
  }
94
129
  export interface ElCascaderProps {
130
+ ariaLabel?: string;
131
+ id?: string;
132
+ modelValue?: string | number | (string | number)[] | null;
95
133
  size?: "" | "large" | "default" | "small";
96
134
  disabled?: boolean;
97
135
  clearable?: boolean;
98
136
  filterable?: boolean;
99
- filterMethod?: () => void;
137
+ filterMethod?: Function;
100
138
  separator?: string;
101
139
  showAllLevels?: boolean;
102
140
  collapseTags?: boolean;
103
141
  collapseTagsTooltip?: boolean;
142
+ maxCollapseTags?: number;
104
143
  debounce?: number;
105
- beforeFilter?: () => void;
144
+ beforeFilter?: Function;
106
145
  popperClass?: string;
107
146
  placeholder?: string;
108
- props?: {
109
- multiple?: boolean;
110
- value?: string;
111
- label?: string;
112
- children?: string;
113
- disabled?: string;
114
- leaf?: string;
115
- checkStrictly?: boolean;
116
- emitPath?: boolean;
117
- expandTrigger?: "click" | "hover";
118
- lazy?: boolean;
119
- lazyLoad?: () => void;
120
- hoverThreshold?: number;
121
- };
147
+ props?: CascaderPanelProps;
122
148
  expandTrigger?: "click" | "hover";
123
149
  options?: Record<string, unknown>[];
150
+ tagType?: "success" | "info" | "warning" | "danger" | "" | undefined;
151
+ popperOptions?: Record<string, unknown>;
152
+ placement?: "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end";
153
+ offset?: number;
154
+ validateEvent?: boolean;
155
+ teleported?: boolean;
156
+ }
157
+ export interface CascaderPanelProps {
158
+ multiple?: boolean;
159
+ value?: string;
160
+ label?: string;
161
+ children?: string;
162
+ disabled?: string;
163
+ leaf?: string;
164
+ checkStrictly?: boolean;
165
+ emitPath?: boolean;
166
+ expandTrigger?: "click" | "hover";
167
+ lazy?: boolean;
168
+ lazyLoad?: Function;
169
+ hoverThreshold?: number;
124
170
  }
125
171
  export interface ElSwitchProps {
172
+ ariaLabel?: string;
173
+ id?: string;
126
174
  disabled?: boolean;
127
175
  loading?: boolean;
128
176
  inlinePrompt?: boolean;
@@ -138,8 +186,14 @@ export interface ElSwitchProps {
138
186
  name?: string;
139
187
  validateEvent?: boolean;
140
188
  tabindex?: string | number;
189
+ beforeChange?: Function;
190
+ activeIcon?: string | Component;
191
+ inactiveIcon?: string | Component;
141
192
  }
142
193
  export interface ElTimePickerProps {
194
+ ariaLabel?: string;
195
+ id?: string;
196
+ modelValue?: Date | string | [Date, Date] | [string, string];
143
197
  readonly?: boolean;
144
198
  disabled?: boolean;
145
199
  size?: "" | "large" | "default" | "small";
@@ -151,16 +205,22 @@ export interface ElTimePickerProps {
151
205
  format?: string;
152
206
  valueFormat?: string;
153
207
  rangeSeparator?: string;
154
- defaultValue?: object;
208
+ defaultValue?: Date | [Date, Date];
155
209
  isRange?: boolean;
156
210
  arrowControl?: boolean;
157
211
  popperClass?: string;
158
- disabledHours?: (role: string, comparingDate?: any) => number[];
159
- disabledMinutes?: (hour: number, role: string, comparingDate?: any) => number[];
160
- disabledSeconds?: (hour: number, minute: number, role: string, comparingDate?: any) => number[];
212
+ disabledHours?: Function;
213
+ disabledMinutes?: Function;
214
+ disabledSeconds?: Function;
161
215
  teleported?: boolean;
216
+ name?: string;
217
+ prefixIcon?: string | Component;
218
+ clearIcon?: string | Component;
219
+ suffixIcon?: string | Component;
162
220
  }
163
221
  export interface ElRadioGroupProps {
222
+ ariaLabel?: string;
223
+ id?: string;
164
224
  size?: "" | "small" | "default" | "large";
165
225
  disabled?: boolean;
166
226
  modelValue?: string | number | boolean;
@@ -169,3 +229,72 @@ export interface ElRadioGroupProps {
169
229
  name?: string;
170
230
  validateEvent?: boolean;
171
231
  }
232
+ export interface ElCheckboxProps {
233
+ ariaLabel?: string;
234
+ id?: string;
235
+ modelValue?: string | number | boolean;
236
+ label?: string | number | boolean | Record<string, unknown>;
237
+ indeterminate?: boolean;
238
+ disabled?: boolean;
239
+ checked?: boolean;
240
+ name?: string;
241
+ trueLabel?: string | number;
242
+ falseLabel?: string | number;
243
+ border?: boolean;
244
+ size?: "" | "large" | "default" | "small";
245
+ tabindex?: string | number;
246
+ validateEvent?: boolean;
247
+ }
248
+ export interface ElRateProps {
249
+ ariaLabel?: string;
250
+ id?: string;
251
+ modelValue?: number;
252
+ lowThreshold?: number;
253
+ highThreshold?: number;
254
+ max?: number;
255
+ disabled?: boolean;
256
+ allowHalf?: boolean;
257
+ showText?: boolean;
258
+ showScore?: boolean;
259
+ textColor?: string;
260
+ texts?: string[];
261
+ scoreTemplate?: string;
262
+ size?: "" | "large" | "default" | "small";
263
+ clearable?: boolean;
264
+ voidColor?: string;
265
+ disabledVoidColor?: string;
266
+ voidIcon?: string | Component;
267
+ disabledVoidIcon?: string | Component;
268
+ icons?: (string | Component)[];
269
+ colors?: string[] | Record<number, string>;
270
+ }
271
+ export interface ElSliderProps {
272
+ ariaLabel?: string;
273
+ id?: string;
274
+ modelValue?: number | [number, number];
275
+ min?: number;
276
+ max?: number;
277
+ step?: number;
278
+ disabled?: boolean;
279
+ showInput?: boolean;
280
+ showInputControls?: boolean;
281
+ inputSize?: "" | "large" | "default" | "small";
282
+ showStops?: boolean;
283
+ showTooltip?: boolean;
284
+ formatTooltip?: Function;
285
+ formatValueText?: Function;
286
+ vertical?: boolean;
287
+ height?: string;
288
+ debounce?: number;
289
+ range?: boolean;
290
+ rangeStartLabel?: string;
291
+ rangeEndLabel?: string;
292
+ tooltipClass?: string;
293
+ marks?: Record<number, string | {
294
+ style: Record<string, unknown>;
295
+ label: string;
296
+ }>;
297
+ placement?: "top" | "bottom" | "right" | "left";
298
+ validateEvent?: boolean;
299
+ persistent?: boolean;
300
+ }
@@ -1,15 +1,15 @@
1
- import type { ExtractPropTypes, ExtractPublicPropTypes, PropType, Ref } from 'vue';
2
- import type { DatePickerProps, MonthPickerProps, QuarterPickerProps, RangePickerProps, WeekPickerProps, YearPickerProps } from '../../../arco.types';
3
- import type { ElCascaderProps, ElDatePickerProps, ElInputNumberProps, ElInputProps, ElSwitchProps, ElTimePickerProps } from '../../../element-plus.types';
4
- import type { CheckboxPublicPropsType } from '../../checkbox/src/checkbox';
5
- import type { DividerPublicPropsType } from '../../divider/src/divider';
6
- import type { RadioPublicPropsType } from '../../radio/src/radio';
7
- import type { SelectPublicPropsType } from '../../select/src/select';
8
- import type Form from './form.vue';
9
- type ELComp = 'el-input' | 'el-input-number' | 'el-date-picker' | 'el-time-picker' | 'el-cascader' | 'el-switch';
10
- type IComp = 'i-divider' | 'i-select' | 'i-radio' | 'i-checkbox' | 'i-date-picker';
11
- type ArcoComp = 'a-range-picker' | 'a-date-picker' | 'a-week-picker' | 'a-quarter-picker' | 'a-year-picker' | 'a-month-picker';
12
- export type FormItemComp = ELComp | ArcoComp | IComp | 'slot';
1
+ import type { ExtractPropTypes, ExtractPublicPropTypes, PropType, Ref } from "vue";
2
+ import type { DatePickerProps, MonthPickerProps, QuarterPickerProps, RangePickerProps, WeekPickerProps, YearPickerProps } from "../../../arco.types";
3
+ import type { ElCascaderProps, ElDatePickerProps, ElInputNumberProps, ElInputProps, ElSwitchProps, ElTimePickerProps } from "../../../element-plus.types";
4
+ import type { CheckboxPublicPropsType } from "../../checkbox/src/checkbox";
5
+ import type { DividerPublicPropsType } from "../../divider/src/divider";
6
+ import type { RadioPublicPropsType } from "../../radio/src/radio";
7
+ import type { SelectPublicPropsType } from "../../select/src/select";
8
+ import type Form from "./form.vue";
9
+ type ELComp = "el-input" | "el-input-number" | "el-date-picker" | "el-time-picker" | "el-cascader" | "el-switch";
10
+ type IComp = "i-divider" | "i-select" | "i-radio" | "i-checkbox" | "i-date-picker";
11
+ type ArcoComp = "a-range-picker" | "a-date-picker" | "a-week-picker" | "a-quarter-picker" | "a-year-picker" | "a-month-picker";
12
+ export type FormItemComp = ELComp | ArcoComp | IComp | "slot";
13
13
  export declare const FormProps: {
14
14
  model: {
15
15
  type: ObjectConstructor;
@@ -1 +1 @@
1
- {"version":3,"file":"form.js","sources":["../../../../../../../packages/components/form/src/form.ts"],"sourcesContent":["import type { ExtractPropTypes, ExtractPublicPropTypes, PropType, Ref } from 'vue';\nimport type {\n DatePickerProps,\n MonthPickerProps,\n QuarterPickerProps,\n RangePickerProps,\n WeekPickerProps,\n YearPickerProps,\n} from '../../../arco.types';\nimport type {\n ElCascaderProps,\n ElDatePickerProps,\n ElInputNumberProps,\n ElInputProps,\n ElSwitchProps,\n ElTimePickerProps,\n} from '../../../element-plus.types';\nimport type { CheckboxPublicPropsType } from '../../checkbox/src/checkbox';\nimport type { DividerPublicPropsType } from '../../divider/src/divider';\nimport type { RadioPublicPropsType } from '../../radio/src/radio';\nimport type { SelectPublicPropsType } from '../../select/src/select';\nimport type Form from './form.vue';\n\n// el-* element-plus组件名称\ntype ELComp = 'el-input' | 'el-input-number' | 'el-date-picker' | 'el-time-picker' | 'el-cascader' | 'el-switch';\nconst ElCompProps = {\n elInput: Object as PropType<ElInputProps>,\n elInputNumber: Object as PropType<ElInputNumberProps>,\n elDatePicker: Object as PropType<ElDatePickerProps>,\n elTimePicker: Object as PropType<ElTimePickerProps>,\n elCascader: Object as PropType<ElCascaderProps>,\n elSwitch: Object as PropType<ElSwitchProps>,\n};\n\n// i-* 自封装组件名称\ntype IComp = 'i-divider' | 'i-select' | 'i-radio' | 'i-checkbox' | 'i-date-picker';\nconst ICompProps = {\n iDivider: Object as PropType<DividerPublicPropsType>,\n iSelect: Object as PropType<SelectPublicPropsType>,\n iRadio: Object as PropType<RadioPublicPropsType>,\n iCheckbox: Object as PropType<CheckboxPublicPropsType>,\n iDatePicker: Object as PropType<ElDatePickerProps>,\n};\n\n// a-* arco design组件名称\ntype ArcoComp =\n | 'a-range-picker'\n | 'a-date-picker'\n | 'a-week-picker'\n | 'a-quarter-picker'\n | 'a-year-picker'\n | 'a-month-picker';\nconst ArcoCompProps = {\n aRangePicker: Object as PropType<RangePickerProps>,\n aDatePicker: Object as PropType<DatePickerProps>,\n aWeekPicker: Object as PropType<WeekPickerProps>,\n aQuarterPicker: Object as PropType<QuarterPickerProps>,\n aYearPicker: Object as PropType<YearPickerProps>,\n aMonthPicker: Object as PropType<MonthPickerProps>,\n};\n\nexport type FormItemComp = ELComp | ArcoComp | IComp | 'slot';\n\nexport const FormProps = {\n model: {\n type: Object,\n default: () => ({}),\n },\n rules: {\n type: Object,\n default: () => ({}),\n },\n inline: {\n type: Boolean,\n default: false,\n },\n labelPosition: {\n type: String as PropType<'left' | 'right' | 'top'>,\n default: 'right',\n },\n labelWidth: {\n type: [String, Number],\n default: 'auto',\n },\n labelSuffix: {\n type: String,\n default: '',\n },\n hideRequiredAsterisk: {\n type: Boolean,\n default: false,\n },\n requireAsteriskPosition: {\n type: String as PropType<'left' | 'right'>,\n default: 'left',\n },\n showMessage: {\n type: Boolean,\n default: true,\n },\n inlineMessage: {\n type: Boolean,\n default: false,\n },\n statusIcon: {\n type: Boolean,\n default: false,\n },\n validateOnRuleChange: {\n type: Boolean,\n default: true,\n },\n size: {\n type: String as PropType<'large' | 'default' | 'small' | ''>,\n default: '',\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n scrollToError: {\n type: Boolean,\n default: false,\n },\n scrollIntoViewOptions: {\n type: [Object, Boolean],\n default: false,\n },\n /**\n * 自定义的 props\n */\n // grid 模式下,每行显示的列数\n column: {\n type: Number,\n default: 1,\n },\n // 显示的表单字段\n fields: {\n type: Array as PropType<FormItemPropsType[]>,\n default: () => [],\n },\n action: Object,\n};\nexport const FormItemProps = {\n prop: {\n type: String,\n },\n label: {\n type: String,\n },\n labelWidth: {\n type: [String, Number],\n },\n // 踩了一个坑,这里默认设置为true和false都会影响到表单验证(rules)\n // 体现为:必须手动调用formRef.validate(),否则不会触发表单验证。\n required: {\n type: Boolean,\n default: undefined,\n },\n rules: Object,\n error: String,\n showMessage: {\n type: Boolean,\n default: true,\n },\n inlineMessage: {\n type: [String, Boolean],\n },\n size: {\n type: String as PropType<'' | 'large' | 'default' | 'small'>,\n },\n validateStatus: {\n type: String as PropType<'' | 'error' | 'validating' | 'success'>,\n },\n /**\n * 自定义属性\n */\n modelValue: [String, Array, Boolean, Number, Object],\n // 列\n column: {\n type: Number,\n default: 1,\n },\n // 行\n row: {\n type: Number,\n default: 1,\n },\n className: {\n type: [String, Array],\n default: '',\n },\n style: {\n type: Object,\n default: () => ({}),\n },\n // 组件名称\n comp: {\n type: String as PropType<FormItemComp>,\n required: true,\n },\n action: Object,\n ...ElCompProps,\n ...ICompProps,\n ...ArcoCompProps,\n};\n\nexport const formItemExcludeKeys = [\n 'modelValue',\n 'column',\n 'row',\n 'className',\n 'comp',\n 'elInput',\n 'elInputNumber',\n 'elDatePicker',\n 'elTimePicker',\n 'elCascader',\n 'elSwitch',\n 'iDivider',\n 'iSelect',\n 'iRadio',\n 'iCheckbox',\n 'pureUpload',\n 'action',\n];\n\nexport type ArrayAble<T> = T[] | T;\n\nexport type FormPropsType = ExtractPropTypes<typeof FormProps>;\nexport type FormItemPropsType = ExtractPublicPropTypes<typeof FormItemProps>;\nexport type FormInstance = InstanceType<typeof Form>;\n\n/**\n * 设置 fields 的属性值\n */\nexport function iFormSetFieldValue(fields: Ref<FormItemPropsType[]>, prop: string, valOpt: Record<string, any>) {\n const index = fields.value.findIndex(item => item.prop === prop);\n if (index === -1) {\n console.error(`field ${prop} is not found!`);\n return;\n }\n Object.keys(valOpt).forEach(key => {\n if (key.includes('.')) {\n const keys = key.split('.');\n const [key1, key2, key3] = keys;\n if (keys.length === 2) {\n // @ts-ignore\n fields.value[index][key1][key2] = valOpt[key];\n } else if (keys.length === 3) {\n // @ts-ignore\n fields.value[index][key1][key2][key3] = valOpt[key];\n } else {\n console.error(`field ${prop} is error!`);\n }\n } else {\n // @ts-ignore\n fields.value[index][key] = valOpt[key];\n }\n });\n}\n"],"names":[],"mappings":";;;;AAyBA,MAAM,WAAc,GAAA;AAAA,EAClB,OAAS,EAAA,MAAA;AAAA,EACT,aAAe,EAAA,MAAA;AAAA,EACf,YAAc,EAAA,MAAA;AAAA,EACd,YAAc,EAAA,MAAA;AAAA,EACd,UAAY,EAAA,MAAA;AAAA,EACZ,QAAU,EAAA;AACZ,CAAA;AAIA,MAAM,UAAa,GAAA;AAAA,EACjB,QAAU,EAAA,MAAA;AAAA,EACV,OAAS,EAAA,MAAA;AAAA,EACT,MAAQ,EAAA,MAAA;AAAA,EACR,SAAW,EAAA,MAAA;AAAA,EACX,WAAa,EAAA;AACf,CAAA;AAUA,MAAM,aAAgB,GAAA;AAAA,EACpB,YAAc,EAAA,MAAA;AAAA,EACd,WAAa,EAAA,MAAA;AAAA,EACb,WAAa,EAAA,MAAA;AAAA,EACb,cAAgB,EAAA,MAAA;AAAA,EAChB,WAAa,EAAA,MAAA;AAAA,EACb,YAAc,EAAA;AAChB,CAAA;AAIO,MAAM,SAAY,GAAA;AAAA,EACvB,KAAO,EAAA;AAAA,IACL,IAAM,EAAA,MAAA;AAAA,IACN,OAAA,kBAAgB,MAAA,CAAA,OAAA,EAAP,CAAA,EAAA,SAAA;AAAA,GACX;AAAA,EACA,KAAO,EAAA;AAAA,IACL,IAAM,EAAA,MAAA;AAAA,IACN,OAAA,kBAAgB,MAAA,CAAA,OAAA,EAAP,CAAA,EAAA,SAAA;AAAA,GACX;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA;AAAA,GACX;AAAA,EACA,aAAe,EAAA;AAAA,IACb,IAAM,EAAA,M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CAAI,GAAA,IAAA;AAC3B,MAAI,IAAA,IAAA,CAAK,WAAW,CAAG,EAAA;AAErB,QAAO,MAAA,CAAA,KAAA,CAAM,KAAK,CAAE,CAAA,IAAI,EAAE,IAAI,CAAA,GAAI,OAAO,GAAG,CAAA;AAAA,OAC9C,MAAA,IAAW,IAAK,CAAA,MAAA,KAAW,CAAG,EAAA;AAE5B,QAAO,MAAA,CAAA,KAAA,CAAM,KAAK,CAAA,CAAE,IAAI,CAAA,CAAE,IAAI,CAAE,CAAA,IAAI,CAAI,GAAA,MAAA,CAAO,GAAG,CAAA;AAAA,OAC7C,MAAA;AACL,QAAQ,OAAA,CAAA,KAAA,CAAM,CAAS,MAAA,EAAA,IAAI,CAAY,UAAA,CAAA,CAAA;AAAA;AACzC,KACK,MAAA;AAEL,MAAA,MAAA,CAAO,MAAM,KAAK,CAAA,CAAE,GAAG,CAAA,GAAI,OAAO,GAAG,CAAA;AAAA;AACvC,GACD,CAAA;AACH;AAxBgB,MAAA,CAAA,kBAAA,EAAA,oBAAA,CAAA;;;;;;;"}
1
+ {"version":3,"file":"form.js","sources":["../../../../../../../packages/components/form/src/form.ts"],"sourcesContent":["import type {\n ExtractPropTypes,\n ExtractPublicPropTypes,\n PropType,\n Ref,\n} from \"vue\";\nimport type {\n DatePickerProps,\n MonthPickerProps,\n QuarterPickerProps,\n RangePickerProps,\n WeekPickerProps,\n YearPickerProps,\n} from \"../../../arco.types\";\nimport type {\n ElCascaderProps,\n ElDatePickerProps,\n ElInputNumberProps,\n ElInputProps,\n ElSwitchProps,\n ElTimePickerProps,\n} from \"../../../element-plus.types\";\nimport type { CheckboxPublicPropsType } from \"../../checkbox/src/checkbox\";\nimport type { DividerPublicPropsType } from \"../../divider/src/divider\";\nimport type { RadioPublicPropsType } from \"../../radio/src/radio\";\nimport type { SelectPublicPropsType } from \"../../select/src/select\";\nimport type Form from \"./form.vue\";\n\n// el-* element-plus组件名称\ntype ELComp =\n | \"el-input\"\n | \"el-input-number\"\n | \"el-date-picker\"\n | \"el-time-picker\"\n | \"el-cascader\"\n | \"el-switch\";\nconst ElCompProps = {\n elInput: Object as PropType<ElInputProps>,\n elInputNumber: Object as PropType<ElInputNumberProps>,\n elDatePicker: Object as PropType<ElDatePickerProps>,\n elTimePicker: Object as PropType<ElTimePickerProps>,\n elCascader: Object as PropType<ElCascaderProps>,\n elSwitch: Object as PropType<ElSwitchProps>,\n};\n\n// i-* 自封装组件名称\ntype IComp =\n | \"i-divider\"\n | \"i-select\"\n | \"i-radio\"\n | \"i-checkbox\"\n | \"i-date-picker\";\nconst ICompProps = {\n iDivider: Object as PropType<DividerPublicPropsType>,\n iSelect: Object as PropType<SelectPublicPropsType>,\n iRadio: Object as PropType<RadioPublicPropsType>,\n iCheckbox: Object as PropType<CheckboxPublicPropsType>,\n iDatePicker: Object as PropType<ElDatePickerProps>,\n};\n\n// a-* arco design组件名称\ntype ArcoComp =\n | \"a-range-picker\"\n | \"a-date-picker\"\n | \"a-week-picker\"\n | \"a-quarter-picker\"\n | \"a-year-picker\"\n | \"a-month-picker\";\nconst ArcoCompProps = {\n aRangePicker: Object as PropType<RangePickerProps>,\n aDatePicker: Object as PropType<DatePickerProps>,\n aWeekPicker: Object as PropType<WeekPickerProps>,\n aQuarterPicker: Object as PropType<QuarterPickerProps>,\n aYearPicker: Object as PropType<YearPickerProps>,\n aMonthPicker: Object as PropType<MonthPickerProps>,\n};\n\nexport type FormItemComp = ELComp | ArcoComp | IComp | \"slot\";\n\nexport const FormProps = {\n model: {\n type: Object,\n default: () => ({}),\n },\n rules: {\n type: Object,\n default: () => ({}),\n },\n inline: {\n type: Boolean,\n default: false,\n },\n labelPosition: {\n type: String as PropType<\"left\" | \"right\" | \"top\">,\n default: \"right\",\n },\n labelWidth: {\n type: [String, Number],\n default: \"auto\",\n },\n labelSuffix: {\n type: String,\n default: \"\",\n },\n hideRequiredAsterisk: {\n type: Boolean,\n default: false,\n },\n requireAsteriskPosition: {\n type: String as PropType<\"left\" | \"right\">,\n default: \"left\",\n },\n showMessage: {\n type: Boolean,\n default: true,\n },\n inlineMessage: {\n type: Boolean,\n default: false,\n },\n statusIcon: {\n type: Boolean,\n default: false,\n },\n validateOnRuleChange: {\n type: Boolean,\n default: true,\n },\n size: {\n type: String as PropType<\"large\" | \"default\" | \"small\" | \"\">,\n default: \"\",\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n scrollToError: {\n type: Boolean,\n default: false,\n },\n scrollIntoViewOptions: {\n type: [Object, Boolean],\n default: false,\n },\n /**\n * 自定义的 props\n */\n // grid 模式下,每行显示的列数\n column: {\n type: Number,\n default: 1,\n },\n // 显示的表单字段\n fields: {\n type: Array as PropType<FormItemPropsType[]>,\n default: () => [],\n },\n action: Object,\n};\nexport const FormItemProps = {\n prop: {\n type: String,\n },\n label: {\n type: String,\n },\n labelWidth: {\n type: [String, Number],\n },\n // 踩了一个坑,这里默认设置为true和false都会影响到表单验证(rules)\n // 体现为:必须手动调用formRef.validate(),否则不会触发表单验证。\n required: {\n type: Boolean,\n default: undefined,\n },\n rules: Object,\n error: String,\n showMessage: {\n type: Boolean,\n default: true,\n },\n inlineMessage: {\n type: [String, Boolean],\n },\n size: {\n type: String as PropType<\"\" | \"large\" | \"default\" | \"small\">,\n },\n validateStatus: {\n type: String as PropType<\"\" | \"error\" | \"validating\" | \"success\">,\n },\n /**\n * 自定义属性\n */\n modelValue: [String, Array, Boolean, Number, Object],\n // 列\n column: {\n type: Number,\n default: 1,\n },\n // 行\n row: {\n type: Number,\n default: 1,\n },\n className: {\n type: [String, Array],\n default: \"\",\n },\n style: {\n type: Object,\n default: () => ({}),\n },\n // 组件名称\n comp: {\n type: String as PropType<FormItemComp>,\n required: true,\n },\n action: Object,\n ...ElCompProps,\n ...ICompProps,\n ...ArcoCompProps,\n};\n\nexport const formItemExcludeKeys = [\n \"modelValue\",\n \"column\",\n \"row\",\n \"className\",\n \"comp\",\n \"elInput\",\n \"elInputNumber\",\n \"elDatePicker\",\n \"elTimePicker\",\n \"elCascader\",\n \"elSwitch\",\n \"iDivider\",\n \"iSelect\",\n \"iRadio\",\n \"iCheckbox\",\n \"pureUpload\",\n \"action\",\n];\n\nexport type ArrayAble<T> = T[] | T;\n\nexport type FormPropsType = ExtractPropTypes<typeof FormProps>;\nexport type FormItemPropsType = ExtractPublicPropTypes<typeof FormItemProps>;\nexport type FormInstance = InstanceType<typeof Form>;\n\n/**\n * 设置 fields 的属性值\n */\nexport function iFormSetFieldValue(\n fields: Ref<FormItemPropsType[]>,\n prop: string,\n valOpt: Record<string, any>,\n) {\n const index = fields.value.findIndex((item) => item.prop === prop);\n if (index === -1) {\n console.error(`field ${prop} is not found!`);\n return;\n }\n Object.keys(valOpt).forEach((key) => {\n if (key.includes(\".\")) {\n const keys = key.split(\".\");\n const [key1, key2, key3] = keys;\n if (keys.length === 2) {\n // @ts-ignore\n fields.value[index][key1][key2] = valOpt[key];\n } else if (keys.length === 3) {\n // @ts-ignore\n fields.value[index][key1][key2][key3] = valOpt[key];\n } else {\n console.error(`field ${prop} is error!`);\n }\n } else {\n // @ts-ignore\n fields.value[index][key] = valOpt[key];\n }\n });\n}\n"],"names":[],"mappings":";;;;AAoCA,MAAM,WAAc,GAAA;AAAA,EAClB,OAAS,EAAA,MAAA;AAAA,EACT,aAAe,EAAA,MAAA;AAAA,EACf,YAAc,EAAA,MAAA;AAAA,EACd,YAAc,EAAA,MAAA;AAAA,EACd,UAAY,EAAA,MAAA;AAAA,EACZ,QAAU,EAAA;AACZ,CAAA;AASA,MAAM,UAAa,GAAA;AAAA,EACjB,QAAU,EAAA,MAAA;AAAA,EACV,OAAS,EAAA,MAAA;AAAA,EACT,MAAQ,EAAA,MAAA;AAAA,EACR,SAAW,EAAA,MAAA;AAAA,EACX,WAAa,EAAA;AACf,CAAA;AAUA,MAAM,aAAgB,GAAA;AAAA,EACpB,YAAc,EAAA,MAAA;AAAA,EACd,WAAa,EAAA,MAAA;AAAA,EACb,WAAa,EAAA,MAAA;AAAA,EACb,cAAgB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: string;
38
38
  };
39
- onChange: {
39
+ changeHandler: {
40
40
  type: import("vue").PropType<(value: string | number | boolean | undefined) => void>;
41
+ default: undefined;
41
42
  };
42
43
  }>, {
43
44
  props: import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -78,8 +79,9 @@ export declare const IRadio: import("../../types").SFCWithInstall<import("vue").
78
79
  type: StringConstructor;
79
80
  default: string;
80
81
  };
81
- onChange: {
82
+ changeHandler: {
82
83
  type: import("vue").PropType<(value: string | number | boolean | undefined) => void>;
84
+ default: undefined;
83
85
  };
84
86
  }>> & Readonly<{
85
87
  "onUpdate:modelValue"?: ((_value: string | number | boolean | undefined) => any) | undefined;
@@ -574,8 +576,9 @@ export declare const IRadio: import("../../types").SFCWithInstall<import("vue").
574
576
  type: StringConstructor;
575
577
  default: string;
576
578
  };
577
- onChange: {
579
+ changeHandler: {
578
580
  type: import("vue").PropType<(value: string | number | boolean | undefined) => void>;
581
+ default: undefined;
579
582
  };
580
583
  }>> & Readonly<{
581
584
  "onUpdate:modelValue"?: ((_value: string | number | boolean | undefined) => any) | undefined;
@@ -587,5 +590,6 @@ export declare const IRadio: import("../../types").SFCWithInstall<import("vue").
587
590
  optLabel: string;
588
591
  optValue: string;
589
592
  textColor: string | undefined;
593
+ changeHandler: (value: string | number | boolean | undefined) => void;
590
594
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
591
595
  export default IRadio;
@@ -39,8 +39,9 @@ export declare const RadioProps: {
39
39
  type: StringConstructor;
40
40
  default: string;
41
41
  };
42
- onChange: {
42
+ changeHandler: {
43
43
  type: PropType<(value: string | number | boolean | undefined) => void>;
44
+ default: undefined;
44
45
  };
45
46
  };
46
47
  export declare const RadioEmits: {
@@ -40,8 +40,9 @@ const RadioProps = {
40
40
  type: String,
41
41
  default: "value"
42
42
  },
43
- onChange: {
44
- type: Function
43
+ changeHandler: {
44
+ type: Function,
45
+ default: void 0
45
46
  }
46
47
  };
47
48
  const RadioEmits = {
@@ -55,7 +56,7 @@ const excludeRadioKeys = [
55
56
  "optLabel",
56
57
  "optValue",
57
58
  "modelValue",
58
- "onChange"
59
+ "changeHandler"
59
60
  ];
60
61
 
61
62
  exports.RadioEmits = RadioEmits;
@@ -1 +1 @@
1
- {"version":3,"file":"radio.js","sources":["../../../../../../../packages/components/radio/src/radio.ts"],"sourcesContent":["import type { ExtractPropTypes, ExtractPublicPropTypes, PropType } from \"vue\";\nimport type { ElRadioGroupProps } from \"../../../element-plus.types\";\nimport type Radio from \"./radio.vue\";\n\nexport const RadioProps = {\n modelValue: {\n type: [String, Number, Boolean] as PropType<\n ElRadioGroupProps[\"modelValue\"]\n >,\n },\n size: {\n type: String as PropType<ElRadioGroupProps[\"size\"]>,\n default: \"\",\n },\n disabled: Boolean as PropType<ElRadioGroupProps[\"disabled\"]>,\n textColor: {\n type: String as PropType<ElRadioGroupProps[\"textColor\"]>,\n default: \"\",\n },\n fill: {\n type: String as PropType<ElRadioGroupProps[\"fill\"]>,\n },\n validateEvent: {\n type: Boolean as PropType<ElRadioGroupProps[\"validateEvent\"]>,\n },\n type: {\n type: String as PropType<\"button\" | \"\">,\n default: \"\",\n },\n data: {\n type: [String, Array] as PropType<string | Record<string, any>[]>,\n default: () => [],\n },\n dataCallback: {\n type: Function as PropType<(list: Record<string, any>[]) => any[]>,\n },\n optLabel: {\n type: String,\n default: \"label\",\n },\n optValue: {\n type: String,\n default: \"value\",\n },\n onChange: {\n type: Function as PropType<\n (value: string | number | boolean | undefined) => void\n >,\n },\n};\n\nexport const RadioEmits = {\n \"update:modelValue\": (_value: string | number | boolean | undefined) => true,\n change: (_value: string | number | boolean | undefined) => true,\n};\n\nexport const excludeRadioKeys = [\n \"type\",\n \"data\",\n \"dataCallback\",\n \"optLabel\",\n \"optValue\",\n \"modelValue\",\n \"onChange\",\n];\n\nexport type RadioPropsType = ExtractPropTypes<typeof RadioProps>;\nexport type RadioPublicPropsType = ExtractPublicPropTypes<typeof RadioProps>;\nexport type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,MAAM,gBAAmB,GAAA;AAAA,EAC9B,MAAA;AAAA,EACA,MAAA;AAAA,EACA,cAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF;;;;;;"}
1
+ {"version":3,"file":"radio.js","sources":["../../../../../../../packages/components/radio/src/radio.ts"],"sourcesContent":["import type { ExtractPropTypes, ExtractPublicPropTypes, PropType } from \"vue\";\nimport type { ElRadioGroupProps } from \"../../../element-plus.types\";\nimport type Radio from \"./radio.vue\";\n\nexport const RadioProps = {\n modelValue: {\n type: [String, Number, Boolean] as PropType<\n ElRadioGroupProps[\"modelValue\"]\n >,\n },\n size: {\n type: String as PropType<ElRadioGroupProps[\"size\"]>,\n default: \"\",\n },\n disabled: Boolean as PropType<ElRadioGroupProps[\"disabled\"]>,\n textColor: {\n type: String as PropType<ElRadioGroupProps[\"textColor\"]>,\n default: \"\",\n },\n fill: {\n type: String as PropType<ElRadioGroupProps[\"fill\"]>,\n },\n validateEvent: {\n type: Boolean as PropType<ElRadioGroupProps[\"validateEvent\"]>,\n },\n type: {\n type: String as PropType<\"button\" | \"\">,\n default: \"\",\n },\n data: {\n type: [String, Array] as PropType<string | Record<string, any>[]>,\n default: () => [],\n },\n dataCallback: {\n type: Function as PropType<(list: Record<string, any>[]) => any[]>,\n },\n optLabel: {\n type: String,\n default: \"label\",\n },\n optValue: {\n type: String,\n default: \"value\",\n },\n changeHandler: {\n type: Function as unknown as PropType<\n (value: string | number | boolean | undefined) => void\n >,\n default: undefined,\n },\n};\n\nexport const RadioEmits = {\n \"update:modelValue\": (_value: string | number | boolean | undefined) => true,\n change: (_value: string | number | boolean | undefined) => true,\n};\n\nexport const excludeRadioKeys = [\n \"type\",\n \"data\",\n \"dataCallback\",\n \"optLabel\",\n \"optValue\",\n \"modelValue\",\n \"changeHandler\",\n];\n\nexport type RadioPropsType = ExtractPropTypes<typeof RadioProps>;\nexport type RadioPublicPropsType = ExtractPublicPropTypes<typeof RadioProps>;\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AAA,KAAkD,IAAnD,EAAA,QAAA;AACV;AAEO,MAAM,gBAAmB,GAAA;AAAA,EAC9B,MAAA;AAAA,EACA,MAAA;AAAA,EACA,cAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF;;;;;;"}
@@ -36,8 +36,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
36
36
  type: StringConstructor;
37
37
  default: string;
38
38
  };
39
- onChange: {
39
+ changeHandler: {
40
40
  type: import("vue").PropType<(value: string | number | boolean | undefined) => void>;
41
+ default: undefined;
41
42
  };
42
43
  }>, {
43
44
  props: import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -78,8 +79,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
78
79
  type: StringConstructor;
79
80
  default: string;
80
81
  };
81
- onChange: {
82
+ changeHandler: {
82
83
  type: import("vue").PropType<(value: string | number | boolean | undefined) => void>;
84
+ default: undefined;
83
85
  };
84
86
  }>> & Readonly<{
85
87
  "onUpdate:modelValue"?: ((_value: string | number | boolean | undefined) => any) | undefined;
@@ -574,8 +576,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
574
576
  type: StringConstructor;
575
577
  default: string;
576
578
  };
577
- onChange: {
579
+ changeHandler: {
578
580
  type: import("vue").PropType<(value: string | number | boolean | undefined) => void>;
581
+ default: undefined;
579
582
  };
580
583
  }>> & Readonly<{
581
584
  "onUpdate:modelValue"?: ((_value: string | number | boolean | undefined) => any) | undefined;
@@ -587,5 +590,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
587
590
  optLabel: string;
588
591
  optValue: string;
589
592
  textColor: string | undefined;
593
+ changeHandler: (value: string | number | boolean | undefined) => void;
590
594
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
591
595
  export default _default;
@@ -52,8 +52,9 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
52
52
  { deep: true, immediate: true }
53
53
  );
54
54
  const handleChange = /* @__PURE__ */ __name((val) => {
55
- var _a;
56
- (_a = props.onChange) == null ? void 0 : _a.call(props, val);
55
+ if (typeof props.changeHandler === "function") {
56
+ props.changeHandler(val);
57
+ }
57
58
  emit("change", val);
58
59
  emit("update:modelValue", val);
59
60
  }, "handleChange");
@@ -1 +1 @@
1
- {"version":3,"file":"radio.vue2.js","sources":["../../../../../../../packages/components/radio/src/radio.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ElRadio, ElRadioButton, ElRadioGroup } from \"element-plus\";\nimport { computed, inject, onMounted, ref, watch } from \"vue\";\nimport { DICT_STORE, excludeObjectKeys } from \"../../../utils\";\nimport { excludeRadioKeys, RadioEmits, RadioProps } from \"./radio\";\n\ndefineOptions({\n name: \"IRadio\",\n});\nconst props = defineProps(RadioProps);\nconst emit = defineEmits(RadioEmits);\nconst dictStore = inject(DICT_STORE);\nconst bindAttrs = computed(() => excludeObjectKeys(props, excludeRadioKeys));\n\nconst radioOptions = ref<Record<string, any>[]>([]);\nonMounted(() => setOptions());\nwatch(\n () => props.data,\n () => setOptions(),\n { deep: true },\n);\nasync function setOptions() {\n const list = await getList();\n radioOptions.value = props.dataCallback ? props.dataCallback(list) : list;\n}\n\nasync function getList() {\n if (Array.isArray(props.data)) {\n return props.data;\n }\n if (dictStore) {\n return await dictStore.getDict(props.data);\n }\n return [];\n}\n\nconst value = ref(\"\");\nwatch(\n () => props.modelValue,\n (val: any) => (value.value = val),\n { deep: true, immediate: true },\n);\nconst handleChange = (val: string | number | boolean | undefined) => {\n props.onChange?.(val);\n emit(\"change\", val);\n emit(\"update:modelValue\", val);\n};\n</script>\n\n<template>\n <ElRadioGroup v-model=\"value\" v-bind=\"bindAttrs\" @change=\"handleChange\">\n <template v-if=\"type === 'button'\">\n <ElRadioButton\n v-for=\"item of radioOptions\"\n :key=\"item[optValue]\"\n :label=\"item[optValue]\"\n :disabled=\"item.disabled\"\n >\n {{ item[optLabel] }}\n </ElRadioButton>\n </template>\n <template v-else>\n <ElRadio\n v-for=\"item of radioOptions\"\n :key=\"item[optValue]\"\n :label=\"item[optValue]\"\n :disabled=\"item.disabled\"\n >\n {{ item[optLabel] }}\n </ElRadio>\n </template>\n </ElRadioGroup>\n</template>\n"],"names":["inject","DICT_STORE","computed","excludeObjectKeys","excludeRadioKeys","ref","onMounted","watch","_openBlock","_createBlock","_unref","_mergeProps","type","_createElementBlock","_Fragment","_renderList","ElRadioButton","optValue","_createTextVNode","_toDisplayString","optLabel","ElRadio"],"mappings":";;;;;;;;;;;;;;;;;;;;;AASA,IAAA,MAAM,KAAQ,GAAA,OAAA;AACd,IAAA,MAAM,IAAO,GAAA,MAAA;AACb,IAAM,MAAA,SAAA,GAAYA,WAAOC,kBAAU,CAAA;AACnC,IAAA,MAAM,YAAYC,YAAS,CAAA,MAAMC,sBAAkB,CAAA,KAAA,EAAOC,sBAAgB,CAAC,CAAA;AAE3E,IAAM,MAAA,YAAA,GAAeC,OAA2B,CAAA,EAAE,CAAA;AAClD,IAAUC,aAAA,CAAA,MAAM,YAAY,CAAA;AAC5B,IAAAC,SAAA;AAAA,MACE,MAAM,KAAM,CAAA,IAAA;AAAA,MACZ,MAAM,UAAW,EAAA;AAAA,MACjB,EAAE,MAAM,IAAK;AAAA,KACf;AACA,IAAA,eAAe,UAAa,GAAA;AAC1B,MAAM,MAAA,IAAA,GAAO,MAAM,OAAQ,EAAA;AAC3B,MAAA,YAAA,CAAa,QAAQ,KAAM,CAAA,YAAA,GAAe,KAAM,CAAA,YAAA,CAAa,IAAI,CAAI,GAAA,IAAA;AAAA;AAFxD,IAAA,MAAA,CAAA,UAAA,EAAA,YAAA,CAAA;AAKf,IAAA,eAAe,OAAU,GAAA;AACvB,MAAA,IAAI,KAAM,CAAA,OAAA,CAAQ,KAAM,CAAA,IAAI,CAAG,EAAA;AAC7B,QAAA,OAAO,KAAM,CAAA,IAAA;AAAA;AAEf,MAAA,IAAI,SAAW,EAAA;AACb,QAA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,gBAClB,KAAA,EAAO,IAAKA,CAAAA,IAAAA,CAAQ,QAAA,CAAA;AAAA,gBACpB,UAAU,IAAK,CAAA;AAAA;qCAEhB,MAAoB;AAAA,kBAAjBC,mBAAA;AAAA,oBAAAC,mBAAA,CAAA,IAAA,CAAKC,IAAQ,CAAA,QAAA,CAAA,CAAA;AAAA,oBAAA;AAAA;AAAA;AAAA;;;;;;;mCAIlB,EAAAP,sBAAA;AAAA,YAOUC,YAAA;AAAA,YAAA,EAAA,KAAA,CAAA,EAAA;AAAA,YAAAC,cANO,CAAA,YAAA,CAAY,KAAA,EAAA,CAApB,IAAI,KAAA;sCADbN,eAOU,CAAAC,SAAA,CAAAW,mBAAA,CAAA,EAAA;AAAA,gBALP,GAAA,EAAK,IAAKJ,CAAAA,IAAAA,CAAQ,QAAA,CAAA;AAAA,gBAClB,KAAA,EAAO,IAAKA,CAAAA,IAAAA,CAAQ,QAAA,CAAA;AAAA,gBACpB,UAAU,IAAK,CAAA;AAAA;qCAEhB,MAAoB;AAAA,kBAAjBC,mBAAA;AAAA,oBAAAC,mBAAA,CAAA,IAAA,CAAKC,IAAQ,CAAA,QAAA,CAAA,CAAA;AAAA,oBAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"radio.vue2.js","sources":["../../../../../../../packages/components/radio/src/radio.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ElRadio, ElRadioButton, ElRadioGroup } from \"element-plus\";\nimport { computed, inject, onMounted, ref, watch } from \"vue\";\nimport { DICT_STORE, excludeObjectKeys } from \"../../../utils\";\nimport { excludeRadioKeys, RadioEmits, RadioProps } from \"./radio\";\n\ndefineOptions({\n name: \"IRadio\",\n});\nconst props = defineProps(RadioProps);\nconst emit = defineEmits(RadioEmits);\nconst dictStore = inject(DICT_STORE);\nconst bindAttrs = computed(() => excludeObjectKeys(props, excludeRadioKeys));\n\nconst radioOptions = ref<Record<string, any>[]>([]);\nonMounted(() => setOptions());\nwatch(\n () => props.data,\n () => setOptions(),\n { deep: true },\n);\nasync function setOptions() {\n const list = await getList();\n radioOptions.value = props.dataCallback ? props.dataCallback(list) : list;\n}\n\nasync function getList() {\n if (Array.isArray(props.data)) {\n return props.data;\n }\n if (dictStore) {\n return await dictStore.getDict(props.data);\n }\n return [];\n}\n\nconst value = ref(\"\");\nwatch(\n () => props.modelValue,\n (val: any) => (value.value = val),\n { deep: true, immediate: true },\n);\nconst handleChange = (val: string | number | boolean | undefined) => {\n if (typeof props.changeHandler === \"function\") {\n props.changeHandler(val);\n }\n emit(\"change\", val);\n emit(\"update:modelValue\", val);\n};\n</script>\n\n<template>\n <ElRadioGroup v-model=\"value\" v-bind=\"bindAttrs\" @change=\"handleChange\">\n <template v-if=\"type === 'button'\">\n <ElRadioButton\n v-for=\"item of radioOptions\"\n :key=\"item[optValue]\"\n :label=\"item[optValue]\"\n :disabled=\"item.disabled\"\n >\n {{ item[optLabel] }}\n </ElRadioButton>\n </template>\n <template v-else>\n <ElRadio\n v-for=\"item of radioOptions\"\n :key=\"item[optValue]\"\n :label=\"item[optValue]\"\n :disabled=\"item.disabled\"\n >\n {{ item[optLabel] }}\n </ElRadio>\n </template>\n </ElRadioGroup>\n</template>\n"],"names":["inject","DICT_STORE","computed","excludeObjectKeys","excludeRadioKeys","ref","onMounted","watch","_openBlock","_createBlock","_unref","_mergeProps","type","_createElementBlock","_Fragment","_renderList","ElRadioButton","optValue","_createTextVNode","_toDisplayString","optLabel","ElRadio"],"mappings":";;;;;;;;;;;;;;;;;;;;;AASA,IAAA,MAAM,KAAQ,GAAA,OAAA;AACd,IAAA,MAAM,IAAO,GAAA,MAAA;AACb,IAAM,MAAA,SAAA,GAAYA,WAAOC,kBAAU,CAAA;AACnC,IAAA,MAAM,YAAYC,YAAS,CAAA,MAAMC,sBAAkB,CAAA,KAAA,EAAOC,sBAAgB,CAAC,CAAA;AAE3E,IAAM,MAAA,YAAA,GAAeC,OAA2B,CAAA,EAAE,CAAA;AAClD,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AAAC,mBAAA,CAAA,IAAA,CAAKC,IAAQ,CAAA,QAAA,CAAA,CAAA;AAAA,oBAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;"}
@@ -73,6 +73,9 @@ export declare const ISelect: import("../../types").SFCWithInstall<import("vue")
73
73
  default: string;
74
74
  };
75
75
  action: ObjectConstructor;
76
+ changeHandler: {
77
+ type: import("vue").PropType<(value: any) => void>;
78
+ };
76
79
  }>, {
77
80
  props: import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
78
81
  multiple: {
@@ -149,6 +152,9 @@ export declare const ISelect: import("../../types").SFCWithInstall<import("vue")
149
152
  default: string;
150
153
  };
151
154
  action: ObjectConstructor;
155
+ changeHandler: {
156
+ type: import("vue").PropType<(value: any) => void>;
157
+ };
152
158
  }>> & Readonly<{
153
159
  onClear?: (() => any) | undefined;
154
160
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
@@ -785,6 +791,9 @@ export declare const ISelect: import("../../types").SFCWithInstall<import("vue")
785
791
  default: string;
786
792
  };
787
793
  action: ObjectConstructor;
794
+ changeHandler: {
795
+ type: import("vue").PropType<(value: any) => void>;
796
+ };
788
797
  }>> & Readonly<{
789
798
  onClear?: (() => any) | undefined;
790
799
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
@@ -1,5 +1,5 @@
1
- import type { ExtractPropTypes, ExtractPublicPropTypes, PropType } from 'vue';
2
- import type Select from './select.vue';
1
+ import type { ExtractPropTypes, ExtractPublicPropTypes, PropType } from "vue";
2
+ import type Select from "./select.vue";
3
3
  export declare const SelectProps: {
4
4
  multiple: {
5
5
  type: BooleanConstructor;
@@ -75,6 +75,9 @@ export declare const SelectProps: {
75
75
  default: string;
76
76
  };
77
77
  action: ObjectConstructor;
78
+ changeHandler: {
79
+ type: PropType<(value: any) => void>;
80
+ };
78
81
  };
79
82
  export type SelectPropsType = ExtractPropTypes<typeof SelectProps>;
80
83
  export type SelectPublicPropsType = ExtractPublicPropTypes<typeof SelectProps>;
@@ -79,7 +79,10 @@ const SelectProps = {
79
79
  /**
80
80
  * pinia useDictStore
81
81
  */
82
- action: Object
82
+ action: Object,
83
+ changeHandler: {
84
+ type: Function
85
+ }
83
86
  };
84
87
 
85
88
  exports.SelectProps = SelectProps;