sag_components 2.0.0-beta197 → 2.0.0-beta198

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 CHANGED
@@ -10579,23 +10579,24 @@ const QuarterPopupPicker = ({
10579
10579
  };
10580
10580
 
10581
10581
  /* eslint-disable import/no-extraneous-dependencies */
10582
- const QuarterPicker = ({
10583
- availableQuarters,
10584
- // ["Q1-2024"]
10585
- label,
10586
- onChange,
10587
- borderRadius,
10588
- required,
10589
- width,
10590
- height,
10591
- placeholder,
10592
- disabled,
10593
- borderColor,
10594
- borderColorFocus,
10595
- textColor,
10596
- selectedValue,
10597
- startYear
10598
- }) => {
10582
+ const QuarterPicker = _ref => {
10583
+ let {
10584
+ availableQuarters,
10585
+ // ["Q1-2024"]
10586
+ label,
10587
+ onChange,
10588
+ borderRadius,
10589
+ required,
10590
+ width,
10591
+ height,
10592
+ placeholder,
10593
+ disabled,
10594
+ borderColor,
10595
+ borderColorFocus,
10596
+ textColor,
10597
+ selectedValue,
10598
+ startYear
10599
+ } = _ref;
10599
10600
  const [isFocused, setIsFocused] = useState(false);
10600
10601
  const [isOpen, setIsOpen] = useState(false);
10601
10602
  const [value, setValue] = useState('');
@@ -11037,22 +11038,23 @@ const MonthPopupPicker = ({
11037
11038
  };
11038
11039
 
11039
11040
  /* eslint-disable import/no-extraneous-dependencies */
11040
- const MonthPicker = ({
11041
- availableMonths,
11042
- label,
11043
- onChange,
11044
- borderRadius,
11045
- required,
11046
- width,
11047
- height,
11048
- placeholder,
11049
- disabled,
11050
- borderColor,
11051
- borderColorFocus,
11052
- textColor,
11053
- selectedValue,
11054
- startYear
11055
- }) => {
11041
+ const MonthPicker = _ref => {
11042
+ let {
11043
+ availableMonths,
11044
+ label,
11045
+ onChange,
11046
+ borderRadius,
11047
+ required,
11048
+ width,
11049
+ height,
11050
+ placeholder,
11051
+ disabled,
11052
+ borderColor,
11053
+ borderColorFocus,
11054
+ textColor,
11055
+ selectedValue,
11056
+ startYear
11057
+ } = _ref;
11056
11058
  const [isFocused, setIsFocused] = useState(false);
11057
11059
  const [isOpen, setIsOpen] = useState(false);
11058
11060
  const [value, setValue] = useState('');
@@ -34874,17 +34876,18 @@ css`
34874
34876
  * • onApply(start,end) — callback, both numbers (inclusive)
34875
34877
  * • onCancel() — callback
34876
34878
  */
34877
- const WeeksCalendar = ({
34878
- year,
34879
- defaultStartWeek = null,
34880
- defaultEndWeek = null,
34881
- backgroundColor = "#066768",
34882
- hoverBackgroundColor = "#E6F0F0",
34883
- allowedWeekRange = null,
34884
- // New prop for range restriction
34885
- onApply,
34886
- onCancel
34887
- }) => {
34879
+ const WeeksCalendar = _ref => {
34880
+ let {
34881
+ year,
34882
+ defaultStartWeek = null,
34883
+ defaultEndWeek = null,
34884
+ backgroundColor = "#066768",
34885
+ hoverBackgroundColor = "#E6F0F0",
34886
+ allowedWeekRange = null,
34887
+ // New prop for range restriction
34888
+ onApply,
34889
+ onCancel
34890
+ } = _ref;
34888
34891
  // state -------------------------------------------------
34889
34892
  const [startWeek, setStartWeek] = useState(defaultStartWeek);
34890
34893
  const [endWeek, setEndWeek] = useState(defaultEndWeek);
@@ -40075,6 +40078,13 @@ const TableBody = /*#__PURE__*/forwardRef(({
40075
40078
  onCheckboxClick = () => {},
40076
40079
  onHeaderCheckboxClick = () => {}
40077
40080
  }, ref) => {
40081
+ // MOVE ALL VALIDATION TO THE VERY TOP BEFORE ANY HOOKS
40082
+ if (!Array.isArray(data) || !Array.isArray(columns)) {
40083
+ console.warn("TableBody: Invalid data or columns prop");
40084
+ return null;
40085
+ }
40086
+
40087
+ // NOW ALL THE HOOKS CAN BE CALLED SAFELY
40078
40088
  const [hoveredRowIndex, setHoveredRowIndex] = useState(null);
40079
40089
  const [focusedRowIndex, setFocusedRowIndex] = useState(null);
40080
40090
  const [isCommentModalOpen, setIsCommentModalOpen] = useState(false);
@@ -40087,12 +40097,6 @@ const TableBody = /*#__PURE__*/forwardRef(({
40087
40097
  const [hasUserInteracted, setHasUserInteracted] = useState(false);
40088
40098
  const [hasInitialValue, setHasInitialValue] = useState(false);
40089
40099
 
40090
- // Early return for invalid data
40091
- if (!Array.isArray(data) || !Array.isArray(columns)) {
40092
- console.warn("TableBody: Invalid data or columns prop");
40093
- return null;
40094
- }
40095
-
40096
40100
  // Expose methods to parent component via ref
40097
40101
  useImperativeHandle(ref, () => ({
40098
40102
  clearFocus: () => {
@@ -40665,7 +40669,7 @@ const TableBody = /*#__PURE__*/forwardRef(({
40665
40669
  };
40666
40670
  }, []);
40667
40671
 
40668
- // Return null if no data
40672
+ // HANDLE SPECIAL CASE: EMPTY DATA AFTER ALL HOOKS
40669
40673
  if (data.length === 0) {
40670
40674
  return /*#__PURE__*/React$1.createElement(StyledTableBody, {
40671
40675
  ref: ref
@@ -54539,10 +54543,11 @@ const DropdownList = styled.ul`
54539
54543
  `}
54540
54544
  `;
54541
54545
  const SectionDiv = styled.div`
54542
- ${({
54543
- $showBorder,
54544
- margin
54545
- }) => {
54546
+ ${_ref => {
54547
+ let {
54548
+ $showBorder,
54549
+ margin
54550
+ } = _ref;
54546
54551
  switch ($showBorder) {
54547
54552
  case 'Template Offer':
54548
54553
  return css`border-top: 1px solid #e6e2e2ff;
@@ -54727,15 +54732,16 @@ function validateField(value, param) {
54727
54732
  if (param.type === 'percent' && Number(value) > 100) return 'Max 100%';
54728
54733
  return null;
54729
54734
  }
54730
- const OverlayTemplateDialog = ({
54731
- open,
54732
- onClose,
54733
- onApply,
54734
- template,
54735
- params,
54736
- buttonColor = '#1db6ab',
54737
- buttonHoverColor = '#066768'
54738
- }) => {
54735
+ const OverlayTemplateDialog = _ref => {
54736
+ let {
54737
+ open,
54738
+ onClose,
54739
+ onApply,
54740
+ template,
54741
+ params,
54742
+ buttonColor = '#1db6ab',
54743
+ buttonHoverColor = '#066768'
54744
+ } = _ref;
54739
54745
  const [fields, setFields] = useState(() => params.map(() => ''));
54740
54746
  const [touched, setTouched] = useState(() => params.map(() => false));
54741
54747
  if (!open) return null;