allaw-ui 3.7.8 → 3.7.9
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.
|
@@ -71,7 +71,8 @@ var PrimaryButton = forwardRef(function (_a, ref) {
|
|
|
71
71
|
// Determine where to place additional icons
|
|
72
72
|
var hasStartIcon = startIcon || (startIconName && startIconName.trim() !== "");
|
|
73
73
|
var hasEndIcon = endIcon || (endIconName && endIconName.trim() !== "");
|
|
74
|
-
|
|
74
|
+
// Place additional icons at start if there's a start icon, otherwise at start by default
|
|
75
|
+
var shouldPlaceAtStart = hasStartIcon || !hasEndIcon;
|
|
75
76
|
useEffect(function () {
|
|
76
77
|
var interval = null;
|
|
77
78
|
if (isButtonLoading) {
|
|
@@ -123,7 +124,7 @@ var PrimaryButton = forwardRef(function (_a, ref) {
|
|
|
123
124
|
startIcon && (React.createElement("span", { className: "primary-button-icon ".concat(startIconName) })),
|
|
124
125
|
React.createElement("span", { className: "primary-button-label" }, label),
|
|
125
126
|
isButtonLoading ? (React.createElement("span", { className: "primary-button-loading-dots" }, loadingDots)) : (endIcon && React.createElement("span", { className: "primary-button-icon ".concat(endIconName) })),
|
|
126
|
-
!shouldPlaceAtStart &&
|
|
127
|
+
!shouldPlaceAtStart && renderAdditionalIcons()));
|
|
127
128
|
});
|
|
128
129
|
PrimaryButton.displayName = "PrimaryButton";
|
|
129
130
|
export default PrimaryButton;
|
|
@@ -117,4 +117,5 @@ export const WithAdditionalIconsStart: any;
|
|
|
117
117
|
export const WithAdditionalIconsEnd: any;
|
|
118
118
|
export const WithAdditionalIconsBoth: any;
|
|
119
119
|
export const LargeWithAdditionalIcons: any;
|
|
120
|
+
export const OnlyAdditionalIcons: any;
|
|
120
121
|
import PrimaryButton from "./PrimaryButton";
|
|
@@ -183,3 +183,5 @@ export var WithAdditionalIconsBoth = Template.bind({});
|
|
|
183
183
|
WithAdditionalIconsBoth.args = __assign(__assign({}, Default.args), { label: "Icônes Début et Fin", startIcon: true, endIcon: true, additionalIcons: [csvIcon, xlsxIcon] });
|
|
184
184
|
export var LargeWithAdditionalIcons = Template.bind({});
|
|
185
185
|
LargeWithAdditionalIcons.args = __assign(__assign({}, Default.args), { label: "Grand Bouton avec Icônes", startIcon: true, size: "large", additionalIcons: [csvIcon, xlsxIcon] });
|
|
186
|
+
export var OnlyAdditionalIcons = Template.bind({});
|
|
187
|
+
OnlyAdditionalIcons.args = __assign(__assign({}, Default.args), { label: "Seulement Icônes Supplémentaires", startIcon: false, endIcon: false, additionalIcons: [csvIcon, xlsxIcon] });
|