es-grid-template 1.9.50 → 1.9.52
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/ali-table/utils/convertColumnsChoose.d.ts +2 -2
- package/es/group-component/hook/utils.d.ts +8 -8
- package/es/table-component/TableContainerEdit.js +73 -56
- package/es/table-component/body/EditableCell.d.ts +3 -0
- package/es/table-component/body/EditableCell.js +122 -36
- package/es/table-component/body/TableBodyCellEdit.js +70 -9
- package/es/table-component/hook/useColumns.js +3 -2
- package/es/table-component/hook/utils.d.ts +3 -0
- package/es/table-component/hook/utils.js +33 -1
- package/es/table-component/style.js +1 -1
- package/es/table-component/style.scss +6 -0
- package/lib/ali-table/utils/convertColumnsChoose.d.ts +2 -2
- package/lib/table-component/TableContainerEdit.js +71 -55
- package/lib/table-component/body/EditableCell.d.ts +3 -0
- package/lib/table-component/body/EditableCell.js +122 -36
- package/lib/table-component/body/TableBodyCellEdit.js +69 -8
- package/lib/table-component/hook/useColumns.js +3 -2
- package/lib/table-component/hook/utils.d.ts +3 -0
- package/lib/table-component/hook/utils.js +38 -4
- package/lib/table-component/style.js +1 -1
- package/lib/table-component/style.scss +6 -0
- package/package.json +1 -1
|
@@ -81,6 +81,7 @@ export declare function sortData(data: any[], sorter: Sorter[]): any[];
|
|
|
81
81
|
export declare function filterDataByColumns(data: any[], queries: FilterItem[] | undefined, sorter: Sorter[] | undefined, keysFilter: string[] | undefined, ignoreAccents?: boolean): any[];
|
|
82
82
|
export declare const getAllRowKey: (data: any[]) => any[];
|
|
83
83
|
export declare const isEditable: <RecordType>(column: ColumnTable, rowData: RecordType) => boolean | ((rowData: any) => boolean);
|
|
84
|
+
export declare const getNextEditableColumn: (columns: any[], currentIndex: number, rowData: any) => any;
|
|
84
85
|
export declare const checkFieldKey: (key: string | undefined) => string;
|
|
85
86
|
export declare const convertArrayWithIndent: (inputArray: any[], parentIndent?: number) => any[];
|
|
86
87
|
export declare const convertLabelToTitle: (data: any[]) => any[];
|
|
@@ -167,3 +168,5 @@ export declare const removeColumns: <RecordType>(columns: ColumnTable<RecordType
|
|
|
167
168
|
export declare function sumFields(columns: ColumnTable[], data: any[], childrenKey?: string): any;
|
|
168
169
|
export declare function sumNumberFields(columns: ColumnTable[], data: any[], childrenKey?: string): any;
|
|
169
170
|
export declare const getTreeDepth: (rows: any[]) => number;
|
|
171
|
+
export type FormatToken = 'YYYY' | 'MM' | 'DD' | 'HH' | 'mm' | 'ss';
|
|
172
|
+
export declare const isDateChanged: (oldDate: string | Date, newDate: string | Date, format: string) => FormatToken | null;
|
|
@@ -39,12 +39,12 @@ exports.getFormat = exports.getFixedFields = exports.getEditType = exports.getDi
|
|
|
39
39
|
exports.getHiddenParentKeys = getHiddenParentKeys;
|
|
40
40
|
exports.getHiddenParentKeys1 = getHiddenParentKeys1;
|
|
41
41
|
exports.getInvisibleColumns = getInvisibleColumns;
|
|
42
|
-
exports.getNewItemsOnly = exports.getLastSelectCell = void 0;
|
|
42
|
+
exports.getNextEditableColumn = exports.getNewItemsOnly = exports.getLastSelectCell = void 0;
|
|
43
43
|
exports.getRowIdsBetween = getRowIdsBetween;
|
|
44
44
|
exports.getVisibleColumnKeys1 = exports.getVisibleColumnKeys = exports.getTypeFilter = exports.getTreeDepth = exports.getTableHeight = exports.getSelectedCellMatrix = void 0;
|
|
45
45
|
exports.getVisibleFields = getVisibleFields;
|
|
46
46
|
exports.groupArrayByColumns = groupArrayByColumns;
|
|
47
|
-
exports.isColor = void 0;
|
|
47
|
+
exports.isDateChanged = exports.isColor = void 0;
|
|
48
48
|
exports.isDateString = isDateString;
|
|
49
49
|
exports.isEmpty = exports.isEditable = exports.isDisable = exports.isDateValue = void 0;
|
|
50
50
|
exports.isEqualSet = isEqualSet;
|
|
@@ -260,6 +260,9 @@ function getDateValueType(value) {
|
|
|
260
260
|
}
|
|
261
261
|
const datetimeRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?(\.\d+)?(Z|[+-]\d{2}:\d{2})?$/;
|
|
262
262
|
const timeRegex = /^\d{2}:\d{2}(:\d{2})?$/;
|
|
263
|
+
|
|
264
|
+
// const timeRegex = /^(?:[01]\d|2[0-3])\s*:\s*[0-5]\d(?:\s*:\s*[0-5]\d)?$/;
|
|
265
|
+
|
|
263
266
|
if (datetimeRegex.test(value)) {
|
|
264
267
|
return 'datetime';
|
|
265
268
|
}
|
|
@@ -274,7 +277,8 @@ const convertToDate = (value, format) => {
|
|
|
274
277
|
}
|
|
275
278
|
const valueType = getDateValueType(value);
|
|
276
279
|
if (valueType === 'time') {
|
|
277
|
-
const date = (
|
|
280
|
+
// const date = dayjs(value, format ? [format, 'HH:mm:ss', 'HH:mm' ] : ['HH:mm:ss', 'HH:mm'], true);
|
|
281
|
+
const date = (0, _dayjs.default)(value, format ?? ['HH:mm:ss', 'HH:mm'], true);
|
|
278
282
|
return date.isValid() ? (0, _moment.default)(date.toDate()).format() : '';
|
|
279
283
|
}
|
|
280
284
|
if (valueType === 'datetime') {
|
|
@@ -1336,6 +1340,15 @@ const isEditable = (column, rowData) => {
|
|
|
1336
1340
|
return column?.editEnable;
|
|
1337
1341
|
};
|
|
1338
1342
|
exports.isEditable = isEditable;
|
|
1343
|
+
const getNextEditableColumn = (columns, currentIndex, rowData) => {
|
|
1344
|
+
for (let i = currentIndex + 1; i < columns.length; i++) {
|
|
1345
|
+
if (isEditable(columns[i].columnDef.meta, rowData)) {
|
|
1346
|
+
return columns[i];
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
return undefined;
|
|
1350
|
+
};
|
|
1351
|
+
exports.getNextEditableColumn = getNextEditableColumn;
|
|
1339
1352
|
const checkFieldKey = key => {
|
|
1340
1353
|
if (key) {
|
|
1341
1354
|
return key;
|
|
@@ -2853,4 +2866,25 @@ const getTreeDepth = rows => {
|
|
|
2853
2866
|
if (!rows?.length) return 0;
|
|
2854
2867
|
return 1 + Math.max(0, ...rows.map(r => getTreeDepth(r.children)));
|
|
2855
2868
|
};
|
|
2856
|
-
exports.getTreeDepth = getTreeDepth;
|
|
2869
|
+
exports.getTreeDepth = getTreeDepth;
|
|
2870
|
+
const TOKEN_MAP = {
|
|
2871
|
+
YYYY: 'year',
|
|
2872
|
+
MM: 'month',
|
|
2873
|
+
DD: 'day',
|
|
2874
|
+
HH: 'hour',
|
|
2875
|
+
mm: 'minute',
|
|
2876
|
+
ss: 'second'
|
|
2877
|
+
};
|
|
2878
|
+
const isDateChanged = (oldDate, newDate, format) => {
|
|
2879
|
+
const prev = (0, _dayjs.default)(oldDate, format, true);
|
|
2880
|
+
const next = (0, _dayjs.default)(newDate, format, true);
|
|
2881
|
+
const tokens = ['YYYY', 'MM', 'DD', 'HH', 'mm', 'ss'];
|
|
2882
|
+
for (const token of tokens) {
|
|
2883
|
+
if (!format.includes(token)) continue;
|
|
2884
|
+
if (!prev.isSame(next, TOKEN_MAP[token])) {
|
|
2885
|
+
return token;
|
|
2886
|
+
}
|
|
2887
|
+
}
|
|
2888
|
+
return null;
|
|
2889
|
+
};
|
|
2890
|
+
exports.isDateChanged = isDateChanged;
|
|
@@ -55,4 +55,4 @@ const colorDark = '#e6e4f3e6 ';
|
|
|
55
55
|
const GridStyle = exports.GridStyle = _styledComponents.default.div.withConfig({
|
|
56
56
|
displayName: "GridStyle",
|
|
57
57
|
componentId: "es-grid-template__sc-hdqm5k-0"
|
|
58
|
-
})(["&.", "-grid{color:", ";font-size:", ";background-color:", ";font-family:", ";&.", "-grid-editable{.", "-grid-container{.", "-grid-tbody{.", "-grid-row{background-color:", ";color:", ";&.", "-grid-row-parent{background-color:#ffffff;font-weight:500;}}}}}table{table-layout:fixed;border-collapse:separate;border-spacing:0;}.", "-grid-container{border:1px solid ", ";border-right:0;&::after{position:absolute;top:0px;right:0;z-index:1;height:100%;border-right:1px solid ", ";content:'';pointer-events:none;}.", "-grid-cell{padding:5px 8px;&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-right{justify-content:flex-end;text-align:right;}&.", "-grid-cell-ellipsis{.ui-rc_cell-content{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;&.select-cell{padding-right:18px;position:relative;}.caret-down{float:right;position:absolute;right:0;&::before{content:'';display:inline-block;margin-left:4px;vertical-align:middle;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #6f7777;}}}}&.", "-grid-cell-wrap{white-space:normal;text-overflow:ellipsis;word-break:break-word;}.", "-grid-header-text-wrap{white-space:normal;overflow:hidden;text-overflow:ellipsis;word-break:break-word;}}.", "-grid-thead{background-color:", ";font-weight:", ";.", "-grid-cell{font-weight:inherit;color:", ";background-color:inherit;border-inline-end:1px solid ", ";border-bottom:1px solid ", ";&.ui-rc-grid-cell-ellipsis{.ui-rc-table-column-title,.", "-grid-cell-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}&.ui-rc-grid-cell-wrap{.ui-rc-table-column-title,.", "-grid-cell-text-wrap{white-space:normal;word-break:break-word;overflow:hidden;}}&:hover{.ui-rc-header-trigger{.ui-rc-table-column-sorter-cancel{opacity:1;}}}.", "-grid-filter-column{display:flex;justify-content:space-between;width:100%;align-items:center;position:relative;z-index:3;}.ui-rc-header-trigger{padding-left:6px;display:flex;align-items:center;.ui-rc-table-column-sorter-cancel{opacity:0;}}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;z-index:3;touch-action:none;user-select:none;width:5px;}.resizer.isResizing{opacity:1;}}}.", "-grid-tbody{.", "-grid-row{font-weight:", ";background-color:", ";color:", ";&.", "-grid-row-odd{background-color:#f9f8fd;}&.", "-grid-row-even{}&.", "-grid-row-parent{background-color:#f5f5f5;font-weight:500;}}}.", "-grid-tfoot{.", "-grid-footer-row{border-bottom-width:1px;border-bottom-color:", ";border-bottom-style:solid;border-top-width:1px;border-top-color:", ";border-top-style:solid;background-color:#fafafa;}.", "-grid-cell{background-color:inherit;border-inline-end:1px solid ", ";}}}&.", "-grid-dark{background-color:", ";color:", ";.", "-grid-container{border-color:", ";&::after{border-right-color:", ";}}}.ui-rc-toolbar-bottom{border-right:1px solid #e0e0e0;border-left:1px solid #e0e0e0;.be-toolbar-item{.ui-rc-btn{font-size:12px;}.toolbar-dropdown-button{font-size:12px;.ui-rc-btn.ui-rc-btn-default.ui-rc-btn-variant-outlined.ui-rc-btn-compact-item.ui-rc-btn-compact-first-item{border-color:#28c76f;}.ui-rc-btn.ui-rc-btn-default.ui-rc-btn-variant-outlined.ui-rc-btn-compact-item.ui-rc-btn-compact-last-item{border-color:#28c76f;.ui-rc-btn-icon{color:#28c76f;}}}}}.ui-rc-toolbar-bottom_border-bottom{border-bottom:1px solid #e0e0e0;}.ui-rc-toolbar-bottom{position:relative;padding:.15rem 0.5rem;background-color:#ffffff;.toolbar-button{border-radius:3px;}.ui-rc-btn{border-radius:3px;height:28px;&.ui-rc-btn-compact-item.ui-rc-btn-compact-last-item{border-start-start-radius:0;border-end-start-radius:0;}&.ui-rc-btn-compact-item.ui-rc-btn-compact-first-item{border-start-end-radius:0;border-end-end-radius:0;}}}}"], props => props.$prefix, color, fontSize, BgColor, fontFamily, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, fwHeader, props => props.$prefix, props => `${props.$theme.color ? props.$theme.color : color}`, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, fwBody, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, tableBorderColor, props => props.$prefix, BgColorDark, colorDark, props => props.$prefix, tableBorderColorDark, tableBorderColorDark);
|
|
58
|
+
})(["&.", "-grid{color:", ";font-size:", ";background-color:", ";font-family:", ";&.", "-grid-editable{.", "-grid-container{.", "-grid-tbody{.", "-grid-row{background-color:", ";color:", ";&.", "-grid-row-parent{background-color:#ffffff;font-weight:500;}}}}}table{table-layout:fixed;border-collapse:separate;border-spacing:0;}.", "-grid-container{border:1px solid ", ";border-right:0;&::after{position:absolute;top:0px;right:0;z-index:1;height:100%;border-right:1px solid ", ";content:'';pointer-events:none;}.", "-grid-cell{padding:5px 8px;&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-right{justify-content:flex-end;text-align:right;}&.", "-grid-cell-ellipsis{.ui-rc_cell-content{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;&.select-cell{padding-right:18px;position:relative;}.caret-down{float:right;position:absolute;right:0;&::before{content:'';display:inline-block;margin-left:4px;vertical-align:middle;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #6f7777;}}}}&.", "-grid-cell-wrap{white-space:normal;text-overflow:ellipsis;word-break:break-word;}.", "-grid-header-text-wrap{white-space:normal;overflow:hidden;text-overflow:ellipsis;word-break:break-word;}}.", "-grid-thead{background-color:", ";font-weight:", ";.", "-grid-cell{font-weight:inherit;color:", ";background-color:inherit;border-inline-end:1px solid ", ";border-bottom:1px solid ", ";&.ui-rc-grid-cell-ellipsis{.ui-rc-table-column-title,.", "-grid-cell-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}&.ui-rc-grid-cell-wrap{.ui-rc-table-column-title,.", "-grid-cell-text-wrap{white-space:normal;word-break:break-word;overflow:hidden;}}&:hover{.ui-rc-header-trigger{.ui-rc-table-column-sorter-cancel{opacity:1;}}}.", "-grid-filter-column{display:flex;justify-content:space-between;width:100%;align-items:center;position:relative;z-index:3;}.ui-rc-header-trigger{padding-left:6px;display:flex;align-items:center;.ui-rc-table-column-sorter-cancel{opacity:0;}}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;z-index:3;touch-action:none;user-select:none;width:5px;}.resizer.isResizing{opacity:1;}}}.", "-grid-tbody{.", "-grid-row{font-weight:", ";background-color:", ";color:", ";&.", "-grid-row-odd{background-color:#f9f8fd;}&.", "-grid-row-even{}&.", "-grid-row-parent{background-color:#f5f5f5;font-weight:500;}}}.", "-grid-tfoot{.", "-grid-footer-row{border-bottom-width:1px;border-bottom-color:", ";border-bottom-style:solid;border-top-width:1px;border-top-color:", ";border-top-style:solid;background-color:#fafafa;}.", "-grid-cell{background-color:inherit;border-inline-end:1px solid ", ";}}}&.", "-grid-dark{background-color:", ";color:", ";.", "-grid-container{border-color:", ";&::after{border-right-color:", ";}}}.ui-rc-toolbar-bottom{border-right:1px solid #e0e0e0;border-left:1px solid #e0e0e0;.be-toolbar-item{.ui-rc-btn{font-size:12px;line-height:1.5}.toolbar-dropdown-button{font-size:12px;.ui-rc-btn.ui-rc-btn-default.ui-rc-btn-variant-outlined.ui-rc-btn-compact-item.ui-rc-btn-compact-first-item{border-color:#28c76f;}.ui-rc-btn.ui-rc-btn-default.ui-rc-btn-variant-outlined.ui-rc-btn-compact-item.ui-rc-btn-compact-last-item{border-color:#28c76f;.ui-rc-btn-icon{color:#28c76f;}}}}}.ui-rc-toolbar-bottom_border-bottom{border-bottom:1px solid #e0e0e0;}.ui-rc-toolbar-bottom{position:relative;padding:.15rem 0.5rem;background-color:#ffffff;.toolbar-button{border-radius:3px;}.ui-rc-btn{border-radius:3px;height:28px;&.ui-rc-btn-compact-item.ui-rc-btn-compact-last-item{border-start-start-radius:0;border-end-start-radius:0;}&.ui-rc-btn-compact-item.ui-rc-btn-compact-first-item{border-start-end-radius:0;border-end-end-radius:0;}}}}"], props => props.$prefix, color, fontSize, BgColor, fontFamily, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, fwHeader, props => props.$prefix, props => `${props.$theme.color ? props.$theme.color : color}`, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, fwBody, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, tableBorderColor, props => props.$prefix, BgColorDark, colorDark, props => props.$prefix, tableBorderColorDark, tableBorderColorDark);
|
|
@@ -1195,4 +1195,10 @@ $cell-index-focus-bg-Dark: #E6EFFD !default;
|
|
|
1195
1195
|
.ui-rc-toolbar-bottom_border-bottom {
|
|
1196
1196
|
border-bottom-color: $tableBorderColorDark;
|
|
1197
1197
|
}
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
.ui-rc-checkbox {
|
|
1201
|
+
&:has(input:focus) span {
|
|
1202
|
+
border-color: red;
|
|
1203
|
+
}
|
|
1198
1204
|
}
|