@dazhicheng/ui 1.6.0 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/dist/components/tt-api-component/index.js +4 -3
  2. package/dist/components/tt-api-component/index.vue2.js +4 -3
  3. package/dist/components/tt-area/TtArea.vue3.js +8 -7
  4. package/dist/components/tt-button/index.js +5 -4
  5. package/dist/components/tt-button/index.vue2.js +4 -3
  6. package/dist/components/tt-checkbox/index.js +4 -3
  7. package/dist/components/tt-checkbox/index.vue.js +4 -3
  8. package/dist/components/tt-drawer/index.js +4 -3
  9. package/dist/components/tt-drawer/src/RenderDrawer.vue.js +4 -3
  10. package/dist/components/tt-drawer/src/components/DrawerFooter.vue.js +8 -7
  11. package/dist/components/tt-drawer/src/components/DrawerHeader.vue2.js +3 -2
  12. package/dist/components/tt-drawer/src/props.js +3 -2
  13. package/dist/components/tt-drawer/src/utils/drawer-api.js +4 -2
  14. package/dist/components/tt-empty/index.js +9 -8
  15. package/dist/components/tt-form/index.js +10 -9
  16. package/dist/components/tt-form/src/components/ExpandableArrow.vue2.js +3 -2
  17. package/dist/components/tt-form/src/components/FormActions.vue2.js +4 -2
  18. package/dist/components/tt-form/src/form/FormDescription.vue.js +3 -2
  19. package/dist/components/tt-form/src/form/FormItem.vue.js +6 -5
  20. package/dist/components/tt-form/src/form/FormLabel.vue.js +8 -7
  21. package/dist/components/tt-form/src/form/RenderContent.vue.js +4 -3
  22. package/dist/components/tt-form/src/form-render/FormField.vue2.js +30 -28
  23. package/dist/components/tt-form/src/form-render/FormLabel.vue2.js +4 -2
  24. package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.js +1 -0
  25. package/dist/components/tt-form/src/form-render/array-register/utils.js +6 -4
  26. package/dist/components/tt-form/src/form-render/dependencies.js +19 -18
  27. package/dist/components/tt-form/src/form-render/form.vue2.js +4 -2
  28. package/dist/components/tt-form/src/form-render/helper.js +15 -14
  29. package/dist/components/tt-form/src/form-render/rootWrapperClass.js +3 -2
  30. package/dist/components/tt-form/src/formApi.js +3 -2
  31. package/dist/components/tt-form/src/group-form/GroupForm.vue2.js +4 -3
  32. package/dist/components/tt-form/src/group-form/GroupSection.vue2.js +2 -0
  33. package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +4 -2
  34. package/dist/components/tt-form/src/group-form/groupFormApi.js +4 -3
  35. package/dist/components/tt-form/src/hooks/useForwardPriorityValues.js +3 -2
  36. package/dist/components/tt-form/src/hooks/useSelectCollapse.js +28 -27
  37. package/dist/components/tt-form/src/index.vue2.js +3 -2
  38. package/dist/components/tt-form/src/useFormContext.js +11 -10
  39. package/dist/components/tt-form-item-error-tooltip/index.js +5 -4
  40. package/dist/components/tt-form-item-error-tooltip/index.vue.js +4 -3
  41. package/dist/components/tt-icon/index.js +6 -5
  42. package/dist/components/tt-image/index.js +6 -5
  43. package/dist/components/tt-image/src/components/ImageViewer.js +7 -6
  44. package/dist/components/tt-loading/index.js +4 -3
  45. package/dist/components/tt-loading/src/directive.js +24 -23
  46. package/dist/components/tt-log/index.js +4 -3
  47. package/dist/components/tt-log/index.vue.js +3 -2
  48. package/dist/components/tt-modal/index.js +3 -2
  49. package/dist/components/tt-modal/src/RenderModal.vue.js +3 -2
  50. package/dist/components/tt-modal/src/components/ModalFooter.vue2.js +3 -2
  51. package/dist/components/tt-modal/src/components/ModalHeader.vue2.js +3 -2
  52. package/dist/components/tt-modal/src/components/ModalWrapper.vue.js +15 -14
  53. package/dist/components/tt-modal/src/props.js +3 -2
  54. package/dist/components/tt-modal/src/utils/modal-api.js +4 -2
  55. package/dist/components/tt-modal-form/index.vue.js +4 -3
  56. package/dist/components/tt-nav-anchor/index.js +4 -3
  57. package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue.js +15 -14
  58. package/dist/components/tt-panel-select/index.js +4 -3
  59. package/dist/components/tt-panel-select/src/hooks/usePanelData.js +4 -3
  60. package/dist/components/tt-panel-select/src/index.vue.js +3 -2
  61. package/dist/components/tt-radio-group/index.js +4 -3
  62. package/dist/components/tt-radio-group/index.vue.js +7 -6
  63. package/dist/components/tt-select/index.js +4 -3
  64. package/dist/components/tt-select/src/Select.vue.d.ts +8 -8
  65. package/dist/components/tt-select/src/Select.vue.js +4 -3
  66. package/dist/components/tt-select/src/components/SelectTable.vue.d.ts +116 -7
  67. package/dist/components/tt-select/src/components/SelectTable.vue.js +3 -2
  68. package/dist/components/tt-select/src/components/Table.vue.d.ts +4 -4
  69. package/dist/components/tt-select/src/components/Table.vue.js +3 -2
  70. package/dist/components/tt-select/src/hooks/useDataSource.js +4 -3
  71. package/dist/components/tt-select/src/hooks/useKeyboard.d.ts +7 -1
  72. package/dist/components/tt-select/src/hooks/useSelect.js +3 -2
  73. package/dist/components/tt-select/src/hooks/useSelectTableEvent.d.ts +1 -1
  74. package/dist/components/tt-select/src/hooks/useSelectTableEvent.js +28 -27
  75. package/dist/components/tt-select/src/props.d.ts +2 -2
  76. package/dist/components/tt-table/index.d.ts +6 -6
  77. package/dist/components/tt-table/index.js +1 -1
  78. package/dist/components/tt-table/src/Table.vue.d.ts +4 -4
  79. package/dist/components/tt-table/src/Table.vue.js +178 -175
  80. package/dist/components/tt-table/src/TableForm.vue.d.ts +6 -6
  81. package/dist/components/tt-table/src/TableForm.vue.js +2 -2
  82. package/dist/components/tt-table/src/components/TableAction.vue.js +19 -17
  83. package/dist/components/tt-table/src/components/TableButtons.js +10 -9
  84. package/dist/components/tt-table/src/components/TableColumnModal.vue2.js +4 -3
  85. package/dist/components/tt-table/src/components/TableToolbarTools.vue.js +18 -17
  86. package/dist/components/tt-table/src/emits.d.ts +10 -1
  87. package/dist/components/tt-table/src/hooks/useColumnPersistence.js +17 -16
  88. package/dist/components/tt-table/src/hooks/useColumns.js +4 -3
  89. package/dist/components/tt-table/src/hooks/useKeyboardNav.js +34 -33
  90. package/dist/components/tt-table/src/hooks/usePagination.js +12 -11
  91. package/dist/components/tt-table/src/hooks/useQuery.js +6 -5
  92. package/dist/components/tt-table/src/hooks/useRowIdentity.d.ts +1 -0
  93. package/dist/components/tt-table/src/hooks/useRowIdentity.js +68 -54
  94. package/dist/components/tt-table/src/hooks/useRowSelection.d.ts +5 -7
  95. package/dist/components/tt-table/src/hooks/useRowSelection.js +70 -68
  96. package/dist/components/tt-table/src/hooks/useSideSlot.js +4 -3
  97. package/dist/components/tt-table/src/hooks/useSyncProps.js +4 -3
  98. package/dist/components/tt-table/src/hooks/useTableData.js +6 -5
  99. package/dist/components/tt-table/src/hooks/useTableFooter.js +9 -8
  100. package/dist/components/tt-table/src/hooks/useTableForm.js +4 -3
  101. package/dist/components/tt-table/src/hooks/useTableRender.d.ts +37 -4
  102. package/dist/components/tt-table/src/props.d.ts +12 -6
  103. package/dist/components/tt-table/src/props.js +14 -7
  104. package/dist/components/tt-table/src/table-mutation-events.js +10 -9
  105. package/dist/components/tt-table/src/types/table.d.ts +16 -0
  106. package/dist/components/tt-table/src/utils/action-tab-index.js +15 -14
  107. package/dist/components/tt-table/src/utils/context.js +5 -4
  108. package/dist/components/tt-table/src/utils/table-api.js +4 -2
  109. package/dist/components/tt-table/src/utils/table-form-api.js +22 -20
  110. package/dist/components/tt-text/index.js +4 -3
  111. package/dist/components/tt-upload/index.js +6 -5
  112. package/dist/components/tt-upload/src/TtUpload.vue.js +4 -3
  113. package/dist/directives/disabled-tip/index.js +9 -8
  114. package/dist/hooks/useFormSchemasLink.js +4 -3
  115. package/dist/hooks/useFormat.d.ts +35 -71
  116. package/dist/hooks/useFormat.js +28 -39
  117. package/dist/hooks/usePanelSelectSchemas.js +4 -3
  118. package/dist/hooks/useScreenshotOss.js +16 -15
  119. package/dist/packages/hooks/src/useDebounce.js +5 -4
  120. package/dist/packages/hooks/src/useElementScreenshot.js +4 -3
  121. package/dist/packages/hooks/src/usePriorityValue.js +5 -4
  122. package/dist/packages/utils/src/format.js +48 -0
  123. package/dist/plugins/default/renderCellContent.js +4 -3
  124. package/dist/plugins/vxeTable/switchStatus.js +14 -13
  125. package/package.json +3 -3
