@aplus-frontend/ui 7.13.12 → 7.14.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/index.mjs +58 -56
- package/es/src/ap-field/text/index.vue2.mjs +2 -2
- package/es/src/ap-field/text/password.vue.mjs +8 -8
- package/es/src/ap-form/ap-form.vue.d.ts +1 -0
- package/es/src/ap-form/ap-form.vue2.mjs +122 -106
- package/es/src/ap-form/drawer-form/index.vue.d.ts +4 -0
- package/es/src/ap-form/drawer-form/index.vue.mjs +13 -10
- package/es/src/ap-form/interface.d.ts +5 -0
- package/es/src/ap-form/item/index.vue.d.ts +1 -0
- package/es/src/ap-form/item/index.vue.mjs +84 -70
- package/es/src/ap-form/items/checkbox/index.vue.mjs +9 -8
- package/es/src/ap-form/items/date/index.vue.mjs +10 -9
- package/es/src/ap-form/items/date-range/index.vue.mjs +10 -9
- package/es/src/ap-form/items/number/index.vue.mjs +7 -6
- package/es/src/ap-form/items/radio/index.vue.mjs +9 -8
- package/es/src/ap-form/items/select/index.vue.mjs +3 -2
- package/es/src/ap-form/items/switch/index.vue.mjs +10 -9
- package/es/src/ap-form/items/text/index.vue2.mjs +6 -5
- package/es/src/ap-form/items/text/password.vue.mjs +10 -9
- package/es/src/ap-form/items/text-area/index.vue.mjs +4 -3
- package/es/src/ap-form/items/tree-select/index.vue.mjs +1 -0
- package/es/src/ap-form/modal-form/index.vue.d.ts +4 -0
- package/es/src/ap-form/modal-form/index.vue.mjs +3 -0
- package/es/src/ap-form/render/item.vue.mjs +6 -5
- package/es/src/ap-form/search-form/index.vue.d.ts +4 -0
- package/es/src/ap-form/search-form/index.vue.mjs +26 -23
- package/es/src/ap-table/ap-table.vue2.mjs +2 -2
- package/es/src/ap-table/components/setting/index.d.ts +2 -0
- package/es/src/ap-table/components/setting/index.mjs +5 -0
- package/es/src/ap-table/components/setting/modal/index.vue.mjs +277 -2
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +2 -273
- package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +11 -8
- package/es/src/ap-table/components/setting/template/edit-form.vue.d.ts +2 -0
- package/es/src/ap-table/components/setting/template/item.vue2.mjs +35 -35
- package/es/src/ap-table/hooks/use-table-template-storage.mjs +55 -54
- package/es/src/ap-table/index.d.ts +2 -2
- package/es/src/ap-table/index.mjs +7 -6
- package/es/src/ap-table/interface.d.ts +16 -0
- package/es/src/business/ap-image/ApImage.vue2.mjs +32 -32
- package/es/src/business/ap-image/style/index.mjs +9 -8
- package/es/src/business/ap-size-input/form-item.vue.mjs +6 -5
- package/es/src/business/ap-view/components/main-button-content.vue.d.ts +2 -0
- package/es/src/business/ap-view/components/menu-list-content.vue.d.ts +2 -0
- package/es/src/business/batch-input-group/form-item.vue.mjs +8 -7
- package/es/src/index.mjs +54 -52
- package/es/src/locale/lang/en.mjs +1 -0
- package/es/src/locale/lang/zh-cn.mjs +1 -0
- package/es/src/render/render.d.ts +7 -4
- package/es/src/render/render.mjs +17 -7
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/index.js +1 -1
- package/lib/src/ap-field/text/index.vue2.js +1 -1
- package/lib/src/ap-field/text/password.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue.d.ts +1 -0
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/drawer-form/index.vue.d.ts +4 -0
- package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
- package/lib/src/ap-form/interface.d.ts +5 -0
- package/lib/src/ap-form/item/index.vue.d.ts +1 -0
- package/lib/src/ap-form/item/index.vue.js +1 -1
- package/lib/src/ap-form/items/checkbox/index.vue.js +1 -1
- package/lib/src/ap-form/items/date/index.vue.js +1 -1
- package/lib/src/ap-form/items/date-range/index.vue.js +1 -1
- package/lib/src/ap-form/items/number/index.vue.js +1 -1
- package/lib/src/ap-form/items/radio/index.vue.js +1 -1
- package/lib/src/ap-form/items/select/index.vue.js +1 -1
- package/lib/src/ap-form/items/switch/index.vue.js +1 -1
- package/lib/src/ap-form/items/text/index.vue2.js +1 -1
- package/lib/src/ap-form/items/text/password.vue.js +1 -1
- package/lib/src/ap-form/items/text-area/index.vue.js +1 -1
- package/lib/src/ap-form/items/tree-select/index.vue.js +1 -1
- package/lib/src/ap-form/modal-form/index.vue.d.ts +4 -0
- package/lib/src/ap-form/modal-form/index.vue.js +1 -1
- package/lib/src/ap-form/render/item.vue.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.d.ts +4 -0
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/index.d.ts +2 -0
- package/lib/src/ap-table/components/setting/index.js +1 -0
- package/lib/src/ap-table/components/setting/modal/index.vue.js +1 -1
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/select-group/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/template/edit-form.vue.d.ts +2 -0
- package/lib/src/ap-table/components/setting/template/item.vue2.js +1 -1
- package/lib/src/ap-table/hooks/use-table-template-storage.js +1 -1
- package/lib/src/ap-table/index.d.ts +2 -2
- package/lib/src/ap-table/index.js +1 -1
- package/lib/src/ap-table/interface.d.ts +16 -0
- package/lib/src/business/ap-image/ApImage.vue2.js +1 -1
- package/lib/src/business/ap-image/style/index.js +1 -1
- package/lib/src/business/ap-size-input/form-item.vue.js +1 -1
- package/lib/src/business/ap-view/components/main-button-content.vue.d.ts +2 -0
- package/lib/src/business/ap-view/components/menu-list-content.vue.d.ts +2 -0
- package/lib/src/business/batch-input-group/form-item.vue.js +1 -1
- package/lib/src/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/render/render.d.ts +7 -4
- package/lib/src/render/render.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,279 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent as ce, ref as v, computed as pe, toRef as me, useSlots as de, createVNode as n, cloneVNode as fe, unref as e, watch as x, createElementBlock as P, openBlock as T, Fragment as ge, createBlock as A, createCommentVNode as j, resolveDynamicComponent as w, withCtx as o, withDirectives as ve, createElementVNode as m, normalizeClass as u, toDisplayString as y, createTextVNode as h, isRef as ye, vShow as Se } from "vue";
|
|
2
|
+
import { SettingOutlined as Te, SaveOutlined as Ce } from "@ant-design/icons-vue";
|
|
3
|
+
import { Button as F, Modal as be, Divider as B, RadioGroup as he, RadioButton as M, Flex as ke, Space as q, Popover as _e } from "@aplus-frontend/antdv";
|
|
4
|
+
import "../../../../ap-button/index.mjs";
|
|
5
|
+
import { randomStr as ze } from "../../../../utils/index.mjs";
|
|
6
|
+
import "../../../../config-provider/index.mjs";
|
|
7
|
+
import { getSingleVNode as xe } from "../../../../utils/slot.mjs";
|
|
8
|
+
import { useInjectApTable as Ae } from "../../../context.mjs";
|
|
9
|
+
import { useTableColumnState as we } from "../../../hooks/use-table-column-state.mjs";
|
|
10
|
+
import { useTableTemplateStorage as Be } from "../../../hooks/use-table-template-storage.mjs";
|
|
11
|
+
import Ke from "../../../style/setting.mjs";
|
|
12
|
+
import { useProvideApColumnSetting as Ne } from "../context.mjs";
|
|
13
|
+
import "../sorter/index.vue.mjs";
|
|
14
|
+
import "../template/edit-form.vue.mjs";
|
|
15
|
+
import "../template/index.vue.mjs";
|
|
16
|
+
import "../tree-select/index.vue.mjs";
|
|
17
|
+
import $e, { customCloneColumnStates as K, isEqualColumnStateIgnoreLabel as Ie } from "../utils.mjs";
|
|
18
|
+
import { useLocale as Le } from "../../../../config-provider/hooks/use-locale.mjs";
|
|
19
|
+
import { useNamespace as G } from "../../../../config-provider/hooks/use-namespace.mjs";
|
|
20
|
+
import Re from "../template/index.vue2.mjs";
|
|
21
|
+
import Ve from "../tree-select/index.vue2.mjs";
|
|
22
|
+
import De from "../sorter/index.vue2.mjs";
|
|
23
|
+
import Oe from "../../../../ap-button/ap-button.vue.mjs";
|
|
24
|
+
import Ue from "../template/edit-form.vue2.mjs";
|
|
25
|
+
const Ee = {
|
|
26
|
+
style: {
|
|
27
|
+
"padding-inline": "8px"
|
|
28
|
+
}
|
|
29
|
+
}, pt = /* @__PURE__ */ ce({
|
|
30
|
+
name: "ApTableSetting",
|
|
31
|
+
__name: "index",
|
|
32
|
+
props: {
|
|
33
|
+
config: {
|
|
34
|
+
default: () => ({
|
|
35
|
+
persistenceKey: ""
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
setup(H) {
|
|
40
|
+
const c = H, {
|
|
41
|
+
columnsBackup: J,
|
|
42
|
+
updateSize: Q,
|
|
43
|
+
updateColumns: W
|
|
44
|
+
} = Ae(), d = v(), k = pe(() => c.config.persistenceKey), C = v(!1), {
|
|
45
|
+
basicTemplate: X,
|
|
46
|
+
customizeTemplateList: f,
|
|
47
|
+
addTemplate: Y,
|
|
48
|
+
deleteTemplate: N,
|
|
49
|
+
updateTemplate: Z
|
|
50
|
+
} = Be(c.config, k), {
|
|
51
|
+
columnState: p,
|
|
52
|
+
setColumnState: $,
|
|
53
|
+
isAllSelected: ee,
|
|
54
|
+
toggleSelectAll: te
|
|
55
|
+
} = we([]), I = `${k.value}__active_key`;
|
|
56
|
+
function L(a) {
|
|
57
|
+
localStorage.setItem(I, a);
|
|
58
|
+
}
|
|
59
|
+
function R() {
|
|
60
|
+
return localStorage.getItem(I);
|
|
61
|
+
}
|
|
62
|
+
const i = v(c.config.defaultActiveKey ?? R() ?? f.value?.[0].key);
|
|
63
|
+
Ne({
|
|
64
|
+
activeKey: i,
|
|
65
|
+
cacheConfig: me(c, "config"),
|
|
66
|
+
deleteTemplate: re
|
|
67
|
+
});
|
|
68
|
+
const {
|
|
69
|
+
t: r
|
|
70
|
+
} = Le(), {
|
|
71
|
+
b: g,
|
|
72
|
+
be: b
|
|
73
|
+
} = G("ap-column-setting"), {
|
|
74
|
+
b: ae
|
|
75
|
+
} = G("ap-table"), le = Ke("ap-column-setting"), S = v(!1), V = v(!1), ne = de(), D = xe(ne.trigger) || n(F, {
|
|
76
|
+
icon: n(Te, null, null),
|
|
77
|
+
class: ae("setting-trigger-button")
|
|
78
|
+
}, null), O = D ? fe(D, {
|
|
79
|
+
onClick: () => {
|
|
80
|
+
S.value = !0;
|
|
81
|
+
}
|
|
82
|
+
}) : null;
|
|
83
|
+
function oe() {
|
|
84
|
+
$(K(e(X).columnState));
|
|
85
|
+
}
|
|
86
|
+
function U(a, t) {
|
|
87
|
+
W?.($e(e(J), a)), Q?.(t);
|
|
88
|
+
}
|
|
89
|
+
function ie() {
|
|
90
|
+
U(e(p), e(d)), S.value = !1;
|
|
91
|
+
const a = K(p.value), t = Z(i.value, {
|
|
92
|
+
columnState: a,
|
|
93
|
+
size: d.value
|
|
94
|
+
});
|
|
95
|
+
L(i.value), c.config?.onChange?.(a, t);
|
|
96
|
+
}
|
|
97
|
+
function se(a) {
|
|
98
|
+
const t = c.config.getActiveKey?.(a) ?? ze(), l = {
|
|
99
|
+
key: t,
|
|
100
|
+
label: a,
|
|
101
|
+
columnState: p.value,
|
|
102
|
+
size: d.value
|
|
103
|
+
};
|
|
104
|
+
Y(l), C.value = !1, i.value = t, c.config.onChange?.(l.columnState, l);
|
|
105
|
+
}
|
|
106
|
+
function E(a) {
|
|
107
|
+
const t = [...f.value].find((l) => l?.key === a);
|
|
108
|
+
t && ($(K(t.columnState)), d.value = t.size);
|
|
109
|
+
}
|
|
110
|
+
function re(a) {
|
|
111
|
+
if (a !== i.value) {
|
|
112
|
+
N(a);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const t = f.value, l = t.findIndex((z) => z.key === a), s = t[l + 1]?.key ?? t[l - 1]?.key;
|
|
116
|
+
N(a), i.value = s, L(s);
|
|
117
|
+
}
|
|
118
|
+
function ue(a) {
|
|
119
|
+
if (V.value = a, !a) {
|
|
120
|
+
const t = R();
|
|
121
|
+
t && t !== i.value && (i.value = t);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
x(() => i.value, (a, t) => {
|
|
125
|
+
if (!t && a) {
|
|
126
|
+
const l = [...f.value].find((s) => s?.key === a);
|
|
127
|
+
if (!l)
|
|
128
|
+
return;
|
|
129
|
+
U(l.columnState, l.size);
|
|
130
|
+
}
|
|
131
|
+
E(a);
|
|
132
|
+
}, {
|
|
133
|
+
immediate: !0
|
|
134
|
+
});
|
|
135
|
+
const _ = v(!1);
|
|
136
|
+
return x([d, p, S], ([a, t, l]) => {
|
|
137
|
+
if (!l)
|
|
138
|
+
return;
|
|
139
|
+
const s = f.value.find((z) => z.key === i.value);
|
|
140
|
+
s && (s.size !== a || !Ie(t, s.columnState)) ? _.value = !0 : _.value = !1;
|
|
141
|
+
}, {
|
|
142
|
+
deep: !0
|
|
143
|
+
}), x(() => i.value, (a) => {
|
|
144
|
+
c.config.onActiveChange?.(a);
|
|
145
|
+
}, {
|
|
146
|
+
immediate: !0
|
|
147
|
+
}), (a, t) => (T(), P(ge, null, [e(O) ? (T(), A(w(e(O)), {
|
|
148
|
+
key: 0
|
|
149
|
+
})) : j("", !0), n(e(be), {
|
|
150
|
+
open: S.value,
|
|
151
|
+
"onUpdate:open": t[4] || (t[4] = (l) => S.value = l),
|
|
152
|
+
title: e(r)("ap.apTable.setting.title"),
|
|
153
|
+
width: 1e3,
|
|
154
|
+
centered: !0,
|
|
155
|
+
"body-style": {
|
|
156
|
+
padding: "0px !important",
|
|
157
|
+
height: "516px"
|
|
158
|
+
},
|
|
159
|
+
"after-open-change": ue,
|
|
160
|
+
"wrap-class-name": `${e(g)()} ${e(le)}`,
|
|
161
|
+
"ok-text": e(r)("ap.apTable.setting.saveAndApply"),
|
|
162
|
+
"mask-closable": !1,
|
|
163
|
+
onOk: ie
|
|
164
|
+
}, {
|
|
165
|
+
footer: o(({
|
|
166
|
+
extra: l
|
|
167
|
+
}) => [n(e(ke), {
|
|
168
|
+
justify: "space-between"
|
|
169
|
+
}, {
|
|
170
|
+
default: o(() => [n(e(q), {
|
|
171
|
+
size: 12
|
|
172
|
+
}, {
|
|
173
|
+
default: o(() => [n(e(_e), {
|
|
174
|
+
open: C.value,
|
|
175
|
+
"onUpdate:open": t[3] || (t[3] = (s) => C.value = s),
|
|
176
|
+
trigger: "click",
|
|
177
|
+
arrow: !1,
|
|
178
|
+
placement: "topLeft",
|
|
179
|
+
"destroy-tooltip-on-hide": ""
|
|
180
|
+
}, {
|
|
181
|
+
content: o(() => [n(Ue, {
|
|
182
|
+
onConfirm: se,
|
|
183
|
+
onCancel: t[2] || (t[2] = () => C.value = !1)
|
|
184
|
+
})]),
|
|
185
|
+
default: o(() => [n(e(Oe), {
|
|
186
|
+
type: "borderLink",
|
|
187
|
+
disabled: !a.config.persistenceKey
|
|
188
|
+
}, {
|
|
189
|
+
icon: o(() => [n(e(Ce))]),
|
|
190
|
+
default: o(() => [h(y(e(r)("ap.apTable.setting.saveAsTemplate")) + " ", 1)]),
|
|
191
|
+
_: 1
|
|
192
|
+
}, 8, ["disabled"])]),
|
|
193
|
+
_: 1
|
|
194
|
+
}, 8, ["open"]), _.value ? (T(), P("span", {
|
|
195
|
+
key: 0,
|
|
196
|
+
class: u(e(g)("modify-tip"))
|
|
197
|
+
}, y(e(r)("ap.apTable.setting.modifyNotification")), 3)) : j("", !0)]),
|
|
198
|
+
_: 1
|
|
199
|
+
}), n(e(q), {
|
|
200
|
+
size: 10
|
|
201
|
+
}, {
|
|
202
|
+
default: o(() => [(T(), A(w(l.cancelBtn))), (T(), A(w(l.okBtn)))]),
|
|
203
|
+
_: 2
|
|
204
|
+
}, 1024)]),
|
|
205
|
+
_: 2
|
|
206
|
+
}, 1024)]),
|
|
207
|
+
default: o(() => [ve(m("div", {
|
|
208
|
+
class: u(e(g)("wrapper"))
|
|
209
|
+
}, [m("div", {
|
|
210
|
+
class: u(e(g)("left"))
|
|
211
|
+
}, [n(Re, {
|
|
212
|
+
"customize-template-list": e(f),
|
|
213
|
+
"persistence-key": k.value,
|
|
214
|
+
onActiveChange: E
|
|
215
|
+
}, null, 8, ["customize-template-list", "persistence-key"])], 2), n(e(B), {
|
|
216
|
+
type: "vertical",
|
|
217
|
+
style: {
|
|
218
|
+
height: "100%",
|
|
219
|
+
margin: "0px"
|
|
220
|
+
}
|
|
221
|
+
}), m("div", {
|
|
222
|
+
class: u(e(g)("center"))
|
|
223
|
+
}, [m("div", {
|
|
224
|
+
class: u(e(b)("center", "header"))
|
|
225
|
+
}, [m("div", {
|
|
226
|
+
class: u(e(b)("center", "tip-wrapper"))
|
|
227
|
+
}, [m("span", {
|
|
228
|
+
class: u(e(b)("center", "header-tips"))
|
|
229
|
+
}, y(e(r)("ap.apTable.setting.selectAllTip")), 3), n(e(F), {
|
|
230
|
+
type: "link",
|
|
231
|
+
size: "small",
|
|
232
|
+
onClick: e(te)
|
|
233
|
+
}, {
|
|
234
|
+
default: o(() => [h(y(e(ee) ? e(r)("ap.apTable.setting.unSelectAll") : e(r)("ap.apTable.setting.selectAll")), 1)]),
|
|
235
|
+
_: 1
|
|
236
|
+
}, 8, ["onClick"])], 2), n(e(he), {
|
|
237
|
+
value: d.value,
|
|
238
|
+
"onUpdate:value": t[0] || (t[0] = (l) => d.value = l)
|
|
239
|
+
}, {
|
|
240
|
+
default: o(() => [n(e(M), {
|
|
241
|
+
value: "small"
|
|
242
|
+
}, {
|
|
243
|
+
default: o(() => [h(y(e(r)("ap.apTable.setting.sizeSmall")), 1)]),
|
|
244
|
+
_: 1
|
|
245
|
+
}), n(e(M), {
|
|
246
|
+
value: "middle"
|
|
247
|
+
}, {
|
|
248
|
+
default: o(() => [h(y(e(r)("ap.apTable.setting.sizeNormal")), 1)]),
|
|
249
|
+
_: 1
|
|
250
|
+
})]),
|
|
251
|
+
_: 1
|
|
252
|
+
}, 8, ["value"])], 2), m("div", Ee, [n(e(B), {
|
|
253
|
+
dashed: "",
|
|
254
|
+
style: {
|
|
255
|
+
margin: "0px"
|
|
256
|
+
}
|
|
257
|
+
})]), n(Ve, {
|
|
258
|
+
class: u(e(b)("center", "content")),
|
|
259
|
+
value: e(p)
|
|
260
|
+
}, null, 8, ["class", "value"])], 2), n(e(B), {
|
|
261
|
+
type: "vertical",
|
|
262
|
+
style: {
|
|
263
|
+
height: "100%",
|
|
264
|
+
margin: "0px"
|
|
265
|
+
}
|
|
266
|
+
}), m("div", {
|
|
267
|
+
class: u(e(g)("right"))
|
|
268
|
+
}, [n(De, {
|
|
269
|
+
value: e(p),
|
|
270
|
+
"onUpdate:value": t[1] || (t[1] = (l) => ye(p) ? p.value = l : null),
|
|
271
|
+
onReset: oe
|
|
272
|
+
}, null, 8, ["value"])], 2)], 2), [[Se, V.value]])]),
|
|
273
|
+
_: 1
|
|
274
|
+
}, 8, ["open", "title", "wrap-class-name", "ok-text"])], 64));
|
|
275
|
+
}
|
|
276
|
+
});
|
|
2
277
|
export {
|
|
3
|
-
|
|
278
|
+
pt as default
|
|
4
279
|
};
|
|
@@ -1,275 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { SettingOutlined as Te, SaveOutlined as be } from "@ant-design/icons-vue";
|
|
3
|
-
import { Button as F, Modal as Ce, Divider as A, RadioGroup as ke, RadioButton as M, Flex as he, Space as q, Popover as _e } from "@aplus-frontend/antdv";
|
|
4
|
-
import "../../../../ap-button/index.mjs";
|
|
5
|
-
import { randomStr as ze } from "../../../../utils/index.mjs";
|
|
6
|
-
import "../../../../config-provider/index.mjs";
|
|
7
|
-
import { getSingleVNode as xe } from "../../../../utils/slot.mjs";
|
|
8
|
-
import { useInjectApTable as we } from "../../../context.mjs";
|
|
9
|
-
import { useTableColumnState as Ae } from "../../../hooks/use-table-column-state.mjs";
|
|
10
|
-
import { useTableTemplateStorage as Be } from "../../../hooks/use-table-template-storage.mjs";
|
|
11
|
-
import Ne from "../../../style/setting.mjs";
|
|
12
|
-
import { useProvideApColumnSetting as Ke } from "../context.mjs";
|
|
13
|
-
import "../sorter/index.vue.mjs";
|
|
14
|
-
import "../template/edit-form.vue.mjs";
|
|
15
|
-
import "../template/index.vue.mjs";
|
|
16
|
-
import "../tree-select/index.vue.mjs";
|
|
17
|
-
import $e, { customCloneColumnStates as B, isEqualColumnStateIgnoreLabel as Ie } from "../utils.mjs";
|
|
18
|
-
import { useLocale as Le } from "../../../../config-provider/hooks/use-locale.mjs";
|
|
19
|
-
import { useNamespace as G } from "../../../../config-provider/hooks/use-namespace.mjs";
|
|
20
|
-
import Re from "../template/index.vue2.mjs";
|
|
21
|
-
import Ve from "../tree-select/index.vue2.mjs";
|
|
22
|
-
import De from "../sorter/index.vue2.mjs";
|
|
23
|
-
import Oe from "../../../../ap-button/ap-button.vue.mjs";
|
|
24
|
-
import Ue from "../template/edit-form.vue2.mjs";
|
|
25
|
-
const Ee = {
|
|
26
|
-
style: {
|
|
27
|
-
"padding-inline": "8px"
|
|
28
|
-
}
|
|
29
|
-
}, ct = /* @__PURE__ */ pe({
|
|
30
|
-
name: "ApTableSetting",
|
|
31
|
-
__name: "index",
|
|
32
|
-
props: {
|
|
33
|
-
config: {
|
|
34
|
-
default: () => ({
|
|
35
|
-
persistenceKey: ""
|
|
36
|
-
})
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
setup(H) {
|
|
40
|
-
const T = H, {
|
|
41
|
-
columnsBackup: J,
|
|
42
|
-
updateSize: Q,
|
|
43
|
-
updateColumns: W
|
|
44
|
-
} = we(), m = v(), h = ce(() => T.config.persistenceKey), b = v(!1), {
|
|
45
|
-
basicTemplate: X,
|
|
46
|
-
customizeTemplateList: d,
|
|
47
|
-
addTemplate: Y,
|
|
48
|
-
deleteTemplate: N,
|
|
49
|
-
updateTemplate: Z
|
|
50
|
-
} = Be(T.config, h), {
|
|
51
|
-
columnState: p,
|
|
52
|
-
setColumnState: K,
|
|
53
|
-
isAllSelected: ee,
|
|
54
|
-
toggleSelectAll: te
|
|
55
|
-
} = Ae([]), $ = `${h.value}__active_key`;
|
|
56
|
-
function I(a) {
|
|
57
|
-
localStorage.setItem($, a);
|
|
58
|
-
}
|
|
59
|
-
function L() {
|
|
60
|
-
return localStorage.getItem($);
|
|
61
|
-
}
|
|
62
|
-
const i = v(L() ?? d.value?.[0].key);
|
|
63
|
-
Ke({
|
|
64
|
-
activeKey: i,
|
|
65
|
-
cacheConfig: me(T, "config"),
|
|
66
|
-
deleteTemplate: re
|
|
67
|
-
});
|
|
68
|
-
const {
|
|
69
|
-
t: r
|
|
70
|
-
} = Le(), {
|
|
71
|
-
b: f,
|
|
72
|
-
be: C
|
|
73
|
-
} = G("ap-column-setting"), {
|
|
74
|
-
b: ae
|
|
75
|
-
} = G("ap-table"), le = Ne("ap-column-setting"), y = v(!1), R = v(!1), ne = de(), V = xe(ne.trigger) || l(F, {
|
|
76
|
-
icon: l(Te, null, null),
|
|
77
|
-
class: ae("setting-trigger-button")
|
|
78
|
-
}, null), D = V ? fe(V, {
|
|
79
|
-
onClick: () => {
|
|
80
|
-
y.value = !0;
|
|
81
|
-
}
|
|
82
|
-
}) : null;
|
|
83
|
-
function oe() {
|
|
84
|
-
K(B(e(X).columnState));
|
|
85
|
-
}
|
|
86
|
-
function O(a, t) {
|
|
87
|
-
W?.($e(e(J), a)), Q?.(t);
|
|
88
|
-
}
|
|
89
|
-
function ie() {
|
|
90
|
-
O(e(p), e(m)), y.value = !1;
|
|
91
|
-
const a = B(p.value), t = Z(i.value, {
|
|
92
|
-
columnState: a,
|
|
93
|
-
size: m.value
|
|
94
|
-
});
|
|
95
|
-
I(i.value), T.config?.onChange?.(a, t);
|
|
96
|
-
}
|
|
97
|
-
function se(a) {
|
|
98
|
-
const t = ze();
|
|
99
|
-
Y({
|
|
100
|
-
key: t,
|
|
101
|
-
label: a,
|
|
102
|
-
columnState: p.value,
|
|
103
|
-
size: m.value
|
|
104
|
-
}), b.value = !1, i.value = t;
|
|
105
|
-
}
|
|
106
|
-
function U(a) {
|
|
107
|
-
const t = [...d.value].find((n) => n?.key === a);
|
|
108
|
-
t && (K(B(t.columnState)), m.value = t.size);
|
|
109
|
-
}
|
|
110
|
-
function re(a) {
|
|
111
|
-
if (a !== i.value) {
|
|
112
|
-
N(a);
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
const t = d.value, n = t.findIndex((z) => z.key === a), s = t[n + 1]?.key ?? t[n - 1]?.key;
|
|
116
|
-
N(a), i.value = s, I(s);
|
|
117
|
-
}
|
|
118
|
-
function ue(a) {
|
|
119
|
-
if (R.value = a, !a) {
|
|
120
|
-
const t = L();
|
|
121
|
-
t && t !== i.value && (i.value = t);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
E(() => i.value, (a, t) => {
|
|
125
|
-
if (!t && a) {
|
|
126
|
-
const n = [...d.value].find((s) => s?.key === a);
|
|
127
|
-
if (!n)
|
|
128
|
-
return;
|
|
129
|
-
O(n.columnState, n.size);
|
|
130
|
-
}
|
|
131
|
-
U(a);
|
|
132
|
-
}, {
|
|
133
|
-
immediate: !0
|
|
134
|
-
});
|
|
135
|
-
const _ = v(!1);
|
|
136
|
-
return E([m, p, y], ([a, t, n]) => {
|
|
137
|
-
if (!n)
|
|
138
|
-
return;
|
|
139
|
-
const s = d.value.find((z) => z.key === i.value);
|
|
140
|
-
s && (s.size !== a || !Ie(t, s.columnState)) ? _.value = !0 : _.value = !1;
|
|
141
|
-
}, {
|
|
142
|
-
deep: !0
|
|
143
|
-
}), (a, t) => (S(), P(ve, null, [e(D) ? (S(), x(w(e(D)), {
|
|
144
|
-
key: 0
|
|
145
|
-
})) : j("", !0), l(e(Ce), {
|
|
146
|
-
open: y.value,
|
|
147
|
-
"onUpdate:open": t[4] || (t[4] = (n) => y.value = n),
|
|
148
|
-
title: e(r)("ap.apTable.setting.title"),
|
|
149
|
-
width: 1e3,
|
|
150
|
-
centered: !0,
|
|
151
|
-
"body-style": {
|
|
152
|
-
padding: "0px !important",
|
|
153
|
-
height: "516px"
|
|
154
|
-
},
|
|
155
|
-
"after-open-change": ue,
|
|
156
|
-
"wrap-class-name": `${e(f)()} ${e(le)}`,
|
|
157
|
-
"ok-text": e(r)("ap.apTable.setting.saveAndApply"),
|
|
158
|
-
"mask-closable": !1,
|
|
159
|
-
onOk: ie
|
|
160
|
-
}, {
|
|
161
|
-
footer: o(({
|
|
162
|
-
extra: n
|
|
163
|
-
}) => [l(e(he), {
|
|
164
|
-
justify: "space-between"
|
|
165
|
-
}, {
|
|
166
|
-
default: o(() => [l(e(q), {
|
|
167
|
-
size: 12
|
|
168
|
-
}, {
|
|
169
|
-
default: o(() => [l(e(_e), {
|
|
170
|
-
open: b.value,
|
|
171
|
-
"onUpdate:open": t[3] || (t[3] = (s) => b.value = s),
|
|
172
|
-
trigger: "click",
|
|
173
|
-
arrow: !1,
|
|
174
|
-
placement: "topLeft",
|
|
175
|
-
"destroy-tooltip-on-hide": ""
|
|
176
|
-
}, {
|
|
177
|
-
content: o(() => [l(Ue, {
|
|
178
|
-
onConfirm: se,
|
|
179
|
-
onCancel: t[2] || (t[2] = () => b.value = !1)
|
|
180
|
-
})]),
|
|
181
|
-
default: o(() => [l(e(Oe), {
|
|
182
|
-
type: "borderLink",
|
|
183
|
-
disabled: !a.config.persistenceKey
|
|
184
|
-
}, {
|
|
185
|
-
icon: o(() => [l(e(be))]),
|
|
186
|
-
default: o(() => [k(g(e(r)("ap.apTable.setting.saveAsTemplate")) + " ", 1)]),
|
|
187
|
-
_: 1
|
|
188
|
-
}, 8, ["disabled"])]),
|
|
189
|
-
_: 1
|
|
190
|
-
}, 8, ["open"]), _.value ? (S(), P("span", {
|
|
191
|
-
key: 0,
|
|
192
|
-
class: u(e(f)("modify-tip"))
|
|
193
|
-
}, g(e(r)("ap.apTable.setting.modifyNotification")), 3)) : j("", !0)]),
|
|
194
|
-
_: 1
|
|
195
|
-
}), l(e(q), {
|
|
196
|
-
size: 10
|
|
197
|
-
}, {
|
|
198
|
-
default: o(() => [(S(), x(w(n.cancelBtn))), (S(), x(w(n.okBtn)))]),
|
|
199
|
-
_: 2
|
|
200
|
-
}, 1024)]),
|
|
201
|
-
_: 2
|
|
202
|
-
}, 1024)]),
|
|
203
|
-
default: o(() => [ge(c("div", {
|
|
204
|
-
class: u(e(f)("wrapper"))
|
|
205
|
-
}, [c("div", {
|
|
206
|
-
class: u(e(f)("left"))
|
|
207
|
-
}, [l(Re, {
|
|
208
|
-
"customize-template-list": e(d),
|
|
209
|
-
"persistence-key": h.value,
|
|
210
|
-
onActiveChange: U
|
|
211
|
-
}, null, 8, ["customize-template-list", "persistence-key"])], 2), l(e(A), {
|
|
212
|
-
type: "vertical",
|
|
213
|
-
style: {
|
|
214
|
-
height: "100%",
|
|
215
|
-
margin: "0px"
|
|
216
|
-
}
|
|
217
|
-
}), c("div", {
|
|
218
|
-
class: u(e(f)("center"))
|
|
219
|
-
}, [c("div", {
|
|
220
|
-
class: u(e(C)("center", "header"))
|
|
221
|
-
}, [c("div", {
|
|
222
|
-
class: u(e(C)("center", "tip-wrapper"))
|
|
223
|
-
}, [c("span", {
|
|
224
|
-
class: u(e(C)("center", "header-tips"))
|
|
225
|
-
}, g(e(r)("ap.apTable.setting.selectAllTip")), 3), l(e(F), {
|
|
226
|
-
type: "link",
|
|
227
|
-
size: "small",
|
|
228
|
-
onClick: e(te)
|
|
229
|
-
}, {
|
|
230
|
-
default: o(() => [k(g(e(ee) ? e(r)("ap.apTable.setting.unSelectAll") : e(r)("ap.apTable.setting.selectAll")), 1)]),
|
|
231
|
-
_: 1
|
|
232
|
-
}, 8, ["onClick"])], 2), l(e(ke), {
|
|
233
|
-
value: m.value,
|
|
234
|
-
"onUpdate:value": t[0] || (t[0] = (n) => m.value = n)
|
|
235
|
-
}, {
|
|
236
|
-
default: o(() => [l(e(M), {
|
|
237
|
-
value: "small"
|
|
238
|
-
}, {
|
|
239
|
-
default: o(() => [k(g(e(r)("ap.apTable.setting.sizeSmall")), 1)]),
|
|
240
|
-
_: 1
|
|
241
|
-
}), l(e(M), {
|
|
242
|
-
value: "middle"
|
|
243
|
-
}, {
|
|
244
|
-
default: o(() => [k(g(e(r)("ap.apTable.setting.sizeNormal")), 1)]),
|
|
245
|
-
_: 1
|
|
246
|
-
})]),
|
|
247
|
-
_: 1
|
|
248
|
-
}, 8, ["value"])], 2), c("div", Ee, [l(e(A), {
|
|
249
|
-
dashed: "",
|
|
250
|
-
style: {
|
|
251
|
-
margin: "0px"
|
|
252
|
-
}
|
|
253
|
-
})]), l(Ve, {
|
|
254
|
-
class: u(e(C)("center", "content")),
|
|
255
|
-
value: e(p)
|
|
256
|
-
}, null, 8, ["class", "value"])], 2), l(e(A), {
|
|
257
|
-
type: "vertical",
|
|
258
|
-
style: {
|
|
259
|
-
height: "100%",
|
|
260
|
-
margin: "0px"
|
|
261
|
-
}
|
|
262
|
-
}), c("div", {
|
|
263
|
-
class: u(e(f)("right"))
|
|
264
|
-
}, [l(De, {
|
|
265
|
-
value: e(p),
|
|
266
|
-
"onUpdate:value": t[1] || (t[1] = (n) => ye(p) ? p.value = n : null),
|
|
267
|
-
onReset: oe
|
|
268
|
-
}, null, 8, ["value"])], 2)], 2), [[Se, R.value]])]),
|
|
269
|
-
_: 1
|
|
270
|
-
}, 8, ["open", "title", "wrap-class-name", "ok-text"])], 64));
|
|
271
|
-
}
|
|
272
|
-
});
|
|
1
|
+
import f from "./index.vue.mjs";
|
|
273
2
|
export {
|
|
274
|
-
|
|
3
|
+
f as default
|
|
275
4
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as U, ref as x, computed as v, unref as n, watch as D, createElementBlock as k, openBlock as s, normalizeClass as w, createElementVNode as b, createVNode as i, withCtx as d, createBlock as u, resolveDynamicComponent as
|
|
2
|
-
import { Checkbox as
|
|
1
|
+
import { defineComponent as U, ref as x, computed as v, unref as n, watch as D, createElementBlock as k, openBlock as s, normalizeClass as w, createElementVNode as b, createVNode as i, withCtx as d, createBlock as u, resolveDynamicComponent as g, Fragment as L, renderList as j, mergeProps as z } from "vue";
|
|
2
|
+
import { Checkbox as C, Row as F, Col as I } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../../../../config-provider/index.mjs";
|
|
4
4
|
import { useInjectApTable as R } from "../../../context.mjs";
|
|
5
5
|
import { getLabelNode as y } from "../utils.mjs";
|
|
@@ -49,31 +49,34 @@ const M = /* @__PURE__ */ U({
|
|
|
49
49
|
b("div", {
|
|
50
50
|
class: w(n(h)("header"))
|
|
51
51
|
}, [
|
|
52
|
-
i(n(
|
|
52
|
+
i(n(C), {
|
|
53
53
|
indeterminate: c.value,
|
|
54
54
|
checked: e.value?.show,
|
|
55
55
|
disabled: E.value,
|
|
56
56
|
"onUpdate:checked": B
|
|
57
57
|
}, {
|
|
58
58
|
default: d(() => [
|
|
59
|
-
(s(), u(
|
|
59
|
+
(s(), u(g(n(y)(f.value, n(m)))))
|
|
60
60
|
]),
|
|
61
61
|
_: 1
|
|
62
62
|
}, 8, ["indeterminate", "checked", "disabled"])
|
|
63
63
|
], 2),
|
|
64
64
|
b("div", null, [
|
|
65
|
-
i(n(F), {
|
|
65
|
+
i(n(F), {
|
|
66
|
+
align: "middle",
|
|
67
|
+
gutter: 24
|
|
68
|
+
}, {
|
|
66
69
|
default: d(() => [
|
|
67
70
|
(s(!0), k(L, null, j(f.value.children, (o) => (s(), u(n(I), {
|
|
68
71
|
key: o.key,
|
|
69
|
-
span:
|
|
72
|
+
span: 12
|
|
70
73
|
}, {
|
|
71
74
|
default: d(() => [
|
|
72
|
-
i(n(
|
|
75
|
+
i(n(C), z({ ref_for: !0 }, A(o), {
|
|
73
76
|
"onUpdate:checked": (a) => N(o.key, a)
|
|
74
77
|
}), {
|
|
75
78
|
default: d(() => [
|
|
76
|
-
(s(), u(
|
|
79
|
+
(s(), u(g(n(y)(o, n(m)))))
|
|
77
80
|
]),
|
|
78
81
|
_: 2
|
|
79
82
|
}, 1040, ["onUpdate:checked"])
|
|
@@ -114,6 +114,7 @@ declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOp
|
|
|
114
114
|
readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
|
|
115
115
|
readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
|
|
116
116
|
readonly syncToUrlPriority?: boolean | undefined;
|
|
117
|
+
readonly autoFocusFirstInput?: boolean | undefined;
|
|
117
118
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
118
119
|
$attrs: {
|
|
119
120
|
[x: string]: unknown;
|
|
@@ -839,6 +840,7 @@ declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOp
|
|
|
839
840
|
}> & {} & ComponentCustomProperties & {} & {
|
|
840
841
|
$slots: {
|
|
841
842
|
default?(_: {}): any;
|
|
843
|
+
default?(_: {}): any;
|
|
842
844
|
};
|
|
843
845
|
}) | null;
|
|
844
846
|
}, HTMLDivElement>;
|