@enact/ui 4.6.2 → 4.7.0
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 +27 -17
- package/AnnounceDecorator/AnnounceDecorator.js +14 -7
- package/AnnounceDecorator/useAnnounce.js +1 -2
- package/BodyText/BodyText.js +14 -8
- package/Button/Button.js +16 -10
- package/CHANGELOG.md +10 -0
- package/Cancelable/Cancelable.js +13 -7
- package/Changeable/Changeable.js +11 -7
- package/ComponentOverride/ComponentOverride.js +18 -7
- package/FloatingLayer/FloatingLayer.js +10 -11
- package/FloatingLayer/FloatingLayerDecorator.js +9 -6
- package/ForwardRef/ForwardRef.js +11 -7
- package/GridListImageItem/GridListImageItem.js +16 -9
- package/Group/Group.js +17 -8
- package/Group/GroupItem.js +14 -10
- package/Heading/Heading.js +20 -9
- package/Icon/Icon.js +15 -8
- package/IconButton/IconButton.js +22 -9
- package/Image/Image.js +16 -8
- package/ImageItem/ImageItem.js +9 -1
- package/Item/Item.js +17 -9
- package/LabeledIcon/LabeledIcon.js +16 -8
- package/Layout/Cell.js +27 -4
- package/Layout/Layout.d.ts +22 -5
- package/Layout/Layout.js +154 -32
- package/Layout/Layout.module.css +8 -0
- package/Layout/tests/Layout-specs.js +39 -0
- package/Marquee/MarqueeController.js +50 -0
- package/Marquee/MarqueeDecorator.js +40 -2
- package/Measurable/Measurable.js +11 -7
- package/Media/Media.js +30 -23
- package/Placeholder/PlaceholderControllerDecorator.js +9 -8
- package/Placeholder/PlaceholderDecorator.js +7 -8
- package/ProgressBar/ProgressBar.js +12 -1
- package/RadioDecorator/RadioDecorator.js +13 -7
- package/Repeater/Repeater.js +14 -10
- package/Resizable/Resizable.js +12 -8
- package/Routable/Link.js +8 -8
- package/Routable/Routable.js +15 -8
- package/Routable/Router.js +10 -10
- package/Scrollable/ScrollThumb.js +8 -9
- package/Scrollable/Scrollable.js +23 -1
- package/Scrollable/ScrollableNative.js +12 -0
- package/Scroller/Scroller.js +8 -1
- package/Scroller/ScrollerBasic.js +8 -9
- package/Scroller/UiScrollerBase.js +11 -12
- package/Skinnable/Skinnable.js +19 -7
- package/Skinnable/useSkins.js +1 -2
- package/Slider/Knob.js +8 -8
- package/Slider/Slider.js +16 -9
- package/SlotItem/SlotItem.js +20 -8
- package/Slottable/Slottable.js +14 -8
- package/Spinner/Spinner.js +24 -9
- package/ToggleIcon/ToggleIcon.js +21 -9
- package/ToggleItem/ToggleItem.js +14 -1
- package/Toggleable/Toggleable.js +11 -7
- package/Toggleable/useToggle.js +0 -1
- package/Touchable/Drag.js +2 -1
- package/Touchable/Flick.js +2 -0
- package/Touchable/Hold.js +2 -0
- package/Touchable/Pinch.js +2 -1
- package/Touchable/Touch.js +3 -3
- package/Touchable/Touchable.js +7 -0
- package/Touchable/useTouch.js +0 -1
- package/Transition/Transition.js +19 -3
- package/ViewManager/Arranger.js +4 -1
- package/ViewManager/TransitionGroup.js +5 -4
- package/ViewManager/View.js +3 -2
- package/ViewManager/ViewManager.js +25 -9
- package/ViewManager/tests/ViewManager-specs.js +44 -0
- package/VirtualList/UiVirtualListBase.js +4 -0
- package/VirtualList/VirtualList.js +11 -1
- package/VirtualList/VirtualListBasic.js +4 -0
- package/internal/IdProvider/IdProvider.js +6 -7
- package/internal/IdProvider/useId.js +0 -1
- package/internal/Pure/Pure.js +11 -7
- package/package.json +2 -2
- package/resolution/ResolutionDecorator.js +36 -7
- package/resolution/resolution.js +23 -7
- package/useScroll/ScrollbarTrack.js +8 -8
- package/useScroll/useScroll.js +17 -1
package/Layout/Layout.js
CHANGED
|
@@ -37,37 +37,159 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
37
37
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
38
38
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
39
39
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
40
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
40
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /**
|
|
41
|
+
* A convenient tool for laying-out content using `Layout`, `Cell`, `Row`, and `Column`.
|
|
42
|
+
*
|
|
43
|
+
* Layout is a powerful and versatile tool used for arranging content on the screen. On a conceptual
|
|
44
|
+
* level, it mixes the best parts of HTML tables wtih the best parts of HTML framesets, both of
|
|
45
|
+
* which were largely abandoned for their drawbacks, ignoring their strengths. A `Layout` is simply
|
|
46
|
+
* a container for `Cell`, the only "legal" child. Conversely, `Cell` may only be used in a
|
|
47
|
+
* `Layout`. Cells in a Layout can either be positioned next to each other (horizontally) or
|
|
48
|
+
* above/below each other (vertically) in what we refer to as a {@link ui/Layout.Row|Row} or
|
|
49
|
+
* {@link ui/Layout.Column|Column}, respectively.
|
|
50
|
+
*
|
|
51
|
+
* The `Row` and `Column` layout presets describe the direction of layout for their children. This
|
|
52
|
+
* can sometimes cause confusion. A `Row` of children naturally forms a _layout_ whose children can
|
|
53
|
+
* have the _appearance_ of columns. To keep things clear, think about the layout rather than the
|
|
54
|
+
* what the children themselves represent.
|
|
55
|
+
*
|
|
56
|
+
* `Layout` is an implementation of flex-box, but with built-in rails, properties, and features to
|
|
57
|
+
* help avoid common problems with flex-box; things like content overflowing, sizing quirks, and
|
|
58
|
+
* positioning problems regarding content of unknown or undefined dimension.
|
|
59
|
+
*
|
|
60
|
+
* The following scenarios are some common cases where `Layout` can truly help out. A quality of
|
|
61
|
+
* `Cell` you'll see below is that when a `Cell` has no defined size, it automatically sizes to fill
|
|
62
|
+
* any remaining space in the `Layout`. If there are multiple auto-sizing `Cell` components, they
|
|
63
|
+
* share the space, subdividing it equally among themselves. It's great to leverage this and only
|
|
64
|
+
* apply sizes to `Cell`s which must have defined sizes. `shrink` is one of the ways you can impose
|
|
65
|
+
* size guidelines on a `Cell`. It automatically fits the size of the Cell to the size of its
|
|
66
|
+
* content.
|
|
67
|
+
*
|
|
68
|
+
* A row of cells where the last one should always attach to the right side, regardless of the size
|
|
69
|
+
* of the main "content" cell:
|
|
70
|
+
* ```
|
|
71
|
+
* ┌───────┬─┐
|
|
72
|
+
* │Main │R│
|
|
73
|
+
* └───────┴─┘
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* ```
|
|
77
|
+
* <Row>
|
|
78
|
+
* <Cell>Main Content</Cell>
|
|
79
|
+
* <Cell shrink>Right Side</Cell>
|
|
80
|
+
* </Row>
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* A "two-column" layout with equal sized cells using `Row`:
|
|
84
|
+
* ```
|
|
85
|
+
* ┌────┬────┐
|
|
86
|
+
* │L │R │
|
|
87
|
+
* └────┴────┘
|
|
88
|
+
* ```
|
|
89
|
+
*
|
|
90
|
+
* ```
|
|
91
|
+
* <Row style={{height: '100%'}}>
|
|
92
|
+
* <Cell>Left Column</Cell>
|
|
93
|
+
* <Cell>Right Column</Cell>
|
|
94
|
+
* </Row>
|
|
95
|
+
* ```
|
|
96
|
+
* *Remember:* The cells of the `Row` are the columns in our layout. It's likely that in a complex
|
|
97
|
+
* layout `Column` would be used inside the left and right cells to arrange the components, as in
|
|
98
|
+
* the example below.
|
|
99
|
+
*
|
|
100
|
+
* A full-height sidebar with a header and body to the right:
|
|
101
|
+
* ```
|
|
102
|
+
* ┌──┬──────┐
|
|
103
|
+
* │S │HEADER│
|
|
104
|
+
* │ ├──────┤
|
|
105
|
+
* │ │Body │
|
|
106
|
+
* │ │ │
|
|
107
|
+
* └──┴──────┘
|
|
108
|
+
* ```
|
|
109
|
+
*
|
|
110
|
+
* ```
|
|
111
|
+
* <Row style={{height: '100%'}}>
|
|
112
|
+
* <Cell size="20%">Sidebar</Cell>
|
|
113
|
+
* <Cell>
|
|
114
|
+
* <Column>
|
|
115
|
+
* <Cell size={90} component="header">
|
|
116
|
+
* <h1>HEADER</h1>
|
|
117
|
+
* </Cell>
|
|
118
|
+
* <Cell>
|
|
119
|
+
* <p>Body area</p>
|
|
120
|
+
* </Cell>
|
|
121
|
+
* </Column>
|
|
122
|
+
* </Cell>
|
|
123
|
+
* </Row>
|
|
124
|
+
* ```
|
|
125
|
+
* *Note:* Here, we've set the height of `Row` so it fills the height of the screen, allowing the
|
|
126
|
+
* Sidebar Cell and content Cell to stretch from the top to the bottom. We've also leveraged the
|
|
127
|
+
* `component` prop on the header cell, which tells `Cell` to render itself as a "header" HTML tag
|
|
128
|
+
* rather than its usual "div" tag.
|
|
129
|
+
*
|
|
130
|
+
* The example below produces a layout like the following:
|
|
131
|
+
* ```
|
|
132
|
+
* ┌─┬─────┬─┐
|
|
133
|
+
* │o│Item │o│
|
|
134
|
+
* └─┴─────┴─┘
|
|
135
|
+
* ```
|
|
136
|
+
*
|
|
137
|
+
* You'll notice the use of some special classes in the example: `"debug layout"`. Adding these on
|
|
138
|
+
* any element in your DOM hierarchy will enable borders in Layout and Cell to help visualize what
|
|
139
|
+
* is happening in the layout. They automatically change color the deeper in the stack they go.
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* <Layout className="debug layout">
|
|
143
|
+
* <Cell shrink>
|
|
144
|
+
* <button>First</button>
|
|
145
|
+
* </Cell>
|
|
146
|
+
* <Cell>
|
|
147
|
+
* <div>A div with some long text in it</div>
|
|
148
|
+
* </Cell>
|
|
149
|
+
* <Cell shrink>
|
|
150
|
+
* <button>Last</button>
|
|
151
|
+
* </Cell>
|
|
152
|
+
* </Layout>
|
|
153
|
+
*
|
|
154
|
+
* @module ui/Layout
|
|
155
|
+
* @exports Cell
|
|
156
|
+
* @exports CellBase
|
|
157
|
+
* @exports CellDecorator
|
|
158
|
+
* @exports Column
|
|
159
|
+
* @exports Layout
|
|
160
|
+
* @exports LayoutBase
|
|
161
|
+
* @exports LayoutDecorator
|
|
162
|
+
* @exports Row
|
|
163
|
+
*/ /**
|
|
164
|
+
* A container for `Cell`s.
|
|
165
|
+
*
|
|
166
|
+
* A stateless component that acts as a containing area for {@link ui/Layout.Cell|Cells} to be
|
|
167
|
+
* positioned in a row or a column (horizontally or vertically, respectively. It supports an
|
|
168
|
+
* {@link ui/Layout.LayoutBase.orientation|orientation} property for laying-out its contents
|
|
169
|
+
* (`Cells`) in an organized, readable way.
|
|
170
|
+
*
|
|
171
|
+
* Example:
|
|
172
|
+
* ```
|
|
173
|
+
* import Input from '@enact/moonstone/Input';
|
|
174
|
+
* import css from './LayoutExample.less';
|
|
175
|
+
* ...
|
|
176
|
+
* <fieldset>
|
|
177
|
+
* <Layout align="center">
|
|
178
|
+
* <Cell component="label" size="40%" className={css.label} shrink>First Name</Cell>
|
|
179
|
+
* <Cell component={Input} placeholder="First" className={css.input} />
|
|
180
|
+
* </Layout>
|
|
181
|
+
* <Layout align="center">
|
|
182
|
+
* <Cell component="label" size="40%" className={css.label} shrink>Last Name</Cell>
|
|
183
|
+
* <Cell component={Input} placeholder="Last" className={css.input} />
|
|
184
|
+
* </Layout>
|
|
185
|
+
* </fieldset>
|
|
186
|
+
* ```
|
|
187
|
+
*
|
|
188
|
+
* @class LayoutBase
|
|
189
|
+
* @ui
|
|
190
|
+
* @memberof ui/Layout
|
|
191
|
+
* @public
|
|
192
|
+
*/
|
|
71
193
|
var LayoutBase = (0, _kind["default"])({
|
|
72
194
|
name: 'LayoutBase',
|
|
73
195
|
propTypes: /** @lends ui/Layout.LayoutBase.prototype */{
|
|
@@ -237,7 +359,7 @@ var LayoutDecorator = (0, _ForwardRef["default"])({
|
|
|
237
359
|
*
|
|
238
360
|
* A stateless component that acts as a containing area for {@link ui/Layout.Cell|Cells} to be
|
|
239
361
|
* positioned in a row or a column (horizontally or vertically, respectively. It supports an
|
|
240
|
-
* {@link ui/Layout.
|
|
362
|
+
* {@link ui/Layout.LayoutBase.orientation|orientation} property for laying-out its contents
|
|
241
363
|
* (`Cells`) in an organized, readable way.
|
|
242
364
|
*
|
|
243
365
|
* Example:
|
package/Layout/Layout.module.css
CHANGED
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
.layout.horizontal > .cell.grow {
|
|
23
23
|
width: 0;
|
|
24
24
|
}
|
|
25
|
+
.layout.horizontal > .cell.grow.size {
|
|
26
|
+
max-width: none;
|
|
27
|
+
min-width: var(--cell-size);
|
|
28
|
+
}
|
|
25
29
|
.layout.vertical {
|
|
26
30
|
flex-direction: column;
|
|
27
31
|
height: 100%;
|
|
@@ -33,6 +37,10 @@
|
|
|
33
37
|
height: 0;
|
|
34
38
|
align-self: normal;
|
|
35
39
|
}
|
|
40
|
+
.layout.vertical > .cell.grow.size {
|
|
41
|
+
max-height: none;
|
|
42
|
+
min-height: var(--cell-size);
|
|
43
|
+
}
|
|
36
44
|
.layout.inline {
|
|
37
45
|
display: inline-flex;
|
|
38
46
|
}
|
|
@@ -104,6 +104,45 @@ describe('Layout Specs', function () {
|
|
|
104
104
|
});
|
|
105
105
|
});
|
|
106
106
|
});
|
|
107
|
+
test('should apply a class for grow', function () {
|
|
108
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
|
|
109
|
+
children: "Body"
|
|
110
|
+
}));
|
|
111
|
+
var cell = _react.screen.getByText('Body');
|
|
112
|
+
var expected = 'grow';
|
|
113
|
+
expect(cell).toHaveClass(expected);
|
|
114
|
+
});
|
|
115
|
+
test('should apply classes for grow and size and flexBasis styles the size prop value 100px', function () {
|
|
116
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout["default"], {
|
|
117
|
+
style: {
|
|
118
|
+
width: "300px"
|
|
119
|
+
},
|
|
120
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
|
|
121
|
+
grow: true,
|
|
122
|
+
size: "100px",
|
|
123
|
+
children: "Body"
|
|
124
|
+
})
|
|
125
|
+
}));
|
|
126
|
+
var cell = _react.screen.getByText('Body');
|
|
127
|
+
var expectedGrowClass = 'grow';
|
|
128
|
+
var expectedSizeClass = 'size';
|
|
129
|
+
var expectedFlexBasis = '100px';
|
|
130
|
+
expect(cell).toHaveClass(expectedGrowClass);
|
|
131
|
+
expect(cell).toHaveClass(expectedSizeClass);
|
|
132
|
+
expect(cell).toHaveStyle({
|
|
133
|
+
'flex-basis': expectedFlexBasis
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
test('should not be apply a class for grow when using shrink', function () {
|
|
137
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
|
|
138
|
+
grow: true,
|
|
139
|
+
shrink: true,
|
|
140
|
+
children: "Body"
|
|
141
|
+
}));
|
|
142
|
+
var cell = _react.screen.getByText('Body');
|
|
143
|
+
var notExpected = 'grow';
|
|
144
|
+
expect(cell).not.toHaveClass(notExpected);
|
|
145
|
+
});
|
|
107
146
|
test('should return a DOM node reference for `componentRef` on `Layout`', function () {
|
|
108
147
|
var ref = jest.fn();
|
|
109
148
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout["default"], {
|
|
@@ -171,6 +171,56 @@ var MarqueeController = (0, _hoc["default"])(defaultConfig, function (config, Wr
|
|
|
171
171
|
value: function componentWillUnmount() {
|
|
172
172
|
this.cancelJob.stop();
|
|
173
173
|
}
|
|
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
|
+
*/
|
|
174
224
|
}, {
|
|
175
225
|
key: "dispatch",
|
|
176
226
|
value:
|
|
@@ -39,8 +39,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
39
39
|
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
40
40
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
41
41
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
42
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
43
|
-
// The minimum number of milliseconds to wait before resetting the marquee position after it finishes.
|
|
42
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } // The minimum number of milliseconds to wait before resetting the marquee position after it finishes.
|
|
44
43
|
var MINIMUM_MARQUEE_RESET_DELAY = 40;
|
|
45
44
|
|
|
46
45
|
/**
|
|
@@ -694,6 +693,45 @@ var MarqueeDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wra
|
|
|
694
693
|
* @param {Number} [delay] Milliseconds to wait before animating
|
|
695
694
|
* @returns {undefined}
|
|
696
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
|
+
*/
|
|
697
735
|
}, {
|
|
698
736
|
key: "handleUnhover",
|
|
699
737
|
value: function handleUnhover() {
|
package/Measurable/Measurable.js
CHANGED
|
@@ -19,13 +19,17 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructur
|
|
|
19
19
|
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(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
20
20
|
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; }
|
|
21
21
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
22
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /* global ResizeObserver, MutationObserver */ /**
|
|
23
|
+
* A higher-order component that adds the ability to measure nodes conveniently.
|
|
24
|
+
*
|
|
25
|
+
* @module ui/Measurable
|
|
26
|
+
* @exports Measurable
|
|
27
|
+
*/ /**
|
|
28
|
+
* Default config for {@link ui/Measurable.Measurable}.
|
|
29
|
+
*
|
|
30
|
+
* @memberof ui/Measurable.Measurable
|
|
31
|
+
* @hocconfig
|
|
32
|
+
*/
|
|
29
33
|
var defaultConfig = {
|
|
30
34
|
/**
|
|
31
35
|
* Configures the prop name to pass the measurement object.
|
package/Media/Media.js
CHANGED
|
@@ -28,29 +28,36 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
28
28
|
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
29
29
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
30
30
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
31
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
31
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /**
|
|
32
|
+
* A representation of `HTMLMediaElement` component with an ability to attach a custom event
|
|
33
|
+
* handler.
|
|
34
|
+
*
|
|
35
|
+
* @module ui/Media
|
|
36
|
+
* @exports getKeyFromSource
|
|
37
|
+
* @exports handledMediaEventsMap
|
|
38
|
+
* @exports Media
|
|
39
|
+
*/ /**
|
|
40
|
+
* Generates a key representing the source node or nodes provided
|
|
41
|
+
*
|
|
42
|
+
* Example:
|
|
43
|
+
* ```
|
|
44
|
+
* getKeyFromSource('path/file.mp4'); // 'path/file.mp4'
|
|
45
|
+
* getKeyFromSource(
|
|
46
|
+
* <source src="path/file.mp4" type="video/mp4" />
|
|
47
|
+
* ); // 'path/file.mp4'
|
|
48
|
+
* getKeyFromSource([
|
|
49
|
+
* <source src="path/file.mp4" type="video/mp4" />,
|
|
50
|
+
* <source src="path/file.ogg" type="video/ogg" />,
|
|
51
|
+
* ]); // 'path/file.mp4+path/file.ogg'
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @function
|
|
55
|
+
* @param {String|Element|Element[]} source URI for a source, `<source>` node, or array of
|
|
56
|
+
* `<source>` nodes
|
|
57
|
+
* @returns {String} Key representing sources
|
|
58
|
+
* @memberof ui/Media
|
|
59
|
+
* @public
|
|
60
|
+
*/
|
|
54
61
|
var getKeyFromSource = function getKeyFromSource() {
|
|
55
62
|
var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
56
63
|
if ( /*#__PURE__*/(0, _react.isValidElement)(source)) {
|