@nodeblocks/frontend-list-users-block 0.4.1 → 0.5.0
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/dist/index.d.ts +15 -15
- package/package.json +6 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TableCellProps, Stack, StackProps, TypographyProps, TabsProps, TabProps, Box, MenuProps, TableHeadProps, TableRowProps, TableBodyProps, IconButtonProps, TableContainer, TableProps } from '@mui/material';
|
|
2
2
|
import { ReactNode, ComponentProps, SyntheticEvent, ReactElement, MouseEvent } from 'react';
|
|
3
|
+
import { SetRequired, PickDeep } from 'type-fest';
|
|
3
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
import { SetRequired } from 'type-fest';
|
|
5
5
|
import { Breakpoint } from '@mui/material/styles';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -135,7 +135,7 @@ declare const defaultHeaderBlocks: {
|
|
|
135
135
|
/**
|
|
136
136
|
* Composes the header title and action blocks at the top of the table layout.
|
|
137
137
|
*/
|
|
138
|
-
declare const BaseTableHeader: <TRow extends Record<string, unknown>, TTabValue extends string | number = string, CustomBlocks extends Record<string, ReactNode> =
|
|
138
|
+
declare const BaseTableHeader: <TRow extends Record<string, unknown>, TTabValue extends string | number = string, CustomBlocks extends Record<string, ReactNode> = Record<string, ReactNode>>(props: Partial<Omit<StackProps, "children">> & {
|
|
139
139
|
children?: BlocksOverride<typeof defaultHeaderBlocks, CustomBlocks>;
|
|
140
140
|
}) => react_jsx_runtime.JSX.Element | null;
|
|
141
141
|
/**
|
|
@@ -218,7 +218,7 @@ declare const defaultContentGridHeadRowBlocks: {
|
|
|
218
218
|
pinMeta?: BaseTableColumnPinMeta;
|
|
219
219
|
}, (props: BaseTableContentGridHeadActionCellProps) => react_jsx_runtime.JSX.Element>;
|
|
220
220
|
};
|
|
221
|
-
type BaseTableContentGridHeadRowProps<TRow extends Record<string, unknown>, CustomBlocks extends Record<string, ReactNode> =
|
|
221
|
+
type BaseTableContentGridHeadRowProps<TRow extends Record<string, unknown>, CustomBlocks extends Record<string, ReactNode> = Record<string, ReactNode>> = Partial<Omit<TableRowProps, 'children'>> & {
|
|
222
222
|
columns: BaseTableContextValue<TRow>['columns'];
|
|
223
223
|
rowActions?: ((row: TRow) => BaseTableRowAction<TRow>[]) | undefined;
|
|
224
224
|
headCell?: ReactNode | ((args: BaseTableContentGridHeadCellRenderArgs<TRow>) => ReactNode);
|
|
@@ -247,7 +247,7 @@ declare const defaultBodyRowBlocks: {
|
|
|
247
247
|
onOpenRowMenu?: RowMenuOpenHandler<Record<string, unknown>> | undefined;
|
|
248
248
|
}, <TRow extends Record<string, unknown>>(props: BaseTableContentGridBodyActionCellProps<TRow>) => react_jsx_runtime.JSX.Element>;
|
|
249
249
|
};
|
|
250
|
-
type BaseTableContentGridBodyRowProps<TRow extends Record<string, unknown>, CustomBlocks extends Record<string, ReactNode> =
|
|
250
|
+
type BaseTableContentGridBodyRowProps<TRow extends Record<string, unknown>, CustomBlocks extends Record<string, ReactNode> = Record<string, ReactNode>> = {
|
|
251
251
|
row: TRow;
|
|
252
252
|
rowIndex: number;
|
|
253
253
|
columns: BaseTableContextValue<TRow>['columns'];
|
|
@@ -282,11 +282,11 @@ declare const defaultContentGridHeadBlocks: {
|
|
|
282
282
|
actionCell: ReactElement<Partial<TableCellProps> & {
|
|
283
283
|
pinMeta?: BaseTableColumnPinMeta;
|
|
284
284
|
}, (props: BaseTableContentGridHeadActionCellProps) => react_jsx_runtime.JSX.Element>;
|
|
285
|
-
},
|
|
285
|
+
}, Record<string, ReactNode>>;
|
|
286
286
|
}, <TRow extends Record<string, unknown>>(props: BaseTableContentGridHeadRowProps<TRow>) => react_jsx_runtime.JSX.Element>;
|
|
287
287
|
};
|
|
288
288
|
type BaseTableContentGridHeadRowRenderArgs<TRow extends Record<string, unknown>> = Pick<ComponentProps<typeof BaseTableContentGridHeadRow<TRow>>, 'columns' | 'rowActions' | 'columnPinMeta' | 'actionColumnPinMeta'>;
|
|
289
|
-
type BaseTableContentGridHeadProps<TRow extends Record<string, unknown>, CustomBlocks extends Record<string, ReactNode> =
|
|
289
|
+
type BaseTableContentGridHeadProps<TRow extends Record<string, unknown>, CustomBlocks extends Record<string, ReactNode> = Record<string, ReactNode>> = Partial<Omit<TableHeadProps, 'children'>> & {
|
|
290
290
|
columns: BaseTableContextValue<TRow>['columns'];
|
|
291
291
|
rowActions?: ((row: TRow) => BaseTableRowAction<TRow>[]) | undefined;
|
|
292
292
|
headRow?: ReactNode | ((args: BaseTableContentGridHeadRowRenderArgs<TRow>) => ReactNode);
|
|
@@ -327,11 +327,11 @@ declare const defaultGridBodyBlocks: {
|
|
|
327
327
|
icon?: ReactNode;
|
|
328
328
|
onOpenRowMenu?: RowMenuOpenHandler<Record<string, unknown>> | undefined;
|
|
329
329
|
}, <TRow extends Record<string, unknown>>(props: BaseTableContentGridBodyActionCellProps<TRow>) => react_jsx_runtime.JSX.Element>;
|
|
330
|
-
},
|
|
330
|
+
}, Record<string, ReactNode>>;
|
|
331
331
|
} & Partial<Omit<TableRowProps, "children">>, <TRow extends Record<string, unknown>>(props: BaseTableContentGridBodyRowProps<TRow>) => react_jsx_runtime.JSX.Element>;
|
|
332
332
|
};
|
|
333
333
|
type BaseTableContentGridBodyRowRenderArgs<TRow extends Record<string, unknown>> = Pick<ComponentProps<typeof BaseTableContentGridBodyRow<TRow>>, 'row' | 'rowIndex' | 'columns' | 'rowActions' | 'onRowClick' | 'onOpenRowMenu' | 'columnPinMeta' | 'actionColumnPinMeta'>;
|
|
334
|
-
type BaseTableContentGridBodyProps<TRow extends Record<string, unknown>, CustomBlocks extends Record<string, ReactNode> =
|
|
334
|
+
type BaseTableContentGridBodyProps<TRow extends Record<string, unknown>, CustomBlocks extends Record<string, ReactNode> = Record<string, ReactNode>> = Partial<Omit<TableBodyProps, 'children'>> & {
|
|
335
335
|
columns: BaseTableContextValue<TRow>['columns'];
|
|
336
336
|
rows: TRow[];
|
|
337
337
|
rowActions?: ((row: TRow) => BaseTableRowAction<TRow>[]) | undefined;
|
|
@@ -382,7 +382,7 @@ declare const defaultGridBlocks: {
|
|
|
382
382
|
rowMenu: ReactElement<ComponentProps<typeof BaseTableContentGridRowMenu>>;
|
|
383
383
|
emptyState: ReactElement<ComponentProps<typeof BaseTableContentEmptyState>>;
|
|
384
384
|
};
|
|
385
|
-
type BaseTableContentGridProps<TRow extends Record<string, unknown>, TTabValue extends string | number = string, CustomBlocks extends Record<string, ReactNode> =
|
|
385
|
+
type BaseTableContentGridProps<TRow extends Record<string, unknown>, TTabValue extends string | number = string, CustomBlocks extends Record<string, ReactNode> = Record<string, ReactNode>> = Partial<Omit<ComponentProps<typeof Stack>, 'children'> & Pick<BaseTableContextValue<TRow, TTabValue>, 'columns' | 'rows' | 'actionColumn' | 'rowActions' | 'noRowsOverlay' | 'onRowClick' | 'getRowId'> & {
|
|
386
386
|
emptyState?: ReactNode;
|
|
387
387
|
head?: ReactNode | ((args: Omit<ComponentProps<typeof BaseTable.Content.Grid.Head<TRow>>, 'children'>) => ReactNode);
|
|
388
388
|
body?: ReactNode | ((args: Omit<SetRequired<ComponentProps<typeof BaseTable.Content.Grid.Body<TRow>>, 'onOpenRowMenu'>, 'children'>) => ReactNode);
|
|
@@ -407,7 +407,7 @@ declare const defaultContentBlocks: {
|
|
|
407
407
|
/**
|
|
408
408
|
* Chooses between the loader, empty-state, and grid branches for the content area.
|
|
409
409
|
*/
|
|
410
|
-
declare const BaseTableContent: <TRow extends Record<string, unknown>, TTabValue extends string | number = string, CustomBlocks extends Record<string, ReactNode> =
|
|
410
|
+
declare const BaseTableContent: <TRow extends Record<string, unknown>, TTabValue extends string | number = string, CustomBlocks extends Record<string, ReactNode> = Record<string, ReactNode>>(props: Partial<Omit<ComponentProps<typeof Box>, "children"> & Pick<BaseTableContextValue<TRow, TTabValue>, "isLoading" | "rows"> & {
|
|
411
411
|
children?: BlocksOverride<typeof defaultContentBlocks, CustomBlocks>;
|
|
412
412
|
}>) => react_jsx_runtime.JSX.Element;
|
|
413
413
|
/**
|
|
@@ -425,7 +425,7 @@ type BaseTableWithChildrenProps<TRow extends Record<string, unknown>, TTabValue
|
|
|
425
425
|
children?: BlocksOverride<typeof defaultBlocks, CustomBlocks>;
|
|
426
426
|
};
|
|
427
427
|
type BaseTableComponent = {
|
|
428
|
-
<TRow extends Record<string, unknown>, TTabValue extends string | number = string, CustomBlocks extends Record<string, ReactNode> =
|
|
428
|
+
<TRow extends Record<string, unknown>, TTabValue extends string | number = string, CustomBlocks extends Record<string, ReactNode> = Record<string, ReactNode>>(props: BaseTableWithChildrenProps<TRow, TTabValue, CustomBlocks>): ReactNode;
|
|
429
429
|
Header: typeof BaseTableHeader & {
|
|
430
430
|
Title: typeof BaseTableHeaderTitle;
|
|
431
431
|
Actions: typeof BaseTableHeaderActions;
|
|
@@ -537,23 +537,23 @@ type ListUsersDefaultBlocks = {
|
|
|
537
537
|
pagination: ReactNode;
|
|
538
538
|
};
|
|
539
539
|
type ListUsersRootPassthroughProps = Omit<StackProps, 'children'>;
|
|
540
|
-
type ListUsersProps<TTabs extends TabData[] = TabData[], CustomBlocks extends Record<string, ReactNode> =
|
|
540
|
+
type ListUsersProps<TTabs extends TabData[] = TabData[], CustomBlocks extends Record<string, ReactNode> = Record<string, ReactNode>> = ListUsersRootPassthroughProps & Required<Pick<ListUsersValue<TTabs>, 'listUsersTitle' | 'labels' | 'data'>> & Partial<Pick<ListUsersValue<TTabs>, 'isLoading' | 'searchValue' | 'onSearchFieldChange' | 'onSearchSubmit' | 'onItemActivate' | 'onItemDeactivate' | 'shouldShowDropdownMenu' | 'resolveRowAction' | 'statusMatch' | 'onNavigate' | 'pagination' | 'rowHref' | 'tabs' | 'currentTab' | 'onTabChange' | 'searchChipsTitle' | 'searchChips' | 'onSearchChipDelete'>> & {
|
|
541
541
|
children?: BlocksOverride<ListUsersDefaultBlocks, CustomBlocks>;
|
|
542
542
|
};
|
|
543
543
|
type ListUsersTitleProps = ComponentProps<typeof BaseTable.Header.Title> & {
|
|
544
544
|
listUsersTitle?: ReactNode;
|
|
545
545
|
};
|
|
546
546
|
type ListUsersHeaderProps = ComponentProps<typeof BaseTable.Header>;
|
|
547
|
-
type ListUsersActionProps = ComponentProps<typeof BaseTable.Header.Actions> & Partial<Pick<ListUsersValue, '
|
|
547
|
+
type ListUsersActionProps = ComponentProps<typeof BaseTable.Header.Actions> & Partial<Pick<ListUsersValue, 'searchValue' | 'onSearchFieldChange' | 'onSearchSubmit'> & PickDeep<ListUsersValue, 'labels.searchFieldPlaceholder'>>;
|
|
548
548
|
type ListUsersLoaderProps = ComponentProps<typeof BaseTable.Content.Loader>;
|
|
549
549
|
type ListUsersContentProps = ComponentProps<typeof BaseTable.Content>;
|
|
550
550
|
type ListUsersTabsProps = ComponentProps<typeof BaseTable.Tabs<ListUsersRowData>>;
|
|
551
551
|
type ListUsersBaseTableGridProps = ComponentProps<typeof BaseTable.Content.Grid<ListUsersRowData>>;
|
|
552
|
-
type ListUsersTableProps = Omit<ListUsersBaseTableGridProps, 'rows' | 'noRowsOverlay'> & Partial<Pick<ListUsersValue, '
|
|
552
|
+
type ListUsersTableProps = Omit<ListUsersBaseTableGridProps, 'rows' | 'noRowsOverlay'> & Partial<Pick<ListUsersValue, 'data' | 'statusMatch' | 'onItemActivate' | 'onItemDeactivate' | 'shouldShowDropdownMenu' | 'resolveRowAction' | 'rowHref' | 'onNavigate' | 'columns' | 'rowActions' | 'actionColumn' | 'onRowClick'> & PickDeep<ListUsersValue, 'labels.headerRow.name' | 'labels.headerRow.createdAt' | 'labels.headerRow.status' | 'labels.cellData.statusActive' | 'labels.cellData.statusInactive' | 'labels.emptyStateMessage' | 'labels.rowActions.activate' | 'labels.rowActions.deactivate'>>;
|
|
553
553
|
type ListUsersPaginationProps = Partial<Omit<ComponentProps<typeof BaseTable.Pagination>, 'pagination' | 'rows' | 'isLoading'>> & Partial<Pick<ListUsersValue, 'pagination' | 'data' | 'isLoading'>>;
|
|
554
554
|
type ListUsersSearchChipsProps = Partial<ComponentProps<typeof BaseTable.SearchChips>>;
|
|
555
555
|
type ListUsersComponent = {
|
|
556
|
-
<TTabs extends TabData[] = TabData[], CustomBlocks extends Record<string, ReactNode> =
|
|
556
|
+
<TTabs extends TabData[] = TabData[], CustomBlocks extends Record<string, ReactNode> = Record<string, ReactNode>>(props: ListUsersProps<TTabs, CustomBlocks>): ReactNode;
|
|
557
557
|
Title: (props: ListUsersTitleProps) => ReactNode;
|
|
558
558
|
Action: (props: ListUsersActionProps) => ReactNode;
|
|
559
559
|
Header: (props: ListUsersHeaderProps) => ReactNode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nodeblocks/frontend-list-users-block",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"main": "./dist/index.cjs.js",
|
|
5
5
|
"module": "./dist/index.esm.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"@emotion/react": "^11.14.0",
|
|
27
27
|
"@emotion/styled": "^11.14.1",
|
|
28
|
-
"@mui/icons-material": "
|
|
29
|
-
"@mui/material": "
|
|
28
|
+
"@mui/icons-material": ">=7 <10",
|
|
29
|
+
"@mui/material": ">=7 <10",
|
|
30
30
|
"react": ">=18 <20",
|
|
31
31
|
"react-dom": ">=18 <20"
|
|
32
32
|
},
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"@types/react-dom": "19.2.3",
|
|
44
44
|
"jsdom": "^27.4.0",
|
|
45
45
|
"rollup": "^4.55.1",
|
|
46
|
-
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
47
46
|
"rollup-plugin-delete": "^3.0.2",
|
|
48
47
|
"rollup-plugin-dts": "^6.4.1",
|
|
48
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
49
49
|
"rollup-plugin-postcss": "^4.0.2",
|
|
50
50
|
"rollup-plugin-serve": "^1.1.1",
|
|
51
51
|
"tslib": "^2.8.1",
|
|
@@ -54,7 +54,8 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@nodeblocks/frontend-base-block": "*",
|
|
57
|
-
"luxon": "^3.7.2"
|
|
57
|
+
"luxon": "^3.7.2",
|
|
58
|
+
"type-fest": "^5.6.0"
|
|
58
59
|
},
|
|
59
60
|
"bundleDependencies": [
|
|
60
61
|
"@nodeblocks/frontend-base-block"
|