@silver-formily/element-plus 3.0.0 → 3.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 (137) hide show
  1. package/README.en-US.md +32 -32
  2. package/README.md +32 -32
  3. package/esm/__builtins__/configs/index.mjs.map +1 -1
  4. package/esm/__builtins__/index.mjs +18 -18
  5. package/esm/__builtins__/shared/loading.mjs.map +1 -1
  6. package/esm/__builtins__/shared/simple-version-compare.mjs.map +1 -1
  7. package/esm/__builtins__/shared/transform-component.mjs.map +1 -1
  8. package/esm/__builtins__/shared/use-enter-submit.mjs.map +1 -1
  9. package/esm/__builtins__/shared/utils.mjs.map +1 -1
  10. package/esm/array-base/index.mjs +63 -59
  11. package/esm/array-base/index.mjs.map +1 -1
  12. package/esm/array-base/symbols.mjs.map +1 -1
  13. package/esm/array-base/utils.mjs +37 -31
  14. package/esm/array-base/utils.mjs.map +1 -1
  15. package/esm/array-cards/index.mjs +36 -33
  16. package/esm/array-cards/index.mjs.map +1 -1
  17. package/esm/array-collapse/index.mjs +39 -37
  18. package/esm/array-collapse/index.mjs.map +1 -1
  19. package/esm/array-collapse/utils.mjs +9 -2
  20. package/esm/array-collapse/utils.mjs.map +1 -1
  21. package/esm/array-items/index.mjs +38 -34
  22. package/esm/array-items/index.mjs.map +1 -1
  23. package/esm/array-list-tabs/index.mjs +38 -36
  24. package/esm/array-list-tabs/index.mjs.map +1 -1
  25. package/esm/array-list-tabs/utils.mjs +12 -5
  26. package/esm/array-list-tabs/utils.mjs.map +1 -1
  27. package/esm/array-table/index.mjs +62 -60
  28. package/esm/array-table/index.mjs.map +1 -1
  29. package/esm/array-table/utils.mjs +18 -11
  30. package/esm/array-table/utils.mjs.map +1 -1
  31. package/esm/array-tabs/index.mjs +28 -25
  32. package/esm/array-tabs/index.mjs.map +1 -1
  33. package/esm/autocomplete/index.mjs +22 -18
  34. package/esm/autocomplete/index.mjs.map +1 -1
  35. package/esm/cascader/index.mjs +22 -18
  36. package/esm/cascader/index.mjs.map +1 -1
  37. package/esm/checkbox/index.mjs +20 -16
  38. package/esm/checkbox/index.mjs.map +1 -1
  39. package/esm/color-picker/index.mjs +9 -6
  40. package/esm/color-picker/index.mjs.map +1 -1
  41. package/esm/color-picker-panel/index.mjs +9 -6
  42. package/esm/color-picker-panel/index.mjs.map +1 -1
  43. package/esm/date-picker/index.mjs +14 -11
  44. package/esm/date-picker/index.mjs.map +1 -1
  45. package/esm/date-picker/utils.mjs.map +1 -1
  46. package/esm/date-picker-panel/index.mjs +14 -11
  47. package/esm/date-picker-panel/index.mjs.map +1 -1
  48. package/esm/editable/index.mjs +33 -30
  49. package/esm/editable/index.mjs.map +1 -1
  50. package/esm/form/form.mjs +6 -6
  51. package/esm/form/form.mjs.map +1 -1
  52. package/esm/form-button-group/index.mjs +18 -14
  53. package/esm/form-button-group/index.mjs.map +1 -1
  54. package/esm/form-button-group/utils.mjs +9 -2
  55. package/esm/form-button-group/utils.mjs.map +1 -1
  56. package/esm/form-collapse/index.mjs +21 -18
  57. package/esm/form-collapse/index.mjs.map +1 -1
  58. package/esm/form-collapse/utils.mjs.map +1 -1
  59. package/esm/form-dialog/index.d.ts +1 -1
  60. package/esm/form-dialog/index.mjs +22 -22
  61. package/esm/form-dialog/index.mjs.map +1 -1
  62. package/esm/form-dialog/types.d.ts +13 -5
  63. package/esm/form-drawer/index.d.ts +1 -1
  64. package/esm/form-drawer/index.mjs +21 -21
  65. package/esm/form-drawer/index.mjs.map +1 -1
  66. package/esm/form-drawer/types.d.ts +13 -5
  67. package/esm/form-grid/hooks.mjs.map +1 -1
  68. package/esm/form-grid/index.mjs +21 -18
  69. package/esm/form-grid/index.mjs.map +1 -1
  70. package/esm/form-item/index.mjs +55 -53
  71. package/esm/form-item/index.mjs.map +1 -1
  72. package/esm/form-item/utils.mjs.map +1 -1
  73. package/esm/form-layout/form-layout.mjs +14 -10
  74. package/esm/form-layout/form-layout.mjs.map +1 -1
  75. package/esm/form-layout/utils.mjs.map +1 -1
  76. package/esm/form-step/index.mjs +30 -27
  77. package/esm/form-step/index.mjs.map +1 -1
  78. package/esm/form-step/utils.mjs.map +1 -1
  79. package/esm/form-tab/hooks.mjs.map +1 -1
  80. package/esm/form-tab/index.mjs +25 -23
  81. package/esm/form-tab/index.mjs.map +1 -1
  82. package/esm/form-tab/utils.mjs.map +1 -1
  83. package/esm/index.mjs +72 -72
  84. package/esm/input/index.mjs +30 -26
  85. package/esm/input/index.mjs.map +1 -1
  86. package/esm/input-number/index.mjs +11 -8
  87. package/esm/input-number/index.mjs.map +1 -1
  88. package/esm/input-tag/index.mjs +20 -16
  89. package/esm/input-tag/index.mjs.map +1 -1
  90. package/esm/mention/index.mjs +24 -20
  91. package/esm/mention/index.mjs.map +1 -1
  92. package/esm/pagination/components/jumper.mjs.map +1 -1
  93. package/esm/pagination/components/next.mjs.map +1 -1
  94. package/esm/pagination/components/pager.mjs.map +1 -1
  95. package/esm/pagination/components/prev.mjs.map +1 -1
  96. package/esm/pagination/components/total.mjs.map +1 -1
  97. package/esm/pagination/pagination.mjs.map +1 -1
  98. package/esm/password/index.mjs.map +1 -1
  99. package/esm/preview-text/index.mjs +31 -27
  100. package/esm/preview-text/index.mjs.map +1 -1
  101. package/esm/preview-text/utils.mjs.map +1 -1
  102. package/esm/query-form/default-components.mjs.map +1 -1
  103. package/esm/query-form/hooks.mjs.map +1 -1
  104. package/esm/query-form/index.mjs +51 -48
  105. package/esm/query-form/index.mjs.map +1 -1
  106. package/esm/query-form-item/index.mjs +37 -34
  107. package/esm/query-form-item/index.mjs.map +1 -1
  108. package/esm/radio/index.mjs +29 -25
  109. package/esm/radio/index.mjs.map +1 -1
  110. package/esm/rate/index.mjs +13 -10
  111. package/esm/rate/index.mjs.map +1 -1
  112. package/esm/reset/index.mjs.map +1 -1
  113. package/esm/segmented/index.mjs +16 -12
  114. package/esm/segmented/index.mjs.map +1 -1
  115. package/esm/select/index.mjs +26 -22
  116. package/esm/select/index.mjs.map +1 -1
  117. package/esm/select-table/index.mjs +16 -12
  118. package/esm/select-table/index.mjs.map +1 -1
  119. package/esm/shared/overlay-elements.mjs.map +1 -1
  120. package/esm/slider/index.mjs +13 -10
  121. package/esm/slider/index.mjs.map +1 -1
  122. package/esm/submit/index.mjs.map +1 -1
  123. package/esm/switch/index.mjs.map +1 -1
  124. package/esm/time-picker/index.mjs +9 -6
  125. package/esm/time-picker/index.mjs.map +1 -1
  126. package/esm/time-select/index.mjs +9 -6
  127. package/esm/time-select/index.mjs.map +1 -1
  128. package/esm/transfer/index.mjs.map +1 -1
  129. package/esm/tree/index.mjs +33 -29
  130. package/esm/tree/index.mjs.map +1 -1
  131. package/esm/tree/utils.mjs.map +1 -1
  132. package/esm/tree-select/index.mjs +18 -14
  133. package/esm/tree-select/index.mjs.map +1 -1
  134. package/esm/upload/index.mjs +10 -7
  135. package/esm/upload/index.mjs.map +1 -1
  136. package/esm/vendor/sizes.mjs.map +1 -1
  137. package/package.json +6 -5
@@ -1,9 +1,13 @@
1
- import { defineComponent as Y, openBlock as r, createElementBlock as p, normalizeClass as M, createBlock as c, unref as e, normalizeProps as h, mergeProps as d, withCtx as n, createTextVNode as u, toDisplayString as a, Fragment as x, renderList as z, normalizeStyle as J, createCommentVNode as b, createVNode as I, guardReactiveProps as U, computed as E, useSlots as O, renderSlot as H, provide as Q, reactive as X } from "vue";
2
- import { useField as N } from "@silver-formily/vue";
3
- import { ElText as k, ElSpace as K, ElTag as W, dayjs as S, ElRate as Z, ElScrollbar as ee, ElTree as te } from "element-plus";
4
- import { usePreviewConfig as $, previewTextConfigKey as re } from "./utils.mjs";
5
- import { useCleanAttrs as T, composeExport as ae } from "../__builtins__/shared/utils.mjs";
6
- import { stylePrefix as C } from "../__builtins__/configs/index.mjs";
1
+ import { ElText as k, ElSpace as K, ElTag as z, dayjs as S, ElRate as J, ElScrollbar as O, ElTree as Q } from "element-plus";
2
+ import "@formily/reactive";
3
+ import "@vueuse/core";
4
+ import { defineComponent as Y, openBlock as r, createElementBlock as p, normalizeClass as M, createBlock as c, unref as e, normalizeProps as h, mergeProps as d, withCtx as n, createTextVNode as u, toDisplayString as a, Fragment as x, renderList as I, normalizeStyle as X, createCommentVNode as b, createVNode as N, guardReactiveProps as U, computed as E, useSlots as Z, renderSlot as H, provide as ee, reactive as te } from "vue";
5
+ import "@formily/core";
6
+ import "@silver-formily/reactive-vue";
7
+ import { useField as W } from "@silver-formily/vue";
8
+ import { useCleanAttrs as $, composeExport as re } from "../__builtins__/shared/utils.mjs";
9
+ import { stylePrefix as T } from "../__builtins__/configs/index.mjs";
10
+ import { usePreviewConfig as C, previewTextConfigKey as ae } from "./utils.mjs";
7
11
  import { isValid as R, isFn as q, isArr as le } from "@formily/shared";
8
12
  import { getSelectedPath as oe } from "../tree/utils.mjs";
