@aplus-frontend/ui 0.0.15 → 0.0.17
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 +42 -38
- package/es/src/ap-form/modal-form/index.vue.mjs +1 -1
- package/es/src/ap-table/ap-table.vue.d.ts +2 -2
- package/es/src/ap-table/ap-table.vue.mjs +1 -1
- package/es/src/ap-table/interface.d.ts +12 -11
- package/es/src/ap-table/style/ap-table.css +6 -0
- package/es/src/ap-table/utils.d.ts +2188 -5
- package/es/src/business/title/style.css +29 -9
- package/es/src/check-card/checked.svg.mjs +4 -0
- package/es/src/check-card/context.d.ts +6 -0
- package/es/src/check-card/context.mjs +16 -0
- package/es/src/check-card/group.vue.d.ts +57 -0
- package/es/src/check-card/group.vue.mjs +57 -0
- package/es/src/check-card/group.vue2.mjs +4 -0
- package/es/src/check-card/index.d.ts +9 -0
- package/es/src/check-card/index.mjs +11 -0
- package/es/src/check-card/index.vue.d.ts +54 -0
- package/es/src/check-card/index.vue.mjs +4 -0
- package/es/src/check-card/index.vue2.mjs +133 -0
- package/es/src/check-card/interface.d.ts +100 -0
- package/es/src/check-card/interface.mjs +1 -0
- package/es/src/check-card/style/index.css +108 -0
- package/es/src/editable-table/hooks/use-get-columns.d.ts +26 -3
- package/es/src/editable-table/hooks/use-get-columns.mjs +54 -52
- package/es/src/editable-table/interface.d.ts +24 -7
- package/es/src/hooks/useControllableValue.mjs +15 -13
- package/es/src/index.d.ts +1 -0
- package/es/src/index.mjs +194 -190
- package/es/src/theme/antd-global-overwrite/admin/index.css +6 -6
- package/es/src/theme/antd-global-overwrite/admin/modal.css +6 -6
- package/es/src/theme/antd-global-overwrite/aplus/index.css +6 -6
- package/es/src/theme/antd-global-overwrite/aplus/modal.css +6 -6
- package/es/src/theme/ap-table/ap-table.css +6 -0
- package/es/src/theme/ap-title/ap-title.css +29 -9
- package/es/src/theme/check-card/index.css +108 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-form/modal-form/index.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +2 -2
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/interface.d.ts +12 -11
- package/lib/src/ap-table/style/ap-table.css +6 -0
- package/lib/src/ap-table/utils.d.ts +2188 -5
- package/lib/src/business/title/style.css +29 -9
- package/lib/src/check-card/checked.svg.js +1 -0
- package/lib/src/check-card/context.d.ts +6 -0
- package/lib/src/check-card/context.js +1 -0
- package/lib/src/check-card/group.vue.d.ts +57 -0
- package/lib/src/check-card/group.vue.js +1 -0
- package/lib/src/check-card/group.vue2.js +1 -0
- package/lib/src/check-card/index.d.ts +9 -0
- package/lib/src/check-card/index.js +1 -0
- package/lib/src/check-card/index.vue.d.ts +54 -0
- package/lib/src/check-card/index.vue.js +1 -0
- package/lib/src/check-card/index.vue2.js +1 -0
- package/lib/src/check-card/interface.d.ts +100 -0
- package/lib/src/check-card/interface.js +1 -0
- package/lib/src/check-card/style/index.css +108 -0
- package/lib/src/editable-table/hooks/use-get-columns.d.ts +26 -3
- package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
- package/lib/src/editable-table/interface.d.ts +24 -7
- package/lib/src/hooks/useControllableValue.js +1 -1
- package/lib/src/index.d.ts +1 -0
- package/lib/src/index.js +1 -1
- package/lib/src/theme/antd-global-overwrite/admin/index.css +6 -6
- package/lib/src/theme/antd-global-overwrite/admin/modal.css +6 -6
- package/lib/src/theme/antd-global-overwrite/aplus/index.css +6 -6
- package/lib/src/theme/antd-global-overwrite/aplus/modal.css +6 -6
- package/lib/src/theme/ap-table/ap-table.css +6 -0
- package/lib/src/theme/ap-title/ap-title.css +29 -9
- package/lib/src/theme/check-card/index.css +108 -0
- package/package.json +2 -2
|
@@ -1,76 +1,78 @@
|
|
|
1
|
-
import { computed as
|
|
1
|
+
import { computed as g, createVNode as c, mergeProps as x } from "vue";
|
|
2
2
|
import { isFunction as C } from "lodash-unified";
|
|
3
3
|
import { getEditableComponent as T } from "../utils.mjs";
|
|
4
4
|
import { updateFormProps as h, getFieldProps as F, getPlaceholder as R, getTableRenderProps as I } from "../../ap-table/utils.mjs";
|
|
5
5
|
import "../../config-provider/index.mjs";
|
|
6
|
-
import { apTableRenderItemMap as
|
|
7
|
-
import { Typography as
|
|
8
|
-
import { useLocale as
|
|
9
|
-
const
|
|
6
|
+
import { apTableRenderItemMap as N, noRenderAsFormItemValueList as v } from "../../ap-table/constants.mjs";
|
|
7
|
+
import { Typography as L } from "ant-design-vue";
|
|
8
|
+
import { useLocale as M } from "../../config-provider/hooks/use-locale.mjs";
|
|
9
|
+
const k = (a) => {
|
|
10
10
|
const {
|
|
11
|
-
t:
|
|
12
|
-
} =
|
|
13
|
-
let
|
|
14
|
-
return
|
|
11
|
+
t: s
|
|
12
|
+
} = M(), f = g(() => {
|
|
13
|
+
let o = a.columns;
|
|
14
|
+
return o ? (o = o.map((e) => ({
|
|
15
15
|
...e,
|
|
16
16
|
customRender({
|
|
17
|
-
value:
|
|
18
|
-
...
|
|
17
|
+
value: l,
|
|
18
|
+
...t
|
|
19
19
|
}) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
const u = C(e.editable) ? e.editable(t.text, t.record, t.index) : !!e.editable;
|
|
21
|
+
let d;
|
|
22
|
+
if (u) {
|
|
23
|
+
const r = T(e.valueType), n = h(e, F(e.fieldProps, {
|
|
24
|
+
value: l,
|
|
25
|
+
...t
|
|
26
|
+
})), i = {};
|
|
27
|
+
a.onFieldChange && (i[`onUpdate:${n.valuePropName || "value"}`] = (y) => {
|
|
28
|
+
var p;
|
|
29
|
+
return (p = a.onFieldChange) == null ? void 0 : p.call(a, t.index, e.dataIndex, y);
|
|
25
30
|
});
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
style: "width: 100%",
|
|
43
|
-
...(t == null ? void 0 : t.field) || {},
|
|
44
|
-
...r
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
return d(m, b, null);
|
|
48
|
-
}
|
|
49
|
-
const s = v[e.valueType], f = I(e, {
|
|
50
|
-
value: o,
|
|
51
|
-
...l
|
|
31
|
+
const b = {
|
|
32
|
+
name: [a.name, t.index, e.dataIndex],
|
|
33
|
+
...n || {},
|
|
34
|
+
// 格式化placeholder
|
|
35
|
+
placeholder: R(s, e.valueType, n == null ? void 0 : n.placeholder),
|
|
36
|
+
field: {
|
|
37
|
+
style: "width: 100%",
|
|
38
|
+
...(n == null ? void 0 : n.field) || {},
|
|
39
|
+
...i
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
d = c(r, b, null);
|
|
43
|
+
} else {
|
|
44
|
+
const r = N[e.valueType], n = I(e, {
|
|
45
|
+
value: l,
|
|
46
|
+
...t
|
|
52
47
|
});
|
|
53
|
-
|
|
48
|
+
d = m(e, l, c(r, x(n, {
|
|
54
49
|
mode: "read"
|
|
55
50
|
}), null));
|
|
56
51
|
}
|
|
52
|
+
return e.customRender ? e.customRender({
|
|
53
|
+
value: l,
|
|
54
|
+
...t,
|
|
55
|
+
column: e,
|
|
56
|
+
editable: u,
|
|
57
|
+
originalNode: d
|
|
58
|
+
}) : d;
|
|
57
59
|
}
|
|
58
|
-
})),
|
|
60
|
+
})), o) : [];
|
|
59
61
|
});
|
|
60
|
-
function
|
|
61
|
-
return
|
|
62
|
-
copyable:
|
|
62
|
+
function m(o, e, l) {
|
|
63
|
+
return v.includes(o.valueType) ? l : o.copyable || o.ellipsis ? c(L.Text, {
|
|
64
|
+
copyable: o.copyable ? {
|
|
63
65
|
text: e,
|
|
64
66
|
tooltip: !1
|
|
65
67
|
} : !1,
|
|
66
|
-
ellipsis:
|
|
68
|
+
ellipsis: o.ellipsis ? {
|
|
67
69
|
tooltip: e
|
|
68
70
|
} : !1,
|
|
69
|
-
content:
|
|
70
|
-
}, null) :
|
|
71
|
+
content: l
|
|
72
|
+
}, null) : l;
|
|
71
73
|
}
|
|
72
|
-
return
|
|
74
|
+
return f;
|
|
73
75
|
};
|
|
74
76
|
export {
|
|
75
|
-
|
|
77
|
+
k as default
|
|
76
78
|
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ColumnType, TableProps } from 'ant-design-vue/es/table';
|
|
2
|
-
import { ApTableValueFields, ValueEnum } from '../ap-table';
|
|
2
|
+
import { ApTableValueFields, ApTableValueTypes, ValueEnum } from '../ap-table';
|
|
3
3
|
import { NamePath, ValidateOptions } from 'ant-design-vue/es/form/interface';
|
|
4
4
|
import { DataIndex } from 'ant-design-vue/es/vc-table/interface';
|
|
5
5
|
import { FormItemProps } from 'ant-design-vue';
|
|
6
|
+
import { VNode } from 'vue';
|
|
6
7
|
|
|
7
|
-
export type EditableColumnType<ValueType extends
|
|
8
|
+
export type EditableColumnType<RecordType = any, ValueType extends ApTableValueTypes = ApTableValueTypes> = ValueType extends ApTableValueTypes ? Omit<ColumnType<RecordType>, 'children' | 'customRender'> & {
|
|
9
|
+
children?: EditableColumnType<RecordType, ValueType>;
|
|
8
10
|
/**
|
|
9
11
|
* 在title之后展示一个icon并触发tooltip
|
|
10
12
|
*/
|
|
@@ -25,11 +27,11 @@ export type EditableColumnType<ValueType extends keyof ApTableValueFields = 'tex
|
|
|
25
27
|
* 自定义表单
|
|
26
28
|
* @deprecated 未实现,请使用`customRender`
|
|
27
29
|
*/
|
|
28
|
-
customRenderFormItem?: (config: EditableColumnType<
|
|
30
|
+
customRenderFormItem?: (config: EditableColumnType<RecordType, ValueType>) => any;
|
|
29
31
|
/**
|
|
30
32
|
* 指定值类型(将会用于普通列和可编辑表格的渲染)
|
|
31
33
|
*/
|
|
32
|
-
valueType?:
|
|
34
|
+
valueType?: ValueType;
|
|
33
35
|
/**
|
|
34
36
|
* 值类型额外配置的参数(支持函数)
|
|
35
37
|
*/
|
|
@@ -39,14 +41,29 @@ export type EditableColumnType<ValueType extends keyof ApTableValueFields = 'tex
|
|
|
39
41
|
record: RecordType;
|
|
40
42
|
index: number;
|
|
41
43
|
renderIndex: number;
|
|
42
|
-
column: EditableColumnType<
|
|
44
|
+
column: EditableColumnType<RecordType, ValueType>;
|
|
43
45
|
}) => ApTableValueFields[ValueType]);
|
|
44
|
-
|
|
46
|
+
/**
|
|
47
|
+
* 自定义渲染,添加了`editable`以及`originalNode`
|
|
48
|
+
* @param opt
|
|
49
|
+
* @returns
|
|
50
|
+
*/
|
|
51
|
+
customRender?: (opt: {
|
|
52
|
+
value: any;
|
|
53
|
+
text: any;
|
|
54
|
+
record: RecordType;
|
|
55
|
+
index: number;
|
|
56
|
+
renderIndex: number;
|
|
57
|
+
column: ColumnType<RecordType>;
|
|
58
|
+
editable?: boolean;
|
|
59
|
+
originalNode?: VNode;
|
|
60
|
+
}) => any;
|
|
61
|
+
} : never;
|
|
45
62
|
export type EditableTableProps<RecordType = any> = Omit<TableProps<RecordType>, 'columns' | 'dataSource'> & {
|
|
46
63
|
/**
|
|
47
64
|
* 列配置
|
|
48
65
|
*/
|
|
49
|
-
columns?: EditableColumnType<
|
|
66
|
+
columns?: EditableColumnType<RecordType, any>[];
|
|
50
67
|
/**
|
|
51
68
|
* 表格数据v-model
|
|
52
69
|
*/
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
)
|
|
6
|
-
|
|
7
|
-
a[u] === void 0 && (f.value = l), r(`update:${u}`, l);
|
|
1
|
+
import { ref as v, watch as V } from "vue";
|
|
2
|
+
import { isUndefined as d } from "lodash-unified";
|
|
3
|
+
function P(u, t, e) {
|
|
4
|
+
const f = (e == null ? void 0 : e.defaultValuePropName) || "defaultValue", a = (e == null ? void 0 : e.valuePropName) || "value", r = v(c());
|
|
5
|
+
function m(l) {
|
|
6
|
+
u[a] === void 0 && (r.value = l), t(`update:${a}`, l);
|
|
8
7
|
}
|
|
9
|
-
|
|
10
|
-
()
|
|
8
|
+
function c() {
|
|
9
|
+
return d(u[a]) ? d(u[f]) ? e == null ? void 0 : e.defaultValue : u[f] : u[a];
|
|
10
|
+
}
|
|
11
|
+
return V(
|
|
12
|
+
() => u[a],
|
|
11
13
|
(l) => {
|
|
12
|
-
|
|
14
|
+
r.value = l;
|
|
13
15
|
}
|
|
14
16
|
), {
|
|
15
|
-
value:
|
|
16
|
-
updateValue:
|
|
17
|
+
value: r,
|
|
18
|
+
updateValue: m
|
|
17
19
|
};
|
|
18
20
|
}
|
|
19
21
|
export {
|
|
20
|
-
|
|
22
|
+
P as useControllableValue
|
|
21
23
|
};
|
package/es/src/index.d.ts
CHANGED