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.esm.js CHANGED
@@ -10792,24 +10792,23 @@ const QuarterPopupPicker = ({
10792
10792
  };
10793
10793
 
10794
10794
  /* eslint-disable import/no-extraneous-dependencies */
10795
- const QuarterPicker = _ref => {
10796
- let {
10797
- availableQuarters,
10798
- // ["Q1-2024"]
10799
- label,
10800
- onChange,
10801
- borderRadius,
10802
- required,
10803
- width,
10804
- height,
10805
- placeholder,
10806
- disabled,
10807
- borderColor,
10808
- borderColorFocus,
10809
- textColor,
10810
- selectedValue,
10811
- startYear
10812
- } = _ref;
10795
+ const QuarterPicker = ({
10796
+ availableQuarters,
10797
+ // ["Q1-2024"]
10798
+ label,
10799
+ onChange,
10800
+ borderRadius,
10801
+ required,
10802
+ width,
10803
+ height,
10804
+ placeholder,
10805
+ disabled,
10806
+ borderColor,
10807
+ borderColorFocus,
10808
+ textColor,
10809
+ selectedValue,
10810
+ startYear
10811
+ }) => {
10813
10812
  const [isFocused, setIsFocused] = useState(false);
10814
10813
  const [isOpen, setIsOpen] = useState(false);
10815
10814
  const [value, setValue] = useState('');
@@ -11251,23 +11250,22 @@ const MonthPopupPicker = ({
11251
11250
  };
11252
11251
 
11253
11252
  /* eslint-disable import/no-extraneous-dependencies */
11254
- const MonthPicker = _ref => {
11255
- let {
11256
- availableMonths,
11257
- label,
11258
- onChange,
11259
- borderRadius,
11260
- required,
11261
- width,
11262
- height,
11263
- placeholder,
11264
- disabled,
11265
- borderColor,
11266
- borderColorFocus,
11267
- textColor,
11268
- selectedValue,
11269
- startYear
11270
- } = _ref;
11253
+ const MonthPicker = ({
11254
+ availableMonths,
11255
+ label,
11256
+ onChange,
11257
+ borderRadius,
11258
+ required,
11259
+ width,
11260
+ height,
11261
+ placeholder,
11262
+ disabled,
11263
+ borderColor,
11264
+ borderColorFocus,
11265
+ textColor,
11266
+ selectedValue,
11267
+ startYear
11268
+ }) => {
11271
11269
  const [isFocused, setIsFocused] = useState(false);
11272
11270
  const [isOpen, setIsOpen] = useState(false);
11273
11271
  const [value, setValue] = useState('');
@@ -11590,7 +11588,9 @@ const FilterPanel = props => {
11590
11588
  };
11591
11589
  const getSelectedValueYear = item => {
11592
11590
  let selectedValueYear = [];
11593
- if (item?.defaultValueYears?.value) {
11591
+ if (item?.selectedValue?.length > 0) {
11592
+ selectedValueYear = item.selectedValue;
11593
+ } else if (item?.defaultValueYears?.value) {
11594
11594
  selectedValueYear = [item?.defaultValueYears];
11595
11595
  }
11596
11596
  return selectedValueYear;
@@ -40717,6 +40717,7 @@ const RangePop = props => {
40717
40717
  params = [],
40718
40718
  paramType = "Week",
40719
40719
  onApply = () => {},
40720
+ onCancel = () => {},
40720
40721
  buttonColor = "#066768",
40721
40722
  hoverColor = "#066768",
40722
40723
  initialValues = null
@@ -40787,6 +40788,7 @@ const RangePop = props => {
40787
40788
  const handleCancel = () => {
40788
40789
  reset();
40789
40790
  setSelectedRadio(radioOptions[0].toLowerCase());
40791
+ onCancel();
40790
40792
  };
40791
40793
 
40792
40794
  // Validation rules
@@ -41331,7 +41333,7 @@ const TableHeader = ({
41331
41333
  return true;
41332
41334
  }
41333
41335
  if (filterData.selectedRadio) {
41334
- return filterData.selectedRadio === 'all weeks';
41336
+ return filterData.selectedRadio !== 'custom range';
41335
41337
  }
41336
41338
  return filterData.isSelectAll && filterData.excluded?.length === 0 && filterData.included?.length === 0;
41337
41339
  };
@@ -41614,30 +41616,22 @@ const TableHeader = ({
41614
41616
  } else if (rangeFilter) {
41615
41617
  const currentFilterState = filterState[key];
41616
41618
 
41617
- // Determine if this is a price column
41618
- const isPriceColumn = key.toLowerCase().includes('price') || key.toLowerCase().includes('cost') || key.toLowerCase().includes('amount');
41619
+ // Determine symbol: use column prop if provided, otherwise auto-detect
41620
+ const isPriceColumn = key.toLowerCase().includes('price') || key.toLowerCase().includes('cost');
41621
+ const symbol = column.rangeFilterSymbol !== undefined ? column.rangeFilterSymbol : isPriceColumn ? '$' : '';
41622
+ const inputType = symbol !== undefined && symbol !== 'week' ? 'price' : 'week';
41619
41623
 
41620
41624
  // Configure RangePop based on column type
41621
- const rangeConfig = isPriceColumn ? {
41622
- paramType: '$',
41623
- params: [{
41624
- label: 'From $',
41625
- type: 'price'
41626
- }, {
41627
- label: 'To $',
41628
- type: 'price'
41629
- }],
41630
- radioOptions: ['All Prices', 'Custom Range']
41631
- } : {
41632
- paramType: 'Week',
41625
+ const rangeConfig = {
41626
+ paramType: symbol || '#',
41633
41627
  params: [{
41634
- label: 'From',
41635
- type: 'week'
41628
+ label: symbol ? `From ${symbol}` : 'From',
41629
+ type: inputType
41636
41630
  }, {
41637
- label: 'To',
41638
- type: 'week'
41631
+ label: symbol ? `To ${symbol}` : 'To',
41632
+ type: inputType
41639
41633
  }],
41640
- radioOptions: ['All Weeks', 'Custom Range']
41634
+ radioOptions: [`All ${title}`, 'Custom Range']
41641
41635
  };
41642
41636
  return /*#__PURE__*/React$1.createElement(RangePop, {
41643
41637
  menuName: title,
@@ -41659,7 +41653,8 @@ const TableHeader = ({
41659
41653
  [key]: data
41660
41654
  }));
41661
41655
  setVisibleFilterPopWrapper(null);
41662
- }
41656
+ },
41657
+ onCancel: () => setVisibleFilterPopWrapper(null)
41663
41658
  });
41664
41659
  } else {
41665
41660
  // Check if this column has an active filter (not in default state)