intelicoreact 1.8.24 → 1.8.26

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
- function e(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 r(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function t(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){r(e,t,n[t])})}return e}function n(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):(function(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function o(r){return function(r){if(Array.isArray(r))return e(r)}(r)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(r,t){if(r){if("string"==typeof r)return e(r,void 0);var n=Object.prototype.toString.call(r).slice(8,-1);if("Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}}(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return b}});var i=require("react/jsx-runtime"),u=f(require("classnames")),a=function(e,r){if(e&&e.__esModule)return e;if(null===e||(void 0===e?"undefined":e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)!="object"&&"function"!=typeof e)return{default:e};var t=p(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var u=o?Object.getOwnPropertyDescriptor(e,i):null;u&&(u.get||u.set)?Object.defineProperty(n,i,u):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}(require("react")),l=require("../../../Functions/fieldValueFormatters"),s=f(require("../../Layout/Spinner/Spinner")),c=f(require("../../UI/DynamicIcon/DynamicIcon")),d=require("./hooks");function f(e){return e&&e.__esModule?e:{default:e}}function p(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(p=function(e){return e?t:r})(e)}function y(){}require("./Input.scss");var b=a.default.forwardRef(function(e,f){var p=e.blurTrim,b=e.autocomplete,m=e.isSelect,v=e.onChange,h=void 0===v?y:v,g=e.onBlur,O=void 0===g?y:g,j=e.onFocus,w=e.onKeyUp,P=e.onKeyDown,_=e.isNotBlinkErrors,D=e.isPriceInput,I=e.onlyNumbers,k=e.disabled,S=e.withDelete,C=e.value,F=e.placeholder,M=e.className,E=e.type,K=void 0===E?"text":E,N=e.mask,x=e.maskChar,A=e.formatChars,B=e.error,V=e.icon,q=e.iconDynamicKey,U=e.iconDynamicProps,T=e.symbolsLimit,L=e.blinkTime,H=e.isFocusDefault,R=e.isNotValidateASCII,W=e.isNumericMobileKeyboard,z=e.isCropFirstNool,$=e.testId,G=e.action,J=e.isUseAutoSelect,Q=void 0===J||J,X=e.isReadOnly,Y=e.isLoading,Z=void 0!==Y&&Y,ee=e.name,er=e.fieldKey,et=e.id,en=e.attributesOfNativeInput,eo=void 0===en?{}:en,ei=q&&!V?(0,i.jsx)(c.default,t({iconKey:q},void 0===U?{}:U)):null,eu=(0,a.useRef)(null),ea=(0,a.useMemo)(function(){return f||eu},[f]),el=(0,d.useInputFocus)({isSelect:m,isFocusDefault:void 0!==H&&H,onFocus:void 0===j?y:j}),es=el.isFocused,ec=el.isEditing,ed=el.setIsFocused,ef=el.setEditing,ep=el.handleFocus,ey=el.handleToggleEdit,eb=(0,d.useErrorBlink)({isUseErrorsBlink:!_&&!N,blinkTime:L}),em=eb.isToHighlightError,ev=eb.setPreviousValue,eh=eb.checkValueChange,eg=(0,d.useKeyboardHandling)({onKeyDown:void 0===P?y:P,onKeyUp:void 0===w?y:w,checkValueChange:eh,setPreviousValue:ev,value:C}),eO=eg.keyDownData,ej=eg.handleKeyDown,ew=eg.handleKeyUp,eP=(0,d.useInputValueProcessing)({onlyNumbers:I,isPriceInput:D,value:C,isNotValidateASCII:void 0!==R&&R,symbolsLimit:T,isCropFirstNool:void 0!==z&&z,type:K,keyDownData:eO,onChange:h,blurTrim:p}),e_=eP.formatedValue,eD=eP.handleChange,eI=eP.handleBlur;eP.correctMinMax;var ek=(0,d.useInputHover)(),eS=ek.onInputHover,eC=ek.handleMouseEnter,eF=ek.handleMouseLeave;(0,a.useEffect)(function(){var e,r;ec&&(null==ea||null==(r=ea.current)||null==(e=r.focus)||e.call(r))},[ec,es]);var eM=t({name:ee||er||et,className:(0,u.default)("input",M,{"input--with-icon":V,"input--with-delete":S}),placeholder:F,value:e_,inputMode:void 0!==W&&W?"decimal":"text",disabled:k,onChange:eD,onFocus:ep,onBlur:function(e){eI(e,O),ed(!1),ef(!1)},onKeyUp:ew,onKeyDown:ej},x?{maskChar:x}:{},A?{formatChars:A}:{});return(0,i.jsxs)("div",{"data-testid":void 0===$?"input":$,className:(0,u.default)("input__wrap",r({},"input__wrap_focus",es),r({},"input__wrap_error",B||em),r({},"input__wrap--disabled",k||Z)),onMouseEnter:eC,onMouseLeave:eF,children:[(0,i.jsx)("input",n(t(n(t({readOnly:void 0!==X&&X},eM),{ref:ea,type:D||"pseudoPassword"===K?"text":K,autoComplete:"pseudoPassword"===K||void 0===b?"off":b}),eo),{onFocus:function(){for(var e,r,t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];null==eo||null==(e=eo.onFocus)||e.call.apply(e,[eo].concat(o(n))),Q&&(null==(r=ea.current)||r.select()),eM.onFocus&&eM.onFocus.apply(eM,o(n))},onBlur:function(){for(var e,r=arguments.length,t=Array(r),n=0;n<r;n++)t[n]=arguments[n];null==eo||null==(e=eo.onBlur)||e.call.apply(e,[eo].concat(o(t))),eM.onBlur&&eM.onBlur.apply(eM,o(t))}})),null!=ei?ei:V,G,S&&eS&&(0,i.jsx)("span",{className:(0,u.default)("input__close",{hidden:!(0,l.getSafelyValue)(C)}),onClick:function(){ey(),h("")}}),Z&&(0,i.jsx)(s.default,{size:"small"})]})});
1
+ function e(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 r(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function t(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){r(e,t,n[t])})}return e}function n(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):(function(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function o(r){return function(r){if(Array.isArray(r))return e(r)}(r)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(r,t){if(r){if("string"==typeof r)return e(r,void 0);var n=Object.prototype.toString.call(r).slice(8,-1);if("Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}}(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return b}});var i=require("react/jsx-runtime"),u=d(require("classnames")),a=function(e,r){if(e&&e.__esModule)return e;if(null===e||(void 0===e?"undefined":e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)!="object"&&"function"!=typeof e)return{default:e};var t=f(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var u=o?Object.getOwnPropertyDescriptor(e,i):null;u&&(u.get||u.set)?Object.defineProperty(n,i,u):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}(require("react")),l=require("../../../Functions/fieldValueFormatters"),s=d(require("../../Layout/Spinner/Spinner")),c=d(require("../../UI/DynamicIcon/DynamicIcon")),p=require("./hooks");function d(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(f=function(e){return e?t:r})(e)}function y(){}require("./Input.scss");var b=function(e){var d=e.ref,f=e.blurTrim,b=e.autocomplete,m=e.isSelect,v=e.onChange,h=void 0===v?y:v,g=e.onBlur,O=void 0===g?y:g,j=e.onFocus,w=e.onKeyUp,P=e.onKeyDown,_=e.isNotBlinkErrors,D=e.isPriceInput,I=e.onlyNumbers,k=e.disabled,S=e.withDelete,C=e.value,F=e.placeholder,M=e.className,E=e.type,K=void 0===E?"text":E,N=e.mask,x=e.maskChar,A=e.formatChars,B=e.error,V=e.icon,q=e.iconDynamicKey,U=e.iconDynamicProps,T=e.symbolsLimit,L=e.blinkTime,H=e.isFocusDefault,W=e.isNotValidateASCII,R=e.isNumericMobileKeyboard,z=e.isCropFirstNool,$=e.testId,G=e.action,J=e.isUseAutoSelect,Q=void 0===J||J,X=e.isReadOnly,Y=e.isLoading,Z=void 0!==Y&&Y,ee=e.name,er=e.fieldKey,et=e.id,en=e.attributesOfNativeInput,eo=void 0===en?{}:en,ei=q&&!V?(0,i.jsx)(c.default,t({iconKey:q},void 0===U?{}:U)):null,eu=(0,a.useRef)(null),ea=(0,a.useMemo)(function(){return d||eu},[d]),el=(0,p.useInputFocus)({isSelect:m,isFocusDefault:void 0!==H&&H,onFocus:void 0===j?y:j}),es=el.isFocused,ec=el.isEditing,ep=el.setIsFocused,ed=el.setEditing,ef=el.handleFocus,ey=el.handleToggleEdit,eb=(0,p.useErrorBlink)({isUseErrorsBlink:!_&&!N,blinkTime:L}),em=eb.isToHighlightError,ev=eb.setPreviousValue,eh=eb.checkValueChange,eg=(0,p.useKeyboardHandling)({onKeyDown:void 0===P?y:P,onKeyUp:void 0===w?y:w,checkValueChange:eh,setPreviousValue:ev,value:C}),eO=eg.keyDownData,ej=eg.handleKeyDown,ew=eg.handleKeyUp,eP=(0,p.useInputValueProcessing)({onlyNumbers:I,isPriceInput:D,value:C,isNotValidateASCII:void 0!==W&&W,symbolsLimit:T,isCropFirstNool:void 0!==z&&z,type:K,keyDownData:eO,onChange:h,blurTrim:f}),e_=eP.formatedValue,eD=eP.handleChange,eI=eP.handleBlur;eP.correctMinMax;var ek=(0,p.useInputHover)(),eS=ek.onInputHover,eC=ek.handleMouseEnter,eF=ek.handleMouseLeave;(0,a.useEffect)(function(){var e,r;ec&&(null==ea||null==(r=ea.current)||null==(e=r.focus)||e.call(r))},[ec,es]);var eM=t({name:ee||er||et,className:(0,u.default)("input",M,{"input--with-icon":V,"input--with-delete":S}),placeholder:F,value:e_,inputMode:void 0!==R&&R?"decimal":"text",disabled:k,onChange:eD,onFocus:ef,onBlur:function(e){eI(e,O),ep(!1),ed(!1)},onKeyUp:ew,onKeyDown:ej},x?{maskChar:x}:{},A?{formatChars:A}:{});return(0,i.jsxs)("div",{"data-testid":void 0===$?"input":$,className:(0,u.default)("input__wrap",r({},"input__wrap_focus",es),r({},"input__wrap_error",B||em),r({},"input__wrap--disabled",k||Z)),onMouseEnter:eC,onMouseLeave:eF,children:[(0,i.jsx)("input",n(t(n(t({readOnly:void 0!==X&&X},eM),{ref:ea,type:D||"pseudoPassword"===K?"text":K,autoComplete:"pseudoPassword"===K||void 0===b?"off":b}),eo),{onFocus:function(){for(var e,r,t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];null==eo||null==(e=eo.onFocus)||e.call.apply(e,[eo].concat(o(n))),Q&&(null==(r=ea.current)||r.select()),eM.onFocus&&eM.onFocus.apply(eM,o(n))},onBlur:function(){for(var e,r=arguments.length,t=Array(r),n=0;n<r;n++)t[n]=arguments[n];null==eo||null==(e=eo.onBlur)||e.call.apply(e,[eo].concat(o(t))),eM.onBlur&&eM.onBlur.apply(eM,o(t))}})),null!=ei?ei:V,G,S&&eS&&(0,i.jsx)("span",{className:(0,u.default)("input__close",{hidden:!(0,l.getSafelyValue)(C)}),onClick:function(){ey(),h("")}}),Z&&(0,i.jsx)(s.default,{size:"small"})]})};
@@ -1 +1 @@
1
- function e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return c}});var t=require("react/jsx-runtime"),n=u(require("classnames")),r=u(require("moment-timezone")),a=u(require("react")),l=require("../../../../Functions/presets/mobileKeyboardTypesPresets"),o=u(require("../../Input/Input"));function u(e){return e&&e.__esModule?e:{default:e}}var c=a.default.forwardRef(function(a,u){var c,i,s,d=a.RC,f=a.className,p=a.testId,b=a.isFocused,m=a.disabled,v=a.value,g=a.date,y=a.prepareDate,j=a.onChange,O=a.onFocus,h=a.onBlur,P=a.onKeyUp,q="invalid date"!==((null==(s=null!=(i=null==y?void 0:y(g))?i:(0,r.default)(g).format("MM/DD/YYYY"))||null==(c=s.toString)?void 0:c.call(s).toLowerCase())||"")?s:"";return b?(0,t.jsx)(o.default,function(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},a=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),a.forEach(function(n){e(t,n,r[n])})}return t}({ref:u,testId:p,className:(0,n.default)(f,"".concat(d,"-interactive")),value:v,disabled:m,onChange:function(e){var t,n,r;return j((n=(t=null==e?void 0:e.replace(/[^0-9/]/g,""))?t.slice(-1):"",r=t?t.slice(0,t.length-1):"",e.length>10||"/"===n?r:2===r.length||5===r.length?"".concat(r,"/").concat(n):t))},onBlur:h,onKeyUp:P},l.NUMERIC_KEYBOARD)):(0,t.jsx)("div",{className:(0,n.default)(f,"".concat(d,"-emulation"),e({},"".concat(d,"-emulation_disabled"),m)),onClick:m?void 0:O,children:(0,t.jsx)("span",{className:(0,n.default)(""),children:q})})});
1
+ function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return u}});var t=require("react/jsx-runtime"),r=a(require("classnames")),n=a(require("moment-timezone"));require("react");var l=require("../../../../Functions/presets/mobileKeyboardTypesPresets"),o=a(require("../../Input/Input"));function a(e){return e&&e.__esModule?e:{default:e}}var u=function(a){var u,c,i,s=a.ref,f=function(e,t){if(null==e)return{};var r,n,l=function(e,t){if(null==e)return{};var r,n,l={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(l[r]=e[r]);return l}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(l[r]=e[r])}return l}(a,["ref"]),d=f.RC,b=f.className,p=f.testId,m=f.isFocused,v=f.disabled,y=f.value,O=f.date,g=f.prepareDate,j=f.onChange,h=f.onFocus,P=f.onBlur,x=f.onKeyUp,w="invalid date"!==((null==(i=null!=(c=null==g?void 0:g(O))?c:(0,n.default)(O).format("MM/DD/YYYY"))||null==(u=i.toString)?void 0:u.call(i).toLowerCase())||"")?i:"";return m?(0,t.jsx)(o.default,function(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},l=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(l=l.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),l.forEach(function(r){e(t,r,n[r])})}return t}({ref:s,testId:p,className:(0,r.default)(b,"".concat(d,"-interactive")),value:y,disabled:v,onChange:function(e){var t,r,n;return j((r=(t=null==e?void 0:e.replace(/[^0-9/]/g,""))?t.slice(-1):"",n=t?t.slice(0,t.length-1):"",e.length>10||"/"===r?n:2===n.length||5===n.length?"".concat(n,"/").concat(r):t))},onBlur:P,onKeyUp:x},l.NUMERIC_KEYBOARD)):(0,t.jsx)("div",{className:(0,r.default)(b,"".concat(d,"-emulation"),e({},"".concat(d,"-emulation_disabled"),v)),onClick:v?void 0:h,children:(0,t.jsx)("span",{className:(0,r.default)(""),children:w})})};
@@ -1 +1 @@
1
- function e(e,n){(null==n||n>e.length)&&(n=e.length);for(var l=0,t=Array(n);l<n;l++)t[l]=e[l];return t}function n(e,n,l){return n in e?Object.defineProperty(e,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[n]=l,e}function l(e){for(var l=1;l<arguments.length;l++){var t=null!=arguments[l]?arguments[l]:{},o=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.forEach(function(l){n(e,l,t[l])})}return e}function t(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):(function(e,n){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);l.push.apply(l,t)}return l})(Object(n)).forEach(function(l){Object.defineProperty(e,l,Object.getOwnPropertyDescriptor(n,l))}),e}function o(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var l,t,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var r=[],i=!0,u=!1;try{for(o=o.call(e);!(i=(l=o.next()).done)&&(r.push(l.value),!n||r.length!==n);i=!0);}catch(e){u=!0,t=e}finally{try{i||null==o.return||o.return()}finally{if(u)throw t}}return r}}(e,n)||i(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(n){return function(n){if(Array.isArray(n))return e(n)}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||i(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(n,l){if(n){if("string"==typeof n)return e(n,l);var t=Object.prototype.toString.call(n).slice(8,-1);if("Object"===t&&n.constructor&&(t=n.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return e(n,l)}}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return j}});var u=require("react/jsx-runtime"),a=w(require("classnames")),c=function(e,n){if(e&&e.__esModule)return e;if(null===e||(void 0===e?"undefined":e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)!="object"&&"function"!=typeof e)return{default:e};var l=y(n);if(l&&l.has(e))return l.get(e);var t={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var i=o?Object.getOwnPropertyDescriptor(e,r):null;i&&(i.get||i.set)?Object.defineProperty(t,r,i):t[r]=e[r]}return t.default=e,l&&l.set(e,t),t}(require("react")),s=require("react-dom"),d=require("react-feather"),v=require("../../../Functions/fieldValueFormatters"),f=require("../../../Functions/useDebounce"),m=w(require("../../../Functions/useIsMobile/useIsMobile")),p=w(require("../../UI/Button/Button")),h=w(require("../../UI/Tag/Tag")),g=w(require("../../UI/TagList/TagList")),b=w(require("../CheckboxInput/CheckboxInput")),_=w(require("../Input/Input"));function w(e){return e&&e.__esModule?e:{default:e}}function y(e){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(y=function(e){return e?l:n})(e)}require("./TagsDropdown.scss");var x="tags-dropdown",N=["#F1F0F0","#E3E2E0","#EEDFDA","#F9DEC9","#FDECC8","#DBECDB","#D3E4EF","#E8DEEE","#F4E0E9","#FFE2DD","#D3EFED","#ECEEDE"],j=function(e){var i,w,y,j,C,E,O,S=e.options,L=e.tagsFullList,k=e.chosenOptions,I=e.onChange,D=e.className,P=e.tagClassname,M=e.listClassName,R=e.onKeyPress,A=e.placeholder,F=e.label,T=e.disabled,H=e.isValuesInTags,B=e.error,q=e.isNotValidateASCII,z=void 0!==q&&q,W=e.noTagsWrap,U=void 0!==W&&W,K=e.headerContent,V=void 0===K?null:K,X=e.footerContent,Y=void 0===X?null:X,$=e.selectAllButtonRef,G=void 0===$?null:$,J=e.unselectAllButtonRef,Q=void 0===J?null:J,Z=e.closeOnSelect,ee=void 0!==Z&&Z,en=e.closeOnRemove,el=void 0!==en&&en,et=e.closeOnRemoveAll,eo=void 0!==et&&et,er=e.closeOnSelectAll,ei=void 0!==er&&er,eu=e.closeOnSelectMobile,ea=void 0!==eu&&eu,ec=e.closeOnRemoveMobile,es=void 0!==ec&&ec,ed=e.closeOnRemoveAllMobile,ev=void 0!==ed&&ed,ef=e.closeOnSelectAllMobile,em=void 0!==ef&&ef,ep=e.fieldKey,eh=e.id,eg=e.noOptionsText,eb=void 0===eg?"No options available":eg,e_=e.mobileSearchPlaceholder,ew=e.isSearchable,ey=void 0===ew||ew,ex=e.useLiveSearch,eN=e.doRequest,ej=e.attributesOfNativeInput,eC=e.isUseLocalOptionsStore,eE=void 0===eC||eC,eO=e.isDefaultOpened,eS=void 0!==eO&&eO,eL=e.withMobileLogic,ek=e.withCreateLogic,eI=e.withActions,eD=e.withSearchInputInList,eP=e.renderOptionsAsTags,eM=e.minItemsForShowMobileSearch,eR=void 0===eM?10:eM,eA=e.onOptionCreate,eF=e.onOptionEdit,eT=e.onOptionDelete,eH=e.onActionConfirmClick,eB=e.onActionCancelClick,eq=e.onDropdownListClose,ez=e.customTriggerRef,eW=e.renderCustomTrigger,eU=e.recalculateListContainerStylesTrigger,eK=(0,c.useRef)(null),eV=(0,c.useRef)(null),eX=(0,c.useRef)(null),eY=(0,c.useRef)(null),e$=(0,c.useRef)(null),eG=(0,c.useRef)(null),eJ=(0,m.default)().isMobile,eQ=eJ&&eL&&window.screen.width<=768,eZ=o((0,c.useState)(eh||ep||Math.random().toString(16).slice(2)),1)[0],e0=o((0,c.useState)(!1),2),e1=e0[0],e2=e0[1],e3=o((0,c.useState)(0),2),e6=e3[0],e8=e3[1],e5=o((0,c.useState)(null),2),e9=e5[0],e4=e5[1],e7=o((0,c.useState)(null),2),ne=e7[0],nn=e7[1],nl=o((0,c.useState)(null),2),nt=nl[0],no=nl[1],nr=o((0,c.useState)(!1),2),ni=nr[0],nu=nr[1],na=o((0,c.useState)(0),2),nc=na[0],ns=na[1],nd=o((0,c.useState)(1),2),nv=nd[0],nf=nd[1],nm=(0,c.useRef)(null),np=o((0,c.useState)(""),2),nh=np[0],ng=np[1],nb=(0,f.useDebounce)({searchValue:nh,delay:600}),n_=o((0,c.useState)(!1),2),nw=n_[0],ny=n_[1],nx=function(e){ng(e),ny(nh!==e&&""===e),nm.current=e},nN=(0,c.useRef)(null),nj=o((0,c.useState)([]),2),nC=nj[0],nE=nj[1],nO=o((0,c.useState)(null),2),nS=nO[0],nL=nO[1],nk=function(e){nL(function(n){return e?t(l({},null!=n?n:{},"function"==typeof e?null==e?void 0:e(n):e),{isChanged:!!n}):e})},nI=(0,c.useMemo)(function(){return!!nS&&(!!nC.filter(function(e){return e.value!==nS.value}).some(function(e){return e.label===nS.label})||null)},[nC,nS]),nD=o((0,c.useState)({}),2),nP=nD[0],nM=nD[1],nR=(0,c.useMemo)(function(){var e=Math.floor(Math.random()*((null==N?void 0:N.length)-1-0+1))+0;return N[e]},[null==nC?void 0:nC.length]),nA=null==nC?void 0:nC.reduce(function(e,n){var l,t=function(e,n){var l=null==e?void 0:e.findIndex(function(e){return e.value===(null==n?void 0:n.value)});-1!==l?e[l]=n:e.push(n)};return n.groupName?null==(l=n.list)||l.map(function(n){return t(e,n)}):t(e,n),e},eE?null==(w=Object.keys(nP))?void 0:w.map(function(e){var n;return{value:e,label:null!=(n=null==nP?void 0:nP[e])?n:""}}):[]),nF=function(e){(eQ?es:el)&&e2(!1),eE&&nM(function(o){return t(l({},o),n({},e,void 0))}),null==I||I(k.filter(function(n){return n!==e}),"chosenOptions")},nT=function(){var e,n;return null!=(n=null!=(e=document.querySelector("div#root"))?e:document.querySelector("div#app"))?n:document.querySelector("div#storybook-root")},nH=function(){var e,n=document.createElement("div");if(n.setAttribute("id",eZ),n.classList.add("tags-dropdown__container"),M&&n.classList.add(M),eQ&&n.addEventListener("click",function(e){e.target&&e.target.id===eZ&&e2(!1)}),eQ){try{null==(t=document.getElementById("mlw-".concat(eZ)))||t.remove()}catch(e){}var l,t,o=document.createElement("div");o.classList.add("tags-dropdown-mobile"),o.setAttribute("id","mlw-".concat(eZ)),null==o||o.append(n),null==(l=nT())||l.append(o)}else null==(e=nT())||e.append(n)},nB=function(){return document.getElementById(eZ)},nq=function(){var e=nB();if(!e||!e1)return!1;var n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,l=null!=(x=null==eX||null==(h=eX.current)?void 0:h.getBoundingClientRect())?x:{},t=l.width,o=l.height,r=void 0===o?0:o,i=l.left,u=l.top,a=void 0===u?0:u,c=null==eG?void 0:eG.current,s=e.getElementsByClassName("tags-dropdown__list")[0],d=null==c?void 0:c.getElementsByClassName("tags-dropdown__header")[0],v=null==c?void 0:c.getElementsByClassName("tags-dropdown__footer")[0],f=Number.parseInt(null!=(N=null==(b=getComputedStyle(c))||null==(g=b.marginTop)?void 0:g.replace("px",""))?N:0,10),m=null!=(j=null==c||null==(_=c.getBoundingClientRect())?void 0:_.height)?j:0,p=500-(null!=(C=null==d||null==(w=d.getBoundingClientRect())?void 0:w.height)?C:0)-(null!=(E=null==v||null==(y=v.getBoundingClientRect())?void 0:y.height)?E:0);if(eQ&&eL)s.style.maxHeight="".concat(p,"px");else{var h,g,b,_,w,y,x,N,j,C,E,O,S,L,k,I,D=null==(O=getComputedStyle(s))?void 0:O.maxHeight,P=null!=ne?ne:Number.parseInt(null!=(k=null==D?void 0:D.replace("px",""))?k:0,10);null!==ne||Number.isNaN(P)||nn(P),void 0!==m&&m>P&&!Number.isNaN(P)&&(m=P-2*f);var M=eW?a-f-(null!=(I=null==ez||null==(L=ez.current)||null==(S=L.getBoundingClientRect())?void 0:S.height)?I:0):a-f,R=n-a-r-2*f,A=e9;!e9&&(null==nC?void 0:nC.length)&&e4(A=M<R||R>=m?"bottom":"top"),m>("top"===A?M:R)&&((m=("top"===A?M:R)-3*f)<200&&(m=200),c&&(c.style.maxHeight="".concat(m,"px"))),e.style.minWidth="".concat(t,"px"),e.style.left="".concat(i,"px"),e.style.top="".concat("bottom"===A?a+r:a-m-2*f,"px")}},nz=function(){var e,n={label:nh,style:{backgroundColor:nR},isEditable:!0,ref:(0,c.createRef)()};(null!=(e=null==eA?void 0:eA(n))?e:new Promise(function(e){return e(1)})).then(function(e){var l,t=Math.random().toString(16).slice(2);n.value=null!=(l=null==e?void 0:e.id)?l:t,nE(function(e){return r(e).concat([n])}),ng(""),nZ(n)})},nW=function(e,n){null==e||e.preventDefault(),null==e||e.stopPropagation(),nk((null==nS?void 0:nS.value)===(null==n?void 0:n.value)?null:n)},nU=function(){var e;(null!=(e=null==eT?void 0:eT(nS))?e:new Promise(function(e){return e(1)})).then(function(){(null==nS?void 0:nS.value)&&nF(null==nS?void 0:nS.value),nE(function(e){return e.filter(function(e){return e.value!==(null==nS?void 0:nS.value)})}),nk(null)})},nK=function(){if(!(null==nS?void 0:nS.isChanged)||nI)return nk(null),!1;null==eF||eF(nS),nE(function(e){return null==e?void 0:e.map(function(e){if(nS&&e.value===(null==nS?void 0:nS.value)){var n=l({},nS);return nk(null),n}return e})})},nV=function(){if(!nS||!(null==e$?void 0:e$.current))return null;var e,n,l,t,o,r,i,u,a,c,s=window.scrollX,d=window.scrollY,v={left:"modal-left",right:"modal-right",top:"modal-top",bottom:"modal-bottom"},f=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,m=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,p=null==nS||null==(e=nS.ref)?void 0:e.current,h=null!=(t=null==p?void 0:p.getBoundingClientRect())?t:{},g=h.x,b=h.y,_=void 0===b?0:b,w=h.width,y=h.height,x=void 0===y?0:y,N=null==eG||null==(n=eG.current)?void 0:n.getBoundingClientRect(),j=f-(null!=(o=null==N?void 0:N.x)?o:0)-(null!=(r=null==N?void 0:N.width)?r:0),C=m-_-d-x;null==(l=Object.values(v))||l.map(function(e){return e$.current&&e$.current.classList.remove(e),e}),e$.current.classList.add(null!=(i=null==v?void 0:v[j<200?"left":"right"])?i:""),e$.current.classList.add(null!=(u=null==v?void 0:v[C<200?"top":"bottom"])?u:""),a=e$.current,(null!=(c=HTMLElement)&&"undefined"!=typeof Symbol&&c[Symbol.hasInstance]?!!c[Symbol.hasInstance](a):a instanceof c)&&(e$.current.style.left="".concat((void 0===g?0:g)+s+(void 0===w?0:w),"px"),e$.current.style.top="".concat(_+d+x,"px"),e$.current.style.transform="translate(".concat(j<200?"calc(-100% + 7px)":"-35px",", ").concat(C<200?"calc(-100% - ".concat(x+10,"px)"):"10px",")"))},nX=function(e){var n,l,t,o,r,i,u=e.target;!e1||(null==(n=nB())?void 0:n.contains(u))||e$.current?e$.current&&!(null==(l=e$.current)?void 0:l.contains(u))&&((null==(i=document)||null==(r=i.getElementById)||null==(o=r.call(i,"editTrigger".concat(null==nS?void 0:nS.value)))||null==(t=o.contains)?void 0:t.call(o,u))||nK()):(e2(!1),null==eq||eq(e))},nY=function(e){var n;nX(e),e.target.isEqualNode(null==eK?void 0:eK.current)||null==eK||null==(n=eK.current)||n.blur()},n$=function(e){var n,l,t,o,r,i;return((null==e?void 0:e.tagName)!=="svg"||(null==e||null==(n=e.parentNode)?void 0:n.className)!=="tag__button")&&(null==e?void 0:e.tagName)!=="line"&&((null==e?void 0:e.tagName)==="svg"&&(null==e||null==(l=e.parentNode)?void 0:l.className)!=="tag__button"||(null==e||null==(o=e.className)||null==(t=o.indexOf)?void 0:t.call(o,"tag__label"))!==-1||(null==e||null==(i=e.className)||null==(r=i.indexOf)?void 0:r.call(i,"tag-list_wrapper"))!==-1||(null==e?void 0:e.className.indexOf("".concat(x,"__trigger")))!==-1||(null==e?void 0:e.className)==="tags-dropdown__arrow")},nG=function(e){if(e.isHiddenInList)return!1;var n=e.title||e.label;return null==nh||!nh.length||!!(null==n?void 0:n.toLowerCase().includes((null==nh?void 0:nh.toLowerCase())||""))},nJ=function(e){return null==e?void 0:e.map(function(e){var n;return(null==e?void 0:e.groupName)?null!=(n=null==e?void 0:e.list)?n:[]:e}).flat()},nQ=(0,c.useCallback)(function(){return null==nC?void 0:nC.reduce(function(e,n){if(null==n?void 0:n.list){var l;e+=(null==n||null==(l=n.list)?void 0:l.length)||0}else++e;return e},0)},[nC]),nZ=function(e){return(null==e||!e.isFreezed)&&(((null==e?void 0:e.closeOnOptionSelect)!==void 0?e.closeOnOptionSelect&&e2(!1):(eQ?ea:ee)&&e2(!1),nx(""),e.value&&k.includes(e.value))?nF(e.value):(e.value&&eE&&nM(function(o){return e.value?t(l({},o),n({},e.value,null==e?void 0:e.label)):o}),e.value&&(null==I||I(r(k).concat([e.value]),"chosenOptions"))),null)},n0=function(e){var n=e;z||(n=(0,v.formatToOnlyASCIICodeText)(n)),nx(n)},n1=function(e){e.target===(null==eV?void 0:eV.current)&&(e.stopPropagation(),e.preventDefault(),e2(!1))},n2=function(){var e,n=null==(e=nJ(nC))?void 0:e.filter(function(e){var n=e.isFreezed,l=e.value;return l&&!n&&!(null==k?void 0:k.includes(l||(null==l?void 0:l.toString())))&&"open_modal"!==l});eE&&nM(function(e){return null==n?void 0:n.reduce(function(e,n){var l=n.value,t=n.label;return l&&(e[l]=t),e},e)}),null==I||I(r(k).concat(r((null==n?void 0:n.map(function(e){var n=e.value;return null!=n?n:""}))||[])),"chosenOptions"),(eQ?em:ei)&&e2(!1)},n3=function(){eE&&nM({}),null==I||I(null==k?void 0:k.filter(function(e){var n,l;return null==(l=nJ(nC))||null==(n=l.find(function(n){return n.value===e}))?void 0:n.isFreezed}),"chosenOptions"),(eQ?ev:eo)&&e2(!1)},n6=(0,c.useCallback)(function(e){eN&&"function"==typeof eN&&+Math.round(e.target.clientHeight+e.target.scrollTop)==+e.target.scrollHeight&&eN(nm.current,!0)},[nC]),n8=function(e){var l,t=e.description,o=e.title||e.label,r=function(e){var n,l=null==e||null==(n=e.toLowerCase())?void 0:n.indexOf(null==nh?void 0:nh.toLowerCase());return -1===l?e:(0,u.jsxs)("pre",{className:"inherit-styles",children:[(0,u.jsx)("span",{children:e.substring(0,l)}),(0,u.jsx)("span",{className:"search-match",children:e.substring(l,l+(null==nh?void 0:nh.length))}),(0,u.jsx)("span",{children:e.substring(l+(null==nh?void 0:nh.length))})]})};return(0,u.jsxs)("button",{type:"button",ref:null==e?void 0:e.ref,onClick:function(n){n.preventDefault(),n.stopPropagation(),nZ(e)},className:(0,a.default)("".concat(x,"__list-item"),n({},"".concat(x,"__list-item_active"),null==k?void 0:k.some(function(n){return n===e.value})),n({},"".concat(x,"__list-item_disabled"),e.disabled),n({},"".concat(x,"__list-item_freezed"),null==e?void 0:e.isFreezed),n({},"".concat(x,"__list-item--editing"),(null==e?void 0:e.value)===(null==nS?void 0:nS.value)),e.className),children:[!eQ&&(0,u.jsx)("span",{className:(0,a.default)("".concat(x,"__active-icon"),n({},"".concat(x,"__active-icon_active"),null==k?void 0:k.some(function(n){return n===e.value}))),children:(0,u.jsx)(d.Check,{width:16,height:16,className:"color--text"})}),(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__list-item-body")),children:[eP?(0,u.jsx)(h.default,{className:(0,a.default)("".concat(x,"__list-item-title"),null==e?void 0:e.labelClassName,{"tag_with-btn":!(null==e?void 0:e.isFreezed)}),label:o?r(o):"",style:null==e?void 0:e.style,isNoDismiss:!0},null==e?void 0:e.value):(0,u.jsx)("span",{className:(0,a.default)("".concat(x,"__list-item-title"),e.labelClassName),children:o?r(o):""}),t&&(0,u.jsx)("span",{className:(0,a.default)("".concat(x,"__list-item-description")),children:t})]}),!eQ&&(null==e?void 0:e.isEditable)&&eF&&eT&&(0,u.jsx)("div",{id:"editTrigger".concat(null==e?void 0:e.value),className:(0,a.default)("".concat(x,"__list-item-edit-trigger")),onClick:function(n){return nW(n,e)},children:(0,u.jsx)(d.MoreHorizontal,{})}),eQ?null!=(l=null==e?void 0:e.customMobileIcon)?l:(0,u.jsx)(b.default,{value:null==k?void 0:k.some(function(n){return n===e.value}),onChange:function(){nZ(e)},label:"",id:""}):""]},"".concat(x,"__list-item-").concat(e.id||e.value))},n5=function(){return(0,u.jsx)(_.default,l({ref:eK,className:(0,a.default)("".concat(x,"__input"),n({},"".concat(x,"__input--in-list"),eD)),value:nh,onChange:n0,placeholder:A||"Select from list",attributesOfNativeInput:t(l({},ej),{onKeyDown:function(e){13===e.keyCode&&ek&&eA&&nA.every(function(e){var n=e.label;return(null==n?void 0:n.toLowerCase())!==(null==nh?void 0:nh.toLowerCase())})&&nz(),null==R||R(e,nh)}})},ek?{symbolsLimit:50}:{}))},n9=(0,c.useCallback)(function(){var e;return null!=(e=null==eW?void 0:eW({chosenOptions:k,singleLevelOptions:nA,deleteChosen:nF,inputRef:eK,onSearchHandler:n0,isOpen:e1,setIsOpen:e2}))?e:(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__trigger"),n({"tags-dropdown__error":B},"".concat(x,"__trigger--with-actions"),eI)),onClick:function(e){var n=e.target;(null==n?void 0:n.tagName)==="INPUT"?e2(!0):n$(n)&&e2(function(e){return!e})},children:[U?(0,u.jsx)(g.default,{items:null==k?void 0:k.map(function(e,n){var l=null==nA?void 0:nA.find(function(n){return n.value===e});return{value:e,label:H?null==l?void 0:l.value:(null==l?void 0:l.label)||(null==l?void 0:l.name)||(null==l?void 0:l.title),id:n,className:null==l?void 0:l.labelClassName,style:null==l?void 0:l.style}}),disableShowMore:!0}):null==k?void 0:k.map(function(e){var n=null==nA?void 0:nA.find(function(n){return n.value===e}),l=H?null==n?void 0:n.value:(null==n?void 0:n.label)||(null==n?void 0:n.name)||(null==n?void 0:n.title);return(0,u.jsx)(h.default,{className:(0,a.default)(P,null==n?void 0:n.labelClassName,{"tag_with-btn":!(null==n?void 0:n.isFreezed)}),label:l,style:null==n?void 0:n.style,removeItem:(null==n?void 0:n.isFreezed)||(null==n?void 0:n.readOnly)?void 0:function(){return nF(e)},isNoDismiss:!1},e)}),(null==k?void 0:k.length)!==0&&U?"":n5(),(0,u.jsx)("span",{className:(0,a.default)("".concat(x,"__arrow"),n({},"".concat(x,"__arrow_active"),e1)),children:eQ?(0,u.jsx)(d.Code,{className:"mobile-icon"}):e1?(0,u.jsx)(d.ChevronUp,{className:"color--text"}):(0,u.jsx)(d.ChevronDown,{className:"color--text"})})]})},[k,nA,eK,e1]);return(0,c.useLayoutEffect)(function(){return nH(),eS&&!eJ&&e2(!0),function(){var e,n;null==(e=nB())||e.remove(),null==(n=document.getElementById("mlw-".concat(eZ)))||n.remove()}},[]),(0,c.useLayoutEffect)(function(){var e;return eQ?(window.removeEventListener("mousewheel",nY),window.removeEventListener("wheel",nY),window.removeEventListener("touchmove",nY),window.removeEventListener("mouseup",nX)):(window.addEventListener("mousewheel",nY),window.addEventListener("wheel",nY),window.addEventListener("touchmove",nY),window.addEventListener("mouseup",nX)),null==(e=nB())||e.addEventListener("click",nY),function(){var e;window.removeEventListener("mousewheel",nY),window.removeEventListener("mouseup",nX),window.removeEventListener("wheel",nY),window.removeEventListener("touchmove",nY),null==(e=nB())||e.removeEventListener("click",nY)}},[nB,eQ]),(0,c.useLayoutEffect)(function(){e1&&(nq(),nV())},[e1,S,k,nh,eQ,null==eG||null==(j=eG.current)||null==(y=j.getBoundingClientRect())?void 0:y.height,eU]),(0,c.useEffect)(function(){var e;eE&&(null==k?void 0:k.length)!==(null==(e=Object.keys(nP))?void 0:e.length)&&nC.map(function(e){var o;return(null==e?void 0:e.value)&&!(null==nP?void 0:nP[null==e||null==(o=e.value)?void 0:o.toString()])&&nM(function(o){var r;return e.value?t(l({},o),n({},null==e||null==(r=e.value)?void 0:r.toString(),null==e?void 0:e.label)):o}),e})},[k,eE]),(0,c.useEffect)(function(){var e,n,l,t,o,r,i,u,a=function(){e8(window.scrollY)},c=e1?"addEventListener":"removeEventListener";null==G||null==(e=G.current)||e[c]("click",n2,!0),null==Q||null==(n=Q.current)||n[c]("click",n3,!0),e1?(eQ&&eL||window.removeEventListener("scroll",a),(null==ez?void 0:ez.current)&&(ez.current.style.pointerEvents="none"),null==(l=nB())||l.classList.add("tags-dropdown__container--opened"),eQ?null==eK||null==(i=eK.current)||null==(r=i.blur)||r.call(i):null==eK||null==(o=eK.current)||null==(t=o.focus)||t.call(o)):(eQ&&eL||window.addEventListener("scroll",a),(null==ez?void 0:ez.current)&&(ez.current.style.pointerEvents="auto"),null==(u=nB())||u.classList.remove("tags-dropdown__container--opened"),eD&&nx(""),e4(null),ng(""))},[e1]),(0,c.useEffect)(function(){var e,n,l,t,o,r=function(e){var n;ns(Number.parseInt(null==(n=e.target.scrollTop)?void 0:n.toString(),10))},i=function(e){e.preventDefault(),window.scrollTo({top:e6})};return e1&&eQ&&(null==eY?void 0:eY.current)&&(null==eY||null==(e=eY.current)||e.addEventListener("scroll",r),no((null==eY||null==(n=eY.current)?void 0:n.scrollHeight)>(null==eY||null==(l=eY.current)?void 0:l.clientHeight)),null===nt&&nu((null==eY||null==(t=eY.current)?void 0:t.scrollHeight)>(null==eY||null==(o=eY.current)?void 0:o.clientHeight))),e1&&eY&&eY.current&&(eY.current.addEventListener("scroll",n6),eQ&&eL||window.addEventListener("scroll",i)),function(){var e,n;eQ&&eL||window.removeEventListener("scroll",i),null==eY||null==(e=eY.current)||e.removeEventListener("scroll",n6),null==eY||null==(n=eY.current)||n.removeEventListener("scroll",r)}},[e1,eQ,null==eY?void 0:eY.current,null==eY||null==(C=eY.current)?void 0:C.scrollHeight,null==eY||null==(E=eY.current)?void 0:E.clientHeight]),(0,c.useEffect)(function(){if(null==eY?void 0:eY.current){var e,n,l;nf(Number.parseInt((e=(null==eY||null==(n=eY.current)?void 0:n.scrollHeight)-(null==eY||null==(l=eY.current)?void 0:l.clientHeight),e.toString()),10))}},[nc,null==eY?void 0:eY.current]),(0,c.useEffect)(function(){ey&&ex&&(nb||nw||e1)&&(null==eN||eN(nb))},[e1,nb,nw]),(0,c.useEffect)(function(){var e;nE(null==(e=L||S)?void 0:e.map(function(e){return t(l({},e),{ref:(0,c.createRef)()})}))},[S,L]),(0,c.useEffect)(function(){if(nS){var e,n;nV(),null==nN||null==(n=nN.current)||null==(e=n.focus)||e.call(n)}},[null==nS?void 0:nS.value]),(0,u.jsxs)("div",{className:(0,a.default)(x,D,(n(O={},"".concat(x,"_disabled"),T),n(O,"".concat(x,"-mobile"),eQ),n(O,"".concat(x,"--focused"),e1&&!(null==ez?void 0:ez.current)&&!eQ),n(O,"".concat(x,"--custom-trigger"),!!(null==ez?void 0:ez.current)),O)),ref:eX,children:[n9(),eI&&(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__actions")),children:[(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__actions-item")),onClick:eH,children:(0,u.jsx)(d.Check,{})}),(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__actions-item")),onClick:eB,children:(0,u.jsx)(d.X,{})})]}),e1&&((i=nB())?(0,s.createPortal)(function(){var e,o,r,i=null==nC?void 0:nC.reduce(function(e,n){if(n.groupName){var o,r=null==n||null==(o=n.list)?void 0:o.filter(function(e){return nG(e)});(null==r?void 0:r.length)&&e.push(t(l({},n),{list:r}))}else nG(n)&&e.push(n);return e},[]),c=[],v=!0,f=!1,m=void 0;try{for(var g,b,w,y=i[Symbol.iterator]();!(v=(w=y.next()).done);v=!0){var j,C,E,O,S=w.value;S.groupName?c.push((0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"-group"),S.className),children:[(0,u.jsx)("span",{className:"".concat(x,"-group__name"),children:S.groupName}),null==(j=S.list)?void 0:j.map(function(e){return n8(e)})]},null==(O=S.groupName)||null==(E=O.toString())?void 0:E.replace(/ /g,"_").concat(null==(C=Date.now())?void 0:C.toString()))):S.readOnly||c.push(n8(S))}}catch(e){f=!0,m=e}finally{try{v||null==y.return||y.return()}finally{if(f)throw m}}return(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__container-wrapper")),ref:eV,onClick:eQ?n1:function(){},children:(0,u.jsxs)("div",{ref:eG,className:(0,a.default)("".concat(x,"__selector-wrapper"),n({},"".concat(x,"__selector-wrapper--fixed-height"),ni&&eQ)),children:[V||eQ?(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__header"),(n(o={},"".concat(x,"__header-with-shadow"),nt&&eQ),n(o,"".concat(x,"__header-with-shadow-hidden"),0===nc),o)),children:[eQ&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__header-row")),children:[(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__label")),children:F}),(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__close-icon")),onClick:function(e){e.stopPropagation(),e2(!1)},children:(0,u.jsx)(d.X,{onClick:function(e){e.stopPropagation(),e2(!1)}})})]}),nQ()>(eR||10)&&(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__header-row")),children:(0,u.jsx)(_.default,l({className:"".concat(x,"__input"),value:nh,onChange:function(e){return nx(e)},placeholder:e_||"Search",withDelete:!0,onMouseDown:function(){e1||e2(!0)}},ej))})]}),V&&(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__header-row")),children:V})]}):null,eD&&(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__input-list-wrapper")),children:n5()}),ek&&eA&&nh&&(null==i?void 0:i.length)&&nA.every(function(e){var n=e.label;return(null==n?void 0:n.toLowerCase())!==(null==nh?void 0:nh.toLowerCase())})?(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__creatable-helper")),children:"Select an option or create one"}):null,(0,u.jsxs)("div",{ref:eY,className:"".concat(x,"__list ").concat(V||eQ?"".concat(x,"__list--with-header"):""," ").concat(Y?"".concat(x,"__list--with-footer"):""),children:[c,(null==(g=i.filter(function(e){return"open_modal"!==e.value}))?void 0:g.length)!==0||ek&&nh?null:(0,u.jsx)("div",{className:"".concat(x,"__no-options"),children:eb})]}),(Y||eQ)&&(null==(b=i.filter(function(e){return"open_modal"!==e.value}))?void 0:b.length)>0?(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__footer"),(n(r={},"".concat(x,"__footer-with-shadow"),eQ&&nt),n(r,"".concat(x,"__footer-with-shadow-hidden"),nc===nv),r)),children:[Y,eQ&&(0,u.jsxs)("button",{type:"button",onClick:function(){return e2(!1)},children:["Apply",(null==k?void 0:k.length)?"(".concat(null==k?void 0:k.length,")"):""]})]}):null,nS&&(0,s.createPortal)((0,u.jsxs)("div",{ref:e$,className:(0,a.default)("".concat(x,"__edit-option-modal")),children:[(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__edit-option-modal-section")),children:[(0,u.jsx)(_.default,{value:null==nS?void 0:nS.label,onChange:function(e){return nk(function(n){return t(l({},n),{label:e})})},error:!!nI,onKeyDown:function(e){13===e&&nK()},symbolsLimit:"50",ref:nN}),(0,u.jsx)(p.default,{variant:"link",icon:(0,u.jsx)(d.Trash2,{}),label:"Delete",onClick:nU})]}),(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__edit-option-modal-section-divider"))}),(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__edit-option-modal-section")),children:[(0,u.jsx)("h3",{children:"Colors"}),(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__edit-option-modal-section-colors")),children:null==N?void 0:N.map(function(e){var n;return(0,u.jsx)("div",{className:"color-block",style:{backgroundColor:e},onClick:function(){return nk(function(n){return t(l({},n),{style:t(l({},n?n.style:{}),{backgroundColor:e})})})},children:(null==nS||null==(n=nS.style)?void 0:n.backgroundColor)===e?(0,u.jsx)(d.Check,{}):null},e)})})]})]},"editOptionModal".concat(null==nS?void 0:nS.value)),null!=(e=document.getElementById("root"))?e:document.body),ek&&eA&&nh&&nA.every(function(e){var n=e.label;return(null==n?void 0:n.toLowerCase())!==(null==nh?void 0:nh.toLowerCase())})&&(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__create-option")),onClick:nz,children:["Create",(0,u.jsx)(h.default,{label:nh,style:{backgroundColor:nR},isNoDismiss:!0})]})]})})}(),i):null)]})};
1
+ function e(e,n){(null==n||n>e.length)&&(n=e.length);for(var l=0,t=Array(n);l<n;l++)t[l]=e[l];return t}function n(e,n,l){return n in e?Object.defineProperty(e,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[n]=l,e}function l(e){for(var l=1;l<arguments.length;l++){var t=null!=arguments[l]?arguments[l]:{},o=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.forEach(function(l){n(e,l,t[l])})}return e}function t(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):(function(e,n){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);l.push.apply(l,t)}return l})(Object(n)).forEach(function(l){Object.defineProperty(e,l,Object.getOwnPropertyDescriptor(n,l))}),e}function o(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var l,t,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var r=[],i=!0,u=!1;try{for(o=o.call(e);!(i=(l=o.next()).done)&&(r.push(l.value),!n||r.length!==n);i=!0);}catch(e){u=!0,t=e}finally{try{i||null==o.return||o.return()}finally{if(u)throw t}}return r}}(e,n)||i(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(n){return function(n){if(Array.isArray(n))return e(n)}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||i(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(n,l){if(n){if("string"==typeof n)return e(n,l);var t=Object.prototype.toString.call(n).slice(8,-1);if("Object"===t&&n.constructor&&(t=n.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return e(n,l)}}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return j}});var u=require("react/jsx-runtime"),a=w(require("classnames")),c=function(e,n){if(e&&e.__esModule)return e;if(null===e||(void 0===e?"undefined":e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)!="object"&&"function"!=typeof e)return{default:e};var l=y(n);if(l&&l.has(e))return l.get(e);var t={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var i=o?Object.getOwnPropertyDescriptor(e,r):null;i&&(i.get||i.set)?Object.defineProperty(t,r,i):t[r]=e[r]}return t.default=e,l&&l.set(e,t),t}(require("react")),s=require("react-dom"),d=require("react-feather"),v=require("../../../Functions/fieldValueFormatters"),f=require("../../../Functions/useDebounce"),m=w(require("../../../Functions/useIsMobile/useIsMobile")),p=w(require("../../UI/Button/Button")),h=w(require("../../UI/Tag/Tag")),g=w(require("../../UI/TagList/TagList")),b=w(require("../CheckboxInput/CheckboxInput")),_=w(require("../Input/Input"));function w(e){return e&&e.__esModule?e:{default:e}}function y(e){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(y=function(e){return e?l:n})(e)}require("./TagsDropdown.scss");var x="tags-dropdown",N=["#F1F0F0","#E3E2E0","#EEDFDA","#F9DEC9","#FDECC8","#DBECDB","#D3E4EF","#E8DEEE","#F4E0E9","#FFE2DD","#D3EFED","#ECEEDE"],j=function(e){var i,w,y,j,C,E,O,S=e.options,L=e.tagsFullList,k=e.chosenOptions,I=e.onChange,D=e.className,P=e.tagClassname,M=e.listClassName,R=e.onKeyPress,A=e.placeholder,F=e.label,T=e.disabled,H=e.isValuesInTags,B=e.error,q=e.isNotValidateASCII,z=void 0!==q&&q,W=e.noTagsWrap,U=void 0!==W&&W,K=e.headerContent,V=void 0===K?null:K,X=e.footerContent,Y=void 0===X?null:X,$=e.selectAllButtonRef,G=void 0===$?null:$,J=e.unselectAllButtonRef,Q=void 0===J?null:J,Z=e.closeOnSelect,ee=void 0!==Z&&Z,en=e.closeOnRemove,el=void 0!==en&&en,et=e.closeOnRemoveAll,eo=void 0!==et&&et,er=e.closeOnSelectAll,ei=void 0!==er&&er,eu=e.closeOnSelectMobile,ea=void 0!==eu&&eu,ec=e.closeOnRemoveMobile,es=void 0!==ec&&ec,ed=e.closeOnRemoveAllMobile,ev=void 0!==ed&&ed,ef=e.closeOnSelectAllMobile,em=void 0!==ef&&ef,ep=e.fieldKey,eh=e.id,eg=e.noOptionsText,eb=void 0===eg?"No options available":eg,e_=e.mobileSearchPlaceholder,ew=e.isSearchable,ey=void 0===ew||ew,ex=e.useLiveSearch,eN=e.doRequest,ej=e.attributesOfNativeInput,eC=e.isUseLocalOptionsStore,eE=void 0===eC||eC,eO=e.isDefaultOpened,eS=void 0!==eO&&eO,eL=e.withMobileLogic,ek=e.withCreateLogic,eI=e.withActions,eD=e.withSearchInputInList,eP=e.renderOptionsAsTags,eM=e.minItemsForShowMobileSearch,eR=void 0===eM?10:eM,eA=e.onOptionCreate,eF=e.onOptionEdit,eT=e.onOptionDelete,eH=e.onActionConfirmClick,eB=e.onActionCancelClick,eq=e.onDropdownListClose,ez=e.customTriggerRef,eW=e.renderCustomTrigger,eU=e.recalculateListContainerStylesTrigger,eK=(0,c.useRef)(null),eV=(0,c.useRef)(null),eX=(0,c.useRef)(null),eY=(0,c.useRef)(null),e$=(0,c.useRef)(null),eG=(0,c.useRef)(null),eJ=(0,m.default)().isMobile,eQ=eJ&&eL&&window.screen.width<=768,eZ=o((0,c.useState)(eh||ep||Math.random().toString(16).slice(2)),1)[0],e0=o((0,c.useState)(!1),2),e1=e0[0],e2=e0[1],e3=o((0,c.useState)(0),2),e6=e3[0],e8=e3[1],e5=o((0,c.useState)(null),2),e9=e5[0],e4=e5[1],e7=o((0,c.useState)(null),2),ne=e7[0],nn=e7[1],nl=o((0,c.useState)(null),2),nt=nl[0],no=nl[1],nr=o((0,c.useState)(!1),2),ni=nr[0],nu=nr[1],na=o((0,c.useState)(0),2),nc=na[0],ns=na[1],nd=o((0,c.useState)(1),2),nv=nd[0],nf=nd[1],nm=(0,c.useRef)(null),np=o((0,c.useState)(""),2),nh=np[0],ng=np[1],nb=(0,f.useDebounce)({searchValue:nh,delay:600}),n_=o((0,c.useState)(!1),2),nw=n_[0],ny=n_[1],nx=function(e){ng(e),ny(nh!==e&&""===e),nm.current=e},nN=(0,c.useRef)(null),nj=o((0,c.useState)([]),2),nC=nj[0],nE=nj[1],nO=o((0,c.useState)(null),2),nS=nO[0],nL=nO[1],nk=function(e){nL(function(n){return e?t(l({},null!=n?n:{},"function"==typeof e?null==e?void 0:e(n):e),{isChanged:!!n}):e})},nI=(0,c.useMemo)(function(){return!!nS&&(!!nC.filter(function(e){return e.value!==nS.value}).some(function(e){return e.label===nS.label})||null)},[nC,nS]),nD=o((0,c.useState)({}),2),nP=nD[0],nM=nD[1],nR=(0,c.useMemo)(function(){var e=Math.floor(Math.random()*((null==N?void 0:N.length)-1-0+1))+0;return N[e]},[null==nC?void 0:nC.length]),nA=null==nC?void 0:nC.reduce(function(e,n){var l,t=function(e,n){var l=null==e?void 0:e.findIndex(function(e){return e.value===(null==n?void 0:n.value)});-1!==l?e[l]=n:e.push(n)};return n.groupName?null==(l=n.list)||l.map(function(n){return t(e,n)}):t(e,n),e},eE?null==(w=Object.keys(nP))?void 0:w.map(function(e){var n;return{value:e,label:null!=(n=null==nP?void 0:nP[e])?n:""}}):[]),nF=function(e){(eQ?es:el)&&e2(!1),eE&&nM(function(o){return t(l({},o),n({},e,void 0))}),null==I||I(k.filter(function(n){return n!==e}),"chosenOptions")},nT=function(){var e,n;return null!=(n=null!=(e=document.querySelector("div#root"))?e:document.querySelector("div#app"))?n:document.querySelector("div#storybook-root")},nH=function(){var e,n=document.createElement("div");if(n.setAttribute("id",eZ),n.classList.add("tags-dropdown__container"),M&&n.classList.add(M),eQ&&n.addEventListener("click",function(e){e.target&&e.target.id===eZ&&e2(!1)}),eQ){try{null==(t=document.getElementById("mlw-".concat(eZ)))||t.remove()}catch(e){}var l,t,o=document.createElement("div");o.classList.add("tags-dropdown-mobile"),o.setAttribute("id","mlw-".concat(eZ)),null==o||o.append(n),null==(l=nT())||l.append(o)}else null==(e=nT())||e.append(n)},nB=function(){return document.getElementById(eZ)},nq=function(){var e=nB();if(!e||!e1)return!1;var n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,l=null!=(x=null==eX||null==(h=eX.current)?void 0:h.getBoundingClientRect())?x:{},t=l.width,o=l.height,r=void 0===o?0:o,i=l.left,u=l.top,a=void 0===u?0:u,c=null==eG?void 0:eG.current,s=e.getElementsByClassName("tags-dropdown__list")[0],d=null==c?void 0:c.getElementsByClassName("tags-dropdown__header")[0],v=null==c?void 0:c.getElementsByClassName("tags-dropdown__footer")[0],f=Number.parseInt(null!=(N=null==(b=getComputedStyle(c))||null==(g=b.marginTop)?void 0:g.replace("px",""))?N:0,10),m=null!=(j=null==c||null==(_=c.getBoundingClientRect())?void 0:_.height)?j:0,p=500-(null!=(C=null==d||null==(w=d.getBoundingClientRect())?void 0:w.height)?C:0)-(null!=(E=null==v||null==(y=v.getBoundingClientRect())?void 0:y.height)?E:0);if(eQ&&eL)s.style.maxHeight="".concat(p,"px");else{var h,g,b,_,w,y,x,N,j,C,E,O,S,L,k,I,D=null==(O=getComputedStyle(s))?void 0:O.maxHeight,P=null!=ne?ne:Number.parseInt(null!=(k=null==D?void 0:D.replace("px",""))?k:0,10);null!==ne||Number.isNaN(P)||nn(P),void 0!==m&&m>P&&!Number.isNaN(P)&&(m=P-2*f);var M=eW?a-f-(null!=(I=null==ez||null==(L=ez.current)||null==(S=L.getBoundingClientRect())?void 0:S.height)?I:0):a-f,R=n-a-r-2*f,A=e9;!e9&&(null==nC?void 0:nC.length)&&e4(A=M<R||R>=m?"bottom":"top"),m>("top"===A?M:R)&&((m=("top"===A?M:R)-3*f)<200&&(m=200),c&&(c.style.maxHeight="".concat(m,"px"))),e.style.minWidth="".concat(t,"px"),e.style.left="".concat(i,"px"),e.style.top="".concat("bottom"===A?a+r:a-m-2*f,"px")}},nz=function(){var e,n={label:nh,style:{backgroundColor:nR},isEditable:!0,ref:(0,c.createRef)()};(null!=(e=null==eA?void 0:eA(n))?e:new Promise(function(e){return e(1)})).then(function(e){var l,t=Math.random().toString(16).slice(2);n.value=null!=(l=null==e?void 0:e.id)?l:t,nE(function(e){return r(e).concat([n])}),ng(""),nZ(n)})},nW=function(e,n){null==e||e.preventDefault(),null==e||e.stopPropagation(),nk((null==nS?void 0:nS.value)===(null==n?void 0:n.value)?null:n)},nU=function(){var e;(null!=(e=null==eT?void 0:eT(nS))?e:new Promise(function(e){return e(1)})).then(function(){(null==nS?void 0:nS.value)&&nF(null==nS?void 0:nS.value),nE(function(e){return e.filter(function(e){return e.value!==(null==nS?void 0:nS.value)})}),nk(null)})},nK=function(){if(!(null==nS?void 0:nS.isChanged)||nI)return nk(null),!1;null==eF||eF(nS),nE(function(e){return null==e?void 0:e.map(function(e){if(nS&&e.value===(null==nS?void 0:nS.value)){var n=l({},nS);return nk(null),n}return e})})},nV=function(){if(!nS||!(null==e$?void 0:e$.current))return null;var e,n,l,t,o,r,i,u,a,c,s=window.scrollX,d=window.scrollY,v={left:"modal-left",right:"modal-right",top:"modal-top",bottom:"modal-bottom"},f=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,m=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,p=null==nS||null==(e=nS.ref)?void 0:e.current,h=null!=(t=null==p?void 0:p.getBoundingClientRect())?t:{},g=h.x,b=h.y,_=void 0===b?0:b,w=h.width,y=h.height,x=void 0===y?0:y,N=null==eG||null==(n=eG.current)?void 0:n.getBoundingClientRect(),j=f-(null!=(o=null==N?void 0:N.x)?o:0)-(null!=(r=null==N?void 0:N.width)?r:0),C=m-_-d-x;null==(l=Object.values(v))||l.map(function(e){return e$.current&&e$.current.classList.remove(e),e}),e$.current.classList.add(null!=(i=null==v?void 0:v[j<200?"left":"right"])?i:""),e$.current.classList.add(null!=(u=null==v?void 0:v[C<200?"top":"bottom"])?u:""),a=e$.current,(null!=(c=HTMLElement)&&"undefined"!=typeof Symbol&&c[Symbol.hasInstance]?!!c[Symbol.hasInstance](a):a instanceof c)&&(e$.current.style.left="".concat((void 0===g?0:g)+s+(void 0===w?0:w),"px"),e$.current.style.top="".concat(_+d+x,"px"),e$.current.style.transform="translate(".concat(j<200?"calc(-100% + 7px)":"-35px",", ").concat(C<200?"calc(-100% - ".concat(x+10,"px)"):"10px",")"))},nX=function(e){var n,l,t,o,r,i,u=e.target;!e1||(null==(n=nB())?void 0:n.contains(u))||e$.current?e$.current&&!(null==(l=e$.current)?void 0:l.contains(u))&&((null==(i=document)||null==(r=i.getElementById)||null==(o=r.call(i,"editTrigger".concat(null==nS?void 0:nS.value)))||null==(t=o.contains)?void 0:t.call(o,u))||nK()):(e2(!1),null==eq||eq(e))},nY=function(e){var n;nX(e),e.target.isEqualNode(null==eK?void 0:eK.current)||null==eK||null==(n=eK.current)||n.blur()},n$=function(e){var n,l,t,o,r,i;return((null==e?void 0:e.tagName)!=="svg"||(null==e||null==(n=e.parentNode)?void 0:n.className)!=="tag__button")&&(null==e?void 0:e.tagName)!=="line"&&((null==e?void 0:e.tagName)==="svg"&&(null==e||null==(l=e.parentNode)?void 0:l.className)!=="tag__button"||(null==e||null==(o=e.className)||null==(t=o.indexOf)?void 0:t.call(o,"tag__label"))!==-1||(null==e||null==(i=e.className)||null==(r=i.indexOf)?void 0:r.call(i,"tag-list_wrapper"))!==-1||(null==e?void 0:e.className.indexOf("".concat(x,"__trigger")))!==-1||(null==e?void 0:e.className)==="tags-dropdown__arrow")},nG=function(e){if(e.isHiddenInList)return!1;var n=e.title||e.label;return null==nh||!nh.length||!!(null==n?void 0:n.toLowerCase().includes((null==nh?void 0:nh.toLowerCase())||""))},nJ=function(e){return null==e?void 0:e.map(function(e){var n;return(null==e?void 0:e.groupName)?null!=(n=null==e?void 0:e.list)?n:[]:e}).flat()},nQ=(0,c.useCallback)(function(){return null==nC?void 0:nC.reduce(function(e,n){if(null==n?void 0:n.list){var l;e+=(null==n||null==(l=n.list)?void 0:l.length)||0}else++e;return e},0)},[nC]),nZ=function(e){return(null==e||!e.isFreezed)&&(((null==e?void 0:e.closeOnOptionSelect)!==void 0?e.closeOnOptionSelect&&e2(!1):(eQ?ea:ee)&&e2(!1),nx(""),e.value&&k.includes(e.value))?nF(e.value):(e.value&&eE&&nM(function(o){return e.value?t(l({},o),n({},e.value,null==e?void 0:e.label)):o}),e.value&&(null==I||I(r(k).concat([e.value]),"chosenOptions"))),null)},n0=function(e){var n=e;z||(n=(0,v.formatToOnlyASCIICodeText)(n)),nx(n)},n1=function(e){e.target===(null==eV?void 0:eV.current)&&(e.stopPropagation(),e.preventDefault(),e2(!1))},n2=function(){var e,n=null==(e=nJ(nC))?void 0:e.filter(function(e){var n=e.isFreezed,l=e.value;return l&&!n&&!(null==k?void 0:k.includes(l||(null==l?void 0:l.toString())))&&"open_modal"!==l});eE&&nM(function(e){return null==n?void 0:n.reduce(function(e,n){var l=n.value,t=n.label;return l&&(e[l]=t),e},e)}),null==I||I(r(k).concat(r((null==n?void 0:n.map(function(e){var n=e.value;return null!=n?n:""}))||[])),"chosenOptions"),(eQ?em:ei)&&e2(!1)},n3=function(){eE&&nM({}),null==I||I(null==k?void 0:k.filter(function(e){var n,l;return null==(l=nJ(nC))||null==(n=l.find(function(n){return n.value===e}))?void 0:n.isFreezed}),"chosenOptions"),(eQ?ev:eo)&&e2(!1)},n6=(0,c.useCallback)(function(e){eN&&"function"==typeof eN&&+Math.round(e.target.clientHeight+e.target.scrollTop)==+e.target.scrollHeight&&eN(nm.current,!0)},[nC]),n8=function(e){var l,t=e.description,o=e.title||e.label,r=function(e){var n,l=null==e||null==(n=e.toLowerCase())?void 0:n.indexOf(null==nh?void 0:nh.toLowerCase());return -1===l?e:(0,u.jsxs)("pre",{className:"inherit-styles",children:[(0,u.jsx)("span",{children:e.substring(0,l)}),(0,u.jsx)("span",{className:"search-match bg--yellow",children:e.substring(l,l+(null==nh?void 0:nh.length))}),(0,u.jsx)("span",{children:e.substring(l+(null==nh?void 0:nh.length))})]})};return(0,u.jsxs)("button",{type:"button",ref:null==e?void 0:e.ref,onClick:function(n){n.preventDefault(),n.stopPropagation(),nZ(e)},className:(0,a.default)("".concat(x,"__list-item"),n({},"".concat(x,"__list-item_active"),null==k?void 0:k.some(function(n){return n===e.value})),n({},"".concat(x,"__list-item_disabled"),e.disabled),n({},"".concat(x,"__list-item_freezed"),null==e?void 0:e.isFreezed),n({},"".concat(x,"__list-item--editing"),(null==e?void 0:e.value)===(null==nS?void 0:nS.value)),e.className),children:[!eQ&&(0,u.jsx)("span",{className:(0,a.default)("".concat(x,"__active-icon"),n({},"".concat(x,"__active-icon_active"),null==k?void 0:k.some(function(n){return n===e.value}))),children:(0,u.jsx)(d.Check,{width:16,height:16,className:"color--text"})}),(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__list-item-body")),children:[eP?(0,u.jsx)(h.default,{className:(0,a.default)("".concat(x,"__list-item-title"),null==e?void 0:e.labelClassName,{"tag_with-btn":!(null==e?void 0:e.isFreezed)}),label:o?r(o):"",style:null==e?void 0:e.style,isNoDismiss:!0},null==e?void 0:e.value):(0,u.jsx)("span",{className:(0,a.default)("".concat(x,"__list-item-title"),e.labelClassName),children:o?r(o):""}),t&&(0,u.jsx)("span",{className:(0,a.default)("".concat(x,"__list-item-description")),children:t})]}),!eQ&&(null==e?void 0:e.isEditable)&&eF&&eT&&(0,u.jsx)("div",{id:"editTrigger".concat(null==e?void 0:e.value),className:(0,a.default)("".concat(x,"__list-item-edit-trigger")),onClick:function(n){return nW(n,e)},children:(0,u.jsx)(d.MoreHorizontal,{})}),eQ?null!=(l=null==e?void 0:e.customMobileIcon)?l:(0,u.jsx)(b.default,{value:null==k?void 0:k.some(function(n){return n===e.value}),onChange:function(){nZ(e)},label:"",id:""}):""]},"".concat(x,"__list-item-").concat(e.id||e.value))},n5=function(){return(0,u.jsx)(_.default,l({ref:eK,className:(0,a.default)("".concat(x,"__input"),n({},"".concat(x,"__input--in-list"),eD)),value:nh,onChange:n0,placeholder:A||"Select from list",attributesOfNativeInput:t(l({},ej),{onKeyDown:function(e){13===e.keyCode&&ek&&eA&&nA.every(function(e){var n=e.label;return(null==n?void 0:n.toLowerCase())!==(null==nh?void 0:nh.toLowerCase())})&&nz(),null==R||R(e,nh)}})},ek?{symbolsLimit:50}:{}))},n9=(0,c.useCallback)(function(){var e;return null!=(e=null==eW?void 0:eW({chosenOptions:k,singleLevelOptions:nA,deleteChosen:nF,inputRef:eK,onSearchHandler:n0,isOpen:e1,setIsOpen:e2}))?e:(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__trigger"),n({"tags-dropdown__error":B},"".concat(x,"__trigger--with-actions"),eI)),onClick:function(e){var n=e.target;(null==n?void 0:n.tagName)==="INPUT"?e2(!0):n$(n)&&e2(function(e){return!e})},children:[U?(0,u.jsx)(g.default,{items:null==k?void 0:k.map(function(e,n){var l=null==nA?void 0:nA.find(function(n){return n.value===e});return{value:e,label:H?null==l?void 0:l.value:(null==l?void 0:l.label)||(null==l?void 0:l.name)||(null==l?void 0:l.title),id:n,className:null==l?void 0:l.labelClassName,style:null==l?void 0:l.style}}),disableShowMore:!0}):null==k?void 0:k.map(function(e){var n=null==nA?void 0:nA.find(function(n){return n.value===e}),l=H?null==n?void 0:n.value:(null==n?void 0:n.label)||(null==n?void 0:n.name)||(null==n?void 0:n.title);return(0,u.jsx)(h.default,{className:(0,a.default)(P,null==n?void 0:n.labelClassName,{"tag_with-btn":!(null==n?void 0:n.isFreezed)}),label:l,style:null==n?void 0:n.style,removeItem:(null==n?void 0:n.isFreezed)||(null==n?void 0:n.readOnly)?void 0:function(){return nF(e)},isNoDismiss:!1},e)}),(null==k?void 0:k.length)!==0&&U?"":n5(),(0,u.jsx)("span",{className:(0,a.default)("".concat(x,"__arrow"),n({},"".concat(x,"__arrow_active"),e1)),children:eQ?(0,u.jsx)(d.Code,{className:"mobile-icon"}):e1?(0,u.jsx)(d.ChevronUp,{className:"color--text"}):(0,u.jsx)(d.ChevronDown,{className:"color--text"})})]})},[k,nA,eK,e1]);return(0,c.useLayoutEffect)(function(){return nH(),eS&&!eJ&&e2(!0),function(){var e,n;null==(e=nB())||e.remove(),null==(n=document.getElementById("mlw-".concat(eZ)))||n.remove()}},[]),(0,c.useLayoutEffect)(function(){var e;return eQ?(window.removeEventListener("mousewheel",nY),window.removeEventListener("wheel",nY),window.removeEventListener("touchmove",nY),window.removeEventListener("mouseup",nX)):(window.addEventListener("mousewheel",nY),window.addEventListener("wheel",nY),window.addEventListener("touchmove",nY),window.addEventListener("mouseup",nX)),null==(e=nB())||e.addEventListener("click",nY),function(){var e;window.removeEventListener("mousewheel",nY),window.removeEventListener("mouseup",nX),window.removeEventListener("wheel",nY),window.removeEventListener("touchmove",nY),null==(e=nB())||e.removeEventListener("click",nY)}},[nB,eQ]),(0,c.useLayoutEffect)(function(){e1&&(nq(),nV())},[e1,S,k,nh,eQ,null==eG||null==(j=eG.current)||null==(y=j.getBoundingClientRect())?void 0:y.height,eU]),(0,c.useEffect)(function(){var e;eE&&(null==k?void 0:k.length)!==(null==(e=Object.keys(nP))?void 0:e.length)&&nC.map(function(e){var o;return(null==e?void 0:e.value)&&!(null==nP?void 0:nP[null==e||null==(o=e.value)?void 0:o.toString()])&&nM(function(o){var r;return e.value?t(l({},o),n({},null==e||null==(r=e.value)?void 0:r.toString(),null==e?void 0:e.label)):o}),e})},[k,eE]),(0,c.useEffect)(function(){var e,n,l,t,o,r,i,u,a=function(){e8(window.scrollY)},c=e1?"addEventListener":"removeEventListener";null==G||null==(e=G.current)||e[c]("click",n2,!0),null==Q||null==(n=Q.current)||n[c]("click",n3,!0),e1?(eQ&&eL||window.removeEventListener("scroll",a),(null==ez?void 0:ez.current)&&(ez.current.style.pointerEvents="none"),null==(l=nB())||l.classList.add("tags-dropdown__container--opened"),eQ?null==eK||null==(i=eK.current)||null==(r=i.blur)||r.call(i):null==eK||null==(o=eK.current)||null==(t=o.focus)||t.call(o)):(eQ&&eL||window.addEventListener("scroll",a),(null==ez?void 0:ez.current)&&(ez.current.style.pointerEvents="auto"),null==(u=nB())||u.classList.remove("tags-dropdown__container--opened"),eD&&nx(""),e4(null),ng(""))},[e1]),(0,c.useEffect)(function(){var e,n,l,t,o,r=function(e){var n;ns(Number.parseInt(null==(n=e.target.scrollTop)?void 0:n.toString(),10))},i=function(e){e.preventDefault(),window.scrollTo({top:e6})};return e1&&eQ&&(null==eY?void 0:eY.current)&&(null==eY||null==(e=eY.current)||e.addEventListener("scroll",r),no((null==eY||null==(n=eY.current)?void 0:n.scrollHeight)>(null==eY||null==(l=eY.current)?void 0:l.clientHeight)),null===nt&&nu((null==eY||null==(t=eY.current)?void 0:t.scrollHeight)>(null==eY||null==(o=eY.current)?void 0:o.clientHeight))),e1&&eY&&eY.current&&(eY.current.addEventListener("scroll",n6),eQ&&eL||window.addEventListener("scroll",i)),function(){var e,n;eQ&&eL||window.removeEventListener("scroll",i),null==eY||null==(e=eY.current)||e.removeEventListener("scroll",n6),null==eY||null==(n=eY.current)||n.removeEventListener("scroll",r)}},[e1,eQ,null==eY?void 0:eY.current,null==eY||null==(C=eY.current)?void 0:C.scrollHeight,null==eY||null==(E=eY.current)?void 0:E.clientHeight]),(0,c.useEffect)(function(){if(null==eY?void 0:eY.current){var e,n,l;nf(Number.parseInt((e=(null==eY||null==(n=eY.current)?void 0:n.scrollHeight)-(null==eY||null==(l=eY.current)?void 0:l.clientHeight),e.toString()),10))}},[nc,null==eY?void 0:eY.current]),(0,c.useEffect)(function(){ey&&ex&&(nb||nw||e1)&&(null==eN||eN(nb))},[e1,nb,nw]),(0,c.useEffect)(function(){var e;nE(null==(e=L||S)?void 0:e.map(function(e){return t(l({},e),{ref:(0,c.createRef)()})}))},[S,L]),(0,c.useEffect)(function(){if(nS){var e,n;nV(),null==nN||null==(n=nN.current)||null==(e=n.focus)||e.call(n)}},[null==nS?void 0:nS.value]),(0,u.jsxs)("div",{className:(0,a.default)(x,D,(n(O={},"".concat(x,"_disabled"),T),n(O,"".concat(x,"-mobile"),eQ),n(O,"".concat(x,"--focused"),e1&&!(null==ez?void 0:ez.current)&&!eQ),n(O,"".concat(x,"--custom-trigger"),!!(null==ez?void 0:ez.current)),O)),ref:eX,children:[n9(),eI&&(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__actions")),children:[(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__actions-item")),onClick:eH,children:(0,u.jsx)(d.Check,{})}),(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__actions-item")),onClick:eB,children:(0,u.jsx)(d.X,{})})]}),e1&&((i=nB())?(0,s.createPortal)(function(){var e,o,r,i=null==nC?void 0:nC.reduce(function(e,n){if(n.groupName){var o,r=null==n||null==(o=n.list)?void 0:o.filter(function(e){return nG(e)});(null==r?void 0:r.length)&&e.push(t(l({},n),{list:r}))}else nG(n)&&e.push(n);return e},[]),c=[],v=!0,f=!1,m=void 0;try{for(var g,b,w,y=i[Symbol.iterator]();!(v=(w=y.next()).done);v=!0){var j,C,E,O,S=w.value;S.groupName?c.push((0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"-group"),S.className),children:[(0,u.jsx)("span",{className:"".concat(x,"-group__name"),children:S.groupName}),null==(j=S.list)?void 0:j.map(function(e){return n8(e)})]},null==(O=S.groupName)||null==(E=O.toString())?void 0:E.replace(/ /g,"_").concat(null==(C=Date.now())?void 0:C.toString()))):S.readOnly||c.push(n8(S))}}catch(e){f=!0,m=e}finally{try{v||null==y.return||y.return()}finally{if(f)throw m}}return(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__container-wrapper")),ref:eV,onClick:eQ?n1:function(){},children:(0,u.jsxs)("div",{ref:eG,className:(0,a.default)("".concat(x,"__selector-wrapper"),n({},"".concat(x,"__selector-wrapper--fixed-height"),ni&&eQ)),children:[V||eQ?(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__header"),(n(o={},"".concat(x,"__header-with-shadow"),nt&&eQ),n(o,"".concat(x,"__header-with-shadow-hidden"),0===nc),o)),children:[eQ&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__header-row")),children:[(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__label")),children:F}),(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__close-icon")),onClick:function(e){e.stopPropagation(),e2(!1)},children:(0,u.jsx)(d.X,{onClick:function(e){e.stopPropagation(),e2(!1)}})})]}),nQ()>(eR||10)&&(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__header-row")),children:(0,u.jsx)(_.default,l({className:"".concat(x,"__input"),value:nh,onChange:function(e){return nx(e)},placeholder:e_||"Search",withDelete:!0,onMouseDown:function(){e1||e2(!0)}},ej))})]}),V&&(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__header-row")),children:V})]}):null,eD&&(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__input-list-wrapper")),children:n5()}),ek&&eA&&nh&&(null==i?void 0:i.length)&&nA.every(function(e){var n=e.label;return(null==n?void 0:n.toLowerCase())!==(null==nh?void 0:nh.toLowerCase())})?(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__creatable-helper")),children:"Select an option or create one"}):null,(0,u.jsxs)("div",{ref:eY,className:"".concat(x,"__list ").concat(V||eQ?"".concat(x,"__list--with-header"):""," ").concat(Y?"".concat(x,"__list--with-footer"):""),children:[c,(null==(g=i.filter(function(e){return"open_modal"!==e.value}))?void 0:g.length)!==0||ek&&nh?null:(0,u.jsx)("div",{className:"".concat(x,"__no-options"),children:eb})]}),(Y||eQ)&&(null==(b=i.filter(function(e){return"open_modal"!==e.value}))?void 0:b.length)>0?(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__footer"),(n(r={},"".concat(x,"__footer-with-shadow"),eQ&&nt),n(r,"".concat(x,"__footer-with-shadow-hidden"),nc===nv),r)),children:[Y,eQ&&(0,u.jsxs)("button",{type:"button",onClick:function(){return e2(!1)},children:["Apply",(null==k?void 0:k.length)?"(".concat(null==k?void 0:k.length,")"):""]})]}):null,nS&&(0,s.createPortal)((0,u.jsxs)("div",{ref:e$,className:(0,a.default)("".concat(x,"__edit-option-modal")),children:[(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__edit-option-modal-section")),children:[(0,u.jsx)(_.default,{value:null==nS?void 0:nS.label,onChange:function(e){return nk(function(n){return t(l({},n),{label:e})})},error:!!nI,onKeyDown:function(e){13===e&&nK()},symbolsLimit:"50",ref:nN}),(0,u.jsx)(p.default,{variant:"link",icon:(0,u.jsx)(d.Trash2,{}),label:"Delete",onClick:nU})]}),(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__edit-option-modal-section-divider"))}),(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__edit-option-modal-section")),children:[(0,u.jsx)("h3",{children:"Colors"}),(0,u.jsx)("div",{className:(0,a.default)("".concat(x,"__edit-option-modal-section-colors")),children:null==N?void 0:N.map(function(e){var n;return(0,u.jsx)("div",{className:"color-block",style:{backgroundColor:e},onClick:function(){return nk(function(n){return t(l({},n),{style:t(l({},n?n.style:{}),{backgroundColor:e})})})},children:(null==nS||null==(n=nS.style)?void 0:n.backgroundColor)===e?(0,u.jsx)(d.Check,{}):null},e)})})]})]},"editOptionModal".concat(null==nS?void 0:nS.value)),null!=(e=document.getElementById("root"))?e:document.body),ek&&eA&&nh&&nA.every(function(e){var n=e.label;return(null==n?void 0:n.toLowerCase())!==(null==nh?void 0:nh.toLowerCase())})&&(0,u.jsxs)("div",{className:(0,a.default)("".concat(x,"__create-option")),onClick:nz,children:["Create",(0,u.jsx)(h.default,{label:nh,style:{backgroundColor:nR},isNoDismiss:!0})]})]})})}(),i):null)]})};
@@ -361,10 +361,6 @@
361
361
 
