@web-utils/form-ui 1.0.0-beta35 → 1.0.0-beta36

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.
@@ -297,11 +297,7 @@ var m = {
297
297
  return n;
298
298
  }
299
299
  return t.options ? t.options.map((e) => (e[t.props.value] = e[t.props.value] ?? e[t.props.label], e)) : [];
300
- });
301
- d(() => {
302
- t.remote && k();
303
- });
304
- let k = async (e) => {
300
+ }), k = async (e) => {
305
301
  try {
306
302
  var n;
307
303
  w.value = !0;
@@ -313,7 +309,9 @@ var m = {
313
309
  } catch {}
314
310
  w.value = !1;
315
311
  };
316
- return () => y({ vNodes: c(p, l(S.value, {
312
+ return d(() => {
313
+ t.remote && k();
314
+ }), () => y({ vNodes: c(p, l(S.value, {
317
315
  offset: t.dropDownOffset,
318
316
  "model-value": C.value,
319
317
  "onUpdate:modelValue": T,
@@ -1,2 +1,2 @@
1
- import { t as e } from "../chunks/uYaz9cwr.mjs";
1
+ import { t as e } from "../chunks/Buc52aVh.mjs";
2
2
  export { e as default };
package/index.mjs CHANGED
@@ -31,7 +31,7 @@ import { t as k } from "./chunks/BYAy19s4.mjs";
31
31
  import { t as A } from "./chunks/DcbnHU8K.mjs";
32
32
  import { t as j } from "./chunks/DQxPzCsy.mjs";
33
33
  import { t as M } from "./chunks/BW6iY7Q7.mjs";
34
- import { t as N } from "./chunks/uYaz9cwr.mjs";
34
+ import { t as N } from "./chunks/Buc52aVh.mjs";
35
35
  import { t as P } from "./chunks/iWQD3xvX.mjs";
36
36
  import { t as F } from "./chunks/Cr1vBYne.mjs";
37
37
  import { t as I } from "./chunks/axr9InkL.mjs";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@web-utils/form-ui",
3
3
  "description": "form-ui",
4
- "version": "1.0.0-beta35",
4
+ "version": "1.0.0-beta36",
5
5
  "author": "Simple",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -3,11 +3,12 @@ import { processButtons as n, reloadTable as r } from "../api/index.mjs";
3
3
  import { tableViewContextKey as i } from "../constants/index.mjs";
4
4
  import { t as a } from "../chunks/DQJyNm1V.mjs";
5
5
  import { t as o } from "../chunks/B1MSrc6f.mjs";
6
- import s from "../form-item-config-provider/index.mjs";
7
- import { t as c } from "../chunks/ZXCLnZFa.mjs";
8
- import { t as l } from "../chunks/DJKE5P39.mjs";
9
- import { hasOwn as u, isArray as d, isFunction as f, isString as p, toStringArray as m, trace as h, warning as g } from "@web-utils/core";
10
- import { Transition as _, createBlock as v, createCommentVNode as y, createElementBlock as b, createElementVNode as x, createSlots as S, createTextVNode as C, createVNode as w, mergeProps as T, normalizeClass as E, normalizeStyle as D, openBlock as O, renderList as k, renderSlot as A, resolveComponent as j, toDisplayString as M, toHandlers as N, vShow as P, withCtx as F, withDirectives as I, withModifiers as L } from "vue";
6
+ import { a as s } from "../chunks/BvsmTC3G.mjs";
7
+ import c from "../form-item-config-provider/index.mjs";
8
+ import { t as l } from "../chunks/ZXCLnZFa.mjs";
9
+ import { t as u } from "../chunks/DJKE5P39.mjs";
10
+ import { hasOwn as d, isArray as f, isFunction as p, isString as m, toStringArray as h, trace as g, warning as _ } from "@web-utils/core";
11
+ import { Transition as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createSlots as C, createTextVNode as w, createVNode as T, mergeProps as E, normalizeClass as D, normalizeStyle as O, openBlock as k, renderList as A, renderSlot as j, toDisplayString as M, toHandlers as N, vShow as P, withCtx as F, withDirectives as I, withModifiers as L } from "vue";
11
12
  import { merge as R } from "@web-utils/integrations/lodash";
12
13
  import { ElButton as z, ElCollapseTransition as B, ElForm as V, ElFormItem as H, ElRow as U } from "element-plus/es";
13
14
  //#region src/components/form/TableView.vue
@@ -35,16 +36,16 @@ var W = [
35
36
  name: "TableView",
36
37
  bus: {
37
38
  reloadTableView(e) {
38
- if (this._viewIds) if (p(e) || d(e)) {
39
+ if (this._viewIds) if (m(e) || f(e)) {
39
40
  let t = e;
40
- p(t) && (t = t.split(",")), this._viewIds.some((e) => t.includes(e)) && (h.call(this.$parent || {}, "reloadTableView"), this.reloadTable());
41
- } else g.call(this.$parent || {}, "`viewId`的类型必须是字符串或数组");
41
+ m(t) && (t = t.split(",")), this._viewIds.some((e) => t.includes(e)) && (g.call(this.$parent || {}, "reloadTableView"), this.reloadTable());
42
+ } else _.call(this.$parent || {}, "`viewId`的类型必须是字符串或数组");
42
43
  },
43
44
  reloadTreeView(e) {
44
- if (this._viewIds) if (p(e) || d(e)) {
45
+ if (this._viewIds) if (m(e) || f(e)) {
45
46
  let t = e;
46
- p(t) && (t = t.split(",")), this._viewIds.some((e) => t.includes(e)) && this.$refs.tree && (h.call(this.$parent || {}, "reloadTreeView"), this.reloadTree());
47
- } else g.call(this.$parent || {}, "`viewId`的类型必须是字符串或数组");
47
+ m(t) && (t = t.split(",")), this._viewIds.some((e) => t.includes(e)) && this.$refs.tree && (g.call(this.$parent || {}, "reloadTreeView"), this.reloadTree());
48
+ } else _.call(this.$parent || {}, "`viewId`的类型必须是字符串或数组");
48
49
  }
49
50
  },
50
51
  provide() {
@@ -118,14 +119,14 @@ var W = [
118
119
  toolbarProps() {
119
120
  var e, t;
120
121
  let r = R({}, this.toolbarAttrs, {}), i = (r == null ? void 0 : r.buttons) || this.$parent.buttons;
121
- return i = i || [], r.buttons = i, r.buttons = n(r.buttons), r.buttons = m(r.buttons), r.searchable = !!((e = (t = this.$slots)["search-form"]) != null && e.call(t)), r;
122
+ return i = i || [], r.buttons = i, r.buttons = n(r.buttons), r.buttons = h(r.buttons), r.searchable = !!((e = (t = this.$slots)["search-form"]) != null && e.call(t)), r;
122
123
  },
123
124
  treeProps() {
124
125
  return e(R({}, this.treeAttrs, {
125
126
  treeProps: {
126
127
  children: "children",
127
128
  label: "label",
128
- isLeaf: (e) => u(e, "hasChildren") ? !e.hasChildren : u(e, "hasChild") ? !e.hasChild : !0
129
+ isLeaf: (e) => d(e, "hasChildren") ? !e.hasChildren : d(e, "hasChild") ? !e.hasChild : !0
129
130
  },
130
131
  show: !1,
131
132
  lazy: !0,
@@ -206,7 +207,7 @@ var W = [
206
207
  async del() {
207
208
  var e;
208
209
  let t = this.deleteApi || this.$parent.del;
209
- if (!((e = this.toolbarListeners) != null && e.del) && f(t)) {
210
+ if (!((e = this.toolbarListeners) != null && e.del) && p(t)) {
210
211
  if (!this.selectedRows.length) {
211
212
  this.$message.warning(this.selectTips || "请选择要删除的记录!");
212
213
  return;
@@ -261,38 +262,38 @@ var W = [
261
262
  class: "search-form-top"
262
263
  }, J = { class: "table-view-content-wrapper" }, Y = { class: "table-view-content" }, X = { class: "table-view-table" }, Z = { class: "slide-panel-content" }, Q = { class: "slide-panel-actions" };
263
264
  function $(e, t, n, r, i, o) {
264
- let u = z, d = j("FormItem"), f = U, p = s, m = V, h = B, g = l, R = a, W = c, G = H;
265
- return O(), b("div", { class: E(["table-view", {
265
+ let d = z, f = s, p = U, m = c, h = V, g = B, _ = u, R = a, W = l, G = H;
266
+ return k(), x("div", { class: D(["table-view", {
266
267
  embed: n.embed,
267
268
  "has-tree": o.treeProps.show
268
- }]) }, [x("div", K, [
269
- y("搜索条件"),
270
- n.searchFormPosition === "top" ? (O(), v(h, { key: 0 }, {
271
- default: F(() => [o.toolbarProps.searchable ? I((O(), b("div", q, [w(m, {
269
+ }]) }, [S("div", K, [
270
+ b("搜索条件"),
271
+ n.searchFormPosition === "top" ? (k(), y(g, { key: 0 }, {
272
+ default: F(() => [o.toolbarProps.searchable ? I((k(), x("div", q, [T(h, {
272
273
  ref: "form",
273
274
  "label-position": "right",
274
275
  model: n.searchModel || o.searchPanelProps.model,
275
276
  "label-width": n.labelWidth,
276
277
  onSubmitCapture: L(o.onSearchClick, ["prevent"])
277
278
  }, {
278
- default: F(() => [w(p, { reactive: "" }, {
279
- default: F(() => [w(f, { gutter: 0 }, {
280
- default: F(() => [A(e.$slots, "search-form", {}, () => [t[3] || (t[3] = x("p", null, "请添加搜索条件!", -1))]), w(d, {
279
+ default: F(() => [T(m, { reactive: "" }, {
280
+ default: F(() => [T(p, { gutter: 0 }, {
281
+ default: F(() => [j(e.$slots, "search-form", {}, () => [t[3] || (t[3] = S("p", null, "请添加搜索条件!", -1))]), T(f, {
281
282
  class: "search-actions",
282
283
  "hide-label": "",
283
284
  "fixed-span": 24
284
285
  }, {
285
- default: F(() => [w(u, {
286
+ default: F(() => [T(d, {
286
287
  type: "primary",
287
288
  "native-type": "submit"
288
289
  }, {
289
- default: F(() => [...t[4] || (t[4] = [C("开始搜索", -1)])]),
290
+ default: F(() => [...t[4] || (t[4] = [w("开始搜索", -1)])]),
290
291
  _: 1
291
- }), w(u, {
292
+ }), T(d, {
292
293
  style: { "margin-left": "10px" },
293
294
  onClick: o.onClearClick
294
295
  }, {
295
- default: F(() => [...t[5] || (t[5] = [C("清除条件", -1)])]),
296
+ default: F(() => [...t[5] || (t[5] = [w("清除条件", -1)])]),
296
297
  _: 1
297
298
  }, 8, ["onClick"])]),
298
299
  _: 1
@@ -306,11 +307,11 @@ function $(e, t, n, r, i, o) {
306
307
  "model",
307
308
  "label-width",
308
309
  "onSubmitCapture"
309
- ])], 512)), [[P, i.isSearchVisible]]) : y("v-if", !0)]),
310
+ ])], 512)), [[P, i.isSearchVisible]]) : b("v-if", !0)]),
310
311
  _: 3
311
- })) : y("v-if", !0),
312
- y("顶部工具条"),
313
- n.showToolbar ? (O(), v(g, T({ key: 1 }, o.toolbarProps, {
312
+ })) : b("v-if", !0),
313
+ b("顶部工具条"),
314
+ n.showToolbar ? (k(), y(_, E({ key: 1 }, o.toolbarProps, {
314
315
  refreshable: "",
315
316
  onSearch: o.toggleSearch,
316
317
  onSettings: t[0] || (t[0] = () => e.$refs.table.toggleSettings()),
@@ -319,20 +320,20 @@ function $(e, t, n, r, i, o) {
319
320
  onReload: o.reloadTableAndTree,
320
321
  onExp: o.exp,
321
322
  onImp: t[1] || (t[1] = (e) => i.importDialogVisible = !0)
322
- }, N(o.toolbarEventHandlers)), S({ _: 2 }, [
323
+ }, N(o.toolbarEventHandlers)), C({ _: 2 }, [
323
324
  e.$slots["toolbar-button"] ? {
324
325
  name: "default",
325
- fn: F(() => [A(e.$slots, "toolbar-button", { selectedRows: i.selectedRows })]),
326
+ fn: F(() => [j(e.$slots, "toolbar-button", { selectedRows: i.selectedRows })]),
326
327
  key: "0"
327
328
  } : void 0,
328
329
  e.$slots["toolbar-left"] ? {
329
330
  name: "toolbar-left",
330
- fn: F(() => [A(e.$slots, "toolbar-left", { selectedRows: i.selectedRows })]),
331
+ fn: F(() => [j(e.$slots, "toolbar-left", { selectedRows: i.selectedRows })]),
331
332
  key: "1"
332
333
  } : void 0,
333
334
  e.$slots["toolbar-right"] ? {
334
335
  name: "toolbar-right",
335
- fn: F(() => [A(e.$slots, "toolbar-right", {
336
+ fn: F(() => [j(e.$slots, "toolbar-right", {
336
337
  del: o.del,
337
338
  create: o.create,
338
339
  reload: o.reloadTableAndTree,
@@ -342,12 +343,12 @@ function $(e, t, n, r, i, o) {
342
343
  } : void 0,
343
344
  e.$slots["toolbar-right-button"] ? {
344
345
  name: "toolbar-right-button",
345
- fn: F(() => [A(e.$slots, "toolbar-right-button")]),
346
+ fn: F(() => [j(e.$slots, "toolbar-right-button")]),
346
347
  key: "3"
347
348
  } : void 0,
348
- k(o.buttonSlots, (t) => ({
349
+ A(o.buttonSlots, (t) => ({
349
350
  name: t,
350
- fn: F(() => [A(e.$slots, t, { selectedRows: i.selectedRows })])
351
+ fn: F(() => [j(e.$slots, t, { selectedRows: i.selectedRows })])
351
352
  }))
352
353
  ]), 1040, [
353
354
  "onSearch",
@@ -355,27 +356,27 @@ function $(e, t, n, r, i, o) {
355
356
  "onCreate",
356
357
  "onReload",
357
358
  "onExp"
358
- ])) : y("v-if", !0),
359
- x("div", J, [
360
- x("div", Y, [
361
- y("侧栏"),
362
- o.treeProps.show ? (O(), b("div", {
359
+ ])) : b("v-if", !0),
360
+ S("div", J, [
361
+ S("div", Y, [
362
+ b("侧栏"),
363
+ o.treeProps.show ? (k(), x("div", {
363
364
  key: 0,
364
365
  ref: "treeScroller",
365
366
  class: "table-view-sidebar",
366
367
  onScroll: t[2] || (t[2] = (...e) => o.onTreeScroll && o.onTreeScroll(...e))
367
- }, [y("<div style=\"font-size: 16px\">视图导航</div>"), w(R, T({ ref: "tree" }, o.treeProps, { readonly: "" }, N(o.toHyphenateKey(n.treeListeners))), {
368
- default: F(({ node: t, data: n }) => [A(e.$slots, "tree-node", {
368
+ }, [b("<div style=\"font-size: 16px\">视图导航</div>"), T(R, E({ ref: "tree" }, o.treeProps, { readonly: "" }, N(o.toHyphenateKey(n.treeListeners))), {
369
+ default: F(({ node: t, data: n }) => [j(e.$slots, "tree-node", {
369
370
  node: t,
370
371
  data: n
371
- }, () => [x("span", null, [x("i", { class: E([t.childNodes.length > 0 ? t.expanded ? "el-icon-folder-opened" : "el-icon-folder" : "el-icon-tickets", "node-icon"]) }, null, 2), A(e.$slots, "tree-label", {
372
+ }, () => [S("span", null, [S("i", { class: D([t.childNodes.length > 0 ? t.expanded ? "el-icon-folder-opened" : "el-icon-folder" : "el-icon-tickets", "node-icon"]) }, null, 2), j(e.$slots, "tree-label", {
372
373
  node: t,
373
374
  data: n
374
- }, () => [C(M(t.label), 1)])])])]),
375
+ }, () => [w(M(t.label), 1)])])])]),
375
376
  _: 3
376
- }, 16)], 544)) : y("v-if", !0),
377
- y("表格"),
378
- x("div", X, [w(W, T({
377
+ }, 16)], 544)) : b("v-if", !0),
378
+ b("表格"),
379
+ S("div", X, [T(W, E({
379
380
  ref: "table",
380
381
  border: n.border,
381
382
  class: [{
@@ -387,12 +388,12 @@ function $(e, t, n, r, i, o) {
387
388
  }, o.tableProps, N(o.toHyphenateKey(n.tableListeners)), {
388
389
  onRowDblclick: o.rowDbClick,
389
390
  onSelectionChange: o.onSelectionChange
390
- }), S({
391
- default: F(() => [A(e.$slots, "columns")]),
391
+ }), C({
392
+ default: F(() => [j(e.$slots, "columns")]),
392
393
  _: 2
393
- }, [k(o.tableScopeSlotNames, (t) => ({
394
+ }, [A(o.tableScopeSlotNames, (t) => ({
394
395
  name: t,
395
- fn: F(({ row: n }) => [A(e.$slots, t, { row: n })])
396
+ fn: F(({ row: n }) => [j(e.$slots, t, { row: n })])
396
397
  }))]), 1040, [
397
398
  "border",
398
399
  "class",
@@ -400,40 +401,40 @@ function $(e, t, n, r, i, o) {
400
401
  "onSelectionChange"
401
402
  ])])
402
403
  ]),
403
- y("搜索条件"),
404
- n.searchFormPosition === "right" ? (O(), v(_, {
404
+ b("搜索条件"),
405
+ n.searchFormPosition === "right" ? (k(), y(v, {
405
406
  key: 0,
406
407
  name: "slide"
407
408
  }, {
408
- default: F(() => [o.toolbarProps.searchable ? I((O(), b("div", {
409
+ default: F(() => [o.toolbarProps.searchable ? I((k(), x("div", {
409
410
  key: 0,
410
- style: D({ width: `${o.searchPanelProps.width}px` }),
411
+ style: O({ width: `${o.searchPanelProps.width}px` }),
411
412
  class: "slide-panel"
412
- }, [y("<div class=\"slide-panel-line\">\r\n <div class=\"slide-panel-line-indicator\"></div>\r\n </div>"), x("div", Z, [w(m, {
413
+ }, [b("<div class=\"slide-panel-line\">\r\n <div class=\"slide-panel-line-indicator\"></div>\r\n </div>"), S("div", Z, [T(h, {
413
414
  ref: "form",
414
415
  "label-position": "right",
415
416
  model: n.searchModel || o.searchPanelProps.model,
416
417
  "label-width": n.labelWidth,
417
418
  onSubmitCapture: L(o.onSearchClick, ["prevent"])
418
419
  }, {
419
- default: F(() => [w(p, {
420
+ default: F(() => [T(m, {
420
421
  block: "",
421
422
  "wrap-col": !1
422
423
  }, {
423
- default: F(() => [w(f, { gutter: 0 }, {
424
- default: F(() => [A(e.$slots, "search-form", {}, () => [t[6] || (t[6] = x("p", null, "请添加搜索条件!", -1))])]),
424
+ default: F(() => [T(p, { gutter: 0 }, {
425
+ default: F(() => [j(e.$slots, "search-form", {}, () => [t[6] || (t[6] = S("p", null, "请添加搜索条件!", -1))])]),
425
426
  _: 3
426
427
  })]),
427
428
  _: 3
428
- }), w(G, { "label-width": "0" }, {
429
- default: F(() => [x("div", Q, [w(u, {
429
+ }), T(G, { "label-width": "0" }, {
430
+ default: F(() => [S("div", Q, [T(d, {
430
431
  type: "primary",
431
432
  "native-type": "submit"
432
433
  }, {
433
- default: F(() => [...t[7] || (t[7] = [C("开始搜索", -1)])]),
434
+ default: F(() => [...t[7] || (t[7] = [w("开始搜索", -1)])]),
434
435
  _: 1
435
- }), w(u, { onClick: o.onClearClick }, {
436
- default: F(() => [...t[8] || (t[8] = [C("清除条件", -1)])]),
436
+ }), T(d, { onClick: o.onClearClick }, {
437
+ default: F(() => [...t[8] || (t[8] = [w("清除条件", -1)])]),
437
438
  _: 1
438
439
  }, 8, ["onClick"])])]),
439
440
  _: 1
@@ -443,11 +444,11 @@ function $(e, t, n, r, i, o) {
443
444
  "model",
444
445
  "label-width",
445
446
  "onSubmitCapture"
446
- ])])], 4)), [[P, i.isSearchVisible]]) : y("v-if", !0)]),
447
+ ])])], 4)), [[P, i.isSearchVisible]]) : b("v-if", !0)]),
447
448
  _: 3
448
- })) : y("v-if", !0)
449
+ })) : b("v-if", !0)
449
450
  ]),
450
- A(e.$slots, "default")
451
+ j(e.$slots, "default")
451
452
  ])], 2);
452
453
  }
453
454
  var ee = /* @__PURE__ */ o(G, [["render", $]]);