@aplus-frontend/ui 0.0.4 → 0.0.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-range/index.vue.mjs +65 -58
- package/es/src/ap-field/interface.d.ts +2 -2
- package/es/src/ap-form/ap-form-item-group/index.vue.mjs +23 -21
- package/es/src/ap-form/ap-form.vue.d.ts +7 -2
- package/es/src/ap-form/ap-form.vue2.mjs +85 -52
- package/es/src/ap-form/context.d.ts +14 -0
- package/es/src/ap-form/hooks/use-watch.d.ts +7 -0
- package/es/src/ap-form/hooks/use-watch.mjs +30 -0
- package/es/src/ap-form/index.d.ts +2 -0
- package/es/src/ap-form/index.mjs +13 -11
- package/es/src/ap-form/interface.d.ts +17 -7
- package/es/src/ap-form/modal-form/index.vue.d.ts +2 -2
- package/es/src/ap-form/modal-form/index.vue.mjs +1 -1
- package/es/src/ap-form/search-form/index.vue.mjs +27 -27
- package/es/src/ap-table/ap-table.vue.d.ts +2 -0
- package/es/src/ap-table/ap-table.vue.mjs +98 -93
- package/es/src/ap-table/interface.d.ts +18 -1
- package/es/src/pro-form/helper.mjs +7 -7
- package/es/src/theme/antd-global-overwrite/admin/alert.css +3 -0
- package/es/src/theme/antd-global-overwrite/admin/index.css +3 -0
- package/es/src/theme/antd-global-overwrite/aplus/alert.css +3 -0
- package/es/src/theme/antd-global-overwrite/aplus/index.css +3 -0
- package/es/src/utils/index.mjs +32 -32
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/interface.d.ts +2 -2
- package/lib/src/ap-form/ap-form-item-group/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue.d.ts +7 -2
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/context.d.ts +14 -0
- package/lib/src/ap-form/hooks/use-watch.d.ts +7 -0
- package/lib/src/ap-form/hooks/use-watch.js +1 -0
- package/lib/src/ap-form/index.d.ts +2 -0
- package/lib/src/ap-form/index.js +1 -1
- package/lib/src/ap-form/interface.d.ts +17 -7
- package/lib/src/ap-form/modal-form/index.vue.d.ts +2 -2
- package/lib/src/ap-form/modal-form/index.vue.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +2 -0
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/interface.d.ts +18 -1
- package/lib/src/pro-form/helper.js +1 -1
- package/lib/src/theme/antd-global-overwrite/admin/alert.css +3 -0
- package/lib/src/theme/antd-global-overwrite/admin/index.css +3 -0
- package/lib/src/theme/antd-global-overwrite/aplus/alert.css +3 -0
- package/lib/src/theme/antd-global-overwrite/aplus/index.css +3 -0
- package/lib/src/utils/index.js +1 -1
- package/package.json +2 -2
|
@@ -15,14 +15,13 @@ import { useLocale as se } from "../../config-provider/hooks/use-locale.mjs";
|
|
|
15
15
|
import V from "../ap-form-item.vue.mjs";
|
|
16
16
|
import pe from "../ap-form.vue2.mjs";
|
|
17
17
|
import ce from "../ap-form-item-group/index.vue.mjs";
|
|
18
|
-
function ie(
|
|
19
|
-
return typeof
|
|
18
|
+
function ie(i) {
|
|
19
|
+
return typeof i == "function" || Object.prototype.toString.call(i) === "[object Object]" && !J(i);
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const c = 24, Pe = /* @__PURE__ */ K({
|
|
22
22
|
name: "ApFormSearchForm",
|
|
23
23
|
__name: "index",
|
|
24
24
|
props: {
|
|
25
|
-
initialValues: {},
|
|
26
25
|
layout: {
|
|
27
26
|
default: "horizontal"
|
|
28
27
|
},
|
|
@@ -65,6 +64,7 @@ const p = 24, Pe = /* @__PURE__ */ K({
|
|
|
65
64
|
onFinish: {},
|
|
66
65
|
onFinishFailed: {},
|
|
67
66
|
onValidate: {},
|
|
67
|
+
initialValues: {},
|
|
68
68
|
collapse: {
|
|
69
69
|
type: Boolean,
|
|
70
70
|
default: void 0
|
|
@@ -97,12 +97,12 @@ const p = 24, Pe = /* @__PURE__ */ K({
|
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
99
|
emits: ["update:collapse"],
|
|
100
|
-
setup(
|
|
100
|
+
setup(i, {
|
|
101
101
|
expose: I,
|
|
102
102
|
emit: j
|
|
103
103
|
}) {
|
|
104
104
|
var S;
|
|
105
|
-
const l = Q(), t =
|
|
105
|
+
const l = Q(), t = i, M = j, {
|
|
106
106
|
value: f,
|
|
107
107
|
updateValue: O
|
|
108
108
|
} = ne(t, M, {
|
|
@@ -117,40 +117,40 @@ const p = 24, Pe = /* @__PURE__ */ K({
|
|
|
117
117
|
O(!o(f));
|
|
118
118
|
}
|
|
119
119
|
function L() {
|
|
120
|
-
var e;
|
|
121
|
-
(e = m.value) == null
|
|
120
|
+
var e, n;
|
|
121
|
+
(n = (e = m.value) == null ? void 0 : e.validateFields()) == null || n.then(t.onSubmit);
|
|
122
122
|
}
|
|
123
123
|
function q() {
|
|
124
|
-
var e,
|
|
125
|
-
t.customReset || (
|
|
124
|
+
var e, n, d;
|
|
125
|
+
t.customReset || (n = (e = m.value) == null ? void 0 : e.resetFields) == null || n.call(e), (d = t.onReset) == null || d.call(t);
|
|
126
126
|
}
|
|
127
|
-
const R = v(T(l.default())),
|
|
127
|
+
const R = v(T(l.default())), u = v((S = l.extra) == null ? void 0 : S.call(l)), F = C(() => Math.floor(c / t.countPerRow));
|
|
128
128
|
P(() => l.default(), (e) => {
|
|
129
129
|
R.value = T(e);
|
|
130
130
|
}), P(() => {
|
|
131
131
|
var e;
|
|
132
132
|
return (e = l.extra) == null ? void 0 : e.call(l);
|
|
133
133
|
}, (e) => {
|
|
134
|
-
|
|
134
|
+
u.value = e;
|
|
135
135
|
});
|
|
136
136
|
const z = C(() => {
|
|
137
137
|
let e;
|
|
138
|
-
const
|
|
138
|
+
const n = [...o(R)], d = [], b = [], r = o(F);
|
|
139
139
|
let h = 0;
|
|
140
|
-
|
|
141
|
-
const
|
|
142
|
-
|
|
140
|
+
n.forEach((s) => {
|
|
141
|
+
const p = s.props;
|
|
142
|
+
p != null && p.hidden ? d.push(s) : (h += p.span || r, b.push(s));
|
|
143
143
|
});
|
|
144
|
-
const B =
|
|
144
|
+
const B = c - (h + r) % c, U = B < r ? c : B, x = c - r * (o(u) && !t.extraInAction ? 2 : 1), W = !t.forceExpand && h > x;
|
|
145
145
|
let _ = 0;
|
|
146
|
-
const G = b.map((
|
|
147
|
-
const w =
|
|
148
|
-
return _ += w.span ||
|
|
149
|
-
span: w.span ||
|
|
150
|
-
key: `ApFormSearchFormItem-${
|
|
146
|
+
const G = b.map((s, p) => {
|
|
147
|
+
const w = s.props;
|
|
148
|
+
return _ += w.span || r, Y(s, {
|
|
149
|
+
span: w.span || r,
|
|
150
|
+
key: `ApFormSearchFormItem-${p}`,
|
|
151
151
|
hidden: !t.forceExpand && o(f) && _ > x
|
|
152
152
|
});
|
|
153
|
-
}), H =
|
|
153
|
+
}), H = c - Math.min(x, _) - r;
|
|
154
154
|
return a(Z, null, [G, d, a(V, {
|
|
155
155
|
span: o(F)
|
|
156
156
|
}, {
|
|
@@ -175,21 +175,21 @@ const p = 24, Pe = /* @__PURE__ */ K({
|
|
|
175
175
|
rotate: o(f) ? 90 : -90
|
|
176
176
|
}, null)
|
|
177
177
|
}, null) : null]
|
|
178
|
-
}), t.extraInAction ? o(
|
|
178
|
+
}), t.extraInAction ? o(u) : null]
|
|
179
179
|
})]
|
|
180
|
-
}), !t.extraInAction && o(
|
|
180
|
+
}), !t.extraInAction && o(u) ? a(V, {
|
|
181
181
|
span: o(f) ? H : U
|
|
182
182
|
}, {
|
|
183
183
|
default: () => [a(N, {
|
|
184
184
|
justify: "end"
|
|
185
|
-
}, ie(e = o(
|
|
185
|
+
}, ie(e = o(u)) ? e : {
|
|
186
186
|
default: () => [e]
|
|
187
187
|
})]
|
|
188
188
|
}) : null]);
|
|
189
189
|
});
|
|
190
190
|
return I({
|
|
191
191
|
apForm: C(() => o(m))
|
|
192
|
-
}), (e,
|
|
192
|
+
}), (e, n) => (k(), A(pe, ee({
|
|
193
193
|
class: o($)(),
|
|
194
194
|
ref_key: "apForm",
|
|
195
195
|
ref: m
|
|
@@ -28,6 +28,7 @@ type ApTableSlots = {
|
|
|
28
28
|
* @param fields
|
|
29
29
|
*/
|
|
30
30
|
declare function setSearchFormValues(fields: any): void;
|
|
31
|
+
declare function getSearchFormValues(): Partial<any> | undefined;
|
|
31
32
|
declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApTableProps<any, any, "text">>, {
|
|
32
33
|
bordered: boolean;
|
|
33
34
|
childrenColumnName: string;
|
|
@@ -50,6 +51,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
50
51
|
submit: () => void;
|
|
51
52
|
reset: () => void;
|
|
52
53
|
setSearchFormValues: typeof setSearchFormValues;
|
|
54
|
+
getSearchFormValues: typeof getSearchFormValues;
|
|
53
55
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApTableProps<any, any, "text">>, {
|
|
54
56
|
bordered: boolean;
|
|
55
57
|
childrenColumnName: string;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Typography as
|
|
3
|
-
import { ApForm as
|
|
4
|
-
import { apTableRenderItemMap as
|
|
1
|
+
import { defineComponent as $, computed as u, createVNode as d, mergeProps as m, unref as l, watch as H, openBlock as p, createElementBlock as c, normalizeClass as h, normalizeStyle as T, withCtx as f, Fragment as G, renderList as x, createBlock as Q, resolveDynamicComponent as U, createCommentVNode as B, createElementVNode as P, renderSlot as I, createSlots as J, toDisplayString as X, normalizeProps as Y, guardReactiveProps as Z } from "vue";
|
|
2
|
+
import { Typography as ee, Table as ae, Tooltip as te } from "ant-design-vue";
|
|
3
|
+
import { ApForm as oe } from "../ap-form/index.mjs";
|
|
4
|
+
import { apTableRenderItemMap as le, noRenderAsFormItemValueList as v, apTableFormItemMap as ne } from "./constants.mjs";
|
|
5
5
|
import "../config-provider/index.mjs";
|
|
6
|
-
import { useTablePaging as
|
|
7
|
-
import { isUndefined as
|
|
6
|
+
import { useTablePaging as re } from "./hooks/use-table-paging.mjs";
|
|
7
|
+
import { isUndefined as de, omit as se } from "lodash-unified";
|
|
8
8
|
import "./style/ap-table.css";
|
|
9
|
-
import { QuestionCircleOutlined as
|
|
10
|
-
import { apColumnToColumn as
|
|
11
|
-
import { useLocale as
|
|
12
|
-
import { useNamespace as
|
|
13
|
-
import { useGlobalConfig as
|
|
14
|
-
const
|
|
9
|
+
import { QuestionCircleOutlined as ue } from "@ant-design/icons-vue";
|
|
10
|
+
import { apColumnToColumn as pe, getTableRenderType as ie, getTableRenderProps as me, getColumnOrder as k, updateFormProps as ce, getFieldProps as fe, getPlaceholder as ge } from "./utils.mjs";
|
|
11
|
+
import { useLocale as ye } from "../config-provider/hooks/use-locale.mjs";
|
|
12
|
+
import { useNamespace as be } from "../config-provider/hooks/use-namespace.mjs";
|
|
13
|
+
import { useGlobalConfig as he } from "../config-provider/hooks/use-global-config.mjs";
|
|
14
|
+
const Ce = {
|
|
15
15
|
key: 0
|
|
16
|
-
},
|
|
16
|
+
}, Ee = /* @__PURE__ */ $({
|
|
17
17
|
name: "ApTable",
|
|
18
18
|
__name: "ap-table",
|
|
19
19
|
props: {
|
|
@@ -125,126 +125,131 @@ const he = {
|
|
|
125
125
|
setup(O, {
|
|
126
126
|
expose: z
|
|
127
127
|
}) {
|
|
128
|
-
const
|
|
128
|
+
const n = O, {
|
|
129
129
|
t: E
|
|
130
|
-
} =
|
|
131
|
-
e:
|
|
130
|
+
} = ye(), {
|
|
131
|
+
e: C,
|
|
132
132
|
b: g
|
|
133
|
-
} =
|
|
134
|
-
var
|
|
135
|
-
let e = ((
|
|
133
|
+
} = be("ap-table"), L = he("uiMode"), y = u(() => {
|
|
134
|
+
var t;
|
|
135
|
+
let e = ((t = n.columns) == null ? void 0 : t.filter((a) => !a.hideInTable)) || [];
|
|
136
136
|
return e = e.map((a) => ({
|
|
137
|
-
...
|
|
137
|
+
...pe(a),
|
|
138
138
|
customRender({
|
|
139
|
-
value:
|
|
139
|
+
value: o,
|
|
140
140
|
...r
|
|
141
141
|
}) {
|
|
142
142
|
let s;
|
|
143
143
|
if (a.customRender)
|
|
144
144
|
s = a.customRender({
|
|
145
|
-
value:
|
|
145
|
+
value: o,
|
|
146
146
|
...r,
|
|
147
147
|
column: a
|
|
148
148
|
});
|
|
149
149
|
else {
|
|
150
|
-
const w =
|
|
151
|
-
value:
|
|
150
|
+
const w = ie(a), q = le[w], K = me(a, {
|
|
151
|
+
value: o,
|
|
152
152
|
...r
|
|
153
153
|
});
|
|
154
|
-
s = d(
|
|
154
|
+
s = d(q, m(K, {
|
|
155
155
|
mode: "read"
|
|
156
156
|
}), null);
|
|
157
157
|
}
|
|
158
|
-
return A(a,
|
|
158
|
+
return A(a, o, s);
|
|
159
159
|
}
|
|
160
160
|
})), e;
|
|
161
|
-
}),
|
|
162
|
-
var e,
|
|
163
|
-
return ((a = (
|
|
164
|
-
let s = k(
|
|
161
|
+
}), F = u(() => {
|
|
162
|
+
var e, t, a;
|
|
163
|
+
return ((a = (t = (e = n.columns) == null ? void 0 : e.filter((o) => !o.hideInSearch && o.dataIndex && (o.valueType || o.customRenderFormItem) && !v.includes(o.valueType))) == null ? void 0 : t.sort((o, r) => {
|
|
164
|
+
let s = k(o.order);
|
|
165
165
|
return k(r.order) - s;
|
|
166
|
-
})) == null ? void 0 : a.map((
|
|
167
|
-
const r =
|
|
166
|
+
})) == null ? void 0 : a.map((o) => {
|
|
167
|
+
const r = ce(o, fe(o.fieldProps));
|
|
168
168
|
return {
|
|
169
|
-
...
|
|
169
|
+
...o,
|
|
170
170
|
fieldProps: {
|
|
171
|
-
label:
|
|
172
|
-
name:
|
|
171
|
+
label: o.title,
|
|
172
|
+
name: o.dataIndex,
|
|
173
173
|
...r || {},
|
|
174
174
|
// 格式化placeholder
|
|
175
|
-
placeholder:
|
|
175
|
+
placeholder: ge(E, o.valueType, r == null ? void 0 : r.placeholder)
|
|
176
176
|
}
|
|
177
177
|
};
|
|
178
178
|
})) || [];
|
|
179
|
-
}),
|
|
180
|
-
formRef:
|
|
181
|
-
submit:
|
|
182
|
-
reset:
|
|
179
|
+
}), V = u(() => l(y).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), N = u(() => l(y).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), {
|
|
180
|
+
formRef: b,
|
|
181
|
+
submit: S,
|
|
182
|
+
reset: R,
|
|
183
183
|
tableProps: i,
|
|
184
|
-
handleTableChange:
|
|
184
|
+
handleTableChange: D,
|
|
185
185
|
data: j
|
|
186
|
-
} =
|
|
186
|
+
} = re({
|
|
187
187
|
async request(e) {
|
|
188
|
-
var a,
|
|
189
|
-
const
|
|
190
|
-
return (
|
|
191
|
-
data: (
|
|
192
|
-
total: (
|
|
188
|
+
var a, o;
|
|
189
|
+
const t = await ((a = n.request) == null ? void 0 : a.call(n, e));
|
|
190
|
+
return (o = n.onLoad) == null || o.call(n, (t == null ? void 0 : t.data) || []), {
|
|
191
|
+
data: (t == null ? void 0 : t.data) || [],
|
|
192
|
+
total: (t == null ? void 0 : t.total) || 0
|
|
193
193
|
};
|
|
194
194
|
},
|
|
195
|
-
filterFields:
|
|
196
|
-
sortFields:
|
|
197
|
-
defaultParams:
|
|
198
|
-
defaultData:
|
|
199
|
-
manual:
|
|
200
|
-
defaultCurrent:
|
|
201
|
-
defaultPageSize:
|
|
202
|
-
formatParams:
|
|
195
|
+
filterFields: l(N),
|
|
196
|
+
sortFields: l(V),
|
|
197
|
+
defaultParams: n.params,
|
|
198
|
+
defaultData: n.defaultData,
|
|
199
|
+
manual: n.manual,
|
|
200
|
+
defaultCurrent: n.pagination ? n.pagination.defaultCurrent : void 0,
|
|
201
|
+
defaultPageSize: n.pagination ? n.pagination.defaultPageSize : void 0,
|
|
202
|
+
formatParams: n.beforeSearchSubmit
|
|
203
203
|
}), W = u(() => ({
|
|
204
|
-
...
|
|
205
|
-
...
|
|
206
|
-
loading:
|
|
207
|
-
pagination:
|
|
204
|
+
...n,
|
|
205
|
+
...l(i),
|
|
206
|
+
loading: de(n.loading) ? l(i).loading : n.loading,
|
|
207
|
+
pagination: n.pagination === !1 ? !1 : l(i).pagination
|
|
208
208
|
}));
|
|
209
|
-
function A(e,
|
|
210
|
-
return v.includes(e.valueType) ? a : e.copyable || e.ellipsis ? d(
|
|
209
|
+
function A(e, t, a) {
|
|
210
|
+
return v.includes(e.valueType) ? a : e.copyable || e.ellipsis ? d(ee.Text, {
|
|
211
211
|
copyable: e.copyable ? {
|
|
212
|
-
text:
|
|
212
|
+
text: t,
|
|
213
213
|
tooltip: !1
|
|
214
214
|
} : !1,
|
|
215
215
|
ellipsis: e.ellipsis ? {
|
|
216
|
-
tooltip:
|
|
216
|
+
tooltip: t
|
|
217
217
|
} : !1,
|
|
218
218
|
content: a
|
|
219
219
|
}, null) : a;
|
|
220
220
|
}
|
|
221
|
-
|
|
222
|
-
var
|
|
223
|
-
(
|
|
221
|
+
H(() => l(j).loading, (e) => {
|
|
222
|
+
var t;
|
|
223
|
+
(t = n.onLoadingChange) == null || t.call(n, e);
|
|
224
224
|
});
|
|
225
225
|
function M(e) {
|
|
226
|
-
var
|
|
227
|
-
(
|
|
226
|
+
var t, a, o;
|
|
227
|
+
(o = (a = (t = b.value) == null ? void 0 : t.apForm) == null ? void 0 : a.setFieldsValue) == null || o.call(a, e);
|
|
228
|
+
}
|
|
229
|
+
function _() {
|
|
230
|
+
var e, t, a;
|
|
231
|
+
return (a = (t = (e = b.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValue) == null ? void 0 : a.call(t, !0);
|
|
228
232
|
}
|
|
229
233
|
return z({
|
|
230
|
-
submit: () =>
|
|
231
|
-
reset: () =>
|
|
232
|
-
setSearchFormValues: M
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
submit: () => S(),
|
|
235
|
+
reset: () => R(),
|
|
236
|
+
setSearchFormValues: M,
|
|
237
|
+
getSearchFormValues: _
|
|
238
|
+
}), (e, t) => (p(), c("div", {
|
|
239
|
+
class: h(e.card ? null : l(g)("wrapper"))
|
|
240
|
+
}, [e.searchForm !== !1 && F.value.length > 0 ? (p(), c("div", {
|
|
236
241
|
key: 0,
|
|
237
|
-
class:
|
|
242
|
+
class: h(e.card ? l(C)("search-wrapper") : null),
|
|
238
243
|
style: T(e.searchFormWrapperStyle)
|
|
239
|
-
}, [d(
|
|
244
|
+
}, [d(l(oe).SearchForm, m(e.searchForm || {}, {
|
|
240
245
|
ref_key: "formRef",
|
|
241
|
-
ref:
|
|
246
|
+
ref: b,
|
|
242
247
|
"custom-reset": "",
|
|
243
|
-
onSubmit:
|
|
244
|
-
onReset:
|
|
245
|
-
"submit-loading":
|
|
248
|
+
onSubmit: l(S),
|
|
249
|
+
onReset: l(R),
|
|
250
|
+
"submit-loading": l(i).loading
|
|
246
251
|
}), {
|
|
247
|
-
default: f(() => [(p(!0), c(
|
|
252
|
+
default: f(() => [(p(!0), c(G, null, x(F.value, (a) => (p(), Q(U(a.customRenderFormItem ? a.customRenderFormItem(a) : l(ne)[a.valueType || "text"]), m({
|
|
248
253
|
key: a.dataIndex,
|
|
249
254
|
ref_for: !0
|
|
250
255
|
}, a.fieldProps || {}, {
|
|
@@ -252,22 +257,22 @@ const he = {
|
|
|
252
257
|
}), null, 16, ["span"]))), 128))]),
|
|
253
258
|
_: 1
|
|
254
259
|
}, 16, ["onSubmit", "onReset", "submit-loading"])], 6)) : B("", !0), P("div", {
|
|
255
|
-
class:
|
|
260
|
+
class: h(e.card ? l(C)("table-wrapper") : null),
|
|
256
261
|
style: T(e.tableWrapperStyle)
|
|
257
|
-
}, [I(e.$slots, "title"), d(
|
|
258
|
-
class:
|
|
262
|
+
}, [I(e.$slots, "title"), d(l(ae), m({
|
|
263
|
+
class: l(L) === "admin" ? l(g)("table-admin") : l(g)("table")
|
|
259
264
|
}, W.value, {
|
|
260
|
-
onChange:
|
|
265
|
+
onChange: l(D),
|
|
261
266
|
columns: y.value
|
|
262
|
-
}),
|
|
267
|
+
}), J({
|
|
263
268
|
headerCell: f(({
|
|
264
269
|
column: a,
|
|
265
|
-
title:
|
|
266
|
-
}) => [a.tooltip ? (p(), c("span",
|
|
270
|
+
title: o
|
|
271
|
+
}) => [a.tooltip ? (p(), c("span", Ce, [P("span", null, X(o), 1), d(l(te), {
|
|
267
272
|
title: a.tooltip,
|
|
268
273
|
placement: "bottom"
|
|
269
274
|
}, {
|
|
270
|
-
default: f(() => [d(
|
|
275
|
+
default: f(() => [d(l(ue), {
|
|
271
276
|
style: {
|
|
272
277
|
color: "#0070ff",
|
|
273
278
|
"padding-left": "4px"
|
|
@@ -276,12 +281,12 @@ const he = {
|
|
|
276
281
|
_: 2
|
|
277
282
|
}, 1032, ["title"])])) : B("", !0)]),
|
|
278
283
|
_: 2
|
|
279
|
-
}, [x(
|
|
280
|
-
name:
|
|
281
|
-
fn: f((r) => [I(e.$slots,
|
|
284
|
+
}, [x(l(se)(e.$slots, "title"), (a, o) => ({
|
|
285
|
+
name: o,
|
|
286
|
+
fn: f((r) => [I(e.$slots, o, Y(Z(r || {})))])
|
|
282
287
|
}))]), 1040, ["class", "onChange", "columns"])], 6)], 2));
|
|
283
288
|
}
|
|
284
289
|
});
|
|
285
290
|
export {
|
|
286
|
-
|
|
291
|
+
Ee as default
|
|
287
292
|
};
|
|
@@ -196,9 +196,26 @@ export type ApTableProps<RecordType = any, ParamsType = any, ValueType extends k
|
|
|
196
196
|
*/
|
|
197
197
|
size?: 'middle' | 'small';
|
|
198
198
|
};
|
|
199
|
-
export type ApTableExpose = {
|
|
199
|
+
export type ApTableExpose<SearchParamsType = Recordable> = {
|
|
200
|
+
/**
|
|
201
|
+
* 查询表单提交
|
|
202
|
+
*/
|
|
200
203
|
submit: () => void;
|
|
204
|
+
/**
|
|
205
|
+
* 查询表单重置
|
|
206
|
+
*/
|
|
201
207
|
reset: () => void;
|
|
208
|
+
/**
|
|
209
|
+
* 设置查询表单的值
|
|
210
|
+
* @param fields
|
|
211
|
+
* @returns
|
|
212
|
+
*/
|
|
213
|
+
setSearchFormValues: (fields: Partial<SearchParamsType>) => void;
|
|
214
|
+
/**
|
|
215
|
+
* 获取查询表单值
|
|
216
|
+
* @returns
|
|
217
|
+
*/
|
|
218
|
+
getSearchFormValues: () => Partial<SearchParamsType>;
|
|
202
219
|
};
|
|
203
220
|
export type FixedApColumnType<ValueType extends keyof ApTableValueFields = 'text', RecordType = any> = Omit<ApColumnType<ValueType, RecordType>, 'filters'> & {
|
|
204
221
|
filters?: ColumnType<RecordType>['filters'];
|
|
@@ -3,12 +3,12 @@ const n = ["Divider", "BasicTitle"];
|
|
|
3
3
|
function p(e) {
|
|
4
4
|
return n.includes(e || "");
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function a(e, i, r) {
|
|
7
7
|
Reflect.has(e, "type") || (["DatePicker", "MonthPicker", "WeekPicker", "TimePicker"].includes(
|
|
8
8
|
i
|
|
9
9
|
) ? e.type = r ? "string" : "object" : ["RangePicker", "Upload", "CheckboxGroup", "TimePicker"].includes(i) ? e.type = "array" : ["InputNumber"].includes(i) && (e.type = "number"));
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const l = [
|
|
12
12
|
"ApiTransfer",
|
|
13
13
|
"ApiTree",
|
|
14
14
|
"ApiTreeSelect",
|
|
@@ -18,8 +18,8 @@ const a = [
|
|
|
18
18
|
"RadioButtonGroup",
|
|
19
19
|
"ApiSelect"
|
|
20
20
|
];
|
|
21
|
-
function
|
|
22
|
-
return e.includes("Input") || e.includes("Complete") ? r("ap.common.inputText")
|
|
21
|
+
function d(e, i = "", r) {
|
|
22
|
+
return e.includes("Input") || e.includes("Complete") ? r("ap.common.inputText") : e.includes("Picker") || e.includes("Select") || e.includes("Cascader") || e.includes("Checkbox") || e.includes("Radio") || e.includes("Switch") ? r("ap.common.chooseText") : "";
|
|
23
23
|
}
|
|
24
24
|
const u = ["DatePicker", "MonthPicker", "WeekPicker", "TimePicker"];
|
|
25
25
|
function c() {
|
|
@@ -36,12 +36,12 @@ function T(e, i) {
|
|
|
36
36
|
return e && s.includes(e) && i && t(i) ? `${i}` : i;
|
|
37
37
|
}
|
|
38
38
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
l as NO_AUTO_LINK_COMPONENTS,
|
|
40
|
+
d as createPlaceholderMessage,
|
|
41
41
|
f as dateItemType,
|
|
42
42
|
s as defaultValueComponents,
|
|
43
43
|
T as handleInputNumberValue,
|
|
44
44
|
p as isIncludeSimpleComponents,
|
|
45
|
-
|
|
45
|
+
a as setComponentRuleType,
|
|
46
46
|
n as simpleComponents
|
|
47
47
|
};
|
package/es/src/utils/index.mjs
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
import { unref as s, markRaw as u } from "vue";
|
|
2
2
|
import { isUndefined as a } from "lodash-unified";
|
|
3
|
-
function
|
|
4
|
-
return (
|
|
3
|
+
function m(t) {
|
|
4
|
+
return (t == null ? void 0 : t.parentNode) ?? document.body;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
return typeof
|
|
6
|
+
function p(t) {
|
|
7
|
+
return typeof t < "u";
|
|
8
8
|
}
|
|
9
|
-
function d(
|
|
10
|
-
const
|
|
11
|
-
return Object.keys(
|
|
12
|
-
|
|
13
|
-
}),
|
|
9
|
+
function d(t) {
|
|
10
|
+
const e = {};
|
|
11
|
+
return Object.keys(t).map((n) => {
|
|
12
|
+
e[n] = s(t[n]);
|
|
13
|
+
}), e;
|
|
14
14
|
}
|
|
15
|
-
function g(
|
|
16
|
-
const r = Object.assign({},
|
|
17
|
-
for (let
|
|
18
|
-
const
|
|
19
|
-
(
|
|
15
|
+
function g(t, e = [], n) {
|
|
16
|
+
const r = Object.assign({}, t), c = Object.keys(r);
|
|
17
|
+
for (let o = 0; o < c.length; o += 1) {
|
|
18
|
+
const i = c[o];
|
|
19
|
+
(e.includes(i) || n != null && n(i, r[i])) && delete r[i];
|
|
20
20
|
}
|
|
21
21
|
return r;
|
|
22
22
|
}
|
|
23
|
-
function k(
|
|
24
|
-
return /^[A-Z][A-Za-z]*$/.test(
|
|
23
|
+
function k(t) {
|
|
24
|
+
return /^[A-Z][A-Za-z]*$/.test(t);
|
|
25
25
|
}
|
|
26
|
-
function f(
|
|
27
|
-
if (Array.isArray(
|
|
28
|
-
return
|
|
29
|
-
if (typeof
|
|
30
|
-
const
|
|
31
|
-
for (const n in
|
|
32
|
-
|
|
33
|
-
return u(
|
|
26
|
+
function f(t) {
|
|
27
|
+
if (Array.isArray(t))
|
|
28
|
+
return t.map((e) => f(e));
|
|
29
|
+
if (typeof t == "object" && t !== null) {
|
|
30
|
+
const e = {};
|
|
31
|
+
for (const n in t)
|
|
32
|
+
e[n] = f(t[n]);
|
|
33
|
+
return u(e);
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return t;
|
|
36
36
|
}
|
|
37
|
-
function O(
|
|
38
|
-
const
|
|
39
|
-
for (const n of Object.keys(
|
|
40
|
-
a(
|
|
41
|
-
return
|
|
37
|
+
function O(t) {
|
|
38
|
+
const e = { ...t };
|
|
39
|
+
for (const n of Object.keys(e))
|
|
40
|
+
a(e[n]) && delete e[n];
|
|
41
|
+
return e;
|
|
42
42
|
}
|
|
43
43
|
export {
|
|
44
44
|
f as convertReactiveToRaw,
|
|
45
45
|
d as getDynamicProps,
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
m as getPopupContainer,
|
|
47
|
+
p as isDef,
|
|
48
48
|
k as isPascalCase,
|
|
49
49
|
O as omitUndefined,
|
|
50
50
|
g as omitWhen
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../date/constant.js");require("../../hooks/index.js");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../date/constant.js");require("../../hooks/index.js");const l=require("lodash-unified"),i=require("dayjs"),T=require("ant-design-vue"),d=require("../date/helper.js"),_=require("@ant-design/icons-vue"),M=require("../../utils/index.js"),R=require("../../hooks/useControllableValue.js"),w=e.defineComponent({__name:"index",props:{mode:{default:"edit"},id:{},defaultPickerValue:{},placeholder:{},disabled:{type:[Boolean,Array],default:void 0},disabledTime:{},presets:{},ranges:{},separator:{type:[Object,String,Number,Boolean,null,Array],default:void 0},allowEmpty:{},onCalendarChange:{},onFocus:{},onBlur:{},onMousedown:{},onMouseup:{},onMouseenter:{},onMouseleave:{},onClick:{},direction:{},autocomplete:{},activePickerIndex:{},dateRender:{},panelRender:{},dropdownClassName:{},dropdownAlign:{},popupStyle:{},transitionName:{},allowClear:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},tabindex:{},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},inputReadOnly:{type:Boolean,default:void 0},format:{default:"Y-D"},suffixIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},clearIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},getPopupContainer:{},inputRender:{},onOpenChange:{},onContextmenu:{},onKeydown:{},role:{},name:{},picker:{},prefixCls:{},disabledDate:{},monthCellRender:{},locale:{},size:{},bordered:{type:Boolean,default:void 0},showTime:{type:Boolean,default:void 0},showNow:{type:Boolean,default:void 0},order:{type:Boolean,default:void 0},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:{}},emits:["update:value"],setup(B,{emit:h}){const t=B,S=h,u=e.computed(()=>v.ApFieldDatePresetFormats.indexOf(t.format)>-1),r=e.computed(()=>u.value?v.PRESET_FORMAT_MAP[t.format]:t.format),{value:y,updateValue:g}=R.useControllableValue(t,S),c=e.computed(()=>{var a,n;const o=e.unref(y);return l.isNil(o)||!(o!=null&&o.length)?o:[i((a=e.unref(y))==null?void 0:a[0]),i((n=e.unref(y))==null?void 0:n[1])]}),O=e.computed(()=>e.unref(u)?t.picker??v.PRESET_FORMAT_PICK_MAP[t.format]:t.picker),C=e.computed(()=>{const o=e.unref(u)?v.PRESET_FORMAT_TIME_MAP[t.format]:{};return{...M.omitUndefined(l.omit(t,["value","onUpdate:value","onChange","onOk","format","mode"])),...o}});function D(o){if(!o){g(o);return}const a=l.isString(o[0])?i(o[0]):o[0],n=l.isString(o[1])?i(o[1]):o[1];e.unref(u)?g([d.formatDay(a,e.unref(r)),d.formatDay(n,e.unref(r),!1)]):g([d.formatValue(a),d.formatValue(n)])}function P(o){var f;const a=l.isString(o[0])?i(o[0]):o[0],n=l.isString(o[1])?i(o[1]):o[1],s=o[0]?e.unref(u)?d.formatDay(a,e.unref(r)):a.valueOf():null,p=o[1]?e.unref(u)?d.formatDay(n,e.unref(r),!1):n.valueOf():null;(f=t.onOk)==null||f.call(t,[s,p])}function b(o,a){var m,k;if(l.isNil(o)){(m=t.onChange)==null||m.call(t,o,a);return}const n=l.isString(o[0])?i(o[0]):o[0],s=l.isString(o[1])?i(o[1]):o[1],p=o[0]?e.unref(u)?d.formatDay(n,e.unref(r)):n.valueOf():null,f=o[1]?e.unref(u)?d.formatDay(s,e.unref(r),!1):s.valueOf():null;(k=t.onChange)==null||k.call(t,[p,f],a)}return(o,a)=>{var n,s;return o.mode==="read"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[c.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString((n=c.value[0])==null?void 0:n.format(r.value))+" ",1),e.createVNode(e.unref(_.SwapRightOutlined)),e.createTextVNode(" "+e.toDisplayString((s=c.value[1])==null?void 0:s.format(r.value)),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(o.emptyText),1)],64))],64)):(e.openBlock(),e.createBlock(e.unref(T.DatePicker).RangePicker,e.mergeProps({key:1},C.value,{value:c.value,"onUpdate:value":D,onChange:b,picker:O.value,format:r.value,onOk:P}),e.createSlots({_:2},[e.renderList(o.$slots,(p,f)=>({name:f,fn:e.withCtx(m=>[e.renderSlot(o.$slots,f,e.normalizeProps(e.guardReactiveProps(m||{})))])}))]),1040,["value","picker","format"]))}}});exports.default=w;
|