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.js CHANGED
@@ -24177,21 +24177,22 @@ const DeleteIcon = styled__default["default"].div`
24177
24177
  position: absolute;
24178
24178
  `;
24179
24179
 
24180
- const QuickFilterDropdownSingle = ({
24181
- label,
24182
- hoverColor,
24183
- options,
24184
- selectedValue,
24185
- placeHolder,
24186
- onChange,
24187
- disabled,
24188
- width,
24189
- error,
24190
- errorMessage,
24191
- xIconShow,
24192
- labelColor,
24193
- showLabelOnTop
24194
- }) => {
24180
+ const QuickFilterDropdownSingle = _ref => {
24181
+ let {
24182
+ label,
24183
+ hoverColor,
24184
+ options,
24185
+ selectedValue,
24186
+ placeHolder,
24187
+ onChange,
24188
+ disabled,
24189
+ width,
24190
+ error,
24191
+ errorMessage,
24192
+ xIconShow,
24193
+ labelColor,
24194
+ showLabelOnTop
24195
+ } = _ref;
24195
24196
  const [isFocused, setIsFocused] = React$1.useState(false);
24196
24197
  const [showOptions, setShowOptions] = React$1.useState(false);
24197
24198
  const [inputValue, setInputValue] = React$1.useState("");
@@ -24648,25 +24649,26 @@ const IconContainer$2 = styled__default["default"].div`
24648
24649
  cursor: pointer;
24649
24650
  `;
24650
24651
 
24651
- const QuickFilterDropdownMultiSelection = ({
24652
- label,
24653
- labelEmptyValue,
24654
- options,
24655
- selectedValue,
24656
- placeHolder,
24657
- onChange,
24658
- required,
24659
- disabled,
24660
- width,
24661
- height,
24662
- error,
24663
- errorMessage,
24664
- labelColor,
24665
- xIconShow,
24666
- checkBoxColor,
24667
- showLabelOnTop,
24668
- dropdownHeight
24669
- }) => {
24652
+ const QuickFilterDropdownMultiSelection = _ref => {
24653
+ let {
24654
+ label,
24655
+ labelEmptyValue,
24656
+ options,
24657
+ selectedValue,
24658
+ placeHolder,
24659
+ onChange,
24660
+ required,
24661
+ disabled,
24662
+ width,
24663
+ height,
24664
+ error,
24665
+ errorMessage,
24666
+ labelColor,
24667
+ xIconShow,
24668
+ checkBoxColor,
24669
+ showLabelOnTop,
24670
+ dropdownHeight
24671
+ } = _ref;
24670
24672
  const [isFocused, setIsFocused] = React$1.useState(false);
24671
24673
  const [showOptions, setShowOptions] = React$1.useState(false);
24672
24674
  const [inputValue, setInputValue] = React$1.useState('');
@@ -39635,6 +39637,22 @@ const HeroButton = styled__default["default"].button`
39635
39637
  pointer-events: none;
39636
39638
  }
39637
39639
  `;
39640
+ const EditableCell = styled__default["default"].div`
39641
+ display: flex;
39642
+ gap: 10px;
39643
+ align-items: center;
39644
+ `;
39645
+ const PencilButton = styled__default["default"].button`
39646
+ display: flex;
39647
+ align-items: center;
39648
+ justify-content: center;
39649
+ cursor: pointer;
39650
+ background-color: transparent;
39651
+ border: none;
39652
+ > svg {
39653
+ pointer-events: none;
39654
+ }
39655
+ `;
39638
39656
 
39639
39657
  // MessageBox.styles.js
39640
39658
  const ModalOverlay = styled__default["default"].div`
@@ -40130,6 +40148,21 @@ const HeroIcon = ({
40130
40148
  fill: "white"
40131
40149
  }))));
40132
40150
 
40151
+ const PencilIcon = ({
40152
+ width = "15",
40153
+ height = "15",
40154
+ fill = "#B1B1B1"
40155
+ }) => /*#__PURE__*/React__default["default"].createElement("svg", {
40156
+ width: width,
40157
+ height: height,
40158
+ viewBox: "0 0 15 15",
40159
+ fill: "none",
40160
+ xmlns: "http://www.w3.org/2000/svg"
40161
+ }, /*#__PURE__*/React__default["default"].createElement("path", {
40162
+ 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",
40163
+ fill: fill
40164
+ }));
40165
+
40133
40166
  // combinedShimmerHooks.js - Chrome shimmer effect integrated with your hooks
40134
40167
 
40135
40168
  // Chrome Shimmer Component
@@ -40230,7 +40263,8 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
40230
40263
  onDropdownSelected = () => {},
40231
40264
  onCheckboxClick = () => {},
40232
40265
  onHeaderCheckboxClick = () => {},
40233
- onHeroClick = () => {}
40266
+ onHeroClick = () => {},
40267
+ onEditableClick = () => {}
40234
40268
  }, ref) => {
40235
40269
  // MOVE ALL VALIDATION TO THE VERY TOP BEFORE ANY HOOKS
40236
40270
  if (!Array.isArray(data) || !Array.isArray(columns)) {
@@ -40310,6 +40344,26 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
40310
40344
  }
40311
40345
  }, [changeFocusIndex]);
40312
40346
 
40347
+ // Close all dropdowns when clicking outside
40348
+ React$1.useEffect(() => {
40349
+ const handleClickOutside = () => {
40350
+ setOpenDropdowns({});
40351
+ };
40352
+ document.addEventListener("click", handleClickOutside);
40353
+ return () => {
40354
+ document.removeEventListener("click", handleClickOutside);
40355
+ };
40356
+ }, []);
40357
+
40358
+ // HANDLE SPECIAL CASE: EMPTY DATA AFTER ALL HOOKS
40359
+ if (data.length === 0) {
40360
+ return /*#__PURE__*/React__default["default"].createElement(StyledTableBody, {
40361
+ ref: ref
40362
+ }, /*#__PURE__*/React__default["default"].createElement(TableRow, null, /*#__PURE__*/React__default["default"].createElement(TableCell, {
40363
+ colSpan: columns.length
40364
+ }, "No data available")));
40365
+ }
40366
+
40313
40367
  // Handle row click for focus state
40314
40368
  const handleRowClick = (row, rowIndex) => {
40315
40369
  setFocusedRowIndex(rowIndex);
@@ -40367,7 +40421,7 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
40367
40421
  return "";
40368
40422
  }
40369
40423
  try {
40370
- if ((value === null || value === undefined) && column?.fieldType?.toLowerCase() !== "comments") {
40424
+ if ((value === null || value === undefined) && column?.fieldType?.toLowerCase() !== "comments" && column?.fieldType?.toLowerCase() !== "editable") {
40371
40425
  return "";
40372
40426
  }
40373
40427
 
@@ -40498,6 +40552,23 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
40498
40552
  console.warn('Error formatting dotIndicator:', e);
40499
40553
  return null;
40500
40554
  }
40555
+ case "editable":
40556
+ try {
40557
+ const isDefine = value === null || value === undefined;
40558
+ return /*#__PURE__*/React__default["default"].createElement(EditableCell, null, /*#__PURE__*/React__default["default"].createElement("span", {
40559
+ style: {
40560
+ color: isDefine ? "#8B8989" : "inherit"
40561
+ }
40562
+ }, value ?? "Define"), /*#__PURE__*/React__default["default"].createElement(PencilButton, {
40563
+ onClick: e => {
40564
+ e.stopPropagation();
40565
+ handleEditableClick(row, column.key, value, rowIndex);
40566
+ }
40567
+ }, /*#__PURE__*/React__default["default"].createElement(PencilIcon, null)));
40568
+ } catch (e) {
40569
+ console.warn('Error formatting editable:', e);
40570
+ return null;
40571
+ }
40501
40572
  case "packagestatus":
40502
40573
  try {
40503
40574
  const applyTooltipLogic = (element, tooltipText) => {
@@ -40791,7 +40862,7 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
40791
40862
  if (value === null || value === undefined) return null;
40792
40863
  return /*#__PURE__*/React__default["default"].createElement(HeroButton, {
40793
40864
  onClick: e => {
40794
- // e.stopPropagation();
40865
+ e.stopPropagation();
40795
40866
  if (onHeroClick) {
40796
40867
  onHeroClick(row, !value);
40797
40868
  }
@@ -40868,26 +40939,17 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
40868
40939
  onDropdownSelected(row, selectedOption, columnKey);
40869
40940
  }
40870
40941
  };
40871
-
40872
- // Close all dropdowns when clicking outside
40873
- React__default["default"].useEffect(() => {
40874
- const handleClickOutside = () => {
40875
- setOpenDropdowns({});
40876
- };
40877
- document.addEventListener("click", handleClickOutside);
40878
- return () => {
40879
- document.removeEventListener("click", handleClickOutside);
40880
- };
40881
- }, []);
40882
-
40883
- // HANDLE SPECIAL CASE: EMPTY DATA AFTER ALL HOOKS
40884
- if (data.length === 0) {
40885
- return /*#__PURE__*/React__default["default"].createElement(StyledTableBody, {
40886
- ref: ref
40887
- }, /*#__PURE__*/React__default["default"].createElement(TableRow, null, /*#__PURE__*/React__default["default"].createElement(TableCell, {
40888
- colSpan: columns.length
40889
- }, "No data available")));
40890
- }
40942
+ const handleEditableClick = (row, columnKey, currentValue, rowIndex) => {
40943
+ if (onEditableClick) {
40944
+ onEditableClick({
40945
+ fullRow: row,
40946
+ columnName: columnKey,
40947
+ currentValue: currentValue,
40948
+ rowIndex: rowIndex
40949
+ });
40950
+ }
40951
+ console.log('handler--------', row, columnKey, currentValue, rowIndex);
40952
+ };
40891
40953
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(StyledTableBody, {
40892
40954
  ref: ref
40893
40955
  }, data.map((row, rowIndex) => {
@@ -41037,7 +41099,8 @@ TableBody.propTypes = {
41037
41099
  onDropdownSelected: PropTypes.func,
41038
41100
  onCheckboxClick: PropTypes.func,
41039
41101
  onHeaderCheckboxClick: PropTypes.func,
41040
- onHeroClick: PropTypes.func
41102
+ onHeroClick: PropTypes.func,
41103
+ onEditableClick: PropTypes.func
41041
41104
  };
41042
41105
  TableBody.displayName = "TableBody";
41043
41106
 
@@ -44402,6 +44465,7 @@ const Table = props => {
44402
44465
  headerCheckboxStates = {},
44403
44466
  onHeroClick = () => {},
44404
44467
  dotIndicatorColor = '#34D399',
44468
+ onEditableClick = () => {},
44405
44469
  // Accept ref as a regular prop
44406
44470
  ref = null
44407
44471
  } = props;
@@ -44555,7 +44619,8 @@ const Table = props => {
44555
44619
  onDropdownSelected: onDropdownSelected,
44556
44620
  onCheckboxClick: onCheckboxClick,
44557
44621
  onHeaderCheckboxClick: onHeaderCheckboxClick,
44558
- onHeroClick: onHeroClick
44622
+ onHeroClick: onHeroClick,
44623
+ onEditableClick: onEditableClick
44559
44624
  })), 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, null, showNoDataInSearch ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("strong", null, noDataInSearchTitle), /*#__PURE__*/React__default["default"].createElement("br", null), noDataInSearchMessage) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("strong", null, noEventsTitle), /*#__PURE__*/React__default["default"].createElement("br", null), noEventsSubtitle)), !showNoDataInSearch && showNoEventsButton && /*#__PURE__*/React__default["default"].createElement(Button$1, {
44560
44625
  height: "45px",
44561
44626
  leftIcon: noEventsButtonIcon,