9
13
  import '../styles/preview-text/index.css';const se = /* @__PURE__ */ Y({
@@ -14,7 +18,7 @@ import '../styles/preview-text/index.css';const se = /* @__PURE__ */ Y({
14
18
  modelValue: {}
15
19
  },
16
20
  setup(_) {
17
- const t = _, l = `${C}-preview-text`, v = N().value, { props: o } = T(), y = !!o.value.props?.multiple, f = o.value.showAllLevels ?? !0, s = v?.dataSource ?? [], { spaceProps: i, textProps: P, tagProps: A, placeholder: V } = $(), D = o.value.props?.value || "value", B = o.value.props?.label || "label";
21
+ const t = _, l = `${T}-preview-text`, v = W().value, { props: o } = $(), y = !!o.value.props?.multiple, f = o.value.showAllLevels ?? !0, s = v?.dataSource ?? [], { spaceProps: i, textProps: P, tagProps: A, placeholder: V } = C(), D = o.value.props?.value || "value", B = o.value.props?.label || "label";
18
22
  function F(L, j) {
19
23
  const g = j.find((w) => w?.[D] === L);
20
24
  return g ? g[B] : j.map((w) => w?.children ? F(L, w.children) : void 0).find((w) => w !== void 0);
@@ -24,7 +28,7 @@ import '../styles/preview-text/index.css';const se = /* @__PURE__ */ Y({
24
28
  }, [
25
29
  Array.isArray(t.modelValue) ? y && Array.isArray(t.modelValue[0]) ? (r(), c(e(K), h(d({ key: 1 }, e(i))), {
26
30
  default: n(() => [
27
- (r(!0), p(x, null, z(t.modelValue, (g, w) => (r(), c(e(W), d({ key: w }, { ref_for: !0 }, e(A)), {
31
+ (r(!0), p(x, null, I(t.modelValue, (g, w) => (r(), c(e(z), d({ key: w }, { ref_for: !0 }, e(A)), {
28
32
  default: n(() => [
29
33
  e(f) ? (r(), p(x, { key: 0 }, [
30
34
  u(a(g.map((G) => F(G, e(s)) || e(V)).join(` ${e(o).separator ?? "/"} `)), 1)
@@ -61,7 +65,7 @@ import '../styles/preview-text/index.css';const se = /* @__PURE__ */ Y({
61
65
  modelValue: {}
62
66
  },
63
67
  setup(_) {
64
- const t = _, { props: l } = T(), m = `${C}-preview-text`, v = `${m}__color`, { spaceProps: o, textProps: y, placeholder: f } = $();
68
+ const t = _, { props: l } = $(), m = `${T}-preview-text`, v = `${m}__color`, { spaceProps: o, textProps: y, placeholder: f } = C();
65
69
  return (s, i) => (r(), c(e(K), d({
66
70
  class: [m, v]
67
71
  }, e(o)), {
@@ -69,9 +73,9 @@ import '../styles/preview-text/index.css';const se = /* @__PURE__ */ Y({
69
73
  e(R)(t.modelValue) ? (r(), p("div", {
70
74
  key: 0,
71
75
  class: M(`${v}-swatch`),
72
- style: J({ backgroundColor: t.modelValue })
76
+ style: X({ backgroundColor: t.modelValue })
73
77
  }, null, 6)) : b("", !0),
74
- I(e(k), h(U(e(y))), {
78
+ N(e(k), h(U(e(y))), {
75
79
  default: n(() => [
76
80
  e(q)(e(l).formatter) ? (r(), p(x, { key: 0 }, [
77
81
  u(a(e(l).formatter(t.modelValue)), 1)
@@ -95,7 +99,7 @@ import '../styles/preview-text/index.css';const se = /* @__PURE__ */ Y({
95
99
  modelValue: {}
96
100
  },
97
101
  setup(_) {
98
- const t = _, { props: l } = T(), m = `${C}-preview-text`, { spaceProps: v, textProps: o, tagProps: y, placeholder: f } = $();
102
+ const t = _, { props: l } = $(), m = `${T}-preview-text`, { spaceProps: v, textProps: o, tagProps: y, placeholder: f } = C();
99
103
  function s(A) {
100
104
  switch (A) {
101
105
  case "year":
@@ -138,7 +142,7 @@ import '../styles/preview-text/index.css';const se = /* @__PURE__ */ Y({
138
142
  _: 1
139
143
  }, 16)) : i.value.endsWith("s") ? (r(), c(e(K), h(d({ key: 1 }, e(v))), {
140
144
  default: n(() => [
141
- (r(!0), p(x, null, z(t.modelValue, (D) => (r(), c(e(W), d({ key: D }, { ref_for: !0 }, e(y)), {
145
+ (r(!0), p(x, null, I(t.modelValue, (D) => (r(), c(e(z), d({ key: D }, { ref_for: !0 }, e(y)), {
142
146
  default: n(() => [
143
147
  u(a(e(S)(D).format(P.value)), 1)
144
148
  ]),
@@ -168,12 +172,12 @@ import '../styles/preview-text/index.css';const se = /* @__PURE__ */ Y({
168
172
  modelValue: {}
169
173
  },
170
174
  setup(_) {
171
- const t = _, l = O(), { props: m } = T(), v = `${C}-preview-text`, { spaceProps: o, textProps: y, placeholder: f } = $();
175
+ const t = _, l = Z(), { props: m } = $(), v = `${T}-preview-text`, { spaceProps: o, textProps: y, placeholder: f } = C();
172
176
  return (s, i) => (r(), c(e(K), d({ class: v }, e(o)), {
173
177
  default: n(() => [
174
178
  l.prepend ? H(s.$slots, "prepend", { key: 0 }) : b("", !0),
175
179
  l.prefix ? H(s.$slots, "prefix", { key: 1 }) : b("", !0),
176
- I(e(k), h(U(e(y))), {
180
+ N(e(k), h(U(e(y))), {
177
181
  default: n(() => [
178
182
  e(q)(e(m).formatter) ? (r(), p(x, { key: 0 }, [
179
183
  u(a(e(m).formatter(t.modelValue)), 1)
@@ -203,7 +207,7 @@ import '../styles/preview-text/index.css';const se = /* @__PURE__ */ Y({
203
207
  },
204
208
  setup(_) {
205
209
  const t = _;
206
- return Q(re, X({
210
+ return ee(ae, te({
207
211
  placeholder: t.placeholder,
208
212
  tagProps: t.tagProps,
209
213
  spaceProps: t.spaceProps,
@@ -218,11 +222,11 @@ import '../styles/preview-text/index.css';const se = /* @__PURE__ */ Y({
218
222
  modelValue: {}
219
223
  },
220
224
  setup(_) {
221
- const t = _, { props: l } = T(), m = `${C}-preview-text`, { textProps: v, placeholder: o } = $();
225
+ const t = _, { props: l } = $(), m = `${T}-preview-text`, { textProps: v, placeholder: o } = C();
222
226
  return (y, f) => (r(), p("div", {
223
227
  class: M(m)
224
228
  }, [
225
- e(R)(t.modelValue) ? (r(), c(e(Z), d({ key: 1 }, e(l), {
229
+ e(R)(t.modelValue) ? (r(), c(e(J), d({ key: 1 }, e(l), {
226
230
  "model-value": t.modelValue,
227
231
  disabled: !0
228
232
  }), null, 16, ["model-value"])) : (r(), c(e(k), h(d({ key: 0 }, e(v))), {
@@ -240,13 +244,13 @@ import '../styles/preview-text/index.css';const se = /* @__PURE__ */ Y({
240
244
  modelValue: {}
241
245
  },
242
246
  setup(_) {
243
- const t = _, l = `${C}-preview-text`, m = N(), { props: v } = T(), o = m.value.dataSource ?? [], { spaceProps: y, textProps: f, tagProps: s, placeholder: i } = $();
247
+ const t = _, l = `${T}-preview-text`, m = W(), { props: v } = $(), o = m.value.dataSource ?? [], { spaceProps: y, textProps: f, tagProps: s, placeholder: i } = C();
244
248
  return (P, A) => (r(), p("div", {
245
249
  class: M(l)
246
250
  }, [
247
251
  e(R)(t.modelValue) ? e(v).multiple ? (r(), c(e(K), h(d({ key: 2 }, e(y))), {
248
252
  default: n(() => [
249
- (r(!0), p(x, null, z(t.modelValue, (V, D) => (r(), c(e(W), d({ key: D }, { ref_for: !0 }, e(s)), {
253
+ (r(!0), p(x, null, I(t.modelValue, (V, D) => (r(), c(e(z), d({ key: D }, { ref_for: !0 }, e(s)), {
250
254
  default: n(() => [
251
255
  u(a(e(o).find((B) => B.value === V)?.label ?? V), 1)
252
256
  ]),
@@ -275,7 +279,7 @@ import '../styles/preview-text/index.css';const se = /* @__PURE__ */ Y({
275
279
  modelValue: {}
276
280
  },
277
281
  setup(_) {
278
- const t = _, { props: l } = T(), m = `${C}-preview-text`, { textProps: v, placeholder: o } = $(), y = l.value.format || "HH:mm:ss", f = l.value.valueFormat || "HH:mm:ss";
282
+ const t = _, { props: l } = $(), m = `${T}-preview-text`, { textProps: v, placeholder: o } = C(), y = l.value.format || "HH:mm:ss", f = l.value.valueFormat || "HH:mm:ss";
279
283
  function s(i) {
280
284
  if (i) {
281
285
  if (i instanceof Date)
@@ -318,17 +322,17 @@ import '../styles/preview-text/index.css';const se = /* @__PURE__ */ Y({
318
322
  maxHeight: {}
319
323
  },
320
324
  setup(_) {
321
- const t = _, l = `${C}-preview-tree`, m = N(), { props: v } = T(["modelValue", "onUpdate:modelValue"]), { textProps: o, placeholder: y } = $(), f = E(() => m.value.dataSource ?? t.data ?? []), s = E(() => t.modelValue !== void 0 ? t.modelValue : m.value?.value), i = E(() => !s.value || !Array.isArray(s.value) || s.value.length === 0 ? [] : t.valueType === "path" ? s.value : oe(f.value, s.value, t.nodeKey, t.props));
325
+ const t = _, l = `${T}-preview-tree`, m = W(), { props: v } = $(["modelValue", "onUpdate:modelValue"]), { textProps: o, placeholder: y } = C(), f = E(() => m.value.dataSource ?? t.data ?? []), s = E(() => t.modelValue !== void 0 ? t.modelValue : m.value?.value), i = E(() => !s.value || !Array.isArray(s.value) || s.value.length === 0 ? [] : t.valueType === "path" ? s.value : oe(f.value, s.value, t.nodeKey, t.props));
322
326
  return (P, A) => (r(), p("div", {
323
327
  class: M(l)
324
328
  }, [
325
- i.value.length > 0 ? (r(), c(e(ee), {
329
+ i.value.length > 0 ? (r(), c(e(O), {
326
330
  key: 0,
327
331
  height: t.height,
328
332
  "max-height": t.maxHeight
329
333
  }, {
330
334
  default: n(() => [
331
- I(e(te), d({
335
+ N(e(Q), d({
332
336
  data: i.value,
333
337
  "node-key": t.nodeKey,
334
338
  props: t.props,
@@ -344,7 +348,7 @@ import '../styles/preview-text/index.css';const se = /* @__PURE__ */ Y({
344
348
  }, 16))
345
349
  ]));
346
350
  }
347
- }), Ye = ae(ce, {
351
+ }), Te = re(ce, {
348
352
  Input: pe,
349
353
  Select: ie,
350
354
  Cascader: se,
@@ -355,7 +359,7 @@ import '../styles/preview-text/index.css';const se = /* @__PURE__ */ Y({
355
359
  Tree: fe
356
360
  });
357
361
  export {
358
- Ye as PreviewText,
359
- Ye as default
362
+ Te as PreviewText,
363
+ Te as default
360
364
  };
361
365
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/preview-text/cascader.vue","../../src/preview-text/color-picker.vue","../../src/preview-text/date-picker.vue","../../src/preview-text/input.vue","../../src/preview-text/preview.vue","../../src/preview-text/rate.vue","../../src/preview-text/select.vue","../../src/preview-text/time-picker.vue","../../src/preview-text/tree.vue","../../src/preview-text/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport type { Field } from '@formily/core'\r\nimport { useField } from '@silver-formily/vue'\r\nimport { ElSpace, ElTag, ElText } from 'element-plus'\r\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\r\nimport { usePreviewConfig } from './utils'\r\n\r\ndefineOptions({\r\n name: 'FPreviewTextCascader',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps<{\r\n modelValue: any\r\n}>()\r\nconst prefixCls = `${stylePrefix}-preview-text`\r\nconst fieldRef = useField<Field>()\r\nconst field = fieldRef.value\r\nconst { props: attrs } = useCleanAttrs()\r\nconst isMultiple = !!attrs.value.props?.multiple\r\nconst isShowAllLevels = attrs.value.showAllLevels ?? true\r\nconst dataSource: any[] = field?.dataSource ?? []\r\nconst { spaceProps, textProps, tagProps, placeholder } = usePreviewConfig()\r\n\r\nconst valueKey = attrs.value.props?.value || 'value'\r\nconst labelKey = attrs.value.props?.label || 'label'\r\n\r\nfunction findLabel(value: any, dataSource: any[]): any {\r\n const foundItem = dataSource.find(item => item?.[valueKey] === value)\r\n if (foundItem)\r\n return foundItem[labelKey]\r\n return dataSource\r\n .map(item => item?.children ? findLabel(value, item.children) : undefined)\r\n .find(label => label !== undefined)\r\n}\r\n</script>\r\n\r\n<template>\r\n <div :class=\"prefixCls\">\r\n <template v-if=\"!Array.isArray(props.modelValue)\">\r\n <ElText v-bind=\"textProps\">\r\n {{ placeholder }}\r\n </ElText>\r\n </template>\r\n <template v-else-if=\"isMultiple && Array.isArray(props.modelValue[0])\">\r\n <ElSpace v-bind=\"spaceProps\">\r\n <ElTag v-for=\"(item, key) of props.modelValue\" :key=\"key\" v-bind=\"tagProps\">\r\n <template v-if=\"isShowAllLevels\">\r\n {{ item.map(val => findLabel(val, dataSource) || placeholder).join(` ${attrs.separator ?? '/'} `) }}\r\n </template>\r\n <template v-else>\r\n {{ findLabel(item[item.length - 1], dataSource) || placeholder }}\r\n </template>\r\n </ElTag>\r\n </ElSpace>\r\n </template>\r\n <template v-else>\r\n <ElText v-bind=\"textProps\">\r\n <template v-if=\"isShowAllLevels\">\r\n {{ props.modelValue.map(val => findLabel(val, dataSource) || placeholder).join(` ${attrs.separator ?? '/'} `) }}\r\n </template>\r\n <template v-else>\r\n {{ findLabel(props.modelValue[props.modelValue.length - 1], dataSource) || placeholder }}\r\n </template>\r\n </ElText>\r\n </template>\r\n </div>\r\n</template>\r\n","<script setup lang=\"ts\">\r\nimport { isFn, isValid } from '@formily/shared'\r\nimport { ElSpace, ElText } from 'element-plus'\r\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\r\nimport { usePreviewConfig } from './utils'\r\n\r\ndefineOptions({\r\n name: 'FPreviewTextColorPicker',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps<{\r\n modelValue?: any\r\n}>()\r\n\r\nconst { props: attrs } = useCleanAttrs()\r\nconst prefixCls = `${stylePrefix}-preview-text`\r\nconst colorCls = `${prefixCls}__color`\r\nconst { spaceProps, textProps, placeholder } = usePreviewConfig()\r\n</script>\r\n\r\n<template>\r\n <ElSpace :class=\"[prefixCls, colorCls]\" v-bind=\"spaceProps\">\r\n <div\r\n v-if=\"isValid(props.modelValue)\"\r\n :class=\"`${colorCls}-swatch`\"\r\n :style=\"{ backgroundColor: props.modelValue }\"\r\n />\r\n <ElText v-bind=\"textProps\">\r\n <template v-if=\"isFn(attrs.formatter)\">\r\n {{ attrs.formatter(props.modelValue) }}\r\n </template>\r\n <template v-else-if=\"isValid(props.modelValue)\">\r\n {{ props.modelValue }}\r\n </template>\r\n <template v-else>\r\n {{ placeholder }}\r\n </template>\r\n </ElText>\r\n </ElSpace>\r\n</template>\r\n","<script setup lang=\"ts\">\r\nimport { dayjs, ElSpace, ElTag, ElText } from 'element-plus'\r\nimport { computed } from 'vue'\r\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\r\nimport { usePreviewConfig } from './utils'\r\n\r\ndefineOptions({\r\n name: 'FPreviewTextDatePicker',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps<{\r\n modelValue?: any\r\n}>()\r\nconst { props: attrs } = useCleanAttrs()\r\nconst prefixCls = `${stylePrefix}-preview-text`\r\nconst { spaceProps, textProps, tagProps, placeholder } = usePreviewConfig()\r\n\r\nfunction getFormatByType(type: string): string {\r\n switch (type) {\r\n case 'year': {\r\n return 'YYYY'\r\n }\r\n case 'years': {\r\n return 'YYYY'\r\n }\r\n case 'month': {\r\n return 'YYYY-MM'\r\n }\r\n case 'months': {\r\n return 'YYYY-MM'\r\n }\r\n case 'week': {\r\n return '[Week] ww'\r\n }\r\n case 'date': {\r\n return 'YYYY-MM-DD'\r\n }\r\n case 'dates': {\r\n return 'YYYY-MM-DD'\r\n }\r\n case 'datetime': {\r\n return 'YYYY-MM-DD HH:mm:ss'\r\n }\r\n case 'daterange': {\r\n return 'YYYY-MM-DD'\r\n }\r\n case 'monthrange': {\r\n return 'YYYY-MM'\r\n }\r\n case 'yearrange': {\r\n return 'YYYY'\r\n }\r\n case 'datetimerange': {\r\n return 'YYYY-MM-DD HH:mm:ss'\r\n }\r\n default: {\r\n return 'YYYY-MM-DD'\r\n }\r\n }\r\n}\r\nconst type = computed(() => attrs.value.type || 'date')\r\nconst format = computed(() => attrs.value.format || getFormatByType(type.value))\r\n</script>\r\n\r\n<template>\r\n <div :class=\"prefixCls\">\r\n <template v-if=\"props.modelValue\">\r\n <template v-if=\"type.endsWith('range')\">\r\n <ElText v-bind=\"textProps\">\r\n {{ props.modelValue[0] ? dayjs(props.modelValue[0]).format(format) : placeholder }}\r\n {{ attrs.rangeSeparator ?? '~' }}\r\n {{ props.modelValue[1] ? dayjs(props.modelValue[1]).format(format) : placeholder }}\r\n </ElText>\r\n </template>\r\n <template v-else-if=\"type.endsWith('s')\">\r\n <ElSpace v-bind=\"spaceProps\">\r\n <ElTag v-for=\"i of props.modelValue\" :key=\"i\" v-bind=\"tagProps\">\r\n {{ dayjs(i).format(format) }}\r\n </ElTag>\r\n </ElSpace>\r\n </template>\r\n <template v-else>\r\n <ElText v-bind=\"textProps\">\r\n {{ dayjs(props.modelValue).format(format) }}\r\n </ElText>\r\n </template>\r\n </template>\r\n <template v-else>\r\n <ElText v-bind=\"textProps\">\r\n {{ placeholder }}\r\n </ElText>\r\n </template>\r\n </div>\r\n</template>\r\n","<script setup lang=\"ts\">\r\nimport { isFn, isValid } from '@formily/shared'\r\nimport { ElSpace, ElText } from 'element-plus'\r\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\r\nimport { usePreviewConfig } from './utils'\r\n\r\ndefineOptions({\r\n name: 'FPreviewTextInput',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps<{\r\n modelValue?: any\r\n}>()\r\n\r\nconst slots = defineSlots<{\r\n prepend?: () => any\r\n prefix?: () => any\r\n suffix?: () => any\r\n append?: () => any\r\n}>()\r\nconst { props: attrs } = useCleanAttrs()\r\nconst prefixCls = `${stylePrefix}-preview-text`\r\nconst { spaceProps, textProps, placeholder } = usePreviewConfig()\r\n</script>\r\n\r\n<template>\r\n <ElSpace :class=\"prefixCls\" v-bind=\"spaceProps\">\r\n <slot v-if=\"slots.prepend\" name=\"prepend\" />\r\n <slot v-if=\"slots.prefix\" name=\"prefix\" />\r\n <ElText v-bind=\"textProps\">\r\n <template v-if=\"isFn(attrs.formatter)\">\r\n {{ attrs.formatter(props.modelValue) }}\r\n </template>\r\n <template v-else-if=\"isValid(props.modelValue)\">\r\n {{ props.modelValue === '' ? '&nbsp;' : props.modelValue }}\r\n </template>\r\n <template v-else>\r\n {{ placeholder }}\r\n </template>\r\n </ElText>\r\n <slot v-if=\"slots.suffix\" name=\"suffix\" />\r\n <slot v-if=\"slots.append\" name=\"append\" />\r\n </ElSpace>\r\n</template>\r\n","<script setup lang=\"ts\">\r\nimport type { PreviewTextProps } from './utils'\r\nimport { provide, reactive } from 'vue'\r\nimport { previewTextConfigKey } from './utils'\r\n\r\ndefineOptions({\r\n name: 'FPreviewTextProvider',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps<PreviewTextProps>()\r\n\r\nprovide(previewTextConfigKey, reactive({\r\n placeholder: props.placeholder,\r\n tagProps: props.tagProps,\r\n spaceProps: props.spaceProps,\r\n textProps: props.textProps,\r\n}))\r\n</script>\r\n\r\n<template>\r\n <slot />\r\n</template>\r\n","<script setup lang=\"ts\">\r\nimport { isValid } from '@formily/shared'\r\nimport { ElRate, ElText } from 'element-plus'\r\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\r\nimport { usePreviewConfig } from './utils'\r\n\r\ndefineOptions({\r\n name: 'FPreviewTextRate',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps<{\r\n modelValue?: any\r\n}>()\r\n\r\nconst { props: attrs } = useCleanAttrs()\r\nconst prefixCls = `${stylePrefix}-preview-text`\r\nconst { textProps, placeholder } = usePreviewConfig()\r\n</script>\r\n\r\n<template>\r\n <div :class=\"prefixCls\">\r\n <ElText v-if=\"!isValid(props.modelValue)\" v-bind=\"textProps\">\r\n {{ placeholder }}\r\n </ElText>\r\n <ElRate\r\n v-else\r\n v-bind=\"attrs\"\r\n :model-value=\"props.modelValue\"\r\n :disabled=\"true\"\r\n />\r\n </div>\r\n</template>\r\n","<script setup lang=\"ts\">\r\nimport type { Field } from '@formily/core'\r\nimport { isValid } from '@formily/shared'\r\nimport { useField } from '@silver-formily/vue'\r\nimport { ElSpace, ElTag, ElText } from 'element-plus'\r\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\r\nimport { usePreviewConfig } from './utils'\r\n\r\ndefineOptions({\r\n name: 'FPreviewTextSelect',\r\n})\r\n\r\nconst props = defineProps<{\r\n modelValue?: any\r\n}>()\r\n\r\nconst prefixCls = `${stylePrefix}-preview-text`\r\n\r\nconst fieldRef = useField<Field>()\r\nconst { props: attrs } = useCleanAttrs()\r\nconst dataSource = fieldRef.value.dataSource ?? []\r\nconst { spaceProps, textProps, tagProps, placeholder } = usePreviewConfig()\r\n</script>\r\n\r\n<template>\r\n <div :class=\"prefixCls\">\r\n <template v-if=\"!isValid(props.modelValue)\">\r\n <ElText v-bind=\"textProps\">\r\n {{ placeholder }}\r\n </ElText>\r\n </template>\r\n <template v-else-if=\"!attrs.multiple\">\r\n <ElText v-bind=\"textProps\">\r\n {{ dataSource.find(i => i.value === props.modelValue)?.label ?? props.modelValue }}\r\n </ElText>\r\n </template>\r\n <ElSpace v-else v-bind=\"spaceProps\">\r\n <ElTag v-for=\"(item, key) of props.modelValue\" :key=\"key\" v-bind=\"tagProps\">\r\n {{ dataSource.find(i => i.value === item)?.label ?? item }}\r\n </ElTag>\r\n </ElSpace>\r\n </div>\r\n</template>\r\n","<script setup lang=\"ts\">\r\nimport { isArr } from '@formily/shared'\r\nimport { dayjs, ElText } from 'element-plus'\r\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\r\nimport { usePreviewConfig } from './utils'\r\n\r\ndefineOptions({\r\n name: 'FPreviewTextTimePicker',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps<{\r\n modelValue?: any\r\n}>()\r\nconst { props: attrs } = useCleanAttrs()\r\nconst prefixCls = `${stylePrefix}-preview-text`\r\nconst { textProps, placeholder } = usePreviewConfig()\r\nconst format = attrs.value.format || 'HH:mm:ss'\r\nconst parseFormat = attrs.value.valueFormat || 'HH:mm:ss'\r\n\r\nfunction formatTimeValue(value: any): string | void {\r\n if (!value)\r\n return\r\n if (value instanceof Date) {\r\n return dayjs(value).format(format)\r\n }\r\n if (typeof value === 'string') {\r\n return dayjs(value, parseFormat).format(format)\r\n }\r\n}\r\n</script>\r\n\r\n<template>\r\n <div :class=\"prefixCls\">\r\n <template v-if=\"isArr(props.modelValue)\">\r\n <ElText v-bind=\"textProps\">\r\n {{ formatTimeValue(props.modelValue[0]) || placeholder }}\r\n {{ attrs.rangeSeparator ?? '~' }}\r\n {{ formatTimeValue(props.modelValue[1]) || placeholder }}\r\n </ElText>\r\n </template>\r\n <template v-else>\r\n <ElText v-bind=\"textProps\">\r\n {{ formatTimeValue(props.modelValue) || placeholder }}\r\n </ElText>\r\n </template>\r\n </div>\r\n</template>\r\n","<script setup lang=\"ts\">\r\nimport type { ArrayField } from '@formily/core'\r\nimport { useField } from '@silver-formily/vue'\r\nimport { ElScrollbar, ElText, ElTree } from 'element-plus'\r\nimport { computed } from 'vue'\r\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\r\nimport { getSelectedPath } from '../tree/utils'\r\nimport { usePreviewConfig } from './utils'\r\n\r\ndefineOptions({\r\n name: 'FPreviewTree',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = withDefaults(defineProps<{\r\n nodeKey: string\r\n modelValue?: any\r\n valueType?: string\r\n data?: any[]\r\n props?: {\r\n children?: string\r\n label?: string\r\n disabled?: string\r\n }\r\n height?: number\r\n maxHeight?: number\r\n}>(), {\r\n valueType: 'all',\r\n props: () => ({\r\n children: 'children',\r\n label: 'label',\r\n disabled: 'disabled',\r\n }),\r\n})\r\n\r\nconst prefixCls = `${stylePrefix}-preview-tree`\r\nconst fieldRef = useField<ArrayField>()\r\nconst { props: attrs } = useCleanAttrs(['modelValue', 'onUpdate:modelValue'])\r\nconst { textProps, placeholder } = usePreviewConfig()\r\n\r\nconst dataSource = computed(() => {\r\n return fieldRef.value.dataSource ?? props.data ?? []\r\n})\r\n\r\nconst resolvedValue = computed(() => {\r\n if (props.modelValue !== undefined)\r\n return props.modelValue\r\n return fieldRef.value?.value\r\n})\r\n\r\nconst previewData = computed(() => {\r\n if (!resolvedValue.value || !Array.isArray(resolvedValue.value) || resolvedValue.value.length === 0) {\r\n return []\r\n }\r\n switch (props.valueType) {\r\n case 'path': {\r\n return resolvedValue.value\r\n }\r\n default: {\r\n const selectedPath = getSelectedPath(dataSource.value, resolvedValue.value, props.nodeKey, props.props)\r\n return selectedPath\r\n }\r\n }\r\n})\r\n</script>\r\n\r\n<template>\r\n <div :class=\"prefixCls\">\r\n <ElScrollbar\r\n v-if=\"previewData.length > 0\"\r\n :height=\"props.height\"\r\n :max-height=\"props.maxHeight\"\r\n >\r\n <ElTree\r\n :data=\"previewData\"\r\n :node-key=\"props.nodeKey\"\r\n :props=\"props.props\"\r\n :default-expand-all=\"true\"\r\n v-bind=\"attrs\"\r\n />\r\n </ElScrollbar>\r\n <ElText v-else v-bind=\"textProps\">\r\n {{ placeholder }}\r\n </ElText>\r\n </div>\r\n</template>\r\n","import { composeExport } from '../__builtins__/shared'\r\nimport Cascader from './cascader.vue'\r\nimport ColorPicker from './color-picker.vue'\r\nimport DatePicker from './date-picker.vue'\r\nimport Input from './input.vue'\r\nimport Preview from './preview.vue'\r\nimport Rate from './rate.vue'\r\nimport Select from './select.vue'\r\nimport TimePicker from './time-picker.vue'\r\nimport Tree from './tree.vue'\r\nimport './style.scss'\r\n\r\nexport const PreviewText = composeExport(Preview, {\r\n Input,\r\n Select,\r\n Cascader,\r\n ColorPicker,\r\n DatePicker,\r\n Rate,\r\n TimePicker,\r\n Tree,\r\n})\r\n\r\nexport default PreviewText\r\n"],"names":["props","__props","prefixCls","stylePrefix","field","useField","attrs","useCleanAttrs","isMultiple","isShowAllLevels","dataSource","spaceProps","textProps","tagProps","placeholder","usePreviewConfig","valueKey","labelKey","findLabel","value","foundItem","item","label","_createElementBlock","_openBlock","_createBlock","_unref","_Fragment","key","_mergeProps","_createTextVNode","_toDisplayString","val","colorCls","isValid","_normalizeStyle","_createVNode","isFn","getFormatByType","type","computed","format","dayjs","_renderList","i","slots","_useSlots","_renderSlot","_ctx","provide","previewTextConfigKey","reactive","ElRate","fieldRef","parseFormat","formatTimeValue","isArr","resolvedValue","previewData","getSelectedPath","ElScrollbar","PreviewText","composeExport","Preview","Input","Select","Cascader","ColorPicker","DatePicker","Rate","TimePicker","Tree"],"mappings":";;;;;;;;;;;;;;;;AAYA,UAAMA,IAAQC,GAGRC,IAAY,GAAGC,CAAW,iBAE1BC,IADWC,EAAA,EACM,OACjB,EAAE,OAAOC,EAAA,IAAUC,EAAA,GACnBC,IAAa,CAAC,CAACF,EAAM,MAAM,OAAO,UAClCG,IAAkBH,EAAM,MAAM,iBAAiB,IAC/CI,IAAoBN,GAAO,cAAc,CAAA,GACzC,EAAE,YAAAO,GAAY,WAAAC,GAAW,UAAAC,GAAU,aAAAC,EAAA,IAAgBC,EAAA,GAEnDC,IAAWV,EAAM,MAAM,OAAO,SAAS,SACvCW,IAAWX,EAAM,MAAM,OAAO,SAAS;AAE7C,aAASY,EAAUC,GAAYT,GAAwB;AACrD,YAAMU,IAAYV,EAAW,KAAK,OAAQW,IAAOL,CAAQ,MAAMG,CAAK;AACpE,aAAIC,IACKA,EAAUH,CAAQ,IACpBP,EACJ,IAAI,CAAAW,MAAQA,GAAM,WAAWH,EAAUC,GAAOE,EAAK,QAAQ,IAAI,MAAS,EACxE,KAAK,CAAAC,MAASA,MAAU,MAAS;AAAA,IACtC;2BAIEC,EA4BM,OAAA;AAAA,MA5BA,SAAOrB,CAAS;AAAA,IAAA;MACH,MAAM,QAAQF,EAAM,UAAU,IAK1BQ,KAAc,MAAM,QAAQR,EAAM,WAAU,CAAA,CAAA,KAC/DwB,KAAAC,EASUC,sBATOA,EAAAf,CAAA,CAAU,CAAA,GAAA;AAAA,mBAClB,MAAuC;AAAA,WAA9Ca,EAAA,EAAA,GAAAD,EAOQI,WAPqB3B,E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AAA;AAAA,QAAA;;;;;ICtEP+C,KAAcC,GAAcC,IAAS;AAAA,EAAA,OAChDC;AAAAA,EAAA,QACAC;AAAAA,EAAA,UACAC;AAAAA,EAAA,aACAC;AAAAA,EAAA,YACAC;AAAAA,EAAA,MACAC;AAAAA,EAAA,YACAC;AAAAA,EAAA,MACAC;AACF,CAAC;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/preview-text/cascader.vue","../../src/preview-text/color-picker.vue","../../src/preview-text/date-picker.vue","../../src/preview-text/input.vue","../../src/preview-text/preview.vue","../../src/preview-text/rate.vue","../../src/preview-text/select.vue","../../src/preview-text/time-picker.vue","../../src/preview-text/tree.vue","../../src/preview-text/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Field } from '@formily/core'\nimport { useField } from '@silver-formily/vue'\nimport { ElSpace, ElTag, ElText } from 'element-plus'\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\nimport { usePreviewConfig } from './utils'\n\ndefineOptions({\n name: 'FPreviewTextCascader',\n inheritAttrs: false,\n})\n\nconst props = defineProps<{\n modelValue: any\n}>()\nconst prefixCls = `${stylePrefix}-preview-text`\nconst fieldRef = useField<Field>()\nconst field = fieldRef.value\nconst { props: attrs } = useCleanAttrs()\nconst isMultiple = !!attrs.value.props?.multiple\nconst isShowAllLevels = attrs.value.showAllLevels ?? true\nconst dataSource: any[] = field?.dataSource ?? []\nconst { spaceProps, textProps, tagProps, placeholder } = usePreviewConfig()\n\nconst valueKey = attrs.value.props?.value || 'value'\nconst labelKey = attrs.value.props?.label || 'label'\n\nfunction findLabel(value: any, dataSource: any[]): any {\n const foundItem = dataSource.find(item => item?.[valueKey] === value)\n if (foundItem)\n return foundItem[labelKey]\n return dataSource\n .map(item => item?.children ? findLabel(value, item.children) : undefined)\n .find(label => label !== undefined)\n}\n</script>\n\n<template>\n <div :class=\"prefixCls\">\n <template v-if=\"!Array.isArray(props.modelValue)\">\n <ElText v-bind=\"textProps\">\n {{ placeholder }}\n </ElText>\n </template>\n <template v-else-if=\"isMultiple && Array.isArray(props.modelValue[0])\">\n <ElSpace v-bind=\"spaceProps\">\n <ElTag v-for=\"(item, key) of props.modelValue\" :key=\"key\" v-bind=\"tagProps\">\n <template v-if=\"isShowAllLevels\">\n {{ item.map(val => findLabel(val, dataSource) || placeholder).join(` ${attrs.separator ?? '/'} `) }}\n </template>\n <template v-else>\n {{ findLabel(item[item.length - 1], dataSource) || placeholder }}\n </template>\n </ElTag>\n </ElSpace>\n </template>\n <template v-else>\n <ElText v-bind=\"textProps\">\n <template v-if=\"isShowAllLevels\">\n {{ props.modelValue.map(val => findLabel(val, dataSource) || placeholder).join(` ${attrs.separator ?? '/'} `) }}\n </template>\n <template v-else>\n {{ findLabel(props.modelValue[props.modelValue.length - 1], dataSource) || placeholder }}\n </template>\n </ElText>\n </template>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { isFn, isValid } from '@formily/shared'\nimport { ElSpace, ElText } from 'element-plus'\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\nimport { usePreviewConfig } from './utils'\n\ndefineOptions({\n name: 'FPreviewTextColorPicker',\n inheritAttrs: false,\n})\n\nconst props = defineProps<{\n modelValue?: any\n}>()\n\nconst { props: attrs } = useCleanAttrs()\nconst prefixCls = `${stylePrefix}-preview-text`\nconst colorCls = `${prefixCls}__color`\nconst { spaceProps, textProps, placeholder } = usePreviewConfig()\n</script>\n\n<template>\n <ElSpace :class=\"[prefixCls, colorCls]\" v-bind=\"spaceProps\">\n <div\n v-if=\"isValid(props.modelValue)\"\n :class=\"`${colorCls}-swatch`\"\n :style=\"{ backgroundColor: props.modelValue }\"\n />\n <ElText v-bind=\"textProps\">\n <template v-if=\"isFn(attrs.formatter)\">\n {{ attrs.formatter(props.modelValue) }}\n </template>\n <template v-else-if=\"isValid(props.modelValue)\">\n {{ props.modelValue }}\n </template>\n <template v-else>\n {{ placeholder }}\n </template>\n </ElText>\n </ElSpace>\n</template>\n","<script setup lang=\"ts\">\nimport { dayjs, ElSpace, ElTag, ElText } from 'element-plus'\nimport { computed } from 'vue'\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\nimport { usePreviewConfig } from './utils'\n\ndefineOptions({\n name: 'FPreviewTextDatePicker',\n inheritAttrs: false,\n})\n\nconst props = defineProps<{\n modelValue?: any\n}>()\nconst { props: attrs } = useCleanAttrs()\nconst prefixCls = `${stylePrefix}-preview-text`\nconst { spaceProps, textProps, tagProps, placeholder } = usePreviewConfig()\n\nfunction getFormatByType(type: string): string {\n switch (type) {\n case 'year': {\n return 'YYYY'\n }\n case 'years': {\n return 'YYYY'\n }\n case 'month': {\n return 'YYYY-MM'\n }\n case 'months': {\n return 'YYYY-MM'\n }\n case 'week': {\n return '[Week] ww'\n }\n case 'date': {\n return 'YYYY-MM-DD'\n }\n case 'dates': {\n return 'YYYY-MM-DD'\n }\n case 'datetime': {\n return 'YYYY-MM-DD HH:mm:ss'\n }\n case 'daterange': {\n return 'YYYY-MM-DD'\n }\n case 'monthrange': {\n return 'YYYY-MM'\n }\n case 'yearrange': {\n return 'YYYY'\n }\n case 'datetimerange': {\n return 'YYYY-MM-DD HH:mm:ss'\n }\n default: {\n return 'YYYY-MM-DD'\n }\n }\n}\nconst type = computed(() => attrs.value.type || 'date')\nconst format = computed(() => attrs.value.format || getFormatByType(type.value))\n</script>\n\n<template>\n <div :class=\"prefixCls\">\n <template v-if=\"props.modelValue\">\n <template v-if=\"type.endsWith('range')\">\n <ElText v-bind=\"textProps\">\n {{ props.modelValue[0] ? dayjs(props.modelValue[0]).format(format) : placeholder }}\n {{ attrs.rangeSeparator ?? '~' }}\n {{ props.modelValue[1] ? dayjs(props.modelValue[1]).format(format) : placeholder }}\n </ElText>\n </template>\n <template v-else-if=\"type.endsWith('s')\">\n <ElSpace v-bind=\"spaceProps\">\n <ElTag v-for=\"i of props.modelValue\" :key=\"i\" v-bind=\"tagProps\">\n {{ dayjs(i).format(format) }}\n </ElTag>\n </ElSpace>\n </template>\n <template v-else>\n <ElText v-bind=\"textProps\">\n {{ dayjs(props.modelValue).format(format) }}\n </ElText>\n </template>\n </template>\n <template v-else>\n <ElText v-bind=\"textProps\">\n {{ placeholder }}\n </ElText>\n </template>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { isFn, isValid } from '@formily/shared'\nimport { ElSpace, ElText } from 'element-plus'\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\nimport { usePreviewConfig } from './utils'\n\ndefineOptions({\n name: 'FPreviewTextInput',\n inheritAttrs: false,\n})\n\nconst props = defineProps<{\n modelValue?: any\n}>()\n\nconst slots = defineSlots<{\n prepend?: () => any\n prefix?: () => any\n suffix?: () => any\n append?: () => any\n}>()\nconst { props: attrs } = useCleanAttrs()\nconst prefixCls = `${stylePrefix}-preview-text`\nconst { spaceProps, textProps, placeholder } = usePreviewConfig()\n</script>\n\n<template>\n <ElSpace :class=\"prefixCls\" v-bind=\"spaceProps\">\n <slot v-if=\"slots.prepend\" name=\"prepend\" />\n <slot v-if=\"slots.prefix\" name=\"prefix\" />\n <ElText v-bind=\"textProps\">\n <template v-if=\"isFn(attrs.formatter)\">\n {{ attrs.formatter(props.modelValue) }}\n </template>\n <template v-else-if=\"isValid(props.modelValue)\">\n {{ props.modelValue === '' ? '&nbsp;' : props.modelValue }}\n </template>\n <template v-else>\n {{ placeholder }}\n </template>\n </ElText>\n <slot v-if=\"slots.suffix\" name=\"suffix\" />\n <slot v-if=\"slots.append\" name=\"append\" />\n </ElSpace>\n</template>\n","<script setup lang=\"ts\">\nimport type { PreviewTextProps } from './utils'\nimport { provide, reactive } from 'vue'\nimport { previewTextConfigKey } from './utils'\n\ndefineOptions({\n name: 'FPreviewTextProvider',\n inheritAttrs: false,\n})\n\nconst props = defineProps<PreviewTextProps>()\n\nprovide(previewTextConfigKey, reactive({\n placeholder: props.placeholder,\n tagProps: props.tagProps,\n spaceProps: props.spaceProps,\n textProps: props.textProps,\n}))\n</script>\n\n<template>\n <slot />\n</template>\n","<script setup lang=\"ts\">\nimport { isValid } from '@formily/shared'\nimport { ElRate, ElText } from 'element-plus'\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\nimport { usePreviewConfig } from './utils'\n\ndefineOptions({\n name: 'FPreviewTextRate',\n inheritAttrs: false,\n})\n\nconst props = defineProps<{\n modelValue?: any\n}>()\n\nconst { props: attrs } = useCleanAttrs()\nconst prefixCls = `${stylePrefix}-preview-text`\nconst { textProps, placeholder } = usePreviewConfig()\n</script>\n\n<template>\n <div :class=\"prefixCls\">\n <ElText v-if=\"!isValid(props.modelValue)\" v-bind=\"textProps\">\n {{ placeholder }}\n </ElText>\n <ElRate\n v-else\n v-bind=\"attrs\"\n :model-value=\"props.modelValue\"\n :disabled=\"true\"\n />\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport type { Field } from '@formily/core'\nimport { isValid } from '@formily/shared'\nimport { useField } from '@silver-formily/vue'\nimport { ElSpace, ElTag, ElText } from 'element-plus'\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\nimport { usePreviewConfig } from './utils'\n\ndefineOptions({\n name: 'FPreviewTextSelect',\n})\n\nconst props = defineProps<{\n modelValue?: any\n}>()\n\nconst prefixCls = `${stylePrefix}-preview-text`\n\nconst fieldRef = useField<Field>()\nconst { props: attrs } = useCleanAttrs()\nconst dataSource = fieldRef.value.dataSource ?? []\nconst { spaceProps, textProps, tagProps, placeholder } = usePreviewConfig()\n</script>\n\n<template>\n <div :class=\"prefixCls\">\n <template v-if=\"!isValid(props.modelValue)\">\n <ElText v-bind=\"textProps\">\n {{ placeholder }}\n </ElText>\n </template>\n <template v-else-if=\"!attrs.multiple\">\n <ElText v-bind=\"textProps\">\n {{ dataSource.find(i => i.value === props.modelValue)?.label ?? props.modelValue }}\n </ElText>\n </template>\n <ElSpace v-else v-bind=\"spaceProps\">\n <ElTag v-for=\"(item, key) of props.modelValue\" :key=\"key\" v-bind=\"tagProps\">\n {{ dataSource.find(i => i.value === item)?.label ?? item }}\n </ElTag>\n </ElSpace>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { isArr } from '@formily/shared'\nimport { dayjs, ElText } from 'element-plus'\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\nimport { usePreviewConfig } from './utils'\n\ndefineOptions({\n name: 'FPreviewTextTimePicker',\n inheritAttrs: false,\n})\n\nconst props = defineProps<{\n modelValue?: any\n}>()\nconst { props: attrs } = useCleanAttrs()\nconst prefixCls = `${stylePrefix}-preview-text`\nconst { textProps, placeholder } = usePreviewConfig()\nconst format = attrs.value.format || 'HH:mm:ss'\nconst parseFormat = attrs.value.valueFormat || 'HH:mm:ss'\n\nfunction formatTimeValue(value: any): string | void {\n if (!value)\n return\n if (value instanceof Date) {\n return dayjs(value).format(format)\n }\n if (typeof value === 'string') {\n return dayjs(value, parseFormat).format(format)\n }\n}\n</script>\n\n<template>\n <div :class=\"prefixCls\">\n <template v-if=\"isArr(props.modelValue)\">\n <ElText v-bind=\"textProps\">\n {{ formatTimeValue(props.modelValue[0]) || placeholder }}\n {{ attrs.rangeSeparator ?? '~' }}\n {{ formatTimeValue(props.modelValue[1]) || placeholder }}\n </ElText>\n </template>\n <template v-else>\n <ElText v-bind=\"textProps\">\n {{ formatTimeValue(props.modelValue) || placeholder }}\n </ElText>\n </template>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport type { ArrayField } from '@formily/core'\nimport { useField } from '@silver-formily/vue'\nimport { ElScrollbar, ElText, ElTree } from 'element-plus'\nimport { computed } from 'vue'\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\nimport { getSelectedPath } from '../tree/utils'\nimport { usePreviewConfig } from './utils'\n\ndefineOptions({\n name: 'FPreviewTree',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<{\n nodeKey: string\n modelValue?: any\n valueType?: string\n data?: any[]\n props?: {\n children?: string\n label?: string\n disabled?: string\n }\n height?: number\n maxHeight?: number\n}>(), {\n valueType: 'all',\n props: () => ({\n children: 'children',\n label: 'label',\n disabled: 'disabled',\n }),\n})\n\nconst prefixCls = `${stylePrefix}-preview-tree`\nconst fieldRef = useField<ArrayField>()\nconst { props: attrs } = useCleanAttrs(['modelValue', 'onUpdate:modelValue'])\nconst { textProps, placeholder } = usePreviewConfig()\n\nconst dataSource = computed(() => {\n return fieldRef.value.dataSource ?? props.data ?? []\n})\n\nconst resolvedValue = computed(() => {\n if (props.modelValue !== undefined)\n return props.modelValue\n return fieldRef.value?.value\n})\n\nconst previewData = computed(() => {\n if (!resolvedValue.value || !Array.isArray(resolvedValue.value) || resolvedValue.value.length === 0) {\n return []\n }\n switch (props.valueType) {\n case 'path': {\n return resolvedValue.value\n }\n default: {\n const selectedPath = getSelectedPath(dataSource.value, resolvedValue.value, props.nodeKey, props.props)\n return selectedPath\n }\n }\n})\n</script>\n\n<template>\n <div :class=\"prefixCls\">\n <ElScrollbar\n v-if=\"previewData.length > 0\"\n :height=\"props.height\"\n :max-height=\"props.maxHeight\"\n >\n <ElTree\n :data=\"previewData\"\n :node-key=\"props.nodeKey\"\n :props=\"props.props\"\n :default-expand-all=\"true\"\n v-bind=\"attrs\"\n />\n </ElScrollbar>\n <ElText v-else v-bind=\"textProps\">\n {{ placeholder }}\n </ElText>\n </div>\n</template>\n","import { composeExport } from '../__builtins__/shared'\nimport Cascader from './cascader.vue'\nimport ColorPicker from './color-picker.vue'\nimport DatePicker from './date-picker.vue'\nimport Input from './input.vue'\nimport Preview from './preview.vue'\nimport Rate from './rate.vue'\nimport Select from './select.vue'\nimport TimePicker from './time-picker.vue'\nimport Tree from './tree.vue'\nimport './style.scss'\n\nexport const PreviewText = composeExport(Preview, {\n Input,\n Select,\n Cascader,\n ColorPicker,\n DatePicker,\n Rate,\n TimePicker,\n Tree,\n})\n\nexport default PreviewText\n"],"names":["props","__props","prefixCls","stylePrefix","field","useField","attrs","useCleanAttrs","isMultiple","isShowAllLevels","dataSource","spaceProps","textProps","tagProps","placeholder","usePreviewConfig","valueKey","labelKey","findLabel","value","foundItem","item","label","_createElementBlock","_openBlock","_createBlock","_unref","_Fragment","key","_mergeProps","_createTextVNode","_toDisplayString","val","colorCls","isValid","_normalizeStyle","_createVNode","isFn","getFormatByType","type","computed","format","dayjs","_renderList","i","slots","_useSlots","_renderSlot","_ctx","provide","previewTextConfigKey","reactive","ElRate","fieldRef","parseFormat","formatTimeValue","isArr","resolvedValue","previewData","getSelectedPath","ElScrollbar","PreviewText","composeExport","Preview","Input","Select","Cascader","ColorPicker","DatePicker","Rate","TimePicker","Tree"],"mappings":";;;;;;;;;;;;;;;;;;;;AAYA,UAAMA,IAAQC,GAGRC,IAAY,GAAGC,CAAW,iBAE1BC,IADWC,EAAA,EACM,OACjB,EAAE,OAAOC,EAAA,IAAUC,EAAA,GACnBC,IAAa,CAAC,CAACF,EAAM,MAAM,OAAO,UAClCG,IAAkBH,EAAM,MAAM,iBAAiB,IAC/CI,IAAoBN,GAAO,cAAc,CAAA,GACzC,EAAE,YAAAO,GAAY,WAAAC,GAAW,UAAAC,GAAU,aAAAC,EAAA,IAAgBC,EAAA,GAEnDC,IAAWV,EAAM,MAAM,OAAO,SAAS,SACvCW,IAAWX,EAAM,MAAM,OAAO,SAAS;AAE7C,aAASY,EAAUC,GAAYT,GAAwB;AACrD,YAAMU,IAAYV,EAAW,KAAK,OAAQW,IAAOL,CAAQ,MAAMG,CAAK;AACpE,aAAIC,IACKA,EAAUH,CAAQ,IACpBP,EACJ,IAAI,CAAAW,MAAQA,GAAM,WAAWH,EAAUC,GAAOE,EAAK,QAAQ,IAAI,MAAS,EACxE,KAAK,CAAAC,MAASA,MAAU,MAAS;AAAA,IACtC;2BAIEC,EA4BM,OAAA;AAAA,MA5BA,SAAOrB,CAAS;AAAA,IAAA;MACH,MAAM,QAAQF,EAAM,UAAU,IAK1BQ,KAAc,MAAM,QAAQR,EAAM,WAAU,CAAA,CAAA,KAC/DwB,KAAAC,EASUC,sBATOA,EAAAf,CAAA,CAAU,CAAA,GAAA;AAAA,mBAClB,MAAuC;AAAA,WAA9Ca,EAAA,E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c,EAAAZ,CAAA,CAAW,GAAA,CAAA;AAAA,QAAA;;;;;ICtEP+C,KAAcC,GAAcC,IAAS;AAAA,EAAA,OAChDC;AAAAA,EAAA,QACAC;AAAAA,EAAA,UACAC;AAAAA,EAAA,aACAC;AAAAA,EAAA,YACAC;AAAAA,EAAA,MACAC;AAAAA,EAAA,YACAC;AAAAA,EAAA,MACAC;AACF,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.mjs","sources":["../../src/preview-text/utils.ts"],"sourcesContent":["import type { SpaceProps, TagProps, TextProps } from 'element-plus'\r\nimport { computed, inject } from 'vue'\r\n\r\nexport interface PreviewTextProps {\r\n placeholder?: string\r\n tagProps?: Partial<TagProps> | Record<string, any>\r\n spaceProps?: Partial<SpaceProps> | Record<string, any>\r\n textProps?: Partial<TextProps> | Record<string, any>\r\n}\r\n\r\nexport const previewTextConfigKey = Symbol('previewTextConfig')\r\n\r\nexport function usePreviewConfig() {\r\n const previewConfig = inject(previewTextConfigKey, {}) as PreviewTextProps\r\n const placeholder = computed(() => previewConfig?.placeholder || 'N/A')\r\n const tagProps = computed<Partial<TagProps>>(() => previewConfig?.tagProps ?? { type: 'info' })\r\n const spaceProps = computed(() => previewConfig?.spaceProps || {})\r\n const textProps = computed(() => previewConfig?.textProps || {})\r\n return {\r\n placeholder,\r\n tagProps,\r\n spaceProps,\r\n textProps,\r\n }\r\n}\r\n"],"names":["previewTextConfigKey","usePreviewConfig","previewConfig","inject","placeholder","computed","tagProps","spaceProps","textProps"],"mappings":";AAUO,MAAMA,2BAA8B,mBAAmB;AAEvD,SAASC,IAAmB;AACjC,QAAMC,IAAgBC,EAAOH,GAAsB,EAAE,GAC/CI,IAAcC,EAAS,MAAMH,GAAe,eAAe,KAAK,GAChEI,IAAWD,EAA4B,MAAMH,GAAe,YAAY,EAAE,MAAM,QAAQ,GACxFK,IAAaF,EAAS,MAAMH,GAAe,cAAc,CAAA,CAAE,GAC3DM,IAAYH,EAAS,MAAMH,GAAe,aAAa,CAAA,CAAE;AAC/D,SAAO;AAAA,IACL,aAAAE;AAAA,IACA,UAAAE;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"utils.mjs","sources":["../../src/preview-text/utils.ts"],"sourcesContent":["import type { SpaceProps, TagProps, TextProps } from 'element-plus'\nimport { computed, inject } from 'vue'\n\nexport interface PreviewTextProps {\n placeholder?: string\n tagProps?: Partial<TagProps> | Record<string, any>\n spaceProps?: Partial<SpaceProps> | Record<string, any>\n textProps?: Partial<TextProps> | Record<string, any>\n}\n\nexport const previewTextConfigKey = Symbol('previewTextConfig')\n\nexport function usePreviewConfig() {\n const previewConfig = inject(previewTextConfigKey, {}) as PreviewTextProps\n const placeholder = computed(() => previewConfig?.placeholder || 'N/A')\n const tagProps = computed<Partial<TagProps>>(() => previewConfig?.tagProps ?? { type: 'info' })\n const spaceProps = computed(() => previewConfig?.spaceProps || {})\n const textProps = computed(() => previewConfig?.textProps || {})\n return {\n placeholder,\n tagProps,\n spaceProps,\n textProps,\n }\n}\n"],"names":["previewTextConfigKey","usePreviewConfig","previewConfig","inject","placeholder","computed","tagProps","spaceProps","textProps"],"mappings":";AAUO,MAAMA,2BAA8B,mBAAmB;AAEvD,SAASC,IAAmB;AACjC,QAAMC,IAAgBC,EAAOH,GAAsB,EAAE,GAC/CI,IAAcC,EAAS,MAAMH,GAAe,eAAe,KAAK,GAChEI,IAAWD,EAA4B,MAAMH,GAAe,YAAY,EAAE,MAAM,QAAQ,GACxFK,IAAaF,EAAS,MAAMH,GAAe,cAAc,CAAA,CAAE,GAC3DM,IAAYH,EAAS,MAAMH,GAAe,aAAa,CAAA,CAAE;AAC/D,SAAO;AAAA,IACL,aAAAE;AAAA,IACA,UAAAE;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,EAAA;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"default-components.mjs","sources":["../../src/query-form/default-components.ts"],"sourcesContent":["import type { Component } from 'vue'\r\nimport { Autocomplete } from '../autocomplete'\r\nimport { Cascader } from '../cascader'\r\nimport { Checkbox } from '../checkbox'\r\nimport { ColorPicker } from '../color-picker'\r\nimport { DatePicker } from '../date-picker'\r\nimport { FormItem } from '../form-item'\r\nimport { Input } from '../input'\r\nimport { InputNumber } from '../input-number'\r\nimport { Password } from '../password'\r\nimport { Radio } from '../radio'\r\nimport { Rate } from '../rate'\r\nimport { Select } from '../select'\r\nimport { Slider } from '../slider'\r\nimport { Switch } from '../switch'\r\nimport { TimePicker } from '../time-picker'\r\nimport { TimeSelect } from '../time-select'\r\nimport { TreeSelect } from '../tree-select'\r\n\r\nexport const queryFormAutoComponents: Record<string, Component> = {\r\n FormItem,\r\n Input,\r\n Autocomplete,\r\n InputNumber,\r\n Password,\r\n Checkbox,\r\n Radio,\r\n Select,\r\n TreeSelect,\r\n Cascader,\r\n Switch,\r\n Rate,\r\n Slider,\r\n ColorPicker,\r\n DatePicker,\r\n TimePicker,\r\n TimeSelect,\r\n}\r\n\r\nexport function mergeQueryFormComponents(components?: Record<string, Component>) {\r\n return {\r\n ...queryFormAutoComponents,\r\n ...components,\r\n }\r\n}\r\n"],"names":["queryFormAutoComponents","FormItem","Input","Autocomplete","InputNumber","Password","Checkbox","Radio","Select","TreeSelect","Cascader","Switch","Rate","Slider","ColorPicker","DatePicker","TimePicker","TimeSelect","mergeQueryFormComponents","components"],"mappings":";;;;;;;;;;;;;;;;;AAmBO,MAAMA,IAAqD;AAAA,EAChE,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AACF;AAEO,SAASC,EAAyBC,GAAwC;AAC/E,SAAO;AAAA,IACL,GAAGnB;AAAA,IACH,GAAGmB;AAAA,EAAA;AAEP;"}
1
+ {"version":3,"file":"default-components.mjs","sources":["../../src/query-form/default-components.ts"],"sourcesContent":["import type { Component } from 'vue'\nimport { Autocomplete } from '../autocomplete'\nimport { Cascader } from '../cascader'\nimport { Checkbox } from '../checkbox'\nimport { ColorPicker } from '../color-picker'\nimport { DatePicker } from '../date-picker'\nimport { FormItem } from '../form-item'\nimport { Input } from '../input'\nimport { InputNumber } from '../input-number'\nimport { Password } from '../password'\nimport { Radio } from '../radio'\nimport { Rate } from '../rate'\nimport { Select } from '../select'\nimport { Slider } from '../slider'\nimport { Switch } from '../switch'\nimport { TimePicker } from '../time-picker'\nimport { TimeSelect } from '../time-select'\nimport { TreeSelect } from '../tree-select'\n\nexport const queryFormAutoComponents: Record<string, Component> = {\n FormItem,\n Input,\n Autocomplete,\n InputNumber,\n Password,\n Checkbox,\n Radio,\n Select,\n TreeSelect,\n Cascader,\n Switch,\n Rate,\n Slider,\n ColorPicker,\n DatePicker,\n TimePicker,\n TimeSelect,\n}\n\nexport function mergeQueryFormComponents(components?: Record<string, Component>) {\n return {\n ...queryFormAutoComponents,\n ...components,\n }\n}\n"],"names":["queryFormAutoComponents","FormItem","Input","Autocomplete","InputNumber","Password","Checkbox","Radio","Select","TreeSelect","Cascader","Switch","Rate","Slider","ColorPicker","DatePicker","TimePicker","TimeSelect","mergeQueryFormComponents","components"],"mappings":";;;;;;;;;;;;;;;;;AAmBO,MAAMA,IAAqD;AAAA,EAChE,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AACF;AAEO,SAASC,EAAyBC,GAAwC;AAC/E,SAAO;AAAA,IACL,GAAGnB;AAAA,IACH,GAAGmB;AAAA,EAAA;AAEP;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.mjs","sources":["../../src/query-form/hooks.ts"],"sourcesContent":["import type { Form } from '@formily/core'\r\nimport type { ISchema } from '@formily/json-schema'\r\nimport type { Component, ComputedRef, MaybeRefOrGetter, Slots } from 'vue'\r\nimport { isFn } from '@formily/shared'\r\nimport { createSchemaField } from '@silver-formily/vue'\r\nimport { computed, toValue } from 'vue'\r\nimport { mergeQueryFormComponents } from './default-components'\r\n\r\nfunction resolveExternalForm(form: unknown): Form | undefined {\r\n if (isFn(form))\r\n return (form as () => Form | undefined)()\r\n return form as Form | undefined\r\n}\r\n\r\ninterface UseQueryFormFormOptions {\r\n formProps: MaybeRefOrGetter<{ form?: unknown }>\r\n fallbackForm?: MaybeRefOrGetter<Form | undefined>\r\n}\r\n\r\nexport function useQueryFormForm(options: UseQueryFormFormOptions) {\r\n const externalForm = computed<Form | undefined>(() => resolveExternalForm(toValue(options.formProps)?.form))\r\n const activeForm = computed<Form | undefined>(() => externalForm.value ?? toValue(options.fallbackForm))\r\n\r\n return {\r\n externalForm,\r\n activeForm,\r\n }\r\n}\r\n\r\ninterface UseQueryFormSchemaFieldOptions {\r\n slots: Slots\r\n schema: ComputedRef<ISchema | undefined>\r\n schemaField: ComputedRef<Component | undefined>\r\n components: ComputedRef<Record<string, Component> | undefined>\r\n scope?: ComputedRef<Record<string, any> | undefined>\r\n}\r\n\r\nexport function useQueryFormSchemaField(options: UseQueryFormSchemaFieldOptions) {\r\n const hasDefaultSlot = computed(() => Boolean(options.slots.default))\r\n const mergedComponents = computed(() => mergeQueryFormComponents(options.components.value))\r\n const schemaField = computed<Component | null>(() => {\r\n if (hasDefaultSlot.value || !options.schema.value)\r\n return null\r\n return options.schemaField.value ?? createSchemaField({\r\n components: mergedComponents.value,\r\n scope: options.scope?.value,\r\n }).SchemaField\r\n })\r\n\r\n return {\r\n hasDefaultSlot,\r\n schemaField,\r\n }\r\n}\r\n"],"names":["resolveExternalForm","form","isFn","useQueryFormForm","options","externalForm","computed","toValue","activeForm","useQueryFormSchemaField","hasDefaultSlot","mergedComponents","mergeQueryFormComponents","schemaField","createSchemaField"],"mappings":";;;;AAQA,SAASA,EAAoBC,GAAiC;AAC5D,SAAIC,EAAKD,CAAI,IACHA,EAAA,IACHA;AACT;AAOO,SAASE,EAAiBC,GAAkC;AACjE,QAAMC,IAAeC,EAA2B,MAAMN,EAAoBO,EAAQH,EAAQ,SAAS,GAAG,IAAI,CAAC,GACrGI,IAAaF,EAA2B,MAAMD,EAAa,SAASE,EAAQH,EAAQ,YAAY,CAAC;AAEvG,SAAO;AAAA,IACL,cAAAC;AAAA,IACA,YAAAG;AAAA,EAAA;AAEJ;AAUO,SAASC,EAAwBL,GAAyC;AAC/E,QAAMM,IAAiBJ,EAAS,MAAM,EAAQF,EAAQ,MAAM,OAAQ,GAC9DO,IAAmBL,EAAS,MAAMM,EAAyBR,EAAQ,WAAW,KAAK,CAAC,GACpFS,IAAcP,EAA2B,MACzCI,EAAe,SAAS,CAACN,EAAQ,OAAO,QACnC,OACFA,EAAQ,YAAY,SAASU,EAAkB;AAAA,IACpD,YAAYH,EAAiB;AAAA,IAC7B,OAAOP,EAAQ,OAAO;AAAA,EAAA,CACvB,EAAE,WACJ;AAED,SAAO;AAAA,IACL,gBAAAM;AAAA,IACA,aAAAG;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"hooks.mjs","sources":["../../src/query-form/hooks.ts"],"sourcesContent":["import type { Form } from '@formily/core'\nimport type { ISchema } from '@formily/json-schema'\nimport type { Component, ComputedRef, MaybeRefOrGetter, Slots } from 'vue'\nimport { isFn } from '@formily/shared'\nimport { createSchemaField } from '@silver-formily/vue'\nimport { computed, toValue } from 'vue'\nimport { mergeQueryFormComponents } from './default-components'\n\nfunction resolveExternalForm(form: unknown): Form | undefined {\n if (isFn(form))\n return (form as () => Form | undefined)()\n return form as Form | undefined\n}\n\ninterface UseQueryFormFormOptions {\n formProps: MaybeRefOrGetter<{ form?: unknown }>\n fallbackForm?: MaybeRefOrGetter<Form | undefined>\n}\n\nexport function useQueryFormForm(options: UseQueryFormFormOptions) {\n const externalForm = computed<Form | undefined>(() => resolveExternalForm(toValue(options.formProps)?.form))\n const activeForm = computed<Form | undefined>(() => externalForm.value ?? toValue(options.fallbackForm))\n\n return {\n externalForm,\n activeForm,\n }\n}\n\ninterface UseQueryFormSchemaFieldOptions {\n slots: Slots\n schema: ComputedRef<ISchema | undefined>\n schemaField: ComputedRef<Component | undefined>\n components: ComputedRef<Record<string, Component> | undefined>\n scope?: ComputedRef<Record<string, any> | undefined>\n}\n\nexport function useQueryFormSchemaField(options: UseQueryFormSchemaFieldOptions) {\n const hasDefaultSlot = computed(() => Boolean(options.slots.default))\n const mergedComponents = computed(() => mergeQueryFormComponents(options.components.value))\n const schemaField = computed<Component | null>(() => {\n if (hasDefaultSlot.value || !options.schema.value)\n return null\n return options.schemaField.value ?? createSchemaField({\n components: mergedComponents.value,\n scope: options.scope?.value,\n }).SchemaField\n })\n\n return {\n hasDefaultSlot,\n schemaField,\n }\n}\n"],"names":["resolveExternalForm","form","isFn","useQueryFormForm","options","externalForm","computed","toValue","activeForm","useQueryFormSchemaField","hasDefaultSlot","mergedComponents","mergeQueryFormComponents","schemaField","createSchemaField"],"mappings":";;;;AAQA,SAASA,EAAoBC,GAAiC;AAC5D,SAAIC,EAAKD,CAAI,IACHA,EAAA,IACHA;AACT;AAOO,SAASE,EAAiBC,GAAkC;AACjE,QAAMC,IAAeC,EAA2B,MAAMN,EAAoBO,EAAQH,EAAQ,SAAS,GAAG,IAAI,CAAC,GACrGI,IAAaF,EAA2B,MAAMD,EAAa,SAASE,EAAQH,EAAQ,YAAY,CAAC;AAEvG,SAAO;AAAA,IACL,cAAAC;AAAA,IACA,YAAAG;AAAA,EAAA;AAEJ;AAUO,SAASC,EAAwBL,GAAyC;AAC/E,QAAMM,IAAiBJ,EAAS,MAAM,EAAQF,EAAQ,MAAM,OAAQ,GAC9DO,IAAmBL,EAAS,MAAMM,EAAyBR,EAAQ,WAAW,KAAK,CAAC,GACpFS,IAAcP,EAA2B,MACzCI,EAAe,SAAS,CAACN,EAAQ,OAAO,QACnC,OACFA,EAAQ,YAAY,SAASU,EAAkB;AAAA,IACpD,YAAYH,EAAiB;AAAA,IAC7B,OAAOP,EAAQ,OAAO;AAAA,EAAA,CACvB,EAAE,WACJ;AAED,SAAO;AAAA,IACL,gBAAAM;AAAA,IACA,aAAAG;AAAA,EAAA;AAEJ;"}
@@ -1,15 +1,18 @@
1
- import { defineComponent as Z, useSlots as ee, computed as d, onUnmounted as te, openBlock as l, createBlock as a, unref as o, mergeProps as f, withCtx as n, createElementVNode as fe, normalizeClass as G, renderSlot as x, resolveDynamicComponent as oe, createCommentVNode as h, ref as K, createVNode as W, normalizeStyle as M, normalizeProps as _, createTextVNode as b, toDisplayString as g } from "vue";
2
- import { reaction as he, toJS as we, autorun as ye } from "@formily/reactive";
1
+ import { ElLink as fe, ElIcon as he } from "element-plus";
2
+ import { reaction as we, toJS as ye, autorun as ve } from "@formily/reactive";
3
+ import "@vueuse/core";
4
+ import { defineComponent as Z, useSlots as ee, computed as d, onUnmounted as te, openBlock as r, createBlock as l, unref as o, mergeProps as f, withCtx as n, createElementVNode as be, normalizeClass as G, renderSlot as x, resolveDynamicComponent as oe, createCommentVNode as h, ref as K, createVNode as W, normalizeStyle as M, normalizeProps as _, createTextVNode as b, toDisplayString as g } from "vue";
5
+ import "@formily/core";
6
+ import "@silver-formily/reactive-vue";
3
7
  import { useForm as se, useFieldSchema as ne } from "@silver-formily/vue";
4
- import { useQueryFormForm as le, useQueryFormSchemaField as ae } from "./hooks.mjs";
5
- import { t as ve } from "../vendor/lodash.mjs";
6
- import { _ as re } from "../form/form.mjs";
7
- import { useCleanAttrs as ie, compatibleUnderlineProp as be, composeExport as ge } from "../__builtins__/shared/utils.mjs";
8
- import { stylePrefix as ue } from "../__builtins__/configs/index.mjs";
9
- import { ArrowUp as Fe, ArrowDown as _e } from "@element-plus/icons-vue";
8
+ import { useCleanAttrs as re, compatibleUnderlineProp as ge, composeExport as Fe } from "../__builtins__/shared/utils.mjs";
9
+ import { stylePrefix as le } from "../__builtins__/configs/index.mjs";
10
+ import { _ as ae } from "../form/form.mjs";
11
+ import { useQueryFormForm as ie, useQueryFormSchemaField as ue } from "./hooks.mjs";
12
+ import { t as _e } from "../vendor/lodash.mjs";
13
+ import { ArrowUp as xe, ArrowDown as Se } from "@element-plus/icons-vue";
10
14
  import { Schema as X } from "@formily/json-schema";
11
- import { createGrid as xe } from "@silver-formily/grid";
12
- import { ElLink as Se, ElIcon as Re } from "element-plus";
15
+ import { createGrid as Re } from "@silver-formily/grid";
13
16
  import { FormButtonGroup as O } from "../form-button-group/index.mjs";
14
17
  import { FormGrid as Y } from "../form-grid/index.mjs";
15
18
  import { Reset as H } from "../reset/index.mjs";
@@ -27,46 +30,46 @@ import '../styles/query-form/index.css';const ke = /* @__PURE__ */ Z({
27
30
  },
28
31
  emits: ["autoSubmit", "autoSubmitFailed"],
29
32
  setup(q, { emit: e }) {
30
- const w = q, C = e, { props: r } = ie(["modelValue", "onUpdate:modelValue"]), D = ee(), L = se(), z = ne(), P = `${ue}-query-form-light`, { externalForm: N, activeForm: T } = le({
31
- formProps: r,
33
+ const w = q, C = e, { props: a } = re(["modelValue", "onUpdate:modelValue"]), D = ee(), L = se(), z = ne(), P = `${le}-query-form-light`, { externalForm: N, activeForm: T } = ie({
34
+ formProps: a,
32
35
  fallbackForm: L
33
36
  }), A = d(() => w.schema ?? z.value), Q = d(() => ({
34
37
  fullness: !1,
35
- ...r.value,
38
+ ...a.value,
36
39
  form: N.value
37
40
  }));
38
41
  function $() {
39
- T.value.submit((i) => (C("autoSubmit", i), r.value.onAutoSubmit?.(i))).catch((i) => {
40
- C("autoSubmitFailed", i), r.value.onAutoSubmitFailed?.(i);
42
+ T.value.submit((i) => (C("autoSubmit", i), a.value.onAutoSubmit?.(i))).catch((i) => {
43
+ C("autoSubmitFailed", i), a.value.onAutoSubmitFailed?.(i);
41
44
  });
42
45
  }
43
- const E = ve(() => {
46
+ const E = _e(() => {
44
47
  $();
45
48
  }, w.throttleWait, {
46
49
  leading: !1,
47
50
  trailing: !0
48
- }), V = he(() => {
51
+ }), V = we(() => {
49
52
  const y = T.value;
50
53
  if (y)
51
- return we(y.values);
54
+ return ye(y.values);
52
55
  }, () => {
53
56
  E();
54
57
  });
55
58
  te(() => {
56
59
  V(), E.cancel();
57
60
  });
58
- const { hasDefaultSlot: S, schemaField: R } = ae({
61
+ const { hasDefaultSlot: S, schemaField: R } = ue({
59
62
  slots: D,
60
63
  schema: A,
61
64
  schemaField: d(() => w.schemaField),
62
65
  components: d(() => w.components)
63
66
  });
64
- return (y, i) => (l(), a(o(re), f(Q.value, { class: P }), {
67
+ return (y, i) => (r(), l(o(ae), f(Q.value, { class: P }), {
65
68
  default: n(() => [
66
- fe("div", {
69
+ be("div", {
67
70
  class: G(`${P}__content`)
68
71
  }, [
69
- o(S) ? x(y.$slots, "default", { key: 0 }) : o(R) ? (l(), a(oe(o(R)), {
72
+ o(S) ? x(y.$slots, "default", { key: 0 }) : o(R) ? (r(), l(oe(o(R)), {
70
73
  key: 1,
71
74
  schema: A.value
72
75
  }, null, 8, ["schema"])) : h("", !0)
@@ -99,7 +102,7 @@ import '../styles/query-form/index.css';const ke = /* @__PURE__ */ Z({
99
102
  resetProps: {}
100
103
  },
101
104
  setup(q) {
102
- const e = q, { props: w } = ie(["modelValue", "onUpdate:modelValue"]), C = ee(), r = `${ue}-query-form`, D = Y.GridColumn, L = ne(), z = se(), { externalForm: P, activeForm: N } = le({
105
+ const e = q, { props: w } = re(["modelValue", "onUpdate:modelValue"]), C = ee(), a = `${le}-query-form`, D = Y.GridColumn, L = ne(), z = se(), { externalForm: P, activeForm: N } = ie({
103
106
  formProps: w,
104
107
  fallbackForm: z
105
108
  }), T = d(() => ({
@@ -154,7 +157,7 @@ import '../styles/query-form/index.css';const ke = /* @__PURE__ */ Z({
154
157
  ...i,
155
158
  maxRows: e.defaultExpanded || !e.showToggle ? 1 / 0 : F,
156
159
  shouldVisible: y
157
- }, u = xe(me), v = K(u.maxRows === 1 / 0), m = K("complete-wrap");
160
+ }, u = Re(me), v = K(u.maxRows === 1 / 0), m = K("complete-wrap");
158
161
  function ce() {
159
162
  if (!e.showToggle) {
160
163
  m.value = "incomplete-wrap";
@@ -171,25 +174,25 @@ import '../styles/query-form/index.css';const ke = /* @__PURE__ */ Z({
171
174
  const c = u.shadowRows;
172
175
  m.value = c < F + 1 ? "incomplete-wrap" : "complete-wrap";
173
176
  }
174
- const de = ye(() => {
177
+ const de = ve(() => {
175
178
  v.value = u.maxRows === 1 / 0, ce();
176
179
  });
177
180
  te(de);
178
181
  function k() {
179
182
  e.showToggle && (u.maxRows = u.maxRows === 1 / 0 ? F : 1 / 0);
180
183
  }
181
- const { hasDefaultSlot: pe, schemaField: j } = ae({
184
+ const { hasDefaultSlot: pe, schemaField: j } = ue({
182
185
  slots: C,
183
186
  schema: d(() => e.schema),
184
187
  schemaField: d(() => e.schemaField),
185
188
  components: d(() => e.components),
186
189
  scope: d(() => e.scope)
187
190
  });
188
- return (t, s) => (l(), a(o(re), f(T.value, { class: r }), {
191
+ return (t, s) => (r(), l(o(ae), f(T.value, { class: a }), {
189
192
  default: n(() => [
190
193
  W(o(Y), { grid: o(u) }, {
191
194
  default: n(() => [
192
- o(pe) ? x(t.$slots, "default", { key: 0 }) : o(j) ? (l(), a(oe(o(j)), {
195
+ o(pe) ? x(t.$slots, "default", { key: 0 }) : o(j) ? (r(), l(oe(o(j)), {
193
196
  key: 1,
194
197
  schema: e.schema
195
198
  }, null, 8, ["schema"])) : h("", !0),
@@ -197,12 +200,12 @@ import '../styles/query-form/index.css';const ke = /* @__PURE__ */ Z({
197
200
  "grid-span": -1,
198
201
  "data-query-form-actions": "",
199
202
  class: G([
200
- `${r}__actions`,
201
- e.actionsAtRowEnd && `${r}__actions--row-end`
203
+ `${a}__actions`,
204
+ e.actionsAtRowEnd && `${a}__actions--row-end`
202
205
  ])
203
206
  }, {
204
207
  default: n(() => [
205
- m.value === "incomplete-wrap" ? (l(), a(o(O), {
208
+ m.value === "incomplete-wrap" ? (r(), l(o(O), {
206
209
  key: 0,
207
210
  align: e.actionsAtRowEnd ? "right" : "left",
208
211
  "align-form-item": "",
@@ -215,13 +218,13 @@ import '../styles/query-form/index.css';const ke = /* @__PURE__ */ Z({
215
218
  toggle: k,
216
219
  type: m.value
217
220
  }, () => [
218
- e.showSubmit ? (l(), a(o(J), _(f({ key: 0 }, e.submitProps)), {
221
+ e.showSubmit ? (r(), l(o(J), _(f({ key: 0 }, e.submitProps)), {
219
222
  default: n(() => [
220
223
  b(g(e.submitText), 1)
221
224
  ]),
222
225
  _: 1
223
226
  }, 16)) : h("", !0),
224
- e.showReset ? (l(), a(o(H), _(f({ key: 1 }, e.resetProps)), {
227
+ e.showReset ? (r(), l(o(H), _(f({ key: 1 }, e.resetProps)), {
225
228
  default: n(() => [
226
229
  b(g(e.resetText), 1)
227
230
  ]),
@@ -230,7 +233,7 @@ import '../styles/query-form/index.css';const ke = /* @__PURE__ */ Z({
230
233
  ])
231
234
  ]),
232
235
  _: 3
233
- }, 8, ["align", "style"])) : m.value === "collapsible" && e.showToggle ? (l(), a(o(O), {
236
+ }, 8, ["align", "style"])) : m.value === "collapsible" && e.showToggle ? (r(), l(o(O), {
234
237
  key: 1,
235
238
  align: e.actionsAtRowEnd ? "right" : "left",
236
239
  "align-form-item": "",
@@ -243,13 +246,13 @@ import '../styles/query-form/index.css';const ke = /* @__PURE__ */ Z({
243
246
  toggle: k,
244
247
  type: m.value
245
248
  }, () => [
246
- e.showSubmit ? (l(), a(o(J), _(f({ key: 0 }, e.submitProps)), {
249
+ e.showSubmit ? (r(), l(o(J), _(f({ key: 0 }, e.submitProps)), {
247
250
  default: n(() => [
248
251
  b(g(e.submitText), 1)
249
252
  ]),
250
253
  _: 1
251
254
  }, 16)) : h("", !0),
252
- e.showReset ? (l(), a(o(H), _(f({ key: 1 }, e.resetProps)), {
255
+ e.showReset ? (r(), l(o(H), _(f({ key: 1 }, e.resetProps)), {
253
256
  default: n(() => [
254
257
  b(g(e.resetText), 1)
255
258
  ]),
@@ -261,19 +264,19 @@ import '../styles/query-form/index.css';const ke = /* @__PURE__ */ Z({
261
264
  toggle: k,
262
265
  type: m.value
263
266
  }, () => [
264
- W(o(Se), {
267
+ W(o(fe), {
265
268
  type: "primary",
266
- underline: o(be)(),
267
- class: G(`${r}__collapse-link`),
269
+ underline: o(ge)(),
270
+ class: G(`${a}__collapse-link`),
268
271
  onClick: k
269
272
  }, {
270
273
  default: n(() => [
271
274
  b(g(v.value ? e.collapseText : e.expandText) + " ", 1),
272
- W(o(Re), {
273
- class: G(`${r}__collapse-icon`)
275
+ W(o(he), {
276
+ class: G(`${a}__collapse-icon`)
274
277
  }, {
275
278
  default: n(() => [
276
- v.value ? (l(), a(o(Fe), { key: 0 })) : (l(), a(o(_e), { key: 1 }))
279
+ v.value ? (r(), l(o(xe), { key: 0 })) : (r(), l(o(Se), { key: 1 }))
277
280
  ]),
278
281
  _: 1
279
282
  }, 8, ["class"])
@@ -283,7 +286,7 @@ import '../styles/query-form/index.css';const ke = /* @__PURE__ */ Z({
283
286
  ])
284
287
  ]),
285
288
  _: 3
286
- }, 8, ["align", "style"])) : (l(), a(o(O), {
289
+ }, 8, ["align", "style"])) : (r(), l(o(O), {
287
290
  key: 2,
288
291
  align: "right",
289
292
  inline: "",
@@ -295,13 +298,13 @@ import '../styles/query-form/index.css';const ke = /* @__PURE__ */ Z({
295
298
  toggle: k,
296
299
  type: m.value
297
300
  }, () => [
298
- e.showSubmit ? (l(), a(o(J), _(f({ key: 0 }, e.submitProps)), {
301
+ e.showSubmit ? (r(), l(o(J), _(f({ key: 0 }, e.submitProps)), {
299
302
  default: n(() => [
300
303
  b(g(e.submitText), 1)
301
304
  ]),
302
305
  _: 1
303
306
  }, 16)) : h("", !0),
304
- e.showReset ? (l(), a(o(H), _(f({ key: 1 }, e.resetProps)), {
307
+ e.showReset ? (r(), l(o(H), _(f({ key: 1 }, e.resetProps)), {
305
308
  default: n(() => [
306
309
  b(g(e.resetText), 1)
307
310
  ]),
@@ -321,11 +324,11 @@ import '../styles/query-form/index.css';const ke = /* @__PURE__ */ Z({
321
324
  _: 3
322
325
  }, 16));
323
326
  }
324
- }), Oe = ge(Ce, {
327
+ }), je = Fe(Ce, {
325
328
  Light: ke
326
329
  });
327
330
  export {
328
- Oe as QueryForm,
329
- Oe as default
331
+ je as QueryForm,
332
+ je as default
330
333
  };
331
334
  //# sourceMappingURL=index.mjs.map