dinocollab-core 2.2.0 → 2.2.1
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/bin/codegen.js +0 -0
- package/dist/src/filter-bar/components/chip-viewer.js +1 -1
- package/dist/src/filter-bar/components/chip-viewer.js.map +1 -1
- package/dist/src/filter-bar/components/filter-menu.js +1 -1
- package/dist/src/filter-bar/components/filter-menu.js.map +1 -1
- package/dist/src/filter-bar/components/filter-menu.units.js +1 -1
- package/dist/src/filter-bar/components/filter-menu.units.js.map +1 -1
- package/dist/src/filter-bar/components/filter-sort.js +1 -1
- package/dist/src/filter-bar/components/filter-sort.js.map +1 -1
- package/dist/src/filter-bar/components/filter-summary.js +1 -1
- package/dist/src/filter-bar/components/filter-summary.js.map +1 -1
- package/dist/src/filter-bar/components/hooks.js +1 -1
- package/dist/src/filter-bar/components/hooks.js.map +1 -1
- package/dist/src/filter-bar/components/popper-custom.js +1 -1
- package/dist/src/filter-bar/components/popper-custom.js.map +1 -1
- package/dist/src/filter-bar/convert-to-graphql.js +1 -1
- package/dist/src/filter-bar/convert-to-graphql.js.map +1 -1
- package/dist/src/filter-bar/index.context.js +1 -1
- package/dist/src/filter-bar/index.context.js.map +1 -1
- package/dist/src/filter-bar/index.create.js +1 -1
- package/dist/src/filter-bar/index.create.js.map +1 -1
- package/dist/src/form/create.form-base.js +1 -1
- package/dist/src/utils/helpers.js +1 -1
- package/dist/types/filter-bar/components/filter-menu.d.ts +1 -0
- package/dist/types/filter-bar/components/filter-menu.types.d.ts +2 -0
- package/dist/types/filter-bar/components/filter-sort.d.ts +1 -0
- package/dist/types/filter-bar/components/hooks.d.ts +1 -1
- package/dist/types/filter-bar/index.context.d.ts +1 -0
- package/dist/types/filter-bar/index.create.d.ts +10 -8
- package/dist/types/lab/data-surface/index.create.d.ts +18 -0
- package/dist/types/lab/data-surface/index.d.ts +1 -0
- package/dist/types/lab/data-surface/index.dino.d.ts +7 -0
- package/dist/types/lab/data-surface/types.d.ts +27 -0
- package/dist/types/lab/data-surface/view-grid.d.ts +40 -0
- package/dist/types/lab/data-surface/view-grid.types.d.ts +22 -0
- package/dist/types/lab/data-surface/view-grid.units.d.ts +11 -0
- package/dist/types/lab/data-surface/view-switch-transition.d.ts +24 -0
- package/dist/types/lab/data-surface/view-switch-transition.units.d.ts +71 -0
- package/dist/types/lab/data-viewer/index.d.ts +1 -0
- package/package.json +10 -10
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ComponentType, FC } from 'react';
|
|
2
|
+
import { TGetterId } from './types';
|
|
3
|
+
import { RenderStrategyRule } from './view-grid.types';
|
|
4
|
+
import type { IViewGridItemProps, TGridSizes } from './view-grid.types';
|
|
5
|
+
export type TVirtualizedConfig = {
|
|
6
|
+
scrollTop: number;
|
|
7
|
+
viewportHeight: number;
|
|
8
|
+
/** Number of extra rows/columns rendered outside the viewport as a buffer. Defaults to `4` (grid) / `6` (table). */
|
|
9
|
+
overscan?: number;
|
|
10
|
+
gap?: number;
|
|
11
|
+
};
|
|
12
|
+
export interface IViewGridBase<T> {
|
|
13
|
+
gap?: number;
|
|
14
|
+
sizes?: TGridSizes;
|
|
15
|
+
gridItemHeight?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Controls how the list is rendered into the DOM.
|
|
18
|
+
* - `normal` — all rows are mounted (suitable for small datasets)
|
|
19
|
+
* - `virtualized` — only visible rows are mounted (optimized for large datasets)
|
|
20
|
+
* @default 'normal'
|
|
21
|
+
*/
|
|
22
|
+
renderStrategy?: RenderStrategyRule;
|
|
23
|
+
Component?: ComponentType<IViewGridItemProps<T>>;
|
|
24
|
+
virtualizedConfig?: TVirtualizedConfig;
|
|
25
|
+
}
|
|
26
|
+
export interface IViewGridConfig<T> extends IViewGridBase<T> {
|
|
27
|
+
getterId: TGetterId<T>;
|
|
28
|
+
}
|
|
29
|
+
export interface IViewGridProps<T> extends IViewGridBase<T> {
|
|
30
|
+
value: T[];
|
|
31
|
+
}
|
|
32
|
+
export declare function createViewGrid<T>(config: IViewGridConfig<T>): FC<IViewGridProps<T>>;
|
|
33
|
+
export default createViewGrid;
|
|
34
|
+
export declare const viewGridClasses: {
|
|
35
|
+
root: string;
|
|
36
|
+
scrollContainer: string;
|
|
37
|
+
grid: string;
|
|
38
|
+
gridVirtualized: string;
|
|
39
|
+
gridItem: string;
|
|
40
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type TGridSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
2
|
+
export type TGridSizes = Partial<Record<TGridSize, number>>;
|
|
3
|
+
/**
|
|
4
|
+
* Controls how the list is rendered into the DOM.
|
|
5
|
+
* - `normal` — all rows are mounted (suitable for small datasets)
|
|
6
|
+
* - `virtualized` — only visible rows are mounted (optimized for large datasets)
|
|
7
|
+
*/
|
|
8
|
+
export declare const RenderStrategyRule: {
|
|
9
|
+
readonly normal: "normal";
|
|
10
|
+
readonly virtualized: "virtualized";
|
|
11
|
+
};
|
|
12
|
+
export type RenderStrategyRule = keyof typeof RenderStrategyRule;
|
|
13
|
+
/**
|
|
14
|
+
* Props received by the custom render function for each card in Grid view.
|
|
15
|
+
* @template T - The shape of a single data row object.
|
|
16
|
+
*/
|
|
17
|
+
export interface IViewGridItemProps<T> {
|
|
18
|
+
/** The data object for this grid card. */
|
|
19
|
+
value: T;
|
|
20
|
+
/** Zero-based position of this item in the data array. */
|
|
21
|
+
index: number;
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IViewGridItemProps, TGridSizes } from './view-grid.types';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
export declare const DEFAULT_GRID_GAP_PX = 8;
|
|
4
|
+
export declare const getMaxGridGap: (...gap: (number | undefined)[]) => number;
|
|
5
|
+
export declare const DEFAULT_GRID_ITEM_MAX_HEIGHT = 200;
|
|
6
|
+
export declare const getMaxGridItemHeight: (...height: (number | undefined)[]) => number;
|
|
7
|
+
export declare const DEFAULT_GRID_ITEM_SIZES: TGridSizes;
|
|
8
|
+
export declare const getGridItemSizes: (sizes?: TGridSizes) => TGridSizes;
|
|
9
|
+
export declare const normalizeGridSizes: (sizes?: TGridSizes) => Required<TGridSizes>;
|
|
10
|
+
export declare const resolveGridColumnsFromWidth: (width: number, sizes?: TGridSizes) => number;
|
|
11
|
+
export declare const GridItemDefault: FC<IViewGridItemProps<any>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { FC, ReactNode, ComponentType } from 'react';
|
|
2
|
+
import { TAnimationConfig } from './view-switch-transition.units';
|
|
3
|
+
type TViewSwitchTransitionConfig<T extends string = string> = {
|
|
4
|
+
value: T;
|
|
5
|
+
label?: string;
|
|
6
|
+
Content: ComponentType<{
|
|
7
|
+
value: T;
|
|
8
|
+
}>;
|
|
9
|
+
icon?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
type TViewSwitchTransitionParam<T extends string = string> = {
|
|
12
|
+
viewA?: TViewSwitchTransitionConfig<T>;
|
|
13
|
+
viewB?: TViewSwitchTransitionConfig<T>;
|
|
14
|
+
transitionConfig?: TAnimationConfig;
|
|
15
|
+
};
|
|
16
|
+
interface IViewSwitchTransitionProps<T extends string = string> {
|
|
17
|
+
value?: T;
|
|
18
|
+
viewA?: TViewSwitchTransitionConfig<T>;
|
|
19
|
+
viewB?: TViewSwitchTransitionConfig<T>;
|
|
20
|
+
transitionConfig?: TAnimationConfig;
|
|
21
|
+
}
|
|
22
|
+
export declare function createViewSwitchTransition<T extends string = string>(config?: TViewSwitchTransitionParam<T>): FC<IViewSwitchTransitionProps<T>>;
|
|
23
|
+
export declare const ViewSwitchTransition: FC<IViewSwitchTransitionProps<string>>;
|
|
24
|
+
export default ViewSwitchTransition;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { CSSProperties, FC, ReactElement } from 'react';
|
|
2
|
+
export declare const viewSwitchTransitionClasses: {
|
|
3
|
+
root: string;
|
|
4
|
+
viewWrapper: string;
|
|
5
|
+
view: string;
|
|
6
|
+
viewA: string;
|
|
7
|
+
viewB: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const ViewSwitchTransitionStyled: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
10
|
+
export declare const ViewDefault: FC;
|
|
11
|
+
/**
|
|
12
|
+
* Fine-grained control over the animation that plays when switching between Grid and Table view.
|
|
13
|
+
* All timing values are in milliseconds unless noted.
|
|
14
|
+
*/
|
|
15
|
+
export type TAnimationConfig = {
|
|
16
|
+
/** Duration of the enter (fade-in) animation. Defaults to `220`. */
|
|
17
|
+
enter?: number;
|
|
18
|
+
/** Duration of the exit (fade-out) animation. Defaults to `140`. */
|
|
19
|
+
exit?: number;
|
|
20
|
+
/** CSS easing function for both enter and exit. Defaults to `'cubic-bezier(0.22, 0.61, 0.36, 1)'`. */
|
|
21
|
+
ease?: string;
|
|
22
|
+
/** Delay before the enter animation starts. Defaults to `12`. */
|
|
23
|
+
delayEnter?: number;
|
|
24
|
+
/** Delay before the exit animation starts. Defaults to `0`. */
|
|
25
|
+
delayExit?: number;
|
|
26
|
+
/** CSS `transform-origin` used during the Grid enter/exit. Defaults to `'top center'`. */
|
|
27
|
+
transformOriginGrid?: string;
|
|
28
|
+
/** CSS `transform-origin` used during the Table enter/exit. Defaults to `'top center'`. */
|
|
29
|
+
transformOriginTable?: string;
|
|
30
|
+
/** Vertical translation offset (px) applied at the start of the enter animation. Defaults to `6`. */
|
|
31
|
+
translateY?: number;
|
|
32
|
+
/** Horizontal scale factor applied at the start of the enter animation. Defaults to `0.992`. */
|
|
33
|
+
horizontalScale?: number;
|
|
34
|
+
/** Delay after the new pane mounts before its enter animation begins. Defaults to `12`. */
|
|
35
|
+
mountDelay?: number;
|
|
36
|
+
/** Extra wait time (ms) after the exit animation completes before swapping the DOM. Defaults to `30`. */
|
|
37
|
+
hold?: number;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Default motion profile used when callers do not provide custom switch config.
|
|
41
|
+
*
|
|
42
|
+
* The values are tuned for a quick but readable transition between Grid and Table
|
|
43
|
+
* while minimizing layout jump perception.
|
|
44
|
+
*/
|
|
45
|
+
export declare const DEFAULT_ANIMATION: Required<TAnimationConfig>;
|
|
46
|
+
/**
|
|
47
|
+
* Props for `CombinedTransition`, the low-level transition wrapper.
|
|
48
|
+
*/
|
|
49
|
+
interface ICombinedTransitionProps {
|
|
50
|
+
/** Controls whether the child should be shown. */
|
|
51
|
+
open: boolean;
|
|
52
|
+
/** Enter/exit durations in milliseconds. */
|
|
53
|
+
timeout: {
|
|
54
|
+
enter: number;
|
|
55
|
+
exit: number;
|
|
56
|
+
};
|
|
57
|
+
/** Delay before applying the enter animation after mount. */
|
|
58
|
+
mountDelay: number;
|
|
59
|
+
/** Resolved animation config (fully required). */
|
|
60
|
+
animationConfig: Required<TAnimationConfig>;
|
|
61
|
+
/** Optional style overrides (commonly transform origin). */
|
|
62
|
+
style?: CSSProperties;
|
|
63
|
+
/** Single child element to receive animated inline style. */
|
|
64
|
+
children: ReactElement;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Reusable transition wrapper combining fade + transform with controlled
|
|
68
|
+
* mount/unmount timing to avoid abrupt content flashing.
|
|
69
|
+
*/
|
|
70
|
+
export declare const CombinedTransition: FC<ICombinedTransitionProps>;
|
|
71
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dinocollab-core",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "Dinocollab core - libraries for building collaborative applications with React 18",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"types": "dist/types/index.d.ts",
|
|
8
8
|
"sideEffects": false,
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "npx rimraf dist && rollup -c && node create-proxy-files.js",
|
|
11
|
+
"build:watch": "rollup -c -w",
|
|
12
|
+
"build:analyze": "npx rimraf dist && rollup -c && node create-proxy-files.js",
|
|
13
|
+
"calc-size": "node calc-build-size.js",
|
|
14
|
+
"test": "jest --passWithNoTests",
|
|
15
|
+
"test:watch": "jest --watch"
|
|
16
|
+
},
|
|
9
17
|
"bin": {
|
|
10
18
|
"dinocollab-codegen-cli": "bin/codegen.js"
|
|
11
19
|
},
|
|
@@ -172,13 +180,5 @@
|
|
|
172
180
|
"@testing-library/react": "^16.3.2",
|
|
173
181
|
"@testing-library/user-event": "^14.6.1",
|
|
174
182
|
"reflect-metadata": "0.2.2"
|
|
175
|
-
},
|
|
176
|
-
"scripts": {
|
|
177
|
-
"build": "npx rimraf dist && rollup -c && node create-proxy-files.js",
|
|
178
|
-
"build:watch": "rollup -c -w",
|
|
179
|
-
"build:analyze": "npx rimraf dist && rollup -c && node create-proxy-files.js",
|
|
180
|
-
"calc-size": "node calc-build-size.js",
|
|
181
|
-
"test": "jest --passWithNoTests",
|
|
182
|
-
"test:watch": "jest --watch"
|
|
183
183
|
}
|
|
184
|
-
}
|
|
184
|
+
}
|