@e1011/es-kit 1.1.84 → 1.1.86

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 (39) hide show
  1. package/dist/hooks/esm/index.css +403 -403
  2. package/dist/hooks/index.css +403 -403
  3. package/dist/lib/cjs/src/core/ui/components/atoms/icons.js +1 -1
  4. package/dist/lib/cjs/src/core/ui/components/atoms/icons.js.map +1 -1
  5. package/dist/lib/cjs/src/core/ui/components/atoms/text/Text.js +1 -1
  6. package/dist/lib/cjs/src/core/ui/components/atoms/text/Text.js.map +1 -1
  7. package/dist/lib/cjs/src/core/ui/components/error/ErrorBoundary.js.map +1 -1
  8. package/dist/lib/cjs/src/core/ui/components/molecules/popover/PopoverLite.js +1 -1
  9. package/dist/lib/cjs/src/core/ui/components/molecules/popover/PopoverLite.js.map +1 -1
  10. package/dist/lib/esm/src/core/ui/components/atoms/icons.js +1 -1
  11. package/dist/lib/esm/src/core/ui/components/atoms/icons.js.map +1 -1
  12. package/dist/lib/esm/src/core/ui/components/atoms/text/Text.js +1 -1
  13. package/dist/lib/esm/src/core/ui/components/atoms/text/Text.js.map +1 -1
  14. package/dist/lib/esm/src/core/ui/components/error/ErrorBoundary.js.map +1 -1
  15. package/dist/lib/esm/src/core/ui/components/molecules/popover/PopoverLite.js +1 -1
  16. package/dist/lib/esm/src/core/ui/components/molecules/popover/PopoverLite.js.map +1 -1
  17. package/dist/lib/tsconfig.tsbuildinfo +1 -1
  18. package/dist/types/src/core/ui/components/atoms/icons.d.ts.map +1 -1
  19. package/dist/types/src/core/ui/components/atoms/text/Text.d.ts.map +1 -1
  20. package/dist/types/src/core/ui/components/error/ErrorBoundary.d.ts +2 -2
  21. package/dist/types/src/core/ui/components/error/ErrorBoundary.d.ts.map +1 -1
  22. package/dist/types/src/core/ui/components/molecules/popover/PopoverLite.d.ts.map +1 -1
  23. package/dist/ui/esm/src/core/ui/components/atoms/icons.js +1 -1
  24. package/dist/ui/esm/src/core/ui/components/atoms/icons.js.map +1 -1
  25. package/dist/ui/esm/src/core/ui/components/atoms/text/Text.js +1 -1
  26. package/dist/ui/esm/src/core/ui/components/atoms/text/Text.js.map +1 -1
  27. package/dist/ui/esm/src/core/ui/components/error/ErrorBoundary.js.map +1 -1
  28. package/dist/ui/esm/src/core/ui/components/molecules/popover/PopoverLite.js +1 -1
  29. package/dist/ui/esm/src/core/ui/components/molecules/popover/PopoverLite.js.map +1 -1
  30. package/dist/ui/src/core/ui/components/atoms/icons.js +1 -1
  31. package/dist/ui/src/core/ui/components/atoms/icons.js.map +1 -1
  32. package/dist/ui/src/core/ui/components/atoms/text/Text.js +1 -1
  33. package/dist/ui/src/core/ui/components/atoms/text/Text.js.map +1 -1
  34. package/dist/ui/src/core/ui/components/error/ErrorBoundary.js.map +1 -1
  35. package/dist/ui/src/core/ui/components/molecules/popover/PopoverLite.js +1 -1
  36. package/dist/ui/src/core/ui/components/molecules/popover/PopoverLite.js.map +1 -1
  37. package/dist/utils/esm/index.css +403 -403
  38. package/dist/utils/index.css +403 -403
  39. package/package.json +3 -4
@@ -1,2 +1,2 @@
1
- "use strict";function e(e){return e&&e.__esModule?e:{default:e}}var t=e(require("react"));const c=t.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},t.default.createElement("path",{d:"M336.1 175c-9.375-9.375-24.56-9.375-33.94 0L256 222.1L208.1 175c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l47.03 47.03L175 303c-9.375 9.375-9.375 24.56 0 33.94c9.373 9.373 24.56 9.381 33.94 0L256 289.9l47.03 47.03c9.373 9.373 24.56 9.381 33.94 0c9.375-9.375 9.375-24.56 0-33.94l-47.03-47.03l47.03-47.03C346.3 199.6 346.3 184.4 336.1 175zM256 0C114.6 0 0 114.6 0 256s114.6 256 256 256S512 397.4 512 256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464z"})),s=t.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},t.default.createElement("path",{d:"M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 128c17.67 0 32 14.33 32 32c0 17.67-14.33 32-32 32S224 177.7 224 160C224 142.3 238.3 128 256 128zM296 384h-80C202.8 384 192 373.3 192 360s10.75-24 24-24h16v-64H224c-13.25 0-24-10.75-24-24S210.8 224 224 224h32c13.25 0 24 10.75 24 24v88h16c13.25 0 24 10.75 24 24S309.3 384 296 384z"}));exports.closeIconJSX=c,exports.infoIconJSX=s;
1
+ "use strict";const e=React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},React.createElement("path",{d:"M336.1 175c-9.375-9.375-24.56-9.375-33.94 0L256 222.1L208.1 175c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l47.03 47.03L175 303c-9.375 9.375-9.375 24.56 0 33.94c9.373 9.373 24.56 9.381 33.94 0L256 289.9l47.03 47.03c9.373 9.373 24.56 9.381 33.94 0c9.375-9.375 9.375-24.56 0-33.94l-47.03-47.03l47.03-47.03C346.3 199.6 346.3 184.4 336.1 175zM256 0C114.6 0 0 114.6 0 256s114.6 256 256 256S512 397.4 512 256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464z"})),c=React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},React.createElement("path",{d:"M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 128c17.67 0 32 14.33 32 32c0 17.67-14.33 32-32 32S224 177.7 224 160C224 142.3 238.3 128 256 128zM296 384h-80C202.8 384 192 373.3 192 360s10.75-24 24-24h16v-64H224c-13.25 0-24-10.75-24-24S210.8 224 224 224h32c13.25 0 24 10.75 24 24v88h16c13.25 0 24 10.75 24 24S309.3 384 296 384z"}));exports.closeIconJSX=e,exports.infoIconJSX=c;
2
2
  //# sourceMappingURL=icons.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"icons.js","sources":["../../../../../../../../src/core/ui/components/atoms/icons.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport React from 'react'\n\nexport const closeIconJSX = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M336.1 175c-9.375-9.375-24.56-9.375-33.94 0L256 222.1L208.1 175c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l47.03 47.03L175 303c-9.375 9.375-9.375 24.56 0 33.94c9.373 9.373 24.56 9.381 33.94 0L256 289.9l47.03 47.03c9.373 9.373 24.56 9.381 33.94 0c9.375-9.375 9.375-24.56 0-33.94l-47.03-47.03l47.03-47.03C346.3 199.6 346.3 184.4 336.1 175zM256 0C114.6 0 0 114.6 0 256s114.6 256 256 256S512 397.4 512 256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464z' /></svg>\n)\nexport const infoIconJSX = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 128c17.67 0 32 14.33 32 32c0 17.67-14.33 32-32 32S224 177.7 224 160C224 142.3 238.3 128 256 128zM296 384h-80C202.8 384 192 373.3 192 360s10.75-24 24-24h16v-64H224c-13.25 0-24-10.75-24-24S210.8 224 224 224h32c13.25 0 24 10.75 24 24v88h16c13.25 0 24 10.75 24 24S309.3 384 296 384z' /></svg>\n\n)\n\n\nexport const appStoreIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M255.9 120.9l9.1-15.7c5.6-9.8 18.1-13.1 27.9-7.5 9.8 5.6 13.1 18.1 7.5 27.9l-87.5 151.5h63.3c20.5 0 32 24.1 23.1 40.8H113.8c-11.3 0-20.4-9.1-20.4-20.4 0-11.3 9.1-20.4 20.4-20.4h52l66.6-115.4-20.8-36.1c-5.6-9.8-2.3-22.2 7.5-27.9 9.8-5.6 22.2-2.3 27.9 7.5l8.9 15.7zm-78.7 218l-19.6 34c-5.6 9.8-18.1 13.1-27.9 7.5-9.8-5.6-13.1-18.1-7.5-27.9l14.6-25.2c16.4-5.1 29.8-1.2 40.4 11.6zm168.9-61.7h53.1c11.3 0 20.4 9.1 20.4 20.4 0 11.3-9.1 20.4-20.4 20.4h-29.5l19.9 34.5c5.6 9.8 2.3 22.2-7.5 27.9-9.8 5.6-22.2 2.3-27.9-7.5-33.5-58.1-58.7-101.6-75.4-130.6-17.1-29.5-4.9-59.1 7.2-69.1 13.4 23 33.4 57.7 60.1 104zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm216 248c0 118.7-96.1 216-216 216-118.7 0-216-96.1-216-216 0-118.7 96.1-216 216-216 118.7 0 216 96.1 216 216z' /></svg>\n)\n\n\nexport const batteryEmptyIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'><path d='M544 192V160c0-35.35-28.65-64-64-64H64C28.65 96 0 124.7 0 160v192c0 35.35 28.65 64 64 64h416c35.35 0 64-28.65 64-64v-32c17.67 0 32-14.33 32-32V224C576 206.3 561.7 192 544 192zM480 352H64V160h416V352z' /></svg>\n)\n\n\nexport const elementorIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path d='M425.6 32H22.4C10 32 0 42 0 54.4v403.2C0 470 10 480 22.4 480h403.2c12.4 0 22.4-10 22.4-22.4V54.4C448 42 438 32 425.6 32M164.3 355.5h-39.8v-199h39.8v199zm159.3 0H204.1v-39.8h119.5v39.8zm0-79.6H204.1v-39.8h119.5v39.8zm0-79.7H204.1v-39.8h119.5v39.8z' /></svg>\n)\n\nexport const squareCheckIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path d='M384 32H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h320c35.35 0 64-28.65 64-64V96C448 60.65 419.3 32 384 32zM400 416c0 8.836-7.164 16-16 16H64c-8.836 0-16-7.164-16-16V96c0-8.838 7.164-16 16-16h320c8.836 0 16 7.162 16 16V416zM303 175L192 286.1L144.1 239c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l64 64C179.7 341.7 185.8 344 192 344s12.28-2.344 16.97-7.031l128-128c9.375-9.375 9.375-24.56 0-33.94S312.4 165.7 303 175z' /></svg>\n)\n\nexport const pencilIcon = (\n <svg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'>\n <path d='M8.91878 3.38356L6.59333 1.08219L7.35936 0.315069C7.56911 0.105023 7.82682 0 8.13251 0C8.43782 0 8.69536 0.105023 8.9051 0.315069L9.67113 1.08219C9.88088 1.29224 9.99031 1.54575 9.99943 1.84274C10.0086 2.13936 9.90824 2.39269 9.69849 2.60274L8.91878 3.38356ZM8.12539 4.19178L2.32545 10H0V7.67123L5.79994 1.86301L8.12539 4.19178Z' fill='#E2E369' />\n </svg>\n\n)\n"],"names":["closeIconJSX","React","createElement","xmlns","viewBox","default","d","infoIconJSX"],"mappings":"0FAIaA,MAAAA,EACXC,EAAAA,QAAAC,cAAA,MAAA,CAAKC,MAAM,6BAA6BC,QAAQ,eAAcH,EAAAI,QAAAH,cAAA,OAAA,CAAMI,EAAE,ygBAE3DC,EACXN,EAAAA,QAAAC,cAAA,MAAA,CAAKC,MAAM,6BAA6BC,QAAQ,eAAcH,EAAAI,QAAAH,cAAA,OAAA,CAAMI,EAAE"}
