@aplus-frontend/ui 0.4.13 → 0.4.14
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 +84 -80
- package/es/src/ap-descriptions/help-message/index.vue2.mjs +17 -12
- package/es/src/ap-field/date/helper.mjs +9 -9
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +62 -62
- package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +79 -67
- package/es/src/hooks/index.d.ts +1 -0
- package/es/src/hooks/index.mjs +6 -4
- package/es/src/hooks/useResize.d.ts +8 -0
- package/es/src/hooks/useResize.mjs +23 -0
- package/es/src/index.d.ts +1 -0
- package/es/src/index.mjs +212 -209
- package/es/src/path-map.mjs +2 -1
- package/es/src/resize-observer/index.d.ts +3 -0
- package/es/src/resize-observer/index.mjs +2 -0
- package/es/src/resize-observer/index.vue.d.ts +25 -0
- package/es/src/resize-observer/index.vue.mjs +45 -0
- package/es/src/resize-observer/index.vue2.mjs +4 -0
- package/es/src/resize-observer/interface.d.ts +27 -0
- package/es/src/resize-observer/interface.mjs +1 -0
- package/es/src/resize-observer/style/css.d.ts +1 -0
- package/es/src/resize-observer/style/css.js +1 -0
- package/es/src/resize-observer/style/index.d.ts +1 -0
- package/es/src/resize-observer/style/index.js +1 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-descriptions/help-message/index.vue2.js +1 -1
- package/lib/src/ap-field/date/helper.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
- package/lib/src/hooks/index.d.ts +1 -0
- package/lib/src/hooks/index.js +1 -1
- package/lib/src/hooks/useResize.d.ts +8 -0
- package/lib/src/hooks/useResize.js +1 -0
- package/lib/src/index.d.ts +1 -0
- package/lib/src/index.js +1 -1
- package/lib/src/path-map.js +1 -1
- package/lib/src/resize-observer/index.d.ts +3 -0
- package/lib/src/resize-observer/index.js +1 -0
- package/lib/src/resize-observer/index.vue.d.ts +25 -0
- package/lib/src/resize-observer/index.vue.js +1 -0
- package/lib/src/resize-observer/index.vue2.js +1 -0
- package/lib/src/resize-observer/interface.d.ts +27 -0
- package/lib/src/resize-observer/interface.js +1 -0
- package/lib/src/resize-observer/style/css.cjs +1 -0
- package/lib/src/resize-observer/style/css.d.ts +1 -0
- package/lib/src/resize-observer/style/index.cjs +1 -0
- package/lib/src/resize-observer/style/index.d.ts +1 -0
- package/package.json +3 -3
- package/theme/ap-descriptions/ap-descriptions.css +3 -0
- package/theme/ap-descriptions/ap-descriptions.less +7 -0
- package/theme/ap-table/ap-table.css +1 -1
- package/theme/ap-table/ap-table.less +1 -1
- package/theme/ap-table-modal/index.css +1 -1
- package/theme/index.css +4 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { DownOutlined as
|
|
3
|
-
import { message as
|
|
1
|
+
import { defineComponent as N, ref as L, computed as s, watch as O, openBlock as g, createBlock as p, unref as o, normalizeClass as V, withCtx as n, createVNode as b, createTextVNode as w, toDisplayString as h, mergeProps as q, createCommentVNode as z } from "vue";
|
|
2
|
+
import { DownOutlined as U } from "@ant-design/icons-vue";
|
|
3
|
+
import { message as $, Dropdown as H, Menu as J, MenuItem as S, Button as Q } from "@aplus-frontend/antdv";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
|
-
import { ApExportGroupActionType as
|
|
6
|
-
import { usePermission as
|
|
7
|
-
import { handleExportDownload as
|
|
8
|
-
import { useInjectApTable as
|
|
9
|
-
import { convertExportField as
|
|
10
|
-
import { useNamespace as
|
|
11
|
-
import { useLocale as
|
|
12
|
-
import { useGlobalConfig as
|
|
13
|
-
const
|
|
5
|
+
import { ApExportGroupActionType as m } from "./interface.mjs";
|
|
6
|
+
import { usePermission as W } from "@aplus-frontend/hooks";
|
|
7
|
+
import { handleExportDownload as X } from "./handleExportDownload.mjs";
|
|
8
|
+
import { useInjectApTable as Y } from "../../ap-table/context.mjs";
|
|
9
|
+
import { convertExportField as Z } from "./convertExportField.mjs";
|
|
10
|
+
import { useNamespace as ee } from "../../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
import { useLocale as te } from "../../config-provider/hooks/use-locale.mjs";
|
|
12
|
+
import { useGlobalConfig as A } from "../../config-provider/hooks/use-global-config.mjs";
|
|
13
|
+
const ve = /* @__PURE__ */ N({
|
|
14
14
|
__name: "ApExportGroup",
|
|
15
15
|
props: {
|
|
16
16
|
selectedRowKeys: {},
|
|
@@ -26,84 +26,96 @@ const fe = /* @__PURE__ */ j({
|
|
|
26
26
|
successMessage: { type: [Boolean, String], default: !1 },
|
|
27
27
|
exportField: { type: [Boolean, Object], default: void 0 }
|
|
28
28
|
},
|
|
29
|
-
setup(
|
|
30
|
-
const { hasPermission:
|
|
29
|
+
setup(_) {
|
|
30
|
+
const { hasPermission: B } = W(), e = _, { columns: u, dataSource: r } = Y(), { b: G } = ee("ap-export-group"), { t: i } = te(), P = A("uiMode"), E = A("exportField"), c = L(!1), v = L(!1), K = s(() => {
|
|
31
31
|
const t = {
|
|
32
32
|
aplus: "#0070FF",
|
|
33
33
|
admin: "#34b77c"
|
|
34
34
|
};
|
|
35
|
-
return
|
|
36
|
-
}),
|
|
35
|
+
return d.value ? "" : t[P.value] || t.aplus;
|
|
36
|
+
}), d = s(
|
|
37
37
|
() => {
|
|
38
38
|
var t;
|
|
39
|
-
return !!(e != null && e.disabled) || (
|
|
39
|
+
return !!(e != null && e.disabled) || (r !== void 0 ? !((t = r == null ? void 0 : r.value) != null && t.length) : !1) || c.value;
|
|
40
40
|
}
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
);
|
|
42
|
+
O(
|
|
43
|
+
() => d.value,
|
|
44
|
+
() => {
|
|
45
|
+
d.value && (v.value = !1);
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
immediate: !0
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
const D = s(() => (e == null ? void 0 : e.successMessage) === !0 ? i("ap.apExportGroup.exportSuccess") : e != null && e.successMessage ? e.successMessage : ""), y = s(() => {
|
|
52
|
+
const t = "exportFieldList", a = (e == null ? void 0 : e.exportField) ?? (E.value === "" ? !0 : E.value) ?? !1;
|
|
53
|
+
return a === !0 ? {
|
|
44
54
|
key: t
|
|
45
|
-
} : typeof
|
|
46
|
-
...
|
|
47
|
-
key:
|
|
48
|
-
} :
|
|
49
|
-
}),
|
|
55
|
+
} : typeof a == "object" ? {
|
|
56
|
+
...a,
|
|
57
|
+
key: a.key ?? t
|
|
58
|
+
} : a;
|
|
59
|
+
}), R = {
|
|
50
60
|
textAlign: "center"
|
|
51
|
-
},
|
|
61
|
+
}, F = s(() => (e == null ? void 0 : e.selectedRowKeys) || []), T = s(() => {
|
|
52
62
|
let t = e == null ? void 0 : e.ifShow;
|
|
53
|
-
return !(e != null && e.ifShow) && (e != null && e.auth) && (t = () =>
|
|
63
|
+
return !(e != null && e.ifShow) && (e != null && e.auth) && (t = () => B(e.auth)), (t == null ? void 0 : t()) ?? !0;
|
|
54
64
|
});
|
|
55
|
-
async function
|
|
56
|
-
var
|
|
57
|
-
const { getRequestParams:
|
|
58
|
-
let
|
|
59
|
-
t ===
|
|
60
|
-
[(e == null ? void 0 : e.idKey) || "ids"]:
|
|
61
|
-
} : t ===
|
|
62
|
-
const
|
|
65
|
+
async function j({ key: t }) {
|
|
66
|
+
var M, k, C;
|
|
67
|
+
const { getRequestParams: a, request: l } = e || {};
|
|
68
|
+
let x = {};
|
|
69
|
+
t === m.SELECT ? x = {
|
|
70
|
+
[(e == null ? void 0 : e.idKey) || "ids"]: F.value
|
|
71
|
+
} : t === m.ALL && (x = (a == null ? void 0 : a()) || {});
|
|
72
|
+
const I = ((M = e == null ? void 0 : e.getInitialParams) == null ? void 0 : M.call(e)) || {};
|
|
63
73
|
try {
|
|
64
74
|
c.value = !0;
|
|
65
|
-
let
|
|
75
|
+
let f = Object.assign(
|
|
66
76
|
{
|
|
67
|
-
...
|
|
68
|
-
...
|
|
77
|
+
...x,
|
|
78
|
+
...I
|
|
69
79
|
},
|
|
70
|
-
|
|
71
|
-
[
|
|
72
|
-
|
|
73
|
-
(
|
|
80
|
+
y.value && (u != null && u.value) ? {
|
|
81
|
+
[y.value.key]: Z(
|
|
82
|
+
u.value,
|
|
83
|
+
(k = y.value) == null ? void 0 : k.convertField
|
|
74
84
|
)
|
|
75
85
|
} : {}
|
|
76
86
|
);
|
|
77
|
-
|
|
87
|
+
f = ((C = e == null ? void 0 : e.beforeRequest) == null ? void 0 : C.call(e, f)) || f, await X(async () => await (l == null ? void 0 : l(f))), e != null && e.successMessage && $.success(D.value);
|
|
78
88
|
} finally {
|
|
79
89
|
c.value = !1;
|
|
80
90
|
}
|
|
81
91
|
}
|
|
82
|
-
return (t,
|
|
92
|
+
return (t, a) => T.value ? (g(), p(o(H), {
|
|
83
93
|
key: 0,
|
|
84
|
-
|
|
85
|
-
"
|
|
86
|
-
|
|
94
|
+
open: v.value,
|
|
95
|
+
"onUpdate:open": a[0] || (a[0] = (l) => v.value = l),
|
|
96
|
+
class: V([o(G)()]),
|
|
97
|
+
"overlay-style": R,
|
|
98
|
+
disabled: d.value
|
|
87
99
|
}, {
|
|
88
|
-
overlay:
|
|
89
|
-
|
|
90
|
-
default:
|
|
100
|
+
overlay: n(() => [
|
|
101
|
+
b(o(J), { onClick: j }, {
|
|
102
|
+
default: n(() => {
|
|
91
103
|
var l;
|
|
92
104
|
return [
|
|
93
|
-
(
|
|
94
|
-
key:
|
|
95
|
-
disabled: ((l =
|
|
105
|
+
(g(), p(o(S), {
|
|
106
|
+
key: o(m).SELECT,
|
|
107
|
+
disabled: ((l = F.value) == null ? void 0 : l.length) === 0
|
|
96
108
|
}, {
|
|
97
|
-
default:
|
|
98
|
-
|
|
109
|
+
default: n(() => [
|
|
110
|
+
w(h(o(i)("ap.apExportGroup.exportSelected")), 1)
|
|
99
111
|
]),
|
|
100
112
|
_: 1
|
|
101
113
|
}, 8, ["disabled"])),
|
|
102
|
-
(
|
|
103
|
-
key:
|
|
114
|
+
(g(), p(o(S), {
|
|
115
|
+
key: o(m).ALL
|
|
104
116
|
}, {
|
|
105
|
-
default:
|
|
106
|
-
|
|
117
|
+
default: n(() => [
|
|
118
|
+
w(h(o(i)("ap.apExportGroup.exportAll")), 1)
|
|
107
119
|
]),
|
|
108
120
|
_: 1
|
|
109
121
|
}))
|
|
@@ -112,26 +124,26 @@ const fe = /* @__PURE__ */ j({
|
|
|
112
124
|
_: 1
|
|
113
125
|
})
|
|
114
126
|
]),
|
|
115
|
-
default:
|
|
116
|
-
|
|
127
|
+
default: n(() => [
|
|
128
|
+
b(o(Q), q({
|
|
117
129
|
...t.$attrs
|
|
118
130
|
}, {
|
|
119
131
|
style: {
|
|
120
|
-
color:
|
|
132
|
+
color: K.value
|
|
121
133
|
},
|
|
122
134
|
loading: c.value
|
|
123
135
|
}), {
|
|
124
|
-
default:
|
|
125
|
-
|
|
126
|
-
|
|
136
|
+
default: n(() => [
|
|
137
|
+
w(h((e == null ? void 0 : e.text) ?? o(i)("ap.apExportGroup.export")) + " ", 1),
|
|
138
|
+
b(o(U))
|
|
127
139
|
]),
|
|
128
140
|
_: 1
|
|
129
141
|
}, 16, ["style", "loading"])
|
|
130
142
|
]),
|
|
131
143
|
_: 1
|
|
132
|
-
}, 8, ["class", "disabled"])) :
|
|
144
|
+
}, 8, ["open", "class", "disabled"])) : z("", !0);
|
|
133
145
|
}
|
|
134
146
|
});
|
|
135
147
|
export {
|
|
136
|
-
|
|
148
|
+
ve as default
|
|
137
149
|
};
|
package/es/src/hooks/index.d.ts
CHANGED
package/es/src/hooks/index.mjs
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { useMessage as r } from "./useMessage.mjs";
|
|
2
2
|
import { useControllableValue as t } from "./useControllableValue.mjs";
|
|
3
3
|
import { useManualRef as f } from "./useManualRef.mjs";
|
|
4
|
-
import { useThrottleRef as
|
|
5
|
-
import { useFullScreen as
|
|
4
|
+
import { useThrottleRef as m } from "./useThrottleRef.mjs";
|
|
5
|
+
import { useFullScreen as x } from "./useFullScreen.mjs";
|
|
6
|
+
import { useResize as n } from "./useResize.mjs";
|
|
6
7
|
export {
|
|
7
8
|
t as useControllableValue,
|
|
8
|
-
|
|
9
|
+
x as useFullScreen,
|
|
9
10
|
f as useManualRef,
|
|
10
11
|
r as useMessage,
|
|
11
|
-
|
|
12
|
+
n as useResize,
|
|
13
|
+
m as useThrottleRef
|
|
12
14
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type ResizeHandlerFn = (entry: ResizeObserverEntry) => void;
|
|
2
|
+
declare function observe(el: Element, handler: ResizeHandlerFn): void;
|
|
3
|
+
declare function unobserve(el: Element): void;
|
|
4
|
+
export declare const useResize: () => {
|
|
5
|
+
observe: typeof observe;
|
|
6
|
+
unobserve: typeof unobserve;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { isClient as s } from "@vueuse/core";
|
|
2
|
+
import { isFunction as a } from "lodash-unified";
|
|
3
|
+
const i = /* @__PURE__ */ new WeakMap();
|
|
4
|
+
let n;
|
|
5
|
+
s && (n = new ResizeObserver((e) => {
|
|
6
|
+
e.forEach((t) => {
|
|
7
|
+
const o = i.get(t.target);
|
|
8
|
+
a(o) && o(t);
|
|
9
|
+
});
|
|
10
|
+
}));
|
|
11
|
+
function f(e, t) {
|
|
12
|
+
i.set(e, t), n == null || n.observe(e);
|
|
13
|
+
}
|
|
14
|
+
function r(e) {
|
|
15
|
+
i.has(e) && i.delete(e), n == null || n.unobserve(e);
|
|
16
|
+
}
|
|
17
|
+
const p = () => ({
|
|
18
|
+
observe: f,
|
|
19
|
+
unobserve: r
|
|
20
|
+
});
|
|
21
|
+
export {
|
|
22
|
+
p as useResize
|
|
23
|
+
};
|
package/es/src/index.d.ts
CHANGED