@aplus-frontend/ui 0.5.2 → 0.5.4

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 (107) hide show
  1. package/es/index.mjs +37 -33
  2. package/es/src/ap-field/text/index.vue2.mjs +13 -13
  3. package/es/src/ap-grid/editable/form-item.vue.d.ts +16 -0
  4. package/es/src/ap-grid/editable/form-item.vue.mjs +257 -0
  5. package/es/src/ap-grid/editable/form-item.vue2.mjs +4 -0
  6. package/es/src/ap-grid/editable/index.vue.d.ts +18 -0
  7. package/es/src/ap-grid/editable/index.vue.mjs +288 -0
  8. package/es/src/ap-grid/editable/index.vue2.mjs +4 -0
  9. package/es/src/ap-grid/editable/interface.d.ts +95 -0
  10. package/es/src/ap-grid/editable/interface.mjs +1 -0
  11. package/es/src/ap-grid/editable/style/css.d.ts +0 -0
  12. package/es/src/ap-grid/editable/style/css.js +1 -0
  13. package/es/src/ap-grid/editable/style/index.d.ts +0 -0
  14. package/es/src/ap-grid/editable/style/index.js +1 -0
  15. package/es/src/ap-grid/hooks/use-editable-columns.d.ts +6 -0
  16. package/es/src/ap-grid/hooks/use-editable-columns.mjs +68 -0
  17. package/es/src/ap-grid/index.d.ts +4 -1
  18. package/es/src/ap-grid/index.mjs +3 -0
  19. package/es/src/ap-grid/index.vue.mjs +114 -104
  20. package/es/src/ap-grid/interface.d.ts +15 -0
  21. package/es/src/ap-grid/utils/col.mjs +39 -39
  22. package/es/src/ap-grid/utils/editable.d.ts +3 -0
  23. package/es/src/ap-grid/utils/editable.mjs +27 -0
  24. package/es/src/ap-grid/utils/table.mjs +24 -17
  25. package/es/src/business/batch-input-group/index.vue.mjs +6 -5
  26. package/es/src/config-provider/config-provider-props.mjs +1 -1
  27. package/es/src/editable-table/utils.d.ts +3 -2
  28. package/es/src/index.mjs +24 -20
  29. package/es/src/path-map.mjs +3 -1
  30. package/lib/index.js +1 -1
  31. package/lib/src/ap-field/text/index.vue2.js +1 -1
  32. package/lib/src/ap-grid/editable/form-item.vue.d.ts +16 -0
  33. package/lib/src/ap-grid/editable/form-item.vue.js +1 -0
  34. package/lib/src/ap-grid/editable/form-item.vue2.js +1 -0
  35. package/lib/src/ap-grid/editable/index.vue.d.ts +18 -0
  36. package/lib/src/ap-grid/editable/index.vue.js +1 -0
  37. package/lib/src/ap-grid/editable/index.vue2.js +1 -0
  38. package/lib/src/ap-grid/editable/interface.d.ts +95 -0
  39. package/lib/src/ap-grid/editable/interface.js +1 -0
  40. package/lib/src/ap-grid/editable/style/css.cjs +1 -0
  41. package/lib/src/ap-grid/editable/style/css.d.ts +0 -0
  42. package/lib/src/ap-grid/editable/style/index.cjs +1 -0
  43. package/lib/src/ap-grid/editable/style/index.d.ts +0 -0
  44. package/lib/src/ap-grid/hooks/use-editable-columns.d.ts +6 -0
  45. package/lib/src/ap-grid/hooks/use-editable-columns.js +1 -0
  46. package/lib/src/ap-grid/index.d.ts +4 -1
  47. package/lib/src/ap-grid/index.js +1 -1
  48. package/lib/src/ap-grid/index.vue.js +1 -1
  49. package/lib/src/ap-grid/interface.d.ts +15 -0
  50. package/lib/src/ap-grid/utils/col.js +1 -1
  51. package/lib/src/ap-grid/utils/editable.d.ts +3 -0
  52. package/lib/src/ap-grid/utils/editable.js +1 -0
  53. package/lib/src/ap-grid/utils/table.js +1 -1
  54. package/lib/src/business/batch-input-group/index.vue.js +2 -2
  55. package/lib/src/config-provider/config-provider-props.js +1 -1
  56. package/lib/src/editable-table/utils.d.ts +3 -2
  57. package/lib/src/index.js +1 -1
  58. package/lib/src/path-map.js +1 -1
  59. package/package.json +1 -1
  60. package/theme/antd-global-overwrite/admin/index.css +54 -54
  61. package/theme/antd-global-overwrite/admin/table.css +54 -54
  62. package/theme/antd-global-overwrite/admin/table.less +4 -3
  63. package/theme/antd-global-overwrite/aplus/index.css +54 -54
  64. package/theme/antd-global-overwrite/aplus/table.css +54 -54
  65. package/theme/antd-global-overwrite/aplus/table.less +4 -3
  66. package/theme/ap-grid/editable.css +22 -0
  67. package/theme/ap-grid/editable.less +28 -0
  68. package/theme/index.css +22 -0
  69. package/theme/index.less +1 -0
  70. package/es/src/theme/antd-global-overwrite/admin/alert.css +0 -50
  71. package/es/src/theme/antd-global-overwrite/admin/button.css +0 -27
  72. package/es/src/theme/antd-global-overwrite/admin/form.css +0 -60
  73. package/es/src/theme/antd-global-overwrite/admin/index.css +0 -838
  74. package/es/src/theme/antd-global-overwrite/admin/message.css +0 -17
  75. package/es/src/theme/antd-global-overwrite/admin/modal.css +0 -117
  76. package/es/src/theme/antd-global-overwrite/admin/pagination.css +0 -122
  77. package/es/src/theme/antd-global-overwrite/admin/steps.css +0 -127
  78. package/es/src/theme/antd-global-overwrite/admin/table.css +0 -318
  79. package/es/src/theme/antd-global-overwrite/aplus/alert.css +0 -50
  80. package/es/src/theme/antd-global-overwrite/aplus/button.css +0 -27
  81. package/es/src/theme/antd-global-overwrite/aplus/form.css +0 -93
  82. package/es/src/theme/antd-global-overwrite/aplus/index.css +0 -873
  83. package/es/src/theme/antd-global-overwrite/aplus/message.css +0 -17
  84. package/es/src/theme/antd-global-overwrite/aplus/modal.css +0 -111
  85. package/es/src/theme/antd-global-overwrite/aplus/pagination.css +0 -147
  86. package/es/src/theme/antd-global-overwrite/aplus/steps.css +0 -125
  87. package/es/src/theme/antd-global-overwrite/aplus/table.css +0 -303
  88. package/es/src/theme/reset.css +0 -257
  89. package/lib/src/theme/antd-global-overwrite/admin/alert.css +0 -50
  90. package/lib/src/theme/antd-global-overwrite/admin/button.css +0 -27
  91. package/lib/src/theme/antd-global-overwrite/admin/form.css +0 -60
  92. package/lib/src/theme/antd-global-overwrite/admin/index.css +0 -838
  93. package/lib/src/theme/antd-global-overwrite/admin/message.css +0 -17
  94. package/lib/src/theme/antd-global-overwrite/admin/modal.css +0 -117
  95. package/lib/src/theme/antd-global-overwrite/admin/pagination.css +0 -122
  96. package/lib/src/theme/antd-global-overwrite/admin/steps.css +0 -127
  97. package/lib/src/theme/antd-global-overwrite/admin/table.css +0 -318
  98. package/lib/src/theme/antd-global-overwrite/aplus/alert.css +0 -50
  99. package/lib/src/theme/antd-global-overwrite/aplus/button.css +0 -27
  100. package/lib/src/theme/antd-global-overwrite/aplus/form.css +0 -93
  101. package/lib/src/theme/antd-global-overwrite/aplus/index.css +0 -873
  102. package/lib/src/theme/antd-global-overwrite/aplus/message.css +0 -17
  103. package/lib/src/theme/antd-global-overwrite/aplus/modal.css +0 -111
  104. package/lib/src/theme/antd-global-overwrite/aplus/pagination.css +0 -147
  105. package/lib/src/theme/antd-global-overwrite/aplus/steps.css +0 -125
  106. package/lib/src/theme/antd-global-overwrite/aplus/table.css +0 -303
  107. package/lib/src/theme/reset.css +0 -257