1
+ {"version":3,"file":"icons.js","sources":["../../../../../../../../src/core/ui/components/atoms/icons.tsx"],"sourcesContent":["\nexport const closeIconJSX = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M336.1 175c-9.375-9.375-24.56-9.375-33.94 0L256 222.1L208.1 175c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l47.03 47.03L175 303c-9.375 9.375-9.375 24.56 0 33.94c9.373 9.373 24.56 9.381 33.94 0L256 289.9l47.03 47.03c9.373 9.373 24.56 9.381 33.94 0c9.375-9.375 9.375-24.56 0-33.94l-47.03-47.03l47.03-47.03C346.3 199.6 346.3 184.4 336.1 175zM256 0C114.6 0 0 114.6 0 256s114.6 256 256 256S512 397.4 512 256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464z' /></svg>\n)\nexport const infoIconJSX = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 128c17.67 0 32 14.33 32 32c0 17.67-14.33 32-32 32S224 177.7 224 160C224 142.3 238.3 128 256 128zM296 384h-80C202.8 384 192 373.3 192 360s10.75-24 24-24h16v-64H224c-13.25 0-24-10.75-24-24S210.8 224 224 224h32c13.25 0 24 10.75 24 24v88h16c13.25 0 24 10.75 24 24S309.3 384 296 384z' /></svg>\n\n)\n\n\nexport const appStoreIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M255.9 120.9l9.1-15.7c5.6-9.8 18.1-13.1 27.9-7.5 9.8 5.6 13.1 18.1 7.5 27.9l-87.5 151.5h63.3c20.5 0 32 24.1 23.1 40.8H113.8c-11.3 0-20.4-9.1-20.4-20.4 0-11.3 9.1-20.4 20.4-20.4h52l66.6-115.4-20.8-36.1c-5.6-9.8-2.3-22.2 7.5-27.9 9.8-5.6 22.2-2.3 27.9 7.5l8.9 15.7zm-78.7 218l-19.6 34c-5.6 9.8-18.1 13.1-27.9 7.5-9.8-5.6-13.1-18.1-7.5-27.9l14.6-25.2c16.4-5.1 29.8-1.2 40.4 11.6zm168.9-61.7h53.1c11.3 0 20.4 9.1 20.4 20.4 0 11.3-9.1 20.4-20.4 20.4h-29.5l19.9 34.5c5.6 9.8 2.3 22.2-7.5 27.9-9.8 5.6-22.2 2.3-27.9-7.5-33.5-58.1-58.7-101.6-75.4-130.6-17.1-29.5-4.9-59.1 7.2-69.1 13.4 23 33.4 57.7 60.1 104zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm216 248c0 118.7-96.1 216-216 216-118.7 0-216-96.1-216-216 0-118.7 96.1-216 216-216 118.7 0 216 96.1 216 216z' /></svg>\n)\n\n\nexport const batteryEmptyIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'><path d='M544 192V160c0-35.35-28.65-64-64-64H64C28.65 96 0 124.7 0 160v192c0 35.35 28.65 64 64 64h416c35.35 0 64-28.65 64-64v-32c17.67 0 32-14.33 32-32V224C576 206.3 561.7 192 544 192zM480 352H64V160h416V352z' /></svg>\n)\n\n\nexport const elementorIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path d='M425.6 32H22.4C10 32 0 42 0 54.4v403.2C0 470 10 480 22.4 480h403.2c12.4 0 22.4-10 22.4-22.4V54.4C448 42 438 32 425.6 32M164.3 355.5h-39.8v-199h39.8v199zm159.3 0H204.1v-39.8h119.5v39.8zm0-79.6H204.1v-39.8h119.5v39.8zm0-79.7H204.1v-39.8h119.5v39.8z' /></svg>\n)\n\nexport const squareCheckIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path d='M384 32H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h320c35.35 0 64-28.65 64-64V96C448 60.65 419.3 32 384 32zM400 416c0 8.836-7.164 16-16 16H64c-8.836 0-16-7.164-16-16V96c0-8.838 7.164-16 16-16h320c8.836 0 16 7.162 16 16V416zM303 175L192 286.1L144.1 239c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l64 64C179.7 341.7 185.8 344 192 344s12.28-2.344 16.97-7.031l128-128c9.375-9.375 9.375-24.56 0-33.94S312.4 165.7 303 175z' /></svg>\n)\n\nexport const pencilIcon = (\n <svg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'>\n <path d='M8.91878 3.38356L6.59333 1.08219L7.35936 0.315069C7.56911 0.105023 7.82682 0 8.13251 0C8.43782 0 8.69536 0.105023 8.9051 0.315069L9.67113 1.08219C9.88088 1.29224 9.99031 1.54575 9.99943 1.84274C10.0086 2.13936 9.90824 2.39269 9.69849 2.60274L8.91878 3.38356ZM8.12539 4.19178L2.32545 10H0V7.67123L5.79994 1.86301L8.12539 4.19178Z' fill='#E2E369' />\n </svg>\n\n)\n"],"names":["closeIconJSX","React","createElement","xmlns","viewBox","d","infoIconJSX"],"mappings":"aACaA,MAAAA,EACXC,MAAAC,cAAA,MAAA,CAAKC,MAAM,6BAA6BC,QAAQ,eAAcH,MAAAC,cAAA,OAAA,CAAMG,EAAE,ygBAE3DC,EACXL,MAAAC,cAAA,MAAA,CAAKC,MAAM,6BAA6BC,QAAQ,eAAcH,MAAAC,cAAA,OAAA,CAAMG,EAAE"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("../../../../../../_virtual/_rollupPluginBabelHelpers.js"),t=require("react"),r=require("../../../../hooks/useParseProps.js"),s=require("../../../../utils/helpers/text.js");function a(e){return e&&e.__esModule?e:{default:e}}var o=a(t);const l=["element","children","href","target","className","id","onClick","text"],c=t.memo((a=>{let{element:c="span",children:i,href:n,target:d,className:u="",id:p,onClick:m,text:h}=a,x=e.objectWithoutProperties(a,l);const{dataProps:P,restProps:b}=r.useParseProps(x),j=h||(null==i?void 0:i.toString()),f=t.useMemo((()=>m?{onClick:m,onKeyDown:m,role:"button",tabIndex:-1}:{}),[m]);return o.default.createElement(c,e.objectSpread2(e.objectSpread2(e.objectSpread2({id:"".concat(p||j&&s.composeId(j)),href:n,text:h,target:d,className:u},f),{},{style:b},P),{},{"data-testid":"".concat(P.dataTestId||P["data-testid"]||p||j&&s.composeId(j))}),i)}));c.displayName="Text",exports.Text=c;
1
+ "use strict";var e=require("../../../../../../_virtual/_rollupPluginBabelHelpers.js"),t=require("react"),r=require("../../../../hooks/useParseProps.js"),s=require("../../../../utils/helpers/text.js");const a=["element","children","href","target","className","id","onClick","text"],o=t.memo((o=>{let{element:l="span",children:c,href:i,target:n,className:d="",id:p,onClick:u,text:m}=o,h=e.objectWithoutProperties(o,a);const{dataProps:x,restProps:P}=r.useParseProps(h),b=m||(null==c?void 0:c.toString()),j=t.useMemo((()=>u?{onClick:u,onKeyDown:u,role:"button",tabIndex:-1}:{}),[u]);return t.createElement(l,e.objectSpread2(e.objectSpread2(e.objectSpread2({id:"".concat(p||b&&s.composeId(b)),href:i,text:m,target:n,className:d},j),{},{style:P},x),{},{"data-testid":"".concat(x.dataTestId||x["data-testid"]||p||b&&s.composeId(b))}),c)}));o.displayName="Text",exports.Text=o;
2
2
  //# sourceMappingURL=Text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Text.js","sources":["../../../../../../../../../src/core/ui/components/atoms/text/Text.tsx"],"sourcesContent":["import React, { memo, FC, useMemo } from 'react'\n\nimport { composeId } from '../../../../utils'\nimport { useParseProps } from '../../../../hooks'\n\nimport { ITextProps, TextProps } from './text.types'\n\n\nexport const Text: FC<TextProps> = memo<ITextProps>((\n { element = 'span', children, href, target, className = '', id, onClick, text, ...rest }: ITextProps,\n) => {\n const { dataProps, restProps } = useParseProps(rest)\n const textFromChildren: string | undefined = text || children?.toString()\n\n const onClickProps = useMemo(() => (onClick ? ({\n onClick,\n onKeyDown: onClick,\n role: 'button',\n tabIndex: -1,\n }) : {}), [onClick])\n\n return React.createElement<TextProps>(\n element,\n {\n id: `${id || (textFromChildren && composeId(textFromChildren))}`,\n href,\n text,\n target,\n className,\n ...onClickProps,\n style: restProps,\n ...dataProps,\n 'data-testid':\n `${dataProps.dataTestId || dataProps['data-testid'] || id || (textFromChildren && composeId(textFromChildren))}`,\n },\n children,\n )\n})\n\nText.displayName = 'Text'\n"],"names":["Text","memo","_ref","element","children","href","target","className","id","onClick","text","rest","_objectWithoutProperties","_excluded","dataProps","restProps","useParseProps","textFromChildren","toString","onClickProps","useMemo","onKeyDown","role","tabIndex","React","createElement","_objectSpread","concat","composeId","style","dataTestId","displayName"],"mappings":"uVAQaA,EAAsBC,EAAIA,MAAaC,IAE/C,IADHC,QAAEA,EAAU,OAAMC,SAAEA,EAAQC,KAAEA,EAAIC,OAAEA,EAAMC,UAAEA,EAAY,GAAEC,GAAEA,EAAEC,QAAEA,EAASC,KAAAA,GAA2BR,EAAlBS,EAAIC,EAAAA,wBAAAV,EAAAW,GAEtF,MAAMC,UAAEA,EAASC,UAAEA,GAAcC,EAAAA,cAAcL,GACzCM,EAAuCP,IAAQN,aAAQ,EAARA,EAAUc,YAEzDC,EAAeC,WAAQ,IAAOX,EAAW,CAC7CA,UACAY,UAAWZ,EACXa,KAAM,SACNC,UAAW,GACR,CAAG,GAAE,CAACd,IAEX,OAAOe,EAAAA,QAAMC,cACXtB,EAAOuB,EAAAA,cAAAA,EAAAA,cAAAA,EAAAA,cAAA,CAELlB,GAAE,GAAAmB,OAAKnB,GAAOS,GAAoBW,EAAAA,UAAUX,IAC5CZ,YACAK,EACAJ,SACAC,aACGY,GAAY,GAAA,CACfU,MAAOd,GACJD,GAAS,GAAA,CACZ,iBAAaa,OACVb,EAAUgB,YAAchB,EAAU,gBAAkBN,GAAOS,GAAoBW,EAAAA,UAAUX,MAE9Fb,EACD,IAGHJ,EAAK+B,YAAc"}
1
+ {"version":3,"file":"Text.js","sources":["../../../../../../../../../src/core/ui/components/atoms/text/Text.tsx"],"sourcesContent":["import { createElement, memo, FC, useMemo } from 'react'\n\nimport { composeId } from '../../../../utils'\nimport { useParseProps } from '../../../../hooks'\n\nimport { ITextProps, TextProps } from './text.types'\n\n\nexport const Text: FC<TextProps> = memo<ITextProps>((\n { element = 'span', children, href, target, className = '', id, onClick, text, ...rest }: ITextProps,\n) => {\n const { dataProps, restProps } = useParseProps(rest)\n const textFromChildren: string | undefined = text || children?.toString()\n\n const onClickProps = useMemo(() => (onClick ? ({\n onClick,\n onKeyDown: onClick,\n role: 'button',\n tabIndex: -1,\n }) : {}), [onClick])\n\n return createElement<TextProps>(\n element,\n {\n id: `${id || (textFromChildren && composeId(textFromChildren))}`,\n href,\n text,\n target,\n className,\n ...onClickProps,\n style: restProps,\n ...dataProps,\n 'data-testid':\n `${dataProps.dataTestId || dataProps['data-testid'] || id || (textFromChildren && composeId(textFromChildren))}`,\n },\n children,\n )\n})\n\nText.displayName = 'Text'\n"],"names":["Text","memo","_ref","element","children","href","target","className","id","onClick","text","rest","_objectWithoutProperties","_excluded","dataProps","restProps","useParseProps","textFromChildren","toString","onClickProps","useMemo","onKeyDown","role","tabIndex","createElement","_objectSpread","concat","composeId","style","dataTestId","displayName"],"mappings":"yRAQaA,EAAsBC,EAAIA,MAAaC,IAE/C,IADHC,QAAEA,EAAU,OAAMC,SAAEA,EAAQC,KAAEA,EAAIC,OAAEA,EAAMC,UAAEA,EAAY,GAAEC,GAAEA,EAAEC,QAAEA,EAASC,KAAAA,GAA2BR,EAAlBS,EAAIC,EAAAA,wBAAAV,EAAAW,GAEtF,MAAMC,UAAEA,EAASC,UAAEA,GAAcC,EAAAA,cAAcL,GACzCM,EAAuCP,IAAQN,aAAQ,EAARA,EAAUc,YAEzDC,EAAeC,WAAQ,IAAOX,EAAW,CAC7CA,UACAY,UAAWZ,EACXa,KAAM,SACNC,UAAW,GACR,CAAG,GAAE,CAACd,IAEX,OAAOe,EAAaA,cAClBrB,EAAOsB,gBAAAA,EAAAA,cAAAA,EAAAA,cAAA,CAELjB,GAAE,GAAAkB,OAAKlB,GAAOS,GAAoBU,EAAAA,UAAUV,IAC5CZ,YACAK,EACAJ,SACAC,aACGY,GAAY,GAAA,CACfS,MAAOb,GACJD,GAAS,GAAA,CACZ,iBAAaY,OACVZ,EAAUe,YAAcf,EAAU,gBAAkBN,GAAOS,GAAoBU,EAAAA,UAAUV,MAE9Fb,EACD,IAGHJ,EAAK8B,YAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.js","sources":["../../../../../../../../src/core/ui/components/error/ErrorBoundary.tsx"],"sourcesContent":["import { FC, memo, PureComponent, ReactNode } from 'react'\n\nimport { IconBase } from '../icon'\nimport { LayoutBox } from '../container/layoutBox/LayoutBox'\n\nimport classes from './errorBoundary.module.scss'\nimport { DefaultErrorComponentProps, ErrorBoundaryProps } from './errorBoundary.types'\n\n\ninterface State {\n error?: Error\n errorInfo?: unknown\n hasError: boolean\n}\n\n\nexport const DefaultErrorComponent: FC<DefaultErrorComponentProps>\n= memo(({ title, text }: DefaultErrorComponentProps) => (\n <LayoutBox className={classes.errorBoundary} direction='column' flexWrap='wrap' gap='2rem' padding='1rem'>\n {title && <h1>{title}</h1>}\n <LayoutBox align='center' justify='space-between' gap='1rem'>\n <IconBase\n className={classes.StyledIcon}\n color='#FF0000'\n width='3rem'\n height='3rem'\n >\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'>\n <path d='M506.3 417l-213.3-364c-16.33-28-57.54-28-73.98 0l-213.2 364C-10.59 444.9 9.849 480 42.74 480h426.6C502.1 480 522.6 445 506.3 417zM232 168c0-13.25 10.75-24 24-24S280 154.8 280 168v128c0 13.25-10.75 24-23.1 24S232 309.3 232 296V168zM256 416c-17.36 0-31.44-14.08-31.44-31.44c0-17.36 14.07-31.44 31.44-31.44s31.44 14.08 31.44 31.44C287.4 401.9 273.4 416 256 416z' />\n </svg>\n </IconBase>\n {text && (\n <LayoutBox flexShrink='0' width='90%'>\n {text}\n </LayoutBox>\n )}\n </LayoutBox>\n </LayoutBox>\n))\nDefaultErrorComponent.displayName = 'DefaultErrorComponent'\n\nexport class ErrorBoundary extends PureComponent<ErrorBoundaryProps, State> {\n constructor(props: ErrorBoundaryProps) {\n super(props)\n this.state = { hasError: false }\n }\n\n static getDerivedStateFromError(error: Error): State {\n return { hasError: true, error }\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void {\n // eslint-disable-next-line no-console\n !this.props.muted && error && console.error(error)\n // eslint-disable-next-line no-console\n !this.props.muted && errorInfo && console.error(errorInfo)\n\n this.props?.onError?.({ error, errorInfo })\n\n !this.props.muted && this.setState({ hasError: true, error, errorInfo })\n }\n\n render(): ReactNode {\n const { ErrorComponent = DefaultErrorComponent, title, text, muted } = this.props\n const { hasError, error, errorInfo } = this.state\n\n if (hasError && !muted) {\n return (\n <ErrorComponent\n title={title || error?.toString() || 'Error'}\n text={text || `${JSON.stringify(errorInfo, null, 2)}`}\n />\n )\n }\n\n if (hasError && muted) {\n return null\n }\n\n return this.props.children\n }\n}\n"],"names":["DefaultErrorComponent","memo","_ref","title","text","React","createElement","LayoutBox","className","classes","default","errorBoundary","direction","flexWrap","gap","padding","align","justify","IconBase","StyledIcon","color","width","height","xmlns","viewBox","d","flexShrink","displayName","ErrorBoundary","PureComponent","constructor","props","super","this","state","hasError","getDerivedStateFromError","error","componentDidCatch","errorInfo","_this$props","_this$props$onError","muted","onError","call","setState","render","ErrorComponent","toString","concat","JSON","stringify","children"],"mappings":"kKAgBaA,MAAAA,EACXC,EAAIA,MAACC,IAAA,IAACC,MAAEA,EAAKC,KAAEA,GAAkCF,EAAA,OACjDG,MAAAC,cAACC,YAAS,CAACC,UAAWC,EAAOC,QAACC,cAAeC,UAAU,SAASC,SAAS,OAAOC,IAAI,OAAOC,QAAQ,QAChGZ,GAASE,MAAAC,cAAA,KAAA,KAAKH,GACfE,MAAAC,cAACC,YAAS,CAACS,MAAM,SAASC,QAAQ,gBAAgBH,IAAI,QACpDT,MAAAC,cAACY,WAAQ,CACPV,UAAWC,EAAOC,QAACS,WACnBC,MAAM,UACNC,MAAM,OACNC,OAAO,QAEPjB,MAAAC,cAAA,MAAA,CAAKiB,MAAM,6BAA6BC,QAAQ,eAC9CnB,MAAAC,cAAA,OAAA,CAAMmB,EAAE,6WAGXrB,GACCC,MAAAC,cAACC,EAAAA,UAAS,CAACmB,WAAW,IAAIL,MAAM,OAC7BjB,IAIG,IAEdJ,EAAsB2B,YAAc,wBAE7B,MAAMC,UAAsBC,EAAAA,cACjCC,WAAAA,CAAYC,GACVC,MAAMD,GACNE,KAAKC,MAAQ,CAAEC,UAAU,EAC3B,CAEA,+BAAOC,CAAyBC,GAC9B,MAAO,CAAEF,UAAU,EAAME,QAC3B,CAEAC,iBAAAA,CAAkBD,EAAcE,GAAkC,IAAAC,EAAAC,EAE/DR,KAAKF,MAAMW,MAEXT,KAAKF,MAAMW,cAEZF,OAAKT,aAAK,IAAAS,GAAS,QAATC,EAAVD,EAAYG,eAAZF,IAAmBA,GAAnBA,EAAAG,KAAAJ,EAAsB,CAAEH,QAAOE,eAE9BN,KAAKF,MAAMW,OAAST,KAAKY,SAAS,CAAEV,UAAU,EAAME,QAAOE,aAC9D,CAEAO,MAAAA,GACE,MAAMC,eAAEA,EAAiB/C,EAAqBG,MAAEA,EAAKC,KAAEA,EAAIsC,MAAEA,GAAUT,KAAKF,OACtEI,SAAEA,EAAQE,MAAEA,EAAKE,UAAEA,GAAcN,KAAKC,MAE5C,OAAIC,IAAaO,EAEbrC,MAAAC,cAACyC,EAAc,CACb5C,MAAOA,IAASkC,aAAAA,EAAAA,EAAOW,aAAc,QACrC5C,KAAMA,GAAI6C,GAAAA,OAAOC,KAAKC,UAAUZ,EAAW,KAAM,MAKnDJ,GAAYO,EACP,KAGFT,KAAKF,MAAMqB,QACpB"}
1
+ {"version":3,"file":"ErrorBoundary.js","sources":["../../../../../../../../src/core/ui/components/error/ErrorBoundary.tsx"],"sourcesContent":["import { ErrorInfo, FC, memo, PureComponent, ReactNode } from 'react'\n\nimport { IconBase } from '../icon'\nimport { LayoutBox } from '../container/layoutBox/LayoutBox'\n\nimport classes from './errorBoundary.module.scss'\nimport { DefaultErrorComponentProps, ErrorBoundaryProps } from './errorBoundary.types'\n\n\ninterface State {\n error?: Error\n errorInfo?: unknown\n hasError: boolean\n}\n\n\nexport const DefaultErrorComponent: FC<DefaultErrorComponentProps>\n= memo(({ title, text }: DefaultErrorComponentProps) => (\n <LayoutBox className={classes.errorBoundary} direction='column' flexWrap='wrap' gap='2rem' padding='1rem'>\n {title && <h1>{title}</h1>}\n <LayoutBox align='center' justify='space-between' gap='1rem'>\n <IconBase\n className={classes.StyledIcon}\n color='#FF0000'\n width='3rem'\n height='3rem'\n >\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'>\n <path d='M506.3 417l-213.3-364c-16.33-28-57.54-28-73.98 0l-213.2 364C-10.59 444.9 9.849 480 42.74 480h426.6C502.1 480 522.6 445 506.3 417zM232 168c0-13.25 10.75-24 24-24S280 154.8 280 168v128c0 13.25-10.75 24-23.1 24S232 309.3 232 296V168zM256 416c-17.36 0-31.44-14.08-31.44-31.44c0-17.36 14.07-31.44 31.44-31.44s31.44 14.08 31.44 31.44C287.4 401.9 273.4 416 256 416z' />\n </svg>\n </IconBase>\n {text && (\n <LayoutBox flexShrink='0' width='90%'>\n {text}\n </LayoutBox>\n )}\n </LayoutBox>\n </LayoutBox>\n))\nDefaultErrorComponent.displayName = 'DefaultErrorComponent'\n\nexport class ErrorBoundary extends PureComponent<ErrorBoundaryProps, State> {\n constructor(props: ErrorBoundaryProps) {\n super(props)\n this.state = { hasError: false }\n }\n\n static getDerivedStateFromError(error: Error): State {\n return { hasError: true, error }\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n // eslint-disable-next-line no-console\n !this.props.muted && error && console.error(error)\n // eslint-disable-next-line no-console\n !this.props.muted && errorInfo && console.error(errorInfo)\n\n this.props?.onError?.({ error, errorInfo })\n\n !this.props.muted && this.setState({ hasError: true, error, errorInfo })\n }\n\n render(): ReactNode {\n const { ErrorComponent = DefaultErrorComponent, title, text, muted } = this.props\n const { hasError, error, errorInfo } = this.state\n\n if (hasError && !muted) {\n return (\n <ErrorComponent\n title={title || error?.toString() || 'Error'}\n text={text || `${JSON.stringify(errorInfo, null, 2)}`}\n />\n )\n }\n\n if (hasError && muted) {\n return null\n }\n\n return this.props.children\n }\n}\n"],"names":["DefaultErrorComponent","memo","_ref","title","text","React","createElement","LayoutBox","className","classes","default","errorBoundary","direction","flexWrap","gap","padding","align","justify","IconBase","StyledIcon","color","width","height","xmlns","viewBox","d","flexShrink","displayName","ErrorBoundary","PureComponent","constructor","props","super","this","state","hasError","getDerivedStateFromError","error","componentDidCatch","errorInfo","_this$props","_this$props$onError","muted","onError","call","setState","render","ErrorComponent","toString","concat","JSON","stringify","children"],"mappings":"kKAgBaA,MAAAA,EACXC,EAAIA,MAACC,IAAA,IAACC,MAAEA,EAAKC,KAAEA,GAAkCF,EAAA,OACjDG,MAAAC,cAACC,YAAS,CAACC,UAAWC,EAAOC,QAACC,cAAeC,UAAU,SAASC,SAAS,OAAOC,IAAI,OAAOC,QAAQ,QAChGZ,GAASE,MAAAC,cAAA,KAAA,KAAKH,GACfE,MAAAC,cAACC,YAAS,CAACS,MAAM,SAASC,QAAQ,gBAAgBH,IAAI,QACpDT,MAAAC,cAACY,WAAQ,CACPV,UAAWC,EAAOC,QAACS,WACnBC,MAAM,UACNC,MAAM,OACNC,OAAO,QAEPjB,MAAAC,cAAA,MAAA,CAAKiB,MAAM,6BAA6BC,QAAQ,eAC9CnB,MAAAC,cAAA,OAAA,CAAMmB,EAAE,6WAGXrB,GACCC,MAAAC,cAACC,EAAAA,UAAS,CAACmB,WAAW,IAAIL,MAAM,OAC7BjB,IAIG,IAEdJ,EAAsB2B,YAAc,wBAE7B,MAAMC,UAAsBC,EAAAA,cACjCC,WAAAA,CAAYC,GACVC,MAAMD,GACNE,KAAKC,MAAQ,CAAEC,UAAU,EAC3B,CAEA,+BAAOC,CAAyBC,GAC9B,MAAO,CAAEF,UAAU,EAAME,QAC3B,CAEAC,iBAAAA,CAAkBD,EAAcE,GAA4B,IAAAC,EAAAC,EAEzDR,KAAKF,MAAMW,MAEXT,KAAKF,MAAMW,cAEZF,OAAKT,aAAK,IAAAS,GAAS,QAATC,EAAVD,EAAYG,eAAZF,IAAmBA,GAAnBA,EAAAG,KAAAJ,EAAsB,CAAEH,QAAOE,eAE9BN,KAAKF,MAAMW,OAAST,KAAKY,SAAS,CAAEV,UAAU,EAAME,QAAOE,aAC9D,CAEAO,MAAAA,GACE,MAAMC,eAAEA,EAAiB/C,EAAqBG,MAAEA,EAAKC,KAAEA,EAAIsC,MAAEA,GAAUT,KAAKF,OACtEI,SAAEA,EAAQE,MAAEA,EAAKE,UAAEA,GAAcN,KAAKC,MAE5C,OAAIC,IAAaO,EAEbrC,MAAAC,cAACyC,EAAc,CACb5C,MAAOA,IAASkC,aAAAA,EAAAA,EAAOW,aAAc,QACrC5C,KAAMA,GAAI6C,GAAAA,OAAOC,KAAKC,UAAUZ,EAAW,KAAM,MAKnDJ,GAAYO,EACP,KAGFT,KAAKF,MAAMqB,QACpB"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("../../../../../../_virtual/_rollupPluginBabelHelpers.js");require("../../../../../../node_modules/core-js/modules/web.dom-collections.iterator.js");var t=require("react"),n=require("../../../../../../node_modules/@popperjs/core/lib/popper.js"),l=require("../../../../utils/helpers/cancelableDelayedFunction.js"),r=require("../../../../hooks/useOutsideClick.js"),o=require("../../../../constants/ui.constants.js");function a(e){return e&&e.__esModule?e:{default:e}}var u=a(t);const i=["children","components","placement","modifiers","data","hoverable","clickable","onOpen","onHide","isOpen","hideOnContentClick","hideOnClickOutside","hideTimeout","isPopup","isModal","modalOverlayClassName","modalContainer","targetRef","hideOnEscape"],s=["ContentComponent"],d={modal:{zIndex:1,position:"fixed",width:"100%",height:"100%",top:"0",left:"0",background:"rgba(0 0 0 / 70%)",pointerEvents:"all",userSelect:"none",visibility:"hidden"}},c=t.memo((a=>{var c,p;let{children:v,components:m,placement:f="bottom",modifiers:b,data:h,hoverable:E,clickable:y,onOpen:C,onHide:j,isOpen:k,hideOnContentClick:w=!1,hideOnClickOutside:N=!0,hideTimeout:g=150,isPopup:O=!1,isModal:S=!1,modalOverlayClassName:M,modalContainer:R,targetRef:L,hideOnEscape:P}=a,q=e.objectWithoutProperties(a,i);const[x,H]=t.useState(null),[T,_]=t.useState(null!==(c=null==L?void 0:L.current)&&void 0!==c?c:null);t.useEffect((()=>{null!=L&&L.current&&_(null==L?void 0:L.current)}),[L]);const W=m||{},{ContentComponent:A}=W,D=e.objectWithoutProperties(W,s),K=t.useRef(null),z=t.useMemo((()=>{const t=b?{modifiers:b,placement:f}:{placement:f};return t.modifiers=t.modifiers||[],O&&(t.modifiers=[...t.modifiers,{name:"centering",phase:"beforeWrite",enabled:!0,fn:t=>{let{state:n}=t;const l=null==R?void 0:R.getBoundingClientRect(),{width:r,height:o,left:a,top:u}=l||{width:window.innerWidth,height:window.innerHeight,left:0,top:0},i=a+(r-n.elements.popper.clientWidth)/2,s=u+(o-n.elements.popper.clientHeight)/2;return e.objectSpread2(e.objectSpread2({},n),{},{styles:e.objectSpread2(e.objectSpread2({},n.styles),{},{popper:e.objectSpread2(e.objectSpread2({},n.styles.popper),{},{left:"".concat(i,"px"),top:"".concat(s,"px"),transform:"none"})})})}}]),t}),[b,f,O,R]),B=t.useRef();t.useEffect((()=>{var t;let l;return null==K||null===(t=K.current)||void 0===t||t.destroy(),T&&x&&(l=n.createPopper(T,x,e.objectSpread2({},z)),K.current=l),()=>{var e;null===(e=l)||void 0===e||e.destroy(),K.current=null}}),[x,T,z]);const F=t.useRef(),I=t.useRef(-1),G=t.useCallback((()=>{var e,t;x&&delete x.dataset.show,S&&null!=te&&te.current&&(te.current.style.visibility="hidden",delete te.current.dataset.show),null==K||null===(e=K.current)||void 0===e||e.update(),null==j||j(),null==F||null===(t=F.current)||void 0===t||t.call(F),clearTimeout(I.current)}),[x,S,j]),J=t.useCallback((()=>{B.current&&B.current(),B.current=l.cancelableSetTimeout(G,g)}),[G,g]),Q=t.useCallback((()=>{B.current&&B.current()}),[]),U=t.useCallback((e=>{var t;("true"===(null==x||null===(t=x.dataset)||void 0===t?void 0:t.show)&&N&&(null==x||!x.contains(e))||null!=x&&x.contains(e)&&w)&&G()}),[G,x,w,N]),V=t.useCallback((()=>{var e,t;x&&(x.dataset.show="true"),null==K||null===(e=K.current)||void 0===e||e.update(),S&&null!=te&&te.current&&(te.current.style.visibility="visible",te.current.dataset.show="true"),null==C||C(),null==F||null===(t=F.current)||void 0===t||t.call(F),clearTimeout(I.current),I.current=setTimeout((()=>{F.current=r.outsideClickHandler(T,U)}),250)}),[x,U,S,C,T]),X=t.useCallback((()=>{var e;"true"===(null==x||null===(e=x.dataset)||void 0===e?void 0:e.show)?G():V()}),[x,G,V]),Y=t.useCallback((e=>{P&&e.keyCode===o.KeyCode.Escape&&G()}),[P,G]);t.useEffect((()=>{var e,t;const n=null==T||null===(e=T.addEventListener)||void 0===e?void 0:e.bind(T),l=null==x||null===(t=x.addEventListener)||void 0===t?void 0:t.bind(x);return l&&n&&(E&&(n(o.EventName.MouseEnter,V),l(o.EventName.MouseEnter,Q),n(o.EventName.MouseLeave,J),l(o.EventName.MouseLeave,G)),y&&n(o.EventName.Click,X)),P&&document.addEventListener(o.EventName.KeyDown,Y),()=>{var e,t;const n=null==T||null===(e=T.removeEventListener)||void 0===e?void 0:e.bind(T),l=null==x||null===(t=x.removeEventListener)||void 0===t?void 0:t.bind(x);document.removeEventListener(o.EventName.KeyDown,Y),B.current&&B.current(),n&&(n(o.EventName.Click,X),n(o.EventName.MouseEnter,V),n(o.EventName.MouseLeave,J)),l&&(l(o.EventName.MouseLeave,G),l(o.EventName.MouseEnter,Q))}}),[T,x,y,E,V,G,X,J,Q,P,Y]),t.useEffect((()=>(!0===k&&V(),!1===k&&G(),null==F?void 0:F.current)),[G,k,V]);const Z="function"==typeof v,$="function"!=typeof v&&!Array.isArray(v),ee="function"!=typeof v&&Array.isArray(v)&&2===v.filter((e=>!!e)).length,te=t.useRef(null);return t.useEffect((()=>{S&&x&&(x.style.zIndex="2")}),[x,S]),u.default.createElement(u.default.Fragment,null,S&&u.default.createElement("span",{ref:te,style:d.modal,className:M}),!L&&Z&&(null==v?void 0:v({forwardedRef:_,data:h})),!L&&$&&u.default.createElement("span",{ref:_},v),!ee&&A&&u.default.createElement(A,e.extends({placement:f,forwardedRef:H,ref:"function"!=typeof A?H:null,data:h,hide:G,components:D},q)),!L&&ee&&u.default.createElement("span",{ref:_},v[0]),ee&&(null==v?void 0:v[1])&&"object"==typeof(null==v?void 0:v[1])&&u.default.cloneElement(v[1],e.objectSpread2(e.objectSpread2({},null==v||null===(p=v[1])||void 0===p?void 0:p.props),{},{placement:f,forwardedRef:H,ref:H,data:h,hide:G,components:D},q)))}));c.displayName="Popover",exports.Popover=c;
1
+ "use strict";var e=require("../../../../../../_virtual/_rollupPluginBabelHelpers.js");require("../../../../../../node_modules/core-js/modules/web.dom-collections.iterator.js");var t=require("react"),n=require("../../../../../../node_modules/@popperjs/core/lib/popper.js"),l=require("../../../../utils/helpers/cancelableDelayedFunction.js"),r=require("../../../../hooks/useOutsideClick.js"),o=require("../../../../constants/ui.constants.js");const a=["children","components","placement","modifiers","data","hoverable","clickable","onOpen","onHide","isOpen","hideOnContentClick","hideOnClickOutside","hideTimeout","isPopup","isModal","modalOverlayClassName","modalContainer","targetRef","hideOnEscape"],i=["ContentComponent"],u={modal:{zIndex:1,position:"fixed",width:"100%",height:"100%",top:"0",left:"0",background:"rgba(0 0 0 / 70%)",pointerEvents:"all",userSelect:"none",visibility:"hidden"}},s=t.memo((s=>{var c,d;let{children:p,components:v,placement:m="bottom",modifiers:f,data:b,hoverable:h,clickable:E,onOpen:y,onHide:C,isOpen:j,hideOnContentClick:k=!1,hideOnClickOutside:w=!0,hideTimeout:R=150,isPopup:N=!1,isModal:g=!1,modalOverlayClassName:O,modalContainer:S,targetRef:M,hideOnEscape:L}=s,P=e.objectWithoutProperties(s,a);const[q,x]=t.useState(null),[H,T]=t.useState(null!==(c=null==M?void 0:M.current)&&void 0!==c?c:null);t.useEffect((()=>{null!=M&&M.current&&T(null==M?void 0:M.current)}),[M]);const W=v||{},{ContentComponent:A}=W,_=e.objectWithoutProperties(W,i),D=t.useRef(null),K=t.useMemo((()=>{const t=f?{modifiers:f,placement:m}:{placement:m};return t.modifiers=t.modifiers||[],N&&(t.modifiers=[...t.modifiers,{name:"centering",phase:"beforeWrite",enabled:!0,fn:t=>{let{state:n}=t;const l=null==S?void 0:S.getBoundingClientRect(),{width:r,height:o,left:a,top:i}=l||{width:window.innerWidth,height:window.innerHeight,left:0,top:0},u=a+(r-n.elements.popper.clientWidth)/2,s=i+(o-n.elements.popper.clientHeight)/2;return e.objectSpread2(e.objectSpread2({},n),{},{styles:e.objectSpread2(e.objectSpread2({},n.styles),{},{popper:e.objectSpread2(e.objectSpread2({},n.styles.popper),{},{left:"".concat(u,"px"),top:"".concat(s,"px"),transform:"none"})})})}}]),t}),[f,m,N,S]),z=t.useRef();t.useEffect((()=>{var t;let l;return null==D||null===(t=D.current)||void 0===t||t.destroy(),H&&q&&(l=n.createPopper(H,q,e.objectSpread2({},K)),D.current=l),()=>{var e;null===(e=l)||void 0===e||e.destroy(),D.current=null}}),[q,H,K]);const B=t.useRef(),F=t.useRef(-1),I=t.useCallback((()=>{var e,t;q&&delete q.dataset.show,g&&null!=ee&&ee.current&&(ee.current.style.visibility="hidden",delete ee.current.dataset.show),null==D||null===(e=D.current)||void 0===e||e.update(),null==C||C(),null==B||null===(t=B.current)||void 0===t||t.call(B),clearTimeout(F.current)}),[q,g,C]),G=t.useCallback((()=>{z.current&&z.current(),z.current=l.cancelableSetTimeout(I,R)}),[I,R]),J=t.useCallback((()=>{z.current&&z.current()}),[]),Q=t.useCallback((e=>{var t;("true"===(null==q||null===(t=q.dataset)||void 0===t?void 0:t.show)&&w&&(null==q||!q.contains(e))||null!=q&&q.contains(e)&&k)&&I()}),[I,q,k,w]),U=t.useCallback((()=>{var e,t;q&&(q.dataset.show="true"),null==D||null===(e=D.current)||void 0===e||e.update(),g&&null!=ee&&ee.current&&(ee.current.style.visibility="visible",ee.current.dataset.show="true"),null==y||y(),null==B||null===(t=B.current)||void 0===t||t.call(B),clearTimeout(F.current),F.current=setTimeout((()=>{B.current=r.outsideClickHandler(H,Q)}),250)}),[q,Q,g,y,H]),V=t.useCallback((()=>{var e;"true"===(null==q||null===(e=q.dataset)||void 0===e?void 0:e.show)?I():U()}),[q,I,U]),X=t.useCallback((e=>{L&&e.keyCode===o.KeyCode.Escape&&I()}),[L,I]);t.useEffect((()=>{var e,t;const n=null==H||null===(e=H.addEventListener)||void 0===e?void 0:e.bind(H),l=null==q||null===(t=q.addEventListener)||void 0===t?void 0:t.bind(q);return l&&n&&(h&&(n(o.EventName.MouseEnter,U),l(o.EventName.MouseEnter,J),n(o.EventName.MouseLeave,G),l(o.EventName.MouseLeave,I)),E&&n(o.EventName.Click,V)),L&&document.addEventListener(o.EventName.KeyDown,X),()=>{var e,t;const n=null==H||null===(e=H.removeEventListener)||void 0===e?void 0:e.bind(H),l=null==q||null===(t=q.removeEventListener)||void 0===t?void 0:t.bind(q);document.removeEventListener(o.EventName.KeyDown,X),z.current&&z.current(),n&&(n(o.EventName.Click,V),n(o.EventName.MouseEnter,U),n(o.EventName.MouseLeave,G)),l&&(l(o.EventName.MouseLeave,I),l(o.EventName.MouseEnter,J))}}),[H,q,E,h,U,I,V,G,J,L,X]),t.useEffect((()=>(!0===j&&U(),!1===j&&I(),null==B?void 0:B.current)),[I,j,U]);const Y="function"==typeof p,Z="function"!=typeof p&&!Array.isArray(p),$="function"!=typeof p&&Array.isArray(p)&&2===p.filter((e=>!!e)).length,ee=t.useRef(null);return t.useEffect((()=>{g&&q&&(q.style.zIndex="2")}),[q,g]),React.createElement(React.Fragment,null,g&&React.createElement("span",{ref:ee,style:u.modal,className:O}),!M&&Y&&(null==p?void 0:p({forwardedRef:T,data:b})),!M&&Z&&React.createElement("span",{ref:T},p),!$&&A&&React.createElement(A,e.extends({placement:m,forwardedRef:x,ref:"function"!=typeof A?x:null,data:b,hide:I,components:_},P)),!M&&$&&React.createElement("span",{ref:T},p[0]),$&&(null==p?void 0:p[1])&&"object"==typeof(null==p?void 0:p[1])&&t.cloneElement(p[1],e.objectSpread2(e.objectSpread2({},null==p||null===(d=p[1])||void 0===d?void 0:d.props),{},{placement:m,forwardedRef:x,ref:x,data:b,hide:I,components:_},P)))}));s.displayName="Popover",exports.Popover=s;
2
2
  //# sourceMappingURL=PopoverLite.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PopoverLite.js","sources":["../../../../../../../../../src/core/ui/components/molecules/popover/PopoverLite.tsx"],"sourcesContent":["\nimport React, { FC, memo, useRef, useEffect, useState, useCallback, useMemo,\n CSSProperties, ReactNode, ReactElement } from 'react'\nimport { createPopper, Instance, ModifierArguments } from '@popperjs/core'\n\nimport { EventName, KeyCode } from '../../../../constants'\nimport { cancelableSetTimeout } from '../../../../utils'\nimport { outsideClickHandler } from '../../../../hooks'\n\nimport { PopoverProps } from './popover.types'\n\n\nconst styles: Record<string, Partial<CSSProperties>> = {\n modal: {\n zIndex: 1,\n position: 'fixed',\n width: '100%',\n height: '100%',\n top: '0',\n left: '0',\n background: 'rgba(0 0 0 / 70%)',\n pointerEvents: 'all',\n userSelect: 'none',\n visibility: 'hidden',\n },\n}\n\nexport const Popover: FC<PopoverProps> = memo<PopoverProps>(\n ({\n children,\n components,\n placement = 'bottom',\n modifiers,\n data,\n hoverable,\n clickable,\n onOpen,\n onHide,\n isOpen,\n hideOnContentClick = false,\n hideOnClickOutside = true,\n hideTimeout = 150,\n isPopup = false,\n isModal = false,\n modalOverlayClassName,\n modalContainer,\n targetRef,\n hideOnEscape,\n ...props\n }: PopoverProps) => {\n const [content, setContent] = useState<HTMLElement | null>(null)\n const [target, setTarget] = useState<HTMLElement | null>(targetRef?.current ?? null)\n\n useEffect(() => {\n if (targetRef?.current) {\n setTarget(targetRef?.current)\n }\n }, [targetRef])\n\n const { ContentComponent, ...contentComponents } = components || {}\n\n const popperInstanceRef = useRef<Instance | null>(null)\n\n const options = useMemo(() => {\n const options = (modifiers ? { modifiers, placement } : { placement })\n\n options.modifiers = options.modifiers || []\n\n if (isPopup) {\n options.modifiers = [\n ...options.modifiers,\n {\n name: 'centering',\n phase: 'beforeWrite',\n enabled: true,\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n fn: ({ state }): Partial<ModifierArguments> => {\n const mcBoundRect = modalContainer?.getBoundingClientRect()\n\n const { width, height, left, top } = mcBoundRect || {\n width: window.innerWidth,\n height: window.innerHeight,\n left: 0,\n top: 0,\n }\n\n const xpos = left + (width - state.elements.popper.clientWidth) / 2\n const ypos = top + (height - state.elements.popper.clientHeight) / 2\n\n return {\n ...state,\n styles: {\n ...state.styles,\n popper: {\n ...state.styles.popper,\n left: `${xpos}px`,\n top: `${ypos}px`,\n transform: 'none',\n },\n },\n }\n },\n },\n ] as PopoverProps['modifiers']\n }\n\n return options\n }, [modifiers, placement, isPopup, modalContainer])\n\n // to save cancelable setTimout\n const pendingHideRef = useRef<(() => void)>()\n\n useEffect(() => {\n popperInstanceRef?.current?.destroy()\n let popperInstance: ReturnType<typeof createPopper>\n\n if (target && content) {\n popperInstance = createPopper(target, content, { ...options })\n\n popperInstanceRef.current = popperInstance\n }\n\n return (): void => {\n popperInstance?.destroy()\n popperInstanceRef.current = null\n }\n }, [content, target, options])\n\n\n const outsideClickUnsubscriber = useRef<() => void | null>()\n const outsideClickUnsubscriberTimeout = useRef<any>(-1)\n\n const hide = useCallback(() => {\n if (content) {\n delete content.dataset.show\n }\n\n if (isModal && modalRef?.current) {\n modalRef.current.style.visibility = 'hidden'\n delete modalRef.current.dataset.show\n }\n\n popperInstanceRef?.current?.update()\n onHide?.()\n outsideClickUnsubscriber?.current?.()\n clearTimeout(outsideClickUnsubscriberTimeout.current)\n }, [content, isModal, onHide])\n\n\n const delayedHide = useCallback(() => {\n pendingHideRef.current && pendingHideRef.current()\n pendingHideRef.current = cancelableSetTimeout(hide, hideTimeout)\n }, [hide, hideTimeout])\n\n const cancelDelayedHide = useCallback(() => {\n pendingHideRef.current && pendingHideRef.current()\n }, [])\n\n const handleOutsideClick = useCallback((eventTarget: HTMLElement | null) => {\n if ((content?.dataset?.show === 'true' && hideOnClickOutside && !content?.contains(eventTarget))\n || (content?.contains(eventTarget) && hideOnContentClick)) {\n hide()\n }\n }, [hide, content, hideOnContentClick, hideOnClickOutside])\n\n const open = useCallback(() => {\n if (content) {\n content.dataset.show = 'true'\n }\n\n popperInstanceRef?.current?.update()\n\n if (isModal && modalRef?.current) {\n modalRef.current.style.visibility = 'visible'\n modalRef.current.dataset.show = 'true'\n }\n\n onOpen?.()\n\n outsideClickUnsubscriber?.current?.()\n clearTimeout(outsideClickUnsubscriberTimeout.current)\n outsideClickUnsubscriberTimeout.current = setTimeout(() => {\n outsideClickUnsubscriber.current = outsideClickHandler(target, handleOutsideClick)\n }, 250)\n }, [content, handleOutsideClick, isModal, onOpen, target])\n\n const toggleOpen = useCallback(() => {\n content?.dataset?.show === 'true' ? hide() : open()\n }, [content, hide, open])\n\n const keydownHandler = useCallback((event: Event) => {\n if (hideOnEscape && (event as unknown as KeyboardEvent).keyCode === KeyCode.Escape) {\n hide()\n }\n }, [hideOnEscape, hide])\n\n useEffect(() => {\n if (!hoverable && !clickable) {\n console.error('Popover component should have at least one of props [\"hoverable\", \"clickable\"]')\n }\n\n const targetAddListener = target?.addEventListener?.bind(target)\n const contentAddListener = content?.addEventListener?.bind(content)\n\n if (contentAddListener && targetAddListener) {\n if (hoverable) {\n targetAddListener(EventName.MouseEnter, open)\n contentAddListener(EventName.MouseEnter, cancelDelayedHide)\n targetAddListener(EventName.MouseLeave, delayedHide)\n contentAddListener(EventName.MouseLeave, hide)\n }\n\n if (clickable) {\n targetAddListener(EventName.Click, toggleOpen)\n }\n }\n\n if (hideOnEscape) {\n document.addEventListener(EventName.KeyDown, keydownHandler)\n }\n\n return (): void => {\n const targetRemoveListener = target?.removeEventListener?.bind(target)\n const contentRemoveListener = content?.removeEventListener?.bind(content)\n\n document.removeEventListener(EventName.KeyDown, keydownHandler)\n\n pendingHideRef.current && pendingHideRef.current()\n\n if (targetRemoveListener) {\n targetRemoveListener(EventName.Click, toggleOpen)\n targetRemoveListener(EventName.MouseEnter, open)\n targetRemoveListener(EventName.MouseLeave, delayedHide)\n }\n if (contentRemoveListener) {\n contentRemoveListener(EventName.MouseLeave, hide)\n contentRemoveListener(EventName.MouseEnter, cancelDelayedHide)\n }\n }\n }, [target, content, clickable, hoverable,\n open, hide, toggleOpen, delayedHide, cancelDelayedHide, hideOnEscape, keydownHandler])\n\n // open, hide based on external isOpen\n useEffect(() => {\n if (isOpen === true) {\n open()\n }\n if (isOpen === false) {\n hide()\n }\n return outsideClickUnsubscriber?.current as () => void\n }, [hide, isOpen, open])\n\n const childrenIsFunction = typeof children === 'function'\n const childrenIsElement = typeof children !== 'function' && !Array.isArray(children)\n const childrenAreElements = typeof children !== 'function' && Array.isArray(children)\n && children.filter((child: ReactNode) => !!child).length === 2\n\n // modal\n const modalRef = useRef<HTMLDivElement | null>(null)\n\n useEffect(() => {\n if (isModal && content) {\n content.style.zIndex = '2'\n }\n }, [content, isModal])\n\n return (\n <>\n {isModal && <span ref={modalRef} style={styles.modal} className={modalOverlayClassName} />}\n {(!targetRef && childrenIsFunction) && children?.({ forwardedRef: setTarget, data })}\n {(!targetRef && childrenIsElement) && <span ref={setTarget}>{children}</span>}\n {!childrenAreElements && ContentComponent && (\n <ContentComponent\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n placement={placement}\n forwardedRef={setContent}\n ref={typeof ContentComponent !== 'function' ? setContent : null}\n data={data}\n hide={hide}\n components={contentComponents as { [key: string]: FC | React.Component<any> }}\n {...props}\n />\n )}\n {(!targetRef && childrenAreElements) && <span ref={setTarget}>{children[0]}</span>}\n {(childrenAreElements && children?.[1] && typeof children?.[1] === 'object')\n && React.cloneElement(children[1] as ReactElement, {\n ...((children?.[1] as ReactElement)?.props),\n placement,\n forwardedRef: setContent,\n // ...(typeof children[1] !== 'function' ? { ref: setContent } : {}),\n ref: setContent,\n data,\n hide,\n components: contentComponents as { [key: string]: FC | React.Component<any> },\n ...props,\n })}\n </>\n )\n },\n)\n\nPopover.displayName = 'Popover'\n"],"names":["styles","modal","zIndex","position","width","height","top","left","background","pointerEvents","userSelect","visibility","Popover","memo","_ref","_targetRef$current","_children$","children","components","placement","modifiers","data","hoverable","clickable","onOpen","onHide","isOpen","hideOnContentClick","hideOnClickOutside","hideTimeout","isPopup","isModal","modalOverlayClassName","modalContainer","targetRef","hideOnEscape","props","_objectWithoutProperties","_excluded","content","setContent","useState","target","setTarget","current","useEffect","_ref2","ContentComponent","contentComponents","_excluded2","popperInstanceRef","useRef","options","useMemo","name","phase","enabled","fn","_ref3","state","mcBoundRect","getBoundingClientRect","window","innerWidth","innerHeight","xpos","elements","popper","clientWidth","ypos","clientHeight","_objectSpread","objectSpread2","concat","transform","pendingHideRef","_popperInstanceRef$cu","popperInstance","destroy","createPopper","_popperInstance","outsideClickUnsubscriber","outsideClickUnsubscriberTimeout","hide","useCallback","_popperInstanceRef$cu2","_outsideClickUnsubscr","dataset","show","modalRef","style","update","call","clearTimeout","delayedHide","cancelableSetTimeout","cancelDelayedHide","handleOutsideClick","eventTarget","_content$dataset","contains","open","_popperInstanceRef$cu3","_outsideClickUnsubscr2","setTimeout","outsideClickHandler","toggleOpen","_content$dataset2","keydownHandler","event","keyCode","KeyCode","Escape","_target$addEventListe","_content$addEventList","targetAddListener","addEventListener","bind","contentAddListener","EventName","MouseEnter","MouseLeave","Click","document","KeyDown","_target$removeEventLi","_content$removeEventL","targetRemoveListener","removeEventListener","contentRemoveListener","childrenIsFunction","childrenIsElement","Array","isArray","childrenAreElements","filter","child","length","React","default","createElement","Fragment","ref","className","forwardedRef","_extends","cloneElement","displayName"],"mappings":"kxBAYMA,EAAiD,CACrDC,MAAO,CACLC,OAAQ,EACRC,SAAU,QACVC,MAAO,OACPC,OAAQ,OACRC,IAAK,IACLC,KAAM,IACNC,WAAY,oBACZC,cAAe,MACfC,WAAY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D,CAAAA,EAAAA,SAAa,QAALD,EAARC,EAAW,UAAE,IAAAD,OAAA,EAAdA,EAAiCoB,OAAK,CAAA,EAAA,CAC1CjB,YACA6H,aAAcxG,EAEdsG,IAAKtG,EACLnB,OACA8D,OACAjE,WAAY8B,GACTZ,IAEJ,IAKTxB,EAAQuI,YAAc"}
1
+ {"version":3,"file":"PopoverLite.js","sources":["../../../../../../../../../src/core/ui/components/molecules/popover/PopoverLite.tsx"],"sourcesContent":["\nimport { FC, memo, useRef, useEffect, useState, useCallback, useMemo, cloneElement,\n CSSProperties, ReactNode, ReactElement, Component } from 'react'\nimport { createPopper, Instance, ModifierArguments } from '@popperjs/core'\n\nimport { EventName, KeyCode } from '../../../../constants'\nimport { cancelableSetTimeout } from '../../../../utils'\nimport { outsideClickHandler } from '../../../../hooks'\n\nimport { PopoverProps } from './popover.types'\n\n\nconst styles: Record<string, Partial<CSSProperties>> = {\n modal: {\n zIndex: 1,\n position: 'fixed',\n width: '100%',\n height: '100%',\n top: '0',\n left: '0',\n background: 'rgba(0 0 0 / 70%)',\n pointerEvents: 'all',\n userSelect: 'none',\n visibility: 'hidden',\n },\n}\n\nexport const Popover: FC<PopoverProps> = memo<PopoverProps>(\n ({\n children,\n components,\n placement = 'bottom',\n modifiers,\n data,\n hoverable,\n clickable,\n onOpen,\n onHide,\n isOpen,\n hideOnContentClick = false,\n hideOnClickOutside = true,\n hideTimeout = 150,\n isPopup = false,\n isModal = false,\n modalOverlayClassName,\n modalContainer,\n targetRef,\n hideOnEscape,\n ...props\n }: PopoverProps) => {\n const [content, setContent] = useState<HTMLElement | null>(null)\n const [target, setTarget] = useState<HTMLElement | null>(targetRef?.current ?? null)\n\n useEffect(() => {\n if (targetRef?.current) {\n setTarget(targetRef?.current)\n }\n }, [targetRef])\n\n const { ContentComponent, ...contentComponents } = components || {}\n\n const popperInstanceRef = useRef<Instance | null>(null)\n\n const options = useMemo(() => {\n const options = (modifiers ? { modifiers, placement } : { placement })\n\n options.modifiers = options.modifiers || []\n\n if (isPopup) {\n options.modifiers = [\n ...options.modifiers,\n {\n name: 'centering',\n phase: 'beforeWrite',\n enabled: true,\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n fn: ({ state }): Partial<ModifierArguments> => {\n const mcBoundRect = modalContainer?.getBoundingClientRect()\n\n const { width, height, left, top } = mcBoundRect || {\n width: window.innerWidth,\n height: window.innerHeight,\n left: 0,\n top: 0,\n }\n\n const xpos = left + (width - state.elements.popper.clientWidth) / 2\n const ypos = top + (height - state.elements.popper.clientHeight) / 2\n\n return {\n ...state,\n styles: {\n ...state.styles,\n popper: {\n ...state.styles.popper,\n left: `${xpos}px`,\n top: `${ypos}px`,\n transform: 'none',\n },\n },\n }\n },\n },\n ] as PopoverProps['modifiers']\n }\n\n return options\n }, [modifiers, placement, isPopup, modalContainer])\n\n // to save cancelable setTimout\n const pendingHideRef = useRef<(() => void)>()\n\n useEffect(() => {\n popperInstanceRef?.current?.destroy()\n let popperInstance: ReturnType<typeof createPopper>\n\n if (target && content) {\n popperInstance = createPopper(target, content, { ...options })\n\n popperInstanceRef.current = popperInstance\n }\n\n return (): void => {\n popperInstance?.destroy()\n popperInstanceRef.current = null\n }\n }, [content, target, options])\n\n\n const outsideClickUnsubscriber = useRef<() => void | null>()\n const outsideClickUnsubscriberTimeout = useRef<any>(-1)\n\n const hide = useCallback(() => {\n if (content) {\n delete content.dataset.show\n }\n\n if (isModal && modalRef?.current) {\n modalRef.current.style.visibility = 'hidden'\n delete modalRef.current.dataset.show\n }\n\n popperInstanceRef?.current?.update()\n onHide?.()\n outsideClickUnsubscriber?.current?.()\n clearTimeout(outsideClickUnsubscriberTimeout.current)\n }, [content, isModal, onHide])\n\n\n const delayedHide = useCallback(() => {\n pendingHideRef.current && pendingHideRef.current()\n pendingHideRef.current = cancelableSetTimeout(hide, hideTimeout)\n }, [hide, hideTimeout])\n\n const cancelDelayedHide = useCallback(() => {\n pendingHideRef.current && pendingHideRef.current()\n }, [])\n\n const handleOutsideClick = useCallback((eventTarget: HTMLElement | null) => {\n if ((content?.dataset?.show === 'true' && hideOnClickOutside && !content?.contains(eventTarget))\n || (content?.contains(eventTarget) && hideOnContentClick)) {\n hide()\n }\n }, [hide, content, hideOnContentClick, hideOnClickOutside])\n\n const open = useCallback(() => {\n if (content) {\n content.dataset.show = 'true'\n }\n\n popperInstanceRef?.current?.update()\n\n if (isModal && modalRef?.current) {\n modalRef.current.style.visibility = 'visible'\n modalRef.current.dataset.show = 'true'\n }\n\n onOpen?.()\n\n outsideClickUnsubscriber?.current?.()\n clearTimeout(outsideClickUnsubscriberTimeout.current)\n outsideClickUnsubscriberTimeout.current = setTimeout(() => {\n outsideClickUnsubscriber.current = outsideClickHandler(target, handleOutsideClick)\n }, 250)\n }, [content, handleOutsideClick, isModal, onOpen, target])\n\n const toggleOpen = useCallback(() => {\n content?.dataset?.show === 'true' ? hide() : open()\n }, [content, hide, open])\n\n const keydownHandler = useCallback((event: Event) => {\n if (hideOnEscape && (event as unknown as KeyboardEvent).keyCode === KeyCode.Escape) {\n hide()\n }\n }, [hideOnEscape, hide])\n\n useEffect(() => {\n if (!hoverable && !clickable) {\n console.error('Popover component should have at least one of props [\"hoverable\", \"clickable\"]')\n }\n\n const targetAddListener = target?.addEventListener?.bind(target)\n const contentAddListener = content?.addEventListener?.bind(content)\n\n if (contentAddListener && targetAddListener) {\n if (hoverable) {\n targetAddListener(EventName.MouseEnter, open)\n contentAddListener(EventName.MouseEnter, cancelDelayedHide)\n targetAddListener(EventName.MouseLeave, delayedHide)\n contentAddListener(EventName.MouseLeave, hide)\n }\n\n if (clickable) {\n targetAddListener(EventName.Click, toggleOpen)\n }\n }\n\n if (hideOnEscape) {\n document.addEventListener(EventName.KeyDown, keydownHandler)\n }\n\n return (): void => {\n const targetRemoveListener = target?.removeEventListener?.bind(target)\n const contentRemoveListener = content?.removeEventListener?.bind(content)\n\n document.removeEventListener(EventName.KeyDown, keydownHandler)\n\n pendingHideRef.current && pendingHideRef.current()\n\n if (targetRemoveListener) {\n targetRemoveListener(EventName.Click, toggleOpen)\n targetRemoveListener(EventName.MouseEnter, open)\n targetRemoveListener(EventName.MouseLeave, delayedHide)\n }\n if (contentRemoveListener) {\n contentRemoveListener(EventName.MouseLeave, hide)\n contentRemoveListener(EventName.MouseEnter, cancelDelayedHide)\n }\n }\n }, [target, content, clickable, hoverable,\n open, hide, toggleOpen, delayedHide, cancelDelayedHide, hideOnEscape, keydownHandler])\n\n // open, hide based on external isOpen\n useEffect(() => {\n if (isOpen === true) {\n open()\n }\n if (isOpen === false) {\n hide()\n }\n return outsideClickUnsubscriber?.current as () => void\n }, [hide, isOpen, open])\n\n const childrenIsFunction = typeof children === 'function'\n const childrenIsElement = typeof children !== 'function' && !Array.isArray(children)\n const childrenAreElements = typeof children !== 'function' && Array.isArray(children)\n && children.filter((child: ReactNode) => !!child).length === 2\n\n // modal\n const modalRef = useRef<HTMLDivElement | null>(null)\n\n useEffect(() => {\n if (isModal && content) {\n content.style.zIndex = '2'\n }\n }, [content, isModal])\n\n return (\n <>\n {isModal && <span ref={modalRef} style={styles.modal} className={modalOverlayClassName} />}\n {(!targetRef && childrenIsFunction) && children?.({ forwardedRef: setTarget, data })}\n {(!targetRef && childrenIsElement) && <span ref={setTarget}>{children}</span>}\n {!childrenAreElements && ContentComponent && (\n <ContentComponent\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n placement={placement}\n forwardedRef={setContent}\n ref={typeof ContentComponent !== 'function' ? setContent : null}\n data={data}\n hide={hide}\n components={contentComponents as { [key: string]: FC | Component<any> }}\n {...props}\n />\n )}\n {(!targetRef && childrenAreElements) && <span ref={setTarget}>{children[0]}</span>}\n {(childrenAreElements && children?.[1] && typeof children?.[1] === 'object')\n && cloneElement(children[1] as ReactElement, {\n ...((children?.[1] as ReactElement)?.props),\n placement,\n forwardedRef: setContent,\n // ...(typeof children[1] !== 'function' ? { ref: setContent } : {}),\n ref: setContent,\n data,\n hide,\n components: contentComponents as { [key: string]: FC | Component<any> },\n ...props,\n })}\n </>\n )\n },\n)\n\nPopover.displayName = 'Popover'\n"],"names":["styles","modal","zIndex","position","width","height","top","left","background","pointerEvents","userSelect","visibility","Popover","memo","_ref","_targetRef$current","_children$","children","components","placement","modifiers","data","hoverable","clickable","onOpen","onHide","isOpen","hideOnContentClick","hideOnClickOutside","hideTimeout","isPopup","isModal","modalOverlayClassName","modalContainer","targetRef","hideOnEscape","props","_objectWithoutProperties","_excluded","content","setContent","useState","target","setTarget","current","useEffect","_ref2","ContentComponent","contentComponents","_excluded2","popperInstanceRef","useRef","options","useMemo","name","phase","enabled","fn","_ref3","state","mcBoundRect","getBoundingClientRect","window","innerWidth","innerHeight","xpos","elements","popper","clientWidth","ypos","clientHeight","_objectSpread","objectSpread2","concat","transform","pendingHideRef","_popperInstanceRef$cu","popperInstance","destroy","createPopper","_popperInstance","outsideClickUnsubscriber","outsideClickUnsubscriberTimeout","hide","useCallback","_popperInstanceRef$cu2","_outsideClickUnsubscr","dataset","show","modalRef","style","update","call","clearTimeout","delayedHide","cancelableSetTimeout","cancelDelayedHide","handleOutsideClick","eventTarget","_content$dataset","contains","open","_popperInstanceRef$cu3","_outsideClickUnsubscr2","setTimeout","outsideClickHandler","toggleOpen","_content$dataset2","keydownHandler","event","keyCode","KeyCode","Escape","_target$addEventListe","_content$addEventList","targetAddListener","addEventListener","bind","contentAddListener","EventName","MouseEnter","MouseLeave","Click","document","KeyDown","_target$removeEventLi","_content$removeEventL","targetRemoveListener","removeEventListener","contentRemoveListener","childrenIsFunction","childrenIsElement","Array","isArray","childrenAreElements","filter","child","length","React","createElement","Fragment","ref","className","forwardedRef","_extends","cloneElement","displayName"],"mappings":"otBAYMA,EAAiD,CACrDC,MAAO,CACLC,OAAQ,EACRC,SAAU,QACVC,MAAO,OACPC,OAAQ,OACRC,IAAK,IACLC,KAAM,IACNC,WAAY,oBACZC,cAAe,MACfC,WAAY,OACZC,WAAY,WAIHC,EAA4BC,E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AAK,CAAA,EAAA,CAC1CjB,YACA4H,aAAcvG,EAEdqG,IAAKrG,EACLnB,OACA8D,OACAjE,WAAY8B,GACTZ,IAEJ,IAKTxB,EAAQsI,YAAc"}
@@ -1,2 +1,2 @@
1
- import e from"react";const c=e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},e.createElement("path",{d:"M336.1 175c-9.375-9.375-24.56-9.375-33.94 0L256 222.1L208.1 175c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l47.03 47.03L175 303c-9.375 9.375-9.375 24.56 0 33.94c9.373 9.373 24.56 9.381 33.94 0L256 289.9l47.03 47.03c9.373 9.373 24.56 9.381 33.94 0c9.375-9.375 9.375-24.56 0-33.94l-47.03-47.03l47.03-47.03C346.3 199.6 346.3 184.4 336.1 175zM256 0C114.6 0 0 114.6 0 256s114.6 256 256 256S512 397.4 512 256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464z"})),t=e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},e.createElement("path",{d:"M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 128c17.67 0 32 14.33 32 32c0 17.67-14.33 32-32 32S224 177.7 224 160C224 142.3 238.3 128 256 128zM296 384h-80C202.8 384 192 373.3 192 360s10.75-24 24-24h16v-64H224c-13.25 0-24-10.75-24-24S210.8 224 224 224h32c13.25 0 24 10.75 24 24v88h16c13.25 0 24 10.75 24 24S309.3 384 296 384z"}));export{c as closeIconJSX,t as infoIconJSX};
1
+ const e=React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},React.createElement("path",{d:"M336.1 175c-9.375-9.375-24.56-9.375-33.94 0L256 222.1L208.1 175c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l47.03 47.03L175 303c-9.375 9.375-9.375 24.56 0 33.94c9.373 9.373 24.56 9.381 33.94 0L256 289.9l47.03 47.03c9.373 9.373 24.56 9.381 33.94 0c9.375-9.375 9.375-24.56 0-33.94l-47.03-47.03l47.03-47.03C346.3 199.6 346.3 184.4 336.1 175zM256 0C114.6 0 0 114.6 0 256s114.6 256 256 256S512 397.4 512 256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464z"})),c=React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},React.createElement("path",{d:"M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 128c17.67 0 32 14.33 32 32c0 17.67-14.33 32-32 32S224 177.7 224 160C224 142.3 238.3 128 256 128zM296 384h-80C202.8 384 192 373.3 192 360s10.75-24 24-24h16v-64H224c-13.25 0-24-10.75-24-24S210.8 224 224 224h32c13.25 0 24 10.75 24 24v88h16c13.25 0 24 10.75 24 24S309.3 384 296 384z"}));export{e as closeIconJSX,c as infoIconJSX};
2
2
  //# sourceMappingURL=icons.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"icons.js","sources":["../../../../../../../../src/core/ui/components/atoms/icons.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport React from 'react'\n\nexport const closeIconJSX = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M336.1 175c-9.375-9.375-24.56-9.375-33.94 0L256 222.1L208.1 175c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l47.03 47.03L175 303c-9.375 9.375-9.375 24.56 0 33.94c9.373 9.373 24.56 9.381 33.94 0L256 289.9l47.03 47.03c9.373 9.373 24.56 9.381 33.94 0c9.375-9.375 9.375-24.56 0-33.94l-47.03-47.03l47.03-47.03C346.3 199.6 346.3 184.4 336.1 175zM256 0C114.6 0 0 114.6 0 256s114.6 256 256 256S512 397.4 512 256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464z' /></svg>\n)\nexport const infoIconJSX = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 128c17.67 0 32 14.33 32 32c0 17.67-14.33 32-32 32S224 177.7 224 160C224 142.3 238.3 128 256 128zM296 384h-80C202.8 384 192 373.3 192 360s10.75-24 24-24h16v-64H224c-13.25 0-24-10.75-24-24S210.8 224 224 224h32c13.25 0 24 10.75 24 24v88h16c13.25 0 24 10.75 24 24S309.3 384 296 384z' /></svg>\n\n)\n\n\nexport const appStoreIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M255.9 120.9l9.1-15.7c5.6-9.8 18.1-13.1 27.9-7.5 9.8 5.6 13.1 18.1 7.5 27.9l-87.5 151.5h63.3c20.5 0 32 24.1 23.1 40.8H113.8c-11.3 0-20.4-9.1-20.4-20.4 0-11.3 9.1-20.4 20.4-20.4h52l66.6-115.4-20.8-36.1c-5.6-9.8-2.3-22.2 7.5-27.9 9.8-5.6 22.2-2.3 27.9 7.5l8.9 15.7zm-78.7 218l-19.6 34c-5.6 9.8-18.1 13.1-27.9 7.5-9.8-5.6-13.1-18.1-7.5-27.9l14.6-25.2c16.4-5.1 29.8-1.2 40.4 11.6zm168.9-61.7h53.1c11.3 0 20.4 9.1 20.4 20.4 0 11.3-9.1 20.4-20.4 20.4h-29.5l19.9 34.5c5.6 9.8 2.3 22.2-7.5 27.9-9.8 5.6-22.2 2.3-27.9-7.5-33.5-58.1-58.7-101.6-75.4-130.6-17.1-29.5-4.9-59.1 7.2-69.1 13.4 23 33.4 57.7 60.1 104zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm216 248c0 118.7-96.1 216-216 216-118.7 0-216-96.1-216-216 0-118.7 96.1-216 216-216 118.7 0 216 96.1 216 216z' /></svg>\n)\n\n\nexport const batteryEmptyIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'><path d='M544 192V160c0-35.35-28.65-64-64-64H64C28.65 96 0 124.7 0 160v192c0 35.35 28.65 64 64 64h416c35.35 0 64-28.65 64-64v-32c17.67 0 32-14.33 32-32V224C576 206.3 561.7 192 544 192zM480 352H64V160h416V352z' /></svg>\n)\n\n\nexport const elementorIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path d='M425.6 32H22.4C10 32 0 42 0 54.4v403.2C0 470 10 480 22.4 480h403.2c12.4 0 22.4-10 22.4-22.4V54.4C448 42 438 32 425.6 32M164.3 355.5h-39.8v-199h39.8v199zm159.3 0H204.1v-39.8h119.5v39.8zm0-79.6H204.1v-39.8h119.5v39.8zm0-79.7H204.1v-39.8h119.5v39.8z' /></svg>\n)\n\nexport const squareCheckIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path d='M384 32H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h320c35.35 0 64-28.65 64-64V96C448 60.65 419.3 32 384 32zM400 416c0 8.836-7.164 16-16 16H64c-8.836 0-16-7.164-16-16V96c0-8.838 7.164-16 16-16h320c8.836 0 16 7.162 16 16V416zM303 175L192 286.1L144.1 239c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l64 64C179.7 341.7 185.8 344 192 344s12.28-2.344 16.97-7.031l128-128c9.375-9.375 9.375-24.56 0-33.94S312.4 165.7 303 175z' /></svg>\n)\n\nexport const pencilIcon = (\n <svg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'>\n <path d='M8.91878 3.38356L6.59333 1.08219L7.35936 0.315069C7.56911 0.105023 7.82682 0 8.13251 0C8.43782 0 8.69536 0.105023 8.9051 0.315069L9.67113 1.08219C9.88088 1.29224 9.99031 1.54575 9.99943 1.84274C10.0086 2.13936 9.90824 2.39269 9.69849 2.60274L8.91878 3.38356ZM8.12539 4.19178L2.32545 10H0V7.67123L5.79994 1.86301L8.12539 4.19178Z' fill='#E2E369' />\n </svg>\n\n)\n"],"names":["closeIconJSX","React","createElement","xmlns","viewBox","d","infoIconJSX"],"mappings":"qBAIaA,MAAAA,EACXC,EAAAC,cAAA,MAAA,CAAKC,MAAM,6BAA6BC,QAAQ,eAAcH,EAAAC,cAAA,OAAA,CAAMG,EAAE,ygBAE3DC,EACXL,EAAAC,cAAA,MAAA,CAAKC,MAAM,6BAA6BC,QAAQ,eAAcH,EAAAC,cAAA,OAAA,CAAMG,EAAE"}
