@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 +1 @@
1
- .pageable-table{flex:auto;height:100%;position:relative}.pageable-table .single-select-column .el-radio__label{padding:0}.pageable-table.auto-height{height:auto;position:static}.pageable-table.auto-height .el-table{min-height:200px;position:static}.pageable-table.auto-height .pageable-table-wrapper{position:static}.pageable-table .pageable-table-wrapper{flex-direction:column;display:flex;position:absolute;top:0;bottom:0;left:0;right:0}.pageable-table .el-pagination{background-color:#fff}.pageable-table .table-status-icon{font-size:20px}.pageable-table .pageable-table-loading{align-items:center;display:inline-flex}.pageable-table .pageable-table-error{color:red;border:1px solid #fca4a4;align-items:center;display:inline-flex}.pageable-table .pageable-table-error:hover{background-color:#fff0f0}.pageable-table .pageable-table-total{padding:0 10px 10px}.pageable-table .underline{position:relative}.pageable-table .underline:after{z-index:1;content:"";background-color:#606266;width:100%;height:1px;position:absolute;bottom:0;left:0}.pageable-table .total{padding:10px}
1
+ .pageable-table{flex:auto;height:100%;position:relative}.pageable-table .single-select-column .el-radio__label{padding:0}.pageable-table.auto-height{height:auto;position:static}.pageable-table.auto-height .el-table{min-height:200px;position:relative}.pageable-table.auto-height .pageable-table-wrapper{position:static}.pageable-table .pageable-table-wrapper{flex-direction:column;display:flex}.pageable-table .el-pagination{background-color:#fff}.pageable-table .table-status-icon{font-size:20px}.pageable-table .pageable-table-loading{align-items:center;display:inline-flex}.pageable-table .pageable-table-error{color:red;border:1px solid #fca4a4;align-items:center;display:inline-flex}.pageable-table .pageable-table-error:hover{background-color:#fff0f0}.pageable-table .pageable-table-total{padding:0 10px 10px}.pageable-table .underline{position:relative}.pageable-table .underline:after{z-index:1;content:"";background-color:#606266;width:100%;height:1px;position:absolute;bottom:0;left:0}.pageable-table .el-table th{color:#000000d9;word-break:break-word;background-color:#fafafa}.pageable-table .total{padding:10px}
@@ -1,57 +1,20 @@
1
- var $ = Object.defineProperty, T = Object.defineProperties;
2
- var _ = Object.getOwnPropertyDescriptors;
3
- var d = Object.getOwnPropertySymbols;
4
- var u = Object.prototype.hasOwnProperty, m = Object.prototype.propertyIsEnumerable;
5
- var f = (e, t, s) => t in e ? $(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, p = (e, t) => {
6
- for (var s in t || (t = {}))
7
- u.call(t, s) && f(e, s, t[s]);
8
- if (d)
9
- for (var s of d(t))
10
- m.call(t, s) && f(e, s, t[s]);
11
- return e;
12
- }, b = (e, t) => T(e, _(t));
13
- var y = (e, t) => {
14
- var s = {};
15
- for (var i in e)
16
- u.call(e, i) && t.indexOf(i) < 0 && (s[i] = e[i]);
17
- if (e != null && d)
18
- for (var i of d(e))
19
- t.indexOf(i) < 0 && m.call(e, i) && (s[i] = e[i]);
20
- return s;
21
- };
22
- var h = (e, t, s) => new Promise((i, r) => {
23
- var g = (l) => {
24
- try {
25
- a(s.next(l));
26
- } catch (n) {
27
- r(n);
28
- }
29
- }, o = (l) => {
30
- try {
31
- a(s.throw(l));
32
- } catch (n) {
33
- r(n);
34
- }
35
- }, a = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(g, o);
36
- a((s = s.apply(e, t)).next());
37
- });
38
- import { cloneDeep as S, merge as w } from "@web-utils/integrations/lodash";
39
- import { copy as P, hasOwn as C } from "@web-utils/core";
40
- import { f as v, h as x, i as O } from "../chunks/index.MAFc4eFi.mjs";
41
- import { n as R } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
42
- function k(e) {
1
+ import { cloneDeep as n, merge as g } from "@web-utils/integrations/lodash";
2
+ import { hasOwn as p, copy as f } from "@web-utils/core";
3
+ import { f as h, g as u, h as m } from "../chunks/index.d3MV3Wq2.mjs";
4
+ import { n as b } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
5
+ function S(e) {
43
6
  let t = "";
44
7
  for (const s in e)
45
8
  t += `<ElTableColumn prop="${s}" label="${s}"/>
46
9
  `;
47
10
  return t;
48
11
  }
49
- const c = {
12
+ const i = {
50
13
  loading: 1,
51
14
  error: -1,
52
15
  empty: 2,
53
16
  success: 0
54
- }, E = {
17
+ }, y = {
55
18
  name: "PageableView",
56
19
  bus: {
57
20
  reloadTableView(e) {
@@ -111,13 +74,13 @@ const c = {
111
74
  },
112
75
  data() {
113
76
  let e = { rules: [] };
114
- this.rules && this.rules.length > 0 && (e.rules = this.rules), this.filters && (e = this.filters), this.filter && (e = Object.assign({}, e, this.filter));
77
+ this.rules && this.rules.length > 0 && (e.rules = this.rules), this.filters && (e = this.filters), this.filter && (e = { ...e, ...this.filter });
115
78
  let t = {};
116
- this.model && (t = S(this.model));
79
+ this.model && (t = n(this.model));
117
80
  const s = this.pageSize;
118
81
  return {
119
82
  // TABLE_STATUS: Object.freeze(TABLE_STATUS),
120
- tableStatus: c.empty,
83
+ tableStatus: i.empty,
121
84
  records: [],
122
85
  loading: !1,
123
86
  currentRow: null,
@@ -155,11 +118,11 @@ const c = {
155
118
  return e.length > 3 ? 50 + (e.length - 3) * 10 : 50;
156
119
  },
157
120
  mergeAttrs() {
158
- return w({}, this.$attrs, { height: this.autoHeight ? null : "auto" });
121
+ return g({}, this.$attrs, { height: this.autoHeight ? null : "auto" });
159
122
  },
160
123
  headers() {
161
124
  var e;
162
- return ((e = this.columns) == null ? void 0 : e.map(v)) || [];
125
+ return ((e = this.columns) == null ? void 0 : e.map(h)) || [];
163
126
  }
164
127
  },
165
128
  watch: {
@@ -190,17 +153,15 @@ const c = {
190
153
  },
191
154
  methods: {
192
155
  updateTableScrollPosition() {
193
- return h(this, null, function* () {
194
- this.$refs.scroller && this.scrollTo(this.tableScrollTop, this.tableScrollLeft);
195
- });
156
+ this.$refs.scroller && this.scrollTo(this.tableScrollTop, this.tableScrollLeft);
196
157
  },
197
- filterTableProperties: O,
198
- filterTableEvents: x,
199
- filterTableColumnProperties: v,
158
+ filterTableProperties: m,
159
+ filterTableEvents: u,
160
+ filterTableColumnProperties: h,
200
161
  onTableScroll() {
201
162
  this.tableScrollTop = this.$refs.scroller.scrollTop, this.tableScrollLeft = this.$refs.scroller.scrollLeft;
202
163
  },
203
- copy: (e) => P(k(e)),
164
+ copy: (e) => f(S(e)),
204
165
  onSortChange({ prop: e, order: t }) {
205
166
  this.page.ascs = t === "ascending" ? e : "", this.page.descs = t === "descending" ? e : "";
206
167
  },
@@ -221,17 +182,18 @@ const c = {
221
182
  this.$set(this.page.model, e, t);
222
183
  },
223
184
  setModel(e) {
224
- this.page.page = 1, this.page.model = S(e);
185
+ this.page.page = 1, this.page.model = n(e);
225
186
  },
226
187
  deleteModelField(e) {
227
188
  delete this.page.model[e];
228
189
  },
229
190
  removeRule(e) {
230
- const t = this.page.filters.rules, s = t.findIndex((i) => i.field === e);
191
+ const t = this.page.filters.rules, s = t.findIndex((l) => l.field === e);
231
192
  s > -1 && t.splice(s, 1);
232
193
  },
233
194
  addFilter({ field: e, op: t, value: s }) {
234
- this.page.filters = Object.assign({}, this.page.filters, {
195
+ this.page.filters = {
196
+ ...this.page.filters,
235
197
  rules: [
236
198
  {
237
199
  field: e,
@@ -240,7 +202,7 @@ const c = {
240
202
  }
241
203
  ],
242
204
  op: "and"
243
- });
205
+ };
244
206
  },
245
207
  clearFilters() {
246
208
  this.page.filters = {};
@@ -251,68 +213,63 @@ const c = {
251
213
  search() {
252
214
  this.setModel(this.model), this.getPage();
253
215
  },
254
- getPage() {
255
- return h(this, null, function* () {
256
- var l;
257
- if (C(this.$attrs, "data")) {
258
- this.records = this.$attrs.data, this.page.page = 1, this.page.total = this.records.length, this.page.limit = this.page.total;
259
- return;
260
- }
261
- this.records = [];
262
- let e;
263
- const a = this.page, { filters: t } = a, s = y(a, ["filters"]), i = p({}, s);
264
- if ((l = t == null ? void 0 : t.rules) != null && l.length && (i.filters = { rules: t.rules }), this.api || this.url) {
265
- this.tableStatus = c.loading;
266
- try {
267
- this.loading = !0, this.api && (e = yield this.api(i)), this.url && (e = yield this.method(this.url, i)), this.loading = !1;
268
- } catch (n) {
269
- this.tableStatus = c.error, console.error(n), this.loading = !1;
270
- return;
271
- }
272
- } else {
273
- this.$notify.warning({
274
- title: "开发提示!",
275
- message: "PageableTable 请提供 url(String) 或 api(Function) 属性"
276
- });
216
+ async getPage() {
217
+ var o;
218
+ if (p(this.$attrs, "data")) {
219
+ this.records = this.$attrs.data, this.page.page = 1, this.page.total = this.records.length, this.page.limit = this.page.total;
220
+ return;
221
+ }
222
+ this.records = [];
223
+ let e;
224
+ const { filters: t, ...s } = this.page, l = { ...s };
225
+ if ((o = t == null ? void 0 : t.rules) != null && o.length && (l.filters = { rules: t.rules }), this.api || this.url) {
226
+ this.tableStatus = i.loading;
227
+ try {
228
+ this.loading = !0, this.api && (e = await this.api(l)), this.url && (e = await this.method(this.url, l)), this.loading = !1;
229
+ } catch (c) {
230
+ this.tableStatus = i.error, console.error(c), this.loading = !1;
277
231
  return;
278
232
  }
279
- const { data: r } = e || {}, { total: g, records: o } = r || {};
280
- this.page.total = Number(g), this.records = o, !o || !o.length ? this.tableStatus = c.empty : this.tableStatus = c.success, this.$refs.table && (this.$refs.scroller.scrollTop = 0), this.$emit("page-loaded", r);
281
- });
233
+ } else {
234
+ this.$notify.warning({
235
+ title: "开发提示!",
236
+ message: "PageableTable 请提供 url(String) 或 api(Function) 属性"
237
+ });
238
+ return;
239
+ }
240
+ const { data: r } = e || {}, { total: d, records: a } = r || {};
241
+ this.page.total = Number(d), this.records = a, !a || !a.length ? this.tableStatus = i.empty : this.tableStatus = i.success, this.$refs.table && (this.$refs.scroller.scrollTop = 0), this.$emit("page-loaded", r);
282
242
  },
283
- refresh() {
284
- return h(this, null, function* () {
285
- yield this.getPage();
286
- });
243
+ async refresh() {
244
+ await this.getPage();
287
245
  },
288
246
  reload() {
289
- return h(this, null, function* () {
290
- this.page = b(p({}, this.$options.data.call(this).page), {
291
- total: this.page.total
292
- });
293
- });
247
+ this.page = {
248
+ ...this.$options.data.call(this).page,
249
+ total: this.page.total
250
+ };
294
251
  },
295
252
  scrollTo(e, t) {
296
253
  e && (this.$refs.scroller.scrollTop = e), t && (this.$refs.scroller.scrollLeft = t);
297
254
  }
298
255
  }
299
256
  };
300
- var F = function() {
257
+ var v = function() {
301
258
  var t = this, s = t._self._c;
302
- return s("div", { staticClass: "work", staticStyle: { height: "100%", "background-color": "#fff" } }, [s("div", { staticClass: "flex-column list-content", staticStyle: { height: "100%" } }, [s("div", { directives: [{ name: "loading", rawName: "v-loading", value: t.loading, expression: "loading" }], staticClass: "flex-item-relative", attrs: { "element-loading-text": "加载中...", "element-loading-background": "#fff" } }, [s("div", { ref: "scroller", staticClass: "scroll-wrapper" }, [s("div", { staticClass: "cards-block" }, [t._t("prepend"), t._l(t.records, function(i) {
303
- return [t._t("default", null, { item: i })];
304
- }), t._t("append")], 2)])]), s("ElPagination", { staticClass: "flex-not-shrink", staticStyle: { "border-top": "1px solid #ebeef5" }, attrs: { "current-page": t.page.page, "hide-on-single-page": t.hideOnSinglePage, "page-size": t.page.limit, total: t.page.total, background: "", layout: "total, prev, pager, next, jumper" }, on: { "current-change": (i) => {
305
- t.page.page = i;
259
+ return s("div", { staticClass: "work", staticStyle: { height: "100%", "background-color": "#fff" } }, [s("div", { staticClass: "flex-column list-content", staticStyle: { height: "100%" } }, [s("div", { directives: [{ name: "loading", rawName: "v-loading", value: t.loading, expression: "loading" }], staticClass: "flex-item-relative", attrs: { "element-loading-text": "加载中...", "element-loading-background": "#fff" } }, [s("div", { ref: "scroller", staticClass: "scroll-wrapper" }, [s("div", { staticClass: "cards-block" }, [t._t("prepend"), t._l(t.records, function(l) {
260
+ return [t._t("default", null, { item: l })];
261
+ }), t._t("append")], 2)])]), s("ElPagination", { staticClass: "flex-not-shrink", staticStyle: { "border-top": "1px solid #ebeef5" }, attrs: { "current-page": t.page.page, "hide-on-single-page": t.hideOnSinglePage, "page-size": t.page.limit, total: t.page.total, background: "", layout: "total, prev, pager, next, jumper" }, on: { "current-change": (l) => {
262
+ t.page.page = l;
306
263
  } } })], 1)]);
307
- }, L = [], M = /* @__PURE__ */ R(
308
- E,
309
- F,
310
- L,
264
+ }, $ = [], T = /* @__PURE__ */ b(
265
+ y,
266
+ v,
267
+ $,
311
268
  !1,
312
269
  null,
313
270
  null
314
271
  );
315
- const I = M.exports;
272
+ const x = T.exports;
316
273
  export {
317
- I as default
274
+ x as default
318
275
  };
@@ -1,71 +1,50 @@
1
- var u = (i, n, t) => new Promise((h, a) => {
2
- var r = (o) => {
3
- try {
4
- s(t.next(o));
5
- } catch (c) {
6
- a(c);
7
- }
8
- }, e = (o) => {
9
- try {
10
- s(t.throw(o));
11
- } catch (c) {
12
- a(c);
13
- }
14
- }, s = (o) => o.done ? h(o.value) : Promise.resolve(o.value).then(r, e);
15
- s((t = t.apply(i, n)).next());
16
- });
17
- import d from "photoswipe";
1
+ import u from "photoswipe";
18
2
  import "photoswipe/dist/photoswipe.css";
19
- import { n as l } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
20
- function w(i) {
21
- new d(i).init();
3
+ import { n as g } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
4
+ function d(t) {
5
+ new u(t).init();
22
6
  }
23
- function g(h, a) {
24
- return u(this, arguments, function* (i, n, t = { selector: "chat-image" }) {
25
- const r = i.target;
26
- if (!(!r || r.classList.contains(t.selector) || r.tagName === "IMG"))
27
- return;
28
- const e = n.querySelectorAll(t.selector === "img" ? t.selector : `.${t.selector}`), s = [...e].findIndex((c) => c === r);
29
- s >= 0 && (t.index = s);
30
- const o = yield f(e);
31
- yield w({ dataSource: o, index: s });
32
- });
7
+ async function l(t, r, n = { selector: "chat-image" }) {
8
+ const c = t.target;
9
+ if (!(!c || c.classList.contains(n.selector) || c.tagName === "IMG"))
10
+ return;
11
+ const e = r.querySelectorAll(n.selector === "img" ? n.selector : `.${n.selector}`), a = [...e].findIndex((s) => s === c);
12
+ a >= 0 && (n.index = a);
13
+ const i = await w(e);
14
+ await d({ dataSource: i, index: a });
33
15
  }
34
- function f(i) {
35
- return u(this, null, function* () {
36
- const n = [];
37
- for (let t = 0, h = i.length; t < h; t++) {
38
- const a = i[t], r = a.getAttribute("data-src") || a.getAttribute("src"), e = {
39
- src: r,
40
- msrc: r,
41
- alt: a.getAttribute("data-title") || a.getAttribute("alt"),
42
- element: a
43
- }, s = a.getAttribute("data-height"), o = a.getAttribute("data-width");
44
- let c = { width: o, height: s };
45
- !s && !o && (c = yield m(a), a.setAttribute("data-height", c.height), a.setAttribute("data-width", c.width)), e.w = c.width, e.width = c.width, e.h = c.height, e.height = c.height, n.push(e);
46
- }
47
- return n;
48
- });
16
+ async function w(t) {
17
+ const r = [];
18
+ for (let n = 0, c = t.length; n < c; n++) {
19
+ const e = t[n], a = e.getAttribute("data-src") || e.getAttribute("src"), i = {
20
+ src: a,
21
+ msrc: a,
22
+ alt: e.getAttribute("data-title") || e.getAttribute("alt"),
23
+ element: e
24
+ }, s = e.getAttribute("data-height"), h = e.getAttribute("data-width");
25
+ let o = { width: h, height: s };
26
+ !s && !h && (o = await f(e), e.setAttribute("data-height", o.height), e.setAttribute("data-width", o.width)), i.w = o.width, i.width = o.width, i.h = o.height, i.height = o.height, r.push(i);
27
+ }
28
+ return r;
49
29
  }
50
- function m(i) {
51
- const n = i.getAttribute("data-src") || i.getAttribute("src"), t = i.getAttribute("data-height"), h = i.getAttribute("data-width");
52
- return t && h ? { width: h, height: t } : i.complete ? {
53
- width: i.naturalWidth,
54
- height: i.naturalHeight
55
- } : new Promise((a) => {
56
- const r = new Image();
57
- r.src = n;
58
- const e = {};
59
- r.complete ? (e.width = r.width, e.height = r.height, a(e)) : (r.onload = () => {
60
- e.width = r.width, e.height = r.height, a(e);
61
- }, r.onerror = () => {
62
- e.width = 0, e.height = 0, a(e);
30
+ function f(t) {
31
+ const r = t.getAttribute("data-src") || t.getAttribute("src"), n = t.getAttribute("data-height"), c = t.getAttribute("data-width");
32
+ return n && c ? { width: c, height: n } : t.complete ? {
33
+ width: t.naturalWidth,
34
+ height: t.naturalHeight
35
+ } : new Promise((e) => {
36
+ const a = new Image();
37
+ a.src = r;
38
+ const i = {};
39
+ a.complete ? (i.width = a.width, i.height = a.height, e(i)) : (a.onload = () => {
40
+ i.width = a.width, i.height = a.height, e(i);
41
+ }, a.onerror = () => {
42
+ i.width = 0, i.height = 0, e(i);
63
43
  });
64
44
  });
65
45
  }
66
- const p = {
46
+ const m = {
67
47
  name: "PhotoSwipe",
68
- photoswipe: g,
69
48
  props: {
70
49
  urls: Array,
71
50
  selector: {
@@ -74,29 +53,27 @@ const p = {
74
53
  }
75
54
  },
76
55
  methods: {
77
- preview(i) {
78
- return u(this, null, function* () {
79
- yield g(i, this.$refs.wrapper, { selector: this.selector });
80
- });
56
+ async preview(t) {
57
+ await l(t, this.$refs.wrapper, { selector: this.selector });
81
58
  }
82
59
  }
83
60
  };
84
- var _ = function() {
85
- var n = this, t = n._self._c;
86
- return t("div", { ref: "wrapper" }, [n._t("default", function() {
87
- return n._l(n.urls, function(h) {
88
- return t("img", { key: h.src, staticStyle: { cursor: "pointer" }, attrs: { width: "100", src: h.src, alt: "" }, on: { click: n.preview } });
61
+ var p = function() {
62
+ var r = this, n = r._self._c;
63
+ return n("div", { ref: "wrapper" }, [r._t("default", function() {
64
+ return r._l(r.urls, function(c) {
65
+ return n("img", { key: c.src, staticStyle: { cursor: "pointer" }, attrs: { width: "100", src: c.src, alt: "" }, on: { click: r.preview } });
89
66
  });
90
- }, { urls: n.urls, preview: n.preview })], 2);
91
- }, b = [], A = /* @__PURE__ */ l(
67
+ }, { urls: r.urls, preview: r.preview })], 2);
68
+ }, _ = [], b = /* @__PURE__ */ g(
69
+ m,
92
70
  p,
93
71
  _,
94
- b,
95
72
  !1,
96
73
  null,
97
74
  null
98
75
  );
99
- const I = A.exports;
76
+ const v = b.exports;
100
77
  export {
101
- I as default
78
+ v as default
102
79
  };
@@ -0,0 +1,117 @@
1
+ import { ref as l, onMounted as S } from "vue";
2
+ import N from "element-ui/lib/message";
3
+ import { isPlainObject as y, isFunction as P } from "@web-utils/core";
4
+ import { cloneDeep as T } from "@web-utils/integrations/lodash";
5
+ import { n as B } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
6
+ const O = {
7
+ name: "PickerTableView"
8
+ }, E = /* @__PURE__ */ Object.assign(O, {
9
+ props: {
10
+ title: String,
11
+ treeTitle: String,
12
+ useTree: Boolean,
13
+ expandFirstNode: Boolean,
14
+ nodeKey: {
15
+ type: String,
16
+ default: "id"
17
+ },
18
+ width: {
19
+ type: String,
20
+ default: "80%"
21
+ },
22
+ height: {
23
+ type: String,
24
+ default: "90vh"
25
+ },
26
+ visible: {
27
+ type: Boolean,
28
+ default: !1
29
+ },
30
+ multiple: {
31
+ type: Boolean,
32
+ default: !1
33
+ },
34
+ descs: {
35
+ type: Array,
36
+ default: () => []
37
+ },
38
+ model: Object,
39
+ tableApi: Function,
40
+ treeApi: Function,
41
+ onNodeClick: Function,
42
+ treeProps: Object,
43
+ rowKey: {
44
+ type: String,
45
+ default: "id"
46
+ },
47
+ customRootNode: [Object, Function],
48
+ expandOnClickNode: {
49
+ type: Boolean,
50
+ default: !0
51
+ }
52
+ },
53
+ emits: ["cancel", "confirm", "update:visible"],
54
+ setup(f, { expose: e, emit: n }) {
55
+ const t = f, a = l([]), s = l(null), i = l([]), m = l([]), h = l(null), g = l(null), v = l(null), _ = l(null), b = (o) => {
56
+ a.value = o;
57
+ }, x = (o) => {
58
+ s.value = o;
59
+ }, d = () => {
60
+ h.value.reload();
61
+ }, k = () => {
62
+ g.value.resetFields(), d();
63
+ }, u = () => {
64
+ v.value.hide();
65
+ }, w = () => {
66
+ n("cancel"), u();
67
+ }, C = () => {
68
+ var p;
69
+ let o;
70
+ if (t.multiple ? (p = a.value) != null && p.length && (o = a.value) : s.value && (o = [s.value]), !o.length) {
71
+ N.warning("请选择!");
72
+ return;
73
+ }
74
+ n("confirm", o), u();
75
+ }, F = (o) => {
76
+ n("update:visible", o);
77
+ };
78
+ return S(async () => {
79
+ var o;
80
+ if (t.useTree) {
81
+ const c = (await t.treeApi()).data.data;
82
+ if (y(t.customRootNode)) {
83
+ const r = T(t.customRootNode);
84
+ r[t.treeProps.children || "children"] = c, i.value = [r];
85
+ } else if (P(t.customRootNode)) {
86
+ const r = t.customRootNode(c);
87
+ r[t.treeProps.children || "children"] = c, i.value = y(r) ? [r] : r;
88
+ } else
89
+ i.value = c;
90
+ t.expandFirstNode && (m.value = [(o = i.value[0]) == null ? void 0 : o.id]);
91
+ }
92
+ }), e({
93
+ search: d
94
+ }), { __sfc: !0, props: t, emits: n, rows: a, current: s, treeData: i, expandedKeys: m, table: h, form: g, dialog: v, tree: _, handleChange: b, handleCurrentChange: x, search: d, clear: k, closeDialog: u, onCancel: w, confirm: C, updateVisible: F };
95
+ }
96
+ });
97
+ var R = function() {
98
+ var e = this, n = e._self._c, t = e._self._setupProxy;
99
+ return n("ElementDialog", { ref: "dialog", attrs: { visible: e.visible, height: e.height, width: e.width, "body-padding": !1, "show-full-screen": "", title: e.title }, on: { "update:visible": t.updateVisible }, scopedSlots: e._u([{ key: "footer", fn: function() {
100
+ return [n("ElButton", { attrs: { size: "mini", type: "primary" }, on: { click: t.confirm } }, [e._v("确定")]), n("ElButton", { attrs: { size: "mini" }, on: { click: t.onCancel } }, [e._v("取消")])];
101
+ }, proxy: !0 }]) }, [n("SkeletonPanel", { attrs: { "flex-column": "", "use-tab": !1, "hide-left": !e.useTree }, scopedSlots: e._u([e.useTree ? { key: "left", fn: function() {
102
+ return [n("div", { staticStyle: { padding: "10px 0", "font-size": "16px", "border-bottom": "1px solid #eee" } }, [e._v(e._s(e.treeTitle))]), n("ElTree", { ref: "tree", attrs: { "node-key": e.nodeKey, data: t.treeData, "default-expanded-keys": t.expandedKeys, props: e.treeProps, "expand-on-click-node": e.expandOnClickNode }, on: { "node-click": e.onNodeClick } })];
103
+ }, proxy: !0 } : null], null, !0) }, [n("FormHolder", { ref: "form", staticStyle: { padding: "10px" }, attrs: { model: e.model, "not-table-form": "" }, nativeOn: { submit: function(a) {
104
+ return a.preventDefault(), t.search.apply(null, arguments);
105
+ } } }, [n("FormItemConfigProvider", { attrs: { reactive: "" } }, [n("ElRow", { attrs: { gutter: 0 } }, [e._t("search-form"), n("FormItem", { staticStyle: { "text-align": "right" }, attrs: { "hide-label": "", span: 24 } }, [n("ElButton", { attrs: { type: "primary", "native-type": "submit" } }, [e._v("搜索")]), n("ElButton", { on: { click: t.clear } }, [e._v("清空")])], 1)], 2)], 1)], 1), n("PageableTable", { ref: "table", attrs: { "highlight-current-row": "", "hide-on-single-page": "", "click-row-select": "", "row-key": e.rowKey, descs: e.descs, "payload-style": "body", api: e.tableApi, model: e.model, multiple: e.multiple }, on: { "current-change": t.handleCurrentChange, "selection-change": t.handleChange } }, [e._t("columns")], 2)], 1)], 1);
106
+ }, D = [], K = /* @__PURE__ */ B(
107
+ E,
108
+ R,
109
+ D,
110
+ !1,
111
+ null,
112
+ null
113
+ );
114
+ const M = K.exports;
115
+ export {
116
+ M as default
117
+ };