@@ -1,11 +1,13 @@
1
- import { defineComponent as q, useAttrs as G, ref as x, inject as A, computed as d, unref as r, h as J, onMounted as Q, createElementBlock as s, openBlock as i, normalizeClass as w, createVNode as k, createBlock as c, createCommentVNode as p, withCtx as u, Fragment as f, renderList as S, renderSlot as Z, withDirectives as F, mergeProps as ee, normalizeStyle as W, toDisplayString as E, createElementVNode as te, withModifiers as oe, createSlots as re, createTextVNode as ne } from "vue";
1
+ import { defineComponent as q, useAttrs as G, ref as x, inject as A, computed as d, unref as r, h as J, onMounted as Q, createElementBlock as s, openBlock as i, normalizeClass as w, createVNode as k, createBlock as c, createCommentVNode as p, withCtx as u, Fragment as m, renderList as S, renderSlot as Z, withDirectives as F, mergeProps as ee, normalizeStyle as W, toDisplayString as E, createElementVNode as te, withModifiers as oe, createSlots as re, createTextVNode as ne } from "vue";
2
2
  import { propTypes as v } from "../../../../packages/hooks/src/propTypes.js";
3
3
  import { useDesign as ie } from "../../../../packages/hooks/src/useDesign.js";
4
4
  import "axios";
5
5
  import { ElDivider as le, ElSpace as se, ElPopover as ae } from "element-plus";
6
- import { isNullOrUnDef as m, isBoolean as de, isFunction as pe, isArray as ue, isObject as ce } from "../../../../packages/utils/src/is.js";
6
+ import { isNullOrUnDef as f, isBoolean as de, isFunction as pe, isArray as ue, isObject as ce } from "../../../../packages/utils/src/is.js";
7
+ import "dayjs";
8
+ import "numeral";
7
9
  import { generateTestId as M, toKebabCase as D } from "../../../../packages/utils/src/testid-helper.js";
