@enact/core
Advanced tools
Comparing version 3.4.0 to 3.4.1
@@ -5,2 +5,6 @@ # Change Log | ||
## [3.4.1] - 2020-08-05 | ||
No significant changes. | ||
## [3.4.0] - 2020-07-29 | ||
@@ -7,0 +11,0 @@ |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -12,4 +14,2 @@ value: true | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
/** | ||
@@ -16,0 +16,0 @@ * Provides methods to add and remove global event listeners. |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -14,6 +16,81 @@ value: true | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
/** | ||
* `core/handle` provides a set of utilities to support handling events for `kind()`s and | ||
* `React.Component`s. The default export, `handle()`, generates an event handler function from a | ||
* set of input functions. The input functions either process or filter the event. If an input | ||
* function returns `true`, `handle()` will continue processing the event by calling the next input | ||
* function in the chain. If it returns `false` (or any falsy value like `null` or `undefined`), | ||
* the event handling chain stops at that input function. | ||
* | ||
* Example: | ||
* ``` | ||
* import {forKey, forward, handle, preventDefault} from '@enact/core/handle'; | ||
* | ||
* // logEnter will contain a function that accepts an event, a props object, and a context object | ||
* const logEnter = handle( | ||
* forward('onKeyDown'), // forwards the event to the function passed in the onKeyDown prop | ||
* forKey('enter'), // if the event.keyCode maps to the enter key, allows event processing to continue | ||
* preventDefault, // calls event.preventDefault() to prevent the `keypress` event | ||
* (ev, props) => { // custom event handler -- in this case, logging some text | ||
* // since it doesn't return `true`, no further input functions would be called after this one | ||
* console.log('The Enter key was pressed down'); | ||
* } | ||
* ).finally(() => { | ||
* console.log('This will log at the end no matter what happens within the handler above') | ||
* }); | ||
* ``` | ||
* | ||
* `handle()` can also be bound to a component instance which allows it to access the instance | ||
* `props` and `context`. This allows you to write consistent event handlers for components created | ||
* either with `kind()` or ES6 classes without worrying about from where the props are sourced. | ||
* | ||
* Handlers can either be bound directly using the native `bind()` method or using the `bindAs()` | ||
* utility method that is appended to the handler. | ||
* | ||
* Example: | ||
* ``` | ||
* import {forKey, forward, handle, preventDefault} from '@enact/core/handle'; | ||
* import React from 'react'; | ||
* | ||
* class MyComponent extends React.Component { | ||
* // bind handle() to the instance | ||
* constructor () { | ||
* super(); | ||
* | ||
* // logEnter will be bound to `this` and set as this.handleKeyDown | ||
* // | ||
* // Equivalent to the following with the advantage of set the function name to be displayed in | ||
* // development tool call stacks | ||
* // | ||
* // this.handleKeyDown = logEnter.bind(this) | ||
* logEnter.bindAs(this, 'handleKeyDown'); | ||
* } | ||
* | ||
* render () { | ||
* return ( | ||
* <div onKeyDown={this.handleKeyDown} /> | ||
* ); | ||
* } | ||
* } | ||
* ``` | ||
* | ||
* @module core/handle | ||
* @exports adaptEvent | ||
* @exports call | ||
* @exports callOnEvent | ||
* @exports forward | ||
* @exports forwardWithPrevent | ||
* @exports forEventProp | ||
* @exports forKey | ||
* @exports forKeyCode | ||
* @exports forProp | ||
* @exports handle | ||
* @exports log | ||
* @exports oneOf | ||
* @exports preventDefault | ||
* @exports returnsTrue | ||
* @exports stop | ||
* @exports stopImmediate | ||
*/ | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
/** | ||
@@ -73,3 +150,3 @@ * The signature for event handlers | ||
var hasPropsAndContext = function hasPropsAndContext(obj) { | ||
return obj && obj.hasOwnProperty && obj.hasOwnProperty('props') && obj.hasOwnProperty('context'); | ||
return obj && Object.prototype.hasOwnProperty.call(obj, 'props') && Object.prototype.hasOwnProperty.call(obj, 'context'); | ||
}; | ||
@@ -726,3 +803,3 @@ | ||
if (!ev || _typeof(ev) !== 'object') { | ||
if (!ev || typeof ev !== 'object') { | ||
ev = {}; | ||
@@ -729,0 +806,0 @@ } |
"use strict"; | ||
var _handle = require("../handle"); | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
var _defineProperty2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/defineProperty")); | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
var _objectSpread2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/objectSpread2")); | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var _handle = require("../handle"); | ||
describe('handle', function () { | ||
var makeEvent = function makeEvent(payload) { | ||
return _objectSpread({ | ||
return (0, _objectSpread2["default"])({ | ||
preventDefault: jest.fn(), | ||
@@ -107,6 +107,6 @@ stopPropagation: jest.fn() | ||
callback(makeEvent(_defineProperty({}, prop, false))); | ||
callback(makeEvent((0, _defineProperty2["default"])({}, prop, false))); | ||
expect(handler).not.toHaveBeenCalled(); // === should pass | ||
callback(makeEvent(_defineProperty({}, prop, value))); | ||
callback(makeEvent((0, _defineProperty2["default"])({}, prop, value))); | ||
expect(handler).toHaveBeenCalled(); | ||
@@ -136,7 +136,4 @@ }); | ||
var spy = jest.fn(); | ||
var props = _defineProperty({}, event, spy); | ||
var payload = _defineProperty({}, prop, propValue); | ||
var props = (0, _defineProperty2["default"])({}, event, spy); | ||
var payload = (0, _defineProperty2["default"])({}, prop, propValue); | ||
(0, _handle.handle)((0, _handle.forward)(event))(payload, props); | ||
@@ -143,0 +140,0 @@ var expected = true; |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -12,4 +14,2 @@ value: true | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
/** | ||
@@ -16,0 +16,0 @@ * Provides the {@link core/hoc.hoc} method to create higher-order components (HOCs). |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
var _react = _interopRequireDefault(require("react")); | ||
@@ -9,4 +11,2 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
/* eslint-disable enact/display-name */ | ||
@@ -13,0 +13,0 @@ describe('hoc', function () { |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -8,32 +10,24 @@ value: true | ||
var _invariant = _interopRequireDefault(require("invariant")); | ||
var _classCallCheck2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/classCallCheck")); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _createClass2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/createClass")); | ||
var _hoc = _interopRequireDefault(require("../../hoc")); | ||
var _assertThisInitialized2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/assertThisInitialized")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var _inherits2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/inherits")); | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
var _createSuper2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/createSuper")); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _invariant = _interopRequireDefault(require("invariant")); | ||
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); } } | ||
var _react = _interopRequireDefault(require("react")); | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
var _hoc = _interopRequireDefault(require("../../hoc")); | ||
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
/** | ||
* Provides the `ApiDecorator` higher-order component | ||
* | ||
* @module core/internal/ApiDecorator | ||
* @private | ||
*/ | ||
// Gets a property from `provider` | ||
@@ -103,5 +97,5 @@ var get = function get(provider, name) { | ||
return _temp = _class = /*#__PURE__*/function (_React$Component) { | ||
_inherits(_class, _React$Component); | ||
(0, _inherits2["default"])(_class, _React$Component); | ||
var _super = _createSuper(_class); | ||
var _super = (0, _createSuper2["default"])(_class); | ||
@@ -111,3 +105,3 @@ function _class() { | ||
_classCallCheck(this, _class); | ||
(0, _classCallCheck2["default"])(this, _class); | ||
@@ -122,3 +116,3 @@ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
api.forEach(function (key) { | ||
Object.defineProperty(_assertThisInitialized(_this), key, { | ||
Object.defineProperty((0, _assertThisInitialized2["default"])(_this), key, { | ||
get: get(provider, key), | ||
@@ -135,3 +129,3 @@ set: set(provider, key), | ||
_createClass(_class, [{ | ||
(0, _createClass2["default"])(_class, [{ | ||
key: "render", | ||
@@ -144,3 +138,2 @@ value: function render() { | ||
}]); | ||
return _class; | ||
@@ -147,0 +140,0 @@ }(_react["default"].Component), _class.displayName = 'ApiDecorator', _temp; |
"use strict"; | ||
var _react = _interopRequireDefault(require("react")); | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
var _enzyme = require("enzyme"); | ||
var _classCallCheck2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/classCallCheck")); | ||
var _ApiDecorator = _interopRequireDefault(require("../ApiDecorator")); | ||
var _createClass2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/createClass")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var _assertThisInitialized2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/assertThisInitialized")); | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
var _inherits2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/inherits")); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _createSuper2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/createSuper")); | ||
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); } } | ||
var _react = _interopRequireDefault(require("react")); | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
var _enzyme = require("enzyme"); | ||
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
var _ApiDecorator = _interopRequireDefault(require("../ApiDecorator")); | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
describe('ApiDecorator', function () { | ||
@@ -37,5 +25,5 @@ var _class, _temp; | ||
var ApiProvider = (_temp = _class = /*#__PURE__*/function (_React$Component) { | ||
_inherits(ApiProvider, _React$Component); | ||
(0, _inherits2["default"])(ApiProvider, _React$Component); | ||
var _super = _createSuper(ApiProvider); | ||
var _super = (0, _createSuper2["default"])(ApiProvider); | ||
@@ -45,4 +33,3 @@ function ApiProvider(props) { | ||
_classCallCheck(this, ApiProvider); | ||
(0, _classCallCheck2["default"])(this, ApiProvider); | ||
_this = _super.call(this); // eslint-disable-next-line | ||
@@ -55,7 +42,7 @@ | ||
_this.instanceProperty = 'property'; | ||
props.setApiProvider(_assertThisInitialized(_this)); | ||
props.setApiProvider((0, _assertThisInitialized2["default"])(_this)); | ||
return _this; | ||
} | ||
_createClass(ApiProvider, [{ | ||
(0, _createClass2["default"])(ApiProvider, [{ | ||
key: "instanceFunction", | ||
@@ -71,3 +58,2 @@ value: function instanceFunction() { | ||
}]); | ||
return ApiProvider; | ||
@@ -74,0 +60,0 @@ }(_react["default"].Component), _class.displayName = 'ApiProvider', _temp); |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -14,6 +16,2 @@ value: true | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
var isRequired = function isRequired(fn) { | ||
@@ -41,3 +39,3 @@ fn.isRequired = function (props, key, componentName, location, propFullName) { | ||
if (propValue && !(0, _util.isRenderable)(propValue)) { | ||
return new Error("Invalid prop '".concat(key, "' supplied to '").concat(componentName, "'. ") + "Expected a renderable value but received '".concat(_typeof(propValue), "' instead.")); | ||
return new Error("Invalid prop '".concat(key, "' supplied to '").concat(componentName, "'. ") + "Expected a renderable value but received '".concat(typeof propValue, "' instead.")); | ||
} | ||
@@ -49,3 +47,3 @@ }); | ||
if (propValue && (typeof propValue === 'string' || !(0, _util.isRenderable)(propValue))) { | ||
return new Error("Invalid prop '".concat(key, "' supplied to '").concat(componentName, "'. ") + "Expected a function but received '".concat(_typeof(propValue), "' instead.")); | ||
return new Error("Invalid prop '".concat(key, "' supplied to '").concat(componentName, "'. ") + "Expected a function but received '".concat(typeof propValue, "' instead.")); | ||
} | ||
@@ -52,0 +50,0 @@ }); |
"use strict"; | ||
var _react = _interopRequireDefault(require("react")); | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
var _enzyme = require("enzyme"); | ||
var _classCallCheck2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/classCallCheck")); | ||
var _Registry = _interopRequireDefault(require("../Registry")); | ||
var _createClass2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/createClass")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var _inherits2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/inherits")); | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
var _createSuper2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/createSuper")); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _react = _interopRequireDefault(require("react")); | ||
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); } } | ||
var _enzyme = require("enzyme"); | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
var _Registry = _interopRequireDefault(require("../Registry")); | ||
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
var SomeContext = /*#__PURE__*/_react["default"].createContext(); | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var SomeContext = _react["default"].createContext(); | ||
describe('Registry', function () { | ||
var NotifiesTree = /*#__PURE__*/function (_React$Component) { | ||
_inherits(NotifiesTree, _React$Component); | ||
(0, _inherits2["default"])(NotifiesTree, _React$Component); | ||
var _super = _createSuper(NotifiesTree); | ||
var _super = (0, _createSuper2["default"])(NotifiesTree); | ||
@@ -44,3 +30,3 @@ function NotifiesTree() { | ||
_classCallCheck(this, NotifiesTree); | ||
(0, _classCallCheck2["default"])(this, NotifiesTree); | ||
@@ -61,3 +47,3 @@ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
_createClass(NotifiesTree, [{ | ||
(0, _createClass2["default"])(NotifiesTree, [{ | ||
key: "componentDidMount", | ||
@@ -77,3 +63,2 @@ value: function componentDidMount() { | ||
}]); | ||
return NotifiesTree; | ||
@@ -85,5 +70,5 @@ }(_react["default"].Component); | ||
var HandlesNotification = /*#__PURE__*/function (_React$Component2) { | ||
_inherits(HandlesNotification, _React$Component2); | ||
(0, _inherits2["default"])(HandlesNotification, _React$Component2); | ||
var _super2 = _createSuper(HandlesNotification); | ||
var _super2 = (0, _createSuper2["default"])(HandlesNotification); | ||
@@ -93,3 +78,3 @@ function HandlesNotification() { | ||
_classCallCheck(this, HandlesNotification); | ||
(0, _classCallCheck2["default"])(this, HandlesNotification); | ||
@@ -117,3 +102,3 @@ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
_createClass(HandlesNotification, [{ | ||
(0, _createClass2["default"])(HandlesNotification, [{ | ||
key: "componentDidMount", | ||
@@ -138,3 +123,2 @@ value: function componentDidMount() { | ||
}]); | ||
return HandlesNotification; | ||
@@ -141,0 +125,0 @@ }(_react["default"].Component); |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -10,4 +12,2 @@ value: true | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
/* | ||
@@ -14,0 +14,0 @@ * The singleton map of names to keyCodes. If a name doesn't have any keyCodes mapped to it, it will |
"use strict"; | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
var _interopRequireWildcard = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireWildcard"); | ||
var keymap = _interopRequireWildcard(require("../")); | ||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
describe('keymap', function () { | ||
@@ -12,0 +8,0 @@ test('should support adding single keyCodes for a name', function () { |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -8,2 +10,12 @@ value: true | ||
var _classCallCheck2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/classCallCheck")); | ||
var _createClass2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/createClass")); | ||
var _inherits2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/inherits")); | ||
var _createSuper2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/createSuper")); | ||
var _objectSpread2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/objectSpread2")); | ||
var _react = _interopRequireDefault(require("react")); | ||
@@ -19,36 +31,12 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
/** | ||
* Provides the {@link core/kind.kind} method to create components | ||
* | ||
* @module core/kind | ||
* @exports kind | ||
*/ | ||
// Because contextType is optional and hooks must be called in the same order, we need a fallback | ||
// context when none is specified. This likely has some overhead so we may want to deprecate and | ||
// remove contextType support for 4.0 since the context APIs have improved since this was added. | ||
var NoContext = _react["default"].createContext(null); | ||
var NoContext = /*#__PURE__*/_react["default"].createContext(null); | ||
/** | ||
@@ -191,5 +179,3 @@ * @callback RenderFunction | ||
var boundHandlers = (0, _useHandlers["default"])(handlers, props, ctx); | ||
var merged = _objectSpread({}, props, {}, boundHandlers); | ||
var merged = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), boundHandlers); | ||
return renderKind(merged, ctx); | ||
@@ -202,5 +188,5 @@ }; | ||
Component = (_temp = _class = /*#__PURE__*/function (_React$Component) { | ||
_inherits(Component, _React$Component); | ||
(0, _inherits2["default"])(Component, _React$Component); | ||
var _super = _createSuper(Component); | ||
var _super = (0, _createSuper2["default"])(Component); | ||
@@ -210,4 +196,3 @@ function Component() { | ||
_classCallCheck(this, Component); | ||
(0, _classCallCheck2["default"])(this, Component); | ||
_this = _super.call(this); | ||
@@ -218,13 +203,10 @@ _this.handlers = new _Handlers["default"](handlers); | ||
_createClass(Component, [{ | ||
(0, _createClass2["default"])(Component, [{ | ||
key: "render", | ||
value: function render() { | ||
this.handlers.setContext(this.props, this.context); | ||
var merged = _objectSpread({}, this.props, {}, this.handlers.handlers); | ||
var merged = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, this.props), this.handlers.handlers); | ||
return renderKind(merged, this.context); | ||
} | ||
}]); | ||
return Component; | ||
@@ -243,3 +225,3 @@ }(_react["default"].Component), _class.contextType = contextType, _temp); | ||
Component.inline = function (props, context) { | ||
var updated = _objectSpread({}, props); | ||
var updated = (0, _objectSpread2["default"])({}, props); | ||
@@ -264,3 +246,3 @@ if (defaultPropKeys && defaultPropKeys.length > 0) { | ||
return _props; | ||
}, _objectSpread({}, updated)); | ||
}, (0, _objectSpread2["default"])({}, updated)); | ||
} | ||
@@ -267,0 +249,0 @@ |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -14,4 +16,2 @@ value: true | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
/** | ||
@@ -18,0 +18,0 @@ * Merges external and internal CSS classes and style objects. Internal CSS classes can be |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
var _computed = _interopRequireDefault(require("../computed")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
describe('computed', function () { | ||
@@ -8,0 +8,0 @@ var exampleCfg = { |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
var _slicedToArray2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/slicedToArray")); | ||
var _objectWithoutProperties2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/objectWithoutProperties")); | ||
var _react = _interopRequireDefault(require("react")); | ||
@@ -11,24 +17,4 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } | ||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } | ||
describe('kind', function () { | ||
var TestContext = _react["default"].createContext({ | ||
var TestContext = /*#__PURE__*/_react["default"].createContext({ | ||
value: 'initial' | ||
@@ -68,4 +54,3 @@ }); | ||
value = _ref2.value, | ||
rest = _objectWithoutProperties(_ref2, ["contextValue", "label", "value"]); | ||
rest = (0, _objectWithoutProperties2["default"])(_ref2, ["contextValue", "label", "value"]); | ||
delete rest.prop; | ||
@@ -157,3 +142,3 @@ return /*#__PURE__*/_react["default"].createElement("div", Object.assign({}, rest, { | ||
var _React$useState = _react["default"].useState(0), | ||
_React$useState2 = _slicedToArray(_React$useState, 2), | ||
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2), | ||
state = _React$useState2[0], | ||
@@ -211,5 +196,3 @@ setState = _React$useState2[1]; // eslint-disable-next-line react/jsx-no-bind | ||
var expected = 'function'; | ||
var actual = _typeof(component.props.onClick); | ||
var actual = typeof component.props.onClick; | ||
expect(actual).toBe(expected); | ||
@@ -216,0 +199,0 @@ }); |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
var _styles = _interopRequireDefault(require("../styles")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
describe('styles', function () { | ||
@@ -129,5 +127,3 @@ var css = { | ||
var expected = 'function'; | ||
var actual = _typeof(updated.styler.join); | ||
var actual = typeof updated.styler.join; | ||
expect(actual).toBe(expected); | ||
@@ -134,0 +130,0 @@ }); |
{ | ||
"name": "@enact/core", | ||
"version": "3.4.0", | ||
"version": "3.4.1", | ||
"description": "Enact is an open source JavaScript framework containing everything you need to create a fast, scalable mobile or web application.", | ||
@@ -27,5 +27,2 @@ "main": "index.js", | ||
}, | ||
"eslintConfig": { | ||
"extends": "enact/strict" | ||
}, | ||
"dependencies": { | ||
@@ -32,0 +29,0 @@ "classnames": "^2.2.5", |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -8,24 +10,16 @@ value: true | ||
var _uniq = _interopRequireDefault(require("ramda/src/uniq")); | ||
var _toConsumableArray2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/toConsumableArray")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var _objectSpread2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/objectSpread2")); | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
var _uniq = _interopRequireDefault(require("ramda/src/uniq")); | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
/** | ||
* Utilities for detecting basic platform capabilities. | ||
* | ||
* @module core/platform | ||
* @exports detect | ||
* @exports platform | ||
* @public | ||
*/ | ||
var hasGesture = function hasGesture() { | ||
@@ -231,3 +225,3 @@ return Boolean('ongesturestart' in window || 'onmsgesturestart' in window && (window.navigator.msMaxTouchPoints > 1 || window.navigator.maxTouchPoints > 1)); | ||
if (p.extra) { | ||
plat = _objectSpread({}, plat, {}, p.extra); | ||
plat = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, plat), p.extra); | ||
} | ||
@@ -296,3 +290,3 @@ | ||
exports.platform = platform; | ||
['gesture', 'node', 'platformName', 'touch', 'touchscreen', 'unknown'].concat(_toConsumableArray((0, _uniq["default"])(platforms.map(function (p) { | ||
['gesture', 'node', 'platformName', 'touch', 'touchscreen', 'unknown'].concat((0, _toConsumableArray2["default"])((0, _uniq["default"])(platforms.map(function (p) { | ||
return p.platform; | ||
@@ -299,0 +293,0 @@ })))).forEach(function (name) { |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -13,4 +15,2 @@ value: true | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
/** | ||
@@ -17,0 +17,0 @@ * Utilities to facilitate integration with v8 snapshot builds |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
var _toConsumableArray2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/toConsumableArray")); | ||
var _enzyme = require("enzyme"); | ||
@@ -9,19 +13,6 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
/* eslint-disable enact/prop-types */ | ||
describe('useChainRefs', function () { | ||
function Component(props) { | ||
var ref = _useChainRefs["default"].apply(void 0, _toConsumableArray(props.refs)); | ||
var ref = _useChainRefs["default"].apply(void 0, (0, _toConsumableArray2["default"])(props.refs)); | ||
@@ -41,3 +32,3 @@ return /*#__PURE__*/_react["default"].createElement("div", { | ||
test('should call a single object ref', function () { | ||
var ref = _react["default"].createRef(); | ||
var ref = /*#__PURE__*/_react["default"].createRef(); | ||
@@ -44,0 +35,0 @@ (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(Component, { |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -14,4 +16,2 @@ value: true | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
/** | ||
@@ -30,3 +30,3 @@ * Updates multiple reference callbacks or objects | ||
ref(node); | ||
} else if (ref.hasOwnProperty('current')) { | ||
} else if (Object.prototype.hasOwnProperty.call(ref, 'current')) { | ||
ref.current = node; | ||
@@ -33,0 +33,0 @@ } else { |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
var _classCallCheck2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/classCallCheck")); | ||
var _enzyme = require("enzyme"); | ||
@@ -9,10 +13,6 @@ | ||
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"); } } | ||
/* eslint-disable enact/prop-types */ | ||
describe('useClass', function () { | ||
var Class = function Class(arg) { | ||
_classCallCheck(this, Class); | ||
(0, _classCallCheck2["default"])(this, Class); | ||
this.arg = arg; | ||
@@ -19,0 +19,0 @@ }; |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -9,12 +11,6 @@ value: true | ||
var _construct2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/construct")); | ||
var _react = _interopRequireDefault(require("react")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
/** | ||
@@ -55,3 +51,3 @@ * Creates one instance of the class, `Ctor` with the provided `args`, for the life of the | ||
ref.current = ref.current || _construct(Ctor, args); | ||
ref.current = ref.current || (0, _construct2["default"])(Ctor, args); | ||
return ref.current; | ||
@@ -58,0 +54,0 @@ } |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -8,8 +10,6 @@ value: true | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _classCallCheck2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/classCallCheck")); | ||
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); } } | ||
var _createClass2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/createClass")); | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
var Handlers = /*#__PURE__*/function () { | ||
@@ -19,4 +19,3 @@ function Handlers(_handlers) { | ||
_classCallCheck(this, Handlers); | ||
(0, _classCallCheck2["default"])(this, Handlers); | ||
this.props = {}; | ||
@@ -37,3 +36,3 @@ this.context = {}; | ||
_createClass(Handlers, [{ | ||
(0, _createClass2["default"])(Handlers, [{ | ||
key: "setContext", | ||
@@ -52,3 +51,2 @@ value: function setContext() { | ||
}]); | ||
return Handlers; | ||
@@ -55,0 +53,0 @@ }(); |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
var _enzyme = require("enzyme"); | ||
@@ -9,4 +11,2 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
/* eslint-disable enact/prop-types */ | ||
@@ -13,0 +13,0 @@ describe('useHandlers', function () { |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -13,4 +15,2 @@ value: true | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
/** | ||
@@ -17,0 +17,0 @@ * Creates a map of event handlers with consistent references across renders. |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -8,12 +10,8 @@ value: true | ||
var _invariant = _interopRequireDefault(require("invariant")); | ||
var _classCallCheck2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/classCallCheck")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var _createClass2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/createClass")); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _invariant = _interopRequireDefault(require("invariant")); | ||
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); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
/** | ||
@@ -37,4 +35,3 @@ * Provides a convenient way to manage timed execution of functions. | ||
_classCallCheck(this, Job); | ||
(0, _classCallCheck2["default"])(this, Job); | ||
this.id = null; | ||
@@ -189,3 +186,3 @@ this.fn = null; | ||
_createClass(Job, [{ | ||
(0, _createClass2["default"])(Job, [{ | ||
key: "run", | ||
@@ -208,3 +205,2 @@ value: function run(args) { | ||
}]); | ||
return Job; | ||
@@ -211,0 +207,0 @@ }(); |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
var _Job = _interopRequireDefault(require("../Job")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
describe('Job', function () { | ||
@@ -8,0 +8,0 @@ describe('#start', function () { |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
var _react = _interopRequireDefault(require("react")); | ||
@@ -7,4 +9,2 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
describe('util', function () { | ||
@@ -24,3 +24,3 @@ describe('isRenderable', function () { | ||
var expected = true; | ||
var actual = (0, _util.isRenderable)(_react["default"].forwardRef(function () {})); | ||
var actual = (0, _util.isRenderable)( /*#__PURE__*/_react["default"].forwardRef(function () {})); | ||
expect(actual).toEqual(expected); | ||
@@ -30,3 +30,3 @@ }); | ||
var expected = true; | ||
var actual = (0, _util.isRenderable)(_react["default"].memo(function () {})); | ||
var actual = (0, _util.isRenderable)( /*#__PURE__*/_react["default"].memo(function () {})); | ||
expect(actual).toEqual(expected); | ||
@@ -36,3 +36,3 @@ }); | ||
var expected = true; | ||
var actual = (0, _util.isRenderable)(_react["default"].lazy(function () {})); | ||
var actual = (0, _util.isRenderable)( /*#__PURE__*/_react["default"].lazy(function () {})); | ||
expect(actual).toEqual(expected); | ||
@@ -39,0 +39,0 @@ }); |
"use strict"; | ||
var _interopRequireWildcard = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireWildcard"); | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -26,10 +30,19 @@ value: true | ||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } | ||
/** | ||
* A collection of utility methods. | ||
* | ||
* @module core/util | ||
* @exports cap | ||
* @exports clamp | ||
* @exports coerceArray | ||
* @exports coerceFunction | ||
* @exports extractAriaProps | ||
* @exports isRenderable | ||
* @exports Job | ||
* @exports memoize | ||
* @exports mergeClassNameMaps | ||
* @exports perfNow | ||
* @exports mapAndFilterChildren | ||
*/ | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
/** | ||
@@ -171,3 +184,3 @@ * Capitalizes a given string (not locale-aware). | ||
var perfNow = function perfNow() { | ||
if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === 'object') { | ||
if (typeof window === 'object') { | ||
return window.performance.now(); | ||
@@ -174,0 +187,0 @@ } else { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5785
213421
72