@dazhicheng/ui 1.6.5 → 1.6.7

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 (25) 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-icon/index.vue.js +2 -2
  4. package/dist/components/tt-loading/src/loading.vue.js +2 -2
  5. package/dist/components/tt-modal/index.d.ts +32 -8
  6. package/dist/components/tt-modal/src/RenderModal.vue.d.ts +32 -8
  7. package/dist/components/tt-modal/src/RenderModal.vue.js +254 -193
  8. package/dist/components/tt-modal/src/components/ModalWrapper.vue.d.ts +14 -2
  9. package/dist/components/tt-modal/src/components/ModalWrapper.vue.js +61 -30
  10. package/dist/components/tt-modal/src/hooks/useModalRender.js +72 -71
  11. package/dist/components/tt-modal/src/utils/resolve-modal-target.d.ts +19 -0
  12. package/dist/components/tt-modal/src/utils/resolve-modal-target.js +151 -0
  13. package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue.js +199 -167
  14. package/dist/components/tt-nav-anchor/src/types.d.ts +13 -4
  15. package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.d.ts +2 -2
  16. package/dist/components/tt-table/src/TableForm.vue.d.ts +0 -9
  17. package/dist/components/tt-table/src/TableForm.vue.js +37 -38
  18. package/dist/components/tt-table/src/hooks/useTableForm.js +22 -23
  19. package/dist/components/tt-table/src/props.d.ts +0 -5
  20. package/dist/components/tt-table/src/props.js +22 -31
  21. package/dist/components/tt-table/src/types/tableForm.d.ts +0 -2
  22. package/dist/components/tt-table/src/utils/table-form-api.js +14 -15
  23. package/dist/directives/dialog-resize/use-draggable.js +47 -25
  24. package/dist/style.css +1 -1
  25. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
- import { defineComponent as Ee, useSlots as Ie, getCurrentInstance as _e, ref as De, shallowReactive as Ke, onScopeDispose as X, computed as u, unref as r, shallowRef as Ve, toRaw as P, watch as h, toValue as S, onMounted as ke, nextTick as Y, createElementBlock as Z, openBlock as ee, normalizeClass as D, createCommentVNode as Be, createElementVNode as Le, createVNode as A, renderSlot as n, createSlots as K, renderList as te, withCtx as b, normalizeProps as oe, guardReactiveProps as re, mergeProps as se, toHandlers as ze, isRef as je } from "vue";
1
+ import { defineComponent as Re, useSlots as _e, getCurrentInstance as Ie, ref as De, shallowReactive as Ke, onScopeDispose as X, computed as u, unref as r, shallowRef as Ve, toRaw as P, watch as h, toValue as S, onMounted as ke, nextTick as Y, createElementBlock as Z, openBlock as ee, normalizeClass as D, createCommentVNode as Be, createElementVNode as Le, createVNode as A, renderSlot as n, createSlots as K, renderList as te, withCtx as b, normalizeProps as oe, guardReactiveProps as re, mergeProps as se, toHandlers as xe, isRef as ze } from "vue";
2
2
  import "../../tt-button/index.js";
3
3
  import "../../tt-checkbox/index.js";
4
4
  import "../../tt-empty/index.js";
5
5
  import "axios";
6
6
  import "element-plus";
7
- import { isFunction as xe } from "../../../packages/utils/src/is.js";
7
+ import { isFunction as je } from "../../../packages/utils/src/is.js";
8
8
  import "dayjs";
9
9
  import "numeral";
10
10
  import { extractResourceFromApi as Ne, generateTestId as M } from "../../../packages/utils/src/testid-helper.js";
@@ -76,7 +76,7 @@ import rt from "./Table.vue.js";
76
76
  import { forwardedEventEntries as st } from "./table-mutation-events.js";
77
77
  import { TableFormApi as at } from "./utils/table-form-api.js";
78
78
  import { provideFormActionTestIds as it } from "./utils/context.js";