362
362
  font: inherit !important;
363
363
  }
364
-
365
- .search-match {
366
- background-color: rgb(255 255 0 / 50%);
367
- }
368
364
  }
369
365
  }
370
366
 
@@ -0,0 +1,20 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { IModalProps } from './Modal.interface';
3
+ import './Modal.scss';
4
+ import './ModalMobile.scss';
5
+ export declare const KEY_CODE: Readonly<{
6
+ readonly ENTER: 13;
7
+ readonly ESC: 27;
8
+ }>;
9
+ export declare function renderModalTitle({ mode, title, onlyTitle, }: {
10
+ mode?: string;
11
+ title: string;
12
+ onlyTitle?: boolean;
13
+ }): string;
14
+ declare function Modal({ ref, id, testId, zIndex, isOpen, onConfirm, onDecline, closeModal, className, variant, size, mode, title, onlyTitle, atributesForModalBody, confirmBtnClassName, confirmBtnLabel, confirmBtnVariant, confirmBtnDisable, confirmBtnIcon, isConfirmBtnIconPositionRight, noConfirmBtn, forced, closeBtnClassName, closeBtnText, closeBtnVariant, closeBtnDisable, closeBtnIcon, btnClassNames, isCloseBtnIconPositionRight, noCloseBtn, noHeader, noHeaderCloseBtn, customHeader, declineBtnDisable, noFooter, customFooter, withFixedFooter, leftContentOfFooter, isSubmittingByEnter: isSubmittingByEnterOuter, isClosingByEsc: isClosingByEscOuter, withEventManagement, submitOnEnter, closeOnEsc, withMobileLogic, children }: IModalProps & {
15
+ ref?: React.RefObject<HTMLDivElement | null>;
16
+ }): ReactElement | null;
17
+ declare namespace Modal {
18
+ var displayName: string;
19
+ }
20
+ export default Modal;
@@ -43,6 +43,7 @@ export interface IModalProps extends IUniProps {
43
43
  onlyTitle?: boolean;
44
44
  noHeader?: boolean;
45
45
  noHeaderCloseBtn?: boolean;
46
+ customHeader?: ReactNode;
46
47
 
47
48
  // Body options
48
49
  atributesForModalBody?: Record<string, unknown>;
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0});var e=exports,t={KEY_CODE:function(){return y},default:function(){return O},renderModalTitle:function(){return v}};for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]});var o=require("react/jsx-runtime"),r=b(require("classnames")),i=require("react"),l=b(require("../../../Functions/useKeyPress/useHandleKeyPress")),a=require("../../../Functions/utils"),s=b(require("../Button/Button")),c=require("./partials/_constants"),d=require("./partials/_utils"),u=b(require("./partials/ModalFooter")),f=b(require("./partials/ModalTitle")),m=b(require("./partials/useMobileModal"));function b(e){return e&&e.__esModule?e:{default:e}}require("./Modal.scss"),require("./ModalMobile.scss");var p={},y=Object.freeze({ENTER:13,ESC:27});function v(e){var t=e.mode,n=e.title,o=e.onlyTitle;return t&&"default"!==t&&!o?"".concat(t[0].toUpperCase()).concat(t.slice(1)," ").concat(n):n}var E=(0,i.forwardRef)(function(e,t){var n,b,y=e.id,E=e.testId,O=void 0===E?"modal":E,h=e.zIndex,_=e.isOpen,g=e.onConfirm,C=e.onDecline,j=e.closeModal,M=e.className,I=e.variant,x=e.size,S=e.mode,B=e.title,N=e.onlyTitle,P=e.atributesForModalBody,w=e.confirmBtnClassName,D=e.confirmBtnLabel,R=e.confirmBtnVariant,F=e.confirmBtnDisable,T=e.confirmBtnIcon,q=e.isConfirmBtnIconPositionRight,A=e.noConfirmBtn,H=e.forced,L=e.closeBtnClassName,k=e.closeBtnText,K=e.closeBtnVariant,V=e.closeBtnDisable,G=e.closeBtnIcon,z=e.btnClassNames,W=e.isCloseBtnIconPositionRight,Y=e.noCloseBtn,U=e.noHeader,J=e.noHeaderCloseBtn,Q=e.declineBtnDisable,X=e.noFooter,Z=e.customFooter,$=e.withFixedFooter,ee=e.leftContentOfFooter,et=e.isSubmittingByEnter,en=e.isClosingByEsc,eo=e.withEventManagement,er=void 0!==eo&&eo,ei=e.submitOnEnter,el=e.closeOnEsc,ea=e.withMobileLogic,es=e.children,ec=(0,i.useRef)(null),ed=(0,i.useRef)(g),eu=(0,i.useRef)(j),ef=(0,i.useRef)(C),em=!1!==ei&&(void 0===et||et),eb=!1!==el&&(void 0===en||en),ep=(0,d.getWithEventManagementStructure)(y,er),ey=ep.isWithSubmitAndCloseManagement,ev="function"==typeof g&&ey&&F,eE="function"==typeof j&&ey&&V,eO="function"==typeof C&&ey&&Q,eh=(0,m.default)({withMobileLogic:ea,withFixedFooter:$,isOpen:_}),e_=eh.modalMobileHeaderRef,eg=eh.modalMobileBodyRef,eC=eh.modalMobileFooterRef,ej=eh.MODALS_LOGIC,eM=eh.renderModal,eI=eh.isMobile,ex=eh.scrollTop,eS=eh.scrollHeight,eB=(0,i.useMemo)(function(){return{confirm:function(){var e;return null==(e=ed.current)?void 0:e.call(ed)},close:function(){var e;return null==(e=eu.current)?void 0:e.call(eu)},decline:function(){var e;"function"==typeof ef.current?ef.current():null==(e=eu.current)||e.call(eu)}}},[]);return((0,l.default)({enterCallback:em&&"function"==typeof g?eB.confirm:void 0,escCallback:eb&&"function"==typeof j?eB.close:void 0,withClamping:!1,withEventManagementStructure:ep}),(0,i.useLayoutEffect)(function(){ed.current=ev?void 0:g},[g,ev]),(0,i.useLayoutEffect)(function(){eu.current=eE?void 0:j},[j,eE]),(0,i.useLayoutEffect)(function(){ef.current=eO?function(){}:C},[C,eO]),(0,i.useEffect)(function(){var e=(0,a.getIsOnlyAnObject)(er)?er.listenersTarget:void 0,t=null!=e?e:document,n=(0,d.getOnKeyPress)({id:y,onSubmit:eB.confirm,onClose:eB.close});return ep.isWithSubmitAndCloseManagement&&n&&(em&&t.addEventListener(c.EVENTS.iGotAnEnterKeyPress.name,n),eb&&t.addEventListener(c.EVENTS.iGotAnEscKeyPress.name,n)),function(){ep.isWithSubmitAndCloseManagement&&n&&(em&&t.removeEventListener(c.EVENTS.iGotAnEnterKeyPress.name,n),eb&&t.removeEventListener(c.EVENTS.iGotAnEscKeyPress.name,n))}},[]),_)?(0,o.jsx)("div",{id:"".concat(y),style:{zIndex:void 0===h?100:h},"data-testid":O,className:"modal-box j5",role:"dialog","aria-modal":"true","aria-labelledby":"".concat(O,"-title"),children:eM((0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{"data-testid":"".concat(O,"-overlay"),className:_?"modal-overlay":"hidden",onClick:eB.close,role:"presentation"}),(0,o.jsxs)("div",{ref:t||ec,style:{width:"number"==typeof x?"".concat(x,"px"):"".concat(null==x?void 0:x.replace("px",""),"px")},className:(0,r.default)(M,{modal:_,"modal--no-header":_&&U,"modal-mobile":_&&eI,hidden:!_}),children:[!U&&(0,o.jsx)(f.default,{wrapperRef:e_,className:(0,r.default)({"modal__header--hidden":ej.IS_HEADER_HIDDEN,"modal__header--sticky":!ej.IS_HEADER_HIDDEN&&ej.IS_HEADER_STICKY}),variant:void 0===I?"primary":I,isForced:H,onClose:eB.close,noHeaderCloseBtn:J,children:(0,o.jsx)("span",{id:"".concat(O,"-title"),children:v({mode:S,title:B,onlyTitle:N})})}),(0,o.jsx)("div",(n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o;o=n[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}({},void 0===P?p:P),b=b={ref:eg,className:(0,r.default)("modal__body",{"modal__body--no-footer":X}),role:"document",children:es},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(b)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(b)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(b,e))}),n)),(!X||Z)&&(0,o.jsx)(u.default,{wrapperRef:eC,className:(0,r.default)({"modal__footer--hidden":ej.IS_FOOTER_HIDDEN,"modal__footer--sticky":!ej.IS_FOOTER_HIDDEN&&ej.IS_FOOTER_STICKY&&ex!==eS,"modal__footer_with-left-content":ee}),children:Z||(0,o.jsxs)(o.Fragment,{children:[ee,(!Y||!A)&&(0,o.jsxs)("div",{className:"modal__buttons-block",children:[!Y&&(0,o.jsx)(s.default,{testId:"modal",className:(0,r.default)(L,z),variant:K||"dark-outline",onClick:eB.decline,label:k||"Cancel",disabled:"function"==typeof C?Q:V,icon:G,isIconRight:W,tabIndex:1,"aria-label":"Close modal"}),!A&&(0,o.jsx)(s.default,{testId:"modal",onClick:eB.confirm,label:D||S&&(null==S?void 0:S[0].toUpperCase())+(null==S?void 0:S.slice(1))||"Apply",className:(0,r.default)("ml5",w,z),variant:void 0===R?"primary":R,disabled:F,icon:T,isIconRight:q,"aria-label":"Confirm modal"})]})]})})]})]}))}):null});E.displayName="Modal";var O=E;
1
+ Object.defineProperty(exports,"__esModule",{value:!0});var e=exports,t={KEY_CODE:function(){return y},default:function(){return O},renderModalTitle:function(){return v}};for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]});var o=require("react/jsx-runtime"),r=b(require("classnames")),i=require("react"),l=b(require("../../../Functions/useKeyPress/useHandleKeyPress")),a=require("../../../Functions/utils"),s=b(require("../Button/Button")),c=require("./partials/_constants"),d=require("./partials/_utils"),u=b(require("./partials/ModalFooter")),f=b(require("./partials/ModalTitle")),m=b(require("./partials/useMobileModal"));function b(e){return e&&e.__esModule?e:{default:e}}require("./Modal.scss"),require("./ModalMobile.scss");var p={},y=Object.freeze({ENTER:13,ESC:27});function v(e){var t=e.mode,n=e.title,o=e.onlyTitle;return t&&"default"!==t&&!o?"".concat(t[0].toUpperCase()).concat(t.slice(1)," ").concat(n):n}function E(e){var t,n,b=e.ref,y=e.id,E=e.testId,O=void 0===E?"modal":E,h=e.zIndex,_=e.isOpen,g=e.onConfirm,C=e.onDecline,j=e.closeModal,M=e.className,I=e.variant,x=e.size,S=e.mode,B=e.title,N=e.onlyTitle,P=e.atributesForModalBody,D=e.confirmBtnClassName,w=e.confirmBtnLabel,R=e.confirmBtnVariant,F=e.confirmBtnDisable,T=e.confirmBtnIcon,H=e.isConfirmBtnIconPositionRight,q=e.noConfirmBtn,A=e.forced,L=e.closeBtnClassName,k=e.closeBtnText,K=e.closeBtnVariant,V=e.closeBtnDisable,G=e.closeBtnIcon,z=e.btnClassNames,W=e.isCloseBtnIconPositionRight,Y=e.noCloseBtn,U=e.noHeader,J=e.noHeaderCloseBtn,Q=e.customHeader,X=e.declineBtnDisable,Z=e.noFooter,$=e.customFooter,ee=e.withFixedFooter,et=e.leftContentOfFooter,en=e.isSubmittingByEnter,eo=e.isClosingByEsc,er=e.withEventManagement,ei=void 0!==er&&er,el=e.submitOnEnter,ea=e.closeOnEsc,es=e.withMobileLogic,ec=e.children,ed=(0,i.useRef)(null),eu=(0,i.useRef)(g),ef=(0,i.useRef)(j),em=(0,i.useRef)(C),eb=!1!==el&&(void 0===en||en),ep=!1!==ea&&(void 0===eo||eo),ey=(0,d.getWithEventManagementStructure)(y,ei),ev=ey.isWithSubmitAndCloseManagement,eE="function"==typeof g&&ev&&F,eO="function"==typeof j&&ev&&V,eh="function"==typeof C&&ev&&X,e_=(0,m.default)({withMobileLogic:es,withFixedFooter:ee,isOpen:_}),eg=e_.modalMobileHeaderRef,eC=e_.modalMobileBodyRef,ej=e_.modalMobileFooterRef,eM=e_.MODALS_LOGIC,eI=e_.renderModal,ex=e_.isMobile,eS=e_.scrollTop,eB=e_.scrollHeight,eN=(0,i.useMemo)(function(){return{confirm:function(){var e;return null==(e=eu.current)?void 0:e.call(eu)},close:function(){var e;return null==(e=ef.current)?void 0:e.call(ef)},decline:function(){var e;"function"==typeof em.current?em.current():null==(e=ef.current)||e.call(ef)}}},[]);return((0,l.default)({enterCallback:eb&&"function"==typeof g?eN.confirm:void 0,escCallback:ep&&"function"==typeof j?eN.close:void 0,withClamping:!1,withEventManagementStructure:ey}),(0,i.useLayoutEffect)(function(){eu.current=eE?void 0:g},[g,eE]),(0,i.useLayoutEffect)(function(){ef.current=eO?void 0:j},[j,eO]),(0,i.useLayoutEffect)(function(){em.current=eh?function(){}:C},[C,eh]),(0,i.useEffect)(function(){var e=(0,a.getIsOnlyAnObject)(ei)?ei.listenersTarget:void 0,t=null!=e?e:document,n=(0,d.getOnKeyPress)({id:y,onSubmit:eN.confirm,onClose:eN.close});return ey.isWithSubmitAndCloseManagement&&n&&(eb&&t.addEventListener(c.EVENTS.iGotAnEnterKeyPress.name,n),ep&&t.addEventListener(c.EVENTS.iGotAnEscKeyPress.name,n)),function(){ey.isWithSubmitAndCloseManagement&&n&&(eb&&t.removeEventListener(c.EVENTS.iGotAnEnterKeyPress.name,n),ep&&t.removeEventListener(c.EVENTS.iGotAnEscKeyPress.name,n))}},[]),_)?(0,o.jsx)("div",{id:"".concat(y),style:{zIndex:void 0===h?100:h},"data-testid":O,className:"modal-box j5",role:"dialog","aria-modal":"true","aria-labelledby":"".concat(O,"-title"),children:eI((0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{"data-testid":"".concat(O,"-overlay"),className:_?"modal-overlay":"hidden",onClick:eN.close,role:"presentation"}),(0,o.jsxs)("div",{ref:b||ed,style:{width:"number"==typeof x?"".concat(x,"px"):"".concat(null==x?void 0:x.replace("px",""),"px")},className:(0,r.default)(M,{modal:_,"modal--no-header":_&&U&&!Q,"modal-mobile":_&&ex,hidden:!_}),children:[Q||!U&&(0,o.jsx)(f.default,{wrapperRef:eg,className:(0,r.default)({"modal__header--hidden":eM.IS_HEADER_HIDDEN,"modal__header--sticky":!eM.IS_HEADER_HIDDEN&&eM.IS_HEADER_STICKY}),variant:void 0===I?"primary":I,isForced:A,onClose:eN.close,noHeaderCloseBtn:J,children:(0,o.jsx)("span",{id:"".concat(O,"-title"),children:v({mode:S,title:B,onlyTitle:N})})}),(0,o.jsx)("div",(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o;o=n[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}({},void 0===P?p:P),n=n={ref:eC,className:(0,r.default)("modal__body",{"modal__body--no-footer":Z}),role:"document",children:ec},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t)),(!Z||$)&&(0,o.jsx)(u.default,{wrapperRef:ej,className:(0,r.default)({"modal__footer--hidden":eM.IS_FOOTER_HIDDEN,"modal__footer--sticky":!eM.IS_FOOTER_HIDDEN&&eM.IS_FOOTER_STICKY&&eS!==eB,"modal__footer_with-left-content":et}),children:$||(0,o.jsxs)(o.Fragment,{children:[et,(!Y||!q)&&(0,o.jsxs)("div",{className:"modal__buttons-block",children:[!Y&&(0,o.jsx)(s.default,{testId:"modal",className:(0,r.default)(L,z),variant:K||"dark-outline",onClick:eN.decline,label:k||"Cancel",disabled:"function"==typeof C?X:V,icon:G,isIconRight:W,tabIndex:1,"aria-label":"Close modal"}),!q&&(0,o.jsx)(s.default,{testId:"modal",onClick:eN.confirm,label:w||S&&(null==S?void 0:S[0].toUpperCase())+(null==S?void 0:S.slice(1))||"Apply",className:(0,r.default)("ml5",D,z),variant:void 0===R?"primary":R,disabled:F,icon:T,isIconRight:H,"aria-label":"Confirm modal"})]})]})})]})]}))}):null}E.displayName="Modal";var O=E;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../../src/Atomic/UI/Modal/Modal.tsx"],"names":[],"mappings":";;;AA2BA,4CAaC;;AApCD,oEAA4B;AAC5B,iCAAoE;AAEpE,iHAAiF;AACjF,oDAA6D;AAC7D,sEAAsC;AAEtC,sDAA+C;AAE/C,8CAAmF;AACnF,iFAAiD;AACjD,+EAA+C;AAE/C,uFAAuD;AACvD,wBAAsB;AACtB,8BAA4B;AAE5B,MAAM,wBAAwB,GAAG,EAAE,CAAA;AACtB,QAAA,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC;IACpC,KAAK,EAAE,EAAE;IACT,GAAG,EAAE,EAAE;CACC,CAAC,CAAC;AAEZ,SAAgB,gBAAgB,CAAC,EAC/B,IAAI,EACJ,KAAK,EACL,SAAS,GAKV;IACC,IAAI,IAAI,IAAI,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ACH,eAAe;+BACZ,CAAC,IAAI,IAAI,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAG,CAAC,EAAE,WAAW,EAAE,KAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAC,CAAC,CAAC,CAAA,CAAC;+BAClD,OAAO,EAEZ,SAAS,EAAE,IAAA,oBAAE,EAAC,KAAK,EAAE,mBAAmB,EAAE,aAAa,CAAC,EACxD,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,iBAAiB,EAC3B,IAAI,EAAE,cAAc,EACpB,WAAW,EAAE,6BAA6B,gBAC/B,eAAe,GAC1B,CACH,CACG,CACP,CACA,CACJ,CACW,CACf,CACG,CACL,CACJ,CACG,CACP,CAAC;AACJ,CAAC;AAED,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;AAE5B,kBAAe,KAAK,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "1.8.24",
3
+ "version": "1.8.26",
4
4
  "description": "",
