arengibook 2.5.503 → 2.5.505
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.js +225 -160
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { useContext, useState, useRef, useEffect, isValidElement, cloneElement, Children, forwardRef, Fragment } from 'react';
|
|
2
|
+
import React__default, { useContext, useState, useRef, useEffect, isValidElement, cloneElement, Children, forwardRef, Fragment, useMemo } from 'react';
|
|
3
3
|
import ReactDOM from 'react-dom';
|
|
4
4
|
|
|
5
5
|
function _arrayWithHoles$f(r) {
|
|
@@ -42653,6 +42653,7 @@ Toast$1.displayName = 'Toast';
|
|
|
42653
42653
|
var css_248z = ".p-toast-message {\n height:auto;\n}\n.p-toast-message.heightoastlarge {\n min-height:50px;\n}\n.p-toast-message.heightoastmedium {\n max-height:100px;\n overflow: hidden;\n}\n\n.p-toast-message.toast_s--compact {\n width: 116px;\n min-width: 56px;\n padding-right: 0;\n position: relative;\n}\n\n.p-toast-message.toast_s--compact .p-toast-message-content {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0.5rem;\n}\n\n.p-toast-message.toast_s--compact .maximize-button {\n margin-right: 20px;\n}\n\n.p-toast-message.toast_s--compact .p-toast-icon-close {\n position: absolute;\n top: 4px;\n right: 4px;\n}\n\n\n.p-toast-message.toast_s--large {\n width: auto;\n min-width: auto;\n padding-right: inherit;\n}\n\n.p-toast-message.toast_s--large .p-toast-message-content {\n display: flex;\n align-items: center;\n padding: 1rem;\n gap: 0.75rem;\n}\n\n.p-toast-message .maximize-button-container {\n margin-left: auto;\n display: flex;\n align-items: center;\n}\n\n.p-toast-message.toast_s--large .p-toast-icon-close {\n position: static;\n margin-left: 0.5rem;\n}\n\n/* Title */\n\n.toast-title {\n font-weight: 600;\n font-size: 0.95rem;\n line-height: 1.3;\n color: #111827; /* gris très foncé / quasi noir */\n margin-bottom: 0.25rem;\n}\n\n\n.toast-root {\n display: flex;\n align-items: flex-start;\n width: 100%;\n gap: 0.75rem;\n}\n.toast-left {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n flex-shrink: 0;\n}\n.toast-body {\n line-height: 1.4;\n}\n.toast-action-btn {\n background: transparent;\n border: none;\n cursor: pointer;\n padding: 0;\n}\n.p-toast-message-content {\n position: relative;\n}\n.p-toast-icon-close {\n position: static;\n}\n.toast-left .p-toast-icon-close {\n order: 3;\n}\n/* Toast - Percentage */\n.toast-percentage {\n margin-top: 0.5rem;\n width: 100%;\n}\n\n.toast-percentage-label {\n font-size: 0.875rem;\n color: #6b7280;\n margin-bottom: 0.25rem;\n text-align: right;\n width: 100%;\n}\n\n.toast-percentage-bar {\n height: 6px;\n background-color: #e5e7eb;\n border-radius: 999px;\n overflow: hidden;\n width: 100%;\n}\n\n.toast-percentage-bar-fill {\n height: 100%;\n background-color: #3b82f6;\n transition: width 0.3s ease;\n}\n\n/* Link */\n\n.toast-link {\n margin-top: 0.5rem;\n}\n\n.toast-link a {\n font-size: 0.85rem;\n font-weight: 500;\n color: #2563eb;\n text-decoration: underline;\n}\n\n.toast-link a:hover {\n text-decoration: none;\n}\n\n/* Links */\n\n.toast-links {\n margin-top: 0.5rem;\n padding-left: 1rem;\n}\n\n.toast-links li {\n margin-bottom: 0.25rem;\n}\n\n.toast-links a {\n font-size: 0.85rem;\n color: #2563eb;\n text-decoration: underline;\n}\n\n.toast-links a:hover {\n text-decoration: none;\n}\n\n.toast-message {\n padding-right: 20px;\n}\n.p-toast-message {\n position: relative;\n}\n.p-toast-message .p-toast-icon-close {\n position: absolute;\n top: 0.5rem;\n right: 0.5rem;\n}\n.p-toast-message .toast-action-btn {\n position: absolute;\n top: 0.5rem;\n right: 2.5rem;\n}\n\n/* AttachedFiles */\n\n.toast-attached-files {\n margin-top: 0.75rem;\n}\n\n.toast-attached-files-title {\n font-size: 0.75rem;\n font-weight: 600;\n color: #6b7280;\n margin-bottom: 0.25rem;\n}\n\n.toast-attached-files-list {\n list-style: none;\n padding: 0;\n margin: 0;\n}\n\n.toast-attached-files-list li {\n margin-bottom: 0.25rem;\n}\n\n.toast-attached-files-list a {\n display: inline-flex;\n align-items: center;\n gap: 0.35rem;\n font-size: 0.85rem;\n color: #2563eb;\n text-decoration: underline;\n}\n\n.toast-attached-files-list a:hover {\n text-decoration: none;\n}\n\n";
|
|
42654
42654
|
styleInject(css_248z);
|
|
42655
42655
|
|
|
42656
|
+
// Toast.jsx
|
|
42656
42657
|
var Toast = function Toast(_ref) {
|
|
42657
42658
|
var icon = _ref.icon,
|
|
42658
42659
|
message = _ref.message,
|
|
@@ -42670,8 +42671,6 @@ var Toast = function Toast(_ref) {
|
|
|
42670
42671
|
duration = _ref$duration === void 0 ? 3000 : _ref$duration,
|
|
42671
42672
|
_ref$autoShow = _ref.autoShow,
|
|
42672
42673
|
autoShow = _ref$autoShow === void 0 ? true : _ref$autoShow,
|
|
42673
|
-
_ref$reShowOnPropsCha = _ref.reShowOnPropsChange,
|
|
42674
|
-
reShowOnPropsChange = _ref$reShowOnPropsCha === void 0 ? false : _ref$reShowOnPropsCha,
|
|
42675
42674
|
onSizeChange = _ref.onSizeChange,
|
|
42676
42675
|
title = _ref.title,
|
|
42677
42676
|
sticky = _ref.sticky,
|
|
@@ -42679,44 +42678,25 @@ var Toast = function Toast(_ref) {
|
|
|
42679
42678
|
enablePercentage = _ref$enablePercentage === void 0 ? false : _ref$enablePercentage,
|
|
42680
42679
|
percentage = _ref.percentage,
|
|
42681
42680
|
link = _ref.link,
|
|
42682
|
-
links = _ref.links
|
|
42683
|
-
|
|
42684
|
-
sizeSModulable = _ref.sizeSModulable,
|
|
42681
|
+
links = _ref.links;
|
|
42682
|
+
_ref.datetimecreation;
|
|
42683
|
+
var sizeSModulable = _ref.sizeSModulable,
|
|
42685
42684
|
isExpanded = _ref.isExpanded,
|
|
42686
42685
|
attachedFiles = _ref.attachedFiles;
|
|
42687
42686
|
var toastRef = useRef(null);
|
|
42688
42687
|
var hasShownRef = useRef(false);
|
|
42689
42688
|
var progressBarRef = useRef(null);
|
|
42690
42689
|
var percentageTextRef = useRef(null);
|
|
42691
|
-
var _useState = useState(percentage),
|
|
42692
|
-
_useState2 = _slicedToArray$a(_useState, 2),
|
|
42693
|
-
currentPercentage = _useState2[0],
|
|
42694
|
-
setCurrentPercentage = _useState2[1];
|
|
42695
|
-
var getIconByType = function getIconByType() {
|
|
42696
|
-
switch (type) {
|
|
42697
|
-
case "success":
|
|
42698
|
-
return "pi pi-check-circle";
|
|
42699
|
-
case "error":
|
|
42700
|
-
return "pi pi-times-circle";
|
|
42701
|
-
case "settingError":
|
|
42702
|
-
return "pi pi-cog pi-times-circle";
|
|
42703
|
-
case "warning":
|
|
42704
|
-
return "pi pi-exclamation-triangle";
|
|
42705
|
-
case "processing":
|
|
42706
|
-
return "pi pi-spinner pi-spin";
|
|
42707
|
-
case "info":
|
|
42708
|
-
default:
|
|
42709
|
-
return "pi pi-info-circle";
|
|
42710
|
-
}
|
|
42711
|
-
};
|
|
42712
42690
|
var handleToggleSize = function handleToggleSize() {
|
|
42713
42691
|
if (!onSizeChange) return;
|
|
42714
42692
|
if (size === "S") {
|
|
42715
42693
|
onSizeChange("L");
|
|
42716
42694
|
toastRef.current.clear();
|
|
42695
|
+
hasShownRef.current = false;
|
|
42717
42696
|
} else if (size === "L") {
|
|
42718
42697
|
onSizeChange("S");
|
|
42719
42698
|
toastRef.current.clear();
|
|
42699
|
+
hasShownRef.current = false;
|
|
42720
42700
|
}
|
|
42721
42701
|
};
|
|
42722
42702
|
var classNameSizeS = function classNameSizeS() {
|
|
@@ -42733,98 +42713,52 @@ var Toast = function Toast(_ref) {
|
|
|
42733
42713
|
return '';
|
|
42734
42714
|
}
|
|
42735
42715
|
};
|
|
42716
|
+
var memoizedRichMessage = useMemo(function () {
|
|
42717
|
+
return /*#__PURE__*/React__default.createElement(RichMessage, {
|
|
42718
|
+
icon: icon,
|
|
42719
|
+
type: type,
|
|
42720
|
+
size: size,
|
|
42721
|
+
title: title,
|
|
42722
|
+
message: message,
|
|
42723
|
+
enableHtmlContent: enableHtmlContent,
|
|
42724
|
+
link: link,
|
|
42725
|
+
links: links,
|
|
42726
|
+
attachedFiles: attachedFiles,
|
|
42727
|
+
enablePercentage: enablePercentage,
|
|
42728
|
+
sizeSModulable: sizeSModulable,
|
|
42729
|
+
isExpanded: isExpanded,
|
|
42730
|
+
onSizeChange: onSizeChange,
|
|
42731
|
+
toastRef: toastRef,
|
|
42732
|
+
progressBarRef: progressBarRef,
|
|
42733
|
+
percentageTextRef: percentageTextRef,
|
|
42734
|
+
handleToggleSize: handleToggleSize
|
|
42735
|
+
});
|
|
42736
|
+
}, [icon, type, size, title, message, enableHtmlContent, link, links, attachedFiles, enablePercentage, sizeSModulable, isExpanded, onSizeChange, handleToggleSize]);
|
|
42736
42737
|
useEffect(function () {
|
|
42737
42738
|
if (!toastRef.current || !autoShow) return;
|
|
42738
|
-
if (hasShownRef.current
|
|
42739
|
-
|
|
42740
|
-
|
|
42741
|
-
|
|
42742
|
-
|
|
42743
|
-
|
|
42744
|
-
|
|
42745
|
-
|
|
42746
|
-
|
|
42747
|
-
|
|
42748
|
-
|
|
42749
|
-
|
|
42750
|
-
|
|
42751
|
-
|
|
42752
|
-
|
|
42753
|
-
|
|
42754
|
-
|
|
42755
|
-
|
|
42756
|
-
|
|
42757
|
-
}, title), /*#__PURE__*/React__default.createElement("div", {
|
|
42758
|
-
className: "toast-message"
|
|
42759
|
-
}, enableHtmlContent ? /*#__PURE__*/React__default.createElement("div", {
|
|
42760
|
-
className: "toast-html-content",
|
|
42761
|
-
dangerouslySetInnerHTML: {
|
|
42762
|
-
__html: message
|
|
42763
|
-
}
|
|
42764
|
-
}) : message), link && size === "L" && /*#__PURE__*/React__default.createElement("div", {
|
|
42765
|
-
className: "toast-link"
|
|
42766
|
-
}, /*#__PURE__*/React__default.createElement("a", {
|
|
42767
|
-
href: link.url,
|
|
42768
|
-
target: "_blank",
|
|
42769
|
-
rel: "noopener noreferrer"
|
|
42770
|
-
}, link.label)), Array.isArray(links) && links.length > 0 && size === "L" && /*#__PURE__*/React__default.createElement("ul", {
|
|
42771
|
-
className: "toast-links"
|
|
42772
|
-
}, links.map(function (link, index) {
|
|
42773
|
-
return /*#__PURE__*/React__default.createElement("li", {
|
|
42774
|
-
key: index
|
|
42775
|
-
}, /*#__PURE__*/React__default.createElement("a", {
|
|
42776
|
-
href: link.url,
|
|
42777
|
-
target: "_blank",
|
|
42778
|
-
rel: "noopener noreferrer"
|
|
42779
|
-
}, link.label));
|
|
42780
|
-
})), Array.isArray(attachedFiles) && attachedFiles.length > 0 && size === "L" && /*#__PURE__*/React__default.createElement("div", {
|
|
42781
|
-
className: "toast-attached-files"
|
|
42782
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
42783
|
-
className: "toast-attached-files-title"
|
|
42784
|
-
}, "Pi\xE8ces jointes"), /*#__PURE__*/React__default.createElement("ul", {
|
|
42785
|
-
className: "toast-attached-files-list"
|
|
42786
|
-
}, attachedFiles.map(function (file, index) {
|
|
42787
|
-
return /*#__PURE__*/React__default.createElement("li", {
|
|
42788
|
-
key: index
|
|
42789
|
-
}, /*#__PURE__*/React__default.createElement("a", {
|
|
42790
|
-
href: file.url,
|
|
42791
|
-
target: "_blank",
|
|
42792
|
-
rel: "noopener noreferrer"
|
|
42793
|
-
}, /*#__PURE__*/React__default.createElement("i", {
|
|
42794
|
-
className: "pi pi-paperclip",
|
|
42795
|
-
"aria-hidden": "true"
|
|
42796
|
-
}), /*#__PURE__*/React__default.createElement("span", null, file.name)));
|
|
42797
|
-
}))), size === "L" && enablePercentage && /*#__PURE__*/React__default.createElement("div", {
|
|
42798
|
-
className: "toast-percentage"
|
|
42799
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
42800
|
-
className: "toast-percentage-label"
|
|
42801
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
42802
|
-
ref: percentageTextRef
|
|
42803
|
-
}, currentPercentage, "%")), /*#__PURE__*/React__default.createElement("div", {
|
|
42804
|
-
className: "toast-percentage-bar"
|
|
42805
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
42806
|
-
ref: progressBarRef,
|
|
42807
|
-
className: "toast-percentage-bar-fill",
|
|
42808
|
-
style: {
|
|
42809
|
-
width: "".concat(currentPercentage, "%")
|
|
42810
|
-
}
|
|
42811
|
-
})))));
|
|
42812
|
-
toastRef.current.show({
|
|
42813
|
-
severity: type,
|
|
42814
|
-
closable: closable,
|
|
42815
|
-
life: duration,
|
|
42816
|
-
sticky: sticky,
|
|
42817
|
-
className: "".concat(classNameSizeS(), " ").concat(type === "processing" ? "toast--processing" : ""),
|
|
42818
|
-
// toast--processing est le css à
|
|
42819
|
-
// personnaliser pour obtenir le loader souhaité par Camille
|
|
42820
|
-
content: function content() {
|
|
42821
|
-
return richMessage;
|
|
42739
|
+
if (!hasShownRef.current) {
|
|
42740
|
+
toastRef.current.show({
|
|
42741
|
+
severity: type,
|
|
42742
|
+
closable: closable,
|
|
42743
|
+
life: duration,
|
|
42744
|
+
sticky: sticky,
|
|
42745
|
+
className: "".concat(classNameSizeS(), " ").concat(type === "processing" ? "toast--processing" : ""),
|
|
42746
|
+
content: function content() {
|
|
42747
|
+
return memoizedRichMessage;
|
|
42748
|
+
}
|
|
42749
|
+
});
|
|
42750
|
+
hasShownRef.current = true;
|
|
42751
|
+
}
|
|
42752
|
+
}, [autoShow, toastRef, memoizedRichMessage]);
|
|
42753
|
+
useEffect(function () {
|
|
42754
|
+
return function () {
|
|
42755
|
+
if (toastRef.current) {
|
|
42756
|
+
toastRef.current.clear();
|
|
42757
|
+
hasShownRef.current = false;
|
|
42822
42758
|
}
|
|
42823
|
-
}
|
|
42824
|
-
|
|
42825
|
-
}, [icon, message, type, size, closable, duration, autoShow, reShowOnPropsChange, title, sticky, enablePercentage, link, datetimecreation, sizeSModulable, isExpanded]);
|
|
42759
|
+
};
|
|
42760
|
+
}, []);
|
|
42826
42761
|
useEffect(function () {
|
|
42827
|
-
setCurrentPercentage(percentage);
|
|
42828
42762
|
if (progressBarRef.current) {
|
|
42829
42763
|
progressBarRef.current.style.width = "".concat(percentage, "%");
|
|
42830
42764
|
}
|
|
@@ -42839,12 +42773,18 @@ var Toast = function Toast(_ref) {
|
|
|
42839
42773
|
};
|
|
42840
42774
|
|
|
42841
42775
|
// Singleton pour l'empilement des toasts
|
|
42842
|
-
var
|
|
42843
|
-
|
|
42776
|
+
var toastRefs = {
|
|
42777
|
+
toastRef: null,
|
|
42778
|
+
hasShownRef: {
|
|
42779
|
+
current: false
|
|
42780
|
+
},
|
|
42781
|
+
// Initialise comme un ref React
|
|
42782
|
+
container: null
|
|
42783
|
+
};
|
|
42844
42784
|
var ToastContainer = function ToastContainer() {
|
|
42845
42785
|
var ref = useRef(null);
|
|
42846
42786
|
useEffect(function () {
|
|
42847
|
-
toastRef = ref
|
|
42787
|
+
toastRefs.toastRef = ref;
|
|
42848
42788
|
}, []);
|
|
42849
42789
|
return /*#__PURE__*/React__default.createElement(Toast$1, {
|
|
42850
42790
|
ref: ref,
|
|
@@ -42852,30 +42792,53 @@ var ToastContainer = function ToastContainer() {
|
|
|
42852
42792
|
});
|
|
42853
42793
|
};
|
|
42854
42794
|
var showToast = function showToast(props) {
|
|
42855
|
-
if (!container) {
|
|
42856
|
-
container = document.createElement('div');
|
|
42857
|
-
document.body.appendChild(container);
|
|
42858
|
-
ReactDOM.render(/*#__PURE__*/React__default.createElement(ToastContainer, null), container);
|
|
42795
|
+
if (!toastRefs.container) {
|
|
42796
|
+
toastRefs.container = document.createElement('div');
|
|
42797
|
+
document.body.appendChild(toastRefs.container);
|
|
42798
|
+
ReactDOM.render(/*#__PURE__*/React__default.createElement(ToastContainer, null), toastRefs.container);
|
|
42859
42799
|
}
|
|
42860
42800
|
setTimeout(function () {
|
|
42861
|
-
if (toastRef) {
|
|
42862
|
-
|
|
42863
|
-
|
|
42801
|
+
if (toastRefs.toastRef) {
|
|
42802
|
+
var handleToggleSize = function handleToggleSize() {
|
|
42803
|
+
if (!props.onSizeChange) return;
|
|
42804
|
+
if (props.size === "S") {
|
|
42805
|
+
props.onSizeChange("L");
|
|
42806
|
+
toastRefs.toastRef.current.clear();
|
|
42807
|
+
toastRefs.hasShownRef.current = false;
|
|
42808
|
+
} else if (props.size === "L") {
|
|
42809
|
+
props.onSizeChange("S");
|
|
42810
|
+
toastRefs.toastRef.current.clear();
|
|
42811
|
+
toastRefs.hasShownRef.current = false;
|
|
42812
|
+
}
|
|
42813
|
+
};
|
|
42814
|
+
toastRefs.toastRef.current.show({
|
|
42864
42815
|
severity: props.type || 'info',
|
|
42865
42816
|
life: props.duration || 3000,
|
|
42866
42817
|
sticky: props.sticky,
|
|
42867
42818
|
closable: props.closable !== false,
|
|
42868
42819
|
summary: props.title || '',
|
|
42869
|
-
content:
|
|
42870
|
-
|
|
42871
|
-
|
|
42872
|
-
|
|
42873
|
-
|
|
42874
|
-
|
|
42875
|
-
|
|
42876
|
-
|
|
42877
|
-
|
|
42878
|
-
|
|
42820
|
+
content: function content() {
|
|
42821
|
+
return /*#__PURE__*/React__default.createElement(RichMessage, {
|
|
42822
|
+
icon: props.icon,
|
|
42823
|
+
type: props.type,
|
|
42824
|
+
size: props.size,
|
|
42825
|
+
title: props.title,
|
|
42826
|
+
message: props.message,
|
|
42827
|
+
enableHtmlContent: props.enableHtmlContent,
|
|
42828
|
+
currentPercentage: props.percentage || 0,
|
|
42829
|
+
link: props.link,
|
|
42830
|
+
links: props.links,
|
|
42831
|
+
attachedFiles: props.attachedFiles,
|
|
42832
|
+
enablePercentage: props.enablePercentage,
|
|
42833
|
+
sizeSModulable: props.sizeSModulable,
|
|
42834
|
+
isExpanded: props.isExpanded,
|
|
42835
|
+
onSizeChange: props.onSizeChange,
|
|
42836
|
+
toastRef: toastRef,
|
|
42837
|
+
progressBarRef: progressBarRef,
|
|
42838
|
+
percentageTextRef: percentageTextRef,
|
|
42839
|
+
handleToggleSize: handleToggleSize
|
|
42840
|
+
});
|
|
42841
|
+
}
|
|
42879
42842
|
});
|
|
42880
42843
|
}
|
|
42881
42844
|
}, 0);
|
|
@@ -42883,6 +42846,123 @@ var showToast = function showToast(props) {
|
|
|
42883
42846
|
if (typeof window !== 'undefined') {
|
|
42884
42847
|
window.showArengibookToast = showToast;
|
|
42885
42848
|
}
|
|
42849
|
+
var RichMessage = function RichMessage(_ref2) {
|
|
42850
|
+
var icon = _ref2.icon,
|
|
42851
|
+
_ref2$type = _ref2.type,
|
|
42852
|
+
type = _ref2$type === void 0 ? "info" : _ref2$type,
|
|
42853
|
+
_ref2$size = _ref2.size,
|
|
42854
|
+
size = _ref2$size === void 0 ? "M" : _ref2$size,
|
|
42855
|
+
title = _ref2.title,
|
|
42856
|
+
message = _ref2.message,
|
|
42857
|
+
_ref2$enableHtmlConte = _ref2.enableHtmlContent,
|
|
42858
|
+
enableHtmlContent = _ref2$enableHtmlConte === void 0 ? false : _ref2$enableHtmlConte,
|
|
42859
|
+
link = _ref2.link,
|
|
42860
|
+
_ref2$links = _ref2.links,
|
|
42861
|
+
links = _ref2$links === void 0 ? [] : _ref2$links,
|
|
42862
|
+
_ref2$attachedFiles = _ref2.attachedFiles,
|
|
42863
|
+
attachedFiles = _ref2$attachedFiles === void 0 ? [] : _ref2$attachedFiles,
|
|
42864
|
+
_ref2$enablePercentag = _ref2.enablePercentage,
|
|
42865
|
+
enablePercentage = _ref2$enablePercentag === void 0 ? false : _ref2$enablePercentag,
|
|
42866
|
+
currentPercentage = _ref2.currentPercentage,
|
|
42867
|
+
sizeSModulable = _ref2.sizeSModulable,
|
|
42868
|
+
_ref2$isExpanded = _ref2.isExpanded,
|
|
42869
|
+
isExpanded = _ref2$isExpanded === void 0 ? false : _ref2$isExpanded,
|
|
42870
|
+
progressBarRef = _ref2.progressBarRef,
|
|
42871
|
+
percentageTextRef = _ref2.percentageTextRef,
|
|
42872
|
+
handleToggleSize = _ref2.handleToggleSize;
|
|
42873
|
+
var getIconByType = function getIconByType() {
|
|
42874
|
+
switch (type) {
|
|
42875
|
+
case "success":
|
|
42876
|
+
return "pi pi-check-circle";
|
|
42877
|
+
case "error":
|
|
42878
|
+
return "pi pi-times-circle";
|
|
42879
|
+
case "settingError":
|
|
42880
|
+
return "pi pi-cog pi-times-circle";
|
|
42881
|
+
case "warning":
|
|
42882
|
+
return "pi pi-exclamation-triangle";
|
|
42883
|
+
case "processing":
|
|
42884
|
+
return "pi pi-spinner pi-spin";
|
|
42885
|
+
case "info":
|
|
42886
|
+
default:
|
|
42887
|
+
return "pi pi-info-circle";
|
|
42888
|
+
}
|
|
42889
|
+
};
|
|
42890
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
42891
|
+
className: "toast-root"
|
|
42892
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
42893
|
+
className: "toast-left"
|
|
42894
|
+
}, /*#__PURE__*/React__default.createElement("i", {
|
|
42895
|
+
className: icon !== null && icon !== void 0 ? icon : getIconByType(),
|
|
42896
|
+
"aria-hidden": "true"
|
|
42897
|
+
}), (size === "S" || size === "L" && sizeSModulable === true) && /*#__PURE__*/React__default.createElement("button", {
|
|
42898
|
+
type: "button",
|
|
42899
|
+
onClick: function onClick() {
|
|
42900
|
+
return handleToggleSize();
|
|
42901
|
+
},
|
|
42902
|
+
"aria-label": isExpanded ? "Réduire" : "Agrandir",
|
|
42903
|
+
className: "toast-action-btn"
|
|
42904
|
+
}, /*#__PURE__*/React__default.createElement("i", {
|
|
42905
|
+
className: isExpanded ? "pi pi-window-minimize" : "pi pi-window-maximize"
|
|
42906
|
+
}))), size !== "S" && /*#__PURE__*/React__default.createElement("div", {
|
|
42907
|
+
className: "toast-body"
|
|
42908
|
+
}, title && (size === "M" || size === "L") && /*#__PURE__*/React__default.createElement("div", {
|
|
42909
|
+
className: "toast-title"
|
|
42910
|
+
}, title), /*#__PURE__*/React__default.createElement("div", {
|
|
42911
|
+
className: "toast-message"
|
|
42912
|
+
}, enableHtmlContent ? /*#__PURE__*/React__default.createElement("div", {
|
|
42913
|
+
className: "toast-html-content",
|
|
42914
|
+
dangerouslySetInnerHTML: {
|
|
42915
|
+
__html: message
|
|
42916
|
+
}
|
|
42917
|
+
}) : message), link && size === "L" && /*#__PURE__*/React__default.createElement("div", {
|
|
42918
|
+
className: "toast-link"
|
|
42919
|
+
}, /*#__PURE__*/React__default.createElement("a", {
|
|
42920
|
+
href: link.url,
|
|
42921
|
+
target: "_blank",
|
|
42922
|
+
rel: "noopener noreferrer"
|
|
42923
|
+
}, link.label)), Array.isArray(links) && links.length > 0 && size === "L" && /*#__PURE__*/React__default.createElement("ul", {
|
|
42924
|
+
className: "toast-links"
|
|
42925
|
+
}, links.map(function (link, index) {
|
|
42926
|
+
return /*#__PURE__*/React__default.createElement("li", {
|
|
42927
|
+
key: index
|
|
42928
|
+
}, /*#__PURE__*/React__default.createElement("a", {
|
|
42929
|
+
href: link.url,
|
|
42930
|
+
target: "_blank",
|
|
42931
|
+
rel: "noopener noreferrer"
|
|
42932
|
+
}, link.label));
|
|
42933
|
+
})), Array.isArray(attachedFiles) && attachedFiles.length > 0 && size === "L" && /*#__PURE__*/React__default.createElement("div", {
|
|
42934
|
+
className: "toast-attached-files"
|
|
42935
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
42936
|
+
className: "toast-attached-files-title"
|
|
42937
|
+
}, "Pi\xE8ces jointes"), /*#__PURE__*/React__default.createElement("ul", {
|
|
42938
|
+
className: "toast-attached-files-list"
|
|
42939
|
+
}, attachedFiles.map(function (file, index) {
|
|
42940
|
+
return /*#__PURE__*/React__default.createElement("li", {
|
|
42941
|
+
key: index
|
|
42942
|
+
}, /*#__PURE__*/React__default.createElement("a", {
|
|
42943
|
+
href: file.url,
|
|
42944
|
+
target: "_blank",
|
|
42945
|
+
rel: "noopener noreferrer"
|
|
42946
|
+
}, /*#__PURE__*/React__default.createElement("i", {
|
|
42947
|
+
className: "pi pi-paperclip",
|
|
42948
|
+
"aria-hidden": "true"
|
|
42949
|
+
}), /*#__PURE__*/React__default.createElement("span", null, file.name)));
|
|
42950
|
+
}))), size === "L" && enablePercentage && /*#__PURE__*/React__default.createElement("div", {
|
|
42951
|
+
className: "toast-percentage"
|
|
42952
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
42953
|
+
className: "toast-percentage-label"
|
|
42954
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
42955
|
+
ref: percentageTextRef
|
|
42956
|
+
}, currentPercentage, "%")), /*#__PURE__*/React__default.createElement("div", {
|
|
42957
|
+
className: "toast-percentage-bar"
|
|
42958
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
42959
|
+
ref: progressBarRef,
|
|
42960
|
+
className: "toast-percentage-bar-fill",
|
|
42961
|
+
style: {
|
|
42962
|
+
width: "".concat(currentPercentage, "%")
|
|
42963
|
+
}
|
|
42964
|
+
})))));
|
|
42965
|
+
};
|
|
42886
42966
|
|
|
42887
42967
|
var ToastPresets = {
|
|
42888
42968
|
Picto: {
|
|
@@ -42896,16 +42976,14 @@ var ToastPresets = {
|
|
|
42896
42976
|
animation: "slide",
|
|
42897
42977
|
duration: 3000,
|
|
42898
42978
|
sticky: false,
|
|
42899
|
-
autoShow: true
|
|
42900
|
-
reShowOnPropsChange: true
|
|
42979
|
+
autoShow: true
|
|
42901
42980
|
},
|
|
42902
42981
|
Size: {
|
|
42903
42982
|
type: "info",
|
|
42904
42983
|
size: "M",
|
|
42905
42984
|
message: "Ceci est un exemple de texte volontairement long afin de tester le comportement du toast en taille L. " + "Le toast doit pouvoir s’étendre naturellement en hauteur sans contrainte artificielle de largeur, " + "tout en restant lisible et cohérent visuellement. " + "Ceci est un exemple de texte volontairement long afin de tester le comportement du toast en taille L. " + "Le toast doit pouvoir s’étendre naturellement en hauteur sans contrainte artificielle de largeur, " + "tout en restant lisible et cohérent visuellement.",
|
|
42906
42985
|
closable: true,
|
|
42907
|
-
autoShow: true
|
|
42908
|
-
reShowOnPropsChange: true
|
|
42986
|
+
autoShow: true
|
|
42909
42987
|
},
|
|
42910
42988
|
Text: {
|
|
42911
42989
|
type: "info",
|
|
@@ -42914,8 +42992,7 @@ var ToastPresets = {
|
|
|
42914
42992
|
closable: true,
|
|
42915
42993
|
position: "top-right",
|
|
42916
42994
|
duration: 3000,
|
|
42917
|
-
autoShow: true
|
|
42918
|
-
reShowOnPropsChange: true
|
|
42995
|
+
autoShow: true
|
|
42919
42996
|
},
|
|
42920
42997
|
Close: {
|
|
42921
42998
|
type: "info",
|
|
@@ -42924,8 +43001,7 @@ var ToastPresets = {
|
|
|
42924
43001
|
closable: true,
|
|
42925
43002
|
position: "top-right",
|
|
42926
43003
|
duration: 6000,
|
|
42927
|
-
autoShow: true
|
|
42928
|
-
reShowOnPropsChange: true
|
|
43004
|
+
autoShow: true
|
|
42929
43005
|
},
|
|
42930
43006
|
FixedPosition: {
|
|
42931
43007
|
type: "info",
|
|
@@ -42934,8 +43010,7 @@ var ToastPresets = {
|
|
|
42934
43010
|
closable: true,
|
|
42935
43011
|
position: "top-left",
|
|
42936
43012
|
duration: 4000,
|
|
42937
|
-
autoShow: true
|
|
42938
|
-
reShowOnPropsChange: true
|
|
43013
|
+
autoShow: true
|
|
42939
43014
|
},
|
|
42940
43015
|
FixedDuration: {
|
|
42941
43016
|
type: "info",
|
|
@@ -42944,16 +43019,14 @@ var ToastPresets = {
|
|
|
42944
43019
|
closable: true,
|
|
42945
43020
|
position: "top-right",
|
|
42946
43021
|
duration: 5000,
|
|
42947
|
-
autoShow: true
|
|
42948
|
-
reShowOnPropsChange: true
|
|
43022
|
+
autoShow: true
|
|
42949
43023
|
},
|
|
42950
43024
|
Titletoast: {
|
|
42951
43025
|
type: "info",
|
|
42952
43026
|
size: "M",
|
|
42953
43027
|
title: "Information importante",
|
|
42954
43028
|
message: "Ce toast contient un titre afin de hiérarchiser l’information affichée.",
|
|
42955
|
-
autoShow: true
|
|
42956
|
-
reShowOnPropsChange: true
|
|
43029
|
+
autoShow: true
|
|
42957
43030
|
},
|
|
42958
43031
|
InfiniteDuration: {
|
|
42959
43032
|
type: "processing",
|
|
@@ -42963,8 +43036,7 @@ var ToastPresets = {
|
|
|
42963
43036
|
sticky: true,
|
|
42964
43037
|
duration: 0,
|
|
42965
43038
|
closable: false,
|
|
42966
|
-
autoShow: true
|
|
42967
|
-
reShowOnPropsChange: true
|
|
43039
|
+
autoShow: true
|
|
42968
43040
|
},
|
|
42969
43041
|
PercentageCompletion: {
|
|
42970
43042
|
type: "processing",
|
|
@@ -42975,7 +43047,6 @@ var ToastPresets = {
|
|
|
42975
43047
|
enablePercentage: true,
|
|
42976
43048
|
closable: false,
|
|
42977
43049
|
autoShow: true,
|
|
42978
|
-
reShowOnPropsChange: true,
|
|
42979
43050
|
duration: 0,
|
|
42980
43051
|
sticky: true,
|
|
42981
43052
|
sizeSModulable: true
|
|
@@ -42991,8 +43062,7 @@ var ToastPresets = {
|
|
|
42991
43062
|
},
|
|
42992
43063
|
closable: true,
|
|
42993
43064
|
duration: 6000,
|
|
42994
|
-
autoShow: true
|
|
42995
|
-
reShowOnPropsChange: true
|
|
43065
|
+
autoShow: true
|
|
42996
43066
|
},
|
|
42997
43067
|
MultipleLink: {
|
|
42998
43068
|
type: "info",
|
|
@@ -43012,7 +43082,6 @@ var ToastPresets = {
|
|
|
43012
43082
|
closable: true,
|
|
43013
43083
|
duration: 8000,
|
|
43014
43084
|
autoShow: true,
|
|
43015
|
-
reShowOnPropsChange: true,
|
|
43016
43085
|
sizeSModulable: true
|
|
43017
43086
|
},
|
|
43018
43087
|
CreationDate: {
|
|
@@ -43029,7 +43098,6 @@ var ToastPresets = {
|
|
|
43029
43098
|
},
|
|
43030
43099
|
duration: 0,
|
|
43031
43100
|
autoShow: true,
|
|
43032
|
-
reShowOnPropsChange: true,
|
|
43033
43101
|
sticky: true,
|
|
43034
43102
|
sizeSModulable: true
|
|
43035
43103
|
},
|
|
@@ -43048,7 +43116,6 @@ var ToastPresets = {
|
|
|
43048
43116
|
closable: true,
|
|
43049
43117
|
duration: 0,
|
|
43050
43118
|
autoShow: true,
|
|
43051
|
-
reShowOnPropsChange: true,
|
|
43052
43119
|
sticky: true,
|
|
43053
43120
|
sizeSModulable: true,
|
|
43054
43121
|
enablePercentage: true
|
|
@@ -43063,7 +43130,6 @@ var ToastPresets = {
|
|
|
43063
43130
|
duration: 0,
|
|
43064
43131
|
closable: false,
|
|
43065
43132
|
autoShow: true,
|
|
43066
|
-
reShowOnPropsChange: true,
|
|
43067
43133
|
sizeSModulable: true,
|
|
43068
43134
|
enablePercentage: true
|
|
43069
43135
|
},
|
|
@@ -43075,8 +43141,7 @@ var ToastPresets = {
|
|
|
43075
43141
|
message: "\n <div style=\"display:flex; flex-direction:column; gap:0.75rem;\">\n <strong style=\"color:#16a34a;\">\n \u2714 Traitement termin\xE9 avec succ\xE8s\n </strong>\n\n <p>\n Le fichier a \xE9t\xE9 g\xE9n\xE9r\xE9 par le backend Symfony.\n </p>\n\n <a\n href=\"https://example.com/result\"\n target=\"_blank\"\n style=\"color:#2563eb; text-decoration:underline;\"\n >\n Voir le r\xE9sultat\n </a>\n\n <button\n style=\"\n margin-top:0.5rem;\n padding:0.4rem 0.75rem;\n background:#2563eb;\n color:white;\n border:none;\n border-radius:4px;\n cursor:pointer;\n \"\n onclick=\"alert('T\xE9l\xE9chargement d\xE9clench\xE9')\"\n >\n T\xE9l\xE9charger\n </button>\n </div>\n ",
|
|
43076
43142
|
sticky: true,
|
|
43077
43143
|
closable: true,
|
|
43078
|
-
autoShow: true
|
|
43079
|
-
reShowOnPropsChange: true
|
|
43144
|
+
autoShow: true
|
|
43080
43145
|
}
|
|
43081
43146
|
};
|
|
43082
43147
|
|