@aplus-frontend/ui 0.6.0-beta.3 → 0.6.0-beta.5

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 (189) hide show
  1. package/es/src/ap-action/group/index.vue.d.ts +1 -1
  2. package/es/src/ap-action/item-dropdown/index.vue.d.ts +1 -1
  3. package/es/src/ap-field/date/index.vue.d.ts +1 -1
  4. package/es/src/ap-field/date-range/index.vue.d.ts +1 -1
  5. package/es/src/ap-field/number/index.vue.d.ts +1 -1
  6. package/es/src/ap-field/rate/index.vue.d.ts +1 -1
  7. package/es/src/ap-field/select/index.vue.d.ts +1 -1
  8. package/es/src/ap-field/tree-select/index.vue.d.ts +1 -1
  9. package/es/src/ap-form/item/index.vue.d.ts +1 -1
  10. package/es/src/ap-form/items/number/index.vue.d.ts +8 -8
  11. package/es/src/ap-form/items/select/index.vue.d.ts +8 -8
  12. package/es/src/ap-form/items/text/index.vue.d.ts +2 -2
  13. package/es/src/ap-form/items/text/password.vue.d.ts +2 -2
  14. package/es/src/ap-form/items/tree-select/index.vue.d.ts +8 -8
  15. package/es/src/ap-form/render/item.vue.d.ts +1 -1
  16. package/es/src/ap-grid/editable/form-item.vue.mjs +91 -83
  17. package/es/src/ap-grid/editable/index.vue.mjs +86 -78
  18. package/es/src/ap-grid/index.vue.mjs +39 -35
  19. package/es/src/ap-info-layout/ap-info-layout-admin/ApInfoLayoutAdmin.vue.d.ts +1 -1
  20. package/es/src/ap-table/ap-table.vue2.mjs +22 -18
  21. package/es/src/ap-table/constants.d.ts +30 -30
  22. package/es/src/ap-table/utils.d.ts +14 -14
  23. package/es/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +3 -3
  24. package/es/src/business/ap-expand-alert/ApExpandAlert.vue2.mjs +25 -25
  25. package/es/src/business/ap-expand-alert/index.d.ts +4 -4
  26. package/es/src/business/ap-label/ApLabel.d.ts +1 -1
  27. package/es/src/business/ap-label/index.d.ts +3 -3
  28. package/es/src/business/ap-ladder/ApLadder.d.ts +1 -1
  29. package/es/src/business/ap-ladder/index.d.ts +3 -3
  30. package/es/src/business/ap-status/interface.d.ts +1 -1
  31. package/es/src/business/ap-view/ap-view.vue2.mjs +60 -58
  32. package/es/src/business/ap-view/components/menu-list-content.vue2.mjs +79 -73
  33. package/es/src/business/ap-view/hooks/use-view-provide.d.ts +1 -0
  34. package/es/src/business/batch-input-group/form-item.vue.d.ts +1 -1
  35. package/es/src/business/batch-input-group/index.vue.d.ts +1 -1
  36. package/es/src/check-card/group.vue.d.ts +1 -1
  37. package/es/src/config-provider/config-provider-props.d.ts +0 -5
  38. package/es/src/config-provider/config-provider-props.mjs +0 -4
  39. package/es/src/config-provider/config-provider.d.ts +0 -138
  40. package/es/src/config-provider/config-provider.mjs +21 -26
  41. package/es/src/config-provider/hooks/use-global-config.d.ts +0 -5
  42. package/es/src/config-provider/index.d.ts +0 -652
  43. package/es/src/editable-table/form-item.vue.d.ts +2 -14
  44. package/es/src/editable-table/form-item.vue.mjs +84 -76
  45. package/es/src/editable-table/index.vue.d.ts +2 -16
  46. package/es/src/editable-table/index.vue.mjs +91 -83
  47. package/es/src/editable-table/interface.d.ts +7 -0
  48. package/lib/src/ap-action/group/index.vue.d.ts +1 -1
  49. package/lib/src/ap-action/item-dropdown/index.vue.d.ts +1 -1
  50. package/lib/src/ap-field/date/index.vue.d.ts +1 -1
  51. package/lib/src/ap-field/date-range/index.vue.d.ts +1 -1
  52. package/lib/src/ap-field/number/index.vue.d.ts +1 -1
  53. package/lib/src/ap-field/rate/index.vue.d.ts +1 -1
  54. package/lib/src/ap-field/select/index.vue.d.ts +1 -1
  55. package/lib/src/ap-field/tree-select/index.vue.d.ts +1 -1
  56. package/lib/src/ap-form/item/index.vue.d.ts +1 -1
  57. package/lib/src/ap-form/items/number/index.vue.d.ts +8 -8
  58. package/lib/src/ap-form/items/select/index.vue.d.ts +8 -8
  59. package/lib/src/ap-form/items/text/index.vue.d.ts +2 -2
  60. package/lib/src/ap-form/items/text/password.vue.d.ts +2 -2
  61. package/lib/src/ap-form/items/tree-select/index.vue.d.ts +8 -8
  62. package/lib/src/ap-form/render/item.vue.d.ts +1 -1
  63. package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
  64. package/lib/src/ap-grid/editable/index.vue.js +1 -1
  65. package/lib/src/ap-grid/index.vue.js +1 -1
  66. package/lib/src/ap-info-layout/ap-info-layout-admin/ApInfoLayoutAdmin.vue.d.ts +1 -1
  67. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  68. package/lib/src/ap-table/constants.d.ts +30 -30
  69. package/lib/src/ap-table/utils.d.ts +14 -14
  70. package/lib/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +3 -3
  71. package/lib/src/business/ap-expand-alert/ApExpandAlert.vue2.js +1 -1
  72. package/lib/src/business/ap-expand-alert/index.d.ts +4 -4
  73. package/lib/src/business/ap-label/ApLabel.d.ts +1 -1
  74. package/lib/src/business/ap-label/index.d.ts +3 -3
  75. package/lib/src/business/ap-ladder/ApLadder.d.ts +1 -1
  76. package/lib/src/business/ap-ladder/index.d.ts +3 -3
  77. package/lib/src/business/ap-status/interface.d.ts +1 -1
  78. package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
  79. package/lib/src/business/ap-view/components/menu-list-content.vue2.js +1 -1
  80. package/lib/src/business/ap-view/hooks/use-view-provide.d.ts +1 -0
  81. package/lib/src/business/batch-input-group/form-item.vue.d.ts +1 -1
  82. package/lib/src/business/batch-input-group/index.vue.d.ts +1 -1
  83. package/lib/src/check-card/group.vue.d.ts +1 -1
  84. package/lib/src/config-provider/config-provider-props.d.ts +0 -5
  85. package/lib/src/config-provider/config-provider-props.js +1 -1
  86. package/lib/src/config-provider/config-provider.d.ts +0 -138
  87. package/lib/src/config-provider/config-provider.js +1 -1
  88. package/lib/src/config-provider/hooks/use-global-config.d.ts +0 -5
  89. package/lib/src/config-provider/index.d.ts +0 -652
  90. package/lib/src/editable-table/form-item.vue.d.ts +2 -14
  91. package/lib/src/editable-table/form-item.vue.js +1 -1
  92. package/lib/src/editable-table/index.vue.d.ts +2 -16
  93. package/lib/src/editable-table/index.vue.js +1 -1
  94. package/lib/src/editable-table/interface.d.ts +7 -0
  95. package/package.json +1 -1
  96. package/theme/antd-global-overwrite/admin/index.css +3 -0
  97. package/theme/antd-global-overwrite/admin/index.less +1 -0
  98. package/theme/antd-global-overwrite/admin/tooltip.css +3 -0
  99. package/theme/antd-global-overwrite/admin/tooltip.less +3 -0
  100. package/theme/antd-global-overwrite/aplus/index.css +3 -0
  101. package/theme/antd-global-overwrite/aplus/index.less +1 -0
  102. package/theme/antd-global-overwrite/aplus/tooltip.css +3 -0
  103. package/theme/antd-global-overwrite/aplus/tooltip.less +3 -0
  104. package/theme/ap-action/item-dropdown.css +17 -0
  105. package/theme/ap-action/item.css +17 -0
  106. package/theme/ap-appendix/ap-appendix.css +17 -0
  107. package/theme/ap-attachment/ap-attachment.css +17 -0
  108. package/theme/ap-batch-action/ap-batch-action.css +17 -0
  109. package/theme/ap-button/ap-button.css +17 -0
  110. package/theme/ap-card/ap-card.css +17 -0
  111. package/theme/ap-descriptions/ap-descriptions.css +17 -0
  112. package/theme/ap-download/ap-download.css +17 -0
  113. package/theme/ap-expand-alert/ap-expand-alert.css +17 -0
  114. package/theme/ap-field/checkbox.css +17 -0
  115. package/theme/ap-field/index.css +17 -0
  116. package/theme/ap-field/number.css +17 -0
  117. package/theme/ap-field/radio.css +17 -0
  118. package/theme/ap-field/text-area.css +17 -0
  119. package/theme/ap-form/ap-form-item-group.css +17 -0
  120. package/theme/ap-form/ap-form-item.css +22 -2
  121. package/theme/ap-form/ap-form-item.less +9 -3
  122. package/theme/ap-form/drawer-form.css +17 -0
  123. package/theme/ap-form/index.css +22 -2
  124. package/theme/ap-form/item-text-group.css +17 -0
  125. package/theme/ap-form/item-text.css +17 -0
  126. package/theme/ap-form/modal-form.css +17 -0
  127. package/theme/ap-form/search-form-sorter.css +17 -0
  128. package/theme/ap-form/search-form.css +22 -2
  129. package/theme/ap-grid/editable.css +17 -0
  130. package/theme/ap-grid/index.css +39 -2
  131. package/theme/ap-grid/index.less +1 -0
  132. package/theme/ap-group-search/ap-extension-select.css +17 -0
  133. package/theme/ap-group-search/ap-group-search.css +17 -0
  134. package/theme/ap-group-search/ap-popover-select.css +17 -0
  135. package/theme/ap-image/ap-image.css +17 -0
  136. package/theme/ap-input-radio/ap-input-radio.css +17 -0
  137. package/theme/ap-label/ap-label.css +17 -0
  138. package/theme/ap-ladder/ap-ladder.css +17 -0
  139. package/theme/ap-layout/ap-info-layout.css +17 -0
  140. package/theme/ap-list/index.css +17 -0
  141. package/theme/ap-product-info/ap-product-info.css +17 -0
  142. package/theme/ap-select-layout/ap-select-layout.css +17 -0
  143. package/theme/ap-size-input/ap-size-input.css +17 -0
  144. package/theme/ap-status/ap-status.css +17 -0
  145. package/theme/ap-summary/index.css +17 -0
  146. package/theme/ap-table/ap-table-index.css +17 -0
  147. package/theme/ap-table/ap-table-paragraph-ellipsis.css +17 -0
  148. package/theme/ap-table/ap-table.css +39 -2
  149. package/theme/ap-table/ap-table.less +1 -0
  150. package/theme/ap-table/setting/index.css +17 -0
  151. package/theme/ap-table/setting/modal.css +17 -0
  152. package/theme/ap-table/setting/select-group.css +17 -0
  153. package/theme/ap-table/setting/sortable-item-meta.css +17 -0
  154. package/theme/ap-table/setting/sortable-item.css +17 -0
  155. package/theme/ap-table/setting/sorter.css +17 -0
  156. package/theme/ap-table-modal/index.css +39 -2
  157. package/theme/ap-tag/ap-tag-group.css +17 -0
  158. package/theme/ap-tag/ap-tag.css +18 -1
  159. package/theme/ap-tag/ap-tag.less +1 -1
  160. package/theme/ap-title/ap-title.css +17 -0
  161. package/theme/ap-upload/index.css +17 -0
  162. package/theme/ap-upload/multiple-file.css +17 -0
  163. package/theme/ap-upload/picture.css +17 -0
  164. package/theme/ap-upload/single-file.css +17 -0
  165. package/theme/ap-upload/upload.css +17 -0
  166. package/theme/ap-upload-single/index.css +17 -0
  167. package/theme/ap-view/ap-view.css +17 -0
  168. package/theme/batch-input-group/index.css +17 -0
  169. package/theme/batch-input-group/popover-input.css +17 -0
  170. package/theme/check-card/index.css +17 -0
  171. package/theme/editable-table/index.css +22 -2
  172. package/theme/full-screen/index.css +17 -0
  173. package/theme/index.css +149 -3
  174. package/theme/index.less +1 -0
  175. package/theme/mask/index.css +17 -0
  176. package/theme/mixins/mixins.css +17 -0
  177. package/theme/mixins/mixins.less +28 -0
  178. package/theme/scroll-bar/index.css +17 -0
  179. package/theme/scroll-view/index.css +17 -0
  180. package/theme/splitter/index.css +17 -0
  181. package/theme/text/group.css +17 -0
  182. package/theme/text/index.css +17 -0
  183. package/theme/ui-mode.css +92 -0
  184. package/theme/ui-mode.less +93 -0
  185. package/theme/work-order-modal/index.css +17 -0
  186. package/es/src/config-provider/css-var.d.ts +0 -139
  187. package/es/src/config-provider/css-var.mjs +0 -278
  188. package/lib/src/config-provider/css-var.d.ts +0 -139
  189. package/lib/src/config-provider/css-var.js +0 -1
