@enact/ui 4.9.2 → 5.0.0-alpha.2
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 +20 -22
- package/AnnounceDecorator/AnnounceDecorator.js +5 -5
- package/AnnounceDecorator/tests/Announce-specs.js +1 -1
- package/AnnounceDecorator/tests/AnnounceDecorator-specs.js +1 -1
- package/AnnounceDecorator/tests/useAnnounce-specs.js +1 -1
- package/AnnounceDecorator/useAnnounce.js +1 -1
- package/BodyText/BodyText.js +5 -5
- package/BodyText/tests/BodyText-specs.js +1 -1
- package/Button/Button.js +5 -5
- package/Button/tests/Button-specs.js +3 -3
- package/CHANGELOG.md +33 -0
- package/Cancelable/Cancelable.js +22 -24
- package/Cancelable/tests/Cancelable-specs.js +4 -4
- package/Changeable/Changeable.js +22 -24
- package/Changeable/tests/Changeable-specs.js +1 -1
- package/ComponentOverride/ComponentOverride.js +4 -4
- package/FloatingLayer/FloatingLayer.js +20 -22
- package/FloatingLayer/FloatingLayerContainer.js +6 -7
- package/FloatingLayer/FloatingLayerDecorator.js +5 -5
- package/FloatingLayer/Scrim.js +18 -20
- package/FloatingLayer/tests/FloatingLayer-specs.js +1 -1
- package/FloatingLayer/tests/Scrim-specs.js +1 -1
- package/FloatingLayer/tests/useFloatingLayerDecorator-specs.js +2 -2
- package/FloatingLayer/useFloatingLayer.js +4 -4
- package/FloatingLayer/useFloatingLayerDecorator.js +1 -1
- package/ForwardRef/ForwardRef.js +3 -3
- package/Group/Group.js +5 -5
- package/Group/GroupItem.js +5 -5
- package/Group/tests/Group-specs.js +4 -4
- package/Heading/Heading.js +5 -5
- package/Heading/tests/Heading-specs.js +1 -1
- package/Icon/Icon.js +5 -5
- package/Icon/tests/Icon-specs.js +1 -1
- package/Image/Image.js +5 -5
- package/Image/tests/Image-specs.js +1 -1
- package/ImageItem/ImageItem.js +5 -5
- package/ImageItem/tests/ImageItem-specs.js +3 -3
- package/Item/Item.js +5 -5
- package/Item/tests/Item-specs.js +3 -3
- package/LabeledIcon/LabeledIcon.js +5 -5
- package/LabeledIcon/tests/LabeledIcon-specs.js +1 -1
- package/Layout/Cell.js +5 -5
- package/Layout/Layout.js +5 -5
- package/Layout/tests/Layout-specs.js +7 -7
- package/Marquee/MarqueeBase.js +5 -5
- package/Marquee/MarqueeController.js +3 -3
- package/Marquee/MarqueeDecorator.js +30 -51
- package/Marquee/index.d.ts +10 -14
- package/Marquee/index.js +1 -1
- package/Marquee/tests/Marquee-specs.js +5 -6
- package/Marquee/useMarqueeController.js +2 -2
- package/Measurable/Measurable.js +8 -8
- package/Measurable/tests/Measurable-specs.js +8 -10
- package/Media/Media.js +17 -19
- package/Placeholder/PlaceholderControllerDecorator.js +22 -24
- package/Placeholder/PlaceholderDecorator.js +20 -22
- package/Placeholder/index.js +1 -1
- package/Placeholder/tests/PlaceholderControllerDecorator-specs.js +2 -2
- package/Placeholder/tests/PlaceholderDecorator-specs.js +1 -1
- package/ProgressBar/ProgressBar.js +5 -5
- package/ProgressBar/tests/ProgressBar-specs.js +1 -1
- package/Repeater/Repeater.js +5 -5
- package/Repeater/tests/Repeater-specs.js +3 -3
- package/Resizable/Resizable.js +3 -3
- package/Resizable/tests/Resizable-specs.js +2 -2
- package/Resizable/tests/useResize-specs.js +3 -3
- package/Resizable/useResize.js +3 -3
- package/Routable/Link.js +17 -19
- package/Routable/Routable.js +5 -5
- package/Routable/Route.js +1 -1
- package/Routable/Router.js +22 -24
- package/Routable/tests/Routable-specs.js +9 -9
- package/Routable/tests/Router-specs.js +1 -1
- package/Routable/util.js +1 -1
- package/Scroller/Scroller.d.ts +0 -120
- package/Scroller/Scroller.js +3 -11
- package/Scroller/ScrollerBasic.js +19 -21
- package/Scroller/tests/Scroller-specs.js +1 -1
- package/Skinnable/Skinnable.js +5 -5
- package/Skinnable/tests/Skinnable-specs.js +3 -3
- package/Skinnable/tests/useSkins-specs.js +3 -3
- package/Skinnable/util.js +1 -1
- package/Slider/Knob.js +5 -5
- package/Slider/PositionDecorator.js +25 -27
- package/Slider/Slider.js +5 -5
- package/Slider/tests/Slider-specs.js +1 -1
- package/Slottable/Slottable.js +3 -5
- package/Slottable/tests/Slottable-specs.js +1 -1
- package/Slottable/tests/useSlots-specs.js +1 -1
- package/Slottable/useSlots.js +5 -5
- package/Spinner/Spinner.js +5 -5
- package/ToggleIcon/ToggleIcon.js +5 -5
- package/ToggleIcon/tests/ToggleIcon-specs.js +3 -3
- package/Toggleable/Toggle.js +6 -7
- package/Toggleable/Toggleable.js +6 -6
- package/Toggleable/tests/Toggleable-specs.js +1 -1
- package/Toggleable/useToggle.js +8 -8
- package/Touchable/ClickAllow.js +5 -6
- package/Touchable/Drag.js +6 -6
- package/Touchable/Flick.js +7 -8
- package/Touchable/Hold.js +7 -8
- package/Touchable/Pinch.js +6 -6
- package/Touchable/Touch.js +6 -7
- package/Touchable/Touchable.js +5 -5
- package/Touchable/config.js +2 -2
- package/Touchable/tests/Touchable-specs.js +3 -3
- package/Touchable/tests/useTouch-specs.js +5 -5
- package/Touchable/useTouch.js +7 -7
- package/Transition/Transition.js +17 -19
- package/Transition/tests/Transition-specs.js +7 -7
- package/ViewManager/Arranger.js +3 -3
- package/ViewManager/TransitionGroup.js +18 -20
- package/ViewManager/View.js +15 -17
- package/ViewManager/ViewManager.js +25 -27
- package/ViewManager/tests/View-specs.js +1 -1
- package/ViewManager/tests/ViewManager-specs.js +16 -18
- package/VirtualList/VirtualList.d.ts +0 -158
- package/VirtualList/VirtualList.js +3 -17
- package/VirtualList/VirtualListBasic.js +42 -43
- package/VirtualList/tests/VirtualGridList-native-specs.js +4 -4
- package/VirtualList/tests/VirtualGridList-specs.js +6 -6
- package/VirtualList/tests/VirtualList-native-specs.js +5 -5
- package/VirtualList/tests/VirtualList-specs.js +7 -7
- package/internal/IdProvider/IdProvider.js +3 -3
- package/internal/IdProvider/Provider.js +5 -6
- package/internal/IdProvider/tests/IdProvider-specs.js +3 -3
- package/internal/IdProvider/tests/useId-specs.js +3 -3
- package/internal/IdProvider/useId.js +1 -1
- package/internal/Pure/Pure.js +20 -22
- package/internal/Pure/tests/Pure-specs.js +15 -17
- package/internal/localized-fonts/localized-fonts.js +4 -4
- package/internal/selection/selection.js +1 -1
- package/package.json +5 -4
- package/resolution/ResolutionDecorator.js +21 -23
- package/resolution/index.js +2 -2
- package/resolution/tests/ResolutionDecorator-specs.js +1 -1
- package/useControlledState/tests/useControlledState-specs.js +5 -5
- package/useControlledState/useControlledState.js +4 -4
- package/useScroll/ScrollAnimator.js +6 -7
- package/useScroll/Scrollbar.js +5 -5
- package/useScroll/ScrollbarTrack.js +5 -5
- package/useScroll/useScroll.js +9 -9
- package/useScroll/utilDOM.js +1 -1
- package/GridListImageItem/GridListImageItem.d.ts +0 -85
- package/GridListImageItem/GridListImageItem.js +0 -250
- package/GridListImageItem/GridListImageItem.module.css +0 -28
- package/GridListImageItem/package.json +0 -3
- package/IconButton/IconButton.d.ts +0 -115
- package/IconButton/IconButton.js +0 -253
- package/IconButton/IconButton.module.css +0 -11
- package/IconButton/package.json +0 -3
- package/IconButton/tests/IconButton-specs.js +0 -29
- package/RadioDecorator/RadioControllerDecorator.js +0 -101
- package/RadioDecorator/RadioDecorator.d.ts +0 -35
- package/RadioDecorator/RadioDecorator.js +0 -177
- package/RadioDecorator/package.json +0 -3
- package/RadioDecorator/tests/RadioDecorator-specs.js +0 -247
- package/Scrollable/ScrollAnimator.js +0 -130
- package/Scrollable/ScrollThumb.js +0 -57
- package/Scrollable/ScrollThumb.module.css +0 -34
- package/Scrollable/Scrollable.js +0 -1430
- package/Scrollable/Scrollable.module.css +0 -36
- package/Scrollable/ScrollableNative.js +0 -1429
- package/Scrollable/Scrollbar.js +0 -281
- package/Scrollable/Scrollbar.module.css +0 -24
- package/Scrollable/package.json +0 -3
- package/Scroller/UiScroller.module.css +0 -10
- package/Scroller/UiScrollerBase.js +0 -372
- package/SlotItem/SlotItem.d.ts +0 -118
- package/SlotItem/SlotItem.js +0 -248
- package/SlotItem/SlotItem.module.css +0 -12
- package/SlotItem/package.json +0 -3
- package/SlotItem/tests/SlotItem-specs.js +0 -24
- package/ToggleItem/ToggleItem.d.ts +0 -132
- package/ToggleItem/ToggleItem.js +0 -301
- package/ToggleItem/ToggleItem.module.css +0 -9
- package/ToggleItem/package.json +0 -3
- package/ToggleItem/tests/ToggleItem-specs.js +0 -120
- package/VirtualList/UiVirtualList.module.css +0 -26
- package/VirtualList/UiVirtualListBase.js +0 -1410
- package/VirtualList/VirtualListBase.js +0 -33
package/Scrollable/Scrollbar.js
DELETED
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "ScrollThumb", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _ScrollThumb["default"];
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
exports["default"] = exports.ScrollbarBase = exports.Scrollbar = void 0;
|
|
13
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
|
-
var _util = require("@enact/core/util");
|
|
15
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
16
|
-
var _react = require("react");
|
|
17
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
18
|
-
var _resolution = _interopRequireDefault(require("../resolution"));
|
|
19
|
-
var _ScrollThumb = _interopRequireDefault(require("./ScrollThumb"));
|
|
20
|
-
var _ScrollbarModule = _interopRequireDefault(require("./Scrollbar.module.css"));
|
|
21
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
-
var _excluded = ["childRenderer", "className", "corner", "css", "vertical"];
|
|
23
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
24
|
-
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; }
|
|
25
|
-
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; }
|
|
26
|
-
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; }
|
|
27
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
28
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
29
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
30
|
-
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, _toPropertyKey(descriptor.key), descriptor); } }
|
|
31
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
32
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
33
|
-
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); }
|
|
34
|
-
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); }
|
|
35
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
36
|
-
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); }; }
|
|
37
|
-
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); }
|
|
38
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
39
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
40
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
41
|
-
var minThumbSize = 18,
|
|
42
|
-
// Size in pixels
|
|
43
|
-
nop = function nop() {},
|
|
44
|
-
thumbHidingDelay = 400; // in milliseconds
|
|
45
|
-
|
|
46
|
-
/*
|
|
47
|
-
* Set CSS Varaible value.
|
|
48
|
-
*
|
|
49
|
-
* @method
|
|
50
|
-
* @param {Node} element - Node.
|
|
51
|
-
* @param {String} variable - CSS Variable property.
|
|
52
|
-
* @param {String} value - CSS Variable value.
|
|
53
|
-
*/
|
|
54
|
-
var setCSSVariable = function setCSSVariable(element, variable, value) {
|
|
55
|
-
_reactDom["default"].findDOMNode(element).style.setProperty(variable, value); // eslint-disable-line react/no-find-dom-node
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* An unstyled base component for a scroll bar. It is used in {@link ui/Scrollable.Scrollable|Scrollable}.
|
|
60
|
-
*
|
|
61
|
-
* @class ScrollbarBase
|
|
62
|
-
* @memberof ui/Scrollable
|
|
63
|
-
* @ui
|
|
64
|
-
* @private
|
|
65
|
-
*/
|
|
66
|
-
var ScrollbarBase = exports.ScrollbarBase = /*#__PURE__*/function (_PureComponent) {
|
|
67
|
-
_inherits(ScrollbarBase, _PureComponent);
|
|
68
|
-
var _super = _createSuper(ScrollbarBase);
|
|
69
|
-
function ScrollbarBase(props) {
|
|
70
|
-
var _this;
|
|
71
|
-
_classCallCheck(this, ScrollbarBase);
|
|
72
|
-
_this = _super.call(this, props);
|
|
73
|
-
_this.minThumbSizeRatio = 0;
|
|
74
|
-
_this.ignoreMode = false;
|
|
75
|
-
_this.update = function (bounds) {
|
|
76
|
-
var vertical = _this.props.vertical,
|
|
77
|
-
clientWidth = bounds.clientWidth,
|
|
78
|
-
clientHeight = bounds.clientHeight,
|
|
79
|
-
scrollWidth = bounds.scrollWidth,
|
|
80
|
-
scrollHeight = bounds.scrollHeight,
|
|
81
|
-
scrollLeft = bounds.scrollLeft,
|
|
82
|
-
scrollTop = bounds.scrollTop,
|
|
83
|
-
clientSize = vertical ? clientHeight : clientWidth,
|
|
84
|
-
scrollSize = vertical ? scrollHeight : scrollWidth,
|
|
85
|
-
scrollOrigin = vertical ? scrollTop : scrollLeft,
|
|
86
|
-
thumbSizeRatioBase = clientSize / scrollSize,
|
|
87
|
-
scrollThumbPositionRatio = scrollOrigin / (scrollSize - clientSize),
|
|
88
|
-
scrollThumbSizeRatio = Math.max(_this.minThumbSizeRatio, Math.min(1, thumbSizeRatioBase));
|
|
89
|
-
setCSSVariable(_this.thumbRef.current, '--scrollbar-size-ratio', scrollThumbSizeRatio);
|
|
90
|
-
setCSSVariable(_this.thumbRef.current, '--scrollbar-progress-ratio', scrollThumbPositionRatio);
|
|
91
|
-
};
|
|
92
|
-
_this.showThumb = function () {
|
|
93
|
-
_this.hideThumbJob.stop();
|
|
94
|
-
_reactDom["default"].findDOMNode(_this.thumbRef.current).classList.add(_this.props.css.thumbShown); // eslint-disable-line react/no-find-dom-node
|
|
95
|
-
};
|
|
96
|
-
_this.startHidingThumb = function () {
|
|
97
|
-
_this.hideThumbJob.start();
|
|
98
|
-
};
|
|
99
|
-
_this.hideThumb = function () {
|
|
100
|
-
_reactDom["default"].findDOMNode(_this.thumbRef.current).classList.remove(_this.props.css.thumbShown); // eslint-disable-line react/no-find-dom-node
|
|
101
|
-
};
|
|
102
|
-
_this.hideThumbJob = new _util.Job(_this.hideThumb.bind(_assertThisInitialized(_this)), thumbHidingDelay);
|
|
103
|
-
_this.calculateMetrics = function () {
|
|
104
|
-
var primaryDimenstion = _this.props.vertical ? 'clientHeight' : 'clientWidth';
|
|
105
|
-
var trackSize;
|
|
106
|
-
if (_this.props.clientSize) {
|
|
107
|
-
trackSize = _this.props.clientSize[primaryDimenstion];
|
|
108
|
-
} else {
|
|
109
|
-
trackSize = _this.containerRef.current[primaryDimenstion];
|
|
110
|
-
}
|
|
111
|
-
_this.minThumbSizeRatio = _resolution["default"].scale(minThumbSize) / trackSize;
|
|
112
|
-
};
|
|
113
|
-
_this.getContainerRef = function () {
|
|
114
|
-
return _this.containerRef;
|
|
115
|
-
};
|
|
116
|
-
_this.containerRef = /*#__PURE__*/(0, _react.createRef)();
|
|
117
|
-
_this.thumbRef = /*#__PURE__*/(0, _react.createRef)();
|
|
118
|
-
return _this;
|
|
119
|
-
}
|
|
120
|
-
_createClass(ScrollbarBase, [{
|
|
121
|
-
key: "componentDidMount",
|
|
122
|
-
value: function componentDidMount() {
|
|
123
|
-
this.calculateMetrics();
|
|
124
|
-
}
|
|
125
|
-
}, {
|
|
126
|
-
key: "componentDidUpdate",
|
|
127
|
-
value: function componentDidUpdate() {
|
|
128
|
-
this.calculateMetrics();
|
|
129
|
-
}
|
|
130
|
-
}, {
|
|
131
|
-
key: "componentWillUnmount",
|
|
132
|
-
value: function componentWillUnmount() {
|
|
133
|
-
this.hideThumbJob.stop();
|
|
134
|
-
}
|
|
135
|
-
}, {
|
|
136
|
-
key: "render",
|
|
137
|
-
value: function render() {
|
|
138
|
-
var _this$props = this.props,
|
|
139
|
-
childRenderer = _this$props.childRenderer,
|
|
140
|
-
className = _this$props.className,
|
|
141
|
-
corner = _this$props.corner,
|
|
142
|
-
css = _this$props.css,
|
|
143
|
-
vertical = _this$props.vertical,
|
|
144
|
-
rest = _objectWithoutProperties(_this$props, _excluded),
|
|
145
|
-
containerClassName = (0, _classnames["default"])(className, css.scrollbar, corner ? css.corner : null, vertical ? css.vertical : css.horizontal);
|
|
146
|
-
delete rest.clientSize;
|
|
147
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({}, rest), {}, {
|
|
148
|
-
className: containerClassName,
|
|
149
|
-
ref: this.containerRef,
|
|
150
|
-
children: childRenderer({
|
|
151
|
-
getContainerRef: this.getContainerRef,
|
|
152
|
-
thumbRef: this.thumbRef
|
|
153
|
-
})
|
|
154
|
-
}));
|
|
155
|
-
}
|
|
156
|
-
}]);
|
|
157
|
-
return ScrollbarBase;
|
|
158
|
-
}(_react.PureComponent);
|
|
159
|
-
/**
|
|
160
|
-
* An unstyled scroll bar. It is used in {@link ui/Scrollable.Scrollable|Scrollable}.
|
|
161
|
-
*
|
|
162
|
-
* @class Scrollbar
|
|
163
|
-
* @memberof ui/Scrollable
|
|
164
|
-
* @ui
|
|
165
|
-
* @private
|
|
166
|
-
*/
|
|
167
|
-
ScrollbarBase.displayName = 'ui:Scrollbar';
|
|
168
|
-
ScrollbarBase.propTypes = /** @lends ui/Scrollable.Scrollbar.prototype */{
|
|
169
|
-
/**
|
|
170
|
-
* The render function for child.
|
|
171
|
-
*
|
|
172
|
-
* @type {Function}
|
|
173
|
-
* @required
|
|
174
|
-
* @private
|
|
175
|
-
*/
|
|
176
|
-
childRenderer: _propTypes["default"].func.isRequired,
|
|
177
|
-
/**
|
|
178
|
-
* Client size of the container; valid values are an object that has `clientWidth` and `clientHeight`.
|
|
179
|
-
*
|
|
180
|
-
* @type {Object}
|
|
181
|
-
* @property {Number} clientHeight The client height of the list.
|
|
182
|
-
* @property {Number} clientWidth The client width of the list.
|
|
183
|
-
* @public
|
|
184
|
-
*/
|
|
185
|
-
clientSize: _propTypes["default"].shape({
|
|
186
|
-
clientHeight: _propTypes["default"].number.isRequired,
|
|
187
|
-
clientWidth: _propTypes["default"].number.isRequired
|
|
188
|
-
}),
|
|
189
|
-
/**
|
|
190
|
-
* If `true`, add the corner between vertical and horizontal scrollbars.
|
|
191
|
-
*
|
|
192
|
-
* @type {Booelan}
|
|
193
|
-
* @default false
|
|
194
|
-
* @public
|
|
195
|
-
*/
|
|
196
|
-
corner: _propTypes["default"].bool,
|
|
197
|
-
/**
|
|
198
|
-
* Customizes the component by mapping the supplied collection of CSS class names to the
|
|
199
|
-
* corresponding internal Elements and states of this component.
|
|
200
|
-
*
|
|
201
|
-
* The following classes are supported:
|
|
202
|
-
*
|
|
203
|
-
* * `scrollbar` - The scrollbar component class
|
|
204
|
-
*
|
|
205
|
-
* @type {Object}
|
|
206
|
-
* @public
|
|
207
|
-
*/
|
|
208
|
-
css: _propTypes["default"].object,
|
|
209
|
-
/**
|
|
210
|
-
* If `true`, the scrollbar will be oriented vertically.
|
|
211
|
-
*
|
|
212
|
-
* @type {Boolean}
|
|
213
|
-
* @default true
|
|
214
|
-
* @public
|
|
215
|
-
*/
|
|
216
|
-
vertical: _propTypes["default"].bool
|
|
217
|
-
};
|
|
218
|
-
ScrollbarBase.defaultProps = {
|
|
219
|
-
childRenderer: nop,
|
|
220
|
-
// eslint-disable-line react/default-props-match-prop-types
|
|
221
|
-
corner: false,
|
|
222
|
-
css: _ScrollbarModule["default"],
|
|
223
|
-
vertical: true
|
|
224
|
-
};
|
|
225
|
-
var Scrollbar = exports.Scrollbar = /*#__PURE__*/function (_Component) {
|
|
226
|
-
_inherits(Scrollbar, _Component);
|
|
227
|
-
var _super2 = _createSuper(Scrollbar);
|
|
228
|
-
function Scrollbar() {
|
|
229
|
-
var _this2;
|
|
230
|
-
_classCallCheck(this, Scrollbar);
|
|
231
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
232
|
-
args[_key] = arguments[_key];
|
|
233
|
-
}
|
|
234
|
-
_this2 = _super2.call.apply(_super2, [this].concat(args));
|
|
235
|
-
_this2.setApi = function (ref) {
|
|
236
|
-
if (ref) {
|
|
237
|
-
var getContainerRef = ref.getContainerRef,
|
|
238
|
-
showThumb = ref.showThumb,
|
|
239
|
-
startHidingThumb = ref.startHidingThumb,
|
|
240
|
-
uiUpdate = ref.update;
|
|
241
|
-
_this2.getContainerRef = getContainerRef;
|
|
242
|
-
_this2.showThumb = showThumb;
|
|
243
|
-
_this2.startHidingThumb = startHidingThumb;
|
|
244
|
-
_this2.update = uiUpdate;
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
return _this2;
|
|
248
|
-
}
|
|
249
|
-
_createClass(Scrollbar, [{
|
|
250
|
-
key: "render",
|
|
251
|
-
value: function render() {
|
|
252
|
-
var vertical = this.props.vertical;
|
|
253
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ScrollbarBase, _objectSpread(_objectSpread({}, this.props), {}, {
|
|
254
|
-
ref: this.setApi,
|
|
255
|
-
childRenderer: function childRenderer(_ref) {
|
|
256
|
-
var thumbRef = _ref.thumbRef;
|
|
257
|
-
// eslint-disable-line react/jsx-no-bind
|
|
258
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScrollThumb["default"], {
|
|
259
|
-
ref: thumbRef,
|
|
260
|
-
vertical: vertical
|
|
261
|
-
}, "thumb");
|
|
262
|
-
}
|
|
263
|
-
}));
|
|
264
|
-
}
|
|
265
|
-
}]);
|
|
266
|
-
return Scrollbar;
|
|
267
|
-
}(_react.Component);
|
|
268
|
-
Scrollbar.propTypes = /** @lends ui/Scrollable.Scrollbar.prototype */{
|
|
269
|
-
/**
|
|
270
|
-
* If `true`, the scrollbar will be oriented vertically.
|
|
271
|
-
*
|
|
272
|
-
* @type {Boolean}
|
|
273
|
-
* @default true
|
|
274
|
-
* @public
|
|
275
|
-
*/
|
|
276
|
-
vertical: _propTypes["default"].bool
|
|
277
|
-
};
|
|
278
|
-
Scrollbar.defaultProps = {
|
|
279
|
-
vertical: true
|
|
280
|
-
};
|
|
281
|
-
var _default = exports["default"] = Scrollbar;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
.scrollbar {
|
|
2
|
-
background: inherit;
|
|
3
|
-
display: flex;
|
|
4
|
-
border-color: transparent;
|
|
5
|
-
visibility: visible;
|
|
6
|
-
opacity: 1;
|
|
7
|
-
flex: none;
|
|
8
|
-
transform: translateZ(0);
|
|
9
|
-
transition: opacity 0.1s linear;
|
|
10
|
-
/* ScrollThumb */
|
|
11
|
-
}
|
|
12
|
-
.scrollbar.vertical {
|
|
13
|
-
flex-direction: column;
|
|
14
|
-
}
|
|
15
|
-
:global(.enact-locale-right-to-left) .scrollbar.horizontal {
|
|
16
|
-
direction: ltr;
|
|
17
|
-
transform: scaleX(-1);
|
|
18
|
-
}
|
|
19
|
-
.scrollbar.corner {
|
|
20
|
-
padding-inline-end: 0.125rem;
|
|
21
|
-
}
|
|
22
|
-
.scrollbar .thumbShown {
|
|
23
|
-
opacity: 1;
|
|
24
|
-
}
|
package/Scrollable/package.json
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
.scroller {
|
|
2
|
-
/* hide native scrollbar */
|
|
3
|
-
scrollbar-width: none;
|
|
4
|
-
will-change: transform;
|
|
5
|
-
/* hide native scrollbar */
|
|
6
|
-
/* NOTE: Needs to be revisited whether it can be replaced with scrollbar-width */
|
|
7
|
-
}
|
|
8
|
-
.scroller::-webkit-scrollbar {
|
|
9
|
-
display: none;
|
|
10
|
-
}
|