package/es/index.mjs CHANGED
@@ -5,7 +5,7 @@ import { configProviderProps as d } from "./src/config-provider/config-provider-
5
5
  import { DEFAULT_NAMESPACE as s, DEFAULT_UIMODE as A, configProviderContextKey as n } from "./src/config-provider/constants.mjs";
6
6
  import { keysOf as c, provideGlobalConfig as F, useGlobalConfig as I } from "./src/config-provider/hooks/use-global-config.mjs";
7
7
  import { buildLocaleContext as T, buildTranslator as S, localeContextKey as C, translate as D, useLocale as g } from "./src/config-provider/hooks/use-locale.mjs";
8
- import { defaultNamespace as G, namespaceContextKey as P, useGetDerivedNamespace as R, useNamespace as M } from "./src/config-provider/hooks/use-namespace.mjs";
8
+ import { defaultNamespace as G, namespaceContextKey as E, useGetDerivedNamespace as P, useNamespace as R } from "./src/config-provider/hooks/use-namespace.mjs";
9
9
  import { ConfigProvider as L, globalConfigCached as N } from "./src/config-provider/config-provider.mjs";
10
10
  import { APConfigProvider as w } from "./src/config-provider/index.mjs";
11
11
  import { ApFormItemText as B } from "./src/ap-form/items/text/index.mjs";
