es-grid-template 1.2.1 → 1.2.2
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 -17
- package/assets/index.scss +62 -5
- package/es/grid-component/GridStyle.js +1 -1
- package/es/grid-component/InternalTable.d.ts +1 -0
- package/es/grid-component/InternalTable.js +2 -1
- package/es/grid-component/TableGrid.js +3 -13
- package/es/grid-component/hooks/content/HeaderContent.js +6 -7
- package/es/grid-component/hooks/useColumns.js +10 -2
- package/es/grid-component/hooks/utils.d.ts +2 -22
- package/es/grid-component/hooks/utils.js +2 -410
- package/es/grid-component/styles.scss +62 -5
- package/es/grid-component/table/Grid.js +17 -1
- package/es/grid-component/table/GridEdit.js +383 -158
- package/es/grid-component/type.d.ts +1 -1
- package/lib/grid-component/GridStyle.js +1 -1
- package/lib/grid-component/InternalTable.d.ts +1 -0
- package/lib/grid-component/InternalTable.js +2 -1
- package/lib/grid-component/TableGrid.js +4 -13
- package/lib/grid-component/hooks/content/HeaderContent.js +6 -7
- package/lib/grid-component/hooks/useColumns.js +10 -2
- package/lib/grid-component/hooks/utils.d.ts +2 -22
- package/lib/grid-component/hooks/utils.js +3 -419
- package/lib/grid-component/styles.scss +62 -5
- package/lib/grid-component/table/Grid.js +17 -1
- package/lib/grid-component/table/GridEdit.js +382 -157
- package/lib/grid-component/type.d.ts +1 -1
- package/package.json +2 -2
package/assets/index.css
CHANGED
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
.ui-rc-table-wrapper p {
|
|
14
14
|
margin: 0;
|
|
15
15
|
}
|
|
16
|
+
.ui-rc-table-wrapper .ui-rc-table {
|
|
17
|
+
color: rgba(0, 0, 0, 0.8705882353);
|
|
18
|
+
}
|
|
16
19
|
.ui-rc-table-wrapper.table-none-column-select .ui-rc-table-cell.ui-rc-table-selection-column {
|
|
17
20
|
padding: 0 !important;
|
|
18
21
|
overflow: hidden !important;
|
|
@@ -100,7 +103,7 @@
|
|
|
100
103
|
.ui-rc-table-wrapper .ui-rc-table-thead > tr > th,
|
|
101
104
|
.ui-rc-table-wrapper .ui-rc-table-thead > tr > td {
|
|
102
105
|
border-bottom: 1px solid #e0e0e0;
|
|
103
|
-
|
|
106
|
+
font-weight: 500;
|
|
104
107
|
}
|
|
105
108
|
.ui-rc-table-wrapper .ui-rc-table-summary .ui-rc-table-cell {
|
|
106
109
|
background-color: #fafafa;
|
|
@@ -191,12 +194,21 @@
|
|
|
191
194
|
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.cell-editable.cell-border-bottom {
|
|
192
195
|
border-bottom: 1px solid #0550C5;
|
|
193
196
|
}
|
|
197
|
+
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.cell-editable.cell-paste-border-bottom {
|
|
198
|
+
border-bottom: 1px dashed #949494;
|
|
199
|
+
}
|
|
194
200
|
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.cell-editable.cell-border-left {
|
|
195
201
|
border-inline-end: 1px solid #0550C5;
|
|
196
202
|
}
|
|
203
|
+
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.cell-editable.cell-paste-border-left {
|
|
204
|
+
border-inline-end: 1px dashed #949494;
|
|
205
|
+
}
|
|
197
206
|
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.cell-editable.cell-border-right {
|
|
198
207
|
border-inline-end: 1px solid #0550C5;
|
|
199
208
|
}
|
|
209
|
+
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.cell-editable.cell-paste-border-right {
|
|
210
|
+
border-inline-end: 1px dashed #949494;
|
|
211
|
+
}
|
|
200
212
|
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.cell-editable.ui-rc-table-cell-fix-right.cell-border-end {
|
|
201
213
|
z-index: 3;
|
|
202
214
|
}
|
|
@@ -209,9 +221,15 @@
|
|
|
209
221
|
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.cell-editable.ui-rc-table-cell-fix-right-first.next-cell-border-left::before {
|
|
210
222
|
border-inline-start: 1px solid #0550C5;
|
|
211
223
|
}
|
|
224
|
+
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.cell-editable.ui-rc-table-cell-fix-right-first.next-cell-paste-border-left::before {
|
|
225
|
+
border-inline-start: 1px dashed #949494;
|
|
226
|
+
}
|
|
212
227
|
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.cell-editable.ui-rc-table-cell-fix-right-first.fixed-cell-border-left::before {
|
|
213
228
|
border-inline-start: 1px solid #0550C5;
|
|
214
229
|
}
|
|
230
|
+
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.cell-editable.ui-rc-table-cell-fix-right-first.fixed-cell-paste-border-left::before {
|
|
231
|
+
border-inline-start: 1px dashed #949494;
|
|
232
|
+
}
|
|
215
233
|
.ui-rc-table-wrapper.grid-editable .ui-rc-table .ui-rc-table-tbody .rc-ui-cell-editable.cell-editable.ui-rc-table-cell-fix-left-last.cell-border-end {
|
|
216
234
|
z-index: 3;
|
|
217
235
|
}
|
|
@@ -233,10 +251,12 @@
|
|
|
233
251
|
.ui-rc-table-wrapper.grid-editable .ui-rc-table.ui-rc-table-ping-right .ui-rc-table-tbody .rc-ui-cell-editable.cell-border-end {
|
|
234
252
|
z-index: 1;
|
|
235
253
|
}
|
|
254
|
+
.ui-rc-table-wrapper.grid-editable .ui-rc-table.ui-rc-table-small .ui-rc-table-selection-column {
|
|
255
|
+
padding: 6px 8px;
|
|
256
|
+
}
|
|
236
257
|
.ui-rc-table-wrapper.grid-editable .ui-rc_cell-content {
|
|
237
258
|
user-select: none;
|
|
238
|
-
padding:
|
|
239
|
-
min-height: 23px;
|
|
259
|
+
padding: 7px 8px;
|
|
240
260
|
overflow: hidden;
|
|
241
261
|
}
|
|
242
262
|
.ui-rc-table-wrapper.grid-editable .ui-rc_cell-content .ui-rc_content {
|
|
@@ -469,9 +489,6 @@
|
|
|
469
489
|
white-space: nowrap;
|
|
470
490
|
overflow: hidden;
|
|
471
491
|
}
|
|
472
|
-
.ui-rc-table-wrapper.grid-editable .ui-rc-table-tbody .ui-rc-table-cell.cell-editing {
|
|
473
|
-
padding: 0 !important;
|
|
474
|
-
}
|
|
475
492
|
.ui-rc-table-wrapper.grid-editable .ui-rc-table-tbody .ui-rc-table-cell.cell-editing:focus-visible {
|
|
476
493
|
outline: none;
|
|
477
494
|
}
|
|
@@ -639,17 +656,6 @@
|
|
|
639
656
|
color: #eb4619;
|
|
640
657
|
}
|
|
641
658
|
|
|
642
|
-
.ui-rc-table-wrapper .ui-rc-table.ui-rc-table-small .ui-rc-table-title,
|
|
643
|
-
.ui-rc-table-wrapper .ui-rc-table.ui-rc-table-small .ui-rc-table-footer,
|
|
644
|
-
.ui-rc-table-wrapper .ui-rc-table.ui-rc-table-small .ui-rc-table-cell,
|
|
645
|
-
.ui-rc-table-wrapper .ui-rc-table.ui-rc-table-small .ui-rc-table-thead > tr > th,
|
|
646
|
-
.ui-rc-table-wrapper .ui-rc-table.ui-rc-table-small .ui-rc-table-tbody > tr > th,
|
|
647
|
-
.ui-rc-table-wrapper .ui-rc-table.ui-rc-table-small .ui-rc-table-tbody > tr > td,
|
|
648
|
-
.ui-rc-table-wrapper .ui-rc-table.ui-rc-table-small tfoot > tr > th,
|
|
649
|
-
.ui-rc-table-wrapper .ui-rc-table.ui-rc-table-small tfoot > tr > td {
|
|
650
|
-
font-size: 13px;
|
|
651
|
-
}
|
|
652
|
-
|
|
653
659
|
.ui-rc-table-wrapper .ui-rc-table.ui-rc-table-small .ui-rc-table-cell:has(.ant-color-picker-trigger) {
|
|
654
660
|
padding: 1px 8px;
|
|
655
661
|
}
|
|
@@ -676,4 +682,14 @@
|
|
|
676
682
|
border-inline-end: 1px solid #e0e0e0;
|
|
677
683
|
}
|
|
678
684
|
|
|
685
|
+
.ui-rc-toolbar-bottom .be-toolbar-item .toolbar-dropdown-button .ant-btn.ant-btn-default.ant-btn-variant-outlined.ant-btn-compact-item.ant-btn-compact-first-item {
|
|
686
|
+
border-color: #28c76f;
|
|
687
|
+
}
|
|
688
|
+
.ui-rc-toolbar-bottom .be-toolbar-item .toolbar-dropdown-button .ant-btn.ant-btn-default.ant-btn-variant-outlined.ant-btn-compact-item.ant-btn-compact-last-item {
|
|
689
|
+
border-color: #28c76f;
|
|
690
|
+
}
|
|
691
|
+
.ui-rc-toolbar-bottom .be-toolbar-item .toolbar-dropdown-button .ant-btn.ant-btn-default.ant-btn-variant-outlined.ant-btn-compact-item.ant-btn-compact-last-item .ant-btn-icon {
|
|
692
|
+
color: #28c76f;
|
|
693
|
+
}
|
|
694
|
+
|
|
679
695
|
/*# sourceMappingURL=index.css.map */
|
package/assets/index.scss
CHANGED
|
@@ -36,6 +36,13 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
36
36
|
margin: 0;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
.ui-rc-table {
|
|
40
|
+
//font-family: $fontFamily;
|
|
41
|
+
color: #000000de;
|
|
42
|
+
//font-weight: 500;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
39
46
|
|
|
40
47
|
&.table-none-column-select {
|
|
41
48
|
.#{$prefix}-table-cell {
|
|
@@ -178,12 +185,14 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
178
185
|
}
|
|
179
186
|
|
|
180
187
|
.#{$prefix}-table-thead {
|
|
188
|
+
//font-weight: 400;
|
|
181
189
|
|
|
182
190
|
> tr {
|
|
183
191
|
> th,
|
|
184
192
|
> td {
|
|
185
193
|
border-bottom: 1px solid $tableBorderColor;
|
|
186
|
-
background: #fff;
|
|
194
|
+
//background: #fff;
|
|
195
|
+
font-weight: 500;
|
|
187
196
|
}
|
|
188
197
|
}
|
|
189
198
|
|
|
@@ -326,6 +335,7 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
326
335
|
overflow: unset;
|
|
327
336
|
|
|
328
337
|
display: flex;
|
|
338
|
+
//--------
|
|
329
339
|
padding: 0;
|
|
330
340
|
|
|
331
341
|
.#{$prefix}-table-row-expand-icon {
|
|
@@ -342,14 +352,26 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
342
352
|
border-bottom: 1px solid $border-selected-color;
|
|
343
353
|
}
|
|
344
354
|
|
|
355
|
+
&.cell-paste-border-bottom {
|
|
356
|
+
border-bottom: 1px dashed #949494;
|
|
357
|
+
}
|
|
358
|
+
|
|
345
359
|
&.cell-border-left {
|
|
346
360
|
border-inline-end: 1px solid $border-selected-color;
|
|
347
361
|
}
|
|
348
362
|
|
|
363
|
+
&.cell-paste-border-left {
|
|
364
|
+
border-inline-end: 1px dashed #949494;
|
|
365
|
+
}
|
|
366
|
+
|
|
349
367
|
&.cell-border-right {
|
|
350
368
|
border-inline-end: 1px solid $border-selected-color;
|
|
351
369
|
}
|
|
352
370
|
|
|
371
|
+
&.cell-paste-border-right {
|
|
372
|
+
border-inline-end: 1px dashed #949494;
|
|
373
|
+
}
|
|
374
|
+
|
|
353
375
|
&.#{$prefix}-table-cell-fix-left {
|
|
354
376
|
&:has(.ui-rc_cell-content.selected) {
|
|
355
377
|
}
|
|
@@ -383,11 +405,23 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
383
405
|
}
|
|
384
406
|
}
|
|
385
407
|
|
|
408
|
+
|
|
409
|
+
&.next-cell-paste-border-left {
|
|
410
|
+
&::before {
|
|
411
|
+
border-inline-start: 1px dashed #949494;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
386
415
|
&.fixed-cell-border-left {
|
|
387
416
|
&::before {
|
|
388
417
|
border-inline-start: 1px solid $border-selected-color;
|
|
389
418
|
}
|
|
390
419
|
}
|
|
420
|
+
&.fixed-cell-paste-border-left {
|
|
421
|
+
&::before {
|
|
422
|
+
border-inline-start: 1px dashed #949494;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
391
425
|
|
|
392
426
|
}
|
|
393
427
|
|
|
@@ -493,14 +527,16 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
493
527
|
.#{$prefix}-table.#{$prefix}-table-small {
|
|
494
528
|
.#{$prefix}-table-selection-column{
|
|
495
529
|
//padding: 8px 8px;
|
|
530
|
+
padding: 6px 8px;
|
|
496
531
|
}
|
|
497
532
|
}
|
|
498
533
|
|
|
499
534
|
.ui-rc_cell-content {
|
|
500
535
|
//position: relative;
|
|
501
536
|
user-select: none;
|
|
502
|
-
padding: 8px 8px;
|
|
503
|
-
|
|
537
|
+
//padding: 8px 8px;
|
|
538
|
+
padding: 7px 8px;
|
|
539
|
+
//min-height: 23px;
|
|
504
540
|
overflow: hidden;
|
|
505
541
|
|
|
506
542
|
.ui-rc_content {
|
|
@@ -520,6 +556,7 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
520
556
|
cursor: crosshair;
|
|
521
557
|
right: 0;
|
|
522
558
|
bottom: 0;
|
|
559
|
+
//background: red;
|
|
523
560
|
|
|
524
561
|
.dot-point {
|
|
525
562
|
position: absolute;
|
|
@@ -627,7 +664,7 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
627
664
|
}
|
|
628
665
|
|
|
629
666
|
&.cell-editing {
|
|
630
|
-
padding: 0 !important;
|
|
667
|
+
//padding: 0 !important;
|
|
631
668
|
&:focus-visible {
|
|
632
669
|
outline: none;
|
|
633
670
|
}
|
|
@@ -965,7 +1002,7 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
965
1002
|
tfoot > tr > th,
|
|
966
1003
|
tfoot > tr > td {
|
|
967
1004
|
//padding: 8px 8px;
|
|
968
|
-
font-size: 13px;
|
|
1005
|
+
//font-size: 13px;
|
|
969
1006
|
}
|
|
970
1007
|
}
|
|
971
1008
|
}
|
|
@@ -1004,3 +1041,23 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
1004
1041
|
.#{$prefix}-table-wrapper .#{$prefix}-table.#{$prefix}-table-bordered >.#{$prefix}-table-container >.#{$prefix}-table-summary >table >tfoot>tr >.#{$prefix}-table-cell-fix-right-first::after {
|
|
1005
1042
|
border-inline-end: 1px solid $tableBorderColor;
|
|
1006
1043
|
}
|
|
1044
|
+
|
|
1045
|
+
|
|
1046
|
+
// toolbar
|
|
1047
|
+
|
|
1048
|
+
.ui-rc-toolbar-bottom {
|
|
1049
|
+
.be-toolbar-item {
|
|
1050
|
+
.toolbar-dropdown-button {
|
|
1051
|
+
.ant-btn.ant-btn-default.ant-btn-variant-outlined.ant-btn-compact-item.ant-btn-compact-first-item {
|
|
1052
|
+
border-color: #28c76f;
|
|
1053
|
+
}
|
|
1054
|
+
.ant-btn.ant-btn-default.ant-btn-variant-outlined.ant-btn-compact-item.ant-btn-compact-last-item {
|
|
1055
|
+
border-color: #28c76f;
|
|
1056
|
+
.ant-btn-icon {
|
|
1057
|
+
color: #28c76f;
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
@@ -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;&::before{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;left:0;z-index:-1;}&::after{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;visibility:visible;right:0;z-index:-1;}.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;.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;z-index:-1;}&::after{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:50px;bottom:0;visibility:visible;right:0;z-index:-1;}&.pagination-template{position:relative;&::before{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;left:0;z-index:-1;}&::after{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;visibility:visible;right:0;z-index:-1;}}}.react-resizable{position:relative;background-clip:padding-box;}.
|
|
5
|
+
})([".ui-rc-table-container{min-height:", ";}.ui-rc-toolbar-bottom{position:relative;padding:.25rem 1rem;&::before{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;left:0;z-index:-1;}&::after{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;visibility:visible;right:0;z-index:-1;}.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;.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;z-index:-1;}&::after{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:50px;bottom:0;visibility:visible;right:0;z-index:-1;}&.pagination-template{position:relative;&::before{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;left:0;z-index:-1;}&::after{content:\"\";position:absolute;border-left:1px solid #e0e0e0;height:100%;bottom:0;visibility:visible;right:0;z-index:-1;}}}.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);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Resizable } from "react-resizable";
|
|
4
|
+
import 'react-resizable/css/styles.css';
|
|
4
5
|
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
5
6
|
import { addRowIdArray,
|
|
6
7
|
// convertFlatColumn,
|
|
@@ -39,7 +40,7 @@ const ResizableTitle = props => {
|
|
|
39
40
|
width: width,
|
|
40
41
|
height: 0,
|
|
41
42
|
handle: /*#__PURE__*/React.createElement("span", {
|
|
42
|
-
className: "
|
|
43
|
+
className: "rc-resizable-handle",
|
|
43
44
|
onClick: e => {
|
|
44
45
|
e.stopPropagation();
|
|
45
46
|
}
|
|
@@ -14,7 +14,7 @@ isEmpty,
|
|
|
14
14
|
sumDataByField
|
|
15
15
|
// updateArrayByKey
|
|
16
16
|
} from "./hooks";
|
|
17
|
-
import {
|
|
17
|
+
// import {ConfigProvider} from "antd";
|
|
18
18
|
import { flatColumns } from "./hooks/columns";
|
|
19
19
|
import Pagination from "rc-master-ui/es/pagination";
|
|
20
20
|
import ComponentSpinner from "./LoadingSpinner";
|
|
@@ -291,17 +291,7 @@ const TableGrid = props => {
|
|
|
291
291
|
const handleChange = sorter => {
|
|
292
292
|
onSorter?.(sorter);
|
|
293
293
|
};
|
|
294
|
-
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(
|
|
295
|
-
theme: {
|
|
296
|
-
components: {
|
|
297
|
-
Table: {
|
|
298
|
-
rowHoverBg: '#eb461912',
|
|
299
|
-
rowSelectedBg: '#eb4619',
|
|
300
|
-
rowSelectedHoverBg: '#eb4619'
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
}, /*#__PURE__*/React.createElement(ContextMenu, {
|
|
294
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(ContextMenu, {
|
|
305
295
|
open: menuVisible,
|
|
306
296
|
pos: position,
|
|
307
297
|
setOpen: setMenuVisible,
|
|
@@ -452,6 +442,6 @@ const TableGrid = props => {
|
|
|
452
442
|
// @ts-ignore
|
|
453
443
|
,
|
|
454
444
|
showTotal: (total, range) => `${range[0]}-${range[1]} / ${total} ${t ? t(pagination?.locale?.items ?? 'items') : 'items'}`
|
|
455
|
-
}, pagination)), bottomToolbar?.())
|
|
445
|
+
}, pagination)), bottomToolbar?.());
|
|
456
446
|
};
|
|
457
447
|
export default TableGrid;
|
|
@@ -18,15 +18,14 @@ const HeaderContent = props => {
|
|
|
18
18
|
headerTooltip,
|
|
19
19
|
headerText,
|
|
20
20
|
columnGroupText,
|
|
21
|
-
headerTemplate
|
|
22
|
-
title
|
|
21
|
+
headerTemplate
|
|
23
22
|
} = props.column ?? {};
|
|
24
23
|
const text = React.useMemo(() => {
|
|
25
|
-
return columnGroupText ?? headerText
|
|
26
|
-
}, [columnGroupText, headerText
|
|
24
|
+
return columnGroupText ?? headerText;
|
|
25
|
+
}, [columnGroupText, headerText]);
|
|
27
26
|
const tooltip = React.useMemo(() => {
|
|
28
|
-
return headerTooltip ?? columnGroupText ?? headerText
|
|
29
|
-
}, [columnGroupText, headerText, headerTooltip
|
|
27
|
+
return headerTooltip ?? columnGroupText ?? headerText;
|
|
28
|
+
}, [columnGroupText, headerText, headerTooltip]);
|
|
30
29
|
const [isOpen, setIsOpen] = useState(false);
|
|
31
30
|
const {
|
|
32
31
|
refs,
|
|
@@ -66,7 +65,7 @@ const HeaderContent = props => {
|
|
|
66
65
|
// style={{flex: 1}}
|
|
67
66
|
,
|
|
68
67
|
className: classnames('', {})
|
|
69
|
-
}), headerTemplate ? getTemplate(headerTemplate) :
|
|
68
|
+
}), headerTemplate ? getTemplate(headerTemplate) : text), isOpen && (headerTooltip !== false || headerTemplate || headerTooltip || columnGroupText || headerText) && /*#__PURE__*/React.createElement(FloatingPortal, {
|
|
70
69
|
root: document.body
|
|
71
70
|
}, /*#__PURE__*/React.createElement(TooltipStyle, _extends({
|
|
72
71
|
className: "Tooltip",
|
|
@@ -156,7 +156,9 @@ const useColumns = config => {
|
|
|
156
156
|
// title: t ? t(col.columnGroupText ?? col.headerText ?? col.title) : col.columnGroupText ?? col.headerText ?? col.title,
|
|
157
157
|
// title: () => (<span>aaa</span>),
|
|
158
158
|
title: () => /*#__PURE__*/React.createElement(HeaderContent, {
|
|
159
|
-
column:
|
|
159
|
+
column: {
|
|
160
|
+
...col
|
|
161
|
+
},
|
|
160
162
|
t: t
|
|
161
163
|
}),
|
|
162
164
|
// title: () => (<span>{t ? t(col.columnGroupText ?? col.headerText ?? col.title) : col.columnGroupText ?? col.headerText ?? col.title}</span>),
|
|
@@ -181,7 +183,13 @@ const useColumns = config => {
|
|
|
181
183
|
}
|
|
182
184
|
if (col.key === 'command') {
|
|
183
185
|
return {
|
|
184
|
-
...transformedColumn
|
|
186
|
+
...transformedColumn,
|
|
187
|
+
onCell: () => ({
|
|
188
|
+
className: 'cell-number',
|
|
189
|
+
style: {
|
|
190
|
+
padding: '2px 8px'
|
|
191
|
+
}
|
|
192
|
+
})
|
|
185
193
|
};
|
|
186
194
|
}
|
|
187
195
|
return {
|
|
@@ -5,7 +5,7 @@ import type { ColumnEditType, ColumnsType, ColumnTable, GetRowKey } from "../typ
|
|
|
5
5
|
import type { SelectionSettings } from "../type";
|
|
6
6
|
import type { AnyObject } from "../type";
|
|
7
7
|
import type { Key } from "react";
|
|
8
|
-
import type { ColumnsTable } from "
|
|
8
|
+
import type { ColumnsTable } from "./../index";
|
|
9
9
|
export declare const newGuid: () => any;
|
|
10
10
|
export declare const sumDataByField: (data: any[], field: string) => any;
|
|
11
11
|
export declare const checkThousandSeparator: (thousandSeparator: string | undefined, decimalSeparator: string | undefined) => string;
|
|
@@ -55,26 +55,6 @@ export declare const getFirstSelectCell: (selectCells: any) => {
|
|
|
55
55
|
col: number;
|
|
56
56
|
};
|
|
57
57
|
export declare const getRowsPasteIndex: (pasteRows: any) => number[];
|
|
58
|
-
export declare const mmm: (string | number | boolean)[][];
|
|
59
|
-
export declare function cloneRows(array: any[], numRows: number): any[];
|
|
60
|
-
export declare function addRows1(arr: any[], n: number): any[];
|
|
61
|
-
export declare function addRows2(arr: any[], n: number): {
|
|
62
|
-
newArr: any[];
|
|
63
|
-
addedRows: any[];
|
|
64
|
-
};
|
|
65
|
-
export declare function addRows(arr: any[], n: number): {
|
|
66
|
-
newArr: any[];
|
|
67
|
-
addedRows: any[];
|
|
68
|
-
};
|
|
69
|
-
export declare function addRows4(arr: any[], n: number): {
|
|
70
|
-
newArr: any[];
|
|
71
|
-
addedRows: any[];
|
|
72
|
-
};
|
|
73
|
-
export declare function addRows6(arr: any, n: number): {
|
|
74
|
-
newArr: any[];
|
|
75
|
-
addedRows: any[];
|
|
76
|
-
};
|
|
77
|
-
export declare function addRows7(arr: any, n: number): any;
|
|
78
58
|
export declare function addRows8(arr: any, n: number): {
|
|
79
59
|
combined: any;
|
|
80
60
|
addedRows: any[];
|
|
@@ -84,5 +64,5 @@ export declare function addRows8(arr: any, n: number): {
|
|
|
84
64
|
};
|
|
85
65
|
export declare const transformColumns: <RecordType>(cols: ColumnsTable<RecordType>, convertColumns: any[], t?: any) => ColumnsTable<RecordType>;
|
|
86
66
|
export declare const transformColumns1: <RecordType>(cols: ColumnsTable<RecordType>, sortMultiple?: boolean) => ColumnsTable<RecordType>;
|
|
87
|
-
export declare const removeColumns: <RecordType>(columns: ColumnsTable
|
|
67
|
+
export declare const removeColumns: <RecordType>(columns: ColumnsTable<RecordType>, groupColumns: string[]) => ColumnsTable<RecordType>;
|
|
88
68
|
export declare const convertFlatColumn: (array: ColumnsTable) => ColumnsTable[];
|