@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,30 +1,25 @@
1
- var u = Object.defineProperty;
2
- var n = Object.getOwnPropertySymbols;
3
- var p = Object.prototype.hasOwnProperty, f = Object.prototype.propertyIsEnumerable;
4
- var s = (o, e, r) => e in o ? u(o, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[e] = r, t = (o, e) => {
5
- for (var r in e || (e = {}))
6
- p.call(e, r) && s(o, r, e[r]);
7
- if (n)
8
- for (var r of n(e))
9
- f.call(e, r) && s(o, r, e[r]);
10
- return o;
11
- };
12
- import { f as c } from "../chunks/form-input-mixin.BkKiqJhi.mjs";
13
- import { f as h } from "../chunks/form-pick-mixin.BFTIVn_i.mjs";
1
+ import { f as n } from "../chunks/form-input.B8z37eqj.mjs";
2
+ import { f as l } from "../chunks/form-pick.BFTIVn_i.mjs";
14
3
  import a from "element-ui/lib/radio-group";
15
- import { d, n as m } from "../chunks/index.MAFc4eFi.mjs";
16
- import { n as y } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
17
- const v = Object.keys(a.props || a.default.props).filter((o) => !["value", "placeholder", "disabled"].includes(o)), _ = {
4
+ import { c as s, n as u } from "../chunks/index.d3MV3Wq2.mjs";
5
+ import { d as p } from "../chunks/dictionary.DqiP9x2m.mjs";
6
+ import { n as c } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
7
+ const d = Object.keys(a.props).filter((o) => !["value", "placeholder", "disabled"].includes(o)), f = {
18
8
  name: "FormRadioGroup",
19
- mixins: [c, h],
9
+ mixins: [n, l, p],
20
10
  props: {
21
11
  options: {
22
12
  type: Array,
23
13
  default: () => []
24
14
  },
15
+ border: Boolean,
25
16
  gender: Boolean,
26
17
  overFlow: Boolean,
27
18
  confirm: Boolean,
19
+ trigger: {
20
+ type: String,
21
+ default: "change"
22
+ },
28
23
  labelProp: {
29
24
  type: String,
30
25
  default: "name"
@@ -36,18 +31,28 @@ const v = Object.keys(a.props || a.default.props).filter((o) => !["value", "plac
36
31
  english: Boolean,
37
32
  chinese: Boolean,
38
33
  typing: Boolean,
39
- classic: Boolean,
34
+ classic: {
35
+ type: Boolean,
36
+ default: !0
37
+ },
40
38
  fillRow: Boolean,
41
39
  ellipsis: Boolean,
42
40
  inline: Boolean,
43
- allowCancel: Boolean
41
+ allowCancel: Boolean,
42
+ radioType: {
43
+ type: String,
44
+ default: "radio"
45
+ }
44
46
  },
45
47
  computed: {
48
+ component() {
49
+ return this.radioType === "radio" ? "ElRadio" : "ElRadioButton";
50
+ },
46
51
  prefix() {
47
52
  return "请选择";
48
53
  },
49
54
  inputProps() {
50
- return d(t(t({}, m(this.$attrs)), this.$props), v);
55
+ return s({ ...u(this.$attrs), ...this.$props }, d);
51
56
  },
52
57
  labelKey() {
53
58
  return this.classic ? "label" : this.labelProp;
@@ -56,7 +61,7 @@ const v = Object.keys(a.props || a.default.props).filter((o) => !["value", "plac
56
61
  return this.classic ? "value" : this.valueProp;
57
62
  },
58
63
  innerOptions() {
59
- return this.gender ? [
64
+ return this.dictType ? this.dictItems : this.gender ? [
60
65
  {
61
66
  [this.labelKey]: "男",
62
67
  [this.valueKey]: this.chinese ? "男" : this.typing ? 1 : "1"
@@ -86,32 +91,32 @@ const v = Object.keys(a.props || a.default.props).filter((o) => !["value", "plac
86
91
  }
87
92
  }
88
93
  };
89
- var b = function() {
94
+ var h = function() {
90
95
  var e = this, r = e._self._c;
91
96
  return r("FormItem", e._b({ class: ["form-radio-group", { "form-radio-group-row": e.fillRow, inline: e.inline }, e.ellipsis ? "form-radio-group-row-ellipsis" : "form-radio-group-row-break-word"], attrs: { rules: e.computeRules, disabled: e.inputDisabled }, scopedSlots: e._u([{ key: "default", fn: function() {
92
- return [r("ElRadioGroup", e._g(e._b({ class: { "over-flow": e.overFlow }, attrs: { value: e.value, disabled: e.inputDisabled, placeholder: e.computePlaceholder }, on: { input: (l) => e.$emit("input", l) } }, "ElRadioGroup", e.inputProps, !1), e.listeners), [e.allowCancel ? e._l(e.innerOptions, function(l) {
93
- return r("ElRadio", { key: l[e.valueKey], attrs: { label: l[e.valueKey] }, nativeOn: { click: function(i) {
94
- return i.preventDefault(), i.stopPropagation(), e.toggle(l);
95
- } } }, [e._v(" " + e._s(l[e.labelKey]) + " ")]);
96
- }) : e._l(e.innerOptions, function(l) {
97
- return r("ElRadio", { key: l[e.valueKey], attrs: { label: l[e.valueKey] } }, [e._v(" " + e._s(l[e.labelKey]) + " ")]);
97
+ return [r("ElRadioGroup", e._g(e._b({ class: { "over-flow": e.overFlow }, attrs: { value: e.value, disabled: e.inputDisabled, placeholder: e.computePlaceholder }, on: { input: (t) => e.$emit("input", t) } }, "ElRadioGroup", e.inputProps, !1), e.listeners), [e.allowCancel ? e._l(e.innerOptions, function(t) {
98
+ return r(e.component, { key: t[e.valueKey], tag: "Component", attrs: { border: e.border, label: t[e.valueKey] }, nativeOn: { click: function(i) {
99
+ return i.preventDefault(), i.stopPropagation(), e.toggle(t);
100
+ } } }, [e._v(" " + e._s(t[e.labelKey]) + " ")]);
101
+ }) : e._l(e.innerOptions, function(t) {
102
+ return r(e.component, { key: t[e.valueKey], tag: "Component", attrs: { border: e.border, label: t[e.valueKey] } }, [e._v(" " + e._s(t[e.labelKey]) + " ")]);
98
103
  })], 2), e._t("append")];
99
- }, proxy: !0 }, { key: "error", fn: function({ error: l }) {
100
- return [e._t("error", null, { error: l })];
104
+ }, proxy: !0 }, { key: "error", fn: function({ error: t }) {
105
+ return [e._t("error", null, { error: t })];
101
106
  } }, { key: "label", fn: function() {
102
107
  return [e._t("label")];
103
108
  }, proxy: !0 }, { key: "below", fn: function() {
104
109
  return [e._t("below")];
105
110
  }, proxy: !0 }], null, !0) }, "FormItem", e.formItemProps, !1));
106
- }, g = [], K = /* @__PURE__ */ y(
107
- _,
108
- b,
109
- g,
111
+ }, m = [], y = /* @__PURE__ */ c(
112
+ f,
113
+ h,
114
+ m,
110
115
  !1,
111
116
  null,
112
117
  null
113
118
  );
114
- const F = K.exports;
119
+ const w = y.exports;
115
120
  export {
116
- F as default
121
+ w as default
117
122
  };
@@ -1 +1 @@
1
- .form-radio-group.inline{display:inline}.form-radio-group.inline .el-radio{float:left;margin-right:10px}.form-radio-group.form-radio-group-row.form-radio-group-row-ellipsis .el-radio__label{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.form-radio-group.form-radio-group-row.form-radio-group-row-break-word .el-radio__label{word-wrap:break-word;word-break:break-all}.form-radio-group.form-radio-group-row .el-radio-group{display:block}.form-radio-group.form-radio-group-row .el-radio{flex-flow:row;width:100%;display:flex}.form-radio-group.form-radio-group-row .el-radio__input{flex-shrink:0;top:3px}.form-radio-group.form-radio-group-row .el-radio__label{vertical-align:sub;flex:auto;margin-bottom:6px;padding-left:4px;display:block}.form-radio-group .el-radio-group{line-height:1}.form-radio-group .el-radio{vertical-align:middle;margin-right:10px}.form-radio-group .el-radio__label{padding-left:0;line-height:19px}
1
+ .form-radio-group.inline{display:inline}.form-radio-group.inline .el-radio{float:left;margin-right:10px}.form-radio-group .el-form-item__content{flex-direction:row;align-items:end;line-height:normal;display:flex}.form-radio-group.form-radio-group-row.form-radio-group-row-ellipsis .el-radio-group{overflow:hidden}.form-radio-group.form-radio-group-row.form-radio-group-row-ellipsis .el-radio__label{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.form-radio-group.form-radio-group-row.form-radio-group-row-break-word .el-radio__label{word-wrap:break-word;word-break:break-all}.form-radio-group.form-radio-group-row .el-radio-group{display:block}.form-radio-group.form-radio-group-row .el-radio{flex-flow:row;width:100%;display:flex}.form-radio-group.form-radio-group-row .el-radio__input{flex-shrink:0;top:3px}.form-radio-group.form-radio-group-row .el-radio__label{vertical-align:sub;flex:auto;margin-bottom:6px;padding-left:4px;display:block}.form-radio-group .el-radio-group{line-height:1}.form-radio-group .el-radio{vertical-align:middle;margin-right:10px}.form-radio-group .el-radio__label{padding-left:0;line-height:19px}
@@ -1,112 +1,179 @@
1
- var a = Object.defineProperty;
2
- var s = Object.getOwnPropertySymbols;
3
- var u = Object.prototype.hasOwnProperty, p = Object.prototype.propertyIsEnumerable;
4
- var n = (r, e, t) => e in r ? a(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, i = (r, e) => {
5
- for (var t in e || (e = {}))
6
- u.call(e, t) && n(r, t, e[t]);
7
- if (s)
8
- for (var t of s(e))
9
- p.call(e, t) && n(r, t, e[t]);
10
- return r;
11
- };
12
- import { f as c } from "../chunks/form-input-mixin.BkKiqJhi.mjs";
13
- import { f } from "../chunks/form-pick-mixin.BFTIVn_i.mjs";
14
- import o from "element-ui/lib/select";
15
- import { d as h, n as m } from "../chunks/index.MAFc4eFi.mjs";
16
- import { n as y } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
17
- const d = Object.keys(o.props || o.default.props).filter((r) => !["value", "placeholder", "disabled"].includes(r)), _ = {
1
+ import { f as o } from "../chunks/form-input.B8z37eqj.mjs";
2
+ import { f as l } from "../chunks/form-pick.BFTIVn_i.mjs";
3
+ import { d as n } from "../chunks/dictionary.DqiP9x2m.mjs";
4
+ import a from "element-ui/lib/select";
5
+ import { c as p, n as u } from "../chunks/index.d3MV3Wq2.mjs";
6
+ import { isString as h, isPlainObject as m, isNumber as f } from "@web-utils/core";
7
+ import { n as c } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
8
+ const d = Object.keys(a.props).filter((e) => !["value", "placeholder", "disabled"].includes(e)), b = {
18
9
  name: "FormSelect",
19
- mixins: [c, f],
10
+ mixins: [o, l, n],
20
11
  props: {
21
12
  options: {
22
13
  type: Array,
23
14
  default: () => []
24
15
  },
25
16
  gender: Boolean,
17
+ year: [Boolean, Number],
26
18
  all: Boolean,
27
19
  filterable: Boolean,
28
20
  confirm: Boolean,
29
- value: {
30
- type: [String, Number]
31
- },
32
- labelProp: {
33
- type: String,
34
- default: "name"
35
- },
36
- valueProp: {
37
- type: String,
38
- default: "code"
39
- },
21
+ start: Number,
22
+ end: Number,
23
+ value: [String, Number, Array],
24
+ optionLabel: [String, Number],
25
+ emitLabel: Boolean,
40
26
  english: Boolean,
41
27
  chinese: Boolean,
42
28
  typing: Boolean,
43
- classic: Boolean
29
+ remote: Boolean,
30
+ allowCreate: Boolean,
31
+ remoteMethod: Function,
32
+ props: {
33
+ type: Object,
34
+ default: () => ({
35
+ label: "label",
36
+ value: "value"
37
+ })
38
+ },
39
+ multiple: Boolean,
40
+ multipleLimit: {
41
+ type: Number,
42
+ default: 0
43
+ },
44
+ multipleStringMode: Boolean,
45
+ multipleStringSeparator: {
46
+ type: String,
47
+ default: ","
48
+ }
49
+ },
50
+ data() {
51
+ return {
52
+ loading: !1,
53
+ remoteOptions: [],
54
+ innerValue: null
55
+ };
44
56
  },
45
57
  computed: {
46
58
  prefix() {
47
59
  return "请选择";
48
60
  },
49
- labelKey() {
50
- return this.classic ? "label" : this.labelProp;
51
- },
52
- valueKey() {
53
- return this.classic ? "value" : this.valueProp;
54
- },
55
61
  inputProps() {
56
- return h(i(i({}, m(this.$attrs)), this.$props), d);
62
+ return p({ ...u(this.$attrs), ...this.$props }, d);
57
63
  },
58
64
  innerOptions() {
59
- return this.gender ? [
60
- {
61
- [this.labelKey]: "男",
62
- [this.valueKey]: this.chinese ? "男" : this.typing ? 1 : "1"
63
- },
64
- {
65
- [this.labelKey]: "女",
66
- [this.valueKey]: this.chinese ? "" : this.typing ? 2 : "2"
67
- }
68
- ] : this.confirm ? [
69
- {
70
- [this.labelKey]: "",
71
- [this.valueKey]: this.chinese ? "" : this.english ? "Y" : this.typing ? 1 : "1"
72
- },
73
- {
74
- [this.labelKey]: "否",
75
- [this.valueKey]: this.chinese ? "否" : this.english ? "N" : this.typing ? 0 : "0"
65
+ if (this.dictType)
66
+ return this.dictItems;
67
+ if (this.remote)
68
+ return this.remoteOptions;
69
+ if (this.gender)
70
+ return [
71
+ {
72
+ [this.props.label]: "",
73
+ [this.props.value]: this.chinese ? "男" : this.typing ? 1 : "1"
74
+ },
75
+ {
76
+ [this.props.label]: "",
77
+ [this.props.value]: this.chinese ? "" : this.typing ? 2 : "2"
78
+ }
79
+ ];
80
+ if (this.confirm)
81
+ return [
82
+ {
83
+ [this.props.label]: "是",
84
+ [this.props.value]: this.chinese ? "是" : this.english ? "Y" : this.typing ? 1 : "1"
85
+ },
86
+ {
87
+ [this.props.label]: "否",
88
+ [this.props.value]: this.chinese ? "否" : this.english ? "N" : this.typing ? 0 : "0"
89
+ }
90
+ ];
91
+ if (this.all)
92
+ return [{ [this.props.value]: "", [this.props.label]: "全部" }, ...this.options];
93
+ if (this.start && this.end)
94
+ return Array(this.end - this.start + 1).fill(1).map((e, t) => ({
95
+ [this.props.label]: this.start + t,
96
+ [this.props.value]: this.start + t
97
+ }));
98
+ if (this.year) {
99
+ const e = (/* @__PURE__ */ new Date()).getFullYear(), t = [];
100
+ let i = 10;
101
+ f(this.year) && (i = this.year);
102
+ for (let r = -i; r <= i; r++) {
103
+ const s = e + r;
104
+ t.push({
105
+ [this.props.label]: s,
106
+ [this.props.value]: s
107
+ });
76
108
  }
77
- ] : this.all ? [{ [this.valueKey]: "", [this.labelKey]: "全部" }, ...this.options] : this.options;
109
+ return t;
110
+ }
111
+ return this.options ? this.options.map((e) => (e[this.props.value] = e[this.props.value] ?? e[this.props.label], e)) : [];
112
+ }
113
+ },
114
+ watch: {
115
+ value: {
116
+ immediate: !0,
117
+ handler(e) {
118
+ this.multiple && this.multipleStringMode ? this.innerValue = e == null ? void 0 : e.split(",").filter((t) => t) : this.innerValue = e;
119
+ }
78
120
  }
79
121
  },
122
+ created() {
123
+ this.reloadOptions();
124
+ },
80
125
  methods: {
81
- emitInput(r) {
82
- this.$emit("input", r);
126
+ reloadOptions() {
127
+ this.remote && this.fetchOptions();
128
+ },
129
+ async fetchOptions(e) {
130
+ var t;
131
+ try {
132
+ this.loading = !0;
133
+ const i = await this.remoteMethod(e, this.prop);
134
+ ((t = i.data.data) == null ? void 0 : t.length) >= 0 ? h(i.data.data[0]) ? this.remoteOptions = i.data.data.map((r) => ({ [this.props.value]: r, [this.props.label]: r })) : m(i.data.data[0]) && (this.remoteOptions = i.data.data) : this.remoteOptions = [];
135
+ } catch {
136
+ }
137
+ this.loading = !1;
138
+ },
139
+ emitInput(e) {
140
+ if (this.multiple && this.multipleStringMode ? this.$emit("input", e.join(this.multipleStringSeparator)) : this.$emit("input", e), this.emitLabel) {
141
+ const t = this.innerOptions.find((r) => r[this.props.value] === e), i = t == null ? void 0 : t[this.props.label];
142
+ i !== this.optionLabel && this.$emit("update:optionLabel", i);
143
+ }
83
144
  }
84
145
  }
85
146
  };
86
- var b = function() {
87
- var e = this, t = e._self._c;
88
- return t("FormItem", e._b({ attrs: { rules: e.computeRules, disabled: e.inputDisabled }, scopedSlots: e._u([{ key: "default", fn: function() {
89
- return [t("ElSelect", e._g(e._b({ attrs: { value: e.value, filterable: e.filterable, placeholder: e.inputDisabled ? "--" : e.computePlaceholder, disabled: e.inputDisabled }, on: { input: e.emitInput } }, "ElSelect", e.inputProps, !1), e.listeners), e._l(e.innerOptions, function(l) {
90
- return t("ElOption", { key: l[e.valueKey], attrs: { value: l[e.valueKey], label: l[e.labelKey] } });
91
- }), 1), e.$slots.warn ? t("div", { staticClass: "el-form-item__warn" }, [e._t("warn")], 2) : e._e()];
92
- }, proxy: !0 }, { key: "error", fn: function({ error: l }) {
93
- return [e.$scopedSlots.error && e.$scopedSlots.error(l) ? t("div", { staticClass: "el-form-item__error" }, [e._t("error", function() {
94
- return [e._v(" " + e._s(l) + " ")];
95
- }, { error: l })], 2) : e._e()];
147
+ var y = function() {
148
+ var t = this, i = t._self._c;
149
+ return i("FormItem", t._b({ attrs: { rules: t.computeRules, disabled: t.inputDisabled }, scopedSlots: t._u([{ key: "default", fn: function() {
150
+ return [i("ElSelect", t._g(t._b({ attrs: { value: t.innerValue, filterable: t.filterable || !!t.year, placeholder: t.inputDisabled ? "--" : t.computePlaceholder, "allow-create": t.allowCreate || !!t.year, disabled: t.inputDisabled, multiple: t.multiple, "multiple-limit": t.multipleLimit, loading: t.loading, remote: t.remote, "remote-method": t.fetchOptions, clearable: "" }, on: { clear: t.reloadOptions, input: t.emitInput } }, "ElSelect", t.inputProps, !1), t.listeners), [t._t("default", function() {
151
+ return [t._l(t.innerOptions, function(r) {
152
+ return [t._t("option", function() {
153
+ return [i("ElOption", { key: r[t.props.value], attrs: { value: r[t.props.value], label: r[t.props.label] } })];
154
+ }, { value: r[t.props.value], label: r[t.props.label] })];
155
+ })];
156
+ })], 2), t.$slots.warn ? i("div", { staticClass: "el-form-item__warn" }, [t._t("warn")], 2) : t._e()];
157
+ }, proxy: !0 }, { key: "error", fn: function({ error: r }) {
158
+ return [t.$scopedSlots.error && t.$scopedSlots.error(r) ? i("div", { staticClass: "el-form-item__error" }, [t._t("error", function() {
159
+ return [t._v(t._s(r))];
160
+ }, { error: r })], 2) : t._e()];
96
161
  } }, { key: "label", fn: function() {
97
- return [e._t("label")];
162
+ return [t._t("label")];
98
163
  }, proxy: !0 }, { key: "below", fn: function() {
99
- return [e._t("below")];
100
- }, proxy: !0 }], null, !0) }, "FormItem", e.formItemProps, !1));
101
- }, v = [], K = /* @__PURE__ */ y(
102
- _,
164
+ return [t._t("below")];
165
+ }, proxy: !0 }, { key: "tips", fn: function() {
166
+ return [t._t("tips")];
167
+ }, proxy: !0 }], null, !0) }, "FormItem", t.formItemProps, !1));
168
+ }, _ = [], g = /* @__PURE__ */ c(
103
169
  b,
104
- v,
170
+ y,
171
+ _,
105
172
  !1,
106
173
  null,
107
174
  null
108
175
  );
109
- const I = K.exports;
176
+ const P = g.exports;
110
177
  export {
111
- I as default
178
+ P as default
112
179
  };
@@ -0,0 +1 @@
1
+ .el-select{width:100%}
@@ -1,59 +1,54 @@
1
- var u = Object.defineProperty;
2
- var o = Object.getOwnPropertySymbols;
3
- var a = Object.prototype.hasOwnProperty, p = 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, n = (r, e) => {
5
- for (var t in e || (e = {}))
6
- a.call(e, t) && l(r, t, e[t]);
7
- if (o)
8
- for (var t of o(e))
9
- p.call(e, t) && l(r, t, e[t]);
10
- return r;
11
- };
12
- import { f as c } from "../chunks/form-input-mixin.BkKiqJhi.mjs";
13
- import s from "element-ui/lib/switch";
14
- import { d as m, n as d } from "../chunks/index.MAFc4eFi.mjs";
15
- import { n as f } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
16
- const _ = Object.keys(s.props || s.default.props).filter((r) => !["value", "placeholder", "disabled"].includes(r)), y = {
1
+ import { f as o } from "../chunks/form-input.B8z37eqj.mjs";
2
+ import l from "element-ui/lib/switch";
3
+ import { c as a, n as u } from "../chunks/index.d3MV3Wq2.mjs";
4
+ import { n as i } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
5
+ const s = Object.keys(l.props).filter((t) => !["value", "placeholder", "disabled"].includes(t)), p = {
17
6
  name: "FormSwitch",
18
- mixins: [c],
7
+ mixins: [o],
19
8
  props: {
20
- value: {
21
- type: [String, Number, Boolean]
9
+ value: [String, Number, Boolean],
10
+ activeValue: {
11
+ type: [Boolean, String, Number],
12
+ default: "Y"
13
+ },
14
+ inactiveValue: {
15
+ type: [Boolean, String, Number],
16
+ default: "N"
22
17
  }
23
18
  },
24
19
  computed: {
25
20
  inputProps() {
26
- return m(n(n({}, d(this.$attrs)), this.$props), _);
21
+ return a({ ...u(this.$attrs), ...this.$props }, s);
27
22
  }
28
23
  },
29
24
  methods: {
30
- emitInput(r) {
31
- this.$emit("input", r);
25
+ emitInput(t) {
26
+ this.$emit("input", t);
32
27
  }
33
28
  }
34
29
  };
35
- var h = function() {
36
- var e = this, t = e._self._c;
37
- return t("FormItem", e._b({ attrs: { rules: e.computeRules, disabled: e.inputDisabled }, scopedSlots: e._u([{ key: "default", fn: function() {
30
+ var c = function() {
31
+ var e = this, r = e._self._c;
32
+ return r("FormItem", e._b({ attrs: { rules: e.computeRules, disabled: e.inputDisabled }, scopedSlots: e._u([{ key: "default", fn: function() {
38
33
  return [e._t("default", function() {
39
- return [t("ElSwitch", e._g(e._b({ class: { "is-readonly": e.readonly }, attrs: { "active-value": "Y", "inactive-value": "N", value: e.value, readonly: e.readonly, disabled: e.inputDisabled, placeholder: e.computePlaceholder }, on: { input: e.emitInput }, scopedSlots: e._u([{ key: "append", fn: function() {
34
+ return [r("ElSwitch", e._g(e._b({ class: { "is-readonly": e.readonly }, attrs: { "active-value": e.activeValue, "inactive-value": e.inactiveValue, value: e.value, readonly: e.readonly, disabled: e.inputDisabled, placeholder: e.computePlaceholder }, on: { input: e.emitInput }, scopedSlots: e._u([{ key: "append", fn: function() {
40
35
  return [e._t("append")];
41
36
  }, proxy: !0 }], null, !0) }, "ElSwitch", e.inputProps, !1), e.listeners))];
42
37
  })];
43
- }, proxy: !0 }, { key: "error", fn: function({ error: i }) {
44
- return [e._t("error", null, { error: i })];
38
+ }, proxy: !0 }, { key: "error", fn: function({ error: n }) {
39
+ return [e._t("error", null, { error: n })];
45
40
  } }, { key: "label", fn: function() {
46
41
  return [e._t("label")];
47
42
  }, proxy: !0 }], null, !0) }, "FormItem", e.formItemProps, !1));
48
- }, v = [], b = /* @__PURE__ */ f(
49
- y,
50
- h,
51
- v,
43
+ }, m = [], d = /* @__PURE__ */ i(
44
+ p,
45
+ c,
46
+ m,
52
47
  !1,
53
48
  null,
54
49
  null
55
50
  );
56
- const w = b.exports;
51
+ const b = d.exports;
57
52
  export {
58
- w as default
53
+ b as default
59
54
  };
@@ -0,0 +1,85 @@
1
+ import { f as a } from "../chunks/form-input.B8z37eqj.mjs";
2
+ import { c as s, n as d } from "../chunks/index.d3MV3Wq2.mjs";
3
+ import c from "../sub-table/index.mjs";
4
+ import { n as m } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
5
+ const i = Object.keys(c.props).filter((l) => !["value", "placeholder", "disabled"].includes(l)), p = {
6
+ name: "FormTable",
7
+ mixins: [a],
8
+ emits: ["add-row"],
9
+ props: {
10
+ value: Array,
11
+ columns: Array,
12
+ allowEmpty: Boolean,
13
+ handleColumn: {
14
+ type: Boolean,
15
+ default: !0
16
+ },
17
+ block: {
18
+ type: Boolean,
19
+ default: !0
20
+ },
21
+ editable: Boolean,
22
+ showHandleColumnAddButton: {
23
+ type: Boolean,
24
+ default: !0
25
+ },
26
+ showEmptyAddButton: {
27
+ type: Boolean,
28
+ default: !0
29
+ },
30
+ status: {
31
+ type: [Number, String],
32
+ default: ""
33
+ }
34
+ },
35
+ data() {
36
+ return {
37
+ selectedRows: []
38
+ };
39
+ },
40
+ computed: {
41
+ inputProps() {
42
+ return s({ ...d(this.$attrs), ...this.$props }, i);
43
+ }
44
+ },
45
+ methods: {
46
+ onSelectionChange(l) {
47
+ this.selectedRows = l;
48
+ }
49
+ }
50
+ };
51
+ var f = function() {
52
+ var e = this, r = e._self._c;
53
+ return r("FormItem", e._b({ attrs: { block: e.block, rules: e.computeRules, disabled: e.inputDisabled }, scopedSlots: e._u([{ key: "default", fn: function() {
54
+ return [r("SubTable", e._g(e._b({ class: { "is-readonly": e.readonly }, attrs: { status: e.status, value: e.value, prop: e.prop, editable: e.editable, columns: e.columns, readonly: e.readonly, "allow-empty": e.allowEmpty, disabled: e.inputDisabled, "handle-column": e.handleColumn, "show-handle-column-add-button": e.showHandleColumnAddButton, "show-empty-add-button": e.showEmptyAddButton, placeholder: e.computePlaceholder }, on: { "selection-change": e.onSelectionChange, input: (n) => e.$emit("input", n) }, scopedSlots: e._u([e._l(e.columns, function(n) {
55
+ return { key: n.prop, fn: function({ row: o, column: t, index: u }) {
56
+ return [e._t(n.prop, null, { row: o, column: t, index: u })];
57
+ } };
58
+ }), { key: "columns", fn: function({ columns: n }) {
59
+ return [e._t("columns", null, { columns: n })];
60
+ } }, { key: "handle", fn: function({ add: n, remove: o }) {
61
+ return [e._t("handle", null, { add: n, remove: o })];
62
+ } }, { key: "tag", fn: function({ column: n, row: o, $index: t }) {
63
+ return [e._t("tag", null, { row: o, column: n, index: t })];
64
+ } }, { key: "handle-column-header", fn: function({ column: n, $index: o }) {
65
+ return [e._t("handle-column-header", null, { column: n, index: o })];
66
+ } }, { key: "toolbar", fn: function({ addRow: n, delRow: o, refresh: t }) {
67
+ return [e._t("toolbar", null, { addRow: n, delRow: o, refresh: t })];
68
+ } }], null, !0) }, "SubTable", e.inputProps, !1), e.listeners))];
69
+ }, proxy: !0 }, { key: "error", fn: function({ error: n }) {
70
+ return [e._t("error", null, { error: n })];
71
+ } }, { key: "label", fn: function() {
72
+ return [e._t("label")];
73
+ }, proxy: !0 }], null, !0) }, "FormItem", e.formItemProps, !1));
74
+ }, y = [], b = /* @__PURE__ */ m(
75
+ p,
76
+ f,
77
+ y,
78
+ !1,
79
+ null,
80
+ null
81
+ );
82
+ const B = b.exports;
83
+ export {
84
+ B as default
85
+ };