@aplus-frontend/ui 0.1.15 → 0.1.16
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 +56 -54
- package/es/src/ap-table/ap-table.vue.mjs +132 -129
- package/es/src/ap-table/interface.d.ts +20 -13
- package/es/src/ap-table/utils.d.ts +8340 -1
- package/es/src/ap-table/utils.mjs +135 -79
- package/es/src/business/index.d.ts +2 -0
- package/es/src/business/index.mjs +20 -18
- package/es/src/config-provider/config-provider-props.d.ts +5 -1
- package/es/src/config-provider/config-provider-props.mjs +4 -0
- package/es/src/config-provider/config-provider.d.ts +10 -1
- package/es/src/config-provider/config-provider.mjs +18 -17
- package/es/src/config-provider/constants.d.ts +6 -2
- package/es/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/es/src/config-provider/index.d.ts +20 -1
- package/es/src/editable-table/form-item.vue.mjs +85 -72
- package/es/src/editable-table/index.vue.mjs +99 -86
- package/es/src/editable-table/utils.mjs +31 -30
- package/es/src/index.mjs +45 -43
- package/es/src/theme/antd-global-overwrite/admin/form.css +10 -5
- package/es/src/theme/antd-global-overwrite/admin/index.css +117 -38
- package/es/src/theme/antd-global-overwrite/admin/pagination.css +54 -16
- package/es/src/theme/antd-global-overwrite/admin/table.css +53 -17
- package/es/src/theme/antd-global-overwrite/aplus/form.css +28 -14
- package/es/src/theme/antd-global-overwrite/aplus/index.css +159 -67
- package/es/src/theme/antd-global-overwrite/aplus/pagination.css +66 -20
- package/es/src/theme/antd-global-overwrite/aplus/table.css +65 -33
- package/es/src/utils/ap-trans-data/index.d.ts +9 -10
- package/es/src/utils/ap-trans-data/index.mjs +20 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/interface.d.ts +20 -13
- package/lib/src/ap-table/utils.d.ts +8340 -1
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/business/index.d.ts +2 -0
- package/lib/src/business/index.js +1 -1
- package/lib/src/config-provider/config-provider-props.d.ts +5 -1
- package/lib/src/config-provider/config-provider-props.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +10 -1
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/constants.d.ts +6 -2
- package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/lib/src/config-provider/index.d.ts +20 -1
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/editable-table/utils.js +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/theme/antd-global-overwrite/admin/form.css +10 -5
- package/lib/src/theme/antd-global-overwrite/admin/index.css +117 -38
- package/lib/src/theme/antd-global-overwrite/admin/pagination.css +54 -16
- package/lib/src/theme/antd-global-overwrite/admin/table.css +53 -17
- package/lib/src/theme/antd-global-overwrite/aplus/form.css +28 -14
- package/lib/src/theme/antd-global-overwrite/aplus/index.css +159 -67
- package/lib/src/theme/antd-global-overwrite/aplus/pagination.css +66 -20
- package/lib/src/theme/antd-global-overwrite/aplus/table.css +65 -33
- package/lib/src/utils/ap-trans-data/index.d.ts +9 -10
- package/lib/src/utils/ap-trans-data/index.js +1 -0
- package/package.json +1 -1
|
@@ -1,110 +1,166 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { isVNode as m, createVNode as c, mergeProps as i, cloneVNode as p } from "vue";
|
|
2
|
+
import { isObject as s, isArray as l, isUndefined as d, isFunction as b, omit as T, isBoolean as y } from "lodash-unified";
|
|
3
|
+
import { apTableRenderItemMap as j, apTableFormItemMap as h } from "./constants.mjs";
|
|
4
|
+
import { isType as g } from "@fruits-chain/utils";
|
|
5
|
+
import "../ap-form/index.mjs";
|
|
6
|
+
import E from "../ap-form/ap-form-item.vue.mjs";
|
|
7
|
+
function F(t) {
|
|
8
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !m(t);
|
|
9
|
+
}
|
|
10
|
+
const O = (t, e, n) => {
|
|
11
|
+
let r = {};
|
|
12
|
+
return s(t) ? Object.keys(t).forEach((o) => {
|
|
13
|
+
s(t[o]) ? r[o] = O(t[o], e[o], n) : r[o] = n(t[o], e);
|
|
14
|
+
}) : r = n(t, e), r;
|
|
15
|
+
}, _ = (t, e) => {
|
|
16
|
+
switch (t) {
|
|
9
17
|
case "dayjs":
|
|
10
|
-
return
|
|
18
|
+
return e.valueOf();
|
|
11
19
|
case "dayjsRange":
|
|
12
|
-
return
|
|
20
|
+
return e.map((n) => n.valueOf());
|
|
13
21
|
case "dayjsDayRange": {
|
|
14
|
-
const [n,
|
|
15
|
-
return [n.startOf("day").valueOf(),
|
|
22
|
+
const [n, r] = e;
|
|
23
|
+
return [n.startOf("day").valueOf(), r.endOf("day").valueOf()];
|
|
16
24
|
}
|
|
17
25
|
case "multiple":
|
|
18
26
|
case "multipleNumber":
|
|
19
|
-
return
|
|
27
|
+
return l(e) ? e : [e];
|
|
20
28
|
case "boolean":
|
|
21
|
-
return
|
|
29
|
+
return e;
|
|
22
30
|
case "object":
|
|
23
|
-
return
|
|
31
|
+
return e;
|
|
24
32
|
default:
|
|
25
|
-
return
|
|
33
|
+
return e;
|
|
26
34
|
}
|
|
27
35
|
};
|
|
28
|
-
function
|
|
29
|
-
return
|
|
36
|
+
function C(t) {
|
|
37
|
+
return l(t) ? t.join(".") : t;
|
|
30
38
|
}
|
|
31
|
-
function
|
|
32
|
-
const
|
|
33
|
-
return
|
|
39
|
+
function N(t) {
|
|
40
|
+
const e = Object.prototype.toString.call(t).match(/^\[object (.*)\]$/)[1].toLowerCase();
|
|
41
|
+
return e === "string" && typeof t == "object" ? "object" : t === null ? "null" : t === void 0 ? "undefined" : e;
|
|
34
42
|
}
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
return n.forEach((
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
if (typeof
|
|
41
|
-
|
|
42
|
-
text:
|
|
43
|
-
value:
|
|
44
|
-
label:
|
|
45
|
-
disabled:
|
|
43
|
+
const S = (t) => N(t) === "map" ? t : new Map(Object.entries(t || {})), f = (t) => {
|
|
44
|
+
const e = [], n = S(t);
|
|
45
|
+
return n.forEach((r, o) => {
|
|
46
|
+
const u = n.get(o) || n.get(`${o}`);
|
|
47
|
+
if (u) {
|
|
48
|
+
if (typeof u == "object" && (u != null && u.text)) {
|
|
49
|
+
e.push({
|
|
50
|
+
text: u == null ? void 0 : u.text,
|
|
51
|
+
value: o,
|
|
52
|
+
label: u == null ? void 0 : u.text,
|
|
53
|
+
disabled: u.disabled
|
|
46
54
|
});
|
|
47
55
|
return;
|
|
48
56
|
}
|
|
49
|
-
|
|
50
|
-
text:
|
|
51
|
-
label:
|
|
52
|
-
value:
|
|
57
|
+
e.push({
|
|
58
|
+
text: u,
|
|
59
|
+
label: u,
|
|
60
|
+
value: o
|
|
53
61
|
});
|
|
54
62
|
}
|
|
55
|
-
}),
|
|
56
|
-
},
|
|
63
|
+
}), e;
|
|
64
|
+
}, R = (t) => d(t) || t < 0 ? 0 : t, $ = (t, e, n) => {
|
|
57
65
|
if (n)
|
|
58
66
|
return n;
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (
|
|
65
|
-
return
|
|
66
|
-
if (o.includes(t))
|
|
67
|
-
return e("ap.common.chooseText");
|
|
68
|
-
if (u.includes(t))
|
|
69
|
-
return e("ap.common.inputText");
|
|
67
|
+
const r = ["select", "date"], o = ["text", "textArea", "number"];
|
|
68
|
+
if (e === "dateRange")
|
|
69
|
+
return [t("ap.common.chooseText"), t("ap.common.chooseText")];
|
|
70
|
+
if (r.includes(e))
|
|
71
|
+
return t("ap.common.chooseText");
|
|
72
|
+
if (o.includes(e))
|
|
73
|
+
return t("ap.common.inputText");
|
|
70
74
|
};
|
|
71
|
-
function
|
|
72
|
-
return !
|
|
75
|
+
function x(t, e) {
|
|
76
|
+
return !t || !b(t) ? t : t(e);
|
|
77
|
+
}
|
|
78
|
+
function q(t) {
|
|
79
|
+
let e = t.valueType || "text";
|
|
80
|
+
return t.valueEnum && (e = "status"), e;
|
|
73
81
|
}
|
|
74
|
-
function
|
|
75
|
-
|
|
76
|
-
|
|
82
|
+
function B(t, e, n) {
|
|
83
|
+
var u;
|
|
84
|
+
const r = j[t];
|
|
85
|
+
if (r)
|
|
86
|
+
return c(r, i(e, {
|
|
87
|
+
mode: "read"
|
|
88
|
+
}), null);
|
|
89
|
+
const o = n == null ? void 0 : n[t];
|
|
90
|
+
return ((u = o == null ? void 0 : o.render) == null ? void 0 : u.call(o, e.value, e)) || e.value;
|
|
77
91
|
}
|
|
78
|
-
function
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
92
|
+
function D(t, e) {
|
|
93
|
+
if (t.customRenderFormItem)
|
|
94
|
+
return () => {
|
|
95
|
+
const o = t.customRenderFormItem(t);
|
|
96
|
+
return p(o, {
|
|
97
|
+
...t.fieldProps,
|
|
98
|
+
span: t.span,
|
|
99
|
+
...o.props || {}
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
const n = h[t.valueType];
|
|
103
|
+
if (n)
|
|
104
|
+
return n;
|
|
105
|
+
const r = e == null ? void 0 : e[t.valueType];
|
|
106
|
+
return () => {
|
|
107
|
+
var u;
|
|
108
|
+
const o = (u = r == null ? void 0 : r.renderFormItem) == null ? void 0 : u.call(r, t.fieldProps.field);
|
|
109
|
+
return o ? c(E, i(t.fieldProps, {
|
|
110
|
+
span: t.span
|
|
111
|
+
}), F(o) ? o : {
|
|
112
|
+
default: () => [o]
|
|
113
|
+
}) : null;
|
|
83
114
|
};
|
|
84
115
|
}
|
|
85
|
-
function
|
|
86
|
-
const t = {
|
|
87
|
-
|
|
116
|
+
function J(t, e) {
|
|
117
|
+
const n = x(t.fieldProps, e), r = (n == null ? void 0 : n.field) || n || {}, o = t.valueType === "switch", u = t.valueType === "index", a = o ? {
|
|
118
|
+
checked: e.value
|
|
119
|
+
} : {
|
|
120
|
+
value: u ? e.index + 1 : e.value
|
|
121
|
+
};
|
|
122
|
+
return t.valueEnum && (r.valueEnum = t.valueEnum), {
|
|
123
|
+
...T(r, ["request"]),
|
|
124
|
+
...a
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function L(t) {
|
|
128
|
+
const e = {
|
|
129
|
+
...t
|
|
130
|
+
};
|
|
131
|
+
return y(t.filters) && t.filters && t.valueEnum && (e.filters = f(t.valueEnum)), e;
|
|
88
132
|
}
|
|
89
|
-
function
|
|
90
|
-
var
|
|
91
|
-
const n =
|
|
92
|
-
return
|
|
133
|
+
function U(t, e) {
|
|
134
|
+
var r;
|
|
135
|
+
const n = e || {};
|
|
136
|
+
return t.valueEnum && !((r = n.field) != null && r.options) && (n.field = {
|
|
93
137
|
...n.field,
|
|
94
|
-
options:
|
|
138
|
+
options: f(t.valueEnum)
|
|
95
139
|
}), n;
|
|
96
140
|
}
|
|
141
|
+
function z(t) {
|
|
142
|
+
if (!g("Object")(t))
|
|
143
|
+
return t;
|
|
144
|
+
try {
|
|
145
|
+
return JSON.stringify(t);
|
|
146
|
+
} catch {
|
|
147
|
+
return t;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
97
150
|
export {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
151
|
+
L as apColumnToColumn,
|
|
152
|
+
C as dataIndexToStr,
|
|
153
|
+
O as formatParamsValueType,
|
|
154
|
+
R as getColumnOrder,
|
|
155
|
+
x as getFieldProps,
|
|
156
|
+
$ as getPlaceholder,
|
|
157
|
+
D as getSearchFormItemRenderNode,
|
|
158
|
+
B as getTableCellRenderNode,
|
|
159
|
+
J as getTableRenderProps,
|
|
160
|
+
q as getTableRenderType,
|
|
161
|
+
S as objectToMap,
|
|
162
|
+
z as objectToString,
|
|
163
|
+
_ as parseFieldValue,
|
|
164
|
+
U as updateFormProps,
|
|
165
|
+
f as valueEnumToArray
|
|
110
166
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ApTransformDataHelper } from '../utils/ap-trans-data';
|
|
1
2
|
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase, Plugin, CSSProperties, PublicProps, ShallowUnwrapRef, VNode, RendererNode, RendererElement, DefineComponent } from 'vue';
|
|
2
3
|
import { TooltipPlacement } from 'ant-design-vue/es/tooltip';
|
|
3
4
|
import { LiteralUnion } from 'ant-design-vue/es/_util/type';
|
|
@@ -1311,3 +1312,4 @@ export declare const ApLabelGroup: DefineComponent<{
|
|
|
1311
1312
|
record: any;
|
|
1312
1313
|
tagValue: string | number | undefined;
|
|
1313
1314
|
}, {}>;
|
|
1315
|
+
export { ApTransformDataHelper };
|
|
@@ -9,25 +9,27 @@ import "./ap-select-layout/select-layout.vue.mjs";
|
|
|
9
9
|
import "./ap-export-group/ApExportGroup.vue.mjs";
|
|
10
10
|
import "./ap-input-radio/ApInputRadio.vue.mjs";
|
|
11
11
|
import "./ap-batch-action/ApBatchAction.vue.mjs";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
12
|
+
import { ApTransformDataHelper as M } from "../utils/ap-trans-data/index.mjs";
|
|
13
|
+
import r from "./title/ApTitle.vue2.mjs";
|
|
14
|
+
import m from "./expandAlert/ApExpandAlert.vue2.mjs";
|
|
15
|
+
import p from "./ap-label/ApLabel.vue2.mjs";
|
|
15
16
|
import i from "./ap-status/ApStatus.vue2.mjs";
|
|
16
17
|
import n from "./ap-status/ApStatusGroup.vue2.mjs";
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
const
|
|
18
|
+
import s from "./ap-select-layout/select-layout.vue2.mjs";
|
|
19
|
+
import a from "./ap-export-group/ApExportGroup.vue2.mjs";
|
|
20
|
+
import c from "./ap-input-radio/ApInputRadio.vue2.mjs";
|
|
21
|
+
import f from "./ap-batch-action/ApBatchAction.vue2.mjs";
|
|
22
|
+
const H = o(r), R = m, g = o(p), j = o(i), k = o(n), q = o(s), v = o(a), z = c, C = f, F = t;
|
|
22
23
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
C as ApBatchAction,
|
|
25
|
+
R as ApExpandAlert,
|
|
26
|
+
v as ApExportGroup,
|
|
27
|
+
z as ApInputRadio,
|
|
28
|
+
g as ApLabel,
|
|
29
|
+
F as ApLabelGroup,
|
|
30
|
+
q as ApSelectLayout,
|
|
31
|
+
j as ApStatus,
|
|
32
|
+
k as ApStatusGroup,
|
|
33
|
+
H as ApTitle,
|
|
34
|
+
M as ApTransformDataHelper
|
|
33
35
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import { LocaleType } from '../locale/interface';
|
|
3
|
-
import { ApiType, ScrollbarGlobalConfig, TableDefaultConfig, ApUploadConfig, ApDescriptionsConfig } from './constants';
|
|
3
|
+
import { ApiType, ScrollbarGlobalConfig, TableDefaultConfig, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig } from './constants';
|
|
4
4
|
import { default as __DTS_DEFAULT_0__ } from 'ant-design-vue/es/config-provider/renderEmpty';
|
|
5
5
|
import { TransformCellTextProps } from 'ant-design-vue/es/table/interface';
|
|
6
6
|
import { CSPConfig, SizeType, ThemeConfig } from 'ant-design-vue/es/config-provider/context';
|
|
@@ -155,5 +155,9 @@ export declare const configProviderProps: () => {
|
|
|
155
155
|
type: PropType<ApDescriptionsConfig>;
|
|
156
156
|
default: () => {};
|
|
157
157
|
};
|
|
158
|
+
valueTypeMap: {
|
|
159
|
+
type: PropType<Record<string, ValueTypeRenderConfig>>;
|
|
160
|
+
default: () => {};
|
|
161
|
+
};
|
|
158
162
|
};
|
|
159
163
|
export type ConfigProviderProps = Partial<ExtractPropTypes<ReturnType<typeof configProviderProps>>>;
|
|
@@ -9,7 +9,7 @@ import { ValidateMessages } from 'ant-design-vue/es/form/interface';
|
|
|
9
9
|
import { RequiredMark } from 'ant-design-vue/es/form/Form';
|
|
10
10
|
import { ThemeConfig } from 'ant-design-vue/es/config-provider/context';
|
|
11
11
|
import { LocaleType } from '..';
|
|
12
|
-
import { ApiType, TableDefaultConfig, ScrollbarGlobalConfig, ApUploadConfig, ApDescriptionsConfig } from './constants';
|
|
12
|
+
import { ApiType, TableDefaultConfig, ScrollbarGlobalConfig, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig } from './constants';
|
|
13
13
|
export declare const globalConfigCached: Ref<ConfigProviderProps>;
|
|
14
14
|
export declare const ConfigProvider: DefineComponent<{
|
|
15
15
|
iconPrefixCls: StringConstructor;
|
|
@@ -156,6 +156,10 @@ export declare const ConfigProvider: DefineComponent<{
|
|
|
156
156
|
type: PropType<ApDescriptionsConfig>;
|
|
157
157
|
default: () => {};
|
|
158
158
|
};
|
|
159
|
+
valueTypeMap: {
|
|
160
|
+
type: PropType<Record<string, ValueTypeRenderConfig>>;
|
|
161
|
+
default: () => {};
|
|
162
|
+
};
|
|
159
163
|
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
160
164
|
iconPrefixCls: StringConstructor;
|
|
161
165
|
getTargetContainer: {
|
|
@@ -301,6 +305,10 @@ export declare const ConfigProvider: DefineComponent<{
|
|
|
301
305
|
type: PropType<ApDescriptionsConfig>;
|
|
302
306
|
default: () => {};
|
|
303
307
|
};
|
|
308
|
+
valueTypeMap: {
|
|
309
|
+
type: PropType<Record<string, ValueTypeRenderConfig>>;
|
|
310
|
+
default: () => {};
|
|
311
|
+
};
|
|
304
312
|
}>>, {
|
|
305
313
|
input: {
|
|
306
314
|
autocomplete?: string;
|
|
@@ -339,5 +347,6 @@ export declare const ConfigProvider: DefineComponent<{
|
|
|
339
347
|
uiMode: "aplus" | "admin";
|
|
340
348
|
apUpload: ApUploadConfig;
|
|
341
349
|
apDescriptions: ApDescriptionsConfig;
|
|
350
|
+
valueTypeMap: Record<string, ValueTypeRenderConfig>;
|
|
342
351
|
}, {}>;
|
|
343
352
|
export type ConfigProviderInstance = InstanceType<typeof ConfigProvider>;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { isVNode as n, ref as
|
|
2
|
-
import { ConfigProvider as
|
|
3
|
-
import { provideGlobalConfig as
|
|
1
|
+
import { isVNode as n, ref as u, defineComponent as d, computed as f, watch as a, createVNode as m, renderSlot as c } from "vue";
|
|
2
|
+
import { ConfigProvider as p } from "ant-design-vue";
|
|
3
|
+
import { provideGlobalConfig as s } from "./hooks/use-global-config.mjs";
|
|
4
4
|
import { configProviderProps as g } from "./config-provider-props.mjs";
|
|
5
5
|
import { tableDefaultConfig as C } from "./constants.mjs";
|
|
6
|
-
import { mergeAntdProvideConfig as
|
|
7
|
-
import { setCSSVariables as
|
|
8
|
-
function
|
|
6
|
+
import { mergeAntdProvideConfig as v } from "../utils/config-provider-preset.mjs";
|
|
7
|
+
import { setCSSVariables as b, aplusCssVar as P, adminCssVar as M } from "../theme/css-var/index.mjs";
|
|
8
|
+
function S(e) {
|
|
9
9
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !n(e);
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const i = u({}), N = /* @__PURE__ */ d({
|
|
12
12
|
name: "AplusConfigProvider",
|
|
13
13
|
props: g(),
|
|
14
14
|
setup(e, {
|
|
15
|
-
slots:
|
|
15
|
+
slots: r
|
|
16
16
|
}) {
|
|
17
|
-
const l =
|
|
17
|
+
const l = f(() => ({
|
|
18
18
|
namespace: e.namespace,
|
|
19
19
|
aplusLocale: e.aplusLocale,
|
|
20
20
|
api: e.api,
|
|
@@ -25,20 +25,21 @@ const a = d({}), N = /* @__PURE__ */ f({
|
|
|
25
25
|
scrollbar: e.scrollbar,
|
|
26
26
|
uiMode: e.uiMode,
|
|
27
27
|
apUpload: e.apUpload,
|
|
28
|
-
apDescriptions: e.apDescriptions
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
apDescriptions: e.apDescriptions,
|
|
29
|
+
valueTypeMap: e.valueTypeMap
|
|
30
|
+
})), t = s(l);
|
|
31
|
+
return a(() => e, (o) => {
|
|
32
|
+
i.value = v(o);
|
|
32
33
|
}, {
|
|
33
34
|
deep: !0,
|
|
34
35
|
immediate: !0
|
|
35
|
-
}),
|
|
36
|
-
|
|
36
|
+
}), a(() => e.uiMode, (o) => {
|
|
37
|
+
b(o === "aplus" ? P : M);
|
|
37
38
|
}, {
|
|
38
39
|
immediate: !0
|
|
39
40
|
}), () => {
|
|
40
41
|
let o;
|
|
41
|
-
return
|
|
42
|
+
return m(p, i.value, S(o = c(r, "default", {
|
|
42
43
|
config: t == null ? void 0 : t.value
|
|
43
44
|
})) ? o : {
|
|
44
45
|
default: () => [o]
|
|
@@ -48,5 +49,5 @@ const a = d({}), N = /* @__PURE__ */ f({
|
|
|
48
49
|
});
|
|
49
50
|
export {
|
|
50
51
|
N as ConfigProvider,
|
|
51
|
-
|
|
52
|
+
i as globalConfigCached
|
|
52
53
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConfigProviderProps } from './config-provider-props';
|
|
2
|
-
import { InjectionKey, Ref } from 'vue';
|
|
2
|
+
import { InjectionKey, Ref, VNode } from 'vue';
|
|
3
3
|
import { SizeType, SorterResult } from '../pro-table/types/table';
|
|
4
|
-
import { Fn } from '../type';
|
|
4
|
+
import { Fn, Recordable } from '../type';
|
|
5
5
|
import { CommonOptionItem, ApiSelectOption } from '../pro-form/components/interface';
|
|
6
6
|
import { client } from '@aplus-frontend/oss';
|
|
7
7
|
export type ConfigProviderContext = Partial<ConfigProviderProps>;
|
|
@@ -38,6 +38,10 @@ export type ApUploadConfig = {
|
|
|
38
38
|
};
|
|
39
39
|
accept?: string;
|
|
40
40
|
};
|
|
41
|
+
export type ValueTypeRenderConfig = {
|
|
42
|
+
render?: (text: any, renderProps: Recordable) => VNode;
|
|
43
|
+
renderFormItem?: (fieldProps: Recordable) => VNode;
|
|
44
|
+
};
|
|
41
45
|
export type ApDescriptionsConfig = {
|
|
42
46
|
downloadFile?: (url: string, name: string) => void;
|
|
43
47
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MaybeRef } from '@aplus-frontend/utils';
|
|
2
2
|
import { App, Ref, ComputedRef, ExtractPropTypes, PropType } from 'vue';
|
|
3
|
-
import { ConfigProviderContext, ApiType, TableDefaultConfig, ScrollbarGlobalConfig, ApUploadConfig, ApDescriptionsConfig } from '../constants';
|
|
3
|
+
import { ConfigProviderContext, ApiType, TableDefaultConfig, ScrollbarGlobalConfig, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig } from '../constants';
|
|
4
4
|
import { default as __DTS_DEFAULT_0__ } from 'ant-design-vue/es/config-provider/renderEmpty';
|
|
5
5
|
import { TransformCellTextProps } from 'ant-design-vue/es/table/interface';
|
|
6
6
|
import { CSPConfig } from 'ant-design-vue/es/config-provider';
|
|
@@ -158,4 +158,8 @@ export declare const provideGlobalConfig: (config: MaybeRef<ConfigProviderContex
|
|
|
158
158
|
type: PropType<ApDescriptionsConfig>;
|
|
159
159
|
default: () => {};
|
|
160
160
|
};
|
|
161
|
+
valueTypeMap: {
|
|
162
|
+
type: PropType<Record<string, ValueTypeRenderConfig>>;
|
|
163
|
+
default: () => {};
|
|
164
|
+
};
|
|
161
165
|
}>>>> | undefined;
|
|
@@ -8,7 +8,7 @@ import { ValidateMessages } from 'ant-design-vue/es/form/interface';
|
|
|
8
8
|
import { RequiredMark } from 'ant-design-vue/es/form/Form';
|
|
9
9
|
import { ThemeConfig } from 'ant-design-vue/es/config-provider/context';
|
|
10
10
|
import { LocaleType } from '..';
|
|
11
|
-
import { ApiType, TableDefaultConfig, ScrollbarGlobalConfig, ApUploadConfig, ApDescriptionsConfig } from './constants';
|
|
11
|
+
import { ApiType, TableDefaultConfig, ScrollbarGlobalConfig, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig } from './constants';
|
|
12
12
|
export * from './config-provider-props';
|
|
13
13
|
export * from './constants';
|
|
14
14
|
export * from './hooks/use-global-config';
|
|
@@ -161,6 +161,10 @@ export declare const APConfigProvider: {
|
|
|
161
161
|
type: PropType<ApDescriptionsConfig>;
|
|
162
162
|
default: () => {};
|
|
163
163
|
};
|
|
164
|
+
valueTypeMap: {
|
|
165
|
+
type: PropType<Record<string, ValueTypeRenderConfig>>;
|
|
166
|
+
default: () => {};
|
|
167
|
+
};
|
|
164
168
|
}>>, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly< ExtractPropTypes<{
|
|
165
169
|
iconPrefixCls: StringConstructor;
|
|
166
170
|
getTargetContainer: {
|
|
@@ -306,6 +310,10 @@ export declare const APConfigProvider: {
|
|
|
306
310
|
type: PropType<ApDescriptionsConfig>;
|
|
307
311
|
default: () => {};
|
|
308
312
|
};
|
|
313
|
+
valueTypeMap: {
|
|
314
|
+
type: PropType<Record<string, ValueTypeRenderConfig>>;
|
|
315
|
+
default: () => {};
|
|
316
|
+
};
|
|
309
317
|
}>>, {
|
|
310
318
|
input: {
|
|
311
319
|
autocomplete?: string;
|
|
@@ -344,6 +352,7 @@ export declare const APConfigProvider: {
|
|
|
344
352
|
uiMode: "aplus" | "admin";
|
|
345
353
|
apUpload: ApUploadConfig;
|
|
346
354
|
apDescriptions: ApDescriptionsConfig;
|
|
355
|
+
valueTypeMap: Record<string, ValueTypeRenderConfig>;
|
|
347
356
|
}, true, {}, {}, {
|
|
348
357
|
P: {};
|
|
349
358
|
B: {};
|
|
@@ -496,6 +505,10 @@ export declare const APConfigProvider: {
|
|
|
496
505
|
type: PropType<ApDescriptionsConfig>;
|
|
497
506
|
default: () => {};
|
|
498
507
|
};
|
|
508
|
+
valueTypeMap: {
|
|
509
|
+
type: PropType<Record<string, ValueTypeRenderConfig>>;
|
|
510
|
+
default: () => {};
|
|
511
|
+
};
|
|
499
512
|
}>>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
|
|
500
513
|
input: {
|
|
501
514
|
autocomplete?: string;
|
|
@@ -534,6 +547,7 @@ export declare const APConfigProvider: {
|
|
|
534
547
|
uiMode: "aplus" | "admin";
|
|
535
548
|
apUpload: ApUploadConfig;
|
|
536
549
|
apDescriptions: ApDescriptionsConfig;
|
|
550
|
+
valueTypeMap: Record<string, ValueTypeRenderConfig>;
|
|
537
551
|
}>;
|
|
538
552
|
__isFragment?: never;
|
|
539
553
|
__isTeleport?: never;
|
|
@@ -683,6 +697,10 @@ export declare const APConfigProvider: {
|
|
|
683
697
|
type: PropType<ApDescriptionsConfig>;
|
|
684
698
|
default: () => {};
|
|
685
699
|
};
|
|
700
|
+
valueTypeMap: {
|
|
701
|
+
type: PropType<Record<string, ValueTypeRenderConfig>>;
|
|
702
|
+
default: () => {};
|
|
703
|
+
};
|
|
686
704
|
}>>, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
|
|
687
705
|
input: {
|
|
688
706
|
autocomplete?: string;
|
|
@@ -721,6 +739,7 @@ export declare const APConfigProvider: {
|
|
|
721
739
|
uiMode: "aplus" | "admin";
|
|
722
740
|
apUpload: ApUploadConfig;
|
|
723
741
|
apDescriptions: ApDescriptionsConfig;
|
|
742
|
+
valueTypeMap: Record<string, ValueTypeRenderConfig>;
|
|
724
743
|
}, {}, string, {}> & ( VNodeProps & ( AllowedComponentProps & ComponentCustomProps & ( Plugin & (new (...args: any[]) => {
|
|
725
744
|
$props: {
|
|
726
745
|
onClick?: () => void;
|