@element-plus/nightly 0.0.20240123 → 0.0.20240124
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.
- package/dist/index.full.js +2 -2
- package/dist/index.full.min.js +2 -2
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +2 -2
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +2 -2
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/divider/index.mjs +2 -2
- package/es/components/divider/src/divider.mjs +35 -17
- package/es/components/divider/src/divider.mjs.map +1 -1
- package/es/components/divider/src/divider2.mjs +17 -35
- package/es/components/divider/src/divider2.mjs.map +1 -1
- package/es/components/form/index.mjs +2 -2
- package/es/components/form/src/form.mjs +54 -152
- package/es/components/form/src/form.mjs.map +1 -1
- package/es/components/form/src/form2.mjs +152 -54
- package/es/components/form/src/form2.mjs.map +1 -1
- package/es/components/index.mjs +4 -4
- package/es/components/menu/index.mjs +2 -2
- package/es/components/menu/src/menu-item.mjs +97 -14
- package/es/components/menu/src/menu-item.mjs.map +1 -1
- package/es/components/menu/src/menu-item2.mjs +14 -97
- package/es/components/menu/src/menu-item2.mjs.map +1 -1
- package/es/components/scrollbar/index.mjs +1 -1
- package/es/components/scrollbar/src/bar2.mjs +1 -1
- package/es/components/scrollbar/src/thumb.mjs +11 -130
- package/es/components/scrollbar/src/thumb.mjs.map +1 -1
- package/es/components/scrollbar/src/thumb2.mjs +130 -11
- package/es/components/scrollbar/src/thumb2.mjs.map +1 -1
- package/es/components/time-select/index.mjs +1 -1
- package/es/components/time-select/src/time-select.mjs +48 -120
- package/es/components/time-select/src/time-select.mjs.map +1 -1
- package/es/components/time-select/src/time-select2.mjs +120 -48
- package/es/components/time-select/src/time-select2.mjs.map +1 -1
- package/es/components/tour/src/content.mjs +44 -63
- package/es/components/tour/src/content.mjs.map +1 -1
- package/es/components/tour/src/content2.mjs +63 -44
- package/es/components/tour/src/content2.mjs.map +1 -1
- package/es/components/tour/src/step.mjs +1 -1
- package/es/components/tour/src/tour.mjs +1 -1
- package/es/components/tour/src/tour2.mjs +1 -1
- package/es/index.mjs +4 -4
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/divider/index.js +2 -2
- package/lib/components/divider/src/divider.js +35 -17
- package/lib/components/divider/src/divider.js.map +1 -1
- package/lib/components/divider/src/divider2.js +17 -35
- package/lib/components/divider/src/divider2.js.map +1 -1
- package/lib/components/form/index.js +2 -2
- package/lib/components/form/src/form.js +54 -151
- package/lib/components/form/src/form.js.map +1 -1
- package/lib/components/form/src/form2.js +151 -54
- package/lib/components/form/src/form2.js.map +1 -1
- package/lib/components/index.js +4 -4
- package/lib/components/menu/index.js +2 -2
- package/lib/components/menu/src/menu-item.js +97 -15
- package/lib/components/menu/src/menu-item.js.map +1 -1
- package/lib/components/menu/src/menu-item2.js +15 -97
- package/lib/components/menu/src/menu-item2.js.map +1 -1
- package/lib/components/scrollbar/index.js +1 -1
- package/lib/components/scrollbar/src/bar2.js +1 -1
- package/lib/components/scrollbar/src/thumb.js +11 -130
- package/lib/components/scrollbar/src/thumb.js.map +1 -1
- package/lib/components/scrollbar/src/thumb2.js +130 -11
- package/lib/components/scrollbar/src/thumb2.js.map +1 -1
- package/lib/components/time-select/index.js +1 -1
- package/lib/components/time-select/src/time-select.js +48 -125
- package/lib/components/time-select/src/time-select.js.map +1 -1
- package/lib/components/time-select/src/time-select2.js +125 -48
- package/lib/components/time-select/src/time-select2.js.map +1 -1
- package/lib/components/tour/src/content.js +45 -63
- package/lib/components/tour/src/content.js.map +1 -1
- package/lib/components/tour/src/content2.js +63 -45
- package/lib/components/tour/src/content2.js.map +1 -1
- package/lib/components/tour/src/step.js +1 -1
- package/lib/components/tour/src/tour.js +1 -1
- package/lib/components/tour/src/tour2.js +1 -1
- package/lib/index.js +4 -4
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -1,159 +1,61 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../../../constants/index.mjs';
|
|
2
2
|
import '../../../utils/index.mjs';
|
|
3
|
-
import '../../../
|
|
4
|
-
import '
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { filterFields, useFormLabelWidth } from './utils.mjs';
|
|
8
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
9
|
-
import { useFormSize } from './hooks/use-form-common-props.mjs';
|
|
10
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
11
|
-
import { debugWarn } from '../../../utils/error.mjs';
|
|
12
|
-
import { isFunction } from '@vue/shared';
|
|
3
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
4
|
+
import { componentSizes } from '../../../constants/size.mjs';
|
|
5
|
+
import { isArray, isString } from '@vue/shared';
|
|
6
|
+
import { isBoolean } from '../../../utils/types.mjs';
|
|
13
7
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
const formMetaProps = buildProps({
|
|
9
|
+
size: {
|
|
10
|
+
type: String,
|
|
11
|
+
values: componentSizes
|
|
12
|
+
},
|
|
13
|
+
disabled: Boolean
|
|
17
14
|
});
|
|
18
|
-
const
|
|
19
|
-
...
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
filterFields(fields, props2).forEach((field) => field.clearValidate());
|
|
58
|
-
};
|
|
59
|
-
const isValidatable = computed(() => {
|
|
60
|
-
const hasModel = !!props.model;
|
|
61
|
-
if (!hasModel) {
|
|
62
|
-
debugWarn(COMPONENT_NAME, "model is required for validate to work.");
|
|
63
|
-
}
|
|
64
|
-
return hasModel;
|
|
65
|
-
});
|
|
66
|
-
const obtainValidateFields = (props2) => {
|
|
67
|
-
if (fields.length === 0)
|
|
68
|
-
return [];
|
|
69
|
-
const filteredFields = filterFields(fields, props2);
|
|
70
|
-
if (!filteredFields.length) {
|
|
71
|
-
debugWarn(COMPONENT_NAME, "please pass correct props!");
|
|
72
|
-
return [];
|
|
73
|
-
}
|
|
74
|
-
return filteredFields;
|
|
75
|
-
};
|
|
76
|
-
const validate = async (callback) => validateField(void 0, callback);
|
|
77
|
-
const doValidateField = async (props2 = []) => {
|
|
78
|
-
if (!isValidatable.value)
|
|
79
|
-
return false;
|
|
80
|
-
const fields2 = obtainValidateFields(props2);
|
|
81
|
-
if (fields2.length === 0)
|
|
82
|
-
return true;
|
|
83
|
-
let validationErrors = {};
|
|
84
|
-
for (const field of fields2) {
|
|
85
|
-
try {
|
|
86
|
-
await field.validate("");
|
|
87
|
-
} catch (fields3) {
|
|
88
|
-
validationErrors = {
|
|
89
|
-
...validationErrors,
|
|
90
|
-
...fields3
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
if (Object.keys(validationErrors).length === 0)
|
|
95
|
-
return true;
|
|
96
|
-
return Promise.reject(validationErrors);
|
|
97
|
-
};
|
|
98
|
-
const validateField = async (modelProps = [], callback) => {
|
|
99
|
-
const shouldThrow = !isFunction(callback);
|
|
100
|
-
try {
|
|
101
|
-
const result = await doValidateField(modelProps);
|
|
102
|
-
if (result === true) {
|
|
103
|
-
callback == null ? void 0 : callback(result);
|
|
104
|
-
}
|
|
105
|
-
return result;
|
|
106
|
-
} catch (e) {
|
|
107
|
-
if (e instanceof Error)
|
|
108
|
-
throw e;
|
|
109
|
-
const invalidFields = e;
|
|
110
|
-
if (props.scrollToError) {
|
|
111
|
-
scrollToField(Object.keys(invalidFields)[0]);
|
|
112
|
-
}
|
|
113
|
-
callback == null ? void 0 : callback(false, invalidFields);
|
|
114
|
-
return shouldThrow && Promise.reject(invalidFields);
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
const scrollToField = (prop) => {
|
|
118
|
-
var _a;
|
|
119
|
-
const field = filterFields(fields, prop)[0];
|
|
120
|
-
if (field) {
|
|
121
|
-
(_a = field.$el) == null ? void 0 : _a.scrollIntoView(props.scrollIntoViewOptions);
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
watch(() => props.rules, () => {
|
|
125
|
-
if (props.validateOnRuleChange) {
|
|
126
|
-
validate().catch((err) => debugWarn(err));
|
|
127
|
-
}
|
|
128
|
-
}, { deep: true });
|
|
129
|
-
provide(formContextKey, reactive({
|
|
130
|
-
...toRefs(props),
|
|
131
|
-
emit,
|
|
132
|
-
resetFields,
|
|
133
|
-
clearValidate,
|
|
134
|
-
validateField,
|
|
135
|
-
getField,
|
|
136
|
-
addField,
|
|
137
|
-
removeField,
|
|
138
|
-
...useFormLabelWidth()
|
|
139
|
-
}));
|
|
140
|
-
expose({
|
|
141
|
-
validate,
|
|
142
|
-
validateField,
|
|
143
|
-
resetFields,
|
|
144
|
-
clearValidate,
|
|
145
|
-
scrollToField
|
|
146
|
-
});
|
|
147
|
-
return (_ctx, _cache) => {
|
|
148
|
-
return openBlock(), createElementBlock("form", {
|
|
149
|
-
class: normalizeClass(unref(formClasses))
|
|
150
|
-
}, [
|
|
151
|
-
renderSlot(_ctx.$slots, "default")
|
|
152
|
-
], 2);
|
|
153
|
-
};
|
|
15
|
+
const formProps = buildProps({
|
|
16
|
+
...formMetaProps,
|
|
17
|
+
model: Object,
|
|
18
|
+
rules: {
|
|
19
|
+
type: definePropType(Object)
|
|
20
|
+
},
|
|
21
|
+
labelPosition: {
|
|
22
|
+
type: String,
|
|
23
|
+
values: ["left", "right", "top"],
|
|
24
|
+
default: "right"
|
|
25
|
+
},
|
|
26
|
+
requireAsteriskPosition: {
|
|
27
|
+
type: String,
|
|
28
|
+
values: ["left", "right"],
|
|
29
|
+
default: "left"
|
|
30
|
+
},
|
|
31
|
+
labelWidth: {
|
|
32
|
+
type: [String, Number],
|
|
33
|
+
default: ""
|
|
34
|
+
},
|
|
35
|
+
labelSuffix: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: ""
|
|
38
|
+
},
|
|
39
|
+
inline: Boolean,
|
|
40
|
+
inlineMessage: Boolean,
|
|
41
|
+
statusIcon: Boolean,
|
|
42
|
+
showMessage: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: true
|
|
45
|
+
},
|
|
46
|
+
validateOnRuleChange: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: true
|
|
49
|
+
},
|
|
50
|
+
hideRequiredAsterisk: Boolean,
|
|
51
|
+
scrollToError: Boolean,
|
|
52
|
+
scrollIntoViewOptions: {
|
|
53
|
+
type: [Object, Boolean]
|
|
154
54
|
}
|
|
155
55
|
});
|
|
156
|
-
|
|
56
|
+
const formEmits = {
|
|
57
|
+
validate: (prop, isValid, message) => (isArray(prop) || isString(prop)) && isBoolean(isValid) && isString(message)
|
|
58
|
+
};
|
|
157
59
|
|
|
158
|
-
export {
|
|
60
|
+
export { formEmits, formProps };
|
|
159
61
|
//# sourceMappingURL=form.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.mjs","sources":["../../../../../../packages/components/form/src/form.
|
|
1
|
+
{"version":3,"file":"form.mjs","sources":["../../../../../../packages/components/form/src/form.ts"],"sourcesContent":["import { componentSizes } from '@element-plus/constants'\nimport {\n buildProps,\n definePropType,\n isArray,\n isBoolean,\n isString,\n} from '@element-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type { FormItemProp } from './form-item'\nimport type { FormRules } from './types'\n\nconst formMetaProps = buildProps({\n /**\n * @description Control the size of components in this form.\n */\n size: {\n type: String,\n values: componentSizes,\n },\n /**\n * @description Whether to disable all components in this form. If set to `true`, it will override the `disabled` prop of the inner component.\n */\n disabled: Boolean,\n} as const)\n\nexport const formProps = buildProps({\n ...formMetaProps,\n /**\n * @description Data of form component.\n */\n model: Object,\n /**\n * @description Validation rules of form.\n */\n rules: {\n type: definePropType<FormRules>(Object),\n },\n /**\n * @description Position of label. If set to `'left'` or `'right'`, `label-width` prop is also required.\n */\n labelPosition: {\n type: String,\n values: ['left', 'right', 'top'],\n default: 'right',\n },\n /**\n * @description Position of asterisk.\n */\n requireAsteriskPosition: {\n type: String,\n values: ['left', 'right'],\n default: 'left',\n },\n /**\n * @description Width of label, e.g. `'50px'`. All its direct child form items will inherit this value. `auto` is supported.\n */\n labelWidth: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description Suffix of the label.\n */\n labelSuffix: {\n type: String,\n default: '',\n },\n /**\n * @description Whether the form is inline.\n */\n inline: Boolean,\n /**\n * @description Whether to display the error message inline with the form item.\n */\n inlineMessage: Boolean,\n /**\n * @description Whether to display an icon indicating the validation result.\n */\n statusIcon: Boolean,\n /**\n * @description Whether to show the error message.\n */\n showMessage: {\n type: Boolean,\n default: true,\n },\n /**\n * @description Whether to trigger validation when the `rules` prop is changed.\n */\n validateOnRuleChange: {\n type: Boolean,\n default: true,\n },\n /**\n * @description Whether to hide required fields should have a red asterisk (star) beside their labels.\n */\n hideRequiredAsterisk: Boolean,\n /**\n * @description When validation fails, scroll to the first error form entry.\n */\n scrollToError: Boolean,\n /**\n * @description When validation fails, it scrolls to the first error item based on the scrollIntoView option.\n */\n scrollIntoViewOptions: {\n type: [Object, Boolean],\n },\n} as const)\nexport type FormProps = ExtractPropTypes<typeof formProps>\nexport type FormMetaProps = ExtractPropTypes<typeof formMetaProps>\n\nexport const formEmits = {\n validate: (prop: FormItemProp, isValid: boolean, message: string) =>\n (isArray(prop) || isString(prop)) &&\n isBoolean(isValid) &&\n isString(message),\n}\nexport type FormEmits = typeof formEmits\n"],"names":[],"mappings":";;;;;;;AAQA,MAAM,aAAa,GAAG,UAAU,CAAC;AACjC,EAAE,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AC,MAAM,EAAE,OAAO,CAAC;AAC3B,GAAG;AACH,CAAC,EAAE;AACS,MAAC,SAAS,GAAG;AACzB,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC,OAAO,CAAC,IAAI,QAAQ,CAAC,OAAO,CAAC;AACpH;;;;"}
|
|
@@ -1,61 +1,159 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import { defineComponent, computed, watch, provide, reactive, toRefs, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from 'vue';
|
|
2
2
|
import '../../../utils/index.mjs';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import '../../../hooks/index.mjs';
|
|
4
|
+
import './hooks/index.mjs';
|
|
5
|
+
import { formContextKey } from './constants.mjs';
|
|
6
|
+
import { formProps, formEmits } from './form.mjs';
|
|
7
|
+
import { filterFields, useFormLabelWidth } from './utils.mjs';
|
|
8
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
9
|
+
import { useFormSize } from './hooks/use-form-common-props.mjs';
|
|
10
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
11
|
+
import { debugWarn } from '../../../utils/error.mjs';
|
|
12
|
+
import { isFunction } from '@vue/shared';
|
|
7
13
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
values: componentSizes
|
|
12
|
-
},
|
|
13
|
-
disabled: Boolean
|
|
14
|
+
const COMPONENT_NAME = "ElForm";
|
|
15
|
+
const __default__ = defineComponent({
|
|
16
|
+
name: COMPONENT_NAME
|
|
14
17
|
});
|
|
15
|
-
const
|
|
16
|
-
...
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
18
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
19
|
+
...__default__,
|
|
20
|
+
props: formProps,
|
|
21
|
+
emits: formEmits,
|
|
22
|
+
setup(__props, { expose, emit }) {
|
|
23
|
+
const props = __props;
|
|
24
|
+
const fields = [];
|
|
25
|
+
const formSize = useFormSize();
|
|
26
|
+
const ns = useNamespace("form");
|
|
27
|
+
const formClasses = computed(() => {
|
|
28
|
+
const { labelPosition, inline } = props;
|
|
29
|
+
return [
|
|
30
|
+
ns.b(),
|
|
31
|
+
ns.m(formSize.value || "default"),
|
|
32
|
+
{
|
|
33
|
+
[ns.m(`label-${labelPosition}`)]: labelPosition,
|
|
34
|
+
[ns.m("inline")]: inline
|
|
35
|
+
}
|
|
36
|
+
];
|
|
37
|
+
});
|
|
38
|
+
const getField = (prop) => {
|
|
39
|
+
return fields.find((field) => field.prop === prop);
|
|
40
|
+
};
|
|
41
|
+
const addField = (field) => {
|
|
42
|
+
fields.push(field);
|
|
43
|
+
};
|
|
44
|
+
const removeField = (field) => {
|
|
45
|
+
if (field.prop) {
|
|
46
|
+
fields.splice(fields.indexOf(field), 1);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const resetFields = (properties = []) => {
|
|
50
|
+
if (!props.model) {
|
|
51
|
+
debugWarn(COMPONENT_NAME, "model is required for resetFields to work.");
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
filterFields(fields, properties).forEach((field) => field.resetField());
|
|
55
|
+
};
|
|
56
|
+
const clearValidate = (props2 = []) => {
|
|
57
|
+
filterFields(fields, props2).forEach((field) => field.clearValidate());
|
|
58
|
+
};
|
|
59
|
+
const isValidatable = computed(() => {
|
|
60
|
+
const hasModel = !!props.model;
|
|
61
|
+
if (!hasModel) {
|
|
62
|
+
debugWarn(COMPONENT_NAME, "model is required for validate to work.");
|
|
63
|
+
}
|
|
64
|
+
return hasModel;
|
|
65
|
+
});
|
|
66
|
+
const obtainValidateFields = (props2) => {
|
|
67
|
+
if (fields.length === 0)
|
|
68
|
+
return [];
|
|
69
|
+
const filteredFields = filterFields(fields, props2);
|
|
70
|
+
if (!filteredFields.length) {
|
|
71
|
+
debugWarn(COMPONENT_NAME, "please pass correct props!");
|
|
72
|
+
return [];
|
|
73
|
+
}
|
|
74
|
+
return filteredFields;
|
|
75
|
+
};
|
|
76
|
+
const validate = async (callback) => validateField(void 0, callback);
|
|
77
|
+
const doValidateField = async (props2 = []) => {
|
|
78
|
+
if (!isValidatable.value)
|
|
79
|
+
return false;
|
|
80
|
+
const fields2 = obtainValidateFields(props2);
|
|
81
|
+
if (fields2.length === 0)
|
|
82
|
+
return true;
|
|
83
|
+
let validationErrors = {};
|
|
84
|
+
for (const field of fields2) {
|
|
85
|
+
try {
|
|
86
|
+
await field.validate("");
|
|
87
|
+
} catch (fields3) {
|
|
88
|
+
validationErrors = {
|
|
89
|
+
...validationErrors,
|
|
90
|
+
...fields3
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (Object.keys(validationErrors).length === 0)
|
|
95
|
+
return true;
|
|
96
|
+
return Promise.reject(validationErrors);
|
|
97
|
+
};
|
|
98
|
+
const validateField = async (modelProps = [], callback) => {
|
|
99
|
+
const shouldThrow = !isFunction(callback);
|
|
100
|
+
try {
|
|
101
|
+
const result = await doValidateField(modelProps);
|
|
102
|
+
if (result === true) {
|
|
103
|
+
callback == null ? void 0 : callback(result);
|
|
104
|
+
}
|
|
105
|
+
return result;
|
|
106
|
+
} catch (e) {
|
|
107
|
+
if (e instanceof Error)
|
|
108
|
+
throw e;
|
|
109
|
+
const invalidFields = e;
|
|
110
|
+
if (props.scrollToError) {
|
|
111
|
+
scrollToField(Object.keys(invalidFields)[0]);
|
|
112
|
+
}
|
|
113
|
+
callback == null ? void 0 : callback(false, invalidFields);
|
|
114
|
+
return shouldThrow && Promise.reject(invalidFields);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const scrollToField = (prop) => {
|
|
118
|
+
var _a;
|
|
119
|
+
const field = filterFields(fields, prop)[0];
|
|
120
|
+
if (field) {
|
|
121
|
+
(_a = field.$el) == null ? void 0 : _a.scrollIntoView(props.scrollIntoViewOptions);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
watch(() => props.rules, () => {
|
|
125
|
+
if (props.validateOnRuleChange) {
|
|
126
|
+
validate().catch((err) => debugWarn(err));
|
|
127
|
+
}
|
|
128
|
+
}, { deep: true });
|
|
129
|
+
provide(formContextKey, reactive({
|
|
130
|
+
...toRefs(props),
|
|
131
|
+
emit,
|
|
132
|
+
resetFields,
|
|
133
|
+
clearValidate,
|
|
134
|
+
validateField,
|
|
135
|
+
getField,
|
|
136
|
+
addField,
|
|
137
|
+
removeField,
|
|
138
|
+
...useFormLabelWidth()
|
|
139
|
+
}));
|
|
140
|
+
expose({
|
|
141
|
+
validate,
|
|
142
|
+
validateField,
|
|
143
|
+
resetFields,
|
|
144
|
+
clearValidate,
|
|
145
|
+
scrollToField
|
|
146
|
+
});
|
|
147
|
+
return (_ctx, _cache) => {
|
|
148
|
+
return openBlock(), createElementBlock("form", {
|
|
149
|
+
class: normalizeClass(unref(formClasses))
|
|
150
|
+
}, [
|
|
151
|
+
renderSlot(_ctx.$slots, "default")
|
|
152
|
+
], 2);
|
|
153
|
+
};
|
|
54
154
|
}
|
|
55
155
|
});
|
|
56
|
-
|
|
57
|
-
validate: (prop, isValid, message) => (isArray(prop) || isString(prop)) && isBoolean(isValid) && isString(message)
|
|
58
|
-
};
|
|
156
|
+
var Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "form.vue"]]);
|
|
59
157
|
|
|
60
|
-
export {
|
|
158
|
+
export { Form as default };
|
|
61
159
|
//# sourceMappingURL=form2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form2.mjs","sources":["../../../../../../packages/components/form/src/form.
|
|
1
|
+
{"version":3,"file":"form2.mjs","sources":["../../../../../../packages/components/form/src/form.vue"],"sourcesContent":["<template>\n <form :class=\"formClasses\">\n <slot />\n </form>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, provide, reactive, toRefs, watch } from 'vue'\nimport { debugWarn, isFunction } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { useFormSize } from './hooks'\nimport { formContextKey } from './constants'\nimport { formEmits, formProps } from './form'\nimport { filterFields, useFormLabelWidth } from './utils'\n\nimport type { ValidateFieldsError } from 'async-validator'\nimport type { Arrayable } from '@element-plus/utils'\nimport type {\n FormContext,\n FormItemContext,\n FormValidateCallback,\n FormValidationResult,\n} from './types'\nimport type { FormItemProp } from './form-item'\n\nconst COMPONENT_NAME = 'ElForm'\ndefineOptions({\n name: COMPONENT_NAME,\n})\nconst props = defineProps(formProps)\nconst emit = defineEmits(formEmits)\n\nconst fields: FormItemContext[] = []\n\nconst formSize = useFormSize()\nconst ns = useNamespace('form')\nconst formClasses = computed(() => {\n const { labelPosition, inline } = props\n return [\n ns.b(),\n // todo: in v2.2.0, we can remove default\n // in fact, remove it doesn't affect the final style\n ns.m(formSize.value || 'default'),\n {\n [ns.m(`label-${labelPosition}`)]: labelPosition,\n [ns.m('inline')]: inline,\n },\n ]\n})\n\nconst getField: FormContext['getField'] = (prop) => {\n return fields.find((field) => field.prop === prop)\n}\n\nconst addField: FormContext['addField'] = (field) => {\n fields.push(field)\n}\n\nconst removeField: FormContext['removeField'] = (field) => {\n if (field.prop) {\n fields.splice(fields.indexOf(field), 1)\n }\n}\n\nconst resetFields: FormContext['resetFields'] = (properties = []) => {\n if (!props.model) {\n debugWarn(COMPONENT_NAME, 'model is required for resetFields to work.')\n return\n }\n filterFields(fields, properties).forEach((field) => field.resetField())\n}\n\nconst clearValidate: FormContext['clearValidate'] = (props = []) => {\n filterFields(fields, props).forEach((field) => field.clearValidate())\n}\n\nconst isValidatable = computed(() => {\n const hasModel = !!props.model\n if (!hasModel) {\n debugWarn(COMPONENT_NAME, 'model is required for validate to work.')\n }\n return hasModel\n})\n\nconst obtainValidateFields = (props: Arrayable<FormItemProp>) => {\n if (fields.length === 0) return []\n\n const filteredFields = filterFields(fields, props)\n if (!filteredFields.length) {\n debugWarn(COMPONENT_NAME, 'please pass correct props!')\n return []\n }\n return filteredFields\n}\n\nconst validate = async (\n callback?: FormValidateCallback\n): FormValidationResult => validateField(undefined, callback)\n\nconst doValidateField = async (\n props: Arrayable<FormItemProp> = []\n): Promise<boolean> => {\n if (!isValidatable.value) return false\n\n const fields = obtainValidateFields(props)\n if (fields.length === 0) return true\n\n let validationErrors: ValidateFieldsError = {}\n for (const field of fields) {\n try {\n await field.validate('')\n } catch (fields) {\n validationErrors = {\n ...validationErrors,\n ...(fields as ValidateFieldsError),\n }\n }\n }\n\n if (Object.keys(validationErrors).length === 0) return true\n return Promise.reject(validationErrors)\n}\n\nconst validateField: FormContext['validateField'] = async (\n modelProps = [],\n callback\n) => {\n const shouldThrow = !isFunction(callback)\n try {\n const result = await doValidateField(modelProps)\n // When result is false meaning that the fields are not validatable\n if (result === true) {\n callback?.(result)\n }\n return result\n } catch (e) {\n if (e instanceof Error) throw e\n\n const invalidFields = e as ValidateFieldsError\n\n if (props.scrollToError) {\n scrollToField(Object.keys(invalidFields)[0])\n }\n callback?.(false, invalidFields)\n return shouldThrow && Promise.reject(invalidFields)\n }\n}\n\nconst scrollToField = (prop: FormItemProp) => {\n const field = filterFields(fields, prop)[0]\n if (field) {\n field.$el?.scrollIntoView(props.scrollIntoViewOptions)\n }\n}\n\nwatch(\n () => props.rules,\n () => {\n if (props.validateOnRuleChange) {\n validate().catch((err) => debugWarn(err))\n }\n },\n { deep: true }\n)\n\nprovide(\n formContextKey,\n reactive({\n ...toRefs(props),\n emit,\n\n resetFields,\n clearValidate,\n validateField,\n getField,\n addField,\n removeField,\n\n ...useFormLabelWidth(),\n })\n)\n\ndefineExpose({\n /**\n * @description Validate the whole form. Receives a callback or returns `Promise`.\n */\n validate,\n /**\n * @description Validate specified fields.\n */\n validateField,\n /**\n * @description Reset specified fields and remove validation result.\n */\n resetFields,\n /**\n * @description Clear validation message for specified fields.\n */\n clearValidate,\n /**\n * @description Scroll to the specified fields.\n */\n scrollToField,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;mCA0Bc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;;AAIA,IAAA,MAAM,SAA4B,EAAC,CAAA;AAEnC,IAAA,MAAM,WAAW,WAAY,EAAA,CAAA;AAC7B,IAAM,MAAA,EAAA,GAAK,aAAa,MAAM,CAAA,CAAA;AAC9B,IAAM,MAAA,WAAA,GAAc,SAAS,MAAM;AACjC,MAAM,MAAA,EAAE,eAAe,MAAW,EAAA,GAAA,KAAA,CAAA;AAClC,MAAO,OAAA;AAAA,QACL,GAAG,CAAE,EAAA;AAAA,QAGL,EAAG,CAAA,CAAA,CAAE,QAAS,CAAA,KAAA,IAAS,SAAS,CAAA;AAAA,QAChC;AAAA,UACE,CAAC,EAAA,CAAG,CAAE,CAAA,CAAA,MAAA,EAAS,eAAe,CAAI,GAAA,aAAA;AAAA,UAClC,CAAC,EAAA,CAAG,CAAE,CAAA,QAAQ,CAAI,GAAA,MAAA;AAAA,SACpB;AAAA,OACF,CAAA;AAAA,KACD,CAAA,CAAA;AAED,IAAM,MAAA,QAAA,GAAoC,CAAC,IAAS,KAAA;AAClD,MAAA,OAAO,OAAO,IAAK,CAAA,CAAC,KAAU,KAAA,KA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A,EAAA,CAAA,KAAA,CAAA,CAAA,GAAA,KAAA,SAAA,CAAA,GAAA,CAAA,CAAA,CAAA;AAAA,OAEF;AAGF,KAAA,EAAA,EAAA;AAEW,IACP,sBAAe,EAAA,QAAA,CAAA;AAAA,MACf,GAAA,MAAA,CAAA,KAAA,CAAA;AAAA,MAEA,IAAA;AAAA,MACA,WAAA;AAAA,MACA,aAAA;AAAA,MACA,aAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MAEA,WAAqB;AAAA,MAEzB,GAAA,iBAAA,EAAA;AAEA,KAAa,CAAA,CAAA,CAAA;AAAA,IAIX,MAAA,CAAA;AAAA,MAIA,QAAA;AAAA,MAIA,aAAA;AAAA,MAIA,WAAA;AAAA,MAIA,aAAA;AAAA,MACD,aAAA;;;;;;;;;;;;;;;"}
|
package/es/components/index.mjs
CHANGED
|
@@ -116,12 +116,12 @@ export { descriptionProps } from './descriptions/src/description.mjs';
|
|
|
116
116
|
export { useDialog } from './dialog/src/use-dialog.mjs';
|
|
117
117
|
export { dialogEmits, dialogProps } from './dialog/src/dialog.mjs';
|
|
118
118
|
export { dialogInjectionKey } from './dialog/src/constants.mjs';
|
|
119
|
-
export { dividerProps } from './divider/src/
|
|
119
|
+
export { dividerProps } from './divider/src/divider2.mjs';
|
|
120
120
|
export { drawerEmits, drawerProps } from './drawer/src/drawer.mjs';
|
|
121
121
|
export { DROPDOWN_COLLECTION_INJECTION_KEY, DROPDOWN_COLLECTION_ITEM_INJECTION_KEY, ElCollection, ElCollectionItem, FIRST_KEYS, FIRST_LAST_KEYS, LAST_KEYS, dropdownItemProps, dropdownMenuProps, dropdownProps } from './dropdown/src/dropdown.mjs';
|
|
122
122
|
export { DROPDOWN_INJECTION_KEY } from './dropdown/src/tokens.mjs';
|
|
123
123
|
export { emptyProps } from './empty/src/empty.mjs';
|
|
124
|
-
export { formEmits, formProps } from './form/src/
|
|
124
|
+
export { formEmits, formProps } from './form/src/form.mjs';
|
|
125
125
|
export { formItemProps, formItemValidateStates } from './form/src/form-item.mjs';
|
|
126
126
|
export { formContextKey, formItemContextKey } from './form/src/constants.mjs';
|
|
127
127
|
export { useDisabled, useFormDisabled, useFormSize, useSize } from './form/src/hooks/use-form-common-props.mjs';
|
|
@@ -133,7 +133,7 @@ export { inputEmits, inputProps } from './input/src/input.mjs';
|
|
|
133
133
|
export { inputNumberEmits, inputNumberProps } from './input-number/src/input-number.mjs';
|
|
134
134
|
export { linkEmits, linkProps } from './link/src/link.mjs';
|
|
135
135
|
export { menuEmits, menuProps } from './menu/src/menu.mjs';
|
|
136
|
-
export { menuItemEmits, menuItemProps } from './menu/src/menu-
|
|
136
|
+
export { menuItemEmits, menuItemProps } from './menu/src/menu-item2.mjs';
|
|
137
137
|
export { menuItemGroupProps } from './menu/src/menu-item-group.mjs';
|
|
138
138
|
export { subMenuProps } from './menu/src/sub-menu.mjs';
|
|
139
139
|
export { overlayEmits, overlayProps } from './overlay/src/overlay.mjs';
|
|
@@ -160,7 +160,7 @@ export { RowAlign, RowJustify, rowProps } from './row/src/row.mjs';
|
|
|
160
160
|
export { rowContextKey } from './row/src/constants.mjs';
|
|
161
161
|
export { BAR_MAP, GAP, renderThumbStyle } from './scrollbar/src/util.mjs';
|
|
162
162
|
export { scrollbarEmits, scrollbarProps } from './scrollbar/src/scrollbar.mjs';
|
|
163
|
-
export { thumbProps } from './scrollbar/src/
|
|
163
|
+
export { thumbProps } from './scrollbar/src/thumb.mjs';
|
|
164
164
|
export { scrollbarContextKey } from './scrollbar/src/constants.mjs';
|
|
165
165
|
export { selectGroupKey, selectKey } from './select/src/token.mjs';
|
|
166
166
|
export { selectV2InjectionKey } from './select-v2/src/token.mjs';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import '../../utils/index.mjs';
|
|
2
2
|
import Menu from './src/menu.mjs';
|
|
3
3
|
export { menuEmits, menuProps } from './src/menu.mjs';
|
|
4
|
-
import MenuItem from './src/menu-
|
|
4
|
+
import MenuItem from './src/menu-item.mjs';
|
|
5
5
|
import MenuItemGroup from './src/menu-item-group2.mjs';
|
|
6
6
|
import SubMenu from './src/sub-menu.mjs';
|
|
7
7
|
export { subMenuProps } from './src/sub-menu.mjs';
|
|
8
|
-
export { menuItemEmits, menuItemProps } from './src/menu-
|
|
8
|
+
export { menuItemEmits, menuItemProps } from './src/menu-item2.mjs';
|
|
9
9
|
export { menuItemGroupProps } from './src/menu-item-group.mjs';
|
|
10
10
|
import './src/types.mjs';
|
|
11
11
|
import './src/instance.mjs';
|