sag_components 2.0.0-beta334 → 2.0.0-beta336
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/dist/index.esm.js +318 -17
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +318 -17
- package/dist/index.js.map +1 -1
- package/dist/types/components/Table/Table.stories.d.ts +198 -142
- package/dist/types/components/Table/Table.style.d.ts +1 -0
- package/dist/types/components/Table/TableBody.styles.d.ts +3 -0
- package/dist/types/components/Table/TableHeader.d.ts +2 -1
- package/dist/types/components/Table/data.d.ts +9 -0
- package/dist/types/icons/CalendarIcon.d.ts +3 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -634,6 +634,26 @@ const ChervronLeftIcon = _ref => {
|
|
|
634
634
|
}));
|
|
635
635
|
};
|
|
636
636
|
|
|
637
|
+
const CalendarIcon = _ref => {
|
|
638
|
+
let {
|
|
639
|
+
clicked,
|
|
640
|
+
width = "14",
|
|
641
|
+
height = "14",
|
|
642
|
+
fill = "#212121",
|
|
643
|
+
color
|
|
644
|
+
} = _ref;
|
|
645
|
+
return /*#__PURE__*/React$1.createElement("svg", {
|
|
646
|
+
width: width,
|
|
647
|
+
height: height,
|
|
648
|
+
viewBox: "0 0 11 12",
|
|
649
|
+
fill: "none",
|
|
650
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
651
|
+
}, /*#__PURE__*/React$1.createElement("path", {
|
|
652
|
+
d: "M2.625 0C2.8125 0 3 0.1875 3 0.375V1.5H7.5V0.375C7.5 0.1875 7.66406 0 7.875 0C8.0625 0 8.25 0.1875 8.25 0.375V1.5H9C9.82031 1.5 10.5 2.17969 10.5 3V3.75V4.5V10.5C10.5 11.3438 9.82031 12 9 12H1.5C0.65625 12 0 11.3438 0 10.5V4.5V3.75V3C0 2.17969 0.65625 1.5 1.5 1.5H2.25V0.375C2.25 0.1875 2.41406 0 2.625 0ZM9.75 4.5H7.3125V6.1875H9.75V4.5ZM9.75 6.9375H7.3125V8.8125H9.75V6.9375ZM9.75 9.5625H7.3125V11.25H9C9.39844 11.25 9.75 10.9219 9.75 10.5V9.5625ZM6.5625 8.8125V6.9375H3.9375V8.8125H6.5625ZM3.9375 9.5625V11.25H6.5625V9.5625H3.9375ZM3.1875 8.8125V6.9375H0.75V8.8125H3.1875ZM0.75 9.5625V10.5C0.75 10.9219 1.07812 11.25 1.5 11.25H3.1875V9.5625H0.75ZM0.75 6.1875H3.1875V4.5H0.75V6.1875ZM3.9375 6.1875H6.5625V4.5H3.9375V6.1875ZM9 2.25H1.5C1.07812 2.25 0.75 2.60156 0.75 3V3.75H9.75V3C9.75 2.60156 9.39844 2.25 9 2.25Z",
|
|
653
|
+
fill: color || fill
|
|
654
|
+
}));
|
|
655
|
+
};
|
|
656
|
+
|
|
637
657
|
const Button$1 = props => {
|
|
638
658
|
const {
|
|
639
659
|
text = "",
|
|
@@ -680,14 +700,15 @@ const Button$1 = props => {
|
|
|
680
700
|
plus: Plus,
|
|
681
701
|
left: ChervronLeftIcon,
|
|
682
702
|
right: ChervronRightIcon,
|
|
683
|
-
vicon: VIcon
|
|
703
|
+
vicon: VIcon,
|
|
704
|
+
calendar: CalendarIcon
|
|
684
705
|
};
|
|
685
706
|
const getIcon = icon => {
|
|
686
707
|
if (!icon || icon === "none") return null;
|
|
687
708
|
const IconComponent = iconMap[icon.toLowerCase()];
|
|
688
709
|
const iconProps = {
|
|
689
|
-
height: "16px",
|
|
690
|
-
width: "16px",
|
|
710
|
+
height: icon.toLowerCase() === "calendar" ? "14" : "16px",
|
|
711
|
+
width: icon.toLowerCase() === "calendar" ? "14" : "16px",
|
|
691
712
|
color: disabled ? disabledTextColor || "#B1B1B1" : hover ? hoverTextColor || (type === "secondary" ? "#229E38" : "#ffffff") : textColor || (type === "secondary" ? "#212121" : "#ffffff"),
|
|
692
713
|
fill: disabled ? disabledTextColor || "#B1B1B1" : hover ? hoverTextColor || (type === "secondary" ? "#229E38" : "#ffffff") : textColor || (type === "secondary" ? "#212121" : "#ffffff")
|
|
693
714
|
};
|
|
@@ -37359,6 +37380,16 @@ const Loader = styled.span`
|
|
|
37359
37380
|
animation: ${rotation} 1.5s infinite ease;
|
|
37360
37381
|
transform: translateZ(0);
|
|
37361
37382
|
`;
|
|
37383
|
+
const DirtyFieldsCounter = styled.div`
|
|
37384
|
+
font-family: 'Poppins', sans-serif;
|
|
37385
|
+
font-size: 14px;
|
|
37386
|
+
font-weight: 500;
|
|
37387
|
+
color: ${({
|
|
37388
|
+
$dirty
|
|
37389
|
+
}) => $dirty ? '#EF4444' : '#1f7677'};
|
|
37390
|
+
padding: 6px 16px;
|
|
37391
|
+
text-align: left;
|
|
37392
|
+
`;
|
|
37362
37393
|
const LoaderWrapper = styled.div`
|
|
37363
37394
|
position: absolute;
|
|
37364
37395
|
top: 50%;
|
|
@@ -41121,6 +41152,7 @@ const TableHeader = ({
|
|
|
41121
41152
|
activeFilters = [],
|
|
41122
41153
|
activeSorts = [],
|
|
41123
41154
|
expandable = false,
|
|
41155
|
+
expandPosition = "left",
|
|
41124
41156
|
onHeaderCheckboxClick = () => {},
|
|
41125
41157
|
headerCheckboxStates = {},
|
|
41126
41158
|
resetFiltersKey = 0,
|
|
@@ -41668,7 +41700,7 @@ const TableHeader = ({
|
|
|
41668
41700
|
onReset: () => handleSortReset(key)
|
|
41669
41701
|
});
|
|
41670
41702
|
};
|
|
41671
|
-
return /*#__PURE__*/React$1.createElement(StyledTableHeader, null, /*#__PURE__*/React$1.createElement("tr", null, expandable && /*#__PURE__*/React$1.createElement(HeaderCell, {
|
|
41703
|
+
return /*#__PURE__*/React$1.createElement(StyledTableHeader, null, /*#__PURE__*/React$1.createElement("tr", null, expandable && expandPosition !== "right" && /*#__PURE__*/React$1.createElement(HeaderCell, {
|
|
41672
41704
|
$fieldType: "expand",
|
|
41673
41705
|
$minWidth: "16px",
|
|
41674
41706
|
$maxWidth: "16px"
|
|
@@ -41689,7 +41721,12 @@ const TableHeader = ({
|
|
|
41689
41721
|
style: {
|
|
41690
41722
|
accentColor: '#066768'
|
|
41691
41723
|
}
|
|
41692
|
-
}), column.title && /*#__PURE__*/React$1.createElement(ColumnLabel, null, column.title
|
|
41724
|
+
}), column.title && /*#__PURE__*/React$1.createElement(ColumnLabel, null, column.title, column.required && /*#__PURE__*/React$1.createElement("span", {
|
|
41725
|
+
style: {
|
|
41726
|
+
color: '#EF4444',
|
|
41727
|
+
marginLeft: '5px'
|
|
41728
|
+
}
|
|
41729
|
+
}, "*")), (column.filter || column.sort) && /*#__PURE__*/React$1.createElement(ColumnActions, null, column.sort && /*#__PURE__*/React$1.createElement(IconButton, {
|
|
41693
41730
|
ref: el => iconRefs.current[`sort-${column.key}`] = el,
|
|
41694
41731
|
onClick: () => handleSort(column.key),
|
|
41695
41732
|
onMouseEnter: () => setFocusedSort(column.key),
|
|
@@ -41714,7 +41751,11 @@ const TableHeader = ({
|
|
|
41714
41751
|
}, /*#__PURE__*/React$1.createElement(FilterIcon, {
|
|
41715
41752
|
state: getFilterIconState(column.key),
|
|
41716
41753
|
isActive: shouldShowActiveIcon(column.key)
|
|
41717
|
-
}))))))
|
|
41754
|
+
})))))), expandable && expandPosition === "right" && /*#__PURE__*/React$1.createElement(HeaderCell, {
|
|
41755
|
+
$fieldType: "expand",
|
|
41756
|
+
$minWidth: "16px",
|
|
41757
|
+
$maxWidth: "16px"
|
|
41758
|
+
}, /*#__PURE__*/React$1.createElement(ColumnContent, null, /*#__PURE__*/React$1.createElement(ColumnLabel, null)))), visibleSortPopWrapper && /*#__PURE__*/createPortal(/*#__PURE__*/React$1.createElement(PopWrapper, {
|
|
41718
41759
|
ref: popupRef,
|
|
41719
41760
|
className: "pop-wrapper",
|
|
41720
41761
|
top: popPosition.top,
|
|
@@ -41904,6 +41945,10 @@ const TableCell = styled.td`
|
|
|
41904
41945
|
position: relative;
|
|
41905
41946
|
`}
|
|
41906
41947
|
|
|
41948
|
+
${props => props.$editable && `
|
|
41949
|
+
overflow: visible;
|
|
41950
|
+
`}
|
|
41951
|
+
|
|
41907
41952
|
/* CSS-only tooltip */
|
|
41908
41953
|
&[data-tooltip]:hover::before {
|
|
41909
41954
|
content: attr(data-tooltip);
|
|
@@ -41957,6 +42002,31 @@ const TableCell = styled.td`
|
|
|
41957
42002
|
}
|
|
41958
42003
|
}
|
|
41959
42004
|
|
|
42005
|
+
input {
|
|
42006
|
+
display: block;
|
|
42007
|
+
}
|
|
42008
|
+
|
|
42009
|
+
input[type="number"]::-webkit-inner-spin-button,
|
|
42010
|
+
input[type="number"]::-webkit-outer-spin-button {
|
|
42011
|
+
-webkit-appearance: none;
|
|
42012
|
+
margin: 0;
|
|
42013
|
+
}
|
|
42014
|
+
|
|
42015
|
+
input[type="number"] {
|
|
42016
|
+
-moz-appearance: textfield;
|
|
42017
|
+
}
|
|
42018
|
+
|
|
42019
|
+
input:hover:not(:focus) {
|
|
42020
|
+
border: 1px solid rgba(0, 0, 0, 0.6) !important;
|
|
42021
|
+
border-radius: 4px;
|
|
42022
|
+
}
|
|
42023
|
+
|
|
42024
|
+
input:focus {
|
|
42025
|
+
border: 2px solid #212121 !important;
|
|
42026
|
+
border-radius: 4px;
|
|
42027
|
+
outline: none !important;
|
|
42028
|
+
}
|
|
42029
|
+
|
|
41960
42030
|
${props => {
|
|
41961
42031
|
switch (props.$fieldType) {
|
|
41962
42032
|
case "currency":
|
|
@@ -42527,6 +42597,137 @@ const PencilButton = styled.button`
|
|
|
42527
42597
|
pointer-events: none;
|
|
42528
42598
|
}
|
|
42529
42599
|
`;
|
|
42600
|
+
const NotAvailableIconButton = styled.button`
|
|
42601
|
+
position: absolute;
|
|
42602
|
+
right: 4px;
|
|
42603
|
+
top: 0;
|
|
42604
|
+
bottom: 0;
|
|
42605
|
+
margin-top: auto;
|
|
42606
|
+
margin-bottom: auto;
|
|
42607
|
+
height: fit-content;
|
|
42608
|
+
background: transparent;
|
|
42609
|
+
border: none;
|
|
42610
|
+
cursor: pointer;
|
|
42611
|
+
padding: 2px;
|
|
42612
|
+
display: flex;
|
|
42613
|
+
align-items: center;
|
|
42614
|
+
justify-content: center;
|
|
42615
|
+
color: #8B8989;
|
|
42616
|
+
opacity: 0;
|
|
42617
|
+
transition: opacity 0.15s ease, color 0.15s ease;
|
|
42618
|
+
|
|
42619
|
+
&:hover {
|
|
42620
|
+
color: #EF4444;
|
|
42621
|
+
}
|
|
42622
|
+
|
|
42623
|
+
&::before {
|
|
42624
|
+
content: 'Mark as N/A';
|
|
42625
|
+
position: absolute;
|
|
42626
|
+
bottom: calc(100% + 12px);
|
|
42627
|
+
left: 50%;
|
|
42628
|
+
transform: translateX(-50%);
|
|
42629
|
+
background: white;
|
|
42630
|
+
color: #212121;
|
|
42631
|
+
padding: 4px 8px;
|
|
42632
|
+
border-radius: 4px;
|
|
42633
|
+
font-size: 12px;
|
|
42634
|
+
font-family: 'Poppins', sans-serif;
|
|
42635
|
+
font-weight: 400;
|
|
42636
|
+
white-space: nowrap;
|
|
42637
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
42638
|
+
opacity: 0;
|
|
42639
|
+
pointer-events: none;
|
|
42640
|
+
transition: opacity 0.15s ease;
|
|
42641
|
+
z-index: 1000;
|
|
42642
|
+
}
|
|
42643
|
+
|
|
42644
|
+
&::after {
|
|
42645
|
+
content: '';
|
|
42646
|
+
position: absolute;
|
|
42647
|
+
bottom: calc(100% + 7px);
|
|
42648
|
+
left: 50%;
|
|
42649
|
+
width: 10px;
|
|
42650
|
+
height: 10px;
|
|
42651
|
+
background: white;
|
|
42652
|
+
transform: translateX(-50%) rotate(45deg);
|
|
42653
|
+
opacity: 0;
|
|
42654
|
+
pointer-events: none;
|
|
42655
|
+
transition: opacity 0.15s ease;
|
|
42656
|
+
z-index: 1001;
|
|
42657
|
+
}
|
|
42658
|
+
|
|
42659
|
+
&:hover::before,
|
|
42660
|
+
&:hover::after {
|
|
42661
|
+
opacity: 1;
|
|
42662
|
+
}
|
|
42663
|
+
`;
|
|
42664
|
+
const NotAvailableCellWrapper = styled.div`
|
|
42665
|
+
position: relative;
|
|
42666
|
+
display: flex;
|
|
42667
|
+
align-items: center;
|
|
42668
|
+
width: 100%;
|
|
42669
|
+
|
|
42670
|
+
&:hover ${NotAvailableIconButton} {
|
|
42671
|
+
opacity: 1;
|
|
42672
|
+
}
|
|
42673
|
+
`;
|
|
42674
|
+
const NotAvailableText = styled.div`
|
|
42675
|
+
position: relative;
|
|
42676
|
+
width: 100%;
|
|
42677
|
+
color: #8B8989;
|
|
42678
|
+
font-family: inherit;
|
|
42679
|
+
font-size: inherit;
|
|
42680
|
+
line-height: normal;
|
|
42681
|
+
cursor: pointer;
|
|
42682
|
+
padding: 1px 2px;
|
|
42683
|
+
border: 1px solid transparent;
|
|
42684
|
+
border-radius: 4px;
|
|
42685
|
+
|
|
42686
|
+
&:hover {
|
|
42687
|
+
border-color: rgba(0, 0, 0, 0.6);
|
|
42688
|
+
}
|
|
42689
|
+
|
|
42690
|
+
&::before {
|
|
42691
|
+
content: 'Click to make required again';
|
|
42692
|
+
position: absolute;
|
|
42693
|
+
bottom: calc(100% + 12px);
|
|
42694
|
+
left: 50%;
|
|
42695
|
+
transform: translateX(-50%);
|
|
42696
|
+
background: white;
|
|
42697
|
+
color: #212121;
|
|
42698
|
+
padding: 4px 8px;
|
|
42699
|
+
border-radius: 4px;
|
|
42700
|
+
font-size: 12px;
|
|
42701
|
+
font-family: 'Poppins', sans-serif;
|
|
42702
|
+
font-weight: 400;
|
|
42703
|
+
white-space: nowrap;
|
|
42704
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
42705
|
+
opacity: 0;
|
|
42706
|
+
pointer-events: none;
|
|
42707
|
+
transition: opacity 0.15s ease;
|
|
42708
|
+
z-index: 1000;
|
|
42709
|
+
}
|
|
42710
|
+
|
|
42711
|
+
&::after {
|
|
42712
|
+
content: '';
|
|
42713
|
+
position: absolute;
|
|
42714
|
+
bottom: calc(100% + 7px);
|
|
42715
|
+
left: 50%;
|
|
42716
|
+
width: 10px;
|
|
42717
|
+
height: 10px;
|
|
42718
|
+
background: white;
|
|
42719
|
+
transform: translateX(-50%) rotate(45deg);
|
|
42720
|
+
opacity: 0;
|
|
42721
|
+
pointer-events: none;
|
|
42722
|
+
transition: opacity 0.15s ease;
|
|
42723
|
+
z-index: 1001;
|
|
42724
|
+
}
|
|
42725
|
+
|
|
42726
|
+
&:hover::before,
|
|
42727
|
+
&:hover::after {
|
|
42728
|
+
opacity: 1;
|
|
42729
|
+
}
|
|
42730
|
+
`;
|
|
42530
42731
|
|
|
42531
42732
|
// MessageBox.styles.js
|
|
42532
42733
|
const ModalOverlay = styled.div`
|
|
@@ -43257,6 +43458,7 @@ const TableBody = /*#__PURE__*/forwardRef(({
|
|
|
43257
43458
|
onCommentSave = () => {},
|
|
43258
43459
|
commentTextLimit = 150,
|
|
43259
43460
|
expandable = false,
|
|
43461
|
+
expandPosition = "left",
|
|
43260
43462
|
expandedRows = {},
|
|
43261
43463
|
expandedContent = {},
|
|
43262
43464
|
onExpandRow = () => {},
|
|
@@ -43267,7 +43469,8 @@ const TableBody = /*#__PURE__*/forwardRef(({
|
|
|
43267
43469
|
onHeroClick = () => {},
|
|
43268
43470
|
onEditableClick = () => {},
|
|
43269
43471
|
isEditMode = false,
|
|
43270
|
-
editRowIndex = -1
|
|
43472
|
+
editRowIndex = -1,
|
|
43473
|
+
markAllNotValidFields = false
|
|
43271
43474
|
}, ref) => {
|
|
43272
43475
|
if (!Array.isArray(data) || !Array.isArray(columns)) {
|
|
43273
43476
|
console.warn("TableBody: Invalid data or columns prop");
|
|
@@ -43284,6 +43487,20 @@ const TableBody = /*#__PURE__*/forwardRef(({
|
|
|
43284
43487
|
const [hasInitialValue, setHasInitialValue] = useState(false);
|
|
43285
43488
|
const [shimmerRowIndex, setShimmerRowIndex] = useState(-1);
|
|
43286
43489
|
const [shimmerStartTime, setShimmerStartTime] = useState(null);
|
|
43490
|
+
const [notAvailableFields, setNotAvailableFields] = useState(() => {
|
|
43491
|
+
const initial = {};
|
|
43492
|
+
data.forEach(row => {
|
|
43493
|
+
columns.forEach(col => {
|
|
43494
|
+
if (col.allowNotAvailable && col.notAvailableValue !== undefined && row[col.key] === col.notAvailableValue) {
|
|
43495
|
+
initial[row.id] = {
|
|
43496
|
+
...(initial[row.id] ?? {}),
|
|
43497
|
+
[col.key]: true
|
|
43498
|
+
};
|
|
43499
|
+
}
|
|
43500
|
+
});
|
|
43501
|
+
});
|
|
43502
|
+
return initial;
|
|
43503
|
+
});
|
|
43287
43504
|
const getNestedValue = (obj, path) => {
|
|
43288
43505
|
if (!path || typeof path !== 'string') return undefined;
|
|
43289
43506
|
return path.split('.').reduce((current, key) => {
|
|
@@ -44077,7 +44294,7 @@ const TableBody = /*#__PURE__*/forwardRef(({
|
|
|
44077
44294
|
onMouseEnter: () => !isEditMode && setHoveredRowIndex(rowIndex),
|
|
44078
44295
|
onMouseLeave: () => !isEditMode && setHoveredRowIndex(null),
|
|
44079
44296
|
onClick: () => handleRowClick(row, rowIndex)
|
|
44080
|
-
}, expandable && expandedContent[rowIndex] !== undefined && expandedContent[rowIndex] !== null ? /*#__PURE__*/React$1.createElement(TableCell, {
|
|
44297
|
+
}, expandPosition !== "right" && (expandable && expandedContent[rowIndex] !== undefined && expandedContent[rowIndex] !== null ? /*#__PURE__*/React$1.createElement(TableCell, {
|
|
44081
44298
|
$fieldType: "expand",
|
|
44082
44299
|
$minWidth: "16px",
|
|
44083
44300
|
$maxWidth: "16px"
|
|
@@ -44096,13 +44313,21 @@ const TableBody = /*#__PURE__*/forwardRef(({
|
|
|
44096
44313
|
$fieldType: "expand",
|
|
44097
44314
|
$minWidth: "16px",
|
|
44098
44315
|
$maxWidth: "16px"
|
|
44099
|
-
}) : null, columns.map((column, columnIndex) => {
|
|
44316
|
+
}) : null), columns.map((column, columnIndex) => {
|
|
44100
44317
|
if (!column || !column.key) {
|
|
44101
44318
|
console.warn(`Invalid column at index ${columnIndex}:`, column);
|
|
44102
44319
|
return /*#__PURE__*/React$1.createElement(TableCell, {
|
|
44103
44320
|
key: `invalid-${columnIndex}`
|
|
44104
44321
|
}, "Invalid Column");
|
|
44105
44322
|
}
|
|
44323
|
+
if (column.groupBreak && rowIndex > 0 && data[rowIndex - 1][column.key] === row[column.key]) {
|
|
44324
|
+
return /*#__PURE__*/React$1.createElement(TableCell, {
|
|
44325
|
+
key: `${column.key}-${rowIndex}`,
|
|
44326
|
+
$fieldType: column.fieldType?.toLowerCase(),
|
|
44327
|
+
$minWidth: column.minWidth,
|
|
44328
|
+
$maxWidth: column.maxWidth
|
|
44329
|
+
});
|
|
44330
|
+
}
|
|
44106
44331
|
let value, formattedValue, fieldTooltip;
|
|
44107
44332
|
try {
|
|
44108
44333
|
value = column.key.includes('.') ? getNestedValue(row, column.key) : row[column.key];
|
|
@@ -44121,7 +44346,7 @@ const TableBody = /*#__PURE__*/forwardRef(({
|
|
|
44121
44346
|
return /*#__PURE__*/React$1.createElement(TableCell, {
|
|
44122
44347
|
key: `${column.key}-${rowIndex}`,
|
|
44123
44348
|
ref: el => {
|
|
44124
|
-
if (isTextBasedField && el && formattedValue) {
|
|
44349
|
+
if (isTextBasedField && el && formattedValue && !column.editable) {
|
|
44125
44350
|
const hasOverflow = shouldShowTooltip(el);
|
|
44126
44351
|
const tooltipTextToShow = hasOverflow ? String(formattedValue) : fieldTooltip;
|
|
44127
44352
|
if (tooltipTextToShow) {
|
|
@@ -44149,13 +44374,81 @@ const TableBody = /*#__PURE__*/forwardRef(({
|
|
|
44149
44374
|
}
|
|
44150
44375
|
},
|
|
44151
44376
|
$fieldType: fieldType,
|
|
44377
|
+
$editable: !!column.editable,
|
|
44152
44378
|
$color: column.color,
|
|
44153
44379
|
$minWidth: column.minWidth,
|
|
44154
44380
|
$maxWidth: column.maxWidth
|
|
44155
44381
|
}, fieldTooltip && !isTextBasedField ? /*#__PURE__*/React$1.createElement(CellContentWrapper, {
|
|
44156
44382
|
ref: el => applyTooltip(el, fieldTooltip)
|
|
44157
|
-
}, renderCellContent(formattedValue, isTextBasedField, shouldShimmer)) : renderCellContent(formattedValue, isTextBasedField, shouldShimmer))
|
|
44158
|
-
|
|
44383
|
+
}, renderCellContent(formattedValue, isTextBasedField, shouldShimmer)) : column.groupBreak ? /*#__PURE__*/React$1.createElement("strong", null, renderCellContent(formattedValue, isTextBasedField, shouldShimmer)) : column.editable && column.allowNotAvailable ? /*#__PURE__*/React$1.createElement(NotAvailableCellWrapper, null, notAvailableFields[row.id]?.[column.key] ? /*#__PURE__*/React$1.createElement(NotAvailableText, {
|
|
44384
|
+
onClick: () => {
|
|
44385
|
+
setNotAvailableFields(prev => ({
|
|
44386
|
+
...prev,
|
|
44387
|
+
[row.id]: {
|
|
44388
|
+
...(prev[row.id] ?? {}),
|
|
44389
|
+
[column.key]: false
|
|
44390
|
+
}
|
|
44391
|
+
}));
|
|
44392
|
+
column.onNotAvailableChange?.(row, false);
|
|
44393
|
+
}
|
|
44394
|
+
}, "N/A") : /*#__PURE__*/React$1.createElement(React$1.Fragment, null, column.renderEditableCell?.(rowIndex, row, {
|
|
44395
|
+
markAllNotValidFields
|
|
44396
|
+
}), /*#__PURE__*/React$1.createElement(NotAvailableIconButton, {
|
|
44397
|
+
type: "button",
|
|
44398
|
+
onClick: e => {
|
|
44399
|
+
e.stopPropagation();
|
|
44400
|
+
setNotAvailableFields(prev => ({
|
|
44401
|
+
...prev,
|
|
44402
|
+
[row.id]: {
|
|
44403
|
+
...(prev[row.id] ?? {}),
|
|
44404
|
+
[column.key]: true
|
|
44405
|
+
}
|
|
44406
|
+
}));
|
|
44407
|
+
column.onNotAvailableChange?.(row, true);
|
|
44408
|
+
}
|
|
44409
|
+
}, /*#__PURE__*/React$1.createElement("svg", {
|
|
44410
|
+
width: "14",
|
|
44411
|
+
height: "14",
|
|
44412
|
+
viewBox: "0 0 14 14",
|
|
44413
|
+
fill: "none",
|
|
44414
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
44415
|
+
}, /*#__PURE__*/React$1.createElement("circle", {
|
|
44416
|
+
cx: "7",
|
|
44417
|
+
cy: "7",
|
|
44418
|
+
r: "6",
|
|
44419
|
+
stroke: "currentColor",
|
|
44420
|
+
strokeWidth: "1.5"
|
|
44421
|
+
}), /*#__PURE__*/React$1.createElement("line", {
|
|
44422
|
+
x1: "2.5",
|
|
44423
|
+
y1: "11.5",
|
|
44424
|
+
x2: "11.5",
|
|
44425
|
+
y2: "2.5",
|
|
44426
|
+
stroke: "currentColor",
|
|
44427
|
+
strokeWidth: "1.5",
|
|
44428
|
+
strokeLinecap: "round"
|
|
44429
|
+
}))))) : column.editable && column.renderEditableCell ? column.renderEditableCell(rowIndex, row, {
|
|
44430
|
+
markAllNotValidFields
|
|
44431
|
+
}) : renderCellContent(formattedValue, isTextBasedField, shouldShimmer));
|
|
44432
|
+
}), expandPosition === "right" && (expandable && expandedContent[rowIndex] !== undefined && expandedContent[rowIndex] !== null ? /*#__PURE__*/React$1.createElement(TableCell, {
|
|
44433
|
+
$fieldType: "expand",
|
|
44434
|
+
$minWidth: "16px",
|
|
44435
|
+
$maxWidth: "16px"
|
|
44436
|
+
}, /*#__PURE__*/React$1.createElement(ExpandIcon, {
|
|
44437
|
+
onClick: e => handleExpandClick(row, rowIndex, e),
|
|
44438
|
+
$isExpanded: expandedRows[rowIndex] || false
|
|
44439
|
+
}, expandedRows[rowIndex] ? /*#__PURE__*/React$1.createElement(MenuItemOpenIcon, {
|
|
44440
|
+
width: "12",
|
|
44441
|
+
height: "12",
|
|
44442
|
+
color: "#666"
|
|
44443
|
+
}) : /*#__PURE__*/React$1.createElement(ChervronRightIcon, {
|
|
44444
|
+
width: "12",
|
|
44445
|
+
height: "12",
|
|
44446
|
+
fill: "#666"
|
|
44447
|
+
}))) : expandable === true ? /*#__PURE__*/React$1.createElement(TableCell, {
|
|
44448
|
+
$fieldType: "expand",
|
|
44449
|
+
$minWidth: "16px",
|
|
44450
|
+
$maxWidth: "16px"
|
|
44451
|
+
}) : null)), expandable && expandedRows[rowIndex] && /*#__PURE__*/React$1.createElement(ExpandedRow, {
|
|
44159
44452
|
$expandedBackgroundColor: expandedBackgroundColor
|
|
44160
44453
|
}, /*#__PURE__*/React$1.createElement(TableCell, {
|
|
44161
44454
|
colSpan: columns.length + 1
|
|
@@ -47781,6 +48074,7 @@ const Table = props => {
|
|
|
47781
48074
|
editRowIndex = -1,
|
|
47782
48075
|
onCommentSave = () => {},
|
|
47783
48076
|
expandable = false,
|
|
48077
|
+
expandPosition = "left",
|
|
47784
48078
|
expandedRows = {},
|
|
47785
48079
|
expandedContent = {},
|
|
47786
48080
|
onExpandRow = () => {},
|
|
@@ -47809,7 +48103,10 @@ const Table = props => {
|
|
|
47809
48103
|
showFooter = false,
|
|
47810
48104
|
total,
|
|
47811
48105
|
rowLabel = "",
|
|
47812
|
-
footerRight = null
|
|
48106
|
+
footerRight = null,
|
|
48107
|
+
showDirtyFieldsCounter = false,
|
|
48108
|
+
dirtyFieldsCount = 0,
|
|
48109
|
+
markAllNotValidFields = false
|
|
47813
48110
|
} = props;
|
|
47814
48111
|
const scrollWrapperRef = useRef(null);
|
|
47815
48112
|
const tableBodyRef = useRef(null);
|
|
@@ -47928,6 +48225,7 @@ const Table = props => {
|
|
|
47928
48225
|
onFilter: onFilter,
|
|
47929
48226
|
onSelectAll: onSelectAll,
|
|
47930
48227
|
expandable: expandable,
|
|
48228
|
+
expandPosition: expandPosition,
|
|
47931
48229
|
onHeaderCheckboxClick: onHeaderCheckboxClick,
|
|
47932
48230
|
headerCheckboxStates: headerCheckboxStates,
|
|
47933
48231
|
resetFiltersKey: resetFiltersKey,
|
|
@@ -47955,6 +48253,7 @@ const Table = props => {
|
|
|
47955
48253
|
changeFocusIndex: changeFocusIndex,
|
|
47956
48254
|
onFocusChange: handleTableFocusChange,
|
|
47957
48255
|
expandable: expandable,
|
|
48256
|
+
expandPosition: expandPosition,
|
|
47958
48257
|
expandedRows: expandedRows,
|
|
47959
48258
|
expandedContent: expandedContent,
|
|
47960
48259
|
onExpandRow: onExpandRow,
|
|
@@ -47966,7 +48265,8 @@ const Table = props => {
|
|
|
47966
48265
|
onHeroClick: onHeroClick,
|
|
47967
48266
|
onEditableClick: onEditableClick,
|
|
47968
48267
|
isEditMode: isEditMode,
|
|
47969
|
-
editRowIndex: editRowIndex
|
|
48268
|
+
editRowIndex: editRowIndex,
|
|
48269
|
+
markAllNotValidFields: markAllNotValidFields
|
|
47970
48270
|
})), data.length === 0 && /*#__PURE__*/React$1.createElement(NoEventsParent, null, /*#__PURE__*/React$1.createElement(NoEventsWrapper, null, showNoDataInSearch ? getNoDataSearchIcon(noDataSearchIcon) : getNoDataIcon(noDataIcon)), /*#__PURE__*/React$1.createElement(NoEventsMessage, {
|
|
47971
48271
|
titleSize: titleSize,
|
|
47972
48272
|
subTitleSize: subTitleSize
|
|
@@ -47996,9 +48296,10 @@ const Table = props => {
|
|
|
47996
48296
|
total: total,
|
|
47997
48297
|
rowLabel: rowLabel,
|
|
47998
48298
|
isLoading: isLoading,
|
|
47999
|
-
isLoadingText: isLoadingText
|
|
48000
|
-
|
|
48001
|
-
|
|
48299
|
+
isLoadingText: isLoadingText
|
|
48300
|
+
}), showDirtyFieldsCounter && (dirtyFieldsCount > 0 ? /*#__PURE__*/React$1.createElement(DirtyFieldsCounter, {
|
|
48301
|
+
$dirty: true
|
|
48302
|
+
}, dirtyFieldsCount, " field", dirtyFieldsCount !== 1 ? 's' : '', " modified") : /*#__PURE__*/React$1.createElement(DirtyFieldsCounter, null, "\u2713 All values complete")))));
|
|
48002
48303
|
};
|
|
48003
48304
|
Table.displayName = "Table";
|
|
48004
48305
|
|