@aplus-frontend/ui 0.4.5 → 0.4.7
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/ap-field/date/index.vue.d.ts +1 -0
- package/es/src/ap-field/date/index.vue.mjs +22 -15
- package/es/src/ap-field/date-range/index.vue.mjs +46 -42
- package/es/src/ap-field/hooks/use-default-presets.d.ts +11 -0
- package/es/src/ap-field/hooks/use-default-presets.mjs +15 -0
- package/es/src/ap-field/interface.d.ts +7 -1
- package/es/src/ap-table/ap-table.vue2.mjs +87 -85
- package/es/src/ap-table/components/dynamic-component/diff.d.ts +2 -0
- package/es/src/ap-table/components/dynamic-component/index.vue.d.ts +4 -0
- package/es/src/ap-table/components/dynamic-component/index.vue.mjs +4 -0
- package/es/src/ap-table/components/dynamic-component/index.vue2.mjs +14 -0
- package/es/src/ap-table/components/interface.d.ts +3 -0
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +55 -55
- package/es/src/ap-table/constants.d.ts +3 -0
- package/es/src/ap-table/hooks/use-table-column-state.d.ts +2 -2
- package/es/src/ap-table/hooks/use-table-column-state.mjs +92 -92
- package/es/src/ap-table/utils.d.ts +1549 -1539
- package/es/src/ap-table/utils.mjs +115 -104
- package/es/src/ap-upload/components/Picture.vue2.mjs +59 -55
- package/es/src/business/batch-input-group/form-item.vue.mjs +7 -6
- package/es/src/business/batch-input-group/interface.d.ts +5 -0
- package/es/src/business/hooks/usePageListApTable.d.ts +2 -2
- package/es/src/locale/lang/en.mjs +10 -1
- package/es/src/locale/lang/zh-cn.mjs +10 -1
- package/es/src/utils/data-range-persets.d.ts +87 -0
- package/es/src/utils/data-range-persets.mjs +107 -0
- package/lib/src/ap-field/date/index.vue.d.ts +1 -0
- package/lib/src/ap-field/date/index.vue.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/hooks/use-default-presets.d.ts +11 -0
- package/lib/src/ap-field/hooks/use-default-presets.js +1 -0
- package/lib/src/ap-field/interface.d.ts +7 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/components/dynamic-component/diff.d.ts +2 -0
- package/lib/src/ap-table/components/dynamic-component/index.vue.d.ts +4 -0
- package/lib/src/ap-table/components/dynamic-component/index.vue.js +1 -0
- package/lib/src/ap-table/components/dynamic-component/index.vue2.js +1 -0
- package/lib/src/ap-table/components/interface.d.ts +3 -0
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
- package/lib/src/ap-table/constants.d.ts +3 -0
- package/lib/src/ap-table/hooks/use-table-column-state.d.ts +2 -2
- package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
- package/lib/src/ap-table/utils.d.ts +1549 -1539
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
- package/lib/src/business/batch-input-group/form-item.vue.js +1 -1
- package/lib/src/business/batch-input-group/interface.d.ts +5 -0
- package/lib/src/business/hooks/usePageListApTable.d.ts +2 -2
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/utils/data-range-persets.d.ts +87 -0
- package/lib/src/utils/data-range-persets.js +1 -0
- package/package.json +3 -3
- package/theme/ap-table/ap-table.css +4 -4
- package/theme/ap-table/ap-table.less +4 -4
- package/theme/ap-table-modal/index.css +4 -4
- package/theme/index.css +4 -4
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { isDef as
|
|
3
|
-
import
|
|
4
|
-
import { useInjectApTable as
|
|
5
|
-
import { isObject as
|
|
6
|
-
function
|
|
7
|
-
|
|
1
|
+
import { ref as D, shallowRef as G, unref as f, computed as W, watchEffect as X } from "vue";
|
|
2
|
+
import { isDef as q } from "../../utils/index.mjs";
|
|
3
|
+
import H, { customCloneColumnStates as B, getColumnStateString as L } from "../components/setting/utils.mjs";
|
|
4
|
+
import { useInjectApTable as P } from "../context.mjs";
|
|
5
|
+
import { isObject as N, mergeWith as F, isBoolean as Q, omit as U, isNumber as b } from "lodash-unified";
|
|
6
|
+
function u(r, o) {
|
|
7
|
+
r.forEach((n) => {
|
|
8
8
|
var i;
|
|
9
|
-
n
|
|
9
|
+
o(n), (i = n.children) != null && i.length && u(n.children, o);
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
if (!
|
|
12
|
+
function V(r, o) {
|
|
13
|
+
if (!o)
|
|
14
14
|
return {};
|
|
15
|
-
const
|
|
16
|
-
return
|
|
15
|
+
const n = r.getItem(o);
|
|
16
|
+
return n ? JSON.parse(n) : {};
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
if (
|
|
20
|
-
return
|
|
18
|
+
function I(r, o) {
|
|
19
|
+
if (N(r) && N(o))
|
|
20
|
+
return F({}, r, o, I);
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
function
|
|
24
|
-
return i ? i.fixed :
|
|
22
|
+
const E = Number.MAX_SAFE_INTEGER;
|
|
23
|
+
function Y(r, o, n, i) {
|
|
24
|
+
return i ? i.fixed : o ? o.fixed : n && "fixed" in n ? n.fixed : Q(r.fixed) ? r.fixed ? "left" : void 0 : r.fixed;
|
|
25
25
|
}
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
), { columnsBackup:
|
|
30
|
-
function
|
|
31
|
-
const e =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
),
|
|
26
|
+
const re = (r, o, n) => {
|
|
27
|
+
const i = D(n), c = G(
|
|
28
|
+
B(n)
|
|
29
|
+
), { columnsBackup: x, updateColumns: a } = P(), T = r.persistenceType || "localStorage", S = window[T];
|
|
30
|
+
function O() {
|
|
31
|
+
const e = V(
|
|
32
|
+
S,
|
|
33
|
+
f(o)
|
|
34
|
+
), t = F(
|
|
35
35
|
{},
|
|
36
|
-
|
|
36
|
+
r.defaultValue || {},
|
|
37
37
|
e,
|
|
38
|
-
|
|
39
|
-
), s =
|
|
40
|
-
function
|
|
41
|
-
return
|
|
42
|
-
var
|
|
43
|
-
const
|
|
44
|
-
key:
|
|
45
|
-
label:
|
|
38
|
+
I
|
|
39
|
+
), s = f(x);
|
|
40
|
+
function l(j, h, z) {
|
|
41
|
+
return j.map((d) => {
|
|
42
|
+
var y, A;
|
|
43
|
+
const v = (h == null ? void 0 : h[d.key]) || {}, g = {
|
|
44
|
+
key: d.key,
|
|
45
|
+
label: d.title,
|
|
46
46
|
show: !0,
|
|
47
|
-
fixed:
|
|
48
|
-
|
|
49
|
-
e[
|
|
50
|
-
(
|
|
51
|
-
|
|
47
|
+
fixed: Y(
|
|
48
|
+
d,
|
|
49
|
+
e[d.key],
|
|
50
|
+
(y = r.defaultValue) == null ? void 0 : y[d.key],
|
|
51
|
+
z
|
|
52
52
|
),
|
|
53
53
|
disabled: !1,
|
|
54
|
-
...
|
|
54
|
+
...U(v, ["children", "fixed"])
|
|
55
55
|
};
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
) : void 0,
|
|
61
|
-
}).sort(
|
|
56
|
+
return g.children = (A = d.children) != null && A.length ? l(
|
|
57
|
+
d.children,
|
|
58
|
+
v.children,
|
|
59
|
+
g
|
|
60
|
+
) : void 0, g;
|
|
61
|
+
}).sort(J);
|
|
62
62
|
}
|
|
63
|
-
return
|
|
63
|
+
return l(s || [], t);
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
const s =
|
|
67
|
-
let
|
|
68
|
-
return e.fixed === "right" &&
|
|
65
|
+
function J(e, t) {
|
|
66
|
+
const s = b(e.order) ? e.order : E;
|
|
67
|
+
let l = b(t.order) ? t.order : E;
|
|
68
|
+
return e.fixed === "right" && t.fixed !== "right" && (l = s - 1), t.fixed === "left" && e.fixed !== "left" && (l = s - 1), s - l;
|
|
69
69
|
}
|
|
70
|
-
const
|
|
70
|
+
const m = W(() => f(i).every((e) => e.show));
|
|
71
71
|
function C() {
|
|
72
|
-
const e =
|
|
73
|
-
|
|
74
|
-
!
|
|
72
|
+
const e = f(i);
|
|
73
|
+
u(e, (t) => {
|
|
74
|
+
!t.disabled && (t.show = !0);
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
const e =
|
|
79
|
-
|
|
80
|
-
!
|
|
77
|
+
function p() {
|
|
78
|
+
const e = f(i);
|
|
79
|
+
u(e, (t) => {
|
|
80
|
+
!t.disabled && (t.show = !1);
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
|
|
83
|
+
function M() {
|
|
84
|
+
f(m) ? p() : C();
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
|
|
88
|
-
s.key === e && (s.show =
|
|
86
|
+
function R(e, t) {
|
|
87
|
+
u(f(i), (s) => {
|
|
88
|
+
s.key === e && (s.show = q(t) ? t : !s.show);
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
o.value = e;
|
|
93
|
-
}
|
|
94
|
-
function M(e) {
|
|
91
|
+
function w(e) {
|
|
95
92
|
i.value = e;
|
|
96
93
|
}
|
|
97
|
-
function
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
94
|
+
function _(e) {
|
|
95
|
+
c.value = e;
|
|
96
|
+
}
|
|
97
|
+
function k(e) {
|
|
98
|
+
if (f(o)) {
|
|
99
|
+
const t = L(e);
|
|
100
|
+
S.setItem(f(o), JSON.stringify(t));
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
return
|
|
104
|
-
var
|
|
105
|
-
const e =
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
103
|
+
return X(() => {
|
|
104
|
+
var t;
|
|
105
|
+
const e = O();
|
|
106
|
+
w(e), (t = r.onChange) == null || t.call(r, e), a == null || a(
|
|
107
|
+
H(
|
|
108
|
+
f(x),
|
|
109
|
+
f(e)
|
|
110
110
|
)
|
|
111
|
-
),
|
|
111
|
+
), c.value = B(e), k(e);
|
|
112
112
|
}), {
|
|
113
|
-
columnState:
|
|
113
|
+
columnState: i,
|
|
114
114
|
selectAll: C,
|
|
115
|
-
unSelectAll:
|
|
116
|
-
toggleSelect:
|
|
117
|
-
setColumnState:
|
|
118
|
-
isAllSelected:
|
|
119
|
-
toggleSelectAll:
|
|
120
|
-
columnStateBackup:
|
|
121
|
-
setColumnStateBackup:
|
|
122
|
-
cacheColumnStateIfNeeded:
|
|
115
|
+
unSelectAll: p,
|
|
116
|
+
toggleSelect: R,
|
|
117
|
+
setColumnState: w,
|
|
118
|
+
isAllSelected: m,
|
|
119
|
+
toggleSelectAll: M,
|
|
120
|
+
columnStateBackup: c,
|
|
121
|
+
setColumnStateBackup: _,
|
|
122
|
+
cacheColumnStateIfNeeded: k
|
|
123
123
|
};
|
|
124
124
|
};
|
|
125
125
|
export {
|
|
126
|
-
|
|
126
|
+
re as useTableColumnState
|
|
127
127
|
};
|