element-plus 2.5.0 → 2.5.1
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 +46 -37
- package/dist/index.full.min.js +11 -11
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +11 -11
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +46 -37
- 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/collection/index.mjs +1 -1
- package/es/components/collection/src/collection.mjs +62 -10
- package/es/components/collection/src/collection.mjs.map +1 -1
- package/es/components/collection/src/collection2.mjs +10 -62
- package/es/components/collection/src/collection2.mjs.map +1 -1
- package/es/components/color-picker/index.mjs +2 -2
- package/es/components/color-picker/src/color-picker.mjs +402 -40
- package/es/components/color-picker/src/color-picker.mjs.map +1 -1
- package/es/components/color-picker/src/color-picker2.mjs +40 -402
- package/es/components/color-picker/src/color-picker2.mjs.map +1 -1
- package/es/components/color-picker/src/components/predefine.mjs +1 -1
- package/es/components/countdown/index.mjs +2 -2
- package/es/components/countdown/src/countdown.mjs +23 -74
- package/es/components/countdown/src/countdown.mjs.map +1 -1
- package/es/components/countdown/src/countdown2.mjs +74 -23
- package/es/components/countdown/src/countdown2.mjs.map +1 -1
- package/es/components/descriptions/index.mjs +2 -2
- package/es/components/descriptions/src/description.mjs +25 -112
- package/es/components/descriptions/src/description.mjs.map +1 -1
- package/es/components/descriptions/src/description2.mjs +112 -25
- package/es/components/descriptions/src/description2.mjs.map +1 -1
- package/es/components/dialog/src/dialog-content.mjs +29 -89
- package/es/components/dialog/src/dialog-content.mjs.map +1 -1
- package/es/components/dialog/src/dialog-content2.mjs +89 -29
- package/es/components/dialog/src/dialog-content2.mjs.map +1 -1
- package/es/components/dialog/src/dialog.mjs +1 -1
- package/es/components/dialog/src/dialog2.mjs +1 -1
- package/es/components/dropdown/src/dropdown-item-impl.mjs +1 -1
- package/es/components/dropdown/src/dropdown.mjs +1 -1
- package/es/components/form/index.mjs +2 -2
- package/es/components/form/src/form.mjs +152 -54
- package/es/components/form/src/form.mjs.map +1 -1
- package/es/components/form/src/form2.mjs +54 -152
- package/es/components/form/src/form2.mjs.map +1 -1
- package/es/components/index.mjs +5 -5
- package/es/components/pagination/src/components/sizes.mjs +69 -23
- package/es/components/pagination/src/components/sizes.mjs.map +1 -1
- package/es/components/pagination/src/components/sizes2.mjs +23 -69
- package/es/components/pagination/src/components/sizes2.mjs.map +1 -1
- package/es/components/pagination/src/pagination.mjs +1 -1
- package/es/components/roving-focus-group/src/roving-focus-group.mjs +1 -1
- package/es/components/select/src/select2.mjs +25 -24
- package/es/components/select/src/select2.mjs.map +1 -1
- package/es/components/select/src/useSelect.mjs +15 -9
- package/es/components/select/src/useSelect.mjs.map +1 -1
- package/es/components/select-v2/src/select.mjs +7 -5
- package/es/components/select-v2/src/select.mjs.map +1 -1
- package/es/components/steps/index.mjs +2 -2
- package/es/components/steps/src/item.mjs +191 -19
- package/es/components/steps/src/item.mjs.map +1 -1
- package/es/components/steps/src/item2.mjs +19 -191
- package/es/components/steps/src/item2.mjs.map +1 -1
- package/es/index.mjs +5 -5
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/collection/index.js +1 -1
- package/lib/components/collection/src/collection.js +62 -9
- package/lib/components/collection/src/collection.js.map +1 -1
- package/lib/components/collection/src/collection2.js +9 -62
- package/lib/components/collection/src/collection2.js.map +1 -1
- package/lib/components/color-picker/index.js +2 -2
- package/lib/components/color-picker/src/color-picker.js +400 -40
- package/lib/components/color-picker/src/color-picker.js.map +1 -1
- package/lib/components/color-picker/src/color-picker2.js +40 -400
- package/lib/components/color-picker/src/color-picker2.js.map +1 -1
- package/lib/components/color-picker/src/components/predefine.js +1 -1
- package/lib/components/countdown/index.js +2 -2
- package/lib/components/countdown/src/countdown.js +24 -74
- package/lib/components/countdown/src/countdown.js.map +1 -1
- package/lib/components/countdown/src/countdown2.js +74 -24
- package/lib/components/countdown/src/countdown2.js.map +1 -1
- package/lib/components/descriptions/index.js +2 -2
- package/lib/components/descriptions/src/description.js +25 -112
- package/lib/components/descriptions/src/description.js.map +1 -1
- package/lib/components/descriptions/src/description2.js +112 -25
- package/lib/components/descriptions/src/description2.js.map +1 -1
- package/lib/components/dialog/src/dialog-content.js +29 -88
- package/lib/components/dialog/src/dialog-content.js.map +1 -1
- package/lib/components/dialog/src/dialog-content2.js +88 -29
- package/lib/components/dialog/src/dialog-content2.js.map +1 -1
- package/lib/components/dialog/src/dialog.js +1 -1
- package/lib/components/dialog/src/dialog2.js +1 -1
- package/lib/components/dropdown/src/dropdown-item-impl.js +1 -1
- package/lib/components/dropdown/src/dropdown.js +1 -1
- package/lib/components/form/index.js +2 -2
- package/lib/components/form/src/form.js +151 -54
- package/lib/components/form/src/form.js.map +1 -1
- package/lib/components/form/src/form2.js +54 -151
- package/lib/components/form/src/form2.js.map +1 -1
- package/lib/components/index.js +5 -5
- package/lib/components/pagination/src/components/sizes.js +69 -23
- package/lib/components/pagination/src/components/sizes.js.map +1 -1
- package/lib/components/pagination/src/components/sizes2.js +23 -69
- package/lib/components/pagination/src/components/sizes2.js.map +1 -1
- package/lib/components/pagination/src/pagination.js +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-group.js +1 -1
- package/lib/components/select/src/select2.js +24 -23
- package/lib/components/select/src/select2.js.map +1 -1
- package/lib/components/select/src/useSelect.js +13 -7
- package/lib/components/select/src/useSelect.js.map +1 -1
- package/lib/components/select-v2/src/select.js +7 -5
- package/lib/components/select-v2/src/select.js.map +1 -1
- package/lib/components/steps/index.js +2 -2
- package/lib/components/steps/src/item.js +191 -19
- package/lib/components/steps/src/item.js.map +1 -1
- package/lib/components/steps/src/item2.js +19 -191
- package/lib/components/steps/src/item2.js.map +1 -1
- package/lib/index.js +5 -5
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/web-types.json +1 -1
|
@@ -2,98 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var vue = require('vue');
|
|
6
|
-
var index$2 = require('../../icon/index.js');
|
|
7
|
-
require('../../focus-trap/index.js');
|
|
8
|
-
require('../../../hooks/index.js');
|
|
9
5
|
require('../../../utils/index.js');
|
|
10
|
-
var
|
|
11
|
-
var dialogContent = require('./dialog-content2.js');
|
|
12
|
-
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
13
|
-
var index = require('../../../hooks/use-locale/index.js');
|
|
6
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
14
7
|
var icon = require('../../../utils/vue/icon.js');
|
|
15
|
-
var tokens = require('../../focus-trap/src/tokens.js');
|
|
16
|
-
var refs = require('../../../utils/vue/refs.js');
|
|
17
|
-
var index$1 = require('../../../hooks/use-draggable/index.js');
|
|
18
8
|
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const draggable = vue.computed(() => props.draggable);
|
|
43
|
-
index$1.useDraggable(dialogRef, headerRef, draggable);
|
|
44
|
-
return (_ctx, _cache) => {
|
|
45
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
46
|
-
ref: vue.unref(composedDialogRef),
|
|
47
|
-
class: vue.normalizeClass(vue.unref(dialogKls)),
|
|
48
|
-
style: vue.normalizeStyle(vue.unref(style)),
|
|
49
|
-
tabindex: "-1"
|
|
50
|
-
}, [
|
|
51
|
-
vue.createElementVNode("header", {
|
|
52
|
-
ref_key: "headerRef",
|
|
53
|
-
ref: headerRef,
|
|
54
|
-
class: vue.normalizeClass(vue.unref(ns).e("header"))
|
|
55
|
-
}, [
|
|
56
|
-
vue.renderSlot(_ctx.$slots, "header", {}, () => [
|
|
57
|
-
vue.createElementVNode("span", {
|
|
58
|
-
role: "heading",
|
|
59
|
-
"aria-level": _ctx.ariaLevel,
|
|
60
|
-
class: vue.normalizeClass(vue.unref(ns).e("title"))
|
|
61
|
-
}, vue.toDisplayString(_ctx.title), 11, _hoisted_1)
|
|
62
|
-
]),
|
|
63
|
-
_ctx.showClose ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
64
|
-
key: 0,
|
|
65
|
-
"aria-label": vue.unref(t)("el.dialog.close"),
|
|
66
|
-
class: vue.normalizeClass(vue.unref(ns).e("headerbtn")),
|
|
67
|
-
type: "button",
|
|
68
|
-
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
|
|
69
|
-
}, [
|
|
70
|
-
vue.createVNode(vue.unref(index$2.ElIcon), {
|
|
71
|
-
class: vue.normalizeClass(vue.unref(ns).e("close"))
|
|
72
|
-
}, {
|
|
73
|
-
default: vue.withCtx(() => [
|
|
74
|
-
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.closeIcon || vue.unref(Close))))
|
|
75
|
-
]),
|
|
76
|
-
_: 1
|
|
77
|
-
}, 8, ["class"])
|
|
78
|
-
], 10, _hoisted_2)) : vue.createCommentVNode("v-if", true)
|
|
79
|
-
], 2),
|
|
80
|
-
vue.createElementVNode("div", {
|
|
81
|
-
id: vue.unref(bodyId),
|
|
82
|
-
class: vue.normalizeClass(vue.unref(ns).e("body"))
|
|
83
|
-
}, [
|
|
84
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
85
|
-
], 10, _hoisted_3),
|
|
86
|
-
_ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("footer", {
|
|
87
|
-
key: 0,
|
|
88
|
-
class: vue.normalizeClass(vue.unref(ns).e("footer"))
|
|
89
|
-
}, [
|
|
90
|
-
vue.renderSlot(_ctx.$slots, "footer")
|
|
91
|
-
], 2)) : vue.createCommentVNode("v-if", true)
|
|
92
|
-
], 6);
|
|
93
|
-
};
|
|
9
|
+
const dialogContentProps = runtime.buildProps({
|
|
10
|
+
center: Boolean,
|
|
11
|
+
alignCenter: Boolean,
|
|
12
|
+
closeIcon: {
|
|
13
|
+
type: icon.iconPropType
|
|
14
|
+
},
|
|
15
|
+
customClass: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: ""
|
|
18
|
+
},
|
|
19
|
+
draggable: Boolean,
|
|
20
|
+
fullscreen: Boolean,
|
|
21
|
+
showClose: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: true
|
|
24
|
+
},
|
|
25
|
+
title: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: ""
|
|
28
|
+
},
|
|
29
|
+
ariaLevel: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: "2"
|
|
94
32
|
}
|
|
95
33
|
});
|
|
96
|
-
|
|
34
|
+
const dialogContentEmits = {
|
|
35
|
+
close: () => true
|
|
36
|
+
};
|
|
97
37
|
|
|
98
|
-
exports
|
|
38
|
+
exports.dialogContentEmits = dialogContentEmits;
|
|
39
|
+
exports.dialogContentProps = dialogContentProps;
|
|
99
40
|
//# sourceMappingURL=dialog-content.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-content.js","sources":["../../../../../../packages/components/dialog/src/dialog-content.
|
|
1
|
+
{"version":3,"file":"dialog-content.js","sources":["../../../../../../packages/components/dialog/src/dialog-content.ts"],"sourcesContent":["import { buildProps, iconPropType } from '@element-plus/utils'\n\nexport const dialogContentProps = buildProps({\n /**\n * @description whether to align the header and footer in center\n */\n center: Boolean,\n /**\n * @description whether to align the dialog both horizontally and vertically\n */\n alignCenter: Boolean,\n /**\n * @description custom close icon, default is Close\n */\n closeIcon: {\n type: iconPropType,\n },\n /**\n * @deprecated will be removed in version 2.4.0, please use class\n */\n customClass: {\n type: String,\n default: '',\n },\n /**\n * @description enable dragging feature for Dialog\n */\n draggable: Boolean,\n /**\n * @description whether the Dialog takes up full screen\n */\n fullscreen: Boolean,\n /**\n * @description whether to show a close button\n */\n showClose: {\n type: Boolean,\n default: true,\n },\n /**\n * @description title of Dialog. Can also be passed with a named slot (see the following table)\n */\n title: {\n type: String,\n default: '',\n },\n /**\n * @description header's aria-level attribute\n */\n ariaLevel: {\n type: String,\n default: '2',\n },\n} as const)\n\nexport const dialogContentEmits = {\n close: () => true,\n}\n"],"names":["buildProps","iconPropType"],"mappings":";;;;;;;;AACY,MAAC,kBAAkB,GAAGA,kBAAU,CAAC;AAC7C,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,WAAW,EAAE,OAAO;AACtB,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAEC,iBAAY;AACtB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE,OAAO;AACpB,EAAE,UAAU,EAAE,OAAO;AACrB,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,kBAAkB,GAAG;AAClC,EAAE,KAAK,EAAE,MAAM,IAAI;AACnB;;;;;"}
|
|
@@ -2,39 +2,98 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var index$2 = require('../../icon/index.js');
|
|
7
|
+
require('../../focus-trap/index.js');
|
|
8
|
+
require('../../../hooks/index.js');
|
|
5
9
|
require('../../../utils/index.js');
|
|
6
|
-
var
|
|
10
|
+
var constants = require('./constants.js');
|
|
11
|
+
var dialogContent = require('./dialog-content.js');
|
|
12
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
13
|
+
var index = require('../../../hooks/use-locale/index.js');
|
|
7
14
|
var icon = require('../../../utils/vue/icon.js');
|
|
15
|
+
var tokens = require('../../focus-trap/src/tokens.js');
|
|
16
|
+
var refs = require('../../../utils/vue/refs.js');
|
|
17
|
+
var index$1 = require('../../../hooks/use-draggable/index.js');
|
|
8
18
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
const _hoisted_1 = ["aria-level"];
|
|
20
|
+
const _hoisted_2 = ["aria-label"];
|
|
21
|
+
const _hoisted_3 = ["id"];
|
|
22
|
+
const __default__ = vue.defineComponent({ name: "ElDialogContent" });
|
|
23
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
24
|
+
...__default__,
|
|
25
|
+
props: dialogContent.dialogContentProps,
|
|
26
|
+
emits: dialogContent.dialogContentEmits,
|
|
27
|
+
setup(__props) {
|
|
28
|
+
const props = __props;
|
|
29
|
+
const { t } = index.useLocale();
|
|
30
|
+
const { Close } = icon.CloseComponents;
|
|
31
|
+
const { dialogRef, headerRef, bodyId, ns, style } = vue.inject(constants.dialogInjectionKey);
|
|
32
|
+
const { focusTrapRef } = vue.inject(tokens.FOCUS_TRAP_INJECTION_KEY);
|
|
33
|
+
const dialogKls = vue.computed(() => [
|
|
34
|
+
ns.b(),
|
|
35
|
+
ns.is("fullscreen", props.fullscreen),
|
|
36
|
+
ns.is("draggable", props.draggable),
|
|
37
|
+
ns.is("align-center", props.alignCenter),
|
|
38
|
+
{ [ns.m("center")]: props.center },
|
|
39
|
+
props.customClass
|
|
40
|
+
]);
|
|
41
|
+
const composedDialogRef = refs.composeRefs(focusTrapRef, dialogRef);
|
|
42
|
+
const draggable = vue.computed(() => props.draggable);
|
|
43
|
+
index$1.useDraggable(dialogRef, headerRef, draggable);
|
|
44
|
+
return (_ctx, _cache) => {
|
|
45
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
46
|
+
ref: vue.unref(composedDialogRef),
|
|
47
|
+
class: vue.normalizeClass(vue.unref(dialogKls)),
|
|
48
|
+
style: vue.normalizeStyle(vue.unref(style)),
|
|
49
|
+
tabindex: "-1"
|
|
50
|
+
}, [
|
|
51
|
+
vue.createElementVNode("header", {
|
|
52
|
+
ref_key: "headerRef",
|
|
53
|
+
ref: headerRef,
|
|
54
|
+
class: vue.normalizeClass(vue.unref(ns).e("header"))
|
|
55
|
+
}, [
|
|
56
|
+
vue.renderSlot(_ctx.$slots, "header", {}, () => [
|
|
57
|
+
vue.createElementVNode("span", {
|
|
58
|
+
role: "heading",
|
|
59
|
+
"aria-level": _ctx.ariaLevel,
|
|
60
|
+
class: vue.normalizeClass(vue.unref(ns).e("title"))
|
|
61
|
+
}, vue.toDisplayString(_ctx.title), 11, _hoisted_1)
|
|
62
|
+
]),
|
|
63
|
+
_ctx.showClose ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
64
|
+
key: 0,
|
|
65
|
+
"aria-label": vue.unref(t)("el.dialog.close"),
|
|
66
|
+
class: vue.normalizeClass(vue.unref(ns).e("headerbtn")),
|
|
67
|
+
type: "button",
|
|
68
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
|
|
69
|
+
}, [
|
|
70
|
+
vue.createVNode(vue.unref(index$2.ElIcon), {
|
|
71
|
+
class: vue.normalizeClass(vue.unref(ns).e("close"))
|
|
72
|
+
}, {
|
|
73
|
+
default: vue.withCtx(() => [
|
|
74
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.closeIcon || vue.unref(Close))))
|
|
75
|
+
]),
|
|
76
|
+
_: 1
|
|
77
|
+
}, 8, ["class"])
|
|
78
|
+
], 10, _hoisted_2)) : vue.createCommentVNode("v-if", true)
|
|
79
|
+
], 2),
|
|
80
|
+
vue.createElementVNode("div", {
|
|
81
|
+
id: vue.unref(bodyId),
|
|
82
|
+
class: vue.normalizeClass(vue.unref(ns).e("body"))
|
|
83
|
+
}, [
|
|
84
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
85
|
+
], 10, _hoisted_3),
|
|
86
|
+
_ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("footer", {
|
|
87
|
+
key: 0,
|
|
88
|
+
class: vue.normalizeClass(vue.unref(ns).e("footer"))
|
|
89
|
+
}, [
|
|
90
|
+
vue.renderSlot(_ctx.$slots, "footer")
|
|
91
|
+
], 2)) : vue.createCommentVNode("v-if", true)
|
|
92
|
+
], 6);
|
|
93
|
+
};
|
|
32
94
|
}
|
|
33
95
|
});
|
|
34
|
-
|
|
35
|
-
close: () => true
|
|
36
|
-
};
|
|
96
|
+
var ElDialogContent = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "dialog-content.vue"]]);
|
|
37
97
|
|
|
38
|
-
exports
|
|
39
|
-
exports.dialogContentProps = dialogContentProps;
|
|
98
|
+
exports["default"] = ElDialogContent;
|
|
40
99
|
//# sourceMappingURL=dialog-content2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-content2.js","sources":["../../../../../../packages/components/dialog/src/dialog-content.
|
|
1
|
+
{"version":3,"file":"dialog-content2.js","sources":["../../../../../../packages/components/dialog/src/dialog-content.vue"],"sourcesContent":["<template>\n <div :ref=\"composedDialogRef\" :class=\"dialogKls\" :style=\"style\" tabindex=\"-1\">\n <header ref=\"headerRef\" :class=\"ns.e('header')\">\n <slot name=\"header\">\n <span role=\"heading\" :aria-level=\"ariaLevel\" :class=\"ns.e('title')\">\n {{ title }}\n </span>\n </slot>\n <button\n v-if=\"showClose\"\n :aria-label=\"t('el.dialog.close')\"\n :class=\"ns.e('headerbtn')\"\n type=\"button\"\n @click=\"$emit('close')\"\n >\n <el-icon :class=\"ns.e('close')\">\n <component :is=\"closeIcon || Close\" />\n </el-icon>\n </button>\n </header>\n <div :id=\"bodyId\" :class=\"ns.e('body')\">\n <slot />\n </div>\n <footer v-if=\"$slots.footer\" :class=\"ns.e('footer')\">\n <slot name=\"footer\" />\n </footer>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject } from 'vue'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { FOCUS_TRAP_INJECTION_KEY } from '@element-plus/components/focus-trap'\nimport { useDraggable, useLocale } from '@element-plus/hooks'\nimport { CloseComponents, composeRefs } from '@element-plus/utils'\nimport { dialogInjectionKey } from './constants'\nimport { dialogContentEmits, dialogContentProps } from './dialog-content'\n\nconst { t } = useLocale()\nconst { Close } = CloseComponents\n\ndefineOptions({ name: 'ElDialogContent' })\nconst props = defineProps(dialogContentProps)\ndefineEmits(dialogContentEmits)\n\nconst { dialogRef, headerRef, bodyId, ns, style } = inject(dialogInjectionKey)!\nconst { focusTrapRef } = inject(FOCUS_TRAP_INJECTION_KEY)!\n\nconst dialogKls = computed(() => [\n ns.b(),\n ns.is('fullscreen', props.fullscreen),\n ns.is('draggable', props.draggable),\n ns.is('align-center', props.alignCenter),\n { [ns.m('center')]: props.center },\n props.customClass,\n])\n\nconst composedDialogRef = composeRefs(focusTrapRef, dialogRef)\n\nconst draggable = computed(() => props.draggable)\nuseDraggable(dialogRef, headerRef, draggable)\n</script>\n"],"names":["useLocale","CloseComponents","inject","dialogInjectionKey","FOCUS_TRAP_INJECTION_KEY","computed","composeRefs","useDraggable"],"mappings":";;;;;;;;;;;;;;;;;;;;;uCAyCc,CAAA,EAAE,IAAM,EAAA,iBAAA,EAAkB,CAAA,CAAA;;;;;;;AAHxC,IAAM,MAAA,EAAE,MAAMA,eAAU,EAAA,CAAA;AACxB,IAAA,MAAM,EAAE,KAAU,EAAA,GAAAC,oBAAA,CAAA;AAMlB,IAAA,MAAM,EAAE,SAAW,EAAA,SAAA,EAAW,QAAQ,EAAI,EAAA,KAAA,EAAA,GAAUC,WAAOC,4BAAkB,CAAA,CAAA;AAC7E,IAAM,MAAA,EAAE,YAAiB,EAAA,GAAAD,UAAA,CAAOE,+BAAwB,CAAA,CAAA;AAExD,IAAM,MAAA,SAAA,GAAYC,aAAS,MAAM;AAAA,MAC/B,GAAG,CAAE,EAAA;AAAA,MACL,EAAG,CAAA,EAAA,CAAG,YAAc,EAAA,KAAA,CAAM,UAAU,CAAA;AAAA,MACpC,EAAG,CAAA,EAAA,CAAG,WAAa,EAAA,KAAA,CAAM,SAAS,CAAA;AAAA,MAClC,EAAG,CAAA,EAAA,CAAG,cAAgB,EAAA,KAAA,CAAM,WAAW,CAAA;AAAA,MACvC,EAAE,CAAC,EAAA,CAAG,EAAE,QAAQ,CAAA,GAAI,MAAM,MAAO,EAAA;AAAA,MACjC,KAAM,CAAA,WAAA;AAAA,KACP,CAAA,CAAA;AAED,IAAM,MAAA,iBAAA,GAAoBC,gBAAY,CAAA,YAAA,EAAc,SAAS,CAAA,CAAA;AAE7D,IAAA,MAAM,SAAY,GAAAD,YAAA,CAAS,MAAM,KAAA,CAAM,SAAS,CAAA,CAAA;AAChD,IAAaE,oBAAA,CAAA,SAAA,EAAW,WAAW,SAAS,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
require('../../../utils/index.js');
|
|
6
6
|
require('../../../constants/index.js');
|
|
7
|
-
var dialogContent = require('./dialog-
|
|
7
|
+
var dialogContent = require('./dialog-content.js');
|
|
8
8
|
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
9
9
|
var event = require('../../../constants/event.js');
|
|
10
10
|
var types = require('../../../utils/types.js');
|
|
@@ -6,7 +6,7 @@ var vue = require('vue');
|
|
|
6
6
|
var index$3 = require('../../overlay/index.js');
|
|
7
7
|
require('../../../hooks/index.js');
|
|
8
8
|
require('../../focus-trap/index.js');
|
|
9
|
-
var dialogContent = require('./dialog-
|
|
9
|
+
var dialogContent = require('./dialog-content2.js');
|
|
10
10
|
var constants = require('./constants.js');
|
|
11
11
|
var dialog = require('./dialog.js');
|
|
12
12
|
var useDialog = require('./use-dialog.js');
|
|
@@ -18,7 +18,7 @@ var tokens$1 = require('../../roving-focus-group/src/tokens.js');
|
|
|
18
18
|
var refs = require('../../../utils/vue/refs.js');
|
|
19
19
|
var event = require('../../../utils/dom/event.js');
|
|
20
20
|
var aria = require('../../../constants/aria.js');
|
|
21
|
-
var collection = require('../../collection/src/
|
|
21
|
+
var collection = require('../../collection/src/collection.js');
|
|
22
22
|
|
|
23
23
|
const _sfc_main = vue.defineComponent({
|
|
24
24
|
name: "DropdownItemImpl",
|
|
@@ -11,7 +11,7 @@ var trigger = require('../../tooltip/src/trigger.js');
|
|
|
11
11
|
var content = require('../../tooltip/src/content.js');
|
|
12
12
|
var icon = require('../../../utils/vue/icon.js');
|
|
13
13
|
var aria = require('../../../constants/aria.js');
|
|
14
|
-
var collection = require('../../collection/src/
|
|
14
|
+
var collection = require('../../collection/src/collection.js');
|
|
15
15
|
|
|
16
16
|
const dropdownProps = runtime.buildProps({
|
|
17
17
|
trigger: trigger.useTooltipTriggerProps.trigger,
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
|
-
var form$1 = require('./src/
|
|
6
|
+
var form$1 = require('./src/form.js');
|
|
7
7
|
var formItem$1 = require('./src/form-item2.js');
|
|
8
|
-
var form = require('./src/
|
|
8
|
+
var form = require('./src/form2.js');
|
|
9
9
|
var formItem = require('./src/form-item.js');
|
|
10
10
|
require('./src/types.js');
|
|
11
11
|
var constants = require('./src/constants.js');
|
|
@@ -2,65 +2,162 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('
|
|
5
|
+
var vue = require('vue');
|
|
6
6
|
require('../../../utils/index.js');
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
require('../../../hooks/index.js');
|
|
8
|
+
require('./hooks/index.js');
|
|
9
|
+
var constants = require('./constants.js');
|
|
10
|
+
var form = require('./form2.js');
|
|
11
|
+
var utils = require('./utils.js');
|
|
12
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
13
|
+
var useFormCommonProps = require('./hooks/use-form-common-props.js');
|
|
14
|
+
var index = require('../../../hooks/use-namespace/index.js');
|
|
15
|
+
var error = require('../../../utils/error.js');
|
|
9
16
|
var shared = require('@vue/shared');
|
|
10
|
-
var types = require('../../../utils/types.js');
|
|
11
17
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
values: size.componentSizes
|
|
16
|
-
},
|
|
17
|
-
disabled: Boolean
|
|
18
|
+
const COMPONENT_NAME = "ElForm";
|
|
19
|
+
const __default__ = vue.defineComponent({
|
|
20
|
+
name: COMPONENT_NAME
|
|
18
21
|
});
|
|
19
|
-
const
|
|
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
|
-
|
|
22
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
23
|
+
...__default__,
|
|
24
|
+
props: form.formProps,
|
|
25
|
+
emits: form.formEmits,
|
|
26
|
+
setup(__props, { expose, emit }) {
|
|
27
|
+
const props = __props;
|
|
28
|
+
const fields = [];
|
|
29
|
+
const formSize = useFormCommonProps.useFormSize();
|
|
30
|
+
const ns = index.useNamespace("form");
|
|
31
|
+
const formClasses = vue.computed(() => {
|
|
32
|
+
const { labelPosition, inline } = props;
|
|
33
|
+
return [
|
|
34
|
+
ns.b(),
|
|
35
|
+
ns.m(formSize.value || "default"),
|
|
36
|
+
{
|
|
37
|
+
[ns.m(`label-${labelPosition}`)]: labelPosition,
|
|
38
|
+
[ns.m("inline")]: inline
|
|
39
|
+
}
|
|
40
|
+
];
|
|
41
|
+
});
|
|
42
|
+
const getField = (prop) => {
|
|
43
|
+
return fields.find((field) => field.prop === prop);
|
|
44
|
+
};
|
|
45
|
+
const addField = (field) => {
|
|
46
|
+
fields.push(field);
|
|
47
|
+
};
|
|
48
|
+
const removeField = (field) => {
|
|
49
|
+
if (field.prop) {
|
|
50
|
+
fields.splice(fields.indexOf(field), 1);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const resetFields = (properties = []) => {
|
|
54
|
+
if (!props.model) {
|
|
55
|
+
error.debugWarn(COMPONENT_NAME, "model is required for resetFields to work.");
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
utils.filterFields(fields, properties).forEach((field) => field.resetField());
|
|
59
|
+
};
|
|
60
|
+
const clearValidate = (props2 = []) => {
|
|
61
|
+
utils.filterFields(fields, props2).forEach((field) => field.clearValidate());
|
|
62
|
+
};
|
|
63
|
+
const isValidatable = vue.computed(() => {
|
|
64
|
+
const hasModel = !!props.model;
|
|
65
|
+
if (!hasModel) {
|
|
66
|
+
error.debugWarn(COMPONENT_NAME, "model is required for validate to work.");
|
|
67
|
+
}
|
|
68
|
+
return hasModel;
|
|
69
|
+
});
|
|
70
|
+
const obtainValidateFields = (props2) => {
|
|
71
|
+
if (fields.length === 0)
|
|
72
|
+
return [];
|
|
73
|
+
const filteredFields = utils.filterFields(fields, props2);
|
|
74
|
+
if (!filteredFields.length) {
|
|
75
|
+
error.debugWarn(COMPONENT_NAME, "please pass correct props!");
|
|
76
|
+
return [];
|
|
77
|
+
}
|
|
78
|
+
return filteredFields;
|
|
79
|
+
};
|
|
80
|
+
const validate = async (callback) => validateField(void 0, callback);
|
|
81
|
+
const doValidateField = async (props2 = []) => {
|
|
82
|
+
if (!isValidatable.value)
|
|
83
|
+
return false;
|
|
84
|
+
const fields2 = obtainValidateFields(props2);
|
|
85
|
+
if (fields2.length === 0)
|
|
86
|
+
return true;
|
|
87
|
+
let validationErrors = {};
|
|
88
|
+
for (const field of fields2) {
|
|
89
|
+
try {
|
|
90
|
+
await field.validate("");
|
|
91
|
+
} catch (fields3) {
|
|
92
|
+
validationErrors = {
|
|
93
|
+
...validationErrors,
|
|
94
|
+
...fields3
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (Object.keys(validationErrors).length === 0)
|
|
99
|
+
return true;
|
|
100
|
+
return Promise.reject(validationErrors);
|
|
101
|
+
};
|
|
102
|
+
const validateField = async (modelProps = [], callback) => {
|
|
103
|
+
const shouldThrow = !shared.isFunction(callback);
|
|
104
|
+
try {
|
|
105
|
+
const result = await doValidateField(modelProps);
|
|
106
|
+
if (result === true) {
|
|
107
|
+
callback == null ? void 0 : callback(result);
|
|
108
|
+
}
|
|
109
|
+
return result;
|
|
110
|
+
} catch (e) {
|
|
111
|
+
if (e instanceof Error)
|
|
112
|
+
throw e;
|
|
113
|
+
const invalidFields = e;
|
|
114
|
+
if (props.scrollToError) {
|
|
115
|
+
scrollToField(Object.keys(invalidFields)[0]);
|
|
116
|
+
}
|
|
117
|
+
callback == null ? void 0 : callback(false, invalidFields);
|
|
118
|
+
return shouldThrow && Promise.reject(invalidFields);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
const scrollToField = (prop) => {
|
|
122
|
+
var _a;
|
|
123
|
+
const field = utils.filterFields(fields, prop)[0];
|
|
124
|
+
if (field) {
|
|
125
|
+
(_a = field.$el) == null ? void 0 : _a.scrollIntoView(props.scrollIntoViewOptions);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
vue.watch(() => props.rules, () => {
|
|
129
|
+
if (props.validateOnRuleChange) {
|
|
130
|
+
validate().catch((err) => error.debugWarn(err));
|
|
131
|
+
}
|
|
132
|
+
}, { deep: true });
|
|
133
|
+
vue.provide(constants.formContextKey, vue.reactive({
|
|
134
|
+
...vue.toRefs(props),
|
|
135
|
+
emit,
|
|
136
|
+
resetFields,
|
|
137
|
+
clearValidate,
|
|
138
|
+
validateField,
|
|
139
|
+
getField,
|
|
140
|
+
addField,
|
|
141
|
+
removeField,
|
|
142
|
+
...utils.useFormLabelWidth()
|
|
143
|
+
}));
|
|
144
|
+
expose({
|
|
145
|
+
validate,
|
|
146
|
+
validateField,
|
|
147
|
+
resetFields,
|
|
148
|
+
clearValidate,
|
|
149
|
+
scrollToField
|
|
150
|
+
});
|
|
151
|
+
return (_ctx, _cache) => {
|
|
152
|
+
return vue.openBlock(), vue.createElementBlock("form", {
|
|
153
|
+
class: vue.normalizeClass(vue.unref(formClasses))
|
|
154
|
+
}, [
|
|
155
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
156
|
+
], 2);
|
|
157
|
+
};
|
|
58
158
|
}
|
|
59
159
|
});
|
|
60
|
-
|
|
61
|
-
validate: (prop, isValid, message) => (shared.isArray(prop) || shared.isString(prop)) && types.isBoolean(isValid) && shared.isString(message)
|
|
62
|
-
};
|
|
160
|
+
var Form = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "form.vue"]]);
|
|
63
161
|
|
|
64
|
-
exports
|
|
65
|
-
exports.formProps = formProps;
|
|
162
|
+
exports["default"] = Form;
|
|
66
163
|
//# sourceMappingURL=form.js.map
|