8
- import { calcWordsWidth as fe } from "../../../../packages/utils/src/tool.js";
10
+ import { calcWordsWidth as me } from "../../../../packages/utils/src/tool.js";
9
11
  import "../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
10
12
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
11
13
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
@@ -16,10 +18,10 @@ import "vue-router";
16
18
  import { TtButton as C } from "../../../tt-button/index.js";
17
19
  import { TtIcon as I } from "../../../tt-icon/index.js";
18
20
  import P from "../../../../directives/disabled-tip/index.js";
19
- import me from "../../../../assets/svg/action_more.svg.js";
21
+ import fe from "../../../../assets/svg/action_more.svg.js";
20
22
  import { ROW_INDEX_KEY as be } from "./RowContext.js";
21
23
  import { scheduleNormalizeActionTabIndex as ve } from "../utils/action-tab-index.js";
22
- const ye = { key: 1 }, ge = ["onClick"], je = /* @__PURE__ */ q({
24
+ const ye = { key: 1 }, ge = ["onClick"], Ve = /* @__PURE__ */ q({
23
25
  name: "TtTableAction",
24
26
  __name: "TableAction",
25
27
  props: {
@@ -55,19 +57,19 @@ const ye = { key: 1 }, ge = ["onClick"], je = /* @__PURE__ */ q({
55
57
  d(() => "")
56
58
  ), R = A(be, void 0), j = d(() => {
57
59
  var o;
58
- if (!m(l.rowIndex))
60
+ if (!f(l.rowIndex))
59
61
  return l.rowIndex;
60
62
  const t = r(R);
61
- if (!m(t))
63
+ if (!f(t))
62
64
  return t;
63
- if (!m((o = l.slotContext) == null ? void 0 : o.$rowIndex))
65
+ if (!f((o = l.slotContext) == null ? void 0 : o.$rowIndex))
64
66
  return l.slotContext.$rowIndex;
65
- if (!m(B.$rowIndex))
67
+ if (!f(B.$rowIndex))
66
68
  return B.$rowIndex;
67
69
  });
68
70
  function y(t) {
69
71
  const o = r(z), e = j.value;
70
- return m(e) ? M(o, "action", D(t)) : M(o, "action", `row${e}`, D(t));
72
+ return f(e) ? M(o, "action", D(t)) : M(o, "action", `row${e}`, D(t));
71
73
  }
72
74
  function _(t) {
73
75
  const o = t.ifShow;
@@ -75,7 +77,7 @@ const ye = { key: 1 }, ge = ["onClick"], je = /* @__PURE__ */ q({
75
77
  return de(o) && (e = o), pe(o) && (e = o(t)), e;
76
78
  }
77
79
  const O = d(() => (l.actions || []).filter((t) => _(t)).slice(0, l.showBtnNums)), g = d(() => (l.actions || []).filter((t) => _(t)).slice(l.showBtnNums)), V = d(() => r(g).length > 0), U = d(() => "left flex items-center"), K = d(() => {
78
- const t = document.getElementsByTagName("body")[0], o = window.getComputedStyle(t).fontFamily, e = g.value.map((a) => fe(a.label, "12px", o) + 22), n = Math.max(...e);
80
+ const t = document.getElementsByTagName("body")[0], o = window.getComputedStyle(t).fontFamily, e = g.value.map((a) => me(a.label, "12px", o) + 22), n = Math.max(...e);
79
81
  return n > l.popoverWidth ? n : l.popoverWidth;
80
82
  });
81
83
  function $(t, o) {
@@ -119,7 +121,7 @@ const ye = { key: 1 }, ge = ["onClick"], je = /* @__PURE__ */ q({
119
121
  wrap: T.wrap
120
122
  }, {
121
123
  default: u(() => [
122
- (i(!0), s(f, null, S(O.value, (e, n) => (i(), s(f, {
124
+ (i(!0), s(m, null, S(O.value, (e, n) => (i(), s(m, {
123
125
  key: `${n}-${e.label}`
124
126
  }, [
125
127
  e.slot ? Z(t.$slots, e.slot, ee({
@@ -138,7 +140,7 @@ const ye = { key: 1 }, ge = ["onClick"], je = /* @__PURE__ */ q({
138
140
  onClick: e.onClick
139
141
  }, {
140
142
  default: u(() => [
141
- e.iconFont ? (i(), s(f, { key: 0 }, [
143
+ e.iconFont ? (i(), s(m, { key: 0 }, [
142
144
  e.iconFont ? (i(), c(r(I), {
143
145
  key: 0,
144
146
  "icon-font": e.iconFont,
@@ -164,7 +166,7 @@ const ye = { key: 1 }, ge = ["onClick"], je = /* @__PURE__ */ q({
164
166
  onMouseleave: o[0] || (o[0] = (e) => b.value = !1)
165
167
  }, [
166
168
  k(r(I), {
167
- icon: r(me),
169
+ icon: r(fe),
168
170
  "is-custom-svg": "",
169
171
  size: 14
170
172
  }, null, 8, ["icon"])
@@ -193,7 +195,7 @@ const ye = { key: 1 }, ge = ["onClick"], je = /* @__PURE__ */ q({
193
195
  }
194
196
  }, {
195
197
  default: u(() => [
196
- (i(!0), s(f, null, S(g.value, (e, n) => (i(), s("div", {
198
+ (i(!0), s(m, null, S(g.value, (e, n) => (i(), s("div", {
197
199
  key: `${n}-${e.label}`,
198
200
  onClick: () => {
199
201
  var a;
@@ -208,7 +210,7 @@ const ye = { key: 1 }, ge = ["onClick"], je = /* @__PURE__ */ q({
208
210
  "data-testid": y(e.label || "")
209
211
  }, re({
210
212
  default: u(() => [
211
- e.label ? (i(), s(f, { key: 0 }, [
213
+ e.label ? (i(), s(m, { key: 0 }, [
212
214
  ne(E(e.label), 1)
213
215
  ], 64)) : p("", !0)
214
216
  ]),
@@ -235,5 +237,5 @@ const ye = { key: 1 }, ge = ["onClick"], je = /* @__PURE__ */ q({
235
237
  }
236
238
  });
237
239
  export {
238
- je as default
240
+ Ve as default
239
241
  };
@@ -1,12 +1,13 @@
1
1
  import { defineComponent as w, inject as S, computed as f, createVNode as n, unref as d, isVNode as k, mergeProps as c, withDirectives as P, resolveDirective as j } from "vue";
2
- import { propTypes as a } from "../../../../packages/hooks/src/propTypes.js";
2
+ import { propTypes as m } from "../../../../packages/hooks/src/propTypes.js";
3
3
  import { useDesign as F } from "../../../../packages/hooks/src/useDesign.js";
4
4
  import "axios";
5
5
  import { ElSpace as $, ElPopover as x } from "element-plus";
6
- import { isBoolean as z, isFunction as m, isArray as D, isObject as N } from "../../../../packages/utils/src/is.js";
6
+ import { isBoolean as z, isFunction as a, isArray as D, isObject as N } from "../../../../packages/utils/src/is.js";
7
+ import "dayjs";
8
+ import "numeral";
7
9
  import { generateTestId as O, toKebabCase as A } from "../../../../packages/utils/src/testid-helper.js";
8
10
  import "xe-utils";
9
- import "dayjs";
10
11
  import "dayjs/plugin/utc";
11
12
  import "dayjs/plugin/timezone";
12
13
  import "../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
@@ -24,7 +25,7 @@ import { componentMap as V } from "../componentMap.js";
24
25
  function _(i) {
25
26
  return typeof i == "function" || Object.prototype.toString.call(i) === "[object Object]" && !k(i);
26
27
  }
27
- const ft = /* @__PURE__ */ w({
28
+ const dt = /* @__PURE__ */ w({
28
29
  name: "TtTableButton",
29
30
  directives: {
30
31
  disabledTip: U
@@ -36,9 +37,9 @@ const ft = /* @__PURE__ */ w({
36
37
  default: () => []
37
38
  },
38
39
  /** 分割线 */
39
- divider: a.bool.def(!0),
40
+ divider: m.bool.def(!0),
40
41
  /** 是否阻止默认行为 */
41
- stopButtonPropagation: a.bool.def(!0)
42
+ stopButtonPropagation: m.bool.def(!0)
42
43
  },
43
44
  setup(i, {
44
45
  slots: g
@@ -48,7 +49,7 @@ const ft = /* @__PURE__ */ w({
48
49
  } = F("table-buttons"), h = S("tableIdContext", f(() => "")), T = (t) => O(d(h), "toolbar-btn", A(t)), C = (t) => {
49
50
  const e = t.ifShow;
50
51
  let o = !0;
51
- return z(e) && (o = e), m(e) && (o = e(t)), o;
52
+ return z(e) && (o = e), a(e) && (o = e(t)), o;
52
53
  }, v = f(() => (i.actions || []).filter((t) => C(t))), y = (t) => {
53
54
  if (!i.stopButtonPropagation) return;
54
55
  t.composedPath().find((r) => {
@@ -61,7 +62,7 @@ const ft = /* @__PURE__ */ w({
61
62
  return D(o) && o.length > 0 ? o.some((r) => !!(r != null && r.condition)) : N(o) ? !!o.condition : !!e;
62
63
  }
63
64
  function I(t, e = "default", o) {
64
- if (!t || !Reflect.has(t, e) || !m(t[e]))
65
+ if (!t || !Reflect.has(t, e) || !a(t[e]))
65
66
  return null;
66
67
  const r = t[e];
67
68
  return r ? r(o) : null;
@@ -127,5 +128,5 @@ const ft = /* @__PURE__ */ w({
127
128
  }
128
129
  });
129
130
  export {
130
- ft as default
131
+ dt as default
131
132
  };
@@ -10,8 +10,9 @@ import { useDesign as ne } from "../../../../packages/hooks/src/useDesign.js";
10
10
  import "axios";
11
11
  import { ElScrollbar as B, ElCheckbox as z, ElCheckboxGroup as ae, ElTooltip as se } from "element-plus";
12
12
  import { isNumber as A } from "../../../../packages/utils/src/is.js";
13
- import "xe-utils";
14
13
  import "dayjs";
14
+ import "numeral";
15
+ import "xe-utils";
15
16
  import "dayjs/plugin/utc";
16
17
  import "dayjs/plugin/timezone";
17
18
  import "../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
@@ -23,7 +24,7 @@ import "lodash-es";
23
24
  import "vue-router";
24
25
  import re from "sortablejs";
25
26
  import { useModalRender as ue } from "../../../tt-modal/src/hooks/useModalRender.js";
26
- const de = ["aria-label", "onClick"], Ae = /* @__PURE__ */ X({
27
+ const de = ["aria-label", "onClick"], Ie = /* @__PURE__ */ X({
27
28
  __name: "TableColumnModal",
28
29
  props: {
29
30
  openColumn: { type: Function },
@@ -227,5 +228,5 @@ const de = ["aria-label", "onClick"], Ae = /* @__PURE__ */ X({
227
228
  }
228
229
  });
229
230
  export {
230
- Ae as default
231
+ Ie as default
231
232
  };
@@ -1,9 +1,10 @@
1
- import { defineComponent as x, inject as E, computed as a, unref as o, ref as I, createElementBlock as s, openBlock as n, createBlock as d, createCommentVNode as f, withCtx as m, renderSlot as u, Fragment as b, renderList as B, createVNode as h } from "vue";
1
+ import { defineComponent as x, inject as E, computed as a, unref as e, ref as I, createElementBlock as s, openBlock as n, createBlock as d, createCommentVNode as f, withCtx as m, renderSlot as u, Fragment as b, renderList as B, createVNode as h } from "vue";
2
2
  import { TtIcon as $ } from "../../../tt-icon/index.js";
3
3
  import { TtButton as y } from "../../../tt-button/index.js";
4
4
  import "axios";
5
5
  import { ElSpace as A, ElTooltip as z } from "element-plus";
6
6
  import "dayjs";
7
+ import "numeral";
7
8
  import { generateTestId as N } from "../../../../packages/utils/src/testid-helper.js";
8
9
  import "xe-utils";
9
10
  import "dayjs/plugin/utc";
@@ -18,7 +19,7 @@ import { toolProps as V } from "../toolProps.js";
18
19
  import j from "../../../../assets/svg/RiRefreshLine.svg.js";
19
20
  import F from "../../../../assets/svg/exportSvg.svg.js";
20
21
  import L from "../../../../assets/svg/columnSet.svg.js";
21
- const P = ["data-testid"], lt = /* @__PURE__ */ x({
22
+ const P = ["data-testid"], it = /* @__PURE__ */ x({
22
23
  __name: "TableToolbarTools",
23
24
  props: V,
24
25
  emits: ["on-refresh", "on-columns-setting", "on-export"],
@@ -26,12 +27,12 @@ const P = ["data-testid"], lt = /* @__PURE__ */ x({
26
27
  const r = k, l = g, v = E(
27
28
  "tableIdContext",
28
29
  a(() => "")
29
- ), C = a(() => N(o(v), "table-toolbar-tools")), c = I(/* @__PURE__ */ new Set());
30
- function T(t, p) {
31
- c.value.add(t), p();
30
+ ), C = a(() => N(e(v), "table-toolbar-tools")), p = I(/* @__PURE__ */ new Set());
31
+ function T(t, c) {
32
+ p.value.add(t), c();
32
33
  }
33
34
  function S(t) {
34
- c.value.delete(t);
35
+ p.value.delete(t);
35
36
  }
36
37
  const _ = a(() => [
37
38
  {
@@ -53,32 +54,32 @@ const P = ["data-testid"], lt = /* @__PURE__ */ x({
53
54
  if: r.showSetColumn
54
55
  }
55
56
  ]);
56
- return (t, p) => (n(), s("div", { "data-testid": C.value }, [
57
- t.showSetting ? (n(), d(o(A), {
57
+ return (t, c) => (n(), s("div", { "data-testid": C.value }, [
58
+ t.showSetting ? (n(), d(e(A), {
58
59
  key: 0,
59
60
  size: 12
60
61
  }, {
61
62
  default: m(() => [
62
63
  u(t.$slots, "toolbar-left"),
63
- (n(!0), s(b, null, B(_.value, (e, i) => (n(), s(b, { key: i }, [
64
- e.if ? (n(), d(o(z), {
64
+ (n(!0), s(b, null, B(_.value, (o, i) => (n(), s(b, { key: i }, [
65
+ o.if ? (n(), d(e(z), {
65
66
  key: 0,
66
67
  class: "box-item",
67
68
  effect: "dark",
68
- content: e.label,
69
+ content: o.label,
69
70
  placement: "top",
70
71
  "show-after": 200
71
72
  }, {
72
73
  default: m(() => [
73
- h(o(y), {
74
+ h(e(y), {
74
75
  class: "icon-table-btn",
75
- "aria-label": e.label,
76
- onClick: (w) => T(i, e.handler),
76
+ "aria-label": o.label,
77
+ onClick: (w) => T(i, o.handler),
77
78
  onAnimationend: (w) => S(i)
78
79
  }, {
79
80
  default: m(() => [
80
- h(o($), {
81
- icon: e.icon,
81
+ h(e($), {
82
+ icon: o.icon,
82
83
  size: 14,
83
84
  "is-custom-svg": ""
84
85
  }, null, 8, ["icon"])
@@ -97,5 +98,5 @@ const P = ["data-testid"], lt = /* @__PURE__ */ x({
97
98
  }
98
99
  });
99
100
  export {
100
- lt as default
101
+ it as default
101
102
  };
@@ -1 +1,10 @@
1
- export declare const basicTableEmits: any[];
1
+ /**
2
+ * 表格透传给 vxe-table 的事件名,加上组件库自己的事件。
3
+ *
4
+ * 必须显式标注 `string[]`:`tableEmits` 来自没有类型声明的 vxe 内部路径,类型是 `any`,
5
+ * 展开进数组后会让整个数组退化为 `any[]`。Vue 由此生成的 props 会落到
6
+ * `[x: \`on${Capitalize<string>}\`]: ((...args: any[] | unknown[]) => any) | undefined` 索引签名,
7
+ * 其中的 `unknown[]` 在参数逆变位置上与任何具名参数的回调都不兼容,
8
+ * 业务侧 `@selection-change="({ rows }) => ..."` 这类写法会整片报 TS2322。
9
+ */
10
+ export declare const basicTableEmits: string[];
@@ -3,8 +3,9 @@ import "axios";
3
3
  import "element-plus";
4
4
  import { isFunction as w } from "../../../../packages/utils/src/is.js";
5
5
  import { ref as B, getCurrentScope as D, onScopeDispose as G, toValue as a, unref as f } from "vue";
6
- import "xe-utils";
7
6
  import "dayjs";
7
+ import "numeral";
8
+ import "xe-utils";
8
9
  import "dayjs/plugin/utc";
9
10
  import "dayjs/plugin/timezone";
10
11
  import "../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
@@ -13,32 +14,32 @@ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/en
13
14
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
14
15
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
15
16
  import "lodash-es";
16
- function Y({
17
+ function Z({
17
18
  getTableProps: K,
18
19
  getProps: O,
19
20
  tableMethods: S
20
21
  }) {
21
22
  const m = B();
22
- let c = 0, d = !1;
23
+ let p = 0, d = !1;
23
24
  const A = (t) => w(t) ? t() : t ?? "";
24
25
  async function q() {
25
26
  var e, r, i, u;
26
- const t = ++c;
27
+ const t = ++p;
27
28
  try {
28
- const { columns: s, columnsKey: j, defaultDisplayFields: l, getColumnsApi: C } = f(K), g = A(j);
29
+ const { columns: s, columnsKey: j, defaultDisplayFields: c, getColumnsApi: C } = f(K), g = A(j);
29
30
  if (!((r = (e = a(O)) == null ? void 0 : e.table) != null && r.useHttpCache) || !g || !v.userId) return;
30
- const n = (i = a(s)) != null && i.length ? a(s) : S.getTableColumns(), y = await (C == null ? void 0 : C({ permissionOnlyCode: g, userId: v.userId }));
31
- if (d || t !== c) return;
32
- const o = (u = y == null ? void 0 : y.records) == null ? void 0 : u[0];
31
+ const o = (i = a(s)) != null && i.length ? a(s) : S.getTableColumns(), y = await (C == null ? void 0 : C({ permissionOnlyCode: g, userId: v.userId }));
32
+ if (d || t !== p) return;
33
+ const n = (u = y == null ? void 0 : y.records) == null ? void 0 : u[0];
33
34
  let I;
34
- if (o != null && o.json) {
35
- const h = JSON.parse(o.json), x = new Map((n == null ? void 0 : n.map((p) => [p.field, p])) ?? []);
36
- I = h.map((p) => x.get(p)).filter(Boolean);
35
+ if (n != null && n.json) {
36
+ const h = JSON.parse(n.json), x = new Map((o == null ? void 0 : o.map((l) => [l.field, l])) ?? []);
37
+ I = h.map((l) => x.get(l)).filter(Boolean);
37
38
  } else
38
- I = l != null && l.length ? n == null ? void 0 : n.filter((h) => l.includes(h.field)) : n;
39
- m.value = o == null ? void 0 : o.id, S.setTableColumns(I);
39
+ I = c != null && c.length ? o == null ? void 0 : o.filter((h) => c.includes(h.field)) : o;
40
+ m.value = n == null ? void 0 : n.id, S.setTableColumns(I);
40
41
  } catch {
41
- if (d || t !== c) return;
42
+ if (d || t !== p) return;
42
43
  }
43
44
  }
44
45
  async function b(t) {
@@ -55,9 +56,9 @@ function Y({
55
56
  }
56
57
  }
57
58
  return D() && G(() => {
58
- d = !0, c += 1;
59
+ d = !0, p += 1;
59
60
  }), { restoreColumns: q, saveColumns: b };
60
61
  }
61
62
  export {
62
- Y as useColumnPersistence
63
+ Z as useColumnPersistence
63
64
  };
@@ -3,8 +3,9 @@ import "axios";
3
3
  import "element-plus";
4
4
  import { isBoolean as _, isFunction as j, isArray as q, isString as G } from "../../../../packages/utils/src/is.js";
5
5
  import { ref as K, shallowRef as U, computed as d, unref as o, watch as I, toValue as X, nextTick as O, onScopeDispose as H } from "vue";
6
- import J from "xe-utils";
7
6
  import "dayjs";
7
+ import "numeral";
8
+ import J from "xe-utils";
8
9
  import "dayjs/plugin/utc";
9
10
  import "dayjs/plugin/timezone";
10
11
  import "../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
@@ -58,7 +59,7 @@ function T(e) {
58
59
  }
59
60
  );
60
61
  }
61
- function at(e, i, s) {
62
+ function mt(e, i, s) {
62
63
  const r = K([]), u = U(!1), m = d(() => {
63
64
  const { customizeColumn: t, editRules: l } = o(e);
64
65
  return {
@@ -133,5 +134,5 @@ function at(e, i, s) {
133
134
  };
134
135
  }
135
136
  export {
136
- at as useColumns
137
+ mt as useColumns
137
138
  };
@@ -2,8 +2,9 @@ import "axios";
2
2
  import "element-plus";
3
3
  import { isElement as O } from "../../../../packages/utils/src/is.js";
4
4
  import { onMounted as C, onScopeDispose as N, nextTick as S } from "vue";
5
- import "xe-utils";
6
5
  import "dayjs";
6
+ import "numeral";
7
+ import "xe-utils";
7
8
  import "dayjs/plugin/utc";
8
9
  import "dayjs/plugin/timezone";
9
10
  import "../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
@@ -13,85 +14,85 @@ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mo
13
14
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
14
15
  import "lodash-es";
15
16
  const f = 'button:not([disabled]):not([tabindex="-1"]),input:not([disabled]),select:not([disabled]),textarea:not([disabled])';
16
- function b(i) {
17
+ function m(i) {
17
18
  const d = window.getComputedStyle(i);
18
19
  return d.display !== "none" && d.visibility !== "hidden" && !!i.offsetParent;
19
20
  }
20
- function k(i) {
21
+ function U(i) {
21
22
  function d(t = i.value) {
22
23
  const e = t == null ? void 0 : t.querySelector(".vxe-table");
23
- return e ? Array.from(e.querySelectorAll(f)).filter(b).filter((n, r, o) => {
24
- const s = n.closest('[class*="table-action"]');
24
+ return e ? Array.from(e.querySelectorAll(f)).filter(m).filter((o, r, n) => {
25
+ const s = o.closest('[class*="table-action"]');
25
26
  if (!s) return !0;
26
27
  const c = s.getBoundingClientRect();
27
- return !o.some((l) => {
28
+ return !n.some((l) => {
28
29
  const u = l.closest('[class*="table-action"]');
29
30
  if (!u || u === s) return !1;
30
31
  const a = u.getBoundingClientRect();
31
32
  return Math.abs(a.top - c.top) <= 2 && a.left > c.left;
32
33
  });
33
- }).sort((n, r) => {
34
- const o = (n.closest(".vxe-body--column") || n).getBoundingClientRect(), s = (r.closest(".vxe-body--column") || r).getBoundingClientRect();
35
- return Math.abs(o.top - s.top) > 2 ? o.top - s.top : Math.abs(o.left - s.left) > 2 ? o.left - s.left : n.getBoundingClientRect().top - r.getBoundingClientRect().top;
34
+ }).sort((o, r) => {
35
+ const n = (o.closest(".vxe-body--column") || o).getBoundingClientRect(), s = (r.closest(".vxe-body--column") || r).getBoundingClientRect();
36
+ return Math.abs(n.top - s.top) > 2 ? n.top - s.top : Math.abs(n.left - s.left) > 2 ? n.left - s.left : o.getBoundingClientRect().top - r.getBoundingClientRect().top;
36
37
  }) : [];
37
38
  }
38
39
  function x(t) {
39
40
  const e = i.value;
40
41
  if (!e) return;
41
- const n = Array.from(document.querySelectorAll(f)).filter((r) => {
42
- if (!b(r) || e.contains(r) || r.closest(".tt-table")) return !1;
43
- const o = e.compareDocumentPosition(r);
44
- return t ? !!(o & Node.DOCUMENT_POSITION_FOLLOWING) : !!(o & Node.DOCUMENT_POSITION_PRECEDING);
42
+ const o = Array.from(document.querySelectorAll(f)).filter((r) => {
43
+ if (!m(r) || e.contains(r) || r.closest(".tt-table")) return !1;
44
+ const n = e.compareDocumentPosition(r);
45
+ return t ? !!(n & Node.DOCUMENT_POSITION_FOLLOWING) : !!(n & Node.DOCUMENT_POSITION_PRECEDING);
45
46
  });
46
- return t ? n[0] : n[n.length - 1];
47
+ return t ? o[0] : o[o.length - 1];
47
48
  }
48
49
  function E(t) {
49
50
  const e = i.value;
50
51
  if (!e) return;
51
- const n = Array.from(document.querySelectorAll(".tt-table")), r = n[n.indexOf(e) + (t ? 1 : -1)], o = r ? m(r) : [];
52
- if (o.length)
53
- return t ? o[0] : o[o.length - 1];
52
+ const o = Array.from(document.querySelectorAll(".tt-table")), r = o[o.indexOf(e) + (t ? 1 : -1)], n = r ? b(r) : [];
53
+ if (n.length)
54
+ return t ? n[0] : n[n.length - 1];
54
55
  }
55
56
  function T(t = i.value) {
56
57
  return t ? Array.from(t.querySelectorAll(f)).filter(
57
- (e) => !e.closest(".vxe-table") && b(e)
58
+ (e) => !e.closest(".vxe-table") && m(e)
58
59
  ) : [];
59
60
  }
60
- function m(t = i.value) {
61
+ function b(t = i.value) {
61
62
  return [...T(t), ...d(t)];
62
63
  }
63
64
  function y(t) {
64
65
  if (t.key !== "Tab") return;
65
66
  const e = t.target;
66
67
  if (!O(e)) return;
67
- const n = m(), r = e.closest(f), o = r ? n.indexOf(r) : -1;
68
- if (o < 0) return;
69
- const s = !t.shiftKey, c = x(s), l = E(s), u = c && l ? !!(c.compareDocumentPosition(l) & Node.DOCUMENT_POSITION_FOLLOWING) === s ? c : l : c || l, a = n[o + (s ? 1 : -1)] || u;
68
+ const o = b(), r = e.closest(f), n = r ? o.indexOf(r) : -1;
69
+ if (n < 0) return;
70
+ const s = !t.shiftKey, c = x(s), l = E(s), u = c && l ? !!(c.compareDocumentPosition(l) & Node.DOCUMENT_POSITION_FOLLOWING) === s ? c : l : c || l, a = o[n + (s ? 1 : -1)] || u;
70
71
  a && (t.preventDefault(), t.stopPropagation(), S(() => a.focus()));
71
72
  }
72
73
  function g(t) {
73
74
  if (t.key !== "Tab") return;
74
- const e = t.target, n = i.value;
75
- if (!O(e) || !n) return;
75
+ const e = t.target, o = i.value;
76
+ if (!O(e) || !o) return;
76
77
  const r = e.closest(".tt-table");
77
- if (r && r !== n) return;
78
- if (n.contains(e)) {
78
+ if (r && r !== o) return;
79
+ if (o.contains(e)) {
79
80
  y(t);
80
81
  return;
81
82
  }
82
- const o = e.closest(f);
83
- if (!o) return;
84
- const s = m(), c = t.shiftKey ? s[s.length - 1] : s[0];
83
+ const n = e.closest(f);
84
+ if (!n) return;
85
+ const s = b(), c = t.shiftKey ? s[s.length - 1] : s[0];
85
86
  if (!c) return;
86
87
  const l = Array.from(document.querySelectorAll(f)).filter(
87
- (p) => !p.closest('[class*="table-action"]') && b(p)
88
- ), u = l.indexOf(o);
88
+ (p) => !p.closest('[class*="table-action"]') && m(p)
89
+ ), u = l.indexOf(n);
89
90
  if (u < 0) return;
90
91
  const a = l[u + (t.shiftKey ? -1 : 1)];
91
- !a || !n.contains(a) || (t.preventDefault(), t.stopPropagation(), c.focus());
92
+ !a || !o.contains(a) || (t.preventDefault(), t.stopPropagation(), c.focus());
92
93
  }
93
94
  return C(() => document.addEventListener("keydown", g, !0)), N(() => document.removeEventListener("keydown", g, !0)), { onTableKeydown: y };
94
95
  }
95
96
  export {
96
- k as useKeyboardNav
97
+ U as useKeyboardNav
97
98
  };
@@ -2,7 +2,8 @@ import { GlobalConfig as f } from "../../../../hooks/useSetup.js";
2
2
  import "axios";
3
3
  import "element-plus";
4
4
  import "dayjs";
5
- import { ref as c, unref as e, computed as P, watch as l } from "vue";
5
+ import { ref as c, unref as o, computed as P, watch as l } from "vue";
6
+ import "numeral";
6
7
  import "xe-utils";
7
8
  import "dayjs/plugin/utc";
8
9
  import "dayjs/plugin/timezone";
@@ -20,32 +21,32 @@ const C = {
20
21
  pageSizes: [300, 500, 1e3, 2e3],
21
22
  layouts: ["Total", "PrevPage", "JumpNumber", "NextPage", "Sizes", "FullJump"]
22
23
  };
23
- function O(r, g) {
24
+ function T(e, g) {
24
25
  var a;
25
- const o = c(
26
- s(e(r).pagerConfig || {}, ((a = f.table) == null ? void 0 : a.pagerConfig) || {})
26
+ const r = c(
27
+ s(o(e).pagerConfig || {}, ((a = f.table) == null ? void 0 : a.pagerConfig) || {})
27
28
  ), i = P(() => {
28
- const { showPager: t, pagerConfig: u } = e(r);
29
+ const { showPager: t, pagerConfig: u } = o(e);
29
30
  if (!(!t && !u))
30
- return { ...C, ...e(o) };
31
+ return { ...C, ...o(r) };
31
32
  });
32
33
  function p() {
33
- return e(i);
34
+ return o(i);
34
35
  }
35
36
  function n(t) {
36
- o.value = { ...e(o), ...t };
37
+ r.value = { ...o(r), ...t };
37
38
  }
38
39
  function m(t) {
39
40
  g("page-change", t);
40
41
  }
41
42
  return l(
42
- () => e(r).pagerConfig,
43
+ () => o(e).pagerConfig,
43
44
  (t) => {
44
45
  t && n(t);
45
46
  },
46
47
  { deep: !0 }
47
- ), { pagination: o, paginationInfo: i, getPagination: p, setPagination: n, onPageChange: m };
48
+ ), { pagination: r, paginationInfo: i, getPagination: p, setPagination: n, onPageChange: m };
48
49
  }
49
50
  export {
50
- O as usePagination
51
+ T as usePagination
51
52
  };
@@ -3,8 +3,9 @@ import "axios";
3
3
  import "element-plus";
4
4
  import { isFunction as b, isObject as ae, isUndefined as ne, isArray as se } from "../../../../packages/utils/src/is.js";
5
5
  import { shallowRef as K, computed as oe, unref as t, watch as ce, onMounted as le, nextTick as ue, onScopeDispose as fe } from "vue";
6
- import "xe-utils";
7
6
  import "dayjs";
7
+ import "numeral";
8
+ import "xe-utils";
8
9
  import "dayjs/plugin/utc";
9
10
  import "dayjs/plugin/timezone";
10
11
  import "../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
@@ -13,8 +14,8 @@ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/en
13
14
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
14
15
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
15
16
  import { omit as me, set as R, get as x } from "lodash-es";
16
- function Oe(s, W, O) {
17
- const { grid: u, pagination: f, paginationInfo: d, setPagination: p, setLoading: q, resetSelectionAfterFetch: T, rows: X, applyRows: j } = W, P = K({ currentPage: 1 }), y = K(!1);
17
+ function Oe(s, W, p) {
18
+ const { grid: u, pagination: f, paginationInfo: d, setPagination: O, setLoading: q, resetSelectionAfterFetch: T, rows: X, applyRows: j } = W, P = K({ currentPage: 1 }), y = K(!1);
18
19
  let w = !0, D = !1, S = !1, g;
19
20
  const L = oe(() => {
20
21
  const { showPager: e, isScrollFetch: r } = t(s);
@@ -87,10 +88,10 @@ function Oe(s, W, O) {
87
88
  await Q({ tablePage: { currentPage: 1, pageSize: m.pageSize } });
88
89
  return;
89
90
  }
90
- if (!await j(I, n) || !n() || (p({ total: H, currentPage: v }), P.value = A(t(d)), O("fetch-success", { items: I, total: E, rawDataSource: F }), !n()) || (T(), !n())) return;
91
+ if (!await j(I, n) || !n() || (O({ total: H, currentPage: v }), P.value = A(t(d)), p("fetch-success", { items: I, total: E, rawDataSource: F }), !n()) || (T(), !n())) return;
91
92
  y.value = !0;
92
93
  } catch (m) {
93
- if (!n() || (O("fetch-error", m), !n()) || !await j([], n) || !n() || (p({ total: 0 }), P.value = A(t(d)), T(), !n())) return;
94
+ if (!n() || (p("fetch-error", m), !n()) || !await j([], n) || !n() || (O({ total: 0 }), P.value = A(t(d)), T(), !n())) return;
94
95
  y.value = !0;
95
96
  } finally {
96
97
  g === a && (g = void 0, q(!1));
@@ -16,6 +16,7 @@ type RowConfig = VxeTablePropTypes.RowConfig<Recordable>;
16
16
  */
17
17
  export declare function useRowIdentity(propsRef: ComputedRef<TtTableProps>): {
18
18
  getRowKey: (row: Recordable) => RowKey | undefined;
19
+ getRowKeys: (rows: Recordable[]) => (RowKey | undefined)[];
19
20
  prepareRows: (records: Recordable | Recordable[]) => void;
20
21
  toVxeRowConfig: (rowConfig?: RowConfig) => RowConfig;
21
22
  };