arengibook 2.5.5 → 2.5.7

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.
Files changed (2) hide show
  1. package/dist/index.js +39 -136
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -42653,11 +42653,10 @@ 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,
42659
- _ref$enableHtmlConten = _ref.enableHtmlContent,
42660
- enableHtmlContent = _ref$enableHtmlConten === void 0 ? false : _ref$enableHtmlConten,
42661
42660
  _ref$type = _ref.type,
42662
42661
  type = _ref$type === void 0 ? "info" : _ref$type,
42663
42662
  _ref$size = _ref.size,
@@ -42672,26 +42671,11 @@ var Toast = function Toast(_ref) {
42672
42671
  autoShow = _ref$autoShow === void 0 ? true : _ref$autoShow,
42673
42672
  _ref$reShowOnPropsCha = _ref.reShowOnPropsChange,
42674
42673
  reShowOnPropsChange = _ref$reShowOnPropsCha === void 0 ? false : _ref$reShowOnPropsCha,
42675
- onSizeChange = _ref.onSizeChange,
42676
42674
  title = _ref.title,
42677
42675
  sticky = _ref.sticky,
42678
- _ref$enablePercentage = _ref.enablePercentage,
42679
- enablePercentage = _ref$enablePercentage === void 0 ? false : _ref$enablePercentage,
42680
- percentage = _ref.percentage,
42681
- link = _ref.link,
42682
- links = _ref.links,
42683
- datetimecreation = _ref.datetimecreation,
42684
- sizeSModulable = _ref.sizeSModulable,
42685
- isExpanded = _ref.isExpanded,
42686
- attachedFiles = _ref.attachedFiles;
42676
+ datetimecreation = _ref.datetimecreation;
42687
42677
  var toastRef = useRef(null);
42688
42678
  var hasShownRef = useRef(false);
42689
- var progressBarRef = useRef(null);
42690
- var percentageTextRef = useRef(null);
42691
- var _useState = useState(percentage),
42692
- _useState2 = _slicedToArray$a(_useState, 2),
42693
- currentPercentage = _useState2[0],
42694
- setCurrentPercentage = _useState2[1];
42695
42679
  var getIconByType = function getIconByType() {
42696
42680
  switch (type) {
42697
42681
  case "success":
@@ -42709,129 +42693,39 @@ var Toast = function Toast(_ref) {
42709
42693
  return "pi pi-info-circle";
42710
42694
  }
42711
42695
  };
42712
- var handleToggleSize = function handleToggleSize() {
42713
- if (!onSizeChange) return;
42714
- if (size === "S") {
42715
- onSizeChange("L");
42716
- toastRef.current.clear();
42717
- } else if (size === "L") {
42718
- onSizeChange("S");
42719
- toastRef.current.clear();
42720
- }
42721
- };
42722
- var classNameSizeS = function classNameSizeS() {
42723
- switch (size) {
42724
- case 'S':
42725
- return "toast_s--compact";
42726
- case 'L':
42727
- if (sizeSModulable === true) {
42728
- return "toast_s--large";
42729
- } else {
42730
- return "";
42731
- }
42732
- default:
42733
- return '';
42734
- }
42735
- };
42736
42696
  useEffect(function () {
42737
42697
  if (!toastRef.current || !autoShow) return;
42738
42698
  if (hasShownRef.current && !reShowOnPropsChange) return;
42699
+ var _content = /*#__PURE__*/React__default.createElement("div", {
42700
+ className: "toast-root"
42701
+ }, /*#__PURE__*/React__default.createElement("div", {
42702
+ className: "toast-left"
42703
+ }, /*#__PURE__*/React__default.createElement("i", {
42704
+ className: icon !== null && icon !== void 0 ? icon : getIconByType(),
42705
+ "aria-hidden": "true"
42706
+ })), /*#__PURE__*/React__default.createElement("div", {
42707
+ className: "toast-body"
42708
+ }, title && /*#__PURE__*/React__default.createElement("div", {
42709
+ className: "toast-title"
42710
+ }, title), /*#__PURE__*/React__default.createElement("div", {
42711
+ className: "toast-message"
42712
+ }, /*#__PURE__*/React__default.createElement("div", {
42713
+ className: "toast-html-content",
42714
+ dangerouslySetInnerHTML: {
42715
+ __html: message
42716
+ }
42717
+ }))));
42739
42718
  toastRef.current.show({
42740
42719
  severity: type,
42741
42720
  closable: closable,
42742
42721
  life: duration,
42743
42722
  sticky: sticky,
42744
- className: "".concat(classNameSizeS(), " ").concat(type === "processing" ? "toast--processing" : ""),
42745
- // toast--processing est le css à
42746
- // personnaliser pour obtenir le loader souhaité par Camille
42747
-
42748
42723
  content: function content() {
42749
- return /*#__PURE__*/React__default.createElement("div", {
42750
- className: "toast-root"
42751
- }, /*#__PURE__*/React__default.createElement("div", {
42752
- className: "toast-left"
42753
- }, /*#__PURE__*/React__default.createElement("i", {
42754
- className: icon !== null && icon !== void 0 ? icon : getIconByType(),
42755
- "aria-hidden": "true"
42756
- }), (size === "S" || size === "L" && sizeSModulable === true) && /*#__PURE__*/React__default.createElement("button", {
42757
- type: "button",
42758
- onClick: handleToggleSize,
42759
- "aria-label": isExpanded ? "Réduire" : "Agrandir",
42760
- className: "toast-action-btn"
42761
- }, /*#__PURE__*/React__default.createElement("i", {
42762
- className: isExpanded ? "pi pi-window-minimize" : "pi pi-window-maximize"
42763
- }))), size !== "S" && /*#__PURE__*/React__default.createElement("div", {
42764
- className: "toast-body"
42765
- }, title && (size === "M" || size === "L") && /*#__PURE__*/React__default.createElement("div", {
42766
- className: "toast-title"
42767
- }, title), /*#__PURE__*/React__default.createElement("div", {
42768
- className: "toast-message"
42769
- }, enableHtmlContent ? /*#__PURE__*/React__default.createElement("div", {
42770
- className: "toast-html-content",
42771
- dangerouslySetInnerHTML: {
42772
- __html: message
42773
- }
42774
- }) : message), link && size === "L" && /*#__PURE__*/React__default.createElement("div", {
42775
- className: "toast-link"
42776
- }, /*#__PURE__*/React__default.createElement("a", {
42777
- href: link.url,
42778
- target: "_blank",
42779
- rel: "noopener noreferrer"
42780
- }, link.label)), Array.isArray(links) && links.length > 0 && size === "L" && /*#__PURE__*/React__default.createElement("ul", {
42781
- className: "toast-links"
42782
- }, links.map(function (link, index) {
42783
- return /*#__PURE__*/React__default.createElement("li", {
42784
- key: index
42785
- }, /*#__PURE__*/React__default.createElement("a", {
42786
- href: link.url,
42787
- target: "_blank",
42788
- rel: "noopener noreferrer"
42789
- }, link.label));
42790
- })), Array.isArray(attachedFiles) && attachedFiles.length > 0 && size === "L" && /*#__PURE__*/React__default.createElement("div", {
42791
- className: "toast-attached-files"
42792
- }, /*#__PURE__*/React__default.createElement("div", {
42793
- className: "toast-attached-files-title"
42794
- }, "Pi\xE8ces jointes"), /*#__PURE__*/React__default.createElement("ul", {
42795
- className: "toast-attached-files-list"
42796
- }, attachedFiles.map(function (file, index) {
42797
- return /*#__PURE__*/React__default.createElement("li", {
42798
- key: index
42799
- }, /*#__PURE__*/React__default.createElement("a", {
42800
- href: file.url,
42801
- target: "_blank",
42802
- rel: "noopener noreferrer"
42803
- }, /*#__PURE__*/React__default.createElement("i", {
42804
- className: "pi pi-paperclip",
42805
- "aria-hidden": "true"
42806
- }), /*#__PURE__*/React__default.createElement("span", null, file.name)));
42807
- }))), size === "L" && enablePercentage && /*#__PURE__*/React__default.createElement("div", {
42808
- className: "toast-percentage"
42809
- }, /*#__PURE__*/React__default.createElement("div", {
42810
- className: "toast-percentage-label"
42811
- }, /*#__PURE__*/React__default.createElement("span", {
42812
- ref: percentageTextRef
42813
- }, currentPercentage, "%")), /*#__PURE__*/React__default.createElement("div", {
42814
- className: "toast-percentage-bar"
42815
- }, /*#__PURE__*/React__default.createElement("div", {
42816
- ref: progressBarRef,
42817
- className: "toast-percentage-bar-fill",
42818
- style: {
42819
- width: "".concat(currentPercentage, "%")
42820
- }
42821
- })))));
42724
+ return _content;
42822
42725
  }
42823
42726
  });
42824
42727
  hasShownRef.current = true;
42825
- }, [icon, message, type, size, closable, duration, autoShow, reShowOnPropsChange, title, sticky, enablePercentage, link, datetimecreation, sizeSModulable, isExpanded]);
42826
- useEffect(function () {
42827
- setCurrentPercentage(percentage);
42828
- if (progressBarRef.current) {
42829
- progressBarRef.current.style.width = "".concat(percentage, "%");
42830
- }
42831
- if (percentageTextRef.current) {
42832
- percentageTextRef.current.textContent = "".concat(percentage, "%");
42833
- }
42834
- }, [percentage]);
42728
+ }, [icon, message, type, size, closable, duration, autoShow, reShowOnPropsChange, title, sticky, datetimecreation]);
42835
42729
  return /*#__PURE__*/React__default.createElement(Toast$1, {
42836
42730
  ref: toastRef,
42837
42731
  position: position
@@ -42851,8 +42745,6 @@ var ToastContainer = function ToastContainer() {
42851
42745
  position: "top-right"
42852
42746
  });
42853
42747
  };