1
+ {"version":3,"file":"icons.js","sources":["../../../../../../../../src/core/ui/components/atoms/icons.tsx"],"sourcesContent":["\nexport const closeIconJSX = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M336.1 175c-9.375-9.375-24.56-9.375-33.94 0L256 222.1L208.1 175c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l47.03 47.03L175 303c-9.375 9.375-9.375 24.56 0 33.94c9.373 9.373 24.56 9.381 33.94 0L256 289.9l47.03 47.03c9.373 9.373 24.56 9.381 33.94 0c9.375-9.375 9.375-24.56 0-33.94l-47.03-47.03l47.03-47.03C346.3 199.6 346.3 184.4 336.1 175zM256 0C114.6 0 0 114.6 0 256s114.6 256 256 256S512 397.4 512 256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464z' /></svg>\n)\nexport const infoIconJSX = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 128c17.67 0 32 14.33 32 32c0 17.67-14.33 32-32 32S224 177.7 224 160C224 142.3 238.3 128 256 128zM296 384h-80C202.8 384 192 373.3 192 360s10.75-24 24-24h16v-64H224c-13.25 0-24-10.75-24-24S210.8 224 224 224h32c13.25 0 24 10.75 24 24v88h16c13.25 0 24 10.75 24 24S309.3 384 296 384z' /></svg>\n\n)\n\n\nexport const appStoreIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M255.9 120.9l9.1-15.7c5.6-9.8 18.1-13.1 27.9-7.5 9.8 5.6 13.1 18.1 7.5 27.9l-87.5 151.5h63.3c20.5 0 32 24.1 23.1 40.8H113.8c-11.3 0-20.4-9.1-20.4-20.4 0-11.3 9.1-20.4 20.4-20.4h52l66.6-115.4-20.8-36.1c-5.6-9.8-2.3-22.2 7.5-27.9 9.8-5.6 22.2-2.3 27.9 7.5l8.9 15.7zm-78.7 218l-19.6 34c-5.6 9.8-18.1 13.1-27.9 7.5-9.8-5.6-13.1-18.1-7.5-27.9l14.6-25.2c16.4-5.1 29.8-1.2 40.4 11.6zm168.9-61.7h53.1c11.3 0 20.4 9.1 20.4 20.4 0 11.3-9.1 20.4-20.4 20.4h-29.5l19.9 34.5c5.6 9.8 2.3 22.2-7.5 27.9-9.8 5.6-22.2 2.3-27.9-7.5-33.5-58.1-58.7-101.6-75.4-130.6-17.1-29.5-4.9-59.1 7.2-69.1 13.4 23 33.4 57.7 60.1 104zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm216 248c0 118.7-96.1 216-216 216-118.7 0-216-96.1-216-216 0-118.7 96.1-216 216-216 118.7 0 216 96.1 216 216z' /></svg>\n)\n\n\nexport const batteryEmptyIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'><path d='M544 192V160c0-35.35-28.65-64-64-64H64C28.65 96 0 124.7 0 160v192c0 35.35 28.65 64 64 64h416c35.35 0 64-28.65 64-64v-32c17.67 0 32-14.33 32-32V224C576 206.3 561.7 192 544 192zM480 352H64V160h416V352z' /></svg>\n)\n\n\nexport const elementorIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path d='M425.6 32H22.4C10 32 0 42 0 54.4v403.2C0 470 10 480 22.4 480h403.2c12.4 0 22.4-10 22.4-22.4V54.4C448 42 438 32 425.6 32M164.3 355.5h-39.8v-199h39.8v199zm159.3 0H204.1v-39.8h119.5v39.8zm0-79.6H204.1v-39.8h119.5v39.8zm0-79.7H204.1v-39.8h119.5v39.8z' /></svg>\n)\n\nexport const squareCheckIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path d='M384 32H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h320c35.35 0 64-28.65 64-64V96C448 60.65 419.3 32 384 32zM400 416c0 8.836-7.164 16-16 16H64c-8.836 0-16-7.164-16-16V96c0-8.838 7.164-16 16-16h320c8.836 0 16 7.162 16 16V416zM303 175L192 286.1L144.1 239c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l64 64C179.7 341.7 185.8 344 192 344s12.28-2.344 16.97-7.031l128-128c9.375-9.375 9.375-24.56 0-33.94S312.4 165.7 303 175z' /></svg>\n)\n\nexport const pencilIcon = (\n <svg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'>\n <path d='M8.91878 3.38356L6.59333 1.08219L7.35936 0.315069C7.56911 0.105023 7.82682 0 8.13251 0C8.43782 0 8.69536 0.105023 8.9051 0.315069L9.67113 1.08219C9.88088 1.29224 9.99031 1.54575 9.99943 1.84274C10.0086 2.13936 9.90824 2.39269 9.69849 2.60274L8.91878 3.38356ZM8.12539 4.19178L2.32545 10H0V7.67123L5.79994 1.86301L8.12539 4.19178Z' fill='#E2E369' />\n </svg>\n\n)\n"],"names":["closeIconJSX","React","createElement","xmlns","viewBox","d","infoIconJSX"],"mappings":"AACaA,MAAAA,EACXC,MAAAC,cAAA,MAAA,CAAKC,MAAM,6BAA6BC,QAAQ,eAAcH,MAAAC,cAAA,OAAA,CAAMG,EAAE,ygBAE3DC,EACXL,MAAAC,cAAA,MAAA,CAAKC,MAAM,6BAA6BC,QAAQ,eAAcH,MAAAC,cAAA,OAAA,CAAMG,EAAE"}
@@ -1,2 +1,2 @@
1
- import{objectWithoutProperties as t,objectSpread2 as e}from"../../../../../../_virtual/_rollupPluginBabelHelpers.js";import r,{memo as o,useMemo as a}from"react";import{useParseProps as s}from"../../../../hooks/useParseProps.js";import{composeId as l}from"../../../../utils/helpers/text.js";const i=["element","children","href","target","className","id","onClick","text"],n=o((o=>{let{element:n="span",children:c,href:d,target:m,className:p="",id:u,onClick:h,text:f}=o,x=t(o,i);const{dataProps:P,restProps:b}=s(x),g=f||(null==c?void 0:c.toString()),j=a((()=>h?{onClick:h,onKeyDown:h,role:"button",tabIndex:-1}:{}),[h]);return r.createElement(n,e(e(e({id:"".concat(u||g&&l(g)),href:d,text:f,target:m,className:p},j),{},{style:b},P),{},{"data-testid":"".concat(P.dataTestId||P["data-testid"]||u||g&&l(g))}),c)}));n.displayName="Text";export{n as Text};
1
+ import{objectWithoutProperties as t,objectSpread2 as e}from"../../../../../../_virtual/_rollupPluginBabelHelpers.js";import{memo as r,useMemo as o,createElement as a}from"react";import{useParseProps as s}from"../../../../hooks/useParseProps.js";import{composeId as l}from"../../../../utils/helpers/text.js";const i=["element","children","href","target","className","id","onClick","text"],n=r((r=>{let{element:n="span",children:c,href:d,target:p,className:m="",id:u,onClick:h,text:f}=r,x=t(r,i);const{dataProps:P,restProps:b}=s(x),g=f||(null==c?void 0:c.toString()),j=o((()=>h?{onClick:h,onKeyDown:h,role:"button",tabIndex:-1}:{}),[h]);return a(n,e(e(e({id:"".concat(u||g&&l(g)),href:d,text:f,target:p,className:m},j),{},{style:b},P),{},{"data-testid":"".concat(P.dataTestId||P["data-testid"]||u||g&&l(g))}),c)}));n.displayName="Text";export{n as Text};
2
2
  //# sourceMappingURL=Text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Text.js","sources":["../../../../../../../../../src/core/ui/components/atoms/text/Text.tsx"],"sourcesContent":["import React, { memo, FC, useMemo } from 'react'\n\nimport { composeId } from '../../../../utils'\nimport { useParseProps } from '../../../../hooks'\n\nimport { ITextProps, TextProps } from './text.types'\n\n\nexport const Text: FC<TextProps> = memo<ITextProps>((\n { element = 'span', children, href, target, className = '', id, onClick, text, ...rest }: ITextProps,\n) => {\n const { dataProps, restProps } = useParseProps(rest)\n const textFromChildren: string | undefined = text || children?.toString()\n\n const onClickProps = useMemo(() => (onClick ? ({\n onClick,\n onKeyDown: onClick,\n role: 'button',\n tabIndex: -1,\n }) : {}), [onClick])\n\n return React.createElement<TextProps>(\n element,\n {\n id: `${id || (textFromChildren && composeId(textFromChildren))}`,\n href,\n text,\n target,\n className,\n ...onClickProps,\n style: restProps,\n ...dataProps,\n 'data-testid':\n `${dataProps.dataTestId || dataProps['data-testid'] || id || (textFromChildren && composeId(textFromChildren))}`,\n },\n children,\n )\n})\n\nText.displayName = 'Text'\n"],"names":["Text","memo","_ref","element","children","href","target","className","id","onClick","text","rest","_objectWithoutProperties","_excluded","dataProps","restProps","useParseProps","textFromChildren","toString","onClickProps","useMemo","onKeyDown","role","tabIndex","React","createElement","_objectSpread","concat","composeId","style","dataTestId","displayName"],"mappings":"oXAQaA,EAAsBC,GAAiBC,IAE/C,IADHC,QAAEA,EAAU,OAAMC,SAAEA,EAAQC,KAAEA,EAAIC,OAAEA,EAAMC,UAAEA,EAAY,GAAEC,GAAEA,EAAEC,QAAEA,EAAOC,KAAEA,GAA2BR,EAAlBS,EAAIC,EAAAV,EAAAW,GAEtF,MAAMC,UAAEA,EAASC,UAAEA,GAAcC,EAAcL,GACzCM,EAAuCP,IAAQN,aAAQ,EAARA,EAAUc,YAEzDC,EAAeC,GAAQ,IAAOX,EAAW,CAC7CA,UACAY,UAAWZ,EACXa,KAAM,SACNC,UAAW,GACR,CAAG,GAAE,CAACd,IAEX,OAAOe,EAAMC,cACXtB,EAAOuB,EAAAA,EAAAA,EAAA,CAELlB,GAAE,GAAAmB,OAAKnB,GAAOS,GAAoBW,EAAUX,IAC5CZ,OACAK,OACAJ,SACAC,aACGY,GAAY,GAAA,CACfU,MAAOd,GACJD,GAAS,GAAA,CACZ,iBAAaa,OACVb,EAAUgB,YAAchB,EAAU,gBAAkBN,GAAOS,GAAoBW,EAAUX,MAE9Fb,EACD,IAGHJ,EAAK+B,YAAc"}
