Sha256: a54af8f67ac8c230e36ef341419f2746dc6edddab5c645b3e4d75f61c87b680b

Contents?: true

Size: 1.81 KB

Versions: 17

Compression:

Stored size: 1.81 KB

Contents

{
I"
metadata:ET{I"modules;T{I"imports;T[I"exports;T{I"
exported;T[I"specifiers;T[I"usedHelpers;T[I"ignored;TFI"	code;TI"„'use strict';

Rev.registerMixin('Core', {

  suitSetObject: function suitSetObject(base, flags) {
    var obj = {};
    obj[base] = true;
    for (var _name in flags) {
      obj[base + '--' + _name] = flags[_name];
    }
    return obj;
  },

  suitSet: function suitSet(base, flags) {
    return this.classSet(this.suitSetObject(base, flags));
  },

  getPropsWithout: function getPropsWithout() {
    for (var _len = arguments.length, names = Array(_len), _key = 0; _key < _len; _key++) {
      names[_key] = arguments[_key];
    }

    return _.omit(this.props, names);
  },

  classSet: function classSet(flags) {
    var classNames = [];
    for (var _name2 in flags) {
      if (flags[_name2]) {
        classNames.push(_name2);
      }
    }
    return classNames.join(' ');
  },

  cx: function cx() {
    this.classSet.apply(this, arguments);
  },

  getClassSetObjectFromClassName: function getClassSetObjectFromClassName(className) {
    var obj = {};
    className.split(' ').forEach(function (name) {
      obj[name.trim()] = true;
    });
    return obj;
  },

  classAdd: function classAdd(flags) {
    var obj = this.getClassSetObjectFromClassName(this.props.className || '');
    _.extend(obj, flags);
    return this.classSet(obj);
  },

  mapChildren: function mapChildren(fn) {
    return React.Children.map(this.props.children, fn);
  },

  getNormalizedChildren: function getNormalizedChildren() {
    console.warn('Core mixin method `getNormalizedChildren` is deprecated. Please use `mapChildren` or `React.Children.map`.');
    var children = this.props.children;
    return children && children.length === 0 ? [children] : children;
  }

});;TI"ast;T0I"map;T0

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
revelry_core-0.1.24.0 spec/dummy/tmp/cache/assets/sprockets/v3.0/64/64_kCwIKoeL1WTXfUkcrGW_VDKjzVnV058UQzYDtxG0.cache
revelry_core-0.1.23.0 spec/dummy/tmp/cache/assets/sprockets/v3.0/64/64_kCwIKoeL1WTXfUkcrGW_VDKjzVnV058UQzYDtxG0.cache
revelry_core-0.1.22.0 spec/dummy/tmp/cache/assets/sprockets/v3.0/64/64_kCwIKoeL1WTXfUkcrGW_VDKjzVnV058UQzYDtxG0.cache
revelry_core-0.1.21.0 spec/dummy/tmp/cache/assets/sprockets/v3.0/64/64_kCwIKoeL1WTXfUkcrGW_VDKjzVnV058UQzYDtxG0.cache
revelry_core-0.1.20.0 spec/dummy/tmp/cache/assets/sprockets/v3.0/64/64_kCwIKoeL1WTXfUkcrGW_VDKjzVnV058UQzYDtxG0.cache
revelry_core-0.1.19.0 spec/dummy/tmp/cache/assets/sprockets/v3.0/64/64_kCwIKoeL1WTXfUkcrGW_VDKjzVnV058UQzYDtxG0.cache
revelry_core-0.1.18.0 spec/dummy/tmp/cache/assets/sprockets/v3.0/64/64_kCwIKoeL1WTXfUkcrGW_VDKjzVnV058UQzYDtxG0.cache
revelry_core-0.1.17.0 spec/dummy/tmp/cache/assets/sprockets/v3.0/64/64_kCwIKoeL1WTXfUkcrGW_VDKjzVnV058UQzYDtxG0.cache
revelry_core-0.1.16.0 spec/dummy/tmp/cache/assets/sprockets/v3.0/64/64_kCwIKoeL1WTXfUkcrGW_VDKjzVnV058UQzYDtxG0.cache
revelry_core-0.1.15.0 spec/dummy/tmp/cache/assets/sprockets/v3.0/64/64_kCwIKoeL1WTXfUkcrGW_VDKjzVnV058UQzYDtxG0.cache
revelry_core-0.1.14.0 spec/dummy/tmp/cache/assets/test/sprockets/v3.0/uvt6UNbYAKtS95PKszhrOxoJs4saCly0mFs0C_MG2UI.cache
revelry_core-0.1.13.0 spec/dummy/tmp/cache/assets/test/sprockets/v3.0/uvt6UNbYAKtS95PKszhrOxoJs4saCly0mFs0C_MG2UI.cache
revelry_core-0.1.12.6 spec/dummy/tmp/cache/assets/development/sprockets/v3.0/hMXzkJvubSE8SW-jjRp6fsHDGy7XodUTlwiovI-qq60.cache
revelry_core-0.1.12.5 spec/dummy/tmp/cache/assets/development/sprockets/v3.0/hMXzkJvubSE8SW-jjRp6fsHDGy7XodUTlwiovI-qq60.cache
revelry_core-0.1.12.4 spec/dummy/tmp/cache/assets/development/sprockets/v3.0/sTbiAsUASXhPIzh-YM4ip_FNRilh7vd2OziXYzsu7Pw.cache
revelry_core-0.1.12.3 spec/dummy/tmp/cache/assets/development/sprockets/v3.0/hMXzkJvubSE8SW-jjRp6fsHDGy7XodUTlwiovI-qq60.cache
revelry_core-0.1.12.0 spec/dummy/tmp/cache/assets/development/sprockets/v3.0/hMXzkJvubSE8SW-jjRp6fsHDGy7XodUTlwiovI-qq60.cache