sag_components 2.0.0-beta223 → 2.0.0-beta224
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 +124 -59
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +124 -59
- package/dist/index.js.map +1 -1
- package/dist/types/components/Table/TableBody.styles.d.ts +2 -0
- package/dist/types/components/Table/data.d.ts +39 -0
- package/dist/types/icons/PencilIcon.d.ts +6 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -24167,21 +24167,22 @@ const DeleteIcon = styled.div`
|
|
|
24167
24167
|
position: absolute;
|
|
24168
24168
|
`;
|
|
24169
24169
|
|
|
24170
|
-
const QuickFilterDropdownSingle =
|
|
24171
|
-
|
|
24172
|
-
|
|
24173
|
-
|
|
24174
|
-
|
|
24175
|
-
|
|
24176
|
-
|
|
24177
|
-
|
|
24178
|
-
|
|
24179
|
-
|
|
24180
|
-
|
|
24181
|
-
|
|
24182
|
-
|
|
24183
|
-
|
|
24184
|
-
|
|
24170
|
+
const QuickFilterDropdownSingle = _ref => {
|
|
24171
|
+
let {
|
|
24172
|
+
label,
|
|
24173
|
+
hoverColor,
|
|
24174
|
+
options,
|
|
24175
|
+
selectedValue,
|
|
24176
|
+
placeHolder,
|
|
24177
|
+
onChange,
|
|
24178
|
+
disabled,
|
|
24179
|
+
width,
|
|
24180
|
+
error,
|
|
24181
|
+
errorMessage,
|
|
24182
|
+
xIconShow,
|
|
24183
|
+
labelColor,
|
|
24184
|
+
showLabelOnTop
|
|
24185
|
+
} = _ref;
|
|
24185
24186
|
const [isFocused, setIsFocused] = useState(false);
|
|
24186
24187
|
const [showOptions, setShowOptions] = useState(false);
|
|
24187
24188
|
const [inputValue, setInputValue] = useState("");
|
|
@@ -24638,25 +24639,26 @@ const IconContainer$2 = styled.div`
|
|
|
24638
24639
|
cursor: pointer;
|
|
24639
24640
|
`;
|
|
24640
24641
|
|
|
24641
|
-
const QuickFilterDropdownMultiSelection =
|
|
24642
|
-
|
|
24643
|
-
|
|
24644
|
-
|
|
24645
|
-
|
|
24646
|
-
|
|
24647
|
-
|
|
24648
|
-
|
|
24649
|
-
|
|
24650
|
-
|
|
24651
|
-
|
|
24652
|
-
|
|
24653
|
-
|
|
24654
|
-
|
|
24655
|
-
|
|
24656
|
-
|
|
24657
|
-
|
|
24658
|
-
|
|
24659
|
-
|
|
24642
|
+
const QuickFilterDropdownMultiSelection = _ref => {
|
|
24643
|
+
let {
|
|
24644
|
+
label,
|
|
24645
|
+
labelEmptyValue,
|
|
24646
|
+
options,
|
|
24647
|
+
selectedValue,
|
|
24648
|
+
placeHolder,
|
|
24649
|
+
onChange,
|
|
24650
|
+
required,
|
|
24651
|
+
disabled,
|
|
24652
|
+
width,
|
|
24653
|
+
height,
|
|
24654
|
+
error,
|
|
24655
|
+
errorMessage,
|
|
24656
|
+
labelColor,
|
|
24657
|
+
xIconShow,
|
|
24658
|
+
checkBoxColor,
|
|
24659
|
+
showLabelOnTop,
|
|
24660
|
+
dropdownHeight
|
|
24661
|
+
} = _ref;
|
|
24660
24662
|
const [isFocused, setIsFocused] = useState(false);
|
|
24661
24663
|
const [showOptions, setShowOptions] = useState(false);
|
|
24662
24664
|
const [inputValue, setInputValue] = useState('');
|
|
@@ -39625,6 +39627,22 @@ const HeroButton = styled.button`
|
|
|
39625
39627
|
pointer-events: none;
|
|
39626
39628
|
}
|
|
39627
39629
|
`;
|
|
39630
|
+
const EditableCell = styled.div`
|
|
39631
|
+
display: flex;
|
|
39632
|
+
gap: 10px;
|
|
39633
|
+
align-items: center;
|
|
39634
|
+
`;
|
|
39635
|
+
const PencilButton = styled.button`
|
|
39636
|
+
display: flex;
|
|
39637
|
+
align-items: center;
|
|
39638
|
+
justify-content: center;
|
|
39639
|
+
cursor: pointer;
|
|
39640
|
+
background-color: transparent;
|
|
39641
|
+
border: none;
|
|
39642
|
+
> svg {
|
|
39643
|
+
pointer-events: none;
|
|
39644
|
+
}
|
|
39645
|
+
`;
|
|
39628
39646
|
|
|
39629
39647
|
// MessageBox.styles.js
|
|
39630
39648
|
const ModalOverlay = styled.div`
|
|
@@ -40120,6 +40138,21 @@ const HeroIcon = ({
|
|
|
40120
40138
|
fill: "white"
|
|
40121
40139
|
}))));
|
|
40122
40140
|
|
|
40141
|
+
const PencilIcon = ({
|
|
40142
|
+
width = "15",
|
|
40143
|
+
height = "15",
|
|
40144
|
+
fill = "#B1B1B1"
|
|
40145
|
+
}) => /*#__PURE__*/React$1.createElement("svg", {
|
|
40146
|
+
width: width,
|
|
40147
|
+
height: height,
|
|
40148
|
+
viewBox: "0 0 15 15",
|
|
40149
|
+
fill: "none",
|
|
40150
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
40151
|
+
}, /*#__PURE__*/React$1.createElement("path", {
|
|
40152
|
+
d: "M1.78316 10.0243C1.89427 9.63542 2.11649 9.27426 2.39427 8.99648L10.8387 0.552084C11.5331 -0.142361 12.6721 -0.142361 13.3665 0.552084L14.4498 1.63542C14.5331 1.71875 14.6165 1.82986 14.6721 1.9132C15.1442 2.60764 15.0609 3.55208 14.4498 4.1632L6.00538 12.6076C5.9776 12.6354 5.92204 12.6632 5.89427 12.7187C5.61649 12.9409 5.31093 13.1076 4.9776 13.2187L2.81093 13.8576L1.61649 14.2187C1.39427 14.2743 1.14427 14.2187 0.9776 14.0243C0.78316 13.8576 0.727604 13.6076 0.810938 13.3854L1.14427 12.191L1.78316 10.0243ZM3.06093 10.4132L2.86649 11.052L2.42204 12.5799L3.94982 12.1354L4.58871 11.9409C4.78316 11.8854 4.92204 11.8021 5.06093 11.6632L11.422 5.30208L9.69979 3.57986L3.33871 9.94093C3.31093 9.94093 3.31093 9.96875 3.28316 9.99648C3.17204 10.1076 3.11649 10.2465 3.06093 10.4132Z",
|
|
40153
|
+
fill: fill
|
|
40154
|
+
}));
|
|
40155
|
+
|
|
40123
40156
|
// combinedShimmerHooks.js - Chrome shimmer effect integrated with your hooks
|
|
40124
40157
|
|
|
40125
40158
|
// Chrome Shimmer Component
|
|
@@ -40220,7 +40253,8 @@ const TableBody = /*#__PURE__*/forwardRef(({
|
|
|
40220
40253
|
onDropdownSelected = () => {},
|
|
40221
40254
|
onCheckboxClick = () => {},
|
|
40222
40255
|
onHeaderCheckboxClick = () => {},
|
|
40223
|
-
onHeroClick = () => {}
|
|
40256
|
+
onHeroClick = () => {},
|
|
40257
|
+
onEditableClick = () => {}
|
|
40224
40258
|
}, ref) => {
|
|
40225
40259
|
// MOVE ALL VALIDATION TO THE VERY TOP BEFORE ANY HOOKS
|
|
40226
40260
|
if (!Array.isArray(data) || !Array.isArray(columns)) {
|
|
@@ -40300,6 +40334,26 @@ const TableBody = /*#__PURE__*/forwardRef(({
|
|
|
40300
40334
|
}
|
|
40301
40335
|
}, [changeFocusIndex]);
|
|
40302
40336
|
|
|
40337
|
+
// Close all dropdowns when clicking outside
|
|
40338
|
+
useEffect(() => {
|
|
40339
|
+
const handleClickOutside = () => {
|
|
40340
|
+
setOpenDropdowns({});
|
|
40341
|
+
};
|
|
40342
|
+
document.addEventListener("click", handleClickOutside);
|
|
40343
|
+
return () => {
|
|
40344
|
+
document.removeEventListener("click", handleClickOutside);
|
|
40345
|
+
};
|
|
40346
|
+
}, []);
|
|
40347
|
+
|
|
40348
|
+
// HANDLE SPECIAL CASE: EMPTY DATA AFTER ALL HOOKS
|
|
40349
|
+
if (data.length === 0) {
|
|
40350
|
+
return /*#__PURE__*/React$1.createElement(StyledTableBody, {
|
|
40351
|
+
ref: ref
|
|
40352
|
+
}, /*#__PURE__*/React$1.createElement(TableRow, null, /*#__PURE__*/React$1.createElement(TableCell, {
|
|
40353
|
+
colSpan: columns.length
|
|
40354
|
+
}, "No data available")));
|
|
40355
|
+
}
|
|
40356
|
+
|
|
40303
40357
|
// Handle row click for focus state
|
|
40304
40358
|
const handleRowClick = (row, rowIndex) => {
|
|
40305
40359
|
setFocusedRowIndex(rowIndex);
|
|
@@ -40357,7 +40411,7 @@ const TableBody = /*#__PURE__*/forwardRef(({
|
|
|
40357
40411
|
return "";
|
|
40358
40412
|
}
|
|
40359
40413
|
try {
|
|
40360
|
-
if ((value === null || value === undefined) && column?.fieldType?.toLowerCase() !== "comments") {
|
|
40414
|
+
if ((value === null || value === undefined) && column?.fieldType?.toLowerCase() !== "comments" && column?.fieldType?.toLowerCase() !== "editable") {
|
|
40361
40415
|
return "";
|
|
40362
40416
|
}
|
|
40363
40417
|
|
|
@@ -40488,6 +40542,23 @@ const TableBody = /*#__PURE__*/forwardRef(({
|
|
|
40488
40542
|
console.warn('Error formatting dotIndicator:', e);
|
|
40489
40543
|
return null;
|
|
40490
40544
|
}
|
|
40545
|
+
case "editable":
|
|
40546
|
+
try {
|
|
40547
|
+
const isDefine = value === null || value === undefined;
|
|
40548
|
+
return /*#__PURE__*/React$1.createElement(EditableCell, null, /*#__PURE__*/React$1.createElement("span", {
|
|
40549
|
+
style: {
|
|
40550
|
+
color: isDefine ? "#8B8989" : "inherit"
|
|
40551
|
+
}
|
|
40552
|
+
}, value ?? "Define"), /*#__PURE__*/React$1.createElement(PencilButton, {
|
|
40553
|
+
onClick: e => {
|
|
40554
|
+
e.stopPropagation();
|
|
40555
|
+
handleEditableClick(row, column.key, value, rowIndex);
|
|
40556
|
+
}
|
|
40557
|
+
}, /*#__PURE__*/React$1.createElement(PencilIcon, null)));
|
|
40558
|
+
} catch (e) {
|
|
40559
|
+
console.warn('Error formatting editable:', e);
|
|
40560
|
+
return null;
|
|
40561
|
+
}
|
|
40491
40562
|
case "packagestatus":
|
|
40492
40563
|
try {
|
|
40493
40564
|
const applyTooltipLogic = (element, tooltipText) => {
|
|
@@ -40781,7 +40852,7 @@ const TableBody = /*#__PURE__*/forwardRef(({
|
|
|
40781
40852
|
if (value === null || value === undefined) return null;
|
|
40782
40853
|
return /*#__PURE__*/React$1.createElement(HeroButton, {
|
|
40783
40854
|
onClick: e => {
|
|
40784
|
-
|
|
40855
|
+
e.stopPropagation();
|
|
40785
40856
|
if (onHeroClick) {
|
|
40786
40857
|
onHeroClick(row, !value);
|
|
40787
40858
|
}
|
|
@@ -40858,26 +40929,17 @@ const TableBody = /*#__PURE__*/forwardRef(({
|
|
|
40858
40929
|
onDropdownSelected(row, selectedOption, columnKey);
|
|
40859
40930
|
}
|
|
40860
40931
|
};
|
|
40861
|
-
|
|
40862
|
-
|
|
40863
|
-
|
|
40864
|
-
|
|
40865
|
-
|
|
40866
|
-
|
|
40867
|
-
|
|
40868
|
-
|
|
40869
|
-
|
|
40870
|
-
|
|
40871
|
-
}
|
|
40872
|
-
|
|
40873
|
-
// HANDLE SPECIAL CASE: EMPTY DATA AFTER ALL HOOKS
|
|
40874
|
-
if (data.length === 0) {
|
|
40875
|
-
return /*#__PURE__*/React$1.createElement(StyledTableBody, {
|
|
40876
|
-
ref: ref
|
|
40877
|
-
}, /*#__PURE__*/React$1.createElement(TableRow, null, /*#__PURE__*/React$1.createElement(TableCell, {
|
|
40878
|
-
colSpan: columns.length
|
|
40879
|
-
}, "No data available")));
|
|
40880
|
-
}
|
|
40932
|
+
const handleEditableClick = (row, columnKey, currentValue, rowIndex) => {
|
|
40933
|
+
if (onEditableClick) {
|
|
40934
|
+
onEditableClick({
|
|
40935
|
+
fullRow: row,
|
|
40936
|
+
columnName: columnKey,
|
|
40937
|
+
currentValue: currentValue,
|
|
40938
|
+
rowIndex: rowIndex
|
|
40939
|
+
});
|
|
40940
|
+
}
|
|
40941
|
+
console.log('handler--------', row, columnKey, currentValue, rowIndex);
|
|
40942
|
+
};
|
|
40881
40943
|
return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(StyledTableBody, {
|
|
40882
40944
|
ref: ref
|
|
40883
40945
|
}, data.map((row, rowIndex) => {
|
|
@@ -41027,7 +41089,8 @@ TableBody.propTypes = {
|
|
|
41027
41089
|
onDropdownSelected: PropTypes.func,
|
|
41028
41090
|
onCheckboxClick: PropTypes.func,
|
|
41029
41091
|
onHeaderCheckboxClick: PropTypes.func,
|
|
41030
|
-
onHeroClick: PropTypes.func
|
|
41092
|
+
onHeroClick: PropTypes.func,
|
|
41093
|
+
onEditableClick: PropTypes.func
|
|
41031
41094
|
};
|
|
41032
41095
|
TableBody.displayName = "TableBody";
|
|
41033
41096
|
|
|
@@ -44392,6 +44455,7 @@ const Table = props => {
|
|
|
44392
44455
|
headerCheckboxStates = {},
|
|
44393
44456
|
onHeroClick = () => {},
|
|
44394
44457
|
dotIndicatorColor = '#34D399',
|
|
44458
|
+
onEditableClick = () => {},
|
|
44395
44459
|
// Accept ref as a regular prop
|
|
44396
44460
|
ref = null
|
|
44397
44461
|
} = props;
|
|
@@ -44545,7 +44609,8 @@ const Table = props => {
|
|
|
44545
44609
|
onDropdownSelected: onDropdownSelected,
|
|
44546
44610
|
onCheckboxClick: onCheckboxClick,
|
|
44547
44611
|
onHeaderCheckboxClick: onHeaderCheckboxClick,
|
|
44548
|
-
onHeroClick: onHeroClick
|
|
44612
|
+
onHeroClick: onHeroClick,
|
|
44613
|
+
onEditableClick: onEditableClick
|
|
44549
44614
|
})), 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, null, showNoDataInSearch ? /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("strong", null, noDataInSearchTitle), /*#__PURE__*/React$1.createElement("br", null), noDataInSearchMessage) : /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("strong", null, noEventsTitle), /*#__PURE__*/React$1.createElement("br", null), noEventsSubtitle)), !showNoDataInSearch && showNoEventsButton && /*#__PURE__*/React$1.createElement(Button$1, {
|
|
44550
44615
|
height: "45px",
|
|
44551
44616
|
leftIcon: noEventsButtonIcon,
|