@enact/ui 4.5.1 → 4.6.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.
Files changed (185) hide show
  1. package/AnnounceDecorator/Announce.js +1 -40
  2. package/AnnounceDecorator/AnnounceDecorator.js +3 -21
  3. package/AnnounceDecorator/tests/Announce-specs.js +2 -7
  4. package/AnnounceDecorator/tests/AnnounceDecorator-specs.js +2 -6
  5. package/AnnounceDecorator/tests/useAnnounce-specs.js +8 -19
  6. package/AnnounceDecorator/useAnnounce.js +0 -6
  7. package/BodyText/BodyText.d.ts +1 -1
  8. package/BodyText/BodyText.js +8 -28
  9. package/BodyText/tests/BodyText-specs.js +0 -19
  10. package/Button/Button.d.ts +6 -6
  11. package/Button/Button.js +33 -63
  12. package/Button/tests/Button-specs.js +0 -26
  13. package/CHANGELOG.md +36 -0
  14. package/Cancelable/Cancelable.js +8 -47
  15. package/Cancelable/cancelHandler.js +5 -12
  16. package/Cancelable/modalHandler.js +3 -11
  17. package/Cancelable/tests/Cancelable-specs.js +3 -57
  18. package/Changeable/Changeable.js +2 -34
  19. package/Changeable/tests/Changeable-specs.js +20 -66
  20. package/ComponentOverride/ComponentOverride.js +1 -13
  21. package/FloatingLayer/FloatingLayer.js +17 -73
  22. package/FloatingLayer/FloatingLayerContainer.js +0 -15
  23. package/FloatingLayer/FloatingLayerDecorator.js +4 -17
  24. package/FloatingLayer/Scrim.js +9 -53
  25. package/FloatingLayer/index.js +0 -4
  26. package/FloatingLayer/tests/FloatingLayer-specs.js +8 -22
  27. package/FloatingLayer/tests/Scrim-specs.js +0 -9
  28. package/FloatingLayer/tests/useFloatingLayerDecorator-specs.js +0 -13
  29. package/FloatingLayer/useFloatingLayer.js +3 -14
  30. package/FloatingLayer/useFloatingLayerDecorator.js +3 -11
  31. package/ForwardRef/ForwardRef.js +1 -10
  32. package/GridListImageItem/GridListImageItem.d.ts +1 -1
  33. package/GridListImageItem/GridListImageItem.js +18 -51
  34. package/Group/Group.js +5 -36
  35. package/Group/GroupItem.js +16 -33
  36. package/Group/tests/Group-specs.js +0 -32
  37. package/Heading/Heading.js +8 -36
  38. package/Heading/tests/Heading-specs.js +81 -14
  39. package/Icon/Icon.d.ts +4 -4
  40. package/Icon/Icon.js +19 -53
  41. package/Icon/tests/Icon-specs.js +0 -22
  42. package/IconButton/IconButton.d.ts +4 -4
  43. package/IconButton/IconButton.js +17 -55
  44. package/IconButton/tests/IconButton-specs.js +0 -7
  45. package/Image/Image.js +17 -46
  46. package/Image/tests/Image-specs.js +0 -14
  47. package/ImageItem/ImageItem.js +18 -47
  48. package/ImageItem/tests/ImageItem-specs.js +0 -25
  49. package/Item/Item.js +9 -33
  50. package/Item/tests/Item-specs.js +0 -24
  51. package/LabeledIcon/LabeledIcon.d.ts +2 -2
  52. package/LabeledIcon/LabeledIcon.js +22 -53
  53. package/LabeledIcon/tests/LabeledIcon-specs.js +0 -14
  54. package/Layout/Cell.js +18 -44
  55. package/Layout/Layout.d.ts +16 -16
  56. package/Layout/Layout.js +23 -46
  57. package/Layout/tests/Layout-specs.js +10 -39
  58. package/Marquee/MarqueeBase.js +31 -64
  59. package/Marquee/MarqueeController.js +11 -72
  60. package/Marquee/MarqueeDecorator.js +70 -196
  61. package/Marquee/index.js +1 -5
  62. package/Marquee/tests/Marquee-specs.js +295 -87
  63. package/Measurable/Measurable.js +12 -34
  64. package/Measurable/tests/Measurable-specs.js +115 -0
  65. package/Media/Media.js +15 -65
  66. package/Media/tests/Media-specs.js +168 -0
  67. package/Placeholder/PlaceholderControllerDecorator.js +7 -43
  68. package/Placeholder/PlaceholderDecorator.js +7 -38
  69. package/Placeholder/index.js +1 -5
  70. package/Placeholder/tests/PlaceholderControllerDecorator-specs.js +25 -0
  71. package/Placeholder/tests/PlaceholderDecorator-specs.js +28 -0
  72. package/ProgressBar/ProgressBar.js +14 -45
  73. package/ProgressBar/tests/ProgressBar-specs.js +0 -17
  74. package/RadioDecorator/RadioControllerDecorator.js +1 -29
  75. package/RadioDecorator/RadioDecorator.js +4 -42
  76. package/RadioDecorator/tests/RadioDecorator-specs.js +12 -49
  77. package/Repeater/Repeater.js +9 -33
  78. package/Repeater/tests/Repeater-specs.js +0 -38
  79. package/Resizable/Resizable.js +9 -37
  80. package/Resizable/tests/Resizable-specs.js +34 -0
  81. package/Routable/Link.js +11 -47
  82. package/Routable/Routable.d.ts +2 -2
  83. package/Routable/Routable.js +12 -35
  84. package/Routable/Route.js +0 -6
  85. package/Routable/Router.js +15 -58
  86. package/Routable/tests/Routable-specs.js +7 -33
  87. package/Routable/tests/Router-specs.js +18 -44
  88. package/Routable/useLink.js +4 -8
  89. package/Routable/util.js +18 -24
  90. package/Scrollable/ScrollAnimator.js +49 -65
  91. package/Scrollable/ScrollThumb.js +2 -13
  92. package/Scrollable/Scrollable.js +180 -387
  93. package/Scrollable/ScrollableNative.js +189 -392
  94. package/Scrollable/Scrollbar.js +30 -102
  95. package/Scroller/Scroller.js +15 -39
  96. package/Scroller/ScrollerBasic.js +34 -89
  97. package/Scroller/UiScrollerBase.js +31 -84
  98. package/Scroller/tests/Scroller-specs.js +56 -0
  99. package/Skinnable/Skinnable.js +11 -38
  100. package/Skinnable/tests/Skinnable-specs.js +3 -74
  101. package/Skinnable/tests/useSkins-specs.js +1 -13
  102. package/Skinnable/tests/util-specs.js +0 -14
  103. package/Skinnable/useSkins.js +8 -15
  104. package/Skinnable/util.js +9 -20
  105. package/Slider/Knob.js +5 -24
  106. package/Slider/PositionDecorator.js +16 -54
  107. package/Slider/Slider.d.ts +2 -2
  108. package/Slider/Slider.js +29 -67
  109. package/Slider/tests/Slider-specs.js +94 -7
  110. package/Slider/utils.js +0 -2
  111. package/SlotItem/SlotItem.d.ts +1 -1
  112. package/SlotItem/SlotItem.js +17 -43
  113. package/SlotItem/tests/SlotItem-specs.js +0 -5
  114. package/Slottable/Slottable.js +4 -12
  115. package/Slottable/tests/Slottable-specs.js +19 -46
  116. package/Slottable/tests/useSlots-specs.js +27 -65
  117. package/Slottable/useSlots.js +8 -33
  118. package/Spinner/Spinner.d.ts +1 -1
  119. package/Spinner/Spinner.js +16 -43
  120. package/Spinner/tests/Spinner-specs.js +0 -15
  121. package/ToggleIcon/ToggleIcon.js +10 -36
  122. package/ToggleIcon/tests/ToggleIcon-specs.js +0 -16
  123. package/ToggleItem/ToggleItem.d.ts +3 -3
  124. package/ToggleItem/ToggleItem.js +18 -55
  125. package/ToggleItem/tests/ToggleItem-specs.js +0 -30
  126. package/Toggleable/Toggle.js +1 -15
  127. package/Toggleable/Toggleable.js +12 -45
  128. package/Toggleable/tests/Toggleable-specs.js +28 -96
  129. package/Toggleable/useToggle.js +3 -19
  130. package/Touchable/ClickAllow.js +5 -14
  131. package/Touchable/Drag.js +16 -54
  132. package/Touchable/Flick.js +11 -42
  133. package/Touchable/Hold.js +21 -68
  134. package/Touchable/Touch.js +37 -65
  135. package/Touchable/Touchable.js +32 -71
  136. package/Touchable/config.js +8 -22
  137. package/Touchable/tests/Touchable-specs.js +270 -119
  138. package/Touchable/tests/useTouch-specs.js +6 -80
  139. package/Touchable/useTouch.js +17 -34
  140. package/Transition/Transition.js +37 -118
  141. package/Transition/tests/Transition-specs.js +20 -60
  142. package/ViewManager/Arranger.js +10 -22
  143. package/ViewManager/TransitionGroup.js +32 -107
  144. package/ViewManager/View.js +35 -91
  145. package/ViewManager/ViewManager.d.ts +1 -1
  146. package/ViewManager/ViewManager.js +20 -84
  147. package/ViewManager/tests/View-specs.js +0 -17
  148. package/ViewManager/tests/ViewManager-specs.js +236 -305
  149. package/ViewManager/tests/test-utils.js +0 -8
  150. package/VirtualList/UiVirtualListBase.js +259 -409
  151. package/VirtualList/VirtualList.d.ts +4 -4
  152. package/VirtualList/VirtualList.js +29 -69
  153. package/VirtualList/VirtualListBase.js +0 -3
  154. package/VirtualList/VirtualListBasic.js +273 -431
  155. package/VirtualList/tests/VirtualGridList-native-specs.js +161 -0
  156. package/VirtualList/tests/VirtualGridList-specs.js +614 -0
  157. package/VirtualList/tests/VirtualList-native-specs.js +152 -0
  158. package/VirtualList/tests/VirtualList-specs.js +423 -95
  159. package/internal/IdProvider/IdProvider.js +7 -21
  160. package/internal/IdProvider/Provider.js +4 -17
  161. package/internal/IdProvider/tests/IdProvider-specs.js +44 -0
  162. package/internal/IdProvider/tests/useId-specs.js +6 -20
  163. package/internal/IdProvider/useId.js +0 -6
  164. package/internal/Pure/Pure.js +3 -30
  165. package/internal/Pure/tests/Pure-specs.js +88 -0
  166. package/internal/localized-fonts/localized-fonts.js +33 -62
  167. package/internal/localized-fonts/tests/localized-fonts-specs.js +33 -0
  168. package/internal/selection/selection.js +1 -6
  169. package/internal/selection/tests/selection-specs.js +6 -4
  170. package/internal/validators/tests/validators-specs.js +80 -0
  171. package/internal/validators/validators.js +14 -34
  172. package/package.json +9 -3
  173. package/resolution/ResolutionDecorator.js +4 -40
  174. package/resolution/index.js +0 -7
  175. package/resolution/resolution.js +42 -80
  176. package/resolution/tests/ResolutionDecorator-specs.js +4 -11
  177. package/resolution/tests/resolution-specs.js +2 -2
  178. package/useControlledState/tests/useControlledState-specs.js +15 -46
  179. package/useControlledState/useControlledState.js +11 -22
  180. package/useScroll/ScrollAnimator.js +49 -65
  181. package/useScroll/Scrollbar.js +22 -58
  182. package/useScroll/ScrollbarTrack.js +3 -19
  183. package/useScroll/useScroll.js +267 -454
  184. package/useScroll/utilDOM.js +8 -14
  185. package/useScroll/utilEvent.js +0 -4
