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.d.ts CHANGED
@@ -1284,13 +1284,12 @@ declare function ModalWithOverlay(props: any): react_jsx_runtime.JSX.Element;
1284
1284
 
1285
1285
  declare function DropdownNew(props: any): react_jsx_runtime.JSX.Element;
1286
1286
 
1287
- declare function WeeksPicker({ label, disabled, borderColor, borderColorFocus, textColor, text, hoverColor, required, placeholder, borderRadius, year, width, height, withMarginBottom, onChange, selectedValue, isDarkerBackground, allowedWeekRange, restrictToRange, }: {
1287
+ declare function WeeksPicker({ label, disabled, borderColor, borderColorFocus, textColor, hoverColor, required, placeholder, borderRadius, year, width, height, withMarginBottom, onChange, selectedValue, isDarkerBackground, allowedWeekRange, restrictToRange, }: {
1288
1288
  label: any;
1289
1289
  disabled: any;
1290
1290
  borderColor: any;
1291
1291
  borderColorFocus: any;
1292
1292
  textColor: any;
1293
- text?: string;
1294
1293
  hoverColor: any;
1295
1294
  required: any;
1296
1295
  placeholder: any;
@@ -1575,7 +1574,7 @@ declare function ModalDrawer({ open, height, onClose, children, widthPercent }:
1575
1574
  widthPercent?: number;
1576
1575
  }): react_jsx_runtime.JSX.Element;
1577
1576
 
1578
- declare function OverlayDropdown({ data, value, onSelectClick, disabled, isDarkerBackground, required, selectedColor, hoverColor, dropdownMaxHeight, width, height, label, labelEmptyValue, showLabelOnTop, placeHolder, labelColor, placeHolderColor, margin, editableDigitalCoupon, dropdownDigitalCouponTitle, ...props }: {
1577
+ declare function OverlayDropdown({ data, value, onSelectClick, disabled, isDarkerBackground, required, selectedColor, hoverColor, dropdownMaxHeight, width, height, label, labelEmptyValue, showLabelOnTop, placeHolder, labelColor, placeHolderColor, textColorMenu, margin, editableDigitalCoupon, dropdownDigitalCouponTitle, ...props }: {
1579
1578
  [x: string]: any;
1580
1579
  data?: any[];
1581
1580
  value: any;
@@ -1594,6 +1593,7 @@ declare function OverlayDropdown({ data, value, onSelectClick, disabled, isDarke
1594
1593
  placeHolder: any;
1595
1594
  labelColor: any;
1596
1595
  placeHolderColor: any;
1596
+ textColorMenu?: string;
1597
1597
  margin?: string;
1598
1598
  editableDigitalCoupon?: boolean;
1599
1599
  dropdownDigitalCouponTitle?: string;
package/dist/index.esm.js CHANGED
@@ -10581,23 +10581,24 @@ const QuarterPopupPicker = ({
10581
10581
  };
10582
10582
 
10583
10583
  /* eslint-disable import/no-extraneous-dependencies */
10584
- const QuarterPicker = ({
10585
- availableQuarters,
10586
- // ["Q1-2024"]
10587
- label,
10588
- onChange,
10589
- borderRadius,
10590
- required,
10591
- width,
10592
- height,
10593
- placeholder,
10594
- disabled,
10595
- borderColor,
10596
- borderColorFocus,
10597
- textColor,
10598
- selectedValue,
10599
- startYear
10600
- }) => {
10584
+ const QuarterPicker = _ref => {
10585
+ let {
10586
+ availableQuarters,
10587
+ // ["Q1-2024"]
10588
+ label,
10589
+ onChange,
10590
+ borderRadius,
10591
+ required,
10592
+ width,
10593
+ height,
10594
+ placeholder,
10595
+ disabled,
10596
+ borderColor,
10597
+ borderColorFocus,
10598
+ textColor,
10599
+ selectedValue,
10600
+ startYear
10601
+ } = _ref;
10601
10602
  const [isFocused, setIsFocused] = useState(false);
10602
10603
  const [isOpen, setIsOpen] = useState(false);
10603
10604
  const [value, setValue] = useState('');
@@ -11039,22 +11040,23 @@ const MonthPopupPicker = ({
11039
11040
  };
11040
11041
 
11041
11042
  /* eslint-disable import/no-extraneous-dependencies */
11042
- const MonthPicker = ({
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
- }) => {
11043
+ const MonthPicker = _ref => {
11044
+ let {
11045
+ availableMonths,
11046
+ label,
11047
+ onChange,
11048
+ borderRadius,
11049
+ required,
11050
+ width,
11051
+ height,
11052
+ placeholder,
11053
+ disabled,
11054
+ borderColor,
11055
+ borderColorFocus,
11056
+ textColor,
11057
+ selectedValue,
11058
+ startYear
11059
+ } = _ref;
11058
11060
  const [isFocused, setIsFocused] = useState(false);
11059
11061
  const [isOpen, setIsOpen] = useState(false);
11060
11062
  const [value, setValue] = useState('');
@@ -24165,21 +24167,22 @@ const DeleteIcon = styled.div`
24165
24167
  position: absolute;
24166
24168
  `;
24167
24169
 
24168
- const QuickFilterDropdownSingle = ({
24169
- label,
24170
- hoverColor,
24171
- options,
24172
- selectedValue,
24173
- placeHolder,
24174
- onChange,
24175
- disabled,
24176
- width,
24177
- error,
24178
- errorMessage,
24179
- xIconShow,
24180
- labelColor,
24181
- showLabelOnTop
24182
- }) => {
24170
+ const QuickFilterDropdownSingle = _ref => {
24171
+ let {
24172
+ label,
24173
+ hoverColor,
24174
+ options,
24175
+ selectedValue,
24176
+ placeHolder,
24177
+ onChange,
24178
+ disabled,
24179
+ width,
24180
+ error,
24181
+ errorMessage,
24182
+ xIconShow,
24183
+ labelColor,
24184
+ showLabelOnTop
24185
+ } = _ref;
24183
24186
  const [isFocused, setIsFocused] = useState(false);
24184
24187
  const [showOptions, setShowOptions] = useState(false);
24185
24188
  const [inputValue, setInputValue] = useState("");
@@ -24636,25 +24639,26 @@ const IconContainer$2 = styled.div`
24636
24639
  cursor: pointer;
24637
24640
  `;
24638
24641
 
24639
- const QuickFilterDropdownMultiSelection = ({
24640
- label,
24641
- labelEmptyValue,
24642
- options,
24643
- selectedValue,
24644
- placeHolder,
24645
- onChange,
24646
- required,
24647
- disabled,
24648
- width,
24649
- height,
24650
- error,
24651
- errorMessage,
24652
- labelColor,
24653
- xIconShow,
24654
- checkBoxColor,
24655
- showLabelOnTop,
24656
- dropdownHeight
24657
- }) => {
24642
+ const QuickFilterDropdownMultiSelection = _ref => {
24643
+ let {
24644
+ label,
24645
+ labelEmptyValue,
24646
+ options,
24647
+ selectedValue,
24648
+ placeHolder,
24649
+ onChange,
24650
+ required,
24651
+ disabled,
24652
+ width,
24653
+ height,
24654
+ error,
24655
+ errorMessage,
24656
+ labelColor,
24657
+ xIconShow,
24658
+ checkBoxColor,
24659
+ showLabelOnTop,
24660
+ dropdownHeight
24661
+ } = _ref;
24658
24662
  const [isFocused, setIsFocused] = useState(false);
24659
24663
  const [showOptions, setShowOptions] = useState(false);
24660
24664
  const [inputValue, setInputValue] = useState('');
@@ -35195,7 +35199,6 @@ const WeeksPicker = _ref => {
35195
35199
  borderColor,
35196
35200
  borderColorFocus,
35197
35201
  textColor,
35198
- text = 'Week',
35199
35202
  hoverColor,
35200
35203
  required,
35201
35204
  placeholder,
@@ -35219,7 +35222,6 @@ const WeeksPicker = _ref => {
35219
35222
  const [isFocused, setIsFocused] = useState(false);
35220
35223
  const [isOpen, setIsOpen] = useState(false);
35221
35224
  const [showAbove, setShowAbove] = useState(false);
35222
- const [previousText, setPreviousText] = useState(text);
35223
35225
 
35224
35226
  // Function to parse the value string and extract week numbers
35225
35227
  const parseValueToWeeks = valueString => {
@@ -35227,21 +35229,25 @@ const WeeksPicker = _ref => {
35227
35229
  startWeek: null,
35228
35230
  endWeek: null
35229
35231
  };
35230
- const rangeMatch = valueString.match(/^(.+?)\s*(\d+)\s*-\s*(\d+)$/);
35231
- if (rangeMatch) {
35232
- const startWeek = parseInt(rangeMatch[2]);
35233
- const endWeek = parseInt(rangeMatch[3]);
35232
+
35233
+ // Handle single week: "Week 5"
35234
+ const singleWeekMatch = valueString.match(/^Week (\d+)$/);
35235
+ if (singleWeekMatch) {
35236
+ const week = parseInt(singleWeekMatch[1]);
35234
35237
  return {
35235
- startWeek,
35236
- endWeek
35238
+ startWeek: week,
35239
+ endWeek: week
35237
35240
  };
35238
35241
  }
35239
- const singleMatch = valueString.match(/^(.+?)\s*(\d+)$/);
35240
- if (singleMatch) {
35241
- const week = parseInt(singleMatch[2]);
35242
+
35243
+ // Handle week range: "Weeks 5 - 10"
35244
+ const rangeMatch = valueString.match(/^Weeks (\d+) - (\d+)$/);
35245
+ if (rangeMatch) {
35246
+ const startWeek = parseInt(rangeMatch[1]);
35247
+ const endWeek = parseInt(rangeMatch[2]);
35242
35248
  return {
35243
- startWeek: week,
35244
- endWeek: week
35249
+ startWeek,
35250
+ endWeek
35245
35251
  };
35246
35252
  }
35247
35253
  return {
@@ -35317,27 +35323,6 @@ const WeeksPicker = _ref => {
35317
35323
  }
35318
35324
  }
35319
35325
  }, [allowedWeekRange, restrictToRange]);
35320
- useEffect(() => {
35321
- if (previousText !== text) {
35322
- setPreviousText(text);
35323
- }
35324
- const currentValue = value || selectedValue;
35325
- if (currentValue) {
35326
- const {
35327
- startWeek,
35328
- endWeek
35329
- } = parseValueToWeeks(currentValue);
35330
- if (startWeek && endWeek) {
35331
- const newValue = endWeek === startWeek ? text === 'Week' ? `${text} ${startWeek}` : `${text}${startWeek}` : text === 'Week' ? `${text}s ${startWeek} - ${endWeek}` : `${text}${startWeek} - ${endWeek}`;
35332
- if (newValue !== value) {
35333
- setValue(newValue);
35334
- if (onChange) {
35335
- onChange(newValue);
35336
- }
35337
- }
35338
- }
35339
- }
35340
- }, [text, value, selectedValue, previousText, onChange]);
35341
35326
  const handleToggle = () => {
35342
35327
  setIsOpen(!isOpen);
35343
35328
  };
@@ -35358,6 +35343,11 @@ const WeeksPicker = _ref => {
35358
35343
  onChange(newValue);
35359
35344
  setValue(newValue);
35360
35345
  };
35346
+ useEffect(() => {
35347
+ if (selectedValue !== undefined) {
35348
+ setValue(selectedValue);
35349
+ }
35350
+ }, [selectedValue]);
35361
35351
  const handleApply = () => {
35362
35352
  setIsOpen(false);
35363
35353
  };
@@ -35441,7 +35431,7 @@ const WeeksPicker = _ref => {
35441
35431
  console.warn('Selected weeks are outside the allowed range');
35442
35432
  return;
35443
35433
  }
35444
- const tempValue = end === start ? text === 'Week' ? `${text} ${start}` : `${text}${start}` : text === 'Week' ? `${text}s ${start} - ${end}` : `${text}${start} - ${end}`;
35434
+ const tempValue = end === start ? `Week ${start}` : `Weeks ${start} - ${end}`;
35445
35435
  onChange(tempValue);
35446
35436
  setValue(tempValue);
35447
35437
  handleApply();
@@ -36108,15 +36098,19 @@ const ToggleInput = styled.input`
36108
36098
  const ToggleSlider = styled.span`
36109
36099
  display: block;
36110
36100
  position: relative;
36111
- background: ${({
36112
- checked,
36113
- disabled
36114
- }) => checked ? "#006d6a" : disabled ? "#B1B1B1" : "#D0D0D0"};
36101
+ background: ${_ref => {
36102
+ let {
36103
+ checked,
36104
+ disabled
36105
+ } = _ref;
36106
+ return checked ? "#006d6a" : disabled ? "#B1B1B1" : "#D0D0D0";
36107
+ }};
36115
36108
  border-radius: 999px;
36116
36109
  transition: background 0.2s;
36117
- ${({
36118
- size
36119
- }) => {
36110
+ ${_ref2 => {
36111
+ let {
36112
+ size
36113
+ } = _ref2;
36120
36114
  switch (size) {
36121
36115
  case "s":
36122
36116
  return css`width: 40px; height: 20px;`;
@@ -36132,14 +36126,18 @@ const ToggleSlider = styled.span`
36132
36126
  left: 3px;
36133
36127
  top: 50%;
36134
36128
  transform: translateY(-50%);
36135
- background: ${({
36136
- disabled
36137
- }) => disabled ? "#D0D0D0" : "#fff"};
36129
+ background: ${_ref3 => {
36130
+ let {
36131
+ disabled
36132
+ } = _ref3;
36133
+ return disabled ? "#D0D0D0" : "#fff";
36134
+ }};
36138
36135
  border-radius: 50%;
36139
36136
  transition: left 0.2s, width 0.2s, height 0.2s;
36140
- ${({
36141
- size
36142
- }) => {
36137
+ ${_ref4 => {
36138
+ let {
36139
+ size
36140
+ } = _ref4;
36143
36141
  switch (size) {
36144
36142
  case "s":
36145
36143
  return css`width: 14px; height: 14px;`;
@@ -36149,10 +36147,11 @@ const ToggleSlider = styled.span`
36149
36147
  return css`width: 20px; height: 20px;`;
36150
36148
  }
36151
36149
  }}
36152
- left: ${({
36153
- checked,
36154
- size
36155
- }) => {
36150
+ left: ${_ref5 => {
36151
+ let {
36152
+ checked,
36153
+ size
36154
+ } = _ref5;
36156
36155
  if (!checked) return "3px";
36157
36156
  switch (size) {
36158
36157
  case "s":
@@ -36166,9 +36165,9 @@ const ToggleSlider = styled.span`
36166
36165
  }
36167
36166
  `;
36168
36167
 
36169
- /**
36170
- * ToggleSwitch component for on/off states.
36171
- * Supports small/large sizes and disabled state.
36168
+ /**
36169
+ * ToggleSwitch component for on/off states.
36170
+ * Supports small/large sizes and disabled state.
36172
36171
  */
36173
36172
  function ToggleSwitch(_ref) {
36174
36173
  let {
@@ -57659,6 +57658,7 @@ const OverlayDropdown = _ref => {
57659
57658
  placeHolder,
57660
57659
  labelColor,
57661
57660
  placeHolderColor,
57661
+ textColorMenu = "black",
57662
57662
  margin = "8px",
57663
57663
  editableDigitalCoupon = false,
57664
57664
  dropdownDigitalCouponTitle = "",
@@ -57933,10 +57933,12 @@ const OverlayDropdown = _ref => {
57933
57933
  }, /*#__PURE__*/React$1.createElement(TruncatedText, {
57934
57934
  onMouseEnter: () => setHoveredText(selected?.label),
57935
57935
  onMouseLeave: () => setHoveredText(null),
57936
- color: !selected && open ? placeHolderColor : "inherit"
57936
+ color: !selected && open ? textColorMenu : "inherit"
57937
57937
  }, group.templateType === 3 && editableDigitalCoupon ? dropdownDigitalCouponTitle !== "" ? dropdownDigitalCouponTitle : item.label : item.label), group.templateType === 2 ? /*#__PURE__*/React$1.createElement(ChervronRightIcon, {
57938
57938
  fill: item.value === value ? "#fff" : "#212121"
57939
- }) : group.templateType === 3 && editableDigitalCoupon ? /*#__PURE__*/React$1.createElement(PenIcon, {
57939
+ }) : group.templateType === 3 && editableDigitalCoupon ? dropdownDigitalCouponTitle === "" ? /*#__PURE__*/React$1.createElement(ChervronRightIcon, {
57940
+ fill: item.value === value ? "#fff" : "#212121"
57941
+ }) : /*#__PURE__*/React$1.createElement(PenIcon, {
57940
57942
  fill: item.value === value ? "#fff" : "#212121"
57941
57943
  }) : item.value === value && /*#__PURE__*/React$1.createElement(OkIcon, {
57942
57944
  width: "22px",