mirror of
https://kevinblog.sytes.net/Code/Jibo-Revival-Group/RoboCommander.git
synced 2026-06-15 12:56:08 +00:00
Initial commit
This commit is contained in:
75
node_modules/react-bootstrap/es/utils/PropTypes.js
generated
vendored
Normal file
75
node_modules/react-bootstrap/es/utils/PropTypes.js
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import createChainableTypeChecker from 'prop-types-extra/lib/utils/createChainableTypeChecker';
|
||||
import ValidComponentChildren from './ValidComponentChildren';
|
||||
var idPropType = PropTypes.oneOfType([PropTypes.string, PropTypes.number]);
|
||||
export function generatedId(name) {
|
||||
return function (props) {
|
||||
var error = null;
|
||||
|
||||
if (!props.generateChildId) {
|
||||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
args[_key - 1] = arguments[_key];
|
||||
}
|
||||
|
||||
error = idPropType.apply(void 0, [props].concat(args));
|
||||
|
||||
if (!error && !props.id) {
|
||||
error = new Error("In order to properly initialize the " + name + " in a way that is accessible to assistive technologies " + ("(such as screen readers) an `id` or a `generateChildId` prop to " + name + " is required"));
|
||||
}
|
||||
}
|
||||
|
||||
return error;
|
||||
};
|
||||
}
|
||||
export function requiredRoles() {
|
||||
for (var _len2 = arguments.length, roles = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
roles[_key2] = arguments[_key2];
|
||||
}
|
||||
|
||||
return createChainableTypeChecker(function (props, propName, component) {
|
||||
var missing;
|
||||
roles.every(function (role) {
|
||||
if (!ValidComponentChildren.some(props.children, function (child) {
|
||||
return child.props.bsRole === role;
|
||||
})) {
|
||||
missing = role;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
if (missing) {
|
||||
return new Error("(children) " + component + " - Missing a required child with bsRole: " + (missing + ". " + component + " must have at least one child of each of ") + ("the following bsRoles: " + roles.join(', ')));
|
||||
}
|
||||
|
||||
return null;
|
||||
});
|
||||
}
|
||||
export function exclusiveRoles() {
|
||||
for (var _len3 = arguments.length, roles = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
||||
roles[_key3] = arguments[_key3];
|
||||
}
|
||||
|
||||
return createChainableTypeChecker(function (props, propName, component) {
|
||||
var duplicate;
|
||||
roles.every(function (role) {
|
||||
var childrenWithRole = ValidComponentChildren.filter(props.children, function (child) {
|
||||
return child.props.bsRole === role;
|
||||
});
|
||||
|
||||
if (childrenWithRole.length > 1) {
|
||||
duplicate = role;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
if (duplicate) {
|
||||
return new Error("(children) " + component + " - Duplicate children detected of bsRole: " + (duplicate + ". Only one child each allowed with the following ") + ("bsRoles: " + roles.join(', ')));
|
||||
}
|
||||
|
||||
return null;
|
||||
});
|
||||
}
|
||||
28
node_modules/react-bootstrap/es/utils/StyleConfig.js
generated
vendored
Normal file
28
node_modules/react-bootstrap/es/utils/StyleConfig.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
export var Size = {
|
||||
LARGE: 'large',
|
||||
SMALL: 'small',
|
||||
XSMALL: 'xsmall'
|
||||
};
|
||||
export var SIZE_MAP = {
|
||||
large: 'lg',
|
||||
medium: 'md',
|
||||
small: 'sm',
|
||||
xsmall: 'xs',
|
||||
lg: 'lg',
|
||||
md: 'md',
|
||||
sm: 'sm',
|
||||
xs: 'xs'
|
||||
};
|
||||
export var DEVICE_SIZES = ['lg', 'md', 'sm', 'xs'];
|
||||
export var State = {
|
||||
SUCCESS: 'success',
|
||||
WARNING: 'warning',
|
||||
DANGER: 'danger',
|
||||
INFO: 'info'
|
||||
};
|
||||
export var Style = {
|
||||
DEFAULT: 'default',
|
||||
PRIMARY: 'primary',
|
||||
LINK: 'link',
|
||||
INVERSE: 'inverse'
|
||||
};
|
||||
174
node_modules/react-bootstrap/es/utils/ValidComponentChildren.js
generated
vendored
Normal file
174
node_modules/react-bootstrap/es/utils/ValidComponentChildren.js
generated
vendored
Normal file
@@ -0,0 +1,174 @@
|
||||
// TODO: This module should be ElementChildren, and should use named exports.
|
||||
import React from 'react';
|
||||
/**
|
||||
* Iterates through children that are typically specified as `props.children`,
|
||||
* but only maps over children that are "valid components".
|
||||
*
|
||||
* The mapFunction provided index will be normalised to the components mapped,
|
||||
* so an invalid component would not increase the index.
|
||||
*
|
||||
* @param {?*} children Children tree container.
|
||||
* @param {function(*, int)} func.
|
||||
* @param {*} context Context for func.
|
||||
* @return {object} Object containing the ordered map of results.
|
||||
*/
|
||||
|
||||
function map(children, func, context) {
|
||||
var index = 0;
|
||||
return React.Children.map(children, function (child) {
|
||||
if (!React.isValidElement(child)) {
|
||||
return child;
|
||||
}
|
||||
|
||||
return func.call(context, child, index++);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Iterates through children that are "valid components".
|
||||
*
|
||||
* The provided forEachFunc(child, index) will be called for each
|
||||
* leaf child with the index reflecting the position relative to "valid components".
|
||||
*
|
||||
* @param {?*} children Children tree container.
|
||||
* @param {function(*, int)} func.
|
||||
* @param {*} context Context for context.
|
||||
*/
|
||||
|
||||
|
||||
function forEach(children, func, context) {
|
||||
var index = 0;
|
||||
React.Children.forEach(children, function (child) {
|
||||
if (!React.isValidElement(child)) {
|
||||
return;
|
||||
}
|
||||
|
||||
func.call(context, child, index++);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Count the number of "valid components" in the Children container.
|
||||
*
|
||||
* @param {?*} children Children tree container.
|
||||
* @returns {number}
|
||||
*/
|
||||
|
||||
|
||||
function count(children) {
|
||||
var result = 0;
|
||||
React.Children.forEach(children, function (child) {
|
||||
if (!React.isValidElement(child)) {
|
||||
return;
|
||||
}
|
||||
|
||||
++result;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* Finds children that are typically specified as `props.children`,
|
||||
* but only iterates over children that are "valid components".
|
||||
*
|
||||
* The provided forEachFunc(child, index) will be called for each
|
||||
* leaf child with the index reflecting the position relative to "valid components".
|
||||
*
|
||||
* @param {?*} children Children tree container.
|
||||
* @param {function(*, int)} func.
|
||||
* @param {*} context Context for func.
|
||||
* @returns {array} of children that meet the func return statement
|
||||
*/
|
||||
|
||||
|
||||
function filter(children, func, context) {
|
||||
var index = 0;
|
||||
var result = [];
|
||||
React.Children.forEach(children, function (child) {
|
||||
if (!React.isValidElement(child)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (func.call(context, child, index++)) {
|
||||
result.push(child);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
function find(children, func, context) {
|
||||
var index = 0;
|
||||
var result;
|
||||
React.Children.forEach(children, function (child) {
|
||||
if (result) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!React.isValidElement(child)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (func.call(context, child, index++)) {
|
||||
result = child;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
function every(children, func, context) {
|
||||
var index = 0;
|
||||
var result = true;
|
||||
React.Children.forEach(children, function (child) {
|
||||
if (!result) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!React.isValidElement(child)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!func.call(context, child, index++)) {
|
||||
result = false;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
function some(children, func, context) {
|
||||
var index = 0;
|
||||
var result = false;
|
||||
React.Children.forEach(children, function (child) {
|
||||
if (result) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!React.isValidElement(child)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (func.call(context, child, index++)) {
|
||||
result = true;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
function toArray(children) {
|
||||
var result = [];
|
||||
React.Children.forEach(children, function (child) {
|
||||
if (!React.isValidElement(child)) {
|
||||
return;
|
||||
}
|
||||
|
||||
result.push(child);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
export default {
|
||||
map: map,
|
||||
forEach: forEach,
|
||||
count: count,
|
||||
find: find,
|
||||
filter: filter,
|
||||
every: every,
|
||||
some: some,
|
||||
toArray: toArray
|
||||
};
|
||||
181
node_modules/react-bootstrap/es/utils/bootstrapUtils.js
generated
vendored
Normal file
181
node_modules/react-bootstrap/es/utils/bootstrapUtils.js
generated
vendored
Normal file
@@ -0,0 +1,181 @@
|
||||
import _Object$entries from "@babel/runtime-corejs2/core-js/object/entries";
|
||||
import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
|
||||
// TODO: The publicly exposed parts of this should be in lib/BootstrapUtils.
|
||||
import invariant from 'invariant';
|
||||
import PropTypes from 'prop-types';
|
||||
import { SIZE_MAP } from './StyleConfig';
|
||||
|
||||
function curry(fn) {
|
||||
return function () {
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
var last = args[args.length - 1];
|
||||
|
||||
if (typeof last === 'function') {
|
||||
return fn.apply(void 0, args);
|
||||
}
|
||||
|
||||
return function (Component) {
|
||||
return fn.apply(void 0, args.concat([Component]));
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export function prefix(props, variant) {
|
||||
var bsClass = (props.bsClass || '').trim();
|
||||
!(bsClass != null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'A `bsClass` prop is required for this component') : invariant(false) : void 0;
|
||||
return bsClass + (variant ? "-" + variant : '');
|
||||
}
|
||||
export var bsClass = curry(function (defaultClass, Component) {
|
||||
var propTypes = Component.propTypes || (Component.propTypes = {});
|
||||
var defaultProps = Component.defaultProps || (Component.defaultProps = {});
|
||||
propTypes.bsClass = PropTypes.string;
|
||||
defaultProps.bsClass = defaultClass;
|
||||
return Component;
|
||||
});
|
||||
export var bsStyles = curry(function (styles, defaultStyle, Component) {
|
||||
if (typeof defaultStyle !== 'string') {
|
||||
Component = defaultStyle;
|
||||
defaultStyle = undefined;
|
||||
}
|
||||
|
||||
var existing = Component.STYLES || [];
|
||||
var propTypes = Component.propTypes || {};
|
||||
styles.forEach(function (style) {
|
||||
if (existing.indexOf(style) === -1) {
|
||||
existing.push(style);
|
||||
}
|
||||
});
|
||||
var propType = PropTypes.oneOf(existing); // expose the values on the propType function for documentation
|
||||
|
||||
Component.STYLES = existing;
|
||||
propType._values = existing;
|
||||
Component.propTypes = _extends({}, propTypes, {
|
||||
bsStyle: propType
|
||||
});
|
||||
|
||||
if (defaultStyle !== undefined) {
|
||||
var defaultProps = Component.defaultProps || (Component.defaultProps = {});
|
||||
defaultProps.bsStyle = defaultStyle;
|
||||
}
|
||||
|
||||
return Component;
|
||||
});
|
||||
export var bsSizes = curry(function (sizes, defaultSize, Component) {
|
||||
if (typeof defaultSize !== 'string') {
|
||||
Component = defaultSize;
|
||||
defaultSize = undefined;
|
||||
}
|
||||
|
||||
var existing = Component.SIZES || [];
|
||||
var propTypes = Component.propTypes || {};
|
||||
sizes.forEach(function (size) {
|
||||
if (existing.indexOf(size) === -1) {
|
||||
existing.push(size);
|
||||
}
|
||||
});
|
||||
var values = [];
|
||||
existing.forEach(function (size) {
|
||||
var mappedSize = SIZE_MAP[size];
|
||||
|
||||
if (mappedSize && mappedSize !== size) {
|
||||
values.push(mappedSize);
|
||||
}
|
||||
|
||||
values.push(size);
|
||||
});
|
||||
var propType = PropTypes.oneOf(values);
|
||||
propType._values = values; // expose the values on the propType function for documentation
|
||||
|
||||
Component.SIZES = existing;
|
||||
Component.propTypes = _extends({}, propTypes, {
|
||||
bsSize: propType
|
||||
});
|
||||
|
||||
if (defaultSize !== undefined) {
|
||||
if (!Component.defaultProps) {
|
||||
Component.defaultProps = {};
|
||||
}
|
||||
|
||||
Component.defaultProps.bsSize = defaultSize;
|
||||
}
|
||||
|
||||
return Component;
|
||||
});
|
||||
export function getClassSet(props) {
|
||||
var _classes;
|
||||
|
||||
var classes = (_classes = {}, _classes[prefix(props)] = true, _classes);
|
||||
|
||||
if (props.bsSize) {
|
||||
var bsSize = SIZE_MAP[props.bsSize] || props.bsSize;
|
||||
classes[prefix(props, bsSize)] = true;
|
||||
}
|
||||
|
||||
if (props.bsStyle) {
|
||||
classes[prefix(props, props.bsStyle)] = true;
|
||||
}
|
||||
|
||||
return classes;
|
||||
}
|
||||
|
||||
function getBsProps(props) {
|
||||
return {
|
||||
bsClass: props.bsClass,
|
||||
bsSize: props.bsSize,
|
||||
bsStyle: props.bsStyle,
|
||||
bsRole: props.bsRole
|
||||
};
|
||||
}
|
||||
|
||||
function isBsProp(propName) {
|
||||
return propName === 'bsClass' || propName === 'bsSize' || propName === 'bsStyle' || propName === 'bsRole';
|
||||
}
|
||||
|
||||
export function splitBsProps(props) {
|
||||
var elementProps = {};
|
||||
|
||||
_Object$entries(props).forEach(function (_ref) {
|
||||
var propName = _ref[0],
|
||||
propValue = _ref[1];
|
||||
|
||||
if (!isBsProp(propName)) {
|
||||
elementProps[propName] = propValue;
|
||||
}
|
||||
});
|
||||
|
||||
return [getBsProps(props), elementProps];
|
||||
}
|
||||
export function splitBsPropsAndOmit(props, omittedPropNames) {
|
||||
var isOmittedProp = {};
|
||||
omittedPropNames.forEach(function (propName) {
|
||||
isOmittedProp[propName] = true;
|
||||
});
|
||||
var elementProps = {};
|
||||
|
||||
_Object$entries(props).forEach(function (_ref2) {
|
||||
var propName = _ref2[0],
|
||||
propValue = _ref2[1];
|
||||
|
||||
if (!isBsProp(propName) && !isOmittedProp[propName]) {
|
||||
elementProps[propName] = propValue;
|
||||
}
|
||||
});
|
||||
|
||||
return [getBsProps(props), elementProps];
|
||||
}
|
||||
/**
|
||||
* Add a style variant to a Component. Mutates the propTypes of the component
|
||||
* in order to validate the new variant.
|
||||
*/
|
||||
|
||||
export function addStyle(Component) {
|
||||
for (var _len2 = arguments.length, styleVariant = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
||||
styleVariant[_key2 - 1] = arguments[_key2];
|
||||
}
|
||||
|
||||
bsStyles(styleVariant, Component);
|
||||
}
|
||||
export var _curry = curry;
|
||||
3
node_modules/react-bootstrap/es/utils/capitalize.js
generated
vendored
Normal file
3
node_modules/react-bootstrap/es/utils/capitalize.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export default function capitalize(string) {
|
||||
return "" + string.charAt(0).toUpperCase() + string.slice(1);
|
||||
}
|
||||
37
node_modules/react-bootstrap/es/utils/createChainedFunction.js
generated
vendored
Normal file
37
node_modules/react-bootstrap/es/utils/createChainedFunction.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Safe chained function
|
||||
*
|
||||
* Will only create a new function if needed,
|
||||
* otherwise will pass back existing functions or null.
|
||||
*
|
||||
* @param {function} functions to chain
|
||||
* @returns {function|null}
|
||||
*/
|
||||
function createChainedFunction() {
|
||||
for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
funcs[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return funcs.filter(function (f) {
|
||||
return f != null;
|
||||
}).reduce(function (acc, f) {
|
||||
if (typeof f !== 'function') {
|
||||
throw new Error('Invalid Argument Type, must only provide functions, undefined, or null.');
|
||||
}
|
||||
|
||||
if (acc === null) {
|
||||
return f;
|
||||
}
|
||||
|
||||
return function chainedFunction() {
|
||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
args[_key2] = arguments[_key2];
|
||||
}
|
||||
|
||||
acc.apply(this, args);
|
||||
f.apply(this, args);
|
||||
};
|
||||
}, null);
|
||||
}
|
||||
|
||||
export default createChainedFunction;
|
||||
64
node_modules/react-bootstrap/es/utils/deprecationWarning.js
generated
vendored
Normal file
64
node_modules/react-bootstrap/es/utils/deprecationWarning.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
|
||||
import warning from 'warning';
|
||||
var warned = {};
|
||||
|
||||
function deprecationWarning(oldname, newname, link) {
|
||||
var message;
|
||||
|
||||
if (typeof oldname === 'object') {
|
||||
message = oldname.message;
|
||||
} else {
|
||||
message = oldname + " is deprecated. Use " + newname + " instead.";
|
||||
|
||||
if (link) {
|
||||
message += "\nYou can read more about it at " + link;
|
||||
}
|
||||
}
|
||||
|
||||
if (warned[message]) {
|
||||
return;
|
||||
}
|
||||
|
||||
process.env.NODE_ENV !== "production" ? warning(false, message) : void 0;
|
||||
warned[message] = true;
|
||||
}
|
||||
|
||||
deprecationWarning.wrapper = function (Component) {
|
||||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
args[_key - 1] = arguments[_key];
|
||||
}
|
||||
|
||||
return (
|
||||
/*#__PURE__*/
|
||||
function (_Component) {
|
||||
_inheritsLoose(DeprecatedComponent, _Component);
|
||||
|
||||
function DeprecatedComponent() {
|
||||
return _Component.apply(this, arguments) || this;
|
||||
}
|
||||
|
||||
var _proto = DeprecatedComponent.prototype;
|
||||
|
||||
_proto.componentWillMount = function componentWillMount() {
|
||||
deprecationWarning.apply(void 0, args);
|
||||
|
||||
if (_Component.prototype.componentWillMount) {
|
||||
var _Component$prototype$;
|
||||
|
||||
for (var _len2 = arguments.length, methodArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
methodArgs[_key2] = arguments[_key2];
|
||||
}
|
||||
|
||||
(_Component$prototype$ = _Component.prototype.componentWillMount).call.apply(_Component$prototype$, [this].concat(methodArgs));
|
||||
}
|
||||
};
|
||||
|
||||
return DeprecatedComponent;
|
||||
}(Component)
|
||||
);
|
||||
};
|
||||
|
||||
export default deprecationWarning;
|
||||
export function _resetWarned() {
|
||||
warned = {};
|
||||
}
|
||||
6
node_modules/react-bootstrap/es/utils/index.js
generated
vendored
Normal file
6
node_modules/react-bootstrap/es/utils/index.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import * as _bootstrapUtils from './bootstrapUtils';
|
||||
export { _bootstrapUtils as bootstrapUtils };
|
||||
import _createChainedFunction from './createChainedFunction';
|
||||
export { _createChainedFunction as createChainedFunction };
|
||||
import _ValidComponentChildren from './ValidComponentChildren';
|
||||
export { _ValidComponentChildren as ValidComponentChildren };
|
||||
19
node_modules/react-bootstrap/es/utils/splitComponentProps.js
generated
vendored
Normal file
19
node_modules/react-bootstrap/es/utils/splitComponentProps.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import _Object$entries from "@babel/runtime-corejs2/core-js/object/entries";
|
||||
export default function splitComponentProps(props, Component) {
|
||||
var componentPropTypes = Component.propTypes;
|
||||
var parentProps = {};
|
||||
var childProps = {};
|
||||
|
||||
_Object$entries(props).forEach(function (_ref) {
|
||||
var propName = _ref[0],
|
||||
propValue = _ref[1];
|
||||
|
||||
if (componentPropTypes[propName]) {
|
||||
parentProps[propName] = propValue;
|
||||
} else {
|
||||
childProps[propName] = propValue;
|
||||
}
|
||||
});
|
||||
|
||||
return [parentProps, childProps];
|
||||
}
|
||||
Reference in New Issue
Block a user