react-ui-basics 0.0.207 → 0.0.209

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-ui-basics",
3
- "version": "0.0.207",
3
+ "version": "0.0.209",
4
4
  "description": "",
5
5
  "module": "index.js",
6
6
  "_main": "index.cjs.js",
@@ -22,6 +22,7 @@ const DayRenderer = ({day, selected, minDate, onClick}: {
22
22
  )}
23
23
  onClick={e => {
24
24
  preventDefault(e);
25
+ stopPropagation(e)
25
26
  if (minDate && (day.isBefore(minDate) && !day.isSameDate(minDate))) return;
26
27
 
27
28
  onClick(day);
package/src/Scrollable.js CHANGED
@@ -22,6 +22,7 @@ import {propsGetter, stateGS, PureComponent, render, componentDidMount, componen
22
22
  export const SCROLLBAR_MODE_HIDDEN = 'hidden';
23
23
  export const SCROLLBAR_MODE_VISIBLE = 'visible';
24
24
  export const SCROLLBAR_MODE_AUTO = 'auto';
25
+ export const SCROLLBAR_RESIZE_DISABLED = 'disabled';
25
26
 
26
27
  let NATIVE_SCROLL_WIDTH = -1;
27
28
  let NATIVE_SCROLL_HEIGHT = -1;
@@ -330,11 +331,21 @@ class Scrollable extends PureComponent {
330
331
  styleOf(thumbH).left = (position * (scrollbarWidth - offsetWidthOf(thumbH))) + 'px';
331
332
  };
332
333
 
333
- initTimeout = setTimeout(() => {
334
- resizeInterval = setInterval(() => {
334
+ let update;
335
+ let sbm = scrollBarModeOf(props());
336
+ let hsbm = horizontalScrollBarModeOf(props());
337
+ if (sbm !== SCROLLBAR_RESIZE_DISABLED && !hsbm === SCROLLBAR_RESIZE_DISABLED) {
338
+ update = () => {
335
339
  updateVerticalScrollbar();
336
340
  updateHorizontalScrollbar();
337
- }, 50);
341
+ };
342
+ } else if (sbm !== SCROLLBAR_RESIZE_DISABLED)
343
+ update = updateVerticalScrollbar
344
+ else
345
+ update = updateVerticalScrollbar
346
+
347
+ initTimeout = setTimeout(() => {
348
+ resizeInterval = setInterval(update, 50);
338
349
  }, 200)
339
350
  };
340
351
 
@@ -384,8 +395,8 @@ Scrollable.defaultProps = {
384
395
 
385
396
  if (process.env.NODE_ENV !== 'production') {
386
397
  Scrollable.propTypes = {
387
- scrollBarMode: PropTypes.oneOf([SCROLLBAR_MODE_AUTO, SCROLLBAR_MODE_HIDDEN, SCROLLBAR_MODE_VISIBLE]),
388
- horizontalScrollBarMode: PropTypes.oneOf([SCROLLBAR_MODE_AUTO, SCROLLBAR_MODE_HIDDEN, SCROLLBAR_MODE_VISIBLE]),
398
+ scrollBarMode: PropTypes.oneOf([SCROLLBAR_MODE_AUTO, SCROLLBAR_MODE_HIDDEN, SCROLLBAR_MODE_VISIBLE, SCROLLBAR_RESIZE_DISABLED]),
399
+ horizontalScrollBarMode: PropTypes.oneOf([SCROLLBAR_MODE_AUTO, SCROLLBAR_MODE_HIDDEN, SCROLLBAR_MODE_VISIBLE, SCROLLBAR_RESIZE_DISABLED]),
389
400
  [ReactConstants[5]]: PropTypes.string,
390
401
  style: PropTypes.object,
391
402
  onScrolledToBottom: PropTypes.func,