@@ -31,8 +31,8 @@ import { default as Te } from "./src/ap-form/render/control.vue.mjs";
31
31
  import { default as Ce } from "./src/ap-form/render/item.vue.mjs";
32
32
  import { default as ge } from "./src/ap-form/provider/index.vue.mjs";
33
33
  import { ApField as Ge } from "./src/ap-field/index.mjs";
34
- import { ApFieldText as Re } from "./src/ap-field/text/index.mjs";
35
- import { default as Ee } from "./src/ap-field/checkbox/index.vue.mjs";
34
+ import { ApFieldText as Pe } from "./src/ap-field/text/index.mjs";
35
+ import { default as Me } from "./src/ap-field/checkbox/index.vue.mjs";
36
36
  import { default as Ne } from "./src/ap-field/date/index.vue.mjs";
37
37
  import { default as we } from "./src/ap-field/number/index.vue.mjs";
38
38
  import { default as Be } from "./src/ap-field/radio/index.vue.mjs";
@@ -56,8 +56,8 @@ import { default as bo } from "./src/work-order-modal/work-order-modal.vue.mjs";
56
56
  import { default as So } from "./src/ap-tag/ap-tag.vue.mjs";
57
57
  import { default as Do } from "./src/ap-tag/ap-tag-group.vue.mjs";
58
58
  import { default as ho } from "./src/ap-info-layout/ApInfoLayout.vue.mjs";
59
- import { NeedNameKeyDefault as Po } from "./src/ap-upload/apUploadTypes.mjs";
60
- import { default as Mo } from "./src/ap-upload/apUpload.vue.mjs";
59
+ import { NeedNameKeyDefault as Eo } from "./src/ap-upload/apUploadTypes.mjs";
60
+ import { default as Ro } from "./src/ap-upload/apUpload.vue.mjs";
61
61
  import { ApDownLoadNeedNameKeyDefault as Lo } from "./src/ap-download/interface.mjs";
62
62
  import { default as yo } from "./src/ap-download/ap-download.vue.mjs";
63
63
  import { CheckCard as vo } from "./src/check-card/index.mjs";
@@ -83,8 +83,8 @@ import { ApExportGroup as br } from "./src/business/ap-export-group/index.mjs";
83
83
  import { handleExportDownload as Sr } from "./src/business/ap-export-group/handleExportDownload.mjs";
84
84
  import { convertExportField as Dr } from "./src/business/ap-export-group/convertExportField.mjs";
85
85
  import { ApImage as hr } from "./src/business/ap-image/index.mjs";
86
- import { ApInputRadio as Pr } from "./src/business/ap-input-radio/index.mjs";
87
- import { ApLabel as Mr, ApLabelGroup as Er } from "./src/business/ap-label/index.mjs";
86
+ import { ApInputRadio as Er } from "./src/business/ap-input-radio/index.mjs";
87
+ import { ApLabel as Rr, ApLabelGroup as Mr } from "./src/business/ap-label/index.mjs";
88
88
  import { locales as Nr } from "./src/business/ap-ladder/interface.mjs";
