@aplus-frontend/ui 7.19.0-beta.1 → 7.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/src/ag-grid/context.mjs +1 -1
- package/es/src/ag-grid/editable/form-item.vue.d.ts +2 -4
- package/es/src/ag-grid/editable/form-item.vue.mjs +88 -77
- package/es/src/ag-grid/editable/index.vue.d.ts +2 -4
- package/es/src/ag-grid/editable/index.vue.mjs +9 -8
- package/es/src/ag-grid/editable/interface.d.ts +15 -1
- package/es/src/ag-grid/hooks/use-columns.mjs +31 -23
- package/es/src/ag-grid/hooks/use-pinned-row.mjs +2 -2
- package/es/src/ag-grid/index.vue.d.ts +2 -4
- package/es/src/ag-grid/index.vue.mjs +353 -335
- package/es/src/ag-grid/interface.d.ts +40 -1
- package/es/src/ag-grid/utils.d.ts +18 -0
- package/es/src/ag-grid/utils.mjs +39 -18
- package/es/src/ap-field/cascader/use-options.d.ts +4 -4
- package/es/src/ap-field/date/index.vue.d.ts +0 -1
- package/es/src/ap-field/date-range/index.vue.d.ts +0 -1
- package/es/src/ap-field/select/use-select-options.d.ts +2 -2
- package/es/src/ap-field/text/password.vue.d.ts +4 -4
- package/es/src/ap-field/tree-select/use-request.d.ts +4 -4
- package/es/src/ap-form/ap-form.vue.d.ts +1 -2
- package/es/src/ap-form/ap-form.vue2.mjs +63 -61
- package/es/src/ap-form/context.mjs +1 -1
- package/es/src/ap-form/drawer-form/index.vue.d.ts +3 -4
- package/es/src/ap-form/interface.d.ts +4 -0
- package/es/src/ap-form/item/index.vue.d.ts +6 -6
- package/es/src/ap-form/item-group/helper.mjs +2 -2
- package/es/src/ap-form/items/date/index.vue.d.ts +9 -11
- package/es/src/ap-form/items/date-range/index.vue.d.ts +13 -15
- package/es/src/ap-form/items/number/index.vue.d.ts +2 -3
- package/es/src/ap-form/items/select/index.vue.d.ts +8 -8
- package/es/src/ap-form/modal-form/index.vue.d.ts +3 -4
- package/es/src/ap-form/provider/context.mjs +1 -1
- package/es/src/ap-form/search-form/index.vue.d.ts +3 -4
- package/es/src/ap-grid/editable/form-item.vue.d.ts +2 -4
- package/es/src/ap-grid/editable/index.vue.d.ts +2 -4
- package/es/src/ap-grid/index.vue.d.ts +2 -4
- package/es/src/ap-grid/utils/table.mjs +2 -2
- package/es/src/ap-list/index.vue.d.ts +2 -4
- package/es/src/ap-modal/utils/confirm.d.ts +1 -1
- package/es/src/ap-pro-card/components/card/index.vue2.mjs +2 -2
- package/es/src/ap-table/ap-table.vue.d.ts +2 -4
- package/es/src/ap-table/components/setting/context.d.ts +1 -1
- package/es/src/ap-table/components/setting/context.mjs +1 -1
- package/es/src/ap-table/components/setting/modal/index.vue.mjs +127 -117
- package/es/src/ap-table/components/setting/sorter/context.mjs +1 -1
- package/es/src/ap-table/components/setting/template/edit-form.vue.d.ts +2 -3
- package/es/src/ap-table/constants.d.ts +20 -22
- package/es/src/ap-table/context.mjs +1 -1
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +9 -9
- package/es/src/ap-table/hooks/use-table-template-storage.d.ts +9 -9
- package/es/src/ap-table/hooks/use-table-template-storage.mjs +102 -95
- package/es/src/ap-table/utils.mjs +1 -1
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +1 -1
- package/es/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/es/src/business/ap-download/hooks/index.mjs +1 -1
- package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue.d.ts +1 -1
- package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue2.mjs +1 -3
- package/es/src/business/ap-draggable-grid/index.d.ts +1 -1
- package/es/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +2 -4
- package/es/src/business/ap-keep-alive/hook.mjs +1 -1
- package/es/src/business/ap-keep-alive/utils.mjs +1 -1
- package/es/src/business/ap-select-layout/index.d.ts +2 -4
- package/es/src/business/ap-select-layout/select-layout.vue.d.ts +2 -4
- package/es/src/business/ap-table-modal/index.d.ts +17 -5
- package/es/src/business/ap-upload/components/MultipleFile.vue.d.ts +1 -1
- package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +128 -112
- package/es/src/business/ap-value-select-card/index.vue.d.ts +2 -4
- package/es/src/business/ap-view/ap-view.vue.d.ts +1 -1
- package/es/src/business/ap-view/ap-view.vue2.mjs +87 -81
- package/es/src/business/ap-view/components/main-button-content.vue.d.ts +2 -3
- package/es/src/business/ap-view/components/menu-list-content.vue.d.ts +2 -3
- package/es/src/business/ap-view/hooks/use-send-to-url.d.ts +2 -0
- package/es/src/business/ap-view/hooks/use-send-to-url.mjs +46 -30
- package/es/src/business/ap-view/hooks/use-view-provide.mjs +1 -1
- package/es/src/business/ap-view/index.d.ts +3 -3
- package/es/src/business/ap-view/interface.d.ts +7 -1
- package/es/src/check-card/context.mjs +1 -1
- package/es/src/config-provider/constants.mjs +1 -1
- package/es/src/config-provider/hooks/use-locale.mjs +1 -1
- package/es/src/config-provider/hooks/use-namespace.d.ts +5 -1
- package/es/src/config-provider/hooks/use-namespace.mjs +1 -1
- package/es/src/config-provider/hooks/use-token.mjs +1 -1
- package/es/src/editable-table/form-item.vue.d.ts +2 -4
- package/es/src/editable-table/index.vue.d.ts +2 -4
- package/es/src/editable-table/utils.mjs +1 -1
- package/es/src/scroll-view/index.vue.d.ts +5 -5
- package/es/src/tests/wrapper.d.ts +4 -4
- package/es/src/text/context.mjs +1 -1
- package/es/src/time-ago/useTimeAgo.mjs +1 -1
- package/es/src/type.d.ts +1 -0
- package/es/src/utils/slot.mjs +1 -1
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/editable/form-item.vue.d.ts +2 -4
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/index.vue.d.ts +2 -4
- package/lib/src/ag-grid/editable/index.vue.js +1 -1
- package/lib/src/ag-grid/editable/interface.d.ts +15 -1
- package/lib/src/ag-grid/hooks/use-columns.js +1 -1
- package/lib/src/ag-grid/hooks/use-pinned-row.js +1 -1
- package/lib/src/ag-grid/index.vue.d.ts +2 -4
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +40 -1
- package/lib/src/ag-grid/utils.d.ts +18 -0
- package/lib/src/ag-grid/utils.js +1 -1
- package/lib/src/ap-field/cascader/use-options.d.ts +4 -4
- package/lib/src/ap-field/date/index.vue.d.ts +0 -1
- package/lib/src/ap-field/date-range/index.vue.d.ts +0 -1
- package/lib/src/ap-field/select/use-select-options.d.ts +2 -2
- package/lib/src/ap-field/text/password.vue.d.ts +4 -4
- package/lib/src/ap-field/tree-select/use-request.d.ts +4 -4
- package/lib/src/ap-form/ap-form.vue.d.ts +1 -2
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/drawer-form/index.vue.d.ts +3 -4
- package/lib/src/ap-form/interface.d.ts +4 -0
- package/lib/src/ap-form/item/index.vue.d.ts +6 -6
- package/lib/src/ap-form/items/date/index.vue.d.ts +9 -11
- package/lib/src/ap-form/items/date-range/index.vue.d.ts +13 -15
- package/lib/src/ap-form/items/number/index.vue.d.ts +2 -3
- package/lib/src/ap-form/items/select/index.vue.d.ts +8 -8
- package/lib/src/ap-form/modal-form/index.vue.d.ts +3 -4
- package/lib/src/ap-form/search-form/index.vue.d.ts +3 -4
- package/lib/src/ap-grid/editable/form-item.vue.d.ts +2 -4
- package/lib/src/ap-grid/editable/index.vue.d.ts +2 -4
- package/lib/src/ap-grid/index.vue.d.ts +2 -4
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-list/index.vue.d.ts +2 -4
- package/lib/src/ap-modal/utils/confirm.d.ts +1 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +2 -4
- package/lib/src/ap-table/components/setting/context.d.ts +1 -1
- package/lib/src/ap-table/components/setting/modal/index.vue.js +1 -1
- package/lib/src/ap-table/components/setting/template/edit-form.vue.d.ts +2 -3
- package/lib/src/ap-table/constants.d.ts +20 -22
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/ap-table/hooks/use-table-template-storage.d.ts +9 -9
- package/lib/src/ap-table/hooks/use-table-template-storage.js +1 -1
- package/lib/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue.d.ts +1 -1
- package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue2.js +1 -1
- package/lib/src/business/ap-draggable-grid/index.d.ts +1 -1
- package/lib/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +2 -4
- package/lib/src/business/ap-select-layout/index.d.ts +2 -4
- package/lib/src/business/ap-select-layout/select-layout.vue.d.ts +2 -4
- package/lib/src/business/ap-table-modal/index.d.ts +17 -5
- package/lib/src/business/ap-upload/components/MultipleFile.vue.d.ts +1 -1
- package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
- package/lib/src/business/ap-value-select-card/index.vue.d.ts +2 -4
- package/lib/src/business/ap-view/ap-view.vue.d.ts +1 -1
- package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
- package/lib/src/business/ap-view/components/main-button-content.vue.d.ts +2 -3
- package/lib/src/business/ap-view/components/menu-list-content.vue.d.ts +2 -3
- package/lib/src/business/ap-view/hooks/use-send-to-url.d.ts +2 -0
- package/lib/src/business/ap-view/hooks/use-send-to-url.js +1 -1
- package/lib/src/business/ap-view/index.d.ts +3 -3
- package/lib/src/business/ap-view/interface.d.ts +7 -1
- package/lib/src/config-provider/hooks/use-namespace.d.ts +5 -1
- package/lib/src/editable-table/form-item.vue.d.ts +2 -4
- package/lib/src/editable-table/index.vue.d.ts +2 -4
- package/lib/src/scroll-view/index.vue.d.ts +5 -5
- package/lib/src/tests/wrapper.d.ts +4 -4
- package/lib/src/time-ago/useTimeAgo.js +1 -1
- package/lib/src/type.d.ts +1 -0
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { provide as r, inject as t, ref as n } from "vue";
|
|
2
|
-
const o = Symbol("agGridExpandableKey"), i = Symbol("agGridSorterContextKey");
|
|
2
|
+
const o = /* @__PURE__ */ Symbol("agGridExpandableKey"), i = /* @__PURE__ */ Symbol("agGridSorterContextKey");
|
|
3
3
|
function d(e) {
|
|
4
4
|
r(o, e);
|
|
5
5
|
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { Recordable } from '../../type';
|
|
2
2
|
import { EditableAgGridFormItemExpose, EditableAgGridFormItemProps } from './interface';
|
|
3
|
-
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode
|
|
3
|
+
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
|
|
4
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
5
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & EditableAgGridFormItemProps<RecordType> & Partial<{}>> & PublicProps;
|
|
6
6
|
expose(exposed: ShallowUnwrapRef<EditableAgGridFormItemExpose<RecordType>>): void;
|
|
7
7
|
attrs: any;
|
|
8
8
|
slots: Readonly<Record<string, any>> & Record<string, any>;
|
|
9
9
|
emit: {};
|
|
10
|
-
}>) => VNode
|
|
11
|
-
[key: string]: any;
|
|
12
|
-
}> & {
|
|
10
|
+
}>) => VNode & {
|
|
13
11
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
14
12
|
};
|
|
15
13
|
export default _default;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { cloneDeep as u, isEqual as
|
|
3
|
-
import { ApForm as
|
|
4
|
-
import { useInjectForm as
|
|
5
|
-
import { useWatch as
|
|
6
|
-
import { getModelValue as
|
|
7
|
-
import { transformValues as
|
|
1
|
+
import { defineComponent as G, useSlots as W, ref as y, onMounted as U, watch as $, unref as r, createElementBlock as q, openBlock as J, Fragment as Q, createVNode as f, mergeProps as h, withCtx as C, createSlots as X, renderList as Y, renderSlot as Z, normalizeProps as ee, guardReactiveProps as oe } from "vue";
|
|
2
|
+
import { cloneDeep as u, isEqual as te, omit as ae } from "lodash-unified";
|
|
3
|
+
import { ApForm as b } from "../../ap-form/index.mjs";
|
|
4
|
+
import { useInjectForm as ne } from "../../ap-form/context.mjs";
|
|
5
|
+
import { useWatch as le } from "../../ap-form/hooks/use-watch.mjs";
|
|
6
|
+
import { getModelValue as re } from "../../ap-form/utils/get.mjs";
|
|
7
|
+
import { transformValues as ie } from "../../ap-form/utils/transform.mjs";
|
|
8
8
|
import "../../config-provider/index.mjs";
|
|
9
|
-
import { useGetEditableColumns as
|
|
10
|
-
import { useEditableFormItemApi as
|
|
9
|
+
import { useGetEditableColumns as se } from "../hooks/use-editable-columns.mjs";
|
|
10
|
+
import { useEditableFormItemApi as me } from "../hooks/use-editable-form-item-api.mjs";
|
|
11
11
|
import "../index.vue2.mjs";
|
|
12
|
-
import
|
|
13
|
-
import { getShadowName as
|
|
14
|
-
import { getColumnTransformOptions as
|
|
15
|
-
import { useNamespace as
|
|
16
|
-
import { useGlobalConfig as
|
|
17
|
-
import
|
|
18
|
-
const
|
|
12
|
+
import ue from "../style/editable.mjs";
|
|
13
|
+
import { getShadowName as de } from "../utils.mjs";
|
|
14
|
+
import { getColumnTransformOptions as pe, arrayToObject as R, getRowKey as fe } from "./utils.mjs";
|
|
15
|
+
import { useNamespace as ce } from "../../config-provider/hooks/use-namespace.mjs";
|
|
16
|
+
import { useGlobalConfig as we } from "../../config-provider/hooks/use-global-config.mjs";
|
|
17
|
+
import ge from "../index.vue.mjs";
|
|
18
|
+
const Ke = /* @__PURE__ */ G({
|
|
19
19
|
name: "EditableGrid",
|
|
20
20
|
__name: "form-item",
|
|
21
21
|
props: {
|
|
@@ -128,6 +128,7 @@ const Ne = /* @__PURE__ */ L({
|
|
|
128
128
|
animateRows: {
|
|
129
129
|
type: Boolean
|
|
130
130
|
},
|
|
131
|
+
plugins: {},
|
|
131
132
|
columns: {},
|
|
132
133
|
defaultValue: {},
|
|
133
134
|
onChange: {},
|
|
@@ -137,112 +138,122 @@ const Ne = /* @__PURE__ */ L({
|
|
|
137
138
|
name: {},
|
|
138
139
|
formItem: {}
|
|
139
140
|
},
|
|
140
|
-
setup(
|
|
141
|
+
setup(v, {
|
|
141
142
|
expose: B
|
|
142
143
|
}) {
|
|
143
|
-
const
|
|
144
|
-
b:
|
|
145
|
-
} =
|
|
146
|
-
internalInstance:
|
|
147
|
-
} =
|
|
148
|
-
function
|
|
149
|
-
const
|
|
150
|
-
if (!Object.keys(
|
|
144
|
+
const x = W(), a = v, {
|
|
145
|
+
b: S
|
|
146
|
+
} = ce("editable-aggrid"), I = ue("editable-aggrid"), m = y(), {
|
|
147
|
+
internalInstance: n
|
|
148
|
+
} = ne();
|
|
149
|
+
function F(e) {
|
|
150
|
+
const o = pe(a.columns || []);
|
|
151
|
+
if (!Object.keys(o).length || !e?.length)
|
|
151
152
|
return e;
|
|
152
|
-
let
|
|
153
|
-
for (const
|
|
154
|
-
|
|
155
|
-
return
|
|
153
|
+
let t = [];
|
|
154
|
+
for (const s of e)
|
|
155
|
+
t.push(ie(s, o));
|
|
156
|
+
return t;
|
|
156
157
|
}
|
|
157
|
-
const i =
|
|
158
|
-
let
|
|
159
|
-
|
|
160
|
-
const e =
|
|
161
|
-
e && (
|
|
158
|
+
const i = de(a.name);
|
|
159
|
+
let c = [];
|
|
160
|
+
U(() => {
|
|
161
|
+
const e = a.formItem?.initialValue ?? re(n?.getInitialValues() ?? {}, a.name);
|
|
162
|
+
e && (n?.updateInitialModel(i, R(u(e), a.rowKey)), c = u(e), l.value || j(u(e), "suffix", !0));
|
|
162
163
|
});
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
const l = y([]), T = le(a.name);
|
|
165
|
+
$(() => T.value, (e) => {
|
|
166
|
+
te(e, l.value) || w(e ?? u(c));
|
|
166
167
|
}, {
|
|
167
168
|
deep: !0,
|
|
168
169
|
flush: "post",
|
|
169
170
|
immediate: !0
|
|
170
171
|
});
|
|
171
|
-
const E =
|
|
172
|
-
add:
|
|
173
|
-
addMultiple:
|
|
174
|
-
__addMultiple:
|
|
175
|
-
remove:
|
|
172
|
+
const E = we("valueTypeMap"), V = se(a, E, i), {
|
|
173
|
+
add: N,
|
|
174
|
+
addMultiple: _,
|
|
175
|
+
__addMultiple: j,
|
|
176
|
+
remove: K,
|
|
176
177
|
removeByKey: k,
|
|
177
178
|
getRowData: D,
|
|
178
179
|
getRowsData: O,
|
|
179
180
|
setRowData: z,
|
|
180
181
|
clear: H,
|
|
181
182
|
refreshRowIds: d
|
|
182
|
-
} =
|
|
183
|
-
function
|
|
184
|
-
const e =
|
|
183
|
+
} = me(a, n, l, i);
|
|
184
|
+
function L() {
|
|
185
|
+
const e = m.value?._internalGridApi;
|
|
185
186
|
if (!d.value?.length || !e)
|
|
186
187
|
return;
|
|
187
|
-
const
|
|
188
|
+
const o = d.value.map((t) => e.getRowNode(t)).filter((t) => !!t);
|
|
188
189
|
e.refreshCells({
|
|
189
|
-
rowNodes:
|
|
190
|
+
rowNodes: o,
|
|
190
191
|
force: !0
|
|
191
192
|
}), d.value = [];
|
|
192
193
|
}
|
|
193
|
-
function
|
|
194
|
-
|
|
195
|
-
const
|
|
196
|
-
|
|
194
|
+
function w(e) {
|
|
195
|
+
l.value = [...e];
|
|
196
|
+
const o = R(e, a.rowKey);
|
|
197
|
+
n?.setFieldValue(a.name, [...e]), n?.setFieldValue(i, o);
|
|
197
198
|
}
|
|
198
|
-
function
|
|
199
|
-
const
|
|
200
|
-
|
|
199
|
+
function g(e, o) {
|
|
200
|
+
const t = e === "end" ? l.value.length - 1 : e;
|
|
201
|
+
m.value?.scrollToRow(t, o);
|
|
201
202
|
}
|
|
202
|
-
function M(e,
|
|
203
|
-
|
|
203
|
+
function M(e, o) {
|
|
204
|
+
m.value?.scrollToColumn(e, o);
|
|
205
|
+
}
|
|
206
|
+
function P(e, o) {
|
|
207
|
+
const t = [i, String(e), o].flat();
|
|
208
|
+
return n?.validateFields([t]);
|
|
209
|
+
}
|
|
210
|
+
function A(e) {
|
|
211
|
+
const t = r(l).map((s, p) => [i, String(fe(s, p, a.rowKey)), e].flat());
|
|
212
|
+
return n?.validateFields(t);
|
|
204
213
|
}
|
|
205
214
|
return B({
|
|
206
|
-
add:
|
|
207
|
-
addMultiple:
|
|
208
|
-
remove:
|
|
215
|
+
add: N,
|
|
216
|
+
addMultiple: _,
|
|
217
|
+
remove: K,
|
|
209
218
|
removeByKey: k,
|
|
210
219
|
getRowData: D,
|
|
211
220
|
getRowsData: O,
|
|
212
221
|
setRowData: z,
|
|
213
222
|
clear: H,
|
|
214
|
-
setTableData:
|
|
215
|
-
scrollTo:
|
|
216
|
-
scrollToRow:
|
|
223
|
+
setTableData: w,
|
|
224
|
+
scrollTo: g,
|
|
225
|
+
scrollToRow: g,
|
|
217
226
|
scrollToColumn: M,
|
|
218
|
-
|
|
219
|
-
|
|
227
|
+
validateCell: P,
|
|
228
|
+
validateColumn: A,
|
|
229
|
+
table: m
|
|
230
|
+
}), (e, o) => (J(), q(Q, null, [f(r(b).FormItem, {
|
|
220
231
|
hidden: "",
|
|
221
232
|
name: e.name,
|
|
222
233
|
"initial-value": e.formItem?.initialValue,
|
|
223
|
-
transform:
|
|
224
|
-
}, null, 8, ["name", "initial-value"]),
|
|
234
|
+
transform: F
|
|
235
|
+
}, null, 8, ["name", "initial-value"]), f(r(b).FormItem, h({
|
|
225
236
|
label: e.label
|
|
226
237
|
}, e.formItem), {
|
|
227
|
-
default:
|
|
238
|
+
default: C(() => [f(ge, h(r(ae)(a, ["name", "maxLength", "onChange", "defaultValue", "formItem"]), {
|
|
228
239
|
ref_key: "tableRef",
|
|
229
|
-
ref:
|
|
230
|
-
class: [
|
|
240
|
+
ref: m,
|
|
241
|
+
class: [r(S)(), r(I)],
|
|
231
242
|
size: "mini",
|
|
232
|
-
columns:
|
|
233
|
-
"data-source":
|
|
243
|
+
columns: r(V),
|
|
244
|
+
"data-source": l.value,
|
|
234
245
|
"search-form": !1,
|
|
235
|
-
onUpdate:
|
|
236
|
-
}),
|
|
246
|
+
onUpdate: L
|
|
247
|
+
}), X({
|
|
237
248
|
_: 2
|
|
238
|
-
}, [
|
|
239
|
-
name:
|
|
240
|
-
fn:
|
|
249
|
+
}, [Y(x, (t, s) => ({
|
|
250
|
+
name: s,
|
|
251
|
+
fn: C((p) => [Z(e.$slots, s, ee(oe(p || {})))])
|
|
241
252
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
242
253
|
_: 3
|
|
243
254
|
}, 16, ["label"])], 64));
|
|
244
255
|
}
|
|
245
256
|
});
|
|
246
257
|
export {
|
|
247
|
-
|
|
258
|
+
Ke as default
|
|
248
259
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Recordable } from '../../type';
|
|
2
2
|
import { EditableAgGridExpose, EditableAgGridProps } from './interface';
|
|
3
|
-
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode
|
|
3
|
+
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
|
|
4
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
5
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
6
6
|
readonly "onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -9,9 +9,7 @@ declare const _default: <RecordType extends Recordable = any>(__VLS_props: NonNu
|
|
|
9
9
|
attrs: any;
|
|
10
10
|
slots: Readonly<Record<string, any>> & Record<string, any>;
|
|
11
11
|
emit: (event: "update:value", ...args: any[]) => void;
|
|
12
|
-
}>) => VNode
|
|
13
|
-
[key: string]: any;
|
|
14
|
-
}> & {
|
|
12
|
+
}>) => VNode & {
|
|
15
13
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
16
14
|
};
|
|
17
15
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as M, useSlots as $, ref as h, watch as q, unref as l, createBlock as J, openBlock as Q, withCtx as
|
|
1
|
+
import { defineComponent as M, useSlots as $, ref as h, watch as q, unref as l, createBlock as J, openBlock as Q, withCtx as m, createVNode as b, mergeProps as X, createSlots as Y, renderList as Z, renderSlot as ee, normalizeProps as oe, guardReactiveProps as ae } from "vue";
|
|
2
2
|
import { isEqual as te, isArray as v, omit as ne } from "lodash-unified";
|
|
3
3
|
import { ApForm as c } from "../../ap-form/index.mjs";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
@@ -10,8 +10,8 @@ import se from "../style/editable.mjs";
|
|
|
10
10
|
import { arrayToObject as f, getRowKey as ie } from "./utils.mjs";
|
|
11
11
|
import { useNamespace as de } from "../../config-provider/hooks/use-namespace.mjs";
|
|
12
12
|
import { useControllableValue as ue } from "../../hooks/useControllableValue.mjs";
|
|
13
|
-
import { useGlobalConfig as
|
|
14
|
-
import
|
|
13
|
+
import { useGlobalConfig as pe } from "../../config-provider/hooks/use-global-config.mjs";
|
|
14
|
+
import me from "../index.vue.mjs";
|
|
15
15
|
const Fe = /* @__PURE__ */ M({
|
|
16
16
|
name: "EditableGrid",
|
|
17
17
|
__name: "index",
|
|
@@ -125,6 +125,7 @@ const Fe = /* @__PURE__ */ M({
|
|
|
125
125
|
animateRows: {
|
|
126
126
|
type: Boolean
|
|
127
127
|
},
|
|
128
|
+
plugins: {},
|
|
128
129
|
columns: {},
|
|
129
130
|
value: {},
|
|
130
131
|
defaultValue: {},
|
|
@@ -153,7 +154,7 @@ const Fe = /* @__PURE__ */ M({
|
|
|
153
154
|
}, {
|
|
154
155
|
deep: !0
|
|
155
156
|
});
|
|
156
|
-
const K =
|
|
157
|
+
const K = pe("valueTypeMap"), k = re(a, K), {
|
|
157
158
|
add: A,
|
|
158
159
|
addMultiple: N,
|
|
159
160
|
remove: j,
|
|
@@ -183,7 +184,7 @@ const Fe = /* @__PURE__ */ M({
|
|
|
183
184
|
function g(e) {
|
|
184
185
|
try {
|
|
185
186
|
const o = Object.keys(e), t = s.value.map((n) => ie(n, void 0, a.rowKey));
|
|
186
|
-
return o.sort((n, u) => t.findIndex((
|
|
187
|
+
return o.sort((n, u) => t.findIndex((p) => String(p) === n) - t.findIndex((p) => String(p) === u)), o.map((n) => e[n]);
|
|
187
188
|
} catch {
|
|
188
189
|
return e;
|
|
189
190
|
}
|
|
@@ -235,11 +236,11 @@ const Fe = /* @__PURE__ */ M({
|
|
|
235
236
|
height: "100%"
|
|
236
237
|
}
|
|
237
238
|
}, {
|
|
238
|
-
default:
|
|
239
|
+
default: m(() => [b(l(c).FormItem, {
|
|
239
240
|
name: e.name,
|
|
240
241
|
"no-style": ""
|
|
241
242
|
}, {
|
|
242
|
-
default:
|
|
243
|
+
default: m(() => [b(me, X(l(ne)(a, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue"]), {
|
|
243
244
|
ref_key: "tableRef",
|
|
244
245
|
ref: i,
|
|
245
246
|
class: [l(T)(), l(F)],
|
|
@@ -252,7 +253,7 @@ const Fe = /* @__PURE__ */ M({
|
|
|
252
253
|
_: 2
|
|
253
254
|
}, [Z(S, (t, n) => ({
|
|
254
255
|
name: n,
|
|
255
|
-
fn:
|
|
256
|
+
fn: m((u) => [ee(e.$slots, n, oe(ae(u || {})))])
|
|
256
257
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
257
258
|
_: 3
|
|
258
259
|
}, 8, ["name"])]),
|
|
@@ -87,7 +87,21 @@ export type EditableAgGridExpose<RecordType = any, ModelType = RecordType[]> = O
|
|
|
87
87
|
validateFieldsReturnTransformed: EditableTableExpose<ModelType, RecordType>['validateFields'];
|
|
88
88
|
table: AgGridExpose;
|
|
89
89
|
};
|
|
90
|
-
export type EditableAgGridFormItemExpose<RecordType = any, ModelType = RecordType[]> = Omit<EditableAgGridExpose<RecordType, ModelType>, 'resetFields' | 'validateFields' | 'validateFieldsReturnTransformed'
|
|
90
|
+
export type EditableAgGridFormItemExpose<RecordType = any, ModelType = RecordType[]> = Omit<EditableAgGridExpose<RecordType, ModelType>, 'resetFields' | 'validateFields' | 'validateFieldsReturnTransformed'> & {
|
|
91
|
+
/**
|
|
92
|
+
* 校验单元格
|
|
93
|
+
* @param rowId 行唯一标识
|
|
94
|
+
* @param field 字段
|
|
95
|
+
* @returns
|
|
96
|
+
*/
|
|
97
|
+
validateCell: (rowId: any, field: NamePath) => any;
|
|
98
|
+
/**
|
|
99
|
+
* 校验列
|
|
100
|
+
* @param colKey 列唯一标识
|
|
101
|
+
* @returns
|
|
102
|
+
*/
|
|
103
|
+
validateColumn: (colKey: string | number) => any;
|
|
104
|
+
};
|
|
91
105
|
export type EditableAgGridFormItemProps<RecordType = any> = Omit<EditableAgGridProps<RecordType>, 'name' | 'value' | 'onUpdate:value'> & {
|
|
92
106
|
label?: string;
|
|
93
107
|
/**
|
|
@@ -1,30 +1,38 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { getStringKey as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
1
|
+
import { ref as s, computed as c, watch as y } from "vue";
|
|
2
|
+
import { getStringKey as a, runPipelineHooks as C } from "../utils.mjs";
|
|
3
|
+
const w = (o) => {
|
|
4
|
+
const r = s([]), u = s([]);
|
|
5
5
|
function l(n = []) {
|
|
6
6
|
return n.filter((e) => !e.hideInTable).map((e) => {
|
|
7
7
|
if (e.children?.length) {
|
|
8
|
-
const
|
|
9
|
-
return
|
|
8
|
+
const t = l(e.children);
|
|
9
|
+
return t?.length ? {
|
|
10
10
|
...e,
|
|
11
|
-
children:
|
|
11
|
+
children: t
|
|
12
12
|
} : null;
|
|
13
13
|
}
|
|
14
14
|
return e;
|
|
15
15
|
}).filter(Boolean);
|
|
16
16
|
}
|
|
17
17
|
function f(n) {
|
|
18
|
-
return
|
|
18
|
+
return r.value.find((e) => a(e.key) === n);
|
|
19
19
|
}
|
|
20
|
-
const m =
|
|
21
|
-
() =>
|
|
20
|
+
const m = c(
|
|
21
|
+
() => r.value.map((n) => a(n.key)).filter(Boolean)
|
|
22
22
|
);
|
|
23
|
-
|
|
23
|
+
async function d(n, e) {
|
|
24
|
+
return await C(
|
|
25
|
+
o.plugins,
|
|
26
|
+
n,
|
|
27
|
+
(t) => t.beforeColumnsChange?.bind(t),
|
|
28
|
+
e
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
y(
|
|
24
32
|
() => o.columns,
|
|
25
|
-
() => {
|
|
26
|
-
const n = l(o.columns);
|
|
27
|
-
|
|
33
|
+
async () => {
|
|
34
|
+
const n = l(o.columns), e = await d(n, r.value);
|
|
35
|
+
r.value = e, u.value = e, o.onShownColumnsChange?.(e);
|
|
28
36
|
},
|
|
29
37
|
{
|
|
30
38
|
deep: !0,
|
|
@@ -34,27 +42,27 @@ const C = (o) => {
|
|
|
34
42
|
function i(n) {
|
|
35
43
|
for (const e of n)
|
|
36
44
|
if (e.children) {
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
-
return
|
|
45
|
+
const t = i(e.children);
|
|
46
|
+
if (t)
|
|
47
|
+
return t;
|
|
40
48
|
} else if (e.defaultSortOrder) {
|
|
41
|
-
const
|
|
49
|
+
const t = e.field ?? e.dataIndex ?? e.key;
|
|
42
50
|
return {
|
|
43
51
|
colKey: e.key,
|
|
44
|
-
field:
|
|
52
|
+
field: t,
|
|
45
53
|
order: e.defaultSortOrder
|
|
46
54
|
};
|
|
47
55
|
}
|
|
48
56
|
}
|
|
49
|
-
const
|
|
57
|
+
const h = c(() => i(r.value));
|
|
50
58
|
return {
|
|
51
|
-
columns:
|
|
59
|
+
columns: r,
|
|
52
60
|
shownColumns: u,
|
|
53
61
|
columnKeys: m,
|
|
54
62
|
getTargetColumnByKey: f,
|
|
55
|
-
defaultSortOrder:
|
|
63
|
+
defaultSortOrder: h
|
|
56
64
|
};
|
|
57
65
|
};
|
|
58
66
|
export {
|
|
59
|
-
|
|
67
|
+
w as useColumns
|
|
60
68
|
};
|
|
@@ -16,7 +16,7 @@ const P = (r) => {
|
|
|
16
16
|
};
|
|
17
17
|
});
|
|
18
18
|
return {
|
|
19
|
-
getRowPinnedCellClass: (o) => (n) => {
|
|
19
|
+
getRowPinnedCellClass: (o) => ((n) => {
|
|
20
20
|
let t;
|
|
21
21
|
const { cellClassName: e } = r.value || {};
|
|
22
22
|
return !n.node.rowPinned || !e ? t = [o(n)] : t = [
|
|
@@ -28,7 +28,7 @@ const P = (r) => {
|
|
|
28
28
|
n.rowIndex
|
|
29
29
|
) : e
|
|
30
30
|
], t.flat().filter(Boolean);
|
|
31
|
-
},
|
|
31
|
+
}),
|
|
32
32
|
rowPinnedGridConfig: d
|
|
33
33
|
};
|
|
34
34
|
};
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { Recordable } from '../type';
|
|
2
2
|
import { AgGridExpose, AgGridProps, AgGridSlots } from './interface';
|
|
3
|
-
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode
|
|
3
|
+
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
|
|
4
4
|
declare const _default: <RecordType extends Recordable>(__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
5
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & AgGridProps<RecordType> & Partial<{}>> & PublicProps;
|
|
6
6
|
expose(exposed: ShallowUnwrapRef<AgGridExpose>): void;
|
|
7
7
|
attrs: any;
|
|
8
8
|
slots: Readonly<AgGridSlots<RecordType>> & AgGridSlots<RecordType>;
|
|
9
9
|
emit: {};
|
|
10
|
-
}>) => VNode
|
|
11
|
-
[key: string]: any;
|
|
12
|
-
}> & {
|
|
10
|
+
}>) => VNode & {
|
|
13
11
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
14
12
|
};
|
|
15
13
|
export default _default;
|