@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.
@@ -1,7 +1,7 @@
1
- import { computed as w } from "vue";
1
+ import { computed as s } from "vue";
2
2
  import { isFunction as l } from "lodash-unified";
3
- const C = (r) => {
4
- const d = w(() => {
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: s, rowIndex: u }) {
12
+ getRowClass({ node: i, data: w, rowIndex: u }) {
13
13
  if (!(!i.rowPinned || !n))
14
- return l(n) ? n(s, u, i.rowPinned) : 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(n.data, n.colDef, n.node.rowPinned) : 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
- C as usePinnedRow
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 f } from "../../ap-grid/constants.mjs";
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 x = (e, c) => m(() => {
8
+ const C = (e, l) => m(() => {
9
9
  if (!e.rowSelection)
10
10
  return;
11
- const l = e.rowSelection === !0 ? {} : e.rowSelection, o = {
11
+ const i = e.rowSelection === !0 ? {} : e.rowSelection, o = {
12
12
  sortable: !1,
13
13
  resizable: !1,
14
- width: l.columnWidth || 60
14
+ width: i.columnWidth || 60
15
15
  };
16
- let n = l.fixed;
17
- if (n === void 0 && (n = c.value.some(
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: u,
24
- colDef: i
23
+ data: f,
24
+ colDef: c,
25
+ rowIndex: u
25
26
  }) => {
26
27
  if (!(!r.rowPinned || !t))
27
- return i.field = f, console.log(i), s(t) ? t(u, i, r.rowPinned) : t;
28
- }, o.cellRenderer = ({ data: r }) => r?.[f];
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
- x as default
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'> & {
@@ -1,15 +1,15 @@
1
- import { useToken as c } from "@aplus-frontend/antdv/es/theme/internal";
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 d } from "vue";
4
- const m = (r, e) => {
5
- const [, a] = c();
6
- return d(() => {
7
- const t = r.value === "mini", o = a.value;
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: e.value,
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
- m as useTheme
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
- export type SummaryColumnType = ApColumnType[] | ApGridColumnType[] | ColumnsType | any[];
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 k, isNil as b, get as s, set as x } from "lodash-unified";
2
- import { toThousand as C, toFixed as L, addNumber as N } from "@aplus-frontend/utils";
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 ?? "", T = (t, e, c) => c ? C(t, e) : L(t, e);
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: c, configList: u, exclude: a } = t;
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(c)?.filter((n) => n.valueType === "number")?.map((n) => ({
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
- u && u?.length > 0 && (r = k(r?.concat(u), "key")), a && a.length > 0 && (r = r.filter(
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 y = {};
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, p = N(g, h)?.toNumber();
21
- x(n, i, +p);
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), y);
26
+ }), n), p);
24
27
  }
25
28
  export {
26
29
  q as computedRecords,
27
30
  j as flattenColumns,
28
31
  l as formatDataIndex,
29
- T as formatNumber
32
+ S as formatNumber
30
33
  };
@@ -1,2 +1,2 @@
1
- declare const _default: "6.28.0";
1
+ declare const _default: "6.28.1";
2
2
  export default _default;
@@ -1,4 +1,4 @@
1
- const e = "6.28.0";
1
+ const e = "6.28.1";
2
2
  export {
3
3
  e as default
4
4
  };
@@ -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:s,rowIndex:d}){if(!(!r.rowPinned||!e))return l.isFunction(e)?e(s,d,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):n],t.flat().filter(Boolean)},rowPinnedGridConfig:u}};exports.usePinnedRow=w;
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 d=require("vue"),f=require("lodash-unified");require("../../ap-grid/index.js");const u=require("../../ap-grid/constants.js");function a(e){return e?.bottom?.length||e?.top?.length}const m=(e,c)=>d.computed(()=>{if(!e.rowSelection)return;const l=e.rowSelection===!0?{}:e.rowSelection,n={sortable:!1,resizable:!1,width:l.columnWidth||60};let i=l.fixed;if(i===void 0&&(i=c.value.some(t=>t.fixed==="left"||t.fixed===!0)?"left":void 0),n.pinned=i,a(e.summary)){const{cellClassName:t}=e.summary;n.cellClass=({node:r,data:s,colDef:o})=>{if(!(!r.rowPinned||!t))return o.field=u.ROW_SELECTION_FIELD,console.log(o),f.isFunction(t)?t(s,o,r.rowPinned):t},n.cellRenderer=({data:r})=>r?.[u.ROW_SELECTION_FIELD]}return n});exports.default=m;
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'> & {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@aplus-frontend/antdv/es/theme/internal"),n=require("ag-grid-community"),d=require("vue"),l=(o,r)=>{const[,t]=c.useToken();return d.computed(()=>{const a=o.value==="mini",e=t.value;return n.themeQuartz.withParams({headerHeight:"36px",headerFontSize:"12px",dataFontSize:"12px",rowHeight:r.value,spacing:a?"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)"})})};exports.useTheme=l;
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
- export type SummaryColumnType = ApColumnType[] | ApGridColumnType[] | ColumnsType | any[];
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],g=t=>r.flatten(t?.map(e=>m(e))),a=t=>Object.prototype.toString.call(t)==="[object Array]"?t.map(e=>String(e)).join("."):t??"",k=(t,e,c)=>c?d.toThousand(t,e):d.toFixed(t,e);function x(t){const{records:e,columns:c,configList:s,exclude:i}=t;if(!e||e?.length===0)return{};let o=g(c)?.filter(n=>n.valueType==="number")?.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 y={};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,h=r.get(n,a(l))||0,b=r.get(f,a(l))||0,p=d.addNumber(h,b)?.toNumber();r.set(n,l,+p)}}),n),y)}exports.computedRecords=x;exports.flattenColumns=g;exports.formatDataIndex=a;exports.formatNumber=k;
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;
@@ -1,2 +1,2 @@
1
- declare const _default: "6.28.0";
1
+ declare const _default: "6.28.1";
2
2
  export default _default;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="6.28.0";exports.default=e;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aplus-frontend/ui",
3
- "version": "6.28.0",
3
+ "version": "6.28.1",
4
4
  "main": "./lib/index.js",
5
5
  "type": "module",
6
6
  "files": [
@@ -161,3 +161,6 @@
161
161
  .aplus-ap-value-select-card--admin .aplus-ap-value-select-card-title {
162
162
  color: #666;
163
163
  }
164
+ .aplus-ap-value-select-card--admin .aplus-ap-value-select-card-title-icon {
165
+ color: #BFBFBF;
166
+ }
@@ -151,6 +151,9 @@
151
151
  }
152
152
  &-title {
153
153
  color: #666;
154
+ &-icon {
155
+ color: #BFBFBF;
156
+ }
154
157
  }
155
158
  }
156
159
  }
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;