UNPKG

1.58 kBSource Map (JSON)View Raw
1{"version":3,"file":"StyleOptionsState.js","sourceRoot":"../src/","sources":["StyleOptionsState.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,MAAM,CAAC,KAAc;IACnC,IAAI,IAAI,KAAK,KAAK,EAAE;QAClB,IAAI,GAAG,KAAK,CAAC;KACd;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,MAAM;IACpB,IAAI,IAAI,KAAK,SAAS,EAAE;QACtB,IAAI;YACF,OAAO,QAAQ,KAAK,WAAW;gBAC/B,CAAC,CAAC,QAAQ,CAAC,eAAe;gBAC1B,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC;KAC1D;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,qHAAqH;AACrH,uHAAuH;AACvH,sEAAsE;AACtE,IAAI,IAAa,CAAC;AAClB,IAAI,GAAG,MAAM,EAAE,CAAC;AAEhB,MAAM,UAAU,eAAe;IAC7B,OAAO;QACL,GAAG,EAAE,MAAM,EAAE;KACd,CAAC;AACJ,CAAC","sourcesContent":["import { IStyleOptions } from './IStyleOptions';\n\n/**\n * Sets the current RTL value.\n */\nexport function setRTL(isRTL: boolean): void {\n if (_rtl !== isRTL) {\n _rtl = isRTL;\n }\n}\n\n/**\n * Gets the current RTL value.\n */\nexport function getRTL(): boolean {\n if (_rtl === undefined) {\n _rtl =\n typeof document !== 'undefined' &&\n !!document.documentElement &&\n document.documentElement.getAttribute('dir') === 'rtl';\n }\n return _rtl;\n}\n\n// This has been split into 2 lines because it was working in Fabric due to the code being transpiled to es5, so this\n// was converted to var while not working in Fluent that uses babel to transpile the code to be es6-like. Splitting the\n// logic into two lines, however, allows it to work in both scenarios.\nlet _rtl: boolean;\n_rtl = getRTL();\n\nexport function getStyleOptions(): IStyleOptions {\n return {\n rtl: getRTL(),\n };\n}\n"]}
\No newline at end of file