Add files
This commit is contained in:
commit
bb80829159
18195 changed files with 2122994 additions and 0 deletions
107
509bba0_unpacked_with_node_modules/~/react-dnd/lib/DragDropContext.js
generated
vendored
Executable file
107
509bba0_unpacked_with_node_modules/~/react-dnd/lib/DragDropContext.js
generated
vendored
Executable file
|
@ -0,0 +1,107 @@
|
|||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
||||
|
||||
var _slice = Array.prototype.slice;
|
||||
|
||||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
||||
|
||||
exports['default'] = DragDropContext;
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
var _react = require('react');
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _dndCore = require('dnd-core');
|
||||
|
||||
var _invariant = require('invariant');
|
||||
|
||||
var _invariant2 = _interopRequireDefault(_invariant);
|
||||
|
||||
var _utilsCheckDecoratorArguments = require('./utils/checkDecoratorArguments');
|
||||
|
||||
var _utilsCheckDecoratorArguments2 = _interopRequireDefault(_utilsCheckDecoratorArguments);
|
||||
|
||||
function DragDropContext(backendOrModule) {
|
||||
_utilsCheckDecoratorArguments2['default'].apply(undefined, ['DragDropContext', 'backend'].concat(_slice.call(arguments)));
|
||||
|
||||
// Auto-detect ES6 default export for people still using ES5
|
||||
var backend = undefined;
|
||||
if (typeof backendOrModule === 'object' && typeof backendOrModule['default'] === 'function') {
|
||||
backend = backendOrModule['default'];
|
||||
} else {
|
||||
backend = backendOrModule;
|
||||
}
|
||||
|
||||
_invariant2['default'](typeof backend === 'function', 'Expected the backend to be a function or an ES6 module exporting a default function. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-drop-context.html');
|
||||
|
||||
var childContext = {
|
||||
dragDropManager: new _dndCore.DragDropManager(backend)
|
||||
};
|
||||
|
||||
return function decorateContext(DecoratedComponent) {
|
||||
var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component';
|
||||
|
||||
return (function (_Component) {
|
||||
_inherits(DragDropContextContainer, _Component);
|
||||
|
||||
function DragDropContextContainer() {
|
||||
_classCallCheck(this, DragDropContextContainer);
|
||||
|
||||
_Component.apply(this, arguments);
|
||||
}
|
||||
|
||||
DragDropContextContainer.prototype.getDecoratedComponentInstance = function getDecoratedComponentInstance() {
|
||||
return this.refs.child;
|
||||
};
|
||||
|
||||
DragDropContextContainer.prototype.getManager = function getManager() {
|
||||
return childContext.dragDropManager;
|
||||
};
|
||||
|
||||
DragDropContextContainer.prototype.getChildContext = function getChildContext() {
|
||||
return childContext;
|
||||
};
|
||||
|
||||
DragDropContextContainer.prototype.render = function render() {
|
||||
return _react2['default'].createElement(DecoratedComponent, _extends({}, this.props, {
|
||||
ref: 'child' }));
|
||||
};
|
||||
|
||||
_createClass(DragDropContextContainer, null, [{
|
||||
key: 'DecoratedComponent',
|
||||
value: DecoratedComponent,
|
||||
enumerable: true
|
||||
}, {
|
||||
key: 'displayName',
|
||||
value: 'DragDropContext(' + displayName + ')',
|
||||
enumerable: true
|
||||
}, {
|
||||
key: 'childContextTypes',
|
||||
value: {
|
||||
dragDropManager: _react.PropTypes.object.isRequired
|
||||
},
|
||||
enumerable: true
|
||||
}]);
|
||||
|
||||
return DragDropContextContainer;
|
||||
})(_react.Component);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = exports['default'];
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/lib/DragDropContext.js
|
||||
// module id = 2736
|
||||
// module chunks = 4
|
133
509bba0_unpacked_with_node_modules/~/react-dnd/lib/DragLayer.js
generated
vendored
Executable file
133
509bba0_unpacked_with_node_modules/~/react-dnd/lib/DragLayer.js
generated
vendored
Executable file
|
@ -0,0 +1,133 @@
|
|||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
||||
|
||||
var _slice = Array.prototype.slice;
|
||||
|
||||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
||||
|
||||
exports['default'] = DragLayer;
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
var _react = require('react');
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _utilsShallowEqual = require('./utils/shallowEqual');
|
||||
|
||||
var _utilsShallowEqual2 = _interopRequireDefault(_utilsShallowEqual);
|
||||
|
||||
var _utilsShallowEqualScalar = require('./utils/shallowEqualScalar');
|
||||
|
||||
var _utilsShallowEqualScalar2 = _interopRequireDefault(_utilsShallowEqualScalar);
|
||||
|
||||
var _lodashLangIsPlainObject = require('lodash/lang/isPlainObject');
|
||||
|
||||
var _lodashLangIsPlainObject2 = _interopRequireDefault(_lodashLangIsPlainObject);
|
||||
|
||||
var _invariant = require('invariant');
|
||||
|
||||
var _invariant2 = _interopRequireDefault(_invariant);
|
||||
|
||||
var _utilsCheckDecoratorArguments = require('./utils/checkDecoratorArguments');
|
||||
|
||||
var _utilsCheckDecoratorArguments2 = _interopRequireDefault(_utilsCheckDecoratorArguments);
|
||||
|
||||
function DragLayer(collect) {
|
||||
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
|
||||
|
||||
_utilsCheckDecoratorArguments2['default'].apply(undefined, ['DragLayer', 'collect[, options]'].concat(_slice.call(arguments)));
|
||||
_invariant2['default'](typeof collect === 'function', 'Expected "collect" provided as the first argument to DragLayer ' + 'to be a function that collects props to inject into the component. ', 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-layer.html', collect);
|
||||
_invariant2['default'](_lodashLangIsPlainObject2['default'](options), 'Expected "options" provided as the second argument to DragLayer to be ' + 'a plain object when specified. ' + 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-layer.html', options);
|
||||
|
||||
return function decorateLayer(DecoratedComponent) {
|
||||
var _options$arePropsEqual = options.arePropsEqual;
|
||||
var arePropsEqual = _options$arePropsEqual === undefined ? _utilsShallowEqualScalar2['default'] : _options$arePropsEqual;
|
||||
|
||||
var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component';
|
||||
|
||||
return (function (_Component) {
|
||||
_inherits(DragLayerContainer, _Component);
|
||||
|
||||
DragLayerContainer.prototype.getDecoratedComponentInstance = function getDecoratedComponentInstance() {
|
||||
return this.refs.child;
|
||||
};
|
||||
|
||||
DragLayerContainer.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) {
|
||||
return !arePropsEqual(nextProps, this.props) || !_utilsShallowEqual2['default'](nextState, this.state);
|
||||
};
|
||||
|
||||
_createClass(DragLayerContainer, null, [{
|
||||
key: 'DecoratedComponent',
|
||||
value: DecoratedComponent,
|
||||
enumerable: true
|
||||
}, {
|
||||
key: 'displayName',
|
||||
value: 'DragLayer(' + displayName + ')',
|
||||
enumerable: true
|
||||
}, {
|
||||
key: 'contextTypes',
|
||||
value: {
|
||||
dragDropManager: _react.PropTypes.object.isRequired
|
||||
},
|
||||
enumerable: true
|
||||
}]);
|
||||
|
||||
function DragLayerContainer(props, context) {
|
||||
_classCallCheck(this, DragLayerContainer);
|
||||
|
||||
_Component.call(this, props);
|
||||
this.handleChange = this.handleChange.bind(this);
|
||||
|
||||
this.manager = context.dragDropManager;
|
||||
_invariant2['default'](typeof this.manager === 'object', 'Could not find the drag and drop manager in the context of %s. ' + 'Make sure to wrap the top-level component of your app with DragDropContext. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context', displayName, displayName);
|
||||
|
||||
this.state = this.getCurrentState();
|
||||
}
|
||||
|
||||
DragLayerContainer.prototype.componentDidMount = function componentDidMount() {
|
||||
var monitor = this.manager.getMonitor();
|
||||
this.unsubscribe = monitor.subscribeToOffsetChange(this.handleChange);
|
||||
};
|
||||
|
||||
DragLayerContainer.prototype.componentWillUnmount = function componentWillUnmount() {
|
||||
this.unsubscribe();
|
||||
};
|
||||
|
||||
DragLayerContainer.prototype.handleChange = function handleChange() {
|
||||
var nextState = this.getCurrentState();
|
||||
if (!_utilsShallowEqual2['default'](nextState, this.state)) {
|
||||
this.setState(nextState);
|
||||
}
|
||||
};
|
||||
|
||||
DragLayerContainer.prototype.getCurrentState = function getCurrentState() {
|
||||
var monitor = this.manager.getMonitor();
|
||||
return collect(monitor);
|
||||
};
|
||||
|
||||
DragLayerContainer.prototype.render = function render() {
|
||||
return _react2['default'].createElement(DecoratedComponent, _extends({}, this.props, this.state, {
|
||||
ref: 'child' }));
|
||||
};
|
||||
|
||||
return DragLayerContainer;
|
||||
})(_react.Component);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = exports['default'];
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/lib/DragLayer.js
|
||||
// module id = 2737
|
||||
// module chunks = 4
|
86
509bba0_unpacked_with_node_modules/~/react-dnd/lib/DragSource.js
generated
vendored
Executable file
86
509bba0_unpacked_with_node_modules/~/react-dnd/lib/DragSource.js
generated
vendored
Executable file
|
@ -0,0 +1,86 @@
|
|||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
var _slice = Array.prototype.slice;
|
||||
exports['default'] = DragSource;
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
var _invariant = require('invariant');
|
||||
|
||||
var _invariant2 = _interopRequireDefault(_invariant);
|
||||
|
||||
var _lodashLangIsPlainObject = require('lodash/lang/isPlainObject');
|
||||
|
||||
var _lodashLangIsPlainObject2 = _interopRequireDefault(_lodashLangIsPlainObject);
|
||||
|
||||
var _utilsCheckDecoratorArguments = require('./utils/checkDecoratorArguments');
|
||||
|
||||
var _utilsCheckDecoratorArguments2 = _interopRequireDefault(_utilsCheckDecoratorArguments);
|
||||
|
||||
var _decorateHandler = require('./decorateHandler');
|
||||
|
||||
var _decorateHandler2 = _interopRequireDefault(_decorateHandler);
|
||||
|
||||
var _registerSource = require('./registerSource');
|
||||
|
||||
var _registerSource2 = _interopRequireDefault(_registerSource);
|
||||
|
||||
var _createSourceFactory = require('./createSourceFactory');
|
||||
|
||||
var _createSourceFactory2 = _interopRequireDefault(_createSourceFactory);
|
||||
|
||||
var _createSourceMonitor = require('./createSourceMonitor');
|
||||
|
||||
var _createSourceMonitor2 = _interopRequireDefault(_createSourceMonitor);
|
||||
|
||||
var _createSourceConnector = require('./createSourceConnector');
|
||||
|
||||
var _createSourceConnector2 = _interopRequireDefault(_createSourceConnector);
|
||||
|
||||
var _utilsIsValidType = require('./utils/isValidType');
|
||||
|
||||
var _utilsIsValidType2 = _interopRequireDefault(_utilsIsValidType);
|
||||
|
||||
function DragSource(type, spec, collect) {
|
||||
var options = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];
|
||||
|
||||
_utilsCheckDecoratorArguments2['default'].apply(undefined, ['DragSource', 'type, spec, collect[, options]'].concat(_slice.call(arguments)));
|
||||
var getType = type;
|
||||
if (typeof type !== 'function') {
|
||||
_invariant2['default'](_utilsIsValidType2['default'](type), 'Expected "type" provided as the first argument to DragSource to be ' + 'a string, or a function that returns a string given the current props. ' + 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', type);
|
||||
getType = function () {
|
||||
return type;
|
||||
};
|
||||
}
|
||||
_invariant2['default'](_lodashLangIsPlainObject2['default'](spec), 'Expected "spec" provided as the second argument to DragSource to be ' + 'a plain object. Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', spec);
|
||||
var createSource = _createSourceFactory2['default'](spec);
|
||||
_invariant2['default'](typeof collect === 'function', 'Expected "collect" provided as the third argument to DragSource to be ' + 'a function that returns a plain object of props to inject. ' + 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', collect);
|
||||
_invariant2['default'](_lodashLangIsPlainObject2['default'](options), 'Expected "options" provided as the fourth argument to DragSource to be ' + 'a plain object when specified. ' + 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', collect);
|
||||
|
||||
return function decorateSource(DecoratedComponent) {
|
||||
return _decorateHandler2['default']({
|
||||
connectBackend: function connectBackend(backend, sourceId) {
|
||||
return backend.connectDragSource(sourceId);
|
||||
},
|
||||
containerDisplayName: 'DragSource',
|
||||
createHandler: createSource,
|
||||
registerHandler: _registerSource2['default'],
|
||||
createMonitor: _createSourceMonitor2['default'],
|
||||
createConnector: _createSourceConnector2['default'],
|
||||
DecoratedComponent: DecoratedComponent,
|
||||
getType: getType,
|
||||
collect: collect,
|
||||
options: options
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = exports['default'];
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/lib/DragSource.js
|
||||
// module id = 2738
|
||||
// module chunks = 4
|
86
509bba0_unpacked_with_node_modules/~/react-dnd/lib/DropTarget.js
generated
vendored
Executable file
86
509bba0_unpacked_with_node_modules/~/react-dnd/lib/DropTarget.js
generated
vendored
Executable file
|
@ -0,0 +1,86 @@
|
|||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
var _slice = Array.prototype.slice;
|
||||
exports['default'] = DropTarget;
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
var _invariant = require('invariant');
|
||||
|
||||
var _invariant2 = _interopRequireDefault(_invariant);
|
||||
|
||||
var _lodashLangIsPlainObject = require('lodash/lang/isPlainObject');
|
||||
|
||||
var _lodashLangIsPlainObject2 = _interopRequireDefault(_lodashLangIsPlainObject);
|
||||
|
||||
var _utilsCheckDecoratorArguments = require('./utils/checkDecoratorArguments');
|
||||
|
||||
var _utilsCheckDecoratorArguments2 = _interopRequireDefault(_utilsCheckDecoratorArguments);
|
||||
|
||||
var _decorateHandler = require('./decorateHandler');
|
||||
|
||||
var _decorateHandler2 = _interopRequireDefault(_decorateHandler);
|
||||
|
||||
var _registerTarget = require('./registerTarget');
|
||||
|
||||
var _registerTarget2 = _interopRequireDefault(_registerTarget);
|
||||
|
||||
var _createTargetFactory = require('./createTargetFactory');
|
||||
|
||||
var _createTargetFactory2 = _interopRequireDefault(_createTargetFactory);
|
||||
|
||||
var _createTargetMonitor = require('./createTargetMonitor');
|
||||
|
||||
var _createTargetMonitor2 = _interopRequireDefault(_createTargetMonitor);
|
||||
|
||||
var _createTargetConnector = require('./createTargetConnector');
|
||||
|
||||
var _createTargetConnector2 = _interopRequireDefault(_createTargetConnector);
|
||||
|
||||
var _utilsIsValidType = require('./utils/isValidType');
|
||||
|
||||
var _utilsIsValidType2 = _interopRequireDefault(_utilsIsValidType);
|
||||
|
||||
function DropTarget(type, spec, collect) {
|
||||
var options = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];
|
||||
|
||||
_utilsCheckDecoratorArguments2['default'].apply(undefined, ['DropTarget', 'type, spec, collect[, options]'].concat(_slice.call(arguments)));
|
||||
var getType = type;
|
||||
if (typeof type !== 'function') {
|
||||
_invariant2['default'](_utilsIsValidType2['default'](type, true), 'Expected "type" provided as the first argument to DropTarget to be ' + 'a string, an array of strings, or a function that returns either given ' + 'the current props. Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', type);
|
||||
getType = function () {
|
||||
return type;
|
||||
};
|
||||
}
|
||||
_invariant2['default'](_lodashLangIsPlainObject2['default'](spec), 'Expected "spec" provided as the second argument to DropTarget to be ' + 'a plain object. Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', spec);
|
||||
var createTarget = _createTargetFactory2['default'](spec);
|
||||
_invariant2['default'](typeof collect === 'function', 'Expected "collect" provided as the third argument to DropTarget to be ' + 'a function that returns a plain object of props to inject. ' + 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', collect);
|
||||
_invariant2['default'](_lodashLangIsPlainObject2['default'](options), 'Expected "options" provided as the fourth argument to DropTarget to be ' + 'a plain object when specified. ' + 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', collect);
|
||||
|
||||
return function decorateTarget(DecoratedComponent) {
|
||||
return _decorateHandler2['default']({
|
||||
connectBackend: function connectBackend(backend, targetId) {
|
||||
return backend.connectDropTarget(targetId);
|
||||
},
|
||||
containerDisplayName: 'DropTarget',
|
||||
createHandler: createTarget,
|
||||
registerHandler: _registerTarget2['default'],
|
||||
createMonitor: _createTargetMonitor2['default'],
|
||||
createConnector: _createTargetConnector2['default'],
|
||||
DecoratedComponent: DecoratedComponent,
|
||||
getType: getType,
|
||||
collect: collect,
|
||||
options: options
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = exports['default'];
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/lib/DropTarget.js
|
||||
// module id = 2739
|
||||
// module chunks = 4
|
43
509bba0_unpacked_with_node_modules/~/react-dnd/lib/bindConnector.js
generated
vendored
Executable file
43
509bba0_unpacked_with_node_modules/~/react-dnd/lib/bindConnector.js
generated
vendored
Executable file
|
@ -0,0 +1,43 @@
|
|||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports['default'] = bindConnector;
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
var _bindConnectorMethod2 = require('./bindConnectorMethod');
|
||||
|
||||
var _bindConnectorMethod3 = _interopRequireDefault(_bindConnectorMethod2);
|
||||
|
||||
var _disposables = require('disposables');
|
||||
|
||||
function bindConnector(connector, handlerId) {
|
||||
var compositeDisposable = new _disposables.CompositeDisposable();
|
||||
var handlerConnector = {};
|
||||
|
||||
Object.keys(connector).forEach(function (key) {
|
||||
var _bindConnectorMethod = _bindConnectorMethod3['default'](handlerId, connector[key]);
|
||||
|
||||
var disposable = _bindConnectorMethod.disposable;
|
||||
var ref = _bindConnectorMethod.ref;
|
||||
|
||||
compositeDisposable.add(disposable);
|
||||
handlerConnector[key] = function () {
|
||||
return ref;
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
disposable: compositeDisposable,
|
||||
handlerConnector: handlerConnector
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = exports['default'];
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/lib/bindConnector.js
|
||||
// module id = 2740
|
||||
// module chunks = 4
|
89
509bba0_unpacked_with_node_modules/~/react-dnd/lib/bindConnectorMethod.js
generated
vendored
Executable file
89
509bba0_unpacked_with_node_modules/~/react-dnd/lib/bindConnectorMethod.js
generated
vendored
Executable file
|
@ -0,0 +1,89 @@
|
|||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports['default'] = bindConnectorMethod;
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
var _utilsShallowEqual = require('./utils/shallowEqual');
|
||||
|
||||
var _utilsShallowEqual2 = _interopRequireDefault(_utilsShallowEqual);
|
||||
|
||||
var _utilsCloneWithRef = require('./utils/cloneWithRef');
|
||||
|
||||
var _utilsCloneWithRef2 = _interopRequireDefault(_utilsCloneWithRef);
|
||||
|
||||
var _disposables = require('disposables');
|
||||
|
||||
var _react = require('react');
|
||||
|
||||
function areOptionsEqual(currentOptions, nextOptions) {
|
||||
if (currentOptions === nextOptions) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return currentOptions !== null && nextOptions !== null && _utilsShallowEqual2['default'](currentOptions, nextOptions);
|
||||
}
|
||||
|
||||
function bindConnectorMethod(handlerId, connect) {
|
||||
var disposable = new _disposables.SerialDisposable();
|
||||
|
||||
var currentNode = null;
|
||||
var currentOptions = null;
|
||||
|
||||
function ref() {
|
||||
var nextWhatever = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0];
|
||||
var nextOptions = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];
|
||||
|
||||
// If passed a ReactElement, clone it and attach this function as a ref.
|
||||
// This helps us achieve a neat API where user doesn't even know that refs
|
||||
// are being used under the hood.
|
||||
if (_react.isValidElement(nextWhatever)) {
|
||||
// Custom components can no longer be wrapped directly in React DnD 2.0
|
||||
// so that we don't need to depend on findDOMNode() from react-dom.
|
||||
if (typeof nextWhatever.type !== 'string') {
|
||||
var displayName = nextWhatever.type.displayName || nextWhatever.type.name || 'the component';
|
||||
throw new Error('Only native element nodes can now be passed to ' + connect.name + '(). ' + ('You can either wrap ' + displayName + ' into a <div>, or turn it into a ') + 'drag source or a drop target itself.');
|
||||
}
|
||||
|
||||
var nextElement = nextWhatever;
|
||||
return _utilsCloneWithRef2['default'](nextElement, function (inst) {
|
||||
return ref(inst, nextOptions);
|
||||
});
|
||||
}
|
||||
|
||||
// At this point we can only receive DOM nodes.
|
||||
var nextNode = nextWhatever;
|
||||
|
||||
// If nothing changed, bail out of re-connecting the node to the backend.
|
||||
if (nextNode === currentNode && areOptionsEqual(currentOptions, nextOptions)) {
|
||||
return;
|
||||
}
|
||||
|
||||
currentNode = nextNode;
|
||||
currentOptions = nextOptions;
|
||||
|
||||
if (!nextNode) {
|
||||
disposable.setDisposable(null);
|
||||
return;
|
||||
}
|
||||
|
||||
// Re-connect the node to the backend.
|
||||
var currentDispose = connect(handlerId, nextNode, nextOptions);
|
||||
disposable.setDisposable(new _disposables.Disposable(currentDispose));
|
||||
}
|
||||
|
||||
return {
|
||||
ref: ref,
|
||||
disposable: disposable
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = exports['default'];
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/lib/bindConnectorMethod.js
|
||||
// module id = 2741
|
||||
// module chunks = 4
|
24
509bba0_unpacked_with_node_modules/~/react-dnd/lib/createSourceConnector.js
generated
vendored
Executable file
24
509bba0_unpacked_with_node_modules/~/react-dnd/lib/createSourceConnector.js
generated
vendored
Executable file
|
@ -0,0 +1,24 @@
|
|||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports["default"] = createSourceConnector;
|
||||
|
||||
function createSourceConnector(backend) {
|
||||
return {
|
||||
dragSource: function connectDragSource() {
|
||||
return backend.connectDragSource.apply(backend, arguments);
|
||||
},
|
||||
dragPreview: function connectDragPreview() {
|
||||
return backend.connectDragPreview.apply(backend, arguments);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = exports["default"];
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/lib/createSourceConnector.js
|
||||
// module id = 2742
|
||||
// module chunks = 4
|
94
509bba0_unpacked_with_node_modules/~/react-dnd/lib/createSourceFactory.js
generated
vendored
Executable file
94
509bba0_unpacked_with_node_modules/~/react-dnd/lib/createSourceFactory.js
generated
vendored
Executable file
|
@ -0,0 +1,94 @@
|
|||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports['default'] = createSourceFactory;
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
||||
|
||||
var _invariant = require('invariant');
|
||||
|
||||
var _invariant2 = _interopRequireDefault(_invariant);
|
||||
|
||||
var _lodashLangIsPlainObject = require('lodash/lang/isPlainObject');
|
||||
|
||||
var _lodashLangIsPlainObject2 = _interopRequireDefault(_lodashLangIsPlainObject);
|
||||
|
||||
var ALLOWED_SPEC_METHODS = ['canDrag', 'beginDrag', 'canDrag', 'isDragging', 'endDrag'];
|
||||
var REQUIRED_SPEC_METHODS = ['beginDrag'];
|
||||
|
||||
function createSourceFactory(spec) {
|
||||
Object.keys(spec).forEach(function (key) {
|
||||
_invariant2['default'](ALLOWED_SPEC_METHODS.indexOf(key) > -1, 'Expected the drag source specification to only have ' + 'some of the following keys: %s. ' + 'Instead received a specification with an unexpected "%s" key. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', ALLOWED_SPEC_METHODS.join(', '), key);
|
||||
_invariant2['default'](typeof spec[key] === 'function', 'Expected %s in the drag source specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', key, key, spec[key]);
|
||||
});
|
||||
REQUIRED_SPEC_METHODS.forEach(function (key) {
|
||||
_invariant2['default'](typeof spec[key] === 'function', 'Expected %s in the drag source specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', key, key, spec[key]);
|
||||
});
|
||||
|
||||
var Source = (function () {
|
||||
function Source(monitor) {
|
||||
_classCallCheck(this, Source);
|
||||
|
||||
this.monitor = monitor;
|
||||
this.props = null;
|
||||
this.component = null;
|
||||
}
|
||||
|
||||
Source.prototype.receiveProps = function receiveProps(props) {
|
||||
this.props = props;
|
||||
};
|
||||
|
||||
Source.prototype.receiveComponent = function receiveComponent(component) {
|
||||
this.component = component;
|
||||
};
|
||||
|
||||
Source.prototype.canDrag = function canDrag() {
|
||||
if (!spec.canDrag) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return spec.canDrag(this.props, this.monitor);
|
||||
};
|
||||
|
||||
Source.prototype.isDragging = function isDragging(globalMonitor, sourceId) {
|
||||
if (!spec.isDragging) {
|
||||
return sourceId === globalMonitor.getSourceId();
|
||||
}
|
||||
|
||||
return spec.isDragging(this.props, this.monitor);
|
||||
};
|
||||
|
||||
Source.prototype.beginDrag = function beginDrag() {
|
||||
var item = spec.beginDrag(this.props, this.monitor, this.component);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
_invariant2['default'](_lodashLangIsPlainObject2['default'](item), 'beginDrag() must return a plain object that represents the dragged item. ' + 'Instead received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', item);
|
||||
}
|
||||
return item;
|
||||
};
|
||||
|
||||
Source.prototype.endDrag = function endDrag() {
|
||||
if (!spec.endDrag) {
|
||||
return;
|
||||
}
|
||||
|
||||
spec.endDrag(this.props, this.monitor, this.component);
|
||||
};
|
||||
|
||||
return Source;
|
||||
})();
|
||||
|
||||
return function createSource(monitor) {
|
||||
return new Source(monitor);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = exports['default'];
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/lib/createSourceFactory.js
|
||||
// module id = 2743
|
||||
// module chunks = 4
|
100
509bba0_unpacked_with_node_modules/~/react-dnd/lib/createSourceMonitor.js
generated
vendored
Executable file
100
509bba0_unpacked_with_node_modules/~/react-dnd/lib/createSourceMonitor.js
generated
vendored
Executable file
|
@ -0,0 +1,100 @@
|
|||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports['default'] = createSourceMonitor;
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
||||
|
||||
var _invariant = require('invariant');
|
||||
|
||||
var _invariant2 = _interopRequireDefault(_invariant);
|
||||
|
||||
var isCallingCanDrag = false;
|
||||
var isCallingIsDragging = false;
|
||||
|
||||
var SourceMonitor = (function () {
|
||||
function SourceMonitor(manager) {
|
||||
_classCallCheck(this, SourceMonitor);
|
||||
|
||||
this.internalMonitor = manager.getMonitor();
|
||||
}
|
||||
|
||||
SourceMonitor.prototype.receiveHandlerId = function receiveHandlerId(sourceId) {
|
||||
this.sourceId = sourceId;
|
||||
};
|
||||
|
||||
SourceMonitor.prototype.canDrag = function canDrag() {
|
||||
_invariant2['default'](!isCallingCanDrag, 'You may not call monitor.canDrag() inside your canDrag() implementation. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source-monitor.html');
|
||||
|
||||
try {
|
||||
isCallingCanDrag = true;
|
||||
return this.internalMonitor.canDragSource(this.sourceId);
|
||||
} finally {
|
||||
isCallingCanDrag = false;
|
||||
}
|
||||
};
|
||||
|
||||
SourceMonitor.prototype.isDragging = function isDragging() {
|
||||
_invariant2['default'](!isCallingIsDragging, 'You may not call monitor.isDragging() inside your isDragging() implementation. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source-monitor.html');
|
||||
|
||||
try {
|
||||
isCallingIsDragging = true;
|
||||
return this.internalMonitor.isDraggingSource(this.sourceId);
|
||||
} finally {
|
||||
isCallingIsDragging = false;
|
||||
}
|
||||
};
|
||||
|
||||
SourceMonitor.prototype.getItemType = function getItemType() {
|
||||
return this.internalMonitor.getItemType();
|
||||
};
|
||||
|
||||
SourceMonitor.prototype.getItem = function getItem() {
|
||||
return this.internalMonitor.getItem();
|
||||
};
|
||||
|
||||
SourceMonitor.prototype.getDropResult = function getDropResult() {
|
||||
return this.internalMonitor.getDropResult();
|
||||
};
|
||||
|
||||
SourceMonitor.prototype.didDrop = function didDrop() {
|
||||
return this.internalMonitor.didDrop();
|
||||
};
|
||||
|
||||
SourceMonitor.prototype.getInitialClientOffset = function getInitialClientOffset() {
|
||||
return this.internalMonitor.getInitialClientOffset();
|
||||
};
|
||||
|
||||
SourceMonitor.prototype.getInitialSourceClientOffset = function getInitialSourceClientOffset() {
|
||||
return this.internalMonitor.getInitialSourceClientOffset();
|
||||
};
|
||||
|
||||
SourceMonitor.prototype.getSourceClientOffset = function getSourceClientOffset() {
|
||||
return this.internalMonitor.getSourceClientOffset();
|
||||
};
|
||||
|
||||
SourceMonitor.prototype.getClientOffset = function getClientOffset() {
|
||||
return this.internalMonitor.getClientOffset();
|
||||
};
|
||||
|
||||
SourceMonitor.prototype.getDifferenceFromInitialOffset = function getDifferenceFromInitialOffset() {
|
||||
return this.internalMonitor.getDifferenceFromInitialOffset();
|
||||
};
|
||||
|
||||
return SourceMonitor;
|
||||
})();
|
||||
|
||||
function createSourceMonitor(manager) {
|
||||
return new SourceMonitor(manager);
|
||||
}
|
||||
|
||||
module.exports = exports['default'];
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/lib/createSourceMonitor.js
|
||||
// module id = 2744
|
||||
// module chunks = 4
|
21
509bba0_unpacked_with_node_modules/~/react-dnd/lib/createTargetConnector.js
generated
vendored
Executable file
21
509bba0_unpacked_with_node_modules/~/react-dnd/lib/createTargetConnector.js
generated
vendored
Executable file
|
@ -0,0 +1,21 @@
|
|||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports["default"] = createTargetConnector;
|
||||
|
||||
function createTargetConnector(backend) {
|
||||
return {
|
||||
dropTarget: function connectDropTarget() {
|
||||
return backend.connectDropTarget.apply(backend, arguments);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = exports["default"];
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/lib/createTargetConnector.js
|
||||
// module id = 2745
|
||||
// module chunks = 4
|
90
509bba0_unpacked_with_node_modules/~/react-dnd/lib/createTargetFactory.js
generated
vendored
Executable file
90
509bba0_unpacked_with_node_modules/~/react-dnd/lib/createTargetFactory.js
generated
vendored
Executable file
|
@ -0,0 +1,90 @@
|
|||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports['default'] = createTargetFactory;
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
||||
|
||||
var _invariant = require('invariant');
|
||||
|
||||
var _invariant2 = _interopRequireDefault(_invariant);
|
||||
|
||||
var _lodashLangIsPlainObject = require('lodash/lang/isPlainObject');
|
||||
|
||||
var _lodashLangIsPlainObject2 = _interopRequireDefault(_lodashLangIsPlainObject);
|
||||
|
||||
var ALLOWED_SPEC_METHODS = ['canDrop', 'hover', 'drop'];
|
||||
|
||||
function createTargetFactory(spec) {
|
||||
Object.keys(spec).forEach(function (key) {
|
||||
_invariant2['default'](ALLOWED_SPEC_METHODS.indexOf(key) > -1, 'Expected the drop target specification to only have ' + 'some of the following keys: %s. ' + 'Instead received a specification with an unexpected "%s" key. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', ALLOWED_SPEC_METHODS.join(', '), key);
|
||||
_invariant2['default'](typeof spec[key] === 'function', 'Expected %s in the drop target specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', key, key, spec[key]);
|
||||
});
|
||||
|
||||
var Target = (function () {
|
||||
function Target(monitor) {
|
||||
_classCallCheck(this, Target);
|
||||
|
||||
this.monitor = monitor;
|
||||
this.props = null;
|
||||
this.component = null;
|
||||
}
|
||||
|
||||
Target.prototype.receiveProps = function receiveProps(props) {
|
||||
this.props = props;
|
||||
};
|
||||
|
||||
Target.prototype.receiveMonitor = function receiveMonitor(monitor) {
|
||||
this.monitor = monitor;
|
||||
};
|
||||
|
||||
Target.prototype.receiveComponent = function receiveComponent(component) {
|
||||
this.component = component;
|
||||
};
|
||||
|
||||
Target.prototype.canDrop = function canDrop() {
|
||||
if (!spec.canDrop) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return spec.canDrop(this.props, this.monitor);
|
||||
};
|
||||
|
||||
Target.prototype.hover = function hover() {
|
||||
if (!spec.hover) {
|
||||
return;
|
||||
}
|
||||
|
||||
spec.hover(this.props, this.monitor, this.component);
|
||||
};
|
||||
|
||||
Target.prototype.drop = function drop() {
|
||||
if (!spec.drop) {
|
||||
return;
|
||||
}
|
||||
|
||||
var dropResult = spec.drop(this.props, this.monitor, this.component);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
_invariant2['default'](typeof dropResult === 'undefined' || _lodashLangIsPlainObject2['default'](dropResult), 'drop() must either return undefined, or an object that represents the drop result. ' + 'Instead received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', dropResult);
|
||||
}
|
||||
return dropResult;
|
||||
};
|
||||
|
||||
return Target;
|
||||
})();
|
||||
|
||||
return function createTarget(monitor) {
|
||||
return new Target(monitor);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = exports['default'];
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/lib/createTargetFactory.js
|
||||
// module id = 2746
|
||||
// module chunks = 4
|
92
509bba0_unpacked_with_node_modules/~/react-dnd/lib/createTargetMonitor.js
generated
vendored
Executable file
92
509bba0_unpacked_with_node_modules/~/react-dnd/lib/createTargetMonitor.js
generated
vendored
Executable file
|
@ -0,0 +1,92 @@
|
|||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports['default'] = createTargetMonitor;
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
||||
|
||||
var _invariant = require('invariant');
|
||||
|
||||
var _invariant2 = _interopRequireDefault(_invariant);
|
||||
|
||||
var isCallingCanDrop = false;
|
||||
|
||||
var TargetMonitor = (function () {
|
||||
function TargetMonitor(manager) {
|
||||
_classCallCheck(this, TargetMonitor);
|
||||
|
||||
this.internalMonitor = manager.getMonitor();
|
||||
}
|
||||
|
||||
TargetMonitor.prototype.receiveHandlerId = function receiveHandlerId(targetId) {
|
||||
this.targetId = targetId;
|
||||
};
|
||||
|
||||
TargetMonitor.prototype.canDrop = function canDrop() {
|
||||
_invariant2['default'](!isCallingCanDrop, 'You may not call monitor.canDrop() inside your canDrop() implementation. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target-monitor.html');
|
||||
|
||||
try {
|
||||
isCallingCanDrop = true;
|
||||
return this.internalMonitor.canDropOnTarget(this.targetId);
|
||||
} finally {
|
||||
isCallingCanDrop = false;
|
||||
}
|
||||
};
|
||||
|
||||
TargetMonitor.prototype.isOver = function isOver(options) {
|
||||
return this.internalMonitor.isOverTarget(this.targetId, options);
|
||||
};
|
||||
|
||||
TargetMonitor.prototype.getItemType = function getItemType() {
|
||||
return this.internalMonitor.getItemType();
|
||||
};
|
||||
|
||||
TargetMonitor.prototype.getItem = function getItem() {
|
||||
return this.internalMonitor.getItem();
|
||||
};
|
||||
|
||||
TargetMonitor.prototype.getDropResult = function getDropResult() {
|
||||
return this.internalMonitor.getDropResult();
|
||||
};
|
||||
|
||||
TargetMonitor.prototype.didDrop = function didDrop() {
|
||||
return this.internalMonitor.didDrop();
|
||||
};
|
||||
|
||||
TargetMonitor.prototype.getInitialClientOffset = function getInitialClientOffset() {
|
||||
return this.internalMonitor.getInitialClientOffset();
|
||||
};
|
||||
|
||||
TargetMonitor.prototype.getInitialSourceClientOffset = function getInitialSourceClientOffset() {
|
||||
return this.internalMonitor.getInitialSourceClientOffset();
|
||||
};
|
||||
|
||||
TargetMonitor.prototype.getSourceClientOffset = function getSourceClientOffset() {
|
||||
return this.internalMonitor.getSourceClientOffset();
|
||||
};
|
||||
|
||||
TargetMonitor.prototype.getClientOffset = function getClientOffset() {
|
||||
return this.internalMonitor.getClientOffset();
|
||||
};
|
||||
|
||||
TargetMonitor.prototype.getDifferenceFromInitialOffset = function getDifferenceFromInitialOffset() {
|
||||
return this.internalMonitor.getDifferenceFromInitialOffset();
|
||||
};
|
||||
|
||||
return TargetMonitor;
|
||||
})();
|
||||
|
||||
function createTargetMonitor(manager) {
|
||||
return new TargetMonitor(manager);
|
||||
}
|
||||
|
||||
module.exports = exports['default'];
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/lib/createTargetMonitor.js
|
||||
// module id = 2747
|
||||
// module chunks = 4
|
188
509bba0_unpacked_with_node_modules/~/react-dnd/lib/decorateHandler.js
generated
vendored
Executable file
188
509bba0_unpacked_with_node_modules/~/react-dnd/lib/decorateHandler.js
generated
vendored
Executable file
|
@ -0,0 +1,188 @@
|
|||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
||||
|
||||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
||||
|
||||
exports['default'] = decorateHandler;
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
var _react = require('react');
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _disposables = require('disposables');
|
||||
|
||||
var _utilsShallowEqual = require('./utils/shallowEqual');
|
||||
|
||||
var _utilsShallowEqual2 = _interopRequireDefault(_utilsShallowEqual);
|
||||
|
||||
var _utilsShallowEqualScalar = require('./utils/shallowEqualScalar');
|
||||
|
||||
var _utilsShallowEqualScalar2 = _interopRequireDefault(_utilsShallowEqualScalar);
|
||||
|
||||
var _lodashLangIsPlainObject = require('lodash/lang/isPlainObject');
|
||||
|
||||
var _lodashLangIsPlainObject2 = _interopRequireDefault(_lodashLangIsPlainObject);
|
||||
|
||||
var _invariant = require('invariant');
|
||||
|
||||
var _invariant2 = _interopRequireDefault(_invariant);
|
||||
|
||||
var _bindConnector2 = require('./bindConnector');
|
||||
|
||||
var _bindConnector3 = _interopRequireDefault(_bindConnector2);
|
||||
|
||||
function decorateHandler(_ref) {
|
||||
var DecoratedComponent = _ref.DecoratedComponent;
|
||||
var createHandler = _ref.createHandler;
|
||||
var createMonitor = _ref.createMonitor;
|
||||
var createConnector = _ref.createConnector;
|
||||
var registerHandler = _ref.registerHandler;
|
||||
var containerDisplayName = _ref.containerDisplayName;
|
||||
var getType = _ref.getType;
|
||||
var collect = _ref.collect;
|
||||
var options = _ref.options;
|
||||
var _options$arePropsEqual = options.arePropsEqual;
|
||||
var arePropsEqual = _options$arePropsEqual === undefined ? _utilsShallowEqualScalar2['default'] : _options$arePropsEqual;
|
||||
|
||||
var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component';
|
||||
|
||||
return (function (_Component) {
|
||||
_inherits(DragDropContainer, _Component);
|
||||
|
||||
DragDropContainer.prototype.getHandlerId = function getHandlerId() {
|
||||
return this.handlerId;
|
||||
};
|
||||
|
||||
DragDropContainer.prototype.getDecoratedComponentInstance = function getDecoratedComponentInstance() {
|
||||
return this.decoratedComponentInstance;
|
||||
};
|
||||
|
||||
DragDropContainer.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) {
|
||||
return !arePropsEqual(nextProps, this.props) || !_utilsShallowEqual2['default'](nextState, this.state);
|
||||
};
|
||||
|
||||
_createClass(DragDropContainer, null, [{
|
||||
key: 'DecoratedComponent',
|
||||
value: DecoratedComponent,
|
||||
enumerable: true
|
||||
}, {
|
||||
key: 'displayName',
|
||||
value: containerDisplayName + '(' + displayName + ')',
|
||||
enumerable: true
|
||||
}, {
|
||||
key: 'contextTypes',
|
||||
value: {
|
||||
dragDropManager: _react.PropTypes.object.isRequired
|
||||
},
|
||||
enumerable: true
|
||||
}]);
|
||||
|
||||
function DragDropContainer(props, context) {
|
||||
_classCallCheck(this, DragDropContainer);
|
||||
|
||||
_Component.call(this, props, context);
|
||||
this.handleChange = this.handleChange.bind(this);
|
||||
this.handleChildRef = this.handleChildRef.bind(this);
|
||||
|
||||
_invariant2['default'](typeof this.context.dragDropManager === 'object', 'Could not find the drag and drop manager in the context of %s. ' + 'Make sure to wrap the top-level component of your app with DragDropContext. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context', displayName, displayName);
|
||||
|
||||
this.manager = this.context.dragDropManager;
|
||||
this.handlerMonitor = createMonitor(this.manager);
|
||||
this.handler = createHandler(this.handlerMonitor);
|
||||
this.disposable = new _disposables.SerialDisposable();
|
||||
|
||||
this.receiveProps(props);
|
||||
this.state = this.getCurrentState();
|
||||
}
|
||||
|
||||
DragDropContainer.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
||||
if (!arePropsEqual(nextProps, this.props)) {
|
||||
this.receiveProps(nextProps);
|
||||
this.handleChange();
|
||||
}
|
||||
};
|
||||
|
||||
DragDropContainer.prototype.componentWillUnmount = function componentWillUnmount() {
|
||||
this.disposable.dispose();
|
||||
};
|
||||
|
||||
DragDropContainer.prototype.receiveProps = function receiveProps(props) {
|
||||
this.handler.receiveProps(props);
|
||||
this.receiveType(getType(props));
|
||||
};
|
||||
|
||||
DragDropContainer.prototype.receiveType = function receiveType(type) {
|
||||
if (type === this.currentType) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.currentType = type;
|
||||
|
||||
var _registerHandler = registerHandler(type, this.handler, this.manager);
|
||||
|
||||
var handlerId = _registerHandler.handlerId;
|
||||
var unregister = _registerHandler.unregister;
|
||||
|
||||
var connector = createConnector(this.manager.getBackend());
|
||||
|
||||
var _bindConnector = _bindConnector3['default'](connector, handlerId);
|
||||
|
||||
var handlerConnector = _bindConnector.handlerConnector;
|
||||
var connectorDisposable = _bindConnector.disposable;
|
||||
|
||||
this.handlerId = handlerId;
|
||||
this.handlerConnector = handlerConnector;
|
||||
this.handlerMonitor.receiveHandlerId(handlerId);
|
||||
|
||||
var globalMonitor = this.manager.getMonitor();
|
||||
var unsubscribe = globalMonitor.subscribeToStateChange(this.handleChange, { handlerIds: [handlerId] });
|
||||
|
||||
this.disposable.setDisposable(new _disposables.CompositeDisposable(new _disposables.Disposable(unsubscribe), new _disposables.Disposable(unregister), connectorDisposable));
|
||||
};
|
||||
|
||||
DragDropContainer.prototype.handleChange = function handleChange() {
|
||||
var nextState = this.getCurrentState();
|
||||
if (!_utilsShallowEqual2['default'](nextState, this.state)) {
|
||||
this.setState(nextState);
|
||||
}
|
||||
};
|
||||
|
||||
DragDropContainer.prototype.handleChildRef = function handleChildRef(component) {
|
||||
this.decoratedComponentInstance = component;
|
||||
this.handler.receiveComponent(component);
|
||||
};
|
||||
|
||||
DragDropContainer.prototype.getCurrentState = function getCurrentState() {
|
||||
var nextState = collect(this.handlerConnector, this.handlerMonitor);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
_invariant2['default'](_lodashLangIsPlainObject2['default'](nextState), 'Expected `collect` specified as the second argument to ' + '%s for %s to return a plain object of props to inject. ' + 'Instead, received %s.', containerDisplayName, displayName, nextState);
|
||||
}
|
||||
return nextState;
|
||||
};
|
||||
|
||||
DragDropContainer.prototype.render = function render() {
|
||||
return _react2['default'].createElement(DecoratedComponent, _extends({}, this.props, this.state, {
|
||||
ref: this.handleChildRef }));
|
||||
};
|
||||
|
||||
return DragDropContainer;
|
||||
})(_react.Component);
|
||||
}
|
||||
|
||||
module.exports = exports['default'];
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/lib/decorateHandler.js
|
||||
// module id = 1119
|
||||
// module chunks = 4
|
37
509bba0_unpacked_with_node_modules/~/react-dnd/lib/index.js
generated
vendored
Executable file
37
509bba0_unpacked_with_node_modules/~/react-dnd/lib/index.js
generated
vendored
Executable file
|
@ -0,0 +1,37 @@
|
|||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
function _interopRequire(obj) { return obj && obj.__esModule ? obj['default'] : obj; }
|
||||
|
||||
var _DragDropContext = require('./DragDropContext');
|
||||
|
||||
exports.DragDropContext = _interopRequire(_DragDropContext);
|
||||
|
||||
var _DragLayer = require('./DragLayer');
|
||||
|
||||
exports.DragLayer = _interopRequire(_DragLayer);
|
||||
|
||||
var _DragSource = require('./DragSource');
|
||||
|
||||
exports.DragSource = _interopRequire(_DragSource);
|
||||
|
||||
var _DropTarget = require('./DropTarget');
|
||||
|
||||
exports.DropTarget = _interopRequire(_DropTarget);
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
Object.defineProperty(exports, 'default', {
|
||||
get: function get() {
|
||||
console.error( // eslint-disable-line no-console
|
||||
'React DnD does not provide a default export. ' + 'You are probably missing the curly braces in the import statement. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#react-dnd-does-not-provide-a-default-export');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/lib/index.js
|
||||
// module id = 254
|
||||
// module chunks = 4
|
27
509bba0_unpacked_with_node_modules/~/react-dnd/lib/registerSource.js
generated
vendored
Executable file
27
509bba0_unpacked_with_node_modules/~/react-dnd/lib/registerSource.js
generated
vendored
Executable file
|
@ -0,0 +1,27 @@
|
|||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports["default"] = registerSource;
|
||||
|
||||
function registerSource(type, source, manager) {
|
||||
var registry = manager.getRegistry();
|
||||
var sourceId = registry.addSource(type, source);
|
||||
|
||||
function unregisterSource() {
|
||||
registry.removeSource(sourceId);
|
||||
}
|
||||
|
||||
return {
|
||||
handlerId: sourceId,
|
||||
unregister: unregisterSource
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = exports["default"];
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/lib/registerSource.js
|
||||
// module id = 2748
|
||||
// module chunks = 4
|
27
509bba0_unpacked_with_node_modules/~/react-dnd/lib/registerTarget.js
generated
vendored
Executable file
27
509bba0_unpacked_with_node_modules/~/react-dnd/lib/registerTarget.js
generated
vendored
Executable file
|
@ -0,0 +1,27 @@
|
|||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports["default"] = registerTarget;
|
||||
|
||||
function registerTarget(type, target, manager) {
|
||||
var registry = manager.getRegistry();
|
||||
var targetId = registry.addTarget(type, target);
|
||||
|
||||
function unregisterTarget() {
|
||||
registry.removeTarget(targetId);
|
||||
}
|
||||
|
||||
return {
|
||||
handlerId: targetId,
|
||||
unregister: unregisterTarget
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = exports["default"];
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/lib/registerTarget.js
|
||||
// module id = 2749
|
||||
// module chunks = 4
|
30
509bba0_unpacked_with_node_modules/~/react-dnd/lib/utils/checkDecoratorArguments.js
generated
vendored
Executable file
30
509bba0_unpacked_with_node_modules/~/react-dnd/lib/utils/checkDecoratorArguments.js
generated
vendored
Executable file
|
@ -0,0 +1,30 @@
|
|||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports['default'] = checkDecoratorArguments;
|
||||
|
||||
function checkDecoratorArguments(functionName, signature) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
||||
args[_key - 2] = arguments[_key];
|
||||
}
|
||||
|
||||
for (var i = 0; i < args.length; i++) {
|
||||
var arg = args[i];
|
||||
if (arg && arg.prototype && arg.prototype.render) {
|
||||
console.error( // eslint-disable-line no-console
|
||||
'You seem to be applying the arguments in the wrong order. ' + ('It should be ' + functionName + '(' + signature + ')(Component), not the other way around. ') + 'Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#you-seem-to-be-applying-the-arguments-in-the-wrong-order');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = exports['default'];
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/lib/utils/checkDecoratorArguments.js
|
||||
// module id = 439
|
||||
// module chunks = 4
|
36
509bba0_unpacked_with_node_modules/~/react-dnd/lib/utils/cloneWithRef.js
generated
vendored
Executable file
36
509bba0_unpacked_with_node_modules/~/react-dnd/lib/utils/cloneWithRef.js
generated
vendored
Executable file
|
@ -0,0 +1,36 @@
|
|||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports['default'] = cloneWithRef;
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
var _invariant = require('invariant');
|
||||
|
||||
var _invariant2 = _interopRequireDefault(_invariant);
|
||||
|
||||
var _react = require('react');
|
||||
|
||||
function cloneWithRef(element, newRef) {
|
||||
var previousRef = element.ref;
|
||||
_invariant2['default'](typeof previousRef !== 'string', 'Cannot connect React DnD to an element with an existing string ref. ' + 'Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. ' + 'Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute');
|
||||
|
||||
return _react.cloneElement(element, {
|
||||
ref: function ref(instance) {
|
||||
newRef(instance);
|
||||
|
||||
if (previousRef) {
|
||||
previousRef(instance);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = exports['default'];
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/lib/utils/cloneWithRef.js
|
||||
// module id = 2750
|
||||
// module chunks = 4
|
25
509bba0_unpacked_with_node_modules/~/react-dnd/lib/utils/isValidType.js
generated
vendored
Executable file
25
509bba0_unpacked_with_node_modules/~/react-dnd/lib/utils/isValidType.js
generated
vendored
Executable file
|
@ -0,0 +1,25 @@
|
|||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports['default'] = isValidType;
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
var _lodashLangIsArray = require('lodash/lang/isArray');
|
||||
|
||||
var _lodashLangIsArray2 = _interopRequireDefault(_lodashLangIsArray);
|
||||
|
||||
function isValidType(type, allowArray) {
|
||||
return typeof type === 'string' || typeof type === 'symbol' || allowArray && _lodashLangIsArray2['default'](type) && type.every(function (t) {
|
||||
return isValidType(t, false);
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = exports['default'];
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/lib/utils/isValidType.js
|
||||
// module id = 1120
|
||||
// module chunks = 4
|
43
509bba0_unpacked_with_node_modules/~/react-dnd/lib/utils/shallowEqual.js
generated
vendored
Executable file
43
509bba0_unpacked_with_node_modules/~/react-dnd/lib/utils/shallowEqual.js
generated
vendored
Executable file
|
@ -0,0 +1,43 @@
|
|||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports["default"] = shallowEqual;
|
||||
|
||||
function shallowEqual(objA, objB) {
|
||||
if (objA === objB) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var keysA = Object.keys(objA);
|
||||
var keysB = Object.keys(objB);
|
||||
|
||||
if (keysA.length !== keysB.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Test for A's keys different from B.
|
||||
var hasOwn = Object.prototype.hasOwnProperty;
|
||||
for (var i = 0; i < keysA.length; i++) {
|
||||
if (!hasOwn.call(objB, keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var valA = objA[keysA[i]];
|
||||
var valB = objB[keysA[i]];
|
||||
|
||||
if (valA !== valB) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
module.exports = exports["default"];
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/lib/utils/shallowEqual.js
|
||||
// module id = 649
|
||||
// module chunks = 4
|
47
509bba0_unpacked_with_node_modules/~/react-dnd/lib/utils/shallowEqualScalar.js
generated
vendored
Executable file
47
509bba0_unpacked_with_node_modules/~/react-dnd/lib/utils/shallowEqualScalar.js
generated
vendored
Executable file
|
@ -0,0 +1,47 @@
|
|||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports['default'] = shallowEqualScalar;
|
||||
|
||||
function shallowEqualScalar(objA, objB) {
|
||||
if (objA === objB) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var keysA = Object.keys(objA);
|
||||
var keysB = Object.keys(objB);
|
||||
|
||||
if (keysA.length !== keysB.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Test for A's keys different from B.
|
||||
var hasOwn = Object.prototype.hasOwnProperty;
|
||||
for (var i = 0; i < keysA.length; i++) {
|
||||
if (!hasOwn.call(objB, keysA[i])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var valA = objA[keysA[i]];
|
||||
var valB = objB[keysA[i]];
|
||||
|
||||
if (valA !== valB || typeof valA === 'object' || typeof valB === 'object') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
module.exports = exports['default'];
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/lib/utils/shallowEqualScalar.js
|
||||
// module id = 1121
|
||||
// module chunks = 4
|
25
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/internal/baseFor.js
generated
vendored
Executable file
25
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/internal/baseFor.js
generated
vendored
Executable file
|
@ -0,0 +1,25 @@
|
|||
var createBaseFor = require('./createBaseFor');
|
||||
|
||||
/**
|
||||
* The base implementation of `baseForIn` and `baseForOwn` which iterates
|
||||
* over `object` properties returned by `keysFunc` invoking `iteratee` for
|
||||
* each property. Iteratee functions may exit iteration early by explicitly
|
||||
* returning `false`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @param {Function} keysFunc The function to get the keys of `object`.
|
||||
* @returns {Object} Returns `object`.
|
||||
*/
|
||||
var baseFor = createBaseFor();
|
||||
|
||||
module.exports = baseFor;
|
||||
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/~/lodash/internal/baseFor.js
|
||||
// module id = 2751
|
||||
// module chunks = 4
|
25
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/internal/baseForIn.js
generated
vendored
Executable file
25
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/internal/baseForIn.js
generated
vendored
Executable file
|
@ -0,0 +1,25 @@
|
|||
var baseFor = require('./baseFor'),
|
||||
keysIn = require('../object/keysIn');
|
||||
|
||||
/**
|
||||
* The base implementation of `_.forIn` without support for callback
|
||||
* shorthands and `this` binding.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @returns {Object} Returns `object`.
|
||||
*/
|
||||
function baseForIn(object, iteratee) {
|
||||
return baseFor(object, iteratee, keysIn);
|
||||
}
|
||||
|
||||
module.exports = baseForIn;
|
||||
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/~/lodash/internal/baseForIn.js
|
||||
// module id = 2752
|
||||
// module chunks = 4
|
22
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/internal/baseProperty.js
generated
vendored
Executable file
22
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/internal/baseProperty.js
generated
vendored
Executable file
|
@ -0,0 +1,22 @@
|
|||
/**
|
||||
* The base implementation of `_.property` without support for deep paths.
|
||||
*
|
||||
* @private
|
||||
* @param {string} key The key of the property to get.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function baseProperty(key) {
|
||||
return function(object) {
|
||||
return object == null ? undefined : object[key];
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = baseProperty;
|
||||
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/~/lodash/internal/baseProperty.js
|
||||
// module id = 2753
|
||||
// module chunks = 4
|
35
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/internal/createBaseFor.js
generated
vendored
Executable file
35
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/internal/createBaseFor.js
generated
vendored
Executable file
|
@ -0,0 +1,35 @@
|
|||
var toObject = require('./toObject');
|
||||
|
||||
/**
|
||||
* Creates a base function for `_.forIn` or `_.forInRight`.
|
||||
*
|
||||
* @private
|
||||
* @param {boolean} [fromRight] Specify iterating from right to left.
|
||||
* @returns {Function} Returns the new base function.
|
||||
*/
|
||||
function createBaseFor(fromRight) {
|
||||
return function(object, iteratee, keysFunc) {
|
||||
var iterable = toObject(object),
|
||||
props = keysFunc(object),
|
||||
length = props.length,
|
||||
index = fromRight ? length : -1;
|
||||
|
||||
while ((fromRight ? index-- : ++index < length)) {
|
||||
var key = props[index];
|
||||
if (iteratee(iterable[key], key, iterable) === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return object;
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = createBaseFor;
|
||||
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/~/lodash/internal/createBaseFor.js
|
||||
// module id = 2754
|
||||
// module chunks = 4
|
23
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/internal/getLength.js
generated
vendored
Executable file
23
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/internal/getLength.js
generated
vendored
Executable file
|
@ -0,0 +1,23 @@
|
|||
var baseProperty = require('./baseProperty');
|
||||
|
||||
/**
|
||||
* Gets the "length" property value of `object`.
|
||||
*
|
||||
* **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
|
||||
* that affects Safari on at least iOS 8.1-8.3 ARM64.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to query.
|
||||
* @returns {*} Returns the "length" value.
|
||||
*/
|
||||
var getLength = baseProperty('length');
|
||||
|
||||
module.exports = getLength;
|
||||
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/~/lodash/internal/getLength.js
|
||||
// module id = 2755
|
||||
// module chunks = 4
|
24
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/internal/getNative.js
generated
vendored
Executable file
24
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/internal/getNative.js
generated
vendored
Executable file
|
@ -0,0 +1,24 @@
|
|||
var isNative = require('../lang/isNative');
|
||||
|
||||
/**
|
||||
* Gets the native function at `key` of `object`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to query.
|
||||
* @param {string} key The key of the method to get.
|
||||
* @returns {*} Returns the function if it's native, else `undefined`.
|
||||
*/
|
||||
function getNative(object, key) {
|
||||
var value = object == null ? undefined : object[key];
|
||||
return isNative(value) ? value : undefined;
|
||||
}
|
||||
|
||||
module.exports = getNative;
|
||||
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/~/lodash/internal/getNative.js
|
||||
// module id = 2756
|
||||
// module chunks = 4
|
23
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/internal/isArrayLike.js
generated
vendored
Executable file
23
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/internal/isArrayLike.js
generated
vendored
Executable file
|
@ -0,0 +1,23 @@
|
|||
var getLength = require('./getLength'),
|
||||
isLength = require('./isLength');
|
||||
|
||||
/**
|
||||
* Checks if `value` is array-like.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
||||
*/
|
||||
function isArrayLike(value) {
|
||||
return value != null && isLength(getLength(value));
|
||||
}
|
||||
|
||||
module.exports = isArrayLike;
|
||||
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/~/lodash/internal/isArrayLike.js
|
||||
// module id = 2757
|
||||
// module chunks = 4
|
32
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/internal/isIndex.js
generated
vendored
Executable file
32
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/internal/isIndex.js
generated
vendored
Executable file
|
@ -0,0 +1,32 @@
|
|||
/** Used to detect unsigned integer values. */
|
||||
var reIsUint = /^\d+$/;
|
||||
|
||||
/**
|
||||
* Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
|
||||
* of an array-like value.
|
||||
*/
|
||||
var MAX_SAFE_INTEGER = 9007199254740991;
|
||||
|
||||
/**
|
||||
* Checks if `value` is a valid array-like index.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to check.
|
||||
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
||||
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
||||
*/
|
||||
function isIndex(value, length) {
|
||||
value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
|
||||
length = length == null ? MAX_SAFE_INTEGER : length;
|
||||
return value > -1 && value % 1 == 0 && value < length;
|
||||
}
|
||||
|
||||
module.exports = isIndex;
|
||||
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/~/lodash/internal/isIndex.js
|
||||
// module id = 2758
|
||||
// module chunks = 4
|
28
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/internal/isLength.js
generated
vendored
Executable file
28
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/internal/isLength.js
generated
vendored
Executable file
|
@ -0,0 +1,28 @@
|
|||
/**
|
||||
* Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
|
||||
* of an array-like value.
|
||||
*/
|
||||
var MAX_SAFE_INTEGER = 9007199254740991;
|
||||
|
||||
/**
|
||||
* Checks if `value` is a valid array-like length.
|
||||
*
|
||||
* **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
||||
*/
|
||||
function isLength(value) {
|
||||
return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
||||
}
|
||||
|
||||
module.exports = isLength;
|
||||
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/~/lodash/internal/isLength.js
|
||||
// module id = 650
|
||||
// module chunks = 4
|
20
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/internal/isObjectLike.js
generated
vendored
Executable file
20
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/internal/isObjectLike.js
generated
vendored
Executable file
|
@ -0,0 +1,20 @@
|
|||
/**
|
||||
* Checks if `value` is object-like.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
||||
*/
|
||||
function isObjectLike(value) {
|
||||
return !!value && typeof value == 'object';
|
||||
}
|
||||
|
||||
module.exports = isObjectLike;
|
||||
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/~/lodash/internal/isObjectLike.js
|
||||
// module id = 440
|
||||
// module chunks = 4
|
22
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/internal/toObject.js
generated
vendored
Executable file
22
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/internal/toObject.js
generated
vendored
Executable file
|
@ -0,0 +1,22 @@
|
|||
var isObject = require('../lang/isObject');
|
||||
|
||||
/**
|
||||
* Converts `value` to an object if it's not one.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to process.
|
||||
* @returns {Object} Returns the object.
|
||||
*/
|
||||
function toObject(value) {
|
||||
return isObject(value) ? value : Object(value);
|
||||
}
|
||||
|
||||
module.exports = toObject;
|
||||
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/~/lodash/internal/toObject.js
|
||||
// module id = 2759
|
||||
// module chunks = 4
|
42
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/lang/isArguments.js
generated
vendored
Executable file
42
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/lang/isArguments.js
generated
vendored
Executable file
|
@ -0,0 +1,42 @@
|
|||
var isArrayLike = require('../internal/isArrayLike'),
|
||||
isObjectLike = require('../internal/isObjectLike');
|
||||
|
||||
/** Used for native method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/** Native method references. */
|
||||
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
||||
|
||||
/**
|
||||
* Checks if `value` is classified as an `arguments` object.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Lang
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isArguments(function() { return arguments; }());
|
||||
* // => true
|
||||
*
|
||||
* _.isArguments([1, 2, 3]);
|
||||
* // => false
|
||||
*/
|
||||
function isArguments(value) {
|
||||
return isObjectLike(value) && isArrayLike(value) &&
|
||||
hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
|
||||
}
|
||||
|
||||
module.exports = isArguments;
|
||||
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/~/lodash/lang/isArguments.js
|
||||
// module id = 1122
|
||||
// module chunks = 4
|
48
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/lang/isArray.js
generated
vendored
Executable file
48
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/lang/isArray.js
generated
vendored
Executable file
|
@ -0,0 +1,48 @@
|
|||
var getNative = require('../internal/getNative'),
|
||||
isLength = require('../internal/isLength'),
|
||||
isObjectLike = require('../internal/isObjectLike');
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var arrayTag = '[object Array]';
|
||||
|
||||
/** Used for native method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/**
|
||||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
||||
* of values.
|
||||
*/
|
||||
var objToString = objectProto.toString;
|
||||
|
||||
/* Native method references for those with the same name as other `lodash` methods. */
|
||||
var nativeIsArray = getNative(Array, 'isArray');
|
||||
|
||||
/**
|
||||
* Checks if `value` is classified as an `Array` object.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Lang
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isArray([1, 2, 3]);
|
||||
* // => true
|
||||
*
|
||||
* _.isArray(function() { return arguments; }());
|
||||
* // => false
|
||||
*/
|
||||
var isArray = nativeIsArray || function(value) {
|
||||
return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
|
||||
};
|
||||
|
||||
module.exports = isArray;
|
||||
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/~/lodash/lang/isArray.js
|
||||
// module id = 1123
|
||||
// module chunks = 4
|
46
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/lang/isFunction.js
generated
vendored
Executable file
46
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/lang/isFunction.js
generated
vendored
Executable file
|
@ -0,0 +1,46 @@
|
|||
var isObject = require('./isObject');
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var funcTag = '[object Function]';
|
||||
|
||||
/** Used for native method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/**
|
||||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
||||
* of values.
|
||||
*/
|
||||
var objToString = objectProto.toString;
|
||||
|
||||
/**
|
||||
* Checks if `value` is classified as a `Function` object.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Lang
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isFunction(_);
|
||||
* // => true
|
||||
*
|
||||
* _.isFunction(/abc/);
|
||||
* // => false
|
||||
*/
|
||||
function isFunction(value) {
|
||||
// The use of `Object#toString` avoids issues with the `typeof` operator
|
||||
// in older versions of Chrome and Safari which return 'function' for regexes
|
||||
// and Safari 8 which returns 'object' for typed array constructors.
|
||||
return isObject(value) && objToString.call(value) == funcTag;
|
||||
}
|
||||
|
||||
module.exports = isFunction;
|
||||
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/~/lodash/lang/isFunction.js
|
||||
// module id = 2760
|
||||
// module chunks = 4
|
56
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/lang/isNative.js
generated
vendored
Executable file
56
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/lang/isNative.js
generated
vendored
Executable file
|
@ -0,0 +1,56 @@
|
|||
var isFunction = require('./isFunction'),
|
||||
isObjectLike = require('../internal/isObjectLike');
|
||||
|
||||
/** Used to detect host constructors (Safari > 5). */
|
||||
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
||||
|
||||
/** Used for native method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/** Used to resolve the decompiled source of functions. */
|
||||
var fnToString = Function.prototype.toString;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/** Used to detect if a method is native. */
|
||||
var reIsNative = RegExp('^' +
|
||||
fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
|
||||
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
||||
);
|
||||
|
||||
/**
|
||||
* Checks if `value` is a native function.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Lang
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is a native function, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isNative(Array.prototype.push);
|
||||
* // => true
|
||||
*
|
||||
* _.isNative(_);
|
||||
* // => false
|
||||
*/
|
||||
function isNative(value) {
|
||||
if (value == null) {
|
||||
return false;
|
||||
}
|
||||
if (isFunction(value)) {
|
||||
return reIsNative.test(fnToString.call(value));
|
||||
}
|
||||
return isObjectLike(value) && reIsHostCtor.test(value);
|
||||
}
|
||||
|
||||
module.exports = isNative;
|
||||
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/~/lodash/lang/isNative.js
|
||||
// module id = 2761
|
||||
// module chunks = 4
|
36
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/lang/isObject.js
generated
vendored
Executable file
36
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/lang/isObject.js
generated
vendored
Executable file
|
@ -0,0 +1,36 @@
|
|||
/**
|
||||
* Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
|
||||
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Lang
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isObject({});
|
||||
* // => true
|
||||
*
|
||||
* _.isObject([1, 2, 3]);
|
||||
* // => true
|
||||
*
|
||||
* _.isObject(1);
|
||||
* // => false
|
||||
*/
|
||||
function isObject(value) {
|
||||
// Avoid a V8 JIT bug in Chrome 19-20.
|
||||
// See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
|
||||
var type = typeof value;
|
||||
return !!value && (type == 'object' || type == 'function');
|
||||
}
|
||||
|
||||
module.exports = isObject;
|
||||
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/~/lodash/lang/isObject.js
|
||||
// module id = 651
|
||||
// module chunks = 4
|
79
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/lang/isPlainObject.js
generated
vendored
Executable file
79
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/lang/isPlainObject.js
generated
vendored
Executable file
|
@ -0,0 +1,79 @@
|
|||
var baseForIn = require('../internal/baseForIn'),
|
||||
isArguments = require('./isArguments'),
|
||||
isObjectLike = require('../internal/isObjectLike');
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var objectTag = '[object Object]';
|
||||
|
||||
/** Used for native method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
||||
* of values.
|
||||
*/
|
||||
var objToString = objectProto.toString;
|
||||
|
||||
/**
|
||||
* Checks if `value` is a plain object, that is, an object created by the
|
||||
* `Object` constructor or one with a `[[Prototype]]` of `null`.
|
||||
*
|
||||
* **Note:** This method assumes objects created by the `Object` constructor
|
||||
* have no inherited enumerable properties.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Lang
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
|
||||
* @example
|
||||
*
|
||||
* function Foo() {
|
||||
* this.a = 1;
|
||||
* }
|
||||
*
|
||||
* _.isPlainObject(new Foo);
|
||||
* // => false
|
||||
*
|
||||
* _.isPlainObject([1, 2, 3]);
|
||||
* // => false
|
||||
*
|
||||
* _.isPlainObject({ 'x': 0, 'y': 0 });
|
||||
* // => true
|
||||
*
|
||||
* _.isPlainObject(Object.create(null));
|
||||
* // => true
|
||||
*/
|
||||
function isPlainObject(value) {
|
||||
var Ctor;
|
||||
|
||||
// Exit early for non `Object` objects.
|
||||
if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isArguments(value)) ||
|
||||
(!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
|
||||
return false;
|
||||
}
|
||||
// IE < 9 iterates inherited properties before own properties. If the first
|
||||
// iterated property is an object's own property then there are no inherited
|
||||
// enumerable properties.
|
||||
var result;
|
||||
// In most environments an object's own properties are iterated before
|
||||
// its inherited properties. If the last iterated property is an object's
|
||||
// own property then there are no inherited enumerable properties.
|
||||
baseForIn(value, function(subValue, key) {
|
||||
result = key;
|
||||
});
|
||||
return result === undefined || hasOwnProperty.call(value, result);
|
||||
}
|
||||
|
||||
module.exports = isPlainObject;
|
||||
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/~/lodash/lang/isPlainObject.js
|
||||
// module id = 285
|
||||
// module chunks = 4
|
72
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/object/keysIn.js
generated
vendored
Executable file
72
509bba0_unpacked_with_node_modules/~/react-dnd/~/lodash/object/keysIn.js
generated
vendored
Executable file
|
@ -0,0 +1,72 @@
|
|||
var isArguments = require('../lang/isArguments'),
|
||||
isArray = require('../lang/isArray'),
|
||||
isIndex = require('../internal/isIndex'),
|
||||
isLength = require('../internal/isLength'),
|
||||
isObject = require('../lang/isObject');
|
||||
|
||||
/** Used for native method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* Creates an array of the own and inherited enumerable property names of `object`.
|
||||
*
|
||||
* **Note:** Non-object values are coerced to objects.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Object
|
||||
* @param {Object} object The object to query.
|
||||
* @returns {Array} Returns the array of property names.
|
||||
* @example
|
||||
*
|
||||
* function Foo() {
|
||||
* this.a = 1;
|
||||
* this.b = 2;
|
||||
* }
|
||||
*
|
||||
* Foo.prototype.c = 3;
|
||||
*
|
||||
* _.keysIn(new Foo);
|
||||
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
|
||||
*/
|
||||
function keysIn(object) {
|
||||
if (object == null) {
|
||||
return [];
|
||||
}
|
||||
if (!isObject(object)) {
|
||||
object = Object(object);
|
||||
}
|
||||
var length = object.length;
|
||||
length = (length && isLength(length) &&
|
||||
(isArray(object) || isArguments(object)) && length) || 0;
|
||||
|
||||
var Ctor = object.constructor,
|
||||
index = -1,
|
||||
isProto = typeof Ctor == 'function' && Ctor.prototype === object,
|
||||
result = Array(length),
|
||||
skipIndexes = length > 0;
|
||||
|
||||
while (++index < length) {
|
||||
result[index] = (index + '');
|
||||
}
|
||||
for (var key in object) {
|
||||
if (!(skipIndexes && isIndex(key, length)) &&
|
||||
!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
|
||||
result.push(key);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = keysIn;
|
||||
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-dnd/~/lodash/object/keysIn.js
|
||||
// module id = 2762
|
||||
// module chunks = 4
|
Loading…
Add table
Add a link
Reference in a new issue