@enact/ui 4.5.1 → 4.5.3
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 +1 -40
- package/AnnounceDecorator/AnnounceDecorator.js +3 -21
- package/AnnounceDecorator/tests/Announce-specs.js +2 -7
- package/AnnounceDecorator/tests/AnnounceDecorator-specs.js +2 -6
- package/AnnounceDecorator/tests/useAnnounce-specs.js +8 -19
- package/AnnounceDecorator/useAnnounce.js +0 -6
- package/BodyText/BodyText.js +6 -26
- package/BodyText/tests/BodyText-specs.js +0 -19
- package/Button/Button.js +26 -56
- package/Button/tests/Button-specs.js +0 -26
- package/CHANGELOG.md +10 -0
- package/Cancelable/Cancelable.js +8 -47
- package/Cancelable/cancelHandler.js +5 -12
- package/Cancelable/modalHandler.js +3 -11
- package/Cancelable/tests/Cancelable-specs.js +3 -57
- package/Changeable/Changeable.js +2 -34
- package/Changeable/tests/Changeable-specs.js +20 -66
- package/ComponentOverride/ComponentOverride.js +1 -13
- package/FloatingLayer/FloatingLayer.js +17 -73
- package/FloatingLayer/FloatingLayerContainer.js +0 -15
- package/FloatingLayer/FloatingLayerDecorator.js +4 -17
- package/FloatingLayer/Scrim.js +9 -53
- package/FloatingLayer/index.js +0 -4
- package/FloatingLayer/tests/FloatingLayer-specs.js +8 -22
- package/FloatingLayer/tests/Scrim-specs.js +0 -9
- package/FloatingLayer/tests/useFloatingLayerDecorator-specs.js +0 -13
- package/FloatingLayer/useFloatingLayer.js +3 -14
- package/FloatingLayer/useFloatingLayerDecorator.js +3 -11
- package/ForwardRef/ForwardRef.js +1 -10
- package/GridListImageItem/GridListImageItem.js +17 -50
- package/Group/Group.js +4 -35
- package/Group/GroupItem.js +15 -32
- package/Group/tests/Group-specs.js +0 -32
- package/Heading/Heading.js +7 -35
- package/Heading/tests/Heading-specs.js +81 -14
- package/Icon/Icon.js +14 -48
- package/Icon/tests/Icon-specs.js +0 -22
- package/IconButton/IconButton.js +12 -50
- package/IconButton/tests/IconButton-specs.js +0 -7
- package/Image/Image.js +16 -45
- package/Image/tests/Image-specs.js +0 -14
- package/ImageItem/ImageItem.js +17 -46
- package/ImageItem/tests/ImageItem-specs.js +0 -25
- package/Item/Item.js +8 -32
- package/Item/tests/Item-specs.js +0 -24
- package/LabeledIcon/LabeledIcon.js +19 -50
- package/LabeledIcon/tests/LabeledIcon-specs.js +0 -14
- package/Layout/Cell.js +11 -37
- package/Layout/Layout.js +14 -37
- package/Layout/tests/Layout-specs.js +10 -39
- package/Marquee/MarqueeBase.js +31 -64
- package/Marquee/MarqueeController.js +11 -72
- package/Marquee/MarqueeDecorator.js +62 -196
- package/Marquee/index.js +1 -5
- package/Marquee/tests/Marquee-specs.js +258 -87
- package/Measurable/Measurable.js +12 -34
- package/Measurable/tests/Measurable-specs.js +115 -0
- package/Media/Media.js +15 -65
- package/Media/tests/Media-specs.js +168 -0
- package/Placeholder/PlaceholderControllerDecorator.js +7 -43
- package/Placeholder/PlaceholderDecorator.js +7 -38
- package/Placeholder/index.js +0 -4
- package/Placeholder/tests/PlaceholderControllerDecorator-specs.js +25 -0
- package/Placeholder/tests/PlaceholderDecorator-specs.js +28 -0
- package/ProgressBar/ProgressBar.js +13 -44
- package/ProgressBar/tests/ProgressBar-specs.js +0 -17
- package/RadioDecorator/RadioControllerDecorator.js +1 -29
- package/RadioDecorator/RadioDecorator.js +4 -42
- package/RadioDecorator/tests/RadioDecorator-specs.js +12 -49
- package/Repeater/Repeater.js +9 -33
- package/Repeater/tests/Repeater-specs.js +0 -38
- package/Resizable/Resizable.js +7 -35
- package/Resizable/tests/Resizable-specs.js +34 -0
- package/Routable/Link.js +8 -44
- package/Routable/Routable.js +10 -33
- package/Routable/Route.js +0 -6
- package/Routable/Router.js +13 -56
- package/Routable/tests/Routable-specs.js +7 -33
- package/Routable/tests/Router-specs.js +18 -44
- package/Routable/useLink.js +4 -8
- package/Routable/util.js +18 -24
- package/Scrollable/ScrollAnimator.js +49 -65
- package/Scrollable/ScrollThumb.js +2 -13
- package/Scrollable/Scrollable.js +179 -386
- package/Scrollable/ScrollableNative.js +188 -391
- package/Scrollable/Scrollbar.js +28 -100
- package/Scroller/Scroller.js +15 -39
- package/Scroller/ScrollerBasic.js +34 -89
- package/Scroller/UiScrollerBase.js +31 -84
- package/Skinnable/Skinnable.js +11 -38
- package/Skinnable/tests/Skinnable-specs.js +3 -74
- package/Skinnable/tests/useSkins-specs.js +1 -13
- package/Skinnable/tests/util-specs.js +0 -14
- package/Skinnable/useSkins.js +8 -15
- package/Skinnable/util.js +9 -20
- package/Slider/Knob.js +5 -24
- package/Slider/PositionDecorator.js +16 -54
- package/Slider/Slider.js +26 -64
- package/Slider/tests/Slider-specs.js +94 -7
- package/Slider/utils.js +0 -2
- package/SlotItem/SlotItem.js +15 -41
- package/SlotItem/tests/SlotItem-specs.js +0 -5
- package/Slottable/Slottable.js +4 -12
- package/Slottable/tests/Slottable-specs.js +19 -46
- package/Slottable/tests/useSlots-specs.js +27 -65
- package/Slottable/useSlots.js +8 -33
- package/Spinner/Spinner.js +15 -42
- package/Spinner/tests/Spinner-specs.js +0 -15
- package/ToggleIcon/ToggleIcon.js +10 -36
- package/ToggleIcon/tests/ToggleIcon-specs.js +0 -16
- package/ToggleItem/ToggleItem.js +15 -52
- package/ToggleItem/tests/ToggleItem-specs.js +0 -30
- package/Toggleable/Toggle.js +1 -15
- package/Toggleable/Toggleable.js +12 -45
- package/Toggleable/tests/Toggleable-specs.js +28 -96
- package/Toggleable/useToggle.js +3 -19
- package/Touchable/ClickAllow.js +5 -14
- package/Touchable/Drag.js +16 -54
- package/Touchable/Flick.js +11 -42
- package/Touchable/Hold.js +21 -68
- package/Touchable/Touch.js +37 -65
- package/Touchable/Touchable.js +32 -71
- package/Touchable/config.js +8 -22
- package/Touchable/tests/Touchable-specs.js +270 -119
- package/Touchable/tests/useTouch-specs.js +6 -80
- package/Touchable/useTouch.js +17 -34
- package/Transition/Transition.js +37 -118
- package/Transition/tests/Transition-specs.js +20 -60
- package/ViewManager/Arranger.js +10 -22
- package/ViewManager/TransitionGroup.js +31 -106
- package/ViewManager/View.js +35 -91
- package/ViewManager/ViewManager.js +19 -83
- package/ViewManager/tests/View-specs.js +0 -17
- package/ViewManager/tests/ViewManager-specs.js +236 -305
- package/ViewManager/tests/test-utils.js +0 -8
- package/VirtualList/UiVirtualListBase.js +256 -406
- package/VirtualList/VirtualList.js +29 -69
- package/VirtualList/VirtualListBase.js +0 -3
- package/VirtualList/VirtualListBasic.js +270 -428
- package/VirtualList/tests/VirtualList-specs.js +9 -37
- package/internal/IdProvider/IdProvider.js +7 -21
- package/internal/IdProvider/Provider.js +4 -17
- package/internal/IdProvider/tests/IdProvider-specs.js +44 -0
- package/internal/IdProvider/tests/useId-specs.js +7 -22
- package/internal/IdProvider/useId.js +0 -6
- package/internal/Pure/Pure.js +3 -30
- package/internal/Pure/tests/Pure-specs.js +88 -0
- package/internal/localized-fonts/localized-fonts.js +33 -62
- package/internal/localized-fonts/tests/localized-fonts-specs.js +33 -0
- package/internal/selection/selection.js +1 -6
- package/internal/selection/tests/selection-specs.js +6 -4
- package/internal/validators/tests/validators-specs.js +80 -0
- package/internal/validators/validators.js +14 -34
- package/package.json +8 -2
- package/resolution/ResolutionDecorator.js +4 -40
- package/resolution/index.js +0 -7
- package/resolution/resolution.js +42 -80
- package/resolution/tests/ResolutionDecorator-specs.js +4 -11
- package/resolution/tests/resolution-specs.js +2 -2
- package/useControlledState/tests/useControlledState-specs.js +15 -46
- package/useControlledState/useControlledState.js +11 -22
- package/useScroll/ScrollAnimator.js +49 -65
- package/useScroll/Scrollbar.js +22 -58
- package/useScroll/ScrollbarTrack.js +3 -19
- package/useScroll/useScroll.js +267 -454
- package/useScroll/utilDOM.js +8 -14
- package/useScroll/utilEvent.js +0 -4
|
@@ -4,49 +4,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = exports.PlaceholderControllerDecorator = exports.PlaceholderContext = void 0;
|
|
7
|
-
|
|
8
7
|
var _handle = require("@enact/core/handle");
|
|
9
|
-
|
|
10
8
|
var _hoc = _interopRequireDefault(require("@enact/core/hoc"));
|
|
11
|
-
|
|
12
9
|
var _util = require("@enact/core/util");
|
|
13
|
-
|
|
14
10
|
var _Registry = _interopRequireDefault(require("@enact/core/internal/Registry"));
|
|
15
|
-
|
|
16
11
|
var _react = require("react");
|
|
17
|
-
|
|
18
12
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
19
|
-
|
|
20
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
|
|
22
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
-
|
|
24
15
|
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; }
|
|
25
|
-
|
|
26
16
|
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; }
|
|
27
|
-
|
|
28
17
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
29
|
-
|
|
30
18
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
31
|
-
|
|
32
19
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
33
|
-
|
|
34
20
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
35
|
-
|
|
36
21
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
37
|
-
|
|
38
22
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
39
|
-
|
|
40
23
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
41
|
-
|
|
42
24
|
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
43
|
-
|
|
44
25
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
45
|
-
|
|
46
26
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
47
|
-
|
|
48
27
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
49
|
-
|
|
50
28
|
/**
|
|
51
29
|
* Default config for `PlaceholderControllerDecorator`.
|
|
52
30
|
*
|
|
@@ -66,7 +44,6 @@ var defaultConfig = {
|
|
|
66
44
|
* @memberof ui/Placeholder.PlaceholderControllerDecorator.defaultConfig
|
|
67
45
|
*/
|
|
68
46
|
bounds: null,
|
|
69
|
-
|
|
70
47
|
/**
|
|
71
48
|
* Event callback which indicates that the viewport has scrolled and placeholders should be
|
|
72
49
|
* notified.
|
|
@@ -76,7 +53,6 @@ var defaultConfig = {
|
|
|
76
53
|
* @memberof ui/Placeholder.PlaceholderControllerDecorator.defaultConfig
|
|
77
54
|
*/
|
|
78
55
|
notify: 'onScroll',
|
|
79
|
-
|
|
80
56
|
/**
|
|
81
57
|
* Multiplier used with the wrapped component's height and width to determine the threshold for
|
|
82
58
|
* replacing the placeholder component with the true component.
|
|
@@ -88,8 +64,9 @@ var defaultConfig = {
|
|
|
88
64
|
thresholdFactor: 1.5
|
|
89
65
|
};
|
|
90
66
|
var PlaceholderContext = /*#__PURE__*/(0, _react.createContext)();
|
|
67
|
+
|
|
91
68
|
/**
|
|
92
|
-
* A higher-order component (HOC) that
|
|
69
|
+
* A higher-order component (HOC) that renders placeholder components.
|
|
93
70
|
*
|
|
94
71
|
* Components are rendered based on their position relative to the `'scrollTop'` from the
|
|
95
72
|
* `'onScroll'`'s parameter. They are not unmounted once rendered.
|
|
@@ -99,53 +76,42 @@ var PlaceholderContext = /*#__PURE__*/(0, _react.createContext)();
|
|
|
99
76
|
* @hoc
|
|
100
77
|
* @public
|
|
101
78
|
*/
|
|
102
|
-
|
|
103
79
|
exports.PlaceholderContext = PlaceholderContext;
|
|
104
80
|
var PlaceholderControllerDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wrapped) {
|
|
105
81
|
var _class;
|
|
106
|
-
|
|
107
82
|
var bounds = config.bounds,
|
|
108
|
-
|
|
109
|
-
|
|
83
|
+
notify = config.notify,
|
|
84
|
+
thresholdFactor = config.thresholdFactor;
|
|
110
85
|
return _class = /*#__PURE__*/function (_Component) {
|
|
111
86
|
_inherits(_class, _Component);
|
|
112
|
-
|
|
113
87
|
var _super = _createSuper(_class);
|
|
114
|
-
|
|
115
88
|
function _class() {
|
|
116
89
|
var _this;
|
|
117
|
-
|
|
118
90
|
_classCallCheck(this, _class);
|
|
119
|
-
|
|
120
91
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
121
92
|
args[_key] = arguments[_key];
|
|
122
93
|
}
|
|
123
|
-
|
|
124
94
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
125
95
|
_this.bounds = null;
|
|
126
96
|
_this.leftThreshold = -1;
|
|
127
97
|
_this.node = null;
|
|
128
98
|
_this.topThreshold = -1;
|
|
129
99
|
_this.registry = _Registry["default"].create(_this.handleRegister.bind(_assertThisInitialized(_this)));
|
|
130
|
-
|
|
131
100
|
_this.notifyAll = function (topThreshold, leftThreshold) {
|
|
132
101
|
_this.registry.notify({
|
|
133
102
|
leftThreshold: leftThreshold,
|
|
134
103
|
topThreshold: topThreshold
|
|
135
104
|
});
|
|
136
105
|
};
|
|
137
|
-
|
|
138
106
|
_this.notifyAllJob = new _util.Job(_this.notifyAll, 32);
|
|
139
107
|
_this.handle = _handle.handle.bind(_assertThisInitialized(_this));
|
|
140
108
|
_this.handleNotify = _this.handle((0, _handle.forward)(notify), function (_ref) {
|
|
141
109
|
var scrollLeft = _ref.scrollLeft,
|
|
142
|
-
|
|
143
|
-
|
|
110
|
+
scrollTop = _ref.scrollTop;
|
|
144
111
|
_this.setThresholds(scrollTop, scrollLeft);
|
|
145
112
|
});
|
|
146
113
|
return _this;
|
|
147
114
|
}
|
|
148
|
-
|
|
149
115
|
_createClass(_class, [{
|
|
150
116
|
key: "componentDidMount",
|
|
151
117
|
value: function componentDidMount() {
|
|
@@ -186,11 +152,10 @@ var PlaceholderControllerDecorator = (0, _hoc["default"])(defaultConfig, functio
|
|
|
186
152
|
key: "setThresholds",
|
|
187
153
|
value: function setThresholds(top, left) {
|
|
188
154
|
var _this$bounds = this.bounds,
|
|
189
|
-
|
|
190
|
-
|
|
155
|
+
height = _this$bounds.height,
|
|
156
|
+
width = _this$bounds.width;
|
|
191
157
|
var topThreshold = height * thresholdFactor + top;
|
|
192
158
|
var leftThreshold = width * thresholdFactor + left;
|
|
193
|
-
|
|
194
159
|
if (this.topThreshold < topThreshold || this.leftThreshold < leftThreshold) {
|
|
195
160
|
this.notifyAll(topThreshold, leftThreshold);
|
|
196
161
|
this.topThreshold = topThreshold;
|
|
@@ -208,7 +173,6 @@ var PlaceholderControllerDecorator = (0, _hoc["default"])(defaultConfig, functio
|
|
|
208
173
|
});
|
|
209
174
|
}
|
|
210
175
|
}]);
|
|
211
|
-
|
|
212
176
|
return _class;
|
|
213
177
|
}(_react.Component), _class.displayName = 'PlaceholderControllerDecorator', _class;
|
|
214
178
|
});
|
|
@@ -4,43 +4,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = exports.PlaceholderDecorator = void 0;
|
|
7
|
-
|
|
8
7
|
var _hoc = _interopRequireDefault(require("@enact/core/hoc"));
|
|
9
|
-
|
|
10
8
|
var _react = require("react");
|
|
11
|
-
|
|
12
9
|
var _PlaceholderControllerDecorator = require("./PlaceholderControllerDecorator");
|
|
13
|
-
|
|
14
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
18
12
|
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; }
|
|
19
|
-
|
|
20
13
|
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; }
|
|
21
|
-
|
|
22
14
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
-
|
|
24
15
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
25
|
-
|
|
26
16
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
27
|
-
|
|
28
17
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
29
|
-
|
|
30
18
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
31
|
-
|
|
32
19
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
33
|
-
|
|
34
20
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
35
|
-
|
|
36
21
|
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
37
|
-
|
|
38
22
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
39
|
-
|
|
40
23
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
41
|
-
|
|
42
24
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
43
|
-
|
|
44
25
|
/**
|
|
45
26
|
* Default config for PlaceholderDecorator.
|
|
46
27
|
*
|
|
@@ -60,7 +41,6 @@ var defaultConfig = {
|
|
|
60
41
|
height: 0,
|
|
61
42
|
width: 'auto'
|
|
62
43
|
},
|
|
63
|
-
|
|
64
44
|
/**
|
|
65
45
|
* The component to use as a placeholder.
|
|
66
46
|
*
|
|
@@ -70,6 +50,7 @@ var defaultConfig = {
|
|
|
70
50
|
*/
|
|
71
51
|
placeholderComponent: 'div'
|
|
72
52
|
};
|
|
53
|
+
|
|
73
54
|
/**
|
|
74
55
|
* A higher-order component that enables a container to notify the wrapped component when scrolling.
|
|
75
56
|
*
|
|
@@ -83,35 +64,26 @@ var defaultConfig = {
|
|
|
83
64
|
* @hoc
|
|
84
65
|
* @public
|
|
85
66
|
*/
|
|
86
|
-
|
|
87
67
|
var PlaceholderDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wrapped) {
|
|
88
68
|
var _class;
|
|
89
|
-
|
|
90
69
|
var PlaceholderComponent = config.placeholderComponent,
|
|
91
|
-
|
|
70
|
+
style = config.style;
|
|
92
71
|
var placeholderStyle = Object.assign({}, defaultConfig.style, style);
|
|
93
72
|
return _class = /*#__PURE__*/function (_PureComponent) {
|
|
94
73
|
_inherits(_class, _PureComponent);
|
|
95
|
-
|
|
96
74
|
var _super = _createSuper(_class);
|
|
97
|
-
|
|
98
75
|
function _class() {
|
|
99
76
|
var _this;
|
|
100
|
-
|
|
101
77
|
_classCallCheck(this, _class);
|
|
102
|
-
|
|
103
78
|
_this = _super.call(this);
|
|
104
|
-
|
|
105
79
|
_this.initPlaceholderRef = function (ref) {
|
|
106
80
|
_this.placeholderRef = ref;
|
|
107
81
|
};
|
|
108
|
-
|
|
109
82
|
_this.state = {
|
|
110
83
|
visible: false
|
|
111
84
|
};
|
|
112
85
|
return _this;
|
|
113
86
|
}
|
|
114
|
-
|
|
115
87
|
_createClass(_class, [{
|
|
116
88
|
key: "componentDidMount",
|
|
117
89
|
value: function componentDidMount() {
|
|
@@ -138,13 +110,12 @@ var PlaceholderDecorator = (0, _hoc["default"])(defaultConfig, function (config,
|
|
|
138
110
|
key: "update",
|
|
139
111
|
value: function update(_ref) {
|
|
140
112
|
var leftThreshold = _ref.leftThreshold,
|
|
141
|
-
|
|
113
|
+
topThreshold = _ref.topThreshold;
|
|
142
114
|
var _this$placeholderRef = this.placeholderRef,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
115
|
+
offsetLeft = _this$placeholderRef.offsetLeft,
|
|
116
|
+
offsetTop = _this$placeholderRef.offsetTop,
|
|
117
|
+
offsetHeight = _this$placeholderRef.offsetHeight,
|
|
118
|
+
offsetWidth = _this$placeholderRef.offsetWidth;
|
|
148
119
|
if (offsetTop < topThreshold + offsetHeight && offsetLeft < leftThreshold + offsetWidth) {
|
|
149
120
|
this.setState(function (state) {
|
|
150
121
|
return state.visible ? null : {
|
|
@@ -157,7 +128,6 @@ var PlaceholderDecorator = (0, _hoc["default"])(defaultConfig, function (config,
|
|
|
157
128
|
key: "render",
|
|
158
129
|
value: function render() {
|
|
159
130
|
var visible = this.state.visible;
|
|
160
|
-
|
|
161
131
|
if (visible) {
|
|
162
132
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapped, _objectSpread(_objectSpread({}, this.props), {}, {
|
|
163
133
|
ref: this.initPlaceholderRef
|
|
@@ -170,7 +140,6 @@ var PlaceholderDecorator = (0, _hoc["default"])(defaultConfig, function (config,
|
|
|
170
140
|
}
|
|
171
141
|
}
|
|
172
142
|
}]);
|
|
173
|
-
|
|
174
143
|
return _class;
|
|
175
144
|
}(_react.PureComponent), _class.displayName = 'PlaceholderDecorator', _class.contextType = _PlaceholderControllerDecorator.PlaceholderContext, _class;
|
|
176
145
|
});
|
package/Placeholder/index.js
CHANGED
|
@@ -16,13 +16,9 @@ Object.defineProperty(exports, "PlaceholderDecorator", {
|
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
exports["default"] = void 0;
|
|
19
|
-
|
|
20
19
|
var _PlaceholderControllerDecorator = _interopRequireDefault(require("./PlaceholderControllerDecorator"));
|
|
21
|
-
|
|
22
20
|
var _PlaceholderDecorator = require("./PlaceholderDecorator");
|
|
23
|
-
|
|
24
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
-
|
|
26
22
|
/**
|
|
27
23
|
* Exports the {@link ui/Placeholder.PlaceholderControllerDecorator} and
|
|
28
24
|
* {@link ui/Placeholder.PlaceholderDecorator} higher-order components.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("@testing-library/jest-dom");
|
|
4
|
+
var _react = require("@testing-library/react");
|
|
5
|
+
var _Placeholder = require("../../Placeholder");
|
|
6
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
describe('PlaceholderControllerDecorator', function () {
|
|
8
|
+
var data;
|
|
9
|
+
var DivComponent = function DivComponent(props) {
|
|
10
|
+
data = props;
|
|
11
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
12
|
+
"data-testid": "component"
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var Component = (0, _Placeholder.PlaceholderControllerDecorator)(DivComponent);
|
|
16
|
+
describe('config', function () {
|
|
17
|
+
test('should pass \'onScroll\' handler to the wrapped component', function () {
|
|
18
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {}));
|
|
19
|
+
expect(data).toHaveProperty('onScroll');
|
|
20
|
+
var expected = 'function';
|
|
21
|
+
var actual = typeof data.onScroll;
|
|
22
|
+
expect(actual).toBe(expected);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Registry = _interopRequireDefault(require("@enact/core/internal/Registry"));
|
|
4
|
+
require("@testing-library/jest-dom");
|
|
5
|
+
var _react = require("@testing-library/react");
|
|
6
|
+
var _PlaceholderControllerDecorator = require("../PlaceholderControllerDecorator");
|
|
7
|
+
var _PlaceholderDecorator = _interopRequireDefault(require("../PlaceholderDecorator"));
|
|
8
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
|
+
describe('PlaceholderDecorator', function () {
|
|
11
|
+
var Component = (0, _PlaceholderDecorator["default"])('div');
|
|
12
|
+
describe('config', function () {
|
|
13
|
+
test('should configure the default style of the placeholder element', function () {
|
|
14
|
+
var controllerRegistry = _Registry["default"].create();
|
|
15
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_PlaceholderControllerDecorator.PlaceholderContext.Provider, {
|
|
16
|
+
value: controllerRegistry.register,
|
|
17
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
18
|
+
"data-testid": "wrapper",
|
|
19
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {})
|
|
20
|
+
})
|
|
21
|
+
}));
|
|
22
|
+
var expectedAttribute = 'style';
|
|
23
|
+
var expectedValue = 'height: 0px; width: auto;';
|
|
24
|
+
var actual = _react.screen.getByTestId('wrapper').children[0];
|
|
25
|
+
expect(actual).toHaveAttribute(expectedAttribute, expectedValue);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -4,59 +4,39 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = exports.ProgressBarDecorator = exports.ProgressBarBase = exports.ProgressBar = void 0;
|
|
7
|
-
|
|
8
7
|
var _kind = _interopRequireDefault(require("@enact/core/kind"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("@enact/core/internal/prop-types"));
|
|
11
|
-
|
|
12
9
|
var _clamp = _interopRequireDefault(require("ramda/src/clamp"));
|
|
13
|
-
|
|
14
10
|
var _compose = _interopRequireDefault(require("ramda/src/compose"));
|
|
15
|
-
|
|
16
11
|
var _propTypes2 = _interopRequireDefault(require("prop-types"));
|
|
17
|
-
|
|
18
12
|
var _validators = require("../internal/validators");
|
|
19
|
-
|
|
20
13
|
var _ForwardRef = _interopRequireDefault(require("../ForwardRef"));
|
|
21
|
-
|
|
22
14
|
var _ProgressBarModule = _interopRequireDefault(require("./ProgressBar.module.css"));
|
|
23
|
-
|
|
24
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
|
-
|
|
26
16
|
var _excluded = ["children", "componentRef", "css"];
|
|
27
|
-
|
|
28
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
|
-
|
|
30
18
|
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
|
-
|
|
32
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; }
|
|
33
|
-
|
|
34
20
|
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; }
|
|
35
|
-
|
|
36
21
|
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
|
-
|
|
38
22
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
39
|
-
|
|
40
23
|
var progressToProportion = function progressToProportion(value) {
|
|
41
24
|
return (0, _clamp["default"])(0, 1, value);
|
|
42
25
|
};
|
|
43
|
-
|
|
44
26
|
var calcBarStyle = function calcBarStyle(prop, anchor) {
|
|
45
27
|
var _ref;
|
|
46
|
-
|
|
47
28
|
var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : anchor;
|
|
48
29
|
var startProp = arguments.length > 3 ? arguments[3] : undefined;
|
|
49
30
|
var endProp = arguments.length > 4 ? arguments[4] : undefined;
|
|
50
31
|
var start = Math.min(anchor, value);
|
|
51
32
|
var end = Math.max(anchor, value) - start;
|
|
52
|
-
|
|
53
33
|
if (process.env.NODE_ENV !== "production") {
|
|
54
34
|
(0, _validators.validateRange)(start, 0, 1, 'ProgressBar', prop, 'min', 'max');
|
|
55
35
|
(0, _validators.validateRange)(end, 0, 1, 'ProgressBar', prop, 'min', 'max');
|
|
56
36
|
}
|
|
57
|
-
|
|
58
37
|
return _ref = {}, _defineProperty(_ref, startProp, progressToProportion(start)), _defineProperty(_ref, endProp, progressToProportion(end)), _ref;
|
|
59
38
|
};
|
|
39
|
+
|
|
60
40
|
/**
|
|
61
41
|
* An unstyled progress bar component that can be customized by a theme or application.
|
|
62
42
|
*
|
|
@@ -65,13 +45,9 @@ var calcBarStyle = function calcBarStyle(prop, anchor) {
|
|
|
65
45
|
* @ui
|
|
66
46
|
* @public
|
|
67
47
|
*/
|
|
68
|
-
|
|
69
|
-
|
|
70
48
|
var ProgressBarBase = (0, _kind["default"])({
|
|
71
49
|
name: 'ui:ProgressBar',
|
|
72
|
-
propTypes:
|
|
73
|
-
/** @lends ui/ProgressBar.ProgressBarBase.prototype */
|
|
74
|
-
{
|
|
50
|
+
propTypes: /** @lends ui/ProgressBar.ProgressBarBase.prototype */{
|
|
75
51
|
/**
|
|
76
52
|
* The proportion of the loaded portion of the progress bar.
|
|
77
53
|
*
|
|
@@ -82,7 +58,6 @@ var ProgressBarBase = (0, _kind["default"])({
|
|
|
82
58
|
* @public
|
|
83
59
|
*/
|
|
84
60
|
backgroundProgress: _propTypes2["default"].number,
|
|
85
|
-
|
|
86
61
|
/**
|
|
87
62
|
* The contents to be displayed with progress bar.
|
|
88
63
|
*
|
|
@@ -90,7 +65,6 @@ var ProgressBarBase = (0, _kind["default"])({
|
|
|
90
65
|
* @public
|
|
91
66
|
*/
|
|
92
67
|
children: _propTypes2["default"].node,
|
|
93
|
-
|
|
94
68
|
/**
|
|
95
69
|
* Called with a reference to the root component.
|
|
96
70
|
*
|
|
@@ -101,7 +75,6 @@ var ProgressBarBase = (0, _kind["default"])({
|
|
|
101
75
|
* @public
|
|
102
76
|
*/
|
|
103
77
|
componentRef: _propTypes["default"].ref,
|
|
104
|
-
|
|
105
78
|
/**
|
|
106
79
|
* Customizes the component by mapping the supplied collection of CSS class names to the
|
|
107
80
|
* corresponding internal elements and states of this component.
|
|
@@ -120,7 +93,6 @@ var ProgressBarBase = (0, _kind["default"])({
|
|
|
120
93
|
* @public
|
|
121
94
|
*/
|
|
122
95
|
css: _propTypes2["default"].object,
|
|
123
|
-
|
|
124
96
|
/**
|
|
125
97
|
* Sets the orientation of the slider.
|
|
126
98
|
*
|
|
@@ -135,7 +107,6 @@ var ProgressBarBase = (0, _kind["default"])({
|
|
|
135
107
|
* @public
|
|
136
108
|
*/
|
|
137
109
|
orientation: _propTypes2["default"].string,
|
|
138
|
-
|
|
139
110
|
/**
|
|
140
111
|
* The proportion of the filled portion of the progress bar.
|
|
141
112
|
*
|
|
@@ -146,7 +117,6 @@ var ProgressBarBase = (0, _kind["default"])({
|
|
|
146
117
|
* @public
|
|
147
118
|
*/
|
|
148
119
|
progress: _propTypes2["default"].number,
|
|
149
|
-
|
|
150
120
|
/**
|
|
151
121
|
* Sets the point, as a proportion between 0 and 1, from which the progress bar is filled.
|
|
152
122
|
*
|
|
@@ -176,9 +146,9 @@ var ProgressBarBase = (0, _kind["default"])({
|
|
|
176
146
|
computed: {
|
|
177
147
|
className: function className(_ref2) {
|
|
178
148
|
var backgroundProgress = _ref2.backgroundProgress,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
149
|
+
orientation = _ref2.orientation,
|
|
150
|
+
progress = _ref2.progress,
|
|
151
|
+
styler = _ref2.styler;
|
|
182
152
|
return styler.append(orientation, {
|
|
183
153
|
fillOverHalf: progress > 0.5,
|
|
184
154
|
loadOverHalf: backgroundProgress > 0.5
|
|
@@ -186,9 +156,9 @@ var ProgressBarBase = (0, _kind["default"])({
|
|
|
186
156
|
},
|
|
187
157
|
style: function style(_ref3) {
|
|
188
158
|
var backgroundProgress = _ref3.backgroundProgress,
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
159
|
+
progress = _ref3.progress,
|
|
160
|
+
progressAnchor = _ref3.progressAnchor,
|
|
161
|
+
_style = _ref3.style;
|
|
192
162
|
return _objectSpread(_objectSpread(_objectSpread({}, _style), {}, {
|
|
193
163
|
'--ui-progressbar-proportion-anchor': progressAnchor
|
|
194
164
|
}, calcBarStyle('backgroundProgress', progressAnchor, backgroundProgress, '--ui-progressbar-proportion-start-background', '--ui-progressbar-proportion-end-background')), calcBarStyle('progress', progressAnchor, progress, '--ui-progressbar-proportion-start', '--ui-progressbar-proportion-end'));
|
|
@@ -196,10 +166,9 @@ var ProgressBarBase = (0, _kind["default"])({
|
|
|
196
166
|
},
|
|
197
167
|
render: function render(_ref4) {
|
|
198
168
|
var children = _ref4.children,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
169
|
+
componentRef = _ref4.componentRef,
|
|
170
|
+
css = _ref4.css,
|
|
171
|
+
rest = _objectWithoutProperties(_ref4, _excluded);
|
|
203
172
|
delete rest.backgroundProgress;
|
|
204
173
|
delete rest.orientation;
|
|
205
174
|
delete rest.progress;
|
|
@@ -219,6 +188,7 @@ var ProgressBarBase = (0, _kind["default"])({
|
|
|
219
188
|
}));
|
|
220
189
|
}
|
|
221
190
|
});
|
|
191
|
+
|
|
222
192
|
/**
|
|
223
193
|
* A higher-order component that adds behavior to
|
|
224
194
|
* [ProgressBar]{@link ui/ProgressBar.ProgressBarBase}.
|
|
@@ -228,11 +198,11 @@ var ProgressBarBase = (0, _kind["default"])({
|
|
|
228
198
|
* @mixes ui/ForwardRef.ForwardRef
|
|
229
199
|
* @public
|
|
230
200
|
*/
|
|
231
|
-
|
|
232
201
|
exports.ProgressBarBase = ProgressBarBase;
|
|
233
202
|
var ProgressBarDecorator = (0, _compose["default"])((0, _ForwardRef["default"])({
|
|
234
203
|
prop: 'componentRef'
|
|
235
204
|
}));
|
|
205
|
+
|
|
236
206
|
/**
|
|
237
207
|
* An unstyled progress bar component that can be customized by a theme or application.
|
|
238
208
|
*
|
|
@@ -244,7 +214,6 @@ var ProgressBarDecorator = (0, _compose["default"])((0, _ForwardRef["default"])(
|
|
|
244
214
|
* @ui
|
|
245
215
|
* @public
|
|
246
216
|
*/
|
|
247
|
-
|
|
248
217
|
exports.ProgressBarDecorator = ProgressBarDecorator;
|
|
249
218
|
var ProgressBar = ProgressBarDecorator(ProgressBarBase);
|
|
250
219
|
exports.ProgressBar = ProgressBar;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("@testing-library/jest-dom");
|
|
4
|
-
|
|
5
4
|
var _react = require("@testing-library/react");
|
|
6
|
-
|
|
7
5
|
var _ProgressBar = _interopRequireDefault(require("../ProgressBar"));
|
|
8
|
-
|
|
9
6
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
|
|
11
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
|
-
|
|
13
8
|
describe('ProgressBar Specs', function () {
|
|
14
9
|
test('should return a DOM node reference for `componentRef`', function () {
|
|
15
10
|
var ref = jest.fn();
|
|
@@ -25,9 +20,7 @@ describe('ProgressBar Specs', function () {
|
|
|
25
20
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
|
|
26
21
|
progress: 0.5
|
|
27
22
|
}));
|
|
28
|
-
|
|
29
23
|
var progressBar = _react.screen.getByRole('progressbar');
|
|
30
|
-
|
|
31
24
|
var expected = '0.5';
|
|
32
25
|
expect(progressBar).toHaveStyle({
|
|
33
26
|
'--ui-progressbar-proportion-end': expected
|
|
@@ -37,9 +30,7 @@ describe('ProgressBar Specs', function () {
|
|
|
37
30
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
|
|
38
31
|
backgroundProgress: 0.75
|
|
39
32
|
}));
|
|
40
|
-
|
|
41
33
|
var progressBar = _react.screen.getByRole('progressbar');
|
|
42
|
-
|
|
43
34
|
var expected = '0.75';
|
|
44
35
|
expect(progressBar).toHaveStyle({
|
|
45
36
|
'--ui-progressbar-proportion-end-background': expected
|
|
@@ -52,9 +43,7 @@ describe('ProgressBar Specs', function () {
|
|
|
52
43
|
orientation: "vertical",
|
|
53
44
|
progress: 0.5
|
|
54
45
|
}));
|
|
55
|
-
|
|
56
46
|
var progressBar = _react.screen.getByRole('progressbar');
|
|
57
|
-
|
|
58
47
|
var expected = '0.5';
|
|
59
48
|
expect(progressBar).toHaveStyle({
|
|
60
49
|
'--ui-progressbar-proportion-end': expected
|
|
@@ -66,9 +55,7 @@ describe('ProgressBar Specs', function () {
|
|
|
66
55
|
orientation: "vertical",
|
|
67
56
|
progress: 0.5
|
|
68
57
|
}));
|
|
69
|
-
|
|
70
58
|
var progressBar = _react.screen.getByRole('progressbar');
|
|
71
|
-
|
|
72
59
|
var expected = '0.75';
|
|
73
60
|
expect(progressBar).toHaveStyle({
|
|
74
61
|
'--ui-progressbar-proportion-end-background': expected
|
|
@@ -81,9 +68,7 @@ describe('ProgressBar Specs', function () {
|
|
|
81
68
|
orientation: "radial",
|
|
82
69
|
progress: 0.5
|
|
83
70
|
}));
|
|
84
|
-
|
|
85
71
|
var progressBar = _react.screen.getByRole('progressbar');
|
|
86
|
-
|
|
87
72
|
var expected = '0.5';
|
|
88
73
|
expect(progressBar).toHaveStyle({
|
|
89
74
|
'--ui-progressbar-proportion-end': expected
|
|
@@ -95,9 +80,7 @@ describe('ProgressBar Specs', function () {
|
|
|
95
80
|
orientation: "radial",
|
|
96
81
|
progress: 0.5
|
|
97
82
|
}));
|
|
98
|
-
|
|
99
83
|
var progressBar = _react.screen.getByRole('progressbar');
|
|
100
|
-
|
|
101
84
|
var expected = '0.75';
|
|
102
85
|
expect(progressBar).toHaveStyle({
|
|
103
86
|
'--ui-progressbar-proportion-end-background': expected
|