@enact/ui 4.9.0-beta.1 → 5.0.0-alpha.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.
Files changed (152) hide show
  1. package/AnnounceDecorator/Announce.js +1 -1
  2. package/AnnounceDecorator/AnnounceDecorator.js +2 -2
  3. package/BodyText/BodyText.js +2 -2
  4. package/BodyText/tests/BodyText-specs.js +1 -1
  5. package/Button/Button.js +2 -2
  6. package/CHANGELOG.md +21 -0
  7. package/Cancelable/Cancelable.js +1 -1
  8. package/Cancelable/tests/Cancelable-specs.js +2 -2
  9. package/Changeable/Changeable.js +1 -1
  10. package/ComponentOverride/ComponentOverride.js +2 -2
  11. package/FloatingLayer/FloatingLayer.js +2 -2
  12. package/FloatingLayer/FloatingLayerContainer.js +1 -1
  13. package/FloatingLayer/FloatingLayerDecorator.js +2 -2
  14. package/FloatingLayer/Scrim.js +2 -2
  15. package/FloatingLayer/tests/useFloatingLayerDecorator-specs.js +1 -1
  16. package/ForwardRef/ForwardRef.js +1 -1
  17. package/Group/Group.js +2 -2
  18. package/Group/GroupItem.js +2 -2
  19. package/Group/tests/Group-specs.js +1 -1
  20. package/Heading/Heading.js +2 -2
  21. package/Icon/Icon.js +2 -2
  22. package/Icon/Icon.module.css +0 -1
  23. package/Icon/tests/Icon-specs.js +1 -1
  24. package/Image/Image.js +2 -2
  25. package/Image/tests/Image-specs.js +1 -1
  26. package/ImageItem/ImageItem.js +2 -2
  27. package/ImageItem/tests/ImageItem-specs.js +2 -2
  28. package/Item/Item.js +2 -2
  29. package/LabeledIcon/LabeledIcon.js +2 -2
  30. package/Layout/Cell.js +2 -2
  31. package/Layout/Layout.js +2 -2
  32. package/Layout/tests/Layout-specs.js +2 -2
  33. package/Marquee/MarqueeBase.js +2 -2
  34. package/Marquee/MarqueeController.js +1 -1
  35. package/Marquee/MarqueeDecorator.js +19 -27
  36. package/Marquee/index.d.ts +10 -14
  37. package/Marquee/tests/Marquee-specs.js +1 -1
  38. package/Marquee/useMarqueeController.js +15 -11
  39. package/Measurable/Measurable.js +1 -1
  40. package/Measurable/tests/Measurable-specs.js +2 -2
  41. package/Media/Media.js +2 -2
  42. package/Placeholder/PlaceholderControllerDecorator.js +1 -1
  43. package/Placeholder/PlaceholderDecorator.js +1 -1
  44. package/Placeholder/tests/PlaceholderControllerDecorator-specs.js +1 -1
  45. package/ProgressBar/ProgressBar.js +2 -2
  46. package/Repeater/Repeater.js +2 -2
  47. package/Repeater/tests/Repeater-specs.js +2 -2
  48. package/Resizable/Resizable.js +1 -1
  49. package/Resizable/tests/Resizable-specs.js +1 -1
  50. package/Resizable/tests/useResize-specs.js +1 -1
  51. package/Resizable/useResize.js +1 -1
  52. package/Routable/Link.js +2 -2
  53. package/Routable/Routable.js +2 -2
  54. package/Routable/Router.js +2 -2
  55. package/Routable/tests/Routable-specs.js +1 -1
  56. package/Scroller/Scroller.d.ts +0 -120
  57. package/Scroller/Scroller.js +1 -9
  58. package/Scroller/ScrollerBasic.js +2 -2
  59. package/Skinnable/Skinnable.js +2 -2
  60. package/Skinnable/tests/Skinnable-specs.js +1 -1
  61. package/Skinnable/tests/useSkins-specs.js +1 -1
  62. package/Slider/Knob.js +2 -2
  63. package/Slider/PositionDecorator.js +1 -1
  64. package/Slider/Slider.js +2 -2
  65. package/Slottable/Slottable.js +1 -3
  66. package/Slottable/useSlots.js +2 -2
  67. package/Spinner/Spinner.js +2 -2
  68. package/ToggleIcon/ToggleIcon.js +2 -2
  69. package/Toggleable/Toggle.js +1 -1
  70. package/Toggleable/Toggleable.js +3 -3
  71. package/Toggleable/useToggle.js +1 -1
  72. package/Touchable/ClickAllow.js +1 -1
  73. package/Touchable/Drag.js +1 -1
  74. package/Touchable/Flick.js +1 -1
  75. package/Touchable/Hold.js +1 -1
  76. package/Touchable/Pinch.js +1 -1
  77. package/Touchable/Touch.js +1 -1
  78. package/Touchable/Touchable.js +2 -2
  79. package/Touchable/config.js +1 -1
  80. package/Touchable/tests/Touchable-specs.js +1 -1
  81. package/Touchable/tests/useTouch-specs.js +2 -2
  82. package/Touchable/useTouch.js +1 -1
  83. package/Transition/Transition.js +2 -2
  84. package/Transition/tests/Transition-specs.js +2 -2
  85. package/ViewManager/Arranger.js +1 -1
  86. package/ViewManager/TransitionGroup.js +1 -1
  87. package/ViewManager/View.js +1 -1
  88. package/ViewManager/ViewManager.js +3 -3
  89. package/ViewManager/tests/ViewManager-specs.js +1 -1
  90. package/VirtualList/VirtualList.d.ts +0 -158
  91. package/VirtualList/VirtualList.js +1 -15
  92. package/VirtualList/VirtualListBasic.js +2 -2
  93. package/VirtualList/tests/VirtualGridList-native-specs.js +2 -2
  94. package/VirtualList/tests/VirtualGridList-specs.js +2 -2
  95. package/VirtualList/tests/VirtualList-native-specs.js +2 -2
  96. package/VirtualList/tests/VirtualList-specs.js +2 -2
  97. package/internal/IdProvider/IdProvider.js +1 -1
  98. package/internal/IdProvider/Provider.js +1 -1
  99. package/internal/IdProvider/tests/IdProvider-specs.js +1 -1
  100. package/internal/IdProvider/tests/useId-specs.js +1 -1
  101. package/internal/Pure/Pure.js +1 -1
  102. package/internal/Pure/tests/Pure-specs.js +1 -1
  103. package/package.json +3 -3
  104. package/resolution/ResolutionDecorator.js +1 -1
  105. package/resolution/index.js +1 -1
  106. package/styles/core.less +1 -5
  107. package/styles/mixins.less +5 -18
  108. package/useScroll/ScrollAnimator.js +1 -1
  109. package/useScroll/Scrollbar.js +2 -2
  110. package/useScroll/Scrollbar.module.css +1 -4
  111. package/useScroll/ScrollbarTrack.js +2 -2
  112. package/useScroll/ScrollbarTrack.module.css +0 -1
  113. package/useScroll/useScroll.js +3 -3
  114. package/useScroll/useScroll.module.css +0 -3
  115. package/GridListImageItem/GridListImageItem.d.ts +0 -85
  116. package/GridListImageItem/GridListImageItem.js +0 -250
  117. package/GridListImageItem/GridListImageItem.module.css +0 -28
  118. package/GridListImageItem/package.json +0 -3
  119. package/IconButton/IconButton.d.ts +0 -115
  120. package/IconButton/IconButton.js +0 -253
  121. package/IconButton/IconButton.module.css +0 -12
  122. package/IconButton/package.json +0 -3
  123. package/IconButton/tests/IconButton-specs.js +0 -29
  124. package/RadioDecorator/RadioControllerDecorator.js +0 -101
  125. package/RadioDecorator/RadioDecorator.d.ts +0 -35
  126. package/RadioDecorator/RadioDecorator.js +0 -177
  127. package/RadioDecorator/package.json +0 -3
  128. package/RadioDecorator/tests/RadioDecorator-specs.js +0 -247
  129. package/Scrollable/ScrollAnimator.js +0 -130
  130. package/Scrollable/ScrollThumb.js +0 -57
  131. package/Scrollable/ScrollThumb.module.css +0 -35
  132. package/Scrollable/Scrollable.js +0 -1430
  133. package/Scrollable/Scrollable.module.css +0 -39
  134. package/Scrollable/ScrollableNative.js +0 -1429
  135. package/Scrollable/Scrollbar.js +0 -281
  136. package/Scrollable/Scrollbar.module.css +0 -27
  137. package/Scrollable/package.json +0 -3
  138. package/Scroller/UiScroller.module.css +0 -10
  139. package/Scroller/UiScrollerBase.js +0 -372
  140. package/SlotItem/SlotItem.d.ts +0 -118
  141. package/SlotItem/SlotItem.js +0 -248
  142. package/SlotItem/SlotItem.module.css +0 -12
  143. package/SlotItem/package.json +0 -3
  144. package/SlotItem/tests/SlotItem-specs.js +0 -24
  145. package/ToggleItem/ToggleItem.d.ts +0 -132
  146. package/ToggleItem/ToggleItem.js +0 -301
  147. package/ToggleItem/ToggleItem.module.css +0 -9
  148. package/ToggleItem/package.json +0 -3
  149. package/ToggleItem/tests/ToggleItem-specs.js +0 -120
  150. package/VirtualList/UiVirtualList.module.css +0 -26
  151. package/VirtualList/UiVirtualListBase.js +0 -1410
  152. package/VirtualList/VirtualListBase.js +0 -33
