@enact/ui 4.5.2 → 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 +30 -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 +29 -63
  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
@@ -4,14 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.utilDOM = exports["default"] = void 0;
7
-
8
7
  var _warning = _interopRequireDefault(require("warning"));
9
-
10
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
-
12
9
  // At the end, wes should not use DOM APIs as well as the APIs in the `utilDOM`. If we use them, we have to try to remove them first if possible.
10
+
13
11
  var utilDOM = function () {
14
12
  // Functions
13
+
15
14
  function containsDangerously(ref, target) {
16
15
  if (!target) {
17
16
  return false;
@@ -22,9 +21,10 @@ var utilDOM = function () {
22
21
  process.env.NODE_ENV !== "production" ? (0, _warning["default"])(ref.contains, 'The `contains` function of the Ref is not supported.') : void 0;
23
22
  return ref.contains(target);
24
23
  }
25
-
26
24
  return false;
27
- } // TBD
25
+ }
26
+
27
+ // TBD
28
28
  // Need to define functions for the following DOM APIs
29
29
  // getBoundingClientRect
30
30
  // dataset.spotlightId
@@ -33,20 +33,15 @@ var utilDOM = function () {
33
33
  // removeAttribute
34
34
  // scrollLeft
35
35
  // scrollTop
36
-
37
-
38
36
  function datasetDangerously() {}
39
-
40
37
  function getBoundingClientRectDangerously() {}
41
-
42
38
  function getRectDangerously() {}
43
-
44
39
  function removeAttributeDangerously() {}
45
-
46
40
  function setAttributeDangerously() {}
47
-
48
41
  var scrollLeftDangerously = 0;
49
- var scrollTopDangerously = 0; // Return
42
+ var scrollTopDangerously = 0;
43
+
44
+ // Return
50
45
 
51
46
  return {
52
47
  containsDangerously: containsDangerously,
@@ -59,7 +54,6 @@ var utilDOM = function () {
59
54
  setAttributeDangerously: setAttributeDangerously
60
55
  };
61
56
  }();
62
-
63
57
  exports.utilDOM = utilDOM;
64
58
  var _default = utilDOM;
65
59
  exports["default"] = _default;
@@ -4,14 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.utilEvent = exports["default"] = void 0;
7
-
8
7
  // A `React.useEvent` hooks is introduced in https://github.com/facebook/react/pull/17651
9
8
  // The `useEvent` below will be replaced with the `React.useEvent` later.
10
9
  var utilEvent = function utilEvent(eventName) {
11
10
  return {
12
11
  addEventListener: function addEventListener(ref, fn, param) {
13
12
  if (!ref) return;
14
-
15
13
  if (typeof window !== 'undefined' && (ref === window || ref === document)) {
16
14
  ref.addEventListener(eventName, fn, param);
17
15
  } else if (ref.current) {
@@ -22,7 +20,6 @@ var utilEvent = function utilEvent(eventName) {
22
20
  },
23
21
  removeEventListener: function removeEventListener(ref, fn, param) {
24
22
  if (!ref) return;
25
-
26
23
  if (typeof window !== 'undefined' && (ref === window || ref === document)) {
27
24
  ref.removeEventListener(eventName, fn, param);
28
25
  } else if (ref.current) {
@@ -33,7 +30,6 @@ var utilEvent = function utilEvent(eventName) {
33
30
  }
34
31
  };
35
32
  };
36
-
37
33
  exports.utilEvent = utilEvent;
38
34
  var _default = utilEvent;
39
35
  exports["default"] = _default;