@web-utils/component 3.8.3 → 4.0.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/awesome-button/index.mjs +25 -55
- package/base.css +1 -1
- package/card/index.mjs +13 -13
- package/card/style.css +1 -1
- package/carousel/style.css +1 -1
- package/chat/index.mjs +2 -2
- package/chat/style.css +1 -1
- package/chunks/{ElementForm.8w6UkiuU.mjs → ElementForm.CQ3PN5qj.mjs} +17 -35
- package/chunks/{ElementListeners.DOy8wyD2.mjs → ElementListeners.De_PRuIm.mjs} +56 -95
- package/chunks/{ElementMultiInstance.3Z28ewuh.mjs → ElementMultiInstance.DQo2wuAQ.mjs} +16 -26
- package/chunks/{ElementProperties.B2I48muA.mjs → ElementProperties.CosfDrlW.mjs} +16 -16
- package/chunks/{ElementTaskConfig.MBbkLrth.mjs → ElementTaskConfig.Bko0kgTp.mjs} +104 -113
- package/chunks/{FlowCondition.BfU9kw6h.mjs → FlowCondition.Y6qEYi1T.mjs} +36 -66
- package/chunks/{FormTemp.BSpnNput.mjs → FormTemp.Bu2VCxUh.mjs} +2 -2
- package/chunks/{SignalAndMessage.CH6L7cYu.mjs → SignalAndMessage.Bb5PFX0N.mjs} +11 -22
- package/chunks/{UserTaskListeners.XXe5dC5I.mjs → UserTaskListeners.Bv3BDfEI.mjs} +45 -86
- package/chunks/configComponents.BDhlZU8F.mjs +23 -0
- package/chunks/confirmable-mixin.D9aKzKZ9.mjs +85 -0
- package/chunks/core.DJEgjQW6.mjs +54 -0
- package/chunks/{dataformat.B9UvztrQ.mjs → dataformat.CpqOeGBl.mjs} +2 -2
- package/chunks/{dic.CET0XdKP.mjs → dic.Dkl-leRW.mjs} +43 -43
- package/chunks/dictionary.DqiP9x2m.mjs +25 -0
- package/chunks/{event.BT1F_1vF.mjs → event.9aDS6jcw.mjs} +2 -2
- package/chunks/form-input.B8z37eqj.mjs +31 -0
- package/chunks/form-item.D-H-wCPE.mjs +233 -0
- package/chunks/form-validate.CVarNHKX.mjs +12 -0
- package/chunks/helper.BiMLcEEk.mjs +41 -0
- package/chunks/index.9OxHjTIE.mjs +16 -0
- package/chunks/{index.MAFc4eFi.mjs → index.d3MV3Wq2.mjs} +43 -47
- package/chunks/{init.ofpxEyAI.mjs → init.DAsXSoLW.mjs} +2 -2
- package/chunks/{packages.CWPkeLu9.mjs → packages.ByyangTp.mjs} +3 -3
- package/chunks/sub-table-plus-props.BVsD71hT.mjs +30 -0
- package/chunks/{tab-mixin.CVr9bZtn.mjs → tab-mixin.BNK6dxLN.mjs} +1 -1
- package/chunks/{util.CoahLDYn.mjs → util.DqFv_pWg.mjs} +54 -55
- package/chunks/utilSelf.Csq1766E.mjs +48 -0
- package/color-picker/index.mjs +19 -37
- package/comment/style.css +1 -1
- package/confirm-button/index.mjs +1 -1
- package/confirmable/index.mjs +1 -1
- package/context-menu/style.css +1 -1
- package/count-up/index.mjs +13 -24
- package/custom-scrollbar/index.mjs +1 -2
- package/data-operatext/style.css +1 -1
- package/data-panel/style.css +1 -1
- package/data-pay/style.css +1 -1
- package/data-price/style.css +1 -1
- package/data-rotate/style.css +1 -1
- package/data-table-picker/index.mjs +1 -1
- package/data-tabs/style.css +1 -1
- package/dialog-form/index.mjs +16 -28
- package/dynamic-table/style.css +1 -1
- package/easy-popup/index.mjs +22 -40
- package/easy-popup/style.css +1 -1
- package/editable-tree/index.mjs +203 -250
- package/editable-tree/style.css +1 -1
- package/element-dialog/index.mjs +30 -52
- package/element-dialog/style.css +1 -1
- package/flex-column/index.mjs +13 -25
- package/flex-item/index.mjs +15 -27
- package/flex-row/index.mjs +13 -25
- package/flow/index.mjs +30 -32
- package/flow-designer/index.mjs +344 -375
- package/flow-designer/style.css +1 -1
- package/flow-node/index.mjs +1 -1
- package/flow-viewer/index.mjs +64 -91
- package/form-block/index.mjs +33 -26
- package/form-card/index.mjs +25 -0
- package/form-cascader/index.mjs +70 -67
- package/form-checkbox/index.mjs +71 -0
- package/form-checkbox-group/index.mjs +33 -53
- package/form-date-picker/index.mjs +44 -73
- package/form-holder/index.mjs +60 -64
- package/form-holder/style.css +1 -0
- package/form-input/index.mjs +62 -40
- package/form-input-cron-expression/index.mjs +77 -0
- package/form-input-cron-expression/style.css +1 -0
- package/form-input-email/index.mjs +21 -33
- package/form-input-id-card/index.mjs +25 -38
- package/form-input-number/index.mjs +39 -42
- package/form-input-number/style.css +1 -1
- package/form-input-phone-number/index.mjs +26 -37
- package/form-input-tag/index.mjs +32 -34
- package/form-input-time/index.mjs +22 -37
- package/form-item/index.mjs +109 -101
- package/form-item/style.css +1 -1
- package/form-item-config-provider/index.mjs +18 -10
- package/form-item-group/index.mjs +73 -69
- package/form-item-group/style.css +1 -1
- package/form-radio-group/index.mjs +41 -36
- package/form-radio-group/style.css +1 -1
- package/form-select/index.mjs +142 -75
- package/form-select/style.css +1 -0
- package/form-switch/index.mjs +29 -34
- package/form-table/index.mjs +85 -0
- package/form-table-plus/index.mjs +109 -0
- package/form-textarea/index.mjs +23 -35
- package/form-tree-select/index.mjs +72 -0
- package/form-tree-select/style.css +1 -0
- package/form-tree-select-multiple/index.mjs +78 -0
- package/form-view/index.mjs +43 -77
- package/form-view/style.css +1 -1
- package/fy-array/index.mjs +2 -2
- package/fy-cascader/index.mjs +1 -1
- package/fy-checkbox/index.mjs +1 -1
- package/fy-code/index.mjs +1 -1
- package/fy-curd/index.mjs +12 -17
- package/fy-curd/style.css +1 -1
- package/fy-date/index.mjs +1 -1
- package/fy-draggable/index.mjs +5 -7
- package/fy-draggable/style.css +1 -1
- package/fy-dynamic/index.mjs +14 -16
- package/fy-empty/index.mjs +1 -1
- package/fy-empty/style.css +1 -1
- package/fy-form/index.mjs +117 -136
- package/fy-form/style.css +1 -1
- package/fy-form-design/index.mjs +319 -345
- package/fy-form-design/style.css +1 -1
- package/fy-input/index.mjs +2 -2
- package/fy-input-color/index.mjs +1 -1
- package/fy-input-icon/index.mjs +1 -1
- package/fy-input-map/index.mjs +21 -26
- package/fy-input-map/style.css +1 -1
- package/fy-input-number/index.mjs +1 -1
- package/fy-input-table/index.mjs +10 -12
- package/fy-input-tree/index.mjs +1 -1
- package/fy-radio/index.mjs +1 -1
- package/fy-rate/index.mjs +1 -1
- package/fy-select/index.mjs +4 -4
- package/fy-slider/index.mjs +2 -2
- package/fy-switch/index.mjs +1 -1
- package/fy-tabs/index.mjs +0 -1
- package/fy-time/index.mjs +1 -1
- package/fy-title/index.mjs +1 -1
- package/fy-tree/index.mjs +1 -1
- package/fy-u-editor/index.mjs +77 -103
- package/fy-upload/index.mjs +3 -3
- package/fy-upload/style.css +1 -1
- package/highlight-j-s/index.mjs +1 -1
- package/highlight-j-s/style.css +1 -1
- package/image-cropper/index.mjs +14 -65
- package/image-preview/index.mjs +17 -45
- package/image-preview/style.css +1 -1
- package/image-viewer/style.css +1 -1
- package/index.mjs +666 -496
- package/input-number/index.mjs +64 -9
- package/keyboard/style.css +1 -1
- package/license/index.mjs +1 -1
- package/login/index.mjs +1 -1
- package/monaco-editor/index.mjs +44 -74
- package/name-avatar/style.css +1 -1
- package/package.json +18 -17
- package/page-index/index.mjs +30 -54
- package/page-index-top/index.mjs +25 -47
- package/pageable-table/index.mjs +354 -226
- package/pageable-table/style.css +1 -1
- package/pageable-view/index.mjs +63 -106
- package/photo-swipe/index.mjs +51 -74
- package/picker-table-view/index.mjs +117 -0
- package/present-view/index.mjs +43 -77
- package/present-view/style.css +1 -1
- package/record-video/index.mjs +1 -1
- package/resize-observer/index.mjs +1 -1
- package/resize-observer/style.css +1 -1
- package/search/index.mjs +2 -2
- package/search/style.css +1 -1
- package/search-popover/index.mjs +28 -48
- package/search-popover/style.css +1 -1
- package/sign/index.mjs +2 -2
- package/sign-panel/style.css +1 -1
- package/skeleton-panel/index.mjs +38 -0
- package/skeleton-panel/style.css +1 -0
- package/split-pane/index.mjs +31 -49
- package/split-pane/style.css +1 -1
- package/sub-table/index.mjs +206 -0
- package/sub-table/style.css +1 -0
- package/sub-table-plus/index.mjs +231 -0
- package/sub-table-plus/style.css +1 -0
- package/swiper/index.mjs +18 -38
- package/swiper/style.css +1 -1
- package/tab/index.mjs +1 -1
- package/tab/style.css +1 -1
- package/tab-item/index.mjs +2 -2
- package/table-column/index.mjs +112 -37
- package/table-column/style.css +1 -0
- package/table-view/index.mjs +178 -135
- package/table-view/style.css +1 -1
- package/tabs-view/index.mjs +104 -0
- package/tabs-view/style.css +1 -0
- package/tag-render/index.mjs +13 -24
- package/text-ellipsis/index.mjs +1 -1
- package/toolbar/index.mjs +115 -58
- package/toolbar/style.css +1 -1
- package/toolbar-button/index.mjs +92 -48
- package/verify/index.mjs +1 -1
- package/vue-cron/index.mjs +48 -66
- package/vue-qr-code/index.mjs +14 -32
- package/vue-quill-editor/index.mjs +3 -3
- package/vue-tags-input/index.mjs +1 -1
- package/vue-tree-select/index.mjs +352 -393
- package/vue-tree-select/style.css +1 -1
- package/vue-video-player/index.mjs +36 -67
- package/watermark/index.mjs +21 -31
- package/web-types.json +9240 -3843
- package/x-input-tag/index.mjs +29 -61
- package/chunks/confirmable-mixin.D4LAArE5.mjs +0 -114
- package/chunks/form-input-mixin.BkKiqJhi.mjs +0 -24
- package/chunks/form-item-mixin.CG4ZwzMC.mjs +0 -140
- package/chunks/input-number-mixin.CzjtGf2n.mjs +0 -60
- package/chunks/utilSelf.CRqpl0Cz.mjs +0 -56
- package/toolbar-button/style.css +0 -1
- /package/chunks/{form-pick-mixin.BFTIVn_i.mjs → form-pick.BFTIVn_i.mjs} +0 -0
|
@@ -1,49 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
for (var r of i(e))
|
|
9
|
-
u.call(e, r) && s(t, r, e[r]);
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { f as h } from "../chunks/form-input-mixin.BkKiqJhi.mjs";
|
|
13
|
-
import { f as c } from "../chunks/form-pick-mixin.BFTIVn_i.mjs";
|
|
14
|
-
import { d as f, n as m } from "../chunks/index.MAFc4eFi.mjs";
|
|
15
|
-
import n from "element-ui/lib/checkbox-group";
|
|
16
|
-
import { n as d } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
17
|
-
const b = Object.keys(n.props || n.default.props).filter((t) => !["value", "placeholder", "disabled"].includes(t)), y = {
|
|
1
|
+
import { f as l } from "../chunks/form-input.B8z37eqj.mjs";
|
|
2
|
+
import { f as i } from "../chunks/form-pick.BFTIVn_i.mjs";
|
|
3
|
+
import { d as s } from "../chunks/dictionary.DqiP9x2m.mjs";
|
|
4
|
+
import { c as n, n as a } from "../chunks/index.d3MV3Wq2.mjs";
|
|
5
|
+
import u from "element-ui/lib/checkbox-group";
|
|
6
|
+
import { n as p } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
7
|
+
const h = Object.keys(u.props).filter((t) => !["value", "placeholder", "disabled"].includes(t)), c = {
|
|
18
8
|
name: "FormCheckboxGroup",
|
|
19
|
-
mixins: [
|
|
9
|
+
mixins: [l, i, s],
|
|
20
10
|
props: {
|
|
21
11
|
options: {
|
|
22
12
|
type: Array,
|
|
23
13
|
default: () => []
|
|
24
14
|
},
|
|
25
|
-
value:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
otherVal: {
|
|
32
|
-
type: String
|
|
33
|
-
},
|
|
34
|
-
otherProp: {
|
|
35
|
-
type: String
|
|
36
|
-
},
|
|
37
|
-
otherPlaceholder: {
|
|
38
|
-
type: String
|
|
39
|
-
},
|
|
40
|
-
otherLabel: {
|
|
41
|
-
type: String
|
|
42
|
-
},
|
|
15
|
+
value: [String, Array],
|
|
16
|
+
other: [String],
|
|
17
|
+
otherVal: [String],
|
|
18
|
+
otherProp: String,
|
|
19
|
+
otherPlaceholder: String,
|
|
20
|
+
otherLabel: String,
|
|
43
21
|
otherWidth: {
|
|
44
22
|
type: String,
|
|
45
23
|
default: "200px"
|
|
46
24
|
},
|
|
25
|
+
otherMaxLength: String,
|
|
47
26
|
gender: Boolean,
|
|
48
27
|
confirm: Boolean,
|
|
49
28
|
labelProp: {
|
|
@@ -55,6 +34,7 @@ const b = Object.keys(n.props || n.default.props).filter((t) => !["value", "plac
|
|
|
55
34
|
default: "code"
|
|
56
35
|
},
|
|
57
36
|
split: Boolean,
|
|
37
|
+
sort: Boolean,
|
|
58
38
|
classic: Boolean,
|
|
59
39
|
fillRow: Boolean,
|
|
60
40
|
ellipsis: Boolean
|
|
@@ -70,10 +50,10 @@ const b = Object.keys(n.props || n.default.props).filter((t) => !["value", "plac
|
|
|
70
50
|
return this.classic ? "value" : this.valueProp;
|
|
71
51
|
},
|
|
72
52
|
inputProps() {
|
|
73
|
-
return
|
|
53
|
+
return n({ ...a(this.$attrs), ...this.$props }, h);
|
|
74
54
|
},
|
|
75
55
|
innerOptions() {
|
|
76
|
-
return this.gender ? [
|
|
56
|
+
return this.dictType ? this.dictItems : this.gender ? [
|
|
77
57
|
{
|
|
78
58
|
[this.labelKey]: "男",
|
|
79
59
|
[this.valueKey]: "男"
|
|
@@ -99,36 +79,36 @@ const b = Object.keys(n.props || n.default.props).filter((t) => !["value", "plac
|
|
|
99
79
|
},
|
|
100
80
|
methods: {
|
|
101
81
|
emitInput(t) {
|
|
102
|
-
this.split ? this.$emit("input", t.join(",")) : this.$emit("input", t);
|
|
82
|
+
this.split ? this.sort ? this.$emit("input", t.sort().join(",")) : this.$emit("input", t.join(",")) : this.sort ? this.$emit("input", t.sort()) : this.$emit("input", t);
|
|
103
83
|
}
|
|
104
84
|
}
|
|
105
85
|
};
|
|
106
|
-
var
|
|
107
|
-
var e = this,
|
|
108
|
-
return
|
|
86
|
+
var f = function() {
|
|
87
|
+
var e = this, o = e._self._c;
|
|
88
|
+
return o("FormItem", e._b({ class: [
|
|
109
89
|
"form-checkbox-group",
|
|
110
90
|
{ "form-checkbox-group-row": e.fillRow },
|
|
111
91
|
e.ellipsis ? "form-checkbox-group-row-ellipsis" : e.fillRow ? "form-checkbox-group-row-break-word" : ""
|
|
112
92
|
], attrs: { rules: e.computeRules, disabled: e.inputDisabled }, scopedSlots: e._u([{ key: "default", fn: function() {
|
|
113
|
-
return [
|
|
114
|
-
return
|
|
115
|
-
}), 1), e.computeVal.includes(e.otherVal) ?
|
|
116
|
-
}, proxy: !0 }, { key: "error", fn: function({ error:
|
|
117
|
-
return [e._t("error", null, { error:
|
|
93
|
+
return [o("ElCheckboxGroup", e._g(e._b({ attrs: { disabled: e.inputDisabled, value: e.computeVal, placeholder: e.computePlaceholder }, on: { input: e.emitInput } }, "ElCheckboxGroup", e.inputProps, !1), e.listeners), e._l(e.innerOptions, function(r) {
|
|
94
|
+
return o("ElCheckbox", { key: r[e.valueKey], attrs: { label: r[e.valueKey] } }, [e._v(" " + e._s(r[e.labelKey]) + " ")]);
|
|
95
|
+
}), 1), e.computeVal.includes(e.otherVal) ? o("FormInput", { staticClass: "form-checkbox-group-other", style: e.otherLabel ? { width: e.otherWidth } : { marginBottom: 0, width: e.otherWidth }, attrs: { "wrap-col": !1, "label-width": "0", prop: e.otherProp, disabled: e.inputDisabled, required: !!e.otherProp, placeholder: e.otherPlaceholder, label: e.otherLabel, "show-message": !!e.otherLabel, value: e.other, "max-length": e.otherMaxLength }, on: { input: (r) => e.$emit("update:other", r) } }) : e._e()];
|
|
96
|
+
}, proxy: !0 }, { key: "error", fn: function({ error: r }) {
|
|
97
|
+
return [e._t("error", null, { error: r })];
|
|
118
98
|
} }, { key: "label", fn: function() {
|
|
119
99
|
return [e._t("label")];
|
|
120
100
|
}, proxy: !0 }, { key: "below", fn: function() {
|
|
121
101
|
return [e._t("below")];
|
|
122
102
|
}, proxy: !0 }], null, !0) }, "FormItem", e.formItemProps, !1));
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
103
|
+
}, m = [], d = /* @__PURE__ */ p(
|
|
104
|
+
c,
|
|
105
|
+
f,
|
|
106
|
+
m,
|
|
127
107
|
!1,
|
|
128
108
|
null,
|
|
129
109
|
null
|
|
130
110
|
);
|
|
131
|
-
const
|
|
111
|
+
const k = d.exports;
|
|
132
112
|
export {
|
|
133
|
-
|
|
113
|
+
k as default
|
|
134
114
|
};
|
|
@@ -1,21 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
d.call(e, r) && s(t, r, e[r]);
|
|
8
|
-
if (n)
|
|
9
|
-
for (var r of n(e))
|
|
10
|
-
h.call(e, r) && s(t, r, e[r]);
|
|
11
|
-
return t;
|
|
12
|
-
}, l = (t, e) => u(t, p(e));
|
|
13
|
-
import { f } from "../chunks/form-input-mixin.BkKiqJhi.mjs";
|
|
14
|
-
import { f as c } from "../chunks/form-pick-mixin.BFTIVn_i.mjs";
|
|
15
|
-
import { toDate as o } from "@web-utils/integrations/dayjs";
|
|
16
|
-
import { d as y, n as g } from "../chunks/index.MAFc4eFi.mjs";
|
|
17
|
-
import { n as _ } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
18
|
-
const k = [
|
|
1
|
+
import { f as n } from "../chunks/form-input.B8z37eqj.mjs";
|
|
2
|
+
import { f as s } from "../chunks/form-pick.BFTIVn_i.mjs";
|
|
3
|
+
import { toDate as a } from "@web-utils/integrations/dayjs";
|
|
4
|
+
import { c as l, n as o } from "../chunks/index.d3MV3Wq2.mjs";
|
|
5
|
+
import { n as m } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
6
|
+
const u = [
|
|
19
7
|
"type",
|
|
20
8
|
"timeArrowControl",
|
|
21
9
|
"size",
|
|
@@ -41,31 +29,17 @@ const k = [
|
|
|
41
29
|
"pickerOptions",
|
|
42
30
|
"unlinkPanels",
|
|
43
31
|
"validateEvent"
|
|
44
|
-
].filter((t) => !["value", "placeholder", "disabled", "type", "pickerOptions"].includes(t)),
|
|
32
|
+
].filter((t) => !["value", "placeholder", "disabled", "type", "pickerOptions"].includes(t)), d = {
|
|
45
33
|
name: "FormDatePicker",
|
|
46
|
-
mixins: [
|
|
34
|
+
mixins: [n, s],
|
|
47
35
|
props: {
|
|
48
|
-
format:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
type: String
|
|
56
|
-
},
|
|
57
|
-
startPlaceholder: {
|
|
58
|
-
type: String
|
|
59
|
-
},
|
|
60
|
-
endPlaceholder: {
|
|
61
|
-
type: String
|
|
62
|
-
},
|
|
63
|
-
start: {
|
|
64
|
-
type: String
|
|
65
|
-
},
|
|
66
|
-
end: {
|
|
67
|
-
type: String
|
|
68
|
-
},
|
|
36
|
+
format: String,
|
|
37
|
+
valueFormat: String,
|
|
38
|
+
rangeSeparator: String,
|
|
39
|
+
startPlaceholder: String,
|
|
40
|
+
endPlaceholder: String,
|
|
41
|
+
start: String,
|
|
42
|
+
end: String,
|
|
69
43
|
year: Boolean,
|
|
70
44
|
month: Boolean,
|
|
71
45
|
dates: Boolean,
|
|
@@ -74,15 +48,9 @@ const k = [
|
|
|
74
48
|
dateTimeRange: Boolean,
|
|
75
49
|
dateRange: Boolean,
|
|
76
50
|
monthRange: Boolean,
|
|
77
|
-
miniDate:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
maxDate: {
|
|
81
|
-
type: String
|
|
82
|
-
},
|
|
83
|
-
pickerOptions: {
|
|
84
|
-
type: Object
|
|
85
|
-
},
|
|
51
|
+
miniDate: String,
|
|
52
|
+
maxDate: String,
|
|
53
|
+
pickerOptions: Object,
|
|
86
54
|
split: {
|
|
87
55
|
type: Boolean,
|
|
88
56
|
default: !0
|
|
@@ -94,23 +62,24 @@ const k = [
|
|
|
94
62
|
},
|
|
95
63
|
mini() {
|
|
96
64
|
if (this.miniDate) {
|
|
97
|
-
const t =
|
|
65
|
+
const t = a(this.miniDate);
|
|
98
66
|
return t.setDate(t.getDate() - 1), t;
|
|
99
67
|
} else
|
|
100
68
|
return null;
|
|
101
69
|
},
|
|
102
70
|
max() {
|
|
103
|
-
return this.maxDate ?
|
|
71
|
+
return this.maxDate ? a(this.maxDate) : null;
|
|
104
72
|
},
|
|
105
73
|
pickerOption() {
|
|
106
|
-
return
|
|
74
|
+
return {
|
|
107
75
|
disabledDate: (t) => {
|
|
108
76
|
if (!this.mini && !this.max)
|
|
109
77
|
return !1;
|
|
110
78
|
const e = t.getTime();
|
|
111
|
-
return this.mini && !this.max ? e <= this.mini.getTime() : !this.mini && this.max ? e >= this.max.getTime() : this.mini && this.max ? e
|
|
112
|
-
}
|
|
113
|
-
|
|
79
|
+
return this.mini && !this.max ? e <= this.mini.getTime() : !this.mini && this.max ? e >= this.max.getTime() : this.mini && this.max ? !(e > this.mini.getTime() && e <= this.max.getTime()) : !1;
|
|
80
|
+
},
|
|
81
|
+
...this.pickerOptions
|
|
82
|
+
};
|
|
114
83
|
},
|
|
115
84
|
innerVal() {
|
|
116
85
|
if (this.range && this.split) {
|
|
@@ -120,18 +89,20 @@ const k = [
|
|
|
120
89
|
return this.value;
|
|
121
90
|
},
|
|
122
91
|
fat() {
|
|
123
|
-
return this.year ? "yyyy" : this.month || this.monthRange ? "yyyy-MM" : this.week ? "yyyy 第 WW 周" : this.dateTime || this.dateTimeRange ? "yyyy-MM-dd HH:mm" : "yyyy-MM-dd";
|
|
92
|
+
return this.year ? "yyyy" : this.month || this.monthRange ? "yyyy-MM" : this.week ? "yyyy 第 WW 周" : this.dateTime || this.dateTimeRange ? "yyyy-MM-dd HH:mm:ss" : "yyyy-MM-dd";
|
|
124
93
|
},
|
|
125
94
|
inputProps() {
|
|
126
|
-
return
|
|
127
|
-
|
|
95
|
+
return l(
|
|
96
|
+
{
|
|
97
|
+
...o(this.$attrs),
|
|
98
|
+
...this.$props,
|
|
128
99
|
valueFormat: this.week ? "yyyy-MM-dd" : this.valueFormat || this.fat,
|
|
129
100
|
format: this.format || this.fat,
|
|
130
101
|
rangeSeparator: this.rangeSeparator || "至",
|
|
131
102
|
startPlaceholder: this.startPlaceholder || "开始日期",
|
|
132
103
|
endPlaceholder: this.endPlaceholder || "结束日期"
|
|
133
|
-
}
|
|
134
|
-
|
|
104
|
+
},
|
|
105
|
+
u
|
|
135
106
|
);
|
|
136
107
|
},
|
|
137
108
|
range() {
|
|
@@ -147,26 +118,26 @@ const k = [
|
|
|
147
118
|
}
|
|
148
119
|
}
|
|
149
120
|
};
|
|
150
|
-
var
|
|
121
|
+
var h = function() {
|
|
151
122
|
var e = this, r = e._self._c;
|
|
152
123
|
return r("FormItem", e._b({ attrs: { rules: e.computeRules, disabled: e.inputDisabled }, scopedSlots: e._u([{ key: "default", fn: function() {
|
|
153
|
-
return [r("ElDatePicker", e._g(e._b({ staticStyle: { width: "100%" }, attrs: { "picker-options": e.pickerOption, value: e.innerVal,
|
|
154
|
-
}, proxy: !0 }, { key: "error", fn: function({ error:
|
|
155
|
-
return [e.$scopedSlots.error && e.$scopedSlots.error(
|
|
156
|
-
return [e._v(
|
|
157
|
-
}, { error:
|
|
124
|
+
return [r("ElDatePicker", e._g(e._b({ staticStyle: { width: "100%" }, attrs: { "picker-options": e.pickerOption, value: e.innerVal, placeholder: e.computePlaceholder, type: e.type, disabled: e.inputDisabled }, on: { input: e.emitInput } }, "ElDatePicker", e.inputProps, !1), e.listeners)), e.$slots.warn ? r("div", { staticClass: "el-form-item__warn" }, [e._t("warn")], 2) : e._e()];
|
|
125
|
+
}, proxy: !0 }, { key: "error", fn: function({ error: i }) {
|
|
126
|
+
return [e.$scopedSlots.error && e.$scopedSlots.error(i) ? r("div", { staticClass: "el-form-item__error" }, [e._t("error", function() {
|
|
127
|
+
return [e._v(e._s(i))];
|
|
128
|
+
}, { error: i })], 2) : e._e()];
|
|
158
129
|
} }, { key: "label", fn: function() {
|
|
159
130
|
return [e._t("label")];
|
|
160
131
|
}, proxy: !0 }], null, !0) }, "FormItem", e.formItemProps, !1));
|
|
161
|
-
},
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
132
|
+
}, p = [], f = /* @__PURE__ */ m(
|
|
133
|
+
d,
|
|
134
|
+
h,
|
|
135
|
+
p,
|
|
165
136
|
!1,
|
|
166
137
|
null,
|
|
167
138
|
null
|
|
168
139
|
);
|
|
169
|
-
const
|
|
140
|
+
const P = f.exports;
|
|
170
141
|
export {
|
|
171
|
-
|
|
142
|
+
P as default
|
|
172
143
|
};
|
package/form-holder/index.mjs
CHANGED
|
@@ -1,73 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} catch (a) {
|
|
6
|
-
s(a);
|
|
7
|
-
}
|
|
8
|
-
}, f = (r) => {
|
|
9
|
-
try {
|
|
10
|
-
l(i.throw(r));
|
|
11
|
-
} catch (a) {
|
|
12
|
-
s(a);
|
|
13
|
-
}
|
|
14
|
-
}, l = (r) => r.done ? d(r.value) : Promise.resolve(r.value).then(n, f);
|
|
15
|
-
l((i = i.apply(t, e)).next());
|
|
16
|
-
});
|
|
17
|
-
import { warning as m } from "@web-utils/core";
|
|
18
|
-
import { e as c } from "../chunks/index.MAFc4eFi.mjs";
|
|
19
|
-
import { n as u } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
20
|
-
const p = {
|
|
1
|
+
import { animate as o, warning as l } from "@web-utils/core";
|
|
2
|
+
import { d as a } from "../chunks/index.d3MV3Wq2.mjs";
|
|
3
|
+
import { n as i } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
4
|
+
const s = {
|
|
21
5
|
name: "FormHolder",
|
|
6
|
+
inject: {
|
|
7
|
+
formView: {
|
|
8
|
+
default: {}
|
|
9
|
+
}
|
|
10
|
+
},
|
|
22
11
|
provide() {
|
|
23
12
|
return {
|
|
24
13
|
formHolder: this
|
|
25
14
|
};
|
|
26
15
|
},
|
|
27
16
|
props: {
|
|
28
|
-
|
|
29
|
-
* 表单实体
|
|
30
|
-
*/
|
|
31
|
-
model: {
|
|
32
|
-
type: Object
|
|
33
|
-
},
|
|
34
|
-
/**
|
|
35
|
-
* 表单元素大小
|
|
36
|
-
*/
|
|
17
|
+
model: Object,
|
|
37
18
|
size: {
|
|
38
19
|
type: String,
|
|
39
20
|
default: "mini"
|
|
40
21
|
},
|
|
41
|
-
/**
|
|
42
|
-
* 是否禁用
|
|
43
|
-
*/
|
|
44
22
|
disabled: Boolean,
|
|
45
|
-
/**
|
|
46
|
-
* 表单组件 label 位置,可选值 top,right,left
|
|
47
|
-
*/
|
|
48
23
|
labelPosition: {
|
|
49
24
|
type: String,
|
|
50
25
|
default: "right"
|
|
51
26
|
},
|
|
52
|
-
/**
|
|
53
|
-
* 表单组件 label 宽度
|
|
54
|
-
*/
|
|
55
27
|
labelWidth: {
|
|
56
28
|
type: String,
|
|
57
|
-
default: "
|
|
29
|
+
default: "110px"
|
|
58
30
|
},
|
|
59
|
-
/**
|
|
60
|
-
* 表单组件是否必填,设置为 false 即使表单输入组件设置了必填也不会校验必填,但可以使用 requiredFields 来排除需要必填的字段
|
|
61
|
-
*/
|
|
62
31
|
required: {
|
|
63
32
|
type: Boolean,
|
|
64
33
|
default: !0
|
|
65
34
|
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
35
|
+
requiredFields: Array,
|
|
36
|
+
enabledFields: Array,
|
|
37
|
+
showAdvice: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: !0
|
|
40
|
+
},
|
|
41
|
+
columns: [Array, Object],
|
|
42
|
+
colCount: Number,
|
|
43
|
+
notTableForm: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: void 0
|
|
46
|
+
},
|
|
47
|
+
commentValueColspan: Number,
|
|
48
|
+
commentLabelColspan: Number,
|
|
49
|
+
showMessage: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: !0
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
computed: {
|
|
55
|
+
tableForm() {
|
|
56
|
+
var r;
|
|
57
|
+
return this.notTableForm === void 0 ? (r = this.formView) == null ? void 0 : r.tableForm : !this.notTableForm;
|
|
71
58
|
}
|
|
72
59
|
},
|
|
73
60
|
watch: {
|
|
@@ -76,38 +63,47 @@ const p = {
|
|
|
76
63
|
}
|
|
77
64
|
},
|
|
78
65
|
created() {
|
|
79
|
-
this.required ||
|
|
80
|
-
|
|
66
|
+
this.required || l.call(
|
|
67
|
+
a(this, (r) => ["FormView", "FormHolder"].includes(r.$options.name)),
|
|
81
68
|
"一般情况下不建议设置 required=false,因为 required 设置为 false 后必填字段要自行维护,在处理表格时会比较复杂,请自行权衡利弊"
|
|
82
69
|
);
|
|
83
70
|
},
|
|
84
71
|
methods: {
|
|
85
|
-
clearValidate(
|
|
72
|
+
clearValidate(r) {
|
|
86
73
|
var e;
|
|
87
|
-
(e = this.$refs.form) == null || e.clearValidate(
|
|
74
|
+
(e = this.$refs.form) == null || e.clearValidate(r);
|
|
88
75
|
},
|
|
89
|
-
validate() {
|
|
90
|
-
|
|
91
|
-
return this.$refs.form.validate();
|
|
92
|
-
}
|
|
76
|
+
async validate() {
|
|
77
|
+
try {
|
|
78
|
+
return await this.$refs.form.validate();
|
|
79
|
+
} catch {
|
|
80
|
+
throw await this.scrollIntoRequiredField(), this.$el.querySelectorAll(".el-form-item.is-error .el-form-item__content").forEach((e) => {
|
|
81
|
+
o(e, "breathe-animation");
|
|
82
|
+
}), Error("表单验证不通过!");
|
|
83
|
+
}
|
|
93
84
|
},
|
|
94
85
|
resetFields() {
|
|
95
86
|
return this.$refs.form.resetFields();
|
|
87
|
+
},
|
|
88
|
+
async scrollIntoRequiredField() {
|
|
89
|
+
await this.$nextTick();
|
|
90
|
+
const r = this.$el.querySelector(".el-form-item.is-error");
|
|
91
|
+
r && r.scrollIntoView({ block: "center", inline: "center", behavior: "smooth" });
|
|
96
92
|
}
|
|
97
93
|
}
|
|
98
94
|
};
|
|
99
|
-
var
|
|
100
|
-
var e = this,
|
|
101
|
-
return
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
95
|
+
var n = function() {
|
|
96
|
+
var e = this, t = e._self._c;
|
|
97
|
+
return t("ElForm", { ref: "form", class: ["clear-fix", { "red-form": e.tableForm }], attrs: { model: e.model, size: e.size, "show-message": e.showMessage, disabled: e.disabled, "label-width": e.tableForm ? "0px" : e.labelWidth, "label-position": e.labelPosition } }, [e.tableForm ? [e._t("top"), t("FormRedTable", { class: { "hide-error-message": e.tableForm }, attrs: { columns: e.columns, "col-count": e.colCount } }, [e._t("default"), e.showAdvice ? t("FormAdvice", { attrs: { "label-colspan": e.commentLabelColspan, "value-colspan": e.commentValueColspan } }) : e._e()], 2), e._t("bottom"), t("div", { staticClass: "red-form-footer" }, [e._t("footer")], 2)] : [e._t("default")]], 2);
|
|
98
|
+
}, d = [], m = /* @__PURE__ */ i(
|
|
99
|
+
s,
|
|
100
|
+
n,
|
|
101
|
+
d,
|
|
106
102
|
!1,
|
|
107
103
|
null,
|
|
108
104
|
null
|
|
109
105
|
);
|
|
110
|
-
const
|
|
106
|
+
const h = m.exports;
|
|
111
107
|
export {
|
|
112
|
-
|
|
108
|
+
h as default
|
|
113
109
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.red-form .red-form-footer{margin-top:14px}.red-form .hide-error-message .el-form-item__error{display:none}@media print{.red-form .el-input__suffix,.red-form .el-input__prefix,.red-form .el-input__icon.el-range__icon.el-icon-date,.red-form .red-form-footer,.red-form .el-input__count{display:none}.red-form .el-input__inner,.red-form .el-textarea__inner,.red-form .x-input-tag,.red-form .el-input.is-disabled .el-input__inner,.red-form .el-input.is-readonly .el-input__inner{background-color:#0000;border:none;padding:0!important}.red-form .el-form-item{margin-bottom:0}.red-form .el-form-item .el-form-item__content,.red-form .el-form-item .el-form-item__label,.red-form .el-input__inner{height:auto;min-height:0;line-height:1.5}}
|
package/form-input/index.mjs
CHANGED
|
@@ -1,65 +1,87 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
p.call(e, t) && l(r, t, e[t]);
|
|
7
|
-
if (s)
|
|
8
|
-
for (var t of s(e))
|
|
9
|
-
i.call(e, t) && l(r, t, e[t]);
|
|
10
|
-
return r;
|
|
11
|
-
};
|
|
12
|
-
import { f as m } from "../chunks/form-input-mixin.BkKiqJhi.mjs";
|
|
13
|
-
import a from "element-ui/lib/input";
|
|
14
|
-
import { d, n as f } from "../chunks/index.MAFc4eFi.mjs";
|
|
15
|
-
import { n as c } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
16
|
-
const _ = Object.keys(a.props || a.default.props).filter((r) => !["value", "placeholder", "disabled"].includes(r)), y = {
|
|
1
|
+
import { f as i } from "../chunks/form-input.B8z37eqj.mjs";
|
|
2
|
+
import o from "element-ui/lib/input";
|
|
3
|
+
import { v as a, c as s, n as l } from "../chunks/index.d3MV3Wq2.mjs";
|
|
4
|
+
import { n as u } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
5
|
+
const p = Object.keys(o.props).filter((t) => !["value", "placeholder", "disabled", "suffixIcon"].includes(t)), c = {
|
|
17
6
|
name: "FormInput",
|
|
18
|
-
mixins: [
|
|
7
|
+
mixins: [i],
|
|
19
8
|
props: {
|
|
20
|
-
value:
|
|
21
|
-
|
|
9
|
+
value: [String, Number],
|
|
10
|
+
readonlyGrey: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: !0
|
|
22
13
|
},
|
|
23
14
|
maxLength: {
|
|
24
15
|
type: String,
|
|
25
|
-
default: "
|
|
26
|
-
}
|
|
16
|
+
default: "255"
|
|
17
|
+
},
|
|
18
|
+
picker: Boolean,
|
|
19
|
+
suffixIcon: String,
|
|
20
|
+
prepend: String,
|
|
21
|
+
append: String,
|
|
22
|
+
showPassword: Boolean
|
|
23
|
+
},
|
|
24
|
+
data() {
|
|
25
|
+
return {
|
|
26
|
+
isValidValue: !1
|
|
27
|
+
};
|
|
27
28
|
},
|
|
28
29
|
computed: {
|
|
29
30
|
inputProps() {
|
|
30
|
-
return
|
|
31
|
+
return s({ ...l(this.$attrs), ...this.$props }, p);
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
watch: {
|
|
35
|
+
async value(t) {
|
|
36
|
+
this.isValidValue = await a(this.prop, t, this.computeRules);
|
|
31
37
|
}
|
|
32
38
|
},
|
|
33
39
|
methods: {
|
|
34
|
-
|
|
35
|
-
this.$emit("
|
|
40
|
+
onInputClick(t) {
|
|
41
|
+
this.inputDisabled || this.$emit("click", t);
|
|
42
|
+
},
|
|
43
|
+
emitInput(t) {
|
|
44
|
+
this.$emit("input", t);
|
|
45
|
+
},
|
|
46
|
+
clear() {
|
|
47
|
+
this.$emit("clear");
|
|
36
48
|
}
|
|
37
49
|
}
|
|
38
50
|
};
|
|
39
|
-
var
|
|
40
|
-
var e = this,
|
|
41
|
-
return
|
|
51
|
+
var d = function() {
|
|
52
|
+
var e = this, n = e._self._c;
|
|
53
|
+
return n("FormItem", e._b({ attrs: { rules: e.computeRules, disabled: e.inputDisabled }, scopedSlots: e._u([{ key: "default", fn: function() {
|
|
42
54
|
return [e._t("default", function() {
|
|
43
|
-
return [
|
|
44
|
-
return
|
|
45
|
-
}
|
|
55
|
+
return [n("ElInput", e._g(e._b({ ref: "input", class: { "is-readonly": e.readonlyGrey && e.readonly && !e.picker, "el-input-cursor-pointer": e.picker && !e.inputDisabled }, attrs: { value: e.value, readonly: e.readonly || e.picker, maxlength: e.maxLength, disabled: e.inputDisabled, "suffix-icon": e.picker ? "el-icon-search" : e.suffixIcon, clearable: "", placeholder: e.inputDisabled ? "" : e.computePlaceholder }, on: { clear: e.clear, input: e.emitInput }, nativeOn: { click: function(r) {
|
|
56
|
+
return r.preventDefault(), e.onInputClick.apply(null, arguments);
|
|
57
|
+
} }, scopedSlots: e._u([{ key: "prepend", fn: function() {
|
|
58
|
+
return [e._t("prepend", function() {
|
|
59
|
+
return [e.prepend ? [e._v(" " + e._s(e.prepend) + " ")] : e._e()];
|
|
60
|
+
})];
|
|
61
|
+
}, proxy: !0 }, { key: "append", fn: function() {
|
|
62
|
+
return [e._t("append", function() {
|
|
63
|
+
return [e.append ? [e._v(" " + e._s(e.append) + " ")] : e._e()];
|
|
64
|
+
})];
|
|
65
|
+
}, proxy: !0 }], null, !0) }, "ElInput", e.inputProps, !1), e.listeners)), e.isValidValue && e.$slots.warn ? n("div", { staticClass: "el-form-item__warn" }, [e._t("warn")], 2) : e._e()];
|
|
46
66
|
})];
|
|
47
|
-
}, proxy: !0 }, { key: "error", fn: function({ error:
|
|
48
|
-
return [e.$scopedSlots.error && e.$scopedSlots.error(
|
|
49
|
-
return [e._v(
|
|
50
|
-
}, { error:
|
|
67
|
+
}, proxy: !0 }, { key: "error", fn: function({ error: r }) {
|
|
68
|
+
return [e.$scopedSlots.error && e.$scopedSlots.error(r) ? n("div", { staticClass: "el-form-item__error" }, [e._t("error", function() {
|
|
69
|
+
return [e._v(e._s(r))];
|
|
70
|
+
}, { error: r })], 2) : e._e()];
|
|
51
71
|
} }, { key: "label", fn: function() {
|
|
52
72
|
return [e._t("label")];
|
|
73
|
+
}, proxy: !0 }, { key: "tips", fn: function() {
|
|
74
|
+
return [e._t("tips")];
|
|
53
75
|
}, proxy: !0 }], null, !0) }, "FormItem", e.formItemProps, !1));
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
76
|
+
}, f = [], m = /* @__PURE__ */ u(
|
|
77
|
+
c,
|
|
78
|
+
d,
|
|
79
|
+
f,
|
|
58
80
|
!1,
|
|
59
81
|
null,
|
|
60
82
|
null
|
|
61
83
|
);
|
|
62
|
-
const
|
|
84
|
+
const k = m.exports;
|
|
63
85
|
export {
|
|
64
|
-
|
|
86
|
+
k as default
|
|
65
87
|
};
|