@lemon-fe/components 1.4.17-alpha.4 → 1.4.17-alpha.6
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/data-grid/index.d.ts +2 -1
- package/es/data-grid/index.js +27 -1
- package/package.json +2 -2
package/es/data-grid/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ declare const Editors: {
|
|
|
17
17
|
Text: React.ForwardRefExoticComponent<import("ag-grid-community").ICellEditorParams<any, any, any> & import("..").TextEditorParams<any> & React.RefAttributes<import("ag-grid-react").ICellEditorReactComp>>;
|
|
18
18
|
Date: React.ForwardRefExoticComponent<import("ag-grid-community").ICellEditorParams<any, any, any> & import("..").DateEditorParams<any> & React.RefAttributes<import("ag-grid-react").ICellEditorReactComp>>;
|
|
19
19
|
Number: React.ForwardRefExoticComponent<import("ag-grid-community").ICellEditorParams<any, any, any> & import("..").NumberEditorParams<any> & React.RefAttributes<import("ag-grid-react").ICellEditorReactComp>>;
|
|
20
|
-
Select: React.ForwardRefExoticComponent<import("ag-grid-community").ICellEditorParams<any, any, any> & Pick<import("antd").SelectProps<any, import("antd/lib/select").BaseOptionType>, "disabled" | "
|
|
20
|
+
Select: React.ForwardRefExoticComponent<import("ag-grid-community").ICellEditorParams<any, any, any> & Pick<import("antd").SelectProps<any, import("antd/lib/select").BaseOptionType>, "disabled" | "mode" | "virtual" | "allowClear" | "showSearch" | "optionFilterProp" | "options" | "listHeight"> & {
|
|
21
21
|
fieldNames?: {
|
|
22
22
|
label: string;
|
|
23
23
|
value: string;
|
|
@@ -116,6 +116,7 @@ declare class InternalDataGrid<TData extends Record<string, any>> extends Compon
|
|
|
116
116
|
*/
|
|
117
117
|
focusPreviousCell(): void;
|
|
118
118
|
private handleRowClicked;
|
|
119
|
+
private processCellForClipboard;
|
|
119
120
|
render(): JSX.Element;
|
|
120
121
|
}
|
|
121
122
|
export declare type DataGridRef<T extends Record<string, any>> = InternalDataGrid<T>;
|
package/es/data-grid/index.js
CHANGED
|
@@ -580,6 +580,31 @@ var InternalDataGrid = /*#__PURE__*/function (_Component) {
|
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
582
|
});
|
|
583
|
+
_defineProperty(_assertThisInitialized(_this), "processCellForClipboard", function (params) {
|
|
584
|
+
var value = params.value,
|
|
585
|
+
column = params.column,
|
|
586
|
+
node = params.node;
|
|
587
|
+
var colDef = column.getColDef();
|
|
588
|
+
if (!node) {
|
|
589
|
+
return value;
|
|
590
|
+
}
|
|
591
|
+
//仅对带存在valueFormatter且格式化后带千分位的数字做除千分位处理
|
|
592
|
+
var isNumericWithCommasReturnVal = function isNumericWithCommasReturnVal(val) {
|
|
593
|
+
if (typeof val === 'string') {
|
|
594
|
+
return /^-?(?!0\d)(?:\d{1,3}(?:,\d{3})*|\d+)(?:\.\d+)?$/.test(val) ? val.replace(/,/g, '') : val;
|
|
595
|
+
} else {
|
|
596
|
+
return val;
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
var showValue = colDef.valueFormatter && typeof colDef.valueFormatter === 'function' ? colDef.valueFormatter(_objectSpread(_objectSpread({
|
|
600
|
+
data: node.data,
|
|
601
|
+
colDef: colDef,
|
|
602
|
+
node: node
|
|
603
|
+
}, params), {}, {
|
|
604
|
+
value: value
|
|
605
|
+
})) : value;
|
|
606
|
+
return isNumericWithCommasReturnVal(showValue);
|
|
607
|
+
});
|
|
583
608
|
_this.state = _objectSpread({
|
|
584
609
|
loading: false
|
|
585
610
|
}, _this.getPagination());
|
|
@@ -734,7 +759,7 @@ var InternalDataGrid = /*#__PURE__*/function (_Component) {
|
|
|
734
759
|
});
|
|
735
760
|
}
|
|
736
761
|
}
|
|
737
|
-
if ((rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys
|
|
762
|
+
if (!shallowEqual(rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys, (_prevProps$rowSelecti = prevProps.rowSelection) === null || _prevProps$rowSelecti === void 0 ? void 0 : _prevProps$rowSelecti.selectedRowKeys)) {
|
|
738
763
|
this.syncSelection();
|
|
739
764
|
}
|
|
740
765
|
if (dataSource !== prevProps.dataSource) {
|
|
@@ -1810,6 +1835,7 @@ var InternalDataGrid = /*#__PURE__*/function (_Component) {
|
|
|
1810
1835
|
},
|
|
1811
1836
|
onFocus: this.handleFocus
|
|
1812
1837
|
}, /*#__PURE__*/React.createElement(AgGridReact, _extends({
|
|
1838
|
+
processCellForClipboard: this.processCellForClipboard,
|
|
1813
1839
|
singleClickEdit: true,
|
|
1814
1840
|
suppressPaginationPanel: true,
|
|
1815
1841
|
suppressCopyRowsToClipboard: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lemon-fe/components",
|
|
3
|
-
"version": "1.4.17-alpha.
|
|
3
|
+
"version": "1.4.17-alpha.6",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"registry": "https://registry.npmjs.org"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "9f54ed14ac97e5e5753bd31751fec5938a02c2f0"
|
|
62
62
|
}
|