89
89
  import { ApLadder as wr } from "./src/business/ap-ladder/index.mjs";
90
90
  import { ApSelectLayout as Br } from "./src/business/ap-select-layout/index.mjs";
@@ -107,19 +107,21 @@ import { default as Tt } from "./src/editable-table/index.vue.mjs";
107
107
  import { default as Ct } from "./src/editable-table/form-item.vue.mjs";
108
108
  import { default as gt } from "./src/ap-descriptions/ap-descriptions.vue.mjs";
109
109
  import { ensureRangeValue as Gt } from "./src/scroll-bar/utils/index.mjs";
110
- import { default as Rt } from "./src/scroll-bar/index.vue.mjs";
111
- import { default as Et } from "./src/scroll-bar/internal.vue.mjs";
110
+ import { default as Pt } from "./src/scroll-bar/index.vue.mjs";
111
+ import { default as Mt } from "./src/scroll-bar/internal.vue.mjs";
112
112
  import { default as Nt } from "./src/scroll-view/index.vue.mjs";
113
113
  import { default as wt } from "./src/portal/index.vue.mjs";
114
114
  import { default as Bt } from "./src/full-screen/index.vue.mjs";
115
115
  import { default as Kt } from "./src/resize-observer/index.vue.mjs";
116
116
  import { default as Ut } from "./src/ap-grid/index.vue.mjs";
