@aplus-frontend/ui 0.4.5 → 0.4.6
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/interface.d.ts +5 -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/business/batch-input-group/form-item.vue.d.ts +1 -0
- package/es/src/business/batch-input-group/form-item.vue.mjs +39 -42
- package/es/src/business/batch-input-group/interface.d.ts +5 -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/interface.d.ts +5 -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/business/batch-input-group/form-item.vue.d.ts +1 -0
- 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/package.json +1 -1
- 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
|
@@ -56,6 +56,7 @@ declare const __VLS_component: DefineComponent<ApFieldDateProps, {}, {}, {}, {},
|
|
|
56
56
|
showToday: boolean;
|
|
57
57
|
showTime: boolean | SharedTimeProps<dayjs.Dayjs>;
|
|
58
58
|
emptyText: string;
|
|
59
|
+
formatBegins: boolean;
|
|
59
60
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
60
61
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
61
62
|
export default _default;
|
|
@@ -83,23 +83,24 @@ const le = /* @__PURE__ */ b({
|
|
|
83
83
|
onChange: {},
|
|
84
84
|
onOk: {},
|
|
85
85
|
format: { default: "Y-D" },
|
|
86
|
+
formatBegins: { type: Boolean, default: !0 },
|
|
86
87
|
timezone: {}
|
|
87
88
|
},
|
|
88
89
|
emits: ["update:value"],
|
|
89
90
|
setup(h, { emit: B }) {
|
|
90
|
-
const e = h,
|
|
91
|
+
const e = h, g = B, { value: m, updateValue: c } = Z(
|
|
91
92
|
e,
|
|
92
|
-
|
|
93
|
-
),
|
|
93
|
+
g
|
|
94
|
+
), k = Y("Date", e), n = i(
|
|
94
95
|
() => I.indexOf(e.format) > -1
|
|
95
96
|
), d = i(
|
|
96
97
|
() => n.value ? H[e.format] : e.format
|
|
97
|
-
),
|
|
98
|
-
if (y(t(
|
|
98
|
+
), p = i(() => {
|
|
99
|
+
if (y(t(m)))
|
|
99
100
|
return;
|
|
100
|
-
let o = r(t(
|
|
101
|
-
return e.timezone && (o = r(W(t(
|
|
102
|
-
}),
|
|
101
|
+
let o = r(t(m));
|
|
102
|
+
return e.timezone && (o = r(W(t(m), e.timezone))), o;
|
|
103
|
+
}), P = i(() => t(n) ? e.picker ?? U[e.format] : e.picker), C = i(() => {
|
|
103
104
|
const o = t(n) ? K[e.format] : {};
|
|
104
105
|
return {
|
|
105
106
|
...$(e, [
|
|
@@ -111,7 +112,7 @@ const le = /* @__PURE__ */ b({
|
|
|
111
112
|
"onUpdate:value",
|
|
112
113
|
"mode"
|
|
113
114
|
]),
|
|
114
|
-
placeholder: t(
|
|
115
|
+
placeholder: t(k),
|
|
115
116
|
...o
|
|
116
117
|
};
|
|
117
118
|
}), f = L(e.timezone);
|
|
@@ -122,14 +123,19 @@ const le = /* @__PURE__ */ b({
|
|
|
122
123
|
}
|
|
123
124
|
const l = r(o);
|
|
124
125
|
c(
|
|
125
|
-
f(
|
|
126
|
+
f(
|
|
127
|
+
l,
|
|
128
|
+
t(n) ? t(d) : void 0,
|
|
129
|
+
e.formatBegins
|
|
130
|
+
)
|
|
126
131
|
);
|
|
127
132
|
}
|
|
128
133
|
function T(o, l) {
|
|
129
134
|
var s;
|
|
130
135
|
const u = r(o), a = o ? f(
|
|
131
136
|
u,
|
|
132
|
-
t(n) ? t(d) : void 0
|
|
137
|
+
t(n) ? t(d) : void 0,
|
|
138
|
+
e.formatBegins
|
|
133
139
|
) : null;
|
|
134
140
|
(s = e.onChange) == null || s.call(e, a, l);
|
|
135
141
|
}
|
|
@@ -137,16 +143,17 @@ const le = /* @__PURE__ */ b({
|
|
|
137
143
|
var a;
|
|
138
144
|
const l = r(o), u = o ? f(
|
|
139
145
|
l,
|
|
140
|
-
t(n) ? t(d) : void 0
|
|
146
|
+
t(n) ? t(d) : void 0,
|
|
147
|
+
e.formatBegins
|
|
141
148
|
) : null;
|
|
142
149
|
(a = e.onOk) == null || a.call(e, u);
|
|
143
150
|
}
|
|
144
151
|
return (o, l) => o.mode === "read" ? (v(), _(w, { key: 0 }, [
|
|
145
|
-
M(R(
|
|
152
|
+
M(R(p.value ? t(r)(p.value).format(d.value) : o.emptyText), 1)
|
|
146
153
|
], 64)) : (v(), F(t(j), A({ key: 1 }, C.value, {
|
|
147
|
-
value:
|
|
154
|
+
value: p.value,
|
|
148
155
|
format: d.value,
|
|
149
|
-
picker:
|
|
156
|
+
picker: P.value,
|
|
150
157
|
"onUpdate:value": O,
|
|
151
158
|
onChange: T,
|
|
152
159
|
onOk: S
|
|
@@ -41,6 +41,11 @@ export type ApFieldDateProps = BasicApFieldProps<Omit<DatePickerProps, 'mode' |
|
|
|
41
41
|
onChange?: (ts: number | null, dayStr: string) => void;
|
|
42
42
|
onOk?: (ts: number | null) => void;
|
|
43
43
|
format?: LiteralUnion<ApFormatPresetType, string>;
|
|
44
|
+
/**
|
|
45
|
+
* 格式化时间时是否以`format`的开始
|
|
46
|
+
* @default true
|
|
47
|
+
*/
|
|
48
|
+
formatBegins?: boolean;
|
|
44
49
|
/**
|
|
45
50
|
* 指定时区,指定后value会变为特定时区下的timestamp
|
|
46
51
|
*/
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { defineComponent as G, ref as
|
|
2
|
-
import { Button as B, Modal as
|
|
3
|
-
import { getSingleVNode as
|
|
4
|
-
import { useInjectApTable as
|
|
1
|
+
import { defineComponent as G, ref as y, unref as e, computed as H, useSlots as L, createVNode as l, cloneVNode as M, openBlock as x, createElementBlock as P, Fragment as q, createBlock as J, resolveDynamicComponent as Q, createCommentVNode as W, withCtx as i, createElementVNode as s, normalizeClass as r, toDisplayString as c, createTextVNode as C, isRef as X } from "vue";
|
|
2
|
+
import { Button as B, Modal as Y, RadioGroup as Z, RadioButton as _, Divider as h } from "@aplus-frontend/antdv";
|
|
3
|
+
import { getSingleVNode as ee } from "../../../../utils/slot.mjs";
|
|
4
|
+
import { useInjectApTable as te } from "../../../context.mjs";
|
|
5
5
|
import "../tree-select/index.vue.mjs";
|
|
6
|
-
import { useTableColumnState as
|
|
6
|
+
import { useTableColumnState as le } from "../../../hooks/use-table-column-state.mjs";
|
|
7
7
|
import "../../../../config-provider/index.mjs";
|
|
8
8
|
import "../sorter/index.vue.mjs";
|
|
9
|
-
import
|
|
10
|
-
import { SettingOutlined as
|
|
11
|
-
import { useLocale as
|
|
9
|
+
import oe, { customCloneColumnStates as N } from "../utils.mjs";
|
|
10
|
+
import { SettingOutlined as ne } from "@ant-design/icons-vue";
|
|
11
|
+
import { useLocale as ae } from "../../../../config-provider/hooks/use-locale.mjs";
|
|
12
12
|
import { useNamespace as T } from "../../../../config-provider/hooks/use-namespace.mjs";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
const
|
|
13
|
+
import se from "../tree-select/index.vue2.mjs";
|
|
14
|
+
import ie from "../sorter/index.vue2.mjs";
|
|
15
|
+
const re = {
|
|
16
16
|
style: {
|
|
17
17
|
lineHeight: "22px",
|
|
18
18
|
color: "#8896B0"
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, Be = /* @__PURE__ */ G({
|
|
21
21
|
__name: "index",
|
|
22
22
|
props: {
|
|
23
23
|
config: {
|
|
@@ -25,46 +25,46 @@ const ie = {
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
setup(A) {
|
|
28
|
-
const
|
|
28
|
+
const m = A, {
|
|
29
29
|
columnsBackup: V,
|
|
30
30
|
size: z,
|
|
31
|
-
updateSize:
|
|
32
|
-
updateColumns:
|
|
33
|
-
} =
|
|
31
|
+
updateSize: d,
|
|
32
|
+
updateColumns: f
|
|
33
|
+
} = te(), g = y(e(z)), R = H(() => m.config.persistenceKey), {
|
|
34
34
|
columnState: n,
|
|
35
|
-
setColumnState:
|
|
36
|
-
isAllSelected:
|
|
37
|
-
toggleSelectAll:
|
|
38
|
-
columnStateBackup:
|
|
39
|
-
setColumnStateBackup:
|
|
40
|
-
cacheColumnStateIfNeeded:
|
|
41
|
-
} =
|
|
35
|
+
setColumnState: w,
|
|
36
|
+
isAllSelected: D,
|
|
37
|
+
toggleSelectAll: O,
|
|
38
|
+
columnStateBackup: U,
|
|
39
|
+
setColumnStateBackup: E,
|
|
40
|
+
cacheColumnStateIfNeeded: I
|
|
41
|
+
} = le(m.config, R, []), {
|
|
42
42
|
t: a
|
|
43
|
-
} =
|
|
44
|
-
b:
|
|
43
|
+
} = ae(), {
|
|
44
|
+
b: v,
|
|
45
45
|
be: S
|
|
46
46
|
} = T("ap-column-setting"), {
|
|
47
|
-
b:
|
|
48
|
-
} = T("ap-table"), u =
|
|
49
|
-
icon: l(
|
|
50
|
-
class:
|
|
51
|
-
}, null), k = b ?
|
|
47
|
+
b: K
|
|
48
|
+
} = T("ap-table"), u = y(!1), $ = L(), b = ee($.trigger) || l(B, {
|
|
49
|
+
icon: l(ne, null, null),
|
|
50
|
+
class: K("setting-trigger-button")
|
|
51
|
+
}, null), k = b ? M(b, {
|
|
52
52
|
onClick: () => {
|
|
53
53
|
u.value = !0;
|
|
54
54
|
}
|
|
55
55
|
}) : null;
|
|
56
56
|
function j() {
|
|
57
|
-
|
|
57
|
+
w(N(e(U)));
|
|
58
58
|
}
|
|
59
59
|
function F() {
|
|
60
60
|
var t, o;
|
|
61
|
-
|
|
61
|
+
f == null || f(oe(e(V), e(n))), d == null || d(e(g)), u.value = !1;
|
|
62
62
|
const p = N(n.value);
|
|
63
|
-
|
|
63
|
+
E(p), I(p), (o = (t = m.config) == null ? void 0 : t.onChange) == null || o.call(t, p);
|
|
64
64
|
}
|
|
65
|
-
return (p, t) => (
|
|
65
|
+
return (p, t) => (x(), P(q, null, [e(k) ? (x(), J(Q(e(k)), {
|
|
66
66
|
key: 0
|
|
67
|
-
})) :
|
|
67
|
+
})) : W("", !0), l(e(Y), {
|
|
68
68
|
open: u.value,
|
|
69
69
|
"onUpdate:open": t[2] || (t[2] = (o) => u.value = o),
|
|
70
70
|
title: e(a)("ap.apTable.setting.title"),
|
|
@@ -76,32 +76,32 @@ const ie = {
|
|
|
76
76
|
},
|
|
77
77
|
onOk: F
|
|
78
78
|
}, {
|
|
79
|
-
default:
|
|
80
|
-
class: r(e(
|
|
81
|
-
}, [
|
|
82
|
-
class: r(e(
|
|
83
|
-
}, [
|
|
79
|
+
default: i(() => [s("div", {
|
|
80
|
+
class: r(e(v)("wrapper"))
|
|
81
|
+
}, [s("div", {
|
|
82
|
+
class: r(e(v)("left"))
|
|
83
|
+
}, [s("div", {
|
|
84
84
|
class: r(e(S)("left", "header"))
|
|
85
|
-
}, [
|
|
85
|
+
}, [s("div", null, [s("span", re, c(e(a)("ap.apTable.setting.selectAllTip")), 1), l(e(B), {
|
|
86
86
|
type: "link",
|
|
87
87
|
size: "small",
|
|
88
|
-
onClick: e(
|
|
88
|
+
onClick: e(O)
|
|
89
89
|
}, {
|
|
90
|
-
default:
|
|
90
|
+
default: i(() => [C(c(e(D) ? e(a)("ap.apTable.setting.unSelectAll") : e(a)("ap.apTable.setting.selectAll")), 1)]),
|
|
91
91
|
_: 1
|
|
92
|
-
}, 8, ["onClick"])]), l(e(
|
|
93
|
-
value:
|
|
94
|
-
"onUpdate:value": t[0] || (t[0] = (o) =>
|
|
92
|
+
}, 8, ["onClick"])]), l(e(Z), {
|
|
93
|
+
value: g.value,
|
|
94
|
+
"onUpdate:value": t[0] || (t[0] = (o) => g.value = o)
|
|
95
95
|
}, {
|
|
96
|
-
default:
|
|
96
|
+
default: i(() => [l(e(_), {
|
|
97
97
|
value: "small"
|
|
98
98
|
}, {
|
|
99
|
-
default:
|
|
99
|
+
default: i(() => [C(c(e(a)("ap.apTable.setting.sizeSmall")), 1)]),
|
|
100
100
|
_: 1
|
|
101
101
|
}), l(e(_), {
|
|
102
102
|
value: "middle"
|
|
103
103
|
}, {
|
|
104
|
-
default:
|
|
104
|
+
default: i(() => [C(c(e(a)("ap.apTable.setting.sizeNormal")), 1)]),
|
|
105
105
|
_: 1
|
|
106
106
|
})]),
|
|
107
107
|
_: 1
|
|
@@ -110,7 +110,7 @@ const ie = {
|
|
|
110
110
|
style: {
|
|
111
111
|
margin: "0px"
|
|
112
112
|
}
|
|
113
|
-
}), l(
|
|
113
|
+
}), l(se, {
|
|
114
114
|
class: r(e(S)("left", "content")),
|
|
115
115
|
value: e(n)
|
|
116
116
|
}, null, 8, ["class", "value"])], 2), l(e(h), {
|
|
@@ -119,11 +119,11 @@ const ie = {
|
|
|
119
119
|
height: "100%",
|
|
120
120
|
margin: "0px"
|
|
121
121
|
}
|
|
122
|
-
}),
|
|
123
|
-
class: r(e(
|
|
124
|
-
}, [l(
|
|
122
|
+
}), s("div", {
|
|
123
|
+
class: r(e(v)("right"))
|
|
124
|
+
}, [l(ie, {
|
|
125
125
|
value: e(n),
|
|
126
|
-
"onUpdate:value": t[1] || (t[1] = (o) =>
|
|
126
|
+
"onUpdate:value": t[1] || (t[1] = (o) => X(n) ? n.value = o : null),
|
|
127
127
|
onReset: j
|
|
128
128
|
}, null, 8, ["value"])], 2)], 2)]),
|
|
129
129
|
_: 1
|
|
@@ -131,5 +131,5 @@ const ie = {
|
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
133
|
export {
|
|
134
|
-
|
|
134
|
+
Be as default
|
|
135
135
|
};
|
|
@@ -1838,6 +1838,7 @@ export declare const apTableRenderItemMap: {
|
|
|
1838
1838
|
showToday: boolean;
|
|
1839
1839
|
showTime: boolean | SharedTimeProps<Dayjs>;
|
|
1840
1840
|
emptyText: string;
|
|
1841
|
+
formatBegins: boolean;
|
|
1841
1842
|
}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
|
1842
1843
|
P: {};
|
|
1843
1844
|
B: {};
|
|
@@ -1874,6 +1875,7 @@ export declare const apTableRenderItemMap: {
|
|
|
1874
1875
|
showToday: boolean;
|
|
1875
1876
|
showTime: boolean | SharedTimeProps<Dayjs>;
|
|
1876
1877
|
emptyText: string;
|
|
1878
|
+
formatBegins: boolean;
|
|
1877
1879
|
}>;
|
|
1878
1880
|
__isFragment?: never;
|
|
1879
1881
|
__isTeleport?: never;
|
|
@@ -1909,6 +1911,7 @@ export declare const apTableRenderItemMap: {
|
|
|
1909
1911
|
showToday: boolean;
|
|
1910
1912
|
showTime: boolean | SharedTimeProps<Dayjs>;
|
|
1911
1913
|
emptyText: string;
|
|
1914
|
+
formatBegins: boolean;
|
|
1912
1915
|
}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
|
|
1913
1916
|
$slots: Readonly<{
|
|
1914
1917
|
dateRender: any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ApColumnState, ApTableSettingType } from '../interface';
|
|
2
1
|
import { Ref, ComputedRef, ShallowRef } from 'vue';
|
|
3
|
-
|
|
2
|
+
import { ApColumnState, ApTableSettingType } from '../interface';
|
|
3
|
+
export declare const useTableColumnState: (columnSetting: ApTableSettingType, persistenceKey: Ref<string | undefined>, initialColumnState: ApColumnState[]) => {
|
|
4
4
|
columnState: Ref<{
|
|
5
5
|
key: string | number;
|
|
6
6
|
show?: boolean | undefined;
|
|
@@ -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
|
};
|
|
@@ -10,5 +10,6 @@ declare const _default: DefineComponent<ApFormItemBatchInputProps, {}, {}, {}, {
|
|
|
10
10
|
hasFeedback: boolean;
|
|
11
11
|
autoLink: boolean;
|
|
12
12
|
validateFirst: boolean;
|
|
13
|
+
defaultSelectedAllKey: boolean;
|
|
13
14
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
14
15
|
export default _default;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as g, computed as i, openBlock as _, createBlock as x, mergeProps as u, unref as m, withCtx as p, createVNode as s } from "vue";
|
|
2
2
|
import "./index.vue2.mjs";
|
|
3
3
|
import "../../ap-form/item/index.vue2.mjs";
|
|
4
|
-
import { isValid as
|
|
5
|
-
import { omit as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
4
|
+
import { isValid as c } from "@aplus-frontend/utils";
|
|
5
|
+
import { isEmpty as C, merge as k, omit as y } from "lodash-unified";
|
|
6
|
+
import { ApForm as F } from "../../ap-form/index.mjs";
|
|
7
|
+
import S from "../../ap-form/item/index.vue.mjs";
|
|
8
|
+
import V from "./index.vue.mjs";
|
|
9
|
+
const R = /* @__PURE__ */ g({
|
|
9
10
|
__name: "form-item",
|
|
10
11
|
props: {
|
|
11
12
|
htmlFor: {},
|
|
@@ -50,56 +51,52 @@ const A = /* @__PURE__ */ b({
|
|
|
50
51
|
field: { default: () => ({}) },
|
|
51
52
|
disabled: { type: Boolean, default: void 0 },
|
|
52
53
|
placeholer: {},
|
|
53
|
-
trim: { type: Boolean, default: !0 }
|
|
54
|
+
trim: { type: Boolean, default: !0 },
|
|
55
|
+
defaultSelectedAllKey: { type: Boolean, default: !0 }
|
|
54
56
|
},
|
|
55
57
|
setup(v) {
|
|
56
|
-
const l = v,
|
|
58
|
+
const l = v, h = i(() => (l == null ? void 0 : l.transform) || {
|
|
57
59
|
flat: !1,
|
|
58
60
|
transformer: (e) => {
|
|
59
|
-
var a,
|
|
61
|
+
var o, a, r, d, n, f;
|
|
60
62
|
if (e)
|
|
61
|
-
return !(e != null && e.value) || ((
|
|
63
|
+
return !(e != null && e.value) || ((o = e == null ? void 0 : e.value) == null ? void 0 : o.length) < 1 ? void 0 : (a = l == null ? void 0 : l.field) != null && a.options ? {
|
|
62
64
|
...e,
|
|
63
|
-
value: (
|
|
64
|
-
} : (f = (
|
|
65
|
+
value: (d = (r = e == null ? void 0 : e.value) == null ? void 0 : r.filter((t) => c(t == null ? void 0 : t.trim()))) == null ? void 0 : d.map((t) => l.trim ? t == null ? void 0 : t.trim() : t)
|
|
66
|
+
} : (f = (n = e == null ? void 0 : e.value) == null ? void 0 : n.filter((t) => c(t == null ? void 0 : t.trim()))) == null ? void 0 : f.map((t) => l.trim ? t == null ? void 0 : t.trim() : t);
|
|
65
67
|
}
|
|
66
|
-
}),
|
|
68
|
+
}), b = (e, o) => {
|
|
69
|
+
var a, r, d;
|
|
70
|
+
return !(l != null && l.initialValue) && l.defaultSelectedAllKey && C(o.value) && ((d = o["onUpdate:value"]) == null || d.call(o, {
|
|
71
|
+
key: (r = (a = l == null ? void 0 : l.field) == null ? void 0 : a.options) == null ? void 0 : r.map((n) => n.value)
|
|
72
|
+
})), k(y(e, ["style"]), o);
|
|
73
|
+
}, B = i(() => {
|
|
67
74
|
var e;
|
|
68
75
|
return ((e = l.field) == null ? void 0 : e.style) || "width:auto";
|
|
69
|
-
}), h = r(() => {
|
|
70
|
-
var e, a;
|
|
71
|
-
return (l == null ? void 0 : l.initialValue) || {
|
|
72
|
-
key: (a = (e = l == null ? void 0 : l.field) == null ? void 0 : e.options) == null ? void 0 : a.map((o) => o.value)
|
|
73
|
-
};
|
|
74
76
|
});
|
|
75
|
-
return (e,
|
|
76
|
-
var
|
|
77
|
-
return
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
V(k, u(m(p)(l.field, ["style"]), {
|
|
93
|
-
style: y.value,
|
|
94
|
-
disabled: e.disabled,
|
|
95
|
-
placeholer: e.placeholer
|
|
96
|
-
}), null, 16, ["style", "disabled", "placeholer"])
|
|
77
|
+
return (e, o) => {
|
|
78
|
+
var a, r;
|
|
79
|
+
return _(), x(S, u(m(y)(l, ["field", "transform", "placeholder", "disabled"]), {
|
|
80
|
+
transform: h.value,
|
|
81
|
+
bordered: (r = (a = e.field) == null ? void 0 : a.options) != null && r.length ? !1 : e.bordered
|
|
82
|
+
}), {
|
|
83
|
+
default: p(() => [
|
|
84
|
+
s(m(F).ControlRender, null, {
|
|
85
|
+
default: p(({ ...d }) => [
|
|
86
|
+
s(V, u(b(l.field, d), {
|
|
87
|
+
style: B.value,
|
|
88
|
+
disabled: e.disabled,
|
|
89
|
+
placeholer: e.placeholer
|
|
90
|
+
}), null, 16, ["style", "disabled", "placeholer"])
|
|
91
|
+
]),
|
|
92
|
+
_: 1
|
|
93
|
+
})
|
|
97
94
|
]),
|
|
98
95
|
_: 1
|
|
99
|
-
}, 16, ["
|
|
96
|
+
}, 16, ["transform", "bordered"]);
|
|
100
97
|
};
|
|
101
98
|
}
|
|
102
99
|
});
|
|
103
100
|
export {
|
|
104
|
-
|
|
101
|
+
R as default
|
|
105
102
|
};
|
|
@@ -56,6 +56,7 @@ declare const __VLS_component: DefineComponent<ApFieldDateProps, {}, {}, {}, {},
|
|
|
56
56
|
showToday: boolean;
|
|
57
57
|
showTime: boolean | SharedTimeProps<dayjs.Dayjs>;
|
|
58
58
|
emptyText: string;
|
|
59
|
+
formatBegins: boolean;
|
|
59
60
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
60
61
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
61
62
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("dayjs"),S=require("@aplus-frontend/antdv"),s=require("./constant.js");require("../../hooks/index.js");const m=require("lodash-unified"),T=require("./helper.js"),_=require("@aplus-frontend/utils"),M=require("../hooks/use-default-placeholder.js"),w=require("../../hooks/useControllableValue.js"),R=e.defineComponent({name:"ApFieldDate",__name:"index",props:{mode:{default:"edit"},class:{},style:{},dropdownClassName:{},dropdownAlign:{},popupStyle:{},transitionName:{},placeholder:{},allowClear:{type:Boolean,default:!0},autofocus:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},tabindex:{},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},inputReadOnly:{type:Boolean,default:void 0},id:{},presets:{},suffixIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},clearIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},getPopupContainer:{},panelRender:{},inputRender:{},onOpenChange:{},onPanelChange:{},onFocus:{},onBlur:{},onMousedown:{},onMouseup:{},onMouseenter:{},onMouseleave:{},onClick:{},onContextmenu:{},onKeydown:{},role:{},name:{},autocomplete:{},direction:{},showToday:{type:Boolean,default:void 0},showTime:{type:Boolean,default:void 0},picker:{},prefixCls:{},defaultPickerValue:{},disabledDate:{},dateRender:{},monthCellRender:{},renderExtraFooter:{},onSelect:{},locale:{},size:{},bordered:{type:Boolean,default:void 0},showNow:{type:Boolean,default:void 0},disabledTime:{},defaultOpenValue:{},showHour:{type:Boolean,default:void 0},showMinute:{type:Boolean,default:void 0},showSecond:{type:Boolean,default:void 0},use12Hours:{type:Boolean,default:void 0},hourStep:{},minuteStep:{},secondStep:{},hideDisabledOptions:{type:Boolean,default:void 0},disabledHours:{},disabledMinutes:{},disabledSeconds:{},valueFormat:{},emptyText:{default:"--"},value:{},defaultValue:{},onChange:{},onOk:{},format:{default:"Y-D"},timezone:{}},emits:["update:value"],setup(y,{emit:h}){const o=y,B=h,{value:c,updateValue:v}=w.useControllableValue(o,B),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("dayjs"),S=require("@aplus-frontend/antdv"),s=require("./constant.js");require("../../hooks/index.js");const m=require("lodash-unified"),T=require("./helper.js"),_=require("@aplus-frontend/utils"),M=require("../hooks/use-default-placeholder.js"),w=require("../../hooks/useControllableValue.js"),R=e.defineComponent({name:"ApFieldDate",__name:"index",props:{mode:{default:"edit"},class:{},style:{},dropdownClassName:{},dropdownAlign:{},popupStyle:{},transitionName:{},placeholder:{},allowClear:{type:Boolean,default:!0},autofocus:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},tabindex:{},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},inputReadOnly:{type:Boolean,default:void 0},id:{},presets:{},suffixIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},clearIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},getPopupContainer:{},panelRender:{},inputRender:{},onOpenChange:{},onPanelChange:{},onFocus:{},onBlur:{},onMousedown:{},onMouseup:{},onMouseenter:{},onMouseleave:{},onClick:{},onContextmenu:{},onKeydown:{},role:{},name:{},autocomplete:{},direction:{},showToday:{type:Boolean,default:void 0},showTime:{type:Boolean,default:void 0},picker:{},prefixCls:{},defaultPickerValue:{},disabledDate:{},dateRender:{},monthCellRender:{},renderExtraFooter:{},onSelect:{},locale:{},size:{},bordered:{type:Boolean,default:void 0},showNow:{type:Boolean,default:void 0},disabledTime:{},defaultOpenValue:{},showHour:{type:Boolean,default:void 0},showMinute:{type:Boolean,default:void 0},showSecond:{type:Boolean,default:void 0},use12Hours:{type:Boolean,default:void 0},hourStep:{},minuteStep:{},secondStep:{},hideDisabledOptions:{type:Boolean,default:void 0},disabledHours:{},disabledMinutes:{},disabledSeconds:{},valueFormat:{},emptyText:{default:"--"},value:{},defaultValue:{},onChange:{},onOk:{},format:{default:"Y-D"},formatBegins:{type:Boolean,default:!0},timezone:{}},emits:["update:value"],setup(y,{emit:h}){const o=y,B=h,{value:c,updateValue:v}=w.useControllableValue(o,B),g=M.useDefaultPlaceholder("Date",o),a=e.computed(()=>s.ApFieldDatePresetFormats.indexOf(o.format)>-1),u=e.computed(()=>a.value?s.PRESET_FORMAT_MAP[o.format]:o.format),f=e.computed(()=>{if(m.isNil(e.unref(c)))return;let t=r(e.unref(c));return o.timezone&&(t=r(_.getTimeFormatToZone(e.unref(c),o.timezone))),t}),P=e.computed(()=>e.unref(a)?o.picker??s.PRESET_FORMAT_PICK_MAP[o.format]:o.picker),k=e.computed(()=>{const t=e.unref(a)?s.PRESET_FORMAT_TIME_MAP[o.format]:{};return{...m.omit(o,["value","defaultValue","onChange","onOk","format","onUpdate:value","mode"]),placeholder:e.unref(g),...t}}),p=T.formatDayWithTimezone(o.timezone);function C(t){if(m.isNil(t)){v(null);return}const l=r(t);v(p(l,e.unref(a)?e.unref(u):void 0,o.formatBegins))}function b(t,l){var i;const d=r(t),n=t?p(d,e.unref(a)?e.unref(u):void 0,o.formatBegins):null;(i=o.onChange)==null||i.call(o,n,l)}function O(t){var n;const l=r(t),d=t?p(l,e.unref(a)?e.unref(u):void 0,o.formatBegins):null;(n=o.onOk)==null||n.call(o,d)}return(t,l)=>t.mode==="read"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(f.value?e.unref(r)(f.value).format(u.value):t.emptyText),1)],64)):(e.openBlock(),e.createBlock(e.unref(S.DatePicker),e.mergeProps({key:1},k.value,{value:f.value,format:u.value,picker:P.value,"onUpdate:value":C,onChange:b,onOk:O}),e.createSlots({_:2},[e.renderList(t.$slots,(d,n)=>({name:n,fn:e.withCtx(i=>[e.renderSlot(t.$slots,n,e.normalizeProps(e.guardReactiveProps(i||{})))])}))]),1040,["value","format","picker"]))}});exports.default=R;
|
|
@@ -41,6 +41,11 @@ export type ApFieldDateProps = BasicApFieldProps<Omit<DatePickerProps, 'mode' |
|
|
|
41
41
|
onChange?: (ts: number | null, dayStr: string) => void;
|
|
42
42
|
onOk?: (ts: number | null) => void;
|
|
43
43
|
format?: LiteralUnion<ApFormatPresetType, string>;
|
|
44
|
+
/**
|
|
45
|
+
* 格式化时间时是否以`format`的开始
|
|
46
|
+
* @default true
|
|
47
|
+
*/
|
|
48
|
+
formatBegins?: boolean;
|
|
44
49
|
/**
|
|
45
50
|
* 指定时区,指定后value会变为特定时区下的timestamp
|
|
46
51
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("@aplus-frontend/antdv"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("@aplus-frontend/antdv"),D=require("../../../../utils/slot.js"),E=require("../../../context.js");require("../tree-select/index.vue.js");const A=require("../../../hooks/use-table-column-state.js");require("../../../../config-provider/index.js");require("../sorter/index.vue.js");const f=require("../utils.js"),R=require("@ant-design/icons-vue"),O=require("../../../../config-provider/hooks/use-locale.js"),N=require("../../../../config-provider/hooks/use-namespace.js"),I=require("../tree-select/index.vue2.js"),M=require("../sorter/index.vue2.js"),U={style:{lineHeight:"22px",color:"#8896B0"}},j=e.defineComponent({__name:"index",props:{config:{default:()=>({})}},setup(C){const s=C,{columnsBackup:S,size:V,updateSize:i,updateColumns:c}=E.useInjectApTable(),d=e.ref(e.unref(V)),_=e.computed(()=>s.config.persistenceKey),{columnState:a,setColumnState:x,isAllSelected:b,toggleSelectAll:y,columnStateBackup:k,setColumnStateBackup:h,cacheColumnStateIfNeeded:q}=A.useTableColumnState(s.config,_,[]),{t:o}=O.useLocale(),{b:p,be:m}=N.useNamespace("ap-column-setting"),{b:T}=N.useNamespace("ap-table"),r=e.ref(!1),B=e.useSlots(),g=D.getSingleVNode(B.trigger)||e.createVNode(l.Button,{icon:e.createVNode(R.SettingOutlined,null,null),class:T("setting-trigger-button")},null),v=g?e.cloneVNode(g,{onClick:()=>{r.value=!0}}):null;function z(){x(f.customCloneColumnStates(e.unref(k)))}function w(){var t,n;c==null||c(f.default(e.unref(S),e.unref(a))),i==null||i(e.unref(d)),r.value=!1;const u=f.customCloneColumnStates(a.value);h(u),q(u),(n=(t=s.config)==null?void 0:t.onChange)==null||n.call(t,u)}return(u,t)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(v)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(v)),{key:0})):e.createCommentVNode("",!0),e.createVNode(e.unref(l.Modal),{open:r.value,"onUpdate:open":t[2]||(t[2]=n=>r.value=n),title:e.unref(o)("ap.apTable.setting.title"),width:900,centered:!0,"body-style":{padding:"0px !important",height:"450px"},onOk:w},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(p)("wrapper"))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(p)("left"))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(m)("left","header"))},[e.createElementVNode("div",null,[e.createElementVNode("span",U,e.toDisplayString(e.unref(o)("ap.apTable.setting.selectAllTip")),1),e.createVNode(e.unref(l.Button),{type:"link",size:"small",onClick:e.unref(y)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b)?e.unref(o)("ap.apTable.setting.unSelectAll"):e.unref(o)("ap.apTable.setting.selectAll")),1)]),_:1},8,["onClick"])]),e.createVNode(e.unref(l.RadioGroup),{value:d.value,"onUpdate:value":t[0]||(t[0]=n=>d.value=n)},{default:e.withCtx(()=>[e.createVNode(e.unref(l.RadioButton),{value:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("ap.apTable.setting.sizeSmall")),1)]),_:1}),e.createVNode(e.unref(l.RadioButton),{value:"middle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("ap.apTable.setting.sizeNormal")),1)]),_:1})]),_:1},8,["value"])],2),e.createVNode(e.unref(l.Divider),{dashed:"",style:{margin:"0px"}}),e.createVNode(I.default,{class:e.normalizeClass(e.unref(m)("left","content")),value:e.unref(a)},null,8,["class","value"])],2),e.createVNode(e.unref(l.Divider),{type:"vertical",style:{height:"100%",margin:"0px"}}),e.createElementVNode("div",{class:e.normalizeClass(e.unref(p)("right"))},[e.createVNode(M.default,{value:e.unref(a),"onUpdate:value":t[1]||(t[1]=n=>e.isRef(a)?a.value=n:null),onReset:z},null,8,["value"])],2)],2)]),_:1},8,["open","title"])],64))}});exports.default=j;
|
|
@@ -1838,6 +1838,7 @@ export declare const apTableRenderItemMap: {
|
|
|
1838
1838
|
showToday: boolean;
|
|
1839
1839
|
showTime: boolean | SharedTimeProps<Dayjs>;
|
|
1840
1840
|
emptyText: string;
|
|
1841
|
+
formatBegins: boolean;
|
|
1841
1842
|
}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
|
1842
1843
|
P: {};
|
|
1843
1844
|
B: {};
|
|
@@ -1874,6 +1875,7 @@ export declare const apTableRenderItemMap: {
|
|
|
1874
1875
|
showToday: boolean;
|
|
1875
1876
|
showTime: boolean | SharedTimeProps<Dayjs>;
|
|
1876
1877
|
emptyText: string;
|
|
1878
|
+
formatBegins: boolean;
|
|
1877
1879
|
}>;
|
|
1878
1880
|
__isFragment?: never;
|
|
1879
1881
|
__isTeleport?: never;
|
|
@@ -1909,6 +1911,7 @@ export declare const apTableRenderItemMap: {
|
|
|
1909
1911
|
showToday: boolean;
|
|
1910
1912
|
showTime: boolean | SharedTimeProps<Dayjs>;
|
|
1911
1913
|
emptyText: string;
|
|
1914
|
+
formatBegins: boolean;
|
|
1912
1915
|
}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
|
|
1913
1916
|
$slots: Readonly<{
|
|
1914
1917
|
dateRender: any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ApColumnState, ApTableSettingType } from '../interface';
|
|
2
1
|
import { Ref, ComputedRef, ShallowRef } from 'vue';
|
|
3
|
-
|
|
2
|
+
import { ApColumnState, ApTableSettingType } from '../interface';
|
|
3
|
+
export declare const useTableColumnState: (columnSetting: ApTableSettingType, persistenceKey: Ref<string | undefined>, initialColumnState: ApColumnState[]) => {
|
|
4
4
|
columnState: Ref<{
|
|
5
5
|
key: string | number;
|
|
6
6
|
show?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),R=require("../../utils/index.js"),l=require("../components/setting/utils.js"),W=require("../context.js"),d=require("lodash-unified");function a(r,n){r.forEach(i=>{var u;n(i),(u=i.children)!=null&&u.length&&a(i.children,n)})}function _(r,n){if(!n)return{};const i=r.getItem(n);return i?JSON.parse(i):{}}function O(r,n){if(d.isObject(r)&&d.isObject(n))return d.mergeWith({},r,n,O)}const T=Number.MAX_SAFE_INTEGER;function z(r,n,i,u){return u?u.fixed:n?n.fixed:i&&"fixed"in i?i.fixed:d.isBoolean(r.fixed)?r.fixed?"left":void 0:r.fixed}const D=(r,n,i)=>{const u=o.ref(i),h=o.shallowRef(l.customCloneColumnStates(i)),{columnsBackup:C,updateColumns:g}=W.useInjectApTable(),q=r.persistenceType||"localStorage",w=window[q];function B(){const e=_(w,o.unref(n)),t=d.mergeWith({},r.defaultValue||{},e,O),f=o.unref(C);function c(M,S,J){return M.map(s=>{var p,N;const A=(S==null?void 0:S[s.key])||{},x={key:s.key,label:s.title,show:!0,fixed:z(s,e[s.key],(p=r.defaultValue)==null?void 0:p[s.key],J),disabled:!1,...d.omit(A,["children","fixed"])};return x.children=(N=s.children)!=null&&N.length?c(s.children,A.children,x):void 0,x}).sort(E)}return c(f||[],t)}function E(e,t){const f=d.isNumber(e.order)?e.order:T;let c=d.isNumber(t.order)?t.order:T;return e.fixed==="right"&&t.fixed!=="right"&&(c=f-1),t.fixed==="left"&&e.fixed!=="left"&&(c=f-1),f-c}const b=o.computed(()=>o.unref(u).every(e=>e.show));function v(){const e=o.unref(u);a(e,t=>{!t.disabled&&(t.show=!0)})}function m(){const e=o.unref(u);a(e,t=>{!t.disabled&&(t.show=!1)})}function F(){o.unref(b)?m():v()}function I(e,t){a(o.unref(u),f=>{f.key===e&&(f.show=R.isDef(t)?t:!f.show)})}function y(e){u.value=e}function j(e){h.value=e}function k(e){if(o.unref(n)){const t=l.getColumnStateString(e);w.setItem(o.unref(n),JSON.stringify(t))}}return o.watchEffect(()=>{var t;const e=B();y(e),(t=r.onChange)==null||t.call(r,e),g==null||g(l.default(o.unref(C),o.unref(e))),h.value=l.customCloneColumnStates(e),k(e)}),{columnState:u,selectAll:v,unSelectAll:m,toggleSelect:I,setColumnState:y,isAllSelected:b,toggleSelectAll:F,columnStateBackup:h,setColumnStateBackup:j,cacheColumnStateIfNeeded:k}};exports.useTableColumnState=D;
|
|
@@ -10,5 +10,6 @@ declare const _default: DefineComponent<ApFormItemBatchInputProps, {}, {}, {}, {
|
|
|
10
10
|
hasFeedback: boolean;
|
|
11
11
|
autoLink: boolean;
|
|
12
12
|
validateFirst: boolean;
|
|
13
|
+
defaultSelectedAllKey: boolean;
|
|
13
14
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
14
15
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue");require("./index.vue2.js");require("../../ap-form/item/index.vue2.js");const f=require("@aplus-frontend/utils"),i=require("lodash-unified"),y=require("../../ap-form/index.js"),_=require("../../ap-form/item/index.vue.js"),h=require("./index.vue.js"),b=o.defineComponent({__name:"form-item",props:{htmlFor:{},prefixCls:{},label:{},help:{},extra:{},labelCol:{},wrapperCol:{},hasFeedback:{type:Boolean,default:!1},colon:{type:Boolean,default:void 0},labelAlign:{},prop:{},name:{},rules:{},autoLink:{type:Boolean,default:!0},required:{type:Boolean,default:void 0},validateFirst:{type:Boolean,default:void 0},validateStatus:{},validateTrigger:{},messageVariables:{},hidden:{type:Boolean},noStyle:{type:Boolean},tooltip:{},span:{},order:{},offset:{},push:{},pull:{},xs:{},sm:{},md:{},lg:{},xl:{},xxl:{},flex:{},bordered:{type:Boolean,default:!1},valuePropName:{},initialValue:{},_signal:{},transform:{},field:{default:()=>({})},disabled:{type:Boolean,default:void 0},placeholer:{},trim:{type:Boolean,default:!0},defaultSelectedAllKey:{type:Boolean,default:!0}},setup(p){const l=p,m=o.computed(()=>(l==null?void 0:l.transform)||{flat:!1,transformer:e=>{var a,r,u,d,n,s;if(e)return!(e!=null&&e.value)||((a=e==null?void 0:e.value)==null?void 0:a.length)<1?void 0:(r=l==null?void 0:l.field)!=null&&r.options?{...e,value:(d=(u=e==null?void 0:e.value)==null?void 0:u.filter(t=>f.isValid(t==null?void 0:t.trim())))==null?void 0:d.map(t=>l.trim?t==null?void 0:t.trim():t)}:(s=(n=e==null?void 0:e.value)==null?void 0:n.filter(t=>f.isValid(t==null?void 0:t.trim())))==null?void 0:s.map(t=>l.trim?t==null?void 0:t.trim():t)}}),c=(e,a)=>{var r,u,d;return!(l!=null&&l.initialValue)&&l.defaultSelectedAllKey&&i.isEmpty(a.value)&&((d=a["onUpdate:value"])==null||d.call(a,{key:(u=(r=l==null?void 0:l.field)==null?void 0:r.options)==null?void 0:u.map(n=>n.value)})),i.merge(i.omit(e,["style"]),a)},v=o.computed(()=>{var e;return((e=l.field)==null?void 0:e.style)||"width:auto"});return(e,a)=>{var r,u;return o.openBlock(),o.createBlock(_.default,o.mergeProps(o.unref(i.omit)(l,["field","transform","placeholder","disabled"]),{transform:m.value,bordered:(u=(r=e.field)==null?void 0:r.options)!=null&&u.length?!1:e.bordered}),{default:o.withCtx(()=>[o.createVNode(o.unref(y.ApForm).ControlRender,null,{default:o.withCtx(({...d})=>[o.createVNode(h.default,o.mergeProps(c(l.field,d),{style:v.value,disabled:e.disabled,placeholer:e.placeholer}),null,16,["style","disabled","placeholer"])]),_:1})]),_:1},16,["transform","bordered"])}}});exports.default=b;
|
package/package.json
CHANGED
|
@@ -470,16 +470,16 @@
|
|
|
470
470
|
.aplus-ap-table-table tr > th.ant-table-cell::before {
|
|
471
471
|
background-color: #D8DDE5 !important;
|
|
472
472
|
}
|
|
473
|
-
.aplus-ap-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell {
|
|
473
|
+
.aplus-ap-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
|
|
474
474
|
padding: 12px 16px;
|
|
475
475
|
}
|
|
476
|
-
.aplus-ap-table .ant-table.ant-table-middle .ant-table-thead .ant-table-cell {
|
|
476
|
+
.aplus-ap-table .ant-table.ant-table-middle .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
|
|
477
477
|
padding: 12px 16px;
|
|
478
478
|
}
|
|
479
|
-
.aplus-ap-table .ant-table.ant-table-small .ant-table-row .ant-table-cell {
|
|
479
|
+
.aplus-ap-table .ant-table.ant-table-small .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
|
|
480
480
|
padding: 9px 16px;
|
|
481
481
|
}
|
|
482
|
-
.aplus-ap-table .ant-table.ant-table-small .ant-table-thead .ant-table-cell {
|
|
482
|
+
.aplus-ap-table .ant-table.ant-table-small .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
|
|
483
483
|
padding: 9px 16px;
|
|
484
484
|
}
|
|
485
485
|
.aplus-ap-table .ant-table-placeholder .ant-table-expanded-row-fixed::after {
|
|
@@ -70,16 +70,16 @@
|
|
|
70
70
|
background-color: var(--ap-table-header-bg, #F2F6F9);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
.ant-table.ant-table-middle .ant-table-row .ant-table-cell {
|
|
73
|
+
.ant-table.ant-table-middle .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
|
|
74
74
|
padding: 12px 16px;
|
|
75
75
|
}
|
|
76
|
-
.ant-table.ant-table-middle .ant-table-thead .ant-table-cell {
|
|
76
|
+
.ant-table.ant-table-middle .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
|
|
77
77
|
padding: 12px 16px;
|
|
78
78
|
}
|
|
79
|
-
.ant-table.ant-table-small .ant-table-row .ant-table-cell {
|
|
79
|
+
.ant-table.ant-table-small .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
|
|
80
80
|
padding: 9px 16px;
|
|
81
81
|
}
|
|
82
|
-
.ant-table.ant-table-small .ant-table-thead .ant-table-cell {
|
|
82
|
+
.ant-table.ant-table-small .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
|
|
83
83
|
padding: 9px 16px;
|
|
84
84
|
}
|
|
85
85
|
.ant-table-placeholder .ant-table-expanded-row-fixed {
|
|
@@ -470,16 +470,16 @@
|
|
|
470
470
|
.aplus-ap-table-table tr > th.ant-table-cell::before {
|
|
471
471
|
background-color: #D8DDE5 !important;
|
|
472
472
|
}
|
|
473
|
-
.aplus-ap-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell {
|
|
473
|
+
.aplus-ap-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
|
|
474
474
|
padding: 12px 16px;
|
|
475
475
|
}
|
|
476
|
-
.aplus-ap-table .ant-table.ant-table-middle .ant-table-thead .ant-table-cell {
|
|
476
|
+
.aplus-ap-table .ant-table.ant-table-middle .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
|
|
477
477
|
padding: 12px 16px;
|
|
478
478
|
}
|
|
479
|
-
.aplus-ap-table .ant-table.ant-table-small .ant-table-row .ant-table-cell {
|
|
479
|
+
.aplus-ap-table .ant-table.ant-table-small .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
|
|
480
480
|
padding: 9px 16px;
|
|
481
481
|
}
|
|
482
|
-
.aplus-ap-table .ant-table.ant-table-small .ant-table-thead .ant-table-cell {
|
|
482
|
+
.aplus-ap-table .ant-table.ant-table-small .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
|
|
483
483
|
padding: 9px 16px;
|
|
484
484
|
}
|
|
485
485
|
.aplus-ap-table .ant-table-placeholder .ant-table-expanded-row-fixed::after {
|
package/theme/index.css
CHANGED
|
@@ -1049,16 +1049,16 @@ div.aplus-ap-info-layout-admin__header-shadow.aplus-ap-info-layout-admin__sticky
|
|
|
1049
1049
|
.aplus-ap-table-table tr > th.ant-table-cell::before {
|
|
1050
1050
|
background-color: #D8DDE5 !important;
|
|
1051
1051
|
}
|
|
1052
|
-
.aplus-ap-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell {
|
|
1052
|
+
.aplus-ap-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
|
|
1053
1053
|
padding: 12px 16px;
|
|
1054
1054
|
}
|
|
1055
|
-
.aplus-ap-table .ant-table.ant-table-middle .ant-table-thead .ant-table-cell {
|
|
1055
|
+
.aplus-ap-table .ant-table.ant-table-middle .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
|
|
1056
1056
|
padding: 12px 16px;
|
|
1057
1057
|
}
|
|
1058
|
-
.aplus-ap-table .ant-table.ant-table-small .ant-table-row .ant-table-cell {
|
|
1058
|
+
.aplus-ap-table .ant-table.ant-table-small .ant-table-row .ant-table-cell:not(.ant-table-selection-column) {
|
|
1059
1059
|
padding: 9px 16px;
|
|
1060
1060
|
}
|
|
1061
|
-
.aplus-ap-table .ant-table.ant-table-small .ant-table-thead .ant-table-cell {
|
|
1061
|
+
.aplus-ap-table .ant-table.ant-table-small .ant-table-thead .ant-table-cell:not(.ant-table-selection-column) {
|
|
1062
1062
|
padding: 9px 16px;
|
|
1063
1063
|
}
|
|
1064
1064
|
.aplus-ap-table .ant-table-placeholder .ant-table-expanded-row-fixed::after {
|