@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.
@@ -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 h, merge as p, get as l, debounce as Y } from "lodash-unified";
4
- import { formatString as A } from "./utils.mjs";
5
- import { toDecimalMark as b } from "@fruits-chain/utils";
6
- import { TypographyParagraph as M } from "@aplus-frontend/antdv";
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 r = {
12
+ const i = {
13
13
  ...n,
14
14
  content: t,
15
- ellipsis: n.ellipsis ? h(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(M, r, null);
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: r
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, r);
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: r,
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, r, o);
46
+ return g(t, i, o);
47
47
  }
48
48
  function y({
49
49
  value: t,
50
50
  record: n
51
- }, r) {
51
+ }, i) {
52
52
  const {
53
53
  fieldList: o,
54
- templateString: i = "{0}",
55
- formatter: e
56
- } = r, s = (o == null ? void 0 : o.map((m, a) => {
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 e ? e(c, a) : c;
58
+ return r ? r(c, a) : c;
59
59
  })) || [];
60
- return s.length === 0 && s.push(t), A(i, s);
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
- }, r) {
65
+ }, i) {
66
66
  const {
67
67
  fieldList: o,
68
- format: i = "YYYY-MM-DD HH:mm:ss",
69
- joinSymbol: e = "~",
68
+ format: e = "YYYY-MM-DD HH:mm:ss",
69
+ joinSymbol: r = "~",
70
70
  zoneAlias: s = "LA"
71
- } = r, m = Array.isArray(i) ? i : [i, i];
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} ${e} {1}`,
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: r = "url",
93
+ urlPath: i = "url",
94
94
  namePath: o = "name",
95
- style: i,
96
- downloadFile: e,
95
+ style: e,
96
+ downloadFile: r,
97
97
  className: s
98
- } = n, m = l(t, o), a = l(t, r), c = Y(() => {
99
- e == null || e(a, m);
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: i,
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: r = {},
112
- precision: o
111
+ style: i = {},
112
+ precision: o,
113
+ isFixed: e = !0
113
114
  } = n;
114
- let i = "";
115
+ let r = "";
115
116
  try {
116
- i = b(t, o);
117
+ e ? r = h(t, o, "fixed") : r = M(t, o);
117
118
  } catch {
118
- i = t;
119
+ r = t;
119
120
  }
120
121
  return f("span", {
121
- style: r,
122
+ style: i,
122
123
  class: "ap-descriptions-item-content__number"
123
- }, [i]);
124
+ }, [r]);
124
125
  }
125
- const N = {
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
- N as formatterMap,
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: keyof T | (string & {}) | string[];
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 s } from "vue";
2
- import { useInjectForm as f } from "../../context.mjs";
3
- import { isArray as e, isObject as a } from "lodash-unified";
4
- function p(t, r) {
5
- return e(r) ? r.reduce((n, o) => n == null ? void 0 : n[o], t) : t == null ? void 0 : t[r];
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 g(t) {
8
- return t == null ? !1 : typeof t == "string" ? t.trim() !== "" : e(t) ? t.length > 0 : a(t) ? Object.keys(t).length > 0 : !0;
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 b = (t) => {
11
- const { model: r } = f();
25
+ const y = (t) => {
26
+ const { model: r } = l();
12
27
  return {
13
- count: s(() => {
14
- let o = 0;
15
- return t.value.forEach((u) => {
16
- const i = [u.node.props.name].flat(1), c = p(r == null ? void 0 : r.value, i);
17
- g(c) && (o += 1);
18
- }), o;
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
- b as useCollapseInputCount
38
+ y as useCollapseInputCount
24
39
  };
@@ -1,2 +1,2 @@
1
- declare const _default: "6.9.0";
1
+ declare const _default: "6.10.0";
2
2
  export default _default;
@@ -1,4 +1,4 @@
1
- const e = "6.9.0";
1
+ const e = "6.10.0";
2
2
  export {
3
3
  e as default
4
4
  };
@@ -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"),M=require("@aplus-frontend/utils"),a=require("lodash-unified"),S=require("./utils.js"),Y=require("@fruits-chain/utils"),A=require("@aplus-frontend/antdv");function g({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(A.TypographyParagraph,o,null)}function y({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 M.getTimeFormatToZone(t,o,n)}function p({value:t,record:e},o){const{fieldList:n,templateString:r="{0}",formatter:i}=o,s=(n==null?void 0:n.map((c,l)=>{const m=a.get(e,c);return i?i(m,l):m}))||[];return s.length===0&&s.push(t),S.formatString(r,s)}function d({value:t,record:e},o){const{fieldList:n,format:r="YYYY-MM-DD HH:mm:ss",joinSymbol:i="~",zoneAlias:s="LA"}=o,c=Array.isArray(r)?r:[r,r];return p({value:t,record:e},{fieldList:n,templateString:`{0} ${i} {1}`,formatter(l,m){return f({value:l,record:e},{format:c[m],zoneAlias:s})}})}function h({record:t},e){const{urlPath:o="url",namePath:n="name",style:r,downloadFile:i,className:s}=e,c=a.get(t,n),l=a.get(t,o),m=a.debounce(()=>{i==null||i(l,c)},500);return u.createVNode("span",{style:r,class:[s,"ap-descriptions-item-content__link "],onClick:m},[c])}function b({value:t},e){const{style:o={},precision:n}=e;let r="";try{r=Y.toDecimalMark(t,n)}catch{r=t}return u.createVNode("span",{style:o,class:"ap-descriptions-item-content__number"},[r])}const q={text:g,array:y,date:f,dateRange:d,template:p,number:b,attachment:h};exports.array=y;exports.attachment=h;exports.date=f;exports.dateRange=d;exports.formatterMap=q;exports.number=b;exports.template=p;exports.text=g;
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: keyof T | (string & {}) | string[];
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 c=require("vue"),f=require("../../context.js"),u=require("lodash-unified");function a(t,n){return u.isArray(n)?n.reduce((e,r)=>e==null?void 0:e[r],t):t==null?void 0:t[n]}function l(t){return t==null?!1:typeof t=="string"?t.trim()!=="":u.isArray(t)?t.length>0:u.isObject(t)?Object.keys(t).length>0:!0}const g=t=>{const{model:n}=f.useInjectForm();return{count:c.computed(()=>{let r=0;return t.value.forEach(o=>{const s=[o.node.props.name].flat(1),i=a(n==null?void 0:n.value,s);l(i)&&(r+=1)}),r})}};exports.useCollapseInputCount=g;
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;
@@ -1,2 +1,2 @@
1
- declare const _default: "6.9.0";
1
+ declare const _default: "6.10.0";
2
2
  export default _default;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="6.9.0";exports.default=e;
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.9.0",
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.10",
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.10",
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",
@@ -684,3 +684,7 @@
684
684
  background-color: var(--ap-table-header-bg);
685
685
  border-radius: 4px;
686
686
  }
687
+ .aplus-ap-grid .vxe-cell--checkbox span.vxe-checkbox--icon {
688
+ line-height: 0;
689
+ vertical-align: -1px;
690
+ }
@@ -202,4 +202,8 @@
202
202
  background-color: var(--ap-table-header-bg);
203
203
  border-radius: 4px;
204
204
  }
205
+ .vxe-cell--checkbox span.vxe-checkbox--icon {
206
+ line-height: 0;
207
+ vertical-align: -1px;
208
+ }
205
209
  });
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;