intelicoreact 1.6.37 → 1.6.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +1 -1
  2. package/dist/Atomic/FormElements/InputDateRange/InputDateRange.d.ts +3 -0
  3. package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.d.ts +3 -0
  4. package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.d.ts +2 -0
  5. package/dist/Atomic/UI/Modal/Modal.d.ts +14 -0
  6. package/dist/Atomic/UI/Modal/Modal.interface.d.ts +64 -0
  7. package/dist/Atomic/UI/Modal/Modal.interface.js +1 -0
  8. package/dist/Atomic/UI/Modal/Modal.interface.js.map +1 -0
  9. package/dist/Atomic/UI/Modal/Modal.interface.ts +13 -2
  10. package/dist/Atomic/UI/Modal/Modal.js +1 -1
  11. package/dist/Atomic/UI/Modal/Modal.js.map +1 -0
  12. package/dist/Atomic/UI/Modal/ModalHOC.d.ts +5 -0
  13. package/dist/Atomic/UI/Modal/ModalHOC.js +1 -1
  14. package/dist/Atomic/UI/Modal/ModalHOC.js.map +1 -0
  15. package/dist/Atomic/UI/Modal/index.d.ts +9 -0
  16. package/dist/Atomic/UI/Modal/index.js +1 -0
  17. package/dist/Atomic/UI/Modal/index.js.map +1 -0
  18. package/dist/Atomic/UI/Modal/index.ts +11 -2
  19. package/dist/Atomic/UI/Modal/partials/ModalFooter.d.ts +4 -0
  20. package/dist/Atomic/UI/Modal/partials/_constants.d.ts +27 -0
  21. package/dist/Atomic/UI/Modal/partials/_constants.js +1 -0
  22. package/dist/Atomic/UI/Modal/partials/_constants.js.map +1 -0
  23. package/dist/Atomic/UI/Modal/partials/_utils.d.ts +9 -0
  24. package/dist/Atomic/UI/Modal/partials/_utils.js +1 -0
  25. package/dist/Atomic/UI/Modal/partials/_utils.js.map +1 -0
  26. package/dist/Atomic/UI/Table/Partials/TdCell.d.ts +13 -0
  27. package/dist/Atomic/UI/Table/Partials/TdRow.d.ts +17 -0
  28. package/dist/Atomic/UI/Table/Partials/TdTitle.d.ts +5 -0
  29. package/dist/Atomic/UI/Table/Table.d.ts +9 -0
  30. package/dist/Atomic/UI/Table/TdTypes/TdWeight.d.ts +7 -0
  31. package/dist/Functions/useKeyPress/useHandleKeyPress.d.ts +30 -0
  32. package/dist/Functions/useKeyPress/useHandleKeyPress.js +1 -1
  33. package/dist/Functions/useKeyPress/useHandleKeyPress.js.map +1 -0
  34. package/dist/Functions/useKeyPress/useKeyPress.d.ts +8 -0
  35. package/dist/Functions/useKeyPress/useKeyPress.js +1 -1
  36. package/dist/Functions/useKeyPress/useKeyPress.js.map +1 -0
  37. package/dist/types/declaration/WithEventLogicAsObj/readme +5 -0
  38. package/dist/types/declaration/WithEventManagementAsObj/index.d.ts +9 -0
  39. package/dist/types/declaration/WithEventManagementAsObj/index.js +1 -0
  40. package/dist/types/declaration/WithEventManagementAsObj/index.js.map +1 -0
  41. package/dist/types/declaration/WithEventManagementAsObj/index.ts +34 -0
  42. package/dist/types/declaration/WithEventManagementAsObj/innerTypes/Modal.d.ts +4 -0
  43. package/dist/types/declaration/WithEventManagementAsObj/innerTypes/Modal.js +1 -0
  44. package/dist/types/declaration/WithEventManagementAsObj/innerTypes/Modal.js.map +1 -0
  45. package/dist/types/declaration/WithEventManagementAsObj/readme +7 -0
  46. package/package.json +1 -1
  47. package/dist/Atomic/UI/Modal/partials/ModalTitle.js.map +0 -1