@@ -1,20 +1,8 @@
1
- import { EditableColumnType, EditableTableFormItemProps } from './interface';
2
- import { StandardBehaviorOptions } from '../../node_modules/scroll-into-view-if-needed';
1
+ import { EditableColumnType, EditableTableFormItemExpose, EditableTableFormItemProps } from './interface';
3
2
  import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
4
- import { UnwrapRefSimple } from '@vue/reactivity';
5
3
  declare const _default: <RecordType = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
6
4
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & EditableTableFormItemProps<RecordType> & Partial<{}>> & PublicProps;
7
- expose(exposed: ShallowUnwrapRef<{
8
- add: (defaultValue?: any, insertIndex?: number) => void;
9
- remove: (index: number | number[]) => void;
10
- getRowData: (index: number) => RecordType | UnwrapRefSimple<RecordType>;
11
- getRowsData: () => RecordType[] | UnwrapRefSimple<RecordType>[];
12
- setRowData: (index: number, payload: any, merge?: boolean) => void;
13
- addMultiple: (list: number | Partial<RecordType>[], insetIn?: "prefix" | "suffix") => void;
14
- scrollTo: (index: number | "end", options?: StandardBehaviorOptions) => void;
15
- setTableData: (nextTableData: RecordType[]) => void;
16
- clear: () => void;
17
- }>): void;
5
+ expose(exposed: ShallowUnwrapRef<EditableTableFormItemExpose>): void;
18
6
  attrs: any;
