"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");

exports.__esModule = true;
exports.createComponentName = createComponentName;
exports.componentMixin = exports.prefix = void 0;

var _bem = _interopRequireDefault(require("../_mixins/bem"));

var _constant = require("./constant");

var prefix = 'gd';
exports.prefix = prefix;

function createComponentName(name) {
  return `${prefix}-${name}`;
}

var componentMixin = {
  mixins: [_bem.default],
  version: "1.16.0-beta.4",
  computed: {
    $$attrs() {
      var attrs = {};

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

      return attrs;
    }

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

      for (var 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 (0, _constant.isSSR)();
    }

  }
};
exports.componentMixin = componentMixin;