@councilbox/councilbox-ui 2.0.58 → 2.0.59
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/ScrollbarOld.js +3 -0
- package/dist/build-index.js +7 -7
- package/dist/components/1.Introduction.stories.mdx +579 -67
- package/dist/components/2.Changelog.stories.mdx +1392 -595
- package/dist/components/3.Guide.stories.mdx +570 -216
- package/dist/components/Accordion/Accordion.stories.js +55 -4
- package/dist/components/Alert/Alert.stories.js +50 -0
- package/dist/components/Avatar/Avatar.stories.js +69 -10
- package/dist/components/AvatarGroup/AvatarGroup.stories.js +51 -4
- package/dist/components/Block/Block.stories.js +23 -2
- package/dist/components/Button/Button.stories.js +47 -21
- package/dist/components/ButtonBasic/ButtonBasic.stories.js +80 -27
- package/dist/components/Checkbox/Checkbox.stories.js +73 -4
- package/dist/components/DatePicker/DatePicker.stories.js +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.stories.js +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.stories.js +1 -1
- package/dist/components/DragDrop/DragDrop.stories.js +116 -16
- package/dist/components/DrawerPanel/DrawerPanel.stories.js +227 -1
- package/dist/components/DropDown/DropDown.stories.js +198 -1
- package/dist/components/EnhancedTable/EnhancedTable.stories.js +218 -8
- package/dist/components/FabButton/FabButton.stories.js +102 -1
- package/dist/components/Grid/Grid.stories.js +178 -4
- package/dist/components/Header/Header.stories.js +588 -13
- package/dist/components/IconButton/IconButton.stories.js +167 -2
- package/dist/components/IconButtonSquare/IconButtonSquare.stories.js +172 -2
- package/dist/components/InputAutocomplete/InputAutocomplete.stories.js +174 -13
- package/dist/components/InputPassword/InputPassword.stories.js +114 -4
- package/dist/components/InputText/InputText.stories.js +170 -9
- package/dist/components/InputTextArea/InputTextArea.stories.js +108 -2
- package/dist/components/LoadingSection/LoadingSection.stories.js +45 -3
- package/dist/components/MenuItem/MenuItem.stories.js +92 -7
- package/dist/components/MenuLateralLeft/MenuLateralLeft.stories.js +208 -2
- package/dist/components/MenuLateralRight/MenuLateralRight.stories.js +193 -2
- package/dist/components/Modal/Modal.stories.js +181 -19
- package/dist/components/PaginationFooter/PaginationFooter.stories.js +148 -5
- package/dist/components/RadioButton/Radio.stories.js +104 -4
- package/dist/components/RichTextInput/DesignRichTextInput.stories.js +7 -1
- package/dist/components/RichTextInput/RichTextInput.stories.js +5 -0
- package/dist/components/Ripple/Ripple.stories.js +72 -4
- package/dist/components/Scrollbar/Scrollbar.css +60 -19
- package/dist/components/Scrollbar/Scrollbar.js +386 -62
- package/dist/components/Scrollbar/Scrollbar.stories.js +5 -0
- package/dist/components/ScrollbarOld/DesignScrollbarOld.js +24 -0
- package/dist/components/ScrollbarOld/ScrollbarOld.css +38 -0
- package/dist/components/ScrollbarOld/ScrollbarOld.js +104 -0
- package/dist/components/ScrollbarOld/ScrollbarOld.stories.js +140 -0
- package/dist/components/SelectInput/SelectInput.stories.js +139 -8
- package/dist/components/Slider/Slider.stories.js +94 -3
- package/dist/components/Spacing/Spacing.stories.js +6 -1
- package/dist/components/Stars/Stars.stories.js +104 -3
- package/dist/components/Stepper/Stepper.stories.js +91 -1
- package/dist/components/Table/Table.stories.js +171 -9
- package/dist/components/Tabs/Tabs.stories.js +122 -3
- package/dist/components/Tag/Tag.stories.js +105 -2
- package/dist/components/TextInput/TextInput.stories.js +92 -4
- package/dist/components/TimePicker/TimePicker.stories.js +1 -1
- package/dist/components/Timeline/Timeline.stories.js +93 -2
- package/dist/components/Toast/Toast.stories.js +6 -0
- package/dist/components/Toggle/Toggle.stories.js +80 -4
- package/dist/components/Tooltip/Tooltip.stories.js +105 -3
- package/dist/components/Typography/Typography.stories.js +51 -10
- package/package.json +5 -5
- package/IconFont.js +0 -3
- package/dist/components/IconFont/IconFont.css +0 -0
- package/dist/components/IconFont/IconFont.js +0 -86
- package/dist/components/IconFont/IconFont.stories.js +0 -36
- package/dist/fonts/IconNames.json +0 -6848
|
@@ -6,14 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports["default"] = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
10
|
require("../../styles/main.css");
|
|
10
11
|
require("./Scrollbar.css");
|
|
11
|
-
var _reactCustomScrollbars = require("react-custom-scrollbars-2");
|
|
12
|
-
var _getScrollbarWidth = _interopRequireDefault(require("react-custom-scrollbars-2/lib/utils/getScrollbarWidth"));
|
|
13
12
|
var _useDynamicStyles2 = _interopRequireDefault(require("../../HOCs/useDynamicStyles"));
|
|
14
13
|
var _excluded = ["prefixClass"];
|
|
15
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
16
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, _extends.apply(null, arguments); }
|
|
17
15
|
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; }
|
|
18
16
|
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; }
|
|
19
17
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -21,6 +19,37 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
21
19
|
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); }
|
|
22
20
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) { o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } } return i; }
|
|
23
21
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) { if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } } return t; }
|
|
22
|
+
var THUMB_MIN_SIZE = 30;
|
|
23
|
+
var AUTO_HIDE_TIMEOUT = 1000;
|
|
24
|
+
var SCROLL_STOP_DELAY = 100;
|
|
25
|
+
var TRACK_FADE_DURATION = 200;
|
|
26
|
+
var INTERACTIVE_SELECTOR = ['input', 'select', 'textarea', 'button', '[role="listbox"]', '[role="option"]', '[role="combobox"]', '[role="slider"]', '[role="tablist"]', '[role="tab"]', '[contenteditable="true"]'].join(', ');
|
|
27
|
+
var clampThumbSize = function clampThumbSize(trackSize, contentRatio) {
|
|
28
|
+
var proportionalSize = Math.ceil(contentRatio * trackSize);
|
|
29
|
+
return Math.min(trackSize, Math.max(proportionalSize, THUMB_MIN_SIZE));
|
|
30
|
+
};
|
|
31
|
+
var EMPTY_AXIS_GEOMETRY = {
|
|
32
|
+
size: 0,
|
|
33
|
+
offset: 0,
|
|
34
|
+
visible: false
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// Same measurement react-custom-scrollbars-2 uses: on systems with overlay/0-width
|
|
38
|
+
// native scrollbars (macOS trackpad default, some modern Chrome setups), this is 0 -
|
|
39
|
+
// and the library shows no custom thumb at all there, relying on the native overlay.
|
|
40
|
+
// We replicate that exactly instead of always drawing our own thumb.
|
|
41
|
+
var cachedScrollbarWidth = null;
|
|
42
|
+
var getScrollbarWidth = function getScrollbarWidth() {
|
|
43
|
+
var useCache = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
44
|
+
if (useCache && cachedScrollbarWidth !== null) return cachedScrollbarWidth;
|
|
45
|
+
if (typeof document === 'undefined') return 0;
|
|
46
|
+
var div = document.createElement('div');
|
|
47
|
+
div.style.cssText = 'width:100px;height:100px;position:absolute;top:-9999px;overflow:scroll;-ms-overflow-style:scrollbar;';
|
|
48
|
+
document.body.appendChild(div);
|
|
49
|
+
cachedScrollbarWidth = div.offsetWidth - div.clientWidth;
|
|
50
|
+
document.body.removeChild(div);
|
|
51
|
+
return cachedScrollbarWidth;
|
|
52
|
+
};
|
|
24
53
|
var Scrollbar = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
25
54
|
var propPrefixClass = _ref.prefixClass,
|
|
26
55
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -28,77 +57,372 @@ var Scrollbar = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
28
57
|
stylesInLine = _useDynamicStyles.stylesInLine,
|
|
29
58
|
dynamicPrefixClass = _useDynamicStyles.prefixClass;
|
|
30
59
|
var prefixClass = propPrefixClass || dynamicPrefixClass;
|
|
31
|
-
var
|
|
60
|
+
var style = props.style,
|
|
61
|
+
autoHide = props.autoHide,
|
|
62
|
+
children = props.children,
|
|
63
|
+
showX = props.showX,
|
|
64
|
+
onScrollStop = props.onScrollStop,
|
|
65
|
+
classFixProp = props.classFix,
|
|
66
|
+
_props$horizontalScro = props.horizontalScroll,
|
|
67
|
+
horizontalScroll = _props$horizontalScro === void 0 ? false : _props$horizontalScro;
|
|
68
|
+
|
|
69
|
+
// Consumers often pass `isMobile && 'ScrollbarMobile'`, which yields false/null instead of a string
|
|
70
|
+
var classFix = typeof classFixProp === 'string' ? classFixProp : '';
|
|
71
|
+
var isMobileMode = classFix.split(' ').filter(Boolean).includes('ScrollbarMobile');
|
|
72
|
+
var showHorizontalThumb = horizontalScroll && showX && !isMobileMode;
|
|
73
|
+
var viewRef = _react["default"].useRef(null);
|
|
74
|
+
var trackVerticalRef = _react["default"].useRef(null);
|
|
75
|
+
var trackHorizontalRef = _react["default"].useRef(null);
|
|
76
|
+
var thumbVerticalRef = _react["default"].useRef(null);
|
|
77
|
+
var thumbHorizontalRef = _react["default"].useRef(null);
|
|
78
|
+
var dragStateRef = _react["default"].useRef(null);
|
|
79
|
+
var trackMouseOverRef = _react["default"].useRef(false);
|
|
80
|
+
var scrollStopTimerRef = _react["default"].useRef(null);
|
|
81
|
+
var hideTracksTimerRef = _react["default"].useRef(null);
|
|
82
|
+
var geometryRef = _react["default"].useRef({
|
|
83
|
+
vertical: EMPTY_AXIS_GEOMETRY,
|
|
84
|
+
horizontal: EMPTY_AXIS_GEOMETRY
|
|
85
|
+
});
|
|
86
|
+
var tracksVisibleRef = _react["default"].useRef(true);
|
|
87
|
+
var hasNativeScrollbarRef = _react["default"].useRef(getScrollbarWidth() > 0);
|
|
88
|
+
var isCustomTrackHidden = _react["default"].useCallback(function () {
|
|
89
|
+
return isMobileMode || !hasNativeScrollbarRef.current;
|
|
90
|
+
}, [isMobileMode]);
|
|
91
|
+
|
|
92
|
+
// Thumb size/offset and track opacity are mutated directly on the DOM (like the
|
|
93
|
+
// original library's own dom-css updates) instead of through setState, since this
|
|
94
|
+
// runs on every scroll/resize frame and must never trigger a React re-render.
|
|
95
|
+
var applyTrackStyles = _react["default"].useCallback(function () {
|
|
96
|
+
var _geometryRef$current = geometryRef.current,
|
|
97
|
+
vertical = _geometryRef$current.vertical,
|
|
98
|
+
horizontal = _geometryRef$current.horizontal;
|
|
99
|
+
var showTracks = tracksVisibleRef.current;
|
|
100
|
+
var display = isCustomTrackHidden() ? 'none' : '';
|
|
101
|
+
if (thumbVerticalRef.current) {
|
|
102
|
+
thumbVerticalRef.current.style.height = "".concat(vertical.size, "px");
|
|
103
|
+
thumbVerticalRef.current.style.transform = "translateY(".concat(vertical.offset, "px)");
|
|
104
|
+
}
|
|
105
|
+
if (trackVerticalRef.current) {
|
|
106
|
+
trackVerticalRef.current.style.display = display;
|
|
107
|
+
trackVerticalRef.current.style.opacity = vertical.visible && showTracks ? '1' : '0';
|
|
108
|
+
trackVerticalRef.current.style.pointerEvents = vertical.visible ? 'auto' : 'none';
|
|
109
|
+
}
|
|
110
|
+
if (thumbHorizontalRef.current) {
|
|
111
|
+
thumbHorizontalRef.current.style.width = "".concat(horizontal.size, "px");
|
|
112
|
+
thumbHorizontalRef.current.style.transform = "translateX(".concat(horizontal.offset, "px)");
|
|
113
|
+
}
|
|
114
|
+
if (trackHorizontalRef.current) {
|
|
115
|
+
trackHorizontalRef.current.style.display = display;
|
|
116
|
+
trackHorizontalRef.current.style.opacity = horizontal.visible && showTracks ? '1' : '0';
|
|
117
|
+
trackHorizontalRef.current.style.pointerEvents = horizontal.visible ? 'auto' : 'none';
|
|
118
|
+
}
|
|
119
|
+
}, [isCustomTrackHidden]);
|
|
120
|
+
var setTracksVisibility = _react["default"].useCallback(function (visible) {
|
|
121
|
+
tracksVisibleRef.current = visible;
|
|
122
|
+
applyTrackStyles();
|
|
123
|
+
}, [applyTrackStyles]);
|
|
124
|
+
var updateThumbs = _react["default"].useCallback(function () {
|
|
125
|
+
var view = viewRef.current;
|
|
126
|
+
if (!view || isCustomTrackHidden()) return;
|
|
127
|
+
var scrollTop = view.scrollTop,
|
|
128
|
+
scrollHeight = view.scrollHeight,
|
|
129
|
+
clientHeight = view.clientHeight,
|
|
130
|
+
scrollLeft = view.scrollLeft,
|
|
131
|
+
scrollWidth = view.scrollWidth,
|
|
132
|
+
clientWidth = view.clientWidth;
|
|
133
|
+
var trackVerticalSize = trackVerticalRef.current ? trackVerticalRef.current.clientHeight : 0;
|
|
134
|
+
var trackHorizontalSize = trackHorizontalRef.current ? trackHorizontalRef.current.clientWidth : 0;
|
|
135
|
+
var verticalNeeded = scrollHeight > clientHeight + 1;
|
|
136
|
+
var horizontalNeeded = showHorizontalThumb && scrollWidth > clientWidth + 1;
|
|
137
|
+
var verticalThumbSize = trackVerticalSize ? clampThumbSize(trackVerticalSize, clientHeight / scrollHeight) : 0;
|
|
138
|
+
var verticalOffset = verticalNeeded ? scrollTop / (scrollHeight - clientHeight) * (trackVerticalSize - verticalThumbSize) : 0;
|
|
139
|
+
var horizontalThumbSize = trackHorizontalSize ? clampThumbSize(trackHorizontalSize, clientWidth / scrollWidth) : 0;
|
|
140
|
+
var horizontalOffset = horizontalNeeded ? scrollLeft / (scrollWidth - clientWidth) * (trackHorizontalSize - horizontalThumbSize) : 0;
|
|
141
|
+
geometryRef.current = {
|
|
142
|
+
vertical: {
|
|
143
|
+
size: verticalThumbSize,
|
|
144
|
+
offset: verticalOffset,
|
|
145
|
+
visible: verticalNeeded
|
|
146
|
+
},
|
|
147
|
+
horizontal: {
|
|
148
|
+
size: horizontalThumbSize,
|
|
149
|
+
offset: horizontalOffset,
|
|
150
|
+
visible: horizontalNeeded
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
applyTrackStyles();
|
|
154
|
+
}, [isCustomTrackHidden, showHorizontalThumb, applyTrackStyles]);
|
|
155
|
+
var showTracksNow = _react["default"].useCallback(function () {
|
|
156
|
+
clearTimeout(hideTracksTimerRef.current);
|
|
157
|
+
setTracksVisibility(true);
|
|
158
|
+
}, [setTracksVisibility]);
|
|
159
|
+
var scheduleHideTracks = _react["default"].useCallback(function () {
|
|
160
|
+
if (!autoHide) return;
|
|
161
|
+
if (dragStateRef.current || trackMouseOverRef.current) return;
|
|
162
|
+
clearTimeout(hideTracksTimerRef.current);
|
|
163
|
+
hideTracksTimerRef.current = setTimeout(function () {
|
|
164
|
+
return setTracksVisibility(false);
|
|
165
|
+
}, AUTO_HIDE_TIMEOUT);
|
|
166
|
+
}, [autoHide, setTracksVisibility]);
|
|
167
|
+
var rafIdRef = _react["default"].useRef(null);
|
|
168
|
+
|
|
169
|
+
// The library coalesces scroll/resize-driven updates into a single rAF (cancelling
|
|
170
|
+
// any pending frame first) so a burst of scroll events only recomputes once per
|
|
171
|
+
// paint. Prop/content-driven updates (below, in useLayoutEffect) stay synchronous
|
|
172
|
+
// so there's never a stale-thumb flash right after mount or a re-render.
|
|
173
|
+
var scheduleUpdateThumbs = _react["default"].useCallback(function () {
|
|
174
|
+
if (rafIdRef.current !== null) cancelAnimationFrame(rafIdRef.current);
|
|
175
|
+
rafIdRef.current = requestAnimationFrame(function () {
|
|
176
|
+
rafIdRef.current = null;
|
|
177
|
+
updateThumbs();
|
|
178
|
+
});
|
|
179
|
+
}, [updateThumbs]);
|
|
180
|
+
var handleScroll = _react["default"].useCallback(function () {
|
|
181
|
+
scheduleUpdateThumbs();
|
|
182
|
+
if (autoHide) showTracksNow();
|
|
183
|
+
clearTimeout(scrollStopTimerRef.current);
|
|
184
|
+
scrollStopTimerRef.current = setTimeout(function () {
|
|
185
|
+
onScrollStop === null || onScrollStop === void 0 ? void 0 : onScrollStop();
|
|
186
|
+
scheduleHideTracks();
|
|
187
|
+
}, SCROLL_STOP_DELAY);
|
|
188
|
+
}, [scheduleUpdateThumbs, autoHide, showTracksNow, onScrollStop, scheduleHideTracks]);
|
|
189
|
+
_react["default"].useLayoutEffect(function () {
|
|
190
|
+
updateThumbs();
|
|
191
|
+
});
|
|
192
|
+
_react["default"].useEffect(function () {
|
|
193
|
+
if (!autoHide) {
|
|
194
|
+
setTracksVisibility(true);
|
|
195
|
+
} else {
|
|
196
|
+
scheduleHideTracks();
|
|
197
|
+
}
|
|
198
|
+
}, [autoHide, scheduleHideTracks, setTracksVisibility]);
|
|
199
|
+
_react["default"].useEffect(function () {
|
|
200
|
+
var view = viewRef.current;
|
|
201
|
+
if (!view || typeof ResizeObserver === 'undefined') return undefined;
|
|
202
|
+
var observer = new ResizeObserver(function () {
|
|
203
|
+
return scheduleUpdateThumbs();
|
|
204
|
+
});
|
|
205
|
+
observer.observe(view);
|
|
206
|
+
if (view.firstElementChild) observer.observe(view.firstElementChild);
|
|
207
|
+
var handleWindowResize = function handleWindowResize() {
|
|
208
|
+
hasNativeScrollbarRef.current = getScrollbarWidth(false) > 0;
|
|
209
|
+
scheduleUpdateThumbs();
|
|
210
|
+
applyTrackStyles();
|
|
211
|
+
};
|
|
212
|
+
window.addEventListener('resize', handleWindowResize);
|
|
213
|
+
return function () {
|
|
214
|
+
observer.disconnect();
|
|
215
|
+
window.removeEventListener('resize', handleWindowResize);
|
|
216
|
+
};
|
|
217
|
+
}, [scheduleUpdateThumbs, applyTrackStyles]);
|
|
218
|
+
_react["default"].useEffect(function () {
|
|
219
|
+
return function () {
|
|
220
|
+
clearTimeout(scrollStopTimerRef.current);
|
|
221
|
+
clearTimeout(hideTracksTimerRef.current);
|
|
222
|
+
if (rafIdRef.current !== null) cancelAnimationFrame(rafIdRef.current);
|
|
223
|
+
};
|
|
224
|
+
}, []);
|
|
225
|
+
var startDrag = _react["default"].useCallback(function (axis, event) {
|
|
226
|
+
event.preventDefault();
|
|
227
|
+
event.stopPropagation();
|
|
228
|
+
var view = viewRef.current;
|
|
229
|
+
if (!view) return;
|
|
230
|
+
dragStateRef.current = {
|
|
231
|
+
axis: axis,
|
|
232
|
+
startClient: axis === 'vertical' ? event.clientY : event.clientX,
|
|
233
|
+
startScroll: axis === 'vertical' ? view.scrollTop : view.scrollLeft,
|
|
234
|
+
trackSize: axis === 'vertical' ? trackVerticalRef.current.clientHeight : trackHorizontalRef.current.clientWidth,
|
|
235
|
+
thumbSize: axis === 'vertical' ? geometryRef.current.vertical.size : geometryRef.current.horizontal.size
|
|
236
|
+
};
|
|
237
|
+
document.body.style.userSelect = 'none';
|
|
238
|
+
showTracksNow();
|
|
239
|
+
var handleMouseMove = function handleMouseMove(moveEvent) {
|
|
240
|
+
var drag = dragStateRef.current;
|
|
241
|
+
if (!drag) return;
|
|
242
|
+
var trackRange = drag.trackSize - drag.thumbSize;
|
|
243
|
+
if (trackRange <= 0) return;
|
|
244
|
+
var client = drag.axis === 'vertical' ? moveEvent.clientY : moveEvent.clientX;
|
|
245
|
+
var delta = client - drag.startClient;
|
|
246
|
+
if (drag.axis === 'vertical') {
|
|
247
|
+
var scrollable = view.scrollHeight - view.clientHeight;
|
|
248
|
+
view.scrollTop = drag.startScroll + delta / trackRange * scrollable;
|
|
249
|
+
} else {
|
|
250
|
+
var _scrollable = view.scrollWidth - view.clientWidth;
|
|
251
|
+
view.scrollLeft = drag.startScroll + delta / trackRange * _scrollable;
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
var handleMouseUp = function handleMouseUp() {
|
|
255
|
+
dragStateRef.current = null;
|
|
256
|
+
document.body.style.userSelect = '';
|
|
257
|
+
document.removeEventListener('mousemove', handleMouseMove);
|
|
258
|
+
document.removeEventListener('mouseup', handleMouseUp);
|
|
259
|
+
scheduleHideTracks();
|
|
260
|
+
};
|
|
261
|
+
document.addEventListener('mousemove', handleMouseMove);
|
|
262
|
+
document.addEventListener('mouseup', handleMouseUp);
|
|
263
|
+
}, [showTracksNow, scheduleHideTracks]);
|
|
264
|
+
var handleTrackMouseDown = _react["default"].useCallback(function (axis, event) {
|
|
265
|
+
var thumbEl = axis === 'vertical' ? thumbVerticalRef.current : thumbHorizontalRef.current;
|
|
266
|
+
if (event.target === thumbEl) return;
|
|
267
|
+
var view = viewRef.current;
|
|
268
|
+
var trackEl = axis === 'vertical' ? trackVerticalRef.current : trackHorizontalRef.current;
|
|
269
|
+
if (!view || !trackEl) return;
|
|
270
|
+
var rect = trackEl.getBoundingClientRect();
|
|
271
|
+
var thumbSize = axis === 'vertical' ? geometryRef.current.vertical.size : geometryRef.current.horizontal.size;
|
|
272
|
+
var trackSize = axis === 'vertical' ? trackEl.clientHeight : trackEl.clientWidth;
|
|
273
|
+
var trackRange = trackSize - thumbSize;
|
|
274
|
+
if (trackRange <= 0) return;
|
|
275
|
+
var clickOffset = axis === 'vertical' ? event.clientY - rect.top : event.clientX - rect.left;
|
|
276
|
+
var ratio = Math.min(Math.max((clickOffset - thumbSize / 2) / trackRange, 0), 1);
|
|
277
|
+
if (axis === 'vertical') {
|
|
278
|
+
view.scrollTop = ratio * (view.scrollHeight - view.clientHeight);
|
|
279
|
+
} else {
|
|
280
|
+
view.scrollLeft = ratio * (view.scrollWidth - view.clientWidth);
|
|
281
|
+
}
|
|
282
|
+
}, []);
|
|
283
|
+
var handleTrackMouseEnter = _react["default"].useCallback(function () {
|
|
284
|
+
trackMouseOverRef.current = true;
|
|
285
|
+
showTracksNow();
|
|
286
|
+
}, [showTracksNow]);
|
|
287
|
+
var handleTrackMouseLeave = _react["default"].useCallback(function () {
|
|
288
|
+
trackMouseOverRef.current = false;
|
|
289
|
+
scheduleHideTracks();
|
|
290
|
+
}, [scheduleHideTracks]);
|
|
291
|
+
var handleKeyUpToScroll = _react["default"].useCallback(function (e) {
|
|
292
|
+
var target = e.target;
|
|
293
|
+
if (target.closest(INTERACTIVE_SELECTOR)) return;
|
|
294
|
+
if (!viewRef.current) return;
|
|
295
|
+
if (e.key === 'ArrowDown') viewRef.current.scrollTop = viewRef.current.scrollHeight;
|
|
296
|
+
if (e.key === 'ArrowUp') viewRef.current.scrollTop = 0;
|
|
297
|
+
}, []);
|
|
32
298
|
_react["default"].useImperativeHandle(ref, function () {
|
|
33
299
|
return {
|
|
34
300
|
scrollToBottom: function scrollToBottom() {
|
|
35
|
-
|
|
301
|
+
if (viewRef.current) viewRef.current.scrollTop = viewRef.current.scrollHeight;
|
|
36
302
|
},
|
|
37
303
|
scrollToTop: function scrollToTop() {
|
|
38
|
-
|
|
304
|
+
if (viewRef.current) viewRef.current.scrollTop = 0;
|
|
305
|
+
},
|
|
306
|
+
scrollToLeft: function scrollToLeft() {
|
|
307
|
+
if (viewRef.current) viewRef.current.scrollLeft = 0;
|
|
308
|
+
},
|
|
309
|
+
scrollToRight: function scrollToRight() {
|
|
310
|
+
if (viewRef.current) viewRef.current.scrollLeft = viewRef.current.scrollWidth;
|
|
39
311
|
},
|
|
40
312
|
getScrollHeight: function getScrollHeight() {
|
|
41
|
-
return
|
|
313
|
+
return viewRef.current ? viewRef.current.scrollHeight : 0;
|
|
314
|
+
},
|
|
315
|
+
getScrollTop: function getScrollTop() {
|
|
316
|
+
return viewRef.current ? viewRef.current.scrollTop : 0;
|
|
317
|
+
},
|
|
318
|
+
getScrollLeft: function getScrollLeft() {
|
|
319
|
+
return viewRef.current ? viewRef.current.scrollLeft : 0;
|
|
320
|
+
},
|
|
321
|
+
getScrollWidth: function getScrollWidth() {
|
|
322
|
+
return viewRef.current ? viewRef.current.scrollWidth : 0;
|
|
323
|
+
},
|
|
324
|
+
getClientHeight: function getClientHeight() {
|
|
325
|
+
return viewRef.current ? viewRef.current.clientHeight : 0;
|
|
326
|
+
},
|
|
327
|
+
getClientWidth: function getClientWidth() {
|
|
328
|
+
return viewRef.current ? viewRef.current.clientWidth : 0;
|
|
42
329
|
},
|
|
43
330
|
getValues: function getValues() {
|
|
44
|
-
|
|
331
|
+
var view = viewRef.current;
|
|
332
|
+
if (!view) {
|
|
333
|
+
return {
|
|
334
|
+
top: 0,
|
|
335
|
+
left: 0,
|
|
336
|
+
scrollTop: 0,
|
|
337
|
+
scrollLeft: 0,
|
|
338
|
+
scrollWidth: 0,
|
|
339
|
+
scrollHeight: 0,
|
|
340
|
+
clientWidth: 0,
|
|
341
|
+
clientHeight: 0 // eslint-disable-line max-len
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
var scrollTop = view.scrollTop,
|
|
345
|
+
scrollLeft = view.scrollLeft,
|
|
346
|
+
scrollWidth = view.scrollWidth,
|
|
347
|
+
scrollHeight = view.scrollHeight,
|
|
348
|
+
clientWidth = view.clientWidth,
|
|
349
|
+
clientHeight = view.clientHeight;
|
|
350
|
+
return {
|
|
351
|
+
left: scrollLeft / (scrollWidth - clientWidth) || 0,
|
|
352
|
+
top: scrollTop / (scrollHeight - clientHeight) || 0,
|
|
353
|
+
scrollTop: scrollTop,
|
|
354
|
+
scrollLeft: scrollLeft,
|
|
355
|
+
scrollWidth: scrollWidth,
|
|
356
|
+
scrollHeight: scrollHeight,
|
|
357
|
+
clientWidth: clientWidth,
|
|
358
|
+
clientHeight: clientHeight
|
|
359
|
+
};
|
|
45
360
|
}
|
|
46
361
|
};
|
|
47
362
|
}, []);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
} : {}), children);
|
|
363
|
+
return (
|
|
364
|
+
/*#__PURE__*/
|
|
365
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
366
|
+
_react["default"].createElement("div", {
|
|
367
|
+
className: prefixClass("Scrollbar ".concat(classFix, " ").concat(horizontalScroll ? 'scrollbarBoth' : 'scrollbarOnlyY', " scrollbarFixHeight")),
|
|
368
|
+
style: _objectSpread(_objectSpread({
|
|
369
|
+
position: 'relative',
|
|
370
|
+
overflow: 'hidden',
|
|
371
|
+
width: '100%',
|
|
372
|
+
height: '100%'
|
|
373
|
+
}, style), stylesInLine),
|
|
374
|
+
onKeyDown: handleKeyUpToScroll
|
|
375
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
376
|
+
ref: viewRef,
|
|
377
|
+
className: prefixClass('cbx-scrollbarNew-view'),
|
|
378
|
+
onScroll: handleScroll
|
|
379
|
+
}, children), /*#__PURE__*/_react["default"].createElement("div", {
|
|
380
|
+
ref: trackHorizontalRef,
|
|
381
|
+
className: prefixClass('cbx-scrollbarNew-trackHorizontal'),
|
|
382
|
+
style: {
|
|
383
|
+
transitionDuration: autoHide ? "".concat(TRACK_FADE_DURATION, "ms") : '0ms'
|
|
384
|
+
},
|
|
385
|
+
onMouseEnter: handleTrackMouseEnter,
|
|
386
|
+
onMouseLeave: handleTrackMouseLeave,
|
|
387
|
+
onMouseDown: function onMouseDown(e) {
|
|
388
|
+
return handleTrackMouseDown('horizontal', e);
|
|
389
|
+
}
|
|
390
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
391
|
+
ref: thumbHorizontalRef,
|
|
392
|
+
className: prefixClass('cbx-scrollbarNew-thumbHorizontal'),
|
|
393
|
+
onMouseDown: function onMouseDown(e) {
|
|
394
|
+
return startDrag('horizontal', e);
|
|
395
|
+
}
|
|
396
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
397
|
+
ref: trackVerticalRef,
|
|
398
|
+
className: prefixClass('cbx-scrollbarNew-trackVertical'),
|
|
399
|
+
style: {
|
|
400
|
+
transitionDuration: autoHide ? "".concat(TRACK_FADE_DURATION, "ms") : '0ms'
|
|
401
|
+
},
|
|
402
|
+
onMouseEnter: handleTrackMouseEnter,
|
|
403
|
+
onMouseLeave: handleTrackMouseLeave,
|
|
404
|
+
onMouseDown: function onMouseDown(e) {
|
|
405
|
+
return handleTrackMouseDown('vertical', e);
|
|
406
|
+
}
|
|
407
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
408
|
+
ref: thumbVerticalRef,
|
|
409
|
+
className: prefixClass('cbx-scrollbarNew-thumbVertical'),
|
|
410
|
+
onMouseDown: function onMouseDown(e) {
|
|
411
|
+
return startDrag('vertical', e);
|
|
412
|
+
}
|
|
413
|
+
})))
|
|
414
|
+
);
|
|
102
415
|
});
|
|
416
|
+
Scrollbar.propTypes = {
|
|
417
|
+
style: _propTypes["default"].object,
|
|
418
|
+
sx: _propTypes["default"].object,
|
|
419
|
+
autoHide: _propTypes["default"].bool,
|
|
420
|
+
showX: _propTypes["default"].bool,
|
|
421
|
+
horizontalScroll: _propTypes["default"].bool,
|
|
422
|
+
classFix: _propTypes["default"].string,
|
|
423
|
+
onScrollStop: _propTypes["default"].func,
|
|
424
|
+
prefixClass: _propTypes["default"].func,
|
|
425
|
+
children: _propTypes["default"].node
|
|
426
|
+
};
|
|
103
427
|
var _default = Scrollbar;
|
|
104
428
|
exports["default"] = _default;
|
|
@@ -13,6 +13,11 @@ var _default = {
|
|
|
13
13
|
component: _Scrollbar["default"],
|
|
14
14
|
argTypes: {},
|
|
15
15
|
parameters: {
|
|
16
|
+
docs: {
|
|
17
|
+
description: {
|
|
18
|
+
component: "\n## Scrollbar\n\nContenedor con desplazamiento vertical (y opcionalmente horizontal) que sustituye la barra de scroll nativa del sistema por una barra personalizada superpuesta, manteniendo un aspecto homog\xE9neo entre navegadores y sistemas operativos.\n\nEl desplazamiento real lo realiza siempre el navegador sobre un elemento nativo con `overflow: auto` (`cbx-scrollbarNew-view`). Las barras personalizadas solo reflejan visualmente la posici\xF3n y permiten arrastrarla, por lo que se conservan el scroll con rueda, trackpad, gestos t\xE1ctiles y teclado.\n\n## Funcionamiento\n\n### Estructura\n\n- **Vista (`cbx-scrollbarNew-view`)**: contenedor absoluto que ocupa todo el componente y contiene los `children`. Oculta la barra nativa (`scrollbar-width: none` y `::-webkit-scrollbar`).\n- **Pistas y thumbs (`cbx-scrollbarNew-track*` / `cbx-scrollbarNew-thumb*`)**: barras de 6px superpuestas a la derecha (vertical) y abajo (horizontal).\n\n### C\xE1lculo y actualizaci\xF3n\n\n- El tama\xF1o del thumb es proporcional a la relaci\xF3n entre el \xE1rea visible y el contenido total, con un m\xEDnimo de 30px.\n- La posici\xF3n y el tama\xF1o se recalculan:\n - En cada evento `scroll`, agrupado en un \xFAnico `requestAnimationFrame` por fotograma.\n - Cuando cambia el tama\xF1o de la vista o de su contenido (`ResizeObserver`) o de la ventana.\n - De forma s\xEDncrona tras cada render (`useLayoutEffect`), evitando parpadeos al montar o al cambiar el contenido.\n- Los estilos de los thumbs se aplican directamente sobre el DOM, sin `setState`, de modo que el scroll nunca provoca re-renders de React.\n\n### Barras nativas superpuestas y modo m\xF3vil\n\n- Si el sistema usa barras de scroll superpuestas de ancho 0 (por ejemplo, macOS con trackpad), no se dibuja la barra personalizada y se deja la del sistema.\n- Con `classFix` que incluya `ScrollbarMobile` se muestra la barra nativa y se ocultan las pistas personalizadas.\n\n### Interacci\xF3n con rat\xF3n\n\n- **Arrastrar el thumb**: desplaza el contenido de forma proporcional. Durante el arrastre se desactiva la selecci\xF3n de texto.\n- **Clic en la pista**: salta directamente a la posici\xF3n pulsada.\n- **`autoHide`**: las barras se ocultan 1 segundo despu\xE9s de dejar de hacer scroll y reaparecen al desplazar o al pasar el rat\xF3n por la pista.\n\n### Propiedades principales\n\n- `autoHide`: oculta las barras cuando no hay actividad.\n- `horizontalScroll`: habilita el desplazamiento horizontal de la vista.\n- `showX`: muestra la barra horizontal personalizada (requiere `horizontalScroll`).\n- `classFix`: clases adicionales del contenedor (`scrollflex`, `ScrollbarMobile`\u2026). Acepta valores no string, que se ignoran.\n- `onScrollStop`: se ejecuta 100ms despu\xE9s de que termine el desplazamiento.\n- `style` / `sx`: estilos del contenedor.\n\n### API imperativa (`ref`)\n\n- `scrollToTop()`, `scrollToBottom()`, `scrollToLeft()`, `scrollToRight()`.\n- `getScrollTop()`, `getScrollLeft()`, `getScrollHeight()`, `getScrollWidth()`, `getClientHeight()`, `getClientWidth()`.\n- `getValues()`: devuelve `top` y `left` (posici\xF3n relativa de 0 a 1) junto con las medidas absolutas.\n\n## Accesibilidad\n\n### Desplazamiento nativo\n\n- Al delegar el scroll en un elemento nativo, el contenido se expone a los lectores de pantalla exactamente igual que sin el componente.\n- Se mantiene el desplazamiento est\xE1ndar con teclado (**Flechas**, **AvP\xE1g/ReP\xE1g**, **Espacio**, **Inicio/Fin**) cuando el foco est\xE1 dentro del contenido, as\xED como el scroll autom\xE1tico al tabular a elementos fuera de la zona visible.\n\n### Barras personalizadas\n\n- Las pistas y thumbs son elementos puramente visuales para el rat\xF3n: no reciben foco ni exponen `role=\"scrollbar\"`, ya que la sem\xE1ntica de desplazamiento la proporciona el elemento nativo.\n- No interfieren en el orden de tabulaci\xF3n.\n\n### Atajos de teclado\n\n- **Flecha abajo** lleva el contenido al final y **Flecha arriba** al principio.\n- Estos atajos se ignoran cuando la tecla se pulsa dentro de un elemento interactivo (`input`, `select`, `textarea`, `button`, elementos `contenteditable` y roles `listbox`, `option`, `combobox`, `slider`, `tablist` y `tab`), para no romper su navegaci\xF3n propia.\n\n## Recomendaciones de uso\n\n- Definir una altura (directamente o mediante el contenedor padre), ya que la vista se posiciona de forma absoluta y ocupa el 100% del componente.\n- Si el contenido no tiene elementos enfocables, valorar si la zona necesita ser alcanzable por teclado para poder desplazarla.\n- Usar `ScrollbarMobile` en dispositivos t\xE1ctiles para conservar la barra nativa del sistema.\n\n## Consideraciones\n\nEl componente no a\xF1ade atributos ARIA: la accesibilidad del desplazamiento recae en el elemento nativo y las barras personalizadas son solo una capa visual.\nLos atajos de **Flecha arriba/abajo** saltan al inicio o al final del contenido en lugar de desplazar l\xEDnea a l\xEDnea.\n\n## Migraci\xF3n desde el Scrollbar antiguo (react-custom-scrollbars-2)\n\nEl Scrollbar antiguo envolv\xEDa el componente `Scrollbars` de `react-custom-scrollbars-2` (sigue disponible temporalmente como `ScrollbarOld`). El nuevo es una implementaci\xF3n propia sin dependencias que mantiene la misma API, as\xED que en la mayor\xEDa de los casos solo hay que actualizar la librer\xEDa.\n\n### 1. Import\n\nNo cambia: se sigue importando `Scrollbar`.\n\n```jsx\nimport Scrollbar from '@councilbox/councilbox-ui/dist/components/Scrollbar/Scrollbar';\n```\n\nSi alg\xFAn sitio usa `ScrollbarOld`, cambiarlo por `Scrollbar`.\n\n### 2. Props\n\nSe mantienen igual: `autoHide`, `showX`, `horizontalScroll`, `classFix`, `onScrollStop`, `style` y `sx`.\n\n| Antiguo | Nuevo |\n| --- | --- |\n| `classFix=\"scrollflex\"` | Igual |\n| `classFix={isMobile && 'ScrollbarMobile'}` | Igual. Ahora muestra la barra nativa del sistema en lugar de la personalizada |\n| `classFix=\"scrollbarFix\"` / `scrollbarFixHeightIos` | Ya no son necesarias: la barra nativa se oculta sin m\xE1rgenes negativos |\n| Clase `macOSFlexFix` (autom\xE1tica) | Ya no existe ni hace falta |\n\n### 3. M\xE9todos por `ref`\n\nSe mantienen `scrollToTop()`, `scrollToBottom()`, `getScrollHeight()` y `getValues()`, con el mismo resultado. Se a\xF1aden `scrollToLeft()`, `scrollToRight()`, `getScrollTop()`, `getScrollLeft()`, `getScrollWidth()`, `getClientHeight()` y `getClientWidth()`.\n\n### 4. Estructura del DOM y estilos propios\n\nEl orden de los elementos internos es el mismo que en el antiguo, por lo que los selectores por posici\xF3n siguen funcionando:\n\n| Elemento | Selector por posici\xF3n | Clase nueva |\n| --- | --- | --- |\n| Vista con el contenido | `.Scrollbar > div:first-child` | `.cbx-scrollbarNew-view` |\n| Pista horizontal | `.Scrollbar > div:nth-child(2)` | `.cbx-scrollbarNew-trackHorizontal` |\n| Pista vertical | `.Scrollbar > div:last-child` | `.cbx-scrollbarNew-trackVertical` |\n| Thumb | `... > div` dentro de cada pista | `.cbx-scrollbarNew-thumbVertical` / `.cbx-scrollbarNew-thumbHorizontal` |\n\nPara estilos nuevos, usar las clases en lugar de los selectores por posici\xF3n.\n\n### 5. Estilos que hay que revisar\n\n- **M\xE1rgenes negativos**: el antiguo ocultaba la barra nativa desplazando la vista con `margin-right: -17px`. Cualquier regla propia que siga aplicando ese margen a la vista (por ejemplo, `.scrollbarBoth > div:first-child { margin-right: -17px }`) recorta ahora 17px de contenido por la derecha y debe eliminarse.\n- **Ocultar la barra nativa**: reglas como `.Scrollbar > div:first-child::-webkit-scrollbar { display: none }` ya no son necesarias, aunque no causan problemas.\n- **`sx` sobre la vista**: sustituir `'> div:first-child'` por `'.cbx-scrollbarNew-view'`.\n\n### 6. Diferencias de comportamiento\n\n- En sistemas con barras superpuestas de ancho 0 (macOS con trackpad), no se dibuja la barra personalizada y se usa la del sistema, igual que hac\xEDa la librer\xEDa antigua.\n- Las actualizaciones del thumb no provocan re-renders de React, por lo que el scroll en listas grandes es m\xE1s fluido.\n- Tras migrar todos los usos, se puede eliminar la dependencia `react-custom-scrollbars-2`.\n"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
16
21
|
storybookCodePanel: {
|
|
17
22
|
disabled: false,
|
|
18
23
|
files: [{
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _ScrollbarOld = _interopRequireDefault(require("./ScrollbarOld"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
var DesignScrollbarOld = function DesignScrollbarOld() {
|
|
11
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
12
|
+
style: {
|
|
13
|
+
height: '18.75rem'
|
|
14
|
+
}
|
|
15
|
+
}, /*#__PURE__*/_react["default"].createElement(_ScrollbarOld["default"], null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
16
|
+
style: {
|
|
17
|
+
height: '31.25rem',
|
|
18
|
+
background: 'gainsboro'
|
|
19
|
+
}
|
|
20
|
+
}, "Prueba")));
|
|
21
|
+
};
|
|
22
|
+
DesignScrollbarOld.displayName = "DesignScrollbarOld";
|
|
23
|
+
var _default = DesignScrollbarOld;
|
|
24
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.scrollbarFix {
|
|
2
|
+
margin-right: -17px;
|
|
3
|
+
scroll-behavior: smooth;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.Scrollbar>div:first-child {
|
|
7
|
+
scroll-behavior: smooth;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.scrollbarBoth>div:first-child {
|
|
11
|
+
margin-right: -17px !important;
|
|
12
|
+
margin-bottom: -0 !important;
|
|
13
|
+
overflow-x: auto !important;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.scrollbarOnlyY>div:first-child {
|
|
17
|
+
overflow-x: hidden !important;
|
|
18
|
+
margin-right: -17px !important;
|
|
19
|
+
margin-bottom: -0 !important;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.scrollflex>div:first-child {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-grow: 1;
|
|
25
|
+
min-height: 100%;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.scrollbarFixHeight > div > div {
|
|
29
|
+
/* flex-grow: 1; */
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.scrollbarFixHeightIos > div > div {
|
|
33
|
+
padding-bottom: 0!important;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.macOSFlexFix> div > div > div {
|
|
37
|
+
min-height: 100%;
|
|
38
|
+
}
|