Dive into secure and efficient coding practices with our curated list of the top 10 examples showcasing 'babel-runtime' in functional components in JavaScript. Our advanced machine learning engine meticulously scans each line of code, cross-referencing millions of open source libraries to ensure your implementation is not just functional, but also robust and secure. Elevate your React applications to new heights by mastering the art of handling side effects, API calls, and asynchronous operations with confidence and precision.
handleChange: function handleChange(e) {
var props = getOptionProps(this);
if (props.disabled) {
return;
}
if (!('checked' in props)) {
this.sChecked = e.target.checked;
}
this.$forceUpdate(); // change前,维持现有状态
this.__emit('change', {
target: _extends({}, props, {
checked: e.target.checked
}),
stopPropagation: function stopPropagation() {
e.stopPropagation();
},
preventDefault: function preventDefault() {
e.preventDefault();
},
nativeEvent: _extends({}, e, { shiftKey: this.eventShiftKey })
});
this.eventShiftKey = false;
},
onClick: function onClick(e) {
value: function render() {
var _classNames;
var _a = this.props,
className = _a.className,
size = _a.size,
prefixCls = _a.prefixCls,
tip = _a.tip,
wrapperClassName = _a.wrapperClassName,
restProps = __rest(_a, ["className", "size", "prefixCls", "tip", "wrapperClassName"]);var _state = this.state,
spinning = _state.spinning,
notCssAnimationSupported = _state.notCssAnimationSupported;
var spinClassName = classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, prefixCls + '-sm', size === 'small'), _defineProperty(_classNames, prefixCls + '-lg', size === 'large'), _defineProperty(_classNames, prefixCls + '-spinning', spinning), _defineProperty(_classNames, prefixCls + '-show-text', !!tip || notCssAnimationSupported), _classNames), className);
// fix https://fb.me/react-unknown-prop
var divProps = omit(restProps, ['spinning', 'delay']);
var spinElement = React.createElement(
'div',
_extends({}, divProps, { className: spinClassName }),
React.createElement(
'span',
{ className: prefixCls + '-dot' },
React.createElement('i', null),
React.createElement('i', null),
React.createElement('i', null),
React.createElement('i', null)
),
tip ? React.createElement(
'div',
{ className: prefixCls + '-text' },
Navbar.prototype.render = function render() {
var _extends2;
var _props4 = this.props,
Component = _props4.componentClass,
fixedTop = _props4.fixedTop,
fixedBottom = _props4.fixedBottom,
staticTop = _props4.staticTop,
inverse = _props4.inverse,
fluid = _props4.fluid,
className = _props4.className,
children = _props4.children,
props = _objectWithoutProperties(_props4, ['componentClass', 'fixedTop', 'fixedBottom', 'staticTop', 'inverse', 'fluid', 'className', 'children']);
var _splitBsPropsAndOmit = splitBsPropsAndOmit(props, ['expanded', 'onToggle', 'onSelect', 'collapseOnSelect']),
bsProps = _splitBsPropsAndOmit[0],
elementProps = _splitBsPropsAndOmit[1];
// will result in some false positives but that seems better
// than false negatives. strict `undefined` check allows explicit
// "nulling" of the role if the user really doesn't want one
if (elementProps.role === undefined && Component !== 'nav') {
elementProps.role = 'navigation';
}
if (inverse) {
bsProps.bsStyle = Style.INVERSE;
function Draw() {
var previous = arguments[0] === undefined ? null : arguments[0];
var options = arguments[1] === undefined ? {} : arguments[1];
_classCallCheck(this, Draw);
this.type = "sink-draw";
var defaults = {
scroll: true,
color: "#000000"
};
_get(_core.Object.getPrototypeOf(Draw.prototype), "constructor", this).call(this, previous, options, defaults);
if (!this.params.canvas) {
return console.error("Please note: a canvas element is required for this module");
}
// pubs
this.scrolls = this.params.scroll;
this.canvas = this.params.canvas;
this.color = this.params.color;
// privs
this._buffer = document.createElement("canvas");
this._buffer.width = this.canvas.width;
this._buffer.height = this.canvas.height;
this._buffCtx = this._buffer.getContext("2d");
function unflatten2(array) {
var _ref;
var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (_ref = {}, _ref[format.id] = format.rootPId, _ref);
var children = [];
for (var i = 0; i < array.length; i++) {
array[i] = _extends({}, array[i]); // copy, can not corrupts original data
if (array[i][format.pId] === parent[format.id]) {
array[i].key = array[i][format.id];
children.push(array[i]);
array.splice(i--, 1);
}
}
if (children.length) {
parent.children = children;
children.forEach(function (child) {
return unflatten2(array, child);
});
}
if (parent[format.id] === format.rootPId) {
return children;
}
}
'use strict';
var _get = require('babel-runtime/helpers/get')['default'];
var _inherits = require('babel-runtime/helpers/inherits')['default'];
var _createClass = require('babel-runtime/helpers/create-class')['default'];
var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default'];
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default'];
Object.defineProperty(exports, '__esModule', {
value: true
});
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
// TODO: default locale should be empty, not fake-English
var state = {
messages: {},
locale: { name: 'en', pluralFn: function pluralFn(c) {
return c === 1 ? 'one' : 'other';
} }
};
/* eslint max-len: 0 */
"use strict";
var _interopRequireDefault = require("babel-runtime/helpers/interop-require-default")["default"];
var _interopRequireWildcard = require("babel-runtime/helpers/interop-require-wildcard")["default"];
exports.__esModule = true;
var _babelHelperGetFunctionArity = require("babel-helper-get-function-arity");
var _babelHelperGetFunctionArity2 = _interopRequireDefault(_babelHelperGetFunctionArity);
var _babelTemplate = require("babel-template");
var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
var _babelTypes = require("babel-types");
var t = _interopRequireWildcard(_babelTypes);
/* @flow */
"use strict";
var _interopRequireDefault = require("babel-runtime/helpers/interop-require-default")["default"];
var _interopRequireWildcard = require("babel-runtime/helpers/interop-require-wildcard")["default"];
exports.__esModule = true;
var _plugin = require("../plugin");
var _plugin2 = _interopRequireDefault(_plugin);
var _babelTypes = require("babel-types");
var t = _interopRequireWildcard(_babelTypes);
exports["default"] = new _plugin2["default"]({
visitor: {
ThisExpression: function ThisExpression(path) {
// base class for all Events
// @NOTE: use a single Event per Surface
"use strict";
var _classCallCheck = require("babel-runtime/helpers/class-call-check")["default"];
var _createClass = require("babel-runtime/helpers/create-class")["default"];
var WaveEvent = (function () {
function WaveEvent(type, originalEvent) {
_classCallCheck(this, WaveEvent);
this.type = type;
this.target = originalEvent.target;
this.currentTarget = originalEvent.currentTarget;
this.originalEvent = originalEvent;
// is setted in timeline's states
// this.currentTarget = null;
this.x = null;
this.y = null;
'use strict';
var _get = require('babel-runtime/helpers/get')['default'];
var _inherits = require('babel-runtime/helpers/inherits')['default'];
var _createClass = require('babel-runtime/helpers/create-class')['default'];
var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default'];
Object.defineProperty(exports, '__esModule', {
value: true
});
var _soundworksServer = require('soundworks/server');
var DropsExperience = (function (_ServerExperience) {
_inherits(DropsExperience, _ServerExperience);
function DropsExperience(clientType) {
_classCallCheck(this, DropsExperience);
_get(Object.getPrototypeOf(DropsExperience.prototype), 'constructor', this).call(this, clientType);
// define services dependencies