sag_components 2.0.0-beta291 → 2.0.0-beta292
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 +2 -1
- package/dist/index.esm.js +61 -46
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +61 -46
- package/dist/index.js.map +1 -1
- package/dist/types/components/OverlayDropdown/OverlayDropdown.d.ts +2 -1
- package/dist/types/components/OverlayDropdown/OverlayDropdown.stories.d.ts +81 -126
- package/package.json +1 -1
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,66 @@ 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 =>
|
|
58126
|
-
|
|
58127
|
-
|
|
58128
|
-
|
|
58129
|
-
|
|
58130
|
-
|
|
58131
|
-
|
|
58132
|
-
|
|
58133
|
-
|
|
58134
|
-
|
|
58135
|
-
|
|
58136
|
-
|
|
58137
|
-
|
|
58138
|
-
|
|
58139
|
-
|
|
58140
|
-
|
|
58141
|
-
|
|
58142
|
-
|
|
58143
|
-
|
|
58144
|
-
|
|
58145
|
-
|
|
58146
|
-
|
|
58147
|
-
|
|
58148
|
-
|
|
58149
|
-
|
|
58150
|
-
|
|
58151
|
-
|
|
58152
|
-
|
|
58153
|
-
|
|
58154
|
-
|
|
58155
|
-
|
|
58156
|
-
|
|
58157
|
-
|
|
58158
|
-
|
|
58159
|
-
|
|
58160
|
-
|
|
58161
|
-
|
|
58162
|
-
|
|
58163
|
-
|
|
58164
|
-
|
|
58165
|
-
|
|
58166
|
-
|
|
58167
|
-
|
|
58168
|
-
|
|
58169
|
-
|
|
58170
|
-
|
|
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
|
+
const penColor = isDigitalCoupon && hasAppliedCoupons ? "#FF8C00" : item.value === value ? "#fff" : "#212121";
|
|
58130
|
+
|
|
58131
|
+
// Update label to show count for digital coupons
|
|
58132
|
+
let displayText = item.label;
|
|
58133
|
+
if (isDigitalCoupon && appliedCouponsCount > 0) {
|
|
58134
|
+
displayText = `Digital Coupon/s (${appliedCouponsCount})`;
|
|
58135
|
+
}
|
|
58136
|
+
return /*#__PURE__*/React$1.createElement(DropdownItem, {
|
|
58137
|
+
key: item.value,
|
|
58138
|
+
selected: item.value === value,
|
|
58139
|
+
selectedColor: selectedColor,
|
|
58140
|
+
hoverColor: hoverColor,
|
|
58141
|
+
onClick: () => {
|
|
58142
|
+
if (onSelectClick && !disabled) {
|
|
58143
|
+
setOpen(false);
|
|
58144
|
+
if (group.templateType === 3 && editableDigitalCoupon) {
|
|
58145
|
+
const result = {
|
|
58146
|
+
...item,
|
|
58147
|
+
label: item.displayLabel || item.label,
|
|
58148
|
+
overlayCode: group.overlayCode,
|
|
58149
|
+
overlayName: group.overlayName,
|
|
58150
|
+
templateType: group.templateType,
|
|
58151
|
+
isEditableDigitalCoupon: true
|
|
58152
|
+
};
|
|
58153
|
+
onSelectClick(result);
|
|
58154
|
+
} else if (group.templateType === 2) {
|
|
58155
|
+
setTemplateDialog({
|
|
58156
|
+
item,
|
|
58157
|
+
group,
|
|
58158
|
+
params: getTemplateParams(item.displayLabel || item.label)
|
|
58159
|
+
});
|
|
58160
|
+
} else {
|
|
58161
|
+
const result = {
|
|
58162
|
+
...item,
|
|
58163
|
+
overlayCode: group.overlayCode,
|
|
58164
|
+
overlayName: group.overlayName,
|
|
58165
|
+
templateType: group.templateType
|
|
58166
|
+
};
|
|
58167
|
+
onSelectClick(result);
|
|
58168
|
+
}
|
|
58169
|
+
}
|
|
58170
|
+
}
|
|
58171
|
+
}, /*#__PURE__*/React$1.createElement(TruncatedText, {
|
|
58172
|
+
onMouseEnter: () => setHoveredText(displayText),
|
|
58173
|
+
onMouseLeave: () => setHoveredText(null)
|
|
58174
|
+
}, displayText), group.templateType === 2 ? /*#__PURE__*/React$1.createElement(ChervronRightIcon, {
|
|
58175
|
+
fill: item.value === value ? "#fff" : "#212121"
|
|
58176
|
+
}) : isDigitalCoupon ? /*#__PURE__*/React$1.createElement(PenIcon, {
|
|
58177
|
+
color: penColor,
|
|
58178
|
+
width: "16",
|
|
58179
|
+
height: "16"
|
|
58180
|
+
}) : item.value === value && /*#__PURE__*/React$1.createElement(OkIcon, {
|
|
58181
|
+
width: "22px",
|
|
58182
|
+
height: "22px",
|
|
58183
|
+
color: "#fff"
|
|
58184
|
+
}));
|
|
58185
|
+
})))), templateDialog && /*#__PURE__*/React$1.createElement(OverlayTemplateDialog, {
|
|
58171
58186
|
open: true,
|
|
58172
58187
|
onClose: () => setTemplateDialog(null),
|
|
58173
58188
|
onApply: handleTemplateApply,
|