How to use the @material/dialog.MDCDialogFoundation.strings function in @material/dialog

To help you get started, we’ve selected a few @material/dialog 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 fintechstudios / angularjs-mdc / src / mdc-dialog / service / $mdcDialog.js View on Github external
function addEventListeners(controller, options) {
      options.onAcceptHandler = (e) => {
        e.stopPropagation();
        $mdcDialog.hide(controller ? controller.result : undefined);
      };
      options.onCancelHandler = (e) => {
        e.stopPropagation();
        $mdcDialog.cancel();
      };

      options.mdcDialog.listen(MDCDialogFoundation.strings.ACCEPT_EVENT, options.onAcceptHandler);
      options.mdcDialog.listen(MDCDialogFoundation.strings.CANCEL_EVENT, options.onCancelHandler);
    }
github jamesmfriedman / rmwc / src / dialog / index.tsx View on Github external
getActionFromEvent: (evt: React.SyntheticEvent & Event) => {
        const element = closest(
          evt.target,
          `[${MDCDialogFoundation.strings.ACTION_ATTRIBUTE}]`
        );
        return (
          element &&
          element.getAttribute(MDCDialogFoundation.strings.ACTION_ATTRIBUTE)
        );
      },
      clickDefaultButton: () => {
github jamesmfriedman / rmwc / src / dialog / index.tsx View on Github external
getActionFromEvent: (evt: React.SyntheticEvent & Event) => {
        const element = closest(
          evt.target,
          `[${MDCDialogFoundation.strings.ACTION_ATTRIBUTE}]`
        );
        return (
          element &&
          element.getAttribute(MDCDialogFoundation.strings.ACTION_ATTRIBUTE)
        );
      },
      clickDefaultButton: () => {
github jamesmfriedman / rmwc / src / dialog / dialog.tsx View on Github external
componentDidMount() {
    super.componentDidMount();
    this.container =
      this.root.ref &&
      this.root.ref.querySelector(
        MDCDialogFoundation.strings.CONTAINER_SELECTOR
      );
    this.content =
      this.root.ref &&
      this.root.ref.querySelector(MDCDialogFoundation.strings.CONTENT_SELECTOR);
    this.buttons =
      this.root.ref &&
      [].slice.call(
        this.root.ref.querySelectorAll(
          MDCDialogFoundation.strings.BUTTON_SELECTOR
        )
      );

    this.defaultButton =
      this.root.ref &&
      this.root.ref.querySelector(
        `[${MDCDialogFoundation.strings.BUTTON_DEFAULT_ATTRIBUTE}]`
github fintechstudios / angularjs-mdc / src / mdc-dialog / service / $mdcDialog.js View on Github external
function addEventListeners(controller, options) {
      options.onAcceptHandler = (e) => {
        e.stopPropagation();
        $mdcDialog.hide(controller ? controller.result : undefined);
      };
      options.onCancelHandler = (e) => {
        e.stopPropagation();
        $mdcDialog.cancel();
      };

      options.mdcDialog.listen(MDCDialogFoundation.strings.ACCEPT_EVENT, options.onAcceptHandler);
      options.mdcDialog.listen(MDCDialogFoundation.strings.CANCEL_EVENT, options.onCancelHandler);
    }
github jamesmfriedman / rmwc / src / dialog / dialog.tsx View on Github external
);
    this.content =
      this.root.ref &&
      this.root.ref.querySelector(MDCDialogFoundation.strings.CONTENT_SELECTOR);
    this.buttons =
      this.root.ref &&
      [].slice.call(
        this.root.ref.querySelectorAll(
          MDCDialogFoundation.strings.BUTTON_SELECTOR
        )
      );

    this.defaultButton =
      this.root.ref &&
      this.root.ref.querySelector(
        `[${MDCDialogFoundation.strings.BUTTON_DEFAULT_ATTRIBUTE}]`
      );

    this.container &&
      (this.focusTrap = createFocusTrap(this.container, {
        initialFocus: undefined,
        escapeDeactivates: false,
        clickOutsideDeactivates: true
      }));

    this.handleDocumentKeydown = this.foundation.handleDocumentKeydown.bind(
      this.foundation
    );

    document.addEventListener('keydown', this.handleDocumentKeydown);
  }