{ 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`.'); return this.mapChildren.apply(this, arguments); } }); // // suitSet: (base, flags)-> // classes = {} // classes[base] = true // for key, value of flags // classes["#{base}--#{key}"] = value // @cx classes // // # Returns a copy of @props sans specific keys // # Example: // # props = @getPropsWithout "className" // #
// getPropsWithout: -> // skipList = {} // skipList[name] = true for name in arguments // props = {} // for name, value of @props // props[name] = value unless skipList[name] // props // // # An object that maps the CSS classes of @props.className from their name to `true`. // _getClassSetObject: -> // return {} unless @props.className // classNames = @props.className.split ' ' // object = {} // object[name] = true for name in classNames // object // // # Like React.addons.classSet but where the existing classes of @props.className are included. // # (Unless they are overridden by `classToBoolMap`.) // # Example: // # className = @classAdd // # active: @props.active // #