UNPKG

@legion-ui-kit/react-core

Version:

<div align="center"> <img height="108" width="116" src="https://legion.digitaltelkom.id/favicon.svg?v=4643a71fb65fa61a5f2b266b769ea7b1" /> <h1 align="center">Legion UI Kit - React Core</h1> </div>

1 lines 1.28 kB
{"version":3,"file":"Select.helper.cjs","sources":["../../../../src/components/Select/Select.helper.ts"],"sourcesContent":["// Constants\r\nimport { SELECT_OPTION_ROOT_ID } from './Select.constant'\r\n\r\nexport const getPortalRoot = (element: HTMLElement): HTMLElement => {\r\n const doc = element.ownerDocument;\r\n\r\n let root = doc.getElementById('legion-select-portal-root') as HTMLElement | null;\r\n\r\n if (!root) {\r\n root = doc.createElement('div');\r\n root.id = SELECT_OPTION_ROOT_ID;\r\n root.style.position = 'fixed';\r\n root.style.top = '0';\r\n root.style.left = '0';\r\n root.style.width = '100%';\r\n root.style.height = '0';\r\n root.style.zIndex = '999999';\r\n doc.body.appendChild(root);\r\n }\r\n\r\n return root;\r\n}\r\n"],"names":["element","doc","ownerDocument","root","getElementById","createElement","id","SELECT_OPTION_ROOT_ID","style","position","top","left","width","height","zIndex","body","appendChild"],"mappings":"0EAG8BA,IAC5B,MAAMC,EAAMD,EAAQE,cAEpB,IAAIC,EAAOF,EAAIG,eAAe,6BAc9B,OAZKD,IACHA,EAAOF,EAAII,cAAc,OACzBF,EAAKG,GAAKC,EAAAA,sBACVJ,EAAKK,MAAMC,SAAW,QACtBN,EAAKK,MAAME,IAAM,IACjBP,EAAKK,MAAMG,KAAO,IAClBR,EAAKK,MAAMI,MAAQ,OACnBT,EAAKK,MAAMK,OAAS,IACpBV,EAAKK,MAAMM,OAAS,SACpBb,EAAIc,KAAKC,YAAYb,IAGhBA"}