@web-utils/component 4.0.0 → 4.0.2

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.
Files changed (172) hide show
  1. package/awesome-button/index.mjs +25 -55
  2. package/base.css +1 -1
  3. package/card/style.css +1 -1
  4. package/carousel/style.css +1 -1
  5. package/chat/style.css +1 -1
  6. package/chunks/{ElementForm.8w6UkiuU.mjs → ElementForm.CQ3PN5qj.mjs} +17 -35
  7. package/chunks/{ElementListeners.DOy8wyD2.mjs → ElementListeners.De_PRuIm.mjs} +56 -95
  8. package/chunks/{ElementMultiInstance.3Z28ewuh.mjs → ElementMultiInstance.DQo2wuAQ.mjs} +16 -26
  9. package/chunks/{ElementProperties.B2I48muA.mjs → ElementProperties.CosfDrlW.mjs} +16 -16
  10. package/chunks/{ElementTaskConfig.MBbkLrth.mjs → ElementTaskConfig.Bko0kgTp.mjs} +104 -113
  11. package/chunks/{FlowCondition.BfU9kw6h.mjs → FlowCondition.Y6qEYi1T.mjs} +36 -66
  12. package/chunks/{SignalAndMessage.CH6L7cYu.mjs → SignalAndMessage.Bb5PFX0N.mjs} +11 -22
  13. package/chunks/{UserTaskListeners.XXe5dC5I.mjs → UserTaskListeners.Bv3BDfEI.mjs} +45 -86
  14. package/chunks/configComponents.BDhlZU8F.mjs +23 -0
  15. package/chunks/confirmable-mixin.D9aKzKZ9.mjs +85 -0
  16. package/chunks/core.DJEgjQW6.mjs +54 -0
  17. package/chunks/dictionary.DqiP9x2m.mjs +25 -0
  18. package/chunks/dictionary.DsN-2ukC.mjs +70 -0
  19. package/chunks/form-input.B8z37eqj.mjs +31 -0
  20. package/chunks/form-item.D-H-wCPE.mjs +233 -0
  21. package/chunks/form-validate.CVarNHKX.mjs +12 -0
  22. package/chunks/helper.BiMLcEEk.mjs +41 -0
  23. package/chunks/index.9OxHjTIE.mjs +16 -0
  24. package/chunks/{index.MAFc4eFi.mjs → index.d3MV3Wq2.mjs} +43 -47
  25. package/chunks/sub-table-plus-props.BVsD71hT.mjs +30 -0
  26. package/chunks/{tab-mixin.CVr9bZtn.mjs → tab-mixin.BNK6dxLN.mjs} +1 -1
  27. package/chunks/utilSelf.Csq1766E.mjs +48 -0
  28. package/color-picker/index.mjs +19 -37
  29. package/comment/style.css +1 -1
  30. package/confirm-button/index.mjs +1 -1
  31. package/confirmable/index.mjs +1 -1
  32. package/context-menu/style.css +1 -1
  33. package/count-up/index.mjs +13 -24
  34. package/custom-scrollbar/index.mjs +1 -2
  35. package/data-operatext/style.css +1 -1
  36. package/data-panel/style.css +1 -1
  37. package/data-pay/style.css +1 -1
  38. package/data-price/style.css +1 -1
  39. package/data-rotate/style.css +1 -1
  40. package/data-table-picker/index.mjs +1 -1
  41. package/data-tabs/style.css +1 -1
  42. package/dialog-form/index.mjs +16 -28
  43. package/dynamic-table/style.css +1 -1
  44. package/easy-popup/index.mjs +22 -40
  45. package/easy-popup/style.css +1 -1
  46. package/editable-tree/index.mjs +203 -250
  47. package/editable-tree/style.css +1 -1
  48. package/element-dialog/index.mjs +30 -52
  49. package/element-dialog/style.css +1 -1
  50. package/flex-column/index.mjs +13 -25
  51. package/flex-item/index.mjs +15 -27
  52. package/flex-row/index.mjs +13 -25
  53. package/flow-designer/index.mjs +343 -374
  54. package/flow-designer/style.css +1 -1
  55. package/flow-viewer/index.mjs +64 -91
  56. package/form-block/index.mjs +33 -26
  57. package/form-card/index.mjs +25 -0
  58. package/form-cascader/index.mjs +70 -67
  59. package/form-checkbox/index.mjs +71 -0
  60. package/form-checkbox-group/index.mjs +33 -53
  61. package/form-date-picker/index.mjs +44 -73
  62. package/form-holder/index.mjs +54 -40
  63. package/form-holder/style.css +1 -0
  64. package/form-input/index.mjs +62 -40
  65. package/form-input-cron-expression/index.mjs +77 -0
  66. package/form-input-cron-expression/style.css +1 -0
  67. package/form-input-email/index.mjs +21 -33
  68. package/form-input-id-card/index.mjs +25 -38
  69. package/form-input-number/index.mjs +39 -42
  70. package/form-input-number/style.css +1 -1
  71. package/form-input-phone-number/index.mjs +26 -37
  72. package/form-input-tag/index.mjs +32 -34
  73. package/form-input-time/index.mjs +22 -37
  74. package/form-item/index.mjs +109 -101
  75. package/form-item/style.css +1 -1
  76. package/form-item-config-provider/index.mjs +18 -10
  77. package/form-item-group/index.mjs +73 -69
  78. package/form-item-group/style.css +1 -1
  79. package/form-radio-group/index.mjs +41 -36
  80. package/form-radio-group/style.css +1 -1
  81. package/form-select/index.mjs +142 -75
  82. package/form-select/style.css +1 -0
  83. package/form-switch/index.mjs +29 -34
  84. package/form-table/index.mjs +85 -0
  85. package/form-table-plus/index.mjs +109 -0
  86. package/form-textarea/index.mjs +23 -35
  87. package/form-tree-select/index.mjs +72 -0
  88. package/form-tree-select/style.css +1 -0
  89. package/form-tree-select-multiple/index.mjs +78 -0
  90. package/form-view/index.mjs +37 -69
  91. package/form-view/style.css +1 -1
  92. package/fy-curd/index.mjs +131 -140
  93. package/fy-curd/style.css +1 -1
  94. package/fy-draggable/index.mjs +16 -26
  95. package/fy-draggable/style.css +1 -1
  96. package/fy-dynamic/index.mjs +48 -57
  97. package/fy-empty/style.css +1 -1
  98. package/fy-form/style.css +1 -1
  99. package/fy-form-design/index.mjs +314 -339
  100. package/fy-form-design/style.css +1 -1
  101. package/fy-input-map/index.mjs +40 -50
  102. package/fy-input-map/style.css +1 -1
  103. package/fy-input-table/index.mjs +31 -41
  104. package/fy-u-editor/index.mjs +77 -103
  105. package/fy-upload/style.css +1 -1
  106. package/highlight-j-s/style.css +1 -1
  107. package/image-cropper/index.mjs +14 -65
  108. package/image-preview/index.mjs +17 -45
  109. package/image-preview/style.css +1 -1
  110. package/image-viewer/style.css +1 -1
  111. package/index.mjs +666 -496
  112. package/input-number/index.mjs +64 -9
  113. package/keyboard/style.css +1 -1
  114. package/monaco-editor/index.mjs +43 -71
  115. package/name-avatar/style.css +1 -1
  116. package/package.json +5 -4
  117. package/page-index/index.mjs +30 -54
  118. package/page-index-top/index.mjs +25 -47
  119. package/pageable-table/index.mjs +385 -218
  120. package/pageable-table/style.css +1 -1
  121. package/pageable-view/index.mjs +56 -95
  122. package/photo-swipe/index.mjs +51 -74
  123. package/picker-table-view/index.mjs +117 -0
  124. package/present-view/index.mjs +43 -77
  125. package/present-view/style.css +1 -1
  126. package/resize-observer/index.mjs +1 -1
  127. package/resize-observer/style.css +1 -1
  128. package/search/style.css +1 -1
  129. package/search-popover/index.mjs +28 -48
  130. package/search-popover/style.css +1 -1
  131. package/sign/index.mjs +1 -1
  132. package/sign-panel/style.css +1 -1
  133. package/skeleton-panel/index.mjs +38 -0
  134. package/skeleton-panel/style.css +1 -0
  135. package/split-pane/index.mjs +31 -49
  136. package/split-pane/style.css +1 -1
  137. package/sub-table/index.mjs +206 -0
  138. package/sub-table/style.css +1 -0
  139. package/sub-table-plus/index.mjs +231 -0
  140. package/sub-table-plus/style.css +1 -0
  141. package/swiper/index.mjs +18 -38
  142. package/swiper/style.css +1 -1
  143. package/tab/index.mjs +1 -1
  144. package/tab/style.css +1 -1
  145. package/tab-item/index.mjs +2 -2
  146. package/table-column/index.mjs +166 -37
  147. package/table-column/style.css +1 -0
  148. package/table-view/index.mjs +177 -132
  149. package/table-view/style.css +1 -1
  150. package/tabs-view/index.mjs +104 -0
  151. package/tabs-view/style.css +1 -0
  152. package/tag-render/index.mjs +13 -24
  153. package/toolbar/index.mjs +115 -58
  154. package/toolbar/style.css +1 -1
  155. package/toolbar-button/index.mjs +92 -48
  156. package/vue-cron/index.mjs +47 -65
  157. package/vue-qr-code/index.mjs +14 -32
  158. package/vue-quill-editor/index.mjs +13 -24
  159. package/vue-tags-input/index.mjs +10 -21
  160. package/vue-tree-select/index.mjs +352 -393
  161. package/vue-tree-select/style.css +1 -1
  162. package/vue-video-player/index.mjs +34 -63
  163. package/watermark/index.mjs +21 -31
  164. package/web-types.json +9240 -3840
  165. package/x-input-tag/index.mjs +29 -61
  166. package/chunks/confirmable-mixin.D4LAArE5.mjs +0 -114
  167. package/chunks/form-input-mixin.BkKiqJhi.mjs +0 -24
  168. package/chunks/form-item-mixin.CG4ZwzMC.mjs +0 -140
  169. package/chunks/input-number-mixin.CzjtGf2n.mjs +0 -60
  170. package/chunks/utilSelf.CRqpl0Cz.mjs +0 -56
  171. package/toolbar-button/style.css +0 -1
  172. /package/chunks/{form-pick-mixin.BFTIVn_i.mjs → form-pick.BFTIVn_i.mjs} +0 -0
