@aplus-frontend/ui 7.7.6 → 7.7.8

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 (51) hide show
  1. package/es/src/ag-grid/editable/form-item.vue.mjs +19 -16
  2. package/es/src/ag-grid/editable/index.vue.mjs +15 -12
  3. package/es/src/ag-grid/index.vue.mjs +1 -0
  4. package/es/src/ap-action/item/index.vue2.mjs +30 -31
  5. package/es/src/ap-action/style/index.d.ts +1 -0
  6. package/es/src/ap-action/style/index.mjs +63 -36
  7. package/es/src/ap-field/number/index.vue.d.ts +2 -0
  8. package/es/src/ap-field/number/index.vue.mjs +2 -2
  9. package/es/src/ap-field/tree-select/index.vue.d.ts +22 -0
  10. package/es/src/ap-field/tree-select/index.vue.mjs +12 -11
  11. package/es/src/ap-field/tree-select/read.vue2.mjs +1 -0
  12. package/es/src/ap-form/items/number/index.vue.d.ts +10 -2
  13. package/es/src/ap-form/items/tree-select/index.vue.d.ts +24 -0
  14. package/es/src/ap-form/style/item.mjs +6 -0
  15. package/es/src/ap-grid/editable/form-item.vue.mjs +51 -48
  16. package/es/src/ap-grid/editable/index.vue.mjs +59 -56
  17. package/es/src/ap-grid/index.vue.mjs +11 -10
  18. package/es/src/ap-table/ap-table.vue2.mjs +3 -0
  19. package/es/src/ap-table/constants.d.ts +17 -1
  20. package/es/src/business/batch-input-group/index.vue.mjs +63 -63
  21. package/es/src/design-token/index.mjs +4 -2
  22. package/es/src/editable-table/form-item.vue.mjs +33 -30
  23. package/es/src/editable-table/index.vue.mjs +13 -10
  24. package/es/src/version.d.ts +1 -1
  25. package/es/src/version.mjs +1 -1
  26. package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
  27. package/lib/src/ag-grid/editable/index.vue.js +1 -1
  28. package/lib/src/ag-grid/index.vue.js +1 -1
  29. package/lib/src/ap-action/item/index.vue2.js +1 -1
  30. package/lib/src/ap-action/style/index.d.ts +1 -0
  31. package/lib/src/ap-action/style/index.js +1 -1
  32. package/lib/src/ap-field/number/index.vue.d.ts +2 -0
  33. package/lib/src/ap-field/number/index.vue.js +1 -1
  34. package/lib/src/ap-field/tree-select/index.vue.d.ts +22 -0
  35. package/lib/src/ap-field/tree-select/index.vue.js +1 -1
  36. package/lib/src/ap-field/tree-select/read.vue2.js +1 -1
  37. package/lib/src/ap-form/items/number/index.vue.d.ts +10 -2
  38. package/lib/src/ap-form/items/tree-select/index.vue.d.ts +24 -0
  39. package/lib/src/ap-form/style/item.js +1 -1
  40. package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
  41. package/lib/src/ap-grid/editable/index.vue.js +1 -1
  42. package/lib/src/ap-grid/index.vue.js +1 -1
  43. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  44. package/lib/src/ap-table/constants.d.ts +17 -1
  45. package/lib/src/business/batch-input-group/index.vue.js +2 -2
  46. package/lib/src/design-token/index.js +1 -1
  47. package/lib/src/editable-table/form-item.vue.js +1 -1
  48. package/lib/src/editable-table/index.vue.js +1 -1
  49. package/lib/src/version.d.ts +1 -1
  50. package/lib/src/version.js +1 -1
  51. package/package.json +3 -3
