@aplus-frontend/ui 6.32.0 → 6.34.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 (78) hide show
  1. package/es/index.mjs +39 -37
  2. package/es/src/ag-grid/components/tooltip/index.vue.d.ts +6 -0
  3. package/es/src/ag-grid/components/tooltip/index.vue.mjs +4 -0
  4. package/es/src/ag-grid/components/tooltip/index.vue2.mjs +29 -0
  5. package/es/src/ag-grid/editable/form-item.vue.d.ts +16 -0
  6. package/es/src/ag-grid/editable/form-item.vue.mjs +215 -0
  7. package/es/src/ag-grid/editable/form-item.vue2.mjs +4 -0
  8. package/es/src/ag-grid/hooks/use-columns-def.d.ts +1 -0
  9. package/es/src/ag-grid/hooks/use-columns-def.mjs +94 -87
  10. package/es/src/ag-grid/hooks/use-editable-api.mjs +39 -39
  11. package/es/src/ag-grid/hooks/use-editable-form-item-api.d.ts +2 -1
  12. package/es/src/ag-grid/hooks/use-editable-form-item-api.mjs +174 -0
  13. package/es/src/ag-grid/index.d.ts +2 -1
  14. package/es/src/ag-grid/index.mjs +1 -0
  15. package/es/src/ag-grid/index.vue.mjs +109 -111
  16. package/es/src/ap-download/ap-download.vue.mjs +31 -25
  17. package/es/src/ap-drawer/interface.d.ts +5 -0
  18. package/es/src/ap-drawer/utils/createDrawer.mjs +22 -19
  19. package/es/src/ap-modal/index.d.ts +1 -0
  20. package/es/src/ap-modal/index.mjs +29 -27
  21. package/es/src/ap-modal/interface.d.ts +5 -0
  22. package/es/src/ap-modal/utils/confirm.mjs +35 -34
  23. package/es/src/ap-modal/utils/createModal.mjs +39 -37
  24. package/es/src/ap-modal/utils/util.d.ts +3 -0
  25. package/es/src/ap-modal/utils/util.mjs +8 -2
  26. package/es/src/business/ap-appendix/ap-appendix.vue2.mjs +21 -18
  27. package/es/src/business/ap-view/ap-view.vue2.mjs +20 -18
  28. package/es/src/business/ap-view/interface.d.ts +4 -0
  29. package/es/src/config-provider/config-provider.mjs +32 -24
  30. package/es/src/index.mjs +15 -13
  31. package/es/src/version.d.ts +1 -1
  32. package/es/src/version.mjs +1 -1
  33. package/lib/index.js +1 -1
  34. package/lib/src/ag-grid/components/tooltip/index.vue.d.ts +6 -0
  35. package/lib/src/ag-grid/components/tooltip/index.vue.js +1 -0
  36. package/lib/src/ag-grid/components/tooltip/index.vue2.js +1 -0
  37. package/lib/src/ag-grid/editable/form-item.vue.d.ts +16 -0
  38. package/lib/src/ag-grid/editable/form-item.vue.js +1 -0
  39. package/lib/src/ag-grid/editable/form-item.vue2.js +1 -0
  40. package/lib/src/ag-grid/hooks/use-columns-def.d.ts +1 -0
  41. package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
  42. package/lib/src/ag-grid/hooks/use-editable-api.js +1 -1
  43. package/lib/src/ag-grid/hooks/use-editable-form-item-api.d.ts +2 -1
  44. package/lib/src/ag-grid/hooks/use-editable-form-item-api.js +1 -0
  45. package/lib/src/ag-grid/index.d.ts +2 -1
  46. package/lib/src/ag-grid/index.js +1 -1
  47. package/lib/src/ag-grid/index.vue.js +1 -1
  48. package/lib/src/ap-download/ap-download.vue.js +1 -1
  49. package/lib/src/ap-drawer/interface.d.ts +5 -0
  50. package/lib/src/ap-drawer/utils/createDrawer.js +1 -1
  51. package/lib/src/ap-modal/index.d.ts +1 -0
  52. package/lib/src/ap-modal/index.js +1 -1
  53. package/lib/src/ap-modal/interface.d.ts +5 -0
  54. package/lib/src/ap-modal/utils/confirm.js +1 -1
  55. package/lib/src/ap-modal/utils/createModal.js +1 -1
  56. package/lib/src/ap-modal/utils/util.d.ts +3 -0
  57. package/lib/src/ap-modal/utils/util.js +1 -1
  58. package/lib/src/business/ap-appendix/ap-appendix.vue2.js +1 -1
  59. package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
  60. package/lib/src/business/ap-view/interface.d.ts +4 -0
  61. package/lib/src/config-provider/config-provider.js +1 -1
  62. package/lib/src/index.js +1 -1
  63. package/lib/src/version.d.ts +1 -1
  64. package/lib/src/version.js +1 -1
  65. package/package.json +1 -1
  66. package/theme/ag-grid/index.css +7 -2
  67. package/theme/ag-grid/index.less +6 -1
  68. package/theme/ap-form/ap-form-item.css +1 -1
  69. package/theme/ap-form/ap-form-item.less +1 -1
  70. package/theme/ap-form/index.css +1 -1
  71. package/theme/ap-form/search-form.css +1 -1
  72. package/theme/ap-grid/index.css +1 -1
  73. package/theme/ap-table/ap-table.css +1 -1
  74. package/theme/ap-table-modal/index.css +1 -1
  75. package/theme/css-var.css +2 -0
  76. package/theme/css-var.less +4 -0
  77. package/theme/editable-table/index.css +1 -1
  78. package/theme/index.css +9 -2