package/Layout/Cell.js CHANGED
@@ -4,55 +4,37 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.toFlexAlign = exports["default"] = exports.CellDecorator = exports.CellBase = exports.Cell = void 0;
7
-
8
7
  var _propTypes = _interopRequireDefault(require("@enact/core/internal/prop-types"));
9
-
10
8
  var _kind = _interopRequireDefault(require("@enact/core/kind"));
11
-
12
9
  var _propTypes2 = _interopRequireDefault(require("prop-types"));
13
-
14
10
  var _ForwardRef = _interopRequireDefault(require("../ForwardRef"));
15
-
16
11
  var _resolution = _interopRequireDefault(require("../resolution"));
17
-
18
12
  var _LayoutModule = _interopRequireDefault(require("./Layout.module.css"));
19
-
20
13
  var _jsxRuntime = require("react/jsx-runtime");
21
-
22
14
  var _excluded = ["component", "componentRef"];
23
-
24
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
-
26
16
  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; }
27
-
28
17
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
29
-
30
18
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
31
-
32
19
  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; }
33
-
34
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; }
35
-
36
21
  var toFlexAlign = function toFlexAlign(align) {
37
22
  return align === 'end' && 'flex-end' || align === 'start' && 'flex-start' || align;
38
23
  };
24
+
39
25
  /**
40
26
  * A stateless component that provides a space for your content in a
41
- * [Layout]{@link ui/Layout.Layout}, without [CellDecorator](ui/Layout.CellDecorator) applied.
27
+ * {@link ui/Layout.Layout|Layout}, without {@link ui/Layout.CellDecorator|CellDecorator} applied.
42
28
  *
43
29
  * @class CellBase
44
30
  * @memberof ui/Layout
45
31
  * @ui
46
32
  * @public
47
33
  */