19
7
  slots: Readonly<{
20
8
  default: any;
@@ -1,15 +1,15 @@
1
- import { defineComponent as O, ref as c, unref as s, useSlots as K, toRef as G, watch as H, nextTick as U, createBlock as W, openBlock as $, mergeProps as h, withCtx as x, createVNode as q, createSlots as J, renderList as Q, renderSlot as X, normalizeProps as Y, guardReactiveProps as Z } from "vue";
2
- import { Table as I } from "@aplus-frontend/antdv";
3
- import { ApForm as g } from "../ap-form/index.mjs";
4
- import { isArray as M, isUndefined as ee, isNumber as m, cloneDeep as oe, omit as w } from "lodash-unified";
1
+ import { defineComponent as G, ref as c, unref as s, useSlots as H, toRef as U, watch as W, nextTick as $, createBlock as q, openBlock as J, mergeProps as h, withCtx as w, createVNode as Q, createSlots as X, renderList as Y, renderSlot as Z, normalizeProps as I, guardReactiveProps as M } from "vue";
2
+ import { Table as ee } from "@aplus-frontend/antdv";
3
+ import { ApForm as x } from "../ap-form/index.mjs";
4
+ import { isArray as g, isUndefined as oe, isNumber as m, cloneDeep as te, omit as y } from "lodash-unified";
5
5
  import "../config-provider/index.mjs";
6
- import { useInjectForm as te } from "../ap-form/context.mjs";
6
+ import { useInjectForm as ae } from "../ap-form/context.mjs";
7
7
  import { isDef as b } from "../utils/index.mjs";
8
- import ae from "./hooks/use-get-columns.mjs";
9
- import { scrollToRowIndex as le } from "./utils.mjs";
8
+ import le from "./hooks/use-get-columns.mjs";
9
+ import { scrollToRowIndex as ue } from "./utils.mjs";
10
10
  import { useNamespace as ne } from "../config-provider/hooks/use-namespace.mjs";
11
- import { useGlobalConfig as ue } from "../config-provider/hooks/use-global-config.mjs";
12
- const we = /* @__PURE__ */ O({
11
+ import { useGlobalConfig as fe } from "../config-provider/hooks/use-global-config.mjs";
12
+ const ye = /* @__PURE__ */ G({
13
13
  name: "EditableTableInner",
14
14
  __name: "form-item",
15
15
  props: {
@@ -109,119 +109,127 @@ const we = /* @__PURE__ */ O({
109
109
  default: () => ({})
110
110
  }
111
111
  },
112
- setup(y, {
113
- expose: C
112
+ setup(C, {
113
+ expose: R
114
114
  }) {
115
- const l = y;
116
- function R(e, t) {
117
- return M(t) ? t.reduce((n, o) => n == null ? void 0 : n[o], e) : e == null ? void 0 : e[t];
115
+ const l = C;
116
+ function B(e, a) {
117
+ return g(a) ? a.reduce((u, t) => u == null ? void 0 : u[t], e) : e == null ? void 0 : e[a];
118
118
  }
119
119
  const {
120
- internalInstance: a,
121
- model: B
122
- } = te(), d = c(R(s(B), l.name) || []), F = K(), T = G(l, "name"), D = g.useWatch(T);
123
- H(() => D.value, async (e) => {
124
- var t;
125
- await U(), d.value = e, (t = l.onChange) == null || t.call(l, e);
120
+ internalInstance: o,
121
+ model: F
122
+ } = ae(), d = c(B(s(F), l.name) || []), T = H(), D = U(l, "name"), V = x.useWatch(D);
123
+ W(() => V.value, async (e) => {
124
+ var a;
125
+ await $(), d.value = e, (a = l.onChange) == null || a.call(l, e);
126
126
  }, {
127
127
  deep: !0
128
128
  });
129
129
  const {
130
130
  b: L
131
- } = ne("editable-table"), p = c(), V = ue("valueTypeMap"), N = ae(l, V);
132
- function S(e, t) {
133
- var u;
134
- const n = ((u = s(d)) == null ? void 0 : u.length) || 0;
135
- if (b(l.maxLength) && n >= l.maxLength)
131
+ } = ne("editable-table"), p = c(), S = fe("valueTypeMap"), v = le(l, S);
132
+ function N(e, a) {
133
+ var n;
134
+ const u = ((n = s(d)) == null ? void 0 : n.length) || 0;
135
+ if (b(l.maxLength) && u >= l.maxLength)
136
136
  return;
137
- const o = {
137
+ const t = {
138
138
  ...e || {}
139
139
  };
140
- a == null || a.setFieldValue(l.name, o, !0, (r, f) => {
141
- if (!r[f]) {
142
- r[f] = [o];
140
+ o == null || o.setFieldValue(l.name, t, !0, (f, r) => {
141
+ if (!f[r]) {
142
+ f[r] = [t];
143
143
  return;
144
144
  }
145
- ee(t) ? r[f].push(o) : r[f].splice(t, 0, o);
145
+ oe(a) ? f[r].push(t) : f[r].splice(a, 0, t);
146
146
  });
147
147
  }
148
- function k(e, t = "suffix") {
149
- var r;
150
- const n = ((r = s(d)) == null ? void 0 : r.length) || 0, o = m(e) ? e : e.length;
151
- if (b(l.maxLength) && n + o > l.maxLength)
148
+ function E(e, a = "suffix") {
149
+ var f;
150
+ const u = ((f = s(d)) == null ? void 0 : f.length) || 0, t = m(e) ? e : e.length;
151
+ if (b(l.maxLength) && u + t > l.maxLength)
152
152
  return;
153
- const u = m(e) ? new Array(e).fill(0).map(() => ({})) : oe(e);
154
- a == null || a.setFieldValue(l.name, u, !0, (f, i) => {
155
- if (!f[i]) {
156
- f[i] = [...u];
153
+ const n = m(e) ? new Array(e).fill(0).map(() => ({})) : te(e);
154
+ o == null || o.setFieldValue(l.name, n, !0, (r, i) => {
155
+ if (!r[i]) {
156
+ r[i] = [...n];
157
157
  return;
158
158
  }
159
- t === "suffix" ? f[i].push(...u) : f[i].unshift(...u);
159
+ a === "suffix" ? r[i].push(...n) : r[i].unshift(...n);
160
160
  });
161
161
  }
162
- function v(e) {
163
- const t = new Set(m(e) ? [e] : e);
164
- a == null || a.setFieldValue(l.name, void 0, !0, (n, o) => {
165
- n[o] = n[o].filter((u, r) => !t.has(r));
162
+ function _(e) {
163
+ const a = new Set(m(e) ? [e] : e);
164
+ o == null || o.setFieldValue(l.name, void 0, !0, (u, t) => {
165
+ u[t] = u[t].filter((n, f) => !a.has(f));
166
166
  });
167
167
  }
168
- function E() {
168
+ function k(e) {
169
+ var u;
170
+ const a = new Set(g(e) ? e : [e]);
171
+ a.size !== 0 && ((u = o == null ? void 0 : o.setFieldValue) == null || u.call(o, l.name, void 0, !0, (t, n) => {
172
+ t[n] = t[n].filter((f) => !a.has(f[l.rowKey]));
173
+ }));
174
+ }
175
+ function j() {
169
176
  return s(d);
170
177
  }
171
- function _(e) {
172
- var t;
173
- return (t = s(d)) == null ? void 0 : t[e];
178
+ function z(e) {
179
+ var a;
180
+ return (a = s(d)) == null ? void 0 : a[e];
174
181
  }
175
- function j(e, t, n = !0) {
176
- a == null || a.setFieldValue(l.name, void 0, !0, (o, u) => {
177
- !o[u] || !o[u][e] || (o[u][e] = {
178
- ...n ? o[u][e] : {},
179
- ...t
182
+ function K(e, a, u = !0) {
183
+ o == null || o.setFieldValue(l.name, void 0, !0, (t, n) => {
184
+ !t[n] || !t[n][e] || (t[n][e] = {
185
+ ...u ? t[n][e] : {},
186
+ ...a
180
187
  });
181
188
  });
182
189
  }
183
190
  function P(e) {
184
- a == null || a.setFieldValue(l.name, e);
191
+ o == null || o.setFieldValue(l.name, e);
185
192
  }
186
- function z(e, t) {
187
- var o;
188
- const n = e === "end" ? d.value.length - 1 : e;
189
- le(n, (o = p.value) == null ? void 0 : o.$el, t);
193
+ function A(e, a) {
194
+ var t;
195
+ const u = e === "end" ? d.value.length - 1 : e;
196
+ ue(u, (t = p.value) == null ? void 0 : t.$el, a);
190
197
  }
191
- function A() {
198
+ function O() {
192
199
  var e;
193
- (e = a == null ? void 0 : a.setFieldValue) == null || e.call(a, l.name, []);
200
+ (e = o == null ? void 0 : o.setFieldValue) == null || e.call(o, l.name, []);
194
201
  }
195
- return C({
196
- add: S,
197
- remove: v,
198
- getRowData: _,
199
- getRowsData: E,
200
- setRowData: j,
201
- addMultiple: k,
202
- scrollTo: z,
202
+ return R({
203
+ add: N,
204
+ remove: _,
205
+ getRowData: z,
206
+ getRowsData: j,
207
+ setRowData: K,
208
+ addMultiple: E,
209
+ scrollTo: A,
203
210
  setTableData: P,
204
- clear: A
205
- }), (e, t) => ($(), W(s(g).FormItem, h(e.formItem, {
211
+ clear: O,
212
+ removeByKey: k
213
+ }), (e, a) => (J(), q(s(x).FormItem, h(e.formItem, {
206
214
  name: e.name,
207
215
  label: e.label
208
216
  }), {
209
- default: x(() => [q(s(I), h(s(w)(l, ["name", "maxLength", "onChange"]), {
217
+ default: w(() => [Q(s(ee), h(s(y)(l, ["name", "maxLength", "onChange"]), {
210
218
  ref_key: "tableRef",
211
219
  ref: p,
212
220
  class: s(L)(),
213
- columns: s(N),
221
+ columns: s(v),
214
222
  "data-source": d.value
215
- }), J({
223
+ }), X({
216
224
  _: 2
217
- }, [Q(s(w)(F, ["headerCell"]), (n, o) => ({
218
- name: o,
219
- fn: x((u) => [X(e.$slots, o, Y(Z(u || {})))])
225
+ }, [Y(s(y)(T, ["headerCell"]), (u, t) => ({
226
+ name: t,
227
+ fn: w((n) => [Z(e.$slots, t, I(M(n || {})))])
220
228
  }))]), 1040, ["class", "columns", "data-source"])]),
221
229
  _: 3
222
230
  }, 16, ["name", "label"]));
223
231
  }
224
232
  });
225
233
  export {
226
- we as default
234
+ ye as default
227
235
  };
@@ -1,25 +1,11 @@
1
- import { EditableTableProps, EditableColumnType } from './interface';
2
- import { NamePath, ValidateOptions } from '@aplus-frontend/antdv/es/form/interface';
1
+ import { EditableTableProps, EditableColumnType, EditableTableExpose } from './interface';
3
2
  import { Recordable } from '../type';
4
- import { StandardBehaviorOptions } from '../../node_modules/scroll-into-view-if-needed';
5
3
  import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
6
4
  declare const _default: <RecordType extends Recordable = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
7
5
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
8
6
  readonly "onUpdate:value"?: ((...args: any[]) => any) | undefined;
9
7
  } & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, "onUpdate:value"> & EditableTableProps<RecordType> & Partial<{}>> & PublicProps;
10
- expose(exposed: ShallowUnwrapRef<{
11
- resetFields: () => void;
12
- validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<any>;
13
- add: (defaultValue?: Partial<RecordType>, insertIndex?: number) => void;
14
- remove: (index: number | number[]) => void;
15
- getRowData: (index: number) => RecordType;
16
- getRowsData: () => RecordType[];
17
- setRowData: (index: number, payload: any, merge?: boolean) => void;
18
- addMultiple: (list: number | Partial<RecordType>[], insetIn?: "prefix" | "suffix") => void;
19
- scrollTo: (index: number | "end", options?: StandardBehaviorOptions) => void;
20
- clear: () => void;
21
- setTableData: (nextTableData: RecordType[]) => void;
22
- }>): void;
8
+ expose(exposed: ShallowUnwrapRef<EditableTableExpose>): void;
23
9
  attrs: any;
24
10
  slots: Readonly<{
25
11
  default: any;
@@ -1,16 +1,16 @@
1
- import { defineComponent as $, useSlots as q, ref as w, watch as y, unref as s, createBlock as J, openBlock as Q, withCtx as h, createVNode as C, mergeProps as X, createSlots as Y, renderList as Z, renderSlot as M, normalizeProps as ee, guardReactiveProps as te } from "vue";
2
- import { Table as ae } from "@aplus-frontend/antdv";
1
+ import { defineComponent as q, useSlots as J, ref as y, watch as C, unref as r, createBlock as Q, openBlock as X, withCtx as h, createVNode as b, mergeProps as Y, createSlots as Z, renderList as M, renderSlot as ee, normalizeProps as te, guardReactiveProps as ae } from "vue";
2
+ import { Table as ne } from "@aplus-frontend/antdv";
3
3
  import { ApForm as x } from "../ap-form/index.mjs";
4
- import { isEqual as ne, isArray as b, isUndefined as oe, isNumber as g, cloneDeep as le, omit as R } from "lodash-unified";
4
+ import { isEqual as oe, isArray as v, isUndefined as le, isNumber as g, cloneDeep as ue, omit as R } from "lodash-unified";
5
5
  import "../config-provider/index.mjs";
6
6
  import "../hooks/index.mjs";
7
7
  import { isDef as F } from "../utils/index.mjs";
8
- import { scrollToRowIndex as ue } from "./utils.mjs";
9
- import se from "./hooks/use-get-columns.mjs";
10
- import { useNamespace as re } from "../config-provider/hooks/use-namespace.mjs";
11
- import { useControllableValue as ie } from "../hooks/useControllableValue.mjs";
8
+ import { scrollToRowIndex as se } from "./utils.mjs";
9
+ import re from "./hooks/use-get-columns.mjs";
10
+ import { useNamespace as ie } from "../config-provider/hooks/use-namespace.mjs";
11
+ import { useControllableValue as fe } from "../hooks/useControllableValue.mjs";
12
12
  import { useGlobalConfig as de } from "../config-provider/hooks/use-global-config.mjs";
13
- const Re = /* @__PURE__ */ $({
13
+ const Fe = /* @__PURE__ */ q({
14
14
  name: "EditableTable",
15
15
  __name: "index",
16
16
  props: {
@@ -113,137 +113,145 @@ const Re = /* @__PURE__ */ $({
113
113
  expose: V,
114
114
  emit: T
115
115
  }) {
116
- const n = B, {
117
- b: L
118
- } = re("editable-table"), _ = q(), D = T, v = w(), {
116
+ const o = B, {
117
+ b: D
118
+ } = ie("editable-table"), L = J(), S = T, w = y(), {
119
119
  value: m,
120
- updateValue: E
121
- } = ie(n, D), i = w(), N = de("valueTypeMap"), c = x.useWatch(n.name, i);
122
- y(() => c.value, (e) => {
120
+ updateValue: _
121
+ } = fe(o, S), i = y(), E = de("valueTypeMap"), c = x.useWatch(o.name, i);
122
+ C(() => c.value, (e) => {
123
123
  var t;
124
- E(e), (t = n.onChange) == null || t.call(n, e);
124
+ _(e), (t = o.onChange) == null || t.call(o, e);
125
125
  }, {
126
126
  deep: !0,
127
127
  flush: "post"
128
- }), y(m, (e) => {
128
+ }), C(m, (e) => {
129
129
  var t;
130
- e !== s(c) && (ne(e, s(c)) || (t = i.value) == null || t.setFieldValue(n.name, e));
130
+ e !== r(c) && (oe(e, r(c)) || (t = i.value) == null || t.setFieldValue(o.name, e));
131
131
  }, {
132
132
  deep: !0
133
133
  });
134
- const S = se(n, N);
134
+ const N = re(o, E);
135
135
  function k() {
136
136
  var e;
137
137
  (e = i.value) == null || e.resetFields();
138
138
  }
139
139
  function A(e) {
140
- return e ? (b(e) ? e : [e]).map((o) => b(o) ? [n.name, ...o] : [n.name, o]) : void 0;
140
+ return e ? (v(e) ? e : [e]).map((a) => v(a) ? [o.name, ...a] : [o.name, a]) : void 0;
141
141
  }
142
- async function I(e, t) {
143
- var a;
144
- const o = await ((a = i.value) == null ? void 0 : a.validateFields(A(e), t));
145
- return o == null ? void 0 : o[n.name];
142
+ async function z(e, t) {
143
+ var n;
144
+ const a = await ((n = i.value) == null ? void 0 : n.validateFields(A(e), t));
145
+ return a == null ? void 0 : a[o.name];
146
146
  }
147
- function P(e, t) {
148
- var l, u, r;
149
- const o = ((l = s(m)) == null ? void 0 : l.length) || 0;
150
- if (F(n.maxLength) && o >= n.maxLength)
147
+ function I(e, t) {
148
+ var l, u, s;
149
+ const a = ((l = r(m)) == null ? void 0 : l.length) || 0;
150
+ if (F(o.maxLength) && a >= o.maxLength)
151
151
  return;
152
- const a = {
152
+ const n = {
153
153
  ...e || {}
154
154
  };
155
- (r = (u = i.value) == null ? void 0 : u.setFieldValue) == null || r.call(u, n.name, a, !0, (d, f) => {
156
- if (!d[f]) {
157
- d[f] = [a];
155
+ (s = (u = i.value) == null ? void 0 : u.setFieldValue) == null || s.call(u, o.name, n, !0, (f, d) => {
156
+ if (!f[d]) {
157
+ f[d] = [n];
158
158
  return;
159
159
  }
160
- oe(t) ? d[f].push(a) : d[f].splice(t, 0, a);
160
+ le(t) ? f[d].push(n) : f[d].splice(t, 0, n);
161
161
  });
162
162
  }
163
- function j(e, t = "suffix") {
164
- var u, r, d;
165
- const o = ((u = s(m)) == null ? void 0 : u.length) || 0, a = g(e) ? e : e.length;
166
- if (F(n.maxLength) && o + a > n.maxLength)
163
+ function K(e, t = "suffix") {
164
+ var u, s, f;
165
+ const a = ((u = r(m)) == null ? void 0 : u.length) || 0, n = g(e) ? e : e.length;
166
+ if (F(o.maxLength) && a + n > o.maxLength)
167
167
  return;
168
- const l = g(e) ? new Array(e).fill(0).map(() => ({})) : le(e);
169
- (d = (r = i.value) == null ? void 0 : r.setFieldValue) == null || d.call(r, n.name, l, !0, (f, p) => {
170
- if (!f[p]) {
171
- f[p] = [...l];
168
+ const l = g(e) ? new Array(e).fill(0).map(() => ({})) : ue(e);
169
+ (f = (s = i.value) == null ? void 0 : s.setFieldValue) == null || f.call(s, o.name, l, !0, (d, p) => {
170
+ if (!d[p]) {
171
+ d[p] = [...l];
172
172
  return;
173
173
  }
174
- t === "suffix" ? f[p].push(...l) : f[p].unshift(...l);
174
+ t === "suffix" ? d[p].push(...l) : d[p].unshift(...l);
175
175
  });
176
176
  }
177
- function z(e) {
178
- var o, a;
177
+ function P(e) {
178
+ var a, n;
179
179
  const t = new Set(g(e) ? [e] : e);
180
- (a = (o = i.value) == null ? void 0 : o.setFieldValue) == null || a.call(o, n.name, void 0, !0, (l, u) => {
181
- l[u] = l[u].filter((r, d) => !t.has(d));
180
+ (n = (a = i.value) == null ? void 0 : a.setFieldValue) == null || n.call(a, o.name, void 0, !0, (l, u) => {
181
+ l[u] = l[u].filter((s, f) => !t.has(f));
182
182
  });
183
183
  }
184
+ function j(e) {
185
+ var a, n;
186
+ const t = new Set(v(e) ? e : [e]);
187
+ t.size !== 0 && ((n = (a = i.value) == null ? void 0 : a.setFieldValue) == null || n.call(a, o.name, void 0, !0, (l, u) => {
188
+ l[u] = l[u].filter((s) => !t.has(s[o.rowKey]));
189
+ }));
190
+ }
184
191
  function O() {
185
- return s(m);
192
+ return r(m);
186
193
  }
187
- function K(e) {
194
+ function U(e) {
188
195
  var t;
189
- (t = i.value) == null || t.setFieldValue(n.name, e);
196
+ (t = i.value) == null || t.setFieldValue(o.name, e);
190
197
  }
191
- function U(e) {
198
+ function G(e) {
192
199
  var t;
193
- return (t = s(m)) == null ? void 0 : t[e];
200
+ return (t = r(m)) == null ? void 0 : t[e];
194
201
  }
195
- function G(e, t, o = !0) {
196
- var a, l;
197
- (l = (a = i.value) == null ? void 0 : a.setFieldValue) == null || l.call(a, n.name, void 0, !0, (u, r) => {
198
- !u[r] || !u[r][e] || (u[r][e] = {
199
- ...o ? u[r][e] : {},
202
+ function H(e, t, a = !0) {
203
+ var n, l;
204
+ (l = (n = i.value) == null ? void 0 : n.setFieldValue) == null || l.call(n, o.name, void 0, !0, (u, s) => {
205
+ !u[s] || !u[s][e] || (u[s][e] = {
206
+ ...a ? u[s][e] : {},
200
207
  ...t
201
208
  });
202
209
  });
203
210
  }
204
- function H(e, t) {
205
- var a;
206
- const o = e === "end" ? m.value.length - 1 : e;
207
- ue(o, (a = v.value) == null ? void 0 : a.$el, t);
211
+ function W(e, t) {
212
+ var n;
213
+ const a = e === "end" ? m.value.length - 1 : e;
214
+ se(a, (n = w.value) == null ? void 0 : n.$el, t);
208
215
  }
209
- function W() {
216
+ function $() {
210
217
  var e, t;
211
- (t = (e = i.value) == null ? void 0 : e.setFieldValue) == null || t.call(e, n.name, []);
218
+ (t = (e = i.value) == null ? void 0 : e.setFieldValue) == null || t.call(e, o.name, []);
212
219
  }
213
220
  return V({
214
221
  resetFields: k,
215
- validateFields: I,
216
- add: P,
217
- remove: z,
218
- getRowData: U,
222
+ validateFields: z,
223
+ add: I,
224
+ remove: P,
225
+ getRowData: G,
219
226
  getRowsData: O,
220
- setRowData: G,
221
- addMultiple: j,
222
- scrollTo: H,
223
- clear: W,
224
- setTableData: K
225
- }), (e, t) => (Q(), J(s(x), {
227
+ setRowData: H,
228
+ addMultiple: K,
229
+ scrollTo: W,
230
+ clear: $,
231
+ setTableData: U,
232
+ removeByKey: j
233
+ }), (e, t) => (X(), Q(r(x), {
226
234
  ref_key: "formRef",
227
235
  ref: i,
228
236
  "initial-values": {
229
- [n.name]: s(m)
237
+ [o.name]: r(m)
230
238
  }
231
239
  }, {
232
- default: h(() => [C(s(x).FormItem, {
240
+ default: h(() => [b(r(x).FormItem, {
233
241
  name: e.name,
234
242
  "no-style": ""
235
243
  }, {
236
- default: h(() => [C(s(ae), X(s(R)(n, ["name", "value", "onUpdate:value", "maxLength", "onChange"]), {
244
+ default: h(() => [b(r(ne), Y(r(R)(o, ["name", "value", "onUpdate:value", "maxLength", "onChange"]), {
237
245
  ref_key: "tableRef",
238
- ref: v,
239
- class: s(L)(),
240
- columns: s(S),
241
- "data-source": s(m)
242
- }), Y({
246
+ ref: w,
247
+ class: r(D)(),
248
+ columns: r(N),
249
+ "data-source": r(m)
250
+ }), Z({
243
251
  _: 2
244
- }, [Z(s(R)(_, ["headerCell"]), (o, a) => ({
245
- name: a,
246
- fn: h((l) => [M(e.$slots, a, ee(te(l || {})))])
252
+ }, [M(r(R)(L, ["headerCell"]), (a, n) => ({
253
+ name: n,
254
+ fn: h((l) => [ee(e.$slots, n, te(ae(l || {})))])
247
255
  }))]), 1040, ["class", "columns", "data-source"])]),
248
256
  _: 3
249
257
  }, 8, ["name"])]),
@@ -252,5 +260,5 @@ const Re = /* @__PURE__ */ $({
252
260
  }
253
261
  });
254
262
  export {
255
- Re as default
263
+ Fe as default
256
264
  };
@@ -7,6 +7,7 @@ import { EllipsisConfig } from '@aplus-frontend/antdv/es/typography/Base';
7
7
  import { StandardBehaviorOptions } from '../../node_modules/scroll-into-view-if-needed';
8
8
  import { Recordable } from '../type';
9
9
  import { ApFormItemProps } from '../ap-form';
10
+ import { Key } from '@aplus-frontend/antdv/es/_util/type';
10
11
  export type EditableColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? Omit<ColumnType<RecordType>, 'children' | 'customRender' | 'ellipsis'> & {
11
12
  children?: EditableColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>[];
12
13
  /**
@@ -138,6 +139,12 @@ export type EditableTableExpose<ModelType = any, RecordType = any> = {
138
139
  * @returns
139
140
  */
140
141
  remove: (index: number | number[]) => void;
142
+ /**
143
+ * 通过key删除数据
144
+ * @param key
145
+ * @returns
146
+ */
147
+ removeByKey: (key: Key | Key[]) => void;
141
148
  /**
142
149
  * 清空所有数据
143
150
  * @returns
@@ -4,8 +4,8 @@ import { Trigger } from '@aplus-frontend/antdv/es/dropdown/props';
4
4
  import { GroupActionTypes } from '..';
5
5
  declare const _default: DefineComponent<ApActionGroupProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApActionGroupProps> & Readonly<{}>, {
6
6
  placement: "top" | "topLeft" | "bottom" | "topRight" | "bottomLeft" | "bottomRight" | "topCenter" | "bottomCenter";
7
- count: number;
8
7
  trigger: Trigger | Trigger[];
9
8
  actions: GroupActionTypes[];
9
+ count: number;
10
10
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
11
11
  export default _default;
@@ -16,8 +16,8 @@ declare const __VLS_component: DefineComponent<ApActionItemDropdownProps, {}, {}
16
16
  visible: boolean;
17
17
  color: ActionColor;
18
18
  disabled: boolean;
19
- trigger: Trigger | Trigger[];
20
19
  loading: boolean;
20
+ trigger: Trigger | Trigger[];
21
21
  actions: MixedActionTypes[];
22
22
  showIcon: boolean;
23
23
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
@@ -33,8 +33,8 @@ declare const __VLS_component: DefineComponent<ApFieldDateProps, {}, {}, {}, {},
33
33
  mode: FieldMode;
34
34
  open: boolean;
35
35
  disabled: boolean;
36
- bordered: boolean;
37
36
  autofocus: boolean;
37
+ bordered: boolean;
38
38
  format: LiteralUnion<ApFormatPresetType, string>;
39
39
  clearIcon: string | number | boolean | void | VNode<RendererNode, RendererElement, {
40
40
  [key: string]: any;
@@ -41,8 +41,8 @@ declare const __VLS_component: DefineComponent<ApFieldDateRangeProps, {}, {}, {}
41
41
  [key: string]: any;
42
42
  }> | null;
43
43
  disabled: boolean | [boolean, boolean];
44
- bordered: boolean;
45
44
  autofocus: boolean;
45
+ bordered: boolean;
46
46
  format: LiteralUnion<ApFormatPresetType, string>;
47
47
  clearIcon: string | number | boolean | void | VNode<RendererNode, RendererElement, {
48
48
  [key: string]: any;
@@ -353,8 +353,8 @@ declare const __VLS_component: DefineComponent<ApFieldNumberProps, {
353
353
  }>, {
354
354
  step: ValueType;
355
355
  disabled: boolean;
356
- bordered: boolean;
357
356
  keyboard: boolean;
357
+ bordered: boolean;
358
358
  max: ValueType;
359
359
  min: ValueType;
360
360
  controls: boolean;
@@ -109,9 +109,9 @@ declare const __VLS_component: DefineComponent<ApFieldRateProps, {
109
109
  }>, {
110
110
  mode: FieldMode;
111
111
  disabled: boolean;
112
- count: number;
113
112
  autofocus: boolean;
114
113
  allowClear: boolean;
114
+ count: number;
115
115
  allowHalf: boolean;
116
116
  character: any;
117
117
  }, {}, {}, {}, string, ComponentProvideOptions, false, {
@@ -449,9 +449,9 @@ declare const __VLS_component: DefineComponent<ApFieldSelectProps, {
449
449
  open: boolean;
450
450
  multiple: boolean;
451
451
  disabled: boolean;
452
- bordered: boolean;
453
452
  loading: boolean;
454
453
  autofocus: boolean;
454
+ bordered: boolean;
455
455
  virtual: boolean;
456
456
  lazy: boolean;
457
457
  allowClear: boolean;
@@ -593,9 +593,9 @@ declare const __VLS_component: DefineComponent<ApFieldTreeSelectProps, {
593
593
  open: boolean;
594
594
  multiple: boolean;
595
595
  disabled: boolean;
596
- bordered: boolean;
597
596
  loading: boolean;
598
597
  autofocus: boolean;
598
+ bordered: boolean;
599
599
  virtual: boolean;
600
600
  dropdownMatchSelectWidth: number | boolean;
601
601
  allowClear: boolean;