@dazhicheng/ui 1.5.266 → 1.6.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 (182) 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.vue.js +1 -1
  4. package/dist/components/tt-area/TtArea.vue3.js +8 -7
  5. package/dist/components/tt-button/index.js +5 -4
  6. package/dist/components/tt-button/index.vue2.js +4 -3
  7. package/dist/components/tt-checkbox/index.js +4 -3
  8. package/dist/components/tt-checkbox/index.vue.js +4 -3
  9. package/dist/components/tt-drawer/index.js +4 -3
  10. package/dist/components/tt-drawer/src/RenderDrawer.vue.js +4 -3
  11. package/dist/components/tt-drawer/src/components/DrawerFooter.vue.js +8 -7
  12. package/dist/components/tt-drawer/src/components/DrawerHeader.vue.js +2 -2
  13. package/dist/components/tt-drawer/src/components/DrawerHeader.vue2.js +3 -2
  14. package/dist/components/tt-drawer/src/hooks/useResizable.js +2 -2
  15. package/dist/components/tt-drawer/src/props.js +3 -2
  16. package/dist/components/tt-drawer/src/utils/drawer-api.js +4 -2
  17. package/dist/components/tt-empty/index.js +9 -8
  18. package/dist/components/tt-form/index.js +10 -9
  19. package/dist/components/tt-form/src/components/ExpandableArrow.vue2.js +3 -2
  20. package/dist/components/tt-form/src/components/FormActions.vue2.js +4 -2
  21. package/dist/components/tt-form/src/form/FormDescription.vue.js +3 -2
  22. package/dist/components/tt-form/src/form/FormItem.vue.js +6 -5
  23. package/dist/components/tt-form/src/form/FormLabel.vue.js +8 -7
  24. package/dist/components/tt-form/src/form/RenderContent.vue.js +4 -3
  25. package/dist/components/tt-form/src/form-render/FormField.vue2.js +30 -28
  26. package/dist/components/tt-form/src/form-render/FormLabel.vue2.js +4 -2
  27. package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.d.ts +3 -3
  28. package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.js +1 -0
  29. package/dist/components/tt-form/src/form-render/array-register/utils.js +6 -4
  30. package/dist/components/tt-form/src/form-render/dependencies.js +19 -18
  31. package/dist/components/tt-form/src/form-render/form.vue2.js +4 -2
  32. package/dist/components/tt-form/src/form-render/helper.js +15 -14
  33. package/dist/components/tt-form/src/form-render/rootWrapperClass.js +3 -2
  34. package/dist/components/tt-form/src/formApi.js +3 -2
  35. package/dist/components/tt-form/src/group-form/GroupForm.vue2.js +4 -3
  36. package/dist/components/tt-form/src/group-form/GroupSection.vue2.js +2 -0
  37. package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +4 -2
  38. package/dist/components/tt-form/src/group-form/groupFormApi.js +4 -3
  39. package/dist/components/tt-form/src/hooks/useForwardPriorityValues.js +3 -2
  40. package/dist/components/tt-form/src/hooks/useSelectCollapse.js +28 -27
  41. package/dist/components/tt-form/src/index.vue2.js +3 -2
  42. package/dist/components/tt-form/src/useFormContext.js +11 -10
  43. package/dist/components/tt-form-item-error-tooltip/index.js +5 -4
  44. package/dist/components/tt-form-item-error-tooltip/index.vue.js +4 -3
  45. package/dist/components/tt-icon/index.js +6 -5
  46. package/dist/components/tt-icon/index.vue.js +2 -2
  47. package/dist/components/tt-image/index.js +6 -5
  48. package/dist/components/tt-image/src/components/ImageViewer.js +7 -6
  49. package/dist/components/tt-loading/index.js +4 -3
  50. package/dist/components/tt-loading/src/directive.js +24 -23
  51. package/dist/components/tt-loading/src/loading.vue.js +2 -2
  52. package/dist/components/tt-log/index.js +4 -3
  53. package/dist/components/tt-log/index.vue.js +3 -2
  54. package/dist/components/tt-modal/index.js +3 -2
  55. package/dist/components/tt-modal/src/RenderModal.vue.js +3 -2
  56. package/dist/components/tt-modal/src/components/ModalFooter.vue2.js +3 -2
  57. package/dist/components/tt-modal/src/components/ModalHeader.vue2.js +3 -2
  58. package/dist/components/tt-modal/src/components/ModalWrapper.vue.js +15 -14
  59. package/dist/components/tt-modal/src/props.js +3 -2
  60. package/dist/components/tt-modal/src/utils/modal-api.js +4 -2
  61. package/dist/components/tt-modal-form/index.vue.js +4 -3
  62. package/dist/components/tt-nav-anchor/index.js +4 -3
  63. package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue.js +15 -14
  64. package/dist/components/tt-panel-select/index.js +4 -3
  65. package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.d.ts +2 -2
  66. package/dist/components/tt-panel-select/src/hooks/usePanelData.js +95 -87
  67. package/dist/components/tt-panel-select/src/index.vue.js +4 -2
  68. package/dist/components/tt-radio-group/index.js +4 -3
  69. package/dist/components/tt-radio-group/index.vue.js +7 -6
  70. package/dist/components/tt-select/index.js +4 -3
  71. package/dist/components/tt-select/src/Select.vue.d.ts +12 -12
  72. package/dist/components/tt-select/src/Select.vue.js +4 -3
  73. package/dist/components/tt-select/src/components/SelectTable.vue.d.ts +116 -7
  74. package/dist/components/tt-select/src/components/SelectTable.vue.js +3 -2
  75. package/dist/components/tt-select/src/components/Table.vue.d.ts +8 -8
  76. package/dist/components/tt-select/src/components/Table.vue.js +3 -2
  77. package/dist/components/tt-select/src/hooks/useDataSource.js +4 -3
  78. package/dist/components/tt-select/src/hooks/useKeyboard.d.ts +7 -1
  79. package/dist/components/tt-select/src/hooks/useSelect.js +3 -2
  80. package/dist/components/tt-select/src/hooks/useSelectTableEvent.d.ts +1 -1
  81. package/dist/components/tt-select/src/hooks/useSelectTableEvent.js +28 -27
  82. package/dist/components/tt-select/src/props.d.ts +2 -2
  83. package/dist/components/tt-table/index.d.ts +526 -361
  84. package/dist/components/tt-table/index.js +7 -5
  85. package/dist/components/tt-table/src/Table.vue.d.ts +308 -218
  86. package/dist/components/tt-table/src/Table.vue.js +406 -618
  87. package/dist/components/tt-table/src/TableForm.vue.d.ts +384 -19
  88. package/dist/components/tt-table/src/TableForm.vue.js +219 -229
  89. package/dist/components/tt-table/src/components/TableAction.vue.js +110 -131
  90. package/dist/components/tt-table/src/components/TableButtons.js +30 -29
  91. package/dist/components/tt-table/src/components/TableColumnModal.vue2.js +88 -84
  92. package/dist/components/tt-table/src/components/TableToolbarTools.vue.d.ts +80 -0
  93. package/dist/components/tt-table/src/components/{TableToobalTools.vue.js → TableToolbarTools.vue.js} +34 -35
  94. package/dist/components/tt-table/src/components/TableToolbarTools.vue2.js +4 -0
  95. package/dist/components/tt-table/src/emits.d.ts +10 -1
  96. package/dist/components/tt-table/src/emits.js +2 -1
  97. package/dist/components/tt-table/src/hooks/useColumnPersistence.d.ts +19 -0
  98. package/dist/components/tt-table/src/hooks/useColumnPersistence.js +64 -0
  99. package/dist/components/tt-table/src/hooks/useColumns.d.ts +505 -21
  100. package/dist/components/tt-table/src/hooks/useColumns.js +101 -245
  101. package/dist/components/tt-table/src/hooks/useGridProps.d.ts +36 -0
  102. package/dist/components/tt-table/src/hooks/useGridProps.js +121 -0
  103. package/dist/components/tt-table/src/hooks/useKeyboardNav.d.ts +11 -0
  104. package/dist/components/tt-table/src/hooks/useKeyboardNav.js +98 -0
  105. package/dist/components/tt-table/src/hooks/usePagination.d.ts +14 -8
  106. package/dist/components/tt-table/src/hooks/usePagination.js +30 -33
  107. package/dist/components/tt-table/src/hooks/useQuery.d.ts +41 -0
  108. package/dist/components/tt-table/src/hooks/useQuery.js +148 -0
  109. package/dist/components/tt-table/src/hooks/useRowIdentity.d.ts +22 -0
  110. package/dist/components/tt-table/src/hooks/useRowIdentity.js +97 -0
  111. package/dist/components/tt-table/src/hooks/useRowSelection.d.ts +24 -12
  112. package/dist/components/tt-table/src/hooks/useRowSelection.js +95 -70
  113. package/dist/components/tt-table/src/hooks/{useLeftRightSlot.d.ts → useSideSlot.d.ts} +25 -17
  114. package/dist/components/tt-table/src/hooks/useSideSlot.js +78 -0
  115. package/dist/components/tt-table/src/hooks/useSyncProps.d.ts +12 -0
  116. package/dist/components/tt-table/src/hooks/useSyncProps.js +56 -0
  117. package/dist/components/tt-table/src/hooks/useTableData.d.ts +71 -0
  118. package/dist/components/tt-table/src/hooks/useTableData.js +308 -0
  119. package/dist/components/tt-table/src/hooks/useTableFooter.d.ts +15 -0
  120. package/dist/components/tt-table/src/hooks/useTableFooter.js +47 -0
  121. package/dist/components/tt-table/src/hooks/useTableForm.d.ts +10 -5
  122. package/dist/components/tt-table/src/hooks/useTableForm.js +56 -48
  123. package/dist/components/tt-table/src/hooks/useTableMethods.d.ts +165 -0
  124. package/dist/components/tt-table/src/hooks/useTableMethods.js +183 -0
  125. package/dist/components/tt-table/src/hooks/useTableRender.d.ts +57 -55
  126. package/dist/components/tt-table/src/props.d.ts +326 -153
  127. package/dist/components/tt-table/src/props.js +125 -271
  128. package/dist/components/tt-table/src/table-defaults.d.ts +25 -0
  129. package/dist/components/tt-table/src/table-defaults.js +71 -0
  130. package/dist/components/tt-table/src/table-mutation-events.d.ts +43 -0
  131. package/dist/components/tt-table/src/table-mutation-events.js +71 -0
  132. package/dist/components/tt-table/src/types/table.d.ts +223 -88
  133. package/dist/components/tt-table/src/types/tableAction.d.ts +23 -0
  134. package/dist/components/tt-table/src/types/tableForm.d.ts +15 -26
  135. package/dist/components/tt-table/src/utils/action-tab-index.d.ts +2 -0
  136. package/dist/components/tt-table/src/utils/action-tab-index.js +51 -0
  137. package/dist/components/tt-table/src/utils/context.js +26 -12
  138. package/dist/components/tt-table/src/utils/table-api.d.ts +136 -58
  139. package/dist/components/tt-table/src/utils/table-api.js +200 -165
  140. package/dist/components/tt-table/src/utils/table-form-api.d.ts +11 -11
  141. package/dist/components/tt-table/src/utils/table-form-api.js +35 -23
  142. package/dist/components/tt-text/index.js +4 -3
  143. package/dist/components/tt-upload/index.js +6 -5
  144. package/dist/components/tt-upload/src/TtUpload.vue.js +4 -3
  145. package/dist/components/types.d.ts +0 -20
  146. package/dist/directives/disabled-tip/index.js +9 -8
  147. package/dist/hooks/useFormSchemasLink.js +4 -3
  148. package/dist/hooks/useFormat.d.ts +35 -71
  149. package/dist/hooks/useFormat.js +28 -39
  150. package/dist/hooks/usePanelSelectSchemas.js +4 -3
  151. package/dist/hooks/useScreenshotOss.js +16 -15
  152. package/dist/hooks/useSetup.js +0 -3
  153. package/dist/packages/hooks/src/useDebounce.js +6 -5
  154. package/dist/packages/hooks/src/useElementScreenshot.js +4 -3
  155. package/dist/packages/hooks/src/usePriorityValue.js +5 -4
  156. package/dist/packages/utils/src/format.js +48 -0
  157. package/dist/packages/utils/src/is.js +20 -18
  158. package/dist/packages/utils/src/tool.js +76 -149
  159. package/dist/plugins/default/renderCellContent.js +4 -3
  160. package/dist/plugins/vxeTable/switchStatus.js +14 -13
  161. package/dist/style.css +1 -1
  162. package/package.json +3 -3
  163. package/dist/components/tt-table/src/components/TableToobalTools.vue.d.ts +0 -576
  164. package/dist/components/tt-table/src/components/TableToobalTools.vue2.js +0 -4
  165. package/dist/components/tt-table/src/enum.d.ts +0 -2
  166. package/dist/components/tt-table/src/hooks/useCellArea.d.ts +0 -15
  167. package/dist/components/tt-table/src/hooks/useCellArea.js +0 -15
  168. package/dist/components/tt-table/src/hooks/useCustomColumns.d.ts +0 -20
  169. package/dist/components/tt-table/src/hooks/useCustomColumns.js +0 -65
  170. package/dist/components/tt-table/src/hooks/useDataSource.d.ts +0 -29
  171. package/dist/components/tt-table/src/hooks/useDataSource.js +0 -232
  172. package/dist/components/tt-table/src/hooks/useLeftRightSlot.js +0 -64
  173. package/dist/components/tt-table/src/hooks/useTable.d.ts +0 -7
  174. package/dist/components/tt-table/src/hooks/useTableEvent.d.ts +0 -101
  175. package/dist/components/tt-table/src/hooks/useTableEvent.js +0 -197
  176. package/dist/components/tt-table/src/hooks/useTableFormEvent.d.ts +0 -10
  177. package/dist/components/tt-table/src/hooks/useTableHeight.d.ts +0 -15
  178. package/dist/components/tt-table/src/hooks/useTableSlot.d.ts +0 -11
  179. package/dist/components/tt-table/src/hooks/useTableSlot.js +0 -17
  180. package/dist/components/tt-table/src/utils/filters.d.ts +0 -109
  181. package/dist/components/tt-table/src/utils/vxeTable.d.ts +0 -28
  182. package/dist/packages/utils/src/check.js +0 -10