@@ -25,10 +25,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
25
25
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
26
26
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
27
27
  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; }
28
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
28
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
29
29
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
30
30
  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; }
31
- 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; }
31
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
32
32
  var scrollbarTrackHidingDelay = 900; // 900ms + 100ms(fade out duration) = 1000ms.
33
33
 
34
34
  var addClass = function addClass(element, className) {
@@ -6,10 +6,7 @@
6
6
  opacity: 1;
7
7
  flex: none;
8
8
  transform: translateZ(0);
9
- -webkit-transform: translateZ(0);
10
9
  transition: opacity 0.1s linear;
11
- -moz-transition: opacity 0.1s linear;
12
- -webkit-transition: opacity 0.1s linear;
13
10
  /* ScrollbarTrack */
14
11
  }
15
12
  .scrollbar.vertical {
@@ -20,7 +17,7 @@
20
17
  transform: scaleX(-1);
21
18
  }
22
19
  .scrollbar.corner {
23
- -webkit-padding-end: 0.125rem;
20
+ padding-inline-end: 0.125rem;
24
21
  }
25
22
  .scrollbar .scrollbarTrackShown {
26
23
  opacity: 1;
@@ -22,10 +22,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
22
22
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
23
23
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
24
24
  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; }
25
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
25
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
26
26
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
27
27
  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; }
