UNPKG

grid-layout-plus-no-pnpm

Version:

<p align="center"> <a href="https://grid-layout-plus.netlify.app/" target="_blank" rel="noopener noreferrer"> <img src="./docs/public/grid-layout-plus.svg" width="180" style="width: 120px;" /> </a> </p>

1 lines 1 kB
{"version":3,"file":"dom.mjs","sources":["../../src/helpers/dom.ts"],"sourcesContent":["let currentDir: 'ltr' | 'rtl' | 'auto' = 'auto'\r\n\r\nfunction hasDocument() {\r\n return typeof document !== 'undefined'\r\n}\r\n\r\nexport function getDocumentDir() {\r\n if (!hasDocument()) {\r\n return currentDir\r\n }\r\n const direction =\r\n typeof document.dir !== 'undefined'\r\n ? document.dir\r\n : document.getElementsByTagName('html')[0].getAttribute('dir')\r\n return direction\r\n}\r\n\r\nexport function setDocumentDir(dir: 'ltr' | 'rtl' | 'auto') {\r\n if (!hasDocument()) {\r\n currentDir = dir\r\n return\r\n }\r\n\r\n const html = document.getElementsByTagName('html')[0]\r\n html.setAttribute('dir', dir)\r\n}\r\n"],"names":["currentDir","hasDocument","getDocumentDir"],"mappings":"AAAA,IAAIA,IAAqC;AAEzC,SAASC,IAAc;AACrB,SAAO,OAAO,WAAa;AAC7B;AAEO,SAASC,IAAiB;AAC3B,SAACD,MAIH,OAAO,SAAS,MAAQ,MACpB,SAAS,MACT,SAAS,qBAAqB,MAAM,EAAE,CAAC,EAAE,aAAa,KAAK,IALxDD;AAOX;"}