sag_components 2.0.0-beta336 → 2.0.0-beta338

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
@@ -10802,24 +10802,23 @@ const QuarterPopupPicker = ({
10802
10802
  };
10803
10803
 
10804
10804
  /* eslint-disable import/no-extraneous-dependencies */
10805
- const QuarterPicker = _ref => {
10806
- let {
10807
- availableQuarters,
10808
- // ["Q1-2024"]
10809
- label,
10810
- onChange,
10811
- borderRadius,
10812
- required,
10813
- width,
10814
- height,
10815
- placeholder,
10816
- disabled,
10817
- borderColor,
10818
- borderColorFocus,
10819
- textColor,
10820
- selectedValue,
10821
- startYear
10822
- } = _ref;
10805
+ const QuarterPicker = ({
10806
+ availableQuarters,
10807
+ // ["Q1-2024"]
10808
+ label,
10809
+ onChange,
10810
+ borderRadius,
10811
+ required,
10812
+ width,
10813
+ height,
10814
+ placeholder,
10815
+ disabled,
10816
+ borderColor,
10817
+ borderColorFocus,
10818
+ textColor,
10819
+ selectedValue,
10820
+ startYear
10821
+ }) => {
10823
10822
  const [isFocused, setIsFocused] = React$1.useState(false);
10824
10823
  const [isOpen, setIsOpen] = React$1.useState(false);
10825
10824
  const [value, setValue] = React$1.useState('');
@@ -11261,23 +11260,22 @@ const MonthPopupPicker = ({
11261
11260
  };
11262
11261
 
11263
11262
  /* eslint-disable import/no-extraneous-dependencies */
11264
- const MonthPicker = _ref => {
11265
- let {
11266
- availableMonths,
11267
- label,
11268
- onChange,
11269
- borderRadius,
11270
- required,
11271
- width,
11272
- height,
11273
- placeholder,
11274
- disabled,
11275
- borderColor,
11276
- borderColorFocus,
11277
- textColor,
11278
- selectedValue,
11279
- startYear
11280
- } = _ref;
11263
+ const MonthPicker = ({
11264
+ availableMonths,
11265
+ label,
11266
+ onChange,
11267
+ borderRadius,
11268
+ required,
11269
+ width,
11270
+ height,
11271
+ placeholder,
11272
+ disabled,
11273
+ borderColor,
11274
+ borderColorFocus,
11275
+ textColor,
11276
+ selectedValue,
11277
+ startYear
11278
+ }) => {
11281
11279
  const [isFocused, setIsFocused] = React$1.useState(false);
11282
11280
  const [isOpen, setIsOpen] = React$1.useState(false);
11283
11281
  const [value, setValue] = React$1.useState('');
@@ -11600,7 +11598,9 @@ const FilterPanel = props => {
11600
11598
  };
11601
11599
  const getSelectedValueYear = item => {
11602
11600
  let selectedValueYear = [];
11603
- if (item?.defaultValueYears?.value) {
11601
+ if (item?.selectedValue?.length > 0) {
11602
+ selectedValueYear = item.selectedValue;
11603
+ } else if (item?.defaultValueYears?.value) {
11604
11604
  selectedValueYear = [item?.defaultValueYears];
11605
11605
  }
11606
11606
  return selectedValueYear;
@@ -40727,6 +40727,7 @@ const RangePop = props => {
40727
40727
  params = [],
40728
40728
  paramType = "Week",
40729
40729
  onApply = () => {},
40730
+ onCancel = () => {},
40730
40731
  buttonColor = "#066768",
40731
40732
  hoverColor = "#066768",
40732
40733
  initialValues = null
@@ -40797,6 +40798,7 @@ const RangePop = props => {
40797
40798
  const handleCancel = () => {
40798
40799
  reset();
40799
40800
  setSelectedRadio(radioOptions[0].toLowerCase());
40801
+ onCancel();
40800
40802
  };
40801
40803
 
40802
40804
  // Validation rules
@@ -41341,7 +41343,7 @@ const TableHeader = ({
41341
41343
  return true;
41342
41344
  }
41343
41345
  if (filterData.selectedRadio) {
41344
- return filterData.selectedRadio === 'all weeks';
41346
+ return filterData.selectedRadio !== 'custom range';
41345
41347
  }
41346
41348
  return filterData.isSelectAll && filterData.excluded?.length === 0 && filterData.included?.length === 0;
41347
41349
  };
@@ -41624,30 +41626,22 @@ const TableHeader = ({
41624
41626
  } else if (rangeFilter) {
41625
41627
  const currentFilterState = filterState[key];
41626
41628
 
41627
- // Determine if this is a price column
41628
- const isPriceColumn = key.toLowerCase().includes('price') || key.toLowerCase().includes('cost') || key.toLowerCase().includes('amount');
41629
+ // Determine symbol: use column prop if provided, otherwise auto-detect
41630
+ const isPriceColumn = key.toLowerCase().includes('price') || key.toLowerCase().includes('cost');
41631
+ const symbol = column.rangeFilterSymbol !== undefined ? column.rangeFilterSymbol : isPriceColumn ? '$' : '';
41632
+ const inputType = symbol !== undefined && symbol !== 'week' ? 'price' : 'week';
41629
41633
 
41630
41634
  // Configure RangePop based on column type
41631
- const rangeConfig = isPriceColumn ? {
41632
- paramType: '$',
41633
- params: [{
41634
- label: 'From $',
41635
- type: 'price'
41636
- }, {
41637
- label: 'To $',
41638
- type: 'price'
41639
- }],
41640
- radioOptions: ['All Prices', 'Custom Range']
41641
- } : {
41642
- paramType: 'Week',
41635
+ const rangeConfig = {
41636
+ paramType: symbol || '#',
41643
41637
  params: [{
41644
- label: 'From',
41645
- type: 'week'
41638
+ label: symbol ? `From ${symbol}` : 'From',
41639
+ type: inputType
41646
41640
  }, {
41647
- label: 'To',
41648
- type: 'week'
41641
+ label: symbol ? `To ${symbol}` : 'To',
41642
+ type: inputType
41649
41643
  }],
41650
- radioOptions: ['All Weeks', 'Custom Range']
41644
+ radioOptions: [`All ${title}`, 'Custom Range']
41651
41645
  };
41652
41646
  return /*#__PURE__*/React__default["default"].createElement(RangePop, {
41653
41647
  menuName: title,
@@ -41669,7 +41663,8 @@ const TableHeader = ({
41669
41663
  [key]: data
41670
41664
  }));
41671
41665
  setVisibleFilterPopWrapper(null);
41672
- }
41666
+ },
41667
+ onCancel: () => setVisibleFilterPopWrapper(null)
41673
41668
  });
41674
41669
  } else {
41675
41670
  // Check if this column has an active filter (not in default state)