1
+ {"version":3,"file":"Text.js","sources":["../../../../../../../../../src/core/ui/components/atoms/text/Text.tsx"],"sourcesContent":["import { createElement, memo, FC, useMemo } from 'react'\n\nimport { composeId } from '../../../../utils'\nimport { useParseProps } from '../../../../hooks'\n\nimport { ITextProps, TextProps } from './text.types'\n\n\nexport const Text: FC<TextProps> = memo<ITextProps>((\n { element = 'span', children, href, target, className = '', id, onClick, text, ...rest }: ITextProps,\n) => {\n const { dataProps, restProps } = useParseProps(rest)\n const textFromChildren: string | undefined = text || children?.toString()\n\n const onClickProps = useMemo(() => (onClick ? ({\n onClick,\n onKeyDown: onClick,\n role: 'button',\n tabIndex: -1,\n }) : {}), [onClick])\n\n return createElement<TextProps>(\n element,\n {\n id: `${id || (textFromChildren && composeId(textFromChildren))}`,\n href,\n text,\n target,\n className,\n ...onClickProps,\n style: restProps,\n ...dataProps,\n 'data-testid':\n `${dataProps.dataTestId || dataProps['data-testid'] || id || (textFromChildren && composeId(textFromChildren))}`,\n },\n children,\n )\n})\n\nText.displayName = 'Text'\n"],"names":["Text","memo","_ref","element","children","href","target","className","id","onClick","text","rest","_objectWithoutProperties","_excluded","dataProps","restProps","useParseProps","textFromChildren","toString","onClickProps","useMemo","onKeyDown","role","tabIndex","createElement","_objectSpread","concat","composeId","style","dataTestId","displayName"],"mappings":"oYAQaA,EAAsBC,GAAiBC,IAE/C,IADHC,QAAEA,EAAU,OAAMC,SAAEA,EAAQC,KAAEA,EAAIC,OAAEA,EAAMC,UAAEA,EAAY,GAAEC,GAAEA,EAAEC,QAAEA,EAAOC,KAAEA,GAA2BR,EAAlBS,EAAIC,EAAAV,EAAAW,GAEtF,MAAMC,UAAEA,EAASC,UAAEA,GAAcC,EAAcL,GACzCM,EAAuCP,IAAQN,aAAQ,EAARA,EAAUc,YAEzDC,EAAeC,GAAQ,IAAOX,EAAW,CAC7CA,UACAY,UAAWZ,EACXa,KAAM,SACNC,UAAW,GACR,CAAG,GAAE,CAACd,IAEX,OAAOe,EACLrB,EAAOsB,EAAAA,EAAAA,EAAA,CAELjB,GAAE,GAAAkB,OAAKlB,GAAOS,GAAoBU,EAAUV,IAC5CZ,OACAK,OACAJ,SACAC,aACGY,GAAY,GAAA,CACfS,MAAOb,GACJD,GAAS,GAAA,CACZ,iBAAaY,OACVZ,EAAUe,YAAcf,EAAU,gBAAkBN,GAAOS,GAAoBU,EAAUV,MAE9Fb,EACD,IAGHJ,EAAK8B,YAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.js","sources":["../../../../../../../../src/core/ui/components/error/ErrorBoundary.tsx"],"sourcesContent":["import { FC, memo, PureComponent, ReactNode } from 'react'\n\nimport { IconBase } from '../icon'\nimport { LayoutBox } from '../container/layoutBox/LayoutBox'\n\nimport classes from './errorBoundary.module.scss'\nimport { DefaultErrorComponentProps, ErrorBoundaryProps } from './errorBoundary.types'\n\n\ninterface State {\n error?: Error\n errorInfo?: unknown\n hasError: boolean\n}\n\n\nexport const DefaultErrorComponent: FC<DefaultErrorComponentProps>\n= memo(({ title, text }: DefaultErrorComponentProps) => (\n <LayoutBox className={classes.errorBoundary} direction='column' flexWrap='wrap' gap='2rem' padding='1rem'>\n {title && <h1>{title}</h1>}\n <LayoutBox align='center' justify='space-between' gap='1rem'>\n <IconBase\n className={classes.StyledIcon}\n color='#FF0000'\n width='3rem'\n height='3rem'\n >\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'>\n <path d='M506.3 417l-213.3-364c-16.33-28-57.54-28-73.98 0l-213.2 364C-10.59 444.9 9.849 480 42.74 480h426.6C502.1 480 522.6 445 506.3 417zM232 168c0-13.25 10.75-24 24-24S280 154.8 280 168v128c0 13.25-10.75 24-23.1 24S232 309.3 232 296V168zM256 416c-17.36 0-31.44-14.08-31.44-31.44c0-17.36 14.07-31.44 31.44-31.44s31.44 14.08 31.44 31.44C287.4 401.9 273.4 416 256 416z' />\n </svg>\n </IconBase>\n {text && (\n <LayoutBox flexShrink='0' width='90%'>\n {text}\n </LayoutBox>\n )}\n </LayoutBox>\n </LayoutBox>\n))\nDefaultErrorComponent.displayName = 'DefaultErrorComponent'\n\nexport class ErrorBoundary extends PureComponent<ErrorBoundaryProps, State> {\n constructor(props: ErrorBoundaryProps) {\n super(props)\n this.state = { hasError: false }\n }\n\n static getDerivedStateFromError(error: Error): State {\n return { hasError: true, error }\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void {\n // eslint-disable-next-line no-console\n !this.props.muted && error && console.error(error)\n // eslint-disable-next-line no-console\n !this.props.muted && errorInfo && console.error(errorInfo)\n\n this.props?.onError?.({ error, errorInfo })\n\n !this.props.muted && this.setState({ hasError: true, error, errorInfo })\n }\n\n render(): ReactNode {\n const { ErrorComponent = DefaultErrorComponent, title, text, muted } = this.props\n const { hasError, error, errorInfo } = this.state\n\n if (hasError && !muted) {\n return (\n <ErrorComponent\n title={title || error?.toString() || 'Error'}\n text={text || `${JSON.stringify(errorInfo, null, 2)}`}\n />\n )\n }\n\n if (hasError && muted) {\n return null\n }\n\n return this.props.children\n }\n}\n"],"names":["DefaultErrorComponent","memo","_ref","title","text","React","createElement","LayoutBox","className","classes","errorBoundary","direction","flexWrap","gap","padding","align","justify","IconBase","StyledIcon","color","width","height","xmlns","viewBox","d","flexShrink","displayName","ErrorBoundary","PureComponent","constructor","props","super","this","state","hasError","getDerivedStateFromError","error","componentDidCatch","errorInfo","_this$props","_this$props$onError","muted","onError","call","setState","render","ErrorComponent","toString","concat","JSON","stringify","children"],"mappings":"6MAgBaA,MAAAA,EACXC,GAAKC,IAAA,IAACC,MAAEA,EAAKC,KAAEA,GAAkCF,EAAA,OACjDG,MAAAC,cAACC,EAAS,CAACC,UAAWC,EAAQC,cAAeC,UA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O,EACP,KAGFT,KAAKF,MAAMqB,QACpB"}
1
+ {"version":3,"file":"ErrorBoundary.js","sources":["../../../../../../../../src/core/ui/components/error/ErrorBoundary.tsx"],"sourcesContent":["import { ErrorInfo, FC, memo, PureComponent, ReactNode } from 'react'\n\nimport { IconBase } from '../icon'\nimport { LayoutBox } from '../container/layoutBox/LayoutBox'\n\nimport classes from './errorBoundary.module.scss'\nimport { DefaultErrorComponentProps, ErrorBoundaryProps } from './errorBoundary.types'\n\n\ninterface State {\n error?: Error\n errorInfo?: unknown\n hasError: boolean\n}\n\n\nexport const DefaultErrorComponent: FC<DefaultErrorComponentProps>\n= memo(({ title, text }: DefaultErrorComponentProps) => (\n <LayoutBox className={classes.errorBoundary} direction='column' flexWrap='wrap' gap='2rem' padding='1rem'>\n {title && <h1>{title}</h1>}\n <LayoutBox align='center' justify='space-between' gap='1rem'>\n <IconBase\n className={classes.StyledIcon}\n color='#FF0000'\n width='3rem'\n height='3rem'\n >\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'>\n <path d='M506.3 417l-213.3-364c-16.33-28-57.54-28-73.98 0l-213.2 364C-10.59 444.9 9.849 480 42.74 480h426.6C502.1 480 522.6 445 506.3 417zM232 168c0-13.25 10.75-24 24-24S280 154.8 280 168v128c0 13.25-10.75 24-23.1 24S232 309.3 232 296V168zM256 416c-17.36 0-31.44-14.08-31.44-31.44c0-17.36 14.07-31.44 31.44-31.44s31.44 14.08 31.44 31.44C287.4 401.9 273.4 416 256 416z' />\n </svg>\n </IconBase>\n {text && (\n <LayoutBox flexShrink='0' width='90%'>\n {text}\n </LayoutBox>\n )}\n </LayoutBox>\n </LayoutBox>\n))\nDefaultErrorComponent.displayName = 'DefaultErrorComponent'\n\nexport class ErrorBoundary extends PureComponent<ErrorBoundaryProps, State> {\n constructor(props: ErrorBoundaryProps) {\n super(props)\n this.state = { hasError: false }\n }\n\n static getDerivedStateFromError(error: Error): State {\n return { hasError: true, error }\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n // eslint-disable-next-line no-console\n !this.props.muted && error && console.error(error)\n // eslint-disable-next-line no-console\n !this.props.muted && errorInfo && console.error(errorInfo)\n\n this.props?.onError?.({ error, errorInfo })\n\n !this.props.muted && this.setState({ hasError: true, error, errorInfo })\n }\n\n render(): ReactNode {\n const { ErrorComponent = DefaultErrorComponent, title, text, muted } = this.props\n const { hasError, error, errorInfo } = this.state\n\n if (hasError && !muted) {\n return (\n <ErrorComponent\n title={title || error?.toString() || 'Error'}\n text={text || `${JSON.stringify(errorInfo, null, 2)}`}\n />\n )\n }\n\n if (hasError && muted) {\n return null\n }\n\n return this.props.children\n }\n}\n"],"names":["DefaultErrorComponent","memo","_ref","title","text","React","createElement","LayoutBox","className","classes","errorBoundary","direction","flexWrap","gap","padding","align","justify","IconBase","StyledIcon","color","width","height","xmlns","viewBox","d","flexShrink","displayName","ErrorBoundary","PureComponent","constructor","props","super","this","state","hasError","getDerivedStateFromError","error","componentDidCatch","errorInfo","_this$props","_this$props$onError","muted","onError","call","setState","render","ErrorComponent","toString","concat","JSON","stringify","children"],"mappings":"6MAgBaA,MAAAA,EACXC,GAAKC,IAAA,IAACC,MAAEA,EAAKC,KAAEA,GAAkCF,EAAA,OACjDG,MAAAC,cAACC,EAAS,CAACC,UAAWC,EAAQC,cAAeC,UAAU,SAASC,SAAS,OAAOC,IAAI,OAAOC,QAAQ,QAChGX,GAASE,MAAAC,cAAA,KAAA,KAAKH,GACfE,MAAAC,cAACC,EAAS,CAACQ,MAAM,SAASC,QAAQ,gBAAgBH,IAAI,QACpDR,MAAAC,cAACW,EAAQ,CACPT,UAAWC,EAAQS,WACnBC,MAAM,UACNC,MAAM,OACNC,OAAO,QAEPhB,MAAAC,cAAA,MAAA,CAAKgB,MAAM,6BAA6BC,QAAQ,eAC9ClB,MAAAC,cAAA,OAAA,CAAMkB,EAAE,6WAGXpB,GACCC,MAAAC,cAACC,EAAS,CAACkB,WAAW,IAAIL,MAAM,OAC7BhB,IAIG,IAEdJ,EAAsB0B,YAAc,wBAE7B,MAAMC,UAAsBC,EACjCC,WAAAA,CAAYC,GACVC,MAAMD,GACNE,KAAKC,MAAQ,CAAEC,UAAU,EAC3B,CAEA,+BAAOC,CAAyBC,GAC9B,MAAO,CAAEF,UAAU,EAAME,QAC3B,CAEAC,iBAAAA,CAAkBD,EAAcE,GAA4B,IAAAC,EAAAC,EAEzDR,KAAKF,MAAMW,MAEXT,KAAKF,MAAMW,cAEZF,OAAKT,aAAK,IAAAS,GAAS,QAATC,EAAVD,EAAYG,eAAZF,IAAmBA,GAAnBA,EAAAG,KAAAJ,EAAsB,CAAEH,QAAOE,eAE9BN,KAAKF,MAAMW,OAAST,KAAKY,SAAS,CAAEV,UAAU,EAAME,QAAOE,aAC9D,CAEAO,MAAAA,GACE,MAAMC,eAAEA,EAAiB9C,EAAqBG,MAAEA,EAAKC,KAAEA,EAAIqC,MAAEA,GAAUT,KAAKF,OACtEI,SAAEA,EAAQE,MAAEA,EAAKE,UAAEA,GAAcN,KAAKC,MAE5C,OAAIC,IAAaO,EAEbpC,MAAAC,cAACwC,EAAc,CACb3C,MAAOA,IAASiC,aAAAA,EAAAA,EAAOW,aAAc,QACrC3C,KAAMA,GAAI4C,GAAAA,OAAOC,KAAKC,UAAUZ,EAAW,KAAM,MAKnDJ,GAAYO,EACP,KAGFT,KAAKF,MAAMqB,QACpB"}
@@ -1,2 +1,2 @@
1
- import{objectWithoutProperties as e,objectSpread2 as n,extends as t}from"../../../../../../_virtual/_rollupPluginBabelHelpers.js";import"../../../../../../node_modules/core-js/modules/web.dom-collections.iterator.js";import l,{memo as o,useState as r,useEffect as i,useRef as s,useMemo as u,useCallback as d}from"react";import{createPopper as a}from"../../../../../../node_modules/@popperjs/core/lib/popper.js";import{cancelableSetTimeout as c}from"../../../../utils/helpers/cancelableDelayedFunction.js";import{outsideClickHandler as p}from"../../../../hooks/useOutsideClick.js";import{KeyCode as m,EventName as v}from"../../../../constants/ui.constants.js";const f=["children","components","placement","modifiers","data","hoverable","clickable","onOpen","onHide","isOpen","hideOnContentClick","hideOnClickOutside","hideTimeout","isPopup","isModal","modalOverlayClassName","modalContainer","targetRef","hideOnEscape"],h=["ContentComponent"],y={modal:{zIndex:1,position:"fixed",width:"100%",height:"100%",top:"0",left:"0",background:"rgba(0 0 0 / 70%)",pointerEvents:"all",userSelect:"none",visibility:"hidden"}},b=o((o=>{var b,E;let{children:w,components:C,placement:g="bottom",modifiers:O,data:k,hoverable:j,clickable:L,onOpen:M,onHide:x,isOpen:R,hideOnContentClick:H=!1,hideOnClickOutside:P=!0,hideTimeout:T=150,isPopup:A=!1,isModal:N=!1,modalOverlayClassName:W,modalContainer:_,targetRef:D,hideOnEscape:z}=o,B=e(o,f);const[F,I]=r(null),[K,S]=r(null!==(b=null==D?void 0:D.current)&&void 0!==b?b:null);i((()=>{null!=D&&D.current&&S(null==D?void 0:D.current)}),[D]);const q=C||{},{ContentComponent:G}=q,J=e(q,h),Q=s(null),U=u((()=>{const e=O?{modifiers:O,placement:g}:{placement:g};return e.modifiers=e.modifiers||[],A&&(e.modifiers=[...e.modifiers,{name:"centering",phase:"beforeWrite",enabled:!0,fn:e=>{let{state:t}=e;const l=null==_?void 0:_.getBoundingClientRect(),{width:o,height:r,left:i,top:s}=l||{width:window.innerWidth,height:window.innerHeight,left:0,top:0},u=i+(o-t.elements.popper.clientWidth)/2,d=s+(r-t.elements.popper.clientHeight)/2;return n(n({},t),{},{styles:n(n({},t.styles),{},{popper:n(n({},t.styles.popper),{},{left:"".concat(u,"px"),top:"".concat(d,"px"),transform:"none"})})})}}]),e}),[O,g,A,_]),V=s();i((()=>{var e;let t;return null==Q||null===(e=Q.current)||void 0===e||e.destroy(),K&&F&&(t=a(K,F,n({},U)),Q.current=t),()=>{var e;null===(e=t)||void 0===e||e.destroy(),Q.current=null}}),[F,K,U]);const X=s(),Y=s(-1),Z=d((()=>{var e,n;F&&delete F.dataset.show,N&&null!=ue&&ue.current&&(ue.current.style.visibility="hidden",delete ue.current.dataset.show),null==Q||null===(e=Q.current)||void 0===e||e.update(),null==x||x(),null==X||null===(n=X.current)||void 0===n||n.call(X),clearTimeout(Y.current)}),[F,N,x]),$=d((()=>{V.current&&V.current(),V.current=c(Z,T)}),[Z,T]),ee=d((()=>{V.current&&V.current()}),[]),ne=d((e=>{var n;("true"===(null==F||null===(n=F.dataset)||void 0===n?void 0:n.show)&&P&&(null==F||!F.contains(e))||null!=F&&F.contains(e)&&H)&&Z()}),[Z,F,H,P]),te=d((()=>{var e,n;F&&(F.dataset.show="true"),null==Q||null===(e=Q.current)||void 0===e||e.update(),N&&null!=ue&&ue.current&&(ue.current.style.visibility="visible",ue.current.dataset.show="true"),null==M||M(),null==X||null===(n=X.current)||void 0===n||n.call(X),clearTimeout(Y.current),Y.current=setTimeout((()=>{X.current=p(K,ne)}),250)}),[F,ne,N,M,K]),le=d((()=>{var e;"true"===(null==F||null===(e=F.dataset)||void 0===e?void 0:e.show)?Z():te()}),[F,Z,te]),oe=d((e=>{z&&e.keyCode===m.Escape&&Z()}),[z,Z]);i((()=>{var e,n;const t=null==K||null===(e=K.addEventListener)||void 0===e?void 0:e.bind(K),l=null==F||null===(n=F.addEventListener)||void 0===n?void 0:n.bind(F);return l&&t&&(j&&(t(v.MouseEnter,te),l(v.MouseEnter,ee),t(v.MouseLeave,$),l(v.MouseLeave,Z)),L&&t(v.Click,le)),z&&document.addEventListener(v.KeyDown,oe),()=>{var e,n;const t=null==K||null===(e=K.removeEventListener)||void 0===e?void 0:e.bind(K),l=null==F||null===(n=F.removeEventListener)||void 0===n?void 0:n.bind(F);document.removeEventListener(v.KeyDown,oe),V.current&&V.current(),t&&(t(v.Click,le),t(v.MouseEnter,te),t(v.MouseLeave,$)),l&&(l(v.MouseLeave,Z),l(v.MouseEnter,ee))}}),[K,F,L,j,te,Z,le,$,ee,z,oe]),i((()=>(!0===R&&te(),!1===R&&Z(),null==X?void 0:X.current)),[Z,R,te]);const re="function"==typeof w,ie="function"!=typeof w&&!Array.isArray(w),se="function"!=typeof w&&Array.isArray(w)&&2===w.filter((e=>!!e)).length,ue=s(null);return i((()=>{N&&F&&(F.style.zIndex="2")}),[F,N]),l.createElement(l.Fragment,null,N&&l.createElement("span",{ref:ue,style:y.modal,className:W}),!D&&re&&(null==w?void 0:w({forwardedRef:S,data:k})),!D&&ie&&l.createElement("span",{ref:S},w),!se&&G&&l.createElement(G,t({placement:g,forwardedRef:I,ref:"function"!=typeof G?I:null,data:k,hide:Z,components:J},B)),!D&&se&&l.createElement("span",{ref:S},w[0]),se&&(null==w?void 0:w[1])&&"object"==typeof(null==w?void 0:w[1])&&l.cloneElement(w[1],n(n({},null==w||null===(E=w[1])||void 0===E?void 0:E.props),{},{placement:g,forwardedRef:I,ref:I,data:k,hide:Z,components:J},B)))}));b.displayName="Popover";export{b as Popover};
1
+ import{objectWithoutProperties as e,objectSpread2 as t,extends as n}from"../../../../../../_virtual/_rollupPluginBabelHelpers.js";import"../../../../../../node_modules/core-js/modules/web.dom-collections.iterator.js";import{memo as l,useState as o,useEffect as r,useRef as i,useMemo as a,useCallback as s,cloneElement as u}from"react";import{createPopper as d}from"../../../../../../node_modules/@popperjs/core/lib/popper.js";import{cancelableSetTimeout as c}from"../../../../utils/helpers/cancelableDelayedFunction.js";import{outsideClickHandler as p}from"../../../../hooks/useOutsideClick.js";import{KeyCode as m,EventName as v}from"../../../../constants/ui.constants.js";const f=["children","components","placement","modifiers","data","hoverable","clickable","onOpen","onHide","isOpen","hideOnContentClick","hideOnClickOutside","hideTimeout","isPopup","isModal","modalOverlayClassName","modalContainer","targetRef","hideOnEscape"],h=["ContentComponent"],y={modal:{zIndex:1,position:"fixed",width:"100%",height:"100%",top:"0",left:"0",background:"rgba(0 0 0 / 70%)",pointerEvents:"all",userSelect:"none",visibility:"hidden"}},b=l((l=>{var b,w;let{children:C,components:E,placement:g="bottom",modifiers:O,data:k,hoverable:R,clickable:j,onOpen:L,onHide:M,isOpen:x,hideOnContentClick:H=!1,hideOnClickOutside:P=!0,hideTimeout:T=150,isPopup:A=!1,isModal:N=!1,modalOverlayClassName:W,modalContainer:_,targetRef:D,hideOnEscape:z}=l,B=e(l,f);const[F,I]=o(null),[K,S]=o(null!==(b=null==D?void 0:D.current)&&void 0!==b?b:null);r((()=>{null!=D&&D.current&&S(null==D?void 0:D.current)}),[D]);const q=E||{},{ContentComponent:G}=q,J=e(q,h),Q=i(null),U=a((()=>{const e=O?{modifiers:O,placement:g}:{placement:g};return e.modifiers=e.modifiers||[],A&&(e.modifiers=[...e.modifiers,{name:"centering",phase:"beforeWrite",enabled:!0,fn:e=>{let{state:n}=e;const l=null==_?void 0:_.getBoundingClientRect(),{width:o,height:r,left:i,top:a}=l||{width:window.innerWidth,height:window.innerHeight,left:0,top:0},s=i+(o-n.elements.popper.clientWidth)/2,u=a+(r-n.elements.popper.clientHeight)/2;return t(t({},n),{},{styles:t(t({},n.styles),{},{popper:t(t({},n.styles.popper),{},{left:"".concat(s,"px"),top:"".concat(u,"px"),transform:"none"})})})}}]),e}),[O,g,A,_]),V=i();r((()=>{var e;let n;return null==Q||null===(e=Q.current)||void 0===e||e.destroy(),K&&F&&(n=d(K,F,t({},U)),Q.current=n),()=>{var e;null===(e=n)||void 0===e||e.destroy(),Q.current=null}}),[F,K,U]);const X=i(),Y=i(-1),Z=s((()=>{var e,t;F&&delete F.dataset.show,N&&null!=se&&se.current&&(se.current.style.visibility="hidden",delete se.current.dataset.show),null==Q||null===(e=Q.current)||void 0===e||e.update(),null==M||M(),null==X||null===(t=X.current)||void 0===t||t.call(X),clearTimeout(Y.current)}),[F,N,M]),$=s((()=>{V.current&&V.current(),V.current=c(Z,T)}),[Z,T]),ee=s((()=>{V.current&&V.current()}),[]),te=s((e=>{var t;("true"===(null==F||null===(t=F.dataset)||void 0===t?void 0:t.show)&&P&&(null==F||!F.contains(e))||null!=F&&F.contains(e)&&H)&&Z()}),[Z,F,H,P]),ne=s((()=>{var e,t;F&&(F.dataset.show="true"),null==Q||null===(e=Q.current)||void 0===e||e.update(),N&&null!=se&&se.current&&(se.current.style.visibility="visible",se.current.dataset.show="true"),null==L||L(),null==X||null===(t=X.current)||void 0===t||t.call(X),clearTimeout(Y.current),Y.current=setTimeout((()=>{X.current=p(K,te)}),250)}),[F,te,N,L,K]),le=s((()=>{var e;"true"===(null==F||null===(e=F.dataset)||void 0===e?void 0:e.show)?Z():ne()}),[F,Z,ne]),oe=s((e=>{z&&e.keyCode===m.Escape&&Z()}),[z,Z]);r((()=>{var e,t;const n=null==K||null===(e=K.addEventListener)||void 0===e?void 0:e.bind(K),l=null==F||null===(t=F.addEventListener)||void 0===t?void 0:t.bind(F);return l&&n&&(R&&(n(v.MouseEnter,ne),l(v.MouseEnter,ee),n(v.MouseLeave,$),l(v.MouseLeave,Z)),j&&n(v.Click,le)),z&&document.addEventListener(v.KeyDown,oe),()=>{var e,t;const n=null==K||null===(e=K.removeEventListener)||void 0===e?void 0:e.bind(K),l=null==F||null===(t=F.removeEventListener)||void 0===t?void 0:t.bind(F);document.removeEventListener(v.KeyDown,oe),V.current&&V.current(),n&&(n(v.Click,le),n(v.MouseEnter,ne),n(v.MouseLeave,$)),l&&(l(v.MouseLeave,Z),l(v.MouseEnter,ee))}}),[K,F,j,R,ne,Z,le,$,ee,z,oe]),r((()=>(!0===x&&ne(),!1===x&&Z(),null==X?void 0:X.current)),[Z,x,ne]);const re="function"==typeof C,ie="function"!=typeof C&&!Array.isArray(C),ae="function"!=typeof C&&Array.isArray(C)&&2===C.filter((e=>!!e)).length,se=i(null);return r((()=>{N&&F&&(F.style.zIndex="2")}),[F,N]),React.createElement(React.Fragment,null,N&&React.createElement("span",{ref:se,style:y.modal,className:W}),!D&&re&&(null==C?void 0:C({forwardedRef:S,data:k})),!D&&ie&&React.createElement("span",{ref:S},C),!ae&&G&&React.createElement(G,n({placement:g,forwardedRef:I,ref:"function"!=typeof G?I:null,data:k,hide:Z,components:J},B)),!D&&ae&&React.createElement("span",{ref:S},C[0]),ae&&(null==C?void 0:C[1])&&"object"==typeof(null==C?void 0:C[1])&&u(C[1],t(t({},null==C||null===(w=C[1])||void 0===w?void 0:w.props),{},{placement:g,forwardedRef:I,ref:I,data:k,hide:Z,components:J},B)))}));b.displayName="Popover";export{b as Popover};
2
2
  //# sourceMappingURL=PopoverLite.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PopoverLite.js","sources":["../../../../../../../../../src/core/ui/components/molecules/popover/PopoverLite.tsx"],"sourcesContent":["\nimport React, { FC, memo, useRef, useEffect, useState, useCallback, useMemo,\n CSSProperties, ReactNode, ReactElement } from 'react'\nimport { createPopper, Instance, ModifierArguments } from '@popperjs/core'\n\nimport { EventName, KeyCode } from '../../../../constants'\nimport { cancelableSetTimeout } from '../../../../utils'\nimport { outsideClickHandler } from '../../../../hooks'\n\nimport { PopoverProps } from './popover.types'\n\n\nconst styles: Record<string, Partial<CSSProperties>> = {\n modal: {\n zIndex: 1,\n position: 'fixed',\n width: '100%',\n height: '100%',\n top: '0',\n left: '0',\n background: 'rgba(0 0 0 / 70%)',\n pointerEvents: 'all',\n userSelect: 'none',\n visibility: 'hidden',\n },\n}\n\nexport const Popover: FC<PopoverProps> = memo<PopoverProps>(\n ({\n children,\n components,\n placement = 'bottom',\n modifiers,\n data,\n hoverable,\n clickable,\n onOpen,\n onHide,\n isOpen,\n hideOnContentClick = false,\n hideOnClickOutside = true,\n hideTimeout = 150,\n isPopup = false,\n isModal = false,\n modalOverlayClassName,\n modalContainer,\n targetRef,\n hideOnEscape,\n ...props\n }: PopoverProps) => {\n const [content, setContent] = useState<HTMLElement | null>(null)\n const [target, setTarget] = useState<HTMLElement | null>(targetRef?.current ?? null)\n\n useEffect(() => {\n if (targetRef?.current) {\n setTarget(targetRef?.current)\n }\n }, [targetRef])\n\n const { ContentComponent, ...contentComponents } = components || {}\n\n const popperInstanceRef = useRef<Instance | null>(null)\n\n const options = useMemo(() => {\n const options = (modifiers ? { modifiers, placement } : { placement })\n\n options.modifiers = options.modifiers || []\n\n if (isPopup) {\n options.modifiers = [\n ...options.modifiers,\n {\n name: 'centering',\n phase: 'beforeWrite',\n enabled: true,\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n fn: ({ state }): Partial<ModifierArguments> => {\n const mcBoundRect = modalContainer?.getBoundingClientRect()\n\n const { width, height, left, top } = mcBoundRect || {\n width: window.innerWidth,\n height: window.innerHeight,\n left: 0,\n top: 0,\n }\n\n const xpos = left + (width - state.elements.popper.clientWidth) / 2\n const ypos = top + (height - state.elements.popper.clientHeight) / 2\n\n return {\n ...state,\n styles: {\n ...state.styles,\n popper: {\n ...state.styles.popper,\n left: `${xpos}px`,\n top: `${ypos}px`,\n transform: 'none',\n },\n },\n }\n },\n },\n ] as PopoverProps['modifiers']\n }\n\n return options\n }, [modifiers, placement, isPopup, modalContainer])\n\n // to save cancelable setTimout\n const pendingHideRef = useRef<(() => void)>()\n\n useEffect(() => {\n popperInstanceRef?.current?.destroy()\n let popperInstance: ReturnType<typeof createPopper>\n\n if (target && content) {\n popperInstance = createPopper(target, content, { ...options })\n\n popperInstanceRef.current = popperInstance\n }\n\n return (): void => {\n popperInstance?.destroy()\n popperInstanceRef.current = null\n }\n }, [content, target, options])\n\n\n const outsideClickUnsubscriber = useRef<() => void | null>()\n const outsideClickUnsubscriberTimeout = useRef<any>(-1)\n\n const hide = useCallback(() => {\n if (content) {\n delete content.dataset.show\n }\n\n if (isModal && modalRef?.current) {\n modalRef.current.style.visibility = 'hidden'\n delete modalRef.current.dataset.show\n }\n\n popperInstanceRef?.current?.update()\n onHide?.()\n outsideClickUnsubscriber?.current?.()\n clearTimeout(outsideClickUnsubscriberTimeout.current)\n }, [content, isModal, onHide])\n\n\n const delayedHide = useCallback(() => {\n pendingHideRef.current && pendingHideRef.current()\n pendingHideRef.current = cancelableSetTimeout(hide, hideTimeout)\n }, [hide, hideTimeout])\n\n const cancelDelayedHide = useCallback(() => {\n pendingHideRef.current && pendingHideRef.current()\n }, [])\n\n const handleOutsideClick = useCallback((eventTarget: HTMLElement | null) => {\n if ((content?.dataset?.show === 'true' && hideOnClickOutside && !content?.contains(eventTarget))\n || (content?.contains(eventTarget) && hideOnContentClick)) {\n hide()\n }\n }, [hide, content, hideOnContentClick, hideOnClickOutside])\n\n const open = useCallback(() => {\n if (content) {\n content.dataset.show = 'true'\n }\n\n popperInstanceRef?.current?.update()\n\n if (isModal && modalRef?.current) {\n modalRef.current.style.visibility = 'visible'\n modalRef.current.dataset.show = 'true'\n }\n\n onOpen?.()\n\n outsideClickUnsubscriber?.current?.()\n clearTimeout(outsideClickUnsubscriberTimeout.current)\n outsideClickUnsubscriberTimeout.current = setTimeout(() => {\n outsideClickUnsubscriber.current = outsideClickHandler(target, handleOutsideClick)\n }, 250)\n }, [content, handleOutsideClick, isModal, onOpen, target])\n\n const toggleOpen = useCallback(() => {\n content?.dataset?.show === 'true' ? hide() : open()\n }, [content, hide, open])\n\n const keydownHandler = useCallback((event: Event) => {\n if (hideOnEscape && (event as unknown as KeyboardEvent).keyCode === KeyCode.Escape) {\n hide()\n }\n }, [hideOnEscape, hide])\n\n useEffect(() => {\n if (!hoverable && !clickable) {\n console.error('Popover component should have at least one of props [\"hoverable\", \"clickable\"]')\n }\n\n const targetAddListener = target?.addEventListener?.bind(target)\n const contentAddListener = content?.addEventListener?.bind(content)\n\n if (contentAddListener && targetAddListener) {\n if (hoverable) {\n targetAddListener(EventName.MouseEnter, open)\n contentAddListener(EventName.MouseEnter, cancelDelayedHide)\n targetAddListener(EventName.MouseLeave, delayedHide)\n contentAddListener(EventName.MouseLeave, hide)\n }\n\n if (clickable) {\n targetAddListener(EventName.Click, toggleOpen)\n }\n }\n\n if (hideOnEscape) {\n document.addEventListener(EventName.KeyDown, keydownHandler)\n }\n\n return (): void => {\n const targetRemoveListener = target?.removeEventListener?.bind(target)\n const contentRemoveListener = content?.removeEventListener?.bind(content)\n\n document.removeEventListener(EventName.KeyDown, keydownHandler)\n\n pendingHideRef.current && pendingHideRef.current()\n\n if (targetRemoveListener) {\n targetRemoveListener(EventName.Click, toggleOpen)\n targetRemoveListener(EventName.MouseEnter, open)\n targetRemoveListener(EventName.MouseLeave, delayedHide)\n }\n if (contentRemoveListener) {\n contentRemoveListener(EventName.MouseLeave, hide)\n contentRemoveListener(EventName.MouseEnter, cancelDelayedHide)\n }\n }\n }, [target, content, clickable, hoverable,\n open, hide, toggleOpen, delayedHide, cancelDelayedHide, hideOnEscape, keydownHandler])\n\n // open, hide based on external isOpen\n useEffect(() => {\n if (isOpen === true) {\n open()\n }\n if (isOpen === false) {\n hide()\n }\n return outsideClickUnsubscriber?.current as () => void\n }, [hide, isOpen, open])\n\n const childrenIsFunction = typeof children === 'function'\n const childrenIsElement = typeof children !== 'function' && !Array.isArray(children)\n const childrenAreElements = typeof children !== 'function' && Array.isArray(children)\n && children.filter((child: ReactNode) => !!child).length === 2\n\n // modal\n const modalRef = useRef<HTMLDivElement | null>(null)\n\n useEffect(() => {\n if (isModal && content) {\n content.style.zIndex = '2'\n }\n }, [content, isModal])\n\n return (\n <>\n {isModal && <span ref={modalRef} style={styles.modal} className={modalOverlayClassName} />}\n {(!targetRef && childrenIsFunction) && children?.({ forwardedRef: setTarget, data })}\n {(!targetRef && childrenIsElement) && <span ref={setTarget}>{children}</span>}\n {!childrenAreElements && ContentComponent && (\n <ContentComponent\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n placement={placement}\n forwardedRef={setContent}\n ref={typeof ContentComponent !== 'function' ? setContent : null}\n data={data}\n hide={hide}\n components={contentComponents as { [key: string]: FC | React.Component<any> }}\n {...props}\n />\n )}\n {(!targetRef && childrenAreElements) && <span ref={setTarget}>{children[0]}</span>}\n {(childrenAreElements && children?.[1] && typeof children?.[1] === 'object')\n && React.cloneElement(children[1] as ReactElement, {\n ...((children?.[1] as ReactElement)?.props),\n placement,\n forwardedRef: setContent,\n // ...(typeof children[1] !== 'function' ? { ref: setContent } : {}),\n ref: setContent,\n data,\n hide,\n components: contentComponents as { [key: string]: FC | React.Component<any> },\n ...props,\n })}\n </>\n )\n },\n)\n\nPopover.displayName = 'Popover'\n"],"names":["styles","modal","zIndex","position","width","height","top","left","background","pointerEvents","userSelect","visibility","Popover","memo","_ref","_targetRef$current","_children$","children","components","placement","modifiers","data","hoverable","clickable","onOpen","onHide","isOpen","hideOnContentClick","hideOnClickOutside","hideTimeout","isPopup","isModal","modalOverlayClassName","modalContainer","targetRef","hideOnEscape","props","_objectWithoutProperties","_excluded","content","setContent","useState","target","setTarget","current","useEffect","_ref2","ContentComponent","contentComponents","_excluded2","popperInstanceRef","useRef","options","useMemo","name","phase","enabled","fn","_ref3","state","mcBoundRect","getBoundingClientRect","window","innerWidth","innerHeight","xpos","elements","popper","clientWidth","ypos","clientHeight","_objectSpread","concat","transform","pendingHideRef","_popperInstanceRef$cu","popperInstance","destroy","createPopper","_popperInstance","outsideClickUnsubscriber","outsideClickUnsubscriberTimeout","hide","useCallback","_popperInstanceRef$cu2","_outsideClickUnsubscr","dataset","show","modalRef","style","update","call","clearTimeout","delayedHide","cancelableSetTimeout","cancelDelayedHide","handleOutsideClick","eventTarget","_content$dataset","contains","open","_popperInstanceRef$cu3","_outsideClickUnsubscr2","setTimeout","outsideClickHandler","toggleOpen","_content$dataset2","keydownHandler","event","keyCode","KeyCode","Escape","_target$addEventListe","_content$addEventList","targetAddListener","addEventListener","bind","contentAddListener","EventName","MouseEnter","MouseLeave","Click","document","KeyDown","_target$removeEventLi","_content$removeEventL","targetRemoveListener","removeEventListener","contentRemoveListener","childrenIsFunction","childrenIsElement","Array","isArray","childrenAreElements","filter","child","length","React","createElement","Fragment","ref","className","forwardedRef","_extends","cloneElement","displayName"],"mappings":"86BAYMA,EAAiD,CACrDC,MAAO,CACLC,OAAQ,EACRC,SAAU,QACVC,MAAO,OACPC,OAAQ,OACRC,IAAK,IACLC,KAAM,IACNC,WAAY,oBACZC,cAAe,MACfC,WAAY,OACZC,WAAY,WAIHC,EAA4BC,GACvCC,I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oH,GAA0C,mBAAbpH,GAA2BkH,MAAMC,QAAQnH,IACb,IAA1DA,EAASqH,QAAQC,KAAuBA,IAAOC,OAG9ChD,GAAWrC,EAA8B,MAQ/C,OANAN,GAAU,KACJd,GAAWQ,IACbA,EAAQkD,MAAMvF,OAAS,IACzB,GACC,CAACqC,EAASR,IAGX0G,EAAAC,cAAAD,EAAAE,SAAA,KACG5G,GAAW0G,EAAAC,cAAA,OAAA,CAAME,IAAKpD,GAAUC,MAAOzF,EAAOC,MAAO4I,UAAW7G,KAC9DE,GAAa+F,KAAuBhH,aAAAA,EAAAA,EAAW,CAAE6H,aAAcnG,EAAWtB,WAC1Ea,GAAagG,IAAsBO,EAAAC,cAAA,OAAA,CAAME,IAAKjG,GAAY1B,IAC3DoH,IAAuBtF,GACzB0F,EAAAC,cAAC3F,EAECgG,EAAA,CACA5H,UAAWA,EACX2H,aAActG,EACdoG,IAAiC,mBAArB7F,EAAkCP,EAAa,KAC3DnB,KAAMA,EACN6D,KAAMA,EACNhE,WAAY8B,GACRZ,KAGHF,GAAamG,IAAwBI,EAAAC,cAAA,OAAA,CAAME,IAAKjG,GAAY1B,EAAS,IACtEoH,KAAuBpH,aAAAA,EAAAA,EAAW,KAA+B,iBAAlBA,aAAQ,EAARA,EAAW,KACzDwH,EAAMO,aAAa/H,EAAS,GAAEsD,EAAAA,EAC1BtD,CAAAA,EAAAA,SAAa,QAALD,EAARC,EAAW,UAAE,IAAAD,OAAA,EAAdA,EAAiCoB,OAAK,CAAA,EAAA,CAC1CjB,YACA2H,aAActG,EAEdoG,IAAKpG,EACLnB,OACA6D,OACAhE,WAAY8B,GACTZ,IAEJ,IAKTxB,EAAQqI,YAAc"}