@@ -1,32 +1,32 @@
1
- import { defineComponent as eo, useSlots as oo, ref as I, toRef as T, unref as t, computed as l, nextTick as to, watch as z, createElementBlock as A, openBlock as b, normalizeStyle as V, normalizeClass as m, createCommentVNode as re, createElementVNode as B, createVNode as M, mergeProps as O, createSlots as ro, withCtx as ae, Fragment as ao, renderList as no, createBlock as ne, resolveDynamicComponent as lo, renderSlot as le, withDirectives as so, vShow as io } from "vue";
2
- import { AgGridVue as uo } from "ag-grid-vue3";
3
- import { ModuleRegistry as co, AllCommunityModule as mo } from "ag-grid-community";
4
- import { mergeProps as po } from "./utils.mjs";
5
- import { Spin as fo, Pagination as go } from "@aplus-frontend/antdv";
1
+ import { defineComponent as oo, useSlots as to, ref as I, toRef as T, unref as t, computed as l, nextTick as ro, watch as z, createElementBlock as A, openBlock as b, normalizeStyle as V, normalizeClass as m, createCommentVNode as re, createElementVNode as B, createVNode as M, mergeProps as O, createSlots as ao, withCtx as ae, Fragment as no, renderList as lo, createBlock as ne, resolveDynamicComponent as so, renderSlot as le, withDirectives as io, vShow as uo } from "vue";
2
+ import { AgGridVue as co } from "ag-grid-vue3";
3
+ import { ModuleRegistry as mo, AllCommunityModule as po } from "ag-grid-community";
4
+ import { mergeProps as fo } from "./utils.mjs";
5
+ import { Spin as go, Pagination as wo } from "@aplus-frontend/antdv";
6
6
  import { isUndefined as F, isFunction as se } from "lodash-unified";
7
7
  import "../config-provider/index.mjs";
8
- import { ApForm as wo } from "../ap-form/index.mjs";
9
- import { recursionApColumns as So } from "../ap-table/utils.mjs";
10
- import { useTablePaging as yo } from "../ap-table/hooks/use-table-paging-ng.mjs";
11
- import Co from "./hooks/use-row-selection.mjs";
12
- import { useProvideSorter as ho } from "./context.mjs";
13
- import { useProvideApTable as vo } from "../ap-table/context.mjs";
14
- import { DEFAULT_ROW_SELECTION_CONFIG as ie, sizeReverseMap as Ro, sizeMap as bo } from "../ap-grid/constants.mjs";
15
- import { useToken as Bo } from "@aplus-frontend/antdv/es/theme/internal";
16
- import { useTheme as Fo } from "./theme.mjs";
17
- import { useColumns as ko } from "./hooks/use-columns.mjs";
18
- import { useColumnsDef as xo } from "./hooks/use-columns-def.mjs";
19
- import { isDef as Io } from "../utils/index.mjs";
20
- import { getValidVNodeList as To } from "../utils/slot.mjs";
21
- import { useSearchForm as No } from "./hooks/use-search-form.mjs";
8
+ import { ApForm as So } from "../ap-form/index.mjs";
9
+ import { recursionApColumns as yo } from "../ap-table/utils.mjs";
10
+ import { useTablePaging as Co } from "../ap-table/hooks/use-table-paging-ng.mjs";
11
+ import ho from "./hooks/use-row-selection.mjs";
12
+ import { useProvideSorter as vo } from "./context.mjs";
13
+ import { useProvideApTable as Ro } from "../ap-table/context.mjs";
14
+ import { DEFAULT_ROW_SELECTION_CONFIG as ie, sizeReverseMap as bo, sizeMap as Bo } from "../ap-grid/constants.mjs";
15
+ import { useToken as Fo } from "@aplus-frontend/antdv/es/theme/internal";
16
+ import { useTheme as ko } from "./theme.mjs";
17
+ import { useColumns as xo } from "./hooks/use-columns.mjs";
18
+ import { useColumnsDef as Io } from "./hooks/use-columns-def.mjs";
19
+ import { isDef as To } from "../utils/index.mjs";
20
+ import { getValidVNodeList as No } from "../utils/slot.mjs";
21
+ import { useSearchForm as Do } from "./hooks/use-search-form.mjs";
22
22
  import "./components/empty/index.vue.mjs";
