es-grid-template 1.4.6 → 1.4.7
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/grid-component/GridStyle.js +1 -1
- package/es/grid-component/InternalTable.js +2 -2
- package/es/grid-component/styles.scss +1 -1
- package/es/grid-component/table/GridEdit.js +6 -4
- package/lib/grid-component/GridStyle.js +1 -1
- package/lib/grid-component/InternalTable.js +2 -2
- package/lib/grid-component/styles.scss +1 -1
- package/lib/grid-component/table/GridEdit.js +5 -3
- package/package.json +1 -1
|
@@ -2,4 +2,4 @@ import styled from "styled-components";
|
|
|
2
2
|
export const GridStyle = styled.div.withConfig({
|
|
3
3
|
displayName: "GridStyle",
|
|
4
4
|
componentId: "es-grid-template__sc-sueu2e-0"
|
|
5
|
-
})(["height:", ";.ui-rc-table.ui-rc-table-virtual.ui-rc-table-scroll-horizontal{.ui-rc-table-container{padding-bottom:8px;border-bottom:1px solid #e0e0e0;}}.ui-rc-table-container{.ui-rc-table-tbody-virtual.ui-rc-table-tbody{min-height:", ";}}.ui-rc-toolbar-bottom{position:relative;padding:.25rem 1rem;background-color:#ffffff;&::before{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;left:0;}&::after{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;visibility:visible;right:0;}.toolbar-button{border-radius:0;.ant-btn{border-radius:0;}}}.ui-rc-pagination{border-bottom:1px solid #e0e0e0;border-top:1px solid #e0e0e0;margin:0;padding:.75rem 1rem;background-color:#ffffff;.ui-rc-pagination-total-text{order:2;margin-left:auto;}&::before{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:50px;bottom:0;left:0;}&::after{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:50px;bottom:0;visibility:visible;right:0;}&.pagination-template{position:relative;&::before{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;left:0;}&::after{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;visibility:visible;right:0;}}}.react-resizable{position:relative;background-clip:padding-box;}.rc-resizable-handle{position:absolute;right:0px;bottom:0;z-index:1;width:5px;height:100%;cursor:col-resize;&.none{cursor:auto;display:none;}}"], props => props.$heightTable ? `${props.$heightTable}px` : undefined, props => props.$heightScroll ? `${props.$heightScroll}px` : undefined);
|
|
5
|
+
})(["height:", ";.ui-rc-table.ui-rc-table-virtual.ui-rc-table-scroll-horizontal{.ui-rc-table-container{&:has(.ui-rc-table-tbody-virtual-scrollbar-horizontal){padding-bottom:8px;border-bottom:1px solid #e0e0e0;}}}.ui-rc-table-container{.ui-rc-table-tbody-virtual.ui-rc-table-tbody{min-height:", ";}}.ui-rc-toolbar-bottom{position:relative;padding:.25rem 1rem;background-color:#ffffff;&::before{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;left:0;}&::after{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;visibility:visible;right:0;}.toolbar-button{border-radius:0;.ant-btn{border-radius:0;}}}.ui-rc-pagination{border-bottom:1px solid #e0e0e0;border-top:1px solid #e0e0e0;margin:0;padding:.75rem 1rem;background-color:#ffffff;.ui-rc-pagination-total-text{order:2;margin-left:auto;}&::before{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:50px;bottom:0;left:0;}&::after{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:50px;bottom:0;visibility:visible;right:0;}&.pagination-template{position:relative;&::before{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;left:0;}&::after{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;visibility:visible;right:0;}}}.react-resizable{position:relative;background-clip:padding-box;}.rc-resizable-handle{position:absolute;right:0px;bottom:0;z-index:1;width:5px;height:100%;cursor:col-resize;&.none{cursor:auto;display:none;}}"], props => props.$heightTable ? `${props.$heightTable}px` : undefined, props => props.$heightScroll ? `${props.$heightScroll}px` : undefined);
|
|
@@ -234,7 +234,7 @@ const InternalTable = props => {
|
|
|
234
234
|
const hhh = (propsHeight ?? 0) - (title ? title.offsetHeight : 0) - (header ? header.offsetHeight : 0) - (paginationE ? paginationE.offsetHeight : 0) - (toolbar ? toolbar.offsetHeight : 0) - (summaryE ? summaryE.offsetHeight : 0) - (scrollbar ? scrollbar.offsetHeight : 0);
|
|
235
235
|
setHeight(hhh);
|
|
236
236
|
// })
|
|
237
|
-
}, [id, propsHeight, columns]);
|
|
237
|
+
}, [id, propsHeight, columns, editAble]);
|
|
238
238
|
const tableRef = React.useRef(null);
|
|
239
239
|
React.useEffect(() => {
|
|
240
240
|
setColumns(propsColumns);
|
|
@@ -847,7 +847,7 @@ const InternalTable = props => {
|
|
|
847
847
|
// scroll={{ y: scrollHeight - (summary ? 0 : 7) }} // scroll height auto, không quá 600
|
|
848
848
|
,
|
|
849
849
|
scroll: {
|
|
850
|
-
y: scrollHeight - (summary ?
|
|
850
|
+
y: scrollHeight - (summary ? 1 : 1)
|
|
851
851
|
} // scroll height auto, không quá 600
|
|
852
852
|
,
|
|
853
853
|
height: propsHeight,
|
|
@@ -85,7 +85,7 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
85
85
|
|
|
86
86
|
.ui-rc-table-tbody-virtual-scrollbar.ui-rc-table-tbody-virtual-scrollbar-horizontal {
|
|
87
87
|
visibility: visible !important;
|
|
88
|
-
|
|
88
|
+
bottom: -8px !important;
|
|
89
89
|
z-index: 5 !important;
|
|
90
90
|
background-color: #f0f0f0;
|
|
91
91
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import React, { Fragment,
|
|
2
|
+
import React, { Fragment, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
4
4
|
import classNames from "classnames";
|
|
5
5
|
import { Button, Dropdown, Form, Modal, Typography } from "antd";
|
|
@@ -950,7 +950,7 @@ const GridEdit = props => {
|
|
|
950
950
|
const isEditing = React.useCallback(record => {
|
|
951
951
|
return record[rowKey] === editingKey;
|
|
952
952
|
}, [editingKey, rowKey]);
|
|
953
|
-
useEffect(() => {
|
|
953
|
+
React.useEffect(() => {
|
|
954
954
|
const handleClickOutside = event => {
|
|
955
955
|
const element = event.target;
|
|
956
956
|
|
|
@@ -990,9 +990,11 @@ const GridEdit = props => {
|
|
|
990
990
|
setRangeCells(new Set());
|
|
991
991
|
}
|
|
992
992
|
};
|
|
993
|
-
document.addEventListener(
|
|
993
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
994
|
+
document.addEventListener('touchstart', handleClickOutside);
|
|
994
995
|
return () => {
|
|
995
|
-
document.removeEventListener(
|
|
996
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
997
|
+
document.removeEventListener('touchstart', handleClickOutside);
|
|
996
998
|
};
|
|
997
999
|
}, [id]);
|
|
998
1000
|
const triggerDragPaste = pastesArray => {
|
|
@@ -9,4 +9,4 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
9
9
|
const GridStyle = exports.GridStyle = _styledComponents.default.div.withConfig({
|
|
10
10
|
displayName: "GridStyle",
|
|
11
11
|
componentId: "es-grid-template__sc-sueu2e-0"
|
|
12
|
-
})(["height:", ";.ui-rc-table.ui-rc-table-virtual.ui-rc-table-scroll-horizontal{.ui-rc-table-container{padding-bottom:8px;border-bottom:1px solid #e0e0e0;}}.ui-rc-table-container{.ui-rc-table-tbody-virtual.ui-rc-table-tbody{min-height:", ";}}.ui-rc-toolbar-bottom{position:relative;padding:.25rem 1rem;background-color:#ffffff;&::before{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;left:0;}&::after{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;visibility:visible;right:0;}.toolbar-button{border-radius:0;.ant-btn{border-radius:0;}}}.ui-rc-pagination{border-bottom:1px solid #e0e0e0;border-top:1px solid #e0e0e0;margin:0;padding:.75rem 1rem;background-color:#ffffff;.ui-rc-pagination-total-text{order:2;margin-left:auto;}&::before{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:50px;bottom:0;left:0;}&::after{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:50px;bottom:0;visibility:visible;right:0;}&.pagination-template{position:relative;&::before{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;left:0;}&::after{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;visibility:visible;right:0;}}}.react-resizable{position:relative;background-clip:padding-box;}.rc-resizable-handle{position:absolute;right:0px;bottom:0;z-index:1;width:5px;height:100%;cursor:col-resize;&.none{cursor:auto;display:none;}}"], props => props.$heightTable ? `${props.$heightTable}px` : undefined, props => props.$heightScroll ? `${props.$heightScroll}px` : undefined);
|
|
12
|
+
})(["height:", ";.ui-rc-table.ui-rc-table-virtual.ui-rc-table-scroll-horizontal{.ui-rc-table-container{&:has(.ui-rc-table-tbody-virtual-scrollbar-horizontal){padding-bottom:8px;border-bottom:1px solid #e0e0e0;}}}.ui-rc-table-container{.ui-rc-table-tbody-virtual.ui-rc-table-tbody{min-height:", ";}}.ui-rc-toolbar-bottom{position:relative;padding:.25rem 1rem;background-color:#ffffff;&::before{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;left:0;}&::after{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;visibility:visible;right:0;}.toolbar-button{border-radius:0;.ant-btn{border-radius:0;}}}.ui-rc-pagination{border-bottom:1px solid #e0e0e0;border-top:1px solid #e0e0e0;margin:0;padding:.75rem 1rem;background-color:#ffffff;.ui-rc-pagination-total-text{order:2;margin-left:auto;}&::before{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:50px;bottom:0;left:0;}&::after{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:50px;bottom:0;visibility:visible;right:0;}&.pagination-template{position:relative;&::before{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;left:0;}&::after{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;visibility:visible;right:0;}}}.react-resizable{position:relative;background-clip:padding-box;}.rc-resizable-handle{position:absolute;right:0px;bottom:0;z-index:1;width:5px;height:100%;cursor:col-resize;&.none{cursor:auto;display:none;}}"], props => props.$heightTable ? `${props.$heightTable}px` : undefined, props => props.$heightScroll ? `${props.$heightScroll}px` : undefined);
|
|
@@ -245,7 +245,7 @@ const InternalTable = props => {
|
|
|
245
245
|
const hhh = (propsHeight ?? 0) - (title ? title.offsetHeight : 0) - (header ? header.offsetHeight : 0) - (paginationE ? paginationE.offsetHeight : 0) - (toolbar ? toolbar.offsetHeight : 0) - (summaryE ? summaryE.offsetHeight : 0) - (scrollbar ? scrollbar.offsetHeight : 0);
|
|
246
246
|
setHeight(hhh);
|
|
247
247
|
// })
|
|
248
|
-
}, [id, propsHeight, columns]);
|
|
248
|
+
}, [id, propsHeight, columns, editAble]);
|
|
249
249
|
const tableRef = _react.default.useRef(null);
|
|
250
250
|
_react.default.useEffect(() => {
|
|
251
251
|
setColumns(propsColumns);
|
|
@@ -858,7 +858,7 @@ const InternalTable = props => {
|
|
|
858
858
|
// scroll={{ y: scrollHeight - (summary ? 0 : 7) }} // scroll height auto, không quá 600
|
|
859
859
|
,
|
|
860
860
|
scroll: {
|
|
861
|
-
y: scrollHeight - (summary ?
|
|
861
|
+
y: scrollHeight - (summary ? 1 : 1)
|
|
862
862
|
} // scroll height auto, không quá 600
|
|
863
863
|
,
|
|
864
864
|
height: propsHeight,
|
|
@@ -85,7 +85,7 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
85
85
|
|
|
86
86
|
.ui-rc-table-tbody-virtual-scrollbar.ui-rc-table-tbody-virtual-scrollbar-horizontal {
|
|
87
87
|
visibility: visible !important;
|
|
88
|
-
|
|
88
|
+
bottom: -8px !important;
|
|
89
89
|
z-index: 5 !important;
|
|
90
90
|
background-color: #f0f0f0;
|
|
91
91
|
}
|
|
@@ -954,7 +954,7 @@ const GridEdit = props => {
|
|
|
954
954
|
const isEditing = _react.default.useCallback(record => {
|
|
955
955
|
return record[rowKey] === editingKey;
|
|
956
956
|
}, [editingKey, rowKey]);
|
|
957
|
-
|
|
957
|
+
_react.default.useEffect(() => {
|
|
958
958
|
const handleClickOutside = event => {
|
|
959
959
|
const element = event.target;
|
|
960
960
|
|
|
@@ -994,9 +994,11 @@ const GridEdit = props => {
|
|
|
994
994
|
setRangeCells(new Set());
|
|
995
995
|
}
|
|
996
996
|
};
|
|
997
|
-
document.addEventListener(
|
|
997
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
998
|
+
document.addEventListener('touchstart', handleClickOutside);
|
|
998
999
|
return () => {
|
|
999
|
-
document.removeEventListener(
|
|
1000
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
1001
|
+
document.removeEventListener('touchstart', handleClickOutside);
|
|
1000
1002
|
};
|
|
1001
1003
|
}, [id]);
|
|
1002
1004
|
const triggerDragPaste = pastesArray => {
|