42854
-
42855
- // Fonction globale simple
42856
42748
  var showToast = function showToast(props) {
42857
42749
  if (!container) {
42858
42750
  container = document.createElement('div');
@@ -42866,11 +42758,22 @@ var showToast = function showToast(props) {
42866
42758
  life: props.duration || 3000,
42867
42759
  sticky: props.sticky,
42868
42760
  closable: props.closable !== false,
42869
- content: function content() {
42870
- return /*#__PURE__*/React__default.createElement(Toast, _extends$G({}, props, {
42871
- autoShow: false
42872
- }));
42873
- }
42761
+ summary: props.title || '',
42762
+ content: /*#__PURE__*/React__default.createElement("div", {
42763
+ className: "p-toast-message-content",
42764
+ style: {
42765
+ display: 'flex',
42766
+ flexDirection: 'column',
42767
+ justifyContent: 'center'
42768
+ }
42769
+ }, props.title && /*#__PURE__*/React__default.createElement("span", {
42770
+ className: "p-toast-summary"
42771
+ }, props.title), /*#__PURE__*/React__default.createElement("div", {
42772
+ className: "p-toast-detail",
42773
+ dangerouslySetInnerHTML: {
42774
+ __html: props.message
42775
+ }
42776
+ }))
42874
42777
  });
42875
42778
  }
42876
42779
  }, 0);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "arengibook",
3
3
  "private": false,
4
- "version": "2.5.05",
4
+ "version": "2.5.7",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "exports": {