How to use the @material/list/foundation.MDCListFoundation.strings function in @material/list

To help you get started, we’ve selected a few @material/list 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 material-components / material-components-web-react / packages / list / index.tsx View on Github external
setTabIndexForListItemChildren: (listItemIndex, tabIndexValue) => {
        const listItem = this.listElements[listItemIndex];
        const selector =
          MDCListFoundation.strings.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX;
        const listItemChildren: Element[] = [].slice.call(
          listItem.querySelectorAll(selector)
        );
        listItemChildren.forEach((el) =>
          el.setAttribute('tabindex', tabIndexValue)
        );
      },
      focusItemAtIndex: (index) => {
github SpringflowNL / aurelia-mdc-elements / node_modules / @material / menu / component.js View on Github external
var _this = this;
        this.menuSurface_ = this.menuSurfaceFactory_(this.root_);
        var list = this.root_.querySelector(strings.LIST_SELECTOR);
        if (list) {
            this.list_ = this.listFactory_(list);
            this.list_.wrapFocus = true;
        }
        else {
            this.list_ = null;
        }
        this.handleKeydown_ = function (evt) { return _this.foundation_.handleKeydown(evt); };
        this.handleItemAction_ = function (evt) { return _this.foundation_.handleItemAction(_this.items[evt.detail.index]); };
        this.handleMenuSurfaceOpened_ = function () { return _this.foundation_.handleMenuSurfaceOpened(); };
        this.menuSurface_.listen(MDCMenuSurfaceFoundation.strings.OPENED_EVENT, this.handleMenuSurfaceOpened_);
        this.listen('keydown', this.handleKeydown_);
        this.listen(MDCListFoundation.strings.ACTION_EVENT, this.handleItemAction_);
    };
    MDCMenu.prototype.destroy = function () {
github material-components / material-components-web-react / packages / list / ListItem.tsx View on Github external
get listElements(): Element[] {
    if (this.listItemElement.current) {
      const listElement = closest(
        this.listItemElement.current,
        `.${MDCListFoundation.cssClasses.ROOT}`
      );
      if (!listElement) return [];
      return [].slice.call(
        listElement.querySelectorAll(
          MDCListFoundation.strings.ENABLED_ITEMS_SELECTOR
        )
      );
    }
    return [];
  }
github material-components / material-components-web-react / packages / list / index.tsx View on Github external
hasRadioAtIndex: (index) => {
        const listItem = this.listElements[index];
        return !!listItem.querySelector(
          MDCListFoundation.strings.RADIO_SELECTOR
        );
      },
      isCheckboxCheckedAtIndex: (index) => {