How to use the @material/drawer/dist/mdc.drawer.MDCTemporaryDrawerFoundation function in @material/drawer

To help you get started, we’ve selected a few @material/drawer 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 gutenye / react-mc / src / Drawer / TemporaryDrawer / TemporaryDrawer.js View on Github external
getDefaultFoundation() {
    this.drawer = this.root_.querySelector(
      MDCTemporaryDrawerFoundation.strings.DRAWER_SELECTOR
    )
    const {
      FOCUSABLE_ELEMENTS,
      OPACITY_VAR_NAME,
    } = MDCTemporaryDrawerFoundation.strings
    // prettier-ignore
    return new MDCTemporaryDrawerFoundation({
      addClass: helper.addClass('rootProps', this),
      removeClass: helper.removeClass('rootProps', this),
      hasClass: helper.hasClass('rootProps', this),
      addBodyClass: helper.addClass(document.body),
      removeBodyClass: helper.removeClass(document.body),
      hasNecessaryDom: () => Boolean(this.drawer),
      registerInteractionHandler: (evt, handler) =>
          this.root_.addEventListener(util.remapEvent(evt), handler, util.applyPassive()),
      deregisterInteractionHandler: (evt, handler) =>
          this.root_.removeEventListener(util.remapEvent(evt), handler, util.applyPassive()),
      registerDrawerInteractionHandler: (evt, handler) =>
          this.drawer.addEventListener(util.remapEvent(evt), handler),
      deregisterDrawerInteractionHandler: (evt, handler) =>
          this.drawer.removeEventListener(util.remapEvent(evt), handler),
      registerTransitionEndHandler: helper.registerHandler('drawerProps', this, 'transitionend'),
      deregisterTransitionEndHandler: helper.deregisterHandler('drawerProps', this, 'transitionend'),
github react-mdc / react-material-components-web / packages / drawer / src / Temporary / Container.tsx View on Github external
constructor(props) {
        super(props);
        this.adapter = new FoundationAdapter();
        this.foundation = new MDCTemporaryDrawerFoundation(this.adapter.toObject());
    }
github react-mdc / react-material-components-web / packages / drawer / src / temporary / container.js View on Github external
constructor (props: Props<p>) {
    super(props);
    this.adapter = new FoundationAdapter(this);
    this.foundation = new MDCTemporaryDrawerFoundation(this.adapter.toObject());
  }
</p>