@artibet/react-mui-components 3.8.7 → 3.8.8

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.
@@ -1 +1 @@
1
- import{TextField as e,FormGroup as r,FormControlLabel as t,Switch as n,Typography as o,Stack as a,Box as l,Popover as i,Autocomplete as u,Chip as d,InputAdornment as c,IconButton as s,FormControl as f,FormLabel as v,RadioGroup as m,Radio as h,Checkbox as p}from"@mui/material";import g from"react";import{Controller as b}from"react-hook-form";import{ChromePicker as y}from"react-color";import{toDate as E}from"date-fns";import"date-fns/locale";import w from"axios";import{NumericFormat as x}from"react-number-format";import{AdapterDateFns as C}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as O}from"@mui/x-date-pickers/LocalizationProvider";import{DateTimePicker as q,renderDigitalClockTimeView as S,DatePicker as L,TimePicker as T}from"@mui/x-date-pickers";import P from"date-fns/locale/el";import{Clear as k}from"@mui/icons-material";function B(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function j(e,r,t,n,o,a,l){try{var i=e[a](l),u=i.value}catch(e){return void t(e)}i.done?r(u):Promise.resolve(u).then(n,o)}function V(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var a=e.apply(r,t);function l(e){j(a,n,o,l,i,"next",e)}function i(e){j(a,n,o,l,i,"throw",e)}l(void 0)}))}}function W(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function F(){return F=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},F.apply(null,arguments)}function z(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function A(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?z(Object(t),!0).forEach((function(r){W(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):z(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function I(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==r.indexOf(n))continue;t[n]=e[n]}return t}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],-1===r.indexOf(t)&&{}.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function _(){_=function(){return r};var e,r={},t=Object.prototype,n=t.hasOwnProperty,o=Object.defineProperty||function(e,r,t){e[r]=t.value},a="function"==typeof Symbol?Symbol:{},l=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function d(e,r,t){return Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[r]}try{d({},"")}catch(e){d=function(e,r,t){return e[r]=t}}function c(e,r,t,n){var a=r&&r.prototype instanceof g?r:g,l=Object.create(a.prototype),i=new k(n||[]);return o(l,"_invoke",{value:S(e,t,i)}),l}function s(e,r,t){try{return{type:"normal",arg:e.call(r,t)}}catch(e){return{type:"throw",arg:e}}}r.wrap=c;var f="suspendedStart",v="suspendedYield",m="executing",h="completed",p={};function g(){}function b(){}function y(){}var E={};d(E,l,(function(){return this}));var w=Object.getPrototypeOf,x=w&&w(w(B([])));x&&x!==t&&n.call(x,l)&&(E=x);var C=y.prototype=g.prototype=Object.create(E);function O(e){["next","throw","return"].forEach((function(r){d(e,r,(function(e){return this._invoke(r,e)}))}))}function q(e,r){function t(o,a,l,i){var u=s(e[o],e,a);if("throw"!==u.type){var d=u.arg,c=d.value;return c&&"object"==typeof c&&n.call(c,"__await")?r.resolve(c.__await).then((function(e){t("next",e,l,i)}),(function(e){t("throw",e,l,i)})):r.resolve(c).then((function(e){d.value=e,l(d)}),(function(e){return t("throw",e,l,i)}))}i(u.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new r((function(r,o){t(e,n,r,o)}))}return a=a?a.then(o,o):o()}})}function S(r,t,n){var o=f;return function(a,l){if(o===m)throw Error("Generator is already running");if(o===h){if("throw"===a)throw l;return{value:e,done:!0}}for(n.method=a,n.arg=l;;){var i=n.delegate;if(i){var u=L(i,n);if(u){if(u===p)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===f)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var d=s(r,t,n);if("normal"===d.type){if(o=n.done?h:v,d.arg===p)continue;return{value:d.arg,done:n.done}}"throw"===d.type&&(o=h,n.method="throw",n.arg=d.arg)}}}function L(r,t){var n=t.method,o=r.iterator[n];if(o===e)return t.delegate=null,"throw"===n&&r.iterator.return&&(t.method="return",t.arg=e,L(r,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var a=s(o,r.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,p;var l=a.arg;return l?l.done?(t[r.resultName]=l.value,t.next=r.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,p):l:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function T(e){var r={tryLoc:e[0]};1 in e&&(r.catchLoc=e[1]),2 in e&&(r.finallyLoc=e[2],r.afterLoc=e[3]),this.tryEntries.push(r)}function P(e){var r=e.completion||{};r.type="normal",delete r.arg,e.completion=r}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function B(r){if(r||""===r){var t=r[l];if(t)return t.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function t(){for(;++o<r.length;)if(n.call(r,o))return t.value=r[o],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(typeof r+" is not iterable")}return b.prototype=y,o(C,"constructor",{value:y,configurable:!0}),o(y,"constructor",{value:b,configurable:!0}),b.displayName=d(y,u,"GeneratorFunction"),r.isGeneratorFunction=function(e){var r="function"==typeof e&&e.constructor;return!!r&&(r===b||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,d(e,u,"GeneratorFunction")),e.prototype=Object.create(C),e},r.awrap=function(e){return{__await:e}},O(q.prototype),d(q.prototype,i,(function(){return this})),r.AsyncIterator=q,r.async=function(e,t,n,o,a){void 0===a&&(a=Promise);var l=new q(c(e,t,n,o),a);return r.isGeneratorFunction(t)?l:l.next().then((function(e){return e.done?e.value:l.next()}))},O(C),d(C,u,"Generator"),d(C,l,(function(){return this})),d(C,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var r=Object(e),t=[];for(var n in r)t.push(n);return t.reverse(),function e(){for(;t.length;){var n=t.pop();if(n in r)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=B,k.prototype={constructor:k,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!r)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var t=this;function o(n,o){return i.type="throw",i.arg=r,t.next=n,o&&(t.method="next",t.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var l=this.tryEntries[a],i=l.completion;if("root"===l.tryLoc)return o("end");if(l.tryLoc<=this.prev){var u=n.call(l,"catchLoc"),d=n.call(l,"finallyLoc");if(u&&d){if(this.prev<l.catchLoc)return o(l.catchLoc,!0);if(this.prev<l.finallyLoc)return o(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return o(l.catchLoc,!0)}else{if(!d)throw Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return o(l.finallyLoc)}}}},abrupt:function(e,r){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=r&&r<=a.finallyLoc&&(a=null);var l=a?a.completion:{};return l.type=e,l.arg=r,a?(this.method="next",this.next=a.finallyLoc,p):this.complete(l)},complete:function(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),p},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),P(t),p}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.tryLoc===e){var n=t.completion;if("throw"===n.type){var o=n.arg;P(t)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,t,n){return this.delegate={iterator:B(r),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=e),p}},r}function N(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a,l,i=[],u=!0,d=!1;try{if(a=(t=t.call(e)).next,0===r);else for(;!(u=(n=a.call(t)).done)&&(i.push(n.value),i.length!==r);u=!0);}catch(e){d=!0,o=e}finally{try{if(!u&&null!=t.return&&(l=t.return(),Object(l)!==l))return}finally{if(d)throw o}}return i}}(e,r)||function(e,r){if(e){if("string"==typeof e)return B(e,r);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?B(e,r):void 0}}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var K=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],D=function(r){var t=r.form,n=r.name,o=r.label,a=r.maxLength,l=void 0===a?255:a,i=r.required,u=void 0!==i&&i,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=r.readonly,p=void 0!==h&&h,y=r.readonlyBackgroundColor,E=void 0===y?"#dddddd":y,w=r.bold,x=void 0!==w&&w,C=I(r,K),O=t.control,q=t.formState.errors;return g.createElement(b,{name:n,control:O,rules:{required:u,disabled:c},render:function(r){var t,a,i=r.field,d=i.onChange,s=i.onBlur,v=i.value;return g.createElement(e,F({required:u,label:o,value:v,onChange:d,onBlur:s,error:m&&Boolean(null===(t=q[n])||void 0===t?void 0:t.message),fullWidth:!0,helperText:m&&(null===(a=q[n])||void 0===a?void 0:a.message),variant:"outlined",disabled:c,autoFocus:f,slotProps:{input:{maxLength:l,readOnly:p,sx:{fontWeight:x?"bold":"",backgroundColor:p?E:""}}}},C))}})},M=["form","name","label","required","disabled","autofocus","showErrors"],Y=function(r){var t=r.form,n=r.name,o=void 0===n?"password":n,a=r.label,l=void 0===a?"Κωδικός Πρόσβασης":a,i=r.required,u=void 0===i||i,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=I(r,M),p=t.control,y=t.formState.errors;return g.createElement(b,{name:o,control:p,rules:{required:u,disabled:c},render:function(r){var t,n,a=r.field,i=a.onChange,d=a.onBlur,s=a.value;return g.createElement(e,F({required:u,label:l,value:s,onChange:i,onBlur:d,error:m&&Boolean(null===(t=y[o])||void 0===t?void 0:t.message),fullWidth:!0,helperText:m&&(null===(n=y[o])||void 0===n?void 0:n.message),variant:"outlined",disabled:c,autoFocus:f,type:"password"},h))}})},G=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],R=function(r){var t=r.form,n=r.name,o=void 0===n?"email":n,a=r.label,l=void 0===a?"E-mail":a,i=r.maxLength,u=void 0===i?255:i,d=r.required,c=void 0===d||d,s=r.disabled,f=void 0!==s&&s,v=r.autofocus,m=void 0!==v&&v,h=r.showErrors,p=void 0===h||h,y=r.readonly,E=void 0!==y&&y,w=r.readonlyBackgroundColor,x=void 0===w?"#dddddd":w,C=r.bold,O=void 0!==C&&C,q=I(r,G),S=t.control,L=t.formState.errors;return g.createElement(b,{name:o,control:S,rules:{required:c,disabled:f},render:function(r){var t,n,a=r.field,i=a.onChange,d=a.onBlur,s=a.value;return g.createElement(e,F({required:c,label:l,value:s,onChange:i,onBlur:d,error:p&&Boolean(null===(t=L[o])||void 0===t?void 0:t.message),fullWidth:!0,helperText:p&&(null===(n=L[o])||void 0===n?void 0:n.message),variant:"outlined",disabled:f,autoFocus:m,slotProps:{input:{maxLength:u,readOnly:E,sx:{fontWeight:O?"bold":"",backgroundColor:E?x:""}}}},q))}})},H=["form","name","label","disabled"],X=function(e){var o=e.form,a=e.name,l=e.label,i=e.disabled,u=void 0!==i&&i,d=I(e,H),c=o.control;return g.createElement(b,{name:a,control:c,rules:{disabled:u},render:function(e){var i=e.field;i.onChange,i.onBlur;var u=i.value;return g.createElement(r,d,g.createElement(t,{control:g.createElement(n,{checked:Boolean(u),onChange:function(e){return o.setValue(a,e.target.checked)},inputProps:{"aria-label":l}}),label:l}))}})},U=function(e){var r=e.label,t=void 0===r?"":r,n=e.color,a=void 0===n?"white":n,l=e.backgroundColor,i=void 0===l?"#888888":l,u=e.paddingX,d=void 0===u?"10px":u,c=e.paddingY,s=void 0===c?"5px":c,f=e.borderRadius,v=void 0===f?"10px":f,m=e.fontSize,h=void 0===m?"14px":m,p=e.width,b={text:{display:"inline-block",textAlign:"center",backgroundColor:i,paddingX:d,paddingY:s,borderRadius:v,width:void 0===p?"auto":p,color:a,fontSize:h}};return g.createElement(o,{sx:b.text},t)},$=["form","name","label","selectionWidth","pickerWidth","selectionTextColor","paddingY","paddingX","required","disabled"],J=function(e){var r=e.form,t=e.name,n=void 0===t?"color":t,u=e.label,d=void 0===u?"Επιλογή Χρώματος":u,c=e.selectionWidth,s=void 0===c?70:c,f=e.pickerWidth,v=void 0===f?350:f,m=e.selectionTextColor,h=void 0===m?"white":m,p=e.paddingY,E=void 0===p?"10px":p,w=e.paddingX,x=void 0===w?"10px":w,C=e.required,O=void 0!==C&&C,q=e.disabled,S=void 0!==q&&q,L=I(e,$),T=N(g.useState(null),2),P=T[0],k=T[1],B=Boolean(P),j=B?"color-picker":void 0,V=r.control;return g.createElement(b,{name:n,control:V,rules:{disabled:S},render:function(e){var r=e.field,t=r.onChange;r.onBlur;var n=r.value;return g.createElement(a,F({gap:1},L),g.createElement(o,null,"".concat(d," ").concat(O?"*":"")),g.createElement(l,{sx:{display:"flex"}},g.createElement(l,{"aria-describedby":j,sx:{cursor:"pointer"},onClick:function(e){return k(e.currentTarget)}},g.createElement(U,{color:h,backgroundColor:n,paddingY:E,paddingX:x,width:s,label:n}))),g.createElement(i,{sx:{marginTop:"10px"},id:j,open:B,anchorEl:P,onClose:function(){return k(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"}},g.createElement(l,null,g.createElement(y,{width:v,color:n,onChange:function(e){return t(e.hex)}}))))}})},Q=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors","size","readonly","readonlyBackgroundColor","bold"],Z=function(r){var t=r.form,n=r.name,o=r.label,a=r.required,l=void 0!==a&&a,i=r.disabled,d=void 0!==i&&i,c=r.options,s=void 0===c?[]:c,f=r.valueKey,v=void 0===f?"id":f,m=r.labelKey,h=void 0===m?"label":m,p=r.maxLength,y=void 0===p?255:p,E=r.autofocus,w=void 0!==E&&E,x=r.noOptionsText,C=void 0===x?"Δεν υπάρχουν επιλογές":x,O=r.showErrors,q=void 0===O||O,S=r.size,L=void 0===S?"medium":S,T=r.readonly,P=void 0!==T&&T,k=r.readonlyBackgroundColor,B=void 0===k?"#dddddd":k,j=r.bold,V=void 0!==j&&j,W=I(r,Q),z=N(g.useState(null),2),A=z[0],_=z[1],K=t.watch(n);g.useEffect((function(){_(s.find((function(e){return e[v]===K}))||null)}),[K]);var D=t.control,M=t.formState.errors;return g.createElement(b,{name:n,control:D,rules:{required:l,disabled:d},render:function(r){var t=r.field,a=t.onChange,i=t.onBlur;return t.value,P?g.createElement(e,{size:L,label:o,fullWidth:!0,required:l,slotProps:{input:{maxLength:y,readOnly:P,sx:{fontWeight:V?"bold":"",backgroundColor:P?B:""}}},value:A?A.label:""}):g.createElement(u,{value:A,required:l,onChange:function(e,r){return a(r?r[v]:null)},options:s,isOptionEqualToValue:function(e,r){return e[v]===r[v]},noOptionsText:C,getOptionLabel:function(e){return e[h]},size:L,slotProps:{input:{maxLength:y,sx:{fontWeight:V?"bold":"",color:"red"}}},renderInput:function(r){var t,a;return g.createElement(e,F({label:o,required:l,disabled:d,autoFocus:w,size:L,error:q&&Boolean(null===(t=M[n])||void 0===t?void 0:t.message),onBlur:i,variant:"outlined",fullWidth:!0,helperText:q&&(null===(a=M[n])||void 0===a?void 0:a.message)},r,W))}})}})},ee=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors"],re=function(r){var t=r.form,n=r.name,o=r.label,a=r.required,l=void 0!==a&&a,i=r.disabled,c=void 0!==i&&i,s=r.options,f=void 0===s?[]:s,v=r.valueKey,m=void 0===v?"id":v,h=r.labelKey,p=void 0===h?"label":h,y=r.maxLength,E=void 0===y?255:y,w=r.autofocus,x=void 0!==w&&w,C=r.noOptionsText,O=void 0===C?"Δεν υπάρχουν επιλογές":C,q=r.showErrors,S=void 0===q||q,L=I(r,ee),T=N(g.useState([]),2),P=T[0],k=T[1],B=t.watch(n);g.useEffect((function(){k(f.filter((function(e){return function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return Boolean(r.find((function(r){return r[t]===e[t]})))}(e,B)})))}),[B]);var j=t.control,V=t.formState.errors;return g.createElement(b,{name:n,control:j,rules:{required:l,disabled:c},render:function(r){var t=r.field,a=t.onChange,i=t.onBlur;return t.value,g.createElement(u,{multiple:!0,value:P,required:l,onChange:function(e,r){return a(r)},options:f,isOptionEqualToValue:function(e,r){return e[m]===r[m]},noOptionsText:O,renderTags:function(e,r){return e.map((function(e,t){return g.createElement(d,F({variant:"outlined",label:e[p],size:"small"},r({index:t})))}))},renderInput:function(r){var t,a;return g.createElement(e,F({label:o,required:l,disabled:c,autoFocus:x,inputProps:{maxLength:E},error:S&&Boolean(null===(t=V[n])||void 0===t?void 0:t.message),onBlur:i,variant:"outlined",fullWidth:!0,helperText:S&&(null===(a=V[n])||void 0===a?void 0:a.message)},r,L))}})}})},te=["form","name","label","optionsUrl","renderOption","valueKey","labelKey","minChars","required","disabled","maxLength","autofocus","loadingText","noOptionsText","placeholder","size","onChange","showErrors","readonly","readonlyBackgroundColor","bold"],ne=g.forwardRef((function(r,t){var n=r.form,o=r.name,a=r.label,l=r.optionsUrl,i=r.renderOption,d=void 0===i?null:i,c=r.valueKey,s=void 0===c?"id":c,f=r.labelKey,v=void 0===f?"label":f,m=r.minChars,h=void 0===m?2:m,p=r.required,y=void 0!==p&&p,E=r.disabled,x=void 0!==E&&E,C=r.maxLength,O=void 0===C?255:C,q=r.autofocus,S=void 0!==q&&q,L=r.loadingText,T=void 0===L?"Ανάκτηση...":L,P=r.noOptionsText,k=void 0===P?"Δεν υπάρχουν επιλογές":P,B=r.placeholder,j=void 0===B?"":B,W=r.size,z=void 0===W?"medium":W,A=r.onChange,K=void 0===A?null:A,D=r.showErrors,M=void 0===D||D,Y=r.readonly,G=void 0!==Y&&Y,R=r.readonlyBackgroundColor,H=void 0===R?"#dddddd":R,X=r.bold,U=void 0!==X&&X,$=I(r,te),J=N(g.useState(null),2),Q=J[0],Z=J[1],ee=N(g.useState([]),2),re=ee[0],ne=ee[1],oe=N(g.useState(!1),2),ae=oe[0],le=oe[1];g.useImperativeHandle(t,(function(){return{setValue:function(e){function r(){return(r=V(_().mark((function r(){var t;return _().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return le(!0),r.next=3,w.get("".concat(l,"?id=").concat(e));case 3:t=r.sent,ne(t.data),Z(t.data.find((function(e){return e[s]===n.getValues(o)}))||null),le(!1);case 7:case"end":return r.stop()}}),r)})))).apply(this,arguments)}n.setValue(o,e),function(){r.apply(this,arguments)}()}}}));var ie=n.control,ue=n.formState.errors;g.useEffect((function(){if(n.getValues(o)){var e=function(){var e=V(_().mark((function e(){var r;return _().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return le(!0),e.next=3,w.get("".concat(l,"?id=").concat(n.getValues(o)));case 3:r=e.sent,ne(r.data),Z(r.data.find((function(e){return e[s]===n.getValues(o)}))||null),le(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}}),[]);var de=function(){var e=V(_().mark((function e(r,t){var n;return _().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t||ne([]),!(t.length<h)){e.next=3;break}return e.abrupt("return");case 3:return le(!0),e.next=6,w.get("".concat(l,"?id=").concat(r||"","&token=").concat(t||""));case 6:n=e.sent,ne(n.data),le(!1);case 9:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}(),ce=useMemo((function(){return e=function(e,r,t){var a;"input"===t&&(a=r,de(n.getValues(o),a))},r=300,function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];t&&clearTimeout(t),t=setTimeout((function(){e.apply(void 0,o)}),r)};var e,r,t}),[]);return g.createElement(b,{name:o,control:ie,rules:{required:y,disabled:x},render:function(r){var t=r.field,n=t.onChange,l=t.onBlur;return t.value,G?g.createElement(e,{size:z,label:a,fullWidth:!0,required:y,slotProps:{input:{maxLength:O,readOnly:G,sx:{fontWeight:U?"bold":"",backgroundColor:G?H:""}}},value:Q?Q.label:""}):g.createElement(u,{value:Q,options:re,onInputChange:ce,onChange:function(e,r){Z(r),n(r?r[s]:null),K&&K(r?r[s]:null)},isOptionEqualToValue:function(e,r){return e[s]===r[s]},getOptionLabel:function(e){return e[v]},filterOptions:function(e){return e},noOptionsText:k,loadingText:T,loading:ae,required:y,size:z,renderInput:function(r){var t,n;return g.createElement(e,F({label:a,required:y,disabled:x,autoFocus:S,placeholder:j,error:M&&Boolean(null===(t=ue[o])||void 0===t?void 0:t.message),onBlur:l,variant:"outlined",fullWidth:!0,helperText:M&&(null===(n=ue[o])||void 0===n?void 0:n.message),size:z,maxLength:O},r,$))},renderOption:function(e,r,t){return d?d(e,r,t):g.createElement("li",F({},e,{key:r[s]}),r[v])}})}})})),oe=["form","name","label","rows","required","disabled","autofocus","showErrors"],ae=function(r){var t=r.form,n=r.name,o=r.label,a=r.rows,l=void 0===a?5:a,i=r.required,u=void 0!==i&&i,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=I(r,oe),p=t.control,y=t.formState.errors;return g.createElement(b,{name:n,control:p,rules:{required:u,disabled:c},render:function(r){var t,a,i=r.field,d=i.onChange,s=i.onBlur,v=i.value;return g.createElement(e,F({required:u,label:o,value:v,multiline:!0,minRows:l,maxRows:l,onChange:d,onBlur:s,error:m&&Boolean(null===(t=y[n])||void 0===t?void 0:t.message),fullWidth:!0,helperText:m&&(null===(a=y[n])||void 0===a?void 0:a.message),variant:"outlined",disabled:c,autoFocus:f},h))}})},le=["form","name","label","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],ie=function(r){var t=r.form,n=r.name,o=r.label,a=r.required,l=void 0!==a&&a,i=r.disabled,u=void 0!==i&&i;r.autofocus;var d=r.showErrors,c=void 0===d||d,s=r.readonly,f=void 0!==s&&s,v=r.readonlyBackgroundColor,m=void 0===v?"#dddddd":v,h=r.bold,p=void 0!==h&&h,y=I(r,le),E=t.control,w=t.formState.errors,C=function(e,r){""===e.value?t.setValue(n,null):t.setValue(n,e.floatValue)};return g.createElement(b,{name:n,control:E,rules:{required:l,disabled:u},render:function(r){var t,a,i=r.field;i.onChange,i.onBlur;var d=i.value;return g.createElement(x,F({customInput:e,variant:"outlined",label:o,required:l,disabled:u,value:d,thousandSeparator:".",decimalSeparator:",",decimalScale:2,fixedDecimalScale:!0,allowNegative:!1,onValueChange:C,error:c&&Boolean(null===(t=w[n])||void 0===t?void 0:t.message),helperText:c&&(null===(a=w[n])||void 0===a?void 0:a.message),fullWidth:!0,slotProps:{input:{readOnly:f,sx:{fontWeight:p?"bold":"",backgroundColor:f?m:""}}}},y))}})},ue=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],de=function(e){var r=e.form,t=e.name,n=e.label,o=e.required,a=void 0!==o&&o,l=e.disabled,i=void 0!==l&&l;e.autofocus;var u=e.showErrors,d=void 0===u||u,c=e.ampm,s=void 0!==c&&c,f=e.singleTimeColumn,v=void 0===f||f,m=e.hoursStep,h=void 0===m?1:m,p=e.minutesStep,y=void 0===p?15:p,w=e.secondsStep,x=void 0===w?30:w,L=I(e,ue),T=r.control,k=r.formState.errors;return g.createElement(O,{dateAdapter:C,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"},fieldClearLabel:"Καθαρισμός"}},g.createElement(b,{name:t,control:T,rules:{required:a,disabled:i},render:function(e){var r,o,l=e.field;return g.createElement(q,{label:n,value:l.value?E(l.value):null,format:"dd/MM/yyyy HH:mm",inputFormat:!0,views:v?["year","month","day","hours"]:["year","month","day","hours","minutes"],ampm:s,onChange:function(e){return l.onChange(e)},viewRenderers:v?{hours:S}:null,timeSteps:{hours:h,minutes:y,seconds:x},slotProps:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:A(A({},L),{},{required:a,error:d&&Boolean(null===(r=k[t])||void 0===r?void 0:r.message),helperText:d&&(null===(o=k[t])||void 0===o?void 0:o.message),variant:"outlined",fullWidth:!0})}})}}))},ce=["form","name","label","required","disabled","autofocus","showErrors"],se=function(e){var r=e.form,t=e.name,n=e.label,o=e.required,a=void 0!==o&&o,l=e.disabled,i=void 0!==l&&l;e.autofocus;var u=e.showErrors,d=void 0===u||u,c=I(e,ce),s=r.control,f=r.formState.errors;return g.createElement(O,{dateAdapter:C,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldClearLabel:"Καθαρισμός"}},g.createElement(b,{name:t,control:s,rules:{required:a,disabled:i},render:function(e){var r,o,l=e.field;return g.createElement(L,{label:n,value:l.value?E(l.value):null,format:"dd/MM/yyyy",inputFormat:!0,onChange:function(e){return l.onChange(e)},slotProps:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:A(A({},c),{},{required:a,error:d&&Boolean(null===(r=f[t])||void 0===r?void 0:r.message),helperText:d&&(null===(o=f[t])||void 0===o?void 0:o.message),variant:"outlined",fullWidth:!0})}})}}))},fe=["form","name","label","allowNegative","required","disabled","autofocus","showErrors"],ve=function(r){var t=r.form,n=r.name,o=r.label,a=r.allowNegative,l=void 0!==a&&a,i=r.required,u=void 0!==i&&i,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=I(r,fe),p=t.control,y=t.formState.errors,E=function(e,r){""===e.value?t.setValue(n,null):t.setValue(n,e.floatValue)};return g.createElement(b,{name:n,control:p,rules:{required:u,disabled:c},render:function(r){var t,a,i=r.field;i.onChange,i.onBlur;var d=i.value;return g.createElement(x,F({customInput:e,variant:"outlined",label:o,required:u,disabled:c,value:d,thousandSeparator:!1,decimalSeparator:",",decimalScale:0,fixedDecimalScale:!0,allowNegative:l,onValueChange:E,error:m&&Boolean(null===(t=y[n])||void 0===t?void 0:t.message),helperText:m&&(null===(a=y[n])||void 0===a?void 0:a.message),fullWidth:!0,autoFocus:f},h))}})},me=["form","name","label","required","disabled","showErrors"],he=function(r){var t=r.form,n=r.name,o=r.label,a=r.required,l=void 0!==a&&a,i=r.disabled,u=void 0!==i&&i,d=r.showErrors,f=void 0===d||d,v=I(r,me),m=N(g.useState(),2),h=m[0],p=m[1],y=g.useRef(null),E=t.control,w=t.formState.errors,x=function(){y.current.value=null,y.current.click()};return g.createElement(g.Fragment,null,g.createElement(b,{name:n,control:E,rules:{required:l,disabled:u},render:function(r){var a,i,d=r.field;return d.onChange,d.onBlur,d.value,g.createElement(e,F({sx:{input:{cursor:"pointer"}},onClick:x,required:l,label:o,value:h?h.name:"",error:f&&Boolean(null===(a=w[n])||void 0===a?void 0:a.message),fullWidth:!0,helperText:f&&(null===(i=w[n])||void 0===i?void 0:i.message),variant:"outlined",disabled:u,InputProps:{endAdornment:h&&g.createElement(c,{position:"end"},g.createElement(s,{onClick:function(e){return function(e){e.stopPropagation(),p(null),t.setValue(n,null)}(e)}},g.createElement(k,null))),readOnly:!0}},v))}}),g.createElement("input",{type:"file",ref:y,style:{display:"none"},onChange:function(e){return function(e){p(e),t.setValue(n,e,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})}(e.currentTarget.files[0])}}))},pe=["form","name","label","ampm","hoursStep","minutesStep","secondsStep","singleTimeColumn","required","disabled","autofocus","showErrors"],ge=function(e){var r=e.form,t=e.name,n=e.label,o=e.ampm,a=void 0!==o&&o,l=e.hoursStep,i=void 0===l?1:l,u=e.minutesStep,d=void 0===u?15:u,c=e.secondsStep,s=void 0===c?30:c,f=e.singleTimeColumn,v=void 0===f||f,m=e.required,h=void 0!==m&&m,p=e.disabled,y=void 0!==p&&p;e.autofocus;var w=e.showErrors,x=void 0===w||w,q=I(e,pe),L=r.control,k=r.formState.errors;return g.createElement(O,{dateAdapter:C,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},g.createElement(b,{name:t,control:L,rules:{required:h,disabled:y},render:function(e){var r,o,l=e.field;return g.createElement(T,{label:n,value:l.value?E(l.value):null,format:"HH:mm",inputFormat:!0,views:v?["hours"]:["hours","minutes"],ampm:a,onChange:function(e){return l.onChange(e)},viewRenderers:v?{hours:S}:null,timeSteps:{hours:i,minutes:d,seconds:s},slotProps:{textField:A(A({},q),{},{required:h,error:x&&Boolean(null===(r=k[t])||void 0===r?void 0:r.message),helperText:x&&(null===(o=k[t])||void 0===o?void 0:o.message),variant:"outlined",fullWidth:!0})}})}}))},be=["form","name","label","options","disabled","direction"],ye=function(e){var r=e.form,n=e.name,o=e.label,a=e.options,l=e.disabled,i=void 0!==l&&l,u=e.direction,d=void 0===u?"vertical":u,c=I(e,be),s=r.control;return g.createElement(b,{name:n,control:s,rules:{disabled:i},render:function(e){var l=e.field;l.onChange,l.onBlur;var i=l.value;return g.createElement(f,c,g.createElement(v,null,o),g.createElement(m,{row:"horizontal"===d,value:i,onChange:function(e){return r.setValue(n,e.target.value)}},a.map((function(e){return g.createElement(t,{key:e.id,value:e.id,control:g.createElement(h,null),label:e.label})}))))}})},Ee=["form","name","label","disabled"],we=function(e){var r=e.form,n=e.name,o=e.label,a=e.disabled,l=void 0!==a&&a,i=I(e,Ee),u=r.control;return g.createElement(b,{name:n,control:u,rules:{disabled:l},render:function(e){var a=e.field;a.onChange,a.onBlur;var u=a.value;return g.createElement(t,F({control:g.createElement(p,{checked:u,onChange:function(e){return r.setValue(n,e.target.checked)},disabled:l}),label:o},i))}})};export{ne as MyAutocompleteApiField,Z as MyAutocompleteField,re as MyAutocompleteMultiField,we as MyCheckboxField,J as MyColorPickerField,ie as MyCurrencyField,se as MyDateField,de as MyDatetimeField,R as MyEmailField,ve as MyIntegerField,ae as MyNotesField,Y as MyPasswordField,ye as MyRadioField,X as MySwitchField,D as MyTextField,ge as MyTimeField,he as MyUploadField};
1
+ import{TextField as e,FormGroup as r,FormControlLabel as t,Switch as n,Typography as o,Stack as a,Box as l,Popover as i,Autocomplete as u,Chip as d,InputAdornment as c,IconButton as s,FormControl as f,FormLabel as v,RadioGroup as m,Radio as h,Checkbox as p}from"@mui/material";import g from"react";import{Controller as b}from"react-hook-form";import{ChromePicker as y}from"react-color";import{toDate as E}from"date-fns";import"date-fns/locale";import w from"axios";import{NumericFormat as x}from"react-number-format";import{AdapterDateFns as C}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as O}from"@mui/x-date-pickers/LocalizationProvider";import{DateTimePicker as q,renderDigitalClockTimeView as S,DatePicker as L,TimePicker as T}from"@mui/x-date-pickers";import P from"date-fns/locale/el";import{Clear as k}from"@mui/icons-material";function B(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function j(e,r,t,n,o,a,l){try{var i=e[a](l),u=i.value}catch(e){return void t(e)}i.done?r(u):Promise.resolve(u).then(n,o)}function V(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var a=e.apply(r,t);function l(e){j(a,n,o,l,i,"next",e)}function i(e){j(a,n,o,l,i,"throw",e)}l(void 0)}))}}function W(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function F(){return F=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},F.apply(null,arguments)}function z(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function A(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?z(Object(t),!0).forEach((function(r){W(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):z(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function I(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==r.indexOf(n))continue;t[n]=e[n]}return t}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],-1===r.indexOf(t)&&{}.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function _(){_=function(){return r};var e,r={},t=Object.prototype,n=t.hasOwnProperty,o=Object.defineProperty||function(e,r,t){e[r]=t.value},a="function"==typeof Symbol?Symbol:{},l=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function d(e,r,t){return Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[r]}try{d({},"")}catch(e){d=function(e,r,t){return e[r]=t}}function c(e,r,t,n){var a=r&&r.prototype instanceof g?r:g,l=Object.create(a.prototype),i=new k(n||[]);return o(l,"_invoke",{value:S(e,t,i)}),l}function s(e,r,t){try{return{type:"normal",arg:e.call(r,t)}}catch(e){return{type:"throw",arg:e}}}r.wrap=c;var f="suspendedStart",v="suspendedYield",m="executing",h="completed",p={};function g(){}function b(){}function y(){}var E={};d(E,l,(function(){return this}));var w=Object.getPrototypeOf,x=w&&w(w(B([])));x&&x!==t&&n.call(x,l)&&(E=x);var C=y.prototype=g.prototype=Object.create(E);function O(e){["next","throw","return"].forEach((function(r){d(e,r,(function(e){return this._invoke(r,e)}))}))}function q(e,r){function t(o,a,l,i){var u=s(e[o],e,a);if("throw"!==u.type){var d=u.arg,c=d.value;return c&&"object"==typeof c&&n.call(c,"__await")?r.resolve(c.__await).then((function(e){t("next",e,l,i)}),(function(e){t("throw",e,l,i)})):r.resolve(c).then((function(e){d.value=e,l(d)}),(function(e){return t("throw",e,l,i)}))}i(u.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new r((function(r,o){t(e,n,r,o)}))}return a=a?a.then(o,o):o()}})}function S(r,t,n){var o=f;return function(a,l){if(o===m)throw Error("Generator is already running");if(o===h){if("throw"===a)throw l;return{value:e,done:!0}}for(n.method=a,n.arg=l;;){var i=n.delegate;if(i){var u=L(i,n);if(u){if(u===p)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===f)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var d=s(r,t,n);if("normal"===d.type){if(o=n.done?h:v,d.arg===p)continue;return{value:d.arg,done:n.done}}"throw"===d.type&&(o=h,n.method="throw",n.arg=d.arg)}}}function L(r,t){var n=t.method,o=r.iterator[n];if(o===e)return t.delegate=null,"throw"===n&&r.iterator.return&&(t.method="return",t.arg=e,L(r,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var a=s(o,r.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,p;var l=a.arg;return l?l.done?(t[r.resultName]=l.value,t.next=r.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,p):l:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function T(e){var r={tryLoc:e[0]};1 in e&&(r.catchLoc=e[1]),2 in e&&(r.finallyLoc=e[2],r.afterLoc=e[3]),this.tryEntries.push(r)}function P(e){var r=e.completion||{};r.type="normal",delete r.arg,e.completion=r}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function B(r){if(r||""===r){var t=r[l];if(t)return t.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function t(){for(;++o<r.length;)if(n.call(r,o))return t.value=r[o],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(typeof r+" is not iterable")}return b.prototype=y,o(C,"constructor",{value:y,configurable:!0}),o(y,"constructor",{value:b,configurable:!0}),b.displayName=d(y,u,"GeneratorFunction"),r.isGeneratorFunction=function(e){var r="function"==typeof e&&e.constructor;return!!r&&(r===b||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,d(e,u,"GeneratorFunction")),e.prototype=Object.create(C),e},r.awrap=function(e){return{__await:e}},O(q.prototype),d(q.prototype,i,(function(){return this})),r.AsyncIterator=q,r.async=function(e,t,n,o,a){void 0===a&&(a=Promise);var l=new q(c(e,t,n,o),a);return r.isGeneratorFunction(t)?l:l.next().then((function(e){return e.done?e.value:l.next()}))},O(C),d(C,u,"Generator"),d(C,l,(function(){return this})),d(C,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var r=Object(e),t=[];for(var n in r)t.push(n);return t.reverse(),function e(){for(;t.length;){var n=t.pop();if(n in r)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=B,k.prototype={constructor:k,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!r)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var t=this;function o(n,o){return i.type="throw",i.arg=r,t.next=n,o&&(t.method="next",t.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var l=this.tryEntries[a],i=l.completion;if("root"===l.tryLoc)return o("end");if(l.tryLoc<=this.prev){var u=n.call(l,"catchLoc"),d=n.call(l,"finallyLoc");if(u&&d){if(this.prev<l.catchLoc)return o(l.catchLoc,!0);if(this.prev<l.finallyLoc)return o(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return o(l.catchLoc,!0)}else{if(!d)throw Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return o(l.finallyLoc)}}}},abrupt:function(e,r){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=r&&r<=a.finallyLoc&&(a=null);var l=a?a.completion:{};return l.type=e,l.arg=r,a?(this.method="next",this.next=a.finallyLoc,p):this.complete(l)},complete:function(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),p},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),P(t),p}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.tryLoc===e){var n=t.completion;if("throw"===n.type){var o=n.arg;P(t)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,t,n){return this.delegate={iterator:B(r),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=e),p}},r}function N(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a,l,i=[],u=!0,d=!1;try{if(a=(t=t.call(e)).next,0===r);else for(;!(u=(n=a.call(t)).done)&&(i.push(n.value),i.length!==r);u=!0);}catch(e){d=!0,o=e}finally{try{if(!u&&null!=t.return&&(l=t.return(),Object(l)!==l))return}finally{if(d)throw o}}return i}}(e,r)||function(e,r){if(e){if("string"==typeof e)return B(e,r);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?B(e,r):void 0}}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var K=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],D=function(r){var t=r.form,n=r.name,o=r.label,a=r.maxLength,l=void 0===a?255:a,i=r.required,u=void 0!==i&&i,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=r.readonly,p=void 0!==h&&h,y=r.readonlyBackgroundColor,E=void 0===y?"#dddddd":y,w=r.bold,x=void 0!==w&&w,C=I(r,K),O=t.control,q=t.formState.errors;return g.createElement(b,{name:n,control:O,rules:{required:u,disabled:c},render:function(r){var t,a,i=r.field,d=i.onChange,s=i.onBlur,v=i.value;return g.createElement(e,F({required:u,label:o,value:v,onChange:d,onBlur:s,error:m&&Boolean(null===(t=q[n])||void 0===t?void 0:t.message),fullWidth:!0,helperText:m&&(null===(a=q[n])||void 0===a?void 0:a.message),variant:"outlined",disabled:c,autoFocus:f,slotProps:{input:{maxLength:l,readOnly:p,sx:{fontWeight:x?"bold":"",backgroundColor:p?E:""}}}},C))}})},M=["form","name","label","required","disabled","autofocus","showErrors"],Y=function(r){var t=r.form,n=r.name,o=void 0===n?"password":n,a=r.label,l=void 0===a?"Κωδικός Πρόσβασης":a,i=r.required,u=void 0===i||i,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=I(r,M),p=t.control,y=t.formState.errors;return g.createElement(b,{name:o,control:p,rules:{required:u,disabled:c},render:function(r){var t,n,a=r.field,i=a.onChange,d=a.onBlur,s=a.value;return g.createElement(e,F({required:u,label:l,value:s,onChange:i,onBlur:d,error:m&&Boolean(null===(t=y[o])||void 0===t?void 0:t.message),fullWidth:!0,helperText:m&&(null===(n=y[o])||void 0===n?void 0:n.message),variant:"outlined",disabled:c,autoFocus:f,type:"password"},h))}})},G=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],R=function(r){var t=r.form,n=r.name,o=void 0===n?"email":n,a=r.label,l=void 0===a?"E-mail":a,i=r.maxLength,u=void 0===i?255:i,d=r.required,c=void 0===d||d,s=r.disabled,f=void 0!==s&&s,v=r.autofocus,m=void 0!==v&&v,h=r.showErrors,p=void 0===h||h,y=r.readonly,E=void 0!==y&&y,w=r.readonlyBackgroundColor,x=void 0===w?"#dddddd":w,C=r.bold,O=void 0!==C&&C,q=I(r,G),S=t.control,L=t.formState.errors;return g.createElement(b,{name:o,control:S,rules:{required:c,disabled:f},render:function(r){var t,n,a=r.field,i=a.onChange,d=a.onBlur,s=a.value;return g.createElement(e,F({required:c,label:l,value:s,onChange:i,onBlur:d,error:p&&Boolean(null===(t=L[o])||void 0===t?void 0:t.message),fullWidth:!0,helperText:p&&(null===(n=L[o])||void 0===n?void 0:n.message),variant:"outlined",disabled:f,autoFocus:m,slotProps:{input:{maxLength:u,readOnly:E,sx:{fontWeight:O?"bold":"",backgroundColor:E?x:""}}}},q))}})},H=["form","name","label","disabled"],X=function(e){var o=e.form,a=e.name,l=e.label,i=e.disabled,u=void 0!==i&&i,d=I(e,H),c=o.control;return g.createElement(b,{name:a,control:c,rules:{disabled:u},render:function(e){var i=e.field;i.onChange,i.onBlur;var u=i.value;return g.createElement(r,d,g.createElement(t,{control:g.createElement(n,{checked:Boolean(u),onChange:function(e){return o.setValue(a,e.target.checked)},inputProps:{"aria-label":l}}),label:l}))}})},U=function(e){var r=e.label,t=void 0===r?"":r,n=e.color,a=void 0===n?"white":n,l=e.backgroundColor,i=void 0===l?"#888888":l,u=e.paddingX,d=void 0===u?"10px":u,c=e.paddingY,s=void 0===c?"5px":c,f=e.borderRadius,v=void 0===f?"10px":f,m=e.fontSize,h=void 0===m?"14px":m,p=e.width,b={text:{display:"inline-block",textAlign:"center",backgroundColor:i,paddingX:d,paddingY:s,borderRadius:v,width:void 0===p?"auto":p,color:a,fontSize:h}};return g.createElement(o,{sx:b.text},t)},$=["form","name","label","selectionWidth","pickerWidth","selectionTextColor","paddingY","paddingX","required","disabled"],J=function(e){var r=e.form,t=e.name,n=void 0===t?"color":t,u=e.label,d=void 0===u?"Επιλογή Χρώματος":u,c=e.selectionWidth,s=void 0===c?70:c,f=e.pickerWidth,v=void 0===f?350:f,m=e.selectionTextColor,h=void 0===m?"white":m,p=e.paddingY,E=void 0===p?"10px":p,w=e.paddingX,x=void 0===w?"10px":w,C=e.required,O=void 0!==C&&C,q=e.disabled,S=void 0!==q&&q,L=I(e,$),T=N(g.useState(null),2),P=T[0],k=T[1],B=Boolean(P),j=B?"color-picker":void 0,V=r.control;return g.createElement(b,{name:n,control:V,rules:{disabled:S},render:function(e){var r=e.field,t=r.onChange;r.onBlur;var n=r.value;return g.createElement(a,F({gap:1},L),g.createElement(o,null,"".concat(d," ").concat(O?"*":"")),g.createElement(l,{sx:{display:"flex"}},g.createElement(l,{"aria-describedby":j,sx:{cursor:"pointer"},onClick:function(e){return k(e.currentTarget)}},g.createElement(U,{color:h,backgroundColor:n,paddingY:E,paddingX:x,width:s,label:n}))),g.createElement(i,{sx:{marginTop:"10px"},id:j,open:B,anchorEl:P,onClose:function(){return k(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"}},g.createElement(l,null,g.createElement(y,{width:v,color:n,onChange:function(e){return t(e.hex)}}))))}})},Q=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors","size","readonly","readonlyBackgroundColor","bold"],Z=function(r){var t=r.form,n=r.name,o=r.label,a=r.required,l=void 0!==a&&a,i=r.disabled,d=void 0!==i&&i,c=r.options,s=void 0===c?[]:c,f=r.valueKey,v=void 0===f?"id":f,m=r.labelKey,h=void 0===m?"label":m,p=r.maxLength,y=void 0===p?255:p,E=r.autofocus,w=void 0!==E&&E,x=r.noOptionsText,C=void 0===x?"Δεν υπάρχουν επιλογές":x,O=r.showErrors,q=void 0===O||O,S=r.size,L=void 0===S?"medium":S,T=r.readonly,P=void 0!==T&&T,k=r.readonlyBackgroundColor,B=void 0===k?"#dddddd":k,j=r.bold,V=void 0!==j&&j,W=I(r,Q),z=N(g.useState(null),2),A=z[0],_=z[1],K=t.watch(n);g.useEffect((function(){_(s.find((function(e){return e[v]===K}))||null)}),[K]);var D=t.control,M=t.formState.errors;return g.createElement(b,{name:n,control:D,rules:{required:l,disabled:d},render:function(r){var t=r.field,a=t.onChange,i=t.onBlur;return t.value,P?g.createElement(e,{size:L,label:o,fullWidth:!0,required:l,slotProps:{input:{maxLength:y,readOnly:P,sx:{fontWeight:V?"bold":"",backgroundColor:P?B:""}}},value:A?A.label:""}):g.createElement(u,{value:A,required:l,onChange:function(e,r){return a(r?r[v]:null)},options:s,isOptionEqualToValue:function(e,r){return e[v]===r[v]},noOptionsText:C,getOptionLabel:function(e){return e[h]},size:L,slotProps:{input:{maxLength:y,sx:{fontWeight:V?"bold":"",color:"red"}}},renderInput:function(r){var t,a;return g.createElement(e,F({label:o,required:l,disabled:d,autoFocus:w,size:L,error:q&&Boolean(null===(t=M[n])||void 0===t?void 0:t.message),onBlur:i,variant:"outlined",fullWidth:!0,helperText:q&&(null===(a=M[n])||void 0===a?void 0:a.message)},r,W))}})}})},ee=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors"],re=function(r){var t=r.form,n=r.name,o=r.label,a=r.required,l=void 0!==a&&a,i=r.disabled,c=void 0!==i&&i,s=r.options,f=void 0===s?[]:s,v=r.valueKey,m=void 0===v?"id":v,h=r.labelKey,p=void 0===h?"label":h,y=r.maxLength,E=void 0===y?255:y,w=r.autofocus,x=void 0!==w&&w,C=r.noOptionsText,O=void 0===C?"Δεν υπάρχουν επιλογές":C,q=r.showErrors,S=void 0===q||q,L=I(r,ee),T=N(g.useState([]),2),P=T[0],k=T[1],B=t.watch(n);g.useEffect((function(){k(f.filter((function(e){return function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return Boolean(r.find((function(r){return r[t]===e[t]})))}(e,B)})))}),[B]);var j=t.control,V=t.formState.errors;return g.createElement(b,{name:n,control:j,rules:{required:l,disabled:c},render:function(r){var t=r.field,a=t.onChange,i=t.onBlur;return t.value,g.createElement(u,{multiple:!0,value:P,required:l,onChange:function(e,r){return a(r)},options:f,isOptionEqualToValue:function(e,r){return e[m]===r[m]},noOptionsText:O,renderTags:function(e,r){return e.map((function(e,t){return g.createElement(d,F({variant:"outlined",label:e[p],size:"small"},r({index:t})))}))},renderInput:function(r){var t,a;return g.createElement(e,F({label:o,required:l,disabled:c,autoFocus:x,inputProps:{maxLength:E},error:S&&Boolean(null===(t=V[n])||void 0===t?void 0:t.message),onBlur:i,variant:"outlined",fullWidth:!0,helperText:S&&(null===(a=V[n])||void 0===a?void 0:a.message)},r,L))}})}})},te=["form","name","label","optionsUrl","renderOption","valueKey","labelKey","minChars","required","disabled","maxLength","autofocus","loadingText","noOptionsText","placeholder","size","onChange","showErrors","readonly","readonlyBackgroundColor","bold"],ne=g.forwardRef((function(r,t){var n=r.form,o=r.name,a=r.label,l=r.optionsUrl,i=r.renderOption,d=void 0===i?null:i,c=r.valueKey,s=void 0===c?"id":c,f=r.labelKey,v=void 0===f?"label":f,m=r.minChars,h=void 0===m?2:m,p=r.required,y=void 0!==p&&p,E=r.disabled,x=void 0!==E&&E,C=r.maxLength,O=void 0===C?255:C,q=r.autofocus,S=void 0!==q&&q,L=r.loadingText,T=void 0===L?"Ανάκτηση...":L,P=r.noOptionsText,k=void 0===P?"Δεν υπάρχουν επιλογές":P,B=r.placeholder,j=void 0===B?"":B,W=r.size,z=void 0===W?"medium":W,A=r.onChange,K=void 0===A?null:A,D=r.showErrors,M=void 0===D||D,Y=r.readonly,G=void 0!==Y&&Y,R=r.readonlyBackgroundColor,H=void 0===R?"#dddddd":R,X=r.bold,U=void 0!==X&&X,$=I(r,te),J=N(g.useState(null),2),Q=J[0],Z=J[1],ee=N(g.useState([]),2),re=ee[0],ne=ee[1],oe=N(g.useState(!1),2),ae=oe[0],le=oe[1];g.useImperativeHandle(t,(function(){return{setValue:function(e){function r(){return(r=V(_().mark((function r(){var t;return _().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return le(!0),r.next=3,w.get("".concat(l,"?id=").concat(e));case 3:t=r.sent,ne(t.data),Z(t.data.find((function(e){return e[s]===n.getValues(o)}))||null),le(!1);case 7:case"end":return r.stop()}}),r)})))).apply(this,arguments)}n.setValue(o,e),function(){r.apply(this,arguments)}()}}}));var ie=n.control,ue=n.formState.errors;g.useEffect((function(){if(n.getValues(o)){var e=function(){var e=V(_().mark((function e(){var r;return _().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return le(!0),e.next=3,w.get("".concat(l,"?id=").concat(n.getValues(o)));case 3:r=e.sent,ne(r.data),Z(r.data.find((function(e){return e[s]===n.getValues(o)}))||null),le(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}}),[]);var de=function(){var e=V(_().mark((function e(r,t){var n;return _().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t||ne([]),!(t.length<h)){e.next=3;break}return e.abrupt("return");case 3:return le(!0),e.next=6,w.get("".concat(l,"?id=").concat(r||"","&token=").concat(t||""));case 6:n=e.sent,ne(n.data),le(!1);case 9:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}(),ce=g.useMemo((function(){return e=function(e,r,t){var a;"input"===t&&(a=r,de(n.getValues(o),a))},r=300,function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];t&&clearTimeout(t),t=setTimeout((function(){e.apply(void 0,o)}),r)};var e,r,t}),[]);return g.createElement(b,{name:o,control:ie,rules:{required:y,disabled:x},render:function(r){var t=r.field,n=t.onChange,l=t.onBlur;return t.value,G?g.createElement(e,{size:z,label:a,fullWidth:!0,required:y,slotProps:{input:{maxLength:O,readOnly:G,sx:{fontWeight:U?"bold":"",backgroundColor:G?H:""}}},value:Q?Q.label:""}):g.createElement(u,{value:Q,options:re,onInputChange:ce,onChange:function(e,r){Z(r),n(r?r[s]:null),K&&K(r?r[s]:null)},isOptionEqualToValue:function(e,r){return e[s]===r[s]},getOptionLabel:function(e){return e[v]},filterOptions:function(e){return e},noOptionsText:k,loadingText:T,loading:ae,required:y,size:z,renderInput:function(r){var t,n;return g.createElement(e,F({label:a,required:y,disabled:x,autoFocus:S,placeholder:j,error:M&&Boolean(null===(t=ue[o])||void 0===t?void 0:t.message),onBlur:l,variant:"outlined",fullWidth:!0,helperText:M&&(null===(n=ue[o])||void 0===n?void 0:n.message),size:z,maxLength:O},r,$))},renderOption:function(e,r,t){return d?d(e,r,t):g.createElement("li",F({},e,{key:r[s]}),r[v])}})}})})),oe=["form","name","label","rows","required","disabled","autofocus","showErrors"],ae=function(r){var t=r.form,n=r.name,o=r.label,a=r.rows,l=void 0===a?5:a,i=r.required,u=void 0!==i&&i,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=I(r,oe),p=t.control,y=t.formState.errors;return g.createElement(b,{name:n,control:p,rules:{required:u,disabled:c},render:function(r){var t,a,i=r.field,d=i.onChange,s=i.onBlur,v=i.value;return g.createElement(e,F({required:u,label:o,value:v,multiline:!0,minRows:l,maxRows:l,onChange:d,onBlur:s,error:m&&Boolean(null===(t=y[n])||void 0===t?void 0:t.message),fullWidth:!0,helperText:m&&(null===(a=y[n])||void 0===a?void 0:a.message),variant:"outlined",disabled:c,autoFocus:f},h))}})},le=["form","name","label","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],ie=function(r){var t=r.form,n=r.name,o=r.label,a=r.required,l=void 0!==a&&a,i=r.disabled,u=void 0!==i&&i;r.autofocus;var d=r.showErrors,c=void 0===d||d,s=r.readonly,f=void 0!==s&&s,v=r.readonlyBackgroundColor,m=void 0===v?"#dddddd":v,h=r.bold,p=void 0!==h&&h,y=I(r,le),E=t.control,w=t.formState.errors,C=function(e,r){""===e.value?t.setValue(n,null):t.setValue(n,e.floatValue)};return g.createElement(b,{name:n,control:E,rules:{required:l,disabled:u},render:function(r){var t,a,i=r.field;i.onChange,i.onBlur;var d=i.value;return g.createElement(x,F({customInput:e,variant:"outlined",label:o,required:l,disabled:u,value:d,thousandSeparator:".",decimalSeparator:",",decimalScale:2,fixedDecimalScale:!0,allowNegative:!1,onValueChange:C,error:c&&Boolean(null===(t=w[n])||void 0===t?void 0:t.message),helperText:c&&(null===(a=w[n])||void 0===a?void 0:a.message),fullWidth:!0,slotProps:{input:{readOnly:f,sx:{fontWeight:p?"bold":"",backgroundColor:f?m:""}}}},y))}})},ue=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],de=function(e){var r=e.form,t=e.name,n=e.label,o=e.required,a=void 0!==o&&o,l=e.disabled,i=void 0!==l&&l;e.autofocus;var u=e.showErrors,d=void 0===u||u,c=e.ampm,s=void 0!==c&&c,f=e.singleTimeColumn,v=void 0===f||f,m=e.hoursStep,h=void 0===m?1:m,p=e.minutesStep,y=void 0===p?15:p,w=e.secondsStep,x=void 0===w?30:w,L=I(e,ue),T=r.control,k=r.formState.errors;return g.createElement(O,{dateAdapter:C,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"},fieldClearLabel:"Καθαρισμός"}},g.createElement(b,{name:t,control:T,rules:{required:a,disabled:i},render:function(e){var r,o,l=e.field;return g.createElement(q,{label:n,value:l.value?E(l.value):null,format:"dd/MM/yyyy HH:mm",inputFormat:!0,views:v?["year","month","day","hours"]:["year","month","day","hours","minutes"],ampm:s,onChange:function(e){return l.onChange(e)},viewRenderers:v?{hours:S}:null,timeSteps:{hours:h,minutes:y,seconds:x},slotProps:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:A(A({},L),{},{required:a,error:d&&Boolean(null===(r=k[t])||void 0===r?void 0:r.message),helperText:d&&(null===(o=k[t])||void 0===o?void 0:o.message),variant:"outlined",fullWidth:!0})}})}}))},ce=["form","name","label","required","disabled","autofocus","showErrors"],se=function(e){var r=e.form,t=e.name,n=e.label,o=e.required,a=void 0!==o&&o,l=e.disabled,i=void 0!==l&&l;e.autofocus;var u=e.showErrors,d=void 0===u||u,c=I(e,ce),s=r.control,f=r.formState.errors;return g.createElement(O,{dateAdapter:C,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldClearLabel:"Καθαρισμός"}},g.createElement(b,{name:t,control:s,rules:{required:a,disabled:i},render:function(e){var r,o,l=e.field;return g.createElement(L,{label:n,value:l.value?E(l.value):null,format:"dd/MM/yyyy",inputFormat:!0,onChange:function(e){return l.onChange(e)},slotProps:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:A(A({},c),{},{required:a,error:d&&Boolean(null===(r=f[t])||void 0===r?void 0:r.message),helperText:d&&(null===(o=f[t])||void 0===o?void 0:o.message),variant:"outlined",fullWidth:!0})}})}}))},fe=["form","name","label","allowNegative","required","disabled","autofocus","showErrors"],ve=function(r){var t=r.form,n=r.name,o=r.label,a=r.allowNegative,l=void 0!==a&&a,i=r.required,u=void 0!==i&&i,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=I(r,fe),p=t.control,y=t.formState.errors,E=function(e,r){""===e.value?t.setValue(n,null):t.setValue(n,e.floatValue)};return g.createElement(b,{name:n,control:p,rules:{required:u,disabled:c},render:function(r){var t,a,i=r.field;i.onChange,i.onBlur;var d=i.value;return g.createElement(x,F({customInput:e,variant:"outlined",label:o,required:u,disabled:c,value:d,thousandSeparator:!1,decimalSeparator:",",decimalScale:0,fixedDecimalScale:!0,allowNegative:l,onValueChange:E,error:m&&Boolean(null===(t=y[n])||void 0===t?void 0:t.message),helperText:m&&(null===(a=y[n])||void 0===a?void 0:a.message),fullWidth:!0,autoFocus:f},h))}})},me=["form","name","label","required","disabled","showErrors"],he=function(r){var t=r.form,n=r.name,o=r.label,a=r.required,l=void 0!==a&&a,i=r.disabled,u=void 0!==i&&i,d=r.showErrors,f=void 0===d||d,v=I(r,me),m=N(g.useState(),2),h=m[0],p=m[1],y=g.useRef(null),E=t.control,w=t.formState.errors,x=function(){y.current.value=null,y.current.click()};return g.createElement(g.Fragment,null,g.createElement(b,{name:n,control:E,rules:{required:l,disabled:u},render:function(r){var a,i,d=r.field;return d.onChange,d.onBlur,d.value,g.createElement(e,F({sx:{input:{cursor:"pointer"}},onClick:x,required:l,label:o,value:h?h.name:"",error:f&&Boolean(null===(a=w[n])||void 0===a?void 0:a.message),fullWidth:!0,helperText:f&&(null===(i=w[n])||void 0===i?void 0:i.message),variant:"outlined",disabled:u,InputProps:{endAdornment:h&&g.createElement(c,{position:"end"},g.createElement(s,{onClick:function(e){return function(e){e.stopPropagation(),p(null),t.setValue(n,null)}(e)}},g.createElement(k,null))),readOnly:!0}},v))}}),g.createElement("input",{type:"file",ref:y,style:{display:"none"},onChange:function(e){return function(e){p(e),t.setValue(n,e,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})}(e.currentTarget.files[0])}}))},pe=["form","name","label","ampm","hoursStep","minutesStep","secondsStep","singleTimeColumn","required","disabled","autofocus","showErrors"],ge=function(e){var r=e.form,t=e.name,n=e.label,o=e.ampm,a=void 0!==o&&o,l=e.hoursStep,i=void 0===l?1:l,u=e.minutesStep,d=void 0===u?15:u,c=e.secondsStep,s=void 0===c?30:c,f=e.singleTimeColumn,v=void 0===f||f,m=e.required,h=void 0!==m&&m,p=e.disabled,y=void 0!==p&&p;e.autofocus;var w=e.showErrors,x=void 0===w||w,q=I(e,pe),L=r.control,k=r.formState.errors;return g.createElement(O,{dateAdapter:C,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},g.createElement(b,{name:t,control:L,rules:{required:h,disabled:y},render:function(e){var r,o,l=e.field;return g.createElement(T,{label:n,value:l.value?E(l.value):null,format:"HH:mm",inputFormat:!0,views:v?["hours"]:["hours","minutes"],ampm:a,onChange:function(e){return l.onChange(e)},viewRenderers:v?{hours:S}:null,timeSteps:{hours:i,minutes:d,seconds:s},slotProps:{textField:A(A({},q),{},{required:h,error:x&&Boolean(null===(r=k[t])||void 0===r?void 0:r.message),helperText:x&&(null===(o=k[t])||void 0===o?void 0:o.message),variant:"outlined",fullWidth:!0})}})}}))},be=["form","name","label","options","disabled","direction"],ye=function(e){var r=e.form,n=e.name,o=e.label,a=e.options,l=e.disabled,i=void 0!==l&&l,u=e.direction,d=void 0===u?"vertical":u,c=I(e,be),s=r.control;return g.createElement(b,{name:n,control:s,rules:{disabled:i},render:function(e){var l=e.field;l.onChange,l.onBlur;var i=l.value;return g.createElement(f,c,g.createElement(v,null,o),g.createElement(m,{row:"horizontal"===d,value:i,onChange:function(e){return r.setValue(n,e.target.value)}},a.map((function(e){return g.createElement(t,{key:e.id,value:e.id,control:g.createElement(h,null),label:e.label})}))))}})},Ee=["form","name","label","disabled"],we=function(e){var r=e.form,n=e.name,o=e.label,a=e.disabled,l=void 0!==a&&a,i=I(e,Ee),u=r.control;return g.createElement(b,{name:n,control:u,rules:{disabled:l},render:function(e){var a=e.field;a.onChange,a.onBlur;var u=a.value;return g.createElement(t,F({control:g.createElement(p,{checked:u,onChange:function(e){return r.setValue(n,e.target.checked)},disabled:l}),label:o},i))}})};export{ne as MyAutocompleteApiField,Z as MyAutocompleteField,re as MyAutocompleteMultiField,we as MyCheckboxField,J as MyColorPickerField,ie as MyCurrencyField,se as MyDateField,de as MyDatetimeField,R as MyEmailField,ve as MyIntegerField,ae as MyNotesField,Y as MyPasswordField,ye as MyRadioField,X as MySwitchField,D as MyTextField,ge as MyTimeField,he as MyUploadField};
package/modals/index.js CHANGED
@@ -1 +1 @@
1
- import e from"react";import{TextField as t,Typography as r,Autocomplete as n,Chip as o,InputAdornment as i,IconButton as a,Dialog as l,Zoom as u,DialogTitle as c,Stack as s,Box as d,Divider as m,DialogContent as f,DialogActions as p,Button as v,CircularProgress as h,DialogContentText as b}from"@mui/material";import{Controller as g,useForm as E}from"react-hook-form";import{yupResolver as x}from"@hookform/resolvers/yup";import*as y from"yup";import{ChromePicker as w}from"react-color";import{toDate as C}from"date-fns";import"date-fns/locale";import S from"axios";import{NumericFormat as q}from"react-number-format";import{AdapterDateFns as W}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as L}from"@mui/x-date-pickers/LocalizationProvider";import{DateTimePicker as k,renderDigitalClockTimeView as T,DatePicker as O,TimePicker as R}from"@mui/x-date-pickers";import V from"date-fns/locale/el";import{Clear as P,EditNoteRounded as j}from"@mui/icons-material";import z from"@mui/icons-material/WarningAmberRounded";import B from"@mui/icons-material/ErrorOutlineRounded";import K from"@mui/icons-material/CheckCircleOutlineRounded";function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function F(e,t,r,n,o,i,a){try{var l=e[i](a),u=l.value}catch(e){return void r(e)}l.done?t(u):Promise.resolve(u).then(n,o)}function I(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){F(i,n,o,a,l,"next",e)}function l(e){F(i,n,o,a,l,"throw",e)}a(void 0)}))}}function M(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function N(){return N=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},N.apply(null,arguments)}function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){M(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function H(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function G(){G=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),l=new O(n||[]);return o(a,"_invoke",{value:W(e,r,l)}),a}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var m="suspendedStart",f="suspendedYield",p="executing",v="completed",h={};function b(){}function g(){}function E(){}var x={};c(x,a,(function(){return this}));var y=Object.getPrototypeOf,w=y&&y(y(R([])));w&&w!==r&&n.call(w,a)&&(x=w);var C=E.prototype=b.prototype=Object.create(x);function S(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function q(e,t){function r(o,i,a,l){var u=d(e[o],e,i);if("throw"!==u.type){var c=u.arg,s=c.value;return s&&"object"==typeof s&&n.call(s,"__await")?t.resolve(s.__await).then((function(e){r("next",e,a,l)}),(function(e){r("throw",e,a,l)})):t.resolve(s).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,l)}))}l(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function W(t,r,n){var o=m;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var l=n.delegate;if(l){var u=L(l,n);if(u){if(u===h)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=d(t,r,n);if("normal"===c.type){if(o=n.done?v:f,c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=v,n.method="throw",n.arg=c.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=d(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,h;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,h):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function R(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(typeof t+" is not iterable")}return g.prototype=E,o(C,"constructor",{value:E,configurable:!0}),o(E,"constructor",{value:g,configurable:!0}),g.displayName=c(E,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,c(e,u,"GeneratorFunction")),e.prototype=Object.create(C),e},t.awrap=function(e){return{__await:e}},S(q.prototype),c(q.prototype,l,(function(){return this})),t.AsyncIterator=q,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new q(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(C),c(C,u,"Generator"),c(C,a,(function(){return this})),c(C,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=R,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return l.type="throw",l.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),h}},t}function Y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,l=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(u=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return D(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?D(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var U=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],X=function(r){var n=r.form,o=r.name,i=r.label,a=r.maxLength,l=void 0===a?255:a,u=r.required,c=void 0!==u&&u,s=r.disabled,d=void 0!==s&&s,m=r.autofocus,f=void 0!==m&&m,p=r.showErrors,v=void 0===p||p,h=r.readonly,b=void 0!==h&&h,E=r.readonlyBackgroundColor,x=void 0===E?"#dddddd":E,y=r.bold,w=void 0!==y&&y,C=H(r,U),S=n.control,q=n.formState.errors;return e.createElement(g,{name:o,control:S,rules:{required:c,disabled:d},render:function(r){var n,a,u=r.field,s=u.onChange,m=u.onBlur,p=u.value;return e.createElement(t,N({required:c,label:i,value:p,onChange:s,onBlur:m,error:v&&Boolean(null===(n=q[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:v&&(null===(a=q[o])||void 0===a?void 0:a.message),variant:"outlined",disabled:d,autoFocus:f,slotProps:{input:{maxLength:l,readOnly:b,sx:{fontWeight:w?"bold":"",backgroundColor:b?x:""}}}},C))}})},$=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],Z=function(r){var n=r.form,o=r.name,i=void 0===o?"email":o,a=r.label,l=void 0===a?"E-mail":a,u=r.maxLength,c=void 0===u?255:u,s=r.required,d=void 0===s||s,m=r.disabled,f=void 0!==m&&m,p=r.autofocus,v=void 0!==p&&p,h=r.showErrors,b=void 0===h||h,E=r.readonly,x=void 0!==E&&E,y=r.readonlyBackgroundColor,w=void 0===y?"#dddddd":y,C=r.bold,S=void 0!==C&&C,q=H(r,$),W=n.control,L=n.formState.errors;return e.createElement(g,{name:i,control:W,rules:{required:d,disabled:f},render:function(r){var n,o,a=r.field,u=a.onChange,s=a.onBlur,m=a.value;return e.createElement(t,N({required:d,label:l,value:m,onChange:u,onBlur:s,error:b&&Boolean(null===(n=L[i])||void 0===n?void 0:n.message),fullWidth:!0,helperText:b&&(null===(o=L[i])||void 0===o?void 0:o.message),variant:"outlined",disabled:f,autoFocus:v,slotProps:{input:{maxLength:c,readOnly:x,sx:{fontWeight:S?"bold":"",backgroundColor:x?w:""}}}},q))}})},J=function(t){var n=t.label,o=void 0===n?"":n,i=t.color,a=void 0===i?"white":i,l=t.backgroundColor,u=void 0===l?"#888888":l,c=t.paddingX,s=void 0===c?"10px":c,d=t.paddingY,m=void 0===d?"5px":d,f=t.borderRadius,p=void 0===f?"10px":f,v=t.fontSize,h=void 0===v?"14px":v,b=t.width,g={text:{display:"inline-block",textAlign:"center",backgroundColor:u,paddingX:s,paddingY:m,borderRadius:p,width:void 0===b?"auto":b,color:a,fontSize:h}};return e.createElement(r,{sx:g.text},o)},Q=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors","size","readonly","readonlyBackgroundColor","bold"],ee=function(r){var o=r.form,i=r.name,a=r.label,l=r.required,u=void 0!==l&&l,c=r.disabled,s=void 0!==c&&c,d=r.options,m=void 0===d?[]:d,f=r.valueKey,p=void 0===f?"id":f,v=r.labelKey,h=void 0===v?"label":v,b=r.maxLength,E=void 0===b?255:b,x=r.autofocus,y=void 0!==x&&x,w=r.noOptionsText,C=void 0===w?"Δεν υπάρχουν επιλογές":w,S=r.showErrors,q=void 0===S||S,W=r.size,L=void 0===W?"medium":W,k=r.readonly,T=void 0!==k&&k,O=r.readonlyBackgroundColor,R=void 0===O?"#dddddd":O,V=r.bold,P=void 0!==V&&V,j=H(r,Q),z=Y(e.useState(null),2),B=z[0],K=z[1],D=o.watch(i);e.useEffect((function(){K(m.find((function(e){return e[p]===D}))||null)}),[D]);var F=o.control,I=o.formState.errors;return e.createElement(g,{name:i,control:F,rules:{required:u,disabled:s},render:function(r){var o=r.field,l=o.onChange,c=o.onBlur;return o.value,T?e.createElement(t,{size:L,label:a,fullWidth:!0,required:u,slotProps:{input:{maxLength:E,readOnly:T,sx:{fontWeight:P?"bold":"",backgroundColor:T?R:""}}},value:B?B.label:""}):e.createElement(n,{value:B,required:u,onChange:function(e,t){return l(t?t[p]:null)},options:m,isOptionEqualToValue:function(e,t){return e[p]===t[p]},noOptionsText:C,getOptionLabel:function(e){return e[h]},size:L,slotProps:{input:{maxLength:E,sx:{fontWeight:P?"bold":"",color:"red"}}},renderInput:function(r){var n,o;return e.createElement(t,N({label:a,required:u,disabled:s,autoFocus:y,size:L,error:q&&Boolean(null===(n=I[i])||void 0===n?void 0:n.message),onBlur:c,variant:"outlined",fullWidth:!0,helperText:q&&(null===(o=I[i])||void 0===o?void 0:o.message)},r,j))}})}})},te=function(e){return null==e||""===e},re=function(e){return null!=e&&""!==e},ne=function(e){return te(e)?"":new Intl.NumberFormat("el-GR",{style:"currency",currency:"EUR"}).format(e)},oe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!te(e))return new Intl.NumberFormat("el-GR",{minimumFractionDigits:t,maximumFractionDigits:t}).format(e)},ie=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors"],ae=function(r){var i=r.form,a=r.name,l=r.label,u=r.required,c=void 0!==u&&u,s=r.disabled,d=void 0!==s&&s,m=r.options,f=void 0===m?[]:m,p=r.valueKey,v=void 0===p?"id":p,h=r.labelKey,b=void 0===h?"label":h,E=r.maxLength,x=void 0===E?255:E,y=r.autofocus,w=void 0!==y&&y,C=r.noOptionsText,S=void 0===C?"Δεν υπάρχουν επιλογές":C,q=r.showErrors,W=void 0===q||q,L=H(r,ie),k=Y(e.useState([]),2),T=k[0],O=k[1],R=i.watch(a);e.useEffect((function(){O(f.filter((function(e){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return Boolean(t.find((function(t){return t[r]===e[r]})))}(e,R)})))}),[R]);var V=i.control,P=i.formState.errors;return e.createElement(g,{name:a,control:V,rules:{required:c,disabled:d},render:function(r){var i=r.field,u=i.onChange,s=i.onBlur;return i.value,e.createElement(n,{multiple:!0,value:T,required:c,onChange:function(e,t){return u(t)},options:f,isOptionEqualToValue:function(e,t){return e[v]===t[v]},noOptionsText:S,renderTags:function(t,r){return t.map((function(t,n){return e.createElement(o,N({variant:"outlined",label:t[b],size:"small"},r({index:n})))}))},renderInput:function(r){var n,o;return e.createElement(t,N({label:l,required:c,disabled:d,autoFocus:w,inputProps:{maxLength:x},error:W&&Boolean(null===(n=P[a])||void 0===n?void 0:n.message),onBlur:s,variant:"outlined",fullWidth:!0,helperText:W&&(null===(o=P[a])||void 0===o?void 0:o.message)},r,L))}})}})},le=["form","name","label","optionsUrl","renderOption","valueKey","labelKey","minChars","required","disabled","maxLength","autofocus","loadingText","noOptionsText","placeholder","size","onChange","showErrors","readonly","readonlyBackgroundColor","bold"],ue=e.forwardRef((function(r,o){var i=r.form,a=r.name,l=r.label,u=r.optionsUrl,c=r.renderOption,s=void 0===c?null:c,d=r.valueKey,m=void 0===d?"id":d,f=r.labelKey,p=void 0===f?"label":f,v=r.minChars,h=void 0===v?2:v,b=r.required,E=void 0!==b&&b,x=r.disabled,y=void 0!==x&&x,w=r.maxLength,C=void 0===w?255:w,q=r.autofocus,W=void 0!==q&&q,L=r.loadingText,k=void 0===L?"Ανάκτηση...":L,T=r.noOptionsText,O=void 0===T?"Δεν υπάρχουν επιλογές":T,R=r.placeholder,V=void 0===R?"":R,P=r.size,j=void 0===P?"medium":P,z=r.onChange,B=void 0===z?null:z,K=r.showErrors,D=void 0===K||K,F=r.readonly,M=void 0!==F&&F,_=r.readonlyBackgroundColor,A=void 0===_?"#dddddd":_,U=r.bold,X=void 0!==U&&U,$=H(r,le),Z=Y(e.useState(null),2),J=Z[0],Q=Z[1],ee=Y(e.useState([]),2),te=ee[0],re=ee[1],ne=Y(e.useState(!1),2),oe=ne[0],ie=ne[1];e.useImperativeHandle(o,(function(){return{setValue:function(e){function t(){return(t=I(G().mark((function t(){var r;return G().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return ie(!0),t.next=3,S.get("".concat(u,"?id=").concat(e));case 3:r=t.sent,re(r.data),Q(r.data.find((function(e){return e[m]===i.getValues(a)}))||null),ie(!1);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}i.setValue(a,e),function(){t.apply(this,arguments)}()}}}));var ae=i.control,ue=i.formState.errors;e.useEffect((function(){if(i.getValues(a)){var e=function(){var e=I(G().mark((function e(){var t;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ie(!0),e.next=3,S.get("".concat(u,"?id=").concat(i.getValues(a)));case 3:t=e.sent,re(t.data),Q(t.data.find((function(e){return e[m]===i.getValues(a)}))||null),ie(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}}),[]);var ce=function(){var e=I(G().mark((function e(t,r){var n;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r||re([]),!(r.length<h)){e.next=3;break}return e.abrupt("return");case 3:return ie(!0),e.next=6,S.get("".concat(u,"?id=").concat(t||"","&token=").concat(r||""));case 6:n=e.sent,re(n.data),ie(!1);case 9:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),se=useMemo((function(){return e=function(e,t,r){var n;"input"===r&&(n=t,ce(i.getValues(a),n))},t=300,function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r&&clearTimeout(r),r=setTimeout((function(){e.apply(void 0,o)}),t)};var e,t,r}),[]);return e.createElement(g,{name:a,control:ae,rules:{required:E,disabled:y},render:function(r){var o=r.field,i=o.onChange,u=o.onBlur;return o.value,M?e.createElement(t,{size:j,label:l,fullWidth:!0,required:E,slotProps:{input:{maxLength:C,readOnly:M,sx:{fontWeight:X?"bold":"",backgroundColor:M?A:""}}},value:J?J.label:""}):e.createElement(n,{value:J,options:te,onInputChange:se,onChange:function(e,t){Q(t),i(t?t[m]:null),B&&B(t?t[m]:null)},isOptionEqualToValue:function(e,t){return e[m]===t[m]},getOptionLabel:function(e){return e[p]},filterOptions:function(e){return e},noOptionsText:O,loadingText:k,loading:oe,required:E,size:j,renderInput:function(r){var n,o;return e.createElement(t,N({label:l,required:E,disabled:y,autoFocus:W,placeholder:V,error:D&&Boolean(null===(n=ue[a])||void 0===n?void 0:n.message),onBlur:u,variant:"outlined",fullWidth:!0,helperText:D&&(null===(o=ue[a])||void 0===o?void 0:o.message),size:j,maxLength:C},r,$))},renderOption:function(t,r,n){return s?s(t,r,n):e.createElement("li",N({},t,{key:r[m]}),r[p])}})}})})),ce=["form","name","label","rows","required","disabled","autofocus","showErrors"],se=function(r){var n=r.form,o=r.name,i=r.label,a=r.rows,l=void 0===a?5:a,u=r.required,c=void 0!==u&&u,s=r.disabled,d=void 0!==s&&s,m=r.autofocus,f=void 0!==m&&m,p=r.showErrors,v=void 0===p||p,h=H(r,ce),b=n.control,E=n.formState.errors;return e.createElement(g,{name:o,control:b,rules:{required:c,disabled:d},render:function(r){var n,a,u=r.field,s=u.onChange,m=u.onBlur,p=u.value;return e.createElement(t,N({required:c,label:i,value:p,multiline:!0,minRows:l,maxRows:l,onChange:s,onBlur:m,error:v&&Boolean(null===(n=E[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:v&&(null===(a=E[o])||void 0===a?void 0:a.message),variant:"outlined",disabled:d,autoFocus:f},h))}})},de=["form","name","label","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],me=function(r){var n=r.form,o=r.name,i=r.label,a=r.required,l=void 0!==a&&a,u=r.disabled,c=void 0!==u&&u;r.autofocus;var s=r.showErrors,d=void 0===s||s,m=r.readonly,f=void 0!==m&&m,p=r.readonlyBackgroundColor,v=void 0===p?"#dddddd":p,h=r.bold,b=void 0!==h&&h,E=H(r,de),x=n.control,y=n.formState.errors,w=function(e,t){""===e.value?n.setValue(o,null):n.setValue(o,e.floatValue)};return e.createElement(g,{name:o,control:x,rules:{required:l,disabled:c},render:function(r){var n,a,u=r.field;u.onChange,u.onBlur;var s=u.value;return e.createElement(q,N({customInput:t,variant:"outlined",label:i,required:l,disabled:c,value:s,thousandSeparator:".",decimalSeparator:",",decimalScale:2,fixedDecimalScale:!0,allowNegative:!1,onValueChange:w,error:d&&Boolean(null===(n=y[o])||void 0===n?void 0:n.message),helperText:d&&(null===(a=y[o])||void 0===a?void 0:a.message),fullWidth:!0,slotProps:{input:{readOnly:f,sx:{fontWeight:b?"bold":"",backgroundColor:f?v:""}}}},E))}})},fe=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],pe=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,a=void 0!==i&&i,l=t.disabled,u=void 0!==l&&l;t.autofocus;var c=t.showErrors,s=void 0===c||c,d=t.ampm,m=void 0!==d&&d,f=t.singleTimeColumn,p=void 0===f||f,v=t.hoursStep,h=void 0===v?1:v,b=t.minutesStep,E=void 0===b?15:b,x=t.secondsStep,y=void 0===x?30:x,w=H(t,fe),S=r.control,q=r.formState.errors;return e.createElement(L,{dateAdapter:W,adapterLocale:V,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"},fieldClearLabel:"Καθαρισμός"}},e.createElement(g,{name:n,control:S,rules:{required:a,disabled:u},render:function(t){var r,i,l=t.field;return e.createElement(k,{label:o,value:l.value?C(l.value):null,format:"dd/MM/yyyy HH:mm",inputFormat:!0,views:p?["year","month","day","hours"]:["year","month","day","hours","minutes"],ampm:m,onChange:function(e){return l.onChange(e)},viewRenderers:p?{hours:T}:null,timeSteps:{hours:h,minutes:E,seconds:y},slotProps:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:A(A({},w),{},{required:a,error:s&&Boolean(null===(r=q[n])||void 0===r?void 0:r.message),helperText:s&&(null===(i=q[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},ve=["form","name","label","required","disabled","autofocus","showErrors"],he=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,a=void 0!==i&&i,l=t.disabled,u=void 0!==l&&l;t.autofocus;var c=t.showErrors,s=void 0===c||c,d=H(t,ve),m=r.control,f=r.formState.errors;return e.createElement(L,{dateAdapter:W,adapterLocale:V,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldClearLabel:"Καθαρισμός"}},e.createElement(g,{name:n,control:m,rules:{required:a,disabled:u},render:function(t){var r,i,l=t.field;return e.createElement(O,{label:o,value:l.value?C(l.value):null,format:"dd/MM/yyyy",inputFormat:!0,onChange:function(e){return l.onChange(e)},slotProps:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:A(A({},d),{},{required:a,error:s&&Boolean(null===(r=f[n])||void 0===r?void 0:r.message),helperText:s&&(null===(i=f[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},be=["form","name","label","allowNegative","required","disabled","autofocus","showErrors"],ge=function(r){var n=r.form,o=r.name,i=r.label,a=r.allowNegative,l=void 0!==a&&a,u=r.required,c=void 0!==u&&u,s=r.disabled,d=void 0!==s&&s,m=r.autofocus,f=void 0!==m&&m,p=r.showErrors,v=void 0===p||p,h=H(r,be),b=n.control,E=n.formState.errors,x=function(e,t){""===e.value?n.setValue(o,null):n.setValue(o,e.floatValue)};return e.createElement(g,{name:o,control:b,rules:{required:c,disabled:d},render:function(r){var n,a,u=r.field;u.onChange,u.onBlur;var s=u.value;return e.createElement(q,N({customInput:t,variant:"outlined",label:i,required:c,disabled:d,value:s,thousandSeparator:!1,decimalSeparator:",",decimalScale:0,fixedDecimalScale:!0,allowNegative:l,onValueChange:x,error:v&&Boolean(null===(n=E[o])||void 0===n?void 0:n.message),helperText:v&&(null===(a=E[o])||void 0===a?void 0:a.message),fullWidth:!0,autoFocus:f},h))}})},Ee=["form","name","label","required","disabled","showErrors"],xe=function(r){var n=r.form,o=r.name,l=r.label,u=r.required,c=void 0!==u&&u,s=r.disabled,d=void 0!==s&&s,m=r.showErrors,f=void 0===m||m,p=H(r,Ee),v=Y(e.useState(),2),h=v[0],b=v[1],E=e.useRef(null),x=n.control,y=n.formState.errors,w=function(){E.current.value=null,E.current.click()};return e.createElement(e.Fragment,null,e.createElement(g,{name:o,control:x,rules:{required:c,disabled:d},render:function(r){var u,s,m=r.field;return m.onChange,m.onBlur,m.value,e.createElement(t,N({sx:{input:{cursor:"pointer"}},onClick:w,required:c,label:l,value:h?h.name:"",error:f&&Boolean(null===(u=y[o])||void 0===u?void 0:u.message),fullWidth:!0,helperText:f&&(null===(s=y[o])||void 0===s?void 0:s.message),variant:"outlined",disabled:d,InputProps:{endAdornment:h&&e.createElement(i,{position:"end"},e.createElement(a,{onClick:function(e){return function(e){e.stopPropagation(),b(null),n.setValue(o,null)}(e)}},e.createElement(P,null))),readOnly:!0}},p))}}),e.createElement("input",{type:"file",ref:E,style:{display:"none"},onChange:function(e){return function(e){b(e),n.setValue(o,e,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})}(e.currentTarget.files[0])}}))},ye=["form","name","label","ampm","hoursStep","minutesStep","secondsStep","singleTimeColumn","required","disabled","autofocus","showErrors"],we=function(t){var r=t.form,n=t.name,o=t.label,i=t.ampm,a=void 0!==i&&i,l=t.hoursStep,u=void 0===l?1:l,c=t.minutesStep,s=void 0===c?15:c,d=t.secondsStep,m=void 0===d?30:d,f=t.singleTimeColumn,p=void 0===f||f,v=t.required,h=void 0!==v&&v,b=t.disabled,E=void 0!==b&&b;t.autofocus;var x=t.showErrors,y=void 0===x||x,w=H(t,ye),S=r.control,q=r.formState.errors;return e.createElement(L,{dateAdapter:W,adapterLocale:V,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},e.createElement(g,{name:n,control:S,rules:{required:h,disabled:E},render:function(t){var r,i,l=t.field;return e.createElement(R,{label:o,value:l.value?C(l.value):null,format:"HH:mm",inputFormat:!0,views:p?["hours"]:["hours","minutes"],ampm:a,onChange:function(e){return l.onChange(e)},viewRenderers:p?{hours:T}:null,timeSteps:{hours:u,minutes:s,seconds:m},slotProps:{textField:A(A({},w),{},{required:h,error:y&&Boolean(null===(r=q[n])||void 0===r?void 0:r.message),helperText:y&&(null===(i=q[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},Ce=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.requiredMessage,L=void 0===W?"Υποχρεωτικό πεδίο":W,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,O=t.cancelLabel,R=void 0===O?"ΑΚΥΡΩΣΗ":O,V=t.maxLength,P=void 0===V?255:V,z=t.message,B=void 0===z?null:z,K=t.isLoading,D=void 0!==K&&K,F={text:a||""},I=y.object({text:q?y.string().max(P,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(P," χαρακτήρες")).required(L):y.string().max(P)}),M=E({defaultValues:F,resolver:x(I)});e.useEffect((function(){n&&(M.reset(F),M.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),B&&"string"==typeof B?e.createElement(r,{variant:"caption",color:"text.secondary"},B):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:M.handleSubmit((function(e){return b(e.text)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},B&&"string"!=typeof B&&e.createElement(d,{sx:{mb:2}},B),e.createElement(X,{form:M,name:"text",label:i,required:q,autofocus:!0,maxLength:P,sx:{mt:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},R),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},D?e.createElement(h,{size:20,sx:{color:"inherit"}}):T))))},Se=/^$|^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,qe=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.requiredMessage,L=void 0===W?"Υποχρεωτικό πεδίο":W,k=t.invalidMessage,T=void 0===k?"Μη έγκυρη μορφή email":k,O=t.okLabel,R=void 0===O?"ΚΑΤΑΧΩΡΗΣΗ":O,V=t.cancelLabel,P=void 0===V?"ΑΚΥΡΩΣΗ":V,z=t.maxLength,B=void 0===z?255:z,K=t.message,D=void 0===K?null:K,F=t.isLoading,I=void 0!==F&&F,M={email:a||""},N=y.object({email:q?y.string().matches(Se,T).required(L):y.string().matches(Se,T)}),_=E({defaultValues:M,resolver:x(N)});e.useEffect((function(){n&&(_.reset(M),_.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),D&&"string"==typeof D?e.createElement(r,{variant:"caption",color:"text.secondary"},D):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:_.handleSubmit((function(e){return b(e.email)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},D&&"string"!=typeof D&&e.createElement(d,{sx:{mb:2}},D),e.createElement(Z,{form:_,label:i,required:q,autofocus:!0,maxLength:B,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},P),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},I?e.createElement(h,{size:20,sx:{color:"inherit"}}):R))))};!function(e,t){void 0===t&&(t={});var r=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".chrome-picker {\r\n -webkit-box-shadow: none !important;\r\n -moz-box-shadow: none !important;\r\n box-shadow: none !important;\r\n}");var We=function(t){var r=t.open,n=t.onSubmit,o=t.onCancel,i=t.title,a=void 0===i?"Επιλογή Χρώματος":i,u=t.color,d=void 0===u?"#000000":u,m=t.pickerWidth,h=void 0===m?350:m,b=t.selectionTextColor,g=void 0===b?"white":b,E=t.paddingY,x=void 0===E?"10px":E,y=t.paddingX,C=void 0===y?"10px":y,S=t.okLabel,q=void 0===S?"ΚΑΤΑΧΩΡΗΣΗ":S,W=t.cancelLabel,L=void 0===W?"ΑΚΥΡΩΣΗ":W;t.isLoading;var k=Y(e.useState("#000000"),2),T=k[0],O=k[1];e.useEffect((function(){r&&O(d)}),[r,d]);return e.createElement(l,{open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),form.handleSubmit(n)())}},e.createElement(c,null,a),e.createElement(f,null,e.createElement(s,{gap:2},e.createElement(J,{color:g,backgroundColor:T,paddingX:C,paddingY:x,label:T}),e.createElement(w,{width:h,color:T,onChange:function(e){return O(e.hex)}}))),e.createElement(p,null,e.createElement(v,{color:"success",onClick:function(){return n(T)}},q),e.createElement(v,{color:"error",onClick:function(){return o()}},L)))},Le=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.options,C=void 0===w?[]:w,S=t.valueKey,q=void 0===S?"id":S,W=t.labelKey,L=void 0===W?"label":W,k=t.required,T=void 0===k||k,O=t.size,R=void 0===O?"sm":O,V=t.requiredMessage,P=void 0===V?"Υποχρεωτικό πεδίο":V,z=t.okLabel,B=void 0===z?"ΚΑΤΑΧΩΡΗΣΗ":z,K=t.cancelLabel,D=void 0===K?"ΑΚΥΡΩΣΗ":K,F=t.message,I=void 0===F?null:F,M=t.isLoading,N=void 0!==M&&M,_={field:a||null},A=y.object({field:T?y.string().required(P):y.string().nullable()}),H=E({defaultValues:_,resolver:x(A)});e.useEffect((function(){n&&(H.reset(_),H.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:R,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),I&&"string"==typeof I?e.createElement(r,{variant:"caption",color:"text.secondary"},I):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:H.handleSubmit((function(e){return b(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},e.createElement(ee,{form:H,name:"field",label:i,options:C,valueKey:q,labelKey:L,required:T,autofocus:!0,size:"medium",sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},N?e.createElement(h,{size:20,sx:{color:"inherit"}}):B))))},ke=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=void 0===a?[]:a,g=t.onSubmit,w=t.onCancel,C=t.options,S=void 0===C?[]:C,q=t.valueKey,W=void 0===q?"id":q,L=t.labelKey,k=void 0===L?"label":L,T=t.required,O=void 0===T||T,R=t.size,V=void 0===R?"sm":R,P=t.requiredMessage,z=void 0===P?"Επιλέξτε τουλάχιστον μία τιμή":P,B=t.okLabel,K=void 0===B?"ΚΑΤΑΧΩΡΗΣΗ":B,D=t.cancelLabel,F=void 0===D?"ΑΚΥΡΩΣΗ":D,I=t.message,M=void 0===I?null:I,N=t.isLoading,_=void 0!==N&&N,A={field:b||[]},H=y.object({field:O?y.array().min(1,z):y.array()}),G=E({defaultValues:A,resolver:x(H)});e.useEffect((function(){n&&(G.reset(A),G.clearErrors())}),[n,b]);return e.createElement(l,{fullWidth:!0,maxWidth:V,open:n,onClose:function(e,t){"escapeKeyDown"===t&&w()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),M&&"string"==typeof M?e.createElement(r,{variant:"caption",color:"text.secondary"},M):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:G.handleSubmit((function(e){return g(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},M&&"string"!=typeof M&&e.createElement(d,{sx:{mb:2}},M),e.createElement(ae,{form:G,name:"field",label:i,options:S,valueKey:W,labelKey:k,required:O,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),w()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},F),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},_?e.createElement(h,{size:20,sx:{color:"inherit"}}):K))))},Te=function(t){var r=t.open,n=t.title,o=t.message,i=t.onConfirm,a=t.onCancel,s=t.confirmText,m=void 0===s?"ΕΠΙΒΕΒΑΙΩΣΗ":s,g=t.cancelText,E=void 0===g?"ΑΚΥΡΩΣΗ":g,x=t.isLoading,y=void 0!==x&&x,w=t.type,C=void 0===w?"warning":w,S={warning:{color:"warning.main",icon:e.createElement(z,{sx:{fontSize:40}})},error:{color:"error.main",icon:e.createElement(B,{sx:{fontSize:40}})},success:{color:"success.main",icon:e.createElement(K,{sx:{fontSize:40}})}}[C]||{color:"primary.main",icon:null};return e.createElement(l,{open:r,onClose:function(e,t){"backdropClick"!==t&&a()},slots:{transition:u},slotProps:{backdrop:{sx:{backgroundColor:"rgba(0, 0, 0, 0.4)",backdropFilter:"blur(4px)"}},paper:{sx:{borderRadius:4,padding:1,maxWidth:400,textAlign:"center",backgroundImage:"none"}}}},e.createElement(d,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:3}},e.createElement(d,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:70,height:70,bgcolor:"".concat(S.color,"20"),color:S.color,borderRadius:"50%",mb:2}},S.icon),e.createElement(c,{sx:{fontWeight:800,fontSize:"1.35rem",pt:0,pb:1}},n)),e.createElement(f,null,e.createElement(b,{sx:{color:"text.secondary",fontWeight:500,lineHeight:1.6}},o)),e.createElement(p,{sx:{justifyContent:"center",gap:2,px:3,pb:3,mt:1}},e.createElement(v,{fullWidth:!0,variant:"text",color:"inherit",onClick:a,sx:{borderRadius:3,fontWeight:700,color:"text.disabled"}},E),e.createElement(v,{fullWidth:!0,variant:"contained",disableElevation:!0,color:"error"===C?"error":"primary",onClick:i,sx:{borderRadius:3,fontWeight:700,py:1}},y?e.createElement(h,{size:20,sx:{color:"inherit"}}):m)))},Oe=function(t){var n=t.open,o=t.title,i=t.label,a=t.message,b=void 0===a?null:a,g=t.value,w=t.onSubmit,C=t.onCancel,S=t.size,q=void 0===S?"sm":S,W=t.rows,L=void 0===W?5:W,k=t.required,T=void 0!==k&&k,O=t.requiredMessage,R=void 0===O?"Υποχρεωτικό πεδίο":O,V=t.okLabel,P=void 0===V?"ΚΑΤΑΧΩΡΗΣΗ":V,z=t.cancelLabel,B=void 0===z?"ΑΚΥΡΩΣΗ":z,K=t.isLoading,D=void 0!==K&&K,F={notes:g||""},I=y.object({notes:T?y.string().required(R):y.string()}),M=E({defaultValues:F,resolver:x(I)});e.useEffect((function(){n&&(M.reset(F),M.clearErrors())}),[n,g]);return e.createElement(l,{fullWidth:!0,maxWidth:q,open:n,onClose:function(e,t){"escapeKeyDown"===t&&C()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),b&&"string"==typeof b?e.createElement(r,{variant:"caption",color:"text.secondary"},b):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:M.handleSubmit((function(e){return w(e.notes)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},b&&"string"!=typeof b&&e.createElement(d,{sx:{mb:2}},b),e.createElement(se,{form:M,name:"notes",label:i,required:T,rows:L,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),C()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},B),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},D?e.createElement(h,{size:20,sx:{color:"inherit"}}):P))))},Re=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.minValue,L=void 0===W?null:W,k=t.maxValue,T=void 0===k?null:k,O=t.requiredMessage,R=void 0===O?"Υποχρεωτικό πεδίο":O,V=t.okLabel,P=void 0===V?"ΚΑΤΑΧΩΡΗΣΗ":V,z=t.cancelLabel,B=void 0===z?"ΑΚΥΡΩΣΗ":z,K=t.message,D=void 0===K?null:K,F=t.isLoading,I=void 0!==F&&F,M={poso:re(a)?a:null},N=y.object({poso:y.number().when([],{is:function(e){return q},then:function(e){return e.required(R)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==L},then:function(e){return e.min(L,"Το ποσό πρέπει να είναι μεγαλύτερο ή ίσο από ".concat(ne(L)))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==T},then:function(e){return e.max(T,"Το ποσό πρέπει να είναι μικρότερο ή ίσο από ".concat(ne(T)))},otherwise:function(e){return e}})}),_=E({defaultValues:M,resolver:x(N)});e.useEffect((function(){n&&(_.reset(M),_.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),D&&"string"==typeof D?e.createElement(r,{variant:"caption",color:"text.secondary"},D):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:_.handleSubmit((function(e){return b(e.poso)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},e.createElement(me,{form:_,name:"poso",label:i,required:q,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},B),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},I?e.createElement(h,{size:20,sx:{color:"inherit"}}):P))))},Ve=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.requiredMessage,L=void 0===W?"Υποχρεωτικό πεδίο":W,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,O=t.cancelLabel,R=void 0===O?"ΑΚΥΡΩΣΗ":O,V=t.message,P=void 0===V?null:V,z=t.isLoading,B=void 0!==z&&z,K={datetime:a},D=y.object({datetime:q?y.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").required(L):y.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").nullable()}),F=E({defaultValues:K,resolver:x(D)});e.useEffect((function(){n&&(F.reset(K),F.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),P&&"string"==typeof P?e.createElement(r,{variant:"caption",color:"text.secondary"},P):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:F.handleSubmit((function(e){return b(e.datetime)})),noValidate:!0},e.createElement(f,null,P&&"string"!=typeof P&&e.createElement(d,{sx:{mb:2}},P),e.createElement(pe,{form:F,name:"datetime",label:i,required:q,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},R),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(h,{size:20,sx:{color:"inherit"}}):T))))},Pe=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.requiredMessage,L=void 0===W?"Υποχρεωτικό πεδίο":W,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,O=t.cancelLabel,R=void 0===O?"ΑΚΥΡΩΣΗ":O,V=t.message,P=void 0===V?null:V,z=t.isLoading,B=void 0!==z&&z,K={datetime:a},D=y.object({datetime:q?y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(L):y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").nullable()}),F=E({defaultValues:K,resolver:x(D)});e.useEffect((function(){n&&(F.reset(K),F.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),P&&"string"==typeof P?e.createElement(r,{variant:"caption",color:"text.secondary"},P):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:F.handleSubmit((function(e){return b(e.datetime)})),noValidate:!0},e.createElement(f,null,P&&"string"!=typeof P&&e.createElement(d,{sx:{mb:2}},P),e.createElement(he,{form:F,name:"datetime",label:i,required:q,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},R),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(h,{size:20,sx:{color:"inherit"}}):T))))},je=[{id:!0,label:"ΝΑΙ"},{id:!1,label:"ΟΧΙ"}],ze=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,u=t.onSubmit,s=t.onCancel,d=t.required,m=void 0===d||d,h=t.info,b=void 0===h?"":h,g=t.size,w=void 0===g?"sm":g,C=t.requiredMessage,S=void 0===C?"Υποχρεωτικό πεδίο":C,q=t.okLabel,W=void 0===q?"ΚΑΤΑΧΩΡΗΣΗ":q,L=t.cancelLabel,k=void 0===L?"ΑΚΥΡΩΣΗ":L,T={field:a||null},O=y.object({field:m?y.boolean().required(S):y.boolean().nullable()}),R=E({defaultValues:T,resolver:x(O)});return e.useEffect((function(){n&&(R.clearErrors(),R.setValue("field",a,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[n,a]),e.createElement(l,{fullWidth:!0,maxWidth:w,open:n,onClose:function(){}},e.createElement(c,null,o),e.createElement(f,null,b&&e.createElement(r,null,b),e.createElement(ee,{form:R,name:"field",label:i,options:je,valueKey:"id",labelKey:"label",required:m,autofocus:!0,size:"medium",sx:{marginTop:2}})),e.createElement(p,null,e.createElement(v,{color:"success",onClick:R.handleSubmit((function(e){return u(e.field)}))},W),e.createElement(v,{color:"error",onClick:function(){return s()}},k)))},Be=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,a=t.onSubmit,u=t.onCancel,s=t.allowNegative,d=void 0!==s&&s,m=t.required,h=void 0===m||m,b=t.requiredMessage,g=void 0===b?"Υποχρεωτικό πεδίο":b,w=t.size,C=void 0===w?"sm":w,S=t.minValue,q=void 0===S?null:S,W=t.maxValue,L=void 0===W?null:W,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,O=t.cancelLabel,R=void 0===O?"ΑΚΥΡΩΣΗ":O;t.isLoading;var V={num:re(i)?i:null},P=y.object({num:y.number().when([],{is:function(e){return h},then:function(e){return e.required(g)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==q},then:function(e){return e.min(q,"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση από ".concat(q))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==L},then:function(e){return e.max(L,"Η τιμή πρέπει να είναι μικρότερη ή ίση από ".concat(L))},otherwise:function(e){return e}})}),j=E({defaultValues:V,resolver:x(P)});return e.useEffect((function(){r&&(j.clearErrors(),j.setValue("num",re(i)?i:null,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(l,{fullWidth:!0,maxWidth:C,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),j.handleSubmit((function(e){return a(e.num)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(ge,{form:j,name:"num",label:o,required:h,autofocus:!0,allowNegative:d,sx:{marginTop:2}})),e.createElement(p,null,e.createElement(v,{color:"success",onClick:j.handleSubmit((function(e){return a(e.num)}))},T),e.createElement(v,{color:"error",onClick:function(){return u()}},R)))},Ke=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,a=t.decimals,u=void 0===a?2:a,s=t.minValue,d=void 0===s?null:s,m=t.maxValue,h=void 0===m?null:m,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.requiredMessage,L=void 0===W?"Υποχρεωτικό πεδίο":W,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,O=t.cancelLabel,R=void 0===O?"ΑΚΥΡΩΣΗ":O;t.isLoading;var V={field:re(i)?i:null},P=y.object({field:y.number().when([],{is:function(e){return q},then:function(e){return e.required(L)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==d},then:function(e){return e.min(d,"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση από ".concat(oe(d,u)))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==h},then:function(e){return e.max(h,"Η τιμή πρέπει να είναι μικρότερη ή ίση από ".concat(oe(h,u)))},otherwise:function(e){return e}})}),j=E({defaultValues:V,resolver:x(P)});return e.useEffect((function(){r&&(j.clearErrors(),j.setValue("field",re(i)?i:null,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(l,{fullWidth:!0,maxWidth:C,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),j.handleSubmit((function(e){return b(e.field)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(me,{form:j,name:"field",label:o,required:q,autofocus:!0,sx:{marginTop:2}})),e.createElement(p,null,e.createElement(v,{color:"success",onClick:j.handleSubmit((function(e){return b(e.field)}))},T),e.createElement(v,{color:"error",onClick:function(){return g()}},R)))},De=function(t){var r=t.open,n=t.title,o=t.message,i=t.onClose,a=t.closeText,u=void 0===a?"ΟΚ":a;return e.createElement(l,{open:r,onClose:function(){}},e.createElement(c,null,n),e.createElement(f,null,e.createElement(b,null,o)),e.createElement(p,null,e.createElement(v,{color:"primary",onClick:function(e){e.stopPropagation(),i()}},u)))},Fe=function(t){var r=t.open,n=t.title,o=void 0===n?"Νέο Αρχείο":n,i=t.description,a=void 0===i||i,u=t.descriptionLabel,d=void 0===u?"Περιγραφή Αρχείου":u,m=t.fileSelectLabel,h=void 0===m?"Επιλογή Αρχείου":m,b=t.maxFileName,g=void 0===b?255:b,w=t.onSubmit,C=t.onCancel;t.isLoading;var S=y.object({descr:a?y.string().required("Παρακαλώ συμπληρώστε την περιγραφή του αρχείου").max(g,"Η περιγραφή δεν πρέπει να υπερβαίνει τους ".concat(g," χαρακτήρες")):y.string(),filename:y.mixed().required("Παρακαλώ επιλέξτε ένα αρχείο")}),q=E({defaultValues:{descr:"",filename:null},resolver:x(S)});return e.useEffect((function(){r&&(q.clearErrors(),q.setValue("descr",""),q.setValue("filename",null))}),[r]),e.createElement(l,{maxWidth:"sm",fullWidth:!0,open:r,onClose:function(){}},e.createElement(c,null,o),e.createElement(f,null,e.createElement(s,{sx:{marginTop:2},gap:3},a&&e.createElement(X,{form:q,name:"descr",label:d,required:!0,autofocus:!0}),e.createElement(xe,{form:q,name:"filename",label:h,required:!0}))),e.createElement(p,null,e.createElement(v,{color:"success",onClick:q.handleSubmit(w)},"ΚΑΤΑΧΩΡΗΣΗ"),e.createElement(v,{color:"error",onClick:function(){return C()}},"ΑΚΥΡΩΣΗ")))},Ie=function(t){var n=t.open,o=t.title,i=t.label,a=t.optionsUrl,b=t.value,g=t.onSubmit,w=t.onCancel,C=t.valueKey,S=void 0===C?"id":C,q=t.labelKey,W=void 0===q?"label":q,L=t.required,k=void 0===L||L,T=t.size,O=void 0===T?"sm":T,R=t.requiredMessage,V=void 0===R?"Υποχρεωτικό πεδίο":R,P=t.minChars,z=void 0===P?1:P,B=t.okLabel,K=void 0===B?"ΚΑΤΑΧΩΡΗΣΗ":B,D=t.cancelLabel,F=void 0===D?"ΑΚΥΡΩΣΗ":D,I=t.message,M=void 0===I?null:I,N=t.isLoading,_=void 0!==N&&N,A={field:b||null},H=y.object({field:k?y.string().required(V):y.string().nullable()}),G=E({defaultValues:A,resolver:x(H)});e.useEffect((function(){n&&(G.reset(A),G.clearErrors())}),[n,b]);return e.createElement(l,{fullWidth:!0,maxWidth:O,open:n,onClose:function(e,t){"escapeKeyDown"===t&&w()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),M&&"string"==typeof M?e.createElement(r,{variant:"caption",color:"text.secondary"},M):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:G.handleSubmit((function(e){return g(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},M&&"string"!=typeof M&&e.createElement(d,{sx:{mb:2}},M),e.createElement(ue,{form:G,name:"field",label:i,optionsUrl:a,minChars:z,valueKey:S,labelKey:W,required:k,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),w()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},F),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},_?e.createElement(h,{size:20,sx:{color:"inherit"}}):K))))},Me=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,a=t.onSubmit,u=t.onCancel,s=t.size,d=void 0===s?"sm":s,m=t.required,h=void 0===m||m,b=t.requiredMessage,g=void 0===b?"Υποχρεωτικό πεδίο":b,w=t.okLabel,C=void 0===w?"ΚΑΤΑΧΩΡΗΣΗ":w,S=t.cancelLabel,q=void 0===S?"ΑΚΥΡΩΣΗ":S,W={datetime:i},L=y.object({datetime:h?y.date().typeError("Μη έγκυρη μορφή ώρας").required(g):y.date().typeError("Μη έγκυρη μορφή ώρας")}),k=E({defaultValues:W,resolver:x(L)});return e.useEffect((function(){r&&(k.clearErrors(),k.setValue("datetime",i,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(l,{fullWidth:!0,maxWidth:d,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),k.handleSubmit((function(e){return a(e.datetime)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(we,{form:k,name:"datetime",label:o,required:h,autofocus:!0,sx:{marginTop:2}})),e.createElement(p,null,e.createElement(v,{color:"success",onClick:k.handleSubmit((function(e){return a(e.datetime)}))},C),e.createElement(v,{color:"error",onClick:function(){return u()}},q)))},Ne=function(t){var n=t.open,o=t.title,i=t.registrationNumber,a=t.registrationDate,b=t.registrationNumberLabel,g=void 0===b?"Αριθμός Πρωτοκόλλου":b,w=t.registrationDateLabel,C=void 0===w?"Ημερομηνία Πρωτοκόλλου":w,S=t.onSubmit,q=t.onCancel,W=t.size,L=void 0===W?"sm":W,k=t.required,T=void 0!==k&&k,O=t.registrationNumberRequiredMessage,R=void 0===O?"Συμπληρώστε τον αριθμό πρωτοκόλλου":O,V=t.registrationDateRequiredMessage,P=void 0===V?"Συμπληρώστε ή επιλέξτε την ημερομηνία πρωτοκόλλου":V,z=t.okLabel,B=void 0===z?"ΚΑΤΑΧΩΡΗΣΗ":z,K=t.cancelLabel,D=void 0===K?"ΑΚΥΡΩΣΗ":K,F=t.registrationNumberMaxLength,I=void 0===F?255:F,M=t.message,N=void 0===M?null:M,_=t.isLoading,A=void 0!==_&&_,H=e.useMemo((function(){return{registration_number:i||"",registration_date:a||null}}),[i,a]),G=y.object({registration_number:T?y.string().max(I,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(I," χαρακτήρες")).required(R):y.string().max(I,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(I," χαρακτήρες")),registration_date:T?y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(P):y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").nullable()}),Y=E({defaultValues:H,resolver:x(G)});e.useEffect((function(){n&&(Y.reset(H),Y.clearErrors())}),[n,H]);return e.createElement(l,{fullWidth:!0,maxWidth:L,open:n,onClose:function(e,t){"escapeKeyDown"===t&&q()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),N&&"string"==typeof N?e.createElement(r,{variant:"caption",color:"text.secondary"},N):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:Y.handleSubmit((function(e){return S(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},N&&"string"!=typeof N&&e.createElement(d,{sx:{mb:2}},N),e.createElement(s,{direction:"column",spacing:2.5},e.createElement(X,{form:Y,name:"registration_number",label:g,required:T,autofocus:!0,maxLength:I,sx:{mt:1}}),e.createElement(he,{form:Y,name:"registration_date",label:C,required:T,sx:{mt:1}}))),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),q()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},A?e.createElement(h,{size:20,sx:{color:"inherit"}}):B))))};export{Ie as AutocompleteApiModalForm,Le as AutocompleteModalForm,ke as AutocompleteMultiModalForm,Te as ConfirmationDialog,Re as CurrencyModalForm,Pe as DateModalForm,Ve as DatetimeModalForm,Ke as DecimalModalForm,qe as EmailModalForm,Be as IntegerModalForm,De as MessageDialog,Oe as NotesModalForm,We as PickColorModalForm,Ne as RegistrationModalForm,Fe as SelectFileModalForm,Ce as TextModalForm,Me as TimeModalForm,ze as YesNoModalForm};
1
+ import e from"react";import{TextField as t,Typography as r,Autocomplete as n,Chip as o,InputAdornment as i,IconButton as a,Dialog as l,Zoom as u,DialogTitle as c,Stack as s,Box as d,Divider as m,DialogContent as f,DialogActions as p,Button as v,CircularProgress as h,DialogContentText as b}from"@mui/material";import{Controller as g,useForm as E}from"react-hook-form";import{yupResolver as x}from"@hookform/resolvers/yup";import*as y from"yup";import{ChromePicker as w}from"react-color";import{toDate as C}from"date-fns";import"date-fns/locale";import S from"axios";import{NumericFormat as q}from"react-number-format";import{AdapterDateFns as W}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as L}from"@mui/x-date-pickers/LocalizationProvider";import{DateTimePicker as k,renderDigitalClockTimeView as T,DatePicker as O,TimePicker as R}from"@mui/x-date-pickers";import V from"date-fns/locale/el";import{Clear as P,EditNoteRounded as j}from"@mui/icons-material";import z from"@mui/icons-material/WarningAmberRounded";import B from"@mui/icons-material/ErrorOutlineRounded";import K from"@mui/icons-material/CheckCircleOutlineRounded";function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function F(e,t,r,n,o,i,a){try{var l=e[i](a),u=l.value}catch(e){return void r(e)}l.done?t(u):Promise.resolve(u).then(n,o)}function I(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){F(i,n,o,a,l,"next",e)}function l(e){F(i,n,o,a,l,"throw",e)}a(void 0)}))}}function M(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function N(){return N=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},N.apply(null,arguments)}function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){M(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function H(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function G(){G=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),l=new O(n||[]);return o(a,"_invoke",{value:W(e,r,l)}),a}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var m="suspendedStart",f="suspendedYield",p="executing",v="completed",h={};function b(){}function g(){}function E(){}var x={};c(x,a,(function(){return this}));var y=Object.getPrototypeOf,w=y&&y(y(R([])));w&&w!==r&&n.call(w,a)&&(x=w);var C=E.prototype=b.prototype=Object.create(x);function S(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function q(e,t){function r(o,i,a,l){var u=d(e[o],e,i);if("throw"!==u.type){var c=u.arg,s=c.value;return s&&"object"==typeof s&&n.call(s,"__await")?t.resolve(s.__await).then((function(e){r("next",e,a,l)}),(function(e){r("throw",e,a,l)})):t.resolve(s).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,l)}))}l(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function W(t,r,n){var o=m;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var l=n.delegate;if(l){var u=L(l,n);if(u){if(u===h)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=d(t,r,n);if("normal"===c.type){if(o=n.done?v:f,c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=v,n.method="throw",n.arg=c.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=d(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,h;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,h):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function R(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(typeof t+" is not iterable")}return g.prototype=E,o(C,"constructor",{value:E,configurable:!0}),o(E,"constructor",{value:g,configurable:!0}),g.displayName=c(E,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,c(e,u,"GeneratorFunction")),e.prototype=Object.create(C),e},t.awrap=function(e){return{__await:e}},S(q.prototype),c(q.prototype,l,(function(){return this})),t.AsyncIterator=q,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new q(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(C),c(C,u,"Generator"),c(C,a,(function(){return this})),c(C,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=R,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return l.type="throw",l.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),h}},t}function Y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,l=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(u=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return D(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?D(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var U=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],X=function(r){var n=r.form,o=r.name,i=r.label,a=r.maxLength,l=void 0===a?255:a,u=r.required,c=void 0!==u&&u,s=r.disabled,d=void 0!==s&&s,m=r.autofocus,f=void 0!==m&&m,p=r.showErrors,v=void 0===p||p,h=r.readonly,b=void 0!==h&&h,E=r.readonlyBackgroundColor,x=void 0===E?"#dddddd":E,y=r.bold,w=void 0!==y&&y,C=H(r,U),S=n.control,q=n.formState.errors;return e.createElement(g,{name:o,control:S,rules:{required:c,disabled:d},render:function(r){var n,a,u=r.field,s=u.onChange,m=u.onBlur,p=u.value;return e.createElement(t,N({required:c,label:i,value:p,onChange:s,onBlur:m,error:v&&Boolean(null===(n=q[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:v&&(null===(a=q[o])||void 0===a?void 0:a.message),variant:"outlined",disabled:d,autoFocus:f,slotProps:{input:{maxLength:l,readOnly:b,sx:{fontWeight:w?"bold":"",backgroundColor:b?x:""}}}},C))}})},$=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],Z=function(r){var n=r.form,o=r.name,i=void 0===o?"email":o,a=r.label,l=void 0===a?"E-mail":a,u=r.maxLength,c=void 0===u?255:u,s=r.required,d=void 0===s||s,m=r.disabled,f=void 0!==m&&m,p=r.autofocus,v=void 0!==p&&p,h=r.showErrors,b=void 0===h||h,E=r.readonly,x=void 0!==E&&E,y=r.readonlyBackgroundColor,w=void 0===y?"#dddddd":y,C=r.bold,S=void 0!==C&&C,q=H(r,$),W=n.control,L=n.formState.errors;return e.createElement(g,{name:i,control:W,rules:{required:d,disabled:f},render:function(r){var n,o,a=r.field,u=a.onChange,s=a.onBlur,m=a.value;return e.createElement(t,N({required:d,label:l,value:m,onChange:u,onBlur:s,error:b&&Boolean(null===(n=L[i])||void 0===n?void 0:n.message),fullWidth:!0,helperText:b&&(null===(o=L[i])||void 0===o?void 0:o.message),variant:"outlined",disabled:f,autoFocus:v,slotProps:{input:{maxLength:c,readOnly:x,sx:{fontWeight:S?"bold":"",backgroundColor:x?w:""}}}},q))}})},J=function(t){var n=t.label,o=void 0===n?"":n,i=t.color,a=void 0===i?"white":i,l=t.backgroundColor,u=void 0===l?"#888888":l,c=t.paddingX,s=void 0===c?"10px":c,d=t.paddingY,m=void 0===d?"5px":d,f=t.borderRadius,p=void 0===f?"10px":f,v=t.fontSize,h=void 0===v?"14px":v,b=t.width,g={text:{display:"inline-block",textAlign:"center",backgroundColor:u,paddingX:s,paddingY:m,borderRadius:p,width:void 0===b?"auto":b,color:a,fontSize:h}};return e.createElement(r,{sx:g.text},o)},Q=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors","size","readonly","readonlyBackgroundColor","bold"],ee=function(r){var o=r.form,i=r.name,a=r.label,l=r.required,u=void 0!==l&&l,c=r.disabled,s=void 0!==c&&c,d=r.options,m=void 0===d?[]:d,f=r.valueKey,p=void 0===f?"id":f,v=r.labelKey,h=void 0===v?"label":v,b=r.maxLength,E=void 0===b?255:b,x=r.autofocus,y=void 0!==x&&x,w=r.noOptionsText,C=void 0===w?"Δεν υπάρχουν επιλογές":w,S=r.showErrors,q=void 0===S||S,W=r.size,L=void 0===W?"medium":W,k=r.readonly,T=void 0!==k&&k,O=r.readonlyBackgroundColor,R=void 0===O?"#dddddd":O,V=r.bold,P=void 0!==V&&V,j=H(r,Q),z=Y(e.useState(null),2),B=z[0],K=z[1],D=o.watch(i);e.useEffect((function(){K(m.find((function(e){return e[p]===D}))||null)}),[D]);var F=o.control,I=o.formState.errors;return e.createElement(g,{name:i,control:F,rules:{required:u,disabled:s},render:function(r){var o=r.field,l=o.onChange,c=o.onBlur;return o.value,T?e.createElement(t,{size:L,label:a,fullWidth:!0,required:u,slotProps:{input:{maxLength:E,readOnly:T,sx:{fontWeight:P?"bold":"",backgroundColor:T?R:""}}},value:B?B.label:""}):e.createElement(n,{value:B,required:u,onChange:function(e,t){return l(t?t[p]:null)},options:m,isOptionEqualToValue:function(e,t){return e[p]===t[p]},noOptionsText:C,getOptionLabel:function(e){return e[h]},size:L,slotProps:{input:{maxLength:E,sx:{fontWeight:P?"bold":"",color:"red"}}},renderInput:function(r){var n,o;return e.createElement(t,N({label:a,required:u,disabled:s,autoFocus:y,size:L,error:q&&Boolean(null===(n=I[i])||void 0===n?void 0:n.message),onBlur:c,variant:"outlined",fullWidth:!0,helperText:q&&(null===(o=I[i])||void 0===o?void 0:o.message)},r,j))}})}})},te=function(e){return null==e||""===e},re=function(e){return null!=e&&""!==e},ne=function(e){return te(e)?"":new Intl.NumberFormat("el-GR",{style:"currency",currency:"EUR"}).format(e)},oe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!te(e))return new Intl.NumberFormat("el-GR",{minimumFractionDigits:t,maximumFractionDigits:t}).format(e)},ie=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors"],ae=function(r){var i=r.form,a=r.name,l=r.label,u=r.required,c=void 0!==u&&u,s=r.disabled,d=void 0!==s&&s,m=r.options,f=void 0===m?[]:m,p=r.valueKey,v=void 0===p?"id":p,h=r.labelKey,b=void 0===h?"label":h,E=r.maxLength,x=void 0===E?255:E,y=r.autofocus,w=void 0!==y&&y,C=r.noOptionsText,S=void 0===C?"Δεν υπάρχουν επιλογές":C,q=r.showErrors,W=void 0===q||q,L=H(r,ie),k=Y(e.useState([]),2),T=k[0],O=k[1],R=i.watch(a);e.useEffect((function(){O(f.filter((function(e){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return Boolean(t.find((function(t){return t[r]===e[r]})))}(e,R)})))}),[R]);var V=i.control,P=i.formState.errors;return e.createElement(g,{name:a,control:V,rules:{required:c,disabled:d},render:function(r){var i=r.field,u=i.onChange,s=i.onBlur;return i.value,e.createElement(n,{multiple:!0,value:T,required:c,onChange:function(e,t){return u(t)},options:f,isOptionEqualToValue:function(e,t){return e[v]===t[v]},noOptionsText:S,renderTags:function(t,r){return t.map((function(t,n){return e.createElement(o,N({variant:"outlined",label:t[b],size:"small"},r({index:n})))}))},renderInput:function(r){var n,o;return e.createElement(t,N({label:l,required:c,disabled:d,autoFocus:w,inputProps:{maxLength:x},error:W&&Boolean(null===(n=P[a])||void 0===n?void 0:n.message),onBlur:s,variant:"outlined",fullWidth:!0,helperText:W&&(null===(o=P[a])||void 0===o?void 0:o.message)},r,L))}})}})},le=["form","name","label","optionsUrl","renderOption","valueKey","labelKey","minChars","required","disabled","maxLength","autofocus","loadingText","noOptionsText","placeholder","size","onChange","showErrors","readonly","readonlyBackgroundColor","bold"],ue=e.forwardRef((function(r,o){var i=r.form,a=r.name,l=r.label,u=r.optionsUrl,c=r.renderOption,s=void 0===c?null:c,d=r.valueKey,m=void 0===d?"id":d,f=r.labelKey,p=void 0===f?"label":f,v=r.minChars,h=void 0===v?2:v,b=r.required,E=void 0!==b&&b,x=r.disabled,y=void 0!==x&&x,w=r.maxLength,C=void 0===w?255:w,q=r.autofocus,W=void 0!==q&&q,L=r.loadingText,k=void 0===L?"Ανάκτηση...":L,T=r.noOptionsText,O=void 0===T?"Δεν υπάρχουν επιλογές":T,R=r.placeholder,V=void 0===R?"":R,P=r.size,j=void 0===P?"medium":P,z=r.onChange,B=void 0===z?null:z,K=r.showErrors,D=void 0===K||K,F=r.readonly,M=void 0!==F&&F,_=r.readonlyBackgroundColor,A=void 0===_?"#dddddd":_,U=r.bold,X=void 0!==U&&U,$=H(r,le),Z=Y(e.useState(null),2),J=Z[0],Q=Z[1],ee=Y(e.useState([]),2),te=ee[0],re=ee[1],ne=Y(e.useState(!1),2),oe=ne[0],ie=ne[1];e.useImperativeHandle(o,(function(){return{setValue:function(e){function t(){return(t=I(G().mark((function t(){var r;return G().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return ie(!0),t.next=3,S.get("".concat(u,"?id=").concat(e));case 3:r=t.sent,re(r.data),Q(r.data.find((function(e){return e[m]===i.getValues(a)}))||null),ie(!1);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}i.setValue(a,e),function(){t.apply(this,arguments)}()}}}));var ae=i.control,ue=i.formState.errors;e.useEffect((function(){if(i.getValues(a)){var e=function(){var e=I(G().mark((function e(){var t;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ie(!0),e.next=3,S.get("".concat(u,"?id=").concat(i.getValues(a)));case 3:t=e.sent,re(t.data),Q(t.data.find((function(e){return e[m]===i.getValues(a)}))||null),ie(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}}),[]);var ce=function(){var e=I(G().mark((function e(t,r){var n;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r||re([]),!(r.length<h)){e.next=3;break}return e.abrupt("return");case 3:return ie(!0),e.next=6,S.get("".concat(u,"?id=").concat(t||"","&token=").concat(r||""));case 6:n=e.sent,re(n.data),ie(!1);case 9:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),se=e.useMemo((function(){return e=function(e,t,r){var n;"input"===r&&(n=t,ce(i.getValues(a),n))},t=300,function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r&&clearTimeout(r),r=setTimeout((function(){e.apply(void 0,o)}),t)};var e,t,r}),[]);return e.createElement(g,{name:a,control:ae,rules:{required:E,disabled:y},render:function(r){var o=r.field,i=o.onChange,u=o.onBlur;return o.value,M?e.createElement(t,{size:j,label:l,fullWidth:!0,required:E,slotProps:{input:{maxLength:C,readOnly:M,sx:{fontWeight:X?"bold":"",backgroundColor:M?A:""}}},value:J?J.label:""}):e.createElement(n,{value:J,options:te,onInputChange:se,onChange:function(e,t){Q(t),i(t?t[m]:null),B&&B(t?t[m]:null)},isOptionEqualToValue:function(e,t){return e[m]===t[m]},getOptionLabel:function(e){return e[p]},filterOptions:function(e){return e},noOptionsText:O,loadingText:k,loading:oe,required:E,size:j,renderInput:function(r){var n,o;return e.createElement(t,N({label:l,required:E,disabled:y,autoFocus:W,placeholder:V,error:D&&Boolean(null===(n=ue[a])||void 0===n?void 0:n.message),onBlur:u,variant:"outlined",fullWidth:!0,helperText:D&&(null===(o=ue[a])||void 0===o?void 0:o.message),size:j,maxLength:C},r,$))},renderOption:function(t,r,n){return s?s(t,r,n):e.createElement("li",N({},t,{key:r[m]}),r[p])}})}})})),ce=["form","name","label","rows","required","disabled","autofocus","showErrors"],se=function(r){var n=r.form,o=r.name,i=r.label,a=r.rows,l=void 0===a?5:a,u=r.required,c=void 0!==u&&u,s=r.disabled,d=void 0!==s&&s,m=r.autofocus,f=void 0!==m&&m,p=r.showErrors,v=void 0===p||p,h=H(r,ce),b=n.control,E=n.formState.errors;return e.createElement(g,{name:o,control:b,rules:{required:c,disabled:d},render:function(r){var n,a,u=r.field,s=u.onChange,m=u.onBlur,p=u.value;return e.createElement(t,N({required:c,label:i,value:p,multiline:!0,minRows:l,maxRows:l,onChange:s,onBlur:m,error:v&&Boolean(null===(n=E[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:v&&(null===(a=E[o])||void 0===a?void 0:a.message),variant:"outlined",disabled:d,autoFocus:f},h))}})},de=["form","name","label","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],me=function(r){var n=r.form,o=r.name,i=r.label,a=r.required,l=void 0!==a&&a,u=r.disabled,c=void 0!==u&&u;r.autofocus;var s=r.showErrors,d=void 0===s||s,m=r.readonly,f=void 0!==m&&m,p=r.readonlyBackgroundColor,v=void 0===p?"#dddddd":p,h=r.bold,b=void 0!==h&&h,E=H(r,de),x=n.control,y=n.formState.errors,w=function(e,t){""===e.value?n.setValue(o,null):n.setValue(o,e.floatValue)};return e.createElement(g,{name:o,control:x,rules:{required:l,disabled:c},render:function(r){var n,a,u=r.field;u.onChange,u.onBlur;var s=u.value;return e.createElement(q,N({customInput:t,variant:"outlined",label:i,required:l,disabled:c,value:s,thousandSeparator:".",decimalSeparator:",",decimalScale:2,fixedDecimalScale:!0,allowNegative:!1,onValueChange:w,error:d&&Boolean(null===(n=y[o])||void 0===n?void 0:n.message),helperText:d&&(null===(a=y[o])||void 0===a?void 0:a.message),fullWidth:!0,slotProps:{input:{readOnly:f,sx:{fontWeight:b?"bold":"",backgroundColor:f?v:""}}}},E))}})},fe=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],pe=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,a=void 0!==i&&i,l=t.disabled,u=void 0!==l&&l;t.autofocus;var c=t.showErrors,s=void 0===c||c,d=t.ampm,m=void 0!==d&&d,f=t.singleTimeColumn,p=void 0===f||f,v=t.hoursStep,h=void 0===v?1:v,b=t.minutesStep,E=void 0===b?15:b,x=t.secondsStep,y=void 0===x?30:x,w=H(t,fe),S=r.control,q=r.formState.errors;return e.createElement(L,{dateAdapter:W,adapterLocale:V,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"},fieldClearLabel:"Καθαρισμός"}},e.createElement(g,{name:n,control:S,rules:{required:a,disabled:u},render:function(t){var r,i,l=t.field;return e.createElement(k,{label:o,value:l.value?C(l.value):null,format:"dd/MM/yyyy HH:mm",inputFormat:!0,views:p?["year","month","day","hours"]:["year","month","day","hours","minutes"],ampm:m,onChange:function(e){return l.onChange(e)},viewRenderers:p?{hours:T}:null,timeSteps:{hours:h,minutes:E,seconds:y},slotProps:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:A(A({},w),{},{required:a,error:s&&Boolean(null===(r=q[n])||void 0===r?void 0:r.message),helperText:s&&(null===(i=q[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},ve=["form","name","label","required","disabled","autofocus","showErrors"],he=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,a=void 0!==i&&i,l=t.disabled,u=void 0!==l&&l;t.autofocus;var c=t.showErrors,s=void 0===c||c,d=H(t,ve),m=r.control,f=r.formState.errors;return e.createElement(L,{dateAdapter:W,adapterLocale:V,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldClearLabel:"Καθαρισμός"}},e.createElement(g,{name:n,control:m,rules:{required:a,disabled:u},render:function(t){var r,i,l=t.field;return e.createElement(O,{label:o,value:l.value?C(l.value):null,format:"dd/MM/yyyy",inputFormat:!0,onChange:function(e){return l.onChange(e)},slotProps:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:A(A({},d),{},{required:a,error:s&&Boolean(null===(r=f[n])||void 0===r?void 0:r.message),helperText:s&&(null===(i=f[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},be=["form","name","label","allowNegative","required","disabled","autofocus","showErrors"],ge=function(r){var n=r.form,o=r.name,i=r.label,a=r.allowNegative,l=void 0!==a&&a,u=r.required,c=void 0!==u&&u,s=r.disabled,d=void 0!==s&&s,m=r.autofocus,f=void 0!==m&&m,p=r.showErrors,v=void 0===p||p,h=H(r,be),b=n.control,E=n.formState.errors,x=function(e,t){""===e.value?n.setValue(o,null):n.setValue(o,e.floatValue)};return e.createElement(g,{name:o,control:b,rules:{required:c,disabled:d},render:function(r){var n,a,u=r.field;u.onChange,u.onBlur;var s=u.value;return e.createElement(q,N({customInput:t,variant:"outlined",label:i,required:c,disabled:d,value:s,thousandSeparator:!1,decimalSeparator:",",decimalScale:0,fixedDecimalScale:!0,allowNegative:l,onValueChange:x,error:v&&Boolean(null===(n=E[o])||void 0===n?void 0:n.message),helperText:v&&(null===(a=E[o])||void 0===a?void 0:a.message),fullWidth:!0,autoFocus:f},h))}})},Ee=["form","name","label","required","disabled","showErrors"],xe=function(r){var n=r.form,o=r.name,l=r.label,u=r.required,c=void 0!==u&&u,s=r.disabled,d=void 0!==s&&s,m=r.showErrors,f=void 0===m||m,p=H(r,Ee),v=Y(e.useState(),2),h=v[0],b=v[1],E=e.useRef(null),x=n.control,y=n.formState.errors,w=function(){E.current.value=null,E.current.click()};return e.createElement(e.Fragment,null,e.createElement(g,{name:o,control:x,rules:{required:c,disabled:d},render:function(r){var u,s,m=r.field;return m.onChange,m.onBlur,m.value,e.createElement(t,N({sx:{input:{cursor:"pointer"}},onClick:w,required:c,label:l,value:h?h.name:"",error:f&&Boolean(null===(u=y[o])||void 0===u?void 0:u.message),fullWidth:!0,helperText:f&&(null===(s=y[o])||void 0===s?void 0:s.message),variant:"outlined",disabled:d,InputProps:{endAdornment:h&&e.createElement(i,{position:"end"},e.createElement(a,{onClick:function(e){return function(e){e.stopPropagation(),b(null),n.setValue(o,null)}(e)}},e.createElement(P,null))),readOnly:!0}},p))}}),e.createElement("input",{type:"file",ref:E,style:{display:"none"},onChange:function(e){return function(e){b(e),n.setValue(o,e,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})}(e.currentTarget.files[0])}}))},ye=["form","name","label","ampm","hoursStep","minutesStep","secondsStep","singleTimeColumn","required","disabled","autofocus","showErrors"],we=function(t){var r=t.form,n=t.name,o=t.label,i=t.ampm,a=void 0!==i&&i,l=t.hoursStep,u=void 0===l?1:l,c=t.minutesStep,s=void 0===c?15:c,d=t.secondsStep,m=void 0===d?30:d,f=t.singleTimeColumn,p=void 0===f||f,v=t.required,h=void 0!==v&&v,b=t.disabled,E=void 0!==b&&b;t.autofocus;var x=t.showErrors,y=void 0===x||x,w=H(t,ye),S=r.control,q=r.formState.errors;return e.createElement(L,{dateAdapter:W,adapterLocale:V,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},e.createElement(g,{name:n,control:S,rules:{required:h,disabled:E},render:function(t){var r,i,l=t.field;return e.createElement(R,{label:o,value:l.value?C(l.value):null,format:"HH:mm",inputFormat:!0,views:p?["hours"]:["hours","minutes"],ampm:a,onChange:function(e){return l.onChange(e)},viewRenderers:p?{hours:T}:null,timeSteps:{hours:u,minutes:s,seconds:m},slotProps:{textField:A(A({},w),{},{required:h,error:y&&Boolean(null===(r=q[n])||void 0===r?void 0:r.message),helperText:y&&(null===(i=q[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},Ce=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.requiredMessage,L=void 0===W?"Υποχρεωτικό πεδίο":W,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,O=t.cancelLabel,R=void 0===O?"ΑΚΥΡΩΣΗ":O,V=t.maxLength,P=void 0===V?255:V,z=t.message,B=void 0===z?null:z,K=t.isLoading,D=void 0!==K&&K,F={text:a||""},I=y.object({text:q?y.string().max(P,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(P," χαρακτήρες")).required(L):y.string().max(P)}),M=E({defaultValues:F,resolver:x(I)});e.useEffect((function(){n&&(M.reset(F),M.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),B&&"string"==typeof B?e.createElement(r,{variant:"caption",color:"text.secondary"},B):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:M.handleSubmit((function(e){return b(e.text)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},B&&"string"!=typeof B&&e.createElement(d,{sx:{mb:2}},B),e.createElement(X,{form:M,name:"text",label:i,required:q,autofocus:!0,maxLength:P,sx:{mt:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},R),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},D?e.createElement(h,{size:20,sx:{color:"inherit"}}):T))))},Se=/^$|^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,qe=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.requiredMessage,L=void 0===W?"Υποχρεωτικό πεδίο":W,k=t.invalidMessage,T=void 0===k?"Μη έγκυρη μορφή email":k,O=t.okLabel,R=void 0===O?"ΚΑΤΑΧΩΡΗΣΗ":O,V=t.cancelLabel,P=void 0===V?"ΑΚΥΡΩΣΗ":V,z=t.maxLength,B=void 0===z?255:z,K=t.message,D=void 0===K?null:K,F=t.isLoading,I=void 0!==F&&F,M={email:a||""},N=y.object({email:q?y.string().matches(Se,T).required(L):y.string().matches(Se,T)}),_=E({defaultValues:M,resolver:x(N)});e.useEffect((function(){n&&(_.reset(M),_.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),D&&"string"==typeof D?e.createElement(r,{variant:"caption",color:"text.secondary"},D):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:_.handleSubmit((function(e){return b(e.email)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},D&&"string"!=typeof D&&e.createElement(d,{sx:{mb:2}},D),e.createElement(Z,{form:_,label:i,required:q,autofocus:!0,maxLength:B,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},P),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},I?e.createElement(h,{size:20,sx:{color:"inherit"}}):R))))};!function(e,t){void 0===t&&(t={});var r=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".chrome-picker {\r\n -webkit-box-shadow: none !important;\r\n -moz-box-shadow: none !important;\r\n box-shadow: none !important;\r\n}");var We=function(t){var r=t.open,n=t.onSubmit,o=t.onCancel,i=t.title,a=void 0===i?"Επιλογή Χρώματος":i,u=t.color,d=void 0===u?"#000000":u,m=t.pickerWidth,h=void 0===m?350:m,b=t.selectionTextColor,g=void 0===b?"white":b,E=t.paddingY,x=void 0===E?"10px":E,y=t.paddingX,C=void 0===y?"10px":y,S=t.okLabel,q=void 0===S?"ΚΑΤΑΧΩΡΗΣΗ":S,W=t.cancelLabel,L=void 0===W?"ΑΚΥΡΩΣΗ":W;t.isLoading;var k=Y(e.useState("#000000"),2),T=k[0],O=k[1];e.useEffect((function(){r&&O(d)}),[r,d]);return e.createElement(l,{open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),form.handleSubmit(n)())}},e.createElement(c,null,a),e.createElement(f,null,e.createElement(s,{gap:2},e.createElement(J,{color:g,backgroundColor:T,paddingX:C,paddingY:x,label:T}),e.createElement(w,{width:h,color:T,onChange:function(e){return O(e.hex)}}))),e.createElement(p,null,e.createElement(v,{color:"success",onClick:function(){return n(T)}},q),e.createElement(v,{color:"error",onClick:function(){return o()}},L)))},Le=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.options,C=void 0===w?[]:w,S=t.valueKey,q=void 0===S?"id":S,W=t.labelKey,L=void 0===W?"label":W,k=t.required,T=void 0===k||k,O=t.size,R=void 0===O?"sm":O,V=t.requiredMessage,P=void 0===V?"Υποχρεωτικό πεδίο":V,z=t.okLabel,B=void 0===z?"ΚΑΤΑΧΩΡΗΣΗ":z,K=t.cancelLabel,D=void 0===K?"ΑΚΥΡΩΣΗ":K,F=t.message,I=void 0===F?null:F,M=t.isLoading,N=void 0!==M&&M,_={field:a||null},A=y.object({field:T?y.string().required(P):y.string().nullable()}),H=E({defaultValues:_,resolver:x(A)});e.useEffect((function(){n&&(H.reset(_),H.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:R,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),I&&"string"==typeof I?e.createElement(r,{variant:"caption",color:"text.secondary"},I):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:H.handleSubmit((function(e){return b(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},e.createElement(ee,{form:H,name:"field",label:i,options:C,valueKey:q,labelKey:L,required:T,autofocus:!0,size:"medium",sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},N?e.createElement(h,{size:20,sx:{color:"inherit"}}):B))))},ke=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=void 0===a?[]:a,g=t.onSubmit,w=t.onCancel,C=t.options,S=void 0===C?[]:C,q=t.valueKey,W=void 0===q?"id":q,L=t.labelKey,k=void 0===L?"label":L,T=t.required,O=void 0===T||T,R=t.size,V=void 0===R?"sm":R,P=t.requiredMessage,z=void 0===P?"Επιλέξτε τουλάχιστον μία τιμή":P,B=t.okLabel,K=void 0===B?"ΚΑΤΑΧΩΡΗΣΗ":B,D=t.cancelLabel,F=void 0===D?"ΑΚΥΡΩΣΗ":D,I=t.message,M=void 0===I?null:I,N=t.isLoading,_=void 0!==N&&N,A={field:b||[]},H=y.object({field:O?y.array().min(1,z):y.array()}),G=E({defaultValues:A,resolver:x(H)});e.useEffect((function(){n&&(G.reset(A),G.clearErrors())}),[n,b]);return e.createElement(l,{fullWidth:!0,maxWidth:V,open:n,onClose:function(e,t){"escapeKeyDown"===t&&w()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),M&&"string"==typeof M?e.createElement(r,{variant:"caption",color:"text.secondary"},M):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:G.handleSubmit((function(e){return g(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},M&&"string"!=typeof M&&e.createElement(d,{sx:{mb:2}},M),e.createElement(ae,{form:G,name:"field",label:i,options:S,valueKey:W,labelKey:k,required:O,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),w()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},F),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},_?e.createElement(h,{size:20,sx:{color:"inherit"}}):K))))},Te=function(t){var r=t.open,n=t.title,o=t.message,i=t.onConfirm,a=t.onCancel,s=t.confirmText,m=void 0===s?"ΕΠΙΒΕΒΑΙΩΣΗ":s,g=t.cancelText,E=void 0===g?"ΑΚΥΡΩΣΗ":g,x=t.isLoading,y=void 0!==x&&x,w=t.type,C=void 0===w?"warning":w,S={warning:{color:"warning.main",icon:e.createElement(z,{sx:{fontSize:40}})},error:{color:"error.main",icon:e.createElement(B,{sx:{fontSize:40}})},success:{color:"success.main",icon:e.createElement(K,{sx:{fontSize:40}})}}[C]||{color:"primary.main",icon:null};return e.createElement(l,{open:r,onClose:function(e,t){"backdropClick"!==t&&a()},slots:{transition:u},slotProps:{backdrop:{sx:{backgroundColor:"rgba(0, 0, 0, 0.4)",backdropFilter:"blur(4px)"}},paper:{sx:{borderRadius:4,padding:1,maxWidth:400,textAlign:"center",backgroundImage:"none"}}}},e.createElement(d,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:3}},e.createElement(d,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:70,height:70,bgcolor:"".concat(S.color,"20"),color:S.color,borderRadius:"50%",mb:2}},S.icon),e.createElement(c,{sx:{fontWeight:800,fontSize:"1.35rem",pt:0,pb:1}},n)),e.createElement(f,null,e.createElement(b,{sx:{color:"text.secondary",fontWeight:500,lineHeight:1.6}},o)),e.createElement(p,{sx:{justifyContent:"center",gap:2,px:3,pb:3,mt:1}},e.createElement(v,{fullWidth:!0,variant:"text",color:"inherit",onClick:a,sx:{borderRadius:3,fontWeight:700,color:"text.disabled"}},E),e.createElement(v,{fullWidth:!0,variant:"contained",disableElevation:!0,color:"error"===C?"error":"primary",onClick:i,sx:{borderRadius:3,fontWeight:700,py:1}},y?e.createElement(h,{size:20,sx:{color:"inherit"}}):m)))},Oe=function(t){var n=t.open,o=t.title,i=t.label,a=t.message,b=void 0===a?null:a,g=t.value,w=t.onSubmit,C=t.onCancel,S=t.size,q=void 0===S?"sm":S,W=t.rows,L=void 0===W?5:W,k=t.required,T=void 0!==k&&k,O=t.requiredMessage,R=void 0===O?"Υποχρεωτικό πεδίο":O,V=t.okLabel,P=void 0===V?"ΚΑΤΑΧΩΡΗΣΗ":V,z=t.cancelLabel,B=void 0===z?"ΑΚΥΡΩΣΗ":z,K=t.isLoading,D=void 0!==K&&K,F={notes:g||""},I=y.object({notes:T?y.string().required(R):y.string()}),M=E({defaultValues:F,resolver:x(I)});e.useEffect((function(){n&&(M.reset(F),M.clearErrors())}),[n,g]);return e.createElement(l,{fullWidth:!0,maxWidth:q,open:n,onClose:function(e,t){"escapeKeyDown"===t&&C()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),b&&"string"==typeof b?e.createElement(r,{variant:"caption",color:"text.secondary"},b):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:M.handleSubmit((function(e){return w(e.notes)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},b&&"string"!=typeof b&&e.createElement(d,{sx:{mb:2}},b),e.createElement(se,{form:M,name:"notes",label:i,required:T,rows:L,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),C()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},B),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},D?e.createElement(h,{size:20,sx:{color:"inherit"}}):P))))},Re=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.minValue,L=void 0===W?null:W,k=t.maxValue,T=void 0===k?null:k,O=t.requiredMessage,R=void 0===O?"Υποχρεωτικό πεδίο":O,V=t.okLabel,P=void 0===V?"ΚΑΤΑΧΩΡΗΣΗ":V,z=t.cancelLabel,B=void 0===z?"ΑΚΥΡΩΣΗ":z,K=t.message,D=void 0===K?null:K,F=t.isLoading,I=void 0!==F&&F,M={poso:re(a)?a:null},N=y.object({poso:y.number().when([],{is:function(e){return q},then:function(e){return e.required(R)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==L},then:function(e){return e.min(L,"Το ποσό πρέπει να είναι μεγαλύτερο ή ίσο από ".concat(ne(L)))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==T},then:function(e){return e.max(T,"Το ποσό πρέπει να είναι μικρότερο ή ίσο από ".concat(ne(T)))},otherwise:function(e){return e}})}),_=E({defaultValues:M,resolver:x(N)});e.useEffect((function(){n&&(_.reset(M),_.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),D&&"string"==typeof D?e.createElement(r,{variant:"caption",color:"text.secondary"},D):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:_.handleSubmit((function(e){return b(e.poso)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},e.createElement(me,{form:_,name:"poso",label:i,required:q,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},B),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},I?e.createElement(h,{size:20,sx:{color:"inherit"}}):P))))},Ve=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.requiredMessage,L=void 0===W?"Υποχρεωτικό πεδίο":W,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,O=t.cancelLabel,R=void 0===O?"ΑΚΥΡΩΣΗ":O,V=t.message,P=void 0===V?null:V,z=t.isLoading,B=void 0!==z&&z,K={datetime:a},D=y.object({datetime:q?y.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").required(L):y.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").nullable()}),F=E({defaultValues:K,resolver:x(D)});e.useEffect((function(){n&&(F.reset(K),F.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),P&&"string"==typeof P?e.createElement(r,{variant:"caption",color:"text.secondary"},P):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:F.handleSubmit((function(e){return b(e.datetime)})),noValidate:!0},e.createElement(f,null,P&&"string"!=typeof P&&e.createElement(d,{sx:{mb:2}},P),e.createElement(pe,{form:F,name:"datetime",label:i,required:q,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},R),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(h,{size:20,sx:{color:"inherit"}}):T))))},Pe=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.requiredMessage,L=void 0===W?"Υποχρεωτικό πεδίο":W,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,O=t.cancelLabel,R=void 0===O?"ΑΚΥΡΩΣΗ":O,V=t.message,P=void 0===V?null:V,z=t.isLoading,B=void 0!==z&&z,K={datetime:a},D=y.object({datetime:q?y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(L):y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").nullable()}),F=E({defaultValues:K,resolver:x(D)});e.useEffect((function(){n&&(F.reset(K),F.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),P&&"string"==typeof P?e.createElement(r,{variant:"caption",color:"text.secondary"},P):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:F.handleSubmit((function(e){return b(e.datetime)})),noValidate:!0},e.createElement(f,null,P&&"string"!=typeof P&&e.createElement(d,{sx:{mb:2}},P),e.createElement(he,{form:F,name:"datetime",label:i,required:q,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},R),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(h,{size:20,sx:{color:"inherit"}}):T))))},je=[{id:!0,label:"ΝΑΙ"},{id:!1,label:"ΟΧΙ"}],ze=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,u=t.onSubmit,s=t.onCancel,d=t.required,m=void 0===d||d,h=t.info,b=void 0===h?"":h,g=t.size,w=void 0===g?"sm":g,C=t.requiredMessage,S=void 0===C?"Υποχρεωτικό πεδίο":C,q=t.okLabel,W=void 0===q?"ΚΑΤΑΧΩΡΗΣΗ":q,L=t.cancelLabel,k=void 0===L?"ΑΚΥΡΩΣΗ":L,T={field:a||null},O=y.object({field:m?y.boolean().required(S):y.boolean().nullable()}),R=E({defaultValues:T,resolver:x(O)});return e.useEffect((function(){n&&(R.clearErrors(),R.setValue("field",a,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[n,a]),e.createElement(l,{fullWidth:!0,maxWidth:w,open:n,onClose:function(){}},e.createElement(c,null,o),e.createElement(f,null,b&&e.createElement(r,null,b),e.createElement(ee,{form:R,name:"field",label:i,options:je,valueKey:"id",labelKey:"label",required:m,autofocus:!0,size:"medium",sx:{marginTop:2}})),e.createElement(p,null,e.createElement(v,{color:"success",onClick:R.handleSubmit((function(e){return u(e.field)}))},W),e.createElement(v,{color:"error",onClick:function(){return s()}},k)))},Be=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,a=t.onSubmit,u=t.onCancel,s=t.allowNegative,d=void 0!==s&&s,m=t.required,h=void 0===m||m,b=t.requiredMessage,g=void 0===b?"Υποχρεωτικό πεδίο":b,w=t.size,C=void 0===w?"sm":w,S=t.minValue,q=void 0===S?null:S,W=t.maxValue,L=void 0===W?null:W,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,O=t.cancelLabel,R=void 0===O?"ΑΚΥΡΩΣΗ":O;t.isLoading;var V={num:re(i)?i:null},P=y.object({num:y.number().when([],{is:function(e){return h},then:function(e){return e.required(g)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==q},then:function(e){return e.min(q,"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση από ".concat(q))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==L},then:function(e){return e.max(L,"Η τιμή πρέπει να είναι μικρότερη ή ίση από ".concat(L))},otherwise:function(e){return e}})}),j=E({defaultValues:V,resolver:x(P)});return e.useEffect((function(){r&&(j.clearErrors(),j.setValue("num",re(i)?i:null,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(l,{fullWidth:!0,maxWidth:C,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),j.handleSubmit((function(e){return a(e.num)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(ge,{form:j,name:"num",label:o,required:h,autofocus:!0,allowNegative:d,sx:{marginTop:2}})),e.createElement(p,null,e.createElement(v,{color:"success",onClick:j.handleSubmit((function(e){return a(e.num)}))},T),e.createElement(v,{color:"error",onClick:function(){return u()}},R)))},Ke=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,a=t.decimals,u=void 0===a?2:a,s=t.minValue,d=void 0===s?null:s,m=t.maxValue,h=void 0===m?null:m,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.requiredMessage,L=void 0===W?"Υποχρεωτικό πεδίο":W,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,O=t.cancelLabel,R=void 0===O?"ΑΚΥΡΩΣΗ":O;t.isLoading;var V={field:re(i)?i:null},P=y.object({field:y.number().when([],{is:function(e){return q},then:function(e){return e.required(L)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==d},then:function(e){return e.min(d,"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση από ".concat(oe(d,u)))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==h},then:function(e){return e.max(h,"Η τιμή πρέπει να είναι μικρότερη ή ίση από ".concat(oe(h,u)))},otherwise:function(e){return e}})}),j=E({defaultValues:V,resolver:x(P)});return e.useEffect((function(){r&&(j.clearErrors(),j.setValue("field",re(i)?i:null,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(l,{fullWidth:!0,maxWidth:C,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),j.handleSubmit((function(e){return b(e.field)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(me,{form:j,name:"field",label:o,required:q,autofocus:!0,sx:{marginTop:2}})),e.createElement(p,null,e.createElement(v,{color:"success",onClick:j.handleSubmit((function(e){return b(e.field)}))},T),e.createElement(v,{color:"error",onClick:function(){return g()}},R)))},De=function(t){var r=t.open,n=t.title,o=t.message,i=t.onClose,a=t.closeText,u=void 0===a?"ΟΚ":a;return e.createElement(l,{open:r,onClose:function(){}},e.createElement(c,null,n),e.createElement(f,null,e.createElement(b,null,o)),e.createElement(p,null,e.createElement(v,{color:"primary",onClick:function(e){e.stopPropagation(),i()}},u)))},Fe=function(t){var r=t.open,n=t.title,o=void 0===n?"Νέο Αρχείο":n,i=t.description,a=void 0===i||i,u=t.descriptionLabel,d=void 0===u?"Περιγραφή Αρχείου":u,m=t.fileSelectLabel,h=void 0===m?"Επιλογή Αρχείου":m,b=t.maxFileName,g=void 0===b?255:b,w=t.onSubmit,C=t.onCancel;t.isLoading;var S=y.object({descr:a?y.string().required("Παρακαλώ συμπληρώστε την περιγραφή του αρχείου").max(g,"Η περιγραφή δεν πρέπει να υπερβαίνει τους ".concat(g," χαρακτήρες")):y.string(),filename:y.mixed().required("Παρακαλώ επιλέξτε ένα αρχείο")}),q=E({defaultValues:{descr:"",filename:null},resolver:x(S)});return e.useEffect((function(){r&&(q.clearErrors(),q.setValue("descr",""),q.setValue("filename",null))}),[r]),e.createElement(l,{maxWidth:"sm",fullWidth:!0,open:r,onClose:function(){}},e.createElement(c,null,o),e.createElement(f,null,e.createElement(s,{sx:{marginTop:2},gap:3},a&&e.createElement(X,{form:q,name:"descr",label:d,required:!0,autofocus:!0}),e.createElement(xe,{form:q,name:"filename",label:h,required:!0}))),e.createElement(p,null,e.createElement(v,{color:"success",onClick:q.handleSubmit(w)},"ΚΑΤΑΧΩΡΗΣΗ"),e.createElement(v,{color:"error",onClick:function(){return C()}},"ΑΚΥΡΩΣΗ")))},Ie=function(t){var n=t.open,o=t.title,i=t.label,a=t.optionsUrl,b=t.value,g=t.onSubmit,w=t.onCancel,C=t.valueKey,S=void 0===C?"id":C,q=t.labelKey,W=void 0===q?"label":q,L=t.required,k=void 0===L||L,T=t.size,O=void 0===T?"sm":T,R=t.requiredMessage,V=void 0===R?"Υποχρεωτικό πεδίο":R,P=t.minChars,z=void 0===P?1:P,B=t.okLabel,K=void 0===B?"ΚΑΤΑΧΩΡΗΣΗ":B,D=t.cancelLabel,F=void 0===D?"ΑΚΥΡΩΣΗ":D,I=t.message,M=void 0===I?null:I,N=t.isLoading,_=void 0!==N&&N,A={field:b||null},H=y.object({field:k?y.string().required(V):y.string().nullable()}),G=E({defaultValues:A,resolver:x(H)});e.useEffect((function(){n&&(G.reset(A),G.clearErrors())}),[n,b]);return e.createElement(l,{fullWidth:!0,maxWidth:O,open:n,onClose:function(e,t){"escapeKeyDown"===t&&w()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),M&&"string"==typeof M?e.createElement(r,{variant:"caption",color:"text.secondary"},M):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:G.handleSubmit((function(e){return g(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},M&&"string"!=typeof M&&e.createElement(d,{sx:{mb:2}},M),e.createElement(ue,{form:G,name:"field",label:i,optionsUrl:a,minChars:z,valueKey:S,labelKey:W,required:k,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),w()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},F),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},_?e.createElement(h,{size:20,sx:{color:"inherit"}}):K))))},Me=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,a=t.onSubmit,u=t.onCancel,s=t.size,d=void 0===s?"sm":s,m=t.required,h=void 0===m||m,b=t.requiredMessage,g=void 0===b?"Υποχρεωτικό πεδίο":b,w=t.okLabel,C=void 0===w?"ΚΑΤΑΧΩΡΗΣΗ":w,S=t.cancelLabel,q=void 0===S?"ΑΚΥΡΩΣΗ":S,W={datetime:i},L=y.object({datetime:h?y.date().typeError("Μη έγκυρη μορφή ώρας").required(g):y.date().typeError("Μη έγκυρη μορφή ώρας")}),k=E({defaultValues:W,resolver:x(L)});return e.useEffect((function(){r&&(k.clearErrors(),k.setValue("datetime",i,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(l,{fullWidth:!0,maxWidth:d,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),k.handleSubmit((function(e){return a(e.datetime)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(we,{form:k,name:"datetime",label:o,required:h,autofocus:!0,sx:{marginTop:2}})),e.createElement(p,null,e.createElement(v,{color:"success",onClick:k.handleSubmit((function(e){return a(e.datetime)}))},C),e.createElement(v,{color:"error",onClick:function(){return u()}},q)))},Ne=function(t){var n=t.open,o=t.title,i=t.registrationNumber,a=t.registrationDate,b=t.registrationNumberLabel,g=void 0===b?"Αριθμός Πρωτοκόλλου":b,w=t.registrationDateLabel,C=void 0===w?"Ημερομηνία Πρωτοκόλλου":w,S=t.onSubmit,q=t.onCancel,W=t.size,L=void 0===W?"sm":W,k=t.required,T=void 0!==k&&k,O=t.registrationNumberRequiredMessage,R=void 0===O?"Συμπληρώστε τον αριθμό πρωτοκόλλου":O,V=t.registrationDateRequiredMessage,P=void 0===V?"Συμπληρώστε ή επιλέξτε την ημερομηνία πρωτοκόλλου":V,z=t.okLabel,B=void 0===z?"ΚΑΤΑΧΩΡΗΣΗ":z,K=t.cancelLabel,D=void 0===K?"ΑΚΥΡΩΣΗ":K,F=t.registrationNumberMaxLength,I=void 0===F?255:F,M=t.message,N=void 0===M?null:M,_=t.isLoading,A=void 0!==_&&_,H=e.useMemo((function(){return{registration_number:i||"",registration_date:a||null}}),[i,a]),G=y.object({registration_number:T?y.string().max(I,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(I," χαρακτήρες")).required(R):y.string().max(I,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(I," χαρακτήρες")),registration_date:T?y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(P):y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").nullable()}),Y=E({defaultValues:H,resolver:x(G)});e.useEffect((function(){n&&(Y.reset(H),Y.clearErrors())}),[n,H]);return e.createElement(l,{fullWidth:!0,maxWidth:L,open:n,onClose:function(e,t){"escapeKeyDown"===t&&q()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),N&&"string"==typeof N?e.createElement(r,{variant:"caption",color:"text.secondary"},N):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:Y.handleSubmit((function(e){return S(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},N&&"string"!=typeof N&&e.createElement(d,{sx:{mb:2}},N),e.createElement(s,{direction:"column",spacing:2.5},e.createElement(X,{form:Y,name:"registration_number",label:g,required:T,autofocus:!0,maxLength:I,sx:{mt:1}}),e.createElement(he,{form:Y,name:"registration_date",label:C,required:T,sx:{mt:1}}))),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),q()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},A?e.createElement(h,{size:20,sx:{color:"inherit"}}):B))))};export{Ie as AutocompleteApiModalForm,Le as AutocompleteModalForm,ke as AutocompleteMultiModalForm,Te as ConfirmationDialog,Re as CurrencyModalForm,Pe as DateModalForm,Ve as DatetimeModalForm,Ke as DecimalModalForm,qe as EmailModalForm,Be as IntegerModalForm,De as MessageDialog,Oe as NotesModalForm,We as PickColorModalForm,Ne as RegistrationModalForm,Fe as SelectFileModalForm,Ce as TextModalForm,Me as TimeModalForm,ze as YesNoModalForm};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artibet/react-mui-components",
3
- "version": "3.8.7",
3
+ "version": "3.8.8",
4
4
  "description": "Various react components build with mui library",
5
5
  "main": "./core/index.js",
6
6
  "scripts": {