@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
@@ -1,248 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = exports.SlotItemDecorator = exports.SlotItemBase = exports.SlotItem = 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 _compose = _interopRequireDefault(require("ramda/src/compose"));
12
- var _Slottable = _interopRequireDefault(require("../Slottable"));
13
- var _SlotItemModule = _interopRequireDefault(require("./SlotItem.module.css"));
14
- var _ForwardRef = _interopRequireDefault(require("../ForwardRef"));
15
- var _jsxRuntime = require("react/jsx-runtime");
16
- var _excluded = ["children", "component", "componentRef", "inline", "slotAfter", "slotBefore"];
17
- /**
18
- * An unstyled item component that accepts multiple positions of children.
19
- *
20
- * Using the usual `children` prop, as well as two additional props: `slotBefore`, and `slotAfter`.
21
- * It is able to be customized by a theme or application.
22
- *
23
- * @module ui/SlotItem
24
- * @exports SlotItem
25
- * @exports SlotItemBase
26
- * @exports SlotItemDecorator
27
- * @deprecated Will be removed in 5.0.0.
28
- */
29
- /**
30
- * A ui-styled `SlotItem` without any behavior.
31
- *
32
- * @class SlotItemBase
33
- * @memberof ui/SlotItem
34
- * @ui
35
- * @public
36
- */
37
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
38
- 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; }
39
- 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; }
40
- 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; }
41
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
42
- 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); }
43
- 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; }
44
- 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; }
45
- var SlotItemBase = exports.SlotItemBase = (0, _kind["default"])({
46
- name: 'SlotItem',
47
- propTypes: /** @lends ui/SlotItem.SlotItemBase.prototype */{
48
- /**
49
- * The type of component to use to render the item.
50
- *
51
- * This component will receive the `inline` prop and any additional unhandled props provided
52
- * to `SlotItem`. A derivative of {@link ui/Item.Item|Item} is recommended.
53
- *
54
- * @type {Component}
55
- * @required
56
- * @public
57
- */
58
- component: _propTypes["default"].component.isRequired,
59
- /**
60
- * Controls the visibility state of the slots.
61
- *
62
- * One, both, or neither slot can be shown. Choosing `'after'` will leave `slotBefore`
63
- * visible at all times; only `slotAfter` will have its visibility toggled. Valid values
64
- * are `'before'`, `'after'` and `'both'`. Omitting the property will result in
65
- * no-auto-hiding for either slot so they will both be present.
66
- *
67
- * In order for `autoHide` to have a visual affect, the `hidden` class must be tied to
68
- * another condition such as focus.
69
- *
70
- * ```
71
- * .slot.hidden:not(:focus) {
72
- * display: none;
73
- * }
74
- * ```
75
- *
76
- * @type {Boolean}
77
- * @public
78
- */
79
- autoHide: _propTypes2["default"].oneOf(['after', 'before', 'both']),
80
- /**
81
- * Called with a reference to the root component.
82
- *
83
- * When using {@link ui/SlotItem.SlotItem}, the `ref` prop is forwarded to this component
84
- * as `componentRef`.
85
- *
86
- * @type {Object|Function}
87
- * @public
88
- */
89
- componentRef: _propTypes["default"].ref,
90
- /**
91
- * Customizes the component by mapping the supplied collection of CSS class names to the
92
- * corresponding internal elements and states of this component.
93
- *
94
- * The following classes are supported:
95
- *
96
- * * `slotItem` - The root class name
97
- * * `slot` - Applied to both slots
98
- * * `after` - Applied to the slot that falls after the content
99
- * * `before` - Applied to the slot that falls before the content
100
- * * `hidden` - Applied to a slot when that slot is supposed to be hidden, according to
101
- * `autoHide` prop
102
- *
103
- * @type {Object}
104
- * @public
105
- */
106
- css: _propTypes2["default"].object,
107
- /**
108
- * Applies inline styling to the component.
109
- *
110
- * @type {Boolean}
111
- * @default false
112
- * @public
113
- */
114
- inline: _propTypes2["default"].bool,
115
- /**
116
- * The layout technique for `SlotItem`.
117
- *
118
- * `"flex"` is applied as a default and gives basic flex support to the wrapping elements.
119
- * This may be set to `null` to define your own layout method.
120
- *
121
- * @type {String}
122
- * @default 'flex'
123
- * @public
124
- */
125
- layout: _propTypes2["default"].oneOf(['flex']),
126
- /**
127
- * Nodes to be inserted after `children` and hidden using `autoHide`.
128
- *
129
- * If nothing is specified, nothing, not even an empty container, is rendered in this place.
130
- *
131
- * @type {Node}
132
- * @public
133
- */
134
- slotAfter: _propTypes2["default"].node,
135
- /**
136
- * Nodes to be inserted before `children` and hidden using `autoHide`.
137
- *
138
- * If nothing is specified, nothing, not even an empty container, is rendered in this place.
139
- *
140
- * @type {Node}
141
- * @public
142
- */
143
- slotBefore: _propTypes2["default"].node
144
- },
145
- defaultProps: {
146
- inline: false,
147
- layout: 'flex'
148
- },
149
- styles: {
150
- css: _SlotItemModule["default"],
151
- className: 'slotItem',
152
- publicClassNames: true
153
- },
154
- computed: {
155
- className: function className(_ref) {
156
- var inline = _ref.inline,
157
- layout = _ref.layout,
158
- styler = _ref.styler;
159
- return styler.append(layout, {
160
- inline: inline
161
- });
162
- },
163
- slotBefore: function slotBefore(_ref2) {
164
- var _slotBefore = _ref2.slotBefore,
165
- autoHide = _ref2.autoHide,
166
- styler = _ref2.styler;
167
- return _slotBefore ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
168
- className: styler.join('slot', 'before', {
169
- hidden: autoHide === 'before' || autoHide === 'both'
170
- }),
171
- children: _slotBefore
172
- }) : null;
173
- },
174
- slotAfter: function slotAfter(_ref3) {
175
- var _slotAfter = _ref3.slotAfter,
176
- autoHide = _ref3.autoHide,
177
- styler = _ref3.styler;
178
- return _slotAfter ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
179
- className: styler.join('slot', 'after', {
180
- hidden: autoHide === 'after' || autoHide === 'both'
181
- }),
182
- children: _slotAfter
183
- }) : null;
184
- }
185
- },
186
- render: (0, _deprecate["default"])(function (_ref4) {
187
- var children = _ref4.children,
188
- Component = _ref4.component,
189
- componentRef = _ref4.componentRef,
190
- inline = _ref4.inline,
191
- slotAfter = _ref4.slotAfter,
192
- slotBefore = _ref4.slotBefore,
193
- rest = _objectWithoutProperties(_ref4, _excluded);
194
- delete rest.autoHide;
195
- delete rest.layout;
196
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, _objectSpread(_objectSpread({
197
- ref: componentRef
198
- }, rest), {}, {
199
- inline: inline,
200
- children: [slotBefore, children, slotAfter]
201
- }));
202
- }, {
203
- name: 'ui/SlotItem',
204
- until: '5.0.0'
205
- })
206
- });
207
-
208
- /**
209
- * A ui-specific higher-order component (HOC) with slot behaviors to apply to {@link ui/SlotItem.SlotItemBase|SlotItem}.
210
- *
211
- * @class SlotItemDecorator
212
- * @memberof ui/SlotItem
213
- * @mixes ui/Slottable.Slottable
214
- * @mixes ui/ForwardRef.ForwardRef
215
- * @hoc
216
- * @public
217
- */
218
- var SlotItemDecorator = exports.SlotItemDecorator = (0, _compose["default"])((0, _ForwardRef["default"])({
219
- prop: 'componentRef'
220
- }), (0, _Slottable["default"])({
221
- slots: ['slotAfter', 'slotBefore']
222
- }));
223
-
224
- /**
225
- * A ui-styled item with built-in support for slots.
226
- *
227
- * Example:
228
- * ```
229
- * <SlotItem component={Item} autoHide="both">
230
- * <slotBefore>
231
- * <Icon>flag</Icon>
232
- * <Icon>star</Icon>
233
- * </slotBefore>
234
- * An Item that will show some icons slotBefore and slotAfter this text when spotted
235
- * <Icon slot="slotAfter">trash</Icon>
236
- * </SlotItem>
237
- * ```
238
- *
239
- * @class SlotItem
240
- * @memberof ui/SlotItem
241
- * @extends ui/SlotItem.SlotItemBase
242
- * @mixes ui/SlotItem.SlotItemDecorator
243
- * @omit componentRef
244
- * @ui
245
- * @public
246
- */
247
- var SlotItem = exports.SlotItem = SlotItemDecorator(SlotItemBase);
248
- var _default = exports["default"] = SlotItem;
@@ -1,12 +0,0 @@
1
- .slotItem.flex {
2
- display: flex;
3
- }
4
- .slotItem.flex.inline {
5
- display: inline-flex;
6
- }
7
- .slotItem .slot,
8
- .slotItem .after,
9
- .slotItem .before,
10
- .slotItem .hidden {
11
- /* Public Class Names */
12
- }
@@ -1,3 +0,0 @@
1
- {
2
- "main": "SlotItem.js"
3
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- var _react = require("@testing-library/react");
4
- var _react2 = require("react");
5
- var _SlotItem = _interopRequireDefault(require("../SlotItem"));
6
- var _jsxRuntime = require("react/jsx-runtime");
7
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
8
- describe('SlotItem', function () {
9
- test('should return a DOM node reference for `componentRef`', function () {
10
- var component = /*#__PURE__*/(0, _react2.forwardRef)(function (props, fn) {
11
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
12
- ref: fn
13
- });
14
- });
15
- var ref = jest.fn();
16
- (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_SlotItem["default"], {
17
- ref: ref,
18
- component: component
19
- }));
20
- var expected = 'DIV';
21
- var actual = ref.mock.calls[0][0].nodeName;
22
- expect(actual).toBe(expected);
23
- });
24
- });
@@ -1,132 +0,0 @@
1
- // Type definitions for ui/ToggleItem
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 { ToggleableProps as ui_Toggleable_ToggleableProps } from "@enact/ui/Toggleable";
6
- import * as React from "react";
7
-
8
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
9
- type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
10
-
11
- export interface ToggleItemBaseProps {
12
- /**
13
- * The main content of the toggle item.
14
- */
15
- children: React.ReactNode;
16
- /**
17
- * The type of component to use to render as root element.
18
- *
19
- * This receives the `css` prop for theme extension and therefore must be a custom
20
- component and not a simple HTML DOM node. Recommended component or themed
21
- derivative:
22
- */
23
- component: React.ComponentType;
24
- /**
25
- * The `Icon` to render in this item.
26
- *
27
- * This component receives the `selected` prop and value,
28
- and must therefore respond to it in some way. It is recommended to use
29
- for this.
30
- */
31
- iconComponent: React.ComponentType | JSX.Element;
32
- /**
33
- * Called with a reference to the root component.
34
- *
35
- * When using , the `ref` prop is forwarded to this
36
- component as `componentRef` .
37
- */
38
- componentRef?: object | Function;
39
- /**
40
- * Customizes the component by mapping the supplied collection of CSS class names to the
41
- corresponding internal elements and states of this component.
42
- *
43
- * The following classes are supported:
44
- * * `toggleItem` - The root class name
45
- */
46
- css?: object;
47
- /**
48
- * Applies a disabled visual state to the toggle item.
49
- */
50
- disabled?: boolean;
51
- /**
52
- * An optional prop that lets you override the icon of the `iconComponent` component.
53
- *
54
- * This accepts any string that the component supports, provided
55
- the recommendations of `iconComponent` are followed.
56
- */
57
- icon?: string | object;
58
- /**
59
- * Specifies on which side ( `'before'` or `'after'` ) of `children` the icon appears.
60
- */
61
- iconPosition?: "before" | "after";
62
- /**
63
- * An additional customizable icon component.
64
- *
65
- * Supports more granular positioning rules. This should only be used _after_ specifying the
66
- `icon` property, as the positioning for this offers the ability to place this in front of
67
- or behind the existing `icon` . See `itemIconPosition` for options.
68
- */
69
- itemIcon?: React.ReactNode;
70
- /**
71
- * Specifies where `itemIcon` appears.
72
- * * `'before'` - first element in the item
73
- * * `'beforeChildren'` - before `children` . If `iconPosition` is `'before'` , `icon` will be
74
- before `itemIcon`
75
- * * `'afterChildren'` - after `children` . If iconPosition `is` 'after' `, ` icon `will be
76
- after` itemIcon`
77
- * * `'after'` - the last element in the item
78
- */
79
- itemIconPosition?: "before" | "beforeChildren" | "afterChildren" | "after";
80
- /**
81
- * Called when the toggle item is toggled. Developers should generally use `onToggle` instead.
82
- */
83
- onTap?: Function;
84
- /**
85
- * Called when the toggle item is toggled.
86
- */
87
- onToggle?: Function;
88
- /**
89
- * Applies the provided `icon` .
90
- */
91
- selected?: boolean;
92
- /**
93
- * The value that will be sent to the `onToggle` handler.
94
- */
95
- value?: any;
96
- }
97
- /**
98
- * A minimally styled toggle item without any behavior, ripe for extension.
99
- */
100
-
101
- export class ToggleItemBase extends React.Component<
102
- Merge<React.HTMLProps<HTMLElement>, ToggleItemBaseProps>
103
- > {}
104
-
105
- export interface ToggleItemDecoratorProps
106
- extends Merge<
107
- Merge<ui_ForwardRef_ForwardRefProps, ui_Touchable_TouchableProps>,
108
- ui_Toggleable_ToggleableProps
109
- > {}
110
- export function ToggleItemDecorator<P>(
111
- Component: React.ComponentType<P> | string,
112
- ): React.ComponentType<P & ToggleItemDecoratorProps>;
113
-
114
- export interface ToggleItemProps
115
- extends Omit<
116
- Merge<ToggleItemBaseProps, ToggleItemDecoratorProps>,
117
- "componentRef"
118
- > {}
119
- /**
120
- * An unstyled item with built-in support for toggling.
121
- *
122
- * Example:
123
- * ```
124
- <ToggleItem icon="lock" iconPosition="before">Toggle Me</ToggleItem>
125
- ```
126
- */
127
-
128
- export class ToggleItem extends React.Component<
129
- Merge<React.HTMLProps<HTMLElement>, ToggleItemProps>
130
- > {}
131
-
132
- export default ToggleItem;