es-grid-template 1.3.5 → 1.3.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/assets/index.css +33 -13
- package/assets/index.scss +49 -14
- package/es/grid-component/EditableCell.js +1 -0
- package/es/grid-component/GridStyle.d.ts +5 -3
- package/es/grid-component/GridStyle.js +1 -1
- package/es/grid-component/TableGrid.js +16 -12
- package/es/grid-component/hooks/columns/index.js +4 -3
- package/es/grid-component/hooks/useColumns.js +7 -5
- package/es/grid-component/hooks/utils.d.ts +23 -0
- package/es/grid-component/hooks/utils.js +512 -2
- package/es/grid-component/number/index.d.ts +2 -2
- package/es/grid-component/number/index.js +2 -2
- package/es/grid-component/styles.scss +49 -14
- package/es/grid-component/table/Grid.js +1 -1
- package/es/grid-component/table/GridEdit.js +474 -206
- package/es/grid-component/table/Group.js +1 -1
- package/lib/grid-component/EditableCell.js +1 -0
- package/lib/grid-component/GridStyle.d.ts +5 -3
- package/lib/grid-component/GridStyle.js +1 -1
- package/lib/grid-component/TableGrid.js +14 -11
- package/lib/grid-component/hooks/columns/index.js +2 -1
- package/lib/grid-component/hooks/useColumns.js +7 -5
- package/lib/grid-component/hooks/utils.d.ts +23 -0
- package/lib/grid-component/hooks/utils.js +537 -8
- package/lib/grid-component/number/index.d.ts +2 -2
- package/lib/grid-component/number/index.js +2 -2
- package/lib/grid-component/styles.scss +49 -14
- package/lib/grid-component/table/Grid.js +1 -1
- package/lib/grid-component/table/GridEdit.js +474 -197
- package/lib/grid-component/table/Group.js +1 -1
- package/package.json +2 -2
package/assets/index.css
CHANGED
|
@@ -49,6 +49,15 @@
|
|
|
49
49
|
.ui-rc-table-wrapper .ui-rc-table-tbody .ui-rc-table-cell {
|
|
50
50
|
line-height: 22px;
|
|
51
51
|
}
|
|
52
|
+
.ui-rc-table-wrapper .ui-rc-table-tbody .ui-rc-table-cell:focus-visible {
|
|
53
|
+
outline: none;
|
|
54
|
+
}
|
|
55
|
+
.ui-rc-table-wrapper .ui-rc-table-tbody .ui-rc-table-cell.disable {
|
|
56
|
+
background-color: #f0f0f0;
|
|
57
|
+
}
|
|
58
|
+
.ui-rc-table-wrapper .ui-rc-table-tbody .ui-rc-table-cell.selected {
|
|
59
|
+
background-color: #E6EFFD;
|
|
60
|
+
}
|
|
52
61
|
.ui-rc-table-wrapper .ui-rc-table-tbody .ui-rc-table-cell .ui-rc-table-cell-content {
|
|
53
62
|
line-height: 22px;
|
|
54
63
|
}
|
|
@@ -207,24 +216,35 @@
|
|
|
207
216
|
top: 8px;
|
|
208
217
|
left: 8px;
|
|
209
218
|
}
|
|
219
|
+
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.rc-ui-cell-index.focus {
|
|
220
|
+
background-color: #CEDBEF;
|
|
221
|
+
font-weight: 500;
|
|
222
|
+
}
|
|
223
|
+
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.rc-ui-cell-index.selected {
|
|
224
|
+
background-color: #0550C5;
|
|
225
|
+
color: #fff;
|
|
226
|
+
}
|
|
210
227
|
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.cell-editable.cell-border-top {
|
|
211
228
|
border-bottom: 1px solid #0550C5;
|
|
212
229
|
}
|
|
213
230
|
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.cell-editable.cell-border-bottom {
|
|
214
231
|
border-bottom: 1px solid #0550C5;
|
|
215
232
|
}
|
|
216
|
-
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.cell-editable.cell-paste-border-bottom {
|
|
217
|
-
border-bottom: 1px dashed #949494;
|
|
218
|
-
}
|
|
219
233
|
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.cell-editable.cell-border-left {
|
|
220
234
|
border-inline-end: 1px solid #0550C5;
|
|
221
235
|
}
|
|
222
|
-
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.cell-editable.cell-paste-border-left {
|
|
223
|
-
border-inline-end: 1px dashed #949494;
|
|
224
|
-
}
|
|
225
236
|
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.cell-editable.cell-border-right {
|
|
226
237
|
border-inline-end: 1px solid #0550C5;
|
|
227
238
|
}
|
|
239
|
+
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.cell-editable.cell-paste-border-top {
|
|
240
|
+
border-bottom: 1px dashed #949494;
|
|
241
|
+
}
|
|
242
|
+
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.cell-editable.cell-paste-border-bottom {
|
|
243
|
+
border-bottom: 1px dashed #949494;
|
|
244
|
+
}
|
|
245
|
+
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.cell-editable.cell-paste-border-left {
|
|
246
|
+
border-inline-end: 1px dashed #949494;
|
|
247
|
+
}
|
|
228
248
|
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.cell-editable.cell-paste-border-right {
|
|
229
249
|
border-inline-end: 1px dashed #949494;
|
|
230
250
|
}
|
|
@@ -283,8 +303,11 @@
|
|
|
283
303
|
height: 10px;
|
|
284
304
|
position: absolute;
|
|
285
305
|
cursor: crosshair;
|
|
286
|
-
right:
|
|
287
|
-
bottom:
|
|
306
|
+
right: -1px;
|
|
307
|
+
bottom: -1px;
|
|
308
|
+
}
|
|
309
|
+
.ui-rc-table-wrapper.grid-editable .ui-rc_cell-content .dragging-point.hidden {
|
|
310
|
+
display: none;
|
|
288
311
|
}
|
|
289
312
|
.ui-rc-table-wrapper.grid-editable .ui-rc_cell-content .dragging-point .dot-point {
|
|
290
313
|
position: absolute;
|
|
@@ -292,15 +315,12 @@
|
|
|
292
315
|
height: 8px;
|
|
293
316
|
border-radius: 6px;
|
|
294
317
|
background-color: #0550C5;
|
|
295
|
-
bottom: -
|
|
296
|
-
right: -
|
|
318
|
+
bottom: -3px;
|
|
319
|
+
right: -3px;
|
|
297
320
|
}
|
|
298
321
|
.ui-rc-table-wrapper.grid-editable .ui-rc_cell-content.selected {
|
|
299
322
|
background-color: #E6EFFD;
|
|
300
323
|
}
|
|
301
|
-
.ui-rc-table-wrapper.grid-editable .ui-rc_cell-content.disable {
|
|
302
|
-
background-color: #f0f0f0;
|
|
303
|
-
}
|
|
304
324
|
.ui-rc-table-wrapper.grid-editable .ui-rc_cell-content--index.focus {
|
|
305
325
|
background-color: #CEDBEF;
|
|
306
326
|
}
|
package/assets/index.scss
CHANGED
|
@@ -144,6 +144,19 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
144
144
|
|
|
145
145
|
.#{$prefix}-table-cell {
|
|
146
146
|
line-height: 22px;
|
|
147
|
+
&:focus-visible {
|
|
148
|
+
outline: none;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
&.disable {
|
|
153
|
+
background-color: #f0f0f0;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&.selected {
|
|
157
|
+
//background: red;
|
|
158
|
+
background-color: $cell-selected-bg;
|
|
159
|
+
}
|
|
147
160
|
|
|
148
161
|
.ui-rc-table-cell-content {
|
|
149
162
|
line-height: 22px;
|
|
@@ -406,7 +419,20 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
406
419
|
left: 8px;
|
|
407
420
|
}
|
|
408
421
|
|
|
422
|
+
&.rc-ui-cell-index {
|
|
423
|
+
&.focus {
|
|
424
|
+
background-color: $cell-index-focus-bg;
|
|
425
|
+
font-weight: 500;
|
|
426
|
+
}
|
|
427
|
+
&.selected {
|
|
428
|
+
background-color: $cell-index-selected-bg;
|
|
429
|
+
color: #fff;
|
|
430
|
+
//font-weight: 500;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
409
434
|
&.cell-editable {
|
|
435
|
+
|
|
410
436
|
&.cell-border-top {
|
|
411
437
|
border-bottom: 1px solid $border-selected-color;
|
|
412
438
|
}
|
|
@@ -415,26 +441,31 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
415
441
|
border-bottom: 1px solid $border-selected-color;
|
|
416
442
|
}
|
|
417
443
|
|
|
418
|
-
&.cell-
|
|
419
|
-
border-
|
|
444
|
+
&.cell-border-left {
|
|
445
|
+
border-inline-end: 1px solid $border-selected-color;
|
|
420
446
|
}
|
|
421
447
|
|
|
422
|
-
&.cell-border-
|
|
448
|
+
&.cell-border-right {
|
|
423
449
|
border-inline-end: 1px solid $border-selected-color;
|
|
424
450
|
}
|
|
425
451
|
|
|
426
|
-
&.cell-paste-border-
|
|
427
|
-
border-
|
|
452
|
+
&.cell-paste-border-top {
|
|
453
|
+
border-bottom: 1px dashed #949494;
|
|
428
454
|
}
|
|
429
455
|
|
|
430
|
-
&.cell-border-
|
|
431
|
-
border-
|
|
456
|
+
&.cell-paste-border-bottom {
|
|
457
|
+
border-bottom: 1px dashed #949494;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
&.cell-paste-border-left {
|
|
461
|
+
border-inline-end: 1px dashed #949494;
|
|
432
462
|
}
|
|
433
463
|
|
|
434
464
|
&.cell-paste-border-right {
|
|
435
465
|
border-inline-end: 1px dashed #949494;
|
|
436
466
|
}
|
|
437
467
|
|
|
468
|
+
|
|
438
469
|
&.#{$prefix}-table-cell-fix-left {
|
|
439
470
|
&:has(.ui-rc_cell-content.selected) {
|
|
440
471
|
}
|
|
@@ -617,18 +648,22 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
617
648
|
height: 10px;
|
|
618
649
|
position: absolute;
|
|
619
650
|
cursor: crosshair;
|
|
620
|
-
right:
|
|
621
|
-
bottom:
|
|
651
|
+
right: -1px;
|
|
652
|
+
bottom: -1px;
|
|
622
653
|
//background: red;
|
|
623
654
|
|
|
655
|
+
&.hidden {
|
|
656
|
+
display: none;
|
|
657
|
+
}
|
|
658
|
+
|
|
624
659
|
.dot-point {
|
|
625
660
|
position: absolute;
|
|
626
661
|
width: 8px;
|
|
627
662
|
height: 8px;
|
|
628
663
|
border-radius: 6px;
|
|
629
664
|
background-color: $border-selected-color;
|
|
630
|
-
bottom: -
|
|
631
|
-
right: -
|
|
665
|
+
bottom: -3px;
|
|
666
|
+
right: -3px;
|
|
632
667
|
}
|
|
633
668
|
|
|
634
669
|
}
|
|
@@ -638,9 +673,9 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
638
673
|
background-color: $cell-selected-bg;
|
|
639
674
|
}
|
|
640
675
|
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
}
|
|
676
|
+
//.ui-rc_cell-content.disable {
|
|
677
|
+
// background-color: #f0f0f0;
|
|
678
|
+
//}
|
|
644
679
|
|
|
645
680
|
.ui-rc_cell-content--index {
|
|
646
681
|
&.focus {
|
|
@@ -572,6 +572,7 @@ const EditableCell = props => {
|
|
|
572
572
|
},
|
|
573
573
|
treeCheckable: column?.editSelectSettings?.selectMode === 'checkbox',
|
|
574
574
|
filterTreeNode: filterTreeNode,
|
|
575
|
+
popupMatchSelectWidth: menuWidth ? menuWidth + 10 : undefined,
|
|
575
576
|
onSelect: (val, option) => {
|
|
576
577
|
onChange(val ?? '');
|
|
577
578
|
const formState = getValues();
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
heightTable?: number | string;
|
|
4
|
-
}
|
|
2
|
+
interface GridProps {
|
|
3
|
+
$heightTable?: number | string;
|
|
4
|
+
}
|
|
5
|
+
export declare const GridStyle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, GridProps>> & string;
|
|
6
|
+
export {};
|
|
@@ -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
|
-
})([".ui-rc-table-container{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
|
|
5
|
+
})([".ui-rc-table-container{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 ? typeof props.$heightTable === 'string' ? props.$heightTable : `${props.$heightTable}px` : undefined);
|
|
@@ -3,13 +3,16 @@ import React, { Fragment } from 'react';
|
|
|
3
3
|
import { createStyles } from 'antd-style';
|
|
4
4
|
import { numericFormatter } from "react-numeric-component";
|
|
5
5
|
import { Empty, Table, Toolbar } from "rc-master-ui";
|
|
6
|
+
// import Table from "../../core/table"
|
|
7
|
+
|
|
6
8
|
import 'dayjs/locale/es';
|
|
7
9
|
import 'dayjs/locale/vi';
|
|
8
10
|
import ContextMenu from "./ContextMenu";
|
|
9
11
|
import classNames from "classnames";
|
|
10
12
|
import { checkDecimalSeparator, checkThousandSeparator,
|
|
11
13
|
// filterDataByColumns2,
|
|
12
|
-
filterDataByColumns3,
|
|
14
|
+
// filterDataByColumns3,
|
|
15
|
+
filterDataByColumns4,
|
|
13
16
|
// convertFlatColumn,
|
|
14
17
|
isEmpty,
|
|
15
18
|
// newGuid,
|
|
@@ -365,8 +368,10 @@ const TableGrid = props => {
|
|
|
365
368
|
loading: {
|
|
366
369
|
spinning: columns && columns.length === 0 || loading === true,
|
|
367
370
|
indicator: /*#__PURE__*/React.createElement(ComponentSpinner, null)
|
|
368
|
-
}
|
|
369
|
-
dataSource
|
|
371
|
+
}
|
|
372
|
+
// dataSource={columns && columns.length > 0 ? filterDataByColumns3(dataSource, filterStates) : []}
|
|
373
|
+
,
|
|
374
|
+
dataSource: columns && columns.length > 0 ? filterDataByColumns4(dataSource, filterStates) : []
|
|
370
375
|
// dataSource={columns && columns.length > 0 && loading !== true ? dataSource : []}
|
|
371
376
|
// className={styles.customTable}
|
|
372
377
|
,
|
|
@@ -391,17 +396,16 @@ const TableGrid = props => {
|
|
|
391
396
|
},
|
|
392
397
|
rowSelection: columns && columns.length === 0 ? undefined : {
|
|
393
398
|
...selectionSettings,
|
|
394
|
-
type: selectionSettings?.mode
|
|
395
|
-
|
|
399
|
+
// type: selectionSettings?.mode,
|
|
400
|
+
type: mode,
|
|
401
|
+
columnWidth: columnWidth ?? 50,
|
|
396
402
|
onChange: onSelectChange,
|
|
397
403
|
// selectedRowKeys: mode === 'checkbox' && type === 'single' ? selectedRowKeys : undefined,
|
|
398
404
|
selectedRowKeys: mergedSelectedKeys,
|
|
399
|
-
defaultSelectedRowKeys: selectionSettings?.defaultSelectedRowKeys,
|
|
405
|
+
// defaultSelectedRowKeys: selectionSettings?.defaultSelectedRowKeys,
|
|
406
|
+
defaultSelectedRowKeys: defaultSelectedRowKeys,
|
|
400
407
|
preserveSelectedRowKeys: true,
|
|
401
|
-
|
|
402
|
-
// checkStrictly: false,
|
|
403
|
-
|
|
404
|
-
hideSelectAll: !type || type === 'single' || selectionSettings?.mode === 'radio' ? true : hideSelectAll ?? type !== 'multiple'
|
|
408
|
+
hideSelectAll: !type || type === 'single' || mode === 'radio' ? true : hideSelectAll ?? type !== 'multiple'
|
|
405
409
|
}
|
|
406
410
|
|
|
407
411
|
// onScroll={() => {
|
|
@@ -418,7 +422,7 @@ const TableGrid = props => {
|
|
|
418
422
|
}
|
|
419
423
|
return /*#__PURE__*/React.createElement(Table.Summary, {
|
|
420
424
|
fixed: true
|
|
421
|
-
}, /*#__PURE__*/React.createElement(Table.Summary.Row, null, flatColumns([Table.SELECTION_COLUMN, ...columns]).filter(col => col.hidden !== true).map((col, index) => {
|
|
425
|
+
}, /*#__PURE__*/React.createElement(Table.Summary.Row, null, flatColumns(!!mode ? [Table.SELECTION_COLUMN, ...columns] : [...columns]).filter(col => col.hidden !== true).map((col, index) => {
|
|
422
426
|
const thousandSeparator = col.format?.thousandSeparator ? col.format?.thousandSeparator : format?.thousandSeparator;
|
|
423
427
|
const decimalSeparator = col.format?.decimalSeparator ? col.format?.decimalSeparator : format?.decimalSeparator;
|
|
424
428
|
const dec = col.format?.decimalScale || col.format?.decimalScale === 0 ? col.format?.decimalScale : format?.decimalScale;
|
|
@@ -442,7 +446,7 @@ const TableGrid = props => {
|
|
|
442
446
|
}, col.summaryTemplate ? col.summaryTemplate(cellValue, col.key) : numericFormatter(cellValue, numericFormatProps));
|
|
443
447
|
})));
|
|
444
448
|
},
|
|
445
|
-
pagination: !pagination || pagination && pagination
|
|
449
|
+
pagination: !pagination || pagination && pagination?.onChange ? false : {
|
|
446
450
|
showTotal: (total, range) => `${range[0]}-${range[1]} / ${total} items`,
|
|
447
451
|
...pagination
|
|
448
452
|
},
|
|
@@ -7,7 +7,7 @@ import { DatePicker, Empty, Input, Select } from "rc-master-ui";
|
|
|
7
7
|
import CheckboxFilter from "../../CheckboxFilter";
|
|
8
8
|
import { SELECTION_COLUMN } from "rc-master-ui/es/table/hooks/useSelection";
|
|
9
9
|
import NumberRange from "../../number-range";
|
|
10
|
-
import
|
|
10
|
+
import NumberInput from "../../number";
|
|
11
11
|
// import {Typography} from "antd";
|
|
12
12
|
const {
|
|
13
13
|
RangePicker
|
|
@@ -76,7 +76,8 @@ export const getValueCell = (column, value, format) => {
|
|
|
76
76
|
|
|
77
77
|
// const contentNumber = !isEmpty(value) ? ((dec || dec === 0) ? parseFloat(Number(value).toFixed(dec)).toString() : value.toString()) : '0'
|
|
78
78
|
|
|
79
|
-
const
|
|
79
|
+
const tmpval = typeof value === 'string' ? Number(value) : value;
|
|
80
|
+
const contentNumber = !isEmpty(value) ? dec || dec === 0 ? parseFloat(tmpval.toFixed(dec)).toString() : tmpval.toString() : '0';
|
|
80
81
|
const numericFormatProps = {
|
|
81
82
|
thousandSeparator: checkThousandSeparator(thousandSeparator, decimalSeparator),
|
|
82
83
|
decimalSeparator: checkDecimalSeparator(thousandSeparator, decimalSeparator),
|
|
@@ -144,7 +145,7 @@ export const renderFilter = (column, selectedKeys, setSelectedKeys, confirm, vis
|
|
|
144
145
|
case 'Number':
|
|
145
146
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
146
147
|
className: 'mb-1'
|
|
147
|
-
}, /*#__PURE__*/React.createElement(
|
|
148
|
+
}, /*#__PURE__*/React.createElement(NumberInput, {
|
|
148
149
|
t: t,
|
|
149
150
|
value: selectedKeys[0],
|
|
150
151
|
onChange: vals => {
|
|
@@ -154,8 +154,8 @@ const useColumns = config => {
|
|
|
154
154
|
const transformColumns = useCallback(columns => {
|
|
155
155
|
// >>>>>>>>>>> Support selection
|
|
156
156
|
const cloneColumns = [...columns];
|
|
157
|
-
const firstNonGroupColumn = flatColumns2(cloneColumns).find(col => col.field && col.field !== '#' &&
|
|
158
|
-
const nonGroupColumns = flatColumns2(cloneColumns).filter(col => col.field && col.field !== '#' &&
|
|
157
|
+
const firstNonGroupColumn = flatColumns2(cloneColumns).find(col => col.field && col.field !== '#' && !groupColumns?.includes(col.field) && col.hidden !== true);
|
|
158
|
+
const nonGroupColumns = flatColumns2(cloneColumns).filter(col => col.field && col.field !== '#' && !groupColumns?.includes(col.field) && col.hidden !== true);
|
|
159
159
|
|
|
160
160
|
// ===================== Render =====================
|
|
161
161
|
|
|
@@ -191,19 +191,18 @@ const useColumns = config => {
|
|
|
191
191
|
children: convertColumns(transformedColumn.children)
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
|
-
if (
|
|
194
|
+
if (transformedColumn.field === '#') {
|
|
195
195
|
return {
|
|
196
196
|
...transformedColumn,
|
|
197
197
|
onCell: () => ({
|
|
198
198
|
className: 'cell-number'
|
|
199
199
|
}),
|
|
200
200
|
render: (val, record) => {
|
|
201
|
-
// return rowIndex + 1
|
|
202
201
|
return findItemPath(dataSource, record, rowKey);
|
|
203
202
|
}
|
|
204
203
|
};
|
|
205
204
|
}
|
|
206
|
-
if (
|
|
205
|
+
if (transformedColumn.field === 'command') {
|
|
207
206
|
return {
|
|
208
207
|
...transformedColumn,
|
|
209
208
|
onCell: () => ({
|
|
@@ -289,6 +288,9 @@ const useColumns = config => {
|
|
|
289
288
|
}
|
|
290
289
|
if (col.field === firstNonGroupColumn?.field && record.children) {
|
|
291
290
|
const currentGroupColumn = flatColumns2(cols).find(it => it.field === record.field);
|
|
291
|
+
if (currentGroupColumn?.template) {
|
|
292
|
+
return renderContent(currentGroupColumn, record[record.field], record, rowIndex, format);
|
|
293
|
+
}
|
|
292
294
|
return /*#__PURE__*/React.createElement("span", null, currentGroupColumn?.headerText, ": ", renderContent(currentGroupColumn, record[record.field], record, rowIndex, format));
|
|
293
295
|
}
|
|
294
296
|
return renderContent(col, value, record, rowIndex, format);
|
|
@@ -62,6 +62,13 @@ export declare function addRows8(arr: any, n: number): {
|
|
|
62
62
|
combined: any[];
|
|
63
63
|
addedRows: any[];
|
|
64
64
|
};
|
|
65
|
+
export declare function addRowsUp(array: any, n: number): {
|
|
66
|
+
combined: any;
|
|
67
|
+
addedRows: any[];
|
|
68
|
+
} | {
|
|
69
|
+
combined: any[];
|
|
70
|
+
addedRows: any[];
|
|
71
|
+
};
|
|
65
72
|
export declare const transformColumns: <RecordType>(cols: ColumnsTable<RecordType>, convertColumns: any[], t?: any) => ColumnsTable<RecordType>;
|
|
66
73
|
export declare const transformColumns1: <RecordType>(cols: ColumnsTable<RecordType>, sortMultiple?: boolean) => ColumnsTable<RecordType>;
|
|
67
74
|
export declare const removeColumns: <RecordType>(columns: ColumnTable<RecordType>[], groupColumns: string[]) => ColumnsTable<RecordType>;
|
|
@@ -76,6 +83,8 @@ export declare const filterDataByColumns: (data: any[], queries: any) => any[];
|
|
|
76
83
|
export declare const filterDataByColumns2: (data: any[], queries: any) => any[];
|
|
77
84
|
export declare const removeFieldRecursive: (data: any[], field: string) => any[];
|
|
78
85
|
export declare const filterDataByColumns3: (data: any[], queries: any[]) => any[];
|
|
86
|
+
export declare const shouldInclude: (item: any, queries: any[]) => any;
|
|
87
|
+
export declare function filterDataByColumns4(data: any[], queries: any[]): any[];
|
|
79
88
|
export declare function isDateString(str: any): boolean;
|
|
80
89
|
export declare function compareDates(date1: any, date2: any): boolean;
|
|
81
90
|
export declare function compareDate(itemValue: any, value: any): boolean;
|
|
@@ -93,3 +102,17 @@ export declare function isRightMostInRegion(rowIndex: number, colIndex: number,
|
|
|
93
102
|
export declare function isEqualSet(setA: any, setB: any): boolean;
|
|
94
103
|
export declare function isBottomMostInRanges(rowIndex: number, colIndex: number, regions: any[]): boolean;
|
|
95
104
|
export declare const mergedSets: (arr: any[]) => Set<unknown>;
|
|
105
|
+
export declare const sortedSetASC: (setValue: any) => Set<unknown>;
|
|
106
|
+
export declare const sortedSetDSC: (setValue: any) => Set<unknown>;
|
|
107
|
+
export declare function getBottomRowCells(cellSet: any): any[];
|
|
108
|
+
export declare function getCellsByPosition(cellSet: any, position?: string): any[];
|
|
109
|
+
export declare const addBorderClass: (selectedCells: any, type: string, className: string, id?: string) => void;
|
|
110
|
+
export declare const removeBorderClass: (selectedCells: any, type: string, className: string, id?: string) => void;
|
|
111
|
+
export declare const onAddClassBgSelectedCell: (selectedCells: any, id?: string) => void;
|
|
112
|
+
export declare const onRemoveClassSelectedCell: (selectedCells: any, id?: string, rowsSelected?: any) => void;
|
|
113
|
+
export declare const addClassBorderPasteCell: (pasteCells: any, type: 'up' | 'down', id?: string) => void;
|
|
114
|
+
export declare const removeClassBorderPasteCell: (pasteCells: any, type: 'up' | 'down', id?: string) => void;
|
|
115
|
+
export declare const addClassCellIndexSelected: (rowsSelected: any, id?: string) => void;
|
|
116
|
+
export declare const removeClassCellIndexSelected: (rowsSelected: any, id?: string) => void;
|
|
117
|
+
export declare const showDraggingPoint: (selectedCells: any, id?: any) => void;
|
|
118
|
+
export declare const hideDraggingPoint: (selectedCells: any, id?: any) => void;
|