@web-utils/component 4.0.0 → 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 (171) 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/form-input.B8z37eqj.mjs +31 -0
  19. package/chunks/form-item.D-H-wCPE.mjs +233 -0
  20. package/chunks/form-validate.CVarNHKX.mjs +12 -0
  21. package/chunks/helper.BiMLcEEk.mjs +41 -0
  22. package/chunks/index.9OxHjTIE.mjs +16 -0
  23. package/chunks/{index.MAFc4eFi.mjs → index.d3MV3Wq2.mjs} +43 -47
  24. package/chunks/sub-table-plus-props.BVsD71hT.mjs +30 -0
  25. package/chunks/{tab-mixin.CVr9bZtn.mjs → tab-mixin.BNK6dxLN.mjs} +1 -1
  26. package/chunks/utilSelf.Csq1766E.mjs +48 -0
  27. package/color-picker/index.mjs +19 -37
  28. package/comment/style.css +1 -1
  29. package/confirm-button/index.mjs +1 -1
  30. package/confirmable/index.mjs +1 -1
  31. package/context-menu/style.css +1 -1
  32. package/count-up/index.mjs +13 -24
  33. package/custom-scrollbar/index.mjs +1 -2
  34. package/data-operatext/style.css +1 -1
  35. package/data-panel/style.css +1 -1
  36. package/data-pay/style.css +1 -1
  37. package/data-price/style.css +1 -1
  38. package/data-rotate/style.css +1 -1
  39. package/data-table-picker/index.mjs +1 -1
  40. package/data-tabs/style.css +1 -1
  41. package/dialog-form/index.mjs +16 -28
  42. package/dynamic-table/style.css +1 -1
  43. package/easy-popup/index.mjs +22 -40
  44. package/easy-popup/style.css +1 -1
  45. package/editable-tree/index.mjs +203 -250
  46. package/editable-tree/style.css +1 -1
  47. package/element-dialog/index.mjs +30 -52
  48. package/element-dialog/style.css +1 -1
  49. package/flex-column/index.mjs +13 -25
  50. package/flex-item/index.mjs +15 -27
  51. package/flex-row/index.mjs +13 -25
  52. package/flow-designer/index.mjs +343 -374
  53. package/flow-designer/style.css +1 -1
  54. package/flow-viewer/index.mjs +64 -91
  55. package/form-block/index.mjs +33 -26
  56. package/form-card/index.mjs +25 -0
  57. package/form-cascader/index.mjs +70 -67
  58. package/form-checkbox/index.mjs +71 -0
  59. package/form-checkbox-group/index.mjs +33 -53
  60. package/form-date-picker/index.mjs +44 -73
  61. package/form-holder/index.mjs +54 -40
  62. package/form-holder/style.css +1 -0
  63. package/form-input/index.mjs +62 -40
  64. package/form-input-cron-expression/index.mjs +77 -0
  65. package/form-input-cron-expression/style.css +1 -0
  66. package/form-input-email/index.mjs +21 -33
  67. package/form-input-id-card/index.mjs +25 -38
  68. package/form-input-number/index.mjs +39 -42
  69. package/form-input-number/style.css +1 -1
  70. package/form-input-phone-number/index.mjs +26 -37
  71. package/form-input-tag/index.mjs +32 -34
  72. package/form-input-time/index.mjs +22 -37
  73. package/form-item/index.mjs +109 -101
  74. package/form-item/style.css +1 -1
  75. package/form-item-config-provider/index.mjs +18 -10
  76. package/form-item-group/index.mjs +73 -69
  77. package/form-item-group/style.css +1 -1
  78. package/form-radio-group/index.mjs +41 -36
  79. package/form-radio-group/style.css +1 -1
  80. package/form-select/index.mjs +142 -75
  81. package/form-select/style.css +1 -0
  82. package/form-switch/index.mjs +29 -34
  83. package/form-table/index.mjs +85 -0
  84. package/form-table-plus/index.mjs +109 -0
  85. package/form-textarea/index.mjs +23 -35
  86. package/form-tree-select/index.mjs +72 -0
  87. package/form-tree-select/style.css +1 -0
  88. package/form-tree-select-multiple/index.mjs +78 -0
  89. package/form-view/index.mjs +37 -69
  90. package/form-view/style.css +1 -1
  91. package/fy-curd/index.mjs +131 -140
  92. package/fy-curd/style.css +1 -1
  93. package/fy-draggable/index.mjs +16 -26
  94. package/fy-draggable/style.css +1 -1
  95. package/fy-dynamic/index.mjs +48 -57
  96. package/fy-empty/style.css +1 -1
  97. package/fy-form/style.css +1 -1
  98. package/fy-form-design/index.mjs +314 -339
  99. package/fy-form-design/style.css +1 -1
  100. package/fy-input-map/index.mjs +40 -50
  101. package/fy-input-map/style.css +1 -1
  102. package/fy-input-table/index.mjs +31 -41
  103. package/fy-u-editor/index.mjs +77 -103
  104. package/fy-upload/style.css +1 -1
  105. package/highlight-j-s/style.css +1 -1
  106. package/image-cropper/index.mjs +14 -65
  107. package/image-preview/index.mjs +17 -45
  108. package/image-preview/style.css +1 -1
  109. package/image-viewer/style.css +1 -1
  110. package/index.mjs +666 -496
  111. package/input-number/index.mjs +64 -9
  112. package/keyboard/style.css +1 -1
  113. package/monaco-editor/index.mjs +43 -71
  114. package/name-avatar/style.css +1 -1
  115. package/package.json +5 -4
  116. package/page-index/index.mjs +30 -54
  117. package/page-index-top/index.mjs +25 -47
  118. package/pageable-table/index.mjs +353 -221
  119. package/pageable-table/style.css +1 -1
  120. package/pageable-view/index.mjs +56 -95
  121. package/photo-swipe/index.mjs +51 -74
  122. package/picker-table-view/index.mjs +117 -0
  123. package/present-view/index.mjs +43 -77
  124. package/present-view/style.css +1 -1
  125. package/resize-observer/index.mjs +1 -1
  126. package/resize-observer/style.css +1 -1
  127. package/search/style.css +1 -1
  128. package/search-popover/index.mjs +28 -48
  129. package/search-popover/style.css +1 -1
  130. package/sign/index.mjs +1 -1
  131. package/sign-panel/style.css +1 -1
  132. package/skeleton-panel/index.mjs +38 -0
  133. package/skeleton-panel/style.css +1 -0
  134. package/split-pane/index.mjs +31 -49
  135. package/split-pane/style.css +1 -1
  136. package/sub-table/index.mjs +206 -0
  137. package/sub-table/style.css +1 -0
  138. package/sub-table-plus/index.mjs +231 -0
  139. package/sub-table-plus/style.css +1 -0
  140. package/swiper/index.mjs +18 -38
  141. package/swiper/style.css +1 -1
  142. package/tab/index.mjs +1 -1
  143. package/tab/style.css +1 -1
  144. package/tab-item/index.mjs +2 -2
  145. package/table-column/index.mjs +112 -37
  146. package/table-column/style.css +1 -0
  147. package/table-view/index.mjs +177 -132
  148. package/table-view/style.css +1 -1
  149. package/tabs-view/index.mjs +104 -0
  150. package/tabs-view/style.css +1 -0
  151. package/tag-render/index.mjs +13 -24
  152. package/toolbar/index.mjs +115 -58
  153. package/toolbar/style.css +1 -1
  154. package/toolbar-button/index.mjs +92 -48
  155. package/vue-cron/index.mjs +47 -65
  156. package/vue-qr-code/index.mjs +14 -32
  157. package/vue-quill-editor/index.mjs +13 -24
  158. package/vue-tags-input/index.mjs +10 -21
  159. package/vue-tree-select/index.mjs +352 -393
  160. package/vue-tree-select/style.css +1 -1
  161. package/vue-video-player/index.mjs +34 -63
  162. package/watermark/index.mjs +21 -31
  163. package/web-types.json +9240 -3840
  164. package/x-input-tag/index.mjs +29 -61
  165. package/chunks/confirmable-mixin.D4LAArE5.mjs +0 -114
  166. package/chunks/form-input-mixin.BkKiqJhi.mjs +0 -24
  167. package/chunks/form-item-mixin.CG4ZwzMC.mjs +0 -140
  168. package/chunks/input-number-mixin.CzjtGf2n.mjs +0 -60
  169. package/chunks/utilSelf.CRqpl0Cz.mjs +0 -56
  170. package/toolbar-button/style.css +0 -1
  171. /package/chunks/{form-pick-mixin.BFTIVn_i.mjs → form-pick.BFTIVn_i.mjs} +0 -0
