How to use the @uifabric/utilities.getRTL function in @uifabric/utilities

To help you get started, we’ve selected a few @uifabric/utilities examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OfficeDev / office-ui-fabric-react / packages / date-time / src / components / WeeklyDayPicker / WeeklyDayPicker.base.tsx View on Github external
private _onTouchMove = (ev: React.TouchEvent) => {
    const isRtl = getRTL();
    const touch = ev.touches[0];
    if (touch && this._initialTouchX !== undefined && touch.clientX !== this._initialTouchX) {
      if ((touch.clientX - this._initialTouchX) * (isRtl ? -1 : 1) < 0) {
        // swipe right
        this._onSelectNextDateRange();
      } else {
        // swipe left
        this._onSelectPrevDateRange();
      }
      this._initialTouchX = undefined;
    }
  };
}
github OfficeDev / office-ui-fabric-react / packages / date-time / src / components / Calendar / CalendarMonth / CalendarMonth.base.tsx View on Github external
<button type="button" title="{" disabled="{!allFocusable">
              
            </button>
          
        
        
          <div role="grid">
            {rowIndexes.map((rowNum: number) =&gt; {
              const monthsForRow = strings.shortMonths.slice(rowNum * MONTHS_PER_ROW, (rowNum + 1) * MONTHS_PER_ROW);
              return (
                <div role="row">
                  {monthsForRow.map((month: string, index: number) =&gt; {
                    const monthIndex = rowNum * MONTHS_PER_ROW + index;
                    const indexedMonth = setMonth(navigatedDate, monthIndex);
                    const isCurrentMonth = this._isCurrentMonth(monthIndex, navigatedDate.getFullYear(), today!);
                    const isNavigatedMonth = navigatedDate.getMonth() === monthIndex;
                    const isSelectedMonth = selectedDate.getMonth() === monthIndex;
                    const isSelectedYear = selectedDate.getFullYear() === navigatedDate.getFullYear();</div></div>
github OfficeDev / office-ui-fabric-react / packages / date-time / src / components / CalendarDayGrid / CalendarDayGrid.base.tsx View on Github external
const roundedTopLeft = !above && !left;
    const roundedTopRight = !above && !right;
    const roundedBottomLeft = !below && !left;
    const roundedBottomRight = !below && !right;

    if (roundedTopLeft) {
      style = getRTL() ? style.concat(classNames.topRightCornerDate + ' ') : style.concat(classNames.topLeftCornerDate + ' ');
    }
    if (roundedTopRight) {
      style = getRTL() ? style.concat(classNames.topLeftCornerDate + ' ') : style.concat(classNames.topRightCornerDate + ' ');
    }
    if (roundedBottomLeft) {
      style = getRTL() ? style.concat(classNames.bottomRightCornerDate + ' ') : style.concat(classNames.bottomLeftCornerDate + ' ');
    }
    if (roundedBottomRight) {
      style = getRTL() ? style.concat(classNames.bottomLeftCornerDate + ' ') : style.concat(classNames.bottomRightCornerDate + ' ');
    }

    return style;
  }
github microsoft / fluent-ui-react / src / components / FocusZone / FocusZone.tsx View on Github external
private moveFocusRight(): boolean {
    const shouldWrap = this.shouldWrapFocus(this._activeElement as HTMLElement, NO_HORIZONTAL_WRAP)
    if (
      this.moveFocus(
        !getRTL(),
        (activeRect: ClientRect, targetRect: ClientRect) =&gt; {
          let distance = -1

          if (
            targetRect.top &lt; activeRect.bottom &amp;&amp;
            targetRect.left &gt;= activeRect.left &amp;&amp;
            this.props.direction !== FocusZoneDirection.vertical
          ) {
            distance = targetRect.left - activeRect.left
          } else if (!shouldWrap) {
            distance = LARGE_NEGATIVE_DISTANCE_FROM_CENTER
          }

          return distance
        },
        undefined /*ev*/,
github microsoft / fluent-ui-react / src / components / FocusZone / FocusZone.tsx View on Github external
private moveFocusLeft(): boolean {
    const shouldWrap = this.shouldWrapFocus(this._activeElement as HTMLElement, NO_HORIZONTAL_WRAP)
    if (
      this.moveFocus(
        getRTL(),
        (activeRect: ClientRect, targetRect: ClientRect) =&gt; {
          let distance = -1

          if (
            targetRect.bottom &gt; activeRect.top &amp;&amp;
            targetRect.right &lt;= activeRect.right &amp;&amp;
            this.props.direction !== FocusZoneDirection.vertical
          ) {
            distance = activeRect.right - targetRect.right
          } else {
            if (!shouldWrap) {
              distance = LARGE_NEGATIVE_DISTANCE_FROM_CENTER
            }
          }

          return distance
github OfficeDev / office-ui-fabric-react / packages / office-ui-fabric-react / src / components / Slider / Slider.styles.ts View on Github external
boxSizing: 'border-box',
        background: thumbBackgroundColor,
        display: 'block',
        width: 16,
        height: 16,
        position: 'absolute'
      },
      vertical
        ? {
            left: -6,
            margin: '0 auto',
            transform: 'translateY(8px)'
          }
        : {
            top: -6,
            transform: getRTL(theme) ? 'translateX(50%)' : 'translateX(-50%)'
          },
      showTransitions && {
        transition: `left ${AnimationVariables.durationValue3} ${AnimationVariables.easeFunction1}`
      },
      disabled && {
        borderColor: thumbDisabledBorderColor,
        selectors: {
          [HighContrastSelector]: {
            borderColor: 'GrayText'
          }
        }
      }
    ],
    line: [
      classNames.line,
      {