@dazhicheng/ui 1.5.266 → 1.6.0

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 (96) hide show
  1. package/dist/components/tt-area/TtArea.vue.js +1 -1
  2. package/dist/components/tt-drawer/src/components/DrawerHeader.vue.js +2 -2
  3. package/dist/components/tt-drawer/src/hooks/useResizable.js +2 -2
  4. package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.d.ts +3 -3
  5. package/dist/components/tt-icon/index.vue.js +2 -2
  6. package/dist/components/tt-loading/src/loading.vue.js +2 -2
  7. package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.d.ts +2 -2
  8. package/dist/components/tt-panel-select/src/hooks/usePanelData.js +93 -86
  9. package/dist/components/tt-panel-select/src/index.vue.js +1 -0
  10. package/dist/components/tt-select/src/Select.vue.d.ts +4 -4
  11. package/dist/components/tt-select/src/components/Table.vue.d.ts +4 -4
  12. package/dist/components/tt-table/index.d.ts +523 -358
  13. package/dist/components/tt-table/index.js +6 -4
  14. package/dist/components/tt-table/src/Table.vue.d.ts +306 -216
  15. package/dist/components/tt-table/src/Table.vue.js +405 -618
  16. package/dist/components/tt-table/src/TableForm.vue.d.ts +384 -19
  17. package/dist/components/tt-table/src/TableForm.vue.js +218 -228
  18. package/dist/components/tt-table/src/components/TableAction.vue.js +108 -131
  19. package/dist/components/tt-table/src/components/TableButtons.js +25 -25
  20. package/dist/components/tt-table/src/components/TableColumnModal.vue2.js +88 -85
  21. package/dist/components/tt-table/src/components/TableToolbarTools.vue.d.ts +80 -0
  22. package/dist/components/tt-table/src/components/{TableToobalTools.vue.js → TableToolbarTools.vue.js} +29 -31
  23. package/dist/components/tt-table/src/components/TableToolbarTools.vue2.js +4 -0
  24. package/dist/components/tt-table/src/emits.js +2 -1
  25. package/dist/components/tt-table/src/hooks/useColumnPersistence.d.ts +19 -0
  26. package/dist/components/tt-table/src/hooks/useColumnPersistence.js +63 -0
  27. package/dist/components/tt-table/src/hooks/useColumns.d.ts +505 -21
  28. package/dist/components/tt-table/src/hooks/useColumns.js +100 -245
  29. package/dist/components/tt-table/src/hooks/useGridProps.d.ts +36 -0
  30. package/dist/components/tt-table/src/hooks/useGridProps.js +121 -0
  31. package/dist/components/tt-table/src/hooks/useKeyboardNav.d.ts +11 -0
  32. package/dist/components/tt-table/src/hooks/useKeyboardNav.js +97 -0
  33. package/dist/components/tt-table/src/hooks/usePagination.d.ts +14 -8
  34. package/dist/components/tt-table/src/hooks/usePagination.js +29 -33
  35. package/dist/components/tt-table/src/hooks/useQuery.d.ts +41 -0
  36. package/dist/components/tt-table/src/hooks/useQuery.js +147 -0
  37. package/dist/components/tt-table/src/hooks/useRowIdentity.d.ts +22 -0
  38. package/dist/components/tt-table/src/hooks/useRowIdentity.js +96 -0
  39. package/dist/components/tt-table/src/hooks/useRowSelection.d.ts +23 -7
  40. package/dist/components/tt-table/src/hooks/useRowSelection.js +95 -71
  41. package/dist/components/tt-table/src/hooks/{useLeftRightSlot.d.ts → useSideSlot.d.ts} +25 -17
  42. package/dist/components/tt-table/src/hooks/useSideSlot.js +77 -0
  43. package/dist/components/tt-table/src/hooks/useSyncProps.d.ts +12 -0
  44. package/dist/components/tt-table/src/hooks/useSyncProps.js +55 -0
  45. package/dist/components/tt-table/src/hooks/useTableData.d.ts +71 -0
  46. package/dist/components/tt-table/src/hooks/useTableData.js +307 -0
  47. package/dist/components/tt-table/src/hooks/useTableFooter.d.ts +15 -0
  48. package/dist/components/tt-table/src/hooks/useTableFooter.js +46 -0
  49. package/dist/components/tt-table/src/hooks/useTableForm.d.ts +10 -5
  50. package/dist/components/tt-table/src/hooks/useTableForm.js +55 -48
  51. package/dist/components/tt-table/src/hooks/useTableMethods.d.ts +165 -0
  52. package/dist/components/tt-table/src/hooks/useTableMethods.js +183 -0
  53. package/dist/components/tt-table/src/hooks/useTableRender.d.ts +24 -55
  54. package/dist/components/tt-table/src/props.d.ts +318 -151
  55. package/dist/components/tt-table/src/props.js +117 -270
  56. package/dist/components/tt-table/src/table-defaults.d.ts +25 -0
  57. package/dist/components/tt-table/src/table-defaults.js +71 -0
  58. package/dist/components/tt-table/src/table-mutation-events.d.ts +43 -0
  59. package/dist/components/tt-table/src/table-mutation-events.js +70 -0
  60. package/dist/components/tt-table/src/types/table.d.ts +207 -88
  61. package/dist/components/tt-table/src/types/tableAction.d.ts +23 -0
  62. package/dist/components/tt-table/src/types/tableForm.d.ts +15 -26
  63. package/dist/components/tt-table/src/utils/action-tab-index.d.ts +2 -0
  64. package/dist/components/tt-table/src/utils/action-tab-index.js +50 -0
  65. package/dist/components/tt-table/src/utils/context.js +25 -12
  66. package/dist/components/tt-table/src/utils/table-api.d.ts +136 -58
  67. package/dist/components/tt-table/src/utils/table-api.js +198 -165
  68. package/dist/components/tt-table/src/utils/table-form-api.d.ts +11 -11
  69. package/dist/components/tt-table/src/utils/table-form-api.js +41 -31
  70. package/dist/components/types.d.ts +0 -20
  71. package/dist/hooks/useSetup.js +0 -3
  72. package/dist/packages/hooks/src/useDebounce.js +6 -6
  73. package/dist/packages/utils/src/is.js +20 -18
  74. package/dist/packages/utils/src/tool.js +76 -149
  75. package/dist/style.css +1 -1
  76. package/package.json +1 -1
  77. package/dist/components/tt-table/src/components/TableToobalTools.vue.d.ts +0 -576
  78. package/dist/components/tt-table/src/components/TableToobalTools.vue2.js +0 -4
  79. package/dist/components/tt-table/src/enum.d.ts +0 -2
  80. package/dist/components/tt-table/src/hooks/useCellArea.d.ts +0 -15
  81. package/dist/components/tt-table/src/hooks/useCellArea.js +0 -15
  82. package/dist/components/tt-table/src/hooks/useCustomColumns.d.ts +0 -20
  83. package/dist/components/tt-table/src/hooks/useCustomColumns.js +0 -65
  84. package/dist/components/tt-table/src/hooks/useDataSource.d.ts +0 -29
  85. package/dist/components/tt-table/src/hooks/useDataSource.js +0 -232
  86. package/dist/components/tt-table/src/hooks/useLeftRightSlot.js +0 -64
  87. package/dist/components/tt-table/src/hooks/useTable.d.ts +0 -7
  88. package/dist/components/tt-table/src/hooks/useTableEvent.d.ts +0 -101
  89. package/dist/components/tt-table/src/hooks/useTableEvent.js +0 -197
  90. package/dist/components/tt-table/src/hooks/useTableFormEvent.d.ts +0 -10
  91. package/dist/components/tt-table/src/hooks/useTableHeight.d.ts +0 -15
  92. package/dist/components/tt-table/src/hooks/useTableSlot.d.ts +0 -11
  93. package/dist/components/tt-table/src/hooks/useTableSlot.js +0 -17
  94. package/dist/components/tt-table/src/utils/filters.d.ts +0 -109
  95. package/dist/components/tt-table/src/utils/vxeTable.d.ts +0 -28
  96. package/dist/packages/utils/src/check.js +0 -10
