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.js
CHANGED
|
@@ -644,6 +644,26 @@ const ChervronLeftIcon = _ref => {
|
|
|
644
644
|
}));
|
|
645
645
|
};
|
|
646
646
|
|
|
647
|
+
const CalendarIcon = _ref => {
|
|
648
|
+
let {
|
|
649
|
+
clicked,
|
|
650
|
+
width = "14",
|
|
651
|
+
height = "14",
|
|
652
|
+
fill = "#212121",
|
|
653
|
+
color
|
|
654
|
+
} = _ref;
|
|
655
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
656
|
+
width: width,
|
|
657
|
+
height: height,
|
|
658
|
+
viewBox: "0 0 11 12",
|
|
659
|
+
fill: "none",
|
|
660
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
661
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
662
|
+
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",
|
|
663
|
+
fill: color || fill
|
|
664
|
+
}));
|
|
665
|
+
};
|
|
666
|
+
|
|
647
667
|
const Button$1 = props => {
|
|
648
668
|
const {
|
|
649
669
|
text = "",
|
|
@@ -690,14 +710,15 @@ const Button$1 = props => {
|
|
|
690
710
|
plus: Plus,
|
|
691
711
|
left: ChervronLeftIcon,
|
|
692
712
|
right: ChervronRightIcon,
|
|
693
|
-
vicon: VIcon
|
|
713
|
+
vicon: VIcon,
|
|
714
|
+
calendar: CalendarIcon
|
|
694
715
|
};
|
|
695
716
|
const getIcon = icon => {
|
|
696
717
|
if (!icon || icon === "none") return null;
|
|
697
718
|
const IconComponent = iconMap[icon.toLowerCase()];
|
|
698
719
|
const iconProps = {
|
|
699
|
-
height: "16px",
|
|
700
|
-
width: "16px",
|
|
720
|
+
height: icon.toLowerCase() === "calendar" ? "14" : "16px",
|
|
721
|
+
width: icon.toLowerCase() === "calendar" ? "14" : "16px",
|
|
701
722
|
color: disabled ? disabledTextColor || "#B1B1B1" : hover ? hoverTextColor || (type === "secondary" ? "#229E38" : "#ffffff") : textColor || (type === "secondary" ? "#212121" : "#ffffff"),
|
|
702
723
|
fill: disabled ? disabledTextColor || "#B1B1B1" : hover ? hoverTextColor || (type === "secondary" ? "#229E38" : "#ffffff") : textColor || (type === "secondary" ? "#212121" : "#ffffff")
|
|
703
724
|
};
|
|
@@ -37369,6 +37390,16 @@ const Loader = styled__default["default"].span`
|
|
|
37369
37390
|
animation: ${rotation} 1.5s infinite ease;
|
|
37370
37391
|
transform: translateZ(0);
|
|
37371
37392
|
`;
|
|
37393
|
+
const DirtyFieldsCounter = styled__default["default"].div`
|
|
37394
|
+
font-family: 'Poppins', sans-serif;
|
|
37395
|
+
font-size: 14px;
|
|
37396
|
+
font-weight: 500;
|
|
37397
|
+
color: ${({
|
|
37398
|
+
$dirty
|
|
37399
|
+
}) => $dirty ? '#EF4444' : '#1f7677'};
|
|
37400
|
+
padding: 6px 16px;
|
|
37401
|
+
text-align: left;
|
|
37402
|
+
`;
|
|
37372
37403
|
const LoaderWrapper = styled__default["default"].div`
|
|
37373
37404
|
position: absolute;
|
|
37374
37405
|
top: 50%;
|
|
@@ -41131,6 +41162,7 @@ const TableHeader = ({
|
|
|
41131
41162
|
activeFilters = [],
|
|
41132
41163
|
activeSorts = [],
|
|
41133
41164
|
expandable = false,
|
|
41165
|
+
expandPosition = "left",
|
|
41134
41166
|
onHeaderCheckboxClick = () => {},
|
|
41135
41167
|
headerCheckboxStates = {},
|
|
41136
41168
|
resetFiltersKey = 0,
|
|
@@ -41678,7 +41710,7 @@ const TableHeader = ({
|
|
|
41678
41710
|
onReset: () => handleSortReset(key)
|
|
41679
41711
|
});
|
|
41680
41712
|
};
|
|
41681
|
-
return /*#__PURE__*/React__default["default"].createElement(StyledTableHeader, null, /*#__PURE__*/React__default["default"].createElement("tr", null, expandable && /*#__PURE__*/React__default["default"].createElement(HeaderCell, {
|
|
41713
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledTableHeader, null, /*#__PURE__*/React__default["default"].createElement("tr", null, expandable && expandPosition !== "right" && /*#__PURE__*/React__default["default"].createElement(HeaderCell, {
|
|
41682
41714
|
$fieldType: "expand",
|
|
41683
41715
|
$minWidth: "16px",
|
|
41684
41716
|
$maxWidth: "16px"
|
|
@@ -41699,7 +41731,12 @@ const TableHeader = ({
|
|
|
41699
41731
|
style: {
|
|
41700
41732
|
accentColor: '#066768'
|
|
41701
41733
|
}
|
|
41702
|
-
}), column.title && /*#__PURE__*/React__default["default"].createElement(ColumnLabel, null, column.title
|
|
41734
|
+
}), column.title && /*#__PURE__*/React__default["default"].createElement(ColumnLabel, null, column.title, column.required && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
41735
|
+
style: {
|
|
41736
|
+
color: '#EF4444',
|
|
41737
|
+
marginLeft: '5px'
|
|
41738
|
+
}
|
|
41739
|
+
}, "*")), (column.filter || column.sort) && /*#__PURE__*/React__default["default"].createElement(ColumnActions, null, column.sort && /*#__PURE__*/React__default["default"].createElement(IconButton, {
|
|
41703
41740
|
ref: el => iconRefs.current[`sort-${column.key}`] = el,
|
|
41704
41741
|
onClick: () => handleSort(column.key),
|
|
41705
41742
|
onMouseEnter: () => setFocusedSort(column.key),
|
|
@@ -41724,7 +41761,11 @@ const TableHeader = ({
|
|
|
41724
41761
|
}, /*#__PURE__*/React__default["default"].createElement(FilterIcon, {
|
|
41725
41762
|
state: getFilterIconState(column.key),
|
|
41726
41763
|
isActive: shouldShowActiveIcon(column.key)
|
|
41727
|
-
}))))))
|
|
41764
|
+
})))))), expandable && expandPosition === "right" && /*#__PURE__*/React__default["default"].createElement(HeaderCell, {
|
|
41765
|
+
$fieldType: "expand",
|
|
41766
|
+
$minWidth: "16px",
|
|
41767
|
+
$maxWidth: "16px"
|
|
41768
|
+
}, /*#__PURE__*/React__default["default"].createElement(ColumnContent, null, /*#__PURE__*/React__default["default"].createElement(ColumnLabel, null)))), visibleSortPopWrapper && /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React__default["default"].createElement(PopWrapper, {
|
|
41728
41769
|
ref: popupRef,
|
|
41729
41770
|
className: "pop-wrapper",
|
|
41730
41771
|
top: popPosition.top,
|
|
@@ -41914,6 +41955,10 @@ const TableCell = styled__default["default"].td`
|
|
|
41914
41955
|
position: relative;
|
|
41915
41956
|
`}
|
|
41916
41957
|
|
|
41958
|
+
${props => props.$editable && `
|
|
41959
|
+
overflow: visible;
|
|
41960
|
+
`}
|
|
41961
|
+
|
|
41917
41962
|
/* CSS-only tooltip */
|
|
41918
41963
|
&[data-tooltip]:hover::before {
|
|
41919
41964
|
content: attr(data-tooltip);
|
|
@@ -41967,6 +42012,31 @@ const TableCell = styled__default["default"].td`
|
|
|
41967
42012
|
}
|
|
41968
42013
|
}
|
|
41969
42014
|
|
|
42015
|
+
input {
|
|
42016
|
+
display: block;
|
|
42017
|
+
}
|
|
42018
|
+
|
|
42019
|
+
input[type="number"]::-webkit-inner-spin-button,
|
|
42020
|
+
input[type="number"]::-webkit-outer-spin-button {
|
|
42021
|
+
-webkit-appearance: none;
|
|
42022
|
+
margin: 0;
|
|
42023
|
+
}
|
|
42024
|
+
|
|
42025
|
+
input[type="number"] {
|
|
42026
|
+
-moz-appearance: textfield;
|
|
42027
|
+
}
|
|
42028
|
+
|
|
42029
|
+
input:hover:not(:focus) {
|
|
42030
|
+
border: 1px solid rgba(0, 0, 0, 0.6) !important;
|
|
42031
|
+
border-radius: 4px;
|
|
42032
|
+
}
|
|
42033
|
+
|
|
42034
|
+
input:focus {
|
|
42035
|
+
border: 2px solid #212121 !important;
|
|
42036
|
+
border-radius: 4px;
|
|
42037
|
+
outline: none !important;
|
|
42038
|
+
}
|
|
42039
|
+
|
|
41970
42040
|
${props => {
|
|
41971
42041
|
switch (props.$fieldType) {
|
|
41972
42042
|
case "currency":
|
|
@@ -42537,6 +42607,137 @@ const PencilButton = styled__default["default"].button`
|
|
|
42537
42607
|
pointer-events: none;
|
|
42538
42608
|
}
|
|
42539
42609
|
`;
|
|
42610
|
+
const NotAvailableIconButton = styled__default["default"].button`
|
|
42611
|
+
position: absolute;
|
|
42612
|
+
right: 4px;
|
|
42613
|
+
top: 0;
|
|
42614
|
+
bottom: 0;
|
|
42615
|
+
margin-top: auto;
|
|
42616
|
+
margin-bottom: auto;
|
|
42617
|
+
height: fit-content;
|
|
42618
|
+
background: transparent;
|
|
42619
|
+
border: none;
|
|
42620
|
+
cursor: pointer;
|
|
42621
|
+
padding: 2px;
|
|
42622
|
+
display: flex;
|
|
42623
|
+
align-items: center;
|
|
42624
|
+
justify-content: center;
|
|
42625
|
+
color: #8B8989;
|
|
42626
|
+
opacity: 0;
|
|
42627
|
+
transition: opacity 0.15s ease, color 0.15s ease;
|
|
42628
|
+
|
|
42629
|
+
&:hover {
|
|
42630
|
+
color: #EF4444;
|
|
42631
|
+
}
|
|
42632
|
+
|
|
42633
|
+
&::before {
|
|
42634
|
+
content: 'Mark as N/A';
|
|
42635
|
+
position: absolute;
|
|
42636
|
+
bottom: calc(100% + 12px);
|
|
42637
|
+
left: 50%;
|
|
42638
|
+
transform: translateX(-50%);
|
|
42639
|
+
background: white;
|
|
42640
|
+
color: #212121;
|
|
42641
|
+
padding: 4px 8px;
|
|
42642
|
+
border-radius: 4px;
|
|
42643
|
+
font-size: 12px;
|
|
42644
|
+
font-family: 'Poppins', sans-serif;
|
|
42645
|
+
font-weight: 400;
|
|
42646
|
+
white-space: nowrap;
|
|
42647
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
42648
|
+
opacity: 0;
|
|
42649
|
+
pointer-events: none;
|
|
42650
|
+
transition: opacity 0.15s ease;
|
|
42651
|
+
z-index: 1000;
|
|
42652
|
+
}
|
|
42653
|
+
|
|
42654
|
+
&::after {
|
|
42655
|
+
content: '';
|
|
42656
|
+
position: absolute;
|
|
42657
|
+
bottom: calc(100% + 7px);
|
|
42658
|
+
left: 50%;
|
|
42659
|
+
width: 10px;
|
|
42660
|
+
height: 10px;
|
|
42661
|
+
background: white;
|
|
42662
|
+
transform: translateX(-50%) rotate(45deg);
|
|
42663
|
+
opacity: 0;
|
|
42664
|
+
pointer-events: none;
|
|
42665
|
+
transition: opacity 0.15s ease;
|
|
42666
|
+
z-index: 1001;
|
|
42667
|
+
}
|
|
42668
|
+
|
|
42669
|
+
&:hover::before,
|
|
42670
|
+
&:hover::after {
|
|
42671
|
+
opacity: 1;
|
|
42672
|
+
}
|
|
42673
|
+
`;
|
|
42674
|
+
const NotAvailableCellWrapper = styled__default["default"].div`
|
|
42675
|
+
position: relative;
|
|
42676
|
+
display: flex;
|
|
42677
|
+
align-items: center;
|
|
42678
|
+
width: 100%;
|
|
42679
|
+
|
|
42680
|
+
&:hover ${NotAvailableIconButton} {
|
|
42681
|
+
opacity: 1;
|
|
42682
|
+
}
|
|
42683
|
+
`;
|
|
42684
|
+
const NotAvailableText = styled__default["default"].div`
|
|
42685
|
+
position: relative;
|
|
42686
|
+
width: 100%;
|
|
42687
|
+
color: #8B8989;
|
|
42688
|
+
font-family: inherit;
|
|
42689
|
+
font-size: inherit;
|
|
42690
|
+
line-height: normal;
|
|
42691
|
+
cursor: pointer;
|
|
42692
|
+
padding: 1px 2px;
|
|
42693
|
+
border: 1px solid transparent;
|
|
42694
|
+
border-radius: 4px;
|
|
42695
|
+
|
|
42696
|
+
&:hover {
|
|
42697
|
+
border-color: rgba(0, 0, 0, 0.6);
|
|
42698
|
+
}
|
|
42699
|
+
|
|
42700
|
+
&::before {
|
|
42701
|
+
content: 'Click to make required again';
|
|
42702
|
+
position: absolute;
|
|
42703
|
+
bottom: calc(100% + 12px);
|
|
42704
|
+
left: 50%;
|
|
42705
|
+
transform: translateX(-50%);
|
|
42706
|
+
background: white;
|
|
42707
|
+
color: #212121;
|
|
42708
|
+
padding: 4px 8px;
|
|
42709
|
+
border-radius: 4px;
|
|
42710
|
+
font-size: 12px;
|
|
42711
|
+
font-family: 'Poppins', sans-serif;
|
|
42712
|
+
font-weight: 400;
|
|
42713
|
+
white-space: nowrap;
|
|
42714
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
42715
|
+
opacity: 0;
|
|
42716
|
+
pointer-events: none;
|
|
42717
|
+
transition: opacity 0.15s ease;
|
|
42718
|
+
z-index: 1000;
|
|
42719
|
+
}
|
|
42720
|
+
|
|
42721
|
+
&::after {
|
|
42722
|
+
content: '';
|
|
42723
|
+
position: absolute;
|
|
42724
|
+
bottom: calc(100% + 7px);
|
|
42725
|
+
left: 50%;
|
|
42726
|
+
width: 10px;
|
|
42727
|
+
height: 10px;
|
|
42728
|
+
background: white;
|
|
42729
|
+
transform: translateX(-50%) rotate(45deg);
|
|
42730
|
+
opacity: 0;
|
|
42731
|
+
pointer-events: none;
|
|
42732
|
+
transition: opacity 0.15s ease;
|
|
42733
|
+
z-index: 1001;
|
|
42734
|
+
}
|
|
42735
|
+
|
|
42736
|
+
&:hover::before,
|
|
42737
|
+
&:hover::after {
|
|
42738
|
+
opacity: 1;
|
|
42739
|
+
}
|
|
42740
|
+
`;
|
|
42540
42741
|
|
|
42541
42742
|
// MessageBox.styles.js
|
|
42542
42743
|
const ModalOverlay = styled__default["default"].div`
|
|
@@ -43267,6 +43468,7 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
|
|
|
43267
43468
|
onCommentSave = () => {},
|
|
43268
43469
|
commentTextLimit = 150,
|
|
43269
43470
|
expandable = false,
|
|
43471
|
+
expandPosition = "left",
|
|
43270
43472
|
expandedRows = {},
|
|
43271
43473
|
expandedContent = {},
|
|
43272
43474
|
onExpandRow = () => {},
|
|
@@ -43277,7 +43479,8 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
|
|
|
43277
43479
|
onHeroClick = () => {},
|
|
43278
43480
|
onEditableClick = () => {},
|
|
43279
43481
|
isEditMode = false,
|
|
43280
|
-
editRowIndex = -1
|
|
43482
|
+
editRowIndex = -1,
|
|
43483
|
+
markAllNotValidFields = false
|
|
43281
43484
|
}, ref) => {
|
|
43282
43485
|
if (!Array.isArray(data) || !Array.isArray(columns)) {
|
|
43283
43486
|
console.warn("TableBody: Invalid data or columns prop");
|
|
@@ -43294,6 +43497,20 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
|
|
|
43294
43497
|
const [hasInitialValue, setHasInitialValue] = React$1.useState(false);
|
|
43295
43498
|
const [shimmerRowIndex, setShimmerRowIndex] = React$1.useState(-1);
|
|
43296
43499
|
const [shimmerStartTime, setShimmerStartTime] = React$1.useState(null);
|
|
43500
|
+
const [notAvailableFields, setNotAvailableFields] = React$1.useState(() => {
|
|
43501
|
+
const initial = {};
|
|
43502
|
+
data.forEach(row => {
|
|
43503
|
+
columns.forEach(col => {
|
|
43504
|
+
if (col.allowNotAvailable && col.notAvailableValue !== undefined && row[col.key] === col.notAvailableValue) {
|
|
43505
|
+
initial[row.id] = {
|
|
43506
|
+
...(initial[row.id] ?? {}),
|
|
43507
|
+
[col.key]: true
|
|
43508
|
+
};
|
|
43509
|
+
}
|
|
43510
|
+
});
|
|
43511
|
+
});
|
|
43512
|
+
return initial;
|
|
43513
|
+
});
|
|
43297
43514
|
const getNestedValue = (obj, path) => {
|
|
43298
43515
|
if (!path || typeof path !== 'string') return undefined;
|
|
43299
43516
|
return path.split('.').reduce((current, key) => {
|
|
@@ -44087,7 +44304,7 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
|
|
|
44087
44304
|
onMouseEnter: () => !isEditMode && setHoveredRowIndex(rowIndex),
|
|
44088
44305
|
onMouseLeave: () => !isEditMode && setHoveredRowIndex(null),
|
|
44089
44306
|
onClick: () => handleRowClick(row, rowIndex)
|
|
44090
|
-
}, expandable && expandedContent[rowIndex] !== undefined && expandedContent[rowIndex] !== null ? /*#__PURE__*/React__default["default"].createElement(TableCell, {
|
|
44307
|
+
}, expandPosition !== "right" && (expandable && expandedContent[rowIndex] !== undefined && expandedContent[rowIndex] !== null ? /*#__PURE__*/React__default["default"].createElement(TableCell, {
|
|
44091
44308
|
$fieldType: "expand",
|
|
44092
44309
|
$minWidth: "16px",
|
|
44093
44310
|
$maxWidth: "16px"
|
|
@@ -44106,13 +44323,21 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
|
|
|
44106
44323
|
$fieldType: "expand",
|
|
44107
44324
|
$minWidth: "16px",
|
|
44108
44325
|
$maxWidth: "16px"
|
|
44109
|
-
}) : null, columns.map((column, columnIndex) => {
|
|
44326
|
+
}) : null), columns.map((column, columnIndex) => {
|
|
44110
44327
|
if (!column || !column.key) {
|
|
44111
44328
|
console.warn(`Invalid column at index ${columnIndex}:`, column);
|
|
44112
44329
|
return /*#__PURE__*/React__default["default"].createElement(TableCell, {
|
|
44113
44330
|
key: `invalid-${columnIndex}`
|
|
44114
44331
|
}, "Invalid Column");
|
|
44115
44332
|
}
|
|
44333
|
+
if (column.groupBreak && rowIndex > 0 && data[rowIndex - 1][column.key] === row[column.key]) {
|
|
44334
|
+
return /*#__PURE__*/React__default["default"].createElement(TableCell, {
|
|
44335
|
+
key: `${column.key}-${rowIndex}`,
|
|
44336
|
+
$fieldType: column.fieldType?.toLowerCase(),
|
|
44337
|
+
$minWidth: column.minWidth,
|
|
44338
|
+
$maxWidth: column.maxWidth
|
|
44339
|
+
});
|
|
44340
|
+
}
|
|
44116
44341
|
let value, formattedValue, fieldTooltip;
|
|
44117
44342
|
try {
|
|
44118
44343
|
value = column.key.includes('.') ? getNestedValue(row, column.key) : row[column.key];
|
|
@@ -44131,7 +44356,7 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
|
|
|
44131
44356
|
return /*#__PURE__*/React__default["default"].createElement(TableCell, {
|
|
44132
44357
|
key: `${column.key}-${rowIndex}`,
|
|
44133
44358
|
ref: el => {
|
|
44134
|
-
if (isTextBasedField && el && formattedValue) {
|
|
44359
|
+
if (isTextBasedField && el && formattedValue && !column.editable) {
|
|
44135
44360
|
const hasOverflow = shouldShowTooltip(el);
|
|
44136
44361
|
const tooltipTextToShow = hasOverflow ? String(formattedValue) : fieldTooltip;
|
|
44137
44362
|
if (tooltipTextToShow) {
|
|
@@ -44159,13 +44384,81 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
|
|
|
44159
44384
|
}
|
|
44160
44385
|
},
|
|
44161
44386
|
$fieldType: fieldType,
|
|
44387
|
+
$editable: !!column.editable,
|
|
44162
44388
|
$color: column.color,
|
|
44163
44389
|
$minWidth: column.minWidth,
|
|
44164
44390
|
$maxWidth: column.maxWidth
|
|
44165
44391
|
}, fieldTooltip && !isTextBasedField ? /*#__PURE__*/React__default["default"].createElement(CellContentWrapper, {
|
|
44166
44392
|
ref: el => applyTooltip(el, fieldTooltip)
|
|
44167
|
-
}, renderCellContent(formattedValue, isTextBasedField, shouldShimmer)) : renderCellContent(formattedValue, isTextBasedField, shouldShimmer))
|
|
44168
|
-
|
|
44393
|
+
}, renderCellContent(formattedValue, isTextBasedField, shouldShimmer)) : column.groupBreak ? /*#__PURE__*/React__default["default"].createElement("strong", null, renderCellContent(formattedValue, isTextBasedField, shouldShimmer)) : column.editable && column.allowNotAvailable ? /*#__PURE__*/React__default["default"].createElement(NotAvailableCellWrapper, null, notAvailableFields[row.id]?.[column.key] ? /*#__PURE__*/React__default["default"].createElement(NotAvailableText, {
|
|
44394
|
+
onClick: () => {
|
|
44395
|
+
setNotAvailableFields(prev => ({
|
|
44396
|
+
...prev,
|
|
44397
|
+
[row.id]: {
|
|
44398
|
+
...(prev[row.id] ?? {}),
|
|
44399
|
+
[column.key]: false
|
|
44400
|
+
}
|
|
44401
|
+
}));
|
|
44402
|
+
column.onNotAvailableChange?.(row, false);
|
|
44403
|
+
}
|
|
44404
|
+
}, "N/A") : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, column.renderEditableCell?.(rowIndex, row, {
|
|
44405
|
+
markAllNotValidFields
|
|
44406
|
+
}), /*#__PURE__*/React__default["default"].createElement(NotAvailableIconButton, {
|
|
44407
|
+
type: "button",
|
|
44408
|
+
onClick: e => {
|
|
44409
|
+
e.stopPropagation();
|
|
44410
|
+
setNotAvailableFields(prev => ({
|
|
44411
|
+
...prev,
|
|
44412
|
+
[row.id]: {
|
|
44413
|
+
...(prev[row.id] ?? {}),
|
|
44414
|
+
[column.key]: true
|
|
44415
|
+
}
|
|
44416
|
+
}));
|
|
44417
|
+
column.onNotAvailableChange?.(row, true);
|
|
44418
|
+
}
|
|
44419
|
+
}, /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
44420
|
+
width: "14",
|
|
44421
|
+
height: "14",
|
|
44422
|
+
viewBox: "0 0 14 14",
|
|
44423
|
+
fill: "none",
|
|
44424
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
44425
|
+
}, /*#__PURE__*/React__default["default"].createElement("circle", {
|
|
44426
|
+
cx: "7",
|
|
44427
|
+
cy: "7",
|
|
44428
|
+
r: "6",
|
|
44429
|
+
stroke: "currentColor",
|
|
44430
|
+
strokeWidth: "1.5"
|
|
44431
|
+
}), /*#__PURE__*/React__default["default"].createElement("line", {
|
|
44432
|
+
x1: "2.5",
|
|
44433
|
+
y1: "11.5",
|
|
44434
|
+
x2: "11.5",
|
|
44435
|
+
y2: "2.5",
|
|
44436
|
+
stroke: "currentColor",
|
|
44437
|
+
strokeWidth: "1.5",
|
|
44438
|
+
strokeLinecap: "round"
|
|
44439
|
+
}))))) : column.editable && column.renderEditableCell ? column.renderEditableCell(rowIndex, row, {
|
|
44440
|
+
markAllNotValidFields
|
|
44441
|
+
}) : renderCellContent(formattedValue, isTextBasedField, shouldShimmer));
|
|
44442
|
+
}), expandPosition === "right" && (expandable && expandedContent[rowIndex] !== undefined && expandedContent[rowIndex] !== null ? /*#__PURE__*/React__default["default"].createElement(TableCell, {
|
|
44443
|
+
$fieldType: "expand",
|
|
44444
|
+
$minWidth: "16px",
|
|
44445
|
+
$maxWidth: "16px"
|
|
44446
|
+
}, /*#__PURE__*/React__default["default"].createElement(ExpandIcon, {
|
|
44447
|
+
onClick: e => handleExpandClick(row, rowIndex, e),
|
|
44448
|
+
$isExpanded: expandedRows[rowIndex] || false
|
|
44449
|
+
}, expandedRows[rowIndex] ? /*#__PURE__*/React__default["default"].createElement(MenuItemOpenIcon, {
|
|
44450
|
+
width: "12",
|
|
44451
|
+
height: "12",
|
|
44452
|
+
color: "#666"
|
|
44453
|
+
}) : /*#__PURE__*/React__default["default"].createElement(ChervronRightIcon, {
|
|
44454
|
+
width: "12",
|
|
44455
|
+
height: "12",
|
|
44456
|
+
fill: "#666"
|
|
44457
|
+
}))) : expandable === true ? /*#__PURE__*/React__default["default"].createElement(TableCell, {
|
|
44458
|
+
$fieldType: "expand",
|
|
44459
|
+
$minWidth: "16px",
|
|
44460
|
+
$maxWidth: "16px"
|
|
44461
|
+
}) : null)), expandable && expandedRows[rowIndex] && /*#__PURE__*/React__default["default"].createElement(ExpandedRow, {
|
|
44169
44462
|
$expandedBackgroundColor: expandedBackgroundColor
|
|
44170
44463
|
}, /*#__PURE__*/React__default["default"].createElement(TableCell, {
|
|
44171
44464
|
colSpan: columns.length + 1
|
|
@@ -47791,6 +48084,7 @@ const Table = props => {
|
|
|
47791
48084
|
editRowIndex = -1,
|
|
47792
48085
|
onCommentSave = () => {},
|
|
47793
48086
|
expandable = false,
|
|
48087
|
+
expandPosition = "left",
|
|
47794
48088
|
expandedRows = {},
|
|
47795
48089
|
expandedContent = {},
|
|
47796
48090
|
onExpandRow = () => {},
|
|
@@ -47819,7 +48113,10 @@ const Table = props => {
|
|
|
47819
48113
|
showFooter = false,
|
|
47820
48114
|
total,
|
|
47821
48115
|
rowLabel = "",
|
|
47822
|
-
footerRight = null
|
|
48116
|
+
footerRight = null,
|
|
48117
|
+
showDirtyFieldsCounter = false,
|
|
48118
|
+
dirtyFieldsCount = 0,
|
|
48119
|
+
markAllNotValidFields = false
|
|
47823
48120
|
} = props;
|
|
47824
48121
|
const scrollWrapperRef = React$1.useRef(null);
|
|
47825
48122
|
const tableBodyRef = React$1.useRef(null);
|
|
@@ -47938,6 +48235,7 @@ const Table = props => {
|
|
|
47938
48235
|
onFilter: onFilter,
|
|
47939
48236
|
onSelectAll: onSelectAll,
|
|
47940
48237
|
expandable: expandable,
|
|
48238
|
+
expandPosition: expandPosition,
|
|
47941
48239
|
onHeaderCheckboxClick: onHeaderCheckboxClick,
|
|
47942
48240
|
headerCheckboxStates: headerCheckboxStates,
|
|
47943
48241
|
resetFiltersKey: resetFiltersKey,
|
|
@@ -47965,6 +48263,7 @@ const Table = props => {
|
|
|
47965
48263
|
changeFocusIndex: changeFocusIndex,
|
|
47966
48264
|
onFocusChange: handleTableFocusChange,
|
|
47967
48265
|
expandable: expandable,
|
|
48266
|
+
expandPosition: expandPosition,
|
|
47968
48267
|
expandedRows: expandedRows,
|
|
47969
48268
|
expandedContent: expandedContent,
|
|
47970
48269
|
onExpandRow: onExpandRow,
|
|
@@ -47976,7 +48275,8 @@ const Table = props => {
|
|
|
47976
48275
|
onHeroClick: onHeroClick,
|
|
47977
48276
|
onEditableClick: onEditableClick,
|
|
47978
48277
|
isEditMode: isEditMode,
|
|
47979
|
-
editRowIndex: editRowIndex
|
|
48278
|
+
editRowIndex: editRowIndex,
|
|
48279
|
+
markAllNotValidFields: markAllNotValidFields
|
|
47980
48280
|
})), data.length === 0 && /*#__PURE__*/React__default["default"].createElement(NoEventsParent, null, /*#__PURE__*/React__default["default"].createElement(NoEventsWrapper, null, showNoDataInSearch ? getNoDataSearchIcon(noDataSearchIcon) : getNoDataIcon(noDataIcon)), /*#__PURE__*/React__default["default"].createElement(NoEventsMessage, {
|
|
47981
48281
|
titleSize: titleSize,
|
|
47982
48282
|
subTitleSize: subTitleSize
|
|
@@ -48006,9 +48306,10 @@ const Table = props => {
|
|
|
48006
48306
|
total: total,
|
|
48007
48307
|
rowLabel: rowLabel,
|
|
48008
48308
|
isLoading: isLoading,
|
|
48009
|
-
isLoadingText: isLoadingText
|
|
48010
|
-
|
|
48011
|
-
|
|
48309
|
+
isLoadingText: isLoadingText
|
|
48310
|
+
}), showDirtyFieldsCounter && (dirtyFieldsCount > 0 ? /*#__PURE__*/React__default["default"].createElement(DirtyFieldsCounter, {
|
|
48311
|
+
$dirty: true
|
|
48312
|
+
}, dirtyFieldsCount, " field", dirtyFieldsCount !== 1 ? 's' : '', " modified") : /*#__PURE__*/React__default["default"].createElement(DirtyFieldsCounter, null, "\u2713 All values complete")))));
|
|
48012
48313
|
};
|
|
48013
48314
|
Table.displayName = "Table";
|
|
48014
48315
|
|