@enact/ui 4.7.0 → 4.7.1
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/AnnounceDecorator/Announce.js +10 -11
- package/Button/tests/Button-specs.js +10 -6
- package/CHANGELOG.md +8 -0
- package/Group/tests/Group-specs.js +14 -9
- package/Item/tests/Item-specs.js +10 -6
- package/Marquee/MarqueeController.js +43 -50
- package/Marquee/MarqueeDecorator.js +39 -46
- package/Placeholder/PlaceholderControllerDecorator.js +1 -2
- package/RadioDecorator/RadioDecorator.js +5 -6
- package/RadioDecorator/tests/RadioDecorator-specs.js +28 -20
- package/Resizable/Resizable.js +28 -102
- package/Resizable/ResizeContext.js +17 -0
- package/Resizable/tests/useResize-specs.js +43 -0
- package/Resizable/useResize.js +66 -0
- package/Routable/tests/Routable-specs.js +9 -6
- package/Scrollable/Scrollable.js +14 -20
- package/Scrollable/ScrollableNative.js +19 -26
- package/ToggleIcon/tests/ToggleIcon-specs.js +6 -3
- package/ToggleItem/tests/ToggleItem-specs.js +6 -3
- package/Touchable/Drag.js +2 -2
- package/Touchable/Flick.js +1 -2
- package/Touchable/Hold.js +1 -2
- package/Touchable/Pinch.js +2 -2
- package/ViewManager/View.js +9 -10
- package/VirtualList/UiVirtualListBase.js +3 -8
- package/VirtualList/VirtualListBasic.js +4 -8
- package/package.json +3 -3
|
@@ -73,6 +73,15 @@ var Announce = (_class = /*#__PURE__*/function (_Component) {
|
|
|
73
73
|
_this.alertTimeout = null;
|
|
74
74
|
_this.alert.removeAttribute('aria-label');
|
|
75
75
|
};
|
|
76
|
+
/**
|
|
77
|
+
* Call to update the message for the alert.
|
|
78
|
+
*
|
|
79
|
+
* @method
|
|
80
|
+
* @param {String} message Message to notify the user
|
|
81
|
+
* @param {Boolean} clear Clears a previous message before setting the new message
|
|
82
|
+
* @returns {undefined}
|
|
83
|
+
* @public
|
|
84
|
+
*/
|
|
76
85
|
_this.announce = function (message) {
|
|
77
86
|
var clear = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
78
87
|
if (clear) {
|
|
@@ -108,17 +117,7 @@ var Announce = (_class = /*#__PURE__*/function (_Component) {
|
|
|
108
117
|
if (this.alertTimeout) {
|
|
109
118
|
clearTimeout(this.alertTimeout);
|
|
110
119
|
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Call to update the message for the alert.
|
|
115
|
-
*
|
|
116
|
-
* @method
|
|
117
|
-
* @param {String} message Message to notify the user
|
|
118
|
-
* @param {Boolean} clear Clears a previous message before setting the new message
|
|
119
|
-
* @returns {undefined}
|
|
120
|
-
* @public
|
|
121
|
-
*/)
|
|
120
|
+
})
|
|
122
121
|
}, {
|
|
123
122
|
key: "render",
|
|
124
123
|
value: function render() {
|
|
@@ -6,6 +6,8 @@ var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
|
6
6
|
var _Button = require("../Button");
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
9
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
10
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
9
11
|
describe('Button', function () {
|
|
10
12
|
test('should return a DOM node reference for `componentRef`', function () {
|
|
11
13
|
var ref = jest.fn();
|
|
@@ -71,26 +73,28 @@ describe('Button', function () {
|
|
|
71
73
|
var expected = 'hasIcon';
|
|
72
74
|
expect(button).toHaveClass(expected);
|
|
73
75
|
});
|
|
74
|
-
test('should call onClick', function () {
|
|
76
|
+
test('should call onClick', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
75
77
|
var handleCLick = jest.fn();
|
|
78
|
+
var user = _userEvent["default"].setup();
|
|
76
79
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
|
|
77
80
|
onClick: handleCLick,
|
|
78
81
|
children: "Hello Button!"
|
|
79
82
|
}));
|
|
80
83
|
var button = _react.screen.getByRole('button');
|
|
81
|
-
|
|
84
|
+
yield user.click(button);
|
|
82
85
|
var expected = 1;
|
|
83
86
|
expect(handleCLick).toHaveBeenCalledTimes(expected);
|
|
84
|
-
});
|
|
85
|
-
test('should not call onClick when button is disabled', function () {
|
|
87
|
+
}));
|
|
88
|
+
test('should not call onClick when button is disabled', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
86
89
|
var handleClick = jest.fn();
|
|
90
|
+
var user = _userEvent["default"].setup();
|
|
87
91
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
|
|
88
92
|
disabled: true,
|
|
89
93
|
onClick: handleClick,
|
|
90
94
|
children: "Hello Button!"
|
|
91
95
|
}));
|
|
92
96
|
var button = _react.screen.getByRole('button');
|
|
93
|
-
|
|
97
|
+
yield user.click(button);
|
|
94
98
|
expect(handleClick).not.toHaveBeenCalled();
|
|
95
|
-
});
|
|
99
|
+
}));
|
|
96
100
|
});
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
The following is a curated list of changes in the Enact ui module, newest changes on the top.
|
|
4
4
|
|
|
5
|
+
## [4.7.1] - 2023-06-02
|
|
6
|
+
|
|
7
|
+
No significant changes.
|
|
8
|
+
|
|
9
|
+
## [4.5.3] - 2023-04-06
|
|
10
|
+
|
|
11
|
+
No significant changes.
|
|
12
|
+
|
|
5
13
|
## [4.7.0] - 2023-04-25
|
|
6
14
|
|
|
7
15
|
### Added
|
|
@@ -8,36 +8,41 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
8
8
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
9
9
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
12
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
11
13
|
describe('Group', function () {
|
|
12
14
|
var stringItems = ['One', 'Two', 'Three'];
|
|
13
|
-
test('should call handler with selected on select', function () {
|
|
15
|
+
test('should call handler with selected on select', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
14
16
|
var handleClick = jest.fn();
|
|
17
|
+
var user = _userEvent["default"].setup();
|
|
15
18
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Group.GroupBase, {
|
|
16
19
|
childComponent: "div",
|
|
17
20
|
onSelect: handleClick,
|
|
18
21
|
children: stringItems
|
|
19
22
|
}));
|
|
20
23
|
var selected = _react.screen.getByText('Two');
|
|
21
|
-
|
|
24
|
+
yield user.click(selected);
|
|
22
25
|
var expected = 1;
|
|
23
26
|
var actual = handleClick.mock.calls[0][0].selected;
|
|
24
27
|
expect(actual).toBe(expected);
|
|
25
|
-
});
|
|
26
|
-
test('should call handler with data on select', function () {
|
|
28
|
+
}));
|
|
29
|
+
test('should call handler with data on select', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
27
30
|
var handleClick = jest.fn();
|
|
31
|
+
var user = _userEvent["default"].setup();
|
|
28
32
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Group.GroupBase, {
|
|
29
33
|
childComponent: "div",
|
|
30
34
|
onSelect: handleClick,
|
|
31
35
|
children: stringItems
|
|
32
36
|
}));
|
|
33
37
|
var selected = _react.screen.getByText('Two');
|
|
34
|
-
|
|
38
|
+
yield user.click(selected);
|
|
35
39
|
var expected = stringItems[1];
|
|
36
40
|
var actual = handleClick.mock.calls[0][0].data;
|
|
37
41
|
expect(actual).toBe(expected);
|
|
38
|
-
});
|
|
39
|
-
test('should call handler with data on select stored in the key specified by `selectedEventProp`', function () {
|
|
42
|
+
}));
|
|
43
|
+
test('should call handler with data on select stored in the key specified by `selectedEventProp`', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
40
44
|
var handleClick = jest.fn();
|
|
45
|
+
var user = _userEvent["default"].setup();
|
|
41
46
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Group.GroupBase, {
|
|
42
47
|
childComponent: "div",
|
|
43
48
|
onSelect: handleClick,
|
|
@@ -45,11 +50,11 @@ describe('Group', function () {
|
|
|
45
50
|
children: stringItems
|
|
46
51
|
}));
|
|
47
52
|
var selected = _react.screen.getByText('Two');
|
|
48
|
-
|
|
53
|
+
yield user.click(selected);
|
|
49
54
|
var expected = stringItems[1];
|
|
50
55
|
var actual = handleClick.mock.calls[0][0].value;
|
|
51
56
|
expect(actual).toBe(expected);
|
|
52
|
-
});
|
|
57
|
+
}));
|
|
53
58
|
test('should call handler on move when childSelect="onMouseMove"', function () {
|
|
54
59
|
var handleClick = jest.fn();
|
|
55
60
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Group.GroupBase, {
|
package/Item/tests/Item-specs.js
CHANGED
|
@@ -6,6 +6,8 @@ var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
|
6
6
|
var _Item = _interopRequireDefault(require("../Item"));
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
9
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
10
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
9
11
|
var tap = function tap(node) {
|
|
10
12
|
_react.fireEvent.mouseDown(node);
|
|
11
13
|
_react.fireEvent.mouseUp(node);
|
|
@@ -58,27 +60,29 @@ describe('Item', function () {
|
|
|
58
60
|
tap(item);
|
|
59
61
|
expect(handleClick).not.toHaveBeenCalled();
|
|
60
62
|
});
|
|
61
|
-
test('should call onClick when clicked', function () {
|
|
63
|
+
test('should call onClick when clicked', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
62
64
|
var handleClick = jest.fn();
|
|
65
|
+
var user = _userEvent["default"].setup();
|
|
63
66
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Item["default"], {
|
|
64
67
|
onClick: handleClick,
|
|
65
68
|
children: "I am a normal Item"
|
|
66
69
|
}));
|
|
67
70
|
var item = _react.screen.getByText('I am a normal Item');
|
|
68
|
-
|
|
71
|
+
yield user.click(item);
|
|
69
72
|
var expected = 1;
|
|
70
73
|
expect(handleClick).toHaveBeenCalledTimes(expected);
|
|
71
|
-
});
|
|
72
|
-
test('should not call onClick when clicked and disabled', function () {
|
|
74
|
+
}));
|
|
75
|
+
test('should not call onClick when clicked and disabled', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
73
76
|
var handleClick = jest.fn();
|
|
77
|
+
var user = _userEvent["default"].setup();
|
|
74
78
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Item["default"], {
|
|
75
79
|
disabled: true,
|
|
76
80
|
onClick: handleClick,
|
|
77
81
|
children: "I am a disabled Item"
|
|
78
82
|
}));
|
|
79
83
|
var item = _react.screen.getByText('I am a disabled Item');
|
|
80
|
-
|
|
84
|
+
yield user.click(item);
|
|
81
85
|
expect(handleClick).not.toHaveBeenCalled();
|
|
82
|
-
});
|
|
86
|
+
}));
|
|
83
87
|
});
|
|
84
88
|
});
|
|
@@ -78,6 +78,15 @@ var MarqueeController = (0, _hoc["default"])(defaultConfig, function (config, Wr
|
|
|
78
78
|
_this.cancelJob = new _util.Job(function () {
|
|
79
79
|
return _this.doCancel();
|
|
80
80
|
}, 30);
|
|
81
|
+
/*
|
|
82
|
+
* Registers `component` with a set of handlers for `start` and `stop`.
|
|
83
|
+
*
|
|
84
|
+
* @param {Object} component A component, typically a React component instance, on
|
|
85
|
+
* which handlers will be dispatched.
|
|
86
|
+
* @param {Object} handlers An object containing `start` and `stop` functions
|
|
87
|
+
*
|
|
88
|
+
* @returns {undefined}
|
|
89
|
+
*/
|
|
81
90
|
_this.handleRegister = function (component, handlers) {
|
|
82
91
|
var needsStart = !_this.allInactive() || _this.isFocused;
|
|
83
92
|
_this.controlled.push(_objectSpread(_objectSpread({}, handlers), {}, {
|
|
@@ -88,6 +97,13 @@ var MarqueeController = (0, _hoc["default"])(defaultConfig, function (config, Wr
|
|
|
88
97
|
_this.dispatch('start');
|
|
89
98
|
}
|
|
90
99
|
};
|
|
100
|
+
/*
|
|
101
|
+
* Unregisters `component` for synchronization
|
|
102
|
+
*
|
|
103
|
+
* @param {Object} component A previously registered component
|
|
104
|
+
*
|
|
105
|
+
* @returns {undefined}
|
|
106
|
+
*/
|
|
91
107
|
_this.handleUnregister = function (component) {
|
|
92
108
|
var wasRunning = false;
|
|
93
109
|
for (var i = 0; i < _this.controlled.length; i++) {
|
|
@@ -101,6 +117,13 @@ var MarqueeController = (0, _hoc["default"])(defaultConfig, function (config, Wr
|
|
|
101
117
|
_this.dispatch('start');
|
|
102
118
|
}
|
|
103
119
|
};
|
|
120
|
+
/*
|
|
121
|
+
* Handler for the `start` context function
|
|
122
|
+
*
|
|
123
|
+
* @param {Object} component A previously registered component
|
|
124
|
+
*
|
|
125
|
+
* @returns {undefined}
|
|
126
|
+
*/
|
|
104
127
|
_this.handleStart = function (component) {
|
|
105
128
|
_this.cancelJob.stop();
|
|
106
129
|
if (!_this.anyRunning()) {
|
|
@@ -108,6 +131,13 @@ var MarqueeController = (0, _hoc["default"])(defaultConfig, function (config, Wr
|
|
|
108
131
|
_this.dispatch('start', component);
|
|
109
132
|
}
|
|
110
133
|
};
|
|
134
|
+
/*
|
|
135
|
+
* Handler for the `cancel` context function
|
|
136
|
+
*
|
|
137
|
+
* @param {Object} component A previously registered component
|
|
138
|
+
*
|
|
139
|
+
* @returns {undefined}
|
|
140
|
+
*/
|
|
111
141
|
_this.handleCancel = function () {
|
|
112
142
|
if (_this.anyRunning()) {
|
|
113
143
|
_this.cancelJob.start();
|
|
@@ -120,6 +150,13 @@ var MarqueeController = (0, _hoc["default"])(defaultConfig, function (config, Wr
|
|
|
120
150
|
_this.markAll(STATE.inactive);
|
|
121
151
|
_this.dispatch('stop');
|
|
122
152
|
};
|
|
153
|
+
/*
|
|
154
|
+
* Handler for the `complete` context function
|
|
155
|
+
*
|
|
156
|
+
* @param {Object} component A previously registered component
|
|
157
|
+
*
|
|
158
|
+
* @returns {undefined}
|
|
159
|
+
*/
|
|
123
160
|
_this.handleComplete = function (component) {
|
|
124
161
|
var complete = _this.markReady(component);
|
|
125
162
|
if (complete) {
|
|
@@ -138,6 +175,9 @@ var MarqueeController = (0, _hoc["default"])(defaultConfig, function (config, Wr
|
|
|
138
175
|
_this.isHovered = false;
|
|
139
176
|
_this.cancelJob.start();
|
|
140
177
|
};
|
|
178
|
+
/*
|
|
179
|
+
* Handler for the focus event
|
|
180
|
+
*/
|
|
141
181
|
_this.handleFocus = function (ev) {
|
|
142
182
|
_this.isFocused = true;
|
|
143
183
|
if (!_this.anyRunning()) {
|
|
@@ -146,6 +186,9 @@ var MarqueeController = (0, _hoc["default"])(defaultConfig, function (config, Wr
|
|
|
146
186
|
_this.cancelJob.stop();
|
|
147
187
|
forwardFocus(ev, _this.props);
|
|
148
188
|
};
|
|
189
|
+
/*
|
|
190
|
+
* Handler for the blur event
|
|
191
|
+
*/
|
|
149
192
|
_this.handleBlur = function (ev) {
|
|
150
193
|
_this.isFocused = false;
|
|
151
194
|
if (_this.anyRunning()) {
|
|
@@ -171,56 +214,6 @@ var MarqueeController = (0, _hoc["default"])(defaultConfig, function (config, Wr
|
|
|
171
214
|
value: function componentWillUnmount() {
|
|
172
215
|
this.cancelJob.stop();
|
|
173
216
|
}
|
|
174
|
-
|
|
175
|
-
/*
|
|
176
|
-
* Registers `component` with a set of handlers for `start` and `stop`.
|
|
177
|
-
*
|
|
178
|
-
* @param {Object} component A component, typically a React component instance, on
|
|
179
|
-
* which handlers will be dispatched.
|
|
180
|
-
* @param {Object} handlers An object containing `start` and `stop` functions
|
|
181
|
-
*
|
|
182
|
-
* @returns {undefined}
|
|
183
|
-
*/
|
|
184
|
-
|
|
185
|
-
/*
|
|
186
|
-
* Unregisters `component` for synchronization
|
|
187
|
-
*
|
|
188
|
-
* @param {Object} component A previously registered component
|
|
189
|
-
*
|
|
190
|
-
* @returns {undefined}
|
|
191
|
-
*/
|
|
192
|
-
|
|
193
|
-
/*
|
|
194
|
-
* Handler for the `start` context function
|
|
195
|
-
*
|
|
196
|
-
* @param {Object} component A previously registered component
|
|
197
|
-
*
|
|
198
|
-
* @returns {undefined}
|
|
199
|
-
*/
|
|
200
|
-
|
|
201
|
-
/*
|
|
202
|
-
* Handler for the `cancel` context function
|
|
203
|
-
*
|
|
204
|
-
* @param {Object} component A previously registered component
|
|
205
|
-
*
|
|
206
|
-
* @returns {undefined}
|
|
207
|
-
*/
|
|
208
|
-
|
|
209
|
-
/*
|
|
210
|
-
* Handler for the `complete` context function
|
|
211
|
-
*
|
|
212
|
-
* @param {Object} component A previously registered component
|
|
213
|
-
*
|
|
214
|
-
* @returns {undefined}
|
|
215
|
-
*/
|
|
216
|
-
|
|
217
|
-
/*
|
|
218
|
-
* Handler for the focus event
|
|
219
|
-
*/
|
|
220
|
-
|
|
221
|
-
/*
|
|
222
|
-
* Handler for the blur event
|
|
223
|
-
*/
|
|
224
217
|
}, {
|
|
225
218
|
key: "dispatch",
|
|
226
219
|
value:
|
|
@@ -240,6 +240,12 @@ var MarqueeDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wra
|
|
|
240
240
|
} : null;
|
|
241
241
|
});
|
|
242
242
|
});
|
|
243
|
+
/*
|
|
244
|
+
* Starts the animation without synchronizing
|
|
245
|
+
*
|
|
246
|
+
* @param {Number} [delay] Milliseconds to wait before animating
|
|
247
|
+
* @returns {undefined}
|
|
248
|
+
*/
|
|
243
249
|
_this.start = function () {
|
|
244
250
|
var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.props.marqueeDelay;
|
|
245
251
|
if (_this.props.marqueeDisabled) {
|
|
@@ -264,6 +270,11 @@ var MarqueeDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wra
|
|
|
264
270
|
}, delay, TimerState.START_PENDING);
|
|
265
271
|
}
|
|
266
272
|
};
|
|
273
|
+
/*
|
|
274
|
+
* Stops the animation
|
|
275
|
+
*
|
|
276
|
+
* @returns {undefined}
|
|
277
|
+
*/
|
|
267
278
|
_this.stop = function () {
|
|
268
279
|
_this.clearTimeout();
|
|
269
280
|
if (_this.state.animating) {
|
|
@@ -273,10 +284,23 @@ var MarqueeDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wra
|
|
|
273
284
|
}
|
|
274
285
|
_this.demote();
|
|
275
286
|
};
|
|
287
|
+
/*
|
|
288
|
+
* Starts marquee animation with synchronization, if not already animating and a timer is
|
|
289
|
+
* not already active to start.
|
|
290
|
+
*
|
|
291
|
+
* @param {Number} [delay] Milliseconds to wait before animating
|
|
292
|
+
* @returns {undefined}
|
|
293
|
+
*/
|
|
276
294
|
_this.tryStartingAnimation = function (delay) {
|
|
277
295
|
if (_this.state.animating || _this.timerState !== TimerState.CLEAR) return;
|
|
278
296
|
_this.startAnimation(delay);
|
|
279
297
|
};
|
|
298
|
+
/*
|
|
299
|
+
* Starts marquee animation with synchronization
|
|
300
|
+
*
|
|
301
|
+
* @param {Number} [delay] Milliseconds to wait before animating
|
|
302
|
+
* @returns {undefined}
|
|
303
|
+
*/
|
|
280
304
|
_this.startAnimation = function (delay) {
|
|
281
305
|
_this.promote(delay);
|
|
282
306
|
if (_this.sync) {
|
|
@@ -295,6 +319,11 @@ var MarqueeDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wra
|
|
|
295
319
|
_this.start(delay);
|
|
296
320
|
}
|
|
297
321
|
};
|
|
322
|
+
/*
|
|
323
|
+
* Resets the marquee and restarts it after `marqueeDelay` milliseconds.
|
|
324
|
+
*
|
|
325
|
+
* @returns {undefined}
|
|
326
|
+
*/
|
|
298
327
|
_this.restartAnimation = function (delay) {
|
|
299
328
|
(0, _reactDom.flushSync)(function () {
|
|
300
329
|
_this.setState({
|
|
@@ -313,6 +342,11 @@ var MarqueeDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wra
|
|
|
313
342
|
_this.startAnimation(delay);
|
|
314
343
|
}
|
|
315
344
|
};
|
|
345
|
+
/*
|
|
346
|
+
* Resets and restarts the marquee after `marqueeResetDelay` milliseconds
|
|
347
|
+
*
|
|
348
|
+
* @returns {undefined}
|
|
349
|
+
*/
|
|
316
350
|
_this.resetAnimation = function () {
|
|
317
351
|
var delay = Math.max(MINIMUM_MARQUEE_RESET_DELAY, _this.props.marqueeResetDelay + _this.props.marqueeDelay);
|
|
318
352
|
// If we're already timing a start action, don't reset. Start actions will clear us if
|
|
@@ -331,6 +365,11 @@ var MarqueeDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wra
|
|
|
331
365
|
}, 0, TimerState.RESET_PENDING);
|
|
332
366
|
}
|
|
333
367
|
};
|
|
368
|
+
/*
|
|
369
|
+
* Cancels the marquee
|
|
370
|
+
*
|
|
371
|
+
* @returns {undefined}
|
|
372
|
+
*/
|
|
334
373
|
_this.cancelAnimation = function () {
|
|
335
374
|
if (_this.sync) {
|
|
336
375
|
_this.context.cancel(_assertThisInitialized(_this));
|
|
@@ -686,52 +725,6 @@ var MarqueeDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wra
|
|
|
686
725
|
value: function shouldAnimate(distance) {
|
|
687
726
|
return distance > 0;
|
|
688
727
|
}
|
|
689
|
-
|
|
690
|
-
/*
|
|
691
|
-
* Starts the animation without synchronizing
|
|
692
|
-
*
|
|
693
|
-
* @param {Number} [delay] Milliseconds to wait before animating
|
|
694
|
-
* @returns {undefined}
|
|
695
|
-
*/
|
|
696
|
-
|
|
697
|
-
/*
|
|
698
|
-
* Stops the animation
|
|
699
|
-
*
|
|
700
|
-
* @returns {undefined}
|
|
701
|
-
*/
|
|
702
|
-
|
|
703
|
-
/*
|
|
704
|
-
* Starts marquee animation with synchronization, if not already animating and a timer is
|
|
705
|
-
* not already active to start.
|
|
706
|
-
*
|
|
707
|
-
* @param {Number} [delay] Milliseconds to wait before animating
|
|
708
|
-
* @returns {undefined}
|
|
709
|
-
*/
|
|
710
|
-
|
|
711
|
-
/*
|
|
712
|
-
* Starts marquee animation with synchronization
|
|
713
|
-
*
|
|
714
|
-
* @param {Number} [delay] Milliseconds to wait before animating
|
|
715
|
-
* @returns {undefined}
|
|
716
|
-
*/
|
|
717
|
-
|
|
718
|
-
/*
|
|
719
|
-
* Resets the marquee and restarts it after `marqueeDelay` milliseconds.
|
|
720
|
-
*
|
|
721
|
-
* @returns {undefined}
|
|
722
|
-
*/
|
|
723
|
-
|
|
724
|
-
/*
|
|
725
|
-
* Resets and restarts the marquee after `marqueeResetDelay` milliseconds
|
|
726
|
-
*
|
|
727
|
-
* @returns {undefined}
|
|
728
|
-
*/
|
|
729
|
-
|
|
730
|
-
/*
|
|
731
|
-
* Cancels the marquee
|
|
732
|
-
*
|
|
733
|
-
* @returns {undefined}
|
|
734
|
-
*/
|
|
735
728
|
}, {
|
|
736
729
|
key: "handleUnhover",
|
|
737
730
|
value: function handleUnhover() {
|
|
@@ -104,6 +104,7 @@ var PlaceholderControllerDecorator = (0, _hoc["default"])(defaultConfig, functio
|
|
|
104
104
|
topThreshold: topThreshold
|
|
105
105
|
});
|
|
106
106
|
};
|
|
107
|
+
// queue up notifications when placeholders are first created
|
|
107
108
|
_this.notifyAllJob = new _util.Job(_this.notifyAll, 32);
|
|
108
109
|
_this.handle = _handle.handle.bind(_assertThisInitialized(_this));
|
|
109
110
|
_this.handleNotify = _this.handle((0, _handle.forward)(notify), function (_ref) {
|
|
@@ -149,8 +150,6 @@ var PlaceholderControllerDecorator = (0, _hoc["default"])(defaultConfig, functio
|
|
|
149
150
|
}
|
|
150
151
|
}
|
|
151
152
|
}
|
|
152
|
-
|
|
153
|
-
// queue up notifications when placeholders are first created
|
|
154
153
|
}, {
|
|
155
154
|
key: "setThresholds",
|
|
156
155
|
value: function setThresholds(top, left) {
|
|
@@ -98,6 +98,11 @@ var RadioDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wrapp
|
|
|
98
98
|
args[_key] = arguments[_key];
|
|
99
99
|
}
|
|
100
100
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
101
|
+
/*
|
|
102
|
+
* Invoked by a `RadioControllerDecorator` when the wrapped component should be deactivated
|
|
103
|
+
*
|
|
104
|
+
* @returns {undefined}
|
|
105
|
+
*/
|
|
101
106
|
_this.deactivate = function () {
|
|
102
107
|
if (_this.props[prop]) {
|
|
103
108
|
(0, _handle.forwardCustom)(deactivate)(null, _this.props);
|
|
@@ -150,12 +155,6 @@ var RadioDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wrapp
|
|
|
150
155
|
});
|
|
151
156
|
}
|
|
152
157
|
}
|
|
153
|
-
|
|
154
|
-
/*
|
|
155
|
-
* Invoked by a `RadioControllerDecorator` when the wrapped component should be deactivated
|
|
156
|
-
*
|
|
157
|
-
* @returns {undefined}
|
|
158
|
-
*/
|
|
159
158
|
}, {
|
|
160
159
|
key: "render",
|
|
161
160
|
value: function render() {
|