28
- 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; }
28
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
29
29
  var ScrollbarTrack = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
30
30
  var _props$vertical = props.vertical,
31
31
  vertical = _props$vertical === void 0 ? true : _props$vertical,
@@ -10,7 +10,6 @@
10
10
  margin: auto;
11
11
  opacity: 0;
12
12
  flex: auto;
13
- -webkit-transition: opacity 100ms linear;
14
13
  transition: opacity 100ms linear;
15
14
  will-change: transform, top, left, right;
16
15
  }
@@ -46,10 +46,10 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
46
46
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
47
47
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
48
48
  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; }
49
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
49
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
50
50
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
51
51
  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; }
52
- 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; }
52
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
53
53
  var constants = exports.constants = {
54
54
  animationDuration: 1000,
55
55
  epsilon: 1,
@@ -1450,7 +1450,7 @@ var useScrollBase = exports.useScrollBase = function useScrollBase(props) {
1450
1450
  className: [_useScrollModule["default"].scrollInnerContainer]
1451
1451
  });
1452
1452
  assignProperties('scrollContentWrapperProps', _objectSpread({
1453
- className: scrollMode === 'translate' ? [_useScrollModule["default"].scrollContentWrapper] : [_useScrollModule["default"].scrollContentWrapper, _useScrollModule["default"].scrollContentWrapperNative]
1453
+ className: [_useScrollModule["default"].scrollContentWrapper]
1454
1454
  }, !noScrollByDrag && {
1455
1455
  flickConfig: flickConfig,
1456
1456
  onDrag: onDrag,
@@ -33,6 +33,3 @@
33
33
  overflow: hidden;
34
34
  flex: 1 1 100%;
35
35
  }
36
- .scroll .scrollContentWrapperNative {
37
- -webkit-overflow-scrolling: touch;
38
- }
@@ -1,85 +0,0 @@
1
- // Type definitions for ui/GridListImageItem
2
-
3
- import * as React from "react";
4
-
5
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
6
- type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
7
-
8
- export interface GridListImageItemProps {
9
- /**
10
- * The primary caption to be displayed with the image.
11
- */
12
- caption?: string;
13
- /**
14
- * The component used to render the captions
15
- */
16
- captionComponent?: string | React.ComponentType;
17
- /**
18
- * Customizes the component by mapping the supplied collection of CSS class names to the
19
- corresponding internal elements and states of this component.
20
- *
21
- * The following classes are supported:
22
- * * `icon` - The icon component class for default selection overlay
23
- * * `image` - The image component class
24
- * * `selected` - Applied when `selected` prop is `true`
25
- * * `caption` - The caption component class
26
- * * `subCaption` - The subCaption component class
27
- */
28
- css?: object;
29
- /**
30
- * The component used to render the default check icon when selected.
31
- If there is custom selectionOverlay component, this icon will not be shown.
32
- */
33
- iconComponent?: React.ComponentType;
34
- /**
35
- * The component used to render the image component
36
- */
37
- imageComponent?: React.ComponentType;
38
- /**
39
- * Placeholder image used while
40
- is loaded.
41
- */
42
- placeholder?: string;
43
- /**
44
- * Applies a selected visual effect to the image, but only if `selectionOverlayShowing`
45
- is also `true` .
46
- */
47
- selected?: boolean;
48
- /**
49
- * The custom selection overlay component to render.
50
- *
51
- * A component can be a stateless functional component, `kind()` or React component.
52
- The following is an example with custom selection overlay kind.
53
- *
54
- * Example:
55
- * ```
56
- const SelectionOverlay = kind({
57
- render: () => <div>custom overlay</div>
58
- });
59
-
60
- <GridListImageItem selectionOverlay={SelectionOverlay} />
61
- ```
62
- */
63
- selectionOverlay?: Function;
64
- /**
65
- * Shows a selection overlay with a centered icon. When `selected` is true, a check mark is shown.
66
- */
67
- selectionOverlayShowing?: boolean;
68
- /**
69
- * The absolute URL path to the image.
70
- */
71
- source?: string;
72
- /**
73
- * The second caption line to be displayed with the image.
74
- */
75
- subCaption?: string;
76
- }
77
- /**
78
- * A basic grid list image item without any behavior.
79
- */
80
-
81
- export class GridListImageItem extends React.Component<
82
- Merge<React.HTMLProps<HTMLElement>, GridListImageItemProps>
83
- > {}
84
-
85
- export default GridListImageItem;
@@ -1,250 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = exports.GridListImageItem = void 0;
7
- var _deprecate = _interopRequireDefault(require("@enact/core/internal/deprecate"));
8
- var _propTypes = _interopRequireDefault(require("@enact/core/internal/prop-types"));
9
- var _kind = _interopRequireDefault(require("@enact/core/kind"));
10
- var _propTypes2 = _interopRequireDefault(require("prop-types"));
11
- var _react = require("react");
12
- var _Layout = require("../Layout");
13
- var _Icon = _interopRequireDefault(require("../Icon"));
14
- var _Image = _interopRequireDefault(require("../Image"));
15
- var _GridListImageItemModule = _interopRequireDefault(require("./GridListImageItem.module.css"));
16
- var _jsxRuntime = require("react/jsx-runtime");
17
- var _excluded = ["css", "imageComponent", "placeholder", "source", "selectionOverlay", "subComponents"];
18
- /**
19
- * Unstyled grid list image item components and behaviors to be customized by a theme or application.
20
- *
21
- * @module ui/GridListImageItem
22
- * @exports GridListImageItem
23
- * @deprecated Will be removed in 5.0.0. Use {@link ui/ImageItem} instead.
24
- */
25
- /**
26
- * A basic grid list image item without any behavior.
27
- *
28
- * @class GridListImageItem
29
- * @memberof ui/GridListImageItem
30
- * @ui
31
- * @public
32
- */
33
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
34
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
35
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
36
- 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; }
37
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
38
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
39
- 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; }
40
- 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; }
41
- var GridListImageItem = exports.GridListImageItem = (0, _kind["default"])({
42
- name: 'ui:GridListImageItem',
43
- propTypes: /** @lends ui/GridListImageItem.GridListImageItem.prototype */{
44
- /**
45
- * The primary caption to be displayed with the image.
46
- *
47
- * @type {String}
48
- * @public
49
- */
50
- caption: _propTypes2["default"].string,
51
- /**
52
- * The component used to render the captions
53
- *
54
- * @type {String|Component}
55
- * @public
56
- */
57
- captionComponent: _propTypes["default"].renderable,
58
- /**
59
- * Customizes the component by mapping the supplied collection of CSS class names to the
60
- * corresponding internal elements and states of this component.
61
- *
62
- * The following classes are supported:
63
- *
64
- * * `icon` - The icon component class for default selection overlay
65
- * * `image` - The image component class
66
- * * `selected` - Applied when `selected` prop is `true`
67
- * * `caption` - The caption component class
68
- * * `subCaption` - The subCaption component class
69
- *
70
- * @type {Object}
71
- * @public
72
- */
73
- css: _propTypes2["default"].object,
74
- /**
75
- * The component used to render the default check icon when selected.
76
- * If there is custom selectionOverlay component, this icon will not be shown.
77
- *
78
- * @type {Component}
79
- * @default ui/Icon.Icon
80
- * @public
81
- */
82
- iconComponent: _propTypes["default"].component,
83
- /**
84
- * The component used to render the image component
85
- *
86
- * @type {Component}
87
- * @default ui/Image.Image
88
- * @public
89
- */
90
- imageComponent: _propTypes["default"].component,
91
- /**
92
- * Placeholder image used while {@link ui/GridListImageItem.GridListImageItem.source|source}
93
- * is loaded.
94
- *
95
- * @type {String}
96
- * @public
97
- */
98
- placeholder: _propTypes2["default"].string,
99
- /**
100
- * Applies a selected visual effect to the image, but only if `selectionOverlayShowing`
101
- * is also `true`.
102
- *
103
- * @type {Boolean}
104
- * @default false
105
- * @public
106
- */
107
- selected: _propTypes2["default"].bool,
108
- /**
109
- * The custom selection overlay component to render.
110
- *
111
- * A component can be a stateless functional component, `kind()` or React component.
112
- * The following is an example with custom selection overlay kind.
113
- *
114
- * Example:
115
- * ```
116
- * const SelectionOverlay = kind({
117
- * render: () => <div>custom overlay</div>
118
- * });
119
- *
120
- * <GridListImageItem selectionOverlay={SelectionOverlay} />
121
- * ```
122
- *
123
- * @type {Function}
124
- * @public
125
- */
126
- selectionOverlay: _propTypes2["default"].func,
127
- /**
128
- * Shows a selection overlay with a centered icon. When `selected` is true, a check mark is shown.
129
- *
130
- * @type {Boolean}
131
- * @default false
132
- * @public
133
- */
134
- selectionOverlayShowing: _propTypes2["default"].bool,
135
- /**
136
- * The absolute URL path to the image.
137
- *
138
- * @type {String}
139
- * @public
140
- */
141
- source: _propTypes2["default"].string,
142
- /**
143
- * The second caption line to be displayed with the image.
144
- *
145
- * @type {String}
146
- * @public
147
- */
148
- subCaption: _propTypes2["default"].string,
149
- /**
150
- * The components that will be shown below the image.
151
- *
152
- * @type {Array|Element}
153
- * @private
154
- */
155
- subComponents: _propTypes2["default"].oneOfType([_propTypes2["default"].array, _propTypes2["default"].element])
156
- },
157
- defaultProps: {
158
- captionComponent: 'div',
159
- iconComponent: _Icon["default"],
160
- imageComponent: _Image["default"],
161
- selected: false,
162
- selectionOverlayShowing: false
163
- },
164
- styles: {
165
- css: _GridListImageItemModule["default"],
166
- className: 'gridListImageItem',
167
- publicClassNames: true
168
- },
169
- computed: {
170
- className: function className(_ref) {
171
- var caption = _ref.caption,
172
- selected = _ref.selected,
173
- styler = _ref.styler,
174
- subCaption = _ref.subCaption;
175
- return styler.append({
176
- selected: selected,
177
- caption: caption,
178
- subCaption: subCaption
179
- });
180
- },
181
- selectionOverlay: function selectionOverlay(_ref2) {
182
- var css = _ref2.css,
183
- IconComponent = _ref2.iconComponent,
184
- SelectionOverlay = _ref2.selectionOverlay,
185
- selectionOverlayShowing = _ref2.selectionOverlayShowing;
186
- if (selectionOverlayShowing) {
187
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
188
- className: css.overlayContainer,
189
- children: SelectionOverlay ? /*#__PURE__*/(0, _jsxRuntime.jsx)(SelectionOverlay, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
190
- className: css.overlayComponent,
191
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(IconComponent, {
192
- className: css.icon,
193
- children: "check"
194
- })
195
- })
196
- });
197
- }
198
- },
199
- subComponents: function subComponents(_ref3) {
200
- var caption = _ref3.caption,
201
- Caption = _ref3.captionComponent,
202
- css = _ref3.css,
203
- subCaption = _ref3.subCaption,
204
- _subComponents = _ref3.subComponents;
205
- return _subComponents ? _subComponents : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
206
- children: [caption ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
207
- className: css.caption,
208
- component: Caption,
209
- shrink: true,
210
- children: caption
211
- }) : null, subCaption ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
212
- className: css.subCaption,
213
- component: Caption,
214
- shrink: true,
215
- children: subCaption
216
- }) : null]
217
- });
218
- }
219
- },
220
- render: (0, _deprecate["default"])(function (_ref4) {
221
- var css = _ref4.css,
222
- ImageComponent = _ref4.imageComponent,
223
- placeholder = _ref4.placeholder,
224
- source = _ref4.source,
225
- selectionOverlay = _ref4.selectionOverlay,
226
- subComponents = _ref4.subComponents,
227
- rest = _objectWithoutProperties(_ref4, _excluded);
228
- delete rest.caption;
229
- delete rest.captionComponent;
230
- delete rest.iconComponent;
231
- delete rest.selected;
232
- delete rest.selectionOverlayShowing;
233
- delete rest.subCaption;
234
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Layout.Column, _objectSpread(_objectSpread({}, rest), {}, {
235
- inline: true,
236
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
237
- className: css.image,
238
- component: ImageComponent,
239
- placeholder: placeholder,
240
- src: source,
241
- children: selectionOverlay
242
- }), subComponents]
243
- }));
244
- }, {
245
- name: 'ui/GridListImageItem',
246
- replacedBy: 'ui/ImageItem',
247
- until: '5.0.0'
248
- })
249
- });
250
- var _default = exports["default"] = GridListImageItem;
@@ -1,28 +0,0 @@
1
- .gridListImageItem {
2
- box-sizing: border-box;
3
- }
4
- .gridListImageItem .icon {
5
- position: relative;
6
- }
7
- .gridListImageItem .image {
8
- display: block;
9
- width: 100%;
10
- height: 100%;
11
- margin: 0;
12
- }
13
- .gridListImageItem .overlayComponent {
14
- display: flex;
15
- align-items: center;
16
- justify-content: center;
17
- height: 100%;
18
- }
19
- .gridListImageItem .overlayContainer {
20
- background-color: transparent;
21
- pointer-events: none;
22
- height: 100%;
23
- }
24
- .gridListImageItem .caption,
25
- .gridListImageItem .selected,
26
- .gridListImageItem .subCaption {
27
- /* Public Class Names */
28
- }
@@ -1,3 +0,0 @@
1
- {
2
- "main": "GridListImageItem.js"
3
- }
@@ -1,115 +0,0 @@
1
- // Type definitions for ui/IconButton
2
-
3
- import { ForwardRefProps as ui_ForwardRef_ForwardRefProps } from "@enact/ui/ForwardRef";
4
- import { TouchableProps as ui_Touchable_TouchableProps } from "@enact/ui/Touchable";
5
- import * as React from "react";
6
-
7
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
8
- type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
9
-
10
- export interface IconButtonBaseProps {
11
- /**
12
- * This is the root component used to render the button and will receive all props except
13
- `icon` .
14
- */
15
- buttonComponent: React.ComponentType | JSX.Element;
16
- /**
17
- * The component used to render the .
18
- *
19
- * This component will receive the `flip` and `size` property set on the `IconButton` as well as the
20
- `icon` class to customize its styling.
21
- */
22
- iconComponent: React.ComponentType;
23
- /**
24
- * Additional children that follow the icon.
25
- *
26
- * If `icon` isn't specified but `children` is, `children` is used as the icon's value.
27
- */
28
- children?: React.ReactNode;
29
- /**
30
- * Called with a reference to the root component.
31
- *
32
- * When using , the `ref` prop is forwarded to this
33
- component as `componentRef` .
34
- */
35
- componentRef?: object | Function;
36
- /**
37
- * Customizes the component by mapping the supplied collection of CSS class names to the
38
- corresponding internal elements and states of this component.
39
- *
40
- * The following classes are supported:
41
- * * `iconButton` - The root component class
42
- * * `icon` - The class
43
- * * `large` - Applied when `size` prop is `'large'`
44
- * * `small` - Applied when `size` prop is `'small'`
45
- * * `pressed` - Applied when `pressed` prop is `true`
46
- */
47
- css?: object;
48
- /**
49
- * Disables IconButton.
50
- *
51
- * When `true` , the button is shown as disabled and does not generate
52
- `onClick` .
53
- */
54
- disabled?: boolean;
55
- /**
56
- * Flip the icon horizontally, vertically or both.
57
- */
58
- flip?: "both" | "horizontal" | "vertical";
59
- /**
60
- * The icon displayed within the IconButton.
61
- *
62
- * If not specified, `children` is used as the icon value instead.
63
- */
64
- icon?: string;
65
- /**
66
- * Applies the `pressed` CSS class.
67
- */
68
- pressed?: boolean;
69
- /**
70
- * Applies the `selected` CSS class.
71
- */
72
- selected?: boolean;
73
- /**
74
- * The size of the button.
75
- *
76
- * Applies the CSS class which can be customized by
77
- .
78
- */
79
- size?: string;
80
- }
81
- /**
82
- * A ui-styled button without any behavior.
83
- */
84
-
85
- export class IconButtonBase extends React.Component<
86
- Merge<React.HTMLProps<HTMLElement>, IconButtonBaseProps>
87
- > {}
88
-
89
- export interface IconButtonDecoratorProps
90
- extends Merge<ui_ForwardRef_ForwardRefProps, ui_Touchable_TouchableProps> {}
91
- export function IconButtonDecorator<P>(
92
- Component: React.ComponentType<P> | string,
93
- ): React.ComponentType<P & IconButtonDecoratorProps>;
94
-
95
- export interface IconButtonProps
96
- extends Omit<
97
- Merge<IconButtonBaseProps, IconButtonDecoratorProps>,
98
- "componentRef"
99
- > {}
100
- /**
101
- * A minimally styled, but interactive, Button ready for customization by a theme.
102
- *
103
- * Example:
104
- * ```
105
- <IconButton size="small">
106
- plus
107
- </IconButton>
108
- ```
109
- */
110
-
111
- export class IconButton extends React.Component<
112
- Merge<React.HTMLProps<HTMLElement>, IconButtonProps>
113
- > {}
114
-
115
- export default IconButton;