117
- import { useMessage as Vt } from "./src/hooks/useMessage.mjs";
118
- import { useControllableValue as _t } from "./src/hooks/useControllableValue.mjs";
119
- import { useManualRef as $t } from "./src/hooks/useManualRef.mjs";
120
- import { useThrottleRef as qt } from "./src/hooks/useThrottleRef.mjs";
121
- import { useFullScreen as Qt } from "./src/hooks/useFullScreen.mjs";
122
- import { useResize as Yt } from "./src/hooks/useResize.mjs";
117
+ import { default as Vt } from "./src/ap-grid/editable/index.vue.mjs";
118
+ import { default as _t } from "./src/ap-grid/editable/form-item.vue.mjs";
119
+ import { useMessage as $t } from "./src/hooks/useMessage.mjs";
120
+ import { useControllableValue as qt } from "./src/hooks/useControllableValue.mjs";
121
+ import { useManualRef as Qt } from "./src/hooks/useManualRef.mjs";
122
+ import { useThrottleRef as Yt } from "./src/hooks/useThrottleRef.mjs";
123
+ import { useFullScreen as ep } from "./src/hooks/useFullScreen.mjs";
124
+ import { useResize as rp } from "./src/hooks/useResize.mjs";
123
125
  const a = {
124
126
  install: (r) => {
125
127
  for (const t in o) {
@@ -153,7 +155,7 @@ export {
153
155
  Fr as ApExportGroupActionType,
154
156
  pt as ApExtensionSelect,
155
157
  Ge as ApField,
156
- Ee as ApFieldCheckbox,
158
+ Me as ApFieldCheckbox,
157
159
  Ne as ApFieldDate,
158
160
  Ve as ApFieldDateRange,
159
161
  we as ApFieldNumber,
@@ -164,7 +166,7 @@ export {
164
166
  _e as ApFieldSelect,
165
167
  qe as ApFieldSlider,
166
168
  Ke as ApFieldSwitch,
167
- Re as ApFieldText,
169
+ Pe as ApFieldText,
168
170
  Ue as ApFieldTextArea,
169
171
  re as ApForm,
170
172
  Te as ApFormControlRender,
@@ -193,9 +195,9 @@ export {
193
195
  at as ApGroupSearch,
194
196
  hr as ApImage,
195
197
  ho as ApInfoLayout,
196
- Pr as ApInputRadio,
197
- Mr as ApLabel,
198
- Er as ApLabelGroup,
198
+ Er as ApInputRadio,
199
+ Rr as ApLabel,
200
+ Mr as ApLabelGroup,
199
201
  wr as ApLadder,
200
202
  zo as ApList,
201
203
  Oo as ApModal,
@@ -212,7 +214,7 @@ export {
212
214
  Do as ApTagGroup,
213
215
  zr as ApTitle,
214
216
  Xo as ApTransformDataHelper,
215
- Mo as ApUpload,
217
+ Ro as ApUpload,
216
218
  lt as ApUploadSingle,
217
219
  dt as BatchInputGroup,
218
220
  vo as CheckCard,
@@ -221,14 +223,16 @@ export {
221
223
  s as DEFAULT_NAMESPACE,
222
224
  A as DEFAULT_UIMODE,
223
225
  no as DictCode,
226
+ Vt as EditableGrid,
227
+ _t as EditableGridFormItem,
224
228
  Tt as EditableTable,
225
229
  Ct as EditableTableFormItem,
226
230
  Bt as FullScreen,
227
- Et as InternalScrollBar,
228
- Po as NeedNameKeyDefault,
231
+ Mt as InternalScrollBar,
232
+ Eo as NeedNameKeyDefault,
229
233
  wt as Portal,
230
234
  Kt as ResizeObserver,
231
- Rt as ScrollBar,
235
+ Pt as ScrollBar,
232
236
  Nt as ScrollView,
233
237
  bo as WorkOrderModal,
234
238
  eo as adminToken,
@@ -252,23 +256,23 @@ export {
252
256
  io as langMap,
253
257
  C as localeContextKey,
254
258
  Nr as locales,
255
- P as namespaceContextKey,
259
+ E as namespaceContextKey,
256
260
  l as pathMap,
257
261
  F as provideGlobalConfig,
258
262
  D as translate,
259
- _t as useControllableValue,
260
- Qt as useFullScreen,
261
- R as useGetDerivedNamespace,
263
+ qt as useControllableValue,
264
+ ep as useFullScreen,
265
+ P as useGetDerivedNamespace,
262
266
  I as useGlobalConfig,
263
267
  g as useLocale,
264
- $t as useManualRef,
265
- Vt as useMessage,
266
- M as useNamespace,
268
+ Qt as useManualRef,
269
+ $t as useMessage,
270
+ R as useNamespace,
267
271
  Wr as usePageListApTable,
268
- Yt as useResize,
272
+ rp as useResize,
269
273
  or as useTableModal,
270
274
  ct as useTablePaging,
271
275
  Hr as useTableRefresh,
272
276
  tr as useTableSelectModal,
273
- qt as useThrottleRef
277
+ Yt as useThrottleRef
274
278
  };
@@ -1,13 +1,13 @@
1
- import { isVNode as v, defineComponent as B, ref as g, useSlots as h, computed as b, createVNode as d, mergeProps as C, unref as u, Fragment as S, createBlock as _, openBlock as R, resolveDynamicComponent as w } from "vue";
2
- import { Input as T } from "@aplus-frontend/antdv";
1
+ import { isVNode as v, defineComponent as B, ref as h, useSlots as b, computed as g, createVNode as d, mergeProps as C, unref as u, createBlock as S, openBlock as _, resolveDynamicComponent as R } from "vue";
2
+ import { Input as w } from "@aplus-frontend/antdv";
3
3
  import "../../hooks/index.mjs";
4
- import { omit as V } from "lodash-unified";
5
- import { useDefaultPlaceholder as j } from "../hooks/use-default-placeholder.mjs";
6
- import { useControllableValue as F } from "../../hooks/useControllableValue.mjs";
4
+ import { omit as T } from "lodash-unified";
5
+ import { useDefaultPlaceholder as V } from "../hooks/use-default-placeholder.mjs";
6
+ import { useControllableValue as j } from "../../hooks/useControllableValue.mjs";
7
7
  function I(l) {
8
8
  return typeof l == "function" || Object.prototype.toString.call(l) === "[object Object]" && !v(l);
9
9
  }
10
- const K = /* @__PURE__ */ B({
10
+ const E = /* @__PURE__ */ B({
11
11
  name: "ApFieldText",
12
12
  __name: "index",
13
13
  props: {
@@ -95,7 +95,7 @@ const K = /* @__PURE__ */ B({
95
95
  expose: i,
96
96
  emit: c
97
97
  }) {
98
- const a = g(), o = h();
98
+ const a = h(), o = b();
99
99
  i({
100
100
  focus: (e) => {
101
101
  var t;
@@ -113,7 +113,7 @@ const K = /* @__PURE__ */ B({
113
113
  var e;
114
114
  (e = a.value) == null || e.select();
115
115
  },
116
- input: b(() => {
116
+ input: g(() => {
117
117
  var e;
118
118
  return (e = a.value) == null ? void 0 : e.input;
119
119
  })
@@ -121,21 +121,21 @@ const K = /* @__PURE__ */ B({
121
121
  const f = c, n = l, {
122
122
  value: r,
123
123
  updateValue: s
124
- } = F(n, f), m = j("Text", n);
124
+ } = j(n, f), m = V("Text", n);
125
125
  function y() {
126
126
  var e, t;
127
- return n.mode === "edit" ? d(T, C(V(n, ["mode", "emptyText", "value", "onUpdate:value"]), {
127
+ return n.mode === "edit" ? d(w, C(T(n, ["mode", "emptyText", "value", "onUpdate:value"]), {
128
128
  placeholder: u(m),
129
129
  value: u(r),
130
130
  "onUpdate:value": s,
131
131
  ref: a
132
132
  }), I(o) ? o : {
133
133
  default: () => [o]
134
- }) : d(S, null, [n.prefix || ((e = o == null ? void 0 : o.prefix) == null ? void 0 : e.call(o)), u(r) || n.emptyText, n.suffix || ((t = o == null ? void 0 : o.suffix) == null ? void 0 : t.call(o))]);
134
+ }) : d("span", null, [n.prefix || ((e = o == null ? void 0 : o.prefix) == null ? void 0 : e.call(o)), u(r) || n.emptyText, n.suffix || ((t = o == null ? void 0 : o.suffix) == null ? void 0 : t.call(o))]);
135
135
  }
136
- return (e, t) => (R(), _(w(y())));
136
+ return (e, t) => (_(), S(R(y())));
137
137
  }
138
138
  });
139
139
  export {
140
- K as default
140
+ E as default
141
141
  };
@@ -0,0 +1,16 @@
1
+ import { EditableGridFormItemExpose, EditableGridFormItemProps } from './interface';
2
+ import { Recordable } from '../../type';
3
+ import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
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<{
5
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & EditableGridFormItemProps<RecordType> & Partial<{}>> & PublicProps;
6
+ expose(exposed: ShallowUnwrapRef<EditableGridFormItemExpose>): void;
7
+ attrs: any;
8
+ slots: Readonly<Record<string, any>> & Record<string, any>;
9
+ emit: {};
10
+ }>) => VNode & {
11
+ __ctx?: Awaited<typeof __VLS_setup>;
12
+ };
13
+ export default _default;
14
+ type __VLS_PrettifyLocal<T> = {
15
+ [K in keyof T]: T[K];
16
+ } & {};
@@ -0,0 +1,257 @@
1
+ import { defineComponent as A, useSlots as P, toRef as H, ref as y, unref as r, watch as W, nextTick as G, createBlock as K, openBlock as M, mergeProps as g, withCtx as C, createVNode as U, createSlots as $, renderList as q, renderSlot as J, normalizeProps as Q, guardReactiveProps as X } from "vue";
2
+ import { ApForm as w } from "../../ap-form/index.mjs";
3
+ import { isArray as Y, isNumber as f, cloneDeep as d, omit as Z } from "lodash-unified";
4
+ import "../../config-provider/index.mjs";
5
+ import { isDef as m } from "../../utils/index.mjs";
6
+ import { useGetEditableColumns as I } from "../hooks/use-editable-columns.mjs";
7
+ import "../index.vue2.mjs";
8
+ import { useInjectForm as ee } from "../../ap-form/context.mjs";
9
+ import { useNamespace as oe } from "../../config-provider/hooks/use-namespace.mjs";
10
+ import { useGlobalConfig as te } from "../../config-provider/hooks/use-global-config.mjs";
11
+ import ae from "../index.vue.mjs";
12
+ const he = /* @__PURE__ */ A({
13
+ name: "EditableGrid",
14
+ __name: "form-item",
15
+ props: {
16
+ dropdownPrefixCls: {},
17
+ loading: {
18
+ type: [Boolean, Object],
19
+ default: void 0
20
+ },
21
+ bordered: {
22
+ type: Boolean,
23
+ default: !1
24
+ },
25
+ locale: {},
26
+ onResizeColumn: {},
27
+ getPopupContainer: {},
28
+ scroll: {},
29
+ sortDirections: {
30
+ default: () => ["ascend", "descend"]
31
+ },
32
+ showSorterTooltip: {
33
+ type: [Boolean, Object],
34
+ default: !0
35
+ },
36
+ prefixCls: {},
37
+ tableLayout: {
38
+ default: "fixed"
39
+ },
40
+ title: {},
41
+ id: {},
42
+ showHeader: {
43
+ type: Boolean,
44
+ default: !0
45
+ },
46
+ components: {},
47
+ customRow: {},
48
+ customHeaderRow: {},
49
+ direction: {},
50
+ expandFixed: {
51
+ type: [String, Boolean],
52
+ default: !1
53
+ },
54
+ expandColumnWidth: {},
55
+ expandedRowKeys: {},
56
+ defaultExpandedRowKeys: {},
57
+ expandedRowRender: {},
58
+ expandRowByClick: {
59
+ type: Boolean,
60
+ default: !1
61
+ },
62
+ expandIcon: {},
63
+ onExpand: {},
64
+ onExpandedRowsChange: {},
65
+ defaultExpandAllRows: {
66
+ type: Boolean,
67
+ default: !1
68
+ },
69
+ indentSize: {
70
+ default: 15
71
+ },
72
+ expandIconColumnIndex: {},
73
+ showExpandColumn: {
74
+ type: Boolean,
75
+ default: !0
76
+ },
77
+ expandedRowClassName: {},
78
+ childrenColumnName: {
79
+ default: "children"
80
+ },
81
+ rowExpandable: {},
82
+ sticky: {
83
+ type: [Boolean, Object],
84
+ default: !1
85
+ },
86
+ transformCellText: {},
87
+ rowClassName: {},
88
+ stripe: {
89
+ type: Boolean
90
+ },
91
+ headerRowClassName: {},
92
+ footerRowClassName: {},
93
+ cellClassName: {},
94
+ headerCellClassName: {},
95
+ footerCellClassName: {},
96
+ rowStyle: {},
97
+ headerRowStyle: {},
98
+ footerRowStyle: {},
99
+ cellStyle: {},
100
+ headerCellStyle: {},
101
+ footerCellStyle: {},
102
+ height: {},
103
+ minHeight: {},
104
+ maxHeight: {},
105
+ mergeCells: {},
106
+ mergeFooterItems: {},
107
+ cellConfig: {},
108
+ rowSelection: {
109
+ type: Boolean,
110
+ default: void 0
111
+ },
112
+ onLoadingChange: {},
113
+ pagination: {
114
+ type: [Boolean, Object],
115
+ default: !1
116
+ },
117
+ searchFormWrapperStyle: {},
118
+ tableWrapperStyle: {},
119
+ wrapperStyle: {},
120
+ size: {
121
+ default: "medium"
122
+ },
123
+ adaptive: {
124
+ type: Boolean,
125
+ default: !1
126
+ },
127
+ columnResizable: {
128
+ type: [Boolean, Object],
129
+ default: !1
130
+ },
131
+ rowKey: {
132
+ default: "key"
133
+ },
134
+ footer: {},
135
+ virtual: {
136
+ type: [Boolean, Object],
137
+ default: void 0
138
+ },
139
+ expandable: {},
140
+ value: {},
141
+ columns: {},
142
+ defaultValue: {},
143
+ "onUpdate:value": {},
144
+ onChange: {},
145
+ maxLength: {},
146
+ onFieldChange: {},
147
+ label: {},
148
+ name: {},
149
+ formItem: {
150
+ default: () => ({})
151
+ }
152
+ },
153
+ setup(x, {
154
+ expose: b
155
+ }) {
156
+ const R = P(), a = x, {
157
+ b: B
158
+ } = oe("editable-grid");
159
+ function S(e, o) {
160
+ return Y(o) ? o.reduce((n, l) => n == null ? void 0 : n[l], e) : e == null ? void 0 : e[o];
161
+ }
162
+ const {
163
+ internalInstance: t,
164
+ model: F
165
+ } = ee(), i = H(a.name), u = y(S(r(F), i.value) || []), N = w.useWatch(i);
166
+ W(() => N.value, async (e) => {
167
+ var o;
168
+ await G(), u.value = e, (o = a.onChange) == null || o.call(a, e);
169
+ }, {
170
+ deep: !0
171
+ });
172
+ const p = y(), v = te("valueTypeMap"), D = I(a, v);
173
+ function L(e, o) {
174
+ var s;
175
+ const n = ((s = r(u)) == null ? void 0 : s.length) || 0;
176
+ if (m(a.maxLength) && n >= a.maxLength)
177
+ return;
178
+ const l = [...r(u) || []];
179
+ m(o) ? l.splice(o, 0, {
180
+ ...e || {}
181
+ }) : l.push({
182
+ ...e || {}
183
+ }), t == null || t.setFieldValue(a.name, l);
184
+ }
185
+ function V(e, o = "suffix") {
186
+ var h;
187
+ const n = ((h = r(u)) == null ? void 0 : h.length) || 0, l = f(e) ? e : e.length;
188
+ if (m(a.maxLength) && n + l > a.maxLength)
189
+ return;
190
+ const s = [...r(u) || []], c = f(e) ? new Array(e).fill(0).map(() => ({})) : d(e);
191
+ o === "suffix" ? s.push(...c) : s.unshift(...c), t == null || t.setFieldValue(a.name, s);
192
+ }
193
+ function _(e) {
194
+ let o = d(r(u) || []);
195
+ const n = f(e) ? [e] : e;
196
+ o = o.filter((l, s) => !n.includes(s)), t == null || t.setFieldValue(a.name, o);
197
+ }
198
+ function E() {
199
+ return r(u);
200
+ }
201
+ function T(e) {
202
+ var o;
203
+ return (o = r(u)) == null ? void 0 : o[e];
204
+ }
205
+ function j(e, o, n = !0) {
206
+ const l = d(r(u));
207
+ l[e] && (l[e] = {
208
+ ...n ? l[e] : {},
209
+ ...o
210
+ }, t == null || t.setFieldValue(a.name, [...l]));
211
+ }
212
+ function k(e) {
213
+ t == null || t.setFieldValue(a.name, e);
214
+ }
215
+ function O(e) {
216
+ var n;
217
+ const o = e === "end" ? u.value.length - 1 : e;
218
+ (n = p.value) == null || n.scrollToRow(o);
219
+ }
220
+ function z() {
221
+ var e;
222
+ (e = t == null ? void 0 : t.setFieldValue) == null || e.call(t, a.name, []);
223
+ }
224
+ return b({
225
+ add: L,
226
+ remove: _,
227
+ getRowData: T,
228
+ getRowsData: E,
229
+ setRowData: j,
230
+ addMultiple: V,
231
+ scrollTo: O,
232
+ setTableData: k,
233
+ clear: z
234
+ }), (e, o) => (M(), K(r(w).FormItem, g(e.formItem, {
235
+ name: e.name,
236
+ label: e.label
237
+ }), {
238
+ default: C(() => [U(ae, g(r(Z)(a, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue", "formItem"]), {
239
+ ref_key: "tableRef",
240
+ ref: p,
241
+ class: r(B)(),
242
+ columns: r(D),
243
+ "data-source": r(d)(u.value),
244
+ "search-form": !1
245
+ }), $({
246
+ _: 2
247
+ }, [q(R, (n, l) => ({
248
+ name: l,
249
+ fn: C((s) => [J(e.$slots, l, Q(X(s || {})))])
250
+ }))]), 1040, ["class", "columns", "data-source"])]),
251
+ _: 3
252
+ }, 16, ["name", "label"]));
253
+ }
254
+ });
255
+ export {
256
+ he as default
257
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./form-item.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,18 @@
1
+ import { EditableGridExpose, EditableGridProps } from './interface';
2
+ import { Recordable } from '../../type';
3
+ import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
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<{
5
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
6
+ readonly "onUpdate:value"?: ((...args: any[]) => any) | undefined;
7
+ } & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, "onUpdate:value"> & EditableGridProps<RecordType> & Partial<{}>> & PublicProps;
8
+ expose(exposed: ShallowUnwrapRef<EditableGridExpose>): void;
9
+ attrs: any;
10
+ slots: Readonly<Record<string, any>> & Record<string, any>;
11
+ emit: (event: "update:value", ...args: any[]) => void;
12
+ }>) => VNode & {
13
+ __ctx?: Awaited<typeof __VLS_setup>;
14
+ };
15
+ export default _default;
16
+ type __VLS_PrettifyLocal<T> = {
17
+ [K in keyof T]: T[K];
18
+ } & {};