@compill/admin 1.0.115 → 1.0.116
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.cjs +30 -625
- package/dist/index.d.ts +0 -6
- package/dist/index.js +15 -602
- package/dist/lib/buttons/InvalidateButton.d.ts +1 -1
- package/dist/lib/buttons/ViewButton.d.ts +1 -1
- package/dist/lib/json/EditItemView.d.ts +1 -1
- package/dist/lib/json/types/EditItemDialog.d.ts +1 -1
- package/dist/lib/json/types/ScreenConfig.d.ts +1 -1
- package/dist/lib/json/types/TableView.d.ts +1 -1
- package/dist/lib/layout/AdminLayout.d.ts +3 -3
- package/dist/lib/layout/Sidebar.d.ts +3 -3
- package/dist/lib/table/TableCreateButton.d.ts +1 -1
- package/dist/lib/table/TableRowActionDialogButton.d.ts +1 -1
- package/dist/lib/table/TableRowDeleteButton.d.ts +1 -1
- package/dist/lib/table/TableRowEditButton.d.ts +1 -1
- package/package.json +14 -11
- package/dist/lib/buttons/DialogButton.d.ts +0 -7
- package/dist/lib/json/dialog/ItemDeleteDialog.d.ts +0 -17
- package/dist/lib/json/dialog/ItemEditDialog.d.ts +0 -32
- package/dist/lib/json/dialog/MultiQueryWrapperDialog.d.ts +0 -7
- package/dist/lib/json/dialog/QueryWrapperDialog.d.ts +0 -13
- package/dist/lib/layout/ButtonBar.d.ts +0 -19
- package/dist/lib/layout/menu/Menu.d.ts +0 -12
- package/dist/lib/layout/menu/MenuButton.d.ts +0 -6
- package/dist/lib/layout/menu/MenuConfig.d.ts +0 -13
- package/dist/lib/layout/menu/MenuItem.d.ts +0 -11
- package/dist/lib/layout/menu/NextMenuItem.d.ts +0 -11
- package/dist/lib/layout/menu/SelectedIndicator.d.ts +0 -3
- package/dist/lib/layout/menu/UserBlock.d.ts +0 -9
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ItemEditDialogProps } from "
|
|
1
|
+
import { ItemEditDialogProps } from "@compill/form-components";
|
|
2
2
|
export declare function EditItemView({ initialValues, ...props }: Omit<ItemEditDialogProps, "show">): JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ItemEditDialogProps } from "
|
|
1
|
+
import { ItemEditDialogProps } from "@compill/form-components";
|
|
2
2
|
import { DetailsViewConfig } from "./DetailsView";
|
|
3
3
|
import { MultiQueryWrapperConfig } from "./MultiQueryWrapper";
|
|
4
4
|
import { QueryWrapperConfig } from "./QueryWrapper";
|
|
@@ -3,11 +3,11 @@ import { FormRendererConfig } from "@compill/form";
|
|
|
3
3
|
import { TableProps } from "@compill/table";
|
|
4
4
|
import { ButtonProps, ModalProps } from "@valerya/ui";
|
|
5
5
|
import { Breadcrumb, QueryBreadcrumbs } from "../../breadcrumbs/BreadCrumbs";
|
|
6
|
-
import { ItemDeleteDialogProps } from "../dialog/ItemDeleteDialog";
|
|
7
6
|
import { EditItemDialogConfig } from "./EditItemDialog";
|
|
8
7
|
import { QueryWrapperDialogConfig } from "./QueryWrapperDialog";
|
|
9
8
|
import * as Yup from "yup";
|
|
10
9
|
import { MutationQueryFn, MutationQueryKey } from "@compill/api";
|
|
10
|
+
import { ItemDeleteDialogProps } from "@compill/form-components";
|
|
11
11
|
export type TableViewScreen = {
|
|
12
12
|
api: API<any>;
|
|
13
13
|
breadcrumbs?: Breadcrumb[] | QueryBreadcrumbs;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Color, ParentComponent, SoperioComponent } from "@soperio/react";
|
|
2
|
-
import {
|
|
2
|
+
import { SidebarMenuConfig } from "@brikka/layout";
|
|
3
3
|
interface LayoutProps extends SoperioComponent, ParentComponent {
|
|
4
4
|
color: Color;
|
|
5
5
|
darkMode?: boolean;
|
|
6
6
|
logo?: React.ReactNode;
|
|
7
7
|
title?: string;
|
|
8
|
-
menuConfig:
|
|
9
|
-
userMenuConfig?:
|
|
8
|
+
menuConfig: SidebarMenuConfig;
|
|
9
|
+
userMenuConfig?: SidebarMenuConfig;
|
|
10
10
|
userSettingsPath: string;
|
|
11
11
|
}
|
|
12
12
|
export declare function AdminLayout({ color, darkMode, logo, title, menuConfig, userMenuConfig, userSettingsPath, ...props }: LayoutProps): JSX.Element;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Color, ParentComponent, SoperioComponent } from "@soperio/react";
|
|
2
|
-
import {
|
|
2
|
+
import { SidebarMenuConfig } from "@brikka/layout";
|
|
3
3
|
interface SidebarProps extends SoperioComponent, ParentComponent {
|
|
4
4
|
show?: boolean;
|
|
5
5
|
color: Color;
|
|
6
6
|
darkMode?: boolean;
|
|
7
7
|
logo?: React.ReactNode;
|
|
8
8
|
title?: string;
|
|
9
|
-
menuConfig:
|
|
10
|
-
userMenuConfig?:
|
|
9
|
+
menuConfig: SidebarMenuConfig;
|
|
10
|
+
userMenuConfig?: SidebarMenuConfig;
|
|
11
11
|
userSettingsPath: string;
|
|
12
12
|
}
|
|
13
13
|
export declare function Sidebar({ show, logo, title, menuConfig, userMenuConfig, userSettingsPath, color, darkMode, ...props }: SidebarProps): JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DialogButtonProps } from "
|
|
1
|
+
import { DialogButtonProps } from "@compill/components";
|
|
2
2
|
export declare function TableRowDeleteButton({ children, ...props }: DialogButtonProps): JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DialogButtonProps } from "
|
|
1
|
+
import { DialogButtonProps } from "@compill/components";
|
|
2
2
|
export declare function TableRowEditButton({ children, ...props }: DialogButtonProps): JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@compill/admin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.116",
|
|
4
4
|
"private": false,
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -31,17 +31,20 @@
|
|
|
31
31
|
"yup": "^1.1.0",
|
|
32
32
|
"@soperio/react": "^1.0.24",
|
|
33
33
|
"@valerya/ui": "^1.0.27",
|
|
34
|
-
"@compill/admin-api": "^1.0.
|
|
35
|
-
"@compill/api": "^1.0.67",
|
|
36
|
-
"@compill/env": "^1.0.29",
|
|
37
|
-
"@compill/components": "^1.0.60",
|
|
38
|
-
"@compill/table": "^1.0.90",
|
|
39
|
-
"@compill/form-editor": "^1.0.32",
|
|
40
|
-
"@compill/form": "^1.0.77",
|
|
41
|
-
"@compill/editor": "^1.0.94",
|
|
42
|
-
"@compill/auth": "^1.0.90",
|
|
34
|
+
"@compill/admin-api": "^1.0.66",
|
|
43
35
|
"@soperio/jsx-runtime": "^1.0.24",
|
|
44
|
-
"@
|
|
36
|
+
"@brikka/layout": "^1.0.92",
|
|
37
|
+
"@compill/api": "^1.0.69",
|
|
38
|
+
"@compill/components": "^1.0.62",
|
|
39
|
+
"@compill/env": "^1.0.31",
|
|
40
|
+
"@compill/form": "^1.0.88",
|
|
41
|
+
"@compill/auth": "^1.0.96",
|
|
42
|
+
"@compill/editor": "^1.0.109",
|
|
43
|
+
"@compill/form-editor": "^1.0.37",
|
|
44
|
+
"@compill/hooks": "^1.0.56",
|
|
45
|
+
"@compill/table": "^1.0.91",
|
|
46
|
+
"@compill/form-components": "^1.0.0",
|
|
47
|
+
"@compill/components-state": "^1.0.0"
|
|
45
48
|
},
|
|
46
49
|
"publishConfig": {
|
|
47
50
|
"access": "public"
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ParentComponent, SoperioComponent } from "@soperio/react";
|
|
2
|
-
import { ButtonProps } from "@valerya/ui";
|
|
3
|
-
import React from "react";
|
|
4
|
-
export interface DialogButtonProps extends SoperioComponent, ParentComponent, ButtonProps {
|
|
5
|
-
buildDialog: (onClose: () => void) => React.ReactNode;
|
|
6
|
-
}
|
|
7
|
-
export declare function DialogButton({ buildDialog, ...props }: DialogButtonProps): JSX.Element;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { CRUDAPI } from "@compill/api";
|
|
2
|
-
import { ModalProps } from "@valerya/ui";
|
|
3
|
-
import React from "react";
|
|
4
|
-
export interface ItemDeleteDialogProps extends ModalProps {
|
|
5
|
-
itemLabel: string;
|
|
6
|
-
queryId: string;
|
|
7
|
-
api: CRUDAPI<any>;
|
|
8
|
-
apiFn?: string;
|
|
9
|
-
invalidateQueriesOnSuccess?: boolean;
|
|
10
|
-
invalidateQueryKey?: string[];
|
|
11
|
-
msg?: (itemLabel: string) => string | React.ReactNode;
|
|
12
|
-
actionButtonLabel?: string;
|
|
13
|
-
closeActionButtonLabel?: string;
|
|
14
|
-
title?: string;
|
|
15
|
-
onSuccess?: () => void;
|
|
16
|
-
}
|
|
17
|
-
export declare function ItemDeleteDialog({ title, actionButtonLabel, closeActionButtonLabel, itemLabel, queryId, api, apiFn, invalidateQueriesOnSuccess, invalidateQueryKey, size, md_boxSizing, msg, show, onClose, onSuccess, ...props }: ItemDeleteDialogProps): JSX.Element;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { CRUDAPI } from "@compill/api";
|
|
2
|
-
import { FormRendererConfig } from "@compill/form";
|
|
3
|
-
import { UseMutationOptions, UseQueryOptions } from "@tanstack/react-query";
|
|
4
|
-
import { ModalProps } from "@valerya/ui";
|
|
5
|
-
import { FormikConfig } from "formik";
|
|
6
|
-
import React from "react";
|
|
7
|
-
export interface ItemEditDialogProps<TFormData extends {} = any, TResultData extends {} = any> extends Omit<ModalProps, "id" | "children" | "title" | "position"> {
|
|
8
|
-
itemLabel?: string;
|
|
9
|
-
queryId?: string;
|
|
10
|
-
api: CRUDAPI<any>;
|
|
11
|
-
initialValues?: any;
|
|
12
|
-
queryFetchOptions?: UseQueryOptions;
|
|
13
|
-
querySaveOptions?: UseMutationOptions<TResultData, unknown, TFormData>;
|
|
14
|
-
onSuccess?: (item: TResultData, response: any) => void;
|
|
15
|
-
onFetchError?: () => void;
|
|
16
|
-
fetchErrorMsg?: string;
|
|
17
|
-
onSaveError?: (item: TFormData) => void;
|
|
18
|
-
saveErrorMsg?: string;
|
|
19
|
-
fetchToFormData?: (item: TResultData) => TFormData;
|
|
20
|
-
formToQueryData?: (TFormData: any) => Partial<TResultData>;
|
|
21
|
-
invalidateQueriesOnSuccess?: boolean;
|
|
22
|
-
invalidateQueryKey?: string[];
|
|
23
|
-
retryText?: string;
|
|
24
|
-
cancelLabel?: string;
|
|
25
|
-
saveLabel?: string;
|
|
26
|
-
title?: ((item?: TResultData) => string);
|
|
27
|
-
formikProps: Omit<FormikConfig<any>, "initialValues" | "onSubmit">;
|
|
28
|
-
form: React.ReactNode | FormRendererConfig | ((item: TResultData) => FormRendererConfig);
|
|
29
|
-
show: boolean;
|
|
30
|
-
onClose: () => void;
|
|
31
|
-
}
|
|
32
|
-
export declare function ItemEditDialog<TFormData extends {}, TResultData extends {}>({ initialValues, itemLabel, queryId, api, queryFetchOptions, querySaveOptions, onSuccess, onFetchError, fetchErrorMsg, onSaveError, saveErrorMsg, fetchToFormData, formToQueryData, invalidateQueriesOnSuccess, invalidateQueryKey, retryText, cancelLabel, saveLabel, size, title, form, show, onClose, formikProps, ...props }: ItemEditDialogProps<TFormData, TResultData>): JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { MultiQueryWrapperDialogConfig } from "../types/MultiQueryWrapperDialog";
|
|
2
|
-
export type MultiQueryWrapperDialogProps = Omit<MultiQueryWrapperDialogConfig, "type"> & {
|
|
3
|
-
queryId?: string;
|
|
4
|
-
onClose: () => void;
|
|
5
|
-
invalidateQueryKey?: string[];
|
|
6
|
-
};
|
|
7
|
-
export declare function MultiQueryWrapperDialog({ queries, config, onClose, queryId, invalidateQueryKey }: MultiQueryWrapperDialogProps): JSX.Element;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CRUDAPI, CRUD_MODEL } from "@compill/api";
|
|
2
|
-
import { QueryWrapperDialogConfig } from "../types/QueryWrapperDialog";
|
|
3
|
-
import { EditItemDialogConfig } from "../types/EditItemDialog";
|
|
4
|
-
export type QueryWrapperDialogProps<T extends CRUD_MODEL, U> = Omit<QueryWrapperDialogConfig<T, U>, "type"> & {
|
|
5
|
-
api: CRUDAPI<any>;
|
|
6
|
-
fn: "get" | "getTransformed" | "getAll" | "getAllTransformed";
|
|
7
|
-
transformFn?: (data: T) => U;
|
|
8
|
-
config: (data?: T | U) => Omit<EditItemDialogConfig, "type">;
|
|
9
|
-
onClose: () => void;
|
|
10
|
-
queryId?: string;
|
|
11
|
-
invalidateQueryKey?: string[];
|
|
12
|
-
};
|
|
13
|
-
export declare function QueryWrapperDialog<T extends CRUD_MODEL, U>({ api, fn, transformFn, config, onClose, queryId, invalidateQueryKey }: QueryWrapperDialogProps<T, U>): JSX.Element | null;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { DialogButtonProps } from "../buttons/DialogButton";
|
|
2
|
-
import { ParentComponent, SoperioComponent } from "@soperio/react";
|
|
3
|
-
import { ButtonProps } from "@valerya/ui";
|
|
4
|
-
import React from "react";
|
|
5
|
-
export declare function ButtonBar({ children, ...props }: ParentComponent & SoperioComponent): JSX.Element;
|
|
6
|
-
export type ButtonBarButtonProps = {
|
|
7
|
-
icon?: string;
|
|
8
|
-
} & ButtonProps;
|
|
9
|
-
export declare const ButtonBarButton: React.ForwardRefExoticComponent<{
|
|
10
|
-
icon?: string;
|
|
11
|
-
} & ButtonProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
-
export interface ButtonBarSubmitButtonProps extends ButtonBarButtonProps {
|
|
13
|
-
useDirty?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export declare const ButtonBarSubmitButton: React.ForwardRefExoticComponent<ButtonBarSubmitButtonProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
-
export type ButtonBarDialogButtonProps = {
|
|
17
|
-
icon?: string;
|
|
18
|
-
} & DialogButtonProps;
|
|
19
|
-
export declare function ButtonBarDialogButton({ icon, children, ...props }: ButtonBarDialogButtonProps): JSX.Element;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ParentComponent, SoperioComponent } from "@soperio/react";
|
|
2
|
-
import { MenuConfig } from "./MenuConfig";
|
|
3
|
-
export interface MenuProps extends SoperioComponent, ParentComponent {
|
|
4
|
-
darkMode?: boolean;
|
|
5
|
-
config: MenuConfig;
|
|
6
|
-
useNextRouter?: boolean;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
export declare function Menu({ darkMode, config, useNextRouter, ...props }: MenuProps): JSX.Element;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type MenuConfig = MenuItems;
|
|
2
|
-
export type MenuItems = (Item | MenuDivider)[];
|
|
3
|
-
export type Item = {
|
|
4
|
-
type: "item";
|
|
5
|
-
path: string;
|
|
6
|
-
icon?: string;
|
|
7
|
-
label: string;
|
|
8
|
-
children?: Item[];
|
|
9
|
-
};
|
|
10
|
-
export type MenuDivider = {
|
|
11
|
-
type: "divider";
|
|
12
|
-
label?: string;
|
|
13
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ParentComponent, SoperioComponent } from "@soperio/react";
|
|
2
|
-
import { Item } from "./MenuConfig";
|
|
3
|
-
interface MenuItemProps extends SoperioComponent, ParentComponent {
|
|
4
|
-
path: string;
|
|
5
|
-
depth?: number;
|
|
6
|
-
icon?: string;
|
|
7
|
-
darkMode?: boolean;
|
|
8
|
-
subMenu?: Item[];
|
|
9
|
-
}
|
|
10
|
-
export declare function MenuItem({ icon, path, depth, darkMode, subMenu, ...props }: MenuItemProps): JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ParentComponent, SoperioComponent } from "@soperio/react";
|
|
2
|
-
import { Item } from "./MenuConfig";
|
|
3
|
-
interface NextMenuItemProps extends SoperioComponent, ParentComponent {
|
|
4
|
-
path: string;
|
|
5
|
-
depth?: number;
|
|
6
|
-
icon?: string;
|
|
7
|
-
darkMode?: boolean;
|
|
8
|
-
subMenu?: Item[];
|
|
9
|
-
}
|
|
10
|
-
export declare function NextMenuItem({ icon, path, depth, darkMode, subMenu, ...props }: NextMenuItemProps): JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { MenuConfig } from "./MenuConfig";
|
|
2
|
-
interface UserBlockProps {
|
|
3
|
-
color: string;
|
|
4
|
-
darkMode?: boolean;
|
|
5
|
-
menuConfig?: MenuConfig;
|
|
6
|
-
path: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function UserBlock({ color, darkMode, menuConfig, path }: UserBlockProps): JSX.Element | null;
|
|
9
|
-
export {};
|