23
- import Do from "./hooks/use-virtual-config.mjs";
24
- import { usePinnedRow as Eo } from "./hooks/use-pinned-row.mjs";
25
- import Ko from "./hooks/use-selection-col-def.mjs";
26
- import { useNamespace as Po } from "../config-provider/hooks/use-namespace.mjs";
27
- import { useGlobalConfig as zo } from "../config-provider/hooks/use-global-config.mjs";
28
- import Ao from "./components/empty/index.vue2.mjs";
29
- const ct = /* @__PURE__ */ eo({
23
+ import Eo from "./hooks/use-virtual-config.mjs";
24
+ import { usePinnedRow as Ko } from "./hooks/use-pinned-row.mjs";
25
+ import Po from "./hooks/use-selection-col-def.mjs";
26
+ import { useNamespace as zo } from "../config-provider/hooks/use-namespace.mjs";
27
+ import { useGlobalConfig as Ao } from "../config-provider/hooks/use-global-config.mjs";
28
+ import Vo from "./components/empty/index.vue2.mjs";
29
+ const mt = /* @__PURE__ */ oo({
30
30
  name: "AgGrid",
31
31
  __name: "index",
32
32
  props: {
@@ -100,27 +100,23 @@ const ct = /* @__PURE__ */ eo({
100
100
  onUpdate: {}
101
101
  },
102
102
  setup(de, { expose: ue }) {
103
- co.registerModules([mo]);
104
- const o = de, G = oo(), { e: k, b: u, be: ce } = Po("ag-grid"), y = I(o.size), me = Fo(y, T(o, "rowHeight")), pe = Do(T(o, "virtual")), { rowPinnedGridConfig: H, getRowPinnedCellClass: fe } = Eo(
103
+ mo.registerModules([po]);
104
+ const o = de, W = to(), { e: k, b: u, be: ce } = zo("ag-grid"), y = I(o.size), me = ko(y, T(o, "rowHeight")), pe = Eo(T(o, "virtual")), { rowPinnedGridConfig: G, getRowPinnedCellClass: fe } = Ko(
105
105
  T(o, "summary")
106
- ), ge = zo("apGrid"), s = I(), [, we] = Bo();
106
+ ), ge = Ao("apGrid"), s = I(), [, we] = Fo();
107
107
  let p = !!o.dataSource;
108
- const L = No(o), { shownColumns: f, columns: U, columnKeys: Se, getTargetColumnByKey: ye } = ko(o), { defaultColDef: Ce, columnDefs: he } = xo(
109
- U,
110
- o,
111
- fe
112
- ), x = I({});
113
- ho({
108
+ const H = Do(o), { shownColumns: f, columns: L, columnKeys: Se, getTargetColumnByKey: ye } = xo(o), { defaultColDef: Ce, columnDefs: he, gridWrapperRef: ve } = Io(L, o, fe), x = I({});
109
+ vo({
114
110
  sorter: x,
115
111
  setSorter(e) {
116
112
  x.value = e;
117
113
  }
118
114
  });
119
- const ve = {
115
+ const Re = {
120
116
  asc: "ascend",
121
117
  desc: "descend"
122
118
  };
123
- function Re() {
119
+ function be() {
124
120
  const e = s.value.getColumns()?.filter((c) => c.getSort() !== void 0), r = t(x) || {};
125
121
  let a = e?.[0];
126
122
  const d = Object.keys(r);
@@ -134,32 +130,32 @@ const ct = /* @__PURE__ */ eo({
134
130
  j(void 0, void 0, {
135
131
  column: i,
136
132
  field: v?.field ?? i.field ?? i.colId,
137
- order: S ? ve[S] : null
133
+ order: S ? Re[S] : null
138
134
  });
139
135
  }
140
- const be = l(() => So(t(f), (e) => {
136
+ const Be = l(() => yo(t(f), (e) => {
141
137
  if (e.sorter === !0)
142
138
  return e.field ?? e.dataIndex ?? e.key;
143
- }).filter(Boolean)), Be = () => {
139
+ }).filter(Boolean)), Fe = () => {
144
140
  x.value = {};
145
141
  const e = s.value;
146
142
  if (!e)
147
143
  return;
148
144
  const r = e.getColumnState()?.map((a) => ({ ...a, sort: null }));
149
145
  e.applyColumnState({ state: r });
150
- }, Fe = l(() => Io(o.manual) ? o.manual : To(G.searchFormExtra?.() || []).some((r) => r.type?.name === "ApView")), {
146
+ }, ke = l(() => To(o.manual) ? o.manual : No(W.searchFormExtra?.() || []).some((r) => r.type?.name === "ApView")), {
151
147
  formRef: g,
152
148
  submit: N,
153
149
  reset: D,
154
150
  data: w,
155
- tableProps: W,
151
+ tableProps: U,
156
152
  handleTableChangeOptional: j,
157
153
  submitWith: $,
158
154
  refresh: q,
159
- getPaging: ke,
160
- setPaging: xe,
161
- setDataSource: Ie
162
- } = yo({
155
+ getPaging: xe,
156
+ setPaging: Ie,
157
+ setDataSource: Te
158
+ } = Co({
163
159
  async request(e) {
164
160
  if (p = !1, C.value && !C.value.preserveSelectedRowKeys && F(o.dataSource) && P(), !F(o.dataSource)) {
165
161
  const a = e.pageSize * (e.current - 1);
@@ -178,11 +174,11 @@ const ct = /* @__PURE__ */ eo({
178
174
  filterFields: I([]),
179
175
  params: T(o, "params"),
180
176
  defaultData: o.defaultData,
181
- manual: t(Fe),
177
+ manual: t(ke),
182
178
  formatParams: o.beforeSearchSubmit,
183
179
  pagination: o.pagination,
184
- sortFields: be,
185
- onClickReset: Be
180
+ sortFields: Be,
181
+ onClickReset: Fe
186
182
  }), C = l(() => {
187
183
  const e = o.rowSelection || ge.value?.rowSelection;
188
184
  if (e)
@@ -190,29 +186,29 @@ const ct = /* @__PURE__ */ eo({
190
186
  ...ie,
191
187
  ...e
192
188
  };
193
- }), Te = Ko(o, f), Ne = l(
189
+ }), Ne = Po(o, f), De = l(
194
190
  () => F(o.dataSource) ? w.records : o.dataSource
195
191
  ), {
196
- select: De,
197
- unSelect: Ee,
192
+ select: Ee,
193
+ unSelect: Ke,
198
194
  selectedRows: E,
199
- selectedRowKeys: Ke,
200
- clearAll: Pe,
201
- selectMultiByKeys: ze
202
- } = Co({
195
+ selectedRowKeys: Pe,
196
+ clearAll: ze,
197
+ selectMultiByKeys: Ae
198
+ } = ho({
203
199
  ...C,
204
- dataSource: Ne,
200
+ dataSource: De,
205
201
  rowKey: o.rowKey
206
- }), Ae = {
202
+ }), Ve = {
207
203
  checkbox: "multiRow",
208
204
  radio: "singleRow"
209
- }, Ve = l(() => {
205
+ }, Me = l(() => {
210
206
  const e = C.value;
211
207
  if (!e)
212
208
  return;
213
209
  const { type: r = "checkbox", disabled: a } = e;
214
210
  return {
215
- mode: Ae[r],
211
+ mode: Ve[r],
216
212
  isRowSelectable: (d) => a ? !a(d.data) : !0
217
213
  };
218
214
  });
@@ -239,15 +235,15 @@ const ct = /* @__PURE__ */ eo({
239
235
  }), e.setNodesSelected({ nodes: a, newValue: !0 }), setTimeout(() => {
240
236
  p = !0;
241
237
  }, 0);
242
- }, Me = (e) => {
243
- p && (e.node.isSelected() ? De(e.data) : Ee(e.data));
244
- }, Oe = () => {
238
+ }, Oe = (e) => {
239
+ p && (e.node.isSelected() ? Ee(e.data) : Ke(e.data));
240
+ }, We = () => {
245
241
  p = !0;
246
242
  }, P = () => {
247
- Pe(), s.value?.deselectAll();
243
+ ze(), s.value?.deselectAll();
248
244
  };
249
245
  function Ge(e) {
250
- ze(e), to(() => {
246
+ Ae(e), ro(() => {
251
247
  J({});
252
248
  });
253
249
  }
@@ -281,7 +277,7 @@ const ct = /* @__PURE__ */ eo({
281
277
  ...n,
282
278
  hide: R
283
279
  }, te = e.find(
284
- (_e) => ee(_e.key) === n.colId
280
+ (eo) => ee(eo.key) === n.colId
285
281
  );
286
282
  return te && (oe.pinned = te.fixed || null), oe;
287
283
  }), i = new Map(
@@ -297,15 +293,15 @@ const ct = /* @__PURE__ */ eo({
297
293
  applyOrder: !0
298
294
  });
299
295
  }
300
- vo({
296
+ Ro({
301
297
  columns: l(() => f.value),
302
- columnsBackup: l(() => U.value),
303
- size: l(() => bo[y.value]),
298
+ columnsBackup: l(() => L.value),
299
+ size: l(() => Bo[y.value]),
304
300
  updateColumns(e) {
305
301
  f.value = e, o.onShownColumnsChange?.(e), He(e);
306
302
  },
307
303
  updateSize(e) {
308
- y.value = Ro[e];
304
+ y.value = bo[e];
309
305
  },
310
306
  renderConfig: l(() => ({
311
307
  className: ce("table-header", "title"),
@@ -329,34 +325,34 @@ const ct = /* @__PURE__ */ eo({
329
325
  o.card ? null : u("wrapper"),
330
326
  u("adaptive"),
331
327
  u(`size-${y.value}`)
332
- ].filter(Boolean)), We = l(() => ({
328
+ ].filter(Boolean)), je = l(() => ({
333
329
  height: "100%",
334
330
  ...o.tableStyle || {}
335
- })), je = (e, r) => {
331
+ })), $e = (e, r) => {
336
332
  j({ current: e, pageSize: r });
337
333
  };
338
- function $e(e) {
334
+ function qe(e) {
339
335
  const r = e.data;
340
336
  return K(r);
341
337
  }
342
- function qe(e, r) {
338
+ function Je(e, r) {
343
339
  s.value?.ensureIndexVisible(e, r);
344
340
  }
345
- function Je(e) {
341
+ function Qe(e) {
346
342
  o.onRowClicked?.(e.data, e.event);
347
343
  }
348
- function Qe(e) {
344
+ function Xe(e) {
349
345
  o.onScrollEnd?.(e.direction);
350
346
  }
351
- function Xe(e) {
347
+ function Ye(e) {
352
348
  return s.value?.refreshCells(e);
353
349
  }
354
- function Ye(e) {
350
+ function Ze(e) {
355
351
  return s.value?.redrawRows(e);
356
352
  }
357
- const Ze = (e) => {
353
+ const _e = (e) => {
358
354
  const r = [
359
- H.value.getRowClass?.(e)
355
+ G.value.getRowClass?.(e)
360
356
  ];
361
357
  if (!e.node.rowPinned) {
362
358
  const a = se(o.rowClassName) ? o.rowClassName(e.data, e.rowIndex) : o.rowClassName;
@@ -367,7 +363,7 @@ const ct = /* @__PURE__ */ eo({
367
363
  return z(
368
364
  () => o.dataSource,
369
365
  (e) => {
370
- Ie(e);
366
+ Te(e);
371
367
  },
372
368
  { immediate: !0, deep: !0 }
373
369
  ), z(
@@ -393,41 +389,41 @@ const ct = /* @__PURE__ */ eo({
393
389
  setSelectedRowKeys: Ge,
394
390
  clearAll: P
395
391
  },
396
- scrollToRow: qe,
392
+ scrollToRow: Je,
397
393
  getDataSource: () => t(w.records),
398
- getPaging: ke,
399
- setPaging: xe,
394
+ getPaging: xe,
395
+ setPaging: Ie,
400
396
  getSearchFormSorterItems: Y,
401
397
  setSearchFormSorterItems: Z,
402
398
  resetSearchFormSorterItems: _,
403
- refreshCells: Xe,
404
- redrawRows: Ye,
399
+ refreshCells: Ye,
400
+ redrawRows: Ze,
405
401
  _internalGridApi: l(() => s.value)
406
402
  }), (e, r) => (b(), A("div", {
407
403
  class: m(Ue.value),
408
404
  style: V(e.wrapperStyle)
409
405
  }, [
410
- t(F)(e.dataSource) && e.searchForm !== !1 && t(L).length > 0 ? (b(), A("div", {
406
+ t(F)(e.dataSource) && e.searchForm !== !1 && t(H).length > 0 ? (b(), A("div", {
411
407
  key: 0,
412
408
  class: m(e.card ? t(k)("search-wrapper") : null),
413
409
  style: V(e.searchFormWrapperStyle)
414
410
  }, [
415
- M(t(wo).SearchForm, O(e.searchForm || {}, {
411
+ M(t(So).SearchForm, O(e.searchForm || {}, {
416
412
  ref_key: "formRef",
417
413
  ref: g,
418
414
  "custom-reset": "",
419
- "submit-loading": t(W).loading,
415
+ "submit-loading": t(U).loading,
420
416
  onSubmit: t(N),
421
417
  onReset: t(D)
422
- }), ro({
418
+ }), ao({
423
419
  default: ae(() => [
424
- (b(!0), A(ao, null, no(t(L), (a) => (b(), ne(lo(a.renderNode), {
420
+ (b(!0), A(no, null, lo(t(H), (a) => (b(), ne(so(a.renderNode), {
425
421
  key: a.dataIndex
426
422
  }))), 128))
427
423
  ]),
428
424
  _: 2
429
425
  }, [
430
- G.searchFormExtra ? {
426
+ W.searchFormExtra ? {
431
427
  name: "extra",
432
428
  fn: ae(() => [
433
429
  le(e.$slots, "searchFormExtra")
@@ -445,60 +441,62 @@ const ct = /* @__PURE__ */ eo({
445
441
  }, [
446
442
  le(e.$slots, "title", {
447
443
  selectedRows: t(E),
448
- selectedRowKeys: t(Ke),
444
+ selectedRowKeys: t(Pe),
449
445
  shownColumns: t(f),
450
446
  clearAll: P
451
447
  })
452
448
  ], 2),
453
449
  B("div", {
450
+ ref_key: "gridWrapperRef",
451
+ ref: ve,
454
452
  class: m(t(u)("grid-wrapper"))
455
453
  }, [
456
- M(t(uo), O(t(po)(t(pe), t(H)), {
457
- "get-row-class": Ze,
458
- style: We.value,
454
+ M(t(co), O(t(fo)(t(pe), t(G)), {
455
+ "get-row-class": _e,
456
+ style: je.value,
459
457
  "row-data": t(w).records,
460
458
  "column-defs": t(he),
461
459
  "default-col-def": t(Ce),
462
460
  "suppress-loading-overlay": "",
463
- "row-selection": Ve.value,
464
- "selection-column-def": t(Te),
465
- "get-row-id": $e,
461
+ "row-selection": Me.value,
462
+ "selection-column-def": t(Ne),
463
+ "get-row-id": qe,
466
464
  theme: t(me),
467
465
  "tooltip-show-delay": 500,
468
466
  "enable-browser-tooltips": e.browserTooltips,
469
467
  "tooltip-interaction": "",
470
468
  "row-class-rules": e.rowClassRules,
471
- "no-rows-overlay-component": Ao,
469
+ "no-rows-overlay-component": Vo,
472
470
  "suppress-cell-focus": "",
473
471
  "dom-layout": e.autoHeight ? "autoHeight" : "normal",
474
- onSortChanged: Re,
472
+ onSortChanged: be,
475
473
  onGridReady: r[0] || (r[0] = (a) => s.value = a.api),
476
474
  onRowDataUpdated: J,
477
- onRowSelected: Me,
478
- onFirstDataRendered: Oe,
479
- onRowClicked: Je,
480
- onBodyScrollEnd: Qe
475
+ onRowSelected: Oe,
476
+ onFirstDataRendered: We,
477
+ onRowClicked: Qe,
478
+ onBodyScrollEnd: Xe
481
479
  }), null, 16, ["style", "row-data", "column-defs", "default-col-def", "row-selection", "selection-column-def", "theme", "enable-browser-tooltips", "row-class-rules", "dom-layout"]),
482
- so(B("div", {
480
+ io(B("div", {
483
481
  class: m(t(k)("table-loading-wrapper"))
484
482
  }, [
485
- M(t(fo), { delay: 300 })
483
+ M(t(go), { delay: 300 })
486
484
  ], 2), [
487
- [io, Le.value]
485
+ [uo, Le.value]
488
486
  ])
489
487
  ], 2),
490
488
  B("div", {
491
489
  class: m(t(u)("pagination-wrapper"))
492
490
  }, [
493
- e.pagination !== !1 ? (b(), ne(t(go), O({
491
+ e.pagination !== !1 ? (b(), ne(t(wo), O({
494
492
  key: 0,
495
493
  class: t(u)("pagination")
496
- }, t(W).pagination, { onChange: je }), null, 16, ["class"])) : re("", !0)
494
+ }, t(U).pagination, { onChange: $e }), null, 16, ["class"])) : re("", !0)
497
495
  ], 2)
498
496
  ], 6)
499
497
  ], 6));
500
498
  }
501
499
  });
502
500
  export {
503
- ct as default
501
+ mt as default
504
502
  };
@@ -1,12 +1,12 @@
1
- import { defineComponent as F, ref as L, useSlots as S, computed as t, unref as s, createBlock as x, openBlock as l, mergeProps as A, withCtx as j, createElementVNode as p, normalizeClass as I, createElementBlock as m, createCommentVNode as u, createVNode as M, renderSlot as T, toDisplayString as U } from "vue";
1
+ import { defineComponent as F, ref as L, useSlots as S, computed as t, unref as a, createBlock as x, openBlock as i, mergeProps as A, withCtx as j, createElementVNode as m, normalizeClass as I, createElementBlock as u, createCommentVNode as f, createVNode as M, renderSlot as T, toDisplayString as U } from "vue";
2
2
  import { Button as V } from "@aplus-frontend/antdv";
3
3
  import { LoadingOutlined as D } from "@ant-design/icons-vue";
4
4
  import "../config-provider/index.mjs";
5
5
  import { useOssInit as E } from "./hooks/index.mjs";
6
- import { getFileInfo as f } from "./utils/getFileInfo.mjs";
6
+ import { getFileInfo as g } from "./utils/getFileInfo.mjs";
7
7
  import { useStyle as P } from "./hooks/useStyle.mjs";
8
8
  import { useLocale as G } from "../config-provider/hooks/use-locale.mjs";
9
- import { useGlobalConfig as i } from "../config-provider/hooks/use-global-config.mjs";
9
+ import { useGlobalConfig as r } from "../config-provider/hooks/use-global-config.mjs";
10
10
  const R = {
11
11
  key: 0,
12
12
  class: "spin"
@@ -43,27 +43,33 @@ const R = {
43
43
  getOssAccess: {}
44
44
  },
45
45
  emits: ["downloadCallback"],
46
- setup(g, { emit: y }) {
47
- const C = y, n = L(!1), { lang: b } = G(), h = S(), w = t(() => b.value === "zh-cn" ? "zh_CN" : "en_US"), N = i("uiMode"), e = g, _ = i("apUpload"), r = i(
46
+ setup(y, { emit: C }) {
47
+ const N = C, n = L(!1), { lang: b } = G(), v = S(), h = t(() => b.value === "zh-cn" ? "zh_CN" : "en_US"), w = r("uiMode"), e = y, l = r("apUpload"), c = r(
48
48
  "downloadCenterTriggerConfig"
49
- ), c = t(() => e.disabled), v = t(() => e.color ? e.color : N.value === "aplus" ? "#0070FF" : "#1890FF"), k = t(() => e.size), { getInnerWrapperClass: B } = P(v, k, c), z = t(() => e.getOssAccess || _.value?.getOssAccess), O = async () => {
49
+ ), d = t(() => e.disabled), _ = t(() => e.color ? e.color : w.value === "aplus" ? "#0070FF" : "#1890FF"), k = t(() => e.size), { getInnerWrapperClass: B } = P(_, k, d), z = t(() => e.getOssAccess || l.value?.getOssAccess), O = async () => {
50
50
  if (!e.disabled) {
51
51
  n.value = !0;
52
52
  try {
53
- if (r.value?.trigger) {
54
- let a = f(e.needName, e.fileName).map((d) => ({
55
- objectName: d.path,
56
- fileName: d.fileName
53
+ if (c.value?.trigger) {
54
+ let s = g(
55
+ e.needName ?? l?.value?.needName,
56
+ e.fileName
57
+ ).map((p) => ({
58
+ objectName: p.path,
59
+ fileName: p.fileName
57
60
  }));
58
- await r.value?.trigger(a);
61
+ await c.value?.trigger(s);
59
62
  } else {
60
- const a = await (await E(
63
+ const s = await (await E(
61
64
  z.value,
62
- s(w)
65
+ a(h)
63
66
  )).downloadFile(
64
- f(e.needName, e.fileName)
67
+ g(
68
+ e.needName ?? l?.value?.needName,
69
+ e.fileName
70
+ )
65
71
  );
66
- C("downloadCallback", a);
72
+ N("downloadCallback", s);
67
73
  }
68
74
  } catch (o) {
69
75
  console.error(o);
@@ -72,23 +78,23 @@ const R = {
72
78
  }
73
79
  }
74
80
  };
75
- return (o, a) => (l(), x(s(V), A(e, {
81
+ return (o, s) => (i(), x(a(V), A(e, {
76
82
  type: e.type,
77
83
  size: e.size,
78
- disabled: c.value,
84
+ disabled: d.value,
79
85
  onClick: O
80
86
  }), {
81
87
  default: j(() => [
82
- p("div", {
83
- class: I(s(B))
88
+ m("div", {
89
+ class: I(a(B))
84
90
  }, [
85
- n.value ? (l(), m("span", R, [
86
- M(s(D), { spin: !0 })
87
- ])) : u("", !0),
88
- s(h).icon ? (l(), m("span", W, [
91
+ n.value ? (i(), u("span", R, [
92
+ M(a(D), { spin: !0 })
93
+ ])) : f("", !0),
94
+ a(v).icon ? (i(), u("span", W, [
89
95
  T(o.$slots, "icon")
90
- ])) : u("", !0),
91
- p("span", $, U(o.text), 1)
96
+ ])) : f("", !0),
97
+ m("span", $, U(o.text), 1)
92
98
  ], 2)
93
99
  ]),
94
100
  _: 3
@@ -1,4 +1,5 @@
1
1
  import { DrawerProps } from '@aplus-frontend/antdv';
2
+ import { AppContext } from 'vue';
2
3
  export type CreateDrawerFuncProps<ContentRecord = any> = Omit<DrawerProps, 'visible' | 'onUpdate:visible' | 'afterVisibleChange' | 'onAfterVisibleOChange' | 'open' | 'onUpdate:open' | 'destroyOnClose' | 'onClose' | 'getContainer' | 'extra' | 'footer'> & Partial<{
3
4
  onClose: (params: ContentRecord) => any | Promise<any>;
4
5
  getContainer: HTMLElement;
@@ -6,6 +7,10 @@ export type CreateDrawerFuncProps<ContentRecord = any> = Omit<DrawerProps, 'visi
6
7
  destroyOnClose: boolean;
7
8
  extra: (params: ContentRecord, close: () => void) => any;
8
9
  footer: (params: ContentRecord, close: () => void) => any;
10
+ /**
11
+ * 抽屉的上下文,一般用于获取全局注册组件、vuex 等内容
12
+ */
13
+ appContext: AppContext;
9
14
  }>;
10
15
  export type CreateDrawerFuncReturn = {
11
16
  destroy: () => void;
@@ -1,29 +1,30 @@
1
- import { render as c, defineComponent as C, createVNode as a, mergeProps as g, h as x } from "vue";
2
- import { Drawer as v } from "@aplus-frontend/antdv";
3
- import { ConfigProvider as b, globalConfigCached as w } from "../../config-provider/config-provider.mjs";
4
- import { omit as P } from "lodash-unified";
1
+ import { render as m, defineComponent as g, createVNode as l, mergeProps as b, h as v } from "vue";
2
+ import { Drawer as w } from "@aplus-frontend/antdv";
3
+ import { ConfigProvider as P, globalConfigCached as y } from "../../config-provider/config-provider.mjs";
4
+ import { omit as A } from "lodash-unified";
5
5
  import "../components/ApDrawerClose.vue.mjs";
6
- import y from "../components/ApDrawerClose.vue2.mjs";
7
- const _ = (n) => {
6
+ import { getModalGlobalAppContext as D } from "../../ap-modal/utils/util.mjs";
7
+ import O from "../components/ApDrawerClose.vue2.mjs";
8
+ const N = (n) => {
8
9
  let o, s;
9
10
  const {
10
11
  destroyOnClose: r = !0
11
12
  } = n;
12
13
  function p() {
13
14
  o && o(!1), setTimeout(() => {
14
- c(null, t), t.parentElement?.removeChild(t);
15
+ m(null, t), t.parentElement?.removeChild(t);
15
16
  }, 500);
16
17
  }
17
- function h() {
18
+ function f() {
18
19
  o && o(!0);
19
20
  }
20
21
  function i() {
21
22
  o && o(!1);
22
23
  }
23
- function m(e) {
24
+ function h(e) {
24
25
  s && s(e);
25
26
  }
26
- const f = /* @__PURE__ */ C({
27
+ const C = /* @__PURE__ */ g({
27
28
  data() {
28
29
  return {
29
30
  open: r,
@@ -50,29 +51,31 @@ const _ = (n) => {
50
51
  }
51
52
  },
52
53
  render() {
53
- const e = P(this.props, ["onClose", "extra", "footer", "visible", "onUpdate:visible", "afterVisibleChange", "onAfterVisibleOChange", "open", "onUpdate:open", "getContainer"]), l = this.props?.content?.component?.exposed ?? void 0, d = () => r ? p() : i();
54
- return a(b, w.value, {
55
- default: () => [a(v, g({
54
+ const e = A(this.props, ["onClose", "extra", "footer", "visible", "onUpdate:visible", "afterVisibleChange", "onAfterVisibleOChange", "open", "onUpdate:open", "getContainer"]), d = this.props?.content?.component?.exposed ?? void 0, c = () => r ? p() : i();
55
+ return l(P, y.value, {
56
+ default: () => [l(w, b({
56
57
  open: this.open,
57
58
  onClose: this.handleClose,
58
59
  closeIcon: this.props?.closeIcon ?? null,
59
- extra: this.props?.extra ? this.props?.extra?.(l, d) : a(y, {
60
+ extra: this.props?.extra ? this.props?.extra?.(d, c) : l(O, {
60
61
  onClose: this.handleClose
61
62
  }, null),
62
- footer: this.props?.footer?.(l, d)
63
+ footer: this.props?.footer?.(d, c)
63
64
  }, e), {
64
65
  default: () => [this.props?.content]
65
66
  })]
66
67
  });
67
68
  }
68
69
  }), u = n.getContainer || document.body, t = document.createElement("div");
69
- return u.appendChild(t), c(x(f), t), {
70
+ u.appendChild(t);
71
+ const a = v(C), x = D();
72
+ return a.appContext = n.appContext || x || a.appContext, m(a, t), {
70
73
  destroy: p,
71
- update: m,
72
- open: h,
74
+ update: h,
75
+ open: f,
73
76
  close: i
74
77
  };
75
78
  };
76
79
  export {
77
- _ as createDrawer
80
+ N as createDrawer
78
81
  };
@@ -11,6 +11,7 @@ type ApModalMixedProps = Omit<typeof _Modal, ApModalType | 'warn'> & {
11
11
  error: ModalFunc;
12
12
  success: ModalFunc;
13
13
  info: ModalFunc;
14
+ setModalGlobalAppContext: (appContext: any) => void;
14
15
  };
15
16
  declare const ApModal: ApModalMixedProps;
16
17
  export { ApModal };