48
-
49
-
50
34
  exports.toFlexAlign = toFlexAlign;
51
35
  var CellBase = (0, _kind["default"])({
52
36
  name: 'Cell',
53
- propTypes:
54
- /** @lends ui/Layout.CellBase.prototype */
55
- {
37
+ propTypes: /** @lends ui/Layout.CellBase.prototype */{
56
38
  /**
57
39
  * The alignment of `Cell`.
58
40
  *
@@ -67,15 +49,13 @@ var CellBase = (0, _kind["default"])({
67
49
  * @public
68
50
  */
69
51
  align: _propTypes2["default"].string,
70
-
71
52
  /**
72
- * Any valid [Node]{@link /docs/developer-guide/glossary/#node} that should be positioned in this `Cell`.
53
+ * Any valid {@link /docs/developer-guide/glossary/#node|Node} that should be positioned in this `Cell`.
73
54
  *
74
55
  * @type {Any}
75
56
  * @public
76
57
  */
77
58
  children: _propTypes2["default"].any,
78
-
79
59
  /**
80
60
  * The type of component to use to render as the `Cell`. May be a DOM node name (e.g 'div',
81
61
  * 'span', etc.) or a custom component.
@@ -85,7 +65,6 @@ var CellBase = (0, _kind["default"])({
85
65
  * @public
86
66
  */
87
67
  component: _propTypes["default"].renderable,
88
-
89
68
  /**
90
69
  * Called with a reference to the root component.
91
70
  *
@@ -96,14 +75,13 @@ var CellBase = (0, _kind["default"])({
96
75
  * @public
97
76
  */
98
77
  componentRef: _propTypes["default"].ref,
99
-
100
78
  /**
101
79
  * Sizes `Cell` to its contents.
102
80
  *
103
81
  * A `shrink`able cell will contract to its minimum size, according to the dimensions of its
104
82
  * contents. This is used when you want the size of this Cell's content to influence the
105
83
  * dimensions of this cell. `shrink` will not allow the contents of the Layout to be pushed
106
- * beyond its boundaries (overflowing). See the [size]{@link ui/Layout.Cell#size} property
84
+ * beyond its boundaries (overflowing). See the {@link ui/Layout.Cell#size|size} property
107
85
  * for more details.
108
86
  *
109
87
  * @type {Boolean}
@@ -111,11 +89,10 @@ var CellBase = (0, _kind["default"])({
111
89
  * @public
112
90
  */
113
91
  shrink: _propTypes2["default"].bool,
114
-
115
92
  /**
116
93
  * Sets the desired size of the Cell using any valid CSS measurement value.
117
94
  *
118
- * When used in conjunction with [shrink]{@link ui/Layout.Cell#shrink}, the size will be
95
+ * When used in conjunction with {@link ui/Layout.Cell#shrink|shrink}, the size will be
119
96
  * the maximum size, shrinking as necessary, to fit the content.
120
97
  *
121
98
  * E.g.
@@ -125,8 +102,8 @@ var CellBase = (0, _kind["default"])({
125
102
  *
126
103
  * This accepts any valid CSS measurement value string. If a numeric value is used, it will
127
104
  * be treated as a pixel value and converted to a
128
- * [relative unit]{@link ui/resolution.unit} based on the rules of
129
- * [resolution independence]{@link ui/resolution}.
105
+ * {@link ui/resolution.unit|relative unit} based on the rules of
106
+ * {@link ui/resolution|resolution independence}.
130
107
  *
131
108
  * @type {String|Number}
132
109
  * @public
@@ -144,8 +121,8 @@ var CellBase = (0, _kind["default"])({
144
121
  computed: {
145
122
  className: function className(_ref) {
146
123
  var shrink = _ref.shrink,
147
- size = _ref.size,
148
- styler = _ref.styler;
124
+ size = _ref.size,
125
+ styler = _ref.styler;
149
126
  return styler.append({
150
127
  shrink: shrink,
151
128
  grow: !shrink && !size
@@ -153,12 +130,11 @@ var CellBase = (0, _kind["default"])({
153
130
  },
154
131
  style: function style(_ref2) {
155
132
  var align = _ref2.align,
156
- shrink = _ref2.shrink,
157
- size = _ref2.size,
158
- _style = _ref2.style;
133
+ shrink = _ref2.shrink,
134
+ size = _ref2.size,
135
+ _style = _ref2.style;
159
136
  if (typeof size === 'number') size = _resolution["default"].unit(_resolution["default"].scale(size), 'rem');
160
137
  var cellSize = size;
161
-
162
138
  if (!size) {
163
139
  if (shrink) {
164
140
  cellSize = '100%';
@@ -166,7 +142,6 @@ var CellBase = (0, _kind["default"])({
166
142
  cellSize = 'none';
167
143
  }
168
144
  }
169
-
170
145
  return _objectSpread(_objectSpread({}, _style), {}, {
171
146
  alignSelf: toFlexAlign(align),
172
147
  flexBasis: shrink ? null : size,
@@ -177,9 +152,8 @@ var CellBase = (0, _kind["default"])({
177
152
  },
178
153
  render: function render(_ref3) {
179
154
  var Component = _ref3.component,
180
- componentRef = _ref3.componentRef,
181
- rest = _objectWithoutProperties(_ref3, _excluded);
182
-
155
+ componentRef = _ref3.componentRef,
156
+ rest = _objectWithoutProperties(_ref3, _excluded);
183
157
  delete rest.align;
184
158
  delete rest.shrink;
185
159
  delete rest.size;
@@ -188,6 +162,7 @@ var CellBase = (0, _kind["default"])({
188
162
  }, rest));
189
163
  }
190
164
  });
165
+
191
166
  /**
192
167
  * Applies Cell behaviors.
193
168
  *
@@ -196,14 +171,14 @@ var CellBase = (0, _kind["default"])({
196
171
  * @mixes ui/ForwardRef.ForwardRef
197
172
  * @public
198
173
  */
199
-
200
174
  exports.CellBase = CellBase;
201
175
  var CellDecorator = (0, _ForwardRef["default"])({
202
176
  prop: 'componentRef'
203
177
  });
178
+
204
179
  /**
205
180
  * A stateless component that provides a space for your content in a
206
- * [Layout]{@link ui/Layout.Layout}.
181
+ * {@link ui/Layout.Layout|Layout}.
207
182
  *
208
183
  * @class Cell
209
184
  * @memberof ui/Layout
@@ -213,7 +188,6 @@ var CellDecorator = (0, _ForwardRef["default"])({
213
188
  * @ui
214
189
  * @public
215
190
  */
216
-
217
191
  exports.CellDecorator = CellDecorator;
218
192
  var Cell = CellDecorator(CellBase);
219
193
  exports.Cell = Cell;
@@ -19,7 +19,7 @@ horizontally in the case of a vertical layout. `"start"` , `"center"` and
19
19
  */
20
20
  align?: string;
21
21
  /**
22
- * Any valid [Node] that should be positioned in this `Cell` .
22
+ * Any valid that should be positioned in this `Cell` .
23
23
  */
24
24
  children?: Any;
25
25
  /**
@@ -40,14 +40,14 @@ as `componentRef` .
40
40
  * A `shrink` able cell will contract to its minimum size, according to the dimensions of its
41
41
  contents. This is used when you want the size of this Cell's content to influence the
42
42
  dimensions of this cell. `shrink` will not allow the contents of the Layout to be pushed
43
- beyond its boundaries (overflowing). See the [size] property
43
+ beyond its boundaries (overflowing). See the property
44
44
  for more details.
45
45
  */
46
46
  shrink?: boolean;
47
47
  /**
48
48
  * Sets the desired size of the Cell using any valid CSS measurement value.
49
49
  *
50
- * When used in conjunction with [shrink] , the size will be
50
+ * When used in conjunction with , the size will be
51
51
  the maximum size, shrinking as necessary, to fit the content.
52
52
  *
53
53
  * E.g.
@@ -57,14 +57,14 @@ and will match your contents size if it's smaller
57
57
  *
58
58
  * This accepts any valid CSS measurement value string. If a numeric value is used, it will
59
59
  be treated as a pixel value and converted to a
60
- [relative unit] based on the rules of
61
- [resolution independence] .
60
+ based on the rules of
61
+ .
62
62
  */
63
63
  size?: string | number;
64
64
  }
65
65
  /**
66
66
  * A stateless component that provides a space for your content in a
67
- [Layout] , without applied.
67
+ , without applied.
68
68
  */
69
69
 
70
70
  export class CellBase extends React.Component<
@@ -80,7 +80,7 @@ export interface LayoutBaseProps {
80
80
  /**
81
81
  * The alignment of children.
82
82
  *
83
- * Aligns the children [Cells] vertically in the case of a horizontal
83
+ * Aligns the children vertically in the case of a horizontal
84
84
  layout or horizontally in the case of a vertical layout. `"start"` , `"center"` and
85
85
  `"end"` are the most commonly used, although all values of `align-items` are supported.
86
86
  `"start"` refers to the top in a horizontal layout, and left in a vertical LTR layout
@@ -93,7 +93,7 @@ separated by a space.
93
93
  */
94
94
  align?: string;
95
95
  /**
96
- * Only [Cell] components are supported as children.
96
+ * Only components are supported as children.
97
97
  */
98
98
  children?: Cell | Cell[];
99
99
  /**
@@ -114,7 +114,7 @@ instead of carving out the entire horizontal space for itself.
114
114
  */
115
115
  inline?: boolean;
116
116
  /**
117
- * The orientation of the `Layout` , i.e. how the children [Cells] are
117
+ * The orientation of the `Layout` , i.e. how the children are
118
118
  positioned on the screen. Must be either `'horizontal'` or `'vertical'` .
119
119
  */
120
120
  orientation?: string;
@@ -132,9 +132,9 @@ additional lines are placed above/before the preceding line instead of below/aft
132
132
  /**
133
133
  * A container for `Cell` s.
134
134
  *
135
- * A stateless component that acts as a containing area for [Cells] to be
135
+ * A stateless component that acts as a containing area for to be
136
136
  positioned in a row or a column (horizontally or vertically, respectively. It supports an
137
- [orientation] property for laying-out its contents
137
+ property for laying-out its contents
138
138
  ( `Cells` ) in an organized, readable way.
139
139
  *
140
140
  * Example:
@@ -163,7 +163,7 @@ export interface CellProps
163
163
  extends Omit<Merge<CellBaseProps, CellDecoratorProps>, "componentRef"> {}
164
164
  /**
165
165
  * A stateless component that provides a space for your content in a
166
- [Layout] .
166
+ .
167
167
  */
168
168
 
169
169
  export class Cell extends React.Component<
@@ -183,9 +183,9 @@ export interface LayoutProps
183
183
  /**
184
184
  * A container for `Cell` s.
185
185
  *
186
- * A stateless component that acts as a containing area for [Cells] to be
186
+ * A stateless component that acts as a containing area for to be
187
187
  positioned in a row or a column (horizontally or vertically, respectively. It supports an
188
- [orientation] property for laying-out its contents
188
+ property for laying-out its contents
189
189
  ( `Cells` ) in an organized, readable way.
190
190
  *
191
191
  * Example:
@@ -214,7 +214,7 @@ export interface ColumnProps
214
214
  extends Merge<LayoutProps, ui_ForwardRef_ForwardRefProps> {}
215
215
  /**
216
216
  * Shorthand for `<Layout orientation="vertical">` , which positions its
217
- [Cells] vertically.
217
+ vertically.
218
218
  * ```
219
219
  ┌────┐
220
220
  ├────┤
@@ -232,7 +232,7 @@ export interface RowProps
232
232
  extends Merge<LayoutProps, ui_ForwardRef_ForwardRefProps> {}
233
233
  /**
234
234
  * Shorthand for `<Layout orientation="horizontal">` , which positions its
235
- [Cells] horizontally.
235
+ horizontally.
236
236
  * ```
237
237
  ┌─┬─┬─┬─┐
238
238
  │ │ │ │ │
package/Layout/Layout.js CHANGED
@@ -22,41 +22,26 @@ Object.defineProperty(exports, "CellDecorator", {
22
22
  }
23
23
  });
24
24
  exports["default"] = exports.Row = exports.LayoutDecorator = exports.LayoutBase = exports.Layout = exports.Column = void 0;
25
-
26
25
  var _propTypes = _interopRequireDefault(require("@enact/core/internal/prop-types"));
27
-
28
26
  var _kind = _interopRequireDefault(require("@enact/core/kind"));
29
-
30
27
  var _propTypes2 = _interopRequireDefault(require("prop-types"));
31
-
32
28
  var _ForwardRef = _interopRequireDefault(require("../ForwardRef"));
33
-
34
29
  var _Cell = require("./Cell");
35
-
36
30
  var _LayoutModule = _interopRequireDefault(require("./Layout.module.css"));
37
-
38
31
  var _jsxRuntime = require("react/jsx-runtime");
39
-
40
32
  var _excluded = ["component", "componentRef"];
41
-
42
33
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
43
-
44
34
  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; }
45
-
46
35
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
47
-
48
36
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
49
-
50
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; }
51
-
52
38
  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; }
53
-
54
39
  /**
55
40
  * A container for `Cell`s.
56
41
  *
57
- * A stateless component that acts as a containing area for [Cells]{@link ui/Layout.Cell} to be
42
+ * A stateless component that acts as a containing area for {@link ui/Layout.Cell|Cells} to be
58
43
  * positioned in a row or a column (horizontally or vertically, respectively. It supports an
59
- * [orientation]{@link ui/Layout.Layout#orientation} property for laying-out its contents
44
+ * {@link ui/Layout.Layout#orientation|orientation} property for laying-out its contents
60
45
  * (`Cells`) in an organized, readable way.
61
46
  *
62
47
  * Example:
@@ -83,13 +68,11 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
83
68
  */
84
69
  var LayoutBase = (0, _kind["default"])({
85
70
  name: 'LayoutBase',
86
- propTypes:
87
- /** @lends ui/Layout.LayoutBase.prototype */
88
- {
71
+ propTypes: /** @lends ui/Layout.LayoutBase.prototype */{
89
72
  /**
90
73
  * The alignment of children.
91
74
  *
92
- * Aligns the children [Cells]{@link ui/Layout.Cell} vertically in the case of a horizontal
75
+ * Aligns the children {@link ui/Layout.Cell|Cells} vertically in the case of a horizontal
93
76
  * layout or horizontally in the case of a vertical layout. `"start"`, `"center"` and
94
77
  * `"end"` are the most commonly used, although all values of `align-items` are supported.
95
78
  * `"start"` refers to the top in a horizontal layout, and left in a vertical LTR layout
@@ -104,15 +87,13 @@ var LayoutBase = (0, _kind["default"])({
104
87
  * @public
105
88
  */
106
89
  align: _propTypes2["default"].string,
107
-
108
90
  /**
109
- * Only [Cell]{@link ui/Layout.Cell} components are supported as children.
91
+ * Only {@link ui/Layout.Cell|Cell} components are supported as children.
110
92
  *
111
93
  * @type {Cell|Cell[]}
112
94
  * @public
113
95
  */
114
96
  children: _propTypes2["default"].any,
115
-
116
97
  /**
117
98
  * The type of component to use to render as the `Layout`. May be a DOM node name (e.g 'div',
118
99
  * 'span', etc.) or a custom component.
@@ -122,7 +103,6 @@ var LayoutBase = (0, _kind["default"])({
122
103
  * @public
123
104
  */
124
105
  component: _propTypes["default"].renderable,
125
-
126
106
  /**
127
107
  * Called with a reference to the root component.
128
108
  *
@@ -133,7 +113,6 @@ var LayoutBase = (0, _kind["default"])({
133
113
  * @public
134
114
  */
135
115
  componentRef: _propTypes["default"].ref,
136
-
137
116
  /**
138
117
  * Allows this `Layout` to have following siblings drawn on the same line as itself
139
118
  * instead of carving out the entire horizontal space for itself.
@@ -143,9 +122,8 @@ var LayoutBase = (0, _kind["default"])({
143
122
  * @public
144
123
  */
145
124
  inline: _propTypes2["default"].bool,
146
-
147
125
  /**
148
- * The orientation of the `Layout`, i.e. how the children [Cells]{@link ui/Layout.Cell} are
126
+ * The orientation of the `Layout`, i.e. how the children {@link ui/Layout.Cell|Cells} are
149
127
  * positioned on the screen. Must be either `'horizontal'` or `'vertical'`.
150
128
  *
151
129
  * @type {String}
@@ -153,7 +131,6 @@ var LayoutBase = (0, _kind["default"])({
153
131
  * @public
154
132
  */
155
133
  orientation: _propTypes2["default"].oneOf(['horizontal', 'vertical']),
156
-
157
134
  /**
158
135
  * Sets the Layout's `flex-wrap` values.
159
136
  *
@@ -181,9 +158,9 @@ var LayoutBase = (0, _kind["default"])({
181
158
  computed: {
182
159
  className: function className(_ref) {
183
160
  var inline = _ref.inline,
184
- orientation = _ref.orientation,
185
- wrap = _ref.wrap,
186
- styler = _ref.styler;
161
+ orientation = _ref.orientation,
162
+ wrap = _ref.wrap,
163
+ styler = _ref.styler;
187
164
  return styler.append(orientation, {
188
165
  inline: inline,
189
166
  nowrap: wrap === false || wrap === 'nowrap',
@@ -193,10 +170,11 @@ var LayoutBase = (0, _kind["default"])({
193
170
  },
194
171
  style: function style(_ref2) {
195
172
  var align = _ref2.align,
196
- _style = _ref2.style;
197
- if (!align) return _style; // This is effectively a polyfill for the upcoming `place-items` prop which is shorthand
198
- // for align-items and justify-items together
173
+ _style = _ref2.style;
174
+ if (!align) return _style;
199
175
 
176
+ // This is effectively a polyfill for the upcoming `place-items` prop which is shorthand
177
+ // for align-items and justify-items together
200
178
  var alignParts = align.split(' ');
201
179
  return _objectSpread(_objectSpread({}, _style), {}, {
202
180
  alignItems: (0, _Cell.toFlexAlign)(alignParts[0]),
@@ -206,9 +184,8 @@ var LayoutBase = (0, _kind["default"])({
206
184
  },
207
185
  render: function render(_ref3) {
208
186
  var Component = _ref3.component,
209
- componentRef = _ref3.componentRef,
210
- rest = _objectWithoutProperties(_ref3, _excluded);
211
-
187
+ componentRef = _ref3.componentRef,
188
+ rest = _objectWithoutProperties(_ref3, _excluded);
212
189
  delete rest.align;
213
190
  delete rest.inline;
214
191
  delete rest.orientation;
@@ -218,6 +195,7 @@ var LayoutBase = (0, _kind["default"])({
218
195
  }, rest));
219
196
  }
220
197
  });
198
+
221
199
  /**
222
200
  * Applies Layout behaviors.
223
201
  *
@@ -226,17 +204,17 @@ var LayoutBase = (0, _kind["default"])({
226
204
  * @mixes ui/ForwardRef.ForwardRef
227
205
  * @public
228
206
  */
229
-
230
207
  exports.LayoutBase = LayoutBase;
231
208
  var LayoutDecorator = (0, _ForwardRef["default"])({
232
209
  prop: 'componentRef'
233
210
  });
211
+
234
212
  /**
235
213
  * A container for `Cell`s.
236
214
  *
237
- * A stateless component that acts as a containing area for [Cells]{@link ui/Layout.Cell} to be
215
+ * A stateless component that acts as a containing area for {@link ui/Layout.Cell|Cells} to be
238
216
  * positioned in a row or a column (horizontally or vertically, respectively. It supports an
239
- * [orientation]{@link ui/Layout.Layout#orientation} property for laying-out its contents
217
+ * {@link ui/Layout.Layout#orientation|orientation} property for laying-out its contents
240
218
  * (`Cells`) in an organized, readable way.
241
219
  *
242
220
  * Example:
@@ -264,12 +242,12 @@ var LayoutDecorator = (0, _ForwardRef["default"])({
264
242
  * @ui
265
243
  * @public
266
244
  */
267
-
268
245
  exports.LayoutDecorator = LayoutDecorator;
269
246
  var Layout = LayoutDecorator(LayoutBase);
247
+
270
248
  /**
271
249
  * Shorthand for `<Layout orientation="vertical">`, which positions its
272
- * [Cells]{@link ui/Layout.Cell} vertically.
250
+ * {@link ui/Layout.Cell|Cells} vertically.
273
251
  * ```
274
252
  * ┌────┐
275
253
  * ├────┤
@@ -285,7 +263,6 @@ var Layout = LayoutDecorator(LayoutBase);
285
263
  * @ui
286
264
  * @public
287
265
  */
288
-
289
266
  exports.Layout = Layout;
290
267
  var Column = LayoutDecorator(function (props) {
291
268
  return LayoutBase.inline(_objectSpread(_objectSpread({}, props), {}, {
@@ -294,9 +271,10 @@ var Column = LayoutDecorator(function (props) {
294
271
  });
295
272
  exports.Column = Column;
296
273
  Column.displayName = 'Column';
274
+
297
275
  /**
298
276
  * Shorthand for `<Layout orientation="horizontal">`, which positions its
299
- * [Cells]{@link ui/Layout.Cell} horizontally.
277
+ * {@link ui/Layout.Cell|Cells} horizontally.
300
278
  * ```
301
279
  * ┌─┬─┬─┬─┐
302
280
  * │ │ │ │ │
@@ -310,7 +288,6 @@ Column.displayName = 'Column';
310
288
  * @ui
311
289
  * @public
312
290
  */
313
-
314
291
  var Row = LayoutDecorator(function (props) {
315
292
  return LayoutBase.inline(_objectSpread(_objectSpread({}, props), {}, {
316
293
  orientation: 'horizontal'
@@ -1,42 +1,26 @@
1
1
  "use strict";
2
2
 
3
3
  require("@testing-library/jest-dom");
4
-
5
4
  var _react = require("@testing-library/react");
6
-
7
5
  var _Layout = _interopRequireWildcard(require("../Layout"));
8
-
9
6
  var _jsxRuntime = require("react/jsx-runtime");
10
-
11
7
  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); }
12
-
13
8
  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; }
14
-
15
9
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16
-
17
10
  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; }
18
-
19
11
  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; }
20
-
21
12
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
22
-
23
13
  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."); }
24
-
25
14
  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); }
26
-
27
15
  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; }
28
-
29
16
  function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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; }
30
-
31
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
32
-
33
18
  describe('Layout Specs', function () {
34
19
  var layoutPropAlign = [['baseline', 'baseline'], ['center', 'center'], ['end', 'flex-end'], ['start', 'flex-start']];
35
20
  layoutPropAlign.forEach(function (_ref) {
36
21
  var _ref2 = _slicedToArray(_ref, 2),
37
- value = _ref2[0],
38
- resolved = _ref2[1];
39
-
22
+ value = _ref2[0],
23
+ resolved = _ref2[1];
40
24
  test("should apply '".concat(resolved, "' style value given an align prop value of \"").concat(value, "\""), function () {
41
25
  (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout["default"], {
42
26
  align: value,
@@ -44,9 +28,7 @@ describe('Layout Specs', function () {
44
28
  children: "Body"
45
29
  })
46
30
  }));
47
-
48
31
  var layout = _react.screen.getByText('Body').parentElement;
49
-
50
32
  var expected = resolved;
51
33
  expect(layout).toHaveStyle({
52
34
  'align-items': expected
@@ -60,48 +42,41 @@ describe('Layout Specs', function () {
60
42
  children: "Body"
61
43
  })
62
44
  }));
63
-
64
45
  var layout = _react.screen.getByText('Body').parentElement;
65
-
66
46
  var expected = 'inline';
67
47
  expect(layout).toHaveClass(expected);
68
- }); // Tests for prop and className combinations
48
+ });
69
49
 
50
+ // Tests for prop and className combinations
70
51
  var propStyleCombination = [['orientation', ['horizontal', 'vertical']]];
71
52
  propStyleCombination.forEach(function (_ref3) {
72
53
  var _ref4 = _slicedToArray(_ref3, 2),
73
- prop = _ref4[0],
74
- vals = _ref4[1];
75
-
54
+ prop = _ref4[0],
55
+ vals = _ref4[1];
76
56
  vals.forEach(function (value) {
77
57
  test("should apply classes for ".concat(prop), function () {
78
58
  var propValue = _defineProperty({}, prop, value);
79
-
80
59
  (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout["default"], _objectSpread(_objectSpread({}, propValue), {}, {
81
60
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
82
61
  children: "Body"
83
62
  })
84
63
  })));
85
-
86
64
  var layout = _react.screen.getByText('Body').parentElement;
87
-
88
65
  var expected = value;
89
66
  expect(layout).toHaveClass(expected);
90
67
  });
91
68
  });
92
- }); // Test for boolean classes
69
+ });
93
70
 
71
+ // Test for boolean classes
94
72
  var cellBooleanPropClasses = ['shrink'];
95
73
  cellBooleanPropClasses.forEach(function (prop) {
96
74
  test("should apply a class for ".concat(prop), function () {
97
75
  var props = _defineProperty({}, prop, true);
98
-
99
76
  (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, _objectSpread(_objectSpread({}, props), {}, {
100
77
  children: "Body"
101
78
  })));
102
-
103
79
  var layout = _react.screen.getByText('Body');
104
-
105
80
  var expected = prop;
106
81
  expect(layout).toHaveClass(expected);
107
82
  });
@@ -109,21 +84,17 @@ describe('Layout Specs', function () {
109
84
  var cellPropSize = [['size', ['100px', '50%', '5em']]];
110
85
  cellPropSize.forEach(function (_ref5) {
111
86
  var _ref6 = _slicedToArray(_ref5, 2),
112
- prop = _ref6[0],
113
- vals = _ref6[1];
114
-
87
+ prop = _ref6[0],
88
+ vals = _ref6[1];
115
89
  vals.forEach(function (value) {
116
90
  test("should apply flexBasis styles the size prop value ".concat(value), function () {
117
91
  var propValue = _defineProperty({}, prop, value);
118
-
119
92
  (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout["default"], {
120
93
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, _objectSpread(_objectSpread({}, propValue), {}, {
121
94
  children: "Body"
122
95
  }))
123
96
  }));
124
-
125
97
  var layoutCell = _react.screen.getByText('Body');
126
-
127
98
  var expected = value;
128
99
  expect(layoutCell).toHaveStyle({
129
100
  'flex-basis': expected