@@ -1,36 +1,8 @@
1
- var b = Object.defineProperty, h = Object.defineProperties;
2
- var v = Object.getOwnPropertyDescriptors;
3
- var c = Object.getOwnPropertySymbols;
4
- var y = Object.prototype.hasOwnProperty, E = Object.prototype.propertyIsEnumerable;
5
- var u = (r, e, t) => e in r ? b(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, d = (r, e) => {
6
- for (var t in e || (e = {}))
7
- y.call(e, t) && u(r, t, e[t]);
8
- if (c)
9
- for (var t of c(e))
10
- E.call(e, t) && u(r, t, e[t]);
11
- return r;
12
- }, F = (r, e) => h(r, v(e));
13
- var n = (r, e, t) => new Promise((i, s) => {
14
- var l = (o) => {
15
- try {
16
- m(t.next(o));
17
- } catch (p) {
18
- s(p);
19
- }
20
- }, a = (o) => {
21
- try {
22
- m(t.throw(o));
23
- } catch (p) {
24
- s(p);
25
- }
26
- }, m = (o) => o.done ? i(o.value) : Promise.resolve(o.value).then(l, a);
27
- m((t = t.apply(r, e)).next());
28
- });
29
- import { c as x, u as f } from "./utils.DRcxC1Fb.mjs";
30
- import { i as g, a as L, f as T, l as k, e as _ } from "./utilSelf.CRqpl0Cz.mjs";
31
- import { fastClone as I } from "@web-utils/core";
32
- import { n as w } from "./_plugin-vue2_normalizer.CeySl7Fu.mjs";
33
- const O = {
1
+ import { c as o, u as n } from "./utils.DRcxC1Fb.mjs";
2
+ import { i as a, a as m, f as p, l as c, e as u } from "./utilSelf.Csq1766E.mjs";
3
+ import { fastClone as d } from "@web-utils/core";
4
+ import { n as F } from "./_plugin-vue2_normalizer.CeySl7Fu.mjs";
5
+ const f = {
34
6
  name: "UserTaskListeners",
35
7
  inject: {
36
8
  prefix: "prefix",
@@ -44,11 +16,11 @@ const O = {
44
16
  data() {
45
17
  return {
46
18
  elementListenersList: [],
47
- listenerEventTypeObject: _,
48
- listenerTypeObject: k,
19
+ listenerEventTypeObject: u,
20
+ listenerTypeObject: c,
49
21
  listenerFormModelVisible: !1,
50
22
  listenerForm: {},
51
- fieldTypeObject: T,
23
+ fieldTypeObject: p,
52
24
  fieldsListOfListener: [],
53
25
  listenerFieldFormModelVisible: !1,
54
26
  // 监听器 注入字段表单弹窗 显示状态
@@ -63,69 +35,56 @@ const O = {
63
35
  watch: {
64
36
  id: {
65
37
  immediate: !0,
66
- handler(r) {
67
- return n(this, null, function* () {
68
- r && (yield this.$nextTick(), this.resetListenersList());
69
- });
38
+ async handler(r) {
39
+ r && (await this.$nextTick(), this.resetListenersList());
70
40
  }
71
41
  }
72
42
  },
73
43
  methods: {
74
44
  resetListenersList() {
75
- var r, e, t, i;
76
- this.otherExtensionList = [], this.bpmnElementListeners = (i = (t = (e = (r = this.element.businessObject) == null ? void 0 : r.extensionElements) == null ? void 0 : e.values) == null ? void 0 : t.filter((s) => s.$type === `${this.prefix}:TaskListener`)) != null ? i : [], this.elementListenersList = this.bpmnElementListeners.map((s) => L(s));
45
+ var r, e, t;
46
+ this.otherExtensionList = [], this.bpmnElementListeners = ((t = (e = (r = this.element.businessObject) == null ? void 0 : r.extensionElements) == null ? void 0 : e.values) == null ? void 0 : t.filter((i) => i.$type === `${this.prefix}:TaskListener`)) ?? [], this.elementListenersList = this.bpmnElementListeners.map((i) => m(i));
77
47
  },
78
- openListenerForm(r, e) {
79
- return n(this, null, function* () {
80
- var t;
81
- r ? (this.listenerForm = g(r), this.editingListenerIndex = e) : (this.listenerForm = {}, this.editingListenerIndex = -1), r && r.fields ? this.fieldsListOfListener = r.fields.map((i) => F(d({}, i), {
82
- fieldType: i.string ? "string" : "expression"
83
- })) : (this.fieldsListOfListener = [], this.$set(this.listenerForm, "fields", [])), this.listenerFormModelVisible = !0, yield this.$nextTick(), (t = this.$refs.listenerFormRef) == null || t.clearValidate();
84
- });
48
+ async openListenerForm(r, e) {
49
+ var t;
50
+ r ? (this.listenerForm = a(r), this.editingListenerIndex = e) : (this.listenerForm = {}, this.editingListenerIndex = -1), r && r.fields ? this.fieldsListOfListener = r.fields.map((i) => ({
51
+ ...i,
52
+ fieldType: i.string ? "string" : "expression"
53
+ })) : (this.fieldsListOfListener = [], this.$set(this.listenerForm, "fields", [])), this.listenerFormModelVisible = !0, await this.$nextTick(), (t = this.$refs.listenerFormRef) == null || t.clearValidate();
85
54
  },
86
55
  // 移除监听器
87
- removeListener(r, e) {
88
- return n(this, null, function* () {
89
- try {
90
- yield this.$confirm("确认移除该监听器吗?", "提示"), this.bpmnElementListeners.splice(e, 1), this.elementListenersList.splice(e, 1), f(this.bpmnInstances, this.element, this.otherExtensionList.concat(this.bpmnElementListeners));
91
- } catch (t) {
92
- }
93
- });
56
+ async removeListener(r, e) {
57
+ try {
58
+ await this.$confirm("确认移除该监听器吗?", "提示"), this.bpmnElementListeners.splice(e, 1), this.elementListenersList.splice(e, 1), n(this.bpmnInstances, this.element, this.otherExtensionList.concat(this.bpmnElementListeners));
59
+ } catch {
60
+ }
94
61
  },
95
62
  // 保存监听器
96
- saveListenerConfig() {
97
- return n(this, null, function* () {
98
- var t, i, s, l;
99
- if (!(yield this.$refs.listenerFormRef.validate())) return;
100
- const e = x(this.bpmnInstances, this.listenerForm, !0, this.prefix);
101
- this.editingListenerIndex === -1 ? (this.bpmnElementListeners.push(e), this.elementListenersList.push(this.listenerForm)) : (this.bpmnElementListeners.splice(this.editingListenerIndex, 1, e), this.elementListenersList.splice(this.editingListenerIndex, 1, this.listenerForm)), this.otherExtensionList = (l = (s = (i = (t = this.element.businessObject) == null ? void 0 : t.extensionElements) == null ? void 0 : i.values) == null ? void 0 : s.filter((a) => a.$type !== `${this.prefix}:TaskListener`)) != null ? l : [], f(this.bpmnInstances, this.element, this.otherExtensionList.concat(this.bpmnElementListeners)), this.listenerFormModelVisible = !1, this.listenerForm = {};
102
- });
63
+ async saveListenerConfig() {
64
+ var t, i, s;
65
+ if (!await this.$refs.listenerFormRef.validate()) return;
66
+ const e = o(this.bpmnInstances, this.listenerForm, !0, this.prefix);
67
+ this.editingListenerIndex === -1 ? (this.bpmnElementListeners.push(e), this.elementListenersList.push(this.listenerForm)) : (this.bpmnElementListeners.splice(this.editingListenerIndex, 1, e), this.elementListenersList.splice(this.editingListenerIndex, 1, this.listenerForm)), this.otherExtensionList = ((s = (i = (t = this.element.businessObject) == null ? void 0 : t.extensionElements) == null ? void 0 : i.values) == null ? void 0 : s.filter((l) => l.$type !== `${this.prefix}:TaskListener`)) ?? [], n(this.bpmnInstances, this.element, this.otherExtensionList.concat(this.bpmnElementListeners)), this.listenerFormModelVisible = !1, this.listenerForm = {};
103
68
  },
104
69
  // 打开监听器字段编辑弹窗
105
- openListenerFieldForm(r, e) {
106
- return n(this, null, function* () {
107
- var t;
108
- this.listenerFieldForm = r ? I(r) : {}, this.editingListenerFieldIndex = r ? e : -1, this.listenerFieldFormModelVisible = !0, yield this.$nextTick(), (t = this.$refs.listenerFieldFormRef) == null || t.clearValidate();
109
- });
70
+ async openListenerFieldForm(r, e) {
71
+ var t;
72
+ this.listenerFieldForm = r ? d(r) : {}, this.editingListenerFieldIndex = r ? e : -1, this.listenerFieldFormModelVisible = !0, await this.$nextTick(), (t = this.$refs.listenerFieldFormRef) == null || t.clearValidate();
110
73
  },
111
74
  // 保存监听器注入字段
112
- saveListenerFiled() {
113
- return n(this, null, function* () {
114
- (yield this.$refs.listenerFieldFormRef.validate()) && (this.editingListenerFieldIndex === -1 ? (this.fieldsListOfListener.push(this.listenerFieldForm), this.listenerForm.fields.push(this.listenerFieldForm)) : (this.fieldsListOfListener.splice(this.editingListenerFieldIndex, 1, this.listenerFieldForm), this.listenerForm.fields.splice(this.editingListenerFieldIndex, 1, this.listenerFieldForm)), this.listenerFieldFormModelVisible = !1, yield this.$nextTick(), this.listenerFieldForm = {});
115
- });
75
+ async saveListenerFiled() {
76
+ await this.$refs.listenerFieldFormRef.validate() && (this.editingListenerFieldIndex === -1 ? (this.fieldsListOfListener.push(this.listenerFieldForm), this.listenerForm.fields.push(this.listenerFieldForm)) : (this.fieldsListOfListener.splice(this.editingListenerFieldIndex, 1, this.listenerFieldForm), this.listenerForm.fields.splice(this.editingListenerFieldIndex, 1, this.listenerFieldForm)), this.listenerFieldFormModelVisible = !1, await this.$nextTick(), this.listenerFieldForm = {});
116
77
  },
117
78
  // 移除监听器字段
118
- removeListenerField(r, e) {
119
- return n(this, null, function* () {
120
- try {
121
- yield this.$confirm("确认移除该字段吗?", "提示"), this.fieldsListOfListener.splice(e, 1), this.listenerForm.fields.splice(e, 1);
122
- } catch (t) {
123
- }
124
- });
79
+ async removeListenerField(r, e) {
80
+ try {
81
+ await this.$confirm("确认移除该字段吗?", "提示"), this.fieldsListOfListener.splice(e, 1), this.listenerForm.fields.splice(e, 1);
82
+ } catch {
83
+ }
125
84
  }
126
85
  }
127
86
  };
128
- var $ = function() {
87
+ var b = function() {
129
88
  var e = this, t = e._self._c;
130
89
  return t("div", { staticClass: "panel-tab__content" }, [t("ElTable", { attrs: { data: e.elementListenersList, size: "mini", border: "" } }, [t("ElTableColumn", { attrs: { label: "序号", width: "50px", type: "index" } }), t("ElTableColumn", { attrs: { label: "事件类型", "min-width": "80px", "show-overflow-tooltip": "", formatter: (i) => e.listenerEventTypeObject[i.event] } }), t("ElTableColumn", { attrs: { label: "事件id", "min-width": "80px", prop: "id", "show-overflow-tooltip": "" } }), t("ElTableColumn", { attrs: { label: "监听器类型", "min-width": "80px", "show-overflow-tooltip": "", formatter: (i) => e.listenerTypeObject[i.listenerType] } }), t("ElTableColumn", { attrs: { label: "操作", width: "90px" }, scopedSlots: e._u([{ key: "default", fn: function({ row: i, $index: s }) {
131
90
  return [t("ElButton", { attrs: { size: "mini", type: "text" }, on: { click: function(l) {
@@ -196,15 +155,15 @@ var $ = function() {
196
155
  }, expression: "listenerFieldForm.string" } })], 1) : e._e(), e.listenerFieldForm.fieldType === "expression" ? t("ElFormItem", { key: "field-expression", attrs: { label: "表达式:", prop: "expression", rules: { required: !0, trigger: ["blur", "change"] } } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.listenerFieldForm.expression, callback: function(i) {
197
156
  e.$set(e.listenerFieldForm, "expression", i);
198
157
  }, expression: "listenerFieldForm.expression" } })], 1) : e._e()], 1)], 1)], 1);
199
- }, S = [], j = /* @__PURE__ */ w(
200
- O,
201
- $,
202
- S,
158
+ }, h = [], v = /* @__PURE__ */ F(
159
+ f,
160
+ b,
161
+ h,
203
162
  !1,
204
163
  null,
205
164
  null
206
165
  );
207
- const M = j.exports;
166
+ const L = v.exports;
208
167
  export {
209
- M as default
168
+ L as default
210
169
  };
@@ -0,0 +1,23 @@
1
+ import { isObject as u, isString as c } from "@web-utils/core";
2
+ const g = {
3
+ privilege: {
4
+ processButtons(e) {
5
+ return e.map((t) => {
6
+ var r, n;
7
+ if (u(t)) {
8
+ const o = t, s = {};
9
+ for (const i in o)
10
+ c(o[i]) && (s[i] = (n = (r = g.privilege) == null ? void 0 : r.hasAuthority) == null ? void 0 : n.call(r, o[i]));
11
+ return s;
12
+ }
13
+ return t;
14
+ });
15
+ },
16
+ hasAuthority(e) {
17
+ return !0;
18
+ }
19
+ }
20
+ };
21
+ export {
22
+ g
23
+ };
@@ -0,0 +1,85 @@
1
+ import d from "element-ui/lib/loading";
2
+ import y from "element-ui/lib/message-box";
3
+ import { isFunction as a } from "@web-utils/core";
4
+ async function v(t, e, n) {
5
+ const { stop: r, prevent: o, message: f, loadable: l, loadingText: x, confirmable: b, confirmType: T, confirmText: S, confirmTitle: w } = e;
6
+ r && t.stopPropagation(), o && t.preventDefault();
7
+ const { before: c, click: u, cancel: s, after: g } = n;
8
+ if (a(u))
9
+ try {
10
+ let i = !0;
11
+ if (a(c) && (i = await c(t)), i === !1)
12
+ return;
13
+ b && await (y.confirm || y.default.confirm)(f || S, {
14
+ type: T,
15
+ title: w
16
+ });
17
+ let m;
18
+ l && (m = (d.service || d.default.service)({
19
+ background: "rgba(0,0,0,0.3)",
20
+ text: x
21
+ }));
22
+ let p;
23
+ try {
24
+ p = await u(t);
25
+ } catch {
26
+ }
27
+ l && m.close(), a(g) && await g(t, p);
28
+ } catch (i) {
29
+ a(s) && await s(i);
30
+ }
31
+ }
32
+ const C = {
33
+ functional: !0,
34
+ props: {
35
+ stop: {
36
+ type: Boolean,
37
+ default: !0
38
+ },
39
+ prevent: {
40
+ type: Boolean,
41
+ default: !0
42
+ },
43
+ text: {
44
+ type: String,
45
+ default: ""
46
+ },
47
+ message: String,
48
+ confirmable: {
49
+ type: Boolean,
50
+ default: !0
51
+ },
52
+ confirmText: {
53
+ type: String,
54
+ default: "你确定要删除该记录吗?"
55
+ },
56
+ confirmType: {
57
+ type: String,
58
+ default: "warning"
59
+ },
60
+ confirmTitle: String,
61
+ loadable: Boolean,
62
+ loadingText: {
63
+ type: String,
64
+ default: "正在处理中请稍候..."
65
+ },
66
+ tag: {
67
+ type: String,
68
+ default: "i"
69
+ }
70
+ },
71
+ render(t, { props: e, data: n, children: r, listeners: o }) {
72
+ return t(
73
+ e.tag,
74
+ {
75
+ ...n,
76
+ on: { click: (f) => v(f, e, o) },
77
+ props: e
78
+ },
79
+ r || e.text
80
+ );
81
+ }
82
+ };
83
+ export {
84
+ C as c
85
+ };
@@ -0,0 +1,54 @@
1
+ import { hyphenate as f } from "@web-utils/core";
2
+ const a = (n) => {
3
+ const t = {};
4
+ for (const o in n)
5
+ t[f(o)] = n[o];
6
+ return t;
7
+ }, h = (n, t = "id", o = "label") => {
8
+ const i = [];
9
+ function e(s, c) {
10
+ if (!s) return;
11
+ const r = [...c, { [t]: s[t], [o]: s[o] }];
12
+ if (!s.children || s.children.length === 0) {
13
+ i.push(r);
14
+ return;
15
+ }
16
+ s.children.forEach((l) => {
17
+ e(l, r);
18
+ });
19
+ }
20
+ return n.forEach((s) => e(s, [])), i;
21
+ }, u = (n) => {
22
+ const t = [];
23
+ return n && (isArray(n) ? n.forEach((o) => {
24
+ isArray(o) ? t.push(...u(o)) : o && t.push(o);
25
+ }) : n && t.push(n)), t;
26
+ }, b = (n, t = "id", o = "label") => {
27
+ const i = [];
28
+ return h(n).forEach((e) => {
29
+ const s = [], c = [];
30
+ for (let r = 0; r < e.length; r++)
31
+ s.push(e[r][t]), c.push(e[r][o]);
32
+ i.push({
33
+ value: s.join("/"),
34
+ label: c.join("/")
35
+ });
36
+ }), i;
37
+ }, j = (n, t = "id", o = "label") => {
38
+ const i = {};
39
+ return h(n).forEach((e) => {
40
+ const s = [], c = [];
41
+ for (let r = 0; r < e.length; r++)
42
+ s.push(e[r][t]), c.push(e[r][o]);
43
+ i[s.join("/")] = {
44
+ value: s.join("/"),
45
+ label: c.join("/")
46
+ };
47
+ }), i;
48
+ };
49
+ export {
50
+ j as a,
51
+ a as b,
52
+ u as f,
53
+ b as t
54
+ };
@@ -0,0 +1,25 @@
1
+ const e = () => [], i = {
2
+ props: {
3
+ dictType: String
4
+ },
5
+ data() {
6
+ return {
7
+ dictItems: []
8
+ };
9
+ },
10
+ watch: {
11
+ dictType: {
12
+ immediate: !0,
13
+ async handler(t) {
14
+ t ? this.dictItems = await e(t, !0, {
15
+ treeDict: this.treeDict,
16
+ idAsValue: this.idAsValue,
17
+ labelAsValue: this.labelAsValue
18
+ }) : this.dictItems = [];
19
+ }
20
+ }
21
+ }
22
+ };
23
+ export {
24
+ i as d
25
+ };
@@ -0,0 +1,31 @@
1
+ import { f as r } from "./form-item.D-H-wCPE.mjs";
2
+ import { c as t } from "./index.d3MV3Wq2.mjs";
3
+ const o = {
4
+ name: "FormInput",
5
+ mixins: [r],
6
+ props: {
7
+ value: [Boolean, String, Array, Number, Object, Date],
8
+ readonly: Boolean,
9
+ disabled: Boolean
10
+ },
11
+ inject: {
12
+ formView: {
13
+ default: {}
14
+ }
15
+ },
16
+ computed: {
17
+ computePlaceholder() {
18
+ return this.formView.printing ? null : this.placeholder === !0 ? this.message : this.placeholder;
19
+ },
20
+ listeners() {
21
+ return t(this.$listeners, "input", !1);
22
+ },
23
+ inputDisabled() {
24
+ var e;
25
+ return (e = this.formHolder.enabledFields) != null && e.includes(this.prop) ? !1 : this.disabled || (this.elForm || {}).disabled;
26
+ }
27
+ }
28
+ };
29
+ export {
30
+ o as f
31
+ };
@@ -0,0 +1,233 @@
1
+ import { c as s } from "./index.d3MV3Wq2.mjs";
2
+ import u from "element-ui/lib/col";
3
+ import m from "element-ui/lib/form-item";
4
+ const p = ["span"], l = [...Object.keys(u.props)], d = l.filter((e) => !p.includes(e)), f = ["label", "prop", "rules", "labelWidth", "required"], a = [...Object.keys(m.props)], h = a.filter((e) => !f.includes(e)), c = [
5
+ "wrapCol",
6
+ "wrapFormItem",
7
+ "unwrap",
8
+ "prefixConfig",
9
+ "block",
10
+ "prefixPick",
11
+ "picker",
12
+ "half",
13
+ "tips",
14
+ "hideLabel",
15
+ "fixedSpan",
16
+ ...l,
17
+ ...a
18
+ ], o = ["disabled", "size", "statusIcon", "inlineMessage", "autoLabelWidth", "hideRequiredAsterisk", "$emit", "validate", "clearValidate"], b = ["$emit", "validate", "clearValidate"], S = {
19
+ name: "FormInput",
20
+ inject: {
21
+ elForm: {
22
+ default: {}
23
+ },
24
+ formItemGroup: {
25
+ default: {}
26
+ },
27
+ formHolder: {
28
+ default: {}
29
+ }
30
+ },
31
+ provide() {
32
+ return {
33
+ elForm: this.proxyForm,
34
+ formItemGroup: this
35
+ };
36
+ },
37
+ props: {
38
+ /**
39
+ * 是否作为内嵌使用
40
+ */
41
+ embed: Boolean,
42
+ /**
43
+ * 是否禁用
44
+ */
45
+ disabled: Boolean,
46
+ /**
47
+ * 是否固定栏数
48
+ */
49
+ fixedSpan: Number,
50
+ /**
51
+ * 是否被列组件包裹
52
+ */
53
+ wrapCol: {
54
+ type: Boolean,
55
+ default: !0
56
+ },
57
+ /**
58
+ * 是否被表单项组件包裹
59
+ */
60
+ wrapFormItem: {
61
+ type: Boolean,
62
+ default: !0
63
+ },
64
+ /**
65
+ * 是否不用列组件包裹
66
+ */
67
+ unwrap: Boolean,
68
+ /**
69
+ * 是否占一半宽度
70
+ */
71
+ half: Boolean,
72
+ /**
73
+ * placeholder 添加"配置"前缀
74
+ */
75
+ prefixConfig: Boolean,
76
+ /**
77
+ * placeholder 添加"添加"前缀
78
+ */
79
+ prefixAdd: Boolean,
80
+ /**
81
+ * placeholder 添加"选择"前缀
82
+ */
83
+ prefixPick: Boolean,
84
+ /**
85
+ * 是否占满一行
86
+ */
87
+ block: Boolean,
88
+ /**
89
+ * 表单项组件样式
90
+ */
91
+ formItemClass: String,
92
+ /**
93
+ * 提示信息
94
+ */
95
+ tips: String,
96
+ /**
97
+ * 校验规则触发方式
98
+ */
99
+ trigger: {
100
+ type: String,
101
+ default: "blur"
102
+ },
103
+ /**
104
+ * 是否隐藏 label
105
+ */
106
+ hideLabel: Boolean,
107
+ /**
108
+ * label 占列数
109
+ */
110
+ labelColspan: [Number, String],
111
+ /**
112
+ * input 占列数
113
+ */
114
+ inputColspan: [Number, String],
115
+ /**
116
+ * label 占行数
117
+ */
118
+ labelRowspan: [Number, String],
119
+ /**
120
+ * input 占行数
121
+ */
122
+ inputRowspan: [Number, String],
123
+ // el-form-item
124
+ prop: String,
125
+ label: String,
126
+ labelWidth: String,
127
+ required: Boolean,
128
+ rules: [Object, Array],
129
+ error: String,
130
+ showMessage: {
131
+ type: Boolean,
132
+ default: !0
133
+ },
134
+ inlineMessage: {
135
+ type: [String, Boolean],
136
+ default: ""
137
+ },
138
+ size: String,
139
+ validateStatus: String,
140
+ for: String,
141
+ // el-col
142
+ span: {
143
+ type: Number,
144
+ default: 12
145
+ },
146
+ offset: Number,
147
+ push: Number,
148
+ pull: Number,
149
+ xs: [Number, Object],
150
+ sm: [Number, Object],
151
+ md: [Number, Object],
152
+ lg: [Number, Object],
153
+ xl: [Number, Object],
154
+ tag: String
155
+ },
156
+ data() {
157
+ const e = {};
158
+ return o.forEach((r) => {
159
+ e[r] = null;
160
+ }), {
161
+ proxyForm: e
162
+ };
163
+ },
164
+ computed: {
165
+ prefix() {
166
+ return this.prefixConfig ? "请配置" : this.prefixPick || this.picker ? "请选择" : this.prefixAdd ? "请添加" : "请输入";
167
+ },
168
+ message() {
169
+ var e;
170
+ return `${this.prefix}${((e = this.label) == null ? void 0 : e.replace(":", "")) || ""}`;
171
+ },
172
+ computeRules() {
173
+ var i;
174
+ const e = [...this.rules || []], r = e.find((t) => t.required);
175
+ if (this.required || r || (i = this.formHolder.requiredFields) != null && i.includes(this.prop)) {
176
+ const t = e.find((n) => n.required);
177
+ t ? t.ref ? t.label = t.label || this.label : t.message = t.message || this.message : e.unshift(this.getRequireRule());
178
+ }
179
+ return e.concat(this.getRules());
180
+ },
181
+ computeSpan() {
182
+ return this.block ? 24 : this.span;
183
+ },
184
+ formItemProps() {
185
+ return s({ ...this.$props, ...this.$attrs }, c);
186
+ },
187
+ elFormItemProps() {
188
+ return s({ ...this.$props, ...this.$attrs }, h);
189
+ },
190
+ elColProps() {
191
+ return s({ ...this.$props, ...this.$attrs }, d);
192
+ },
193
+ formCfg() {
194
+ const e = {
195
+ disabled: this.disabled
196
+ };
197
+ return o.forEach((r) => {
198
+ e[r] = this.elForm[r];
199
+ }), e;
200
+ }
201
+ },
202
+ watch: {
203
+ computeRules() {
204
+ var e, r;
205
+ (r = (e = this.elForm) == null ? void 0 : e.clearValidate) == null || r.call(e, this.prop);
206
+ },
207
+ formCfg: {
208
+ immediate: !0,
209
+ handler() {
210
+ var e;
211
+ this.proxyForm.disabled = (e = this.formHolder.enabledFields) != null && e.includes(this.prop) ? !1 : (this.elForm || {}).disabled, o.forEach((r) => {
212
+ var i;
213
+ r !== "disabled" && (b.includes(r) ? this.proxyForm[r] = (i = this.elForm[r]) == null ? void 0 : i.bind(this.elForm) : this.proxyForm[r] = this.elForm[r]);
214
+ });
215
+ }
216
+ }
217
+ },
218
+ methods: {
219
+ getRules() {
220
+ return [];
221
+ },
222
+ getRequireRule() {
223
+ return {
224
+ required: !0,
225
+ trigger: this.trigger,
226
+ message: this.message
227
+ };
228
+ }
229
+ }
230
+ };
231
+ export {
232
+ S as f
233
+ };
@@ -0,0 +1,12 @@
1
+ const a = (r, t, e) => t && !/^[A-Za-z0-9\u4e00-\u9fa5_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(t) ? e(new Error("invalid")) : e();
2
+ function s(r, t, e) {
3
+ if (this.$refs.table.$refs.table.records.length === 0) {
4
+ e(new Error(r.message || `请添加${r.label}`));
5
+ return;
6
+ }
7
+ e();
8
+ }
9
+ export {
10
+ s as a,
11
+ a as v
12
+ };