@@ -1,63 +1,72 @@
1
- var n = Object.defineProperty;
2
- var h = (r, t, e) => t in r ? n(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
- var s = (r, t, e) => h(r, typeof t != "symbol" ? t + "" : t, e);
1
+ var m = Object.defineProperty;
2
+ var b = (s, t, e) => t in s ? m(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
+ var r = (s, t, e) => b(s, typeof t != "symbol" ? t + "" : t, e);
4
4
  import "axios";
5
5
  import "element-plus";
6
- import { isFunction as d } from "../../../../packages/utils/src/is.js";
7
- import { reactive as i, computed as u, toValue as b } from "vue";
8
- import { bindMethods as c } from "../../../../packages/utils/src/tool.js";
6
+ import { isFunction as c } from "../../../../packages/utils/src/is.js";
7
+ import { reactive as i, computed as u, toValue as f } from "vue";
8
+ import { bindMethods as d } from "../../../../packages/utils/src/tool.js";
9
9
  import { mergeWithArrayOverride as a } from "../../../../packages/utils/src/merge.js";
10
10
  import "../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
11
- import { StateHandler as f } from "../../../../packages/utils/src/stateHandler.js";
11
+ import { StateHandler as O } from "../../../../packages/utils/src/stateHandler.js";
12
12
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
13
13
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
14
14
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
15
15
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
16
16
  import "lodash-es";
17
- import { Store as S, useStore as A } from "@tanstack/vue-store";
18
- import { getDefaultState as y, TableApi as O } from "./table-api.js";
19
- class U {
17
+ import { Store as A, useStore as S } from "@tanstack/vue-store";
18
+ import { getDefaultState as y, TableApi as j } from "./table-api.js";
19
+ function g(s) {
20
+ if (!s) return;
21
+ const t = {};
22
+ return Object.keys(s).forEach((e) => {
23
+ e !== "data" && Object.assign(t, { [e]: s[e] });
24
+ }), t;
25
+ }
26
+ class V {
20
27
  /**
21
28
  * 构造函数,初始化 store、tableApi、状态等
22
29
  * @param options 表单+表格配置项
23
30
  */
24
31
  constructor(t = {}) {
25
32
  /** form 表单实例(FormApi) */
26
- s(this, "formApi", i({}));
33
+ r(this, "formApi", i({}));
27
34
  /** 表格 API 实例(TableApi) */
28
- s(this, "tableApi", i({}));
35
+ r(this, "tableApi", i({}));
29
36
  /** vxe-grid 表格实例 */
30
- s(this, "grid", i({}));
37
+ r(this, "grid", i({}));
31
38
  /** 当前表单+表格的 props 状态 */
32
- s(this, "state", null);
39
+ r(this, "state", null);
33
40
  /** 表单操作方法集合(TableFormActionType) */
34
- s(this, "tableForm", i({}));
41
+ r(this, "tableForm", i({}));
35
42
  /** 响应式 store,存储表单+表格的状态 */
36
- s(this, "store");
37
- s(this, "isMounted", !1);
38
- s(this, "stateHandler");
43
+ r(this, "store");
44
+ r(this, "isMounted", !1);
45
+ r(this, "stateHandler");
39
46
  /**
40
47
  * 当前选中的行 key 数组(响应式)
41
48
  */
42
- s(this, "selectedKeys", u(() => b(this.tableApi.selectedKeys) ?? []));
43
- const e = { ...t }, o = y();
44
- this.store = new S(
49
+ r(this, "selectedKeys", u(() => f(this.tableApi.selectedKeys) ?? []));
50
+ const e = { ...t }, o = g(t.table);
51
+ o && (e.table = o);
52
+ const p = y();
53
+ this.store = new A(
45
54
  a(e, {
46
55
  useSearchForm: !0,
47
- table: o,
48
- tableRowId: o.tableRowId || "id"
56
+ table: p,
57
+ tableRowId: p.tableRowId || "id"
49
58
  }),
50
59
  {
51
60
  onUpdate: () => {
52
61
  this.state = this.store.state;
53
62
  }
54
63
  }
55
- ), this.state = this.store.state, this.stateHandler = new f();
56
- const p = new O({
64
+ ), this.state = this.store.state, this.stateHandler = new O();
65
+ const n = new j({
57
66
  ...this.state.table,
58
67
  useSearchForm: this.state.useSearchForm || !1
59
- }), l = p;
60
- l.useStore = (m) => A(p.store, m), Object.setPrototypeOf(this.tableApi, l), c(this);
68
+ }), l = n;
69
+ l.useStore = (h) => S(n.store, h), Object.setPrototypeOf(this.tableApi, l), d(this);
61
70
  }
62
71
  /**
63
72
  * 组件挂载时调用,注入表单和表格实例
@@ -73,14 +82,14 @@ class U {
73
82
  * @param stateOrFn 新状态或返回新状态的函数
74
83
  */
75
84
  setState(t) {
76
- d(t) ? this.store.setState((e) => a(t(e), e)) : this.store.setState((e) => a(t, e));
85
+ c(t) ? this.store.setState((e) => a(t(e), e)) : this.store.setState((e) => a(t, e));
77
86
  }
78
87
  /**
79
88
  * 重新加载表格数据
80
89
  * @param data 可选的查询参数
81
90
  */
82
91
  async reload(t) {
83
- this.tableForm.reload(t);
92
+ await this.tableForm.reload(t);
84
93
  }
85
94
  /**
86
95
  * 获取表单实例
@@ -125,9 +134,10 @@ class U {
125
134
  * 组件卸载时调用,重置挂载状态
126
135
  */
127
136
  unmount() {
128
- this.isMounted = !1, this.stateHandler.reset();
137
+ var t;
138
+ this.isMounted = !1, (t = this.tableApi) == null || t.unmount(), Object.setPrototypeOf(this.grid, Object.prototype), Object.setPrototypeOf(this.formApi, Object.prototype), Object.setPrototypeOf(this.tableForm, Object.prototype), this.stateHandler.reset();
129
139
  }
130
140
  }
131
141
  export {
132
- U as TableFormApi
142
+ V as TableFormApi
133
143
  };
@@ -80,17 +80,6 @@ export type TtUiGlobalConfig = {
80
80
  * @default-id
81
81
  */
82
82
  tableRowId?: string;
83
- /**
84
- * 请求的状态码
85
- * @default-200
86
- * @deprecated
87
- */
88
- resultCode?: string | number;
89
- /**
90
- * loading text
91
- * @default-loading text
92
- */
93
- loadingText?: string;
94
83
  /**
95
84
  * empty text
96
85
  * @default-暂无数据
@@ -130,11 +119,6 @@ export type TtUiGlobalConfig = {
130
119
  * 表格边框
131
120
  */
132
121
  border?: "full" | "inner" | "outer" | "none" | boolean;
133
- /**
134
- * 是否开启缓存
135
- * @default-false 不开启
136
- */
137
- useCache?: boolean;
138
122
  /**
139
123
  * 是否显示右边刷新按钮
140
124
  * @default-true 显示
@@ -155,12 +139,8 @@ export type TtUiGlobalConfig = {
155
139
  * @default-true 显示
156
140
  */
157
141
  showSetColumn?: boolean;
158
- /** 是否显示自定义行距 */
159
- showLineHeight?: boolean;
160
142
  /** 自定义函数 */
161
143
  customizeColumn?: TtTableProps["customizeColumn"];
162
- /** 外部插槽 */
163
- getSyncSlotComponent?: TtTableProps["getSyncSlotComponent"];
164
144
  /**
165
145
  * 表格斑马线
166
146
  * @default- false
@@ -15,8 +15,6 @@ const i = {
15
15
  totalField: "total",
16
16
  dataField: "list",
17
17
  tableRowId: "id",
18
- resultCode: 200,
19
- loadingText: "加载中...",
20
18
  emptyText: "暂无数据",
21
19
  noSearchText: "请先点击查询",
22
20
  keyboardConfig: {
@@ -33,7 +31,6 @@ const i = {
33
31
  showSetting: !0,
34
32
  showRefresh: !0,
35
33
  showExport: !1,
36
- useCache: !1,
37
34
  defaultDisplayFields: [],
38
35
  isReloadResetToFirstPage: !0,
39
36
  stripe: !0,
@@ -1,17 +1,17 @@
1
1
  import "axios";
2
2
  import "element-plus";
3
3
  import "dayjs";
4
- import "vue";
5
- import { debounce as m } from "../../utils/src/tool.js";
4
+ import { getCurrentScope as p, onScopeDispose as i } from "vue";
5
+ import { debounce as n } from "../../utils/src/tool.js";
6
6
  import "../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
7
7
  import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
8
8
  import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
9
9
  import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
10
10
  import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
11
11
  import "lodash-es";
12
- function h(r, t, i) {
13
- const o = m(r, t, i);
14
- return {
12
+ function S(r, e, t) {
13
+ const o = n(r, e ?? 200, t);
14
+ return p() && i(o.cancel), {
15
15
  /**
16
16
  * 防抖函数,保持原函数的返回类型
17
17
  * 如果原函数是异步的,返回 Promise;如果是同步的,返回原始类型
@@ -28,5 +28,5 @@ function h(r, t, i) {
28
28
  };
29
29
  }
30
30
  export {
31
- h as useDebounceFn
31
+ S as useDebounceFn
32
32
  };
@@ -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
  };