ag-common 0.0.389 → 0.0.391

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.
@@ -1,3 +1,4 @@
1
+ /** random number up to max. seed defaults to now.getTime() */
1
2
  export declare function random(max: number, seed?: number): number;
2
3
  /** between 0 and 1. seed defaults to now.getTime() */
3
4
  export declare const randomDecimal: (seed?: number) => number;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.shuffle = exports.randomDecimal = exports.random = void 0;
4
+ /** random number up to max. seed defaults to now.getTime() */
4
5
  function random(max, seed) {
5
6
  seed = seed || new Date().getTime();
6
7
  const ret = (seed * 9301 + 49297) % 233280;
@@ -35,6 +35,9 @@ const Base = styled_1.default.div `
35
35
  overflow-y: auto;
36
36
  height: 100%;
37
37
  width: 100%;
38
+ &[data-no-scroll='true'] {
39
+ overflow-y: initial;
40
+ }
38
41
  `;
39
42
  //if we see this, then we havent shown user enough items - allow click to load more
40
43
  const LoadMore = styled_1.default.div `
@@ -63,7 +66,7 @@ const InfiniteScroll = (p) => {
63
66
  const sliced = p.children.slice(0, endIndex);
64
67
  const lastDisplayIndex = Math.min(p.children.length, endIndex);
65
68
  const renderResultsLine = (_b = p.renderResultsLine) === null || _b === void 0 ? void 0 : _b.call(p, lastDisplayIndex, p.children.length);
66
- return (react_1.default.createElement(Base, Object.assign({ ref: ref, className: p.className, onScroll: (e) => {
69
+ return (react_1.default.createElement(Base, Object.assign({ "data-no-scroll": scrollDisabled, ref: ref, className: p.className, onScroll: (e) => {
67
70
  if (scrollDisabled) {
68
71
  return;
69
72
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ag-common",
3
- "version": "0.0.389",
3
+ "version": "0.0.391",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Andrei Gec <@andreigec> (https://gec.dev/)",
@@ -44,7 +44,7 @@
44
44
  "@storybook/react": "6.5.14",
45
45
  "@storybook/theming": "6.5.14",
46
46
  "@types/jsonwebtoken": "8.5.9",
47
- "@types/node": "18.11.13",
47
+ "@types/node": "18.11.15",
48
48
  "@types/react": "18.0.26",
49
49
  "@types/react-dom": "18.0.9",
50
50
  "@emotion/react": "11.10.5",