5
5
  "author": "Andrey Isakov",
6
6
  "license": "ISC",
@@ -1,15 +0,0 @@
1
- export default useFormFieldsChangesManager;
2
- declare function useFormFieldsChangesManager({ form, setForm, callback, validateField, settings }: {
3
- form: any;
4
- setForm: any;
5
- callback: any;
6
- validateField: any;
7
- settings: any;
8
- }): {
9
- assignChangesToField: (data: any, key: any, settings: any) => any;
10
- isFormMustBeChanget: boolean;
11
- startChangesProcessing: () => void;
12
- setIsFormMustBeChanget: () => void;
13
- changesArray: any;
14
- DELAY_TIME: number;
15
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFormFieldsChangesManager.js","sourceRoot":"","sources":["../../../src/Functions/hooks/useFormFieldsChangesManager.js"],"names":[],"mappings":";;;AAAA,uDAAmD;AACnD,oCAAoD;AAEpD,MAAM,QAAQ,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AACrC,MAAM,WAAW,GAAG,EAA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AAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;oBAC3F,OAAO,MAAM,CAAC;gBAChB,CAAC,CAAC,EAAE;aACL,CAAC,CAAC;YACL,CAAC,CAAC,OAAO,CAAC;QAEd,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,UAAU;YAAE,uBAAuB,GAAG,MAAM,QAAQ,CAAC,aAAa,CAAC,CAAC;QACxG,IAAI,CAAC,YAAY;YAAE,MAAM,OAAO,CAAC,uBAAuB,aAAvB,uBAAuB,cAAvB,uBAAuB,GAAI,aAAa,CAAC,CAAC;QAE3E,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC;QACvB,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC,CAAC;IAEF,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,mBAAmB;YAAE,UAAU,EAAE,CAAC;IACxC,CAAC,EAAE,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAE1B,OAAO;QACL,oBAAoB,EAAE,uCAAuC;QAC7D,mBAAmB,EAAE,+CAA+C;QAEpE,+EAA+E;QAC/E,8EAA8E;QAC9E,sBAAsB;QAEtB,uFAAuF;QACvF,sBAAsB,EAAE,sBAAsB,EAAE,+EAA+E;QAE/H,YAAY,EAAE,IAAA,aAAK,EAAC,WAAW,CAAC,EAAE,uCAAuC;QAEzE,yEAAyE;QACzE,sEAAsE;QACtE,UAAU;KACX,CAAC;AACJ,CAAC;AAED,kBAAe,2BAA2B,CAAC"}
@@ -1,3 +0,0 @@
1
- export default FormWithDependOn;
2
- declare const FormWithDependOn: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
3
- import React from "react";