@enact/ui 4.6.2 → 4.7.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.
- package/AnnounceDecorator/Announce.js +25 -16
- package/AnnounceDecorator/AnnounceDecorator.js +14 -7
- package/AnnounceDecorator/useAnnounce.js +1 -2
- package/BodyText/BodyText.js +14 -8
- package/Button/Button.js +16 -10
- package/Button/tests/Button-specs.js +10 -6
- package/CHANGELOG.md +18 -0
- package/Cancelable/Cancelable.js +13 -7
- package/Changeable/Changeable.js +11 -7
- package/ComponentOverride/ComponentOverride.js +18 -7
- package/FloatingLayer/FloatingLayer.js +10 -11
- package/FloatingLayer/FloatingLayerDecorator.js +9 -6
- package/ForwardRef/ForwardRef.js +11 -7
- package/GridListImageItem/GridListImageItem.js +16 -9
- package/Group/Group.js +17 -8
- package/Group/GroupItem.js +14 -10
- package/Group/tests/Group-specs.js +14 -9
- package/Heading/Heading.js +20 -9
- package/Icon/Icon.js +15 -8
- package/IconButton/IconButton.js +22 -9
- package/Image/Image.js +16 -8
- package/ImageItem/ImageItem.js +9 -1
- package/Item/Item.js +17 -9
- package/Item/tests/Item-specs.js +10 -6
- package/LabeledIcon/LabeledIcon.js +16 -8
- package/Layout/Cell.js +27 -4
- package/Layout/Layout.d.ts +22 -5
- package/Layout/Layout.js +154 -32
- package/Layout/Layout.module.css +8 -0
- package/Layout/tests/Layout-specs.js +39 -0
- package/Marquee/MarqueeController.js +43 -0
- package/Marquee/MarqueeDecorator.js +40 -9
- package/Measurable/Measurable.js +11 -7
- package/Media/Media.js +30 -23
- package/Placeholder/PlaceholderControllerDecorator.js +8 -8
- package/Placeholder/PlaceholderDecorator.js +7 -8
- package/ProgressBar/ProgressBar.js +12 -1
- package/RadioDecorator/RadioDecorator.js +18 -13
- package/RadioDecorator/tests/RadioDecorator-specs.js +28 -20
- package/Repeater/Repeater.js +14 -10
- package/Resizable/Resizable.js +28 -98
- package/Resizable/ResizeContext.js +17 -0
- package/Resizable/tests/useResize-specs.js +43 -0
- package/Resizable/useResize.js +66 -0
- package/Routable/Link.js +8 -8
- package/Routable/Routable.js +15 -8
- package/Routable/Router.js +10 -10
- package/Routable/tests/Routable-specs.js +9 -6
- package/Scrollable/ScrollThumb.js +8 -9
- package/Scrollable/Scrollable.js +23 -7
- package/Scrollable/ScrollableNative.js +19 -14
- package/Scroller/Scroller.js +8 -1
- package/Scroller/ScrollerBasic.js +8 -9
- package/Scroller/UiScrollerBase.js +11 -12
- package/Skinnable/Skinnable.js +19 -7
- package/Skinnable/useSkins.js +1 -2
- package/Slider/Knob.js +8 -8
- package/Slider/Slider.js +16 -9
- package/SlotItem/SlotItem.js +20 -8
- package/Slottable/Slottable.js +14 -8
- package/Spinner/Spinner.js +24 -9
- package/ToggleIcon/ToggleIcon.js +21 -9
- package/ToggleIcon/tests/ToggleIcon-specs.js +6 -3
- package/ToggleItem/ToggleItem.js +14 -1
- package/ToggleItem/tests/ToggleItem-specs.js +6 -3
- package/Toggleable/Toggleable.js +11 -7
- package/Toggleable/useToggle.js +0 -1
- package/Touchable/Drag.js +1 -0
- package/Touchable/Flick.js +1 -0
- package/Touchable/Hold.js +1 -0
- package/Touchable/Pinch.js +1 -0
- package/Touchable/Touch.js +3 -3
- package/Touchable/Touchable.js +7 -0
- package/Touchable/useTouch.js +0 -1
- package/Transition/Transition.js +19 -3
- package/ViewManager/Arranger.js +4 -1
- package/ViewManager/TransitionGroup.js +5 -4
- package/ViewManager/View.js +12 -12
- package/ViewManager/ViewManager.js +25 -9
- package/ViewManager/tests/ViewManager-specs.js +44 -0
- package/VirtualList/UiVirtualListBase.js +3 -4
- package/VirtualList/VirtualList.js +11 -1
- package/VirtualList/VirtualListBasic.js +4 -4
- package/internal/IdProvider/IdProvider.js +6 -7
- package/internal/IdProvider/useId.js +0 -1
- package/internal/Pure/Pure.js +11 -7
- package/package.json +3 -3
- package/resolution/ResolutionDecorator.js +36 -7
- package/resolution/resolution.js +23 -7
- package/useScroll/ScrollbarTrack.js +8 -8
- package/useScroll/useScroll.js +17 -1
package/Group/GroupItem.js
CHANGED
|
@@ -15,16 +15,20 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
15
15
|
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; }
|
|
16
16
|
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; }
|
|
17
17
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
18
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /*
|
|
19
|
+
* Exports the {@link ui/Group.GroupItem} and {@link ui/Group.GroupItemBase}
|
|
20
|
+
* components as well as the `pickGroupItemProps` method. The default export is {@link ui/Group.GroupItem}.
|
|
21
|
+
* `GroupItem` is stateless and is the same as `GroupItemBase`.
|
|
22
|
+
* NOTE: not jsdoc on purpose.
|
|
23
|
+
*/ /**
|
|
24
|
+
* Pick the `GroupItem`-specific props into a {@link /developer-guide/glossary/#private|private} `itemProps` key to be extracted by
|
|
25
|
+
* `GroupItem` before passing the remaining on to the repeated `childComponent`
|
|
26
|
+
*
|
|
27
|
+
* @function
|
|
28
|
+
* @param {Object} props `Group` props
|
|
29
|
+
* @returns {Object} `GroupItem` props
|
|
30
|
+
* @private
|
|
31
|
+
*/
|
|
28
32
|
var pickGroupItemProps = function pickGroupItemProps(props) {
|
|
29
33
|
return {
|
|
30
34
|
$$GroupItem: {
|
|
@@ -8,36 +8,41 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
8
8
|
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); }
|
|
9
9
|
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; }
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
12
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
11
13
|
describe('Group', function () {
|
|
12
14
|
var stringItems = ['One', 'Two', 'Three'];
|
|
13
|
-
test('should call handler with selected on select', function () {
|
|
15
|
+
test('should call handler with selected on select', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
14
16
|
var handleClick = jest.fn();
|
|
17
|
+
var user = _userEvent["default"].setup();
|
|
15
18
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Group.GroupBase, {
|
|
16
19
|
childComponent: "div",
|
|
17
20
|
onSelect: handleClick,
|
|
18
21
|
children: stringItems
|
|
19
22
|
}));
|
|
20
23
|
var selected = _react.screen.getByText('Two');
|
|
21
|
-
|
|
24
|
+
yield user.click(selected);
|
|
22
25
|
var expected = 1;
|
|
23
26
|
var actual = handleClick.mock.calls[0][0].selected;
|
|
24
27
|
expect(actual).toBe(expected);
|
|
25
|
-
});
|
|
26
|
-
test('should call handler with data on select', function () {
|
|
28
|
+
}));
|
|
29
|
+
test('should call handler with data on select', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
27
30
|
var handleClick = jest.fn();
|
|
31
|
+
var user = _userEvent["default"].setup();
|
|
28
32
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Group.GroupBase, {
|
|
29
33
|
childComponent: "div",
|
|
30
34
|
onSelect: handleClick,
|
|
31
35
|
children: stringItems
|
|
32
36
|
}));
|
|
33
37
|
var selected = _react.screen.getByText('Two');
|
|
34
|
-
|
|
38
|
+
yield user.click(selected);
|
|
35
39
|
var expected = stringItems[1];
|
|
36
40
|
var actual = handleClick.mock.calls[0][0].data;
|
|
37
41
|
expect(actual).toBe(expected);
|
|
38
|
-
});
|
|
39
|
-
test('should call handler with data on select stored in the key specified by `selectedEventProp`', function () {
|
|
42
|
+
}));
|
|
43
|
+
test('should call handler with data on select stored in the key specified by `selectedEventProp`', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
40
44
|
var handleClick = jest.fn();
|
|
45
|
+
var user = _userEvent["default"].setup();
|
|
41
46
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Group.GroupBase, {
|
|
42
47
|
childComponent: "div",
|
|
43
48
|
onSelect: handleClick,
|
|
@@ -45,11 +50,11 @@ describe('Group', function () {
|
|
|
45
50
|
children: stringItems
|
|
46
51
|
}));
|
|
47
52
|
var selected = _react.screen.getByText('Two');
|
|
48
|
-
|
|
53
|
+
yield user.click(selected);
|
|
49
54
|
var expected = stringItems[1];
|
|
50
55
|
var actual = handleClick.mock.calls[0][0].value;
|
|
51
56
|
expect(actual).toBe(expected);
|
|
52
|
-
});
|
|
57
|
+
}));
|
|
53
58
|
test('should call handler on move when childSelect="onMouseMove"', function () {
|
|
54
59
|
var handleClick = jest.fn();
|
|
55
60
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Group.GroupBase, {
|
package/Heading/Heading.js
CHANGED
|
@@ -19,15 +19,26 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
19
19
|
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; }
|
|
20
20
|
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; }
|
|
21
21
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
22
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /**
|
|
23
|
+
* A component for instantiating a section of content with a title.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* <Heading spacing="none">
|
|
27
|
+
* A Content Section Heading
|
|
28
|
+
* </Heading>
|
|
29
|
+
*
|
|
30
|
+
* @module ui/Heading
|
|
31
|
+
* @exports Heading
|
|
32
|
+
* @exports HeadingBase
|
|
33
|
+
* @exports HeadingDecorator
|
|
34
|
+
*/ /**
|
|
35
|
+
* A labeled Heading component.
|
|
36
|
+
*
|
|
37
|
+
* @class HeadingBase
|
|
38
|
+
* @memberof ui/Heading
|
|
39
|
+
* @ui
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
31
42
|
var HeadingBase = (0, _kind["default"])({
|
|
32
43
|
name: 'ui:Heading',
|
|
33
44
|
propTypes: /** @lends ui/Heading.Heading.prototype */{
|
package/Icon/Icon.js
CHANGED
|
@@ -14,14 +14,13 @@ var _ForwardRef = _interopRequireDefault(require("../ForwardRef"));
|
|
|
14
14
|
var _IconModule = _interopRequireDefault(require("./Icon.module.css"));
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
16
|
var _excluded = ["componentRef", "iconProps"];
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
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; }
|
|
17
|
+
/**
|
|
18
|
+
* An unstyled icon component to be customized by a theme or application.
|
|
19
|
+
*
|
|
20
|
+
* @module ui/Icon
|
|
21
|
+
* @exports Icon
|
|
22
|
+
* @exports IconDecorator
|
|
23
|
+
*/
|
|
25
24
|
/**
|
|
26
25
|
* Merges consumer styles with the image `src` resolved through the resolution independence module.
|
|
27
26
|
*
|
|
@@ -32,6 +31,14 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
32
31
|
* @returns {Object} Original style object with backgroundImage updated
|
|
33
32
|
* @private
|
|
34
33
|
*/
|
|
34
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
35
|
+
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; }
|
|
36
|
+
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; }
|
|
37
|
+
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; }
|
|
38
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
39
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
40
|
+
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; }
|
|
41
|
+
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; }
|
|
35
42
|
var mergeStyle = function mergeStyle(style, src) {
|
|
36
43
|
var updated = Object.assign({}, style);
|
|
37
44
|
var source = _resolution["default"].selectSrc(src);
|
package/IconButton/IconButton.js
CHANGED
|
@@ -16,6 +16,27 @@ var _Touchable = _interopRequireDefault(require("../Touchable"));
|
|
|
16
16
|
var _IconButtonModule = _interopRequireDefault(require("./IconButton.module.css"));
|
|
17
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
18
|
var _excluded = ["buttonComponent", "children", "componentRef", "css", "flip", "icon", "iconComponent", "size"];
|
|
19
|
+
/**
|
|
20
|
+
* An {@link ui/Icon.Icon|Icon} that acts like a {@link ui/Button.Button|Button}.
|
|
21
|
+
*
|
|
22
|
+
* You may specify an image or a font-based icon by setting the `children` to either the path
|
|
23
|
+
* to the image or a string from an {@link ui/Icon.Icon.iconList|iconList}. This is unstyled,
|
|
24
|
+
* but can easily be extended and customized by a theme or application.
|
|
25
|
+
*
|
|
26
|
+
* @module ui/IconButton
|
|
27
|
+
* @exports IconButton
|
|
28
|
+
* @exports IconButtonBase
|
|
29
|
+
* @exports IconButtonDecorator
|
|
30
|
+
* @deprecated Will be removed in 5.0.0. Use {@link ui/Button} instead.
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* A ui-styled button without any behavior.
|
|
34
|
+
*
|
|
35
|
+
* @class IconButtonBase
|
|
36
|
+
* @memberof ui/IconButton
|
|
37
|
+
* @ui
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
19
40
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
20
41
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
21
42
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -30,14 +51,6 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
|
|
|
30
51
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
31
52
|
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; }
|
|
32
53
|
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; }
|
|
33
|
-
/**
|
|
34
|
-
* A ui-styled button without any behavior.
|
|
35
|
-
*
|
|
36
|
-
* @class IconButtonBase
|
|
37
|
-
* @memberof ui/IconButton
|
|
38
|
-
* @ui
|
|
39
|
-
* @public
|
|
40
|
-
*/
|
|
41
54
|
var IconButtonBase = (0, _kind["default"])({
|
|
42
55
|
name: 'ui:IconButton',
|
|
43
56
|
propTypes: /** @lends ui/IconButton.IconButtonBase.prototype */{
|
|
@@ -66,7 +79,7 @@ var IconButtonBase = (0, _kind["default"])({
|
|
|
66
79
|
*
|
|
67
80
|
* If `icon` isn't specified but `children` is, `children` is used as the icon's value.
|
|
68
81
|
*
|
|
69
|
-
* @see {@link ui/Icon.
|
|
82
|
+
* @see {@link ui/Icon.IconBase.children}
|
|
70
83
|
* @type {Node}
|
|
71
84
|
* @public
|
|
72
85
|
*/
|
package/Image/Image.js
CHANGED
|
@@ -14,14 +14,14 @@ var _ForwardRef = _interopRequireDefault(require("../ForwardRef"));
|
|
|
14
14
|
var _ImageModule = _interopRequireDefault(require("./Image.module.css"));
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
16
|
var _excluded = ["alt", "aria-label", "bgImage", "children", "componentRef", "css", "imgSrc", "onError", "onLoad", "style"];
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
/**
|
|
18
|
+
* An unstyled image component to be customized by a theme or application.
|
|
19
|
+
*
|
|
20
|
+
* @module ui/Image
|
|
21
|
+
* @exports Image
|
|
22
|
+
* @exports ImageBase
|
|
23
|
+
* @exports ImageDecorator
|
|
24
|
+
*/
|
|
25
25
|
/**
|
|
26
26
|
* A basic image component designed to display images conditionally based on screen size.
|
|
27
27
|
*
|
|
@@ -50,6 +50,14 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
50
50
|
* @ui
|
|
51
51
|
* @public
|
|
52
52
|
*/
|
|
53
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
54
|
+
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; }
|
|
55
|
+
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; }
|
|
56
|
+
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; }
|
|
57
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
58
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
59
|
+
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; }
|
|
60
|
+
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; }
|
|
53
61
|
var ImageBase = (0, _kind["default"])({
|
|
54
62
|
name: 'ui:Image',
|
|
55
63
|
propTypes: /** @lends ui/Image.ImageBase.prototype */{
|
package/ImageItem/ImageItem.js
CHANGED
|
@@ -16,6 +16,15 @@ var _ImageItemModule = _interopRequireDefault(require("./ImageItem.module.css"))
|
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
17
|
var _excluded = ["imageComponent"],
|
|
18
18
|
_excluded2 = ["children", "componentRef", "css", "imageComponent", "orientation", "placeholder", "src"];
|
|
19
|
+
/**
|
|
20
|
+
* Unstyled image item components and behaviors to be customized by a theme or application.
|
|
21
|
+
*
|
|
22
|
+
* @module ui/ImageItem
|
|
23
|
+
* @exports ImageItem
|
|
24
|
+
* @exports ImageItemBase
|
|
25
|
+
* @exports ImageItemDecorator
|
|
26
|
+
*/
|
|
27
|
+
// Adapts ComponentOverride to work within Cell since both use the component prop
|
|
19
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
20
29
|
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; }
|
|
21
30
|
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; }
|
|
@@ -24,7 +33,6 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
|
|
|
24
33
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
25
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; }
|
|
26
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; }
|
|
27
|
-
// Adapts ComponentOverride to work within Cell since both use the component prop
|
|
28
36
|
function ImageOverride(_ref) {
|
|
29
37
|
var imageComponent = _ref.imageComponent,
|
|
30
38
|
rest = _objectWithoutProperties(_ref, _excluded);
|
package/Item/Item.js
CHANGED
|
@@ -13,14 +13,14 @@ var _ForwardRef = _interopRequireDefault(require("../ForwardRef"));
|
|
|
13
13
|
var _ItemModule = _interopRequireDefault(require("./Item.module.css"));
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
15
|
var _excluded = ["component", "componentRef", "disabled", "children"];
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
/**
|
|
17
|
+
* An unstyled item component and behaviors to be customized by a theme or application.
|
|
18
|
+
*
|
|
19
|
+
* @module ui/Item
|
|
20
|
+
* @exports Item
|
|
21
|
+
* @exports ItemBase
|
|
22
|
+
* @exports ItemDecorator
|
|
23
|
+
*/
|
|
24
24
|
/**
|
|
25
25
|
* A basic list item component structure without any behaviors applied to it.
|
|
26
26
|
*
|
|
@@ -31,6 +31,14 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
31
31
|
* @ui
|
|
32
32
|
* @public
|
|
33
33
|
*/
|
|
34
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
35
|
+
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; }
|
|
36
|
+
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; }
|
|
37
|
+
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; }
|
|
38
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
39
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
40
|
+
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; }
|
|
41
|
+
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; }
|
|
34
42
|
var ItemBase = (0, _kind["default"])({
|
|
35
43
|
name: 'ui:Item',
|
|
36
44
|
propTypes: /** @lends ui/Item.ItemBase.prototype */{
|
|
@@ -51,7 +59,7 @@ var ItemBase = (0, _kind["default"])({
|
|
|
51
59
|
*/
|
|
52
60
|
component: _propTypes["default"].renderable,
|
|
53
61
|
/**
|
|
54
|
-
* Called with a reference to {@link ui/Item.ItemBase
|
|
62
|
+
* Called with a reference to {@link ui/Item.ItemBase.component|component}
|
|
55
63
|
*
|
|
56
64
|
* @type {Object|Function}
|
|
57
65
|
* @private
|
package/Item/tests/Item-specs.js
CHANGED
|
@@ -6,6 +6,8 @@ var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
|
6
6
|
var _Item = _interopRequireDefault(require("../Item"));
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
9
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
10
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
9
11
|
var tap = function tap(node) {
|
|
10
12
|
_react.fireEvent.mouseDown(node);
|
|
11
13
|
_react.fireEvent.mouseUp(node);
|
|
@@ -58,27 +60,29 @@ describe('Item', function () {
|
|
|
58
60
|
tap(item);
|
|
59
61
|
expect(handleClick).not.toHaveBeenCalled();
|
|
60
62
|
});
|
|
61
|
-
test('should call onClick when clicked', function () {
|
|
63
|
+
test('should call onClick when clicked', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
62
64
|
var handleClick = jest.fn();
|
|
65
|
+
var user = _userEvent["default"].setup();
|
|
63
66
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Item["default"], {
|
|
64
67
|
onClick: handleClick,
|
|
65
68
|
children: "I am a normal Item"
|
|
66
69
|
}));
|
|
67
70
|
var item = _react.screen.getByText('I am a normal Item');
|
|
68
|
-
|
|
71
|
+
yield user.click(item);
|
|
69
72
|
var expected = 1;
|
|
70
73
|
expect(handleClick).toHaveBeenCalledTimes(expected);
|
|
71
|
-
});
|
|
72
|
-
test('should not call onClick when clicked and disabled', function () {
|
|
74
|
+
}));
|
|
75
|
+
test('should not call onClick when clicked and disabled', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
73
76
|
var handleClick = jest.fn();
|
|
77
|
+
var user = _userEvent["default"].setup();
|
|
74
78
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Item["default"], {
|
|
75
79
|
disabled: true,
|
|
76
80
|
onClick: handleClick,
|
|
77
81
|
children: "I am a disabled Item"
|
|
78
82
|
}));
|
|
79
83
|
var item = _react.screen.getByText('I am a disabled Item');
|
|
80
|
-
|
|
84
|
+
yield user.click(item);
|
|
81
85
|
expect(handleClick).not.toHaveBeenCalled();
|
|
82
|
-
});
|
|
86
|
+
}));
|
|
83
87
|
});
|
|
84
88
|
});
|
|
@@ -16,14 +16,14 @@ var _Slottable = _interopRequireDefault(require("../Slottable"));
|
|
|
16
16
|
var _LabeledIconModule = _interopRequireDefault(require("./LabeledIcon.module.css"));
|
|
17
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
18
|
var _excluded = ["css", "children", "componentRef", "disabled", "flip", "icon", "iconComponent", "orientation", "size"];
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Provides unstyled LabeledIcon components to be customized by a theme or application.
|
|
21
|
+
*
|
|
22
|
+
* @module ui/LabeledIcon
|
|
23
|
+
* @exports LabeledIcon
|
|
24
|
+
* @exports LabeledIconBase
|
|
25
|
+
* @exports LabeledIconDecorator
|
|
26
|
+
*/
|
|
27
27
|
/**
|
|
28
28
|
* An icon component with a label.
|
|
29
29
|
*
|
|
@@ -32,6 +32,14 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
32
32
|
* @ui
|
|
33
33
|
* @public
|
|
34
34
|
*/
|
|
35
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
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; }
|
|
37
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
38
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
39
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
40
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
41
|
+
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; }
|
|
42
|
+
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; }
|
|
35
43
|
var LabeledIconBase = (0, _kind["default"])({
|
|
36
44
|
name: 'ui:LabeledIcon',
|
|
37
45
|
propTypes: /** @lends ui/LabeledIcon.LabeledIconBase.prototype */{
|
package/Layout/Cell.js
CHANGED
|
@@ -77,13 +77,27 @@ var CellBase = (0, _kind["default"])({
|
|
|
77
77
|
* @public
|
|
78
78
|
*/
|
|
79
79
|
componentRef: _propTypes["default"].ref,
|
|
80
|
+
/**
|
|
81
|
+
* Sizes `Cell` to its container.
|
|
82
|
+
*
|
|
83
|
+
* A `grow`able cell will expand to its maximum size, according to the remaining space of the
|
|
84
|
+
* container. This is used when you want to grow the size of this Cell so that it fills the
|
|
85
|
+
* container. See the {@link ui/Layout.CellBase.size|size} property for more details.
|
|
86
|
+
*
|
|
87
|
+
* When combined with {@link ui/Layout.CellBase.shrink|shrink}, `shrink` prop takes precedence over
|
|
88
|
+
* `grow` prop and `grow` prop is simply ignored.
|
|
89
|
+
*
|
|
90
|
+
* @type {Boolean}
|
|
91
|
+
* @public
|
|
92
|
+
*/
|
|
93
|
+
grow: _propTypes2["default"].bool,
|
|
80
94
|
/**
|
|
81
95
|
* Sizes `Cell` to its contents.
|
|
82
96
|
*
|
|
83
97
|
* A `shrink`able cell will contract to its minimum size, according to the dimensions of its
|
|
84
98
|
* contents. This is used when you want the size of this Cell's content to influence the
|
|
85
99
|
* dimensions of this cell. `shrink` will not allow the contents of the Layout to be pushed
|
|
86
|
-
* beyond its boundaries (overflowing). See the {@link ui/Layout.
|
|
100
|
+
* beyond its boundaries (overflowing). See the {@link ui/Layout.CellBase.size|size} property
|
|
87
101
|
* for more details.
|
|
88
102
|
*
|
|
89
103
|
* @type {Boolean}
|
|
@@ -94,13 +108,19 @@ var CellBase = (0, _kind["default"])({
|
|
|
94
108
|
/**
|
|
95
109
|
* Sets the desired size of the Cell using any valid CSS measurement value.
|
|
96
110
|
*
|
|
97
|
-
* When used in conjunction with {@link ui/Layout.
|
|
111
|
+
* When used in conjunction with {@link ui/Layout.CellBase.shrink|shrink}, the size will be
|
|
98
112
|
* the maximum size, shrinking as necessary, to fit the content.
|
|
99
113
|
*
|
|
114
|
+
* When used in conjunction with {@link ui/Layout.CellBase.grow|grow}, the size will be the
|
|
115
|
+
* minimunm size, growing as necessary, to fit the container.
|
|
116
|
+
*
|
|
100
117
|
* E.g.
|
|
101
118
|
* * `size="400px"` -> cell will be 400px, regardless of the dimensions of your content
|
|
102
119
|
* * `size="400px" shrink` -> cell will be 400px if your content is greater than 400px,
|
|
103
120
|
* and will match your contents size if it's smaller
|
|
121
|
+
* * `size="400px" grow` -> cell will be 400px if the container has no remaining space.
|
|
122
|
+
* Cell can grow larger than `size` to fill the container if there is remaining space
|
|
123
|
+
* in the container.
|
|
104
124
|
*
|
|
105
125
|
* This accepts any valid CSS measurement value string. If a numeric value is used, it will
|
|
106
126
|
* be treated as a pixel value and converted to a
|
|
@@ -122,12 +142,14 @@ var CellBase = (0, _kind["default"])({
|
|
|
122
142
|
},
|
|
123
143
|
computed: {
|
|
124
144
|
className: function className(_ref) {
|
|
125
|
-
var
|
|
145
|
+
var grow = _ref.grow,
|
|
146
|
+
shrink = _ref.shrink,
|
|
126
147
|
size = _ref.size,
|
|
127
148
|
styler = _ref.styler;
|
|
128
149
|
return styler.append({
|
|
129
150
|
shrink: shrink,
|
|
130
|
-
grow: !shrink && !size
|
|
151
|
+
grow: !shrink && (grow || !size),
|
|
152
|
+
size: size
|
|
131
153
|
});
|
|
132
154
|
},
|
|
133
155
|
style: function style(_ref2) {
|
|
@@ -157,6 +179,7 @@ var CellBase = (0, _kind["default"])({
|
|
|
157
179
|
componentRef = _ref3.componentRef,
|
|
158
180
|
rest = _objectWithoutProperties(_ref3, _excluded);
|
|
159
181
|
delete rest.align;
|
|
182
|
+
delete rest.grow;
|
|
160
183
|
delete rest.shrink;
|
|
161
184
|
delete rest.size;
|
|
162
185
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, _objectSpread({
|
package/Layout/Layout.d.ts
CHANGED
|
@@ -35,6 +35,17 @@ as `componentRef` .
|
|
|
35
35
|
*/
|
|
36
36
|
componentRef?: object | Function;
|
|
37
37
|
/**
|
|
38
|
+
* Sizes `Cell` to its container.
|
|
39
|
+
*
|
|
40
|
+
* A `grow` able cell will expand to its maximum size, according to the remaining space of the
|
|
41
|
+
container. This is used when you want to grow the size of this Cell so that it fills the
|
|
42
|
+
container. See the property for more details.
|
|
43
|
+
*
|
|
44
|
+
* When combined with , `shrink` prop takes precedence over
|
|
45
|
+
`grow` prop and `grow` prop is simply ignored.
|
|
46
|
+
*/
|
|
47
|
+
grow?: boolean;
|
|
48
|
+
/**
|
|
38
49
|
* Sizes `Cell` to its contents.
|
|
39
50
|
*
|
|
40
51
|
* A `shrink` able cell will contract to its minimum size, according to the dimensions of its
|
|
@@ -49,11 +60,17 @@ for more details.
|
|
|
49
60
|
*
|
|
50
61
|
* When used in conjunction with , the size will be
|
|
51
62
|
the maximum size, shrinking as necessary, to fit the content.
|
|
63
|
+
*
|
|
64
|
+
* When used in conjunction with , the size will be the
|
|
65
|
+
minimunm size, growing as necessary, to fit the container.
|
|
52
66
|
*
|
|
53
67
|
* E.g.
|
|
54
68
|
* * `size="400px"` -> cell will be 400px, regardless of the dimensions of your content
|
|
55
69
|
* * `size="400px" shrink` -> cell will be 400px if your content is greater than 400px,
|
|
56
70
|
and will match your contents size if it's smaller
|
|
71
|
+
* * `size="400px" grow` -> cell will be 400px if the container has no remaining space.
|
|
72
|
+
Cell can grow larger than `size` to fill the container if there is remaining space
|
|
73
|
+
in the container.
|
|
57
74
|
*
|
|
58
75
|
* This accepts any valid CSS measurement value string. If a numeric value is used, it will
|
|
59
76
|
be treated as a pixel value and converted to a
|
|
@@ -71,11 +88,6 @@ export class CellBase extends React.Component<
|
|
|
71
88
|
Merge<React.HTMLProps<HTMLElement>, CellBaseProps>
|
|
72
89
|
> {}
|
|
73
90
|
|
|
74
|
-
export interface CellDecoratorProps extends ui_ForwardRef_ForwardRefProps {}
|
|
75
|
-
export function CellDecorator<P>(
|
|
76
|
-
Component: React.ComponentType<P> | string
|
|
77
|
-
): React.ComponentType<P & CellDecoratorProps>;
|
|
78
|
-
|
|
79
91
|
export interface LayoutBaseProps {
|
|
80
92
|
/**
|
|
81
93
|
* The alignment of children.
|
|
@@ -179,6 +191,11 @@ export class LayoutBase extends React.Component<
|
|
|
179
191
|
Merge<React.HTMLProps<HTMLElement>, LayoutBaseProps>
|
|
180
192
|
> {}
|
|
181
193
|
|
|
194
|
+
export interface CellDecoratorProps extends ui_ForwardRef_ForwardRefProps {}
|
|
195
|
+
export function CellDecorator<P>(
|
|
196
|
+
Component: React.ComponentType<P> | string
|
|
197
|
+
): React.ComponentType<P & CellDecoratorProps>;
|
|
198
|
+
|
|
182
199
|
export interface CellProps
|
|
183
200
|
extends Omit<Merge<CellBaseProps, CellDecoratorProps>, "componentRef"> {}
|
|
184
201
|
/**
|