import bemMixin from '../_mixins/bem';
import { isSSR } from './constant';
export const prefix = 'gd';
export function createComponentName(name) {
  return `${prefix}-${name}`;
}
export const componentMixin = {
  mixins: [bemMixin],
  version: "1.15.8",
  computed: {
    $$attrs() {
      const attrs = {};

      for (const key in this.$attrs) {
        if (!this.$hasProp(key)) {
          attrs[key] = this.$attrs[key];
        }
      }

      return attrs;
    }

  },
  methods: {
    ignoreListeners(keys) {
      const listeners = {};

      for (const key in this.$listeners) {
        if (keys.indexOf(key) === -1) {
          listeners[key] = this.$listeners[key];
        }
      }

      return listeners;
    },

    $hasProp(key) {
      return key in this.$options.propsData && this.$options.propsData[key] !== undefined;
    },

    isSSR() {
      return isSSR();
    }

  }
};