@etsoo/react 1.7.44 → 1.7.45
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/lib/components/DnDList.d.ts +1 -1
- package/lib/components/DnDList.js +5 -5
- package/lib/components/DynamicRouter.d.ts +1 -1
- package/lib/components/DynamicRouter.js +2 -2
- package/lib/components/ScrollRestoration.d.ts +1 -2
- package/lib/components/ScrollRestoration.js +2 -1
- package/lib/components/ScrollerGrid.d.ts +1 -1
- package/lib/components/ScrollerGrid.js +9 -11
- package/lib/components/ScrollerList.d.ts +1 -1
- package/lib/components/ScrollerList.js +2 -1
- package/lib/states/State.js +2 -1
- package/package.json +1 -1
- package/tsconfig.json +1 -1
|
@@ -71,4 +71,4 @@ export interface DnDListPros<D extends object, K extends DataTypes.Keys<D>> {
|
|
|
71
71
|
*/
|
|
72
72
|
export declare function DnDList<D extends {
|
|
73
73
|
id: UniqueIdentifier;
|
|
74
|
-
}, K extends DataTypes.Keys<D, UniqueIdentifier> = DataTypes.Keys<D, UniqueIdentifier>>(props: DnDListPros<D, K>):
|
|
74
|
+
}, K extends DataTypes.Keys<D, UniqueIdentifier> = DataTypes.Keys<D, UniqueIdentifier>>(props: DnDListPros<D, K>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { DndContext } from '@dnd-kit/core';
|
|
2
3
|
import { SortableContext, useSortable, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
|
3
4
|
import { CSS } from '@dnd-kit/utilities';
|
|
@@ -122,9 +123,8 @@ export function DnDList(props) {
|
|
|
122
123
|
React.useEffect(() => {
|
|
123
124
|
setItems(props.items);
|
|
124
125
|
}, [props.items]);
|
|
125
|
-
return (
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}))));
|
|
126
|
+
return (_jsx(DndContext, { onDragStart: handleDragStart, onDragEnd: handleDragEnd, children: _jsx(SortableContext, { items: items, strategy: verticalListSortingStrategy, children: items.map((item, index) => {
|
|
127
|
+
const id = item[keyField];
|
|
128
|
+
return (_jsx(SortableItem, { id: id, style: getItemStyle(index, id === activeId), itemRenderer: (nodeRef, actionNodeRef) => itemRenderer(item, index, nodeRef, actionNodeRef) }, id));
|
|
129
|
+
}) }) }));
|
|
130
130
|
}
|
|
@@ -13,4 +13,4 @@ export type DynamicRouterProps = {
|
|
|
13
13
|
* @param props Props
|
|
14
14
|
* @returns Component
|
|
15
15
|
*/
|
|
16
|
-
export declare function DynamicRouter(props: React.PropsWithChildren<DynamicRouterProps>):
|
|
16
|
+
export declare function DynamicRouter(props: React.PropsWithChildren<DynamicRouterProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { BridgeUtils } from '@etsoo/appscript';
|
|
2
|
-
import React from 'react';
|
|
3
3
|
import { BrowserRouter, MemoryRouter } from 'react-router-dom';
|
|
4
4
|
function getEntries(host) {
|
|
5
5
|
const startUrl = host.getStartUrl();
|
|
@@ -15,5 +15,5 @@ export function DynamicRouter(props) {
|
|
|
15
15
|
const { basename, children } = props;
|
|
16
16
|
// Layout
|
|
17
17
|
const host = BridgeUtils.host;
|
|
18
|
-
return host == null ? (
|
|
18
|
+
return host == null ? (_jsx(BrowserRouter, { basename: basename, children: children })) : (_jsx(MemoryRouter, { basename: basename, initialEntries: getEntries(host), children: children }));
|
|
19
19
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { useLocation } from 'react-router-dom';
|
|
3
4
|
import { useWindowScroll } from '../uses/useWindowScroll';
|
|
@@ -26,5 +27,5 @@ export function ScrollRestoration() {
|
|
|
26
27
|
mounted.current = false;
|
|
27
28
|
};
|
|
28
29
|
}, [key]);
|
|
29
|
-
return
|
|
30
|
+
return _jsx(React.Fragment, {});
|
|
30
31
|
}
|
|
@@ -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>(props: ScrollerGridProps<T>) =>
|
|
117
|
+
export declare const ScrollerGrid: <T extends object>(props: ScrollerGridProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { VariableSizeGrid } from 'react-window';
|
|
3
4
|
/**
|
|
@@ -237,15 +238,12 @@ export const ScrollerGrid = (props) => {
|
|
|
237
238
|
loadDataLocal();
|
|
238
239
|
}
|
|
239
240
|
// Layout
|
|
240
|
-
return (
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
return [
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
? rowHeight
|
|
249
|
-
: () => rowHeight, style: { overflowX: 'hidden' }, width: width, ...rest }, (props) => itemRendererLocal(props, refs.current)),
|
|
250
|
-
footerRenderer && footerRenderer(rows, refs.current)));
|
|
241
|
+
return (_jsxs(React.Fragment, { children: [headerRenderer && headerRenderer(refs.current), _jsx(VariableSizeGrid, { itemKey: ({ columnIndex, rowIndex, data }) => {
|
|
242
|
+
if (data == null)
|
|
243
|
+
return [rowIndex, columnIndex].join(',');
|
|
244
|
+
// ${data[idField]}-${rowIndex} always unique but no cache for the same item
|
|
245
|
+
return [`${data[idField]}`, columnIndex].join(',');
|
|
246
|
+
}, onItemsRendered: onItemsRenderedLocal, ref: ref, rowCount: rowCount, rowHeight: typeof rowHeight === 'function'
|
|
247
|
+
? rowHeight
|
|
248
|
+
: () => rowHeight, style: { overflowX: 'hidden' }, width: width, ...rest, children: (props) => itemRendererLocal(props, refs.current) }), footerRenderer && footerRenderer(rows, refs.current)] }));
|
|
251
249
|
};
|
|
@@ -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>(props: ScrollerListProps<T>) =>
|
|
70
|
+
export declare const ScrollerList: <T extends object>(props: ScrollerListProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { DataTypes, Utils } from '@etsoo/shared';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { FixedSizeList, VariableSizeList } from 'react-window';
|
|
@@ -190,5 +191,5 @@ export const ScrollerList = (props) => {
|
|
|
190
191
|
loadDataLocal();
|
|
191
192
|
}
|
|
192
193
|
// Layout
|
|
193
|
-
return typeof itemSize === 'function' ? (
|
|
194
|
+
return typeof itemSize === 'function' ? (_jsx(VariableSizeList, { height: height, width: width, itemCount: itemCount, itemKey: (index, data) => DataTypes.getIdValue1(data, idField) ?? index, itemSize: itemSize, outerRef: refs, ref: listRef, style: style, onItemsRendered: onItemsRenderedLocal, ...rest, children: itemRendererLocal })) : (_jsx(FixedSizeList, { height: height, width: width, itemCount: itemCount, itemKey: (index, data) => DataTypes.getIdValue1(data, idField) ?? index, itemSize: itemSize, outerRef: refs, ref: listRef, style: style, onItemsRendered: onItemsRenderedLocal, ...rest, children: itemRendererLocal }));
|
|
194
195
|
};
|
package/lib/states/State.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
/**
|
|
3
4
|
* State
|
|
@@ -28,7 +29,7 @@ export class State {
|
|
|
28
29
|
else {
|
|
29
30
|
// Context new value
|
|
30
31
|
const value = { ...calls, state, dispatch };
|
|
31
|
-
return (
|
|
32
|
+
return (_jsx(context.Provider, { value: value, children: children }));
|
|
32
33
|
}
|
|
33
34
|
};
|
|
34
35
|
// Return
|
package/package.json
CHANGED