@@ -1 +1 @@
1
- function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,l=Array(t);n<t;n++)l[n]=e[n];return l}function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e){for(var n=1;n<arguments.length;n++){var l=null!=arguments[n]?arguments[n]:{},r=Object.keys(l);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(l).filter(function(e){return Object.getOwnPropertyDescriptor(l,e).enumerable}))),r.forEach(function(n){t(e,n,l[n])})}return e}function l(t,n){return function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,l,r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],u=!0,i=!1;try{for(r=r.call(e);!(u=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);u=!0);}catch(e){i=!0,l=e}finally{try{u||null==r.return||r.return()}finally{if(i)throw l}}return o}}(t,n)||function(t,n){if(t){if("string"==typeof t)return e(t,n);var l=Object.prototype.toString.call(t).slice(8,-1);if("Object"===l&&t.constructor&&(l=t.constructor.name),"Map"===l||"Set"===l)return Array.from(l);if("Arguments"===l||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return e(t,n)}}(t,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.")}()}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return b}});var r=require("react/jsx-runtime"),o=p(require("classnames")),u=function(e,t){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 n=m(t);if(n&&n.has(e))return n.get(e);var l={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var u=r?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(l,o,u):l[o]=e[o]}return l.default=e,n&&n.set(e,l),l}(require("react")),i=require("react-dom"),c=require("react-feather"),a=require("../../../Functions/fieldValueFormatters"),s=require("../../../Functions/useDebounce"),d=p(require("../../../Functions/useIsMobile/useIsMobile")),f=p(require("../../Layout/Spinner/Spinner")),v=p(require("../RadioInput/RadioInput"));function p(e){return e&&e.__esModule?e:{default:e}}function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(m=function(e){return e?n:t})(e)}require("./DropdownLiveSearch.scss");var h="dropdown-live-search",b=function(e){var p,m,b,g,_=e.label,w=e.value,y=e.error,x=e.disabled,j=e.onChange,E=e.placeholder,S=e.className,L=e.isSearchable,N=e.doRequest,C=e.isLoading,I=e.options,k=e.fieldKey,O=e.id,M=e.isListTop,q=e.attributesOfNativeInput,P=e.withMobileLogic,R=e.tabIndex,H=e.isNotValidateASCII,D=void 0!==H&&H,A=e.noOptionsText,T=void 0===A?"No options available":A,F=e.testId,B=void 0===F?"dropdown-live-search":F,W=l((0,u.useState)(O||k||Math.random().toString(16).slice(2)),1)[0],V=l((0,u.useState)(!1),2),$=V[0],U=V[1],z=l((0,u.useState)(!1),2),K=z[0],X=z[1],G=(0,d.default)().isMobile&&P&&window.screen.width<=768,J=(0,u.useMemo)(function(){var e,t;return null!=(t=null==I||null==(e=I.find(function(e){return e.value===w}))?void 0:e.label)?t:""},[w,I]),Q=l((0,u.useState)(""),2),Y=Q[0],Z=Q[1],ee=l((0,u.useState)(!1),2),et=ee[0],en=ee[1],el=(0,u.useRef)(null),er=(0,u.useRef)(null),eo=(0,u.useRef)(null),eu=(0,u.useRef)(null),ei=(0,u.useRef)(null),ec=(0,u.useRef)(null),ea=(0,u.useRef)(null),es=(0,u.useRef)(null),ed=l((0,u.useState)(!1),2),ef=ed[0],ev=ed[1],ep=l((0,u.useState)(null),2),em=ep[0],eh=ep[1],eb=l((0,u.useState)(!1),2),eg=eb[0],e_=eb[1],ew=l((0,u.useState)(0),2),ey=ew[0],ex=ew[1],ej=l((0,u.useState)(1),2),eE=ej[0],eS=ej[1],eL=(0,s.useDebounce)({searchValue:Y,delay:600}),eN=(0,u.useCallback)(function(e){if(N&&"function"==typeof N){var t,n=null==e?void 0:e.target;Math.round(n.clientHeight+n.scrollTop)===n.scrollHeight&&N(null!=(t=ea.current)?t:"",!0)}},[I]),eC=function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];t&&en(!0),Z(e),ea.current=e},eI=function(e){U(e),eC("",!1),e||en(!1)},ek=function(){var e,t;return null!=(t=null!=(e=document.querySelector("div#root"))?e:document.querySelector("div#app"))?t:document.querySelector("div#storybook-root")},eO=function(){return document.getElementById(null==W?void 0:W.toString())},eM=function(e){e.target===(null==es?void 0:es.current)&&(e.stopPropagation(),e.preventDefault(),eI(!1))},eq=function(e){$||(e.preventDefault(),e.stopPropagation())},eP=function(e){var t;!el.current||el.current.contains(e.target)||eO()&&(null==(t=eO())?void 0:t.contains(e.target))||eI(!1)},eR=function(e){[27].includes(e.keyCode)&&eI(!1)},eH=$?eP:function(){},eD=function(e){var t,n=null==(t=e.target)?void 0:t.value;D||(n=(0,a.formatToOnlyASCIICodeText)(n)),eC(n),!Y&&et||e.target.value?X(!1):(null==j||j(""),eC(""),X(!0))},eA=function(e,t){if(!L)return e;var n=et||G&&P?Y:J;return e=e.replace(/["&<>]/g,function(e){var t;return null!=(t=({'"':"&quot;","&":"&amp;","<":"&lt;",">":"&gt;"})[e])?t:""}),(n?null==e?void 0:e.replace(RegExp(null==n?void 0:n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&"),"i"),function(e){return'<span class="bg--yellow">'.concat(e,"</span>")}):e)+(t?'<span class="dropdown__list-item-postfix">'.concat(t,"</span>"):"")},eT=function(e,n,l){var u,i,a,s,d=e.label.toLowerCase(),f=null==Y?void 0:Y.toLowerCase();return(0,r.jsxs)("button",{type:"button","data-testid":"".concat(B,"-").concat(l||n,"-option"),onClick:function(){null==j||j(e.value),eI(!1)},className:(0,o.default)("".concat(h,"__list-item"),(t(s={},"".concat(h,"__list-item_active"),e.value===w),t(s,"".concat(h,"__list-item_disabled"),e.disabled),s),e.className),children:[!G||G&&!P&&(0,r.jsx)("span",{className:(0,o.default)("".concat(h,"__active-icon"),t({},"".concat(h,"__active-icon_active"),d===f)),children:(0,r.jsx)(c.Check,{})}),(0,r.jsx)("p",{title:e.label,className:e.labelClassName||"",dangerouslySetInnerHTML:{__html:eA(e.label,e.postfix)}}),G?null!=(a=null==e?void 0:e.customMobileIcon)?a:(0,r.jsx)(v.default,{value:e.value,checked:null==w?void 0:w.toString()}):""]},null==(i=e.value)||null==(u=i.toString())?void 0:u.replace(/ /g,"_"))},eF=function(){var e,l,u;return(0,r.jsx)("div",{className:(0,o.default)("".concat(h,"__container-wrapper")),ref:es,onClick:G?eM:function(){},children:(0,r.jsx)("div",{className:(0,o.default)("".concat(h,"__list-wrapper"),(t(l={},"".concat(h,"__list-wrapper--fixed-height"),eg),t(l,"".concat(h,"__list-wrapper--with-bottom-shadow"),em&&G),t(l,"".concat(h,"__list-wrapper--with-bottom-shadow-hidden"),ey===eE),l)),children:(0,r.jsxs)("div",{id:"dropdown-live-search-list",className:(0,o.default)("".concat(h,"__container"),t({},"".concat(h,"__list-top"),M)),ref:er,children:[G&&(0,r.jsxs)("div",{ref:eu,className:(0,o.default)("".concat(h,"__list-header"),(t(u={},"".concat(h,"__list-header-with-shadow"),em&&G),t(u,"".concat(h,"__list-header-with-shadow-hidden"),0===ey),u)),children:[(0,r.jsxs)("div",{className:(0,o.default)("".concat(h,"__list-header-row")),children:[(0,r.jsx)("div",{className:(0,o.default)("".concat(h,"__list-label")),children:_}),(0,r.jsx)("div",{className:(0,o.default)("".concat(h,"__list-close-icon")),onClick:function(){return eI(!1)},children:(0,r.jsx)(c.X,{onClick:function(){return eI(!1)}})})]}),L&&(0,r.jsx)("input",n({ref:ec,className:"".concat(h,"__input"),value:$?Y:J,onChange:eD,placeholder:E,onFocus:eq,tabIndex:-1},q))]}),(0,r.jsxs)("div",{className:(0,o.default)("".concat(h,"__list"),{disabled:C}),ref:eo,children:[null==I?void 0:I.map(function(e){return eT(e)}),!(null==I?void 0:I.length)&&(0,r.jsx)("div",{className:"".concat(h,"__list-item ").concat(h,"__list-item--no-options"),children:T})]}),C&&$&&(0,r.jsx)(f.default,{size:(null!=(e=null==I?void 0:I.length)?e:0)<=3?"small":null})]})})})},eB=function(){var e=document.createElement("div");e.setAttribute("id",null==W?void 0:W.toString()),e.classList.add("dropdown__container"),G&&e.addEventListener("click",function(e){e.target.id===W&&eI(!1)});try{null==(t=eO())||t.remove()}finally{if(G){try{null==(r=document.getElementById("mlw-".concat(W)))||r.remove()}catch(e){}var t,n,l,r,o=document.createElement("div");o.classList.add("dropdown-live-search-mobile"),o.setAttribute("id","mlw-".concat(W)),null==o||o.append(e),null==(l=ek())||l.append(o)}else null==(n=ek())||n.append(e)}};return((0,u.useEffect)(function(){return document.addEventListener("click",eP,!0),function(){return document.removeEventListener("click",eP,!0)}},[]),(0,u.useEffect)(function(){(null==I?void 0:I.length)===1&&Y===I[0].label&&(eC(I[0].label),null==j||j(I[0].value))},[I]),(0,u.useEffect)(function(){L&&(eL||K)&&(null==N||N(eL),K&&X(!1))},[eL,K]),(0,u.useEffect)(function(){G&&P&&eB()},[G,P]),(0,u.useEffect)(function(){if($&&G&&(null==eo?void 0:eo.current)&&!Y){var e,t,n,l;eh((null==eo||null==(e=eo.current)?void 0:e.scrollHeight)>(null==eo||null==(t=eo.current)?void 0:t.clientHeight)),e_(em||(null==eo||null==(n=eo.current)?void 0:n.scrollHeight)>(null==eo||null==(l=eo.current)?void 0:l.clientHeight))}},[$,G,em,null==eo?void 0:eo.current,null==eo||null==(m=eo.current)?void 0:m.scrollHeight,null==eo||null==(b=eo.current)?void 0:b.clientHeight]),(0,u.useLayoutEffect)(function(){var e=document.getElementById("dropdown-live-search-list");if((e||$)&&(!P||!G)){var t,n=null==el||null==(t=el.current)?void 0:t.clientWidth;e&&(e.style.minWidth="".concat(n,"px"))}},[el,$,P]),(0,u.useEffect)(function(){if(!$&&(ev(!1),P&&G&&eC("")),$&&eo&&eo.current){if(G&&P){var e;null==N||N("").then(function(){setTimeout(function(){if(eo.current&&(null==er?void 0:er.current)&&(null==eu?void 0:eu.current)){var e,t,n,l;eo.current.style.maxHeight="".concat((null==er||null==(t=er.current)||null==(e=t.getBoundingClientRect())?void 0:e.height)-(null==eu||null==(l=eu.current)||null==(n=l.getBoundingClientRect())?void 0:n.height),"px")}},1)}),null==ec||null==(e=ec.current)||e.focus()}eo.current.addEventListener("scroll",eN)}return function(){removeEventListener("scroll",eN)}},[$,eo]),(0,u.useLayoutEffect)(function(){var e;return G?(window.removeEventListener("mousewheel",eH),window.removeEventListener("scroll",eH),window.removeEventListener("touchmove",eH)):(window.addEventListener("mousewheel",eH),window.addEventListener("scroll",eH),window.addEventListener("touchmove",eH)),null==(e=eO())||e.addEventListener("click",eH),window.addEventListener("keyup",eR),function(){var e;window.removeEventListener("mousewheel",eH),window.removeEventListener("scroll",eH),window.removeEventListener("touchmove",eH),window.removeEventListener("keyup",eR),null==(e=eO())||e.removeEventListener("click",eH)}},[eO]),(0,u.useEffect)(function(){var e,t=function(e){var t,n;ex(Number.parseInt(null==(n=e.target)||null==(t=n.scrollTop)?void 0:t.toString(),10))};return $&&G&&(null==eo?void 0:eo.current)&&(null==eo||null==(e=eo.current)||e.addEventListener("scroll",t)),function(){var e;null==eo||null==(e=eo.current)||e.removeEventListener("scroll",t)}},[$,G,null==eo?void 0:eo.current]),(0,u.useEffect)(function(){if(null==eo?void 0:eo.current){var e,t,n;eS(Number.parseInt((e=(null==eo||null==(t=eo.current)?void 0:t.scrollHeight)-(null==eo||null==(n=eo.current)?void 0:n.clientHeight),e.toString()),10))}},[ey,null==eo?void 0:eo.current]),I)?(0,r.jsxs)("div",{className:(0,o.default)(h,S,(t(g={disabled:x},"".concat(h,"-mobile"),G),t(g,"".concat(h,"--focused"),$),g)),ref:el,children:[(0,r.jsxs)("button",{type:"button","data-testid":B,className:"".concat(h,"__trigger input__wrap ").concat($?"input__wrap--focus":""," ").concat(!w?"placeholder":""," ").concat(y?"error":""),onClick:function(){return L?null:eI(!$)},onMouseDown:function(){return ev(!0)},onFocus:function(){return ef?null:eI(!0)},tabIndex:R,children:[L?(0,r.jsx)("input",n({ref:ei,className:"".concat(h,"__input"),value:$?G&&P||!et?J:Y:J,onChange:eD,placeholder:E,onFocus:eq,onClick:function(e){var t,n;$||eI(!0),G&&P?(e.preventDefault(),e.stopPropagation(),e.target&&(null==(t=e.target)||t.blur())):e.target&&(null==(n=e.target)||n.select())},tabIndex:-1},q)):(0,r.jsx)("span",{className:"text",children:J||E}),(0,r.jsx)("span",{className:(0,o.default)("".concat(h,"__arrow"),t({},"".concat(h,"__arrow_active"),$)),onClick:function(){return eI(!$)},children:G?(0,r.jsx)(c.Code,{className:"mobile-icon"}):$?(0,r.jsx)(c.ChevronUp,{}):(0,r.jsx)(c.ChevronDown,{})})]}),$&&(G&&P?(p=eO())?(0,i.createPortal)(eF(),p):null:eF())]}):null};
1
+ function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,l=Array(t);n<t;n++)l[n]=e[n];return l}function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e){for(var n=1;n<arguments.length;n++){var l=null!=arguments[n]?arguments[n]:{},r=Object.keys(l);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(l).filter(function(e){return Object.getOwnPropertyDescriptor(l,e).enumerable}))),r.forEach(function(n){t(e,n,l[n])})}return e}function l(t,n){return function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,l,r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],u=!0,i=!1;try{for(r=r.call(e);!(u=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);u=!0);}catch(e){i=!0,l=e}finally{try{u||null==r.return||r.return()}finally{if(i)throw l}}return o}}(t,n)||function(t,n){if(t){if("string"==typeof t)return e(t,n);var l=Object.prototype.toString.call(t).slice(8,-1);if("Object"===l&&t.constructor&&(l=t.constructor.name),"Map"===l||"Set"===l)return Array.from(l);if("Arguments"===l||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return e(t,n)}}(t,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.")}()}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return b}});var r=require("react/jsx-runtime"),o=p(require("classnames")),u=function(e,t){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 n=m(t);if(n&&n.has(e))return n.get(e);var l={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var u=r?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(l,o,u):l[o]=e[o]}return l.default=e,n&&n.set(e,l),l}(require("react")),i=require("react-dom"),c=require("react-feather"),a=require("../../../Functions/fieldValueFormatters"),s=require("../../../Functions/useDebounce"),d=p(require("../../../Functions/useIsMobile/useIsMobile")),f=p(require("../../Layout/Spinner/Spinner")),v=p(require("../RadioInput/RadioInput"));function p(e){return e&&e.__esModule?e:{default:e}}function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(m=function(e){return e?n:t})(e)}require("./DropdownLiveSearch.scss");var h="dropdown-live-search",b=function(e){var p,m,b,g,_=e.label,w=e.value,y=e.error,x=e.disabled,j=e.onChange,E=e.placeholder,S=e.className,L=e.isSearchable,N=e.doRequest,C=e.isLoading,I=e.options,k=e.fieldKey,O=e.id,M=e.isListTop,q=e.attributesOfNativeInput,P=e.withMobileLogic,R=e.tabIndex,H=e.isNotValidateASCII,D=void 0!==H&&H,A=e.noOptionsText,T=void 0===A?"No options available":A,F=e.testId,B=void 0===F?"dropdown-live-search":F,W=l((0,u.useState)(O||k||Math.random().toString(16).slice(2)),1)[0],V=l((0,u.useState)(!1),2),$=V[0],U=V[1],z=l((0,u.useState)(!1),2),K=z[0],X=z[1],G=(0,d.default)().isMobile&&P&&window.screen.width<=768,J=(0,u.useMemo)(function(){var e,t;return null!=(t=null==I||null==(e=I.find(function(e){return e.value===w}))?void 0:e.label)?t:""},[w,I]),Q=l((0,u.useState)(""),2),Y=Q[0],Z=Q[1],ee=l((0,u.useState)(!1),2),et=ee[0],en=ee[1],el=(0,u.useRef)(null),er=(0,u.useRef)(null),eo=(0,u.useRef)(null),eu=(0,u.useRef)(null),ei=(0,u.useRef)(null),ec=(0,u.useRef)(null),ea=(0,u.useRef)(null),es=(0,u.useRef)(null),ed=l((0,u.useState)(!1),2),ef=ed[0],ev=ed[1],ep=l((0,u.useState)(null),2),em=ep[0],eh=ep[1],eb=l((0,u.useState)(!1),2),eg=eb[0],e_=eb[1],ew=l((0,u.useState)(0),2),ey=ew[0],ex=ew[1],ej=l((0,u.useState)(1),2),eE=ej[0],eS=ej[1],eL=(0,s.useDebounce)({searchValue:Y,delay:600}),eN=(0,u.useCallback)(function(e){if(N&&"function"==typeof N){var t,n=null==e?void 0:e.target;Math.round(n.clientHeight+n.scrollTop)===n.scrollHeight&&N(null!=(t=ea.current)?t:"",!0)}},[I]),eC=function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];t&&en(!0),Z(e),ea.current=e},eI=function(e){U(e),eC("",!1),e||en(!1)},ek=function(){var e,t;return null!=(t=null!=(e=document.querySelector("div#root"))?e:document.querySelector("div#app"))?t:document.querySelector("div#storybook-root")},eO=function(){return document.getElementById(null==W?void 0:W.toString())},eM=function(e){e.target===(null==es?void 0:es.current)&&(e.stopPropagation(),e.preventDefault(),eI(!1))},eq=function(e){$||(e.preventDefault(),e.stopPropagation())},eP=function(e){var t;!el.current||el.current.contains(e.target)||eO()&&(null==(t=eO())?void 0:t.contains(e.target))||eI(!1)},eR=function(e){[27].includes(e.keyCode)&&eI(!1)},eH=$?eP:function(){},eD=function(e){var t,n=null==(t=e.target)?void 0:t.value;D||(n=(0,a.formatToOnlyASCIICodeText)(n)),eC(n),!Y&&et||e.target.value?X(!1):(null==j||j(""),eC(""),X(!0))},eA=function(e,t){if(!L)return e;var n=et||G&&P?Y:J;return e=e.replace(/["&<>]/g,function(e){var t;return null!=(t=({'"':"&quot;","&":"&amp;","<":"&lt;",">":"&gt;"})[e])?t:""}),(n?null==e?void 0:e.replace(RegExp(null==n?void 0:n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&"),"i"),function(e){return'<span class="bg--yellow">'.concat(e,"</span>")}):e)+(t?'<span class="dropdown__list-item-postfix">'.concat(t,"</span>"):"")},eT=function(e,n,l){var u,i,a,s,d=e.label.toLowerCase(),f=null==Y?void 0:Y.toLowerCase();return(0,r.jsxs)("button",{type:"button","data-testid":"".concat(B,"-").concat(l||n,"-option"),onClick:function(){null==j||j(e.value),eI(!1)},className:(0,o.default)("".concat(h,"__list-item"),(t(s={},"".concat(h,"__list-item_active"),e.value===w),t(s,"".concat(h,"__list-item_disabled"),e.disabled),s),e.className),children:[!G||G&&!P&&(0,r.jsx)("span",{className:(0,o.default)("".concat(h,"__active-icon"),t({},"".concat(h,"__active-icon_active"),d===f)),children:(0,r.jsx)(c.Check,{})}),(0,r.jsx)("p",{title:e.label,className:e.labelClassName||"",dangerouslySetInnerHTML:{__html:eA(e.label,e.postfix)}}),G?null!=(a=null==e?void 0:e.customMobileIcon)?a:(0,r.jsx)(v.default,{value:e.value,checked:null==w?void 0:w.toString()}):""]},null==(i=e.value)||null==(u=i.toString())?void 0:u.replace(/ /g,"_"))},eF=function(){var e,l,u;return(0,r.jsx)("div",{className:(0,o.default)("".concat(h,"__container-wrapper")),ref:es,onClick:G?eM:function(){},children:(0,r.jsx)("div",{className:(0,o.default)("".concat(h,"__list-wrapper"),(t(l={},"".concat(h,"__list-wrapper--fixed-height"),eg),t(l,"".concat(h,"__list-wrapper--with-bottom-shadow"),em&&G),t(l,"".concat(h,"__list-wrapper--with-bottom-shadow-hidden"),ey===eE),l)),children:(0,r.jsxs)("div",{id:"dropdown-live-search-list",className:(0,o.default)("".concat(h,"__container"),t({},"".concat(h,"__list-top"),M)),ref:er,children:[G&&(0,r.jsxs)("div",{ref:eu,className:(0,o.default)("".concat(h,"__list-header"),(t(u={},"".concat(h,"__list-header-with-shadow"),em&&G),t(u,"".concat(h,"__list-header-with-shadow-hidden"),0===ey),u)),children:[(0,r.jsxs)("div",{className:(0,o.default)("".concat(h,"__list-header-row")),children:[(0,r.jsx)("div",{className:(0,o.default)("".concat(h,"__list-label")),children:_}),(0,r.jsx)("div",{className:(0,o.default)("".concat(h,"__list-close-icon")),onClick:function(){return eI(!1)},children:(0,r.jsx)(c.X,{onClick:function(){return eI(!1)}})})]}),L&&(0,r.jsx)("input",n({ref:ec,className:"".concat(h,"__input"),value:$?Y:J,onChange:eD,placeholder:E,onFocus:eq,tabIndex:-1},q))]}),(0,r.jsxs)("div",{className:(0,o.default)("".concat(h,"__list"),{disabled:C}),ref:eo,children:[null==I?void 0:I.map(function(e){return eT(e)}),!(null==I?void 0:I.length)&&(0,r.jsx)("div",{className:"".concat(h,"__list-item ").concat(h,"__list-item--no-options"),children:T})]}),C&&$&&(0,r.jsx)(f.default,{size:(null!=(e=null==I?void 0:I.length)?e:0)<=3?"small":null})]})})})},eB=function(){var e=document.createElement("div");e.setAttribute("id",null==W?void 0:W.toString()),e.classList.add("dropdown__container"),G&&e.addEventListener("click",function(e){e.target.id===W&&eI(!1)});try{null==(t=eO())||t.remove()}finally{if(G){try{null==(r=document.getElementById("mlw-".concat(W)))||r.remove()}catch(e){}var t,n,l,r,o=document.createElement("div");o.classList.add("dropdown-live-search-mobile"),o.setAttribute("id","mlw-".concat(W)),null==o||o.append(e),null==(l=ek())||l.append(o)}else null==(n=ek())||n.append(e)}};return((0,u.useEffect)(function(){return document.addEventListener("click",eP,!0),function(){return document.removeEventListener("click",eP,!0)}},[]),(0,u.useEffect)(function(){(null==I?void 0:I.length)===1&&Y===I[0].label&&(eC(I[0].label),null==j||j(I[0].value))},[I]),(0,u.useEffect)(function(){L&&(eL||K)&&(null==N||N(eL),K&&X(!1))},[eL,K]),(0,u.useEffect)(function(){G&&P&&eB()},[G,P]),(0,u.useEffect)(function(){if($&&G&&(null==eo?void 0:eo.current)&&!Y){var e,t,n,l;eh((null==eo||null==(e=eo.current)?void 0:e.scrollHeight)>(null==eo||null==(t=eo.current)?void 0:t.clientHeight)),e_(em||(null==eo||null==(n=eo.current)?void 0:n.scrollHeight)>(null==eo||null==(l=eo.current)?void 0:l.clientHeight))}},[$,G,em,null==eo?void 0:eo.current,null==eo||null==(m=eo.current)?void 0:m.scrollHeight,null==eo||null==(b=eo.current)?void 0:b.clientHeight]),(0,u.useLayoutEffect)(function(){var e=document.getElementById("dropdown-live-search-list");if((e||$)&&(!P||!G)){var t,n=null==el||null==(t=el.current)?void 0:t.clientWidth;e&&(e.style.minWidth="".concat(n,"px"))}},[el,$,P]),(0,u.useEffect)(function(){if(!$&&(ev(!1),P&&G&&eC("")),$&&eo&&eo.current){if(G&&P){var e;null==N||N("").then(function(){setTimeout(function(){if(eo.current&&(null==er?void 0:er.current)&&(null==eu?void 0:eu.current)){var e,t,n,l;eo.current.style.maxHeight="".concat((null==er||null==(t=er.current)||null==(e=t.getBoundingClientRect())?void 0:e.height)-(null==eu||null==(l=eu.current)||null==(n=l.getBoundingClientRect())?void 0:n.height),"px")}},1)}),null==ec||null==(e=ec.current)||e.focus()}else G||null==N||N("");eo.current.addEventListener("scroll",eN)}return function(){removeEventListener("scroll",eN)}},[$,eo]),(0,u.useLayoutEffect)(function(){var e;return G?(window.removeEventListener("mousewheel",eH),window.removeEventListener("scroll",eH),window.removeEventListener("touchmove",eH)):(window.addEventListener("mousewheel",eH),window.addEventListener("scroll",eH),window.addEventListener("touchmove",eH)),null==(e=eO())||e.addEventListener("click",eH),window.addEventListener("keyup",eR),function(){var e;window.removeEventListener("mousewheel",eH),window.removeEventListener("scroll",eH),window.removeEventListener("touchmove",eH),window.removeEventListener("keyup",eR),null==(e=eO())||e.removeEventListener("click",eH)}},[eO]),(0,u.useEffect)(function(){var e,t=function(e){var t,n;ex(Number.parseInt(null==(n=e.target)||null==(t=n.scrollTop)?void 0:t.toString(),10))};return $&&G&&(null==eo?void 0:eo.current)&&(null==eo||null==(e=eo.current)||e.addEventListener("scroll",t)),function(){var e;null==eo||null==(e=eo.current)||e.removeEventListener("scroll",t)}},[$,G,null==eo?void 0:eo.current]),(0,u.useEffect)(function(){if(null==eo?void 0:eo.current){var e,t,n;eS(Number.parseInt((e=(null==eo||null==(t=eo.current)?void 0:t.scrollHeight)-(null==eo||null==(n=eo.current)?void 0:n.clientHeight),e.toString()),10))}},[ey,null==eo?void 0:eo.current]),I)?(0,r.jsxs)("div",{className:(0,o.default)(h,S,(t(g={disabled:x},"".concat(h,"-mobile"),G),t(g,"".concat(h,"--focused"),$),g)),ref:el,children:[(0,r.jsxs)("button",{type:"button","data-testid":B,className:"".concat(h,"__trigger input__wrap ").concat($?"input__wrap--focus":""," ").concat(!w?"placeholder":""," ").concat(y?"error":""),onClick:function(){return L?null:eI(!$)},onMouseDown:function(){return ev(!0)},onFocus:function(){return ef?null:eI(!0)},tabIndex:R,children:[L?(0,r.jsx)("input",n({ref:ei,className:"".concat(h,"__input"),value:$?G&&P||!et?J:Y:J,onChange:eD,placeholder:E,onFocus:eq,onClick:function(e){var t,n;$||eI(!0),G&&P?(e.preventDefault(),e.stopPropagation(),e.target&&(null==(t=e.target)||t.blur())):e.target&&(null==(n=e.target)||n.select())},tabIndex:-1},q)):(0,r.jsx)("span",{className:"text",children:J||E}),(0,r.jsx)("span",{className:(0,o.default)("".concat(h,"__arrow"),t({},"".concat(h,"__arrow_active"),$)),onClick:function(){return eI(!$)},children:G?(0,r.jsx)(c.Code,{className:"mobile-icon"}):$?(0,r.jsx)(c.ChevronUp,{}):(0,r.jsx)(c.ChevronDown,{})})]}),$&&(G&&P?(p=eO())?(0,i.createPortal)(eF(),p):null:eF())]}):null};
@@ -0,0 +1,3 @@
1
+ declare const _default: React.MemoExoticComponent<(props: any) => JSX.Element>;
2
+ export default _default;
3
+ import React from "react";
@@ -0,0 +1,3 @@
1
+ declare const _default: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<any>>;
2
+ export default _default;
3
+ import React from "react";
@@ -0,0 +1,2 @@
1
+ export default ExampleChartIntegration;
2
+ declare function ExampleChartIntegration(props: any): JSX.Element;
@@ -0,0 +1,14 @@
1
+ import type { IModalProps } from './Modal.interface';
2
+ import './Modal.scss';
3
+ import './ModalMobile.scss';
4
+ export declare const KEY_CODE: Readonly<{
5
+ readonly ENTER: 13;
6
+ readonly ESC: 27;
7
+ }>;
8
+ export declare function renderModalTitle({ mode, title, onlyTitle, }: {
9
+ mode?: string;
10
+ title: string;
11
+ onlyTitle?: boolean;
12
+ }): string;
13
+ declare const Modal: import("react").ForwardRefExoticComponent<IModalProps & import("react").RefAttributes<HTMLDivElement>>;
14
+ export default Modal;
@@ -0,0 +1,64 @@
1
+ import type { ReactNode, RefObject } from 'react';
2
+ import type { IUniProps } from '../../../types/base.interface';
3
+ import type WithEventManagementAsObj from '../../../types/declaration/WithEventManagementAsObj';
4
+ export type TModalVariant = 'default' | 'primary';
5
+ export type TModalMode = 'default' | 'create' | 'edit' | 'add';
6
+ export type TModalSize = 'default' | 290 | 420 | 870 | 770 | 950;
7
+ export interface IModalTitleProps extends IUniProps {
8
+ variant?: TModalVariant;
9
+ children: ReactNode;
10
+ isForced?: boolean;
11
+ onClose?: () => void;
12
+ noHeaderCloseBtn?: boolean;
13
+ wrapperRef?: RefObject<HTMLDivElement>;
14
+ }
15
+ export interface IModalFooterProps extends IUniProps {
16
+ children: ReactNode;
17
+ wrapperRef?: RefObject<HTMLDivElement>;
18
+ }
19
+ export interface IModalProps extends IUniProps {
20
+ /** ID for correct identification */
21
+ id?: number | string;
22
+ isOpen: boolean;
23
+ title: string;
24
+ children: ReactNode;
25
+ variant?: TModalVariant;
26
+ mode?: TModalMode;
27
+ size?: TModalSize | string | number;
28
+ zIndex?: number;
29
+ onConfirm?: () => void;
30
+ onDecline?: () => void;
31
+ closeModal?: () => void;
32
+ onlyTitle?: boolean;
33
+ noHeader?: boolean;
34
+ noHeaderCloseBtn?: boolean;
35
+ atributesForModalBody?: Record<string, unknown>;
36
+ noFooter?: boolean;
37
+ withFixedFooter?: boolean;
38
+ leftContentOfFooter?: ReactNode;
39
+ customFooter?: ReactNode;
40
+ confirmBtnClassName?: string;
41
+ confirmBtnLabel?: string;
42
+ confirmBtnVariant?: string;
43
+ confirmBtnDisable?: boolean;
44
+ confirmBtnIcon?: ReactNode;
45
+ isConfirmBtnIconPositionRight?: boolean;
46
+ noConfirmBtn?: boolean;
47
+ closeBtnClassName?: string;
48
+ closeBtnText?: string;
49
+ closeBtnVariant?: string;
50
+ closeBtnDisable?: boolean;
51
+ closeBtnIcon?: ReactNode;
52
+ isCloseBtnIconPositionRight?: boolean;
53
+ noCloseBtn?: boolean;
54
+ forced?: boolean;
55
+ withMobileLogic?: boolean;
56
+ btnClassNames?: string;
57
+ withEventManagement?: WithEventManagementAsObj<'Modal'> | boolean | null;
58
+ submitOnEnter?: boolean;
59
+ closeOnEsc?: boolean;
60
+ }
61
+ export interface IModalHOCProps extends Pick<IModalProps, 'id' | 'zIndex' | 'isOpen' | 'children' | 'className' | 'size' | 'testId' | 'closeOnEsc'> {
62
+ closeModal: () => void;
63
+ withEventManagement?: WithEventManagementAsObj<'Modal'> | boolean | null;
64
+ }
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:!0});
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Modal.interface.js","sourceRoot":"","sources":["../../../../src/Atomic/UI/Modal/Modal.interface.ts"],"names":[],"mappings":""}
@@ -1,6 +1,7 @@
1
1
  import type { ReactNode, RefObject } from 'react';
