@dinert/element-plus 1.1.11 → 1.1.12
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/element-plus.umd.js +1 -1
- package/dist/element-plus.umd.js.map +1 -1
- package/es/packages/components/form/src/cascader.mjs +5 -7
- package/es/packages/components/form/src/cascader.mjs.map +1 -1
- package/es/packages/components/form/src/date.mjs +9 -10
- package/es/packages/components/form/src/date.mjs.map +1 -1
- package/es/packages/components/form/src/index.mjs +75 -71
- package/es/packages/components/form/src/index.mjs.map +1 -1
- package/es/packages/components/form/src/input-autocomplete.mjs +4 -6
- package/es/packages/components/form/src/input-autocomplete.mjs.map +1 -1
- package/es/packages/components/form/src/input-number.mjs +3 -5
- package/es/packages/components/form/src/input-number.mjs.map +1 -1
- package/es/packages/components/form/src/input.mjs +3 -5
- package/es/packages/components/form/src/input.mjs.map +1 -1
- package/es/packages/components/form/src/select-v2.mjs +5 -7
- package/es/packages/components/form/src/select-v2.mjs.map +1 -1
- package/es/packages/components/form/src/select.mjs +5 -7
- package/es/packages/components/form/src/select.mjs.map +1 -1
- package/es/packages/components/form/src/tree-select.mjs +4 -6
- package/es/packages/components/form/src/tree-select.mjs.map +1 -1
- package/es/packages/components/form/utils/index.mjs.map +1 -1
- package/es/packages/components/tooltip/src/index.mjs +15 -15
- package/es/packages/components/tooltip/src/index.mjs.map +1 -1
- package/es/style.css +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { defineComponent as t, computed as r, createVNode as o, resolveComponent as s, mergeProps as
|
|
2
|
-
|
|
3
|
-
const d = /* @__PURE__ */ t({
|
|
1
|
+
import { defineComponent as t, computed as r, createVNode as o, resolveComponent as s, mergeProps as m } from "vue";
|
|
2
|
+
const p = /* @__PURE__ */ t({
|
|
4
3
|
name: "dinert-cascader",
|
|
5
4
|
props: {
|
|
6
5
|
form: {
|
|
@@ -25,11 +24,10 @@ const d = /* @__PURE__ */ t({
|
|
|
25
24
|
};
|
|
26
25
|
},
|
|
27
26
|
render() {
|
|
28
|
-
return o("div", null, [o(s("el-cascader"),
|
|
27
|
+
return o("div", null, [o(s("el-cascader"), m({
|
|
29
28
|
modelValue: this.form.model[this.formItem.key],
|
|
30
29
|
"onUpdate:modelValue": (e) => this.form.model[this.formItem.key] = e,
|
|
31
|
-
clearable: !0
|
|
32
|
-
placeholder: m(this.formItem.label, "select")
|
|
30
|
+
clearable: !0
|
|
33
31
|
}, {
|
|
34
32
|
...this.options
|
|
35
33
|
}, {
|
|
@@ -38,6 +36,6 @@ const d = /* @__PURE__ */ t({
|
|
|
38
36
|
}
|
|
39
37
|
});
|
|
40
38
|
export {
|
|
41
|
-
|
|
39
|
+
p as default
|
|
42
40
|
};
|
|
43
41
|
//# sourceMappingURL=cascader.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cascader.mjs","sources":["../../../../../packages/components/form/src/cascader.tsx"],"sourcesContent":["import {computed, defineComponent} from 'vue'\
|
|
1
|
+
{"version":3,"file":"cascader.mjs","sources":["../../../../../packages/components/form/src/cascader.tsx"],"sourcesContent":["import {computed, defineComponent} from 'vue'\n\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\nimport type {PropType} from 'vue'\n\nexport default defineComponent({\n name: 'dinert-cascader',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n formItem: {\n type: Object as PropType<CustomFormItemProps>,\n default: () => ({})\n },\n },\n setup(props) {\n const options = computed<CustomFormItemProps[keyof CustomFormItemProps]['cascader']>(() => {\n const options = props.formItem.options || {\n options: [],\n props: {\n children: 'children',\n value: 'value',\n label: 'label',\n }\n }\n return options\n })\n\n return {\n options\n }\n },\n render() {\n return (\n <div>\n <el-cascader\n v-model={this.form.model[this.formItem.key]}\n clearable\n {...{\n ...this.options,\n }}\n v-slots={this.$slots}\n key={this.formItem.key}\n >\n </el-cascader>\n </div>\n )\n }\n})\n\n"],"names":["defineComponent","name","props","form","type","Object","default","formItem","setup","options","computed","children","value","label","render","_createVNode","_resolveComponent","_mergeProps","model","key","$event","$slots"],"mappings":";AAKA,MAAeA,sBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,UAAU;AAAA,MACNH,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACpB;AAAA,EACH;AAAA,EACDE,MAAMN,GAAO;AAaT,WAAO;AAAA,MACHO,SAbYC,EAAqE,MACjER,EAAMK,SAASE,WAAW;AAAA,QACtCA,SAAS,CAAE;AAAA,QACXP,OAAO;AAAA,UACHS,UAAU;AAAA,UACVC,OAAO;AAAA,UACPC,OAAO;AAAA,QACX;AAAA,OAGP;AAAA;EAKJ;AAAA,EACDC,SAAS;AACL,WAAAC,EAAAA,OAAAA,MAAAA,CAAAA,EAAAC,kBAAAC,EAAA;AAAA,MAAA,YAGqB,KAAKd,KAAKe,MAAM,KAAKX,SAASY,GAAG;AAAA,MAAC,uBAAAC,CAAAA,MAAlC,KAAKjB,KAAKe,MAAM,KAAKX,SAASY,GAAG,IAACC;AAAAA,MAAA,WAAA;AAAA,IAAA,GAAA;AAAA,MAGvC,GAAG,KAAKX;AAAAA,IAAO,GAAA;AAAA,MAAA,KAGd,KAAKF,SAASY;AAAAA,IADV,CAAA,GAAA,KAAKE,MAAM,CAAA,CAAA;AAAA,EAMpC;AACJ,CAAC;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as s, computed as i, createVNode as
|
|
1
|
+
import { defineComponent as s, computed as i, createVNode as l, resolveComponent as a, mergeProps as m } from "vue";
|
|
2
2
|
import { Calendar as p } from "../../../../node_modules/@element-plus/icons-vue/dist/index.mjs";
|
|
3
|
-
import { customPlaceholder as
|
|
4
|
-
const
|
|
5
|
-
const t =
|
|
3
|
+
import { customPlaceholder as r } from "../utils/index.mjs";
|
|
4
|
+
const n = (e, o) => {
|
|
5
|
+
const t = o.type;
|
|
6
6
|
return ["week"].includes(t) ? "周" : ["month", "monthrange"].includes(t) ? "月份" : ["year", "yearrange"].includes(t) ? "年份" : "时间";
|
|
7
|
-
},
|
|
7
|
+
}, u = (e) => ["datetime", "datetimerange"].includes(e.type) ? "YYYY-MM-DD HH:mm:ss" : e.type === "year" ? "YYYY" : ["month", "monthrange"].includes(e.type) ? "YYYY-MM" : ["date", "daterange", "dates"].includes(e.type) ? "YYYY-MM-DD" : "", h = /* @__PURE__ */ s({
|
|
8
8
|
name: "dinert-date",
|
|
9
9
|
props: {
|
|
10
10
|
form: {
|
|
@@ -25,16 +25,15 @@ const r = (e, n) => {
|
|
|
25
25
|
};
|
|
26
26
|
},
|
|
27
27
|
render() {
|
|
28
|
-
return a(
|
|
28
|
+
return l(a("el-date-picker"), m({
|
|
29
29
|
modelValue: this.form.model[this.formItem.key],
|
|
30
30
|
"onUpdate:modelValue": (e) => this.form.model[this.formItem.key] = e,
|
|
31
31
|
prefixIcon: p,
|
|
32
32
|
clearable: !0,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
endPlaceholder: o(r(this.options.label || "", this.options), "input", "结束"),
|
|
33
|
+
startPlaceholder: r(n(typeof this.options.label == "function" ? this.options.label(this.form.model) : this.options.label, this.options), "input", "开始"),
|
|
34
|
+
endPlaceholder: r(n(typeof this.options.label == "function" ? this.options.label(this.form.model) : this.options.label, this.options), "input", "结束"),
|
|
36
35
|
"unlink-panels": !0,
|
|
37
|
-
valueFormat:
|
|
36
|
+
valueFormat: u(this.options),
|
|
38
37
|
format: this.options.type === "week" ? "YYYY第ww周" : this.options.format
|
|
39
38
|
}, this.options), this.$slots);
|
|
40
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.mjs","sources":["../../../../../packages/components/form/src/date.tsx"],"sourcesContent":["import {computed, defineComponent} from 'vue'\nimport {Calendar} from '@element-plus/icons-vue'\nimport {customPlaceholder} from '../utils'\n\n\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\nimport type {PropType} from 'vue'\n\n\nconst datePickerPlaceholder = (_label: string, item: any) => {\n const type = item.type\n if (['week'].includes(type)) {\n return '周'\n } else if (['month', 'monthrange'].includes(type)) {\n return '月份'\n } else if (['year', 'yearrange'].includes(type)) {\n return '年份'\n }\n return '时间'\n}\n\nconst customValuFormat = (options: any): string => {\n if (['datetime', 'datetimerange'].includes(options.type)) {\n return 'YYYY-MM-DD HH:mm:ss'\n } else if (options.type === 'year') {\n return 'YYYY'\n } else if (['month', 'monthrange'].includes(options.type)) {\n return 'YYYY-MM'\n } else if (['date', 'daterange', 'dates'].includes(options.type)) {\n return 'YYYY-MM-DD'\n }\n return ''\n}\nexport default defineComponent({\n name: 'dinert-date',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n formItem: {\n type: Object as PropType<CustomFormItemProps>,\n default: () => ({})\n },\n },\n setup(props) {\n\n const options = computed<CustomFormItemProps[keyof CustomFormItemProps]['date']>(() => {\n const options = props.formItem.options || {}\n options.type = props.formItem.type\n\n return options\n })\n\n return {\n options\n }\n },\n render() {\n\n return (\n <el-date-picker\n v-model={this.form.model[this.formItem.key]}\n prefixIcon={Calendar}\n clearable\n
|
|
1
|
+
{"version":3,"file":"date.mjs","sources":["../../../../../packages/components/form/src/date.tsx"],"sourcesContent":["import {computed, defineComponent} from 'vue'\nimport {Calendar} from '@element-plus/icons-vue'\nimport {customPlaceholder} from '../utils'\n\n\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\nimport type {PropType} from 'vue'\n\n\nconst datePickerPlaceholder = (_label: string, item: any) => {\n const type = item.type\n if (['week'].includes(type)) {\n return '周'\n } else if (['month', 'monthrange'].includes(type)) {\n return '月份'\n } else if (['year', 'yearrange'].includes(type)) {\n return '年份'\n }\n return '时间'\n}\n\nconst customValuFormat = (options: any): string => {\n if (['datetime', 'datetimerange'].includes(options.type)) {\n return 'YYYY-MM-DD HH:mm:ss'\n } else if (options.type === 'year') {\n return 'YYYY'\n } else if (['month', 'monthrange'].includes(options.type)) {\n return 'YYYY-MM'\n } else if (['date', 'daterange', 'dates'].includes(options.type)) {\n return 'YYYY-MM-DD'\n }\n return ''\n}\nexport default defineComponent({\n name: 'dinert-date',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n formItem: {\n type: Object as PropType<CustomFormItemProps>,\n default: () => ({})\n },\n },\n setup(props) {\n\n const options = computed<CustomFormItemProps[keyof CustomFormItemProps]['date']>(() => {\n const options = props.formItem.options || {}\n options.type = props.formItem.type\n\n return options\n })\n\n return {\n options\n }\n },\n render() {\n\n return (\n <el-date-picker\n v-model={this.form.model[this.formItem.key]}\n prefixIcon={Calendar}\n clearable\n startPlaceholder={customPlaceholder(datePickerPlaceholder(typeof this.options.label === 'function' ? this.options.label(this.form.model) : this.options.label, this.options), 'input', '开始')}\n endPlaceholder={customPlaceholder(datePickerPlaceholder(typeof this.options.label === 'function' ? this.options.label(this.form.model) : this.options.label, this.options), 'input', '结束')}\n unlink-panels={true}\n valueFormat={customValuFormat(this.options)}\n format={this.options.type === 'week' ? 'YYYY第ww周' : this.options.format}\n {...this.options}\n v-slots={this.$slots}\n >\n </el-date-picker>\n )\n }\n})\n\n"],"names":["datePickerPlaceholder","_label","item","type","includes","customValuFormat","options","defineComponent","name","props","form","Object","default","formItem","setup","computed","render","_createVNode","_resolveComponent","_mergeProps","model","key","$event","Calendar","customPlaceholder","label","format","$slots"],"mappings":";;;AASA,MAAMA,IAAwBA,CAACC,GAAgBC,MAAc;AACzD,QAAMC,IAAOD,EAAKC;AAClB,SAAI,CAAC,MAAM,EAAEC,SAASD,CAAI,IACf,MACA,CAAC,SAAS,YAAY,EAAEC,SAASD,CAAI,IACrC,OACA,CAAC,QAAQ,WAAW,EAAE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I,KAAKd,QAAQmB,OAAO,KAAKnB,OAAO,GAAG,SAAS,IAAI;AAAA,MAAC,iBAC3K;AAAA,MAAI,aACND,EAAiB,KAAKC,OAAO;AAAA,MAAC,QACnC,KAAKA,QAAQH,SAAS,SAAS,aAAa,KAAKG,QAAQoB;AAAAA,IAAM,GACnE,KAAKpB,OAAO,GACP,KAAKqB,MAAM;AAAA,EAIhC;AACJ,CAAC;"}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { customPlaceholder as
|
|
1
|
+
import { defineComponent as $, ref as k, toRefs as F, computed as x, createVNode as o, resolveComponent as n, mergeProps as w, Fragment as A, createTextVNode as L, isVNode as U, nextTick as q } from "vue";
|
|
2
|
+
import V from "./input.mjs";
|
|
3
|
+
import D from "./input-number.mjs";
|
|
4
|
+
import T from "./input-autocomplete.mjs";
|
|
5
|
+
import E from "./select.mjs";
|
|
6
|
+
import M from "./select-v2.mjs";
|
|
7
|
+
import j from "./switch.mjs";
|
|
8
|
+
import B from "./date.mjs";
|
|
9
|
+
import N from "./radio.mjs";
|
|
10
|
+
import O from "./tree-select.mjs";
|
|
11
|
+
import z from "./rate.mjs";
|
|
12
|
+
import H from "./checkbox.mjs";
|
|
13
|
+
import P from "./cascader.mjs";
|
|
14
|
+
import W from "../../../hooks/useWindowResize.mjs";
|
|
15
|
+
import { customPlaceholder as S, labelMouseEnter as G, getTooltipValue as J, valueMouseEnter as K, formItemSlot as c } from "../utils/index.mjs";
|
|
16
16
|
import { getUuid as Q, dataTransformRod as X } from "../../../utils/tools.mjs";
|
|
17
17
|
import { ArrowUp as Y, ArrowDown as Z } from "../../../../node_modules/@element-plus/icons-vue/dist/index.mjs";
|
|
18
18
|
import "../../../assets/scss/dinert-form.scss.mjs";
|
|
19
19
|
function ee(f) {
|
|
20
|
-
return typeof f == "function" || Object.prototype.toString.call(f) === "[object Object]" && !
|
|
20
|
+
return typeof f == "function" || Object.prototype.toString.call(f) === "[object Object]" && !U(f);
|
|
21
21
|
}
|
|
22
|
-
const we = /* @__PURE__ */
|
|
22
|
+
const we = /* @__PURE__ */ $({
|
|
23
23
|
name: "dinert-form",
|
|
24
24
|
props: {
|
|
25
25
|
form: {
|
|
@@ -35,36 +35,36 @@ const we = /* @__PURE__ */ R({
|
|
|
35
35
|
setup(f, {
|
|
36
36
|
emit: e
|
|
37
37
|
}) {
|
|
38
|
-
const
|
|
38
|
+
const t = k(!0), u = k(!1), m = k(), a = k("form_" + Q()), {
|
|
39
39
|
form: b
|
|
40
|
-
} =
|
|
40
|
+
} = F(f), r = x(() => {
|
|
41
41
|
let s = 0;
|
|
42
|
-
const
|
|
43
|
-
return Object.keys(b.value.formItem).forEach((
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
...
|
|
47
|
-
key:
|
|
48
|
-
sort: typeof
|
|
42
|
+
const i = [];
|
|
43
|
+
return Object.keys(b.value.formItem).forEach((p) => {
|
|
44
|
+
const d = b.value.formItem[p];
|
|
45
|
+
i.push({
|
|
46
|
+
...d,
|
|
47
|
+
key: p,
|
|
48
|
+
sort: typeof d.sort > "u" ? s : d.sort
|
|
49
49
|
}), s += 10;
|
|
50
|
-
}),
|
|
51
|
-
}),
|
|
50
|
+
}), i.sort((p, d) => p.sort - d.sort), i;
|
|
51
|
+
}), l = () => {
|
|
52
52
|
let s = document.querySelectorAll(`.${a.value} .el-form-left > div`);
|
|
53
|
-
s[0] && (u.value = !1,
|
|
54
|
-
const
|
|
55
|
-
|
|
53
|
+
s[0] && (u.value = !1, q(() => {
|
|
54
|
+
const i = s[0].getBoundingClientRect().top, p = s[s.length - 1].getBoundingClientRect().top;
|
|
55
|
+
i !== p ? u.value = !0 : (t.value || (t.value = !0), u.value = !1), s = null;
|
|
56
56
|
}));
|
|
57
57
|
};
|
|
58
|
-
return
|
|
59
|
-
|
|
58
|
+
return W(() => {
|
|
59
|
+
l();
|
|
60
60
|
}, 100, !0), {
|
|
61
|
-
formItemMap:
|
|
61
|
+
formItemMap: r,
|
|
62
62
|
unfold: () => {
|
|
63
|
-
|
|
63
|
+
t.value ? t.value = !1 : t.value = !0, e("UnFold", t.value);
|
|
64
64
|
},
|
|
65
65
|
formClass: a,
|
|
66
66
|
formRef: m,
|
|
67
|
-
packUp:
|
|
67
|
+
packUp: t,
|
|
68
68
|
isArrow: u
|
|
69
69
|
};
|
|
70
70
|
},
|
|
@@ -81,21 +81,24 @@ const we = /* @__PURE__ */ R({
|
|
|
81
81
|
default: () => [o(n("el-row"), w(this.form.row, {
|
|
82
82
|
class: "el-form-left"
|
|
83
83
|
}), ee(f = this.formItemMap.map((e) => {
|
|
84
|
-
const
|
|
84
|
+
const t = {};
|
|
85
85
|
let u = typeof e.vif == "function" ? e.vif(this.form.model) : e.vif;
|
|
86
86
|
u = u === void 0 ? !0 : u;
|
|
87
87
|
let m = typeof e.show == "function" ? e.show(this.form.model) : e.show;
|
|
88
|
-
if (m = m === void 0 ? !0 : m,
|
|
88
|
+
if (m = m === void 0 ? !0 : m, e.options = {
|
|
89
|
+
placeholder: S(typeof e.label == "function" ? e.label(this.form.model) : e.label, e.type),
|
|
90
|
+
...e.options
|
|
91
|
+
}, m || (t.display = "none"), u) {
|
|
89
92
|
e.required = e.required === void 0 ? e.required || this.form.required : e.required, e.showLabel = e.showLabel === void 0 ? e.showLabel || this.form.showLabel : e.showLabel;
|
|
90
93
|
let a = e.rules || [];
|
|
91
94
|
a = e.required ? [{
|
|
92
95
|
required: !0,
|
|
93
96
|
trigger: "blur",
|
|
94
|
-
message:
|
|
97
|
+
message: S(typeof e.label == "function" ? e.label(this.form.model) : e.label, e.type)
|
|
95
98
|
}].concat(a) : a, a = e.showLabel ? [] : a;
|
|
96
99
|
const b = e.showLabel ? !0 : e.tempValueDisabled;
|
|
97
100
|
return o(n("el-col"), w({
|
|
98
|
-
style:
|
|
101
|
+
style: t,
|
|
99
102
|
class: [e.type, e.key],
|
|
100
103
|
key: e.key
|
|
101
104
|
}, {
|
|
@@ -113,93 +116,94 @@ const we = /* @__PURE__ */ R({
|
|
|
113
116
|
class: [e.labelWrap ? "label-wrap" : "", e.showLabel || this.form.showLabel ? "show-label" : ""]
|
|
114
117
|
}, {
|
|
115
118
|
...e,
|
|
119
|
+
label: typeof e.label == "function" ? e.label(this.form.model) : e.label,
|
|
116
120
|
rules: a
|
|
117
121
|
}), {
|
|
118
122
|
label: () => o(n("dinert-tooltip"), {
|
|
119
123
|
key: e.key,
|
|
120
|
-
content: e.label,
|
|
124
|
+
content: typeof e.label == "function" ? e.label(this.form.model) : e.label,
|
|
121
125
|
disabled: e.labelDisabled,
|
|
122
|
-
onLabelMouseEnter: (
|
|
126
|
+
onLabelMouseEnter: (r) => G(r, e, this)
|
|
123
127
|
}, null),
|
|
124
128
|
default: () => o(n("dinert-tooltip"), {
|
|
125
129
|
key: e.key,
|
|
126
130
|
content: String(J(this.form.model[e.key], e)),
|
|
127
131
|
disabled: b,
|
|
128
132
|
item: e,
|
|
129
|
-
onLabelMouseEnter: (
|
|
133
|
+
onLabelMouseEnter: (r) => K(r, e, this.form.model[e.key], this)
|
|
130
134
|
}, {
|
|
131
135
|
default: () => {
|
|
132
|
-
var C, s, p, d,
|
|
133
|
-
const
|
|
134
|
-
let
|
|
136
|
+
var C, s, i, p, d, I;
|
|
137
|
+
const r = {};
|
|
138
|
+
let l = o("span", null, [X(this.form.model[e.key])]);
|
|
135
139
|
if (this.$slots[c(e.key)])
|
|
136
|
-
|
|
140
|
+
l = (s = (C = this.$slots)[c(e.key)]) == null ? void 0 : s.call(C, {
|
|
137
141
|
...e,
|
|
138
142
|
model: this.form.model
|
|
139
143
|
});
|
|
140
144
|
else {
|
|
141
145
|
if (e.showLabel || this.form.showLabel && [!0, void 0].includes(e.showLabel))
|
|
142
|
-
return
|
|
146
|
+
return l;
|
|
143
147
|
if (["input", "textarea"].includes(e.type)) {
|
|
144
|
-
const g = (
|
|
145
|
-
|
|
148
|
+
const g = (p = (i = this.$slots)[c(e.key + "_append")]) == null ? void 0 : p.call(i), _ = g && g[0] && g[0].children, v = (I = (d = this.$slots)[c(e.key + "_prepend")]) == null ? void 0 : I.call(d), R = v && v[0] && v[0].children;
|
|
149
|
+
_ && (r.append = () => {
|
|
146
150
|
var h, y;
|
|
147
151
|
return (y = (h = this.$slots)[c(e.key + "_append")]) == null ? void 0 : y.call(h);
|
|
148
|
-
}),
|
|
152
|
+
}), R && (r.prepend = () => {
|
|
149
153
|
var h, y;
|
|
150
154
|
return (y = (h = this.$slots)[c(e.key + "_prepend")]) == null ? void 0 : y.call(h);
|
|
151
|
-
}),
|
|
155
|
+
}), l = o(V, {
|
|
152
156
|
form: this.form,
|
|
153
157
|
formItem: e
|
|
154
|
-
},
|
|
158
|
+
}, r);
|
|
155
159
|
} else
|
|
156
|
-
["input-number"].includes(e.type) ?
|
|
160
|
+
["input-number"].includes(e.type) ? l = o(D, {
|
|
157
161
|
form: this.form,
|
|
158
162
|
formItem: e
|
|
159
|
-
}, null) : ["input-autocomplete"].includes(e.type) ?
|
|
163
|
+
}, null) : ["input-autocomplete"].includes(e.type) ? l = o(T, {
|
|
160
164
|
form: this.form,
|
|
161
165
|
formItem: e
|
|
162
|
-
}, null) : ["select"].includes(e.type) ?
|
|
166
|
+
}, null) : ["select"].includes(e.type) ? l = o(E, {
|
|
163
167
|
form: this.form,
|
|
164
168
|
formItem: e
|
|
165
|
-
}, null) : ["select-v2"].includes(e.type) ?
|
|
169
|
+
}, null) : ["select-v2"].includes(e.type) ? l = o(M, {
|
|
166
170
|
form: this.form,
|
|
167
171
|
formItem: e
|
|
168
|
-
}, null) : ["switch"].includes(e.type) ?
|
|
172
|
+
}, null) : ["switch"].includes(e.type) ? l = o(j, {
|
|
169
173
|
form: this.form,
|
|
170
174
|
formItem: e
|
|
171
|
-
}, null) : ["datetime", "date", "dates", "week", "month", "year", "years", "datetimerange", "daterange", "monthrange", "yearrange"].includes(e.type) ?
|
|
175
|
+
}, null) : ["datetime", "date", "dates", "week", "month", "year", "years", "datetimerange", "daterange", "monthrange", "yearrange"].includes(e.type) ? l = o(B, {
|
|
172
176
|
form: this.form,
|
|
173
177
|
formItem: e
|
|
174
|
-
}, null) : ["radio", "radio-button"].includes(e.type) ?
|
|
178
|
+
}, null) : ["radio", "radio-button"].includes(e.type) ? l = o(N, {
|
|
175
179
|
form: this.form,
|
|
176
180
|
formItem: e
|
|
177
|
-
}, null) : ["tree-select"].includes(e.type) ?
|
|
181
|
+
}, null) : ["tree-select"].includes(e.type) ? l = o(O, {
|
|
178
182
|
form: this.form,
|
|
179
183
|
formItem: e
|
|
180
|
-
}, null) : ["rate"].includes(e.type) ?
|
|
184
|
+
}, null) : ["rate"].includes(e.type) ? l = o(z, {
|
|
181
185
|
form: this.form,
|
|
182
186
|
formItem: e
|
|
183
|
-
}, null) : ["checkbox", "checkbox-button"].includes(e.type) ?
|
|
187
|
+
}, null) : ["checkbox", "checkbox-button"].includes(e.type) ? l = o(H, {
|
|
184
188
|
form: this.form,
|
|
185
189
|
formItem: e
|
|
186
|
-
}, null) : ["cascader"].includes(e.type) && (
|
|
190
|
+
}, null) : ["cascader"].includes(e.type) && (l = o(P, {
|
|
187
191
|
form: this.form,
|
|
188
192
|
formItem: e
|
|
189
193
|
}, null));
|
|
190
194
|
}
|
|
191
|
-
return
|
|
195
|
+
return l;
|
|
192
196
|
},
|
|
193
197
|
defaultAfter: () => {
|
|
194
|
-
var
|
|
195
|
-
return (
|
|
198
|
+
var r, l;
|
|
199
|
+
return (l = (r = this.$slots)[c("after_" + e.key)]) == null ? void 0 : l.call(r, {
|
|
196
200
|
...e,
|
|
197
201
|
model: this.form.model
|
|
198
202
|
});
|
|
199
203
|
},
|
|
200
204
|
defaultBefore: () => {
|
|
201
|
-
var
|
|
202
|
-
return (
|
|
205
|
+
var r, l;
|
|
206
|
+
return (l = (r = this.$slots)[c("before_" + e.key)]) == null ? void 0 : l.call(r, {
|
|
203
207
|
...e,
|
|
204
208
|
model: this.form.model
|
|
205
209
|
});
|
|
@@ -214,7 +218,7 @@ const we = /* @__PURE__ */ R({
|
|
|
214
218
|
class: ["el-form-right", this.isArrow ? "isArrow" : ""]
|
|
215
219
|
}, {
|
|
216
220
|
default: () => {
|
|
217
|
-
var e,
|
|
221
|
+
var e, t;
|
|
218
222
|
return [this.isArrow && o(n("el-button"), {
|
|
219
223
|
class: "el-form-right-operation",
|
|
220
224
|
text: !0,
|
|
@@ -224,7 +228,7 @@ const we = /* @__PURE__ */ R({
|
|
|
224
228
|
default: () => [o(n("el-icon"), null, {
|
|
225
229
|
default: () => [this.packUp ? o(Y, null, null) : o(Z, null, null)]
|
|
226
230
|
}), this.packUp ? "收起" : "展开"]
|
|
227
|
-
}), ((
|
|
231
|
+
}), ((t = (e = this.$slots).form_search) == null ? void 0 : t.call(e)) || o(A, null, [o(n("el-button"), {
|
|
228
232
|
type: "primary",
|
|
229
233
|
onClick: () => this.$emit("SearchFn")
|
|
230
234
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/form/src/index.tsx"],"sourcesContent":["import {defineComponent, ref, computed, nextTick, toRefs} from 'vue'\nimport CustomInput from './input'\nimport CustomInputNumber from './input-number'\nimport CustomInputAutocomplete from './input-autocomplete'\nimport CustomSelect from './select'\nimport CustomSelectV2 from './select-v2'\nimport CustomSwitch from './switch'\nimport CustomDate from './date'\nimport CustomRadio from './radio'\nimport CustomSelectTree from './tree-select'\nimport CustomRate from './rate'\nimport CustomCheckbox from './checkbox'\nimport CustomCascader from './cascader'\n\nimport useWindowResize from '@packages/hooks/useWindowResize'\nimport {labelMouseEnter, valueMouseEnter, getTooltipValue, formItemSlot, customPlaceholder} from '@packages/components/form/utils'\n\nimport {dataTransformRod, getUuid} from '@packages/utils/tools'\nimport {ElForm} from 'element-plus'\n\nimport {ArrowUp, ArrowDown} from '@element-plus/icons-vue'\n\n\nimport '@packages/assets/scss/dinert-form.scss'\n\nimport type {PropType} from 'vue'\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\n\n// 展开还是收起状态\nexport default defineComponent({\n name: 'dinert-form',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n search: {\n type: Boolean,\n default: true\n }\n },\n emits: ['UnFold', 'SearchFn', 'ResetFn'],\n setup(props, {emit}) {\n\n const packUp = ref(true)\n const isArrow = ref(false)\n const formRef = ref<InstanceType<typeof ElForm>>()\n const formClass = ref('form_' + getUuid())\n const {form} = toRefs(props)\n const formItemMap = computed(() => {\n let index = 0\n const result: any = []\n Object.keys(form.value.formItem).forEach(key => {\n const value = form.value.formItem[key] as Partial<CustomFormItemProps>\n result.push({\n ...value,\n key: key,\n sort: typeof value.sort === 'undefined' ? index : value.sort,\n })\n index += 10\n })\n\n result.sort((a: any, b: any) => {\n return a.sort - b.sort\n })\n\n return result\n })\n\n const resizeForm = () => {\n let elFormLeft = document.querySelectorAll(`.${formClass.value} .el-form-left > div`) as any\n if (elFormLeft[0]) {\n isArrow.value = false\n nextTick(() => {\n const firstTop = elFormLeft[0].getBoundingClientRect().top\n const lastTop = elFormLeft[elFormLeft.length - 1].getBoundingClientRect().top\n const isHeight = firstTop !== lastTop\n if (isHeight) {\n isArrow.value = true\n } else {\n if (!packUp.value) {\n packUp.value = true\n }\n isArrow.value = false\n }\n elFormLeft = null\n })\n\n }\n }\n\n useWindowResize(() => {\n resizeForm()\n }, 100, true)\n\n\n const unfold = () => {\n if (packUp.value) {\n packUp.value = false\n } else {\n packUp.value = true\n }\n\n emit('UnFold', packUp.value)\n }\n\n\n return {\n formItemMap,\n unfold,\n formClass,\n\n formRef,\n packUp,\n isArrow\n }\n },\n render() {\n return (\n <el-form inline={true}\n {...this.form}\n ref={el => {this.formRef = el}}\n class={[this.formClass, this.packUp ? '' : 'packUp', 'dinert-form']}>\n <el-row {...this.form.row} class=\"el-form-left\">\n {/* eslint-disable-next-line array-callback-return, consistent-return */}\n { this.formItemMap.map((item: CustomFormItemProps) => {\n const style: any = {}\n let vif = typeof item.vif === 'function' ? item.vif(this.form.model) : item.vif\n vif = vif === undefined ? true : vif\n\n let show = typeof item.show === 'function' ? item.show(this.form.model) : item.show\n show = show === undefined ? true : show\n\n if (!show) {\n style.display = 'none'\n }\n if (vif) {\n item.required = item.required === undefined ? item.required || this.form.required : item.required\n item.showLabel = item.showLabel === undefined ? item.showLabel || this.form.showLabel : item.showLabel\n\n let rules = item.rules || []\n rules = item.required ? [{required: true, trigger: 'blur', message: customPlaceholder(item.label, item.type)}].concat(rules as any) : rules\n rules = item.showLabel ? [] : rules\n const valDisabled = item.showLabel ? true : item.tempValueDisabled\n\n return (\n <el-col\n style= {style}\n class={[item.type, item.key]}\n key={item.key}\n {\n ...{\n // xl: 3, // ≥1920px\n // lg: 4, // ≥1200px\n // md: 8, // ≥992px\n // sm: 12, // ≥768px\n // xs: 24, // <768px\n ...this.form.colLayout,\n ...item.colLayout\n }\n }\n >\n <el-form-item\n key={item.key}\n prop={item.key}\n class={[item.labelWrap ? 'label-wrap' : '', item.showLabel || this.form.showLabel ? 'show-label' : '']}\n {...{\n ...item,\n rules: rules\n }}\n v-slots={{\n label: () => {\n return (\n <dinert-tooltip\n key={item.key}\n content={item.label}\n disabled={item.labelDisabled}\n onLabelMouseEnter={(e: MouseEvent) => labelMouseEnter(e, item, this)}\n >\n </dinert-tooltip>\n )\n },\n default: () => {\n return (\n <dinert-tooltip\n key={item.key}\n content={String(getTooltipValue(this.form.model[item.key], item))}\n disabled={valDisabled}\n item={item}\n onLabelMouseEnter={(e: MouseEvent) => valueMouseEnter(e, item, this.form.model[item.key], this)}\n v-slots={\n {\n default: () => {\n\n\n const slots: any = {}\n\n let componentResult = <span>{dataTransformRod(this.form.model[item.key])}</span>\n\n\n if (this.$slots[formItemSlot(item.key)]) {\n componentResult = (this.$slots[formItemSlot(item.key)]?.({...item, model: this.form.model}))\n } else if (item.showLabel || (this.form.showLabel && [true, undefined].includes(item.showLabel))) {\n return componentResult\n } else if (['input', 'textarea'].includes(item.type)) {\n const appendSlot = this.$slots[formItemSlot(item.key + '_append')]?.()\n const appendSlotValue = appendSlot && appendSlot[0] && appendSlot[0].children\n\n const prependSlot = this.$slots[formItemSlot(item.key + '_prepend')]?.()\n const prependSlotValue = prependSlot && prependSlot[0] && prependSlot[0].children\n if (appendSlotValue) {\n slots.append = () => this.$slots[formItemSlot(item.key + '_append')]?.()\n }\n if (prependSlotValue) {\n slots.prepend = () => this.$slots[formItemSlot(item.key + '_prepend')]?.()\n }\n componentResult = (<CustomInput form={this.form} formItem={item} v-slots={slots}></CustomInput>)\n } else if (['input-number'].includes(item.type)) {\n componentResult = (<CustomInputNumber form={this.form} formItem={item}></CustomInputNumber>)\n } else if (['input-autocomplete'].includes(item.type)) {\n componentResult = (<CustomInputAutocomplete form={this.form} formItem={item}></CustomInputAutocomplete>)\n } else if (['select'].includes(item.type)) {\n componentResult = (<CustomSelect form={this.form} formItem={item}></CustomSelect>)\n } else if (['select-v2'].includes(item.type)) {\n componentResult = (<CustomSelectV2 form={this.form} formItem={item}></CustomSelectV2>)\n } else if (['switch'].includes(item.type)) {\n componentResult = (<CustomSwitch form={this.form} formItem={item}></CustomSwitch>)\n } else if ([\n 'datetime',\n 'date',\n 'dates',\n 'week',\n 'month',\n 'year',\n 'years',\n 'datetimerange',\n 'daterange',\n 'monthrange',\n 'yearrange',\n ].includes(item.type)) {\n componentResult = (<CustomDate form={this.form} formItem={item}></CustomDate>)\n } else if (['radio', 'radio-button'].includes(item.type)) {\n componentResult = (<CustomRadio form={this.form} formItem={item}></CustomRadio>)\n } else if (['tree-select'].includes(item.type)) {\n componentResult = (<CustomSelectTree form={this.form} formItem={item}></CustomSelectTree>)\n } else if (['rate'].includes(item.type)) {\n componentResult = (<CustomRate form={this.form} formItem={item}></CustomRate>)\n } else if (['checkbox', 'checkbox-button'].includes(item.type)) {\n componentResult = (<CustomCheckbox form={this.form} formItem={item}></CustomCheckbox>)\n } else if (['cascader'].includes(item.type)) {\n componentResult = (<CustomCascader form={this.form} formItem={item}></CustomCascader>)\n }\n\n\n return componentResult\n },\n defaultAfter: () => this.$slots[formItemSlot('after_' + item.key)]?.({...item, model: this.form.model}),\n defaultBefore: () => this.$slots[formItemSlot('before_' + item.key)]?.({...item, model: this.form.model}),\n }\n }\n >\n </dinert-tooltip>\n )\n }\n }}\n >\n </el-form-item>\n </el-col>\n )\n }\n\n })\n }\n </el-row>\n {\n this.search\n && <el-row class={['el-form-right', this.isArrow ? 'isArrow' : '']}>\n {this.isArrow\n && <el-button class=\"el-form-right-operation\" text type=\"primary\"\n onClick={this.unfold}\n >\n <el-icon>\n {this.packUp ? <ArrowUp/> : <ArrowDown/>}\n </el-icon>\n {this.packUp ? '收起' : '展开'}\n </el-button>\n }\n {this.$slots.form_search?.()\n || (\n <>\n <el-button type=\"primary\" onClick={() => this.$emit('SearchFn')}>搜索</el-button>\n <el-button type=\"primary\" plain\n onClick={() => this.$emit('ResetFn')}\n >重置</el-button>\n </>\n )\n }\n </el-row>\n }\n </el-form>\n )\n }\n})\n"],"names":["_isSlot","s","Object","prototype","toString","call","_isVNode","defineComponent","name","props","form","type","default","search","Boolean","emits","setup","emit","packUp","ref","isArrow","formRef","formClass","getUuid","toRefs","formItemMap","computed","index","result","keys","value","formItem","forEach","key","push","sort","a","b","resizeForm","elFormLeft","document","querySelectorAll","nextTick","firstTop","getBoundingClientRect","top","lastTop","length","useWindowResize","unfold","render","_slot","_createVNode","_resolveComponent","_mergeProps","el","row","map","item","style","vif","model","undefined","show","display","required","showLabel","rules","trigger","message","customPlaceholder","label","concat","valDisabled","tempValueDisabled","colLayout","labelWrap","labelDisabled","e","labelMouseEnter","String","getTooltipValue","valueMouseEnter","slots","componentResult","dataTransformRod","$slots","formItemSlot","_b","_a","includes","appendSlot","_d","_c","appendSlotValue","children","prependSlot","_f","_e","prependSlotValue","append","prepend","CustomInput","CustomInputNumber","CustomInputAutocomplete","CustomSelect","CustomSelectV2","CustomSwitch","CustomDate","CustomRadio","CustomSelectTree","CustomRate","CustomCheckbox","CustomCascader","defaultAfter","defaultBefore","ArrowUp","ArrowDown","form_search","_Fragment","onClick","$emit","_createTextVNode"],"mappings":";;;;;;;;;;;;;;;;;;AAuB+C,SAAAA,GAAAC,GAAA;AAAA,SAAA,OAAAA,KAAA,cAAAC,OAAAC,UAAAC,SAAAC,KAAAJ,CAAA,MAAAK,qBAAAA,CAAAA,EAAAL,CAAA;AAAA;AAM/C,MAAeM,uBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMT;AAAAA,MACNU,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,QAAQ;AAAA,MACJF,MAAMG;AAAAA,MACNF,SAAS;AAAA,IACb;AAAA,EACH;AAAA,EACDG,OAAO,CAAC,UAAU,YAAY,SAAS;AAAA,EACvCC,MAAMP,GAAO;AAAA,IAACQ,MAAAA;AAAAA,EAAI,GAAG;AAEjB,UAAMC,IAASC,EAAI,EAAI,GACjBC,IAAUD,EAAI,EAAK,GACnBE,IAAUF,KACVG,IAAYH,EAAI,UAAUI,EAAS,CAAA,GACnC;AAAA,MAACb,MAAAA;AAAAA,IAAI,IAAIc,EAAOf,CAAK,GACrBgB,IAAcC,EAAS,MAAM;AAC/B,UAAIC,IAAQ;AACZ,YAAMC,IAAc,CAAA;AACpB1B,oBAAO2B,KAAKnB,EAAKoB,MAAMC,QAAQ,EAAEC,QAAQC,CAAAA,MAAO;AAC5C,cAAMH,IAAQpB,EAAKoB,MAAMC,SAASE,CAAG;AACrCL,QAAAA,EAAOM,KAAK;AAAA,UACR,GAAGJ;AAAAA,UACHG,KAAKA;AAAAA,UACLE,MAAM,OAAOL,EA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,GAAA;AAAA,YAAA,OAAA;AAAA,YAAA,MAAA;AAAA,YAAA,MAAA;AAAA,YAAA,SAEA,KAAKJ;AAAAA,UAAM,GAAA;AAAA,YAAArC,SAAAA,MAAAwC,CAAAA,EAAAC,EAAA,SAAA,GAAA,MAAA;AAAA,cAAAzC,SAAAA,MAGf,CAAA,KAAKM,SAAMkC,EAAAgE,GAAA,MAAA,IAAA,IAAAhE,EAAAiE,GAA4B,MAAA,IAAA,CAAA;AAAA,YAAA,CAAA,GAE3C,KAAKnG,SAAS,OAAO,IAAI;AAAA,UAAA,CAAA,KAG7BsE,KAAAC,IAAA,KAAKH,QAAOgC,gBAAZ,gBAAA9B,EAAA,KAAAC,OAA2BrC,EAAAmE,GAAAnE,MAAAA,CAAAA,EAAAC,EAAA,WAAA,GAAA;AAAA,YAAA,MAAA;AAAA,YAAA,SAGmBmE,MAAM,KAAKC,MAAM,UAAU;AAAA,UAAC,GAAA;AAAA,YAAA7G,SAAAA,MAAA,CAAA8G,EAAA,IAAA,CAAA;AAAA,UAAAtE,CAAAA,GAAAA,EAAAC,EAAA,WAAA,GAAA;AAAA,YAAA,MAAA;AAAA,YAAA,OAAA;AAAA,YAAA,SAElDmE,MAAM,KAAKC,MAAM,SAAS;AAAA,UAAC,GAAA;AAAA,YAAA7G,SAAAA,MAAA,CAAA8G,EAAA,IAAA,CAAA;AAAA,UAG/C,CAAA,CAAA,CAAA,CAAA;AAAA;AAAA,OAEA,CAAA;AAAA,IAAA,CAAA;AAAA,EAIrB;AACJ,CAAC;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/form/src/index.tsx"],"sourcesContent":["import {defineComponent, ref, computed, nextTick, toRefs} from 'vue'\nimport CustomInput from './input'\nimport CustomInputNumber from './input-number'\nimport CustomInputAutocomplete from './input-autocomplete'\nimport CustomSelect from './select'\nimport CustomSelectV2 from './select-v2'\nimport CustomSwitch from './switch'\nimport CustomDate from './date'\nimport CustomRadio from './radio'\nimport CustomSelectTree from './tree-select'\nimport CustomRate from './rate'\nimport CustomCheckbox from './checkbox'\nimport CustomCascader from './cascader'\n\nimport useWindowResize from '@packages/hooks/useWindowResize'\nimport {labelMouseEnter, valueMouseEnter, getTooltipValue, formItemSlot, customPlaceholder} from '@packages/components/form/utils'\n\nimport {dataTransformRod, getUuid} from '@packages/utils/tools'\nimport {ElForm} from 'element-plus'\n\nimport {ArrowUp, ArrowDown} from '@element-plus/icons-vue'\n\n\nimport '@packages/assets/scss/dinert-form.scss'\n\nimport type {PropType} from 'vue'\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\n\n// 展开还是收起状态\nexport default defineComponent({\n name: 'dinert-form',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n search: {\n type: Boolean,\n default: true\n }\n },\n emits: ['UnFold', 'SearchFn', 'ResetFn'],\n setup(props, {emit}) {\n\n const packUp = ref(true)\n const isArrow = ref(false)\n const formRef = ref<InstanceType<typeof ElForm>>()\n const formClass = ref('form_' + getUuid())\n const {form} = toRefs(props)\n const formItemMap = computed(() => {\n let index = 0\n const result: any = []\n Object.keys(form.value.formItem).forEach(key => {\n const value = form.value.formItem[key] as Partial<CustomFormItemProps>\n result.push({\n ...value,\n key: key,\n sort: typeof value.sort === 'undefined' ? index : value.sort,\n })\n index += 10\n })\n\n result.sort((a: any, b: any) => {\n return a.sort - b.sort\n })\n\n return result\n })\n\n const resizeForm = () => {\n let elFormLeft = document.querySelectorAll(`.${formClass.value} .el-form-left > div`) as any\n if (elFormLeft[0]) {\n isArrow.value = false\n nextTick(() => {\n const firstTop = elFormLeft[0].getBoundingClientRect().top\n const lastTop = elFormLeft[elFormLeft.length - 1].getBoundingClientRect().top\n const isHeight = firstTop !== lastTop\n if (isHeight) {\n isArrow.value = true\n } else {\n if (!packUp.value) {\n packUp.value = true\n }\n isArrow.value = false\n }\n elFormLeft = null\n })\n\n }\n }\n\n useWindowResize(() => {\n resizeForm()\n }, 100, true)\n\n\n const unfold = () => {\n if (packUp.value) {\n packUp.value = false\n } else {\n packUp.value = true\n }\n\n emit('UnFold', packUp.value)\n }\n\n\n return {\n formItemMap,\n unfold,\n formClass,\n\n formRef,\n packUp,\n isArrow\n }\n },\n render() {\n return (\n <el-form inline={true}\n {...this.form}\n ref={el => {this.formRef = el}}\n class={[this.formClass, this.packUp ? '' : 'packUp', 'dinert-form']}>\n <el-row {...this.form.row} class=\"el-form-left\">\n {/* eslint-disable-next-line array-callback-return, consistent-return */}\n { this.formItemMap.map((item: CustomFormItemProps) => {\n const style: any = {}\n let vif = typeof item.vif === 'function' ? item.vif(this.form.model) : item.vif\n vif = vif === undefined ? true : vif\n\n let show = typeof item.show === 'function' ? item.show(this.form.model) : item.show\n show = show === undefined ? true : show\n item.options = {placeholder: customPlaceholder(typeof item.label === 'function' ? item.label(this.form.model) : item.label, item.type), ...item.options}\n\n\n if (!show) {\n style.display = 'none'\n }\n if (vif) {\n item.required = item.required === undefined ? item.required || this.form.required : item.required\n item.showLabel = item.showLabel === undefined ? item.showLabel || this.form.showLabel : item.showLabel\n\n let rules = item.rules || []\n rules = item.required ? [{required: true, trigger: 'blur', message: customPlaceholder(typeof item.label === 'function' ? item.label(this.form.model) : item.label, item.type)}].concat(rules as any) : rules\n rules = item.showLabel ? [] : rules\n const valDisabled = item.showLabel ? true : item.tempValueDisabled\n\n return (\n <el-col\n style= {style}\n class={[item.type, item.key]}\n key={item.key}\n {\n ...{\n // xl: 3, // ≥1920px\n // lg: 4, // ≥1200px\n // md: 8, // ≥992px\n // sm: 12, // ≥768px\n // xs: 24, // <768px\n ...this.form.colLayout,\n ...item.colLayout\n }\n }\n >\n <el-form-item\n key={item.key}\n prop={item.key}\n class={[item.labelWrap ? 'label-wrap' : '', item.showLabel || this.form.showLabel ? 'show-label' : '']}\n {...{\n ...item,\n label: typeof item.label === 'function' ? item.label(this.form.model) : item.label,\n rules: rules\n }}\n v-slots={{\n label: () => {\n return (\n <dinert-tooltip\n key={item.key}\n content={typeof item.label === 'function' ? item.label(this.form.model) : item.label}\n disabled={item.labelDisabled}\n onLabelMouseEnter={(e: MouseEvent) => labelMouseEnter(e, item, this)}\n >\n </dinert-tooltip>\n )\n },\n default: () => {\n return (\n <dinert-tooltip\n key={item.key}\n content={String(getTooltipValue(this.form.model[item.key], item))}\n disabled={valDisabled}\n item={item}\n onLabelMouseEnter={(e: MouseEvent) => valueMouseEnter(e, item, this.form.model[item.key], this)}\n v-slots={\n {\n default: () => {\n\n\n const slots: any = {}\n\n let componentResult = <span>{dataTransformRod(this.form.model[item.key])}</span>\n\n\n if (this.$slots[formItemSlot(item.key)]) {\n componentResult = (this.$slots[formItemSlot(item.key)]?.({...item, model: this.form.model}))\n } else if (item.showLabel || (this.form.showLabel && [true, undefined].includes(item.showLabel))) {\n return componentResult\n } else if (['input', 'textarea'].includes(item.type)) {\n const appendSlot = this.$slots[formItemSlot(item.key + '_append')]?.()\n const appendSlotValue = appendSlot && appendSlot[0] && appendSlot[0].children\n\n const prependSlot = this.$slots[formItemSlot(item.key + '_prepend')]?.()\n const prependSlotValue = prependSlot && prependSlot[0] && prependSlot[0].children\n if (appendSlotValue) {\n slots.append = () => this.$slots[formItemSlot(item.key + '_append')]?.()\n }\n if (prependSlotValue) {\n slots.prepend = () => this.$slots[formItemSlot(item.key + '_prepend')]?.()\n }\n componentResult = (<CustomInput form={this.form} formItem={item} v-slots={slots}></CustomInput>)\n } else if (['input-number'].includes(item.type)) {\n componentResult = (<CustomInputNumber form={this.form} formItem={item}></CustomInputNumber>)\n } else if (['input-autocomplete'].includes(item.type)) {\n componentResult = (<CustomInputAutocomplete form={this.form} formItem={item}></CustomInputAutocomplete>)\n } else if (['select'].includes(item.type)) {\n componentResult = (<CustomSelect form={this.form} formItem={item}></CustomSelect>)\n } else if (['select-v2'].includes(item.type)) {\n componentResult = (<CustomSelectV2 form={this.form} formItem={item}></CustomSelectV2>)\n } else if (['switch'].includes(item.type)) {\n componentResult = (<CustomSwitch form={this.form} formItem={item}></CustomSwitch>)\n } else if ([\n 'datetime',\n 'date',\n 'dates',\n 'week',\n 'month',\n 'year',\n 'years',\n 'datetimerange',\n 'daterange',\n 'monthrange',\n 'yearrange',\n ].includes(item.type)) {\n componentResult = (<CustomDate form={this.form} formItem={item}></CustomDate>)\n } else if (['radio', 'radio-button'].includes(item.type)) {\n componentResult = (<CustomRadio form={this.form} formItem={item}></CustomRadio>)\n } else if (['tree-select'].includes(item.type)) {\n componentResult = (<CustomSelectTree form={this.form} formItem={item}></CustomSelectTree>)\n } else if (['rate'].includes(item.type)) {\n componentResult = (<CustomRate form={this.form} formItem={item}></CustomRate>)\n } else if (['checkbox', 'checkbox-button'].includes(item.type)) {\n componentResult = (<CustomCheckbox form={this.form} formItem={item}></CustomCheckbox>)\n } else if (['cascader'].includes(item.type)) {\n componentResult = (<CustomCascader form={this.form} formItem={item}></CustomCascader>)\n }\n\n\n return componentResult\n },\n defaultAfter: () => this.$slots[formItemSlot('after_' + item.key)]?.({...item, model: this.form.model}),\n defaultBefore: () => this.$slots[formItemSlot('before_' + item.key)]?.({...item, model: this.form.model}),\n }\n }\n >\n </dinert-tooltip>\n )\n }\n }}\n >\n </el-form-item>\n </el-col>\n )\n }\n\n })\n }\n </el-row>\n {\n this.search\n && <el-row class={['el-form-right', this.isArrow ? 'isArrow' : '']}>\n {this.isArrow\n && <el-button class=\"el-form-right-operation\" text type=\"primary\"\n onClick={this.unfold}\n >\n <el-icon>\n {this.packUp ? <ArrowUp/> : <ArrowDown/>}\n </el-icon>\n {this.packUp ? '收起' : '展开'}\n </el-button>\n }\n {this.$slots.form_search?.()\n || (\n <>\n <el-button type=\"primary\" onClick={() => this.$emit('SearchFn')}>搜索</el-button>\n <el-button type=\"primary\" plain\n onClick={() => this.$emit('ResetFn')}\n >重置</el-button>\n </>\n )\n }\n </el-row>\n }\n </el-form>\n )\n }\n})\n"],"names":["_isSlot","s","Object","prototype","toString","call","_isVNode","defineComponent","name","props","form","type","default","search","Boolean","emits","setup","emit","packUp","ref","isArrow","formRef","formClass","getUuid","toRefs","formItemMap","computed","index","result","keys","value","formItem","forEach","key","push","sort","a","b","resizeForm","elFormLeft","document","querySelectorAll","nextTick","firstTop","getBoundingClientRect","top","lastTop","length","useWindowResize","unfold","render","_slot","_createVNode","_resolveComponent","_mergeProps","el","row","map","item","style","vif","model","undefined","show","options","placeholder","customPlaceholder","label","display","required","showLabel","rules","trigger","message","concat","valDisabled","tempValueDisabled","colLayout","labelWrap","labelDisabled","e","labelMouseEnter","String","getTooltipValue","valueMouseEnter","slots","componentResult","dataTransformRod","$slots","formItemSlot","_b","_a","includes","appendSlot","_d","_c","appendSlotValue","children","prependSlot","_f","_e","prependSlotValue","append","prepend","CustomInput","CustomInputNumber","CustomInputAutocomplete","CustomSelect","CustomSelectV2","CustomSwitch","CustomDate","CustomRadio","CustomSelectTree","CustomRate","CustomCheckbox","CustomCascader","defaultAfter","defaultBefore","ArrowUp","ArrowDown","form_search","_Fragment","onClick","$emit","_createTextVNode"],"mappings":";;;;;;;;;;;;;;;;;;AAuB+C,SAAAA,GAAAC,GAAA;AAAA,SAAA,OAAAA,KAAA,cAAAC,OAAAC,UAAAC,SAAAC,KAAAJ,CAAA,MAAAK,qBAAAA,CAAAA,EAAAL,CAAA;AAAA;AAM/C,MAAeM,uBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMT;AAAAA,MACNU,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,QAAQ;AAAA,MACJF,MAAMG;AAAAA,MACNF,SAAS;AAAA,IACb;AAAA,EACH;AAAA,EACDG,OAAO,CAAC,UAAU,YAAY,SAAS;AAAA,EACvCC,MAAMP,GAAO;AAAA,IAACQ,MAAAA;AAAAA,EAAI,GAAG;AAEjB,UAAMC,IAASC,EAAI,EAAI,GACjBC,IAAUD,EAAI,EAAK,GACnBE,IAAUF,KACVG,IAAYH,EAAI,UAAUI,EAAS,CAAA,GAC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,MAAAA,CAAAA,EAAAC,EAAA,WAAA,GAAA;AAAA,YAAA,MAAA;AAAA,YAAA,SAGmBqE,MAAM,KAAKC,MAAM,UAAU;AAAA,UAAC,GAAA;AAAA,YAAA/G,SAAAA,MAAA,CAAAgH,EAAA,IAAA,CAAA;AAAA,UAAAxE,CAAAA,GAAAA,EAAAC,EAAA,WAAA,GAAA;AAAA,YAAA,MAAA;AAAA,YAAA,OAAA;AAAA,YAAA,SAElDqE,MAAM,KAAKC,MAAM,SAAS;AAAA,UAAC,GAAA;AAAA,YAAA/G,SAAAA,MAAA,CAAAgH,EAAA,IAAA,CAAA;AAAA,UAG/C,CAAA,CAAA,CAAA,CAAA;AAAA;AAAA,OAEA,CAAA;AAAA,IAAA,CAAA;AAAA,EAIrB;AACJ,CAAC;"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { defineComponent as o, computed as s, createVNode as t, resolveComponent as
|
|
2
|
-
|
|
3
|
-
const a = /* @__PURE__ */ o({
|
|
1
|
+
import { defineComponent as o, computed as s, createVNode as t, resolveComponent as n, mergeProps as m } from "vue";
|
|
2
|
+
const u = /* @__PURE__ */ o({
|
|
4
3
|
name: "dinert-input-autocomplete",
|
|
5
4
|
props: {
|
|
6
5
|
form: {
|
|
@@ -18,16 +17,15 @@ const a = /* @__PURE__ */ o({
|
|
|
18
17
|
};
|
|
19
18
|
},
|
|
20
19
|
render() {
|
|
21
|
-
return t("div", null, [t(
|
|
20
|
+
return t("div", null, [t(n("el-autocomplete"), m({
|
|
22
21
|
modelValue: this.form.model[this.formItem.key],
|
|
23
22
|
"onUpdate:modelValue": (e) => this.form.model[this.formItem.key] = e,
|
|
24
23
|
clearable: !0,
|
|
25
|
-
placeholder: n(this.formItem.label),
|
|
26
24
|
"fetch-suggestions": this.options.fetchSuggestions || (() => ({}))
|
|
27
25
|
}, this.options), this.$slots)]);
|
|
28
26
|
}
|
|
29
27
|
});
|
|
30
28
|
export {
|
|
31
|
-
|
|
29
|
+
u as default
|
|
32
30
|
};
|
|
33
31
|
//# sourceMappingURL=input-autocomplete.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-autocomplete.mjs","sources":["../../../../../packages/components/form/src/input-autocomplete.tsx"],"sourcesContent":["import {computed, defineComponent} from 'vue'\
|
|
1
|
+
{"version":3,"file":"input-autocomplete.mjs","sources":["../../../../../packages/components/form/src/input-autocomplete.tsx"],"sourcesContent":["import {computed, defineComponent} from 'vue'\n\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\nimport type {PropType} from 'vue'\n\n\nexport default defineComponent({\n name: 'dinert-input-autocomplete',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n formItem: {\n type: Object as PropType<CustomFormItemProps>,\n default: () => ({})\n },\n },\n setup(props) {\n const options = computed<CustomFormItemProps[keyof CustomFormItemProps]['input-autocomplete']>(() => {\n const options = props.formItem.options || {}\n return options\n })\n\n return {\n options\n }\n },\n render() {\n\n return (\n <div>\n <el-autocomplete\n v-model={this.form.model[this.formItem.key]}\n clearable\n fetch-suggestions={this.options.fetchSuggestions || (() => ({}))}\n {...this.options}\n v-slots={this.$slots}\n >\n </el-autocomplete>\n </div>\n )\n }\n})\n\n"],"names":["defineComponent","name","props","form","type","Object","default","formItem","setup","options","computed","render","_createVNode","_resolveComponent","_mergeProps","model","key","$event","fetchSuggestions","$slots"],"mappings":";AAMA,MAAeA,sBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,UAAU;AAAA,MACNH,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACpB;AAAA,EACH;AAAA,EACDE,MAAMN,GAAO;AAMT,WAAO;AAAA,MACHO,SANYC,EAA+E,MAC3ER,EAAMK,SAASE,WAAW,CAAA,CAE7C;AAAA;EAKJ;AAAA,EACDE,SAAS;AAEL,WAAAC,EAAAA,OAAAA,MAAAA,CAAAA,EAAAC,sBAAAC,EAAA;AAAA,MAAA,YAGqB,KAAKX,KAAKY,MAAM,KAAKR,SAASS,GAAG;AAAA,MAAC,uBAAAC,CAAAA,MAAlC,KAAKd,KAAKY,MAAM,KAAKR,SAASS,GAAG,IAACC;AAAAA,MAAA,WAAA;AAAA,MAAA,qBAExB,KAAKR,QAAQS,qBAAqB,OAAO,CAAE;AAAA,IAAE,GAC5D,KAAKT,OAAO,GACP,KAAKU,MAAM,CAAA,CAAA;AAAA,EAKpC;AACJ,CAAC;"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { defineComponent as t, computed as o, createVNode as r, resolveComponent as m, mergeProps as n } from "vue";
|
|
2
|
-
|
|
3
|
-
const d = /* @__PURE__ */ t({
|
|
2
|
+
const i = /* @__PURE__ */ t({
|
|
4
3
|
name: "dinert-input-number",
|
|
5
4
|
props: {
|
|
6
5
|
form: {
|
|
@@ -21,12 +20,11 @@ const d = /* @__PURE__ */ t({
|
|
|
21
20
|
return r(m("el-input-number"), n({
|
|
22
21
|
modelValue: this.form.model[this.formItem.key],
|
|
23
22
|
"onUpdate:modelValue": (e) => this.form.model[this.formItem.key] = e,
|
|
24
|
-
clearable: !0
|
|
25
|
-
placeholder: s(this.formItem.label)
|
|
23
|
+
clearable: !0
|
|
26
24
|
}, this.options), this.$slots);
|
|
27
25
|
}
|
|
28
26
|
});
|
|
29
27
|
export {
|
|
30
|
-
|
|
28
|
+
i as default
|
|
31
29
|
};
|
|
32
30
|
//# sourceMappingURL=input-number.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-number.mjs","sources":["../../../../../packages/components/form/src/input-number.tsx"],"sourcesContent":["import {computed, defineComponent} from 'vue'\
|
|
1
|
+
{"version":3,"file":"input-number.mjs","sources":["../../../../../packages/components/form/src/input-number.tsx"],"sourcesContent":["import {computed, defineComponent} from 'vue'\n\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\nimport type {PropType} from 'vue'\n\n\nexport default defineComponent({\n name: 'dinert-input-number',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n formItem: {\n type: Object as PropType<CustomFormItemProps>,\n default: () => ({})\n },\n },\n setup(props) {\n const options = computed<CustomFormItemProps[keyof CustomFormItemProps]['input-number']>(() => {\n const options = props.formItem.options || {}\n return options\n })\n\n return {\n options,\n }\n },\n render() {\n\n return (\n <el-input-number\n v-model={this.form.model[this.formItem.key]}\n clearable\n {...this.options}\n v-slots={this.$slots}\n >\n </el-input-number>\n )\n }\n})\n\n"],"names":["defineComponent","name","props","form","type","Object","default","formItem","setup","options","computed","render","_createVNode","_resolveComponent","_mergeProps","model","key","$event","$slots"],"mappings":";AAMA,MAAeA,sBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,UAAU;AAAA,MACNH,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACpB;AAAA,EACH;AAAA,EACDE,MAAMN,GAAO;AAMT,WAAO;AAAA,MACHO,SANYC,EAAyE,MACrER,EAAMK,SAASE,WAAW,CAAA,CAE7C;AAAA;EAKJ;AAAA,EACDE,SAAS;AAEL,WAAAC,EAAAC,EAAA,iBAAA,GAAAC,EAAA;AAAA,MAAA,YAEiB,KAAKX,KAAKY,MAAM,KAAKR,SAASS,GAAG;AAAA,MAAC,uBAAAC,CAAAA,MAAlC,KAAKd,KAAKY,MAAM,KAAKR,SAASS,GAAG,IAACC;AAAAA,MAAA,WAAA;AAAA,IAAA,GAEvC,KAAKR,OAAO,GACP,KAAKS,MAAM;AAAA,EAIhC;AACJ,CAAC;"}
|