@element-plus/nightly 0.0.20220615 → 0.0.20220616
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/attributes.json +1 -1
- package/dist/index.css +1 -1
- package/dist/index.full.js +26 -23
- package/dist/index.full.min.js +7 -7
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +8 -8
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +26 -23
- 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.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/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/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/form/index.mjs +1 -1
- package/es/components/form/index2.mjs +2 -2
- package/es/components/form/src/form.mjs +1 -1
- package/es/components/form/src/form3.mjs +48 -148
- package/es/components/form/src/form3.mjs.map +1 -1
- package/es/components/form/src/form4.mjs +148 -48
- package/es/components/form/src/form4.mjs.map +1 -1
- package/es/components/index.mjs +1 -1
- package/es/components/pagination/src/components/pager.vue.d.ts +1 -0
- package/es/components/pagination/src/components/pager4.mjs +15 -12
- package/es/components/pagination/src/components/pager4.mjs.map +1 -1
- package/es/components/scrollbar/src/scrollbar3.mjs +1 -1
- package/es/components/scrollbar/src/scrollbar3.mjs.map +1 -1
- package/es/index.mjs +1 -1
- package/es/version.d.ts +1 -1
- package/es/version2.mjs +1 -1
- package/es/version2.mjs.map +1 -1
- package/lib/components/form/index.js +1 -1
- package/lib/components/form/index2.js +2 -2
- package/lib/components/form/src/form.js +1 -1
- package/lib/components/form/src/form3.js +48 -147
- package/lib/components/form/src/form3.js.map +1 -1
- package/lib/components/form/src/form4.js +147 -48
- package/lib/components/form/src/form4.js.map +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/pagination/src/components/pager.vue.d.ts +1 -0
- package/lib/components/pagination/src/components/pager4.js +15 -12
- package/lib/components/pagination/src/components/pager4.js.map +1 -1
- package/lib/components/scrollbar/src/scrollbar3.js +1 -1
- package/lib/components/scrollbar/src/scrollbar3.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version2.js +1 -1
- package/lib/version2.js.map +1 -1
- package/package.json +2 -2
- package/theme-chalk/el-select-dropdown.css +1 -1
- package/theme-chalk/el-select.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/select-dropdown.scss +6 -0
- package/web-types.json +1 -1
package/dist/locale/zh-tw.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! Element Plus v0.0.
|
|
1
|
+
/*! Element Plus v0.0.20220616 */(function(u,e){typeof exports=="object"&&typeof module!="undefined"?module.exports=e():typeof define=="function"&&define.amd?define(e):(u=typeof globalThis!="undefined"?globalThis:u||self,u.ElementPlusLocaleZhTw=e())})(this,function(){"use strict";var u={name:"zh-tw",el:{colorpicker:{confirm:"\u78BA\u8A8D",clear:"\u6E05\u7A7A"},datepicker:{now:"\u73FE\u5728",today:"\u4ECA\u5929",cancel:"\u53D6\u6D88",clear:"\u6E05\u7A7A",confirm:"\u78BA\u8A8D",selectDate:"\u9078\u64C7\u65E5\u671F",selectTime:"\u9078\u64C7\u6642\u9593",startDate:"\u958B\u59CB\u65E5\u671F",startTime:"\u958B\u59CB\u6642\u9593",endDate:"\u7D50\u675F\u65E5\u671F",endTime:"\u7D50\u675F\u6642\u9593",prevYear:"\u524D\u4E00\u5E74",nextYear:"\u5F8C\u4E00\u5E74",prevMonth:"\u4E0A\u500B\u6708",nextMonth:"\u4E0B\u500B\u6708",year:"\u5E74",month1:"1 \u6708",month2:"2 \u6708",month3:"3 \u6708",month4:"4 \u6708",month5:"5 \u6708",month6:"6 \u6708",month7:"7 \u6708",month8:"8 \u6708",month9:"9 \u6708",month10:"10 \u6708",month11:"11 \u6708",month12:"12 \u6708",weeks:{sun:"\u65E5",mon:"\u4E00",tue:"\u4E8C",wed:"\u4E09",thu:"\u56DB",fri:"\u4E94",sat:"\u516D"},months:{jan:"\u4E00\u6708",feb:"\u4E8C\u6708",mar:"\u4E09\u6708",apr:"\u56DB\u6708",may:"\u4E94\u6708",jun:"\u516D\u6708",jul:"\u4E03\u6708",aug:"\u516B\u6708",sep:"\u4E5D\u6708",oct:"\u5341\u6708",nov:"\u5341\u4E00\u6708",dec:"\u5341\u4E8C\u6708"}},select:{loading:"\u52A0\u8F09\u4E2D",noMatch:"\u7121\u5339\u914D\u8CC7\u6599",noData:"\u7121\u8CC7\u6599",placeholder:"\u8ACB\u9078\u64C7"},cascader:{noMatch:"\u7121\u5339\u914D\u8CC7\u6599",loading:"\u52A0\u8F09\u4E2D",placeholder:"\u8ACB\u9078\u64C7",noData:"\u7121\u8CC7\u6599"},pagination:{goto:"\u524D\u5F80",pagesize:"\u9805/\u9801",total:"\u5171 {total} \u9805",pageClassifier:"\u9801"},messagebox:{title:"\u63D0\u793A",confirm:"\u78BA\u5B9A",cancel:"\u53D6\u6D88",error:"\u8F38\u5165\u7684\u8CC7\u6599\u4E0D\u7B26\u898F\u5B9A!"},upload:{deleteTip:"\u6309 delete \u9375\u53EF\u522A\u9664",delete:"\u522A\u9664",preview:"\u67E5\u770B\u5716\u7247",continue:"\u7E7C\u7E8C\u4E0A\u50B3"},table:{emptyText:"\u66AB\u7121\u8CC7\u6599",confirmFilter:"\u7BE9\u9078",resetFilter:"\u91CD\u7F6E",clearFilter:"\u5168\u90E8",sumText:"\u5408\u8A08"},tree:{emptyText:"\u66AB\u7121\u8CC7\u6599"},transfer:{noMatch:"\u7121\u5339\u914D\u8CC7\u6599",noData:"\u7121\u8CC7\u6599",titles:["\u5217\u8868 1","\u5217\u8868 2"],filterPlaceholder:"\u8ACB\u8F38\u5165\u641C\u7D22\u5167\u5BB9",noCheckedFormat:"\u5171 {total} \u9805",hasCheckedFormat:"\u5DF2\u9078 {checked}/{total} \u9805"},image:{error:"\u52A0\u8F09\u5931\u6557"},pageHeader:{title:"\u8FD4\u56DE"},popconfirm:{confirmButtonText:"\u78BA\u8A8D",cancelButtonText:"\u53D6\u6D88"}}};return u});
|
|
2
2
|
//# sourceMappingURL=zh-tw.min.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! Element Plus v0.0.
|
|
1
|
+
/*! Element Plus v0.0.20220616 */var u={name:"zh-tw",el:{colorpicker:{confirm:"\u78BA\u8A8D",clear:"\u6E05\u7A7A"},datepicker:{now:"\u73FE\u5728",today:"\u4ECA\u5929",cancel:"\u53D6\u6D88",clear:"\u6E05\u7A7A",confirm:"\u78BA\u8A8D",selectDate:"\u9078\u64C7\u65E5\u671F",selectTime:"\u9078\u64C7\u6642\u9593",startDate:"\u958B\u59CB\u65E5\u671F",startTime:"\u958B\u59CB\u6642\u9593",endDate:"\u7D50\u675F\u65E5\u671F",endTime:"\u7D50\u675F\u6642\u9593",prevYear:"\u524D\u4E00\u5E74",nextYear:"\u5F8C\u4E00\u5E74",prevMonth:"\u4E0A\u500B\u6708",nextMonth:"\u4E0B\u500B\u6708",year:"\u5E74",month1:"1 \u6708",month2:"2 \u6708",month3:"3 \u6708",month4:"4 \u6708",month5:"5 \u6708",month6:"6 \u6708",month7:"7 \u6708",month8:"8 \u6708",month9:"9 \u6708",month10:"10 \u6708",month11:"11 \u6708",month12:"12 \u6708",weeks:{sun:"\u65E5",mon:"\u4E00",tue:"\u4E8C",wed:"\u4E09",thu:"\u56DB",fri:"\u4E94",sat:"\u516D"},months:{jan:"\u4E00\u6708",feb:"\u4E8C\u6708",mar:"\u4E09\u6708",apr:"\u56DB\u6708",may:"\u4E94\u6708",jun:"\u516D\u6708",jul:"\u4E03\u6708",aug:"\u516B\u6708",sep:"\u4E5D\u6708",oct:"\u5341\u6708",nov:"\u5341\u4E00\u6708",dec:"\u5341\u4E8C\u6708"}},select:{loading:"\u52A0\u8F09\u4E2D",noMatch:"\u7121\u5339\u914D\u8CC7\u6599",noData:"\u7121\u8CC7\u6599",placeholder:"\u8ACB\u9078\u64C7"},cascader:{noMatch:"\u7121\u5339\u914D\u8CC7\u6599",loading:"\u52A0\u8F09\u4E2D",placeholder:"\u8ACB\u9078\u64C7",noData:"\u7121\u8CC7\u6599"},pagination:{goto:"\u524D\u5F80",pagesize:"\u9805/\u9801",total:"\u5171 {total} \u9805",pageClassifier:"\u9801"},messagebox:{title:"\u63D0\u793A",confirm:"\u78BA\u5B9A",cancel:"\u53D6\u6D88",error:"\u8F38\u5165\u7684\u8CC7\u6599\u4E0D\u7B26\u898F\u5B9A!"},upload:{deleteTip:"\u6309 delete \u9375\u53EF\u522A\u9664",delete:"\u522A\u9664",preview:"\u67E5\u770B\u5716\u7247",continue:"\u7E7C\u7E8C\u4E0A\u50B3"},table:{emptyText:"\u66AB\u7121\u8CC7\u6599",confirmFilter:"\u7BE9\u9078",resetFilter:"\u91CD\u7F6E",clearFilter:"\u5168\u90E8",sumText:"\u5408\u8A08"},tree:{emptyText:"\u66AB\u7121\u8CC7\u6599"},transfer:{noMatch:"\u7121\u5339\u914D\u8CC7\u6599",noData:"\u7121\u8CC7\u6599",titles:["\u5217\u8868 1","\u5217\u8868 2"],filterPlaceholder:"\u8ACB\u8F38\u5165\u641C\u7D22\u5167\u5BB9",noCheckedFormat:"\u5171 {total} \u9805",hasCheckedFormat:"\u5DF2\u9078 {checked}/{total} \u9805"},image:{error:"\u52A0\u8F09\u5931\u6557"},pageHeader:{title:"\u8FD4\u56DE"},popconfirm:{confirmButtonText:"\u78BA\u8A8D",cancelButtonText:"\u53D6\u6D88"}}};export{u as default};
|
|
2
2
|
//# sourceMappingURL=zh-tw.min.mjs.map
|
package/dist/locale/zh-tw.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { ElForm, ElFormItem, ElForm as default } from './index2.mjs';
|
|
2
|
-
export { formEmits, formProps } from './src/
|
|
2
|
+
export { formEmits, formProps } from './src/form3.mjs';
|
|
3
3
|
export { formItemProps, formItemValidateStates } from './src/form-item3.mjs';
|
|
4
4
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../../utils/index2.mjs';
|
|
2
|
-
import Form from './src/
|
|
2
|
+
import Form from './src/form4.mjs';
|
|
3
3
|
import FormItem from './src/form-item4.mjs';
|
|
4
|
-
export { formEmits, formProps } from './src/
|
|
4
|
+
export { formEmits, formProps } from './src/form3.mjs';
|
|
5
5
|
export { formItemProps, formItemValidateStates } from './src/form-item3.mjs';
|
|
6
6
|
import './src/types2.mjs';
|
|
7
7
|
import { withInstall, withNoopInstall } from '../../utils/vue/install2.mjs';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { formEmits, formProps } from './
|
|
1
|
+
export { formEmits, formProps } from './form3.mjs';
|
|
2
2
|
//# sourceMappingURL=form.mjs.map
|
|
@@ -1,153 +1,53 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../../../constants/index2.mjs';
|
|
2
2
|
import '../../../utils/index2.mjs';
|
|
3
|
-
import '../../../
|
|
4
|
-
import '../../../
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
8
|
-
import { useSize } from '../../../hooks/use-common-props/index2.mjs';
|
|
9
|
-
import { useNamespace } from '../../../hooks/use-namespace/index2.mjs';
|
|
10
|
-
import { debugWarn } from '../../../utils/error2.mjs';
|
|
11
|
-
import { isFunction } from '@vue/shared';
|
|
12
|
-
import { formContextKey } from '../../../tokens/form2.mjs';
|
|
3
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime2.mjs';
|
|
4
|
+
import { componentSizes } from '../../../constants/size2.mjs';
|
|
5
|
+
import { isArray, isString } from '@vue/shared';
|
|
6
|
+
import { isBoolean } from '@vueuse/core';
|
|
13
7
|
|
|
14
|
-
const
|
|
15
|
-
|
|
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
|
-
const clearValidate = (props2 = []) => {
|
|
54
|
-
filterFields(fields, props2).forEach((field) => field.clearValidate());
|
|
55
|
-
};
|
|
56
|
-
const isValidatable = computed(() => {
|
|
57
|
-
const hasModel = !!props.model;
|
|
58
|
-
if (!hasModel) {
|
|
59
|
-
debugWarn(COMPONENT_NAME, "model is required for validate to work.");
|
|
60
|
-
}
|
|
61
|
-
return hasModel;
|
|
62
|
-
});
|
|
63
|
-
const obtainValidateFields = (props2) => {
|
|
64
|
-
if (fields.length === 0)
|
|
65
|
-
return [];
|
|
66
|
-
const filteredFields = filterFields(fields, props2);
|
|
67
|
-
if (!filteredFields.length) {
|
|
68
|
-
debugWarn(COMPONENT_NAME, "please pass correct props!");
|
|
69
|
-
return [];
|
|
70
|
-
}
|
|
71
|
-
return filteredFields;
|
|
72
|
-
};
|
|
73
|
-
const validate = async (callback) => validateField(void 0, callback);
|
|
74
|
-
const doValidateField = async (props2 = []) => {
|
|
75
|
-
if (!isValidatable.value)
|
|
76
|
-
return false;
|
|
77
|
-
const fields2 = obtainValidateFields(props2);
|
|
78
|
-
if (fields2.length === 0)
|
|
79
|
-
return true;
|
|
80
|
-
let validationErrors = {};
|
|
81
|
-
for (const field of fields2) {
|
|
82
|
-
try {
|
|
83
|
-
await field.validate("");
|
|
84
|
-
} catch (fields3) {
|
|
85
|
-
validationErrors = {
|
|
86
|
-
...validationErrors,
|
|
87
|
-
...fields3
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
if (Object.keys(validationErrors).length === 0)
|
|
92
|
-
return true;
|
|
93
|
-
return Promise.reject(validationErrors);
|
|
94
|
-
};
|
|
95
|
-
const validateField = async (modelProps = [], callback) => {
|
|
96
|
-
const shouldThrow = !isFunction(callback);
|
|
97
|
-
try {
|
|
98
|
-
const result = await doValidateField(modelProps);
|
|
99
|
-
if (result === true) {
|
|
100
|
-
callback == null ? void 0 : callback(result);
|
|
101
|
-
}
|
|
102
|
-
return result;
|
|
103
|
-
} catch (e) {
|
|
104
|
-
const invalidFields = e;
|
|
105
|
-
if (props.scrollToError) {
|
|
106
|
-
scrollToField(Object.keys(invalidFields)[0]);
|
|
107
|
-
}
|
|
108
|
-
callback == null ? void 0 : callback(false, invalidFields);
|
|
109
|
-
return shouldThrow && Promise.reject(invalidFields);
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
const scrollToField = (prop) => {
|
|
113
|
-
var _a;
|
|
114
|
-
const field = filterFields(fields, prop)[0];
|
|
115
|
-
if (field) {
|
|
116
|
-
(_a = field.$el) == null ? void 0 : _a.scrollIntoView();
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
watch(() => props.rules, () => {
|
|
120
|
-
if (props.validateOnRuleChange) {
|
|
121
|
-
validate().catch((err) => debugWarn(err));
|
|
122
|
-
}
|
|
123
|
-
}, { deep: true });
|
|
124
|
-
provide(formContextKey, reactive({
|
|
125
|
-
...toRefs(props),
|
|
126
|
-
emit,
|
|
127
|
-
resetFields,
|
|
128
|
-
clearValidate,
|
|
129
|
-
validateField,
|
|
130
|
-
addField,
|
|
131
|
-
removeField,
|
|
132
|
-
...useFormLabelWidth()
|
|
133
|
-
}));
|
|
134
|
-
expose({
|
|
135
|
-
validate,
|
|
136
|
-
validateField,
|
|
137
|
-
resetFields,
|
|
138
|
-
clearValidate,
|
|
139
|
-
scrollToField
|
|
140
|
-
});
|
|
141
|
-
return (_ctx, _cache) => {
|
|
142
|
-
return openBlock(), createElementBlock("form", {
|
|
143
|
-
class: normalizeClass(unref(formClasses))
|
|
144
|
-
}, [
|
|
145
|
-
renderSlot(_ctx.$slots, "default")
|
|
146
|
-
], 2);
|
|
147
|
-
};
|
|
148
|
-
}
|
|
8
|
+
const formProps = buildProps({
|
|
9
|
+
model: Object,
|
|
10
|
+
rules: {
|
|
11
|
+
type: definePropType(Object)
|
|
12
|
+
},
|
|
13
|
+
labelPosition: {
|
|
14
|
+
type: String,
|
|
15
|
+
values: ["left", "right", "top"],
|
|
16
|
+
default: "right"
|
|
17
|
+
},
|
|
18
|
+
labelWidth: {
|
|
19
|
+
type: [String, Number],
|
|
20
|
+
default: ""
|
|
21
|
+
},
|
|
22
|
+
labelSuffix: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: ""
|
|
25
|
+
},
|
|
26
|
+
inline: Boolean,
|
|
27
|
+
inlineMessage: Boolean,
|
|
28
|
+
statusIcon: Boolean,
|
|
29
|
+
showMessage: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: true
|
|
32
|
+
},
|
|
33
|
+
size: {
|
|
34
|
+
type: String,
|
|
35
|
+
values: componentSizes
|
|
36
|
+
},
|
|
37
|
+
disabled: Boolean,
|
|
38
|
+
validateOnRuleChange: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: true
|
|
41
|
+
},
|
|
42
|
+
hideRequiredAsterisk: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false
|
|
45
|
+
},
|
|
46
|
+
scrollToError: Boolean
|
|
149
47
|
});
|
|
150
|
-
|
|
48
|
+
const formEmits = {
|
|
49
|
+
validate: (prop, isValid, message) => (isArray(prop) || isString(prop)) && isBoolean(isValid) && isString(message)
|
|
50
|
+
};
|
|
151
51
|
|
|
152
|
-
export {
|
|
52
|
+
export { formEmits, formProps };
|
|
153
53
|
//# sourceMappingURL=form3.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form3.mjs","sources":["../../../../../../packages/components/form/src/form.
|
|
1
|
+
{"version":3,"file":"form3.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 '@element-plus/tokens'\n\nexport const formProps = buildProps({\n model: Object,\n rules: {\n type: definePropType<FormRules>(Object),\n },\n labelPosition: {\n type: String,\n values: ['left', 'right', 'top'] as const,\n default: 'right',\n },\n labelWidth: {\n type: [String, Number],\n default: '',\n },\n labelSuffix: {\n type: String,\n default: '',\n },\n inline: Boolean,\n inlineMessage: Boolean,\n statusIcon: Boolean,\n showMessage: {\n type: Boolean,\n default: true,\n },\n size: {\n type: String,\n values: componentSizes,\n },\n disabled: Boolean,\n validateOnRuleChange: {\n type: Boolean,\n default: true,\n },\n hideRequiredAsterisk: {\n type: Boolean,\n default: false,\n },\n scrollToError: Boolean,\n} as const)\nexport type FormProps = ExtractPropTypes<typeof formProps>\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":";;;;;;;AAQY,MAAC,SAAS,GAAG,UAAU,CAAC;AACpC,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC;AACpC,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,aAAa,EAAE,OAAO;AACxB,EAAE,UAAU,EAAE,OAAO;AACrB,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,cAAc;AAC1B,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,oBAAoB,EAAE;AACxB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,oBAAoB,EAAE;AACxB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,aAAa,EAAE,OAAO;AACxB,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,53 +1,153 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import { defineComponent, computed, watch, provide, reactive, toRefs, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from 'vue';
|
|
2
2
|
import '../../../utils/index2.mjs';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import '../../../tokens/index2.mjs';
|
|
4
|
+
import '../../../hooks/index2.mjs';
|
|
5
|
+
import { formProps, formEmits } from './form3.mjs';
|
|
6
|
+
import { filterFields, useFormLabelWidth } from './utils2.mjs';
|
|
7
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
8
|
+
import { useSize } from '../../../hooks/use-common-props/index2.mjs';
|
|
9
|
+
import { useNamespace } from '../../../hooks/use-namespace/index2.mjs';
|
|
10
|
+
import { debugWarn } from '../../../utils/error2.mjs';
|
|
11
|
+
import { isFunction } from '@vue/shared';
|
|
12
|
+
import { formContextKey } from '../../../tokens/form2.mjs';
|
|
7
13
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
rules: {
|
|
11
|
-
type: definePropType(Object)
|
|
12
|
-
},
|
|
13
|
-
labelPosition: {
|
|
14
|
-
type: String,
|
|
15
|
-
values: ["left", "right", "top"],
|
|
16
|
-
default: "right"
|
|
17
|
-
},
|
|
18
|
-
labelWidth: {
|
|
19
|
-
type: [String, Number],
|
|
20
|
-
default: ""
|
|
21
|
-
},
|
|
22
|
-
labelSuffix: {
|
|
23
|
-
type: String,
|
|
24
|
-
default: ""
|
|
25
|
-
},
|
|
26
|
-
inline: Boolean,
|
|
27
|
-
inlineMessage: Boolean,
|
|
28
|
-
statusIcon: Boolean,
|
|
29
|
-
showMessage: {
|
|
30
|
-
type: Boolean,
|
|
31
|
-
default: true
|
|
32
|
-
},
|
|
33
|
-
size: {
|
|
34
|
-
type: String,
|
|
35
|
-
values: componentSizes
|
|
36
|
-
},
|
|
37
|
-
disabled: Boolean,
|
|
38
|
-
validateOnRuleChange: {
|
|
39
|
-
type: Boolean,
|
|
40
|
-
default: true
|
|
41
|
-
},
|
|
42
|
-
hideRequiredAsterisk: {
|
|
43
|
-
type: Boolean,
|
|
44
|
-
default: false
|
|
45
|
-
},
|
|
46
|
-
scrollToError: Boolean
|
|
47
|
-
});
|
|
48
|
-
const formEmits = {
|
|
49
|
-
validate: (prop, isValid, message) => (isArray(prop) || isString(prop)) && isBoolean(isValid) && isString(message)
|
|
14
|
+
const __default__ = {
|
|
15
|
+
name: "ElForm"
|
|
50
16
|
};
|
|
17
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
18
|
+
...__default__,
|
|
19
|
+
props: formProps,
|
|
20
|
+
emits: formEmits,
|
|
21
|
+
setup(__props, { expose, emit }) {
|
|
22
|
+
const props = __props;
|
|
23
|
+
const COMPONENT_NAME = "ElForm";
|
|
24
|
+
const fields = [];
|
|
25
|
+
const formSize = useSize();
|
|
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 addField = (field) => {
|
|
39
|
+
fields.push(field);
|
|
40
|
+
};
|
|
41
|
+
const removeField = (field) => {
|
|
42
|
+
if (field.prop) {
|
|
43
|
+
fields.splice(fields.indexOf(field), 1);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const resetFields = (properties = []) => {
|
|
47
|
+
if (!props.model) {
|
|
48
|
+
debugWarn(COMPONENT_NAME, "model is required for resetFields to work.");
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
filterFields(fields, properties).forEach((field) => field.resetField());
|
|
52
|
+
};
|
|
53
|
+
const clearValidate = (props2 = []) => {
|
|
54
|
+
filterFields(fields, props2).forEach((field) => field.clearValidate());
|
|
55
|
+
};
|
|
56
|
+
const isValidatable = computed(() => {
|
|
57
|
+
const hasModel = !!props.model;
|
|
58
|
+
if (!hasModel) {
|
|
59
|
+
debugWarn(COMPONENT_NAME, "model is required for validate to work.");
|
|
60
|
+
}
|
|
61
|
+
return hasModel;
|
|
62
|
+
});
|
|
63
|
+
const obtainValidateFields = (props2) => {
|
|
64
|
+
if (fields.length === 0)
|
|
65
|
+
return [];
|
|
66
|
+
const filteredFields = filterFields(fields, props2);
|
|
67
|
+
if (!filteredFields.length) {
|
|
68
|
+
debugWarn(COMPONENT_NAME, "please pass correct props!");
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
return filteredFields;
|
|
72
|
+
};
|
|
73
|
+
const validate = async (callback) => validateField(void 0, callback);
|
|
74
|
+
const doValidateField = async (props2 = []) => {
|
|
75
|
+
if (!isValidatable.value)
|
|
76
|
+
return false;
|
|
77
|
+
const fields2 = obtainValidateFields(props2);
|
|
78
|
+
if (fields2.length === 0)
|
|
79
|
+
return true;
|
|
80
|
+
let validationErrors = {};
|
|
81
|
+
for (const field of fields2) {
|
|
82
|
+
try {
|
|
83
|
+
await field.validate("");
|
|
84
|
+
} catch (fields3) {
|
|
85
|
+
validationErrors = {
|
|
86
|
+
...validationErrors,
|
|
87
|
+
...fields3
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (Object.keys(validationErrors).length === 0)
|
|
92
|
+
return true;
|
|
93
|
+
return Promise.reject(validationErrors);
|
|
94
|
+
};
|
|
95
|
+
const validateField = async (modelProps = [], callback) => {
|
|
96
|
+
const shouldThrow = !isFunction(callback);
|
|
97
|
+
try {
|
|
98
|
+
const result = await doValidateField(modelProps);
|
|
99
|
+
if (result === true) {
|
|
100
|
+
callback == null ? void 0 : callback(result);
|
|
101
|
+
}
|
|
102
|
+
return result;
|
|
103
|
+
} catch (e) {
|
|
104
|
+
const invalidFields = e;
|
|
105
|
+
if (props.scrollToError) {
|
|
106
|
+
scrollToField(Object.keys(invalidFields)[0]);
|
|
107
|
+
}
|
|
108
|
+
callback == null ? void 0 : callback(false, invalidFields);
|
|
109
|
+
return shouldThrow && Promise.reject(invalidFields);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
const scrollToField = (prop) => {
|
|
113
|
+
var _a;
|
|
114
|
+
const field = filterFields(fields, prop)[0];
|
|
115
|
+
if (field) {
|
|
116
|
+
(_a = field.$el) == null ? void 0 : _a.scrollIntoView();
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
watch(() => props.rules, () => {
|
|
120
|
+
if (props.validateOnRuleChange) {
|
|
121
|
+
validate().catch((err) => debugWarn(err));
|
|
122
|
+
}
|
|
123
|
+
}, { deep: true });
|
|
124
|
+
provide(formContextKey, reactive({
|
|
125
|
+
...toRefs(props),
|
|
126
|
+
emit,
|
|
127
|
+
resetFields,
|
|
128
|
+
clearValidate,
|
|
129
|
+
validateField,
|
|
130
|
+
addField,
|
|
131
|
+
removeField,
|
|
132
|
+
...useFormLabelWidth()
|
|
133
|
+
}));
|
|
134
|
+
expose({
|
|
135
|
+
validate,
|
|
136
|
+
validateField,
|
|
137
|
+
resetFields,
|
|
138
|
+
clearValidate,
|
|
139
|
+
scrollToField
|
|
140
|
+
});
|
|
141
|
+
return (_ctx, _cache) => {
|
|
142
|
+
return openBlock(), createElementBlock("form", {
|
|
143
|
+
class: normalizeClass(unref(formClasses))
|
|
144
|
+
}, [
|
|
145
|
+
renderSlot(_ctx.$slots, "default")
|
|
146
|
+
], 2);
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
var Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/form/src/form.vue"]]);
|
|
51
151
|
|
|
52
|
-
export {
|
|
152
|
+
export { Form as default };
|
|
53
153
|
//# sourceMappingURL=form4.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form4.mjs","sources":["../../../../../../packages/components/form/src/form.
|
|
1
|
+
{"version":3,"file":"form4.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 { formContextKey } from '@element-plus/tokens'\nimport { useNamespace, useSize } from '@element-plus/hooks'\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 '@element-plus/tokens'\nimport type { FormItemProp } from './form-item'\n\nconst COMPONENT_NAME = 'ElForm'\ndefineOptions({\n name: 'ElForm',\n})\nconst props = defineProps(formProps)\nconst emit = defineEmits(formEmits)\n\nconst fields: FormItemContext[] = []\n\nconst formSize = useSize()\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 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 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()\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 addField,\n removeField,\n\n ...useFormLabelWidth(),\n })\n)\n\ndefineExpose({\n /** @description validate form */\n validate,\n /** @description validate form field */\n validateField,\n /** @description reset fields */\n resetFields,\n /** @description clear validation status */\n clearValidate,\n /** @description scroll to field */\n scrollToField,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwBA,IAAA,MAAA,cAAA,GAAA,QAAA,CAAA;AAOA,IAAA,MAAA,SAAA,EAAA,CAAA;AAEA,IAAA,MAAA,WAAA,OAAA,EAAA,CAAA;AACA,IAAA,MAAA,EAAA,GAAA,aAAA,MAAA,CAAA,CAAA;AACA,IAAA,MAAA,WAAA,GAAA,SAAA,MAAA;AACA,MAAA,MAAA,EAAA,eAAA,MAAA,EAAA,GAAA,KAAA,CAAA;AACA,MAAA,OAAA;AAAA,QACA,GAAA,CAAA,EAAA;AAAA,QAGA,EAAA,CAAA,CAAA,CAAA,QAAA,CAAA,KAAA,IAAA,SAAA,CAAA;AAAA,QACA;AAAA,UACA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,MAAA,EAAA,eAAA,CAAA,GAAA,aAAA;AAAA,UACA,CAAA,EAAA,CAAA,CAAA,CAAA,QAAA,CAAA,GAAA,MAAA;AAAA,SACA;AAAA,OACA,CAAA;AAAA,KACA,CAAA,CAAA;AAEA,IAAA,MAAA,QAAA,GAAA,CAAA,KAAA,KAAA;AACA,MAAA,MAAA,CAAA,KAAA,KAAA,CAAA,CAAA;AAAA,KACA,CAAA;AAEA,IAAA,MAAA,WAAA,GAAA,CAAA,KAAA,KAAA;AACA,MAAA,IAAA,MAAA,IAAA,EAAA;AACA,QAAA,MAAA,CAAA,M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package/es/components/index.mjs
CHANGED
|
@@ -55,7 +55,7 @@ export { DROPDOWN_INJECTION_KEY } from './dropdown/src/tokens2.mjs';
|
|
|
55
55
|
export { ElDropdown, ElDropdownItem, ElDropdownMenu } from './dropdown/index2.mjs';
|
|
56
56
|
export { emptyProps } from './empty/src/empty3.mjs';
|
|
57
57
|
export { ElEmpty } from './empty/index2.mjs';
|
|
58
|
-
export { formEmits, formProps } from './form/src/
|
|
58
|
+
export { formEmits, formProps } from './form/src/form3.mjs';
|
|
59
59
|
export { formItemProps, formItemValidateStates } from './form/src/form-item3.mjs';
|
|
60
60
|
export { ElForm, ElFormItem } from './form/index2.mjs';
|
|
61
61
|
export { iconProps } from './icon/src/icon3.mjs';
|
|
@@ -66,6 +66,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
66
66
|
quickPrevFocus: import("vue").Ref<boolean>;
|
|
67
67
|
quickNextFocus: import("vue").Ref<boolean>;
|
|
68
68
|
pagers: import("vue").ComputedRef<number[]>;
|
|
69
|
+
tabindex: import("vue").ComputedRef<0 | -1>;
|
|
69
70
|
onMouseEnter: (forward?: boolean) => void;
|
|
70
71
|
onFocus: (forward?: boolean) => void;
|
|
71
72
|
onEnter: (e: UIEvent) => void;
|