How to use the @material/chips/chip/foundation.MDCChipFoundation.strings function in @material/chips

To help you get started, we’ve selected a few @material/chips 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 pgbross / vue-material-adapter / packages / mcwv-chips / chip.js View on Github external
mounted() {
    const {
      INTERACTION_EVENT,
      SELECTION_EVENT,
      REMOVAL_EVENT,
      TRAILING_ICON_INTERACTION_EVENT,
      PRIMARY_ACTION_SELECTOR,
      TRAILING_ACTION_SELECTOR,
      NAVIGATION_EVENT,
    } = MDCChipFoundation.strings;

    this.trailingAction_ = this.$el.querySelector(TRAILING_ACTION_SELECTOR);

    this.foundation = new MDCChipFoundation({
      addClass: className => this.$set(this.classes, className, true),
      removeClass: className => this.$delete(this.classes, className),
      hasClass: className => this.$el.classList.contains(className),
      addClassToLeadingIcon: className => {
        this.$set(this.leadingClasses, className, true);

        // if no ref, then using slot, so just add class directly
        if (!this.$refs['leading-icon'] && this.haveleadingIcon) {
          const item = this.$slots['leading-icon'][0];
          (item.elm || item).classList.add(className);
        }
      },
github pgbross / vue-material-adapter / packages / mcwv-chips / chip-set.js View on Github external
import MDCChipSetFoundation from '@material/chips/chip-set/foundation';
import { MDCChipFoundation } from '@material/chips/chip/foundation';

const {
  INTERACTION_EVENT,
  SELECTION_EVENT,
  REMOVAL_EVENT,
  NAVIGATION_EVENT,
} = MDCChipFoundation.strings;

const { CHIP_SELECTOR } = MDCChipSetFoundation.strings;

let idCounter = 0;

export default {
  name: 'mcw-chip-set',
  props: {
    choice: [Boolean],
    filter: [Boolean],
    input: [Boolean],
  },
  provide() {
    return { mcwChipSet: this };
  },
  data() {