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 +2 -1
- package/dist/index.esm.js +72 -46
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +72 -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,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 =>
|
|
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
|
+
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,
|