@etsoo/react 1.7.29 → 1.7.31

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.
@@ -2,13 +2,13 @@
2
2
  "compilerOptions": {
3
3
  "target": "ES2020",
4
4
  "module": "ESNext",
5
- "allowJs": true,
5
+ "moduleResolution": "Node10",
6
+ "allowJs": false,
6
7
  "skipLibCheck": true,
7
8
  "esModuleInterop": true,
8
9
  "allowSyntheticDefaultImports": true,
9
10
  "strict": true,
10
11
  "forceConsistentCasingInFileNames": true,
11
- "moduleResolution": "Bundler",
12
12
  "resolveJsonModule": true,
13
13
  "isolatedModules": true,
14
14
  "noEmit": true,
@@ -1,4 +1,4 @@
1
- import { DataTypes, IdDefaultType } from '@etsoo/shared';
1
+ import { DataTypes } from '@etsoo/shared';
2
2
  import React from 'react';
3
3
  import { Align, GridChildComponentProps, VariableSizeGridProps } from 'react-window';
4
4
  import { GridLoader, GridLoaderStates } from './GridLoader';
@@ -21,7 +21,7 @@ export type ScrollerGridItemRendererProps<T> = Omit<GridChildComponentProps<T>,
21
21
  /**
22
22
  * Scroller vertical grid props
23
23
  */
24
- export interface ScrollerGridProps<T extends object, D extends DataTypes.Keys<T>> extends GridLoader<T>, Omit<VariableSizeGridProps<T>, 'children' | 'rowCount' | 'rowHeight' | 'ref'> {
24
+ export interface ScrollerGridProps<T extends object> extends GridLoader<T>, Omit<VariableSizeGridProps<T>, 'children' | 'rowCount' | 'rowHeight' | 'ref'> {
25
25
  /**
26
26
  * Default order by asc
27
27
  * @default true
@@ -38,7 +38,7 @@ export interface ScrollerGridProps<T extends object, D extends DataTypes.Keys<T>
38
38
  /**
39
39
  * Id field
40
40
  */
41
- idField?: D;
41
+ idField?: DataTypes.Keys<T>;
42
42
  /**
43
43
  * Item renderer
44
44
  */
@@ -114,4 +114,4 @@ export interface ScrollerGridForwardRef<T> extends GridMethodRef<T> {
114
114
  * @param props Props
115
115
  * @returns Component
116
116
  */
117
- export declare const ScrollerGrid: <T extends object, D extends DataTypes.Keys<T, import("@etsoo/shared").IdType> = IdDefaultType<T>>(props: ScrollerGridProps<T, D>) => React.JSX.Element;
117
+ export declare const ScrollerGrid: <T extends object>(props: ScrollerGridProps<T>) => React.JSX.Element;
@@ -1,4 +1,4 @@
1
- import { DataTypes, IdDefaultType } from '@etsoo/shared';
1
+ import { DataTypes } from '@etsoo/shared';
2
2
  import React from 'react';
3
3
  import { Align, ListChildComponentProps, ListProps } from 'react-window';
4
4
  import { GridLoader } from './GridLoader';
@@ -6,7 +6,7 @@ import { GridMethodRef } from './GridMethodRef';
6
6
  /**
7
7
  * Scroller vertical list props
8
8
  */
9
- export interface ScrollerListProps<T extends object, D extends DataTypes.Keys<T>> extends GridLoader<T>, Omit<ListProps<T>, 'ref' | 'outerRef' | 'height' | 'width' | 'children' | 'itemCount'> {
9
+ export interface ScrollerListProps<T extends object> extends GridLoader<T>, Omit<ListProps<T>, 'ref' | 'outerRef' | 'height' | 'width' | 'children' | 'itemCount'> {
10
10
  /**
11
11
  * Default order by asc/desc
12
12
  */
@@ -30,7 +30,7 @@ export interface ScrollerListProps<T extends object, D extends DataTypes.Keys<T>
30
30
  /**
31
31
  * Id field
32
32
  */
33
- idField?: D;
33
+ idField?: DataTypes.Keys<T>;
34
34
  /**
35
35
  * Item renderer
36
36
  */
@@ -67,4 +67,4 @@ export interface ScrollerListForwardRef<T> extends GridMethodRef<T> {
67
67
  * @param props Props
68
68
  * @returns Component
69
69
  */
70
- export declare const ScrollerList: <T extends object, D extends DataTypes.Keys<T, import("@etsoo/shared").IdType> = IdDefaultType<T>>(props: ScrollerListProps<T, D>) => React.JSX.Element;
70
+ export declare const ScrollerList: <T extends object>(props: ScrollerListProps<T>) => React.JSX.Element;
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.7.29",
3
+ "version": "1.7.31",
4
4
  "description": "TypeScript ReactJs UI Independent Framework",
5
5
  "main": "lib/index.js",
6
+ "type": "module",
6
7
  "types": "lib/index.d.ts",
7
8
  "scripts": {
8
9
  "build": "tsc",
@@ -50,9 +51,9 @@
50
51
  "@emotion/css": "^11.11.2",
51
52
  "@emotion/react": "^11.11.4",
52
53
  "@emotion/styled": "^11.11.0",
53
- "@etsoo/appscript": "^1.4.78",
54
- "@etsoo/notificationbase": "^1.1.39",
55
- "@etsoo/shared": "^1.2.28",
54
+ "@etsoo/appscript": "^1.4.79",
55
+ "@etsoo/notificationbase": "^1.1.40",
56
+ "@etsoo/shared": "^1.2.31",
56
57
  "react": "^18.2.0",
57
58
  "react-dom": "^18.2.0",
58
59
  "react-router-dom": "^6.22.2",
@@ -1,4 +1,4 @@
1
- import { DataTypes, IdDefaultType } from '@etsoo/shared';
1
+ import { DataTypes } from '@etsoo/shared';
2
2
  import React from 'react';
3
3
  import {
4
4
  Align,
@@ -39,10 +39,8 @@ export type ScrollerGridItemRendererProps<T> = Omit<
39
39
  /**
40
40
  * Scroller vertical grid props
41
41
  */
42
- export interface ScrollerGridProps<
43
- T extends object,
44
- D extends DataTypes.Keys<T>
45
- > extends GridLoader<T>,
42
+ export interface ScrollerGridProps<T extends object>
43
+ extends GridLoader<T>,
46
44
  Omit<
47
45
  VariableSizeGridProps<T>,
48
46
  'children' | 'rowCount' | 'rowHeight' | 'ref'
@@ -69,7 +67,7 @@ export interface ScrollerGridProps<
69
67
  /**
70
68
  * Id field
71
69
  */
72
- idField?: D;
70
+ idField?: DataTypes.Keys<T>;
73
71
 
74
72
  /**
75
73
  * Item renderer
@@ -158,12 +156,7 @@ export interface ScrollerGridForwardRef<T> extends GridMethodRef<T> {
158
156
  * @param props Props
159
157
  * @returns Component
160
158
  */
161
- export const ScrollerGrid = <
162
- T extends object,
163
- D extends DataTypes.Keys<T> = IdDefaultType<T>
164
- >(
165
- props: ScrollerGridProps<T, D>
166
- ) => {
159
+ export const ScrollerGrid = <T extends object>(props: ScrollerGridProps<T>) => {
167
160
  // Destruct
168
161
  const {
169
162
  autoLoad = true,
@@ -172,7 +165,7 @@ export const ScrollerGrid = <
172
165
  footerRenderer,
173
166
  headerRenderer,
174
167
  itemRenderer,
175
- idField = 'id' as D,
168
+ idField = 'id' as DataTypes.Keys<T>,
176
169
  loadBatchSize,
177
170
  loadData,
178
171
  mRef,
@@ -1,4 +1,4 @@
1
- import { DataTypes, IdDefaultType, Utils } from '@etsoo/shared';
1
+ import { DataTypes, Utils } from '@etsoo/shared';
2
2
  import React from 'react';
3
3
  import {
4
4
  Align,
@@ -20,10 +20,8 @@ import { GridMethodRef } from './GridMethodRef';
20
20
  /**
21
21
  * Scroller vertical list props
22
22
  */
23
- export interface ScrollerListProps<
24
- T extends object,
25
- D extends DataTypes.Keys<T>
26
- > extends GridLoader<T>,
23
+ export interface ScrollerListProps<T extends object>
24
+ extends GridLoader<T>,
27
25
  Omit<
28
26
  ListProps<T>,
29
27
  'ref' | 'outerRef' | 'height' | 'width' | 'children' | 'itemCount'
@@ -56,7 +54,7 @@ export interface ScrollerListProps<
56
54
  /**
57
55
  * Id field
58
56
  */
59
- idField?: D;
57
+ idField?: DataTypes.Keys<T>;
60
58
 
61
59
  /**
62
60
  * Item renderer
@@ -108,12 +106,7 @@ const calculateBatchSize = (
108
106
  * @param props Props
109
107
  * @returns Component
110
108
  */
111
- export const ScrollerList = <
112
- T extends object,
113
- D extends DataTypes.Keys<T> = IdDefaultType<T>
114
- >(
115
- props: ScrollerListProps<T, D>
116
- ) => {
109
+ export const ScrollerList = <T extends object>(props: ScrollerListProps<T>) => {
117
110
  // Destruct
118
111
  const {
119
112
  autoLoad = true,
@@ -124,7 +117,7 @@ export const ScrollerList = <
124
117
  mRef,
125
118
  oRef,
126
119
  style = {},
127
- idField = 'id' as D,
120
+ idField = 'id' as DataTypes.Keys<T>,
128
121
  itemRenderer,
129
122
  itemSize,
130
123
  loadBatchSize = calculateBatchSize(height, itemSize),
package/tsconfig.json CHANGED
@@ -3,8 +3,8 @@
3
3
  /* Visit https://aka.ms/tsconfig.json to read more about this file */
4
4
  "target": "ES2020",
5
5
  "module": "ESNext",
6
- "allowJs": true,
7
- "moduleResolution": "Bundler",
6
+ "moduleResolution": "Node10",
7
+ "allowJs": false,
8
8
  "isolatedModules": true,
9
9
  "outDir": "./lib",
10
10
  "noEmit": false,