sag_components 2.0.0-beta275 → 2.0.0-beta276

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.d.ts CHANGED
@@ -1578,29 +1578,29 @@ declare function ModalDrawer({ open, height, onClose, children, widthPercent }:
1578
1578
  widthPercent?: number;
1579
1579
  }): react_jsx_runtime.JSX.Element;
1580
1580
 
1581
- declare function OverlayDropdown({ data, value, onSelectClick, disabled, isDarkerBackground, required, selectedColor, hoverColor, dropdownMaxHeight, width, minWidth, height, label, labelEmptyValue, showLabelOnTop, placeHolder, labelColor, placeHolderColor, margin, dropdownWidth, editableDigitalCoupon, ...props }: {
1581
+ declare function OverlayDropdown({ data, value, onSelectClick, label, labelEmptyValue, showLabelOnTop, labelColor, placeHolder, placeHolderColor, required, disabled, isDarkerBackground, editableDigitalCoupon, selectedColor, hoverColor, width, minWidth, dropdownWidth, dropdownMaxHeight, height, margin, ...props }: {
1582
1582
  [x: string]: any;
1583
1583
  data?: any[];
1584
1584
  value: any;
1585
1585
  onSelectClick: any;
1586
+ label: any;
1587
+ labelEmptyValue: any;
1588
+ showLabelOnTop: any;
1589
+ labelColor: any;
1590
+ placeHolder: any;
1591
+ placeHolderColor: any;
1592
+ required?: boolean;
1586
1593
  disabled?: boolean;
1587
1594
  isDarkerBackground?: boolean;
1588
- required?: boolean;
1595
+ editableDigitalCoupon?: boolean;
1589
1596
  selectedColor?: string;
1590
1597
  hoverColor?: string;
1591
- dropdownMaxHeight?: string;
1592
1598
  width?: string;
1593
1599
  minWidth?: string;
1600
+ dropdownWidth?: string;
1601
+ dropdownMaxHeight?: string;
1594
1602
  height?: string;
1595
- label: any;
1596
- labelEmptyValue: any;
1597
- showLabelOnTop: any;
1598
- placeHolder: any;
1599
- labelColor: any;
1600
- placeHolderColor: any;
1601
1603
  margin?: string;
1602
- dropdownWidth?: string;
1603
- editableDigitalCoupon?: boolean;
1604
1604
  }): react_jsx_runtime.JSX.Element;
1605
1605
 
1606
1606
  declare function MessageBox({ isOpen, isDisabled, onClose, onConfirm, title, primaryText, secondaryText, width, height, color, hoverColor, opacity, secondaryColor, seperateSectionBorder, children, tooltipContent, }: {
package/dist/index.esm.js CHANGED
@@ -9292,7 +9292,6 @@ const Label$7 = styled.label`
9292
9292
  return props.isFocused || props.hasValue ? '0px' : `${height / 2 - 4}px`;
9293
9293
  }};
9294
9294
  left: ${props => props.isFocused || props.hasValue ? '23px' : '10px'};
9295
- font-family: Poppins;
9296
9295
  transform: translateY(-50%);
9297
9296
  transition: ${props => props.showLabelOnTop ? 'top 0.3s ease, font-size 0.3s ease, color 0.3s ease' : ''} ;
9298
9297
  display: flex;
@@ -24543,7 +24542,6 @@ const OptionsContainer$1 = styled.div`
24543
24542
  width: 100%;
24544
24543
  background-color: #fff;
24545
24544
  display: ${props => props.showoptions && props.filteredoptions?.length > 0 ? 'block' : 'none'};
24546
-
24547
24545
  `;
24548
24546
  const OptionsSubContainer = styled.ul`
24549
24547
  list-style: none;
@@ -24555,7 +24553,6 @@ const OptionsSubContainer = styled.ul`
24555
24553
  left: 0;
24556
24554
  z-index: 101;
24557
24555
  width: calc(100% - 23px);
24558
- font-family: Poppins;
24559
24556
  border-radius: 4px;
24560
24557
  background-color: #fff;
24561
24558
  display: ${props => props.showoptions && props.filteredoptions?.length > 0 ? 'block' : 'none'};
@@ -24566,13 +24563,10 @@ const OptionsSubContainer = styled.ul`
24566
24563
  const OptionItem = styled.li`
24567
24564
  display: flex;
24568
24565
  align-items: center;
24569
- gap: 8px;
24570
24566
  padding: 10px;
24571
24567
  cursor: pointer;
24572
24568
  color: #212121;
24573
- font-family: Poppins;
24574
24569
  font-size: 14px;
24575
- font-style: normal;
24576
24570
  font-weight: 400;
24577
24571
  transition: background-color 0.3s;
24578
24572
 
@@ -24587,7 +24581,6 @@ const ErrorMessage$1 = styled.div`
24587
24581
  `;
24588
24582
  const SelectedOptionsContainer = styled.div`
24589
24583
  display: flex;
24590
- flex-direction: row;
24591
24584
  align-items: center;
24592
24585
  gap: 4px;
24593
24586
  flex-wrap: nowrap;
@@ -24636,7 +24629,8 @@ const SelectedOptionCount = styled.div`
24636
24629
  const IconContainer$2 = styled.div`
24637
24630
  display: flex;
24638
24631
  padding: 2px;
24639
- cursor: pointer;
24632
+ margin-right: 8px;
24633
+ cursor: pointer;
24640
24634
  `;
24641
24635
 
24642
24636
  const QuickFilterDropdownMultiSelection = _ref => {
@@ -35687,7 +35681,7 @@ const Label$3 = styled.label`
35687
35681
  if (props.multiline) {
35688
35682
  return props.isFocused || props.hasValue ? '0px' : '20px';
35689
35683
  }
35690
- return props.isFocused || props.hasValue ? '0px' : props.size === 'medium' ? '27px' : '17px';
35684
+ return props.isFocused || props.hasValue ? '0px' : props.size === 'medium' ? '50%' : '17px';
35691
35685
  }};
35692
35686
  left: ${props => {
35693
35687
  if (props.multiline) {
@@ -35695,7 +35689,6 @@ const Label$3 = styled.label`
35695
35689
  }
35696
35690
  return props.isFocused || props.hasValue ? '23px' : props.leftIcon && props.leftIcon !== 'none' ? '42px' : '16px';
35697
35691
  }};
35698
- font-family: Poppins;
35699
35692
  transform: translateY(-50%);
35700
35693
  transition: top 0.3s ease, font-size 0.3s ease, color 0.3s ease;
35701
35694
  display: flex;
@@ -36117,19 +36110,15 @@ const ToggleInput = styled.input`
36117
36110
  const ToggleSlider = styled.span`
36118
36111
  display: block;
36119
36112
  position: relative;
36120
- background: ${_ref => {
36121
- let {
36122
- checked,
36123
- disabled
36124
- } = _ref;
36125
- return checked ? "#006d6a" : disabled ? "#B1B1B1" : "#D0D0D0";
36126
- }};
36113
+ background: ${({
36114
+ checked,
36115
+ disabled
36116
+ }) => checked ? "#006d6a" : disabled ? "#B1B1B1" : "#D0D0D0"};
36127
36117
  border-radius: 999px;
36128
36118
  transition: background 0.2s;
36129
- ${_ref2 => {
36130
- let {
36131
- size
36132
- } = _ref2;
36119
+ ${({
36120
+ size
36121
+ }) => {
36133
36122
  switch (size) {
36134
36123
  case "s":
36135
36124
  return css`width: 40px; height: 20px;`;
@@ -36145,18 +36134,14 @@ const ToggleSlider = styled.span`
36145
36134
  left: 3px;
36146
36135
  top: 50%;
36147
36136
  transform: translateY(-50%);
36148
- background: ${_ref3 => {
36149
- let {
36150
- disabled
36151
- } = _ref3;
36152
- return disabled ? "#D0D0D0" : "#fff";
36153
- }};
36137
+ background: ${({
36138
+ disabled
36139
+ }) => disabled ? "#D0D0D0" : "#fff"};
36154
36140
  border-radius: 50%;
36155
36141
  transition: left 0.2s, width 0.2s, height 0.2s;
36156
- ${_ref4 => {
36157
- let {
36158
- size
36159
- } = _ref4;
36142
+ ${({
36143
+ size
36144
+ }) => {
36160
36145
  switch (size) {
36161
36146
  case "s":
36162
36147
  return css`width: 14px; height: 14px;`;
@@ -36166,11 +36151,10 @@ const ToggleSlider = styled.span`
36166
36151
  return css`width: 20px; height: 20px;`;
36167
36152
  }
36168
36153
  }}
36169
- left: ${_ref5 => {
36170
- let {
36171
- checked,
36172
- size
36173
- } = _ref5;
36154
+ left: ${({
36155
+ checked,
36156
+ size
36157
+ }) => {
36174
36158
  if (!checked) return "3px";
36175
36159
  switch (size) {
36176
36160
  case "s":
@@ -36184,9 +36168,9 @@ const ToggleSlider = styled.span`
36184
36168
  }
36185
36169
  `;
36186
36170
 
36187
- /**
36188
- * ToggleSwitch component for on/off states.
36189
- * Supports small/large sizes and disabled state.
36171
+ /**
36172
+ * ToggleSwitch component for on/off states.
36173
+ * Supports small/large sizes and disabled state.
36190
36174
  */
36191
36175
  function ToggleSwitch(_ref) {
36192
36176
  let {
@@ -37428,8 +37412,8 @@ const ColumnContent = styled.div`
37428
37412
  min-height: 20px;
37429
37413
  `;
37430
37414
  const ColumnCheckbox = styled.input`
37431
- width: 16px;
37432
- height: 16px;
37415
+ width: 18px;
37416
+ height: 18px;
37433
37417
  cursor: pointer;
37434
37418
  margin: 0;
37435
37419
  `;
@@ -40413,6 +40397,7 @@ const Radio = styled.input`
40413
40397
  `;
40414
40398
  const Actions$1 = styled.div`
40415
40399
  display: flex;
40400
+ align-items: center;
40416
40401
  justify-content: space-between;
40417
40402
  padding-top: 12px;
40418
40403
  `;
@@ -40854,21 +40839,7 @@ const SortIcon = ({
40854
40839
  }));
40855
40840
  };
40856
40841
 
40857
- // TableHeader.jsx - Updated with debounce
40858
-
40859
- // Inline debounce hook
40860
- const useDebounce = (value, delay = 1500) => {
40861
- const [debouncedValue, setDebouncedValue] = useState(value);
40862
- useEffect(() => {
40863
- const handler = setTimeout(() => {
40864
- setDebouncedValue(value);
40865
- }, delay);
40866
- return () => {
40867
- clearTimeout(handler);
40868
- };
40869
- }, [value, delay]);
40870
- return debouncedValue;
40871
- };
40842
+ // TableHeader.jsx
40872
40843
  const TableHeader = ({
40873
40844
  columns,
40874
40845
  onSort,
@@ -40879,8 +40850,7 @@ const TableHeader = ({
40879
40850
  expandable = false,
40880
40851
  onHeaderCheckboxClick = () => {},
40881
40852
  headerCheckboxStates = {},
40882
- resetFiltersKey = 0,
40883
- debounceDelay = 500 // NEW: Add debounce delay prop (default 500ms)
40853
+ resetFiltersKey = 0 // NEW: Add this prop
40884
40854
  }) => {
40885
40855
  const [focusedFilter, setFocusedFilter] = useState(null);
40886
40856
  const [focusedSort, setFocusedSort] = useState(null);
@@ -40890,21 +40860,17 @@ const TableHeader = ({
40890
40860
  top: 0,
40891
40861
  left: 0
40892
40862
  });
40893
-
40894
- // Internal state that updates immediately (for UI responsiveness)
40895
40863
  const [filterState, setFilterState] = useState({});
40896
40864
  const [filterSelections, setFilterSelections] = useState({});
40897
40865
  const [activeSortColumn, setActiveSortColumn] = useState(null);
40898
40866
  const [activeSortValue, setActiveSortValue] = useState(null);
40899
-
40900
- // Debounced values (these will be passed to parent after delay)
40901
- const debouncedFilterState = useDebounce(filterState, debounceDelay);
40902
40867
  const iconRefs = useRef({});
40903
40868
  const popupRef = useRef(null);
40904
40869
 
40905
- // Reset internal state when resetFiltersKey changes
40870
+ // NEW: Reset internal state when resetFiltersKey changes
40906
40871
  useEffect(() => {
40907
40872
  if (resetFiltersKey > 0) {
40873
+ // Reset filter selections to default (all selected)
40908
40874
  const resetSelections = {};
40909
40875
  columns.forEach(column => {
40910
40876
  if (column.filter && column.filterOptions) {
@@ -40920,9 +40886,15 @@ const TableHeader = ({
40920
40886
  }
40921
40887
  });
40922
40888
  setFilterSelections(resetSelections);
40889
+
40890
+ // Reset filter state
40923
40891
  setFilterState({});
40892
+
40893
+ // Reset sort state
40924
40894
  setActiveSortColumn(null);
40925
40895
  setActiveSortValue(null);
40896
+
40897
+ // Close any open popups
40926
40898
  setVisibleFilterPopWrapper(null);
40927
40899
  setVisibleSortPopWrapper(null);
40928
40900
  }
@@ -40965,14 +40937,6 @@ const TableHeader = ({
40965
40937
  return hasChanges ? newSelections : prevSelections;
40966
40938
  });
40967
40939
  }, [columns]);
40968
-
40969
- // 🎯 KEY CHANGE: Use debounced value to trigger parent callback
40970
- useEffect(() => {
40971
- // Only call onFilter if there's actual filter data
40972
- if (Object.keys(debouncedFilterState).length > 0) {
40973
- onFilter(debouncedFilterState);
40974
- }
40975
- }, [debouncedFilterState, onFilter]);
40976
40940
  const isFilterInDefaultState = columnKey => {
40977
40941
  const filterData = filterState[columnKey];
40978
40942
  if (!filterData) {
@@ -41065,6 +41029,11 @@ const TableHeader = ({
41065
41029
  setVisibleSortPopWrapper(prevKey => prevKey === key ? null : key);
41066
41030
  setVisibleFilterPopWrapper(null);
41067
41031
  };
41032
+ useEffect(() => {
41033
+ if (Object.keys(filterState).length > 0) {
41034
+ onFilter(filterState);
41035
+ }
41036
+ }, [filterState]);
41068
41037
  const handleFilter = key => {
41069
41038
  const iconElement = iconRefs.current[`filter-${key}`];
41070
41039
  if (iconElement) {
@@ -41094,9 +41063,6 @@ const TableHeader = ({
41094
41063
  onSort(columnKey, null);
41095
41064
  }
41096
41065
  };
41097
-
41098
- // 🎯 Filter changes update immediately in UI (filterState)
41099
- // But parent callback is triggered only after debounce
41100
41066
  const handleFilterSelectionChange = (columnKey, selectionData) => {
41101
41067
  setFilterSelections(prev => {
41102
41068
  const updated = {
@@ -41105,8 +41071,6 @@ const TableHeader = ({
41105
41071
  };
41106
41072
  return updated;
41107
41073
  });
41108
-
41109
- // Update internal state immediately for responsive UI
41110
41074
  setFilterState(prev => ({
41111
41075
  ...prev,
41112
41076
  [columnKey]: selectionData.filterData
@@ -41243,7 +41207,6 @@ const TableHeader = ({
41243
41207
  placeholder: column.key === 'EventCode' ? 'Enter Event ID' : 'Search..',
41244
41208
  fieldHeight: "40px",
41245
41209
  onTyping: value => {
41246
- // Update internal state immediately
41247
41210
  setFilterState(prev => ({
41248
41211
  ...prev,
41249
41212
  [key]: value
@@ -41278,7 +41241,6 @@ const TableHeader = ({
41278
41241
  fields: currentFilterState.fields
41279
41242
  } : null,
41280
41243
  onApply: data => {
41281
- // Update internal state immediately
41282
41244
  setFilterState(prev => ({
41283
41245
  ...prev,
41284
41246
  [key]: data
@@ -41341,14 +41303,7 @@ const TableHeader = ({
41341
41303
  onChange: e => handleHeaderCheckboxClick(column.key, e),
41342
41304
  "data-column": column.key,
41343
41305
  style: {
41344
- width: '18px',
41345
- height: '18px',
41346
- marginLeft: '10px',
41347
- cursor: 'pointer',
41348
- accentColor: '#066768',
41349
- display: 'flex',
41350
- alignItems: 'center',
41351
- justifyContent: 'center'
41306
+ accentColor: '#066768'
41352
41307
  }
41353
41308
  }), column.title && /*#__PURE__*/React$1.createElement(ColumnLabel, null, column.title), (column.filter || column.sort) && /*#__PURE__*/React$1.createElement(ColumnActions, null, column.sort && /*#__PURE__*/React$1.createElement(IconButton, {
41354
41309
  ref: el => iconRefs.current[`sort-${column.key}`] = el,
@@ -42106,6 +42061,18 @@ styled.div`
42106
42061
  }
42107
42062
  `}
42108
42063
  `;
42064
+ const CheckboxInput = styled.input`
42065
+ width: 18px;
42066
+ height: 18px;
42067
+ margin: 0;
42068
+ accent-color: ${props => props.buttonColor || '#066768'};
42069
+ cursor: pointer;
42070
+
42071
+ &:disabled {
42072
+ cursor: not-allowed;
42073
+ opacity: 0.5;
42074
+ }
42075
+ `;
42109
42076
  const HeroButton = styled.button`
42110
42077
  display: flex;
42111
42078
  align-items: center;
@@ -42749,6 +42716,7 @@ const TableBody = /*#__PURE__*/forwardRef(({
42749
42716
  onDropdownSelected = () => {},
42750
42717
  onCheckboxClick = () => {},
42751
42718
  onHeaderCheckboxClick = () => {},
42719
+ disableCheckboxTooltipText = "",
42752
42720
  onHeroClick = () => {},
42753
42721
  onEditableClick = () => {},
42754
42722
  isEditMode = false,
@@ -43152,12 +43120,12 @@ const TableBody = /*#__PURE__*/forwardRef(({
43152
43120
  hoverTextColor: "#B1B1B1",
43153
43121
  hoverBackgroundColor: "#E6F0F0",
43154
43122
  hoverBorderColor: "#D9D9D9",
43123
+ disabled: true,
43155
43124
  disabledTextColor: "#B1B1B1",
43156
- disabledBackgroundColor: focusedRowIndex === rowIndex ? "#D1E7E7" : hoveredRowIndex === rowIndex ? "#E6F0F0" : "#FFF",
43157
43125
  disabledBorderColor: "#D9D9D9",
43126
+ disabledBackgroundColor: focusedRowIndex === rowIndex ? "#D1E7E7" : hoveredRowIndex === rowIndex ? "#E6F0F0" : "#FFF",
43158
43127
  width: "100px",
43159
- height: "32px",
43160
- disabled: true
43128
+ height: "32px"
43161
43129
  }));
43162
43130
  } else if (lowerValue === "draft") {
43163
43131
  return /*#__PURE__*/React$1.createElement(ButtonWrapper, {
@@ -43379,24 +43347,15 @@ const TableBody = /*#__PURE__*/forwardRef(({
43379
43347
  return /*#__PURE__*/React$1.createElement("div", {
43380
43348
  style: {
43381
43349
  display: "flex",
43382
- alignItems: "center",
43383
- justifyContent: "center",
43384
- width: "100%",
43385
- height: "100%"
43350
+ alignItems: "center"
43386
43351
  }
43387
- }, /*#__PURE__*/React$1.createElement("input", {
43352
+ }, /*#__PURE__*/React$1.createElement(CheckboxInput, {
43388
43353
  type: "checkbox",
43389
43354
  checked: isChecked,
43390
43355
  disabled: isDisabled,
43356
+ buttonColor: buttonColor,
43391
43357
  onChange: e => handleCheckboxClick(row, column.key, e),
43392
- onClick: e => e.stopPropagation(),
43393
- style: {
43394
- width: "18px",
43395
- height: "18px",
43396
- cursor: isDisabled ? "not-allowed" : "pointer",
43397
- accentColor: buttonColor,
43398
- opacity: isDisabled ? 0.5 : 1
43399
- }
43358
+ onClick: e => e.stopPropagation()
43400
43359
  }));
43401
43360
  } catch (e) {
43402
43361
  console.warn('Error formatting checkbox:', e);
@@ -47026,6 +46985,7 @@ const Table = props => {
47026
46985
  onCheckboxClick = () => {},
47027
46986
  onHeaderCheckboxClick = () => {},
47028
46987
  headerCheckboxStates = {},
46988
+ disableCheckboxTooltipText = "",
47029
46989
  onHeroClick = () => {},
47030
46990
  dotIndicatorColor = '#34D399',
47031
46991
  onEditableClick = () => {},
@@ -47170,6 +47130,7 @@ const Table = props => {
47170
47130
  onDropdownSelected: onDropdownSelected,
47171
47131
  onCheckboxClick: onCheckboxClick,
47172
47132
  onHeaderCheckboxClick: onHeaderCheckboxClick,
47133
+ disableCheckboxTooltipText: disableCheckboxTooltipText,
47173
47134
  onHeroClick: onHeroClick,
47174
47135
  onEditableClick: onEditableClick,
47175
47136
  isEditMode: isEditMode,
@@ -57798,27 +57759,32 @@ OverlayTemplateDialog.propTypes = {
57798
57759
  // Main Component
57799
57760
  const OverlayDropdown = _ref => {
57800
57761
  let {
57762
+ // Data / selection
57801
57763
  data = [],
57802
57764
  value,
57803
57765
  onSelectClick,
57766
+ // Label / placeholder
57767
+ label,
57768
+ labelEmptyValue,
57769
+ showLabelOnTop,
57770
+ labelColor,
57771
+ placeHolder,
57772
+ placeHolderColor,
57773
+ // Behavior
57774
+ required = false,
57804
57775
  disabled = false,
57805
57776
  isDarkerBackground = false,
57806
- required = false,
57777
+ editableDigitalCoupon = false,
57778
+ // Appearance
57807
57779
  selectedColor = "#066768",
57808
57780
  hoverColor = "#E6F0F0",
57809
- dropdownMaxHeight = "600px",
57781
+ // Sizing
57810
57782
  width = "100%",
57811
57783
  minWidth = "unset",
57784
+ dropdownWidth = "100%",
57785
+ dropdownMaxHeight = "600px",
57812
57786
  height = "auto",
57813
- label,
57814
- labelEmptyValue,
57815
- showLabelOnTop,
57816
- placeHolder,
57817
- labelColor,
57818
- placeHolderColor,
57819
57787
  margin = "8px",
57820
- dropdownWidth = "100%",
57821
- editableDigitalCoupon = false,
57822
57788
  ...props
57823
57789
  } = _ref;
57824
57790
  const [open, setOpen] = useState(false);