1
+ {"version":3,"file":"PopoverLite.js","sources":["../../../../../../../../../src/core/ui/components/molecules/popover/PopoverLite.tsx"],"sourcesContent":["\nimport { FC, memo, useRef, useEffect, useState, useCallback, useMemo, cloneElement,\n CSSProperties, ReactNode, ReactElement, Component } from 'react'\nimport { createPopper, Instance, ModifierArguments } from '@popperjs/core'\n\nimport { EventName, KeyCode } from '../../../../constants'\nimport { cancelableSetTimeout } from '../../../../utils'\nimport { outsideClickHandler } from '../../../../hooks'\n\nimport { PopoverProps } from './popover.types'\n\n\nconst styles: Record<string, Partial<CSSProperties>> = {\n modal: {\n zIndex: 1,\n position: 'fixed',\n width: '100%',\n height: '100%',\n top: '0',\n left: '0',\n background: 'rgba(0 0 0 / 70%)',\n pointerEvents: 'all',\n userSelect: 'none',\n visibility: 'hidden',\n },\n}\n\nexport const Popover: FC<PopoverProps> = memo<PopoverProps>(\n ({\n children,\n components,\n placement = 'bottom',\n modifiers,\n data,\n hoverable,\n clickable,\n onOpen,\n onHide,\n isOpen,\n hideOnContentClick = false,\n hideOnClickOutside = true,\n hideTimeout = 150,\n isPopup = false,\n isModal = false,\n modalOverlayClassName,\n modalContainer,\n targetRef,\n hideOnEscape,\n ...props\n }: PopoverProps) => {\n const [content, setContent] = useState<HTMLElement | null>(null)\n const [target, setTarget] = useState<HTMLElement | null>(targetRef?.current ?? null)\n\n useEffect(() => {\n if (targetRef?.current) {\n setTarget(targetRef?.current)\n }\n }, [targetRef])\n\n const { ContentComponent, ...contentComponents } = components || {}\n\n const popperInstanceRef = useRef<Instance | null>(null)\n\n const options = useMemo(() => {\n const options = (modifiers ? { modifiers, placement } : { placement })\n\n options.modifiers = options.modifiers || []\n\n if (isPopup) {\n options.modifiers = [\n ...options.modifiers,\n {\n name: 'centering',\n phase: 'beforeWrite',\n enabled: true,\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n fn: ({ state }): Partial<ModifierArguments> => {\n const mcBoundRect = modalContainer?.getBoundingClientRect()\n\n const { width, height, left, top } = mcBoundRect || {\n width: window.innerWidth,\n height: window.innerHeight,\n left: 0,\n top: 0,\n }\n\n const xpos = left + (width - state.elements.popper.clientWidth) / 2\n const ypos = top + (height - state.elements.popper.clientHeight) / 2\n\n return {\n ...state,\n styles: {\n ...state.styles,\n popper: {\n ...state.styles.popper,\n left: `${xpos}px`,\n top: `${ypos}px`,\n transform: 'none',\n },\n },\n }\n },\n },\n ] as PopoverProps['modifiers']\n }\n\n return options\n }, [modifiers, placement, isPopup, modalContainer])\n\n // to save cancelable setTimout\n const pendingHideRef = useRef<(() => void)>()\n\n useEffect(() => {\n popperInstanceRef?.current?.destroy()\n let popperInstance: ReturnType<typeof createPopper>\n\n if (target && content) {\n popperInstance = createPopper(target, content, { ...options })\n\n popperInstanceRef.current = popperInstance\n }\n\n return (): void => {\n popperInstance?.destroy()\n popperInstanceRef.current = null\n }\n }, [content, target, options])\n\n\n const outsideClickUnsubscriber = useRef<() => void | null>()\n const outsideClickUnsubscriberTimeout = useRef<any>(-1)\n\n const hide = useCallback(() => {\n if (content) {\n delete content.dataset.show\n }\n\n if (isModal && modalRef?.current) {\n modalRef.current.style.visibility = 'hidden'\n delete modalRef.current.dataset.show\n }\n\n popperInstanceRef?.current?.update()\n onHide?.()\n outsideClickUnsubscriber?.current?.()\n clearTimeout(outsideClickUnsubscriberTimeout.current)\n }, [content, isModal, onHide])\n\n\n const delayedHide = useCallback(() => {\n pendingHideRef.current && pendingHideRef.current()\n pendingHideRef.current = cancelableSetTimeout(hide, hideTimeout)\n }, [hide, hideTimeout])\n\n const cancelDelayedHide = useCallback(() => {\n pendingHideRef.current && pendingHideRef.current()\n }, [])\n\n const handleOutsideClick = useCallback((eventTarget: HTMLElement | null) => {\n if ((content?.dataset?.show === 'true' && hideOnClickOutside && !content?.contains(eventTarget))\n || (content?.contains(eventTarget) && hideOnContentClick)) {\n hide()\n }\n }, [hide, content, hideOnContentClick, hideOnClickOutside])\n\n const open = useCallback(() => {\n if (content) {\n content.dataset.show = 'true'\n }\n\n popperInstanceRef?.current?.update()\n\n if (isModal && modalRef?.current) {\n modalRef.current.style.visibility = 'visible'\n modalRef.current.dataset.show = 'true'\n }\n\n onOpen?.()\n\n outsideClickUnsubscriber?.current?.()\n clearTimeout(outsideClickUnsubscriberTimeout.current)\n outsideClickUnsubscriberTimeout.current = setTimeout(() => {\n outsideClickUnsubscriber.current = outsideClickHandler(target, handleOutsideClick)\n }, 250)\n }, [content, handleOutsideClick, isModal, onOpen, target])\n\n const toggleOpen = useCallback(() => {\n content?.dataset?.show === 'true' ? hide() : open()\n }, [content, hide, open])\n\n const keydownHandler = useCallback((event: Event) => {\n if (hideOnEscape && (event as unknown as KeyboardEvent).keyCode === KeyCode.Escape) {\n hide()\n }\n }, [hideOnEscape, hide])\n\n useEffect(() => {\n if (!hoverable && !clickable) {\n console.error('Popover component should have at least one of props [\"hoverable\", \"clickable\"]')\n }\n\n const targetAddListener = target?.addEventListener?.bind(target)\n const contentAddListener = content?.addEventListener?.bind(content)\n\n if (contentAddListener && targetAddListener) {\n if (hoverable) {\n targetAddListener(EventName.MouseEnter, open)\n contentAddListener(EventName.MouseEnter, cancelDelayedHide)\n targetAddListener(EventName.MouseLeave, delayedHide)\n contentAddListener(EventName.MouseLeave, hide)\n }\n\n if (clickable) {\n targetAddListener(EventName.Click, toggleOpen)\n }\n }\n\n if (hideOnEscape) {\n document.addEventListener(EventName.KeyDown, keydownHandler)\n }\n\n return (): void => {\n const targetRemoveListener = target?.removeEventListener?.bind(target)\n const contentRemoveListener = content?.removeEventListener?.bind(content)\n\n document.removeEventListener(EventName.KeyDown, keydownHandler)\n\n pendingHideRef.current && pendingHideRef.current()\n\n if (targetRemoveListener) {\n targetRemoveListener(EventName.Click, toggleOpen)\n targetRemoveListener(EventName.MouseEnter, open)\n targetRemoveListener(EventName.MouseLeave, delayedHide)\n }\n if (contentRemoveListener) {\n contentRemoveListener(EventName.MouseLeave, hide)\n contentRemoveListener(EventName.MouseEnter, cancelDelayedHide)\n }\n }\n }, [target, content, clickable, hoverable,\n open, hide, toggleOpen, delayedHide, cancelDelayedHide, hideOnEscape, keydownHandler])\n\n // open, hide based on external isOpen\n useEffect(() => {\n if (isOpen === true) {\n open()\n }\n if (isOpen === false) {\n hide()\n }\n return outsideClickUnsubscriber?.current as () => void\n }, [hide, isOpen, open])\n\n const childrenIsFunction = typeof children === 'function'\n const childrenIsElement = typeof children !== 'function' && !Array.isArray(children)\n const childrenAreElements = typeof children !== 'function' && Array.isArray(children)\n && children.filter((child: ReactNode) => !!child).length === 2\n\n // modal\n const modalRef = useRef<HTMLDivElement | null>(null)\n\n useEffect(() => {\n if (isModal && content) {\n content.style.zIndex = '2'\n }\n }, [content, isModal])\n\n return (\n <>\n {isModal && <span ref={modalRef} style={styles.modal} className={modalOverlayClassName} />}\n {(!targetRef && childrenIsFunction) && children?.({ forwardedRef: setTarget, data })}\n {(!targetRef && childrenIsElement) && <span ref={setTarget}>{children}</span>}\n {!childrenAreElements && ContentComponent && (\n <ContentComponent\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n placement={placement}\n forwardedRef={setContent}\n ref={typeof ContentComponent !== 'function' ? setContent : null}\n data={data}\n hide={hide}\n components={contentComponents as { [key: string]: FC | Component<any> }}\n {...props}\n />\n )}\n {(!targetRef && childrenAreElements) && <span ref={setTarget}>{children[0]}</span>}\n {(childrenAreElements && children?.[1] && typeof children?.[1] === 'object')\n && cloneElement(children[1] as ReactElement, {\n ...((children?.[1] as ReactElement)?.props),\n placement,\n forwardedRef: setContent,\n // ...(typeof children[1] !== 'function' ? { ref: setContent } : {}),\n ref: setContent,\n data,\n hide,\n components: contentComponents as { [key: string]: FC | Component<any> },\n ...props,\n })}\n </>\n )\n },\n)\n\nPopover.displayName = 'Popover'\n"],"names":["styles","modal","zIndex","position","width","height","top","left","background","pointerEvents","userSelect","visibility","Popover","memo","_ref","_targetRef$current","_children$","children","components","placement","modifiers","data","hoverable","clickable","onOpen","onHide","isOpen","hideOnContentClick","hideOnClickOutside","hideTimeout","isPopup","isModal","modalOverlayClassName","modalContainer","targetRef","hideOnEscape","props","_objectWithoutProperties","_excluded","content","setContent","useState","target","setTarget","current","useEffect","_ref2","ContentComponent","contentComponents","_excluded2","popperInstanceRef","useRef","options","useMemo","name","phase","enabled","fn","_ref3","state","mcBoundRect","getBoundingClientRect","window","innerWidth","innerHeight","xpos","elements","popper","clientWidth","ypos","clientHeight","_objectSpread","concat","transform","pendingHideRef","_popperInstanceRef$cu","popperInstance","destroy","createPopper","_popperInstance","outsideClickUnsubscriber","outsideClickUnsubscriberTimeout","hide","useCallback","_popperInstanceRef$cu2","_outsideClickUnsubscr","dataset","show","modalRef","style","update","call","clearTimeout","delayedHide","cancelableSetTimeout","cancelDelayedHide","handleOutsideClick","eventTarget","_content$dataset","contains","open","_popperInstanceRef$cu3","_outsideClickUnsubscr2","setTimeout","outsideClickHandler","toggleOpen","_content$dataset2","keydownHandler","event","keyCode","KeyCode","Escape","_target$addEventListe","_content$addEventList","targetAddListener","addEventListener","bind","contentAddListener","EventName","MouseEnter","MouseLeave","Click","document","KeyDown","_target$removeEventLi","_content$removeEventL","targetRemoveListener","removeEventListener","contentRemoveListener","childrenIsFunction","childrenIsElement","Array","isArray","childrenAreElements","filter","child","length","React","createElement","Fragment","ref","className","forwardedRef","_extends","cloneElement","displayName"],"mappings":"67BAYMA,EAAiD,CACrDC,MAAO,CACLC,OAAQ,EACRC,SAAU,QACVC,MAAO,OACPC,OAAQ,OACRC,IAAK,IACLC,KAAM,IACNC,WAAY,oBACZC,cAAe,MACfC,WAAY,OACZC,WAAY,WAIHC,EAA4BC,GACvCC,IAqBoB,IAAAC,EAAAC,EAAA,IArBnBC,SACCA,EAAQC,WACRA,EAAUC,UACVA,EAAY,SAAQC,UACpBA,EAASC,KACTA,EAAIC,UACJA,EAASC,UACTA,EAASC,OACTA,EAAMC,OACNA,EAAMC,OACNA,EAAMC,mBACNA,GAAqB,EAAKC,mBAC1BA,GAAqB,EAAIC,YACzBA,EAAc,IAAGC,QACjBA,GAAU,EAAKC,QACfA,GAAU,EAAKC,sBACfA,EAAqBC,eACrBA,EAAcC,UACdA,EAASC,aACTA,GAEarB,EADVsB,EAAKC,EAAAvB,EAAAwB,GAER,MAAOC,EAASC,GAAcC,EAA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