@aplus-frontend/ui 6.28.0 → 6.28.1
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/ag-grid/hooks/use-pinned-row.mjs +12 -7
- package/es/src/ag-grid/hooks/use-selection-col-def.mjs +12 -11
- package/es/src/ag-grid/interface.d.ts +1 -1
- package/es/src/ag-grid/theme.mjs +11 -9
- package/es/src/business/ap-summary/interface.d.ts +3 -1
- package/es/src/business/ap-summary/utils.mjs +14 -11
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/hooks/use-pinned-row.js +1 -1
- package/lib/src/ag-grid/hooks/use-selection-col-def.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +1 -1
- package/lib/src/ag-grid/theme.js +1 -1
- package/lib/src/business/ap-summary/interface.d.ts +3 -1
- package/lib/src/business/ap-summary/utils.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
- package/theme/ap-value-select-card/index.css +3 -0
- package/theme/ap-value-select-card/index.less +3 -0
- package/theme/index.css +3 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { computed as
|
|
1
|
+
import { computed as s } from "vue";
|
|
2
2
|
import { isFunction as l } from "lodash-unified";
|
|
3
|
-
const
|
|
4
|
-
const d =
|
|
3
|
+
const P = (r) => {
|
|
4
|
+
const d = s(() => {
|
|
5
5
|
const o = r.value;
|
|
6
6
|
if (!o)
|
|
7
7
|
return {};
|
|
@@ -9,9 +9,9 @@ const C = (r) => {
|
|
|
9
9
|
return {
|
|
10
10
|
pinnedTopRowData: t,
|
|
11
11
|
pinnedBottomRowData: e,
|
|
12
|
-
getRowClass({ node: i, data:
|
|
12
|
+
getRowClass({ node: i, data: w, rowIndex: u }) {
|
|
13
13
|
if (!(!i.rowPinned || !n))
|
|
14
|
-
return l(n) ? n(
|
|
14
|
+
return l(n) ? n(w, u, i.rowPinned) : n;
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
});
|
|
@@ -21,12 +21,17 @@ const C = (r) => {
|
|
|
21
21
|
const { cellClassName: e } = r.value || {};
|
|
22
22
|
return !n.node.rowPinned || !e ? t = [o(n)] : t = [
|
|
23
23
|
o(n),
|
|
24
|
-
l(e) ? e(
|
|
24
|
+
l(e) ? e(
|
|
25
|
+
n.data,
|
|
26
|
+
n.colDef,
|
|
27
|
+
n.node.rowPinned,
|
|
28
|
+
n.rowIndex
|
|
29
|
+
) : e
|
|
25
30
|
], t.flat().filter(Boolean);
|
|
26
31
|
},
|
|
27
32
|
rowPinnedGridConfig: d
|
|
28
33
|
};
|
|
29
34
|
};
|
|
30
35
|
export {
|
|
31
|
-
|
|
36
|
+
P as usePinnedRow
|
|
32
37
|
};
|
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
import { computed as m } from "vue";
|
|
2
2
|
import { isFunction as s } from "lodash-unified";
|
|
3
3
|
import "../../ap-grid/index.mjs";
|
|
4
|
-
import { ROW_SELECTION_FIELD as
|
|
4
|
+
import { ROW_SELECTION_FIELD as a } from "../../ap-grid/constants.mjs";
|
|
5
5
|
function d(e) {
|
|
6
6
|
return e?.bottom?.length || e?.top?.length;
|
|
7
7
|
}
|
|
8
|
-
const
|
|
8
|
+
const C = (e, l) => m(() => {
|
|
9
9
|
if (!e.rowSelection)
|
|
10
10
|
return;
|
|
11
|
-
const
|
|
11
|
+
const i = e.rowSelection === !0 ? {} : e.rowSelection, o = {
|
|
12
12
|
sortable: !1,
|
|
13
13
|
resizable: !1,
|
|
14
|
-
width:
|
|
14
|
+
width: i.columnWidth || 60
|
|
15
15
|
};
|
|
16
|
-
let n =
|
|
17
|
-
if (n === void 0 && (n =
|
|
16
|
+
let n = i.fixed;
|
|
17
|
+
if (n === void 0 && (n = l.value.some(
|
|
18
18
|
(t) => t.fixed === "left" || t.fixed === !0
|
|
19
19
|
) ? "left" : void 0), o.pinned = n, d(e.summary)) {
|
|
20
20
|
const { cellClassName: t } = e.summary;
|
|
21
21
|
o.cellClass = ({
|
|
22
22
|
node: r,
|
|
23
|
-
data:
|
|
24
|
-
colDef:
|
|
23
|
+
data: f,
|
|
24
|
+
colDef: c,
|
|
25
|
+
rowIndex: u
|
|
25
26
|
}) => {
|
|
26
27
|
if (!(!r.rowPinned || !t))
|
|
27
|
-
return
|
|
28
|
-
}, o.cellRenderer = ({ data: r }) => r?.[
|
|
28
|
+
return s(t) ? t(f, c, r.rowPinned, u) : t;
|
|
29
|
+
}, o.cellRenderer = ({ data: r }) => r?.[a];
|
|
29
30
|
}
|
|
30
31
|
return o;
|
|
31
32
|
});
|
|
32
33
|
export {
|
|
33
|
-
|
|
34
|
+
C as default
|
|
34
35
|
};
|
|
@@ -114,7 +114,7 @@ export type AgGridVirtualConfig = {
|
|
|
114
114
|
export type AgGridSummaryType<RecordType = any> = {
|
|
115
115
|
top?: RecordType[];
|
|
116
116
|
bottom?: RecordType[];
|
|
117
|
-
cellClassName?: string | string[] | ((data: RecordType, column: ColDef<RecordType>, pinned: RowPinnedType) => string | string[]);
|
|
117
|
+
cellClassName?: string | string[] | ((data: RecordType, column: ColDef<RecordType>, pinned: RowPinnedType, rowIndex: number) => string | string[]);
|
|
118
118
|
rowClassName?: string | string[] | ((data: RecordType, rowIndex: number, pinned: RowPinnedType) => string | string[]);
|
|
119
119
|
};
|
|
120
120
|
export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection' | 'rowClassName' | 'footer' | 'loading' | 'sticky'> & {
|
package/es/src/ag-grid/theme.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { useToken as
|
|
1
|
+
import { useToken as d } from "@aplus-frontend/antdv/es/theme/internal";
|
|
2
2
|
import { themeQuartz as n } from "ag-grid-community";
|
|
3
|
-
import { computed as
|
|
4
|
-
const
|
|
5
|
-
const [, a] =
|
|
6
|
-
return
|
|
7
|
-
const t =
|
|
3
|
+
import { computed as c } from "vue";
|
|
4
|
+
const p = (e, r) => {
|
|
5
|
+
const [, a] = d();
|
|
6
|
+
return c(() => {
|
|
7
|
+
const t = e.value === "mini", o = a.value;
|
|
8
8
|
return n.withParams({
|
|
9
9
|
headerHeight: "36px",
|
|
10
10
|
headerFontSize: "12px",
|
|
11
11
|
dataFontSize: "12px",
|
|
12
|
-
rowHeight:
|
|
12
|
+
rowHeight: r.value,
|
|
13
13
|
spacing: t ? "5px" : "6.5px",
|
|
14
14
|
foregroundColor: o.colorTextBase,
|
|
15
15
|
wrapperBorder: !1,
|
|
@@ -18,10 +18,12 @@ const m = (r, e) => {
|
|
|
18
18
|
selectedRowBackgroundColor: o.controlItemBgActive,
|
|
19
19
|
checkboxCheckedBackgroundColor: o.colorPrimary,
|
|
20
20
|
rowHoverColor: "var(--ap-color-bg-2)",
|
|
21
|
-
headerBackgroundColor: "var(--ap-table-header-bg)"
|
|
21
|
+
headerBackgroundColor: "var(--ap-table-header-bg)",
|
|
22
|
+
headerColumnResizeHandleHeight: "50%",
|
|
23
|
+
headerColumnResizeHandleWidth: "1px"
|
|
22
24
|
});
|
|
23
25
|
});
|
|
24
26
|
};
|
|
25
27
|
export {
|
|
26
|
-
|
|
28
|
+
p as useTheme
|
|
27
29
|
};
|
|
@@ -2,7 +2,8 @@ import { ColumnsType } from '@aplus-frontend/antdv/es/table';
|
|
|
2
2
|
import { AlignType, DataIndex, Key } from '@aplus-frontend/antdv/es/vc-table/interface';
|
|
3
3
|
import { ApColumnType } from '../../ap-table';
|
|
4
4
|
import { ApGridColumnType } from '../../ap-grid';
|
|
5
|
-
|
|
5
|
+
import { AgGridColumnType } from '../../ag-grid';
|
|
6
|
+
export type SummaryColumnType = ApColumnType[] | ApGridColumnType[] | AgGridColumnType[] | ColumnsType | any[];
|
|
6
7
|
export type ValueType = {
|
|
7
8
|
[key in string]: any;
|
|
8
9
|
};
|
|
@@ -40,4 +41,5 @@ export interface ComputedRecordParams<T> {
|
|
|
40
41
|
* 排出 在 columns 和 configList中相同key 的配置项
|
|
41
42
|
*/
|
|
42
43
|
exclude?: Key[];
|
|
44
|
+
valueTypeExtension?: string[];
|
|
43
45
|
}
|
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
import { flatten as f, uniqBy as
|
|
2
|
-
import { toThousand as
|
|
1
|
+
import { flatten as f, uniqBy as x, isNil as b, get as s, set as C } from "lodash-unified";
|
|
2
|
+
import { toThousand as L, toFixed as N, addNumber as T } from "@aplus-frontend/utils";
|
|
3
3
|
const m = (t) => t?.children && t?.children?.length > 0 ? f(t.children?.map((e) => m(e))) : [t], j = (t) => f(
|
|
4
4
|
t?.map((e) => m(e))
|
|
5
|
-
), l = (t) => Object.prototype.toString.call(t) === "[object Array]" ? t.map((e) => String(e)).join(".") : t ?? "",
|
|
5
|
+
), l = (t) => Object.prototype.toString.call(t) === "[object Array]" ? t.map((e) => String(e)).join(".") : t ?? "", S = (t, e, u) => u ? L(t, e) : N(t, e);
|
|
6
6
|
function q(t) {
|
|
7
|
-
const { records: e, columns:
|
|
7
|
+
const { records: e, columns: u, configList: c, exclude: a, valueTypeExtension: y } = t;
|
|
8
8
|
if (!e || e?.length === 0)
|
|
9
9
|
return {};
|
|
10
|
-
let r = j(
|
|
10
|
+
let r = j(u)?.filter(
|
|
11
|
+
(n) => n.valueType === "number" || // 兼容自定义valueType的情况
|
|
12
|
+
y?.includes(n.valueType)
|
|
13
|
+
)?.map((n) => ({
|
|
11
14
|
key: n.key || "",
|
|
12
15
|
dataIndex: n.dataIndex
|
|
13
16
|
}));
|
|
14
|
-
|
|
17
|
+
c && c?.length > 0 && (r = x(r?.concat(c), "key")), a && a.length > 0 && (r = r.filter(
|
|
15
18
|
(n) => !a.includes(n.key)
|
|
16
19
|
));
|
|
17
|
-
const
|
|
20
|
+
const p = {};
|
|
18
21
|
return e?.reduce((n, d) => (r.forEach((o) => {
|
|
19
22
|
if (!b(s(d, l(o.dataIndex || o.key)))) {
|
|
20
|
-
const i = o.dataIndex || o.key, g = s(n, l(i)) || 0, h = s(d, l(i)) || 0,
|
|
21
|
-
|
|
23
|
+
const i = o.dataIndex || o.key, g = s(n, l(i)) || 0, h = s(d, l(i)) || 0, k = T(g, h)?.toNumber();
|
|
24
|
+
C(n, i, +k);
|
|
22
25
|
}
|
|
23
|
-
}), n),
|
|
26
|
+
}), n), p);
|
|
24
27
|
}
|
|
25
28
|
export {
|
|
26
29
|
q as computedRecords,
|
|
27
30
|
j as flattenColumns,
|
|
28
31
|
l as formatDataIndex,
|
|
29
|
-
|
|
32
|
+
S as formatNumber
|
|
30
33
|
};
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "6.28.
|
|
1
|
+
declare const _default: "6.28.1";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("vue"),l=require("lodash-unified"),w=i=>{const u=c.computed(()=>{const o=i.value;if(!o)return{};const{rowClassName:e,top:t,bottom:n}=o;return{pinnedTopRowData:t,pinnedBottomRowData:n,getRowClass({node:r,data:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("vue"),l=require("lodash-unified"),w=i=>{const u=c.computed(()=>{const o=i.value;if(!o)return{};const{rowClassName:e,top:t,bottom:n}=o;return{pinnedTopRowData:t,pinnedBottomRowData:n,getRowClass({node:r,data:d,rowIndex:s}){if(!(!r.rowPinned||!e))return l.isFunction(e)?e(d,s,r.rowPinned):e}}});return{getRowPinnedCellClass:o=>e=>{let t;const{cellClassName:n}=i.value||{};return!e.node.rowPinned||!n?t=[o(e)]:t=[o(e),l.isFunction(n)?n(e.data,e.colDef,e.node.rowPinned,e.rowIndex):n],t.flat().filter(Boolean)},rowPinnedGridConfig:u}};exports.usePinnedRow=w;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("vue"),d=require("lodash-unified");require("../../ap-grid/index.js");const a=require("../../ap-grid/constants.js");function m(e){return e?.bottom?.length||e?.top?.length}const S=(e,l)=>f.computed(()=>{if(!e.rowSelection)return;const o=e.rowSelection===!0?{}:e.rowSelection,n={sortable:!1,resizable:!1,width:o.columnWidth||60};let i=o.fixed;if(i===void 0&&(i=l.value.some(t=>t.fixed==="left"||t.fixed===!0)?"left":void 0),n.pinned=i,m(e.summary)){const{cellClassName:t}=e.summary;n.cellClass=({node:r,data:u,colDef:c,rowIndex:s})=>{if(!(!r.rowPinned||!t))return d.isFunction(t)?t(u,c,r.rowPinned,s):t},n.cellRenderer=({data:r})=>r?.[a.ROW_SELECTION_FIELD]}return n});exports.default=S;
|
|
@@ -114,7 +114,7 @@ export type AgGridVirtualConfig = {
|
|
|
114
114
|
export type AgGridSummaryType<RecordType = any> = {
|
|
115
115
|
top?: RecordType[];
|
|
116
116
|
bottom?: RecordType[];
|
|
117
|
-
cellClassName?: string | string[] | ((data: RecordType, column: ColDef<RecordType>, pinned: RowPinnedType) => string | string[]);
|
|
117
|
+
cellClassName?: string | string[] | ((data: RecordType, column: ColDef<RecordType>, pinned: RowPinnedType, rowIndex: number) => string | string[]);
|
|
118
118
|
rowClassName?: string | string[] | ((data: RecordType, rowIndex: number, pinned: RowPinnedType) => string | string[]);
|
|
119
119
|
};
|
|
120
120
|
export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection' | 'rowClassName' | 'footer' | 'loading' | 'sticky'> & {
|
package/lib/src/ag-grid/theme.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@aplus-frontend/antdv/es/theme/internal"),c=require("ag-grid-community"),d=require("vue"),l=(o,r)=>{const[,a]=n.useToken();return d.computed(()=>{const t=o.value==="mini",e=a.value;return c.themeQuartz.withParams({headerHeight:"36px",headerFontSize:"12px",dataFontSize:"12px",rowHeight:r.value,spacing:t?"5px":"6.5px",foregroundColor:e.colorTextBase,wrapperBorder:!1,rowBorder:{color:e.colorBorderSecondary},headerRowBorder:{color:e.colorBorderSecondary},selectedRowBackgroundColor:e.controlItemBgActive,checkboxCheckedBackgroundColor:e.colorPrimary,rowHoverColor:"var(--ap-color-bg-2)",headerBackgroundColor:"var(--ap-table-header-bg)",headerColumnResizeHandleHeight:"50%",headerColumnResizeHandleWidth:"1px"})})};exports.useTheme=l;
|
|
@@ -2,7 +2,8 @@ import { ColumnsType } from '@aplus-frontend/antdv/es/table';
|
|
|
2
2
|
import { AlignType, DataIndex, Key } from '@aplus-frontend/antdv/es/vc-table/interface';
|
|
3
3
|
import { ApColumnType } from '../../ap-table';
|
|
4
4
|
import { ApGridColumnType } from '../../ap-grid';
|
|
5
|
-
|
|
5
|
+
import { AgGridColumnType } from '../../ag-grid';
|
|
6
|
+
export type SummaryColumnType = ApColumnType[] | ApGridColumnType[] | AgGridColumnType[] | ColumnsType | any[];
|
|
6
7
|
export type ValueType = {
|
|
7
8
|
[key in string]: any;
|
|
8
9
|
};
|
|
@@ -40,4 +41,5 @@ export interface ComputedRecordParams<T> {
|
|
|
40
41
|
* 排出 在 columns 和 configList中相同key 的配置项
|
|
41
42
|
*/
|
|
42
43
|
exclude?: Key[];
|
|
44
|
+
valueTypeExtension?: string[];
|
|
43
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("lodash-unified"),d=require("@aplus-frontend/utils"),m=t=>t?.children&&t?.children?.length>0?r.flatten(t.children?.map(e=>m(e))):[t],
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("lodash-unified"),d=require("@aplus-frontend/utils"),m=t=>t?.children&&t?.children?.length>0?r.flatten(t.children?.map(e=>m(e))):[t],y=t=>r.flatten(t?.map(e=>m(e))),a=t=>Object.prototype.toString.call(t)==="[object Array]"?t.map(e=>String(e)).join("."):t??"",x=(t,e,c)=>c?d.toThousand(t,e):d.toFixed(t,e);function C(t){const{records:e,columns:c,configList:s,exclude:i,valueTypeExtension:g}=t;if(!e||e?.length===0)return{};let o=y(c)?.filter(n=>n.valueType==="number"||g?.includes(n.valueType))?.map(n=>({key:n.key||"",dataIndex:n.dataIndex}));s&&s?.length>0&&(o=r.uniqBy(o?.concat(s),"key")),i&&i.length>0&&(o=o.filter(n=>!i.includes(n.key)));const h={};return e?.reduce((n,f)=>(o.forEach(u=>{if(!r.isNil(r.get(f,a(u.dataIndex||u.key)))){const l=u.dataIndex||u.key,p=r.get(n,a(l))||0,b=r.get(f,a(l))||0,k=d.addNumber(p,b)?.toNumber();r.set(n,l,+k)}}),n),h)}exports.computedRecords=C;exports.flattenColumns=y;exports.formatDataIndex=a;exports.formatNumber=x;
|
package/lib/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "6.28.
|
|
1
|
+
declare const _default: "6.28.1";
|
|
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.28.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="6.28.1";exports.default=e;
|
package/package.json
CHANGED
package/theme/index.css
CHANGED
|
@@ -4500,6 +4500,9 @@ div.aplus-ap-info-layout-admin__header-shadow.aplus-ap-info-layout-admin__sticky
|
|
|
4500
4500
|
.aplus-ap-value-select-card--admin .aplus-ap-value-select-card-title {
|
|
4501
4501
|
color: #666;
|
|
4502
4502
|
}
|
|
4503
|
+
.aplus-ap-value-select-card--admin .aplus-ap-value-select-card-title-icon {
|
|
4504
|
+
color: #BFBFBF;
|
|
4505
|
+
}
|
|
4503
4506
|
.aplus-pro-card {
|
|
4504
4507
|
position: relative;
|
|
4505
4508
|
display: flex;
|