@aplus-frontend/ui 0.2.0 → 0.2.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 (91) hide show
  1. package/es/index.mjs +1 -1
  2. package/es/src/ap-button/ap-action-button.vue.mjs +1 -0
  3. package/es/src/ap-button/ap-button.vue.d.ts +3 -0
  4. package/es/src/ap-button/ap-button.vue.mjs +47 -66
  5. package/es/src/ap-button/interface.d.ts +1 -0
  6. package/es/src/ap-button/utils/index.d.ts +3 -0
  7. package/es/src/ap-button/utils/index.mjs +33 -0
  8. package/es/src/ap-descriptions/help-message/index.vue.d.ts +2 -2
  9. package/es/src/ap-descriptions/interface.d.ts +1 -1
  10. package/es/src/ap-field/checkbox/index.vue.mjs +23 -22
  11. package/es/src/ap-field/hooks/use-options.d.ts +8 -0
  12. package/es/src/ap-field/hooks/use-options.mjs +22 -0
  13. package/es/src/ap-field/radio/index.vue.mjs +25 -24
  14. package/es/src/ap-field/segmented/index.vue.mjs +37 -33
  15. package/es/src/ap-field/select/index.vue.mjs +74 -73
  16. package/es/src/ap-table/ap-table.vue.mjs +2 -428
  17. package/es/src/ap-table/ap-table.vue2.mjs +428 -2
  18. package/es/src/ap-table/components/setting/modal/index.vue.d.ts +16 -1
  19. package/es/src/ap-table/components/setting/modal/index.vue2.mjs +22 -20
  20. package/es/src/ap-table/hooks/use-table-column-state.mjs +72 -69
  21. package/es/src/ap-table/index.d.ts +6 -1
  22. package/es/src/ap-table/index.mjs +9 -3
  23. package/es/src/business/ap-batch-action/ApBatchAction.vue.d.ts +8 -3
  24. package/es/src/business/ap-batch-action/ApBatchAction.vue2.mjs +42 -29
  25. package/es/src/business/ap-batch-action/index.d.ts +8 -3
  26. package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +14 -13
  27. package/es/src/business/ap-batch-action-group/index.d.ts +4 -0
  28. package/es/src/business/ap-button-group/index.d.ts +8 -0
  29. package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +42 -40
  30. package/es/src/business/ap-table-modal/index.d.ts +38 -1
  31. package/es/src/business/ap-table-modal/interface.d.ts +17 -2
  32. package/es/src/business/ap-table-modal/style/css.js +1 -1
  33. package/es/src/business/ap-table-modal/style/index.js +1 -1
  34. package/es/src/business/ap-table-modal/table-layout/index.vue.d.ts +57 -0
  35. package/es/src/business/ap-table-modal/table-layout/index.vue.mjs +4 -0
  36. package/es/src/business/ap-table-modal/table-layout/index.vue2.mjs +74 -0
  37. package/es/src/business/ap-table-modal/table-modal.vue2.mjs +134 -79
  38. package/es/src/config-provider/config-provider.d.ts +1 -0
  39. package/es/src/config-provider/css-var.d.ts +1 -0
  40. package/es/src/config-provider/css-var.mjs +7 -5
  41. package/es/src/config-provider/index.d.ts +6 -0
  42. package/es/src/index.mjs +201 -202
  43. package/es/src/locale/lang/en.mjs +3 -1
  44. package/es/src/locale/lang/zh-cn.mjs +3 -1
  45. package/es/src/path-map.mjs +2 -0
  46. package/lib/index.js +1 -1
  47. package/lib/src/ap-button/ap-action-button.vue.js +1 -1
  48. package/lib/src/ap-button/ap-button.vue.d.ts +3 -0
  49. package/lib/src/ap-button/ap-button.vue.js +1 -1
  50. package/lib/src/ap-button/interface.d.ts +1 -0
  51. package/lib/src/ap-button/utils/index.d.ts +3 -0
  52. package/lib/src/ap-button/utils/index.js +1 -0
  53. package/lib/src/ap-descriptions/help-message/index.vue.d.ts +2 -2
  54. package/lib/src/ap-descriptions/interface.d.ts +1 -1
  55. package/lib/src/ap-field/checkbox/index.vue.js +1 -1
  56. package/lib/src/ap-field/hooks/use-options.d.ts +8 -0
  57. package/lib/src/ap-field/hooks/use-options.js +1 -0
  58. package/lib/src/ap-field/radio/index.vue.js +1 -1
  59. package/lib/src/ap-field/segmented/index.vue.js +1 -1
  60. package/lib/src/ap-field/select/index.vue.js +1 -1
  61. package/lib/src/ap-table/ap-table.vue.js +1 -1
  62. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  63. package/lib/src/ap-table/components/setting/modal/index.vue.d.ts +16 -1
  64. package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
  65. package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
  66. package/lib/src/ap-table/index.d.ts +6 -1
  67. package/lib/src/ap-table/index.js +1 -1
  68. package/lib/src/business/ap-batch-action/ApBatchAction.vue.d.ts +8 -3
  69. package/lib/src/business/ap-batch-action/ApBatchAction.vue2.js +1 -1
  70. package/lib/src/business/ap-batch-action/index.d.ts +8 -3
  71. package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.js +1 -1
  72. package/lib/src/business/ap-batch-action-group/index.d.ts +4 -0
  73. package/lib/src/business/ap-button-group/index.d.ts +8 -0
  74. package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
  75. package/lib/src/business/ap-table-modal/index.d.ts +38 -1
  76. package/lib/src/business/ap-table-modal/interface.d.ts +17 -2
  77. package/lib/src/business/ap-table-modal/style/css.js +1 -1
  78. package/lib/src/business/ap-table-modal/style/index.js +1 -1
  79. package/lib/src/business/ap-table-modal/table-layout/index.vue.d.ts +57 -0
  80. package/lib/src/business/ap-table-modal/table-layout/index.vue.js +1 -0
  81. package/lib/src/business/ap-table-modal/table-layout/index.vue2.js +1 -0
  82. package/lib/src/business/ap-table-modal/table-modal.vue2.js +1 -1
  83. package/lib/src/config-provider/config-provider.d.ts +1 -0
  84. package/lib/src/config-provider/css-var.d.ts +1 -0
  85. package/lib/src/config-provider/css-var.js +1 -1
  86. package/lib/src/config-provider/index.d.ts +6 -0
  87. package/lib/src/index.js +1 -1
  88. package/lib/src/locale/lang/en.js +1 -1
  89. package/lib/src/locale/lang/zh-cn.js +1 -1
  90. package/lib/src/path-map.js +1 -1
  91. package/package.json +2 -2