@@ -603,6 +603,8 @@ export declare const apTableFormItemMap: {
603
603
  keyboard: boolean;
604
604
  bordered: boolean;
605
605
  emptyText: string;
606
+ changeOnWheel: boolean;
607
+ changeOnBlur: boolean;
606
608
  min: ValueType;
607
609
  max: ValueType;
608
610
  controls: boolean;
@@ -633,13 +635,15 @@ export declare const apTableFormItemMap: {
633
635
  keyboard: boolean;
634
636
  bordered: boolean;
635
637
  emptyText: string;
638
+ changeOnWheel: boolean;
639
+ changeOnBlur: boolean;
636
640
  min: ValueType;
637
641
  max: ValueType;
638
642
  controls: boolean;
639
643
  thousands: boolean;
640
644
  }> & Omit<Readonly< ApFieldNumberProps> & Readonly<{
641
645
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
642
- }>, "blur" | "focus" | ("step" | "disabled" | "keyboard" | "bordered" | "emptyText" | "min" | "max" | "controls" | "thousands")> & ShallowUnwrapRef<{
646
+ }>, "blur" | "focus" | ("step" | "disabled" | "keyboard" | "bordered" | "emptyText" | "changeOnWheel" | "changeOnBlur" | "min" | "max" | "controls" | "thousands")> & ShallowUnwrapRef<{
643
647
  focus: () => void;
644
648
  blur: () => void;
645
649
  }> & {} & ComponentCustomProperties & {} & {
@@ -2591,6 +2595,7 @@ export declare const apTableFormItemMap: {
2591
2595
  readonly replaceFields?: FieldNames | undefined;
2592
2596
  readonly 'onUpdate:treeExpandedKeys'?: ((keys: Key[]) => void) | undefined;
2593
2597
  readonly 'onUpdate:searchValue'?: ((value: string) => void) | undefined;
2598
+ readonly switcherLoadingIcon?: any;
2594
2599
  readonly filterTreeNode?: boolean | ((inputValue: string, treeNode: DefaultOptionType) => boolean) | undefined;
2595
2600
  readonly treeNodeFilterProp?: string | undefined;
2596
2601
  readonly treeNodeLabelProp?: string | undefined;
@@ -2668,6 +2673,10 @@ export declare const apTableFormItemMap: {
2668
2673
  type: PropType<"filled" | "outlined" | "borderless" | "underlined">;
2669
2674
  default: "filled" | "outlined" | "borderless" | "underlined";
2670
2675
  };
2676
+ switcherLoadingIcon: {
2677
+ default: any;
2678
+ type: PropType<any>;
2679
+ };
2671
2680
  value: {
2672
2681
  type: PropType<any>;
2673
2682
  };
@@ -2882,6 +2891,7 @@ export declare const apTableFormItemMap: {
2882
2891
  treeCheckStrictly: boolean;
2883
2892
  treeDataSimpleMode: any;
2884
2893
  treeDefaultExpandAll: boolean;
2894
+ switcherLoadingIcon: any;
2885
2895
  replaceFields: FieldNames;
2886
2896
  'onUpdate:treeExpandedKeys': (keys: Key[]) => void;
2887
2897
  'onUpdate:searchValue': (value: string) => void;
@@ -2898,6 +2908,7 @@ export declare const apTableFormItemMap: {
2898
2908
  tagRender?: any;
2899
2909
  suffixIcon?: any;
2900
2910
  clearIcon?: any;
2911
+ switcherLoadingIcon?: any;
2901
2912
  }>, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
2902
2913
  P: {};
2903
2914
  B: {};
@@ -2953,6 +2964,10 @@ export declare const apTableFormItemMap: {
2953
2964
  type: PropType<"filled" | "outlined" | "borderless" | "underlined">;
2954
2965
  default: "filled" | "outlined" | "borderless" | "underlined";
2955
2966
  };
2967
+ switcherLoadingIcon: {
2968
+ default: any;
2969
+ type: PropType<any>;
2970
+ };
2956
2971
  value: {
2957
2972
  type: PropType<any>;
2958
2973
  };
@@ -3167,6 +3182,7 @@ export declare const apTableFormItemMap: {
3167
3182
  treeCheckStrictly: boolean;
3168
3183
  treeDataSimpleMode: any;
3169
3184
  treeDefaultExpandAll: boolean;
3185
+ switcherLoadingIcon: any;
3170
3186
  replaceFields: FieldNames;
3171
3187
  'onUpdate:treeExpandedKeys': (keys: Key[]) => void;
3172
3188
  'onUpdate:searchValue': (value: string) => void;
@@ -1,22 +1,22 @@
1
- import { defineComponent as T, ref as h, computed as r, unref as t, createElementBlock as $, openBlock as g, normalizeStyle as B, normalizeClass as b, createVNode as c, withCtx as A, createBlock as K, createCommentVNode as M, mergeProps as D } from "vue";
1
+ import { defineComponent as $, ref as g, computed as r, unref as t, createElementBlock as K, openBlock as B, normalizeStyle as C, normalizeClass as b, createVNode as m, withCtx as A, createBlock as M, createCommentVNode as D, mergeProps as G } from "vue";
2
2
  import "../../ap-field/index.mjs";
3
- import { Space as G } from "@aplus-frontend/antdv";
3
+ import { Form as q, Space as H } from "@aplus-frontend/antdv";
4
4
  import "../../config-provider/index.mjs";
5
- import { isNumber as q, omit as H } from "lodash-unified";
5
+ import { isNumber as Y, omit as J } from "lodash-unified";
6
6
  import "./popover-input/index.vue.mjs";
7
7
  import "../../hooks/index.mjs";
8
8
  import "../../utils/index.mjs";
9
- import { useDefaultPlaceholder as Y } from "../../ap-field/hooks/use-default-placeholder.mjs";
10
- import { splitValue as J } from "./utils.mjs";
11
- import Q from "./style/index.mjs";
12
- import { useControllableValue as W } from "../../hooks/useControllableValue.mjs";
13
- import { useLocale as X } from "../../config-provider/hooks/use-locale.mjs";
14
- import { useNamespace as Z } from "../../config-provider/hooks/use-namespace.mjs";
15
- import { isDef as ee } from "../../utils/is.mjs";
16
- import te from "../../ap-field/select/index.vue.mjs";
17
- import { ApFieldText as oe } from "../../ap-field/text/index.mjs";
18
- import ne from "./popover-input/index.vue2.mjs";
19
- const m = "GROUP_SEARCH_ALL", Ve = /* @__PURE__ */ T({
9
+ import { useDefaultPlaceholder as Q } from "../../ap-field/hooks/use-default-placeholder.mjs";
10
+ import { splitValue as W } from "./utils.mjs";
11
+ import X from "./style/index.mjs";
12
+ import { useControllableValue as Z } from "../../hooks/useControllableValue.mjs";
13
+ import { useLocale as ee } from "../../config-provider/hooks/use-locale.mjs";
14
+ import { useNamespace as te } from "../../config-provider/hooks/use-namespace.mjs";
15
+ import { isDef as oe } from "../../utils/is.mjs";
16
+ import ne from "../../ap-field/select/index.vue.mjs";
17
+ import { ApFieldText as le } from "../../ap-field/text/index.mjs";
18
+ import ae from "./popover-input/index.vue2.mjs";
19
+ const d = "GROUP_SEARCH_ALL", Ve = /* @__PURE__ */ $({
20
20
  name: "BatchInputGroup",
21
21
  __name: "index",
22
22
  props: {
@@ -77,91 +77,91 @@ const m = "GROUP_SEARCH_ALL", Ve = /* @__PURE__ */ T({
77
77
  beforeInput: {}
78
78
  },
79
79
  emits: ["update:value"],
80
- setup(V, { emit: x }) {
81
- const o = V, C = Y("Text", o), S = x, { value: a, updateValue: u } = W(
80
+ setup(x, { emit: V }) {
81
+ const o = x, I = Q("Text", o), S = V, { value: a, updateValue: u } = Z(
82
82
  o,
83
83
  S
84
- ), s = h(), f = h(), { t: I } = X(), { b: k, cssVar: U } = Z("batch-input-group"), d = Q("batch-input-group"), w = r(() => {
84
+ ), i = g(), f = g(), { t: k } = ee(), { b: F, cssVar: U } = te("batch-input-group"), v = X("batch-input-group"), p = q.useInjectFormItemContext(), w = r(() => {
85
85
  const e = o.popoverPlacement;
86
86
  return {
87
- "popover-left": q(e) ? `${e}px` : e === "left" ? "0px" : "unset",
87
+ "popover-left": Y(e) ? `${e}px` : e === "left" ? "0px" : "unset",
88
88
  "popover-right": e === "right" ? "0px" : "unset"
89
89
  };
90
90
  }), P = r(() => o.options ? o.options.length > 1 && o.hasAll ? [
91
- { value: m, label: I("ap.common.all") },
91
+ { value: d, label: k("ap.common.all") },
92
92
  ...o.options
93
- ] : o.options : []), R = r(() => o.options ? o.options.map((e) => e.value) : []), N = r(() => t(a)?.value?.length ? t(a).value.join(",") : ""), j = r(() => t(a)?.value?.length ? t(a).value.join(`
93
+ ] : o.options : []), R = r(() => o.options ? o.options.map((e) => e.value) : []), j = r(() => t(a)?.value?.length ? t(a).value.join(",") : ""), N = r(() => t(a)?.value?.length ? t(a).value.join(`
94
94
  `) : ""), E = r(() => {
95
95
  const e = t(a)?.key;
96
96
  if (e?.length)
97
- return e.length === 1 || !o.hasAll ? e[0] : m;
98
- }), F = r(() => {
97
+ return e.length === 1 || !o.hasAll ? e[0] : d;
98
+ }), L = r(() => {
99
99
  const e = t(a)?.key;
100
- return !e || e?.length <= 1 ? t(C) : (o.options || []).filter((n) => e.includes(n.value)).map((n) => n.label).join("/");
100
+ return !e || e?.length <= 1 ? t(I) : (o.options || []).filter((n) => e.includes(n.value)).map((n) => n.label).join("/");
101
101
  });
102
- function L(e) {
103
- const l = t(a) || {}, n = e === m ? t(R) : ee(e) ? [e] : [];
102
+ function O(e) {
103
+ const l = t(a) || {}, n = e === d ? t(R) : oe(e) ? [e] : [];
104
104
  u({
105
105
  ...l,
106
106
  key: n
107
- });
107
+ }), p.onFieldChange();
108
108
  }
109
- function O(e) {
109
+ function _(e) {
110
110
  const l = t(a) || {}, n = e.target.value || "";
111
- let i = J(n, ",", ",", o.maxNum);
112
- if (n !== i) {
113
- const y = f.value?.$el?.querySelector("input");
114
- y && (y.value = i);
111
+ let c = W(n, ",", ",", o.maxNum);
112
+ if (n !== c) {
113
+ const h = f.value?.$el?.querySelector("input");
114
+ h && (h.value = c);
115
115
  }
116
- let p = i.split(",");
117
- p.length === 1 && p[0] === "" && (p = []), u({
116
+ let s = c.split(",");
117
+ s.length === 1 && s[0] === "" && (s = []), u({
118
118
  ...l,
119
- value: p
120
- });
119
+ value: s
120
+ }), p.onFieldChange();
121
121
  }
122
- function _(e) {
122
+ function z(e) {
123
123
  const l = t(a) || {};
124
124
  let n = e.split(/,|\n/);
125
125
  u({
126
126
  ...l,
127
127
  value: n
128
- });
128
+ }), p.onFieldChange();
129
129
  }
130
- function v() {
130
+ function y() {
131
131
  const e = t(a) || {}, l = e.value?.filter(Boolean);
132
132
  u({
133
133
  ...e,
134
134
  value: l
135
- });
135
+ }), p.onFieldChange();
136
136
  }
137
- function z(e) {
138
- v(), o.onBlur?.(e);
137
+ function T(e) {
138
+ y(), o.onBlur?.(e);
139
139
  }
140
- return (e, l) => (g(), $("div", {
140
+ return (e, l) => (B(), K("div", {
141
141
  ref_key: "containerRef",
142
- ref: s,
143
- class: b([t(k)(), t(d)]),
144
- style: B(t(U)(w.value)),
142
+ ref: i,
143
+ class: b([t(F)(), t(v)]),
144
+ style: C(t(U)(w.value)),
145
145
  onFocus: l[0] || (l[0] = //@ts-ignore
146
146
  (...n) => e.onFocus && e.onFocus(...n)),
147
147
  onBlur: l[1] || (l[1] = //@ts-ignore
148
148
  (...n) => e.onBlur && e.onBlur(...n))
149
149
  }, [
150
- c(t(G).Compact, { block: "" }, {
150
+ m(t(H).Compact, { block: "" }, {
151
151
  default: A(() => [
152
- e.options?.length ? (g(), K(t(te), {
152
+ e.options?.length ? (B(), M(t(ne), {
153
153
  key: 0,
154
- style: B(e.style),
154
+ style: C(e.style),
155
155
  options: P.value,
156
156
  value: E.value,
157
157
  "allow-clear": !1,
158
158
  "dropdown-match-select-width": !1,
159
159
  disabled: e.disabled,
160
- "get-popup-container": () => s.value,
161
- "onUpdate:value": L
162
- }, null, 8, ["style", "options", "value", "disabled", "get-popup-container"])) : M("", !0),
163
- c(t(oe), D(
164
- t(H)(o, [
160
+ "get-popup-container": () => i.value,
161
+ "onUpdate:value": O
162
+ }, null, 8, ["style", "options", "value", "disabled", "get-popup-container"])) : D("", !0),
163
+ m(t(le), G(
164
+ t(J)(o, [
165
165
  "style",
166
166
  "value",
167
167
  "onUpdate:value",
@@ -174,22 +174,22 @@ const m = "GROUP_SEARCH_ALL", Ve = /* @__PURE__ */ T({
174
174
  ref_key: "inputRef",
175
175
  ref: f,
176
176
  style: e.inputStyle,
177
- value: N.value,
178
- placeholder: F.value,
179
- onInput: O,
180
- onBlur: z
177
+ value: j.value,
178
+ placeholder: L.value,
179
+ onInput: _,
180
+ onBlur: T
181
181
  }
182
182
  ), {
183
183
  suffix: A(() => [
184
- c(ne, {
185
- _parent: s.value,
186
- value: j.value,
184
+ m(ae, {
185
+ _parent: i.value,
186
+ value: N.value,
187
187
  disabled: e.disabled,
188
188
  placement: o.popoverPlacement,
189
189
  "max-num": e.maxNum,
190
- class: b(t(d)),
191
- "onUpdate:value": _,
192
- onClose: v
190
+ class: b(t(v)),
191
+ "onUpdate:value": z,
192
+ onClose: y
193
193
  }, null, 8, ["_parent", "value", "disabled", "placement", "max-num", "class"])
194
194
  ]),
195
195
  _: 1
@@ -39,7 +39,8 @@ const o = {
39
39
  colorBgSpotlight: "#000000cc",
40
40
  controlItemBgActive: "#F5F9FF",
41
41
  controlItemBgActiveHover: "#EAF2FF",
42
- colorBorderSecondary: "#E9EDF3"
42
+ colorBorderSecondary: "#E9EDF3",
43
+ controlHeight: 30
43
44
  }, c = {
44
45
  ...o,
45
46
  // 主色
@@ -73,7 +74,8 @@ const o = {
73
74
  colorBgSpotlight: "#000000cc",
74
75
  controlItemBgActive: "#f3fbf7",
75
76
  controlItemBgActiveHover: "#e6f6ef",
76
- colorBorderSecondary: "#E9E9E9"
77
+ colorBorderSecondary: "#E9E9E9",
78
+ controlHeight: 30
77
79
  };
78
80
  export {
79
81
  c as adminToken,
@@ -1,4 +1,4 @@
1
- import { defineComponent as z, ref as A, unref as s, useSlots as K, toRef as O, watch as G, nextTick as W, shallowRef as H, createBlock as U, openBlock as $, mergeProps as p, withCtx as c, createVNode as q, createSlots as J, renderList as Q, renderSlot as X, normalizeProps as Y, guardReactiveProps as Z } from "vue";
1
+ import { defineComponent as z, ref as A, unref as r, useSlots as K, toRef as O, watch as G, nextTick as H, shallowRef as W, createBlock as U, openBlock as $, mergeProps as p, withCtx as c, createVNode as q, createSlots as J, renderList as Q, renderSlot as X, normalizeProps as Y, guardReactiveProps as Z } from "vue";
2
2
  import { Table as M } from "@aplus-frontend/antdv";
3
3
  import { ApForm as h } from "../ap-form/index.mjs";
4
4
  import { isUndefined as ee, isNumber as d, cloneDeep as te, isArray as ae, omit as b } from "lodash-unified";
@@ -7,13 +7,13 @@ import { useInjectForm as oe } from "../ap-form/context.mjs";
7
7
  import "../utils/index.mjs";
8
8
  import ne from "./hooks/use-get-columns.mjs";
9
9
  import { scrollToRowIndex as le } from "./utils.mjs";
10
- import { getModelValue as se } from "../ap-form/utils/get.mjs";
11
- import { useDevWarning as re } from "../utils/warning.mjs";
10
+ import { getModelValue as re } from "../ap-form/utils/get.mjs";
11
+ import { useDevWarning as se } from "../utils/warning.mjs";
12
12
  import ie from "./style/index.mjs";
13
13
  import { useNamespace as ue } from "../config-provider/hooks/use-namespace.mjs";
14
14
  import { useGlobalConfig as fe } from "../config-provider/hooks/use-global-config.mjs";
15
15
  import { isDef as g } from "../utils/is.mjs";
16
- const ve = /* @__PURE__ */ z({
16
+ const Te = /* @__PURE__ */ z({
17
17
  name: "EditableTableFormItem",
18
18
  __name: "form-item",
19
19
  props: {
@@ -101,6 +101,9 @@ const ve = /* @__PURE__ */ z({
101
101
  type: [Boolean, Object]
102
102
  },
103
103
  transformCellText: {},
104
+ rowHoverable: {
105
+ type: Boolean
106
+ },
104
107
  columns: {},
105
108
  value: {},
106
109
  defaultValue: {},
@@ -115,54 +118,54 @@ const ve = /* @__PURE__ */ z({
115
118
  }
116
119
  },
117
120
  setup(w, {
118
- expose: x
121
+ expose: y
119
122
  }) {
120
123
  const o = w;
121
- re("EditableTableFormItem")(!1, "breaking", "EditableTableFormItem has been EOL, Please use EditableAgGridFormItem(https://aplus.aplnk.com/aplus-ui/components/ag-grid/editable/) instead.");
124
+ se("EditableTableFormItem")(!1, "breaking", "EditableTableFormItem has been EOL, Please use EditableAgGridFormItem(https://aplus.aplnk.com/aplus-ui/components/ag-grid/editable/) instead.");
122
125
  const {
123
126
  internalInstance: i,
124
- model: y
125
- } = oe(), u = A(se(s(y), o.name) || []), C = K(), R = O(o, "name"), F = h.useWatch(R);
127
+ model: x
128
+ } = oe(), u = A(re(r(x), o.name) || []), C = K(), R = O(o, "name"), F = h.useWatch(R);
126
129
  G(() => F.value, async (e) => {
127
- await W(), u.value = e, o.onChange?.(e);
130
+ await H(), u.value = e, o.onChange?.(e);
128
131
  }, {
129
132
  deep: !0
130
133
  });
131
134
  const {
132
135
  b: B
133
- } = ue("editable-table"), I = ie("editable-table"), m = H(), T = fe("valueTypeMap"), v = ne(o, T);
136
+ } = ue("editable-table"), v = ie("editable-table"), m = W(), I = fe("valueTypeMap"), T = ne(o, I);
134
137
  function D(e, n) {
135
- const l = s(u)?.length || 0;
138
+ const l = r(u)?.length || 0;
136
139
  if (g(o.maxLength) && l >= o.maxLength)
137
140
  return;
138
141
  const t = {
139
142
  ...e || {}
140
143
  };
141
- i?.setFieldValue(o.name, t, !0, (a, r) => {
142
- if (!a[r]) {
143
- a[r] = [t];
144
+ i?.setFieldValue(o.name, t, !0, (a, s) => {
145
+ if (!a[s]) {
146
+ a[s] = [t];
144
147
  return;
145
148
  }
146
- ee(n) ? a[r].push(t) : a[r].splice(n, 0, t);
149
+ ee(n) ? a[s].push(t) : a[s].splice(n, 0, t);
147
150
  });
148
151
  }
149
152
  function E(e, n = "suffix") {
150
- const l = s(u)?.length || 0, t = d(e) ? e : e.length;
153
+ const l = r(u)?.length || 0, t = d(e) ? e : e.length;
151
154
  if (g(o.maxLength) && l + t > o.maxLength)
152
155
  return;
153
156
  const a = d(e) ? new Array(e).fill(0).map(() => ({})) : te(e);
154
- i?.setFieldValue(o.name, a, !0, (r, f) => {
155
- if (!r[f]) {
156
- r[f] = [...a];
157
+ i?.setFieldValue(o.name, a, !0, (s, f) => {
158
+ if (!s[f]) {
159
+ s[f] = [...a];
157
160
  return;
158
161
  }
159
- n === "suffix" ? r[f].push(...a) : r[f].unshift(...a);
162
+ n === "suffix" ? s[f].push(...a) : s[f].unshift(...a);
160
163
  });
161
164
  }
162
165
  function S(e) {
163
166
  const n = new Set(d(e) ? [e] : e);
164
167
  i?.setFieldValue(o.name, void 0, !0, (l, t) => {
165
- l[t] = l[t].filter((a, r) => !n.has(r));
168
+ l[t] = l[t].filter((a, s) => !n.has(s));
166
169
  });
167
170
  }
168
171
  function L(e) {
@@ -172,10 +175,10 @@ const ve = /* @__PURE__ */ z({
172
175
  });
173
176
  }
174
177
  function V() {
175
- return s(u);
178
+ return r(u);
176
179
  }
177
180
  function k(e) {
178
- return s(u)?.[e];
181
+ return r(u)?.[e];
179
182
  }
180
183
  function N(e, n, l = !0) {
181
184
  i?.setFieldValue(o.name, void 0, !0, (t, a) => {
@@ -195,7 +198,7 @@ const ve = /* @__PURE__ */ z({
195
198
  function j() {
196
199
  i?.setFieldValue?.(o.name, []);
197
200
  }
198
- return x({
201
+ return y({
199
202
  add: D,
200
203
  remove: S,
201
204
  getRowData: k,
@@ -206,19 +209,19 @@ const ve = /* @__PURE__ */ z({
206
209
  setTableData: _,
207
210
  clear: j,
208
211
  removeByKey: L
209
- }), (e, n) => ($(), U(s(h).FormItem, p(e.formItem, {
212
+ }), (e, n) => ($(), U(r(h).FormItem, p(e.formItem, {
210
213
  name: e.name,
211
214
  label: e.label
212
215
  }), {
213
- default: c(() => [q(s(M), p(s(b)(o, ["name", "maxLength", "onChange"]), {
216
+ default: c(() => [q(r(M), p(r(b)(o, ["name", "maxLength", "onChange"]), {
214
217
  ref_key: "tableRef",
215
218
  ref: m,
216
- class: [s(B)(), s(I)],
217
- columns: s(v),
219
+ class: [r(B)(), r(v)],
220
+ columns: r(T),
218
221
  "data-source": u.value
219
222
  }), J({
220
223
  _: 2
221
- }, [Q(s(b)(C, ["headerCell"]), (l, t) => ({
224
+ }, [Q(r(b)(C, ["headerCell"]), (l, t) => ({
222
225
  name: t,
223
226
  fn: c((a) => [X(e.$slots, t, Y(Z(a || {})))])
224
227
  }))]), 1040, ["class", "columns", "data-source"])]),
@@ -227,5 +230,5 @@ const ve = /* @__PURE__ */ z({
227
230
  }
228
231
  });
229
232
  export {
230
- ve as default
233
+ Te as default
231
234
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as W, useSlots as H, shallowRef as $, ref as q, watch as b, unref as s, createBlock as J, openBlock as Q, withCtx as p, createVNode as w, mergeProps as X, createSlots as Y, renderList as Z, renderSlot as M, normalizeProps as ee, guardReactiveProps as te } from "vue";
1
+ import { defineComponent as U, useSlots as W, shallowRef as $, ref as q, watch as b, unref as s, createBlock as J, openBlock as Q, withCtx as p, createVNode as w, mergeProps as X, createSlots as Y, renderList as Z, renderSlot as M, normalizeProps as ee, guardReactiveProps as te } from "vue";
2
2
  import { Table as ae } from "@aplus-frontend/antdv";
3
3
  import { ApForm as m } from "../ap-form/index.mjs";
4
4
  import { isEqual as ne, isArray as c, isUndefined as oe, isNumber as h, cloneDeep as le, omit as v } from "lodash-unified";
@@ -12,8 +12,8 @@ import ie from "./style/index.mjs";
12
12
  import { useNamespace as de } from "../config-provider/hooks/use-namespace.mjs";
13
13
  import { useControllableValue as fe } from "../hooks/useControllableValue.mjs";
14
14
  import { useGlobalConfig as pe } from "../config-provider/hooks/use-global-config.mjs";
15
- import { isDef as x } from "../utils/is.mjs";
16
- const Se = /* @__PURE__ */ W({
15
+ import { isDef as y } from "../utils/is.mjs";
16
+ const Se = /* @__PURE__ */ U({
17
17
  name: "EditableTable",
18
18
  __name: "index",
19
19
  props: {
@@ -101,6 +101,9 @@ const Se = /* @__PURE__ */ W({
101
101
  type: [Boolean, Object]
102
102
  },
103
103
  transformCellText: {},
104
+ rowHoverable: {
105
+ type: Boolean
106
+ },
104
107
  columns: {},
105
108
  value: {},
106
109
  defaultValue: {},
@@ -113,15 +116,15 @@ const Se = /* @__PURE__ */ W({
113
116
  onFieldChange: {}
114
117
  },
115
118
  emits: ["update:value"],
116
- setup(y, {
119
+ setup(x, {
117
120
  expose: C,
118
121
  emit: R
119
122
  }) {
120
- const t = y;
123
+ const t = x;
121
124
  ue("EditableTable")(!1, "breaking", "EditableTable has been EOL, Please use EditableAgGrid(https://aplus.aplnk.com/aplus-ui/components/ag-grid/editable/) instead.");
122
125
  const {
123
126
  b: F
124
- } = de("editable-table"), B = ie("editable-table"), T = H(), E = R, g = $(), {
127
+ } = de("editable-table"), B = ie("editable-table"), T = W(), E = R, g = $(), {
125
128
  value: i,
126
129
  updateValue: V
127
130
  } = fe(t, E), r = q(), S = pe("valueTypeMap"), f = m.useWatch(t.name, r);
@@ -147,7 +150,7 @@ const Se = /* @__PURE__ */ W({
147
150
  }
148
151
  function N(e, l) {
149
152
  const n = s(i)?.length || 0;
150
- if (x(t.maxLength) && n >= t.maxLength)
153
+ if (y(t.maxLength) && n >= t.maxLength)
151
154
  return;
152
155
  const a = {
153
156
  ...e || {}
@@ -162,7 +165,7 @@ const Se = /* @__PURE__ */ W({
162
165
  }
163
166
  function A(e, l = "suffix") {
164
167
  const n = s(i)?.length || 0, a = h(e) ? e : e.length;
165
- if (x(t.maxLength) && n + a > t.maxLength)
168
+ if (y(t.maxLength) && n + a > t.maxLength)
166
169
  return;
167
170
  const o = h(e) ? new Array(e).fill(0).map(() => ({})) : le(e);
168
171
  r.value?.setFieldValue?.(t.name, o, !0, (u, d) => {
@@ -206,7 +209,7 @@ const Se = /* @__PURE__ */ W({
206
209
  const n = e === "end" ? i.value.length - 1 : e;
207
210
  se(n, g.value?.$el, l);
208
211
  }
209
- function U() {
212
+ function H() {
210
213
  r.value?.setFieldValue?.(t.name, []);
211
214
  }
212
215
  return C({
@@ -219,7 +222,7 @@ const Se = /* @__PURE__ */ W({
219
222
  setRowData: j,
220
223
  addMultiple: A,
221
224
  scrollTo: G,
222
- clear: U,
225
+ clear: H,
223
226
  setTableData: K,
224
227
  removeByKey: P
225
228
  }), (e, l) => (Q(), J(s(m), {
@@ -1,2 +1,2 @@
1
- declare const _default: "7.7.6";
1
+ declare const _default: "7.7.8";
2
2
  export default _default;
@@ -1,4 +1,4 @@
1
- const e = "7.7.6";
1
+ const e = "7.7.8";
2
2
  export {
3
3
  e as default
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),w=require("../../ap-form/index.js"),s=require("lodash-unified");require("../../config-provider/index.js");const D=require("../hooks/use-editable-columns.js");require("../index.vue2.js");const P=require("../hooks/use-editable-form-item-api.js"),k=require("../../ap-form/context.js"),L=require("../../ap-form/utils/get.js"),M=require("../utils.js"),O=require("../../ap-form/hooks/use-watch.js"),z=require("./utils.js"),G=require("../style/editable.js"),H=require("../../config-provider/hooks/use-namespace.js"),K=require("../../config-provider/hooks/use-global-config.js"),W=require("../index.vue.js"),U=e.defineComponent({name:"EditableGrid",__name:"form-item",props:{dropdownPrefixCls:{},bordered:{type:Boolean},locale:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{},showSorterTooltip:{type:[Boolean,Object]},prefixCls:{},rowKey:{type:[String,Function],default:"key"},tableLayout:{},title:{},id:{},showHeader:{type:Boolean},components:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean]},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean},indentSize:{},expandIconColumnIndex:{},showExpandColumn:{type:Boolean},expandedRowClassName:{},childrenColumnName:{},rowExpandable:{},transformCellText:{},rowSelection:{type:[Boolean,Object]},onLoadingChange:{},onShownColumnsChange:{},pagination:{type:[Boolean,Object],default:!1},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},tableStyle:{},adaptive:{type:Boolean},columnResizable:{type:Boolean,default:!1},loading:{type:Boolean,default:void 0},summary:{},rowHeight:{default:66},getRowHeight:{},advanceRenderer:{type:Boolean},browserTooltips:{type:Boolean},virtual:{type:[Boolean,Object],default:void 0},onRowClicked:{},onScrollEnd:{},rowClassName:{},rowClassRules:{},autoHeight:{type:Boolean},onUpdate:{},customRow:{},theme:{},columns:{},defaultValue:{},onChange:{},maxLength:{},onFieldChange:{},label:{},name:{},formItem:{}},setup(h,{expose:y}){const b=e.useSlots(),t=h,{b:C}=H.useNamespace("editable-aggrid"),R=G.default("editable-aggrid"),r=e.ref(),{internalInstance:u,model:v}=k.useInjectForm(),i=M.getShadowName(t.name);let c;e.onMounted(()=>{const o=t.formItem?.initialValue??L.getModelValue(e.unref(v),t.name);c=s.cloneDeep(o),m(o,"suffix")});const l=e.ref([]),x=O.useWatch(t.name);e.watch(()=>x.value,o=>{s.isEqual(o,l.value)||p(o??c)},{deep:!0});const B=K.useGlobalConfig("valueTypeMap"),q=D.useGetEditableColumns(t,B,i),{add:S,addMultiple:m,remove:_,removeByKey:I,getRowData:E,getRowsData:F,setRowData:N,clear:T,refreshRowIds:d}=P.useEditableFormItemApi(t,u,l,i);function V(){const o=r.value?._internalGridApi;if(!d.value?.length||!o)return;const n=d.value.map(a=>o.getRowNode(a)).filter(a=>!!a);o.refreshCells({rowNodes:n,force:!0}),d.value=[]}function p(o){l.value=o;const n=z.arrayToObject(o,t.rowKey);u?.setFieldValue(t.name,o),u?.setFieldValue(i,n)}function f(o,n){const a=o==="end"?l.value.length-1:o;r.value?.scrollToRow(a,n)}function j(o,n){r.value?.scrollToColumn(o,n)}return y({add:S,addMultiple:m,remove:_,removeByKey:I,getRowData:E,getRowsData:F,setRowData:N,clear:T,setTableData:p,scrollTo:f,scrollToRow:f,scrollToColumn:j}),(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(w.ApForm).FormItem,{hidden:"",name:o.name},null,8,["name"]),e.createVNode(e.unref(w.ApForm).FormItem,e.mergeProps(e.unref(s.omit)(o.formItem,"initialValue"),{label:o.label}),{default:e.withCtx(()=>[e.createVNode(W.default,e.mergeProps(e.unref(s.omit)(t,["name","maxLength","onChange","defaultValue","formItem"]),{ref_key:"tableRef",ref:r,class:[e.unref(C)(),e.unref(R)],size:"mini",columns:e.unref(q),"data-source":l.value,"search-form":!1,onUpdate:V}),e.createSlots({_:2},[e.renderList(b,(a,g)=>({name:g,fn:e.withCtx(A=>[e.renderSlot(o.$slots,g,e.normalizeProps(e.guardReactiveProps(A||{})))])}))]),1040,["class","columns","data-source"])]),_:3},16,["label"])],64))}});exports.default=U;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),w=require("../../ap-form/index.js"),s=require("lodash-unified");require("../../config-provider/index.js");const D=require("../hooks/use-editable-columns.js");require("../index.vue2.js");const P=require("../hooks/use-editable-form-item-api.js"),k=require("../../ap-form/context.js"),H=require("../../ap-form/utils/get.js"),L=require("../utils.js"),M=require("../../ap-form/hooks/use-watch.js"),O=require("./utils.js"),z=require("../style/editable.js"),G=require("../../config-provider/hooks/use-namespace.js"),K=require("../../config-provider/hooks/use-global-config.js"),W=require("../index.vue.js"),U=e.defineComponent({name:"EditableGrid",__name:"form-item",props:{dropdownPrefixCls:{},bordered:{type:Boolean},locale:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{},showSorterTooltip:{type:[Boolean,Object]},prefixCls:{},rowKey:{type:[String,Function],default:"key"},tableLayout:{},title:{},id:{},showHeader:{type:Boolean},components:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean]},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean},indentSize:{},expandIconColumnIndex:{},showExpandColumn:{type:Boolean},expandedRowClassName:{},childrenColumnName:{},rowExpandable:{},transformCellText:{},rowHoverable:{type:Boolean},rowSelection:{type:[Boolean,Object]},onLoadingChange:{},onShownColumnsChange:{},pagination:{type:[Boolean,Object],default:!1},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},tableStyle:{},adaptive:{type:Boolean},columnResizable:{type:Boolean,default:!1},loading:{type:Boolean,default:void 0},summary:{},rowHeight:{default:66},getRowHeight:{},advanceRenderer:{type:Boolean},browserTooltips:{type:Boolean},virtual:{type:[Boolean,Object],default:void 0},onRowClicked:{},onScrollEnd:{},rowClassName:{},rowClassRules:{},autoHeight:{type:Boolean},onUpdate:{},customRow:{},theme:{},columns:{},defaultValue:{},onChange:{},maxLength:{},onFieldChange:{},label:{},name:{},formItem:{}},setup(h,{expose:y}){const b=e.useSlots(),t=h,{b:C}=G.useNamespace("editable-aggrid"),R=z.default("editable-aggrid"),r=e.ref(),{internalInstance:u,model:v}=k.useInjectForm(),i=L.getShadowName(t.name);let c;e.onMounted(()=>{const o=t.formItem?.initialValue??H.getModelValue(e.unref(v),t.name);c=s.cloneDeep(o),m(o,"suffix")});const l=e.ref([]),x=M.useWatch(t.name);e.watch(()=>x.value,o=>{s.isEqual(o,l.value)||p(o??c)},{deep:!0});const B=K.useGlobalConfig("valueTypeMap"),q=D.useGetEditableColumns(t,B,i),{add:S,addMultiple:m,remove:_,removeByKey:I,getRowData:E,getRowsData:F,setRowData:N,clear:T,refreshRowIds:d}=P.useEditableFormItemApi(t,u,l,i);function V(){const o=r.value?._internalGridApi;if(!d.value?.length||!o)return;const a=d.value.map(n=>o.getRowNode(n)).filter(n=>!!n);o.refreshCells({rowNodes:a,force:!0}),d.value=[]}function p(o){l.value=o;const a=O.arrayToObject(o,t.rowKey);u?.setFieldValue(t.name,o),u?.setFieldValue(i,a)}function f(o,a){const n=o==="end"?l.value.length-1:o;r.value?.scrollToRow(n,a)}function j(o,a){r.value?.scrollToColumn(o,a)}return y({add:S,addMultiple:m,remove:_,removeByKey:I,getRowData:E,getRowsData:F,setRowData:N,clear:T,setTableData:p,scrollTo:f,scrollToRow:f,scrollToColumn:j}),(o,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(w.ApForm).FormItem,{hidden:"",name:o.name},null,8,["name"]),e.createVNode(e.unref(w.ApForm).FormItem,e.mergeProps(e.unref(s.omit)(o.formItem,"initialValue"),{label:o.label}),{default:e.withCtx(()=>[e.createVNode(W.default,e.mergeProps(e.unref(s.omit)(t,["name","maxLength","onChange","defaultValue","formItem"]),{ref_key:"tableRef",ref:r,class:[e.unref(C)(),e.unref(R)],size:"mini",columns:e.unref(q),"data-source":l.value,"search-form":!1,onUpdate:V}),e.createSlots({_:2},[e.renderList(b,(n,g)=>({name:g,fn:e.withCtx(A=>[e.renderSlot(o.$slots,g,e.normalizeProps(e.guardReactiveProps(A||{})))])}))]),1040,["class","columns","data-source"])]),_:3},16,["label"])],64))}});exports.default=U;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("../../ap-form/index.js"),u=require("lodash-unified");require("../../config-provider/index.js");require("../../hooks/index.js");const P=require("../hooks/use-editable-columns.js");require("../index.vue2.js");const z=require("../hooks/use-editable-api.js"),c=require("./utils.js"),G=require("../style/editable.js"),H=require("../../config-provider/hooks/use-namespace.js"),L=require("../../hooks/useControllableValue.js"),M=require("../../config-provider/hooks/use-global-config.js"),U=require("../index.vue.js"),W=e.defineComponent({name:"EditableGrid",__name:"index",props:{dropdownPrefixCls:{},bordered:{type:Boolean},locale:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{},showSorterTooltip:{type:[Boolean,Object]},prefixCls:{},rowKey:{type:[String,Function],default:"key"},tableLayout:{},title:{},id:{},showHeader:{type:Boolean},components:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean]},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean},indentSize:{},expandIconColumnIndex:{},showExpandColumn:{type:Boolean},expandedRowClassName:{},childrenColumnName:{},rowExpandable:{},transformCellText:{},rowSelection:{type:[Boolean,Object]},onLoadingChange:{},onShownColumnsChange:{},pagination:{type:[Boolean,Object],default:!1},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},tableStyle:{},adaptive:{type:Boolean},columnResizable:{type:Boolean,default:!1},loading:{type:Boolean,default:void 0},summary:{},rowHeight:{default:66},getRowHeight:{},advanceRenderer:{type:Boolean},browserTooltips:{type:Boolean},virtual:{type:[Boolean,Object],default:void 0},onRowClicked:{},onScrollEnd:{},rowClassName:{},rowClassRules:{},autoHeight:{type:Boolean},onUpdate:{},customRow:{},theme:{},columns:{},value:{},defaultValue:{},"onUpdate:value":{},onChange:{},maxLength:{},name:{default:"ap-editable-table-inner-name"},onFieldChange:{}},emits:["update:value"],setup(y,{expose:w,emit:b}){const g=e.useSlots(),o=y,{b:h}=H.useNamespace("editable-aggrid"),C=G.default("editable-aggrid"),v=b,s=e.ref(),{value:r,updateValue:p}=L.useControllableValue(o,v),l=e.ref(),R=d.ApForm.useWatch(o.name,l);e.watch(r,a=>{const t=c.arrayToObject(a,o.rowKey);u.isEqual(t,e.unref(R))||l.value?.setFieldValue(o.name,t)},{deep:!0});const x=M.useGlobalConfig("valueTypeMap"),B=P.useGetEditableColumns(o,x),{add:_,addMultiple:S,remove:T,removeByKey:q,getRowData:F,getRowsData:E,setRowData:A,clear:N,refreshRowIds:i}=z.useEditableApi(o,l,r,p);function j(){const a=s.value?._internalGridApi;if(!i.value?.length||!a)return;const t=i.value.map(n=>a.getRowNode(n)).filter(n=>!!n);a.refreshCells({rowNodes:t,force:!0}),i.value=[]}function V(){l.value?.resetFields()}function O(a){return a?(u.isArray(a)?a:[a]).map(n=>u.isArray(n)?[o.name,...n]:[o.name,n]):void 0}async function k(a,t){return(await l.value?.validateFields(O(a),t))?.[o.name]}function D(a){p(a);const t=c.arrayToObject(a,o.rowKey);l.value?.setFieldValue(o.name,t)}function f(a,t){const n=a==="end"?r.value.length-1:a;s.value?.scrollToRow(n,t)}function K(a,t){s.value?.scrollToColumn(a,t)}return w({resetFields:V,validateFields:k,add:_,addMultiple:S,remove:T,removeByKey:q,getRowData:F,getRowsData:E,setRowData:A,clear:N,setTableData:D,scrollTo:f,scrollToRow:f,scrollToColumn:K}),(a,t)=>(e.openBlock(),e.createBlock(e.unref(d.ApForm),{ref_key:"formRef",ref:l,"initial-values":{[o.name]:e.unref(c.arrayToObject)(e.unref(r),o.rowKey)},style:{height:"100%"}},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ApForm).FormItem,{name:a.name,"no-style":""},{default:e.withCtx(()=>[e.createVNode(U.default,e.mergeProps(e.unref(u.omit)(o,["name","value","onUpdate:value","maxLength","onChange","defaultValue"]),{ref_key:"tableRef",ref:s,class:[e.unref(h)(),e.unref(C)],size:"mini",columns:e.unref(B),"data-source":e.unref(r),"search-form":!1,onUpdate:j}),e.createSlots({_:2},[e.renderList(g,(n,m)=>({name:m,fn:e.withCtx(I=>[e.renderSlot(a.$slots,m,e.normalizeProps(e.guardReactiveProps(I||{})))])}))]),1040,["class","columns","data-source"])]),_:3},8,["name"])]),_:3},8,["initial-values"]))}});exports.default=W;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("../../ap-form/index.js"),u=require("lodash-unified");require("../../config-provider/index.js");require("../../hooks/index.js");const I=require("../hooks/use-editable-columns.js");require("../index.vue2.js");const P=require("../hooks/use-editable-api.js"),c=require("./utils.js"),z=require("../style/editable.js"),G=require("../../config-provider/hooks/use-namespace.js"),L=require("../../hooks/useControllableValue.js"),M=require("../../config-provider/hooks/use-global-config.js"),U=require("../index.vue.js"),W=e.defineComponent({name:"EditableGrid",__name:"index",props:{dropdownPrefixCls:{},bordered:{type:Boolean},locale:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{},showSorterTooltip:{type:[Boolean,Object]},prefixCls:{},rowKey:{type:[String,Function],default:"key"},tableLayout:{},title:{},id:{},showHeader:{type:Boolean},components:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean]},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean},indentSize:{},expandIconColumnIndex:{},showExpandColumn:{type:Boolean},expandedRowClassName:{},childrenColumnName:{},rowExpandable:{},transformCellText:{},rowHoverable:{type:Boolean},rowSelection:{type:[Boolean,Object]},onLoadingChange:{},onShownColumnsChange:{},pagination:{type:[Boolean,Object],default:!1},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},tableStyle:{},adaptive:{type:Boolean},columnResizable:{type:Boolean,default:!1},loading:{type:Boolean,default:void 0},summary:{},rowHeight:{default:66},getRowHeight:{},advanceRenderer:{type:Boolean},browserTooltips:{type:Boolean},virtual:{type:[Boolean,Object],default:void 0},onRowClicked:{},onScrollEnd:{},rowClassName:{},rowClassRules:{},autoHeight:{type:Boolean},onUpdate:{},customRow:{},theme:{},columns:{},value:{},defaultValue:{},"onUpdate:value":{},onChange:{},maxLength:{},name:{default:"ap-editable-table-inner-name"},onFieldChange:{}},emits:["update:value"],setup(y,{expose:w,emit:b}){const g=e.useSlots(),a=y,{b:h}=G.useNamespace("editable-aggrid"),v=z.default("editable-aggrid"),C=b,s=e.ref(),{value:r,updateValue:p}=L.useControllableValue(a,C),l=e.ref(),R=d.ApForm.useWatch(a.name,l);e.watch(r,o=>{const t=c.arrayToObject(o,a.rowKey);u.isEqual(t,e.unref(R))||l.value?.setFieldValue(a.name,t)},{deep:!0});const x=M.useGlobalConfig("valueTypeMap"),B=I.useGetEditableColumns(a,x),{add:_,addMultiple:S,remove:T,removeByKey:q,getRowData:F,getRowsData:E,setRowData:A,clear:N,refreshRowIds:i}=P.useEditableApi(a,l,r,p);function j(){const o=s.value?._internalGridApi;if(!i.value?.length||!o)return;const t=i.value.map(n=>o.getRowNode(n)).filter(n=>!!n);o.refreshCells({rowNodes:t,force:!0}),i.value=[]}function V(){l.value?.resetFields()}function O(o){return o?(u.isArray(o)?o:[o]).map(n=>u.isArray(n)?[a.name,...n]:[a.name,n]):void 0}async function k(o,t){return(await l.value?.validateFields(O(o),t))?.[a.name]}function D(o){p(o);const t=c.arrayToObject(o,a.rowKey);l.value?.setFieldValue(a.name,t)}function f(o,t){const n=o==="end"?r.value.length-1:o;s.value?.scrollToRow(n,t)}function K(o,t){s.value?.scrollToColumn(o,t)}return w({resetFields:V,validateFields:k,add:_,addMultiple:S,remove:T,removeByKey:q,getRowData:F,getRowsData:E,setRowData:A,clear:N,setTableData:D,scrollTo:f,scrollToRow:f,scrollToColumn:K}),(o,t)=>(e.openBlock(),e.createBlock(e.unref(d.ApForm),{ref_key:"formRef",ref:l,"initial-values":{[a.name]:e.unref(c.arrayToObject)(e.unref(r),a.rowKey)},style:{height:"100%"}},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ApForm).FormItem,{name:o.name,"no-style":""},{default:e.withCtx(()=>[e.createVNode(U.default,e.mergeProps(e.unref(u.omit)(a,["name","value","onUpdate:value","maxLength","onChange","defaultValue"]),{ref_key:"tableRef",ref:s,class:[e.unref(h)(),e.unref(v)],size:"mini",columns:e.unref(B),"data-source":e.unref(r),"search-form":!1,onUpdate:j}),e.createSlots({_:2},[e.renderList(g,(n,m)=>({name:m,fn:e.withCtx(H=>[e.renderSlot(o.$slots,m,e.normalizeProps(e.guardReactiveProps(H||{})))])}))]),1040,["class","columns","data-source"])]),_:3},8,["name"])]),_:3},8,["initial-values"]))}});exports.default=W;