@aplus-frontend/ui 7.12.6 → 7.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/src/ag-grid/components/loading/index.vue.d.ts +3 -0
- package/es/src/ag-grid/components/loading/index.vue.mjs +4 -0
- package/es/src/ag-grid/components/loading/index.vue2.mjs +18 -0
- package/es/src/ag-grid/context.mjs +1 -1
- package/es/src/ag-grid/editable/form-item.vue.mjs +33 -31
- package/es/src/ag-grid/editable/index.vue.mjs +1 -0
- package/es/src/ag-grid/hooks/use-pinned-row.mjs +2 -2
- package/es/src/ag-grid/index.vue.mjs +209 -202
- package/es/src/ag-grid/interface.d.ts +4 -0
- package/es/src/ag-grid/style/index.mjs +8 -5
- package/es/src/ap-drawer/interface.d.ts +13 -2
- package/es/src/ap-drawer/utils/createDrawer.mjs +37 -32
- package/es/src/ap-field/select/index.vue.d.ts +1 -2
- package/es/src/ap-field/select/index.vue.mjs +126 -88
- package/es/src/ap-field/style/index.mjs +8 -6
- package/es/src/ap-field/style/select.d.ts +2 -0
- package/es/src/ap-field/style/select.mjs +43 -0
- package/es/src/ap-form/context.mjs +1 -1
- package/es/src/ap-form/item-group/helper.mjs +2 -2
- package/es/src/ap-form/items/select/index.vue.d.ts +4 -8
- package/es/src/ap-form/provider/context.mjs +1 -1
- package/es/src/ap-grid/utils/table.mjs +2 -2
- package/es/src/ap-pro-card/components/card/index.vue2.mjs +2 -2
- package/es/src/ap-table/ap-table.vue2.mjs +15 -16
- package/es/src/ap-table/components/setting/context.d.ts +17 -0
- package/es/src/ap-table/components/setting/context.mjs +18 -0
- package/es/src/ap-table/components/setting/modal/index.vue.d.ts +1 -1
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +220 -88
- package/es/src/ap-table/components/setting/sorter/context.mjs +1 -1
- package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +49 -51
- package/es/src/ap-table/components/setting/template/edit-form.vue.d.ts +844 -0
- package/es/src/ap-table/components/setting/template/edit-form.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/template/edit-form.vue2.mjs +74 -0
- package/es/src/ap-table/components/setting/template/index.vue.d.ts +11 -0
- package/es/src/ap-table/components/setting/template/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/template/index.vue2.mjs +51 -0
- package/es/src/ap-table/components/setting/template/item.vue.d.ts +13 -0
- package/es/src/ap-table/components/setting/template/item.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/template/item.vue2.mjs +78 -0
- package/es/src/ap-table/components/setting/tree-select/index.vue.d.ts +1 -1
- package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +26 -29
- package/es/src/ap-table/components/setting/utils.d.ts +1 -0
- package/es/src/ap-table/components/setting/utils.mjs +22 -15
- package/es/src/ap-table/constants.d.ts +2 -4
- package/es/src/ap-table/context.mjs +1 -1
- package/es/src/ap-table/hooks/use-table-column-state.d.ts +4 -23
- package/es/src/ap-table/hooks/use-table-column-state.mjs +32 -120
- package/es/src/ap-table/hooks/use-table-template-storage.d.ts +49 -0
- package/es/src/ap-table/hooks/use-table-template-storage.mjs +150 -0
- package/es/src/ap-table/interface.d.ts +26 -3
- package/es/src/ap-table/style/index.d.ts +1 -0
- package/es/src/ap-table/style/index.mjs +2 -1
- package/es/src/ap-table/style/setting.d.ts +2 -0
- package/es/src/ap-table/style/setting.mjs +114 -19
- 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/ag-grid-modal/style/index.mjs +7 -7
- package/es/src/business/ap-attachment/ApAttachment.mjs +96 -89
- package/es/src/business/ap-attachment/style/index.mjs +33 -16
- package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +24 -22
- package/es/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +1 -1
- package/es/src/business/ap-batch-action-group/MenuItemGroup.vue2.mjs +35 -31
- package/es/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/es/src/business/ap-batch-action-group/interface.d.ts +1 -1
- package/es/src/business/ap-download/hooks/index.mjs +1 -1
- package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue2.mjs +1 -3
- 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-upload/components/MultipleFile.vue2.mjs +19 -19
- package/es/src/business/ap-upload/components/Picture.vue2.mjs +34 -34
- package/es/src/business/ap-value-select-card/style/index.mjs +3 -2
- package/es/src/business/ap-view/components/menu-list-content.vue2.mjs +21 -21
- package/es/src/business/ap-view/hooks/use-view-provide.mjs +1 -1
- package/es/src/business/ap-view/style/index.mjs +2 -2
- 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.mjs +1 -1
- package/es/src/config-provider/hooks/use-token.mjs +1 -1
- package/es/src/design-token/index.mjs +5 -5
- package/es/src/editable-table/utils.mjs +1 -1
- package/es/src/locale/lang/en.mjs +15 -4
- package/es/src/locale/lang/zh-cn.mjs +18 -7
- package/es/src/text/context.mjs +1 -1
- package/es/src/time-ago/useTimeAgo.mjs +26 -27
- package/es/src/utils/data-range-persets.d.ts +13 -1
- package/es/src/utils/data-range-persets.mjs +80 -60
- package/es/src/utils/index.d.ts +1 -0
- package/es/src/utils/index.mjs +56 -48
- package/es/src/utils/retry.d.ts +12 -0
- package/es/src/utils/retry.mjs +27 -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/components/loading/index.vue.d.ts +3 -0
- package/lib/src/ag-grid/components/loading/index.vue.js +1 -0
- package/lib/src/ag-grid/components/loading/index.vue2.js +1 -0
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/index.vue.js +1 -1
- package/lib/src/ag-grid/hooks/use-pinned-row.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +4 -0
- package/lib/src/ag-grid/style/index.js +1 -1
- package/lib/src/ap-drawer/interface.d.ts +13 -2
- package/lib/src/ap-drawer/utils/createDrawer.js +1 -1
- package/lib/src/ap-field/select/index.vue.d.ts +1 -2
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-field/style/index.js +1 -1
- package/lib/src/ap-field/style/select.d.ts +2 -0
- package/lib/src/ap-field/style/select.js +1 -0
- package/lib/src/ap-form/items/select/index.vue.d.ts +4 -8
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/context.d.ts +17 -0
- package/lib/src/ap-table/components/setting/context.js +1 -0
- package/lib/src/ap-table/components/setting/modal/index.vue.d.ts +1 -1
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/sorter/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/template/edit-form.vue.d.ts +844 -0
- package/lib/src/ap-table/components/setting/template/edit-form.vue.js +1 -0
- package/lib/src/ap-table/components/setting/template/edit-form.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/template/index.vue.d.ts +11 -0
- package/lib/src/ap-table/components/setting/template/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/template/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/template/item.vue.d.ts +13 -0
- package/lib/src/ap-table/components/setting/template/item.vue.js +1 -0
- package/lib/src/ap-table/components/setting/template/item.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/tree-select/index.vue.d.ts +1 -1
- package/lib/src/ap-table/components/setting/tree-select/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/utils.d.ts +1 -0
- package/lib/src/ap-table/components/setting/utils.js +1 -1
- package/lib/src/ap-table/constants.d.ts +2 -4
- package/lib/src/ap-table/hooks/use-table-column-state.d.ts +4 -23
- package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
- package/lib/src/ap-table/hooks/use-table-template-storage.d.ts +49 -0
- package/lib/src/ap-table/hooks/use-table-template-storage.js +1 -0
- package/lib/src/ap-table/interface.d.ts +26 -3
- package/lib/src/ap-table/style/index.d.ts +1 -0
- package/lib/src/ap-table/style/index.js +1 -1
- package/lib/src/ap-table/style/setting.d.ts +2 -0
- package/lib/src/ap-table/style/setting.js +1 -1
- package/lib/src/business/ag-grid-modal/style/index.js +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/lib/src/business/ap-attachment/style/index.js +1 -1
- package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.js +1 -1
- package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +1 -1
- package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue2.js +1 -1
- package/lib/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/lib/src/business/ap-batch-action-group/interface.d.ts +1 -1
- package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue2.js +1 -1
- package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
- package/lib/src/business/ap-upload/components/Picture.vue2.js +1 -1
- package/lib/src/business/ap-value-select-card/style/index.js +1 -1
- package/lib/src/business/ap-view/components/menu-list-content.vue2.js +1 -1
- package/lib/src/business/ap-view/style/index.js +1 -1
- package/lib/src/design-token/index.js +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/time-ago/useTimeAgo.js +1 -1
- package/lib/src/utils/data-range-persets.d.ts +13 -1
- package/lib/src/utils/data-range-persets.js +1 -1
- package/lib/src/utils/index.d.ts +1 -0
- package/lib/src/utils/index.js +1 -1
- package/lib/src/utils/retry.d.ts +12 -0
- package/lib/src/utils/retry.js +1 -0
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +2 -2
|
@@ -161,7 +161,7 @@ const $e = /* @__PURE__ */ ee({
|
|
|
161
161
|
transform: m.value ? "rotate(-90deg)" : "rotate(0deg)"
|
|
162
162
|
}
|
|
163
163
|
}, null)]), O = (e, l = []) => {
|
|
164
|
-
if (e?.type === Symbol.for("v-fgt")) {
|
|
164
|
+
if (e?.type === /* @__PURE__ */ Symbol.for("v-fgt")) {
|
|
165
165
|
const r = Array.isArray(e?.children) ? e?.children : [e?.children];
|
|
166
166
|
if (r?.length)
|
|
167
167
|
for (let o = 0; o < r.length; o++)
|
|
@@ -174,7 +174,7 @@ const $e = /* @__PURE__ */ ee({
|
|
|
174
174
|
return E(!1), a(f, null, [e?.reduce((l, r) => {
|
|
175
175
|
const o = O(r);
|
|
176
176
|
return [...l, ...o];
|
|
177
|
-
}, [])?.filter((l) => l.type !== Symbol.for("v-cmt"))?.map((l, r, o) => {
|
|
177
|
+
}, [])?.filter((l) => l.type !== /* @__PURE__ */ Symbol.for("v-cmt"))?.map((l, r, o) => {
|
|
178
178
|
if (l && typeof l == "object" && "type" in l && l.type?.isProCard === !0) {
|
|
179
179
|
E(!0);
|
|
180
180
|
const c = l?.props?.colSpan || l?.props?.["col-span"] || {}, {
|
|
@@ -148,7 +148,6 @@ const Qr = /* @__PURE__ */ je({
|
|
|
148
148
|
default: !1
|
|
149
149
|
},
|
|
150
150
|
settings: {
|
|
151
|
-
type: [Boolean, Object],
|
|
152
151
|
default: void 0
|
|
153
152
|
}
|
|
154
153
|
},
|
|
@@ -194,10 +193,10 @@ const Qr = /* @__PURE__ */ je({
|
|
|
194
193
|
}).filter(Boolean)), Ce = n(() => pe(o(s), (e) => {
|
|
195
194
|
if (e.filters && !e.onFilter)
|
|
196
195
|
return e.key || e?.dataIndex;
|
|
197
|
-
}).filter(Boolean)), Te = n(() => g(r.dataSource) ? y.records : r.dataSource),
|
|
196
|
+
}).filter(Boolean)), Te = n(() => g(r.dataSource) ? y.records : r.dataSource), xe = n(() => fe(r.manual) ? r.manual : Ye(b.searchFormExtra?.() || []).some((a) => a.type?.name === "ApView")), {
|
|
198
197
|
rowSelection: T,
|
|
199
|
-
selectedRows:
|
|
200
|
-
...
|
|
198
|
+
selectedRows: x,
|
|
199
|
+
...F
|
|
201
200
|
} = nr({
|
|
202
201
|
fixed: !0,
|
|
203
202
|
...r.rowSelection === !0 ? {} : r.rowSelection,
|
|
@@ -210,7 +209,7 @@ const Qr = /* @__PURE__ */ je({
|
|
|
210
209
|
tableProps: q,
|
|
211
210
|
refresh: M,
|
|
212
211
|
data: y,
|
|
213
|
-
setDataSource:
|
|
212
|
+
setDataSource: Fe,
|
|
214
213
|
getColumnSFConfig: G,
|
|
215
214
|
sortedInfo: Be,
|
|
216
215
|
filteredInfo: ke,
|
|
@@ -220,7 +219,7 @@ const Qr = /* @__PURE__ */ je({
|
|
|
220
219
|
getLastParams: Pe
|
|
221
220
|
} = lr({
|
|
222
221
|
async request(e) {
|
|
223
|
-
if (!T.value.preserveSelectedRowKeys && g(r.dataSource) && !P.value &&
|
|
222
|
+
if (!T.value.preserveSelectedRowKeys && g(r.dataSource) && !P.value && F.clearAll(), P.value && (P.value = !1), !g(r.dataSource))
|
|
224
223
|
return {
|
|
225
224
|
data: r.dataSource || [],
|
|
226
225
|
total: r.dataSource.length || 0
|
|
@@ -235,7 +234,7 @@ const Qr = /* @__PURE__ */ je({
|
|
|
235
234
|
sortFields: Re,
|
|
236
235
|
params: _e(r, "params"),
|
|
237
236
|
defaultData: r.defaultData,
|
|
238
|
-
manual: o(
|
|
237
|
+
manual: o(xe),
|
|
239
238
|
formatParams: r.beforeSearchSubmit,
|
|
240
239
|
pagination: r.pagination
|
|
241
240
|
});
|
|
@@ -367,7 +366,7 @@ const Qr = /* @__PURE__ */ je({
|
|
|
367
366
|
B(() => o(y).loading, (e) => {
|
|
368
367
|
r.onLoadingChange?.(e);
|
|
369
368
|
}), B(() => r.dataSource, (e) => {
|
|
370
|
-
|
|
369
|
+
Fe(e);
|
|
371
370
|
}, {
|
|
372
371
|
immediate: !0
|
|
373
372
|
});
|
|
@@ -402,8 +401,8 @@ const Qr = /* @__PURE__ */ je({
|
|
|
402
401
|
getShownColumns: Oe,
|
|
403
402
|
dataSource: n(() => o(y).records),
|
|
404
403
|
rowSelection: {
|
|
405
|
-
selectedRows: n(() => o(
|
|
406
|
-
...
|
|
404
|
+
selectedRows: n(() => o(x)),
|
|
405
|
+
...F
|
|
407
406
|
},
|
|
408
407
|
scrollBar: {
|
|
409
408
|
x: {
|
|
@@ -455,20 +454,20 @@ const Qr = /* @__PURE__ */ je({
|
|
|
455
454
|
}, [L("div", {
|
|
456
455
|
class: m(o(O)("header", "title"))
|
|
457
456
|
}, [v(e.$slots, "title", z({
|
|
458
|
-
selectedRows: o(
|
|
457
|
+
selectedRows: o(x),
|
|
459
458
|
selectedRowKeys: o(T).selectedRowKeys,
|
|
460
459
|
shownColumns: s.value
|
|
461
|
-
},
|
|
460
|
+
}, F))], 2), b.title ? (f(), ue(o(Ge), {
|
|
462
461
|
key: 0,
|
|
463
462
|
type: "vertical"
|
|
464
463
|
})) : le("", !0), p(vr, {
|
|
465
|
-
config: e.settings
|
|
464
|
+
config: e.settings
|
|
466
465
|
}, null, 8, ["config"])], 2)) : v(e.$slots, "title", z({
|
|
467
466
|
key: 1,
|
|
468
|
-
selectedRows: o(
|
|
467
|
+
selectedRows: o(x),
|
|
469
468
|
selectedRowKeys: o(T).selectedRowKeys,
|
|
470
469
|
shownColumns: s.value
|
|
471
|
-
},
|
|
470
|
+
}, F))], 2), p(o(Je), z({
|
|
472
471
|
ref_key: "antdTableRef",
|
|
473
472
|
ref: $,
|
|
474
473
|
class: o(d)("table")
|
|
@@ -481,7 +480,7 @@ const Qr = /* @__PURE__ */ je({
|
|
|
481
480
|
summary: w(() => [v(e.$slots, "summary", {
|
|
482
481
|
columns: s.value,
|
|
483
482
|
records: Q.value.dataSource,
|
|
484
|
-
selectedRows: o(
|
|
483
|
+
selectedRows: o(x)
|
|
485
484
|
})]),
|
|
486
485
|
_: 2
|
|
487
486
|
}, [o(j) ? {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { InjectionKey, Ref } from 'vue';
|
|
2
|
+
import { ApTableSettingType } from '../../interface';
|
|
3
|
+
type ApColumnSettingContextProps = {
|
|
4
|
+
/**
|
|
5
|
+
* 当前选中的模版
|
|
6
|
+
*/
|
|
7
|
+
activeKey: Ref<string>;
|
|
8
|
+
/**
|
|
9
|
+
* 缓存设置
|
|
10
|
+
*/
|
|
11
|
+
cacheConfig: Ref<ApTableSettingType>;
|
|
12
|
+
deleteTemplate: (key: string) => void;
|
|
13
|
+
};
|
|
14
|
+
export declare const ApColumnSettingContextKey: InjectionKey<ApColumnSettingContextProps>;
|
|
15
|
+
export declare function useProvideApColumnSetting(state: ApColumnSettingContextProps): void;
|
|
16
|
+
export declare function useInjectApColumnSetting(): ApColumnSettingContextProps;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { provide as o, inject as i, ref as e } from "vue";
|
|
2
|
+
const t = /* @__PURE__ */ Symbol("ap-column-setting");
|
|
3
|
+
function u(n) {
|
|
4
|
+
o(t, n);
|
|
5
|
+
}
|
|
6
|
+
function m() {
|
|
7
|
+
return i(t, {
|
|
8
|
+
activeKey: e(),
|
|
9
|
+
cacheConfig: e(),
|
|
10
|
+
deleteTemplate: () => {
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
t as ApColumnSettingContextKey,
|
|
16
|
+
m as useInjectApColumnSetting,
|
|
17
|
+
u as useProvideApColumnSetting
|
|
18
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApTableSettingModalProps } from '../../interface';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
-
import { ApTableSettingType } from '
|
|
3
|
+
import { ApTableSettingType } from '../../../interface';
|
|
4
4
|
type TableSettingModalSlots = {
|
|
5
5
|
trigger?: any;
|
|
6
6
|
};
|
|
@@ -1,135 +1,267 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { SettingOutlined as
|
|
3
|
-
import { Button as
|
|
1
|
+
import { defineComponent as re, ref as v, computed as pe, toRef as ue, useSlots as ce, createVNode as l, cloneVNode as me, unref as e, watch as O, createElementBlock as U, openBlock as S, Fragment as de, createBlock as w, createCommentVNode as E, resolveDynamicComponent as A, withCtx as o, withDirectives as fe, createElementVNode as c, normalizeClass as p, toDisplayString as g, createTextVNode as C, isRef as ve, vShow as ge } from "vue";
|
|
2
|
+
import { SettingOutlined as ye, SaveOutlined as Se } from "@ant-design/icons-vue";
|
|
3
|
+
import { Button as P, Modal as Te, Divider as B, RadioGroup as be, RadioButton as j, Flex as ke, Space as F, Popover as Ce } from "@aplus-frontend/antdv";
|
|
4
|
+
import "../../../../ap-button/index.mjs";
|
|
5
|
+
import { randomStr as he } from "../../../../utils/index.mjs";
|
|
4
6
|
import "../../../../config-provider/index.mjs";
|
|
5
|
-
import { getSingleVNode as
|
|
6
|
-
import { useInjectApTable as
|
|
7
|
-
import { useTableColumnState as
|
|
8
|
-
import
|
|
7
|
+
import { getSingleVNode as _e } from "../../../../utils/slot.mjs";
|
|
8
|
+
import { useInjectApTable as ze } from "../../../context.mjs";
|
|
9
|
+
import { useTableColumnState as xe } from "../../../hooks/use-table-column-state.mjs";
|
|
10
|
+
import { useTableTemplateStorage as we } from "../../../hooks/use-table-template-storage.mjs";
|
|
11
|
+
import Ae from "../../../style/setting.mjs";
|
|
12
|
+
import { useProvideApColumnSetting as Be } from "../context.mjs";
|
|
9
13
|
import "../sorter/index.vue.mjs";
|
|
14
|
+
import "../template/edit-form.vue.mjs";
|
|
15
|
+
import "../template/index.vue.mjs";
|
|
10
16
|
import "../tree-select/index.vue.mjs";
|
|
11
|
-
import
|
|
12
|
-
import { useLocale as
|
|
13
|
-
import { useNamespace as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
+
import Ne, { customCloneColumnStates as N, isEqualColumnStateIgnoreLabel as Ie } from "../utils.mjs";
|
|
18
|
+
import { useLocale as $e } from "../../../../config-provider/hooks/use-locale.mjs";
|
|
19
|
+
import { useNamespace as M } from "../../../../config-provider/hooks/use-namespace.mjs";
|
|
20
|
+
import Ke from "../template/index.vue2.mjs";
|
|
21
|
+
import Le from "../tree-select/index.vue2.mjs";
|
|
22
|
+
import Re from "../sorter/index.vue2.mjs";
|
|
23
|
+
import Ve from "../../../../ap-button/ap-button.vue.mjs";
|
|
24
|
+
import De from "../template/edit-form.vue2.mjs";
|
|
25
|
+
const Oe = {
|
|
26
|
+
style: {
|
|
27
|
+
"padding-inline": "8px"
|
|
28
|
+
}
|
|
29
|
+
}, pt = /* @__PURE__ */ re({
|
|
17
30
|
name: "ApTableSetting",
|
|
18
31
|
__name: "index",
|
|
19
32
|
props: {
|
|
20
33
|
config: {
|
|
21
|
-
default: () => ({
|
|
34
|
+
default: () => ({
|
|
35
|
+
persistenceKey: ""
|
|
36
|
+
})
|
|
22
37
|
}
|
|
23
38
|
},
|
|
24
|
-
setup(
|
|
25
|
-
const
|
|
26
|
-
columnsBackup:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
} =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
39
|
+
setup(q) {
|
|
40
|
+
const T = q, {
|
|
41
|
+
columnsBackup: G,
|
|
42
|
+
updateSize: H,
|
|
43
|
+
updateColumns: J
|
|
44
|
+
} = ze(), m = v(), h = pe(() => T.config.persistenceKey), _ = `${h.value}__active_key`, b = v(!1), {
|
|
45
|
+
basicTemplate: Q,
|
|
46
|
+
customizeTemplateList: d,
|
|
47
|
+
addTemplate: W,
|
|
48
|
+
deleteTemplate: I,
|
|
49
|
+
updateTemplate: X
|
|
50
|
+
} = we(T.config, h), {
|
|
51
|
+
columnState: u,
|
|
52
|
+
setColumnState: $,
|
|
53
|
+
isAllSelected: Y,
|
|
54
|
+
toggleSelectAll: Z
|
|
55
|
+
} = xe([]), i = v(localStorage.getItem(_) ?? d.value?.[0].key);
|
|
56
|
+
Be({
|
|
57
|
+
activeKey: i,
|
|
58
|
+
cacheConfig: ue(T, "config"),
|
|
59
|
+
deleteTemplate: ie
|
|
60
|
+
});
|
|
61
|
+
const {
|
|
62
|
+
t: s
|
|
63
|
+
} = $e(), {
|
|
64
|
+
b: f,
|
|
65
|
+
be: k
|
|
66
|
+
} = M("ap-column-setting"), {
|
|
67
|
+
b: ee
|
|
68
|
+
} = M("ap-table"), te = Ae("ap-column-setting"), y = v(!1), K = v(!1), ae = ce(), L = _e(ae.trigger) || l(P, {
|
|
69
|
+
icon: l(ye, null, null),
|
|
70
|
+
class: ee("setting-trigger-button")
|
|
71
|
+
}, null), R = L ? me(L, {
|
|
49
72
|
onClick: () => {
|
|
50
|
-
|
|
73
|
+
y.value = !0;
|
|
51
74
|
}
|
|
52
75
|
}) : null;
|
|
53
|
-
function
|
|
54
|
-
|
|
76
|
+
function le() {
|
|
77
|
+
$(N(e(Q).columnState));
|
|
78
|
+
}
|
|
79
|
+
function V(a, t) {
|
|
80
|
+
J?.(Ne(e(G), a)), H?.(t);
|
|
81
|
+
}
|
|
82
|
+
function ne() {
|
|
83
|
+
V(e(u), e(m)), y.value = !1;
|
|
84
|
+
const a = N(u.value), t = X(i.value, {
|
|
85
|
+
columnState: a,
|
|
86
|
+
size: m.value
|
|
87
|
+
});
|
|
88
|
+
localStorage.setItem(_, i.value), T.config?.onChange?.(a, t);
|
|
89
|
+
}
|
|
90
|
+
function oe(a) {
|
|
91
|
+
const t = he();
|
|
92
|
+
W({
|
|
93
|
+
key: t,
|
|
94
|
+
label: a,
|
|
95
|
+
columnState: u.value,
|
|
96
|
+
size: m.value
|
|
97
|
+
}), b.value = !1, i.value = t;
|
|
98
|
+
}
|
|
99
|
+
function D(a) {
|
|
100
|
+
const t = [...d.value].find((n) => n?.key === a);
|
|
101
|
+
t && ($(N(t.columnState)), m.value = t.size);
|
|
55
102
|
}
|
|
56
|
-
function
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
103
|
+
function ie(a) {
|
|
104
|
+
if (a !== i.value) {
|
|
105
|
+
I(a);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const t = d.value, n = t.findIndex((x) => x.key === a), r = t[n + 1]?.key ?? t[n - 1]?.key;
|
|
109
|
+
I(a), i.value = r;
|
|
110
|
+
}
|
|
111
|
+
function se(a) {
|
|
112
|
+
if (K.value = a, !a) {
|
|
113
|
+
const t = localStorage.getItem(_);
|
|
114
|
+
t && t !== i.value && (i.value = t);
|
|
115
|
+
}
|
|
60
116
|
}
|
|
61
|
-
|
|
117
|
+
O(() => i.value, (a, t) => {
|
|
118
|
+
if (!t && a) {
|
|
119
|
+
const n = [...d.value].find((r) => r?.key === a);
|
|
120
|
+
if (!n)
|
|
121
|
+
return;
|
|
122
|
+
V(n.columnState, n.size);
|
|
123
|
+
}
|
|
124
|
+
D(a);
|
|
125
|
+
}, {
|
|
126
|
+
immediate: !0
|
|
127
|
+
});
|
|
128
|
+
const z = v(!1);
|
|
129
|
+
return O([m, u, y], ([a, t, n]) => {
|
|
130
|
+
if (!n)
|
|
131
|
+
return;
|
|
132
|
+
const r = d.value.find((x) => x.key === i.value);
|
|
133
|
+
r && (r.size !== a || !Ie(t, r.columnState)) ? z.value = !0 : z.value = !1;
|
|
134
|
+
}, {
|
|
135
|
+
deep: !0
|
|
136
|
+
}), (a, t) => (S(), U(de, null, [e(R) ? (S(), w(A(e(R)), {
|
|
62
137
|
key: 0
|
|
63
|
-
})) :
|
|
64
|
-
open:
|
|
65
|
-
"onUpdate:open":
|
|
66
|
-
title: e(
|
|
67
|
-
width:
|
|
138
|
+
})) : E("", !0), l(e(Te), {
|
|
139
|
+
open: y.value,
|
|
140
|
+
"onUpdate:open": t[4] || (t[4] = (n) => y.value = n),
|
|
141
|
+
title: e(s)("ap.apTable.setting.title"),
|
|
142
|
+
width: 1e3,
|
|
68
143
|
centered: !0,
|
|
69
144
|
"body-style": {
|
|
70
145
|
padding: "0px !important",
|
|
71
|
-
height: "
|
|
146
|
+
height: "516px"
|
|
72
147
|
},
|
|
73
|
-
"after-open-change":
|
|
74
|
-
"wrap-class-name": `${e(
|
|
75
|
-
|
|
148
|
+
"after-open-change": se,
|
|
149
|
+
"wrap-class-name": `${e(f)()} ${e(te)}`,
|
|
150
|
+
"ok-text": e(s)("ap.apTable.setting.saveAndApply"),
|
|
151
|
+
onOk: ne
|
|
76
152
|
}, {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
153
|
+
footer: o(({
|
|
154
|
+
extra: n
|
|
155
|
+
}) => [l(e(ke), {
|
|
156
|
+
justify: "space-between"
|
|
157
|
+
}, {
|
|
158
|
+
default: o(() => [l(e(F), {
|
|
159
|
+
size: 12
|
|
160
|
+
}, {
|
|
161
|
+
default: o(() => [l(e(Ce), {
|
|
162
|
+
open: b.value,
|
|
163
|
+
"onUpdate:open": t[3] || (t[3] = (r) => b.value = r),
|
|
164
|
+
trigger: "click",
|
|
165
|
+
arrow: !1,
|
|
166
|
+
placement: "topLeft",
|
|
167
|
+
"destroy-tooltip-on-hide": ""
|
|
168
|
+
}, {
|
|
169
|
+
content: o(() => [l(De, {
|
|
170
|
+
onConfirm: oe,
|
|
171
|
+
onCancel: t[2] || (t[2] = () => b.value = !1)
|
|
172
|
+
})]),
|
|
173
|
+
default: o(() => [l(e(Ve), {
|
|
174
|
+
type: "borderLink",
|
|
175
|
+
disabled: !a.config.persistenceKey
|
|
176
|
+
}, {
|
|
177
|
+
icon: o(() => [l(e(Se))]),
|
|
178
|
+
default: o(() => [C(g(e(s)("ap.apTable.setting.saveAsTemplate")) + " ", 1)]),
|
|
179
|
+
_: 1
|
|
180
|
+
}, 8, ["disabled"])]),
|
|
181
|
+
_: 1
|
|
182
|
+
}, 8, ["open"]), z.value ? (S(), U("span", {
|
|
183
|
+
key: 0,
|
|
184
|
+
class: p(e(f)("modify-tip"))
|
|
185
|
+
}, g(e(s)("ap.apTable.setting.modifyNotification")), 3)) : E("", !0)]),
|
|
186
|
+
_: 1
|
|
187
|
+
}), l(e(F), {
|
|
188
|
+
size: 10
|
|
189
|
+
}, {
|
|
190
|
+
default: o(() => [(S(), w(A(n.cancelBtn))), (S(), w(A(n.okBtn)))]),
|
|
191
|
+
_: 2
|
|
192
|
+
}, 1024)]),
|
|
193
|
+
_: 2
|
|
194
|
+
}, 1024)]),
|
|
195
|
+
default: o(() => [fe(c("div", {
|
|
196
|
+
class: p(e(f)("wrapper"))
|
|
197
|
+
}, [c("div", {
|
|
198
|
+
class: p(e(f)("left"))
|
|
199
|
+
}, [l(Ke, {
|
|
200
|
+
"customize-template-list": e(d),
|
|
201
|
+
"persistence-key": h.value,
|
|
202
|
+
onActiveChange: D
|
|
203
|
+
}, null, 8, ["customize-template-list", "persistence-key"])], 2), l(e(B), {
|
|
204
|
+
type: "vertical",
|
|
205
|
+
style: {
|
|
206
|
+
height: "100%",
|
|
207
|
+
margin: "0px"
|
|
208
|
+
}
|
|
209
|
+
}), c("div", {
|
|
210
|
+
class: p(e(f)("center"))
|
|
211
|
+
}, [c("div", {
|
|
212
|
+
class: p(e(k)("center", "header"))
|
|
213
|
+
}, [c("div", {
|
|
214
|
+
class: p(e(k)("center", "tip-wrapper"))
|
|
215
|
+
}, [c("span", {
|
|
216
|
+
class: p(e(k)("center", "header-tips"))
|
|
217
|
+
}, g(e(s)("ap.apTable.setting.selectAllTip")), 3), l(e(P), {
|
|
86
218
|
type: "link",
|
|
87
219
|
size: "small",
|
|
88
|
-
onClick: e(
|
|
220
|
+
onClick: e(Z)
|
|
89
221
|
}, {
|
|
90
|
-
default:
|
|
222
|
+
default: o(() => [C(g(e(Y) ? e(s)("ap.apTable.setting.unSelectAll") : e(s)("ap.apTable.setting.selectAll")), 1)]),
|
|
91
223
|
_: 1
|
|
92
|
-
}, 8, ["onClick"])]),
|
|
93
|
-
value:
|
|
94
|
-
"onUpdate:value":
|
|
224
|
+
}, 8, ["onClick"])], 2), l(e(be), {
|
|
225
|
+
value: m.value,
|
|
226
|
+
"onUpdate:value": t[0] || (t[0] = (n) => m.value = n)
|
|
95
227
|
}, {
|
|
96
|
-
default:
|
|
228
|
+
default: o(() => [l(e(j), {
|
|
97
229
|
value: "small"
|
|
98
230
|
}, {
|
|
99
|
-
default:
|
|
231
|
+
default: o(() => [C(g(e(s)("ap.apTable.setting.sizeSmall")), 1)]),
|
|
100
232
|
_: 1
|
|
101
|
-
}),
|
|
233
|
+
}), l(e(j), {
|
|
102
234
|
value: "middle"
|
|
103
235
|
}, {
|
|
104
|
-
default:
|
|
236
|
+
default: o(() => [C(g(e(s)("ap.apTable.setting.sizeNormal")), 1)]),
|
|
105
237
|
_: 1
|
|
106
238
|
})]),
|
|
107
239
|
_: 1
|
|
108
|
-
}, 8, ["value"])], 2),
|
|
240
|
+
}, 8, ["value"])], 2), c("div", Oe, [l(e(B), {
|
|
109
241
|
dashed: "",
|
|
110
242
|
style: {
|
|
111
243
|
margin: "0px"
|
|
112
244
|
}
|
|
113
|
-
}),
|
|
114
|
-
class:
|
|
115
|
-
value: e(
|
|
116
|
-
}, null, 8, ["class", "value"])], 2),
|
|
245
|
+
})]), l(Le, {
|
|
246
|
+
class: p(e(k)("center", "content")),
|
|
247
|
+
value: e(u)
|
|
248
|
+
}, null, 8, ["class", "value"])], 2), l(e(B), {
|
|
117
249
|
type: "vertical",
|
|
118
250
|
style: {
|
|
119
251
|
height: "100%",
|
|
120
252
|
margin: "0px"
|
|
121
253
|
}
|
|
122
|
-
}),
|
|
123
|
-
class:
|
|
124
|
-
}, [
|
|
125
|
-
value: e(
|
|
126
|
-
"onUpdate:value":
|
|
127
|
-
onReset:
|
|
128
|
-
}, null, 8, ["value"])], 2)], 2), [[
|
|
254
|
+
}), c("div", {
|
|
255
|
+
class: p(e(f)("right"))
|
|
256
|
+
}, [l(Re, {
|
|
257
|
+
value: e(u),
|
|
258
|
+
"onUpdate:value": t[1] || (t[1] = (n) => ve(u) ? u.value = n : null),
|
|
259
|
+
onReset: le
|
|
260
|
+
}, null, 8, ["value"])], 2)], 2), [[ge, K.value]])]),
|
|
129
261
|
_: 1
|
|
130
|
-
}, 8, ["open", "title", "
|
|
262
|
+
}, 8, ["open", "title", "wrap-class-name", "ok-text"])], 64));
|
|
131
263
|
}
|
|
132
264
|
});
|
|
133
265
|
export {
|
|
134
|
-
|
|
266
|
+
pt as default
|
|
135
267
|
};
|