@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 +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
+ .table-column-filter .el-drawer__body{padding:10px}.table-column-filter .el-drawer__header{border-bottom:1px solid #f0f0f0;min-height:20px;margin-bottom:0;padding:16px 10px 16px 24px}.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 c = Object.getOwnPropertySymbols;
4
- var m = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
5
- var u = (e, t, s) => t in e ? $(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, r = (e, t) => {
6
- for (var s in t || (t = {}))
7
- m.call(t, s) && u(e, s, t[s]);
8
- if (c)
9
- for (var s of c(t))
10
- b.call(t, s) && u(e, s, t[s]);
11
- return e;
12
- }, p = (e, t) => T(e, _(t));
13
- var S = (e, t) => {
14
- var s = {};
15
- for (var l in e)
16
- m.call(e, l) && t.indexOf(l) < 0 && (s[l] = e[l]);
17
- if (e != null && c)
18
- for (var l of c(e))
19
- t.indexOf(l) < 0 && b.call(e, l) && (s[l] = e[l]);
20
- return s;
21
- };
22
- var f = (e, t, s) => new Promise((l, o) => {
23
- var g = (i) => {
24
- try {
25
- a(s.next(i));
26
- } catch (h) {
27
- o(h);
28
- }
29
- }, n = (i) => {
30
- try {
31
- a(s.throw(i));
32
- } catch (h) {
33
- o(h);
34
- }
35
- }, a = (i) => i.done ? l(i.value) : Promise.resolve(i.value).then(g, n);
36
- a((s = s.apply(e, t)).next());
37
- });
38
- import { cloneDeep as y, merge as w } from "@web-utils/integrations/lodash";
39
- import { hasOwn as P, copy 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 d = {
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 d = {
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 = r(r({}, 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 = y(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: d.empty,
83
+ tableStatus: i.empty,
121
84
  records: [],
122
85
  loading: !1,
123
86
  currentRow: null,
@@ -155,11 +118,11 @@ const d = {
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: {
@@ -192,13 +155,13 @@ const d = {
192
155
  updateTableScrollPosition() {
193
156
  this.$refs.scroller && this.scrollTo(this.tableScrollTop, this.tableScrollLeft);
194
157
  },
195
- filterTableProperties: O,
196
- filterTableEvents: x,
197
- filterTableColumnProperties: v,
158
+ filterTableProperties: m,
159
+ filterTableEvents: u,
160
+ filterTableColumnProperties: h,
198
161
  onTableScroll() {
199
162
  this.tableScrollTop = this.$refs.scroller.scrollTop, this.tableScrollLeft = this.$refs.scroller.scrollLeft;
200
163
  },
201
- copy: (e) => C(k(e)),
164
+ copy: (e) => f(S(e)),
202
165
  onSortChange({ prop: e, order: t }) {
203
166
  this.page.ascs = t === "ascending" ? e : "", this.page.descs = t === "descending" ? e : "";
204
167
  },
@@ -219,7 +182,7 @@ const d = {
219
182
  this.$set(this.page.model, e, t);
220
183
  },
221
184
  setModel(e) {
222
- this.page.page = 1, this.page.model = y(e);
185
+ this.page.page = 1, this.page.model = n(e);
223
186
  },
224
187
  deleteModelField(e) {
225
188
  delete this.page.model[e];
@@ -229,7 +192,8 @@ const d = {
229
192
  s > -1 && t.splice(s, 1);
230
193
  },
231
194
  addFilter({ field: e, op: t, value: s }) {
232
- this.page.filters = p(r({}, this.page.filters), {
195
+ this.page.filters = {
196
+ ...this.page.filters,
233
197
  rules: [
234
198
  {
235
199
  field: e,
@@ -238,7 +202,7 @@ const d = {
238
202
  }
239
203
  ],
240
204
  op: "and"
241
- });
205
+ };
242
206
  },
243
207
  clearFilters() {
244
208
  this.page.filters = {};
@@ -249,66 +213,63 @@ const d = {
249
213
  search() {
250
214
  this.setModel(this.model), this.getPage();
251
215
  },
252
- getPage() {
253
- return f(this, null, function* () {
254
- var i;
255
- if (P(this.$attrs, "data")) {
256
- this.records = this.$attrs.data, this.page.page = 1, this.page.total = this.records.length, this.page.limit = this.page.total;
257
- return;
258
- }
259
- this.records = [];
260
- let e;
261
- const a = this.page, { filters: t } = a, s = S(a, ["filters"]), l = r({}, s);
262
- if ((i = t == null ? void 0 : t.rules) != null && i.length && (l.filters = { rules: t.rules }), this.api || this.url) {
263
- this.tableStatus = d.loading;
264
- try {
265
- this.loading = !0, this.api && (e = yield this.api(l)), this.url && (e = yield this.method(this.url, l)), this.loading = !1;
266
- } catch (h) {
267
- this.tableStatus = d.error, console.error(h), this.loading = !1;
268
- return;
269
- }
270
- } else {
271
- this.$notify.warning({
272
- title: "开发提示!",
273
- message: "PageableTable 请提供 url(String) 或 api(Function) 属性"
274
- });
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;
275
231
  return;
276
232
  }
277
- const { data: o } = e || {}, { total: g, records: n } = o || {};
278
- this.page.total = Number(g), this.records = n, !n || !n.length ? this.tableStatus = d.empty : this.tableStatus = d.success, this.$refs.table && (this.$refs.scroller.scrollTop = 0), this.$emit("page-loaded", o);
279
- });
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);
280
242
  },
281
- refresh() {
282
- return f(this, null, function* () {
283
- yield this.getPage();
284
- });
243
+ async refresh() {
244
+ await this.getPage();
285
245
  },
286
246
  reload() {
287
- this.page = p(r({}, this.$options.data.call(this).page), {
247
+ this.page = {
248
+ ...this.$options.data.call(this).page,
288
249
  total: this.page.total
289
- });
250
+ };
290
251
  },
291
252
  scrollTo(e, t) {
292
253
  e && (this.$refs.scroller.scrollTop = e), t && (this.$refs.scroller.scrollLeft = t);
293
254
  }
294
255
  }
295
256
  };
296
- var F = function() {
257
+ var v = function() {
297
258
  var t = this, s = t._self._c;
298
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) {
299
260
  return [t._t("default", null, { item: l })];
300
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) => {
301
262
  t.page.page = l;
302
263
  } } })], 1)]);
303
- }, L = [], M = /* @__PURE__ */ R(
304
- E,
305
- F,
306
- L,
264
+ }, $ = [], T = /* @__PURE__ */ b(
265
+ y,
266
+ v,
267
+ $,
307
268
  !1,
308
269
  null,
309
270
  null
310
271
  );
311
- const I = M.exports;
272
+ const x = T.exports;
312
273
  export {
313
- I as default
274
+ x as default
314
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
+ };