79
- const nt = ["data-testid"], lt = ["data-testid"], Do = /* @__PURE__ */ Ee({
79
+ const nt = ["data-testid"], lt = ["data-testid"], Do = /* @__PURE__ */ Re({
80
80
  name: "TtTableForm",
81
81
  __name: "TableForm",
82
82
  props: ot,
@@ -91,12 +91,12 @@ const nt = ["data-testid"], lt = ["data-testid"], Do = /* @__PURE__ */ Ee({
91
91
  ],
92
92
  setup(ie, { expose: ne, emit: le }) {
93
93
  var J, q, G;
94
- const i = ie, y = le, R = Ie(), g = _e(), { prefixCls: $ } = qe("table-form");
94
+ const i = ie, y = le, $ = _e(), g = Ie(), { prefixCls: E } = qe("table-form");
95
95
  function V() {
96
96
  var e;
97
97
  return Object.hasOwn(((e = g == null ? void 0 : g.vnode) == null ? void 0 : e.props) || {}, "table");
98
98
  }
99
- const E = De();
99
+ const R = De();
100
100
  let t = i.tableFormApi;
101
101
  t || (t = new at(i), t.useStore = (e) => Je(t.store, e));
102
102
  const k = Ke({});
@@ -116,21 +116,21 @@ const nt = ["data-testid"], lt = ["data-testid"], Do = /* @__PURE__ */ Ee({
116
116
  reset: M(r(w), "search-btn-reset")
117
117
  }))
118
118
  );
119
- const { getSlotKeys: ue, replaceSlotKey: ce } = ae("form-"), { getSlotKeys: de, replaceSlotKey: fe } = ae("t-"), { getFormProps: I, getTableProps: m, getTableToolProps: be, submitSearchQuery: L } = et(
119
+ const { getSlotKeys: ue, replaceSlotKey: ce } = ae("form-"), { getSlotKeys: de, replaceSlotKey: fe } = ae("t-"), { getFormProps: _, getTableProps: m, getTableToolProps: be, submitSearchQuery: L } = et(
120
120
  c,
121
121
  t.tableApi.reload,
122
122
  t.tableApi.getLoading,
123
123
  t.tableApi.getPagination
124
- ), z = Ve([]), ge = u(() => (i.table, !V() || !i.table ? !1 : (i.table.data, Object.hasOwn(P(i.table), "data"))));
125
- let _ = () => {
124
+ ), x = Ve([]), ge = u(() => (i.table, !V() || !i.table ? !1 : (i.table.data, Object.hasOwn(P(i.table), "data"))));
125
+ let I = () => {
126
126
  };
127
127
  function he(e) {
128
- _(), _ = h(
128
+ I(), I = h(
129
129
  () => S(e),
130
130
  (o) => {
131
- z.value = o || [];
131
+ x.value = o || [];
132
132
  },
133
- { immediate: !0, deep: je(e) ? !1 : 1 }
133
+ { immediate: !0, deep: ze(e) ? !1 : 1 }
134
134
  );
135
135
  }
136
136
  function Se() {
@@ -154,7 +154,7 @@ const nt = ["data-testid"], lt = ["data-testid"], Do = /* @__PURE__ */ Ee({
154
154
  200,
155
155
  { leading: !0 }
156
156
  ), [ye, s] = We({
157
- ...S(I),
157
+ ...S(_),
158
158
  handleSubmit: Te,
159
159
  handleReset: we,
160
160
  submitOnEnter: !0,
@@ -165,7 +165,7 @@ const nt = ["data-testid"], lt = ["data-testid"], Do = /* @__PURE__ */ Ee({
165
165
  collapsed: !0,
166
166
  collapseTriggerResize: !0,
167
167
  collapsedRows: 3
168
- }), { restoreColumns: ve, saveColumns: j } = Ye({
168
+ }), { restoreColumns: ve, saveColumns: z } = Ye({
169
169
  getTableProps: m,
170
170
  getProps: c,
171
171
  tableMethods: t.tableApi
@@ -178,7 +178,7 @@ const nt = ["data-testid"], lt = ["data-testid"], Do = /* @__PURE__ */ Ee({
178
178
  const { run: Fe } = O(async () => {
179
179
  if (d || !r(m).useHttpCache) return;
180
180
  const e = (t.tableApi.getTableColumns() || []).map((o) => o.field).filter(Boolean);
181
- e.length && await j(JSON.stringify(e));
181
+ e.length && await z(JSON.stringify(e));
182
182
  }, 300);
183
183
  function Ce(e) {
184
184
  var o;
@@ -211,13 +211,13 @@ const nt = ["data-testid"], lt = ["data-testid"], Do = /* @__PURE__ */ Ee({
211
211
  };
212
212
  async function Oe() {
213
213
  const { tableRefreshBefore: e } = r(c);
214
- xe(e) && await e(), v.reload();
214
+ je(e) && await e(), v.reload();
215
215
  }
216
- async function x() {
216
+ async function j() {
217
217
  var e;
218
218
  await Y(), !d && ((e = t.tableApi) == null || e.redoHeight());
219
219
  }
220
- async function Re(e) {
220
+ async function $e(e) {
221
221
  var F, C;
222
222
  if (d) return;
223
223
  const o = S((C = (F = r(c)) == null ? void 0 : F.table) == null ? void 0 : C.columns) || [], a = new Map(o.map((f) => [f.field, f])), l = e.checkedModel.map((f) => a.get(f)).filter(Boolean);
@@ -227,7 +227,7 @@ const nt = ["data-testid"], lt = ["data-testid"], Do = /* @__PURE__ */ Ee({
227
227
  }
228
228
  e.modalApi.setModalProps({ confirmLoading: !0 });
229
229
  try {
230
- if (r(m).useHttpCache && await j(JSON.stringify(e.checkedModel)), d) return;
230
+ if (r(m).useHttpCache && await z(JSON.stringify(e.checkedModel)), d) return;
231
231
  t.tableApi.setTableColumns(l), e.modalApi.closeModal(), y("set-columns", l);
232
232
  } finally {
233
233
  d || e.modalApi.setModalProps({ confirmLoading: !1 });
@@ -236,12 +236,12 @@ const nt = ["data-testid"], lt = ["data-testid"], Do = /* @__PURE__ */ Ee({
236
236
  function N(e, o = !1) {
237
237
  var f, Q, U;
238
238
  const { notSetColumnField: a, columns: l } = r(m), F = ((((f = t.tableApi.getTableInstance()) == null ? void 0 : f.getTableColumn()) || {}).visibleColumn || []).map((p) => p.field).filter(Boolean), C = (S(l) || []).filter((p) => p.visible === !0 || p.visible === void 0).map((p) => p.field);
239
- (Q = E.value) == null || Q.openModal({
239
+ (Q = R.value) == null || Q.openModal({
240
240
  columns: (S(l) || []).filter((p) => p.visible !== !1),
241
241
  displayFields: o ? C : F,
242
242
  disabledColumnField: a || [],
243
243
  isExport: e
244
- }), (U = E.value) == null || U.setModalProps({ title: e ? "自定义导出" : "列设置" });
244
+ }), (U = R.value) == null || U.setModalProps({ title: e ? "自定义导出" : "列设置" });
245
245
  }
246
246
  function H(e = !1) {
247
247
  N(!1, e);
@@ -249,7 +249,7 @@ const nt = ["data-testid"], lt = ["data-testid"], Do = /* @__PURE__ */ Ee({
249
249
  function W(e = !1) {
250
250
  N(!0, e);
251
251
  }
252
- function $e() {
252
+ function Ee() {
253
253
  const e = i.table;
254
254
  if (!V() || !e) return;
255
255
  const o = {};
@@ -258,7 +258,7 @@ const nt = ["data-testid"], lt = ["data-testid"], Do = /* @__PURE__ */ Ee({
258
258
  }), o;
259
259
  }
260
260
  return tt(i, t.setState, ["tableFormApi", "table"]), h(
261
- $e,
261
+ Ee,
262
262
  (e) => {
263
263
  e && t.setState({ table: e });
264
264
  },
@@ -269,28 +269,28 @@ const nt = ["data-testid"], lt = ["data-testid"], Do = /* @__PURE__ */ Ee({
269
269
  s == null || s.setState({ submitButtonOptions: { loading: e } });
270
270
  },
271
271
  { immediate: (G = (q = t.store.state) == null ? void 0 : q.table) == null ? void 0 : G.immediate }
272
- ), h(I, (e) => s == null ? void 0 : s.setState(e)), h(m, (e) => {
272
+ ), h(_, (e) => s == null ? void 0 : s.setState(e)), h(m, (e) => {
273
273
  var o;
274
274
  return (o = t.tableApi) == null ? void 0 : o.setState(e);
275
275
  }), ke(() => {
276
- g && y("register", v, g.uid), t.mount(v, s), s == null || s.setState(r(I)), Y(() => {
276
+ g && y("register", v, g.uid), t.mount(v, s), s == null || s.setState(r(_)), Y(() => {
277
277
  d || ve();
278
- }), window.addEventListener("resize", x);
278
+ }), window.addEventListener("resize", j);
279
279
  }), X(() => {
280
- d = !0, _(), t == null || t.unmount(), window.removeEventListener("resize", x);
280
+ d = !0, I(), t == null || t.unmount(), window.removeEventListener("resize", j);
281
281
  }), ne({ ...v, instance: g }), (e, o) => (ee(), Z("div", {
282
- class: D(r($)),
282
+ class: D(r(E)),
283
283
  "data-testid": me.value
284
284
  }, [
285
285
  c.value.useSearchForm ? (ee(), Z("div", {
286
286
  key: 0,
287
- class: D(`${r($)}-header`),
287
+ class: D(`${r(E)}-header`),
288
288
  "data-testid": pe.value
289
289
  }, [
290
290
  A(r(ye), {
291
291
  "test-id": `${w.value}-search-form`
292
292
  }, K({ _: 2 }, [
293
- te(r(ue)(r(R)), (a) => ({
293
+ te(r(ue)(r($)), (a) => ({
294
294
  name: r(ce)(a),
295
295
  fn: b((l) => [
296
296
  n(e.$slots, a, oe(re(l || {})))
@@ -301,7 +301,7 @@ const nt = ["data-testid"], lt = ["data-testid"], Do = /* @__PURE__ */ Ee({
301
301
  ], 10, lt)) : Be("", !0),
302
302
  Le("div", {
303
303
  class: D({
304
- [`${r($)}-wrapper`]: !0,
304
+ [`${r(E)}-wrapper`]: !0,
305
305
  "pt-(--tt-base-padding)!": !0,
306
306
  "pb-(--tt-base-padding)!": !r(m).showPager
307
307
  })
@@ -309,13 +309,12 @@ const nt = ["data-testid"], lt = ["data-testid"], Do = /* @__PURE__ */ Ee({
309
309
  n(e.$slots, "table-top"),
310
310
  A(rt, se({
311
311
  ...r(m),
312
- ...ge.value ? { data: z.value } : {}
312
+ ...ge.value ? { data: x.value } : {}
313
313
  }, {
314
- "table-row-id": e.tableRowId,
315
314
  "form-api": r(s),
316
315
  "table-api": r(t).tableApi
317
- }, ze(Pe.value)), K({ _: 2 }, [
318
- te(r(de)(r(R)), (a) => ({
316
+ }, xe(Pe.value)), K({ _: 2 }, [
317
+ te(r(de)(r($)), (a) => ({
319
318
  name: r(fe)(a),
320
319
  fn: b((l) => [
321
320
  n(e.$slots, a, oe(re(l || {})))
@@ -341,22 +340,22 @@ const nt = ["data-testid"], lt = ["data-testid"], Do = /* @__PURE__ */ Ee({
341
340
  ]),
342
341
  key: "0"
343
342
  } : void 0
344
- ]), 1040, ["table-row-id", "form-api", "table-api"]),
343
+ ]), 1040, ["form-api", "table-api"]),
345
344
  n(e.$slots, "table-bottom")
346
345
  ], 2),
347
346
  A(Qe, {
348
347
  ref_key: "columnModalRef",
349
- ref: E,
348
+ ref: R,
350
349
  "open-export": W,
351
350
  "open-column": H,
352
- onOnSubmit: Re
351
+ onOnSubmit: $e
353
352
  }, K({
354
353
  beforeFooter: b(() => [
355
354
  n(e.$slots, "t-column-modal-before-footer")
356
355
  ]),
357
356
  _: 2
358
357
  }, [
359
- r(R)["t-column-modal-title"] ? {
358
+ r($)["t-column-modal-title"] ? {
360
359
  name: "title",
361
360
  fn: b(() => [
362
361
  n(e.$slots, "t-column-modal-title")
@@ -1,7 +1,7 @@
1
1
  import "axios";
2
2
  import "element-plus";
3
3
  import { isFunction as m } from "../../../../packages/utils/src/is.js";
4
- import { computed as c, unref as i, toValue as u } from "vue";
4
+ import { computed as s, unref as i, toValue as a } from "vue";
5
5
  import "dayjs";
6
6
  import "numeral";
7
7
  import "xe-utils";
@@ -12,12 +12,12 @@ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/ae
12
12
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
13
13
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
14
14
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
15
- import { omit as p } from "lodash-es";
16
- function j(n, h, l, d) {
17
- const f = c(() => {
15
+ import { omit as u } from "lodash-es";
16
+ function k(n, p, h, l) {
17
+ const f = s(() => {
18
18
  const { form: t } = i(n), o = {
19
19
  ...t == null ? void 0 : t.submitButtonOptions,
20
- loading: i(l)
20
+ loading: i(h)
21
21
  };
22
22
  return {
23
23
  ...t,
@@ -25,44 +25,43 @@ function j(n, h, l, d) {
25
25
  };
26
26
  });
27
27
  async function b(t) {
28
- const o = d(), r = { currentPage: 1, pageSize: o == null ? void 0 : o.pageSize };
29
- await h({ tablePage: r, searchInfo: t });
28
+ const o = l(), r = { currentPage: 1, pageSize: o == null ? void 0 : o.pageSize };
29
+ await p({ tablePage: r, searchInfo: t });
30
30
  }
31
- async function w(t) {
32
- const { handleSearchInfoFn: o, table: r } = u(n);
31
+ async function d(t) {
32
+ const { handleSearchInfoFn: o, table: r } = a(n);
33
33
  let e = t;
34
34
  return m(o) && (e = await o(e) || e), m(r == null ? void 0 : r.beforeFetch) && (e = await r.beforeFetch(e) || e), e;
35
35
  }
36
- const a = c(() => {
37
- const { columnsKey: t, showSetting: o, showSetColumn: r, showRefresh: e, showExport: s } = i(n).table || {}, { toolConfig: F } = i(n);
36
+ const c = s(() => {
37
+ const { columnsKey: t, showSetting: o, showSetColumn: r, showRefresh: e, showExport: F } = i(n).table || {}, { toolConfig: w } = i(n);
38
38
  return {
39
39
  columnsKey: t,
40
40
  showSetting: o,
41
41
  showRefresh: e,
42
42
  showSetColumn: r,
43
- showExport: s,
44
- ...F
43
+ showExport: F,
44
+ ...w
45
45
  };
46
- }), g = c(() => {
47
- const { table: t = {}, tableRowId: o, useSearchForm: r, testId: e } = u(n), s = p(i(a), ["tableRowId"]);
46
+ }), g = s(() => {
47
+ const { table: t = {}, useSearchForm: o, testId: r } = a(n), e = u(i(c), ["tableRowId"]);
48
48
  return {
49
- useSearchForm: r || !1,
49
+ useSearchForm: o || !1,
50
50
  // 数据由 TableForm 单独绑定,不进入表格配置。
51
- ...p(t, ["data"]),
52
- ...s,
53
- tableRowId: (t == null ? void 0 : t.tableRowId) || o,
51
+ ...u(t, ["data"]),
52
+ ...e,
54
53
  // 继承外层的 testId,如果 table.testId 未设置则使用外层的 testId
55
- testId: (t == null ? void 0 : t.testId) || e,
56
- beforeFetch: w
54
+ testId: (t == null ? void 0 : t.testId) || r,
55
+ beforeFetch: d
57
56
  };
58
57
  });
59
58
  return {
60
59
  getFormProps: f,
61
60
  submitSearchQuery: b,
62
61
  getTableProps: g,
63
- getTableToolProps: a
62
+ getTableToolProps: c
64
63
  };
65
64
  }
66
65
  export {
67
- j as useTableForm
66
+ k as useTableForm
68
67
  };
@@ -509,11 +509,6 @@ export declare const tableFormProps: {
509
509
  type: PropType<TtTableToolsProps>;
510
510
  default: null;
511
511
  };
512
- /** 表格行id */
513
- tableRowId: {
514
- type: StringConstructor;
515
- default: () => string | undefined;
516
- };
517
512
  /** 表格 testId,用于生成测试标识 */
518
513
  testId: {
519
514
  type: StringConstructor;
@@ -1,4 +1,4 @@
1
- import { propTypes as o } from "../../../packages/hooks/src/propTypes.js";
1
+ import { propTypes as t } from "../../../packages/hooks/src/propTypes.js";
2
2
  import "axios";
3
3
  import "element-plus";
4
4
  import "dayjs";
@@ -14,12 +14,11 @@ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-
14
14
  import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
15
15
  import "lodash-es";
16
16
  import "vue-router";
17
- import { GlobalConfig as a } from "../../../hooks/useSetup.js";
18
- import { createSharedTableDefaults as l } from "./table-defaults.js";
19
- function e(t) {
20
- return l()[t];
17
+ import { createSharedTableDefaults as o } from "./table-defaults.js";
18
+ function e(l) {
19
+ return o()[l];
21
20
  }
22
- const r = {
21
+ const a = {
23
22
  /** 是否显示分页 */
24
23
  showPager: { type: Boolean, default: () => e("showPager") },
25
24
  /** 当前页数 field */
@@ -30,7 +29,7 @@ const r = {
30
29
  totalField: { type: String, default: () => e("totalField") },
31
30
  /** 数据的 field */
32
31
  dataField: { type: String, default: () => e("dataField") }
33
- }, p = {
32
+ }, r = {
34
33
  /** 是否显示复选框 */
35
34
  showCheckbox: { type: Boolean, default: () => e("showCheckbox") },
36
35
  /** 是否跨页保持复选框选中状态 */
@@ -83,7 +82,7 @@ const r = {
83
82
  type: Function
84
83
  // default: () => GlobalConfig.table?.customizeColumn,
85
84
  }
86
- }, n = {
85
+ }, p = {
87
86
  /** api请求方法 */
88
87
  api: {
89
88
  type: Function,
@@ -116,7 +115,7 @@ const r = {
116
115
  },
117
116
  /** 是否滚动加载数据 */
118
117
  isScrollFetch: { type: Boolean, default: () => e("isScrollFetch") }
119
- }, i = {
118
+ }, n = {
120
119
  /** 是否显示toolbar */
121
120
  showToolbar: { type: Boolean, default: () => e("showToolbar") },
122
121
  /** 具体某些列排序 field数组 */
@@ -142,14 +141,14 @@ const r = {
142
141
  },
143
142
  /** 是否显示表格上方 alert */
144
143
  showTableAlert: { type: Boolean, default: () => e("showTableAlert") }
145
- }, j = {
144
+ }, x = {
146
145
  /**
147
146
  * 是否自适应高度
148
147
  *
149
148
  * 组件方式默认 `true`,与 `table-api.ts` 的 `getDefaultState()` 里 hook 方式默认 `false` 有意不同,
150
149
  * 不要统一:改任一边都会改变现有页面的表格高度。因此它不进 `createSharedTableDefaults()`。
151
150
  */
152
- autoHeight: o.bool.def(!0),
151
+ autoHeight: t.bool.def(!0),
153
152
  /** 左侧插槽的宽度 */
154
153
  leftSlotWidth: { type: Number, default: () => e("leftSlotWidth") },
155
154
  /** 右侧插槽的宽度 */
@@ -200,17 +199,17 @@ const r = {
200
199
  type: Object
201
200
  },
202
201
  /** 是否使用搜索form */
203
- useSearchForm: o.bool.def(!1),
202
+ useSearchForm: t.bool.def(!1),
204
203
  /** 表格 testId,用于生成测试标识 */
205
204
  testId: {
206
205
  type: String,
207
206
  default: void 0
208
207
  },
208
+ ...a,
209
209
  ...r,
210
210
  ...p,
211
- ...n,
212
- ...i
213
- }, d = {
211
+ ...n
212
+ }, i = {
214
213
  /** 按键配置项 */
215
214
  keyboardConfig: {
216
215
  type: Object,
@@ -231,7 +230,7 @@ const r = {
231
230
  type: Object,
232
231
  default: () => e("radioConfig")
233
232
  }
234
- }, I = {
233
+ }, T = {
235
234
  /**
236
235
  * table参数
237
236
  *
@@ -243,10 +242,10 @@ const r = {
243
242
  */
244
243
  table: {
245
244
  type: Object,
246
- default: () => ({ ...l(), autoHeight: !0, columnsKey: "", useSearchForm: !1 })
245
+ default: () => ({ ...o(), autoHeight: !0, columnsKey: "", useSearchForm: !1 })
247
246
  },
248
247
  /** 是否使用搜索form */
249
- useSearchForm: o.bool.def(!0),
248
+ useSearchForm: t.bool.def(!0),
250
249
  /** BasicFormProps 的配置 */
251
250
  form: {
252
251
  type: Object,
@@ -267,14 +266,6 @@ const r = {
267
266
  type: Object,
268
267
  default: null
269
268
  },
270
- /** 表格行id */
271
- tableRowId: {
272
- type: String,
273
- default: () => {
274
- var t;
275
- return (t = a.table) == null ? void 0 : t.tableRowId;
276
- }
277
- },
278
269
  /** 表格 testId,用于生成测试标识 */
279
270
  testId: {
280
271
  type: String,
@@ -284,7 +275,7 @@ const r = {
284
275
  tableFormApi: {
285
276
  type: Object
286
277
  }
287
- }, A = {
278
+ }, j = {
288
279
  /** 列配置 */
289
280
  columns: {
290
281
  type: Array,
@@ -341,10 +332,10 @@ const r = {
341
332
  type: String,
342
333
  default: "right"
343
334
  },
344
- ...d
335
+ ...i
345
336
  };
346
337
  export {
347
- I as tableFormProps,
348
- A as tableOtherProps,
349
- j as tableProps
338
+ T as tableFormProps,
339
+ j as tableOtherProps,
340
+ x as tableProps
350
341
  };
@@ -23,8 +23,6 @@ export type TtTableFormProps<Row = any> = {
23
23
  toolConfig?: TtTableToolsProps;
24
24
  /** 刷新前的调用方法 */
25
25
  tableRefreshBefore?: (...arg: any[]) => Promise<any>;
26
- /** 表格行id */
27
- tableRowId?: string;
28
26
  /**
29
27
  * 表格 testId,用于生成测试标识
30
28
  * 如果不指定,将从 table.api 路径自动提取
@@ -1,10 +1,10 @@
1
- var h = Object.defineProperty;
2
- var b = (r, t, e) => t in r ? h(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
- var s = (r, t, e) => b(r, typeof t != "symbol" ? t + "" : t, e);
1
+ var l = Object.defineProperty;
2
+ var c = (r, t, e) => t in r ? l(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var s = (r, t, e) => c(r, typeof t != "symbol" ? t + "" : t, e);
4
4
  import "axios";
5
5
  import "element-plus";
6
- import { isFunction as c } from "../../../../packages/utils/src/is.js";
7
- import { reactive as i, computed as u, toValue as f } from "vue";
6
+ import { isFunction as u } from "../../../../packages/utils/src/is.js";
7
+ import { reactive as i, computed as b, toValue as f } from "vue";
8
8
  import "dayjs";
9
9
  import "numeral";
10
10
  import { bindMethods as d } from "../../../../packages/utils/src/tool.js";
@@ -25,7 +25,7 @@ function g(r) {
25
25
  e !== "data" && Object.assign(t, { [e]: r[e] });
26
26
  }), t;
27
27
  }
28
- class q {
28
+ class z {
29
29
  /**
30
30
  * 构造函数,初始化 store、tableApi、状态等
31
31
  * @param options 表单+表格配置项
@@ -48,15 +48,14 @@ class q {
48
48
  /**
49
49
  * 当前选中的行 key 数组(响应式)
50
50
  */
51
- s(this, "selectedKeys", u(() => f(this.tableApi.selectedKeys) ?? []));
51
+ s(this, "selectedKeys", b(() => f(this.tableApi.selectedKeys) ?? []));
52
52
  const e = { ...t }, o = g(t.table);
53
53
  o && (e.table = o);
54
- const p = y();
54
+ const m = y();
55
55
  this.store = new A(
56
56
  a(e, {
57
57
  useSearchForm: !0,
58
- table: p,
59
- tableRowId: p.tableRowId || "id"
58
+ table: m
60
59
  }),
61
60
  {
62
61
  onUpdate: () => {
@@ -64,11 +63,11 @@ class q {
64
63
  }
65
64
  }
66
65
  ), this.state = this.store.state, this.stateHandler = new O();
67
- const n = new j({
66
+ const p = new j({
68
67
  ...this.state.table,
69
68
  useSearchForm: this.state.useSearchForm || !1
70
- }), m = n;
71
- m.useStore = (l) => S(n.store, l), Object.setPrototypeOf(this.tableApi, m), d(this);
69
+ }), n = p;
70
+ n.useStore = (h) => S(p.store, h), Object.setPrototypeOf(this.tableApi, n), d(this);
72
71
  }
73
72
  /**
74
73
  * 组件挂载时调用,注入表单和表格实例
@@ -84,7 +83,7 @@ class q {
84
83
  * @param stateOrFn 新状态或返回新状态的函数
85
84
  */
86
85
  setState(t) {
87
- c(t) ? this.store.setState((e) => a(t(e), e)) : this.store.setState((e) => a(t, e));
86
+ u(t) ? this.store.setState((e) => a(t(e), e)) : this.store.setState((e) => a(t, e));
88
87
  }
89
88
  /**
90
89
  * 重新加载表格数据
@@ -141,5 +140,5 @@ class q {
141
140
  }
142
141
  }
143
142
  export {
144
- q as TableFormApi
143
+ z as TableFormApi
145
144
  };
@@ -1,35 +1,57 @@
1
- import { isString as S, isNumber as U } from "lodash-es";
2
- import { unref as x, watchEffect as j } from "vue";
3
- import k from "./use-parse-translate.js";
4
- function M(e, o = "px") {
1
+ import { isString as U, isNumber as j } from "lodash-es";
2
+ import { unref as X, watchEffect as k } from "vue";
3
+ import z from "./use-parse-translate.js";
4
+ function Y(e, n = "px") {
5
5
  if (!e) return "";
6
- if (S(e))
7
- return e;
8
6
  if (U(e))
9
- return `${e}${o}`;
7
+ return e;
8
+ if (j(e))
9
+ return `${e}${n}`;
10
+ }
11
+ function G(e) {
12
+ const n = e.closest(".el-overlay-dialog"), c = e.closest(".el-overlay"), s = n || c;
13
+ if (s)
14
+ return s.getBoundingClientRect();
15
+ const { clientWidth: o, clientHeight: t } = document.documentElement;
16
+ return {
17
+ left: 0,
18
+ top: 0,
19
+ right: o,
20
+ bottom: t,
21
+ width: o,
22
+ height: t,
23
+ x: 0,
24
+ y: 0,
25
+ toJSON() {
26
+ return {};
27
+ }
28
+ };
10
29
  }
11
- function J(e, o, N, R, s) {
12
- const t = x(e), n = x(o), c = (l) => {
13
- var p, v, h, L, E, b;
14
- const Y = l.clientX, $ = l.clientY, { x: a, y: i } = k(t.style.transform), T = ((v = (p = s.value) == null ? void 0 : p.draggableLimit) == null ? void 0 : v[1]) || 50, y = ((L = (h = s.value) == null ? void 0 : h.draggableLimit) == null ? void 0 : L[2]) || 50, D = ((b = (E = s.value) == null ? void 0 : E.draggableLimit) == null ? void 0 : b[3]) || 50, m = t.getBoundingClientRect(), u = m.left, d = m.top, W = m.width, B = document.documentElement.clientWidth, H = document.documentElement.clientHeight, _ = -u - W + D + a, q = -d + i, A = B - u - T + a, C = H - d - y + i, f = (w) => {
30
+ function V(e, n, c, s, o) {
31
+ const t = X(e), a = X(n), f = (h) => {
32
+ var w, x, y, E, M, R, N, D;
33
+ const B = h.clientX, C = h.clientY, { x: m, y: l } = z(t.style.transform), H = ((x = (w = o.value) == null ? void 0 : w.draggableLimit) == null ? void 0 : x[0]) ?? 50, S = ((E = (y = o.value) == null ? void 0 : y.draggableLimit) == null ? void 0 : E[1]) ?? 50, W = ((R = (M = o.value) == null ? void 0 : M.draggableLimit) == null ? void 0 : R[2]) ?? 50, _ = ((D = (N = o.value) == null ? void 0 : N.draggableLimit) == null ? void 0 : D[3]) ?? 50, i = t.getBoundingClientRect(), v = i.left, p = i.top, q = i.width, A = i.height, r = G(t), F = r.left - v - q + _ + m, J = r.right - v - S + m, u = r.top - p + H + l;
34
+ let g = r.bottom - p - A - W + l;
35
+ g < u && (g = u);
36
+ const L = (T) => {
15
37
  requestAnimationFrame(() => {
16
- const F = Math.min(Math.max(a + w.clientX - Y, _), A), P = Math.min(Math.max(i + w.clientY - $, q), C);
17
- t.style.transform = `translate(${M(F)}, ${M(P)})`;
38
+ const O = Math.min(Math.max(m + T.clientX - B, F), J), P = Math.min(Math.max(l + T.clientY - C, u), g);
39
+ t.style.transform = `translate(${Y(O)}, ${Y(P)})`;
18
40
  });
19
- }, g = () => {
20
- document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", g);
41
+ }, b = () => {
42
+ document.removeEventListener("mousemove", L), document.removeEventListener("mouseup", b);
21
43
  };
22
- document.addEventListener("mousemove", f), document.addEventListener("mouseup", g);
23
- }, X = () => {
24
- n && t && (t.className = `${t.className} is-draggable`, n.addEventListener("mousedown", c));
25
- }, r = () => {
26
- n && t && (t.className = t.className.replace("is-draggable", ""), n.removeEventListener("mousedown", c));
44
+ document.addEventListener("mousemove", L), document.addEventListener("mouseup", b);
45
+ }, $ = () => {
46
+ a && t && (t.className = `${t.className} is-draggable`, a.addEventListener("mousedown", f));
47
+ }, d = () => {
48
+ a && t && (t.className = t.className.replace("is-draggable", ""), a.removeEventListener("mousedown", f));
27
49
  };
28
- j(() => {
29
- N.value ? X() : r();
30
- }), R.push(r);
50
+ k(() => {
51
+ c.value ? $() : d();
52
+ }), s.push(d);
31
53
  }
32
54
  export {
33
- M as addUnit,
34
- J as default
55
+ Y as addUnit,
56
+ V as default
35
57
  };