@@ -1,49 +1,28 @@
1
- var a = Object.defineProperty;
2
- var i = Object.getOwnPropertySymbols;
3
- var p = Object.prototype.hasOwnProperty, u = Object.prototype.propertyIsEnumerable;
4
- var s = (t, e, r) => e in t ? a(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, l = (t, e) => {
5
- for (var r in e || (e = {}))
6
- p.call(e, r) && s(t, r, e[r]);
7
- if (i)
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: [h, c],
9
+ mixins: [l, i, s],
20
10
  props: {
21
11
  options: {
22
12
  type: Array,
23
13
  default: () => []
24
14
  },
25
- value: {
26
- type: [String, Array]
27
- },
28
- other: {
29
- type: String
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 f(l(l({}, m(this.$attrs)), this.$props), b);
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 _ = function() {
107
- var e = this, r = e._self._c;
108
- return r("FormItem", e._b({ class: [
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 [r("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(o) {
114
- return r("ElCheckbox", { key: o[e.valueKey], attrs: { label: o[e.valueKey] } }, [e._v(" " + e._s(o[e.labelKey]) + " ")]);
115
- }), 1), e.computeVal.includes(e.otherVal) ? r("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, required: !!e.otherProp, placeholder: e.otherPlaceholder, label: e.otherLabel, "show-message": !!e.otherLabel, value: e.other }, on: { input: (o) => e.$emit("update:other", o) } }) : e._e()];
116
- }, proxy: !0 }, { key: "error", fn: function({ error: o }) {
117
- return [e._t("error", null, { error: o })];
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
- }, v = [], x = /* @__PURE__ */ d(
124
- y,
125
- _,
126
- v,
103
+ }, m = [], d = /* @__PURE__ */ p(
104
+ c,
105
+ f,
106
+ m,
127
107
  !1,
128
108
  null,
129
109
  null
130
110
  );
131
- const B = x.exports;
111
+ const k = d.exports;
132
112
  export {
133
- B as default
113
+ k as default
134
114
  };
@@ -1,21 +1,9 @@
1
- var m = Object.defineProperty, u = Object.defineProperties;
2
- var p = Object.getOwnPropertyDescriptors;
3
- var n = Object.getOwnPropertySymbols;
4
- var d = Object.prototype.hasOwnProperty, h = Object.prototype.propertyIsEnumerable;
5
- var s = (t, e, r) => e in t ? m(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, i = (t, e) => {
6
- for (var r in e || (e = {}))
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)), P = {
32
+ ].filter((t) => !["value", "placeholder", "disabled", "type", "pickerOptions"].includes(t)), d = {
45
33
  name: "FormDatePicker",
46
- mixins: [f, c],
34
+ mixins: [n, s],
47
35
  props: {
48
- format: {
49
- type: String
50
- },
51
- valueFormat: {
52
- type: String
53
- },
54
- rangeSeparator: {
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
- type: String
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 = o(this.miniDate);
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 ? o(this.maxDate) : null;
71
+ return this.maxDate ? a(this.maxDate) : null;
104
72
  },
105
73
  pickerOption() {
106
- return i({
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 <= this.mini.getTime() && e >= this.max.getTime() : !1;
112
- }
113
- }, this.pickerOptions);
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 y(
127
- l(i(i({}, g(this.$attrs)), this.$props), {
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
- k
104
+ },
105
+ u
135
106
  );
136
107
  },
137
108
  range() {
@@ -147,26 +118,26 @@ const k = [
147
118
  }
148
119
  }
149
120
  };
150
- var x = function() {
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, size: "mini", 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()];
154
- }, proxy: !0 }, { key: "error", fn: function({ error: a }) {
155
- return [e.$scopedSlots.error && e.$scopedSlots.error(a) ? r("div", { staticClass: "el-form-item__error" }, [e._t("error", function() {
156
- return [e._v(" " + e._s(a) + " ")];
157
- }, { error: a })], 2) : e._e()];
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
- }, S = [], v = /* @__PURE__ */ _(
162
- P,
163
- x,
164
- S,
132
+ }, p = [], f = /* @__PURE__ */ m(
133
+ d,
134
+ h,
135
+ p,
165
136
  !1,
166
137
  null,
167
138
  null
168
139
  );
169
- const M = v.exports;
140
+ const P = f.exports;
170
141
  export {
171
- M as default
142
+ P as default
172
143
  };
@@ -1,57 +1,60 @@
1
- import { warning as i } from "@web-utils/core";
2
- import { e as l } from "../chunks/index.MAFc4eFi.mjs";
3
- import { n as a } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
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
4
  const s = {
5
5
  name: "FormHolder",
6
+ inject: {
7
+ formView: {
8
+ default: {}
9
+ }
10
+ },
6
11
  provide() {
7
12
  return {
8
13
  formHolder: this
9
14
  };
10
15
  },
11
16
  props: {
12
- /**
13
- * 表单实体
14
- */
15
- model: {
16
- type: Object
17
- },
18
- /**
19
- * 表单元素大小
20
- */
17
+ model: Object,
21
18
  size: {
22
19
  type: String,
23
20
  default: "mini"
24
21
  },
25
- /**
26
- * 是否禁用
27
- */
28
22
  disabled: Boolean,
29
- /**
30
- * 表单组件 label 位置,可选值 top,right,left
31
- */
32
23
  labelPosition: {
33
24
  type: String,
34
25
  default: "right"
35
26
  },
36
- /**
37
- * 表单组件 label 宽度
38
- */
39
27
  labelWidth: {
40
28
  type: String,
41
- default: "160px"
29
+ default: "110px"
42
30
  },
43
- /**
44
- * 表单组件是否必填,设置为 false 即使表单输入组件设置了必填也不会校验必填,但可以使用 requiredFields 来排除需要必填的字段
45
- */
46
31
  required: {
47
32
  type: Boolean,
48
33
  default: !0
49
34
  },
50
- /**
51
- * 需要校验必填的字段, required 设置为 false 时有效
52
- */
53
- requiredFields: {
54
- type: Array
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;
55
58
  }
56
59
  },
57
60
  watch: {
@@ -60,8 +63,8 @@ const s = {
60
63
  }
61
64
  },
62
65
  created() {
63
- this.required || i.call(
64
- l(this, (r) => ["FormView", "FormHolder"].includes(r.$options.name)),
66
+ this.required || l.call(
67
+ a(this, (r) => ["FormView", "FormHolder"].includes(r.$options.name)),
65
68
  "一般情况下不建议设置 required=false,因为 required 设置为 false 后必填字段要自行维护,在处理表格时会比较复杂,请自行权衡利弊"
66
69
  );
67
70
  },
@@ -70,26 +73,37 @@ const s = {
70
73
  var e;
71
74
  (e = this.$refs.form) == null || e.clearValidate(r);
72
75
  },
73
- validate() {
74
- return this.$refs.form.validate();
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
+ }
75
84
  },
76
85
  resetFields() {
77
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" });
78
92
  }
79
93
  }
80
94
  };
81
- var o = function() {
95
+ var n = function() {
82
96
  var e = this, t = e._self._c;
83
- return t("ElForm", e._g(e._b({ ref: "form", staticClass: "clear-fix", attrs: { model: e.model, size: e.size, disabled: e.disabled, "label-width": e.labelWidth, "label-position": e.labelPosition } }, "ElForm", e.$attrs, !1), e.$listeners), [e._t("default")], 2);
84
- }, d = [], n = /* @__PURE__ */ a(
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(
85
99
  s,
86
- o,
100
+ n,
87
101
  d,
88
102
  !1,
89
103
  null,
90
104
  null
91
105
  );
92
- const c = n.exports;
106
+ const h = m.exports;
93
107
  export {
94
- c as default
108
+ h as default
95
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}}
@@ -1,65 +1,87 @@
1
- var u = Object.defineProperty;
2
- var s = Object.getOwnPropertySymbols;
3
- var p = Object.prototype.hasOwnProperty, i = Object.prototype.propertyIsEnumerable;
4
- var l = (r, e, t) => e in r ? u(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, o = (r, e) => {
5
- for (var t in e || (e = {}))
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: [m],
7
+ mixins: [i],
19
8
  props: {
20
- value: {
21
- type: [String, Number]
9
+ value: [String, Number],
10
+ readonlyGrey: {
11
+ type: Boolean,
12
+ default: !0
22
13
  },
23
14
  maxLength: {
24
15
  type: String,
25
- default: "200"
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 d(o(o({}, f(this.$attrs)), this.$props), _);
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
- emitInput(r) {
35
- this.$emit("input", r);
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 v = function() {
40
- var e = this, t = e._self._c;
41
- return t("FormItem", e._b({ attrs: { rules: e.computeRules, disabled: e.inputDisabled }, scopedSlots: e._u([{ key: "default", fn: function() {
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 [t("ElInput", e._g(e._b({ class: { "is-readonly": e.readonly }, attrs: { value: e.value, readonly: e.readonly, maxlength: e.maxLength, disabled: e.inputDisabled, placeholder: e.computePlaceholder }, on: { input: e.emitInput }, scopedSlots: e._u([{ key: "append", fn: function() {
44
- return [e._t("append")];
45
- }, proxy: !0 }], null, !0) }, "ElInput", e.inputProps, !1), e.listeners)), e.$slots.warn ? t("div", { staticClass: "el-form-item__warn" }, [e._t("warn")], 2) : e._e()];
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: n }) {
48
- return [e.$scopedSlots.error && e.$scopedSlots.error(n) ? t("div", { staticClass: "el-form-item__error" }, [e._t("error", function() {
49
- return [e._v(" " + e._s(n) + " ")];
50
- }, { error: n })], 2) : e._e()];
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
- }, b = [], h = /* @__PURE__ */ c(
55
- y,
56
- v,
57
- b,
76
+ }, f = [], m = /* @__PURE__ */ u(
77
+ c,
78
+ d,
79
+ f,
58
80
  !1,
59
81
  null,
60
82
  null
61
83
  );
62
- const $ = h.exports;
84
+ const k = m.exports;
63
85
  export {
64
- $ as default
86
+ k as default
65
87
  };