@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.
Files changed (211) hide show
  1. package/awesome-button/index.mjs +25 -55
  2. package/base.css +1 -1
  3. package/card/index.mjs +13 -13
  4. package/card/style.css +1 -1
  5. package/carousel/style.css +1 -1
  6. package/chat/index.mjs +2 -2
  7. package/chat/style.css +1 -1
  8. package/chunks/{ElementForm.8w6UkiuU.mjs → ElementForm.CQ3PN5qj.mjs} +17 -35
  9. package/chunks/{ElementListeners.DOy8wyD2.mjs → ElementListeners.De_PRuIm.mjs} +56 -95
  10. package/chunks/{ElementMultiInstance.3Z28ewuh.mjs → ElementMultiInstance.DQo2wuAQ.mjs} +16 -26
  11. package/chunks/{ElementProperties.B2I48muA.mjs → ElementProperties.CosfDrlW.mjs} +16 -16
  12. package/chunks/{ElementTaskConfig.MBbkLrth.mjs → ElementTaskConfig.Bko0kgTp.mjs} +104 -113
  13. package/chunks/{FlowCondition.BfU9kw6h.mjs → FlowCondition.Y6qEYi1T.mjs} +36 -66
  14. package/chunks/{FormTemp.BSpnNput.mjs → FormTemp.Bu2VCxUh.mjs} +2 -2
  15. package/chunks/{SignalAndMessage.CH6L7cYu.mjs → SignalAndMessage.Bb5PFX0N.mjs} +11 -22
  16. package/chunks/{UserTaskListeners.XXe5dC5I.mjs → UserTaskListeners.Bv3BDfEI.mjs} +45 -86
  17. package/chunks/configComponents.BDhlZU8F.mjs +23 -0
  18. package/chunks/confirmable-mixin.D9aKzKZ9.mjs +85 -0
  19. package/chunks/core.DJEgjQW6.mjs +54 -0
  20. package/chunks/{dataformat.B9UvztrQ.mjs → dataformat.CpqOeGBl.mjs} +2 -2
  21. package/chunks/{dic.CET0XdKP.mjs → dic.Dkl-leRW.mjs} +43 -43
  22. package/chunks/dictionary.DqiP9x2m.mjs +25 -0
  23. package/chunks/{event.BT1F_1vF.mjs → event.9aDS6jcw.mjs} +2 -2
  24. package/chunks/form-input.B8z37eqj.mjs +31 -0
  25. package/chunks/form-item.D-H-wCPE.mjs +233 -0
  26. package/chunks/form-validate.CVarNHKX.mjs +12 -0
  27. package/chunks/helper.BiMLcEEk.mjs +41 -0
  28. package/chunks/index.9OxHjTIE.mjs +16 -0
  29. package/chunks/{index.MAFc4eFi.mjs → index.d3MV3Wq2.mjs} +43 -47
  30. package/chunks/{init.ofpxEyAI.mjs → init.DAsXSoLW.mjs} +2 -2
  31. package/chunks/{packages.CWPkeLu9.mjs → packages.ByyangTp.mjs} +3 -3
  32. package/chunks/sub-table-plus-props.BVsD71hT.mjs +30 -0
  33. package/chunks/{tab-mixin.CVr9bZtn.mjs → tab-mixin.BNK6dxLN.mjs} +1 -1
  34. package/chunks/{util.CoahLDYn.mjs → util.DqFv_pWg.mjs} +54 -55
  35. package/chunks/utilSelf.Csq1766E.mjs +48 -0
  36. package/color-picker/index.mjs +19 -37
  37. package/comment/style.css +1 -1
  38. package/confirm-button/index.mjs +1 -1
  39. package/confirmable/index.mjs +1 -1
  40. package/context-menu/style.css +1 -1
  41. package/count-up/index.mjs +13 -24
  42. package/custom-scrollbar/index.mjs +1 -2
  43. package/data-operatext/style.css +1 -1
  44. package/data-panel/style.css +1 -1
  45. package/data-pay/style.css +1 -1
  46. package/data-price/style.css +1 -1
  47. package/data-rotate/style.css +1 -1
  48. package/data-table-picker/index.mjs +1 -1
  49. package/data-tabs/style.css +1 -1
  50. package/dialog-form/index.mjs +16 -28
  51. package/dynamic-table/style.css +1 -1
  52. package/easy-popup/index.mjs +22 -40
  53. package/easy-popup/style.css +1 -1
  54. package/editable-tree/index.mjs +203 -250
  55. package/editable-tree/style.css +1 -1
  56. package/element-dialog/index.mjs +30 -52
  57. package/element-dialog/style.css +1 -1
  58. package/flex-column/index.mjs +13 -25
  59. package/flex-item/index.mjs +15 -27
  60. package/flex-row/index.mjs +13 -25
  61. package/flow/index.mjs +30 -32
  62. package/flow-designer/index.mjs +344 -375
  63. package/flow-designer/style.css +1 -1
  64. package/flow-node/index.mjs +1 -1
  65. package/flow-viewer/index.mjs +64 -91
  66. package/form-block/index.mjs +33 -26
  67. package/form-card/index.mjs +25 -0
  68. package/form-cascader/index.mjs +70 -67
  69. package/form-checkbox/index.mjs +71 -0
  70. package/form-checkbox-group/index.mjs +33 -53
  71. package/form-date-picker/index.mjs +44 -73
  72. package/form-holder/index.mjs +60 -64
  73. package/form-holder/style.css +1 -0
  74. package/form-input/index.mjs +62 -40
  75. package/form-input-cron-expression/index.mjs +77 -0
  76. package/form-input-cron-expression/style.css +1 -0
  77. package/form-input-email/index.mjs +21 -33
  78. package/form-input-id-card/index.mjs +25 -38
  79. package/form-input-number/index.mjs +39 -42
  80. package/form-input-number/style.css +1 -1
  81. package/form-input-phone-number/index.mjs +26 -37
  82. package/form-input-tag/index.mjs +32 -34
  83. package/form-input-time/index.mjs +22 -37
  84. package/form-item/index.mjs +109 -101
  85. package/form-item/style.css +1 -1
  86. package/form-item-config-provider/index.mjs +18 -10
  87. package/form-item-group/index.mjs +73 -69
  88. package/form-item-group/style.css +1 -1
  89. package/form-radio-group/index.mjs +41 -36
  90. package/form-radio-group/style.css +1 -1
  91. package/form-select/index.mjs +142 -75
  92. package/form-select/style.css +1 -0
  93. package/form-switch/index.mjs +29 -34
  94. package/form-table/index.mjs +85 -0
  95. package/form-table-plus/index.mjs +109 -0
  96. package/form-textarea/index.mjs +23 -35
  97. package/form-tree-select/index.mjs +72 -0
  98. package/form-tree-select/style.css +1 -0
  99. package/form-tree-select-multiple/index.mjs +78 -0
  100. package/form-view/index.mjs +43 -77
  101. package/form-view/style.css +1 -1
  102. package/fy-array/index.mjs +2 -2
  103. package/fy-cascader/index.mjs +1 -1
  104. package/fy-checkbox/index.mjs +1 -1
  105. package/fy-code/index.mjs +1 -1
  106. package/fy-curd/index.mjs +12 -17
  107. package/fy-curd/style.css +1 -1
  108. package/fy-date/index.mjs +1 -1
  109. package/fy-draggable/index.mjs +5 -7
  110. package/fy-draggable/style.css +1 -1
  111. package/fy-dynamic/index.mjs +14 -16
  112. package/fy-empty/index.mjs +1 -1
  113. package/fy-empty/style.css +1 -1
  114. package/fy-form/index.mjs +117 -136
  115. package/fy-form/style.css +1 -1
  116. package/fy-form-design/index.mjs +319 -345
  117. package/fy-form-design/style.css +1 -1
  118. package/fy-input/index.mjs +2 -2
  119. package/fy-input-color/index.mjs +1 -1
  120. package/fy-input-icon/index.mjs +1 -1
  121. package/fy-input-map/index.mjs +21 -26
  122. package/fy-input-map/style.css +1 -1
  123. package/fy-input-number/index.mjs +1 -1
  124. package/fy-input-table/index.mjs +10 -12
  125. package/fy-input-tree/index.mjs +1 -1
  126. package/fy-radio/index.mjs +1 -1
  127. package/fy-rate/index.mjs +1 -1
  128. package/fy-select/index.mjs +4 -4
  129. package/fy-slider/index.mjs +2 -2
  130. package/fy-switch/index.mjs +1 -1
  131. package/fy-tabs/index.mjs +0 -1
  132. package/fy-time/index.mjs +1 -1
  133. package/fy-title/index.mjs +1 -1
  134. package/fy-tree/index.mjs +1 -1
  135. package/fy-u-editor/index.mjs +77 -103
  136. package/fy-upload/index.mjs +3 -3
  137. package/fy-upload/style.css +1 -1
  138. package/highlight-j-s/index.mjs +1 -1
  139. package/highlight-j-s/style.css +1 -1
  140. package/image-cropper/index.mjs +14 -65
  141. package/image-preview/index.mjs +17 -45
  142. package/image-preview/style.css +1 -1
  143. package/image-viewer/style.css +1 -1
  144. package/index.mjs +666 -496
  145. package/input-number/index.mjs +64 -9
  146. package/keyboard/style.css +1 -1
  147. package/license/index.mjs +1 -1
  148. package/login/index.mjs +1 -1
  149. package/monaco-editor/index.mjs +44 -74
  150. package/name-avatar/style.css +1 -1
  151. package/package.json +18 -17
  152. package/page-index/index.mjs +30 -54
  153. package/page-index-top/index.mjs +25 -47
  154. package/pageable-table/index.mjs +354 -226
  155. package/pageable-table/style.css +1 -1
  156. package/pageable-view/index.mjs +63 -106
  157. package/photo-swipe/index.mjs +51 -74
  158. package/picker-table-view/index.mjs +117 -0
  159. package/present-view/index.mjs +43 -77
  160. package/present-view/style.css +1 -1
  161. package/record-video/index.mjs +1 -1
  162. package/resize-observer/index.mjs +1 -1
  163. package/resize-observer/style.css +1 -1
  164. package/search/index.mjs +2 -2
  165. package/search/style.css +1 -1
  166. package/search-popover/index.mjs +28 -48
  167. package/search-popover/style.css +1 -1
  168. package/sign/index.mjs +2 -2
  169. package/sign-panel/style.css +1 -1
  170. package/skeleton-panel/index.mjs +38 -0
  171. package/skeleton-panel/style.css +1 -0
  172. package/split-pane/index.mjs +31 -49
  173. package/split-pane/style.css +1 -1
  174. package/sub-table/index.mjs +206 -0
  175. package/sub-table/style.css +1 -0
  176. package/sub-table-plus/index.mjs +231 -0
  177. package/sub-table-plus/style.css +1 -0
  178. package/swiper/index.mjs +18 -38
  179. package/swiper/style.css +1 -1
  180. package/tab/index.mjs +1 -1
  181. package/tab/style.css +1 -1
  182. package/tab-item/index.mjs +2 -2
  183. package/table-column/index.mjs +112 -37
  184. package/table-column/style.css +1 -0
  185. package/table-view/index.mjs +178 -135
  186. package/table-view/style.css +1 -1
  187. package/tabs-view/index.mjs +104 -0
  188. package/tabs-view/style.css +1 -0
  189. package/tag-render/index.mjs +13 -24
  190. package/text-ellipsis/index.mjs +1 -1
  191. package/toolbar/index.mjs +115 -58
  192. package/toolbar/style.css +1 -1
  193. package/toolbar-button/index.mjs +92 -48
  194. package/verify/index.mjs +1 -1
  195. package/vue-cron/index.mjs +48 -66
  196. package/vue-qr-code/index.mjs +14 -32
  197. package/vue-quill-editor/index.mjs +3 -3
  198. package/vue-tags-input/index.mjs +1 -1
  199. package/vue-tree-select/index.mjs +352 -393
  200. package/vue-tree-select/style.css +1 -1
  201. package/vue-video-player/index.mjs +36 -67
  202. package/watermark/index.mjs +21 -31
  203. package/web-types.json +9240 -3843
  204. package/x-input-tag/index.mjs +29 -61
  205. package/chunks/confirmable-mixin.D4LAArE5.mjs +0 -114
  206. package/chunks/form-input-mixin.BkKiqJhi.mjs +0 -24
  207. package/chunks/form-item-mixin.CG4ZwzMC.mjs +0 -140
  208. package/chunks/input-number-mixin.CzjtGf2n.mjs +0 -60
  209. package/chunks/utilSelf.CRqpl0Cz.mjs +0 -56
  210. package/toolbar-button/style.css +0 -1
  211. /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,73 +1,60 @@
1
- var o = (t, e, i) => new Promise((d, s) => {
2
- var n = (r) => {
3
- try {
4
- l(i.next(r));
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: "160px"
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
- * 需要校验必填的字段, required 设置为 false 时有效
68
- */
69
- requiredFields: {
70
- 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;
71
58
  }
72
59
  },
73
60
  watch: {
@@ -76,38 +63,47 @@ const p = {
76
63
  }
77
64
  },
78
65
  created() {
79
- this.required || m.call(
80
- c(this, (t) => ["FormView", "FormHolder"].includes(t.$options.name)),
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(t) {
72
+ clearValidate(r) {
86
73
  var e;
87
- (e = this.$refs.form) == null || e.clearValidate(t);
74
+ (e = this.$refs.form) == null || e.clearValidate(r);
88
75
  },
89
- validate() {
90
- return o(this, null, function* () {
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 _ = function() {
100
- var e = this, i = e._self._c;
101
- return i("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);
102
- }, h = [], b = /* @__PURE__ */ u(
103
- p,
104
- _,
105
- h,
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 q = b.exports;
106
+ const h = m.exports;
111
107
  export {
112
- q as default
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}}
@@ -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
  };