@aplus-frontend/ui 6.9.0 → 6.10.0
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-descriptions/formatter/index.d.ts +5 -0
- package/es/src/ap-descriptions/formatter/index.mjs +39 -38
- package/es/src/ap-descriptions/interface.d.ts +7 -1
- package/es/src/ap-form/search-form/hooks/use-collapse-input-count.mjs +31 -16
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ap-descriptions/formatter/index.d.ts +5 -0
- package/lib/src/ap-descriptions/formatter/index.js +1 -1
- package/lib/src/ap-descriptions/interface.d.ts +7 -1
- package/lib/src/ap-form/search-form/hooks/use-collapse-input-count.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
- package/theme/ap-grid/index.css +4 -0
- package/theme/ap-grid/index.less +4 -0
- package/theme/index.css +4 -0
|
@@ -63,6 +63,11 @@ interface NumberExtraProps {
|
|
|
63
63
|
style?: StyleValue;
|
|
64
64
|
/** 限制小数点位数 */
|
|
65
65
|
precision?: number;
|
|
66
|
+
/**
|
|
67
|
+
* 是否固定位数
|
|
68
|
+
* @default true
|
|
69
|
+
*/
|
|
70
|
+
isFixed?: boolean;
|
|
66
71
|
}
|
|
67
72
|
/** 处理数字型数据 */
|
|
68
73
|
export declare function number({ value }: FormatOptions, opt: NumberExtraProps): import("vue/jsx-runtime").JSX.Element;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { createVNode as f } from "vue";
|
|
2
|
-
import { getTimeFormatToZone as g } from "@aplus-frontend/utils";
|
|
3
|
-
import { isBoolean as
|
|
4
|
-
import { formatString as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { getTimeFormatToZone as g, toThousand as h } from "@aplus-frontend/utils";
|
|
3
|
+
import { isBoolean as Y, merge as p, get as l, debounce as A } from "lodash-unified";
|
|
4
|
+
import { formatString as b } from "./utils.mjs";
|
|
5
|
+
import { TypographyParagraph as d } from "@aplus-frontend/antdv";
|
|
6
|
+
import { toDecimalMark as M } from "@fruits-chain/utils";
|
|
7
7
|
function S({
|
|
8
8
|
value: t
|
|
9
9
|
}, n) {
|
|
10
10
|
if (!(n != null && n.ellipsis))
|
|
11
11
|
return t;
|
|
12
|
-
const
|
|
12
|
+
const i = {
|
|
13
13
|
...n,
|
|
14
14
|
content: t,
|
|
15
|
-
ellipsis: n.ellipsis ?
|
|
15
|
+
ellipsis: n.ellipsis ? Y(n.ellipsis) ? {
|
|
16
16
|
tooltip: t,
|
|
17
17
|
rows: 1
|
|
18
18
|
} : {
|
|
@@ -20,61 +20,61 @@ function S({
|
|
|
20
20
|
tooltip: t
|
|
21
21
|
} : !1
|
|
22
22
|
};
|
|
23
|
-
return f(
|
|
23
|
+
return f(d, i, null);
|
|
24
24
|
}
|
|
25
25
|
function D({
|
|
26
26
|
value: t
|
|
27
27
|
}, n) {
|
|
28
28
|
var o;
|
|
29
29
|
const {
|
|
30
|
-
joinSymbol:
|
|
30
|
+
joinSymbol: i
|
|
31
31
|
} = p({
|
|
32
32
|
joinSymbol: " "
|
|
33
33
|
}, n);
|
|
34
|
-
return (o = t == null ? void 0 : t.join) == null ? void 0 : o.call(t,
|
|
34
|
+
return (o = t == null ? void 0 : t.join) == null ? void 0 : o.call(t, i);
|
|
35
35
|
}
|
|
36
36
|
function u({
|
|
37
37
|
value: t
|
|
38
38
|
}, n) {
|
|
39
39
|
const {
|
|
40
|
-
zoneAlias:
|
|
40
|
+
zoneAlias: i,
|
|
41
41
|
format: o
|
|
42
42
|
} = p({
|
|
43
43
|
zoneAlias: "LA",
|
|
44
44
|
format: "YYYY-MM-DD HH:mm:ss"
|
|
45
45
|
}, n);
|
|
46
|
-
return g(t,
|
|
46
|
+
return g(t, i, o);
|
|
47
47
|
}
|
|
48
48
|
function y({
|
|
49
49
|
value: t,
|
|
50
50
|
record: n
|
|
51
|
-
},
|
|
51
|
+
}, i) {
|
|
52
52
|
const {
|
|
53
53
|
fieldList: o,
|
|
54
|
-
templateString:
|
|
55
|
-
formatter:
|
|
56
|
-
} =
|
|
54
|
+
templateString: e = "{0}",
|
|
55
|
+
formatter: r
|
|
56
|
+
} = i, s = (o == null ? void 0 : o.map((m, a) => {
|
|
57
57
|
const c = l(n, m);
|
|
58
|
-
return
|
|
58
|
+
return r ? r(c, a) : c;
|
|
59
59
|
})) || [];
|
|
60
|
-
return s.length === 0 && s.push(t),
|
|
60
|
+
return s.length === 0 && s.push(t), b(e, s);
|
|
61
61
|
}
|
|
62
62
|
function j({
|
|
63
63
|
value: t,
|
|
64
64
|
record: n
|
|
65
|
-
},
|
|
65
|
+
}, i) {
|
|
66
66
|
const {
|
|
67
67
|
fieldList: o,
|
|
68
|
-
format:
|
|
69
|
-
joinSymbol:
|
|
68
|
+
format: e = "YYYY-MM-DD HH:mm:ss",
|
|
69
|
+
joinSymbol: r = "~",
|
|
70
70
|
zoneAlias: s = "LA"
|
|
71
|
-
} =
|
|
71
|
+
} = i, m = Array.isArray(e) ? e : [e, e];
|
|
72
72
|
return y({
|
|
73
73
|
value: t,
|
|
74
74
|
record: n
|
|
75
75
|
}, {
|
|
76
76
|
fieldList: o,
|
|
77
|
-
templateString: `{0} ${
|
|
77
|
+
templateString: `{0} ${r} {1}`,
|
|
78
78
|
formatter(a, c) {
|
|
79
79
|
return u({
|
|
80
80
|
value: a,
|
|
@@ -90,16 +90,16 @@ function k({
|
|
|
90
90
|
record: t
|
|
91
91
|
}, n) {
|
|
92
92
|
const {
|
|
93
|
-
urlPath:
|
|
93
|
+
urlPath: i = "url",
|
|
94
94
|
namePath: o = "name",
|
|
95
|
-
style:
|
|
96
|
-
downloadFile:
|
|
95
|
+
style: e,
|
|
96
|
+
downloadFile: r,
|
|
97
97
|
className: s
|
|
98
|
-
} = n, m = l(t, o), a = l(t,
|
|
99
|
-
|
|
98
|
+
} = n, m = l(t, o), a = l(t, i), c = A(() => {
|
|
99
|
+
r == null || r(a, m);
|
|
100
100
|
}, 500);
|
|
101
101
|
return f("span", {
|
|
102
|
-
style:
|
|
102
|
+
style: e,
|
|
103
103
|
class: [s, "ap-descriptions-item-content__link "],
|
|
104
104
|
onClick: c
|
|
105
105
|
}, [m]);
|
|
@@ -108,21 +108,22 @@ function H({
|
|
|
108
108
|
value: t
|
|
109
109
|
}, n) {
|
|
110
110
|
const {
|
|
111
|
-
style:
|
|
112
|
-
precision: o
|
|
111
|
+
style: i = {},
|
|
112
|
+
precision: o,
|
|
113
|
+
isFixed: e = !0
|
|
113
114
|
} = n;
|
|
114
|
-
let
|
|
115
|
+
let r = "";
|
|
115
116
|
try {
|
|
116
|
-
|
|
117
|
+
e ? r = h(t, o, "fixed") : r = M(t, o);
|
|
117
118
|
} catch {
|
|
118
|
-
|
|
119
|
+
r = t;
|
|
119
120
|
}
|
|
120
121
|
return f("span", {
|
|
121
|
-
style:
|
|
122
|
+
style: i,
|
|
122
123
|
class: "ap-descriptions-item-content__number"
|
|
123
|
-
}, [
|
|
124
|
+
}, [r]);
|
|
124
125
|
}
|
|
125
|
-
const
|
|
126
|
+
const B = {
|
|
126
127
|
text: S,
|
|
127
128
|
array: D,
|
|
128
129
|
date: u,
|
|
@@ -136,7 +137,7 @@ export {
|
|
|
136
137
|
k as attachment,
|
|
137
138
|
u as date,
|
|
138
139
|
j as dateRange,
|
|
139
|
-
|
|
140
|
+
B as formatterMap,
|
|
140
141
|
H as number,
|
|
141
142
|
y as template,
|
|
142
143
|
S as text
|
|
@@ -12,10 +12,16 @@ type MixObjectPropertyType<O, key extends keyof O> = key extends keyof O ? {
|
|
|
12
12
|
} : never;
|
|
13
13
|
export type TransformOptionType = MixObjectPropertyType<FormatterMapType, FormatterValueType>;
|
|
14
14
|
type Recordable = Record<string, any>;
|
|
15
|
+
type AllKeys<T, P extends string = '', Level extends unknown[] = []> = Level['length'] extends 5 ? never : T extends object ? {
|
|
16
|
+
[K in keyof T]: `${P}${K extends string ? K : never}` | (T[K] extends object ? AllKeys<T[K], `${P}${K extends string ? K : never}.`, [
|
|
17
|
+
...Level,
|
|
18
|
+
unknown
|
|
19
|
+
]> : never);
|
|
20
|
+
}[keyof T] : never;
|
|
15
21
|
/** 基本描述类型 */
|
|
16
22
|
export interface ItemSchema<T extends Recordable = Recordable> {
|
|
17
23
|
label: VNodeChild | VNode;
|
|
18
|
-
field:
|
|
24
|
+
field: Extract<AllKeys<T>, string> | string[];
|
|
19
25
|
span?: number;
|
|
20
26
|
prefix?: VNodeChild | VNode;
|
|
21
27
|
suffix?: VNodeChild | VNode;
|
|
@@ -1,24 +1,39 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { useInjectForm as
|
|
3
|
-
import { isArray as
|
|
4
|
-
function
|
|
5
|
-
return
|
|
1
|
+
import { computed as u } from "vue";
|
|
2
|
+
import { useInjectForm as l } from "../../context.mjs";
|
|
3
|
+
import { isArray as o, isObject as d } from "lodash-unified";
|
|
4
|
+
function a(t, r) {
|
|
5
|
+
return o(r) ? r.reduce((n, e) => n == null ? void 0 : n[e], t) : t == null ? void 0 : t[r];
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
|
|
7
|
+
function i(t) {
|
|
8
|
+
if (t == null)
|
|
9
|
+
return !1;
|
|
10
|
+
if (typeof t == "string")
|
|
11
|
+
return t.trim() !== "";
|
|
12
|
+
if (o(t))
|
|
13
|
+
return t.some((n) => i(n));
|
|
14
|
+
if (d(t)) {
|
|
15
|
+
const r = Object.keys(t);
|
|
16
|
+
if (r.length === 0)
|
|
17
|
+
return !1;
|
|
18
|
+
for (const n of r)
|
|
19
|
+
if (i(t[n]))
|
|
20
|
+
return !0;
|
|
21
|
+
return !1;
|
|
22
|
+
}
|
|
23
|
+
return !0;
|
|
9
24
|
}
|
|
10
|
-
const
|
|
11
|
-
const { model: r } =
|
|
25
|
+
const y = (t) => {
|
|
26
|
+
const { model: r } = l();
|
|
12
27
|
return {
|
|
13
|
-
count:
|
|
14
|
-
let
|
|
15
|
-
return t.value.forEach((
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
}),
|
|
28
|
+
count: u(() => {
|
|
29
|
+
let e = 0;
|
|
30
|
+
return t.value.forEach((s) => {
|
|
31
|
+
const c = [s.node.props.name].flat(1), f = a(r == null ? void 0 : r.value, c);
|
|
32
|
+
i(f) && (e += 1);
|
|
33
|
+
}), e;
|
|
19
34
|
})
|
|
20
35
|
};
|
|
21
36
|
};
|
|
22
37
|
export {
|
|
23
|
-
|
|
38
|
+
y as useCollapseInputCount
|
|
24
39
|
};
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "6.
|
|
1
|
+
declare const _default: "6.10.0";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED
|
@@ -63,6 +63,11 @@ interface NumberExtraProps {
|
|
|
63
63
|
style?: StyleValue;
|
|
64
64
|
/** 限制小数点位数 */
|
|
65
65
|
precision?: number;
|
|
66
|
+
/**
|
|
67
|
+
* 是否固定位数
|
|
68
|
+
* @default true
|
|
69
|
+
*/
|
|
70
|
+
isFixed?: boolean;
|
|
66
71
|
}
|
|
67
72
|
/** 处理数字型数据 */
|
|
68
73
|
export declare function number({ value }: FormatOptions, opt: NumberExtraProps): import("vue/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("vue"),g=require("@aplus-frontend/utils"),a=require("lodash-unified"),S=require("./utils.js"),Y=require("@aplus-frontend/antdv"),A=require("@fruits-chain/utils");function y({value:t},e){if(!(e!=null&&e.ellipsis))return t;const o={...e,content:t,ellipsis:e.ellipsis?a.isBoolean(e.ellipsis)?{tooltip:t,rows:1}:{...e.ellipsis,tooltip:t}:!1};return u.createVNode(Y.TypographyParagraph,o,null)}function d({value:t},e){var n;const{joinSymbol:o}=a.merge({joinSymbol:" "},e);return(n=t==null?void 0:t.join)==null?void 0:n.call(t,o)}function f({value:t},e){const{zoneAlias:o,format:n}=a.merge({zoneAlias:"LA",format:"YYYY-MM-DD HH:mm:ss"},e);return g.getTimeFormatToZone(t,o,n)}function p({value:t,record:e},o){const{fieldList:n,templateString:i="{0}",formatter:r}=o,s=(n==null?void 0:n.map((c,l)=>{const m=a.get(e,c);return r?r(m,l):m}))||[];return s.length===0&&s.push(t),S.formatString(i,s)}function h({value:t,record:e},o){const{fieldList:n,format:i="YYYY-MM-DD HH:mm:ss",joinSymbol:r="~",zoneAlias:s="LA"}=o,c=Array.isArray(i)?i:[i,i];return p({value:t,record:e},{fieldList:n,templateString:`{0} ${r} {1}`,formatter(l,m){return f({value:l,record:e},{format:c[m],zoneAlias:s})}})}function b({record:t},e){const{urlPath:o="url",namePath:n="name",style:i,downloadFile:r,className:s}=e,c=a.get(t,n),l=a.get(t,o),m=a.debounce(()=>{r==null||r(l,c)},500);return u.createVNode("span",{style:i,class:[s,"ap-descriptions-item-content__link "],onClick:m},[c])}function M({value:t},e){const{style:o={},precision:n,isFixed:i=!0}=e;let r="";try{i?r=g.toThousand(t,n,"fixed"):r=A.toDecimalMark(t,n)}catch{r=t}return u.createVNode("span",{style:o,class:"ap-descriptions-item-content__number"},[r])}const q={text:y,array:d,date:f,dateRange:h,template:p,number:M,attachment:b};exports.array=d;exports.attachment=b;exports.date=f;exports.dateRange=h;exports.formatterMap=q;exports.number=M;exports.template=p;exports.text=y;
|
|
@@ -12,10 +12,16 @@ type MixObjectPropertyType<O, key extends keyof O> = key extends keyof O ? {
|
|
|
12
12
|
} : never;
|
|
13
13
|
export type TransformOptionType = MixObjectPropertyType<FormatterMapType, FormatterValueType>;
|
|
14
14
|
type Recordable = Record<string, any>;
|
|
15
|
+
type AllKeys<T, P extends string = '', Level extends unknown[] = []> = Level['length'] extends 5 ? never : T extends object ? {
|
|
16
|
+
[K in keyof T]: `${P}${K extends string ? K : never}` | (T[K] extends object ? AllKeys<T[K], `${P}${K extends string ? K : never}.`, [
|
|
17
|
+
...Level,
|
|
18
|
+
unknown
|
|
19
|
+
]> : never);
|
|
20
|
+
}[keyof T] : never;
|
|
15
21
|
/** 基本描述类型 */
|
|
16
22
|
export interface ItemSchema<T extends Recordable = Recordable> {
|
|
17
23
|
label: VNodeChild | VNode;
|
|
18
|
-
field:
|
|
24
|
+
field: Extract<AllKeys<T>, string> | string[];
|
|
19
25
|
span?: number;
|
|
20
26
|
prefix?: VNodeChild | VNode;
|
|
21
27
|
suffix?: VNodeChild | VNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("vue"),l=require("../../context.js"),i=require("lodash-unified");function a(t,e){return i.isArray(e)?e.reduce((n,r)=>n==null?void 0:n[r],t):t==null?void 0:t[e]}function s(t){if(t==null)return!1;if(typeof t=="string")return t.trim()!=="";if(i.isArray(t))return t.some(n=>s(n));if(i.isObject(t)){const e=Object.keys(t);if(e.length===0)return!1;for(const n of e)if(s(t[n]))return!0;return!1}return!0}const d=t=>{const{model:e}=l.useInjectForm();return{count:f.computed(()=>{let r=0;return t.value.forEach(o=>{const u=[o.node.props.name].flat(1),c=a(e==null?void 0:e.value,u);s(c)&&(r+=1)}),r})}};exports.useCollapseInputCount=d;
|
package/lib/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "6.
|
|
1
|
+
declare const _default: "6.10.0";
|
|
2
2
|
export default _default;
|
package/lib/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="6.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="6.10.0";exports.default=e;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aplus-frontend/ui",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.10.0",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -65,14 +65,14 @@
|
|
|
65
65
|
"@aplus-frontend/hooks": "1.0.7"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@aplus-frontend/antdv": "^1.1.
|
|
68
|
+
"@aplus-frontend/antdv": "^1.1.12",
|
|
69
69
|
"@aplus-frontend/icon": "^1.2.6",
|
|
70
70
|
"@aplus-frontend/oss": "^1.1.2",
|
|
71
71
|
"vue": "^3.5.14",
|
|
72
72
|
"vxe-table": "4.11.29"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@aplus-frontend/antdv": "^1.1.
|
|
75
|
+
"@aplus-frontend/antdv": "^1.1.12",
|
|
76
76
|
"@aplus-frontend/icon": "^1.2.6",
|
|
77
77
|
"@aplus-frontend/oss": "^1.1.2",
|
|
78
78
|
"@types/sortablejs": "^1.15.8",
|
package/theme/ap-grid/index.css
CHANGED
package/theme/ap-grid/index.less
CHANGED
package/theme/index.css
CHANGED
|
@@ -3578,6 +3578,10 @@ div.aplus-ap-info-layout-admin__header-shadow.aplus-ap-info-layout-admin__sticky
|
|
|
3578
3578
|
background-color: var(--ap-table-header-bg);
|
|
3579
3579
|
border-radius: 4px;
|
|
3580
3580
|
}
|
|
3581
|
+
.aplus-ap-grid .vxe-cell--checkbox span.vxe-checkbox--icon {
|
|
3582
|
+
line-height: 0;
|
|
3583
|
+
vertical-align: -1px;
|
|
3584
|
+
}
|
|
3581
3585
|
.aplus-editable-grid__header-cell--required {
|
|
3582
3586
|
color: #FF4D4F;
|
|
3583
3587
|
padding-right: 2px;
|