@etsoo/react 1.6.83 → 1.6.85

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.
@@ -19,6 +19,12 @@ export type GridData = FormData | DataTypes.StringRecord;
19
19
  * @returns Json data
20
20
  */
21
21
  export declare function GridDataGet<F extends DataTypes.BasicTemplate>(props: GridLoadDataProps, template?: F): GridJsonData & DataTypes.BasicTemplateType<F>;
22
+ /**
23
+ * Grid data get with format
24
+ * @param data Data
25
+ * @returns Json data
26
+ */
27
+ export declare function GridDataGetData<F extends DataTypes.BasicTemplate>(data?: GridData, template?: F): DataTypes.BasicTemplateType<F>;
22
28
  /**
23
29
  * Grid Json data
24
30
  */
@@ -17,12 +17,20 @@ export const GridSizeGet = (size, input) => {
17
17
  export function GridDataGet(props, template) {
18
18
  // Destruct
19
19
  const { data, ...rest } = props;
20
+ // DomUtils.dataAs(data, template);
21
+ return { ...GridDataGetData(data, template), ...rest };
22
+ }
23
+ /**
24
+ * Grid data get with format
25
+ * @param data Data
26
+ * @returns Json data
27
+ */
28
+ export function GridDataGetData(data, template) {
20
29
  // Clear form empty value
21
30
  if (data instanceof FormData) {
22
31
  DomUtils.clearFormData(data);
23
32
  }
24
33
  // Conditions
25
34
  const conditions = data == null ? {} : DomUtils.dataAs(data, template !== null && template !== void 0 ? template : {}, true); // Set keepSource to true to hold form data, even they are invisible from the conditions
26
- // DomUtils.dataAs(data, template);
27
- return { ...conditions, ...rest };
35
+ return conditions;
28
36
  }
@@ -40,7 +40,10 @@ export interface ScrollerListProps<T extends object, D extends DataTypes.Keys<T>
40
40
  */
41
41
  itemSize: ((index: number) => number) | number;
42
42
  }
43
- interface ScrollerListRef {
43
+ /**
44
+ * Scroller list ref
45
+ */
46
+ export interface ScrollerListRef {
44
47
  /**
45
48
  * Scroll to the specified offset (scrollTop or scrollLeft, depending on the direction prop).
46
49
  */
@@ -65,4 +68,3 @@ export interface ScrollerListForwardRef<T> extends GridMethodRef<T>, ScrollerLis
65
68
  * @returns Component
66
69
  */
67
70
  export declare const ScrollerList: <T extends object, D extends DataTypes.Keys<T, string | number> = IdDefaultType<T>>(props: ScrollerListProps<T, D>) => React.JSX.Element;
68
- export {};
package/lib/index.d.ts CHANGED
@@ -11,7 +11,7 @@ export * from './components/ListItemReact';
11
11
  export * from './components/ScrollerGrid';
12
12
  export * from './components/ScrollerList';
13
13
  export * from './components/ScrollRestoration';
14
- export type { ListOnScrollProps, GridOnScrollProps } from 'react-window';
14
+ export type { ListOnScrollProps, GridOnScrollProps, VariableSizeGrid } from 'react-window';
15
15
  export * from './notifier/Notifier';
16
16
  export * from '@etsoo/notificationbase';
17
17
  export * from './states/CultureState';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.6.83",
3
+ "version": "1.6.85",
4
4
  "description": "TypeScript ReactJs UI Independent Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -32,6 +32,19 @@ export function GridDataGet<F extends DataTypes.BasicTemplate>(
32
32
  // Destruct
33
33
  const { data, ...rest } = props;
34
34
 
35
+ // DomUtils.dataAs(data, template);
36
+ return { ...GridDataGetData(data, template), ...rest };
37
+ }
38
+
39
+ /**
40
+ * Grid data get with format
41
+ * @param data Data
42
+ * @returns Json data
43
+ */
44
+ export function GridDataGetData<F extends DataTypes.BasicTemplate>(
45
+ data?: GridData,
46
+ template?: F
47
+ ): DataTypes.BasicTemplateType<F> {
35
48
  // Clear form empty value
36
49
  if (data instanceof FormData) {
37
50
  DomUtils.clearFormData(data);
@@ -41,8 +54,7 @@ export function GridDataGet<F extends DataTypes.BasicTemplate>(
41
54
  const conditions: DataTypes.BasicTemplateType<F> =
42
55
  data == null ? {} : DomUtils.dataAs(data, template ?? {}, true); // Set keepSource to true to hold form data, even they are invisible from the conditions
43
56
 
44
- // DomUtils.dataAs(data, template);
45
- return { ...conditions, ...rest };
57
+ return conditions;
46
58
  }
47
59
 
48
60
  /**
@@ -69,7 +69,10 @@ export interface ScrollerListProps<
69
69
  itemSize: ((index: number) => number) | number;
70
70
  }
71
71
 
72
- interface ScrollerListRef {
72
+ /**
73
+ * Scroller list ref
74
+ */
75
+ export interface ScrollerListRef {
73
76
  /**
74
77
  * Scroll to the specified offset (scrollTop or scrollLeft, depending on the direction prop).
75
78
  */
package/src/index.ts CHANGED
@@ -14,7 +14,11 @@ export * from './components/ListItemReact';
14
14
  export * from './components/ScrollerGrid';
15
15
  export * from './components/ScrollerList';
16
16
  export * from './components/ScrollRestoration';
17
- export type { ListOnScrollProps, GridOnScrollProps } from 'react-window';
17
+ export type {
18
+ ListOnScrollProps,
19
+ GridOnScrollProps,
20
+ VariableSizeGrid
21
+ } from 'react-window';
18
22
 
19
23
  // notifier
20
24
  export * from './notifier/Notifier';