@rsuci/shared-form-components 1.0.112 → 1.0.113

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.
@@ -32,6 +32,6 @@ export const ValidationModal = ({ isOpen, onClose, onConfirm, action, enquetesCo
32
32
  const isValider = action === 'valider';
33
33
  const titre = isValider ? 'Valider l\'enquête' : 'Rejeter l\'enquête';
34
34
  const couleurBouton = isValider ? 'bg-green-600 hover:bg-green-700' : 'bg-red-600 hover:bg-red-700';
35
- return (_jsxs("div", { className: "fixed inset-0 z-50 overflow-y-auto", children: [_jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 transition-opacity", onClick: handleClose }), _jsx("div", { className: "flex min-h-full items-center justify-center p-4", children: _jsxs("div", { className: "relative bg-white rounded-lg shadow-xl max-w-md w-full p-6", children: [_jsxs("div", { className: "flex items-center justify-between mb-4", children: [_jsxs("div", { className: "flex items-center space-x-3", children: [_jsx("div", { className: `${isValider ? 'text-green-600' : 'text-red-600'}`, children: isValider ? (_jsx("svg", { className: "w-6 h-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) })) : (_jsx("svg", { className: "w-6 h-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) })) }), _jsx("h3", { className: "text-lg font-semibold text-gray-900", children: titre })] }), _jsx("button", { onClick: handleClose, disabled: isSubmitting, className: "text-gray-400 hover:text-gray-600 transition-colors disabled:opacity-50", children: _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })] }), _jsxs("div", { className: "mb-6", children: [_jsxs("p", { className: "text-gray-700 mb-4", children: ["\u00CAtes-vous s\u00FBr de vouloir ", isValider ? 'valider' : 'rejeter', ' ', _jsxs("span", { className: "font-semibold", children: [enquetesCount, " enqu\u00EAte", enquetesCount > 1 ? 's' : ''] }), " ?"] }), !isValider && (_jsxs("div", { children: [_jsx("label", { htmlFor: "commentaire", className: "block text-sm font-medium text-gray-700 mb-2", children: "Commentaire (optionnel)" }), _jsx("textarea", { id: "commentaire", value: commentaire, onChange: (e) => setCommentaire(e.target.value), disabled: isSubmitting, rows: 4, className: "w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-red-500 disabled:bg-gray-100 disabled:cursor-not-allowed text-gray-900 placeholder:text-gray-400", placeholder: "Indiquez la raison du rejet (optionnel)..." }), _jsx("p", { className: "mt-1 text-xs text-gray-500", children: "Maximum 500 caract\u00E8res" })] }))] }), _jsxs("div", { className: "flex justify-end space-x-3", children: [_jsx("button", { onClick: handleClose, disabled: isSubmitting, className: "px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors disabled:opacity-50 disabled:cursor-not-allowed", children: "Annuler" }), _jsx("button", { onClick: handleConfirm, disabled: isSubmitting, className: `px-4 py-2 text-sm font-medium text-white rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed ${couleurBouton}`, children: isSubmitting ? (_jsxs("span", { className: "flex items-center", children: [_jsxs("svg", { className: "animate-spin -ml-1 mr-2 h-4 w-4 text-white", fill: "none", viewBox: "0 0 24 24", children: [_jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })] }), "Traitement..."] })) : ('Confirmer') })] })] }) })] }));
35
+ return (_jsxs("div", { className: "fixed inset-0 z-50 overflow-y-auto", children: [_jsx("div", { className: "fixed inset-0 bg-black/30 backdrop-blur-sm transition-opacity", onClick: handleClose }), _jsx("div", { className: "flex min-h-full items-center justify-center p-4", children: _jsxs("div", { className: "relative bg-white rounded-lg shadow-xl max-w-md w-full p-6", children: [_jsxs("div", { className: "flex items-center justify-between mb-4", children: [_jsxs("div", { className: "flex items-center space-x-3", children: [_jsx("div", { className: `${isValider ? 'text-green-600' : 'text-red-600'}`, children: isValider ? (_jsx("svg", { className: "w-6 h-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) })) : (_jsx("svg", { className: "w-6 h-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) })) }), _jsx("h3", { className: "text-lg font-semibold text-gray-900", children: titre })] }), _jsx("button", { onClick: handleClose, disabled: isSubmitting, className: "text-gray-400 hover:text-gray-600 transition-colors disabled:opacity-50", children: _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })] }), _jsxs("div", { className: "mb-6", children: [_jsxs("p", { className: "text-gray-700 mb-4", children: ["\u00CAtes-vous s\u00FBr de vouloir ", isValider ? 'valider' : 'rejeter', ' ', _jsxs("span", { className: "font-semibold", children: [enquetesCount, " enqu\u00EAte", enquetesCount > 1 ? 's' : ''] }), " ?"] }), !isValider && (_jsxs("div", { children: [_jsx("label", { htmlFor: "commentaire", className: "block text-sm font-medium text-gray-700 mb-2", children: "Commentaire (optionnel)" }), _jsx("textarea", { id: "commentaire", value: commentaire, onChange: (e) => setCommentaire(e.target.value), disabled: isSubmitting, rows: 4, className: "w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-red-500 disabled:bg-gray-100 disabled:cursor-not-allowed text-gray-900 placeholder:text-gray-400", placeholder: "Indiquez la raison du rejet (optionnel)..." }), _jsx("p", { className: "mt-1 text-xs text-gray-500", children: "Maximum 500 caract\u00E8res" })] }))] }), _jsxs("div", { className: "flex justify-end space-x-3", children: [_jsx("button", { onClick: handleClose, disabled: isSubmitting, className: "px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors disabled:opacity-50 disabled:cursor-not-allowed", children: "Annuler" }), _jsx("button", { onClick: handleConfirm, disabled: isSubmitting, className: `px-4 py-2 text-sm font-medium text-white rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed ${couleurBouton}`, children: isSubmitting ? (_jsxs("span", { className: "flex items-center", children: [_jsxs("svg", { className: "animate-spin -ml-1 mr-2 h-4 w-4 text-white", fill: "none", viewBox: "0 0 24 24", children: [_jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })] }), "Traitement..."] })) : ('Confirmer') })] })] }) })] }));
36
36
  };
37
37
  export default ValidationModal;
@@ -1 +1 @@
1
- {"version":3,"file":"condition-engine.d.ts","sourceRoot":"","sources":["../../src/lib/condition-engine.ts"],"names":[],"mappings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AAC,oBAAoB;IAU5B;;;OAGG;IACH,OAAO,CAAC,cAAc;IA8BtB;;OAEG;IACH,OAAO,CAAC,eAAe;IA6BvB;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IA2CzB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAY1B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAUzB;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAiChC;;OAEG;IACH,OAAO,CAAC,YAAY;IA6CpB;;OAEG;IACH,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;IAwGhF;;OAEG;IACH,uBAAuB,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,EAAE;CAwE5D;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,WAAW,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,oBAS3E,CAAC"}
@@ -837,6 +837,14 @@ export class ConditionEngine {
837
837
  return 'null';
838
838
  }
839
839
  if (typeof value === 'string') {
840
+ // Détecter les strings au format date (YYYY-MM-DD ou ISO 8601) et les convertir en Date
841
+ // pour que les comparaisons avec today() fonctionnent correctement
842
+ if (/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2})?/.test(value)) {
843
+ const parsed = new Date(value);
844
+ if (!isNaN(parsed.getTime())) {
845
+ return `new Date("${value}")`;
846
+ }
847
+ }
840
848
  return `"${value.replace(/"/g, '\\"')}"`;
841
849
  }
842
850
  if (typeof value === 'boolean') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsuci/shared-form-components",
3
- "version": "1.0.112",
3
+ "version": "1.0.113",
4
4
  "description": "Composants partagés de rendu de formulaires RSU v2 - Package local pour frontend Admin et Public",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",