sag_components 2.0.0-beta291 → 2.0.0-beta293

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
@@ -1588,7 +1588,7 @@ declare function ModalDrawer({ open, height, onClose, children, widthPercent }:
1588
1588
  widthPercent?: number;
1589
1589
  }): react_jsx_runtime.JSX.Element;
1590
1590
 
1591
- declare function OverlayDropdown({ data, value, onSelectClick, label, labelEmptyValue, showLabelOnTop, labelColor, placeHolder, placeHolderColor, required, disabled, isDarkerBackground, editableDigitalCoupon, customDisplayText, selectedColor, hoverColor, width, minWidth, dropdownWidth, dropdownMaxHeight, height, margin, ...props }: {
1591
+ declare function OverlayDropdown({ data, value, onSelectClick, label, labelEmptyValue, showLabelOnTop, labelColor, placeHolder, placeHolderColor, required, disabled, isDarkerBackground, editableDigitalCoupon, customDisplayText, appliedCouponsCount, selectedColor, hoverColor, width, minWidth, dropdownWidth, dropdownMaxHeight, height, margin, ...props }: {
1592
1592
  [x: string]: any;
1593
1593
  data?: any[];
1594
1594
  value: any;
@@ -1604,6 +1604,7 @@ declare function OverlayDropdown({ data, value, onSelectClick, label, labelEmpty
1604
1604
  isDarkerBackground?: boolean;
1605
1605
  editableDigitalCoupon?: boolean;
1606
1606
  customDisplayText?: any;
1607
+ appliedCouponsCount?: number;
1607
1608
  selectedColor?: string;
1608
1609
  hoverColor?: string;
1609
1610
  width?: string;
package/dist/index.esm.js CHANGED
@@ -57892,6 +57892,7 @@ const OverlayDropdown = _ref => {
57892
57892
  isDarkerBackground = false,
57893
57893
  editableDigitalCoupon = false,
57894
57894
  customDisplayText = null,
57895
+ appliedCouponsCount = 0,
57895
57896
  selectedColor = "#066768",
57896
57897
  hoverColor = "#E6F0F0",
57897
57898
  width = "100%",
@@ -58122,52 +58123,77 @@ const OverlayDropdown = _ref => {
58122
58123
  $showBorder: group.overlayName,
58123
58124
  margin: margin,
58124
58125
  key: group.overlayCode
58125
- }, ["Template Offer", "Last defined by you"].includes(group.overlayName) && /*#__PURE__*/React$1.createElement(SectionTitle, null, group.overlayName), group.items.map(item => /*#__PURE__*/React$1.createElement(DropdownItem, {
58126
- key: item.value,
58127
- selected: item.value === value,
58128
- selectedColor: selectedColor,
58129
- hoverColor: hoverColor,
58130
- onClick: () => {
58131
- if (onSelectClick && !disabled) {
58132
- setOpen(false);
58133
- if (group.templateType === 3 && editableDigitalCoupon) {
58134
- const result = {
58135
- ...item,
58136
- overlayCode: group.overlayCode,
58137
- overlayName: group.overlayName,
58138
- templateType: group.templateType,
58139
- isEditableDigitalCoupon: true
58140
- };
58141
- onSelectClick(result);
58142
- } else if (group.templateType === 2) {
58143
- setTemplateDialog({
58144
- item,
58145
- group,
58146
- params: getTemplateParams(item.label)
58147
- });
58148
- } else {
58149
- const result = {
58150
- ...item,
58151
- overlayCode: group.overlayCode,
58152
- overlayName: group.overlayName,
58153
- templateType: group.templateType
58154
- };
58155
- onSelectClick(result);
58156
- }
58157
- }
58158
- }
58159
- }, /*#__PURE__*/React$1.createElement(TruncatedText, {
58160
- onMouseEnter: () => setHoveredText(item.label),
58161
- onMouseLeave: () => setHoveredText(null)
58162
- }, item.label), group.templateType === 2 ? /*#__PURE__*/React$1.createElement(ChervronRightIcon, {
58163
- fill: item.value === value ? "#fff" : "#212121"
58164
- }) : group.templateType === 3 && editableDigitalCoupon ? /*#__PURE__*/React$1.createElement(PenIcon, {
58165
- fill: item.value === value ? "#fff" : "#212121"
58166
- }) : item.value === value && /*#__PURE__*/React$1.createElement(OkIcon, {
58167
- width: "22px",
58168
- height: "22px",
58169
- color: "#fff"
58170
- })))))), templateDialog && /*#__PURE__*/React$1.createElement(OverlayTemplateDialog, {
58126
+ }, ["Template Offer", "Last defined by you"].includes(group.overlayName) && /*#__PURE__*/React$1.createElement(SectionTitle, null, group.overlayName), group.items.map(item => {
58127
+ const isDigitalCoupon = group.templateType === 3 && editableDigitalCoupon;
58128
+ const hasAppliedCoupons = appliedCouponsCount > 0;
58129
+ let displayText = item.label;
58130
+ if (isDigitalCoupon && appliedCouponsCount > 0) {
58131
+ displayText = `Digital Coupon/s (${appliedCouponsCount})`;
58132
+ }
58133
+ let iconToShow = null;
58134
+ if (group.templateType === 2) {
58135
+ iconToShow = /*#__PURE__*/React$1.createElement(ChervronRightIcon, {
58136
+ fill: item.value === value ? "#fff" : "#212121"
58137
+ });
58138
+ } else if (isDigitalCoupon) {
58139
+ if (hasAppliedCoupons) {
58140
+ iconToShow = /*#__PURE__*/React$1.createElement(PenIcon, {
58141
+ color: item.value === value ? "#fff" : "#212121",
58142
+ width: "16",
58143
+ height: "16"
58144
+ });
58145
+ } else {
58146
+ iconToShow = /*#__PURE__*/React$1.createElement(ChervronRightIcon, {
58147
+ fill: item.value === value ? "#fff" : "#212121"
58148
+ });
58149
+ }
58150
+ } else if (item.value === value) {
58151
+ iconToShow = /*#__PURE__*/React$1.createElement(OkIcon, {
58152
+ width: "22px",
58153
+ height: "22px",
58154
+ color: "#fff"
58155
+ });
58156
+ }
58157
+ return /*#__PURE__*/React$1.createElement(DropdownItem, {
58158
+ key: item.value,
58159
+ selected: item.value === value,
58160
+ selectedColor: selectedColor,
58161
+ hoverColor: hoverColor,
58162
+ onClick: () => {
58163
+ if (onSelectClick && !disabled) {
58164
+ setOpen(false);
58165
+ if (group.templateType === 3 && editableDigitalCoupon) {
58166
+ const result = {
58167
+ ...item,
58168
+ label: item.displayLabel || item.label,
58169
+ overlayCode: group.overlayCode,
58170
+ overlayName: group.overlayName,
58171
+ templateType: group.templateType,
58172
+ isEditableDigitalCoupon: true
58173
+ };
58174
+ onSelectClick(result);
58175
+ } else if (group.templateType === 2) {
58176
+ setTemplateDialog({
58177
+ item,
58178
+ group,
58179
+ params: getTemplateParams(item.displayLabel || item.label)
58180
+ });
58181
+ } else {
58182
+ const result = {
58183
+ ...item,
58184
+ overlayCode: group.overlayCode,
58185
+ overlayName: group.overlayName,
58186
+ templateType: group.templateType
58187
+ };
58188
+ onSelectClick(result);
58189
+ }
58190
+ }
58191
+ }
58192
+ }, /*#__PURE__*/React$1.createElement(TruncatedText, {
58193
+ onMouseEnter: () => setHoveredText(displayText),
58194
+ onMouseLeave: () => setHoveredText(null)
58195
+ }, displayText), iconToShow);
58196
+ })))), templateDialog && /*#__PURE__*/React$1.createElement(OverlayTemplateDialog, {
58171
58197
  open: true,
58172
58198
  onClose: () => setTemplateDialog(null),
58173
58199
  onApply: handleTemplateApply,