@enact/ui 3.2.3 → 3.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/A11yDecorator/A11yDecorator.js +1 -1
- package/A11yDecorator/tests/A11yDecorator-specs.js +9 -9
- package/AnnounceDecorator/Announce.js +10 -8
- package/AnnounceDecorator/AnnounceDecorator.d.ts +1 -1
- package/AnnounceDecorator/AnnounceDecorator.js +10 -8
- package/AnnounceDecorator/tests/Announce-specs.js +3 -3
- package/AnnounceDecorator/tests/AnnounceDecorator-specs.js +4 -4
- package/BodyText/BodyText.d.ts +3 -3
- package/BodyText/BodyText.js +1 -1
- package/BodyText/tests/BodyText-specs.js +11 -7
- package/Button/Button.d.ts +8 -8
- package/Button/Button.js +5 -5
- package/CHANGELOG.md +24 -0
- package/Cancelable/Cancelable.js +15 -11
- package/Cancelable/tests/Cancelable-specs.js +20 -20
- package/Changeable/Changeable.js +12 -8
- package/Changeable/tests/Changeable-specs.js +24 -22
- package/ComponentOverride/ComponentOverride.d.ts +1 -1
- package/ComponentOverride/ComponentOverride.js +1 -1
- package/FloatingLayer/FloatingLayer.js +12 -8
- package/FloatingLayer/FloatingLayerDecorator.js +15 -11
- package/FloatingLayer/Scrim.js +12 -8
- package/FloatingLayer/tests/FloatingLayer-specs.js +3 -3
- package/FloatingLayer/tests/Scrim-specs.js +2 -2
- package/ForwardRef/ForwardRef.js +4 -2
- package/GridListImageItem/GridListImageItem.d.ts +2 -2
- package/GridListImageItem/GridListImageItem.js +7 -7
- package/Group/Group.d.ts +4 -4
- package/Group/Group.js +1 -1
- package/Group/GroupItem.js +1 -1
- package/Group/tests/Group-specs.js +9 -9
- package/Heading/Heading.d.ts +3 -2
- package/Heading/Heading.js +1 -1
- package/Heading/tests/Heading-specs.js +4 -4
- package/Icon/Icon.d.ts +5 -5
- package/Icon/Icon.js +2 -2
- package/Icon/tests/Icon-specs.js +8 -8
- package/IconButton/IconButton.d.ts +6 -6
- package/IconButton/IconButton.js +12 -6
- package/Image/Image.d.ts +1 -1
- package/Image/Image.js +5 -3
- package/Image/tests/Image-specs.js +4 -4
- package/Item/Item.d.ts +2 -2
- package/Item/Item.js +1 -1
- package/Item/tests/Item-specs.js +4 -4
- package/LabeledIcon/LabeledIcon.d.ts +6 -6
- package/LabeledIcon/LabeledIcon.js +4 -2
- package/LabeledIcon/tests/LabeledIcon-specs.js +6 -6
- package/Layout/Cell.js +4 -2
- package/Layout/Layout.d.ts +22 -22
- package/Layout/Layout.js +4 -2
- package/Layout/tests/Layout-specs.js +19 -11
- package/Marquee/MarqueeBase.js +71 -39
- package/Marquee/MarqueeController.js +14 -8
- package/Marquee/MarqueeDecorator.js +15 -11
- package/Marquee/index.d.ts +85 -81
- package/Marquee/tests/Marquee-specs.js +61 -22
- package/Measurable/Measurable.js +20 -20
- package/Media/Media.d.ts +1 -1
- package/Media/Media.js +10 -6
- package/Placeholder/PlaceholderControllerDecorator.js +13 -11
- package/Placeholder/PlaceholderDecorator.js +11 -7
- package/ProgressBar/ProgressBar.d.ts +1 -1
- package/ProgressBar/ProgressBar.js +8 -6
- package/ProgressBar/tests/ProgressBar-specs.js +4 -4
- package/RadioDecorator/RadioControllerDecorator.js +13 -9
- package/RadioDecorator/RadioDecorator.js +10 -8
- package/RadioDecorator/tests/RadioDecorator-specs.js +23 -19
- package/Repeater/Repeater.d.ts +4 -3
- package/Repeater/Repeater.js +7 -5
- package/Repeater/tests/Repeater-specs.js +15 -15
- package/Resizable/Resizable.js +12 -10
- package/Routable/Link.js +4 -4
- package/Routable/Routable.d.ts +2 -2
- package/Routable/Routable.js +5 -3
- package/Routable/Router.js +13 -7
- package/Routable/tests/Router-specs.js +30 -30
- package/Scrollable/ScrollAnimator.js +1 -3
- package/Scrollable/ScrollThumb.js +1 -1
- package/Scrollable/Scrollable.js +30 -24
- package/Scrollable/ScrollableNative.js +30 -24
- package/Scrollable/Scrollbar.js +21 -17
- package/Scroller/Scroller.d.ts +3 -3
- package/Scroller/Scroller.js +21 -11
- package/Skinnable/Skinnable.js +3 -3
- package/Skinnable/tests/Skinnable-specs.js +34 -34
- package/Skinnable/util.js +1 -1
- package/Slider/Knob.js +1 -1
- package/Slider/PositionDecorator.js +12 -8
- package/Slider/Slider.d.ts +6 -6
- package/Slider/Slider.js +6 -4
- package/SlotItem/SlotItem.d.ts +4 -4
- package/SlotItem/SlotItem.js +3 -3
- package/Slottable/Slottable.js +4 -2
- package/Slottable/tests/Slottable-specs.js +25 -25
- package/Spinner/Spinner.d.ts +3 -3
- package/Spinner/Spinner.js +6 -6
- package/Spinner/tests/Spinner-specs.js +5 -5
- package/ToggleIcon/ToggleIcon.d.ts +3 -3
- package/ToggleIcon/ToggleIcon.js +1 -1
- package/ToggleIcon/tests/ToggleIcon-specs.js +4 -4
- package/ToggleItem/ToggleItem.d.ts +15 -13
- package/ToggleItem/ToggleItem.js +8 -4
- package/ToggleItem/tests/ToggleItem-specs.js +12 -8
- package/Toggleable/Toggleable.js +15 -9
- package/Toggleable/tests/Toggleable-specs.js +33 -31
- package/Touchable/ClickAllow.js +1 -3
- package/Touchable/Drag.js +3 -1
- package/Touchable/Flick.js +1 -3
- package/Touchable/Hold.js +5 -5
- package/Touchable/Touchable.d.ts +3 -3
- package/Touchable/Touchable.js +15 -9
- package/Touchable/config.js +4 -2
- package/Touchable/tests/Touchable-specs.js +18 -18
- package/Transition/Transition.d.ts +31 -29
- package/Transition/Transition.js +15 -9
- package/Transition/tests/Transition-specs.js +23 -15
- package/ViewManager/Arranger.js +3 -1
- package/ViewManager/TransitionGroup.js +11 -7
- package/ViewManager/View.js +12 -8
- package/ViewManager/ViewManager.d.ts +10 -10
- package/ViewManager/ViewManager.js +10 -6
- package/ViewManager/tests/View-specs.js +24 -24
- package/ViewManager/tests/ViewManager-specs.js +93 -89
- package/VirtualList/VirtualList.d.ts +9 -8
- package/VirtualList/VirtualList.js +4 -4
- package/VirtualList/VirtualListBase.js +40 -24
- package/VirtualList/tests/VirtualList-specs.js +13 -13
- package/internal/IdProvider/IdProvider.js +10 -6
- package/internal/Pure/Pure.js +10 -6
- package/internal/localized-fonts/localized-fonts.js +7 -3
- package/package.json +2 -2
- package/resolution/ResolutionDecorator.js +10 -6
- package/resolution/index.js +5 -1
- package/resolution/resolution.js +1 -1
- package/resolution/tests/ResolutionDecorator-specs.js +2 -2
|
@@ -15,9 +15,11 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
17
|
|
|
18
|
-
function _typeof(obj) { 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); }
|
|
18
|
+
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); }
|
|
19
19
|
|
|
20
|
-
function
|
|
20
|
+
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; }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
21
23
|
|
|
22
24
|
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; }
|
|
23
25
|
|
|
@@ -27,10 +29,14 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
27
29
|
|
|
28
30
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
29
31
|
|
|
32
|
+
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); }; }
|
|
33
|
+
|
|
30
34
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
31
35
|
|
|
32
36
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
33
37
|
|
|
38
|
+
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; } }
|
|
39
|
+
|
|
34
40
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
35
41
|
|
|
36
42
|
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); }
|
|
@@ -83,17 +89,17 @@ var MarqueeController = (0, _hoc["default"])(defaultConfig, function (config, Wr
|
|
|
83
89
|
var marqueeOnFocus = config.marqueeOnFocus;
|
|
84
90
|
var forwardBlur = (0, _handle.forward)('onBlur');
|
|
85
91
|
var forwardFocus = (0, _handle.forward)('onFocus');
|
|
86
|
-
return _temp = _class =
|
|
87
|
-
/*#__PURE__*/
|
|
88
|
-
function (_React$Component) {
|
|
92
|
+
return _temp = _class = /*#__PURE__*/function (_React$Component) {
|
|
89
93
|
_inherits(_class, _React$Component);
|
|
90
94
|
|
|
95
|
+
var _super = _createSuper(_class);
|
|
96
|
+
|
|
91
97
|
function _class(props) {
|
|
92
98
|
var _this;
|
|
93
99
|
|
|
94
100
|
_classCallCheck(this, _class);
|
|
95
101
|
|
|
96
|
-
_this =
|
|
102
|
+
_this = _super.call(this, props);
|
|
97
103
|
_this.cancelJob = new _util.Job(function () {
|
|
98
104
|
return _this.doCancel();
|
|
99
105
|
}, 30);
|
|
@@ -328,9 +334,9 @@ var MarqueeController = (0, _hoc["default"])(defaultConfig, function (config, Wr
|
|
|
328
334
|
});
|
|
329
335
|
}
|
|
330
336
|
|
|
331
|
-
return _react["default"].createElement(MarqueeControllerContext.Provider, {
|
|
337
|
+
return /*#__PURE__*/_react["default"].createElement(MarqueeControllerContext.Provider, {
|
|
332
338
|
value: this.childContext
|
|
333
|
-
}, _react["default"].createElement(Wrapped, props));
|
|
339
|
+
}, /*#__PURE__*/_react["default"].createElement(Wrapped, props));
|
|
334
340
|
}
|
|
335
341
|
}]);
|
|
336
342
|
|
|
@@ -33,7 +33,7 @@ var _MarqueeController = require("./MarqueeController");
|
|
|
33
33
|
|
|
34
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
35
35
|
|
|
36
|
-
function _typeof(obj) { 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); }
|
|
36
|
+
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); }
|
|
37
37
|
|
|
38
38
|
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; }
|
|
39
39
|
|
|
@@ -45,12 +45,16 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
45
45
|
|
|
46
46
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
47
47
|
|
|
48
|
-
function
|
|
48
|
+
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); }; }
|
|
49
49
|
|
|
50
|
-
function
|
|
50
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
51
51
|
|
|
52
52
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
53
53
|
|
|
54
|
+
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; } }
|
|
55
|
+
|
|
56
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
57
|
+
|
|
54
58
|
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); }
|
|
55
59
|
|
|
56
60
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
@@ -215,17 +219,17 @@ var MarqueeDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wra
|
|
|
215
219
|
return rtl;
|
|
216
220
|
};
|
|
217
221
|
|
|
218
|
-
return _temp = _class =
|
|
219
|
-
/*#__PURE__*/
|
|
220
|
-
function (_React$Component) {
|
|
222
|
+
return _temp = _class = /*#__PURE__*/function (_React$Component) {
|
|
221
223
|
_inherits(_class, _React$Component);
|
|
222
224
|
|
|
225
|
+
var _super = _createSuper(_class);
|
|
226
|
+
|
|
223
227
|
function _class(props) {
|
|
224
228
|
var _this;
|
|
225
229
|
|
|
226
230
|
_classCallCheck(this, _class);
|
|
227
231
|
|
|
228
|
-
_this =
|
|
232
|
+
_this = _super.call(this, props);
|
|
229
233
|
_this.promoteJob = new _util.Job(function () {
|
|
230
234
|
_this.setState(function (state) {
|
|
231
235
|
return state.promoted ? null : {
|
|
@@ -772,10 +776,10 @@ var MarqueeDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wra
|
|
|
772
776
|
delete rest.marqueeSpeed;
|
|
773
777
|
delete rest.remeasure;
|
|
774
778
|
delete rest.rtl;
|
|
775
|
-
return _react["default"].createElement(Wrapped, Object.assign({}, rest, {
|
|
779
|
+
return /*#__PURE__*/_react["default"].createElement(Wrapped, Object.assign({}, rest, {
|
|
776
780
|
onBlur: this.handleBlur,
|
|
777
781
|
disabled: disabled
|
|
778
|
-
}), _react["default"].createElement(MarqueeComponent, {
|
|
782
|
+
}), /*#__PURE__*/_react["default"].createElement(MarqueeComponent, {
|
|
779
783
|
alignment: alignment,
|
|
780
784
|
animating: this.state.animating,
|
|
781
785
|
className: configClassName,
|
|
@@ -806,14 +810,14 @@ var MarqueeDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wra
|
|
|
806
810
|
delete props.marqueeSpeed;
|
|
807
811
|
delete props.remeasure;
|
|
808
812
|
delete props.rtl;
|
|
809
|
-
return _react["default"].createElement(Wrapped, props);
|
|
813
|
+
return /*#__PURE__*/_react["default"].createElement(Wrapped, props);
|
|
810
814
|
}
|
|
811
815
|
}, {
|
|
812
816
|
key: "render",
|
|
813
817
|
value: function render() {
|
|
814
818
|
var _this4 = this;
|
|
815
819
|
|
|
816
|
-
return _react["default"].createElement(_Resizable.ResizeContext.Consumer, null, function (register) {
|
|
820
|
+
return /*#__PURE__*/_react["default"].createElement(_Resizable.ResizeContext.Consumer, null, function (register) {
|
|
817
821
|
if (!_this4.resizeRegistry && register) {
|
|
818
822
|
_this4.resizeRegistry = register(_this4.handleResize);
|
|
819
823
|
}
|
package/Marquee/index.d.ts
CHANGED
|
@@ -5,6 +5,90 @@ import * as React from "react";
|
|
|
5
5
|
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
6
6
|
type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
|
|
7
7
|
|
|
8
|
+
export interface MarqueeBaseProps {
|
|
9
|
+
/**
|
|
10
|
+
* Text alignment value of the marquee
|
|
11
|
+
*
|
|
12
|
+
* Valid values are:
|
|
13
|
+
* * `'left'` ,
|
|
14
|
+
* * `'right'` , and
|
|
15
|
+
* * `'center'`
|
|
16
|
+
*/
|
|
17
|
+
alignment?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Applies animating styles such as removing the ellipsis.
|
|
20
|
+
*/
|
|
21
|
+
animating?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Sets the value of the `aria-label` attribute for the wrapped component.
|
|
24
|
+
*/
|
|
25
|
+
"aria-label"?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The text or a set of components that should be marqueed
|
|
28
|
+
*
|
|
29
|
+
* This prop may be empty in some cases, which is OK.
|
|
30
|
+
*/
|
|
31
|
+
children?: React.ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Called when mounting or unmounting with a reference to the client node
|
|
34
|
+
*/
|
|
35
|
+
clientRef?: Function;
|
|
36
|
+
/**
|
|
37
|
+
* Customizes the component by mapping the supplied collection of CSS class names to the
|
|
38
|
+
corresponding internal Elements and states of this component.
|
|
39
|
+
*
|
|
40
|
+
* The following classes are supported:
|
|
41
|
+
* * `marquee` - The root component class
|
|
42
|
+
* * `animate` - Applied to the inner content node when the text is animating
|
|
43
|
+
* * `spacing` - The spacing node used between the repeated content
|
|
44
|
+
* * `text` - The inner content node
|
|
45
|
+
* * `willAnimate` - Applied to the inner content node shortly before animation
|
|
46
|
+
*/
|
|
47
|
+
css?: object;
|
|
48
|
+
/**
|
|
49
|
+
* Distance to animate the marquee
|
|
50
|
+
*
|
|
51
|
+
* Usually, the `distance` is the width of the text minus the width of the container
|
|
52
|
+
*/
|
|
53
|
+
distance?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Called when the marquee completes its animation
|
|
56
|
+
*/
|
|
57
|
+
onMarqueeComplete?: Function;
|
|
58
|
+
/**
|
|
59
|
+
* Text overflow setting. Either `'clip'` or `'ellipsis'`
|
|
60
|
+
*/
|
|
61
|
+
overflow?: "clip" | "ellipsis";
|
|
62
|
+
/**
|
|
63
|
+
* `true` if the directionality of the content is right-to-left
|
|
64
|
+
*/
|
|
65
|
+
rtl?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Amount of spacing, in pixels, between the instances of the content
|
|
68
|
+
*/
|
|
69
|
+
spacing?: number;
|
|
70
|
+
/**
|
|
71
|
+
* Speed of marquee animation in pixels/second.
|
|
72
|
+
*/
|
|
73
|
+
speed?: number;
|
|
74
|
+
/**
|
|
75
|
+
* Indicates the marquee will animate soon.
|
|
76
|
+
*
|
|
77
|
+
* Should be used by the component to prepare itself for animation such as promoting
|
|
78
|
+
composite layers for improved performance.
|
|
79
|
+
*/
|
|
80
|
+
willAnimate?: boolean;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Marquees the children of the component.
|
|
84
|
+
*
|
|
85
|
+
* For automated marquee calculations use .
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
export class MarqueeBase extends React.Component<
|
|
89
|
+
Merge<React.HTMLProps<HTMLElement>, MarqueeBaseProps>
|
|
90
|
+
> {}
|
|
91
|
+
|
|
8
92
|
export interface MarqueeControllerConfig extends Object {
|
|
9
93
|
/**
|
|
10
94
|
* When `true` , any `onFocus` events that bubble to the controller will start the contained
|
|
@@ -153,87 +237,7 @@ export interface MarqueeProps
|
|
|
153
237
|
*/
|
|
154
238
|
|
|
155
239
|
export class Marquee extends React.Component<
|
|
156
|
-
|
|
157
|
-
> {}
|
|
158
|
-
|
|
159
|
-
export interface MarqueeBaseProps {
|
|
160
|
-
/**
|
|
161
|
-
* Text alignment value of the marquee
|
|
162
|
-
*
|
|
163
|
-
* Valid values are:
|
|
164
|
-
* * `'left'` ,
|
|
165
|
-
* * `'right'` , and
|
|
166
|
-
* * `'center'`
|
|
167
|
-
*/
|
|
168
|
-
alignment?: string;
|
|
169
|
-
/**
|
|
170
|
-
* Applies animating styles such as removing the ellipsis.
|
|
171
|
-
*/
|
|
172
|
-
animating?: boolean;
|
|
173
|
-
/**
|
|
174
|
-
* The text or a set of components that should be marqueed
|
|
175
|
-
*
|
|
176
|
-
* This prop may be empty in some cases, which is OK.
|
|
177
|
-
*/
|
|
178
|
-
children?: React.ReactNode;
|
|
179
|
-
/**
|
|
180
|
-
* Called when mounting or unmounting with a reference to the client node
|
|
181
|
-
*/
|
|
182
|
-
clientRef?: Function;
|
|
183
|
-
/**
|
|
184
|
-
* Customizes the component by mapping the supplied collection of CSS class names to the
|
|
185
|
-
corresponding internal Elements and states of this component.
|
|
186
|
-
*
|
|
187
|
-
* The following classes are supported:
|
|
188
|
-
* * `marquee` - The root component class
|
|
189
|
-
* * `animate` - Applied to the inner content node when the text is animating
|
|
190
|
-
* * `spacing` - The spacing node used between the repeated content
|
|
191
|
-
* * `text` - The inner content node
|
|
192
|
-
* * `willAnimate` - Applied to the inner content node shortly before animation
|
|
193
|
-
*/
|
|
194
|
-
css?: object;
|
|
195
|
-
/**
|
|
196
|
-
* Distance to animate the marquee
|
|
197
|
-
*
|
|
198
|
-
* Usually, the `distance` is the width of the text minus the width of the container
|
|
199
|
-
*/
|
|
200
|
-
distance?: number;
|
|
201
|
-
/**
|
|
202
|
-
* Called when the marquee completes its animation
|
|
203
|
-
*/
|
|
204
|
-
onMarqueeComplete?: Function;
|
|
205
|
-
/**
|
|
206
|
-
* Text overflow setting. Either `'clip'` or `'ellipsis'`
|
|
207
|
-
*/
|
|
208
|
-
overflow?: "clip" | "ellipsis";
|
|
209
|
-
/**
|
|
210
|
-
* `true` if the directionality of the content is right-to-left
|
|
211
|
-
*/
|
|
212
|
-
rtl?: boolean;
|
|
213
|
-
/**
|
|
214
|
-
* Amount of spacing, in pixels, between the instances of the content
|
|
215
|
-
*/
|
|
216
|
-
spacing?: number;
|
|
217
|
-
/**
|
|
218
|
-
* Speed of marquee animation in pixels/second.
|
|
219
|
-
*/
|
|
220
|
-
speed?: number;
|
|
221
|
-
/**
|
|
222
|
-
* Indicates the marquee will animate soon.
|
|
223
|
-
*
|
|
224
|
-
* Should be used by the component to prepare itself for animation such as promoting
|
|
225
|
-
composite layers for improved performance.
|
|
226
|
-
*/
|
|
227
|
-
willAnimate?: boolean;
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* Marquees the children of the component.
|
|
231
|
-
*
|
|
232
|
-
* For automated marquee calculations use .
|
|
233
|
-
*/
|
|
234
|
-
|
|
235
|
-
export class MarqueeBase extends React.Component<
|
|
236
|
-
MarqueeBaseProps & React.HTMLProps<HTMLElement>
|
|
240
|
+
Merge<React.HTMLProps<HTMLElement>, MarqueeProps>
|
|
237
241
|
> {}
|
|
238
242
|
|
|
239
243
|
export default Marquee;
|
|
@@ -27,19 +27,19 @@ describe('Marquee', function () {
|
|
|
27
27
|
});
|
|
28
28
|
});
|
|
29
29
|
test('should determine the correct directionality of latin text on initial render', function () {
|
|
30
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(_index.Marquee, null, ltrText));
|
|
30
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_index.Marquee, null, ltrText));
|
|
31
31
|
var expected = 'ltr';
|
|
32
32
|
var actual = subject.find(contentSelector).prop('style');
|
|
33
33
|
expect(actual).toHaveProperty('direction', expected);
|
|
34
34
|
});
|
|
35
35
|
test('should determine the correct directionality of non-latin text on initial render', function () {
|
|
36
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(_index.Marquee, null, rtlText));
|
|
36
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_index.Marquee, null, rtlText));
|
|
37
37
|
var expected = 'rtl';
|
|
38
38
|
var actual = subject.find(contentSelector).prop('style');
|
|
39
39
|
expect(actual).toHaveProperty('direction', expected);
|
|
40
40
|
});
|
|
41
41
|
test('should force the directionality text if forceDirection is specified', function () {
|
|
42
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(_index.Marquee, {
|
|
42
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_index.Marquee, {
|
|
43
43
|
forceDirection: "ltr"
|
|
44
44
|
}, rtlText));
|
|
45
45
|
var expected = 'ltr';
|
|
@@ -47,7 +47,7 @@ describe('Marquee', function () {
|
|
|
47
47
|
expect(actual).toHaveProperty('direction', expected);
|
|
48
48
|
});
|
|
49
49
|
test('should switch directionality when the text content changes after initial render', function () {
|
|
50
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(_index.Marquee, null, ltrText));
|
|
50
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_index.Marquee, null, ltrText));
|
|
51
51
|
subject.setProps({
|
|
52
52
|
children: rtlText
|
|
53
53
|
});
|
|
@@ -57,7 +57,7 @@ describe('Marquee', function () {
|
|
|
57
57
|
expect(actual).toHaveProperty('direction', expected);
|
|
58
58
|
});
|
|
59
59
|
test('should not switch directionality when the text content changes after initial render and the forceDirection property was already set', function () {
|
|
60
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(_index.Marquee, {
|
|
60
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_index.Marquee, {
|
|
61
61
|
forceDirection: "ltr"
|
|
62
62
|
}, ltrText));
|
|
63
63
|
subject.setProps({
|
|
@@ -69,7 +69,7 @@ describe('Marquee', function () {
|
|
|
69
69
|
expect(actual).toHaveProperty('direction', expected);
|
|
70
70
|
});
|
|
71
71
|
test('should override direction to RTL when forceDirection is set and locale is LTR', function () {
|
|
72
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(_index.Marquee, {
|
|
72
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_index.Marquee, {
|
|
73
73
|
forceDirection: "rtl",
|
|
74
74
|
locale: "ltr"
|
|
75
75
|
}));
|
|
@@ -78,7 +78,7 @@ describe('Marquee', function () {
|
|
|
78
78
|
expect(actual).toHaveProperty('direction', expected);
|
|
79
79
|
});
|
|
80
80
|
test('should override direction to LTR when forceDirection is set and locale is RTL', function () {
|
|
81
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(_index.Marquee, {
|
|
81
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_index.Marquee, {
|
|
82
82
|
forceDirection: "ltr",
|
|
83
83
|
locale: "rtl"
|
|
84
84
|
}));
|
|
@@ -87,7 +87,7 @@ describe('Marquee', function () {
|
|
|
87
87
|
expect(actual).toHaveProperty('direction', expected);
|
|
88
88
|
});
|
|
89
89
|
test('should have direction of RTL when forceDirection is RTL and locale is RTL', function () {
|
|
90
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(_index.Marquee, {
|
|
90
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_index.Marquee, {
|
|
91
91
|
forceDirection: "rtl",
|
|
92
92
|
locale: "rtl"
|
|
93
93
|
}));
|
|
@@ -96,7 +96,7 @@ describe('Marquee', function () {
|
|
|
96
96
|
expect(actual).toHaveProperty('direction', expected);
|
|
97
97
|
});
|
|
98
98
|
test('should have direction of LTR when forceDirection is LTR and locale is LTR', function () {
|
|
99
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(_index.Marquee, {
|
|
99
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_index.Marquee, {
|
|
100
100
|
forceDirection: "ltr",
|
|
101
101
|
locale: "ltr"
|
|
102
102
|
}));
|
|
@@ -105,7 +105,7 @@ describe('Marquee', function () {
|
|
|
105
105
|
expect(actual).toHaveProperty('direction', expected);
|
|
106
106
|
});
|
|
107
107
|
test('should convert percentage values of marqueeSpacing to absolute values', function (done) {
|
|
108
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(_index.Marquee, {
|
|
108
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_index.Marquee, {
|
|
109
109
|
marqueeSpacing: "60%",
|
|
110
110
|
marqueeOn: "render",
|
|
111
111
|
marqueeOnRenderDelay: 10
|
|
@@ -119,7 +119,7 @@ describe('Marquee', function () {
|
|
|
119
119
|
}, 100);
|
|
120
120
|
});
|
|
121
121
|
test('should pass absolute values of marqueeSpacing', function (done) {
|
|
122
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(_index.Marquee, {
|
|
122
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_index.Marquee, {
|
|
123
123
|
marqueeSpacing: 80,
|
|
124
124
|
marqueeOn: "render",
|
|
125
125
|
marqueeOnRenderDelay: 10
|
|
@@ -136,13 +136,13 @@ describe('Marquee', function () {
|
|
|
136
136
|
describe('MarqueeBase', function () {
|
|
137
137
|
// Computed Property Tests
|
|
138
138
|
test('should not include the animate class when animating is false', function () {
|
|
139
|
-
var subject = (0, _enzyme.shallow)(_react["default"].createElement(_index.MarqueeBase, null));
|
|
139
|
+
var subject = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_index.MarqueeBase, null));
|
|
140
140
|
var expected = false;
|
|
141
141
|
var actual = subject.childAt(0).hasClass(_MarqueeModule["default"].animate);
|
|
142
142
|
expect(actual).toBe(expected);
|
|
143
143
|
});
|
|
144
144
|
test('should include the animate class when animating is true', function () {
|
|
145
|
-
var subject = (0, _enzyme.shallow)(_react["default"].createElement(_index.MarqueeBase, {
|
|
145
|
+
var subject = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_index.MarqueeBase, {
|
|
146
146
|
animating: true
|
|
147
147
|
}));
|
|
148
148
|
var expected = true;
|
|
@@ -150,19 +150,19 @@ describe('MarqueeBase', function () {
|
|
|
150
150
|
expect(actual).toBe(expected);
|
|
151
151
|
});
|
|
152
152
|
test('should not transition when animating is false', function () {
|
|
153
|
-
var subject = (0, _enzyme.shallow)(_react["default"].createElement(_index.MarqueeBase, null));
|
|
153
|
+
var subject = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_index.MarqueeBase, null));
|
|
154
154
|
var actual = subject.childAt(0).prop('style');
|
|
155
155
|
expect(actual).not.toHaveProperty('transition');
|
|
156
156
|
});
|
|
157
157
|
test('should transition when animating is true', function () {
|
|
158
|
-
var subject = (0, _enzyme.shallow)(_react["default"].createElement(_index.MarqueeBase, {
|
|
158
|
+
var subject = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_index.MarqueeBase, {
|
|
159
159
|
animating: true
|
|
160
160
|
}));
|
|
161
161
|
var actual = subject.childAt(0).prop('style');
|
|
162
162
|
expect(actual).toHaveProperty('transitionDuration');
|
|
163
163
|
});
|
|
164
164
|
test('should set RTL direction in LTR context when the text directionality is RTL', function () {
|
|
165
|
-
var subject = (0, _enzyme.shallow)(_react["default"].createElement(_index.MarqueeBase, {
|
|
165
|
+
var subject = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_index.MarqueeBase, {
|
|
166
166
|
rtl: true
|
|
167
167
|
}), {
|
|
168
168
|
context: {
|
|
@@ -174,7 +174,7 @@ describe('MarqueeBase', function () {
|
|
|
174
174
|
expect(actual).toBe(expected);
|
|
175
175
|
});
|
|
176
176
|
test('should set LTR direction in RTL when the text directionality is LTR', function () {
|
|
177
|
-
var subject = (0, _enzyme.shallow)(_react["default"].createElement(_index.MarqueeBase, null), {
|
|
177
|
+
var subject = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_index.MarqueeBase, null), {
|
|
178
178
|
context: {
|
|
179
179
|
rtl: true
|
|
180
180
|
}
|
|
@@ -184,7 +184,7 @@ describe('MarqueeBase', function () {
|
|
|
184
184
|
expect(actual).toBe(expected);
|
|
185
185
|
});
|
|
186
186
|
test('should transition from the right with LTR text', function () {
|
|
187
|
-
var subject = (0, _enzyme.shallow)(_react["default"].createElement(_index.MarqueeBase, {
|
|
187
|
+
var subject = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_index.MarqueeBase, {
|
|
188
188
|
animating: true,
|
|
189
189
|
distance: 100
|
|
190
190
|
}));
|
|
@@ -192,7 +192,7 @@ describe('MarqueeBase', function () {
|
|
|
192
192
|
expect(actual).toHaveProperty('right');
|
|
193
193
|
});
|
|
194
194
|
test('should transition from the left with RTL text', function () {
|
|
195
|
-
var subject = (0, _enzyme.shallow)(_react["default"].createElement(_index.MarqueeBase, {
|
|
195
|
+
var subject = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_index.MarqueeBase, {
|
|
196
196
|
animating: true,
|
|
197
197
|
distance: 100,
|
|
198
198
|
rtl: true
|
|
@@ -201,7 +201,7 @@ describe('MarqueeBase', function () {
|
|
|
201
201
|
expect(actual).toHaveProperty('left');
|
|
202
202
|
});
|
|
203
203
|
test('should duplicate from content when promoted and a non-zero distance', function () {
|
|
204
|
-
var subject = (0, _enzyme.shallow)(_react["default"].createElement(_index.MarqueeBase, {
|
|
204
|
+
var subject = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_index.MarqueeBase, {
|
|
205
205
|
willAnimate: true,
|
|
206
206
|
distance: 100
|
|
207
207
|
}, "Text"));
|
|
@@ -209,7 +209,7 @@ describe('MarqueeBase', function () {
|
|
|
209
209
|
expect(actual).toBe('TextText');
|
|
210
210
|
});
|
|
211
211
|
test('should not duplicate from content when promoted and a zero distance', function () {
|
|
212
|
-
var subject = (0, _enzyme.shallow)(_react["default"].createElement(_index.MarqueeBase, {
|
|
212
|
+
var subject = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_index.MarqueeBase, {
|
|
213
213
|
willAnimate: true,
|
|
214
214
|
distance: 0
|
|
215
215
|
}, "Text"));
|
|
@@ -217,10 +217,49 @@ describe('MarqueeBase', function () {
|
|
|
217
217
|
expect(actual).toBe('Text');
|
|
218
218
|
});
|
|
219
219
|
test('should not duplicate from content when not promoted and a non-zero distance', function () {
|
|
220
|
-
var subject = (0, _enzyme.shallow)(_react["default"].createElement(_index.MarqueeBase, {
|
|
220
|
+
var subject = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_index.MarqueeBase, {
|
|
221
221
|
distance: 100
|
|
222
222
|
}, "Text"));
|
|
223
223
|
var actual = subject.text();
|
|
224
224
|
expect(actual).toBe('Text');
|
|
225
225
|
});
|
|
226
|
+
test('should add aria-label with content when promoted and a non-zero distance', function () {
|
|
227
|
+
var text = 'Text';
|
|
228
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_index.MarqueeBase, {
|
|
229
|
+
willAnimate: true,
|
|
230
|
+
distance: 100
|
|
231
|
+
}, text));
|
|
232
|
+
var expected = text;
|
|
233
|
+
var actual = subject.childAt(0).prop('aria-label');
|
|
234
|
+
expect(actual).toBe(expected);
|
|
235
|
+
});
|
|
236
|
+
test('should not override aria-label with content when promoted and a non-zero distance', function () {
|
|
237
|
+
var aria = 'Custom';
|
|
238
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_index.MarqueeBase, {
|
|
239
|
+
willAnimate: true,
|
|
240
|
+
distance: 100,
|
|
241
|
+
"aria-label": aria
|
|
242
|
+
}, "Text"));
|
|
243
|
+
var expected = aria;
|
|
244
|
+
var actual = subject.childAt(0).prop('aria-label');
|
|
245
|
+
expect(actual).toBe(expected);
|
|
246
|
+
});
|
|
247
|
+
test('should concatenate string children when promoted and a non-zero distance', function () {
|
|
248
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_index.MarqueeBase, {
|
|
249
|
+
willAnimate: true,
|
|
250
|
+
distance: 100
|
|
251
|
+
}, "This is ", 'A', " test"));
|
|
252
|
+
var expected = 'This is A test';
|
|
253
|
+
var actual = subject.childAt(0).prop('aria-label');
|
|
254
|
+
expect(actual).toBe(expected);
|
|
255
|
+
});
|
|
256
|
+
test('should not concatenate non-string children when promoted and a non-zero distance', function () {
|
|
257
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_index.MarqueeBase, {
|
|
258
|
+
willAnimate: true,
|
|
259
|
+
distance: 100
|
|
260
|
+
}, "Test", /*#__PURE__*/_react["default"].createElement("div", null, "Hello"), "World"));
|
|
261
|
+
var expected = 'Test World';
|
|
262
|
+
var actual = subject.childAt(0).prop('aria-label');
|
|
263
|
+
expect(actual).toBe(expected);
|
|
264
|
+
});
|
|
226
265
|
});
|
package/Measurable/Measurable.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
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); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -9,17 +11,25 @@ var _hoc = _interopRequireDefault(require("@enact/core/hoc"));
|
|
|
9
11
|
|
|
10
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
13
|
|
|
12
|
-
function
|
|
14
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
15
|
+
|
|
16
|
+
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; }
|
|
13
17
|
|
|
14
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
19
|
|
|
16
20
|
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; }
|
|
17
21
|
|
|
18
|
-
function
|
|
22
|
+
function _createForOfIteratorHelper(o) { if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) { var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var it, normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
23
|
+
|
|
24
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
25
|
+
|
|
26
|
+
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."); }
|
|
19
27
|
|
|
20
|
-
function
|
|
28
|
+
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); }
|
|
21
29
|
|
|
22
|
-
function
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
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; }
|
|
23
33
|
|
|
24
34
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
25
35
|
|
|
@@ -80,12 +90,11 @@ var useMeasurable = function useMeasurable() {
|
|
|
80
90
|
}; // Fallback support for MutationObserver
|
|
81
91
|
} else if (typeof MutationObserver === 'function') {
|
|
82
92
|
var mutationObserver = new MutationObserver(function (mutationsList) {
|
|
83
|
-
var
|
|
84
|
-
|
|
85
|
-
var _iteratorError = undefined;
|
|
93
|
+
var _iterator = _createForOfIteratorHelper(mutationsList),
|
|
94
|
+
_step;
|
|
86
95
|
|
|
87
96
|
try {
|
|
88
|
-
for (
|
|
97
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
89
98
|
var mutation = _step.value;
|
|
90
99
|
|
|
91
100
|
if (mutation.type === 'childList') {
|
|
@@ -95,18 +104,9 @@ var useMeasurable = function useMeasurable() {
|
|
|
95
104
|
}
|
|
96
105
|
}
|
|
97
106
|
} catch (err) {
|
|
98
|
-
|
|
99
|
-
_iteratorError = err;
|
|
107
|
+
_iterator.e(err);
|
|
100
108
|
} finally {
|
|
101
|
-
|
|
102
|
-
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
|
|
103
|
-
_iterator["return"]();
|
|
104
|
-
}
|
|
105
|
-
} finally {
|
|
106
|
-
if (_didIteratorError) {
|
|
107
|
-
throw _iteratorError;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
109
|
+
_iterator.f();
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
112
|
mutationObserver.observe(refToMeasure, {
|
|
@@ -157,7 +157,7 @@ var Measurable = (0, _hoc["default"])(defaultConfig, function (configHoc, Wrappe
|
|
|
157
157
|
measurement = _useMeasurable.measurement;
|
|
158
158
|
|
|
159
159
|
var measurementProps = (_measurementProps = {}, _defineProperty(_measurementProps, configHoc.refProp, ref), _defineProperty(_measurementProps, configHoc.measurementProp, measurement), _measurementProps);
|
|
160
|
-
return _react["default"].createElement(Wrapped, Object.assign({}, props, measurementProps));
|
|
160
|
+
return /*#__PURE__*/_react["default"].createElement(Wrapped, Object.assign({}, props, measurementProps));
|
|
161
161
|
};
|
|
162
162
|
});
|
|
163
163
|
exports.Measurable = Measurable;
|
package/Media/Media.d.ts
CHANGED
|
@@ -93,7 +93,7 @@ element and props matching their name will be executed as callback functions whe
|
|
|
93
93
|
*/
|
|
94
94
|
|
|
95
95
|
export class Media extends React.Component<
|
|
96
|
-
|
|
96
|
+
Merge<React.HTMLProps<HTMLElement>, MediaProps>
|
|
97
97
|
> {}
|
|
98
98
|
|
|
99
99
|
export default Media;
|