UNPKG

1.04 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3/**
4 * Sets the current RTL value.
5 */
6function setRTL(isRTL) {
7 if (_rtl !== isRTL) {
8 _rtl = isRTL;
9 }
10}
11exports.setRTL = setRTL;
12/**
13 * Gets the current RTL value.
14 */
15function getRTL() {
16 if (_rtl === undefined) {
17 _rtl =
18 typeof document !== 'undefined' &&
19 !!document.documentElement &&
20 document.documentElement.getAttribute('dir') === 'rtl';
21 }
22 return _rtl;
23}
24exports.getRTL = getRTL;
25// This has been split into 2 lines because it was working in Fabric due to the code being transpiled to es5, so this
26// was converted to var while not working in Fluent that uses babel to transpile the code to be es6-like. Splitting the
27// logic into two lines, however, allows it to work in both scenarios.
28var _rtl;
29_rtl = getRTL();
30function getStyleOptions() {
31 return {
32 rtl: getRTL(),
33 };
34}
35exports.getStyleOptions = getStyleOptions;
36//# sourceMappingURL=StyleOptionsState.js.map
\No newline at end of file