2
2
 
3
3
  import type { IUniProps } from '../../../types/base.interface';
4
+ import type WithEventManagementAsObj from '../../../types/declaration/WithEventManagementAsObj';
4
5
 
5
6
  export type TModalVariant = 'default' | 'primary';
6
7
  export type TModalMode = 'default' | 'create' | 'edit' | 'add';
@@ -21,6 +22,9 @@ export interface IModalFooterProps extends IUniProps {
21
22
  }
22
23
 
23
24
  export interface IModalProps extends IUniProps {
25
+ /** ID for correct identification */
26
+ id?: number | string;
27
+
24
28
  isOpen: boolean;
25
29
  title: string;
26
30
  children: ReactNode;
@@ -68,16 +72,23 @@ export interface IModalProps extends IUniProps {
68
72
 
69
73
  // Additional options
70
74
  forced?: boolean;
75
+ withMobileLogic?: boolean;
71
76
  btnClassNames?: string;
77
+
78
+ // ? Приоритетнее чем submitOnEnter и closeOnEsc
79
+ // ? Используем "мягкий" варинт типизации для возможности гибкой конфигурации
80
+ withEventManagement?: WithEventManagementAsObj<'Modal'> | boolean | null;
72
81
  submitOnEnter?: boolean;
73
82
  closeOnEsc?: boolean;
74
- withMobileLogic?: boolean;
75
83
  }
76
84
 
77
85
  export interface IModalHOCProps
78
86
  extends Pick<
79
87
  IModalProps,
80
- 'zIndex' | 'isOpen' | 'children' | 'className' | 'size' | 'testId' | 'closeOnEsc'
88
+ 'id' | 'zIndex' | 'isOpen' | 'children' | 'className' | 'size' | 'testId' | 'closeOnEsc'
81
89
  > {
82
90
  closeModal: () => void;
91
+
92
+ // ? Используем "мягкий" варинт типизации для возможности гибкой конфигурации
93
+ withEventManagement?: WithEventManagementAsObj<'Modal'> | boolean | null;
83
94
  }
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0});var e=exports,o={KEY_CODE:function(){return m},default:function(){return y},renderModalTitle:function(){return b}};for(var t in o)Object.defineProperty(e,t,{enumerable:!0,get:o[t]});var n=require("react/jsx-runtime"),r=u(require("classnames")),l=require("react"),a=u(require("../../../Functions/useKeyPress/useHandleKeyPress")),i=u(require("../Button/Button")),c=u(require("./partials/ModalFooter")),d=u(require("./partials/ModalTitle")),s=u(require("./partials/useMobileModal"));function u(e){return e&&e.__esModule?e:{default:e}}require("./Modal.scss"),require("./ModalMobile.scss");var f={},m=Object.freeze({ENTER:13,ESC:27});function b(e){var o=e.mode,t=e.title,n=e.onlyTitle;return o&&"default"!==o&&!n?"".concat(o[0].toUpperCase()).concat(o.slice(1)," ").concat(t):t}var p=(0,l.forwardRef)(function(e,o){var t,u,m=e.zIndex,p=e.isOpen,y=e.onConfirm,O=e.onDecline,v=e.closeModal,_=e.children,h=e.className,j=e.title,C=e.variant,x=e.onlyTitle,I=e.mode,g=e.size,E=e.atributesForModalBody,M=e.confirmBtnClassName,B=e.confirmBtnLabel,D=e.confirmBtnVariant,w=e.confirmBtnDisable,N=e.confirmBtnIcon,R=e.isConfirmBtnIconPositionRight,F=e.noConfirmBtn,P=e.noCloseBtn,S=e.noFooter,H=e.noHeader,T=e.closeBtnClassName,k=e.closeBtnText,q=e.closeBtnVariant,A=e.closeBtnDisable,K=e.closeBtnIcon,L=e.forced,z=e.btnClassNames,Y=e.isCloseBtnIconPositionRight,U=e.submitOnEnter,V=e.closeOnEsc,G=e.leftContentOfFooter,J=e.customFooter,Q=e.testId,W=void 0===Q?"modal":Q,X=e.noHeaderCloseBtn,Z=e.withMobileLogic,$=e.withFixedFooter,ee=(0,l.useRef)(null),eo=(0,s.default)({withMobileLogic:Z,withFixedFooter:$,isOpen:p}),et=eo.modalMobileHeaderRef,en=eo.modalMobileBodyRef,er=eo.modalMobileFooterRef,el=eo.MODALS_LOGIC,ea=eo.renderModal,ei=eo.isMobile,ec=eo.scrollTop,ed=eo.scrollHeight,es={confirm:function(){null==y||y()},decline:function(){"function"==typeof O?O():null==v||v()}};return((0,a.default)({enterCallback:(void 0===U||U)&&"function"==typeof y?function(){return es.confirm()}:void 0,escCallback:(void 0===V||V)&&"function"==typeof v?function(){return v()}:void 0,withClamping:!1}),p)?(0,n.jsx)("div",{style:{zIndex:void 0===m?100:m},"data-testid":W,className:"modal-box j5",role:"dialog","aria-modal":"true","aria-labelledby":"".concat(W,"-title"),children:ea((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{"data-testid":"".concat(W,"-overlay"),className:p?"modal-overlay":"hidden",onClick:v,role:"presentation"}),(0,n.jsxs)("div",{ref:o||ee,style:{width:"number"==typeof g?"".concat(g,"px"):"".concat(null==g?void 0:g.replace("px",""),"px")},className:(0,r.default)(h,{modal:p,"modal--no-header":p&&H,"modal-mobile":p&&ei,hidden:!p}),children:[!H&&(0,n.jsx)(d.default,{wrapperRef:et,className:(0,r.default)({"modal__header--hidden":el.IS_HEADER_HIDDEN,"modal__header--sticky":!el.IS_HEADER_HIDDEN&&el.IS_HEADER_STICKY}),variant:void 0===C?"primary":C,isForced:L,onClose:es.decline,noHeaderCloseBtn:X,children:(0,n.jsx)("span",{id:"".concat(W,"-title"),children:b({mode:I,title:j,onlyTitle:x})})}),(0,n.jsx)("div",(t=function(e){for(var o=1;o<arguments.length;o++){var t=null!=arguments[o]?arguments[o]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(o){var n;n=t[o],o in e?Object.defineProperty(e,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[o]=n})}return e}({},void 0===E?f:E),u=u={ref:en,className:(0,r.default)("modal__body",{"modal__body--no-footer":S}),role:"document",children:_},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(u)):(function(e,o){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(u)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(u,e))}),t)),(!S||J)&&(0,n.jsx)(c.default,{wrapperRef:er,className:(0,r.default)({"modal__footer--hidden":el.IS_FOOTER_HIDDEN,"modal__footer--sticky":!el.IS_FOOTER_HIDDEN&&el.IS_FOOTER_STICKY&&ec!==ed,"modal__footer_with-left-content":G}),children:J||(0,n.jsxs)(n.Fragment,{children:[G,(!P||!F)&&(0,n.jsxs)("div",{className:"modal__buttons-block",children:[!P&&(0,n.jsx)(i.default,{testId:"modal",className:(0,r.default)(T,z),variant:q||"dark-outline",onClick:function(){return es.decline()},label:k||"Cancel",disabled:A,icon:K,isIconRight:Y,tabIndex:1,"aria-label":"Close modal"}),!F&&(0,n.jsx)(i.default,{testId:"modal",onClick:function(){return es.confirm()},label:B||I&&(null==I?void 0:I[0].toUpperCase())+(null==I?void 0:I.slice(1))||"Apply",className:(0,r.default)("ml5",M,z),variant:void 0===D?"primary":D,disabled:w,icon:N,isIconRight:R,"aria-label":"Confirm modal"})]})]})})]})]}))}):null});p.displayName="Modal";var y=p;
1
+ Object.defineProperty(exports,"__esModule",{value:!0});var e=exports,t={KEY_CODE:function(){return p},default:function(){return E},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=f(require("classnames")),i=require("react"),a=f(require("../../../Functions/useKeyPress/useHandleKeyPress")),l=f(require("../Button/Button")),s=require("./partials/_constants"),c=require("./partials/_utils"),d=f(require("./partials/ModalFooter")),u=f(require("./partials/ModalTitle")),m=f(require("./partials/useMobileModal"));function f(e){return e&&e.__esModule?e:{default:e}}require("./Modal.scss"),require("./ModalMobile.scss");var b={},p=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 y=(0,i.forwardRef)(function(e,t){var n,f,p=e.id,y=e.zIndex,E=e.isOpen,O=e.onConfirm,h=e.onDecline,_=e.closeModal,j=e.children,C=e.className,g=e.title,M=e.variant,x=e.onlyTitle,I=e.mode,N=e.size,S=e.atributesForModalBody,P=e.confirmBtnClassName,w=e.confirmBtnLabel,B=e.confirmBtnVariant,D=e.confirmBtnDisable,R=e.confirmBtnIcon,F=e.isConfirmBtnIconPositionRight,T=e.noConfirmBtn,H=e.noCloseBtn,q=e.noFooter,k=e.noHeader,A=e.closeBtnClassName,K=e.closeBtnText,L=e.closeBtnVariant,V=e.closeBtnDisable,G=e.closeBtnIcon,z=e.forced,W=e.btnClassNames,Y=e.isCloseBtnIconPositionRight,U=e.submitOnEnter,J=e.closeOnEsc,Q=e.withEventManagement,X=e.leftContentOfFooter,Z=e.customFooter,$=e.testId,ee=void 0===$?"modal":$,et=e.noHeaderCloseBtn,en=e.withMobileLogic,eo=e.withFixedFooter,er=(0,i.useRef)(null),ei=(0,c.getWithEventManagementStructure)(p,void 0!==Q&&Q),ea=(0,m.default)({withMobileLogic:en,withFixedFooter:eo,isOpen:E}),el=ea.modalMobileHeaderRef,es=ea.modalMobileBodyRef,ec=ea.modalMobileFooterRef,ed=ea.MODALS_LOGIC,eu=ea.renderModal,em=ea.isMobile,ef=ea.scrollTop,eb=ea.scrollHeight,ep={confirm:function(){null==O||O()},decline:function(){"function"==typeof h?h():null==_||_()}};return((0,a.default)({enterCallback:(void 0===U||U)&&"function"==typeof O?function(){return ep.confirm()}:void 0,escCallback:(void 0===J||J)&&"function"==typeof _?function(){return _()}:void 0,withClamping:!1,withEventManagementStructure:ei}),(0,i.useEffect)(function(){var e=(0,c.getOnKeyPress)({id:p,onSubmit:ep.confirm,onClose:_});return ei.isWithSubmitAndCloseManagement&&e&&(document.addEventListener(s.EVENTS.iGotAnEnterKeyPress.name,e),document.addEventListener(s.EVENTS.iGotAnEscKeyPress.name,e)),function(){ei.isWithSubmitAndCloseManagement&&e&&(document.removeEventListener(s.EVENTS.iGotAnEnterKeyPress.name,e),document.removeEventListener(s.EVENTS.iGotAnEscKeyPress.name,e))}},[]),E)?(0,o.jsx)("div",{style:{zIndex:void 0===y?100:y},"data-testid":ee,className:"modal-box j5",role:"dialog","aria-modal":"true","aria-labelledby":"".concat(ee,"-title"),children:eu((0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{"data-testid":"".concat(ee,"-overlay"),className:E?"modal-overlay":"hidden",onClick:_,role:"presentation"}),(0,o.jsxs)("div",{ref:t||er,style:{width:"number"==typeof N?"".concat(N,"px"):"".concat(null==N?void 0:N.replace("px",""),"px")},className:(0,r.default)(C,{modal:E,"modal--no-header":E&&k,"modal-mobile":E&&em,hidden:!E}),children:[!k&&(0,o.jsx)(u.default,{wrapperRef:el,className:(0,r.default)({"modal__header--hidden":ed.IS_HEADER_HIDDEN,"modal__header--sticky":!ed.IS_HEADER_HIDDEN&&ed.IS_HEADER_STICKY}),variant:void 0===M?"primary":M,isForced:z,onClose:_,noHeaderCloseBtn:et,children:(0,o.jsx)("span",{id:"".concat(ee,"-title"),children:v({mode:I,title:g,onlyTitle:x})})}),(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===S?b:S),f=f={ref:es,className:(0,r.default)("modal__body",{"modal__body--no-footer":q}),role:"document",children:j},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(f)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(f)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(f,e))}),n)),(!q||Z)&&(0,o.jsx)(d.default,{wrapperRef:ec,className:(0,r.default)({"modal__footer--hidden":ed.IS_FOOTER_HIDDEN,"modal__footer--sticky":!ed.IS_FOOTER_HIDDEN&&ed.IS_FOOTER_STICKY&&ef!==eb,"modal__footer_with-left-content":X}),children:Z||(0,o.jsxs)(o.Fragment,{children:[X,(!H||!T)&&(0,o.jsxs)("div",{className:"modal__buttons-block",children:[!H&&(0,o.jsx)(l.default,{testId:"modal",className:(0,r.default)(A,W),variant:L||"dark-outline",onClick:function(){return ep.decline()},label:K||"Cancel",disabled:V,icon:G,isIconRight:Y,tabIndex:1,"aria-label":"Close modal"}),!T&&(0,o.jsx)(l.default,{testId:"modal",onClick:function(){return ep.confirm()},label:w||I&&(null==I?void 0:I[0].toUpperCase())+(null==I?void 0:I.slice(1))||"Apply",className:(0,r.default)("ml5",P,W),variant:void 0===B?"primary":B,disabled:D,icon:R,isIconRight:F,"aria-label":"Confirm modal"})]})]})})]})]}))}):null});y.displayName="Modal";var E=y;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../../src/Atomic/UI/Modal/Modal.tsx"],"names":[],"mappings":";;;AAuBA,4CAaC;;AAlCD,oEAA4B;AAC5B,iCAAsD;AAEtD,iHAAiF;AAEjF,sEAAsC;AACtC,sDAA+C;AAC/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,IAAI,KAAK,SAAS,IAAI,CAAC,SAAS,EAAE,CAAC;QAC7C,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC;IAC7D,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,KAAK,GAAG,IAAA,kBAAU,EACtB,CACE,EACE,EAAE,EACF,MAAM,GAAG,GAAG,EACZ,MAAM,EACN,SAAS;AACT,iIAAiI;AACjI,w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KAAK,EACH,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,CACF,CAAC;AAEF,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;AAE5B,kBAAe,KAAK,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { IModalHOCProps } from './Modal.interface';
2
+ import React from 'react';
3
+ import './Modal.scss';
4
+ declare const Modal: React.FC<IModalHOCProps>;
5
+ export default Modal;
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return l}});var e=require("react/jsx-runtime"),r=o(require("classnames")),t=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=a(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var i=o?Object.getOwnPropertyDescriptor(e,l):null;i&&(i.get||i.set)?Object.defineProperty(n,l,i):n[l]=e[l]}return n.default=e,t&&t.set(e,n),n}(require("react")),n=o(require("../../../Functions/useKeyPress/useHandleKeyPress"));function o(e){return e&&e.__esModule?e:{default:e}}function a(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(a=function(e){return e?t:r})(e)}require("./Modal.scss");var l=function(o){var a=o.zIndex,l=o.isOpen,i=o.closeModal,u=o.children,s=o.className,d=o.size,c=o.testId,f=void 0===c?"modal":c,p=o.closeOnEsc,y=(0,t.useRef)(null);return((0,n.default)({escCallback:(void 0===p||p)&&"function"==typeof i?function(){return null==i?void 0:i()}:void 0}),l)?(0,e.jsxs)("div",{style:{zIndex:void 0===a?100:a},"data-testid":f,className:"modal-box j5",role:"presentation",children:[(0,e.jsx)("div",{className:"modal-overlay",onClick:i,role:"presentation","aria-hidden":"true"}),(0,e.jsx)("div",{ref:y,style:{width:d},className:(0,r.default)(s,"modal"),role:"dialog","aria-modal":"true","aria-labelledby":f,tabIndex:-1,children:u})]}):null};
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return u}});var e=require("react/jsx-runtime"),t=o(require("classnames")),n=function(e,t){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 n=s(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var o=a?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(require("react")),r=o(require("../../../Functions/useKeyPress/useHandleKeyPress")),a=require("./partials/_constants"),i=require("./partials/_utils");function o(e){return e&&e.__esModule?e:{default:e}}function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}require("./Modal.scss");var u=function(o){var s=o.id,u=o.zIndex,l=o.isOpen,d=o.closeModal,c=o.children,f=o.className,m=o.size,p=o.testId,v=void 0===p?"modal":p,y=o.closeOnEsc,b=o.withEventManagement,g=(0,n.useRef)(null),j=(0,i.getWithEventManagementStructure)(s,void 0!==b&&b);return((0,r.default)({escCallback:(void 0===y||y)&&"function"==typeof d?function(){return null==d?void 0:d()}:void 0,withEventManagementStructure:j}),(0,n.useEffect)(function(){var e=(0,i.getOnKeyPress)({id:s,onClose:d});return j.isWithSubmitAndCloseManagement&&e&&document.addEventListener(a.EVENTS.iGotAnEscKeyPress.name,e),function(){j.isWithSubmitAndCloseManagement&&e&&document.removeEventListener(a.EVENTS.iGotAnEscKeyPress.name,e)}},[]),l)?(0,e.jsxs)("div",{style:{zIndex:void 0===u?100:u},"data-testid":v,className:"modal-box j5",role:"presentation",children:[(0,e.jsx)("div",{className:"modal-overlay",onClick:d,role:"presentation","aria-hidden":"true"}),(0,e.jsx)("div",{ref:g,style:{width:m},className:(0,t.default)(f,"modal"),role:"dialog","aria-modal":"true","aria-labelledby":v,tabIndex:-1,children:c})]}):null};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModalHOC.js","sourceRoot":"","sources":["../../../../src/Atomic/UI/Modal/ModalHOC.tsx"],"names":[],"mappings":";;;AAEA,oEAA4B;AAE5B,uDAAiD;AAEjD,iHAAiF;AACjF,sDAA+C;AAC/C,8CAAmF;AAEnF,wBAAsB;AAEtB,MAAM,KAAK,GAA6B,CAAC,EACvC,EAAE,EACF,MAAM,GAAG,GAAG,EACZ,MAAM,EACN,UAAU,EACV,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,MAAM,GAAG,OAAO,EAChB,UAAU,GAAG,IAAI,EACjB,mBAAmB,GAAG,KAAK,GAC5B,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,IAAA,cAAM,EAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,4BAA4B,GAAG,IAAA,wCAA+B,EAAC,EAAE,EAAE,mBAAmB,CAAC,CAAC;IAE9F,IAAA,2BAAiB,EAAC;QAChB,WAAW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,IAAI,EAAC,QAAQ,gBACF,MAAM,qBACA,MAAM,EACvB,QAAQ,EAAE,CAAC,CAAC,IAEX,QAAQ,CACL,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,KAAK,CAAC"}
@@ -0,0 +1,9 @@
1
+ import Modal from './Modal';
2
+ import ModalHOC from './ModalHOC';
3
+ import { EVENTS } from './partials/_constants';
4
+ import { dispatchEventForModalManagement } from './partials/_utils';
5
+ export type { IModalFooterProps, IModalHOCProps, IModalProps, IModalTitleProps } from './Modal.interface';
6
+ export { Modal, ModalHOC };
7
+ export { EVENTS };
8
+ export { dispatchEventForModalManagement };
9
+ export default Modal;
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.dispatchEventForModalManagement=exports.EVENTS=exports.ModalHOC=exports.Modal=void 0;var e=require("tslib"),t=e.__importDefault(require("./Modal"));exports.Modal=t.default;var r=e.__importDefault(require("./ModalHOC"));exports.ModalHOC=r.default;var a=require("./partials/_constants");Object.defineProperty(exports,"EVENTS",{enumerable:!0,get:function(){return a.EVENTS}});var o=require("./partials/_utils");Object.defineProperty(exports,"dispatchEventForModalManagement",{enumerable:!0,get:function(){return o.dispatchEventForModalManagement}}),exports.default=t.default;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Atomic/UI/Modal/index.ts"],"names":[],"mappings":";;;;AAAA,4DAA4B;AAQnB,gBARF,eAAK,CAQE;AAPd,kEAAkC;AAOlB,mBAPT,kBAAQ,CAOS;AANxB,sDAA+C;AAQtC,uFARA,mBAAM,OAQA;AAPf,8CAAoE;AAS3D,gHATA,wCAA+B,OASA;AACxC,8BAA8B;AAC9B,kBAAe,eAAK,CAAC"}
@@ -1,6 +1,15 @@
1
1
  import Modal from './Modal';
2
2
  import ModalHOC from './ModalHOC';
3
+ import { EVENTS } from './partials/_constants';
4
+ import { dispatchEventForModalManagement } from './partials/_utils';
3
5
 
4
- export default Modal;
6
+ // ? Экспорт типов
5
7
  export type { IModalFooterProps, IModalHOCProps, IModalProps, IModalTitleProps } from './Modal.interface';
6
- export { ModalHOC };
8
+ // ? Экспорт компоненттов
9
+ export { Modal, ModalHOC };
10
+ // ? Экспорт констант
11
+ export { EVENTS };
12
+ // ? Экспорт нужных снаружи методов
13
+ export { dispatchEventForModalManagement };
14
+ // ? Целевой дефолтный экспорт
15
+ export default Modal;
@@ -0,0 +1,4 @@
1
+ import type { IModalFooterProps } from '../Modal.interface';
2
+ import React from 'react';
3
+ declare const ModalFooter: React.FC<IModalFooterProps>;
4
+ export default ModalFooter;
@@ -0,0 +1,27 @@
1
+ export declare const DEFAULT_EVENT_OPTIONS: Readonly<{
2
+ bubbles: true;
3
+ cancelable: true;
4
+ composed: false;
5
+ }>;
6
+ export declare const EVENTS: Readonly<{
7
+ iGotAnEnterKeyPress: {
8
+ innerKey: string;
9
+ name: string;
10
+ shortName: string;
11
+ options: Readonly<{
12
+ bubbles: true;
13
+ cancelable: true;
14
+ composed: false;
15
+ }>;
16
+ };
17
+ iGotAnEscKeyPress: {
18
+ innerKey: string;
19
+ name: string;
20
+ shortName: string;
21
+ options: Readonly<{
22
+ bubbles: true;
23
+ cancelable: true;
24
+ composed: false;
25
+ }>;
26
+ };
27
+ }>;
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:!0});var e=exports,r={DEFAULT_EVENT_OPTIONS:function(){return n},EVENTS:function(){return t}};for(var s in r)Object.defineProperty(e,s,{enumerable:!0,get:r[s]});var n=Object.freeze({bubbles:!0,cancelable:!0,composed:!1}),t=Object.freeze({iGotAnEnterKeyPress:{innerKey:"iGotAnEnterKeyPress",name:"modal:i-got-an-enter-key-press",shortName:"enterIsPressed",options:n},iGotAnEscKeyPress:{innerKey:"iGotAnEscKeyPress",name:"modal:i-got-an-esc-key-press",shortName:"escIsPressed",options:n}});
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_constants.js","sourceRoot":"","sources":["../../../../../src/Atomic/UI/Modal/partials/_constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC;IACjD,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,IAAI;IAChB,QAAQ,EAAE,KAAK;CAChB,CAAC,CAAC;AAEU,QAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAClC,mBAAmB,EAAE;QACnB,QAAQ,EAAE,qBAAqB;QAC/B,IAAI,EAAE,gCAAgC;QACtC,SAAS,EAAE,gBAAgB;QAC3B,OAAO,EAAE,6BAAqB;KAC/B;IACD,iBAAiB,EAAE;QACjB,QAAQ,EAAE,mBAAmB;QAC7B,IAAI,EAAE,8BAA8B;QACpC,SAAS,EAAE,cAAc;QACzB,OAAO,EAAE,6BAAqB;KAC/B;CACF,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type WithEventManagementAsObj from '../../../../types/declaration/WithEventManagementAsObj';
2
+ import type { IModalProps } from '../Modal.interface';
3
+ export declare function getWithEventManagementStructure(modalId: number | string | null | undefined, withEventManagement?: IModalProps['withEventManagement']): WithEventManagementAsObj<'Modal', true>;
4
+ export declare function getOnKeyPress({ id: modalId, onSubmit, onClose, }: {
5
+ id: number | string | null | undefined;
6
+ onSubmit?: () => unknown;
7
+ onClose?: () => unknown;
8
+ }): ((ev: Event) => void) | null;
9
+ export declare function dispatchEventForModalManagement(eventName: string, uniqueId: number | string, target?: HTMLElement | Document): void;
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:!0});var e=exports,t={dispatchEventForModalManagement:function(){return u},getOnKeyPress:function(){return c},getWithEventManagementStructure:function(){return i}};for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]});var r=require("../../../../Functions/utils"),o=require("./_constants");function i(e,t){var n,o={isWithSubmitAndCloseManagement:!1};for(var i in o)e?o[i]=(0,r.getIsOnlyAnObject)(t)?null!=(n=t[i])&&n:!!t:o[i]=!1;return o}function c(e){var t=e.id,n=e.onSubmit,r=e.onClose;return t?function(e){var i=(e.detail||{}).id;if(t&&i&&i===t)switch(e.type){case o.EVENTS.iGotAnEnterKeyPress.name:null==n||n();break;case o.EVENTS.iGotAnEscKeyPress.name:null==r||r()}}:null}function u(e,t,n){var r,i,c=Object.values(o.EVENTS).find(function(t){return t.name===e||t.shortName===e});c&&t&&(null!=n?n:document).dispatchEvent(new CustomEvent(c.name,(r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},c.options),i=i={detail:{id:t}},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))}),r)))}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_utils.js","sourceRoot":"","sources":["../../../../../src/Atomic/UI/Modal/partials/_utils.ts"],"names":[],"mappings":";;AASA,0EA6BC;AAKD,sCA+BC;AAQD,0EASC;AAxFD,uDAAgE;AAEhE,6CAAsC;AAEtC,yFAAyF;AACzF,mEAAmE;AACnE,SAAgB,+BAA+B,CAC7C,OAA2C,EAC3C,mBAAwD;;IAExD,uFAAuF;IACvF,4EAA4E;IAC5E,MAAM,MAAM,GAAG;QACb,8BAA8B,EAAE,KAAK;KACY,CAAC;IAEpD,uCAAuC;IACvC,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,0EAA0E;QAC1E,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,CAAC,GA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FAAsF;AACtF,8DAA8D;AAC9D,gFAAgF;AAChF,4FAA4F;AAC5F,2FAA2F;AAC3F,4FAA4F;AAC5F,SAAgB,+BAA+B,CAC7C,SAAiB,EACjB,QAAyB,EACzB,MAA+B;IAE/B,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,SAAS,IAAI,EAAE,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC;IACpG,IAAI,KAAK,IAAI,QAAQ,EAAE,CAAC;QACtB,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,QAAQ,CAAC,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,GAAG,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;IAClH,CAAC;AACH,CAAC"}
@@ -0,0 +1,13 @@
1
+ export default TdCell;
2
+ declare function TdCell({ type, item, rowIndex, onChange, cardLength, changePriority, getAdviceWeight, onActionClick, rowItem, isDeleted, }: {
3
+ type: any;
4
+ item: any;
5
+ rowIndex: any;
6
+ onChange: any;
7
+ cardLength: any;
8
+ changePriority: any;
9
+ getAdviceWeight: any;
10
+ onActionClick: any;
11
+ rowItem: any;
12
+ isDeleted: any;
13
+ }): any;
@@ -0,0 +1,17 @@
1
+ export default TdRow;
2
+ declare function TdRow({ item, onChange, rowIndex, cardStatus, range, type, rowSpan, colSpan, cardLength, changePriority, getAdviceWeight, onActionClick, isDeleted, testId, }: {
3
+ item: any;
4
+ onChange: any;
5
+ rowIndex: any;
6
+ cardStatus: any;
7
+ range: any;
8
+ type: any;
9
+ rowSpan: any;
10
+ colSpan: any;
11
+ cardLength: any;
12
+ changePriority: any;
13
+ getAdviceWeight: any;
14
+ onActionClick: any;
15
+ isDeleted: any;
16
+ testId?: string | undefined;
17
+ }): JSX.Element;
@@ -0,0 +1,5 @@
1
+ export default TdTitle;
2
+ declare function TdTitle({ locations, title }: {
3
+ locations: any;
4
+ title: any;
5
+ }): JSX.Element;
@@ -0,0 +1,9 @@
1
+ export default Table;
2
+ declare function Table({ rows, onChange, className, header, onActionClick, testId, }: {
3
+ rows: any;
4
+ onChange: any;
5
+ className: any;
6
+ header: any;
7
+ onActionClick: any;
8
+ testId?: string | undefined;
9
+ }): JSX.Element;
@@ -0,0 +1,7 @@
1
+ export default TdWeight;
2
+ declare function TdWeight({ value, percent, onChange, className }: {
3
+ value: any;
4
+ percent: any;
5
+ onChange: any;
6
+ className: any;
7
+ }): JSX.Element;
@@ -0,0 +1,30 @@
1
+ import type WithEventManagementAsObj from '../../types/declaration/WithEventManagementAsObj';
2
+ interface UseHandleKeyPressProps {
3
+ /** Callback function to be called when Escape key is pressed */
4
+ escCallback?: () => void;
5
+ /** Callback function to be called when Enter key is pressed */
6
+ enterCallback?: () => void;
7
+ /** Whether to allow key repeat events */
8
+ withClamping?: boolean;
9
+ withEventManagementStructure?: WithEventManagementAsObj<'Modal'>;
10
+ }
11
+ /**
12
+ * A hook that handles Enter and Escape key press events
13
+ *
14
+ * @param props - Configuration object for key press handling
15
+ * @param props.escCallback - Function to be called when Escape key is pressed
16
+ * @param props.enterCallback - Function to be called when Enter key is pressed
17
+ * @param props.withClamping - Whether to allow key repeat events (default: true)
18
+ *
19
+ * @example
20
+ * ```tsx
21
+ * function Component() {
22
+ * useHandleKeyPress({
23
+ * escCallback: () => console.log('Esc pressed'),
24
+ * enterCallback: () => console.log('Enter pressed'),
25
+ * });
26
+ * }
27
+ * ```
28
+ */
29
+ declare function useHandleKeyPress({ escCallback, enterCallback, withClamping, withEventManagementStructure, }: UseHandleKeyPressProps): void;
30
+ export default useHandleKeyPress;
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return n}});var e,t=require("react"),u=(e=require("./useKeyPress"))&&e.__esModule?e:{default:e},n=function(e){var n=e.escCallback,r=e.enterCallback,f=e.withClamping,a=void 0===f||f,c=(0,u.default)("Enter",a),o=(0,u.default)("Escape",a);(0,t.useEffect)(function(){o&&"function"==typeof n&&n()},[o,n]),(0,t.useEffect)(function(){c&&"function"==typeof r&&r()},[c,r])};
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return u}});var e,t=require("react"),n=(e=require("./useKeyPress"))&&e.__esModule?e:{default:e},u=function(e){var u=e.escCallback,r=e.enterCallback,a=e.withClamping,f=void 0===a||a,i=(e.withEventManagementStructure||{}).isWithSubmitAndCloseManagement,c=(0,n.default)("Enter",f,i),o=(0,n.default)("Escape",f,i);(0,t.useEffect)(function(){!i&&o&&"function"==typeof u&&u()},[o,u]),(0,t.useEffect)(function(){!i&&c&&"function"==typeof r&&r()},[c,r])};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useHandleKeyPress.js","sourceRoot":"","sources":["../../../src/Functions/useKeyPress/useHandleKeyPress.ts"],"names":[],"mappings":";;;AAEA,iCAAkC;AAElC,wEAAwC;AAYxC;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAS,iBAAiB,CAAC,EACzB,WAAW,EACX,aAAa,EACb,YAAY,GAAG,IAAI,EACnB,4BAA4B,GACL;IACvB,MAAM,EAAE,8BAA8B,EAAE,GAAG,4BAA4B,IAAI,EAAE,CAAC;IAE9E,MAAM,YAAY,GAAG,IAAA,qBAAW,EAAC,OAAO,EAAE,YAAY,EAAE,8BAA8B,CAAC,CAAC;IACxF,MAAM,aAAa,GAAG,IAAA,qBAAW,EAAC,QAAQ,EAAE,YAAY,EAAE,8BAA8B,CAAC,CAAC;IAE1F,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,8BAA8B,IAAI,aAAa,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE,CAAC;YAC1F,WAAW,EAAE,CAAC;QAChB,CAAC;IACH,CAAC,EAAE,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC;IAEjC,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,8BAA8B,IAAI,YAAY,IAAI,OAAO,aAAa,KAAK,UAAU,EAAE,CAAC;YAC3F,aAAa,EAAE,CAAC;QAClB,CAAC;IACH,CAAC,EAAE,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC,CAAA;AACnC,CAAC;AAED,kBAAe,iBAAiB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * A hook that detects when a specific key is pressed
3
+ * @param targetKey - The key to listen for
4
+ * @param clamping - Whether to allow key repeat events
5
+ * @returns boolean indicating if the target key is currently pressed
6
+ */
7
+ declare function useKeyPress(targetKey: string, clamping?: boolean, isForbidden?: boolean): boolean;
8
+ export default useKeyPress;
@@ -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}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});var r=require("react"),t=function(t){var n,o=!(arguments.length>1)||void 0===arguments[1]||arguments[1],u=(n=(0,r.useState)(!1),function(e){if(Array.isArray(e))return e}(n)||function(e,r){var t,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var u=[],i=!0,a=!1;try{for(o=o.call(e);!(i=(t=o.next()).done)&&(u.push(t.value),u.length!==r);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(a)throw n}}return u}}(n,2)||function(r,t){if(r){if("string"==typeof r)return e(r,2);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)}}(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=u[0],a=u[1],l=(0,r.useCallback)(function(e){var r=e.key,n=e.repeat;if(r===t){if(!o&&n)return;a(!0)}},[o,t]),f=(0,r.useCallback)(function(e){var r=e.key,n=e.repeat;if(r===t){if(!o&&n)return;a(!1)}},[o,t]);return(0,r.useEffect)(function(){var e=function(e){return l(e)},r=function(e){return f(e)};return window.addEventListener("keydown",e),window.addEventListener("keyup",r),function(){window.removeEventListener("keydown",e),window.removeEventListener("keyup",r)}},[l,f]),i};
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}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});var r=require("react"),t=function(t){var n,o=!(arguments.length>1)||void 0===arguments[1]||arguments[1],u=arguments.length>2?arguments[2]:void 0,i=(n=(0,r.useState)(!1),function(e){if(Array.isArray(e))return e}(n)||function(e,r){var t,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var u=[],i=!0,a=!1;try{for(o=o.call(e);!(i=(t=o.next()).done)&&(u.push(t.value),u.length!==r);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(a)throw n}}return u}}(n,2)||function(r,t){if(r){if("string"==typeof r)return e(r,2);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)}}(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=i[0],l=i[1],f=(0,r.useCallback)(function(e){var r=e.key,n=e.repeat;if(r===t){if(!o&&n)return;l(!0)}},[o,t]),c=(0,r.useCallback)(function(e){var r=e.key,n=e.repeat;if(r===t){if(!o&&n)return;l(!1)}},[o,t]);return(0,r.useEffect)(function(){var e=function(e){return f(e)},r=function(e){return c(e)};return u||(window.addEventListener("keydown",e),window.addEventListener("keyup",r)),function(){window.removeEventListener("keydown",e),window.removeEventListener("keyup",r)}},[f,c,u]),a};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useKeyPress.js","sourceRoot":"","sources":["../../../src/Functions/useKeyPress/useKeyPress.ts"],"names":[],"mappings":";;AAAA,iCAAyD;AAOzD;;;;;GAKG;AACH,SAAS,WAAW,CAAC,SAAiB,EAAE,WAAoB,IAAI,EAAE,WAAqB;IACrF,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IAE7D,MAAM,WAAW,GAAG,IAAA,mBAAW,EAC7B,CAAC,EAAE,GAAG,EAAE,MAAM,EAAiB,EAAQ,EAAE;QACvC,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtB,IAAI,CAAC,QAAQ,IAAI,MAAM;gBAAE,OAAO;YAChC,aAAa,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,EACD,CAAC,QAAQ,EAAE,SAAS,CAAC,CACtB,CAAC;IAEF,MAAM,SAAS,GAAG,IAAA,mBAAW,EAC3B,CAAC,EAAE,GAAG,EAAE,MAAM,EAAiB,EAAQ,EAAE;QACvC,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtB,IAAI,CAAC,QAAQ,IAAI,MAAM;gBAAE,OAAO;YAChC,aAAa,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,EACD,CAAC,QAAQ,EAAE,SAAS,CAAC,CACtB,CAAC;IAEF,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,UAAU,GAAG,CAAC,KAA+B,EAAQ,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACjF,MAAM,QAAQ,GAAG,CAAC,KAA+B,EAAQ,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAE7E,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;YAC/C,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,GAAG,EAAE;YACV,oCAAoC;YACpC,gEAAgE;YAChE,uFAAuF;YACvF,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;YAClD,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAChD,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;IAE1C,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,kBAAe,WAAW,CAAC"}
@@ -0,0 +1,5 @@
1
+ Заготовка (пока не обращать внимание)
2
+ Сюда переедут типы и интерфейсы конфигурационных объектов включения/выключения логики ивентов различных компонентов.
3
+
4
+ WithEventLogicAsObj - "С логикой ивенов",
5
+ подразумевается, что некоторые внутренние процессы компонента будут ДОПОЛНИТЕЛЬНО СОПРОВОЖДАТЬСЯ соответствующими ивентами.
@@ -0,0 +1,9 @@
1
+ import type { IWithEventManagementAsObjForModal } from './innerTypes/Modal';
2
+ interface InnerTypes<isAsHard extends boolean> {
3
+ Modal: isAsHard extends true ? Required<IWithEventManagementAsObjForModal> : IWithEventManagementAsObjForModal;
4
+ }
5
+ interface ICommon {
6
+ [key: string]: any;
7
+ }
8
+ export type WithEventManagementAsObj<ComponentKey extends keyof InnerTypes<isAsHard>, isAsHard extends boolean = false> = ICommon & InnerTypes<isAsHard>[ComponentKey];
9
+ export default WithEventManagementAsObj;
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:!0});
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/declaration/WithEventManagementAsObj/index.ts"],"names":[],"mappings":";;AAyBA,2BAA2B;AAE3B,0HAA0H;AAC1H,qFAAqF;AACrF,6EAA6E;AAE7E,6EAA6E;AAC7E,+EAA+E;AAC/E,+FAA+F"}
@@ -0,0 +1,34 @@
1
+ import type { IWithEventManagementAsObjForModal } from './innerTypes/Modal';
2
+
3
+ // ? Ключи InnerTypes (как и названия модулей в папке) соответствуют названиям компонентов для которых выбирается интерфейс управления
4
+
5
+ // ? Расширение InnerTypes:
6
+ // ? - заведите в папке InnerTypes отдельный модуль, назовите его так же как компонент для которого заводится этот подтип;
7
+ // ? - в модуле пропишите задуманные управляющие пропы, обязательность выбирайте исходя из того
8
+ // ? как было бы удобно этим пользоваться при конфигурации самого компонента (как правило это все НЕобязательные);
9
+ // ? - импортируйте модуль тут, в интерфейсе InnerTypes заведите одноименный файлу ключ,
10
+ // ? велью пропишите ПО АНАЛОГИИ с имеющимися (это важно)
11
+ interface InnerTypes<isAsHard extends boolean> {
12
+ Modal: isAsHard extends true ? Required<IWithEventManagementAsObjForModal> : IWithEventManagementAsObjForModal;
13
+ }
14
+
15
+ interface ICommon {
16
+ [key: string]: any;
17
+ }
18
+
19
+ export type WithEventManagementAsObj<
20
+ ComponentKey extends keyof InnerTypes<isAsHard>,
21
+ isAsHard extends boolean = false,
22
+ > = ICommon & InnerTypes<isAsHard>[ComponentKey];
23
+
24
+ export default WithEventManagementAsObj;
25
+
26
+ // ? Примеры использования:
27
+
28
+ // ? 1) Для типизации вне компонента (если пишем на TS) можно использовать простой вариант (без 2-го аргумента дженерика):
29
+ // ? const newManagementObj: WithEventManagementAsObj<'Modal'> = { ...что-то там }
30
+ // ? Опциональность пропсов будет такая, как прописана в отдельном модуле.
31
+
32
+ // ? 2) Для внедрения механики в компонент можно посмотреть на примере Modal,
33
+ // ? там есть комментарии для чего используется типизация в "жестком" режиме
34
+ // ? const newHardManagementObj: WithEventManagementAsObj<'Modal', true> = { ...что-то там }
@@ -0,0 +1,4 @@
1
+ export interface IWithEventManagementAsObjForModal {
2
+ isWithSubmitAndCloseManagement?: boolean;
3
+ }
4
+ export default IWithEventManagementAsObjForModal;
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:!0});
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../../../src/types/declaration/WithEventManagementAsObj/innerTypes/Modal.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ WithEventManagementAsObj - "С логикой УПРАВЛЕНИЯ ивентами",
2
+ подразумевается, что некоторые внутренние процессы компонента будут УПРАВЛЯТЬСЯ ИВЕНТАМИ, запущенными из-вне на document
3
+
4
+ Структура:
5
+ - в index лежит ОСНОВНОЙ, конфигурируемый через дженерик, тип, нужно [импортировать ВСЕГДА его / пользоваться ВСЕГДА им]
6
+ - в папке innerTypes лежат расширяющие типы/интерфейсы, они [расширяют / переопределяют] основной, под каждый отдельно взятый компонент
7
+ по задумке - нет необходимости импортировать что либо из папки innerTypes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "1.6.37",
3
+ "version": "1.6.39",
4
4
  "description": "",
5
5
  "author": "Andrey Isakov",
6
6
  "license": "ISC",
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModalTitle.js","sourceRoot":"","sources":["../../../../../src/Atomic/UI/Modal/partials/ModalTitle.tsx"],"names":[],"mappings":";;;AACA,oEAA4B;AAC5B,uDAAiD;AAEjD,iDAAkC;AAElC,MAAM,UAAU,GAA+B,IAAA,YAAI,EACjD,CAAC,EACC,OAAO,GAAG,SAAS,EACnB,QAAQ,EACR,QAAQ,GAAG,KAAK,EAChB,OAAO,EACP,gBAAgB,GAAG,KAAK,EACxB,SAAS,EACT,UAAU,EACV,MAAM,GAAG,aAAa,GACvB,EAAE,EAAE;IACH,MAAM,aAAa,GAAG,IAAA,mBAAW,EAC/B,CAAC,C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