@@ -1,15 +1,17 @@
1
- import { defineComponent as I, ref as i, unref as r, computed as N, h as O, openBlock as A, createBlock as D, mergeProps as g, withCtx as E, createVNode as L } from "vue";
2
- import { message as U, Modal as q } from "@aplus-frontend/antdv";
1
+ import { defineComponent as F, ref as m, unref as u, computed as U, h as q, openBlock as $, createBlock as z, mergeProps as b, withCtx as k, createVNode as T } from "vue";
2
+ import { message as h, Modal as H } from "@aplus-frontend/antdv";
3
3
  import "../../index.mjs";
4
- import { cloneDeep as F, omit as x } from "lodash-unified";
5
- import { transformTableParams as G } from "@aplus-frontend/utils";
4
+ import { cloneDeep as V, omit as S } from "lodash-unified";
5
+ import { transformTableParams as W } from "@aplus-frontend/utils";
6
6
  import "./modal-title.vue.mjs";
7
- import { AsyncOpenResultError as f } from "./interface.mjs";
8
- import { useGlobalConfig as $ } from "../../config-provider/hooks/use-global-config.mjs";
9
- import { useLocale as z } from "../../config-provider/hooks/use-locale.mjs";
10
- import V from "./modal-title.vue2.mjs";
11
- import W from "../../ap-table/ap-table.vue.mjs";
12
- const le = /* @__PURE__ */ I({
7
+ import { AsyncOpenResultError as x } from "./interface.mjs";
8
+ import "./table-layout/index.vue.mjs";
9
+ import { useGlobalConfig as Y } from "../../config-provider/hooks/use-global-config.mjs";
10
+ import { useLocale as J } from "../../config-provider/hooks/use-locale.mjs";
11
+ import Q from "./modal-title.vue2.mjs";
12
+ import X from "./table-layout/index.vue2.mjs";
13
+ import { ApTable as Z } from "../../ap-table/index.mjs";
14
+ const fe = /* @__PURE__ */ F({
13
15
  __name: "table-modal",
14
16
  props: {
15
17
  columns: {},
@@ -19,6 +21,9 @@ const le = /* @__PURE__ */ I({
19
21
  maxCount: { default: 1 / 0 },
20
22
  isRenderModalTitleSuffix: { type: Boolean, default: !0 },
21
23
  renderModalTitleSuffix: {},
24
+ disabledCheckbox: { type: [Boolean, Function] },
25
+ rowSelection: {},
26
+ tableLayoutConfig: {},
22
27
  prefixCls: {},
23
28
  confirmLoading: { type: Boolean, default: void 0 },
24
29
  title: {},
@@ -56,89 +61,126 @@ const le = /* @__PURE__ */ I({
56
61
  mousePosition: {}
57
62
  },
58
63
  emits: ["finish"],
59
- setup(b, { expose: C, emit: w }) {
60
- const e = b, T = w, s = i(!1), m = i({}), d = i(null), n = i([]), p = i();
61
- let u = null, a = null;
62
- const k = $("uiMode", "admin"), { t: B } = z(), S = async (t = [], o = {}) => {
63
- var l, c, v;
64
- switch (n.value = [...t], s.value = !0, m.value = o == null ? void 0 : o.extraParams, p.value = o.apTableDataSources || ((l = e.apTableProps) == null ? void 0 : l.dataSource), o.refreshMode || "reset") {
64
+ setup(B, { expose: R, emit: M }) {
65
+ const e = B, P = M, i = m(!1), y = m({}), d = m(null), a = m([]), C = m();
66
+ let c = null, n = null;
67
+ const K = Y("uiMode", "admin"), { t: g } = J(), _ = async (t = [], o = {}) => {
68
+ var l, r, s;
69
+ switch (a.value = [...t], i.value = !0, y.value = o == null ? void 0 : o.extraParams, C.value = o.apTableDataSources || ((l = e.apTableProps) == null ? void 0 : l.dataSource), o.refreshMode || "reset") {
65
70
  case "reset":
66
- (c = d.value) == null || c.reset();
71
+ (r = d.value) == null || r.reset();
67
72
  break;
68
73
  case "submit":
69
- (v = d.value) == null || v.submit();
74
+ (s = d.value) == null || s.submit();
70
75
  break;
71
76
  case "none":
72
77
  break;
73
78
  }
74
- return new Promise((K, _) => {
75
- u = K, a = _;
79
+ return new Promise((p, f) => {
80
+ c = p, n = f;
76
81
  });
77
- }, y = () => {
78
- s.value = !1, u = null, a == null || a(f.ModalCancel), a = null;
79
- }, h = async (t) => {
80
- t = G({
82
+ }, w = () => {
83
+ i.value = !1, c = null, n == null || n(x.ModalCancel), n = null;
84
+ }, I = async (t) => {
85
+ t = W({
81
86
  ...t,
82
- ...m.value
87
+ ...y.value
83
88
  });
84
- const o = e.api, { records: l, total: c } = await o(t);
85
- return {
89
+ const o = e.api, { records: l, total: r } = await o(t);
90
+ return console.log("records", l), {
86
91
  data: l,
87
- total: c
92
+ total: r
88
93
  };
89
- }, M = () => {
90
- if (n.value.length > e.maxCount) {
91
- a == null || a(f.ExceedMaxCount);
94
+ }, L = () => {
95
+ if (a.value.length > e.maxCount) {
96
+ n == null || n(x.ExceedMaxCount);
92
97
  return;
93
98
  }
94
99
  if (e.getRowKey) {
95
- const t = F(r(n)), o = t.map(e.getRowKey);
96
- T("finish", o, t), u == null || u({ keys: o, rows: t });
100
+ const t = V(u(a)), o = t.map(e.getRowKey);
101
+ P("finish", o, t), c == null || c({ keys: o, rows: t });
97
102
  } else {
98
- a == null || a(f.NotFineGetRowKey);
103
+ n == null || n(x.NotFineGetRowKey);
99
104
  return;
100
105
  }
101
- s.value = !1;
102
- }, P = N(() => {
103
- if (e.getRowKey)
104
- return {
105
- fixed: !0,
106
- selectedRowKeys: n.value.map(e.getRowKey),
107
- columnWidth: 50,
108
- preserveSelectedRowKeys: !0,
109
- onChange: (t, o) => {
110
- if (o.length > e.maxCount) {
111
- U.warning(
112
- B("ap.apTableModal.messageMaxCount", { maxCount: e.maxCount })
106
+ i.value = !1;
107
+ }, A = U(() => {
108
+ if (!e.getRowKey) return;
109
+ const t = e.getRowKey;
110
+ return {
111
+ fixed: !0,
112
+ selectedRowKeys: a.value.map(t),
113
+ columnWidth: 50,
114
+ preserveSelectedRowKeys: !0,
115
+ onSelectAll(o, l) {
116
+ var s, p;
117
+ if (l.length > e.maxCount) {
118
+ h.warning(
119
+ g("ap.apTableModal.messageMaxCount", { maxCount: e.maxCount })
120
+ );
121
+ return;
122
+ }
123
+ const r = (s = d.value) == null ? void 0 : s.dataSource;
124
+ if (o) {
125
+ const f = u(r).filter((v) => !a.value.some((E) => t(E) === t(v)));
126
+ a.value = a.value.concat(f);
127
+ } else
128
+ a.value = (p = a.value) == null ? void 0 : p.filter((f) => !r.some((v) => t(v) === t(f)));
129
+ },
130
+ onSelect(o, l) {
131
+ if (l) {
132
+ if (a.value.length >= e.maxCount) {
133
+ h.warning(
134
+ g("ap.apTableModal.messageMaxCount", { maxCount: e.maxCount })
113
135
  );
114
136
  return;
115
137
  }
116
- n.value = o;
138
+ a.value.push(o);
139
+ } else {
140
+ const r = a.value.findIndex(
141
+ (s) => t(o) === t(s)
142
+ );
143
+ a.value.splice(r, 1);
117
144
  }
118
- };
119
- }), R = () => e.isRenderModalTitleSuffix ? O(
120
- V,
145
+ },
146
+ getCheckboxProps: (o) => ({
147
+ disabled: typeof e.disabledCheckbox == "function" ? e.disabledCheckbox(o, a.value) : e.disabledCheckbox
148
+ // Column configuration not to be checked
149
+ }),
150
+ ...e.rowSelection || {}
151
+ };
152
+ }), D = () => e.isRenderModalTitleSuffix ? q(
153
+ Q,
121
154
  {
122
155
  title: e.title,
123
- count: n.value.length || 0,
156
+ count: a.value.length || 0,
124
157
  maxCount: e.maxCount
125
158
  },
126
159
  {
127
160
  default: e.renderModalTitleSuffix ?? void 0
128
161
  }
129
- ) : e.title;
130
- return C({
131
- open: S,
132
- close: y,
133
- getApTableInstance: () => d.value
134
- }), (t, o) => (A(), D(r(q), g(
162
+ ) : e.title, N = () => d.value, O = () => {
163
+ a.value = [];
164
+ }, G = (t) => {
165
+ const o = e.getRowKey;
166
+ if (!o) return;
167
+ const l = a.value.findIndex(
168
+ (r) => o(t) === o(r)
169
+ );
170
+ a.value.splice(l, 1);
171
+ };
172
+ return R({
173
+ open: _,
174
+ close: w,
175
+ getApTableInstance: N
176
+ }), (t, o) => ($(), z(u(H), b(
135
177
  {
136
- onOk: M,
137
- onCancel: y,
138
- open: s.value,
139
- "onUpdate:open": o[0] || (o[0] = (l) => s.value = l)
178
+ onOk: L,
179
+ onCancel: w,
180
+ open: i.value,
181
+ "onUpdate:open": o[0] || (o[0] = (l) => i.value = l)
140
182
  },
141
- r(x)(e, [
183
+ u(S)(e, [
142
184
  "api",
143
185
  "getRowKey",
144
186
  "centered",
@@ -147,32 +189,45 @@ const le = /* @__PURE__ */ I({
147
189
  "maxCount",
148
190
  "title",
149
191
  "renderModalTitleSuffix",
150
- "isRenderModalTitleSuffix"
192
+ "isRenderModalTitleSuffix",
193
+ "rowSelection",
194
+ "disabledCheckbox",
195
+ "tableLayoutConfig"
151
196
  ]),
152
197
  {
153
- title: R(),
198
+ title: D(),
199
+ "body-style": { maxHeight: "calc(100vh - 205px)", overflowY: "scroll" },
154
200
  centered: e.centered ?? !0
155
201
  }
156
202
  ), {
157
- default: E(() => [
158
- L(r(W), g({
159
- scroll: { y: "100%" },
160
- style: { padding: "0px" },
161
- columns: t.columns,
162
- request: h,
163
- "row-key": t.getRowKey,
164
- "row-selection": P.value,
165
- bordered: r(k) === "admin"
166
- }, r(x)(e.apTableProps, "dataSource"), {
167
- ref_key: "apTableRef",
168
- ref: d,
169
- "data-source": p.value
170
- }), null, 16, ["columns", "row-key", "row-selection", "bordered", "data-source"])
203
+ default: k(() => [
204
+ T(X, b(e.tableLayoutConfig || {}, {
205
+ onClear: O,
206
+ "selected-list": a.value,
207
+ onDeleteItem: G
208
+ }), {
209
+ default: k(() => [
210
+ T(u(Z), b({
211
+ scroll: { y: "100%" },
212
+ style: { padding: "0px" },
213
+ columns: t.columns,
214
+ request: I,
215
+ "row-key": t.getRowKey,
216
+ "row-selection": A.value,
217
+ bordered: u(K) === "admin"
218
+ }, u(S)(e.apTableProps, "dataSource"), {
219
+ ref_key: "apTableRef",
220
+ ref: d,
221
+ "data-source": C.value
222
+ }), null, 16, ["columns", "row-key", "row-selection", "bordered", "data-source"])
223
+ ]),
224
+ _: 1
225
+ }, 16, ["selected-list"])
171
226
  ]),
172
227
  _: 1
173
228
  }, 16, ["open", "title", "centered"]));
174
229
  }
175
230
  });
176
231
  export {
177
- le as default
232
+ fe as default
178
233
  };
@@ -408,6 +408,7 @@ export declare const ConfigProvider: DefineComponent<{
408
408
  color: {
409
409
  font: string;
410
410
  active: string;
411
+ border: string;
411
412
  };
412
413
  };
413
414
  basic: {
@@ -59,6 +59,7 @@ declare const aplusCssVarObj: {
59
59
  color: {
60
60
  font: string;
61
61
  active: string;
62
+ border: string;
62
63
  };
63
64
  };
64
65
  basic: {
@@ -57,7 +57,8 @@ const F = {
57
57
  "ap-batch-action": {
58
58
  color: {
59
59
  font: "#8896B0",
60
- active: "#0070FF"
60
+ active: "#0070FF",
61
+ border: "#E9EDF3"
61
62
  }
62
63
  },
63
64
  basic: {
@@ -133,7 +134,8 @@ const F = {
133
134
  "ap-batch-action": {
134
135
  color: {
135
136
  font: "#999999",
136
- active: "#34B77C"
137
+ active: "#34B77C",
138
+ border: "#E9E9E9"
137
139
  }
138
140
  },
139
141
  basic: {
@@ -162,15 +164,15 @@ function s(e) {
162
164
  }
163
165
  return t(e, []), o;
164
166
  }
165
- const p = s(F), d = s(b);
167
+ const d = s(F), p = s(b);
166
168
  function u(e) {
167
169
  Object.entries(e).forEach(([o, t]) => {
168
170
  document.documentElement.style.setProperty(o, t);
169
171
  });
170
172
  }
171
173
  export {
172
- d as adminCssVar,
173
- p as aplusCssVar,
174
+ p as adminCssVar,
175
+ d as aplusCssVar,
174
176
  s as generateCssVar,
175
177
  u as setCSSVariables
176
178
  };
@@ -223,6 +223,7 @@ export declare const APConfigProvider: {
223
223
  color: {
224
224
  font: string;
225
225
  active: string;
226
+ border: string;
226
227
  };
227
228
  };
228
229
  basic: {
@@ -447,6 +448,7 @@ export declare const APConfigProvider: {
447
448
  color: {
448
449
  font: string;
449
450
  active: string;
451
+ border: string;
450
452
  };
451
453
  };
452
454
  basic: {
@@ -565,6 +567,7 @@ export declare const APConfigProvider: {
565
567
  color: {
566
568
  font: string;
567
569
  active: string;
570
+ border: string;
568
571
  };
569
572
  };
570
573
  basic: {
@@ -794,6 +797,7 @@ export declare const APConfigProvider: {
794
797
  color: {
795
798
  font: string;
796
799
  active: string;
800
+ border: string;
797
801
  };
798
802
  };
799
803
  basic: {
@@ -912,6 +916,7 @@ export declare const APConfigProvider: {
912
916
  color: {
913
917
  font: string;
914
918
  active: string;
919
+ border: string;
915
920
  };
916
921
  };
917
922
  basic: {
@@ -1180,6 +1185,7 @@ export declare const APConfigProvider: {
1180
1185
  color: {
1181
1186
  font: string;
1182
1187
  active: string;
1188
+ border: string;
1183
1189
  };
1184
1190
  };
1185
1191
  basic: {