sag_components 2.0.0-beta247 → 2.0.0-beta249

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
@@ -10591,23 +10591,24 @@ const QuarterPopupPicker = ({
10591
10591
  };
10592
10592
 
10593
10593
  /* eslint-disable import/no-extraneous-dependencies */
10594
- const QuarterPicker = ({
10595
- availableQuarters,
10596
- // ["Q1-2024"]
10597
- label,
10598
- onChange,
10599
- borderRadius,
10600
- required,
10601
- width,
10602
- height,
10603
- placeholder,
10604
- disabled,
10605
- borderColor,
10606
- borderColorFocus,
10607
- textColor,
10608
- selectedValue,
10609
- startYear
10610
- }) => {
10594
+ const QuarterPicker = _ref => {
10595
+ let {
10596
+ availableQuarters,
10597
+ // ["Q1-2024"]
10598
+ label,
10599
+ onChange,
10600
+ borderRadius,
10601
+ required,
10602
+ width,
10603
+ height,
10604
+ placeholder,
10605
+ disabled,
10606
+ borderColor,
10607
+ borderColorFocus,
10608
+ textColor,
10609
+ selectedValue,
10610
+ startYear
10611
+ } = _ref;
10611
10612
  const [isFocused, setIsFocused] = React$1.useState(false);
10612
10613
  const [isOpen, setIsOpen] = React$1.useState(false);
10613
10614
  const [value, setValue] = React$1.useState('');
@@ -11049,22 +11050,23 @@ const MonthPopupPicker = ({
11049
11050
  };
11050
11051
 
11051
11052
  /* eslint-disable import/no-extraneous-dependencies */
11052
- const MonthPicker = ({
11053
- availableMonths,
11054
- label,
11055
- onChange,
11056
- borderRadius,
11057
- required,
11058
- width,
11059
- height,
11060
- placeholder,
11061
- disabled,
11062
- borderColor,
11063
- borderColorFocus,
11064
- textColor,
11065
- selectedValue,
11066
- startYear
11067
- }) => {
11053
+ const MonthPicker = _ref => {
11054
+ let {
11055
+ availableMonths,
11056
+ label,
11057
+ onChange,
11058
+ borderRadius,
11059
+ required,
11060
+ width,
11061
+ height,
11062
+ placeholder,
11063
+ disabled,
11064
+ borderColor,
11065
+ borderColorFocus,
11066
+ textColor,
11067
+ selectedValue,
11068
+ startYear
11069
+ } = _ref;
11068
11070
  const [isFocused, setIsFocused] = React$1.useState(false);
11069
11071
  const [isOpen, setIsOpen] = React$1.useState(false);
11070
11072
  const [value, setValue] = React$1.useState('');
@@ -24175,21 +24177,22 @@ const DeleteIcon = styled__default["default"].div`
24175
24177
  position: absolute;
24176
24178
  `;
24177
24179
 
24178
- const QuickFilterDropdownSingle = ({
24179
- label,
24180
- hoverColor,
24181
- options,
24182
- selectedValue,
24183
- placeHolder,
24184
- onChange,
24185
- disabled,
24186
- width,
24187
- error,
24188
- errorMessage,
24189
- xIconShow,
24190
- labelColor,
24191
- showLabelOnTop
24192
- }) => {
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;
24193
24196
  const [isFocused, setIsFocused] = React$1.useState(false);
24194
24197
  const [showOptions, setShowOptions] = React$1.useState(false);
24195
24198
  const [inputValue, setInputValue] = React$1.useState("");
@@ -24646,25 +24649,26 @@ const IconContainer$2 = styled__default["default"].div`
24646
24649
  cursor: pointer;
24647
24650
  `;
24648
24651
 
24649
- const QuickFilterDropdownMultiSelection = ({
24650
- label,
24651
- labelEmptyValue,
24652
- options,
24653
- selectedValue,
24654
- placeHolder,
24655
- onChange,
24656
- required,
24657
- disabled,
24658
- width,
24659
- height,
24660
- error,
24661
- errorMessage,
24662
- labelColor,
24663
- xIconShow,
24664
- checkBoxColor,
24665
- showLabelOnTop,
24666
- dropdownHeight
24667
- }) => {
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;
24668
24672
  const [isFocused, setIsFocused] = React$1.useState(false);
24669
24673
  const [showOptions, setShowOptions] = React$1.useState(false);
24670
24674
  const [inputValue, setInputValue] = React$1.useState('');
@@ -35205,7 +35209,6 @@ const WeeksPicker = _ref => {
35205
35209
  borderColor,
35206
35210
  borderColorFocus,
35207
35211
  textColor,
35208
- text = 'Week',
35209
35212
  hoverColor,
35210
35213
  required,
35211
35214
  placeholder,
@@ -35229,7 +35232,6 @@ const WeeksPicker = _ref => {
35229
35232
  const [isFocused, setIsFocused] = React$1.useState(false);
35230
35233
  const [isOpen, setIsOpen] = React$1.useState(false);
35231
35234
  const [showAbove, setShowAbove] = React$1.useState(false);
35232
- const [previousText, setPreviousText] = React$1.useState(text);
35233
35235
 
35234
35236
  // Function to parse the value string and extract week numbers
35235
35237
  const parseValueToWeeks = valueString => {
@@ -35237,21 +35239,25 @@ const WeeksPicker = _ref => {
35237
35239
  startWeek: null,
35238
35240
  endWeek: null
35239
35241
  };
35240
- const rangeMatch = valueString.match(/^(.+?)\s*(\d+)\s*-\s*(\d+)$/);
35241
- if (rangeMatch) {
35242
- const startWeek = parseInt(rangeMatch[2]);
35243
- const endWeek = parseInt(rangeMatch[3]);
35242
+
35243
+ // Handle single week: "Week 5"
35244
+ const singleWeekMatch = valueString.match(/^Week (\d+)$/);
35245
+ if (singleWeekMatch) {
35246
+ const week = parseInt(singleWeekMatch[1]);
35244
35247
  return {
35245
- startWeek,
35246
- endWeek
35248
+ startWeek: week,
35249
+ endWeek: week
35247
35250
  };
35248
35251
  }
35249
- const singleMatch = valueString.match(/^(.+?)\s*(\d+)$/);
35250
- if (singleMatch) {
35251
- const week = parseInt(singleMatch[2]);
35252
+
35253
+ // Handle week range: "Weeks 5 - 10"
35254
+ const rangeMatch = valueString.match(/^Weeks (\d+) - (\d+)$/);
35255
+ if (rangeMatch) {
35256
+ const startWeek = parseInt(rangeMatch[1]);
35257
+ const endWeek = parseInt(rangeMatch[2]);
35252
35258
  return {
35253
- startWeek: week,
35254
- endWeek: week
35259
+ startWeek,
35260
+ endWeek
35255
35261
  };
35256
35262
  }
35257
35263
  return {
@@ -35327,27 +35333,6 @@ const WeeksPicker = _ref => {
35327
35333
  }
35328
35334
  }
35329
35335
  }, [allowedWeekRange, restrictToRange]);
35330
- React$1.useEffect(() => {
35331
- if (previousText !== text) {
35332
- setPreviousText(text);
35333
- }
35334
- const currentValue = value || selectedValue;
35335
- if (currentValue) {
35336
- const {
35337
- startWeek,
35338
- endWeek
35339
- } = parseValueToWeeks(currentValue);
35340
- if (startWeek && endWeek) {
35341
- const newValue = endWeek === startWeek ? text === 'Week' ? `${text} ${startWeek}` : `${text}${startWeek}` : text === 'Week' ? `${text}s ${startWeek} - ${endWeek}` : `${text}${startWeek} - ${endWeek}`;
35342
- if (newValue !== value) {
35343
- setValue(newValue);
35344
- if (onChange) {
35345
- onChange(newValue);
35346
- }
35347
- }
35348
- }
35349
- }
35350
- }, [text, value, selectedValue, previousText, onChange]);
35351
35336
  const handleToggle = () => {
35352
35337
  setIsOpen(!isOpen);
35353
35338
  };
@@ -35368,6 +35353,11 @@ const WeeksPicker = _ref => {
35368
35353
  onChange(newValue);
35369
35354
  setValue(newValue);
35370
35355
  };
35356
+ React$1.useEffect(() => {
35357
+ if (selectedValue !== undefined) {
35358
+ setValue(selectedValue);
35359
+ }
35360
+ }, [selectedValue]);
35371
35361
  const handleApply = () => {
35372
35362
  setIsOpen(false);
35373
35363
  };
@@ -35451,7 +35441,7 @@ const WeeksPicker = _ref => {
35451
35441
  console.warn('Selected weeks are outside the allowed range');
35452
35442
  return;
35453
35443
  }
35454
- const tempValue = end === start ? text === 'Week' ? `${text} ${start}` : `${text}${start}` : text === 'Week' ? `${text}s ${start} - ${end}` : `${text}${start} - ${end}`;
35444
+ const tempValue = end === start ? `Week ${start}` : `Weeks ${start} - ${end}`;
35455
35445
  onChange(tempValue);
35456
35446
  setValue(tempValue);
35457
35447
  handleApply();
@@ -36118,15 +36108,19 @@ const ToggleInput = styled__default["default"].input`
36118
36108
  const ToggleSlider = styled__default["default"].span`
36119
36109
  display: block;
36120
36110
  position: relative;
36121
- background: ${({
36122
- checked,
36123
- disabled
36124
- }) => checked ? "#006d6a" : disabled ? "#B1B1B1" : "#D0D0D0"};
36111
+ background: ${_ref => {
36112
+ let {
36113
+ checked,
36114
+ disabled
36115
+ } = _ref;
36116
+ return checked ? "#006d6a" : disabled ? "#B1B1B1" : "#D0D0D0";
36117
+ }};
36125
36118
  border-radius: 999px;
36126
36119
  transition: background 0.2s;
36127
- ${({
36128
- size
36129
- }) => {
36120
+ ${_ref2 => {
36121
+ let {
36122
+ size
36123
+ } = _ref2;
36130
36124
  switch (size) {
36131
36125
  case "s":
36132
36126
  return styled.css`width: 40px; height: 20px;`;
@@ -36142,14 +36136,18 @@ const ToggleSlider = styled__default["default"].span`
36142
36136
  left: 3px;
36143
36137
  top: 50%;
36144
36138
  transform: translateY(-50%);
36145
- background: ${({
36146
- disabled
36147
- }) => disabled ? "#D0D0D0" : "#fff"};
36139
+ background: ${_ref3 => {
36140
+ let {
36141
+ disabled
36142
+ } = _ref3;
36143
+ return disabled ? "#D0D0D0" : "#fff";
36144
+ }};
36148
36145
  border-radius: 50%;
36149
36146
  transition: left 0.2s, width 0.2s, height 0.2s;
36150
- ${({
36151
- size
36152
- }) => {
36147
+ ${_ref4 => {
36148
+ let {
36149
+ size
36150
+ } = _ref4;
36153
36151
  switch (size) {
36154
36152
  case "s":
36155
36153
  return styled.css`width: 14px; height: 14px;`;
@@ -36159,10 +36157,11 @@ const ToggleSlider = styled__default["default"].span`
36159
36157
  return styled.css`width: 20px; height: 20px;`;
36160
36158
  }
36161
36159
  }}
36162
- left: ${({
36163
- checked,
36164
- size
36165
- }) => {
36160
+ left: ${_ref5 => {
36161
+ let {
36162
+ checked,
36163
+ size
36164
+ } = _ref5;
36166
36165
  if (!checked) return "3px";
36167
36166
  switch (size) {
36168
36167
  case "s":
@@ -36176,9 +36175,9 @@ const ToggleSlider = styled__default["default"].span`
36176
36175
  }
36177
36176
  `;
36178
36177
 
36179
- /**
36180
- * ToggleSwitch component for on/off states.
36181
- * Supports small/large sizes and disabled state.
36178
+ /**
36179
+ * ToggleSwitch component for on/off states.
36180
+ * Supports small/large sizes and disabled state.
36182
36181
  */
36183
36182
  function ToggleSwitch(_ref) {
36184
36183
  let {
@@ -57669,6 +57668,7 @@ const OverlayDropdown = _ref => {
57669
57668
  placeHolder,
57670
57669
  labelColor,
57671
57670
  placeHolderColor,
57671
+ textColorMenu = "black",
57672
57672
  margin = "8px",
57673
57673
  editableDigitalCoupon = false,
57674
57674
  dropdownDigitalCouponTitle = "",
@@ -57943,10 +57943,12 @@ const OverlayDropdown = _ref => {
57943
57943
  }, /*#__PURE__*/React__default["default"].createElement(TruncatedText, {
57944
57944
  onMouseEnter: () => setHoveredText(selected?.label),
57945
57945
  onMouseLeave: () => setHoveredText(null),
57946
- color: !selected && open ? placeHolderColor : "inherit"
57946
+ color: !selected && open ? textColorMenu : "inherit"
57947
57947
  }, group.templateType === 3 && editableDigitalCoupon ? dropdownDigitalCouponTitle !== "" ? dropdownDigitalCouponTitle : item.label : item.label), group.templateType === 2 ? /*#__PURE__*/React__default["default"].createElement(ChervronRightIcon, {
57948
57948
  fill: item.value === value ? "#fff" : "#212121"
57949
- }) : group.templateType === 3 && editableDigitalCoupon ? /*#__PURE__*/React__default["default"].createElement(PenIcon, {
57949
+ }) : group.templateType === 3 && editableDigitalCoupon ? dropdownDigitalCouponTitle === "" ? /*#__PURE__*/React__default["default"].createElement(ChervronRightIcon, {
57950
+ fill: item.value === value ? "#fff" : "#212121"
57951
+ }) : /*#__PURE__*/React__default["default"].createElement(PenIcon, {
57950
57952
  fill: item.value === value ? "#fff" : "#212121"
57951
57953
  }) : item.value === value && /*#__PURE__*/React__default["default"].createElement(OkIcon, {
57952
57954
  width: "22px",