@@ -2,8 +2,9 @@ import { ref as E, getCurrentInstance as O, render as w, nextTick as h, toValue
2
2
  import "axios";
3
3
  import "element-plus";
4
4
  import { isNumber as P } from "../../utils/src/is.js";
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";
@@ -47,7 +48,7 @@ function _(e) {
47
48
  function $(e, t) {
48
49
  e.style.cssText = (t == null ? void 0 : t.containerStyle) ?? W, (!(t != null && t.containerStyle) || !/width\s*:/i.test(t.containerStyle)) && (e.style.width = _(t));
49
50
  }
50
- function p() {
51
+ function ee() {
51
52
  var y;
52
53
  const e = E(!1), t = E(null), f = ((y = O()) == null ? void 0 : y.appContext) ?? null;
53
54
  async function d(u, r) {
@@ -132,5 +133,5 @@ function p() {
132
133
  };
133
134
  }
134
135
  export {
135
- p as useElementScreenshot
136
+ ee as useElementScreenshot
136
137
  };
@@ -3,6 +3,7 @@ import "axios";
3
3
  import "element-plus";
4
4
  import "dayjs";
5
5
  import { toValue as v, getCurrentInstance as d, useSlots as b, useAttrs as O, computed as P } from "vue";
6
+ import "numeral";
6
7
  import { getFirstNonNullOrUndefined as V } from "../../utils/src/tool.js";
7
8
  import "../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
8
9
  import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
@@ -26,20 +27,20 @@ function g(o, e, r) {
26
27
  );
27
28
  });
28
29
  }
29
- function U(o, e) {
30
+ function q(o, e) {
30
31
  const r = {};
31
32
  return Object.keys(o).forEach((t) => {
32
33
  r[t] = g(t, o, e);
33
34
  }), r;
34
35
  }
35
- function q(o) {
36
+ function w(o) {
36
37
  const e = {};
37
38
  for (const [r, t] of Object.entries(o))
38
39
  e[r] = v(t);
39
40
  return e;
40
41
  }
41
42
  export {
42
- q as getPriorityValues,
43
+ w as getPriorityValues,
43
44
  g as usePriorityValue,
44
- U as usePriorityValues
45
+ q as usePriorityValues
45
46
  };
@@ -0,0 +1,48 @@
1
+ import i from "dayjs";
2
+ import f from "numeral";
3
+ import { isNumber as s, isNullOrUnDef as u } from "./is.js";
4
+ const m = "0,0.00", a = "YYYY-MM-DD HH:mm:ss", c = "YYYY-MM-DD";
5
+ function B(r, t = m) {
6
+ return r ? f(r).format(t) : "0.00";
7
+ }
8
+ function D(r, t = m) {
9
+ return r ? f(r).format(t) : "0.00";
10
+ }
11
+ function g(r) {
12
+ return r ? f(f(r).format(m)).value() : 0;
13
+ }
14
+ function A(r, t) {
15
+ if (u(r) || r === "") return "";
16
+ let n = Number.parseFloat(r.toString());
17
+ if (Number.isNaN(n)) return "";
18
+ n = Math.round(n * 10 ** t) / 10 ** t;
19
+ let o = n.toString(), e = o.indexOf(".");
20
+ for (e < 0 && (e = o.length, o += "."); o.length <= e + t; ) o += "0";
21
+ return o;
22
+ }
23
+ function Y(r, t = 2) {
24
+ if (u(r) || r === 0) return "0 Bytes";
25
+ const n = 1e3, o = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], e = Math.floor(Math.log(r) / Math.log(n));
26
+ return `${Number.parseFloat((r / n ** e).toFixed(t))} ${o[e]}`;
27
+ }
28
+ function h(r, t = "period") {
29
+ if (!r) return "";
30
+ const n = (s(r) ? r.toString() : r).replace(/[-.]/g, ""), o = n.slice(0, 4), e = n.slice(4, 6);
31
+ return t === "period" ? `${o}年${e}期` : ` ${e}/${o}`;
32
+ }
33
+ function N(r, t = a) {
34
+ return u(r) ? "--" : i(r).isValid() ? i(r).format(t) : "--";
35
+ }
36
+ function O(r, t = c, n = !1) {
37
+ return u(r) ? "--" : n ? r ? i(+r).format(t) : "--" : i(r).isValid() ? i(r).format(t) : "--";
38
+ }
39
+ export {
40
+ B as formatAmount,
41
+ D as formatAmountOfPlace,
42
+ A as formatDecimal,
43
+ Y as formatFileSize,
44
+ h as formatPeriod,
45
+ g as formatPlaceOfAmount,
46
+ O as formatToDate,
47
+ N as formatToDateTime
48
+ };
@@ -18,47 +18,49 @@ function e(n) {
18
18
  function c(n) {
19
19
  return e(n) ? !1 : n instanceof Promise ? !0 : t(n, "Object");
20
20
  }
21
- function p(n) {
22
- return e(n) ? !0 : j(n) || y(n) ? n.length === 0 : n instanceof Map || n instanceof Set ? n.size === 0 : c(n) ? Object.keys(n).length === 0 : !1;
21
+ function j(n) {
22
+ return e(n) ? !0 : d(n) || y(n) ? n.length === 0 : n instanceof Map || n instanceof Set ? n.size === 0 : c(n) ? Object.keys(n).length === 0 : !1;
23
23
  }
24
- function b(n) {
24
+ function m(n) {
25
25
  return t(n, "Date");
26
26
  }
27
- function d(n) {
27
+ function b(n) {
28
28
  return t(n, "Number") && n === n;
29
29
  }
30
30
  function y(n) {
31
31
  return t(n, "String");
32
32
  }
33
- function g(n) {
33
+ function a(n) {
34
34
  return typeof n == "function";
35
35
  }
36
- function D(n) {
36
+ function g(n) {
37
37
  return t(n, "Boolean");
38
38
  }
39
- function j(n) {
40
- return n && Array.isArray(n);
39
+ function d(n) {
40
+ return Array.isArray(n);
41
41
  }
42
- function O(n) {
42
+ function D(n) {
43
43
  return typeof Element > "u" ? !1 : n instanceof Element;
44
44
  }
45
- function a(n) {
45
+ const O = typeof window > "u";
46
+ function S(n) {
46
47
  return i.isDayjs(n);
47
48
  }
48
49
  export {
49
50
  t as is,
50
- j as isArray,
51
- D as isBoolean,
52
- b as isDate,
53
- a as isDayjsObject,
51
+ d as isArray,
52
+ g as isBoolean,
53
+ m as isDate,
54
+ S as isDayjsObject,
54
55
  f as isDef,
55
- O as isElement,
56
- p as isEmpty,
57
- g as isFunction,
56
+ D as isElement,
57
+ j as isEmpty,
58
+ a as isFunction,
58
59
  s as isNull,
59
60
  e as isNullOrUnDef,
60
- d as isNumber,
61
+ b as isNumber,
61
62
  c as isObject,
63
+ O as isServer,
62
64
  y as isString,
63
65
  o as isUndefined
64
66
  };
@@ -1,181 +1,108 @@
1
- import { isObject as v, isArray as E } from "./is.js";
1
+ import "dayjs";
2
2
  import "vue";
3
3
  import "xe-utils";
4
- import { twMerge as M } from "../../../node_modules/.pnpm/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js";
5
- import { clsx as P } from "../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
6
- import { klona as U } from "../../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/full/index.js";
7
- import "dayjs";
4
+ import { twMerge as N } from "../../../node_modules/.pnpm/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js";
5
+ import { clsx as W } from "../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
6
+ import { klona as j } from "../../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/full/index.js";
8
7
  import "dayjs/plugin/utc";
9
8
  import "dayjs/plugin/timezone";
10
- function J(n, i = "12", e = "Microsoft YaHei,Arial,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue','Noto Sans',sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol','Noto Color Emoji'") {
11
- let t = 0;
12
- const o = document.createElement("canvas").getContext("2d");
13
- return o && (o.font = `${i} ${e}`, t = o.measureText(n).width), t;
14
- }
15
- function S(n, i, e) {
16
- const t = (e == null ? void 0 : e.excludeAll) || [], f = (e == null ? void 0 : e.exclude) || [];
17
- return t.includes("Id") || t.push("Id"), t.includes("rowId") || t.push("rowId"), Object.fromEntries(
18
- Object.entries(n).reduce((o, [s, r]) => (t.includes(s) || f.includes(s) || (r && v(r) ? L(e, i, r, s, o) : r && E(r) ? z(e, i, r, s, o) : H(e, i, r, s, o)), o), [])
19
- );
20
- }
21
- function L(n, i, e, t, f) {
22
- const o = S(e, i[t] || {}, {
23
- excludeAll: n == null ? void 0 : n.excludeAll,
24
- ...n
25
- });
26
- Object.keys(o).length && f.push([t, o]);
27
- }
28
- function z(n, i, e, t, f) {
29
- var r, d, u;
30
- const o = [], s = (r = (n || {})[t]) == null ? void 0 : r.key;
31
- if (i[t]) {
32
- const a = (e == null ? void 0 : e.length) >= ((d = i[t]) == null ? void 0 : d.length) ? e : i[t], g = (e == null ? void 0 : e.length) < ((u = i[t]) == null ? void 0 : u.length) ? e : i[t];
33
- s ? a.forEach((l) => {
34
- const p = g.find((h) => h[s] === l[s]);
35
- if (p) {
36
- const h = S(l, p, {
37
- excludeAll: n == null ? void 0 : n.excludeAll,
38
- ...n[t]
39
- });
40
- Object.keys(h).length && o.push({ [s]: p[s], ...h });
41
- } else
42
- o.push(l);
43
- }) : a.forEach((l, p) => {
44
- const h = g[p];
45
- if (v(l) && !v(h) || E(l) && !E(h) || typeof l != typeof h || !h)
46
- o.push(l);
47
- else if (v(l) || E(l)) {
48
- const A = S(l, h, { excludeAll: n == null ? void 0 : n.excludeAll });
49
- Object.keys(A).length && o.push({ ...A });
50
- } else l !== h && o.push(l);
51
- });
52
- } else
53
- o.push(...e);
54
- o.length && f.push([t, o]);
55
- }
56
- function H(n, i, e, t, f) {
57
- const o = (n == null ? void 0 : n.notNullToFalse) || [];
58
- if (typeof e == "string" && typeof i[t] == "number" || typeof e == "number" && typeof i[t] == "string")
59
- Number(e) !== Number(i[t]) && f.push([t, e]);
60
- else if ([void 0, null, ""].includes(e))
61
- [void 0, null, ""].includes(i[t]) || f.push([t, e]);
62
- else if (e !== i[t]) {
63
- if (e === !1 && [void 0, null, ""].includes(i[t]) && !o.includes(t))
64
- return;
65
- f.push([t, e]);
66
- }
67
- }
68
- function W(n, i, e) {
69
- const t = {}, f = ["rowId", "row_id"], o = (e == null ? void 0 : e.excludeAll) || [], s = (e == null ? void 0 : e.exclude) || [];
70
- for (const r in i)
71
- if (Object.prototype.hasOwnProperty.call(i, r) && ![...o, ...f].includes(r) && ![...s, ...f].includes(r)) {
72
- const d = n[r], u = i[r];
73
- if (Array.isArray(u) && Array.isArray(d))
74
- (d.length !== u.length || d.some((g, l) => typeof g == "object" && typeof u[l] == "object" ? Object.keys(W(g, u[l], { excludeAll: o, ...e == null ? void 0 : e[r] })).length > 0 : g !== u[l])) && (t[r] = u);
75
- else if (typeof u == "object" && typeof d == "object" && u !== null && d !== null) {
76
- const a = W(d, u, { excludeAll: o, ...e == null ? void 0 : e[r] });
77
- Object.keys(a).length > 0 && (t[r] = a);
78
- } else d !== u && String(d) !== String(u) && (t[r] = u);
79
- }
80
- return t;
9
+ function P(o, i = "12", m = "Microsoft YaHei,Arial,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue','Noto Sans',sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol','Noto Color Emoji'") {
10
+ let s = 0;
11
+ const n = document.createElement("canvas").getContext("2d");
12
+ return n && (n.font = `${i} ${m}`, s = n.measureText(o).width), s;
81
13
  }
82
- function Q(n) {
83
- const i = Object.getPrototypeOf(n);
14
+ function z(o) {
15
+ const i = Object.getPrototypeOf(o);
84
16
  if (!i || i === Object.prototype)
85
- return n;
86
- const e = Object.getOwnPropertyNames(i);
87
- for (const t of e) {
88
- const f = n[t];
89
- t !== "constructor" && typeof f == "function" && (n[t] = f.bind(n));
17
+ return o;
18
+ const m = Object.getOwnPropertyNames(i);
19
+ for (const s of m) {
20
+ const f = o[s];
21
+ s !== "constructor" && typeof f == "function" && (o[s] = f.bind(o));
90
22
  }
91
- return n;
23
+ return o;
92
24
  }
93
- function X(...n) {
94
- for (const i of n)
25
+ function F(...o) {
26
+ for (const i of o)
95
27
  if (i != null)
96
28
  return i;
97
29
  }
98
- function Z(...n) {
99
- return M(P(n));
30
+ function H(...o) {
31
+ return N(W(o));
100
32
  }
101
- function y() {
102
- const n = new Event("resize");
103
- window.dispatchEvent(n);
33
+ function R() {
34
+ const o = new Event("resize");
35
+ window.dispatchEvent(o);
104
36
  }
105
- function b(n) {
106
- return U(n);
37
+ function $(o) {
38
+ return j(o);
107
39
  }
108
- function j(n, i = 200, e = {}) {
109
- const { leading: t = !1, trailing: f = !0, maxWait: o } = e;
110
- let s, r, d, u = 0, a, g;
111
- function l(c) {
112
- const m = a;
113
- return a = void 0, u = c, g = n(...m), g;
40
+ function B(o, i = 200, m = {}) {
41
+ const { leading: s = !1, trailing: f = !0, maxWait: n } = m;
42
+ let r, d, l, a = 0, c, u;
43
+ function g(t) {
44
+ const e = c;
45
+ return c = void 0, a = t, u = o(...e), u;
114
46
  }
115
47
  function p() {
116
- s !== void 0 && (window.clearTimeout(s), s = void 0), r !== void 0 && (window.clearTimeout(r), r = void 0);
48
+ r !== void 0 && (window.clearTimeout(r), r = void 0), d !== void 0 && (window.clearTimeout(d), d = void 0);
117
49
  }
118
- function h() {
119
- p(), u = 0, a = void 0, d = void 0, g = void 0;
50
+ function S() {
51
+ p(), a = 0, c = void 0, l = void 0, u = void 0;
120
52
  }
121
- function A(c) {
122
- const m = c - d, x = c - u, N = i - m;
123
- return o !== void 0 ? Math.min(N, o - x) : N;
53
+ function h(t) {
54
+ const e = t - l, w = t - a, b = i - e;
55
+ return n !== void 0 ? Math.min(b, n - w) : b;
124
56
  }
125
- function D(c) {
126
- if (d === void 0) return !0;
127
- const m = c - d, x = c - u;
128
- return m >= i || m < 0 || o !== void 0 && x >= o;
57
+ function x(t) {
58
+ if (l === void 0) return !0;
59
+ const e = t - l, w = t - a;
60
+ return e >= i || e < 0 || n !== void 0 && w >= n;
129
61
  }
130
- function C(c) {
131
- return u = c, p(), s = window.setTimeout(T, i), o !== void 0 && (r = window.setTimeout(I, o)), t ? l(c) : g;
62
+ function k(t) {
63
+ return a = t, p(), r = window.setTimeout(T, i), n !== void 0 && (d = window.setTimeout(E, n)), s ? g(t) : u;
132
64
  }
133
- function F(c) {
134
- return s = void 0, f && a !== void 0 ? l(c) : (a = void 0, g);
65
+ function I(t) {
66
+ return r = void 0, f && c !== void 0 ? g(t) : (c = void 0, u);
135
67
  }
136
68
  function T() {
137
- const c = Date.now();
138
- if (D(c)) {
139
- F(c);
69
+ const t = Date.now();
70
+ if (x(t)) {
71
+ I(t);
140
72
  return;
141
73
  }
142
- const m = A(c);
143
- m > 0 ? s = window.setTimeout(T, m) : s = void 0;
74
+ const e = h(t);
75
+ e > 0 ? r = window.setTimeout(T, e) : r = void 0;
144
76
  }
145
- function I() {
146
- const c = Date.now();
147
- p(), a !== void 0 && l(c);
77
+ function E() {
78
+ const t = Date.now();
79
+ p(), c !== void 0 && g(t);
148
80
  }
149
- const w = (...c) => {
150
- const m = Date.now(), x = D(m);
151
- if (a = c ?? [], d = m, x) {
152
- if (s === void 0)
153
- return C(m);
154
- if (o !== void 0)
155
- return p(), s = window.setTimeout(T, i), r = window.setTimeout(I, o), t ? l(m) : g;
81
+ const v = (...t) => {
82
+ const e = Date.now(), w = x(e);
83
+ if (c = t ?? [], l = e, w) {
84
+ if (r === void 0)
85
+ return k(e);
86
+ if (n !== void 0)
87
+ return p(), r = window.setTimeout(T, i), d = window.setTimeout(E, n), s ? g(e) : u;
156
88
  }
157
- return s === void 0 && (s = window.setTimeout(T, i), o !== void 0 && (r = window.setTimeout(I, o))), g;
89
+ return r === void 0 && (r = window.setTimeout(T, i), n !== void 0 && (d = window.setTimeout(E, n))), u;
158
90
  };
159
- return w.isPending = () => s !== void 0 || r !== void 0, w.cancel = () => {
160
- h();
161
- }, w.flush = (...c) => {
162
- if (!w.isPending())
163
- return c.length > 0 ? n(...c) : g;
164
- const m = a !== void 0 ? a : c;
165
- return h(), n(...m);
166
- }, w;
91
+ return v.isPending = () => r !== void 0 || d !== void 0, v.cancel = () => {
92
+ S();
93
+ }, v.flush = (...t) => {
94
+ if (!v.isPending())
95
+ return t.length > 0 ? o(...t) : u;
96
+ const e = c !== void 0 ? c : t;
97
+ return S(), o(...e);
98
+ }, v;
167
99
  }
168
100
  export {
169
- Q as bindMethods,
170
- J as calcWordsWidth,
171
- Z as clnm,
172
- b as cloneDeep,
173
- W as compareObjects,
174
- j as debounce,
175
- S as getDifference,
176
- X as getFirstNonNullOrUndefined,
177
- z as setDifferenceArr,
178
- H as setDifferenceField,
179
- L as setDifferenceObj,
180
- y as triggerWindowResize
101
+ z as bindMethods,
102
+ P as calcWordsWidth,
103
+ H as clnm,
104
+ $ as cloneDeep,
105
+ B as debounce,
106
+ F as getFirstNonNullOrUndefined,
107
+ R as triggerWindowResize
181
108
  };
@@ -2,8 +2,9 @@ import { h as l, defineComponent as w, shallowRef as b, onMounted as $ } from "v
2
2
  import "axios";
3
3
  import "element-plus";
4
4
  import { isFunction as c } from "../../packages/utils/src/is.js";
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";
@@ -12,7 +13,7 @@ import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8
12
13
  import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
13
14
  import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
14
15
  import { cloneDeep as f } from "lodash-es";
15
- function Y() {
16
+ function _() {
16
17
  return {
17
18
  install(C) {
18
19
  C.renderer.add("renderCellContent", {
@@ -65,5 +66,5 @@ function Y() {
65
66
  };
66
67
  }
67
68
  export {
68
- Y as createVxePluginRenderCellContent
69
+ _ as createVxePluginRenderCellContent
69
70
  };
@@ -3,8 +3,9 @@ import { omit as U } from "lodash-es";
3
3
  import { h as w, defineComponent as _, ref as y } from "vue";
4
4
  import "axios";
5
5
  import { isFunction as u } from "../../packages/utils/src/is.js";
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";
@@ -35,31 +36,31 @@ function j(a) {
35
36
  inactive: t.inactiveValue ?? O
36
37
  };
37
38
  }
38
- function oe() {
39
+ function ae() {
39
40
  return {
40
41
  install(a) {
41
42
  a.renderer.add("switchStatus", {
42
43
  renderTableDefault(t, l) {
43
- const { row: i, column: n } = l, e = t.props ?? {}, v = U(e, [...D]), E = C(v);
44
+ const { row: i, column: r } = l, e = t.props ?? {}, v = U(e, [...D]), E = C(v);
44
45
  return w(
45
46
  _({
46
47
  name: "TtVxeSwitchCell",
47
48
  setup: () => {
48
- const s = y(!1), { active: r, inactive: m } = j(e);
49
+ const s = y(!1), { active: n, inactive: m } = j(e);
49
50
  return () => w(L, {
50
- activeValue: r,
51
+ activeValue: n,
51
52
  inactiveValue: m,
52
53
  ...E,
53
- modelValue: i[n.field],
54
+ modelValue: i[r.field],
54
55
  loading: s.value,
55
56
  "onUpdate:modelValue": (o) => {
56
- i[n.field] = o;
57
+ i[r.field] = o;
57
58
  },
58
59
  beforeChange: async () => {
59
60
  var d;
60
- const o = i[n.field];
61
+ const o = i[r.field];
61
62
  if ((u(e.beforeChange) ? await ((d = e.beforeChange) == null ? void 0 : d.call(e, o)) : !0) === !1 || !u(e.api)) return !1;
62
- const T = o === r ? m : r, b = `是否确认${o === r ? "关闭" : "开启"}`;
63
+ const T = o === n ? m : n, b = `是否确认${o === n ? "关闭" : "开启"}`;
63
64
  let p = !1;
64
65
  return await x({
65
66
  title: e.confirmTitle || "温馨提示",
@@ -72,9 +73,9 @@ function oe() {
72
73
  var h, V;
73
74
  if (B === "confirm") {
74
75
  f.confirmButtonLoading = !0;
75
- let c = { [n.field]: T, id: i.id };
76
+ let c = { [r.field]: T, id: i.id };
76
77
  if (s.value = !0, u(e.beforeFetch)) {
77
- const S = await ((h = e.beforeFetch) == null ? void 0 : h.call(e, c, i, n));
78
+ const S = await ((h = e.beforeFetch) == null ? void 0 : h.call(e, c, i, r));
78
79
  c = {
79
80
  ...c,
80
81
  ...S
@@ -83,7 +84,7 @@ function oe() {
83
84
  const F = await e.api(c).finally(() => {
84
85
  s.value = !1, f.confirmButtonLoading = !1;
85
86
  });
86
- (V = e.afterFetch) == null || V.call(e, F), A.success(o === r ? "禁用成功" : "启用成功"), f.confirmButtonLoading = !1, g(), p = !0;
87
+ (V = e.afterFetch) == null || V.call(e, F), A.success(o === n ? "禁用成功" : "启用成功"), f.confirmButtonLoading = !1, g(), p = !0;
87
88
  } else
88
89
  g();
89
90
  }
@@ -99,5 +100,5 @@ function oe() {
99
100
  };
100
101
  }
101
102
  export {
102
- oe as createVxePluginSwitchStatus
103
+ ae as createVxePluginSwitchStatus
103
104
  };