@compill/admin 1.0.104 → 1.0.105

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.
Files changed (165) hide show
  1. package/dist/index.cjs +2054 -0
  2. package/dist/index.d.cts +565 -0
  3. package/dist/index.d.ts +565 -50
  4. package/dist/index.js +2000 -50
  5. package/package.json +17 -16
  6. package/dist/lib/SectionTitle.d.ts +0 -2
  7. package/dist/lib/SectionTitle.js +0 -4
  8. package/dist/lib/breadcrumbs/BreadCrumbs.d.ts +0 -15
  9. package/dist/lib/breadcrumbs/BreadCrumbs.js +0 -29
  10. package/dist/lib/buttons/DialogButton.d.ts +0 -7
  11. package/dist/lib/buttons/DialogButton.js +0 -15
  12. package/dist/lib/buttons/InvalidateButton.d.ts +0 -6
  13. package/dist/lib/buttons/InvalidateButton.js +0 -11
  14. package/dist/lib/buttons/NavigateButton.d.ts +0 -4
  15. package/dist/lib/buttons/NavigateButton.js +0 -12
  16. package/dist/lib/buttons/PublishButton.d.ts +0 -9
  17. package/dist/lib/buttons/PublishButton.js +0 -17
  18. package/dist/lib/buttons/UpdateButton.d.ts +0 -2
  19. package/dist/lib/buttons/UpdateButton.js +0 -11
  20. package/dist/lib/buttons/ViewButton.d.ts +0 -5
  21. package/dist/lib/buttons/ViewButton.js +0 -13
  22. package/dist/lib/cells/OrderCell.d.ts +0 -11
  23. package/dist/lib/cells/OrderCell.js +0 -26
  24. package/dist/lib/json/DetailsView.d.ts +0 -5
  25. package/dist/lib/json/DetailsView.js +0 -69
  26. package/dist/lib/json/EditItemView.d.ts +0 -2
  27. package/dist/lib/json/EditItemView.js +0 -6
  28. package/dist/lib/json/MultiQueryWrapper.d.ts +0 -5
  29. package/dist/lib/json/MultiQueryWrapper.js +0 -61
  30. package/dist/lib/json/QueryWrapper.d.ts +0 -6
  31. package/dist/lib/json/QueryWrapper.js +0 -29
  32. package/dist/lib/json/ScreenRenderer.d.ts +0 -6
  33. package/dist/lib/json/ScreenRenderer.js +0 -19
  34. package/dist/lib/json/ScreenTopBar.d.ts +0 -15
  35. package/dist/lib/json/ScreenTopBar.js +0 -18
  36. package/dist/lib/json/TabbedView.d.ts +0 -3
  37. package/dist/lib/json/TabbedView.js +0 -21
  38. package/dist/lib/json/buttons/ActionButton.d.ts +0 -14
  39. package/dist/lib/json/buttons/ActionButton.js +0 -11
  40. package/dist/lib/json/buttons/ConfirmationActionButton.d.ts +0 -26
  41. package/dist/lib/json/buttons/ConfirmationActionButton.js +0 -20
  42. package/dist/lib/json/dialog/DialogRenderer.d.ts +0 -11
  43. package/dist/lib/json/dialog/DialogRenderer.js +0 -14
  44. package/dist/lib/json/dialog/ItemDeleteDialog.d.ts +0 -17
  45. package/dist/lib/json/dialog/ItemDeleteDialog.js +0 -14
  46. package/dist/lib/json/dialog/ItemEditDialog.d.ts +0 -32
  47. package/dist/lib/json/dialog/ItemEditDialog.js +0 -77
  48. package/dist/lib/json/dialog/MultiQueryWrapperDialog.d.ts +0 -7
  49. package/dist/lib/json/dialog/MultiQueryWrapperDialog.js +0 -23
  50. package/dist/lib/json/dialog/QueryWrapperDialog.d.ts +0 -13
  51. package/dist/lib/json/dialog/QueryWrapperDialog.js +0 -20
  52. package/dist/lib/json/table/RefreshButton.d.ts +0 -3
  53. package/dist/lib/json/table/RefreshButton.js +0 -11
  54. package/dist/lib/json/table/TableRowActionsView.d.ts +0 -11
  55. package/dist/lib/json/table/TableRowActionsView.js +0 -36
  56. package/dist/lib/json/table/TableRowPublishPostButton.d.ts +0 -8
  57. package/dist/lib/json/table/TableRowPublishPostButton.js +0 -20
  58. package/dist/lib/json/table/TableView.d.ts +0 -3
  59. package/dist/lib/json/table/TableView.js +0 -65
  60. package/dist/lib/json/table/TableViewContext.d.ts +0 -14
  61. package/dist/lib/json/table/TableViewContext.js +0 -58
  62. package/dist/lib/json/table/useTableProps.d.ts +0 -3
  63. package/dist/lib/json/table/useTableProps.js +0 -57
  64. package/dist/lib/json/types/DetailsView.d.ts +0 -57
  65. package/dist/lib/json/types/DetailsView.js +0 -1
  66. package/dist/lib/json/types/EditItemDialog.d.ts +0 -4
  67. package/dist/lib/json/types/EditItemDialog.js +0 -1
  68. package/dist/lib/json/types/MultiQueryWrapper.d.ts +0 -18
  69. package/dist/lib/json/types/MultiQueryWrapper.js +0 -1
  70. package/dist/lib/json/types/MultiQueryWrapperDialog.d.ts +0 -13
  71. package/dist/lib/json/types/MultiQueryWrapperDialog.js +0 -1
  72. package/dist/lib/json/types/QueryWrapper.d.ts +0 -27
  73. package/dist/lib/json/types/QueryWrapper.js +0 -1
  74. package/dist/lib/json/types/QueryWrapperDialog.d.ts +0 -22
  75. package/dist/lib/json/types/QueryWrapperDialog.js +0 -1
  76. package/dist/lib/json/types/ScreenConfig.d.ts +0 -8
  77. package/dist/lib/json/types/ScreenConfig.js +0 -1
  78. package/dist/lib/json/types/TabbedView.d.ts +0 -22
  79. package/dist/lib/json/types/TabbedView.js +0 -1
  80. package/dist/lib/json/types/TableView.d.ts +0 -117
  81. package/dist/lib/json/types/TableView.js +0 -1
  82. package/dist/lib/layout/AdminLayout.d.ts +0 -13
  83. package/dist/lib/layout/AdminLayout.js +0 -15
  84. package/dist/lib/layout/ButtonBar.d.ts +0 -19
  85. package/dist/lib/layout/ButtonBar.js +0 -19
  86. package/dist/lib/layout/Content.d.ts +0 -9
  87. package/dist/lib/layout/Content.js +0 -9
  88. package/dist/lib/layout/PageTitleBar.d.ts +0 -6
  89. package/dist/lib/layout/PageTitleBar.js +0 -4
  90. package/dist/lib/layout/Sidebar.d.ts +0 -20
  91. package/dist/lib/layout/Sidebar.js +0 -12
  92. package/dist/lib/layout/menu/Menu.d.ts +0 -12
  93. package/dist/lib/layout/menu/Menu.js +0 -23
  94. package/dist/lib/layout/menu/MenuButton.d.ts +0 -6
  95. package/dist/lib/layout/menu/MenuButton.js +0 -5
  96. package/dist/lib/layout/menu/MenuConfig.d.ts +0 -13
  97. package/dist/lib/layout/menu/MenuConfig.js +0 -1
  98. package/dist/lib/layout/menu/MenuItem.d.ts +0 -11
  99. package/dist/lib/layout/menu/MenuItem.js +0 -11
  100. package/dist/lib/layout/menu/NextMenuItem.d.ts +0 -11
  101. package/dist/lib/layout/menu/NextMenuItem.js +0 -11
  102. package/dist/lib/layout/menu/SelectedIndicator.d.ts +0 -3
  103. package/dist/lib/layout/menu/SelectedIndicator.js +0 -4
  104. package/dist/lib/layout/menu/UserBlock.d.ts +0 -9
  105. package/dist/lib/layout/menu/UserBlock.js +0 -34
  106. package/dist/lib/modal/AttachDialog.d.ts +0 -30
  107. package/dist/lib/modal/AttachDialog.js +0 -73
  108. package/dist/lib/modal/FormActionDialog.d.ts +0 -23
  109. package/dist/lib/modal/FormActionDialog.js +0 -20
  110. package/dist/lib/page/PageContainer.d.ts +0 -2
  111. package/dist/lib/page/PageContainer.js +0 -5
  112. package/dist/lib/page/PageContentEditor.d.ts +0 -4
  113. package/dist/lib/page/PageContentEditor.js +0 -10
  114. package/dist/lib/page/PageMain.d.ts +0 -2
  115. package/dist/lib/page/PageMain.js +0 -5
  116. package/dist/lib/page/PageQueryStateContainer.d.ts +0 -21
  117. package/dist/lib/page/PageQueryStateContainer.js +0 -16
  118. package/dist/lib/page/PageSectionTitle.d.ts +0 -2
  119. package/dist/lib/page/PageSectionTitle.js +0 -4
  120. package/dist/lib/page/PageSidebar.d.ts +0 -2
  121. package/dist/lib/page/PageSidebar.js +0 -4
  122. package/dist/lib/page/PageSidebarSection.d.ts +0 -4
  123. package/dist/lib/page/PageSidebarSection.js +0 -5
  124. package/dist/lib/page/PageStateContainer.d.ts +0 -7
  125. package/dist/lib/page/PageStateContainer.js +0 -7
  126. package/dist/lib/page/PageSubSectionTitle.d.ts +0 -2
  127. package/dist/lib/page/PageSubSectionTitle.js +0 -4
  128. package/dist/lib/page/PageTitle.d.ts +0 -2
  129. package/dist/lib/page/PageTitle.js +0 -4
  130. package/dist/lib/page/PageTopBar.d.ts +0 -13
  131. package/dist/lib/page/PageTopBar.js +0 -78
  132. package/dist/lib/status/StatusBadge.d.ts +0 -4
  133. package/dist/lib/status/StatusBadge.js +0 -21
  134. package/dist/lib/table/TableColumnButton.d.ts +0 -1
  135. package/dist/lib/table/TableColumnButton.js +0 -53
  136. package/dist/lib/table/TableContainer.d.ts +0 -10
  137. package/dist/lib/table/TableContainer.js +0 -6
  138. package/dist/lib/table/TableContainerContext.d.ts +0 -18
  139. package/dist/lib/table/TableContainerContext.js +0 -40
  140. package/dist/lib/table/TableCreateButton.d.ts +0 -4
  141. package/dist/lib/table/TableCreateButton.js +0 -7
  142. package/dist/lib/table/TableFilterButton.d.ts +0 -2
  143. package/dist/lib/table/TableFilterButton.js +0 -8
  144. package/dist/lib/table/TableFilters.d.ts +0 -9
  145. package/dist/lib/table/TableFilters.js +0 -27
  146. package/dist/lib/table/TableMassActions.d.ts +0 -6
  147. package/dist/lib/table/TableMassActions.js +0 -9
  148. package/dist/lib/table/TableRowActionBar.d.ts +0 -10
  149. package/dist/lib/table/TableRowActionBar.js +0 -8
  150. package/dist/lib/table/TableRowActionButton.d.ts +0 -4
  151. package/dist/lib/table/TableRowActionButton.js +0 -5
  152. package/dist/lib/table/TableRowActionDialogButton.d.ts +0 -4
  153. package/dist/lib/table/TableRowActionDialogButton.js +0 -6
  154. package/dist/lib/table/TableRowDeleteButton.d.ts +0 -2
  155. package/dist/lib/table/TableRowDeleteButton.js +0 -6
  156. package/dist/lib/table/TableRowEditButton.d.ts +0 -2
  157. package/dist/lib/table/TableRowEditButton.js +0 -6
  158. package/dist/lib/table/TableRowNavigateButton.d.ts +0 -4
  159. package/dist/lib/table/TableRowNavigateButton.js +0 -14
  160. package/dist/lib/table/TableRowPublishPostButton.d.ts +0 -8
  161. package/dist/lib/table/TableRowPublishPostButton.js +0 -19
  162. package/dist/lib/table/TableRowViewButton.d.ts +0 -4
  163. package/dist/lib/table/TableRowViewButton.js +0 -13
  164. package/dist/lib/table/TableTopBar.d.ts +0 -8
  165. package/dist/lib/table/TableTopBar.js +0 -5
@@ -1,57 +0,0 @@
1
- import { API } from "@compill/admin-api";
2
- import * as Yup from "yup";
3
- import { Breadcrumb } from "../../breadcrumbs/BreadCrumbs.js";
4
- import { FormRendererConfig } from "@compill/form";
5
- import { CRUDAPI } from "@compill/api";
6
- export type DetailsViewConfig<T = any> = {
7
- type: "details";
8
- api: CRUDAPI<T> | API<T>;
9
- queryField: string;
10
- useNextRouter?: boolean;
11
- processInput?: (input: T) => any;
12
- screen: Screen | ((data: T) => Screen);
13
- };
14
- type Screen = {
15
- invalidateParentQueryKey?: string[];
16
- invalidatePage?: string;
17
- breadcrumbs?: Breadcrumb[];
18
- initialValues: any | ((data: any) => any);
19
- schema: Yup.Schema;
20
- header?: React.ReactNode;
21
- sections?: DetailSection[];
22
- buttonBar?: DetailViewButton[];
23
- } & ({
24
- type: "form";
25
- } | {
26
- type?: "post" | "section";
27
- editor?: DetailEditor;
28
- editorFooter?: React.ReactNode;
29
- });
30
- type DetailEditor = {
31
- type?: "blockEditor";
32
- name: string;
33
- } | {
34
- type?: "textarea";
35
- name: string;
36
- };
37
- export type DetailSection = {
38
- type: "section";
39
- title?: string;
40
- form: FormRendererConfig | ((item: any) => FormRendererConfig);
41
- } | {
42
- type: "custom";
43
- component: ((item: any) => React.ReactNode);
44
- };
45
- export type DetailViewButton = {
46
- type: "invalidate";
47
- pathOrPermalink: string;
48
- } | {
49
- type: "link";
50
- path: string;
51
- icon?: string;
52
- label?: string;
53
- } | {
54
- type: "custom";
55
- render: (item: any) => React.ReactNode;
56
- };
57
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- import { ItemEditDialogProps } from "../dialog/ItemEditDialog.js";
2
- export type EditItemDialogConfig = Omit<ItemEditDialogProps, "show" | "onClose"> & {
3
- type: "dialog";
4
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,18 +0,0 @@
1
- import { CRUDAPI } from "@compill/api";
2
- import { DetailsViewConfig } from "./DetailsView.js";
3
- import { TabbedViewConfig } from "./TabbedView.js";
4
- import { TableViewConfig } from "./TableView.js";
5
- type SubScreen = TableViewConfig | DetailsViewConfig | TabbedViewConfig;
6
- export type QueryDef = {
7
- api: CRUDAPI<any> | ((id: string) => CRUDAPI<any>);
8
- fn: "get" | "getAll";
9
- queryField?: string;
10
- transformFn?: (data: any) => any;
11
- params?: any;
12
- };
13
- export type MultiQueryWrapperConfig = {
14
- type: "multiQuery";
15
- queries: QueryDef[];
16
- config: (...data: any[]) => SubScreen;
17
- };
18
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,13 +0,0 @@
1
- import { CRUDAPI } from "@compill/api";
2
- import { EditItemDialogConfig } from "./EditItemDialog.js";
3
- export type QueryDef = {
4
- api: CRUDAPI<any>;
5
- fn: "get" | "getAll";
6
- transformFn?: (data: any) => any;
7
- cache?: boolean;
8
- };
9
- export type MultiQueryWrapperDialogConfig = {
10
- type: "multiQuery";
11
- queries: QueryDef[];
12
- config: (...data: any[]) => Omit<EditItemDialogConfig, "type">;
13
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,27 +0,0 @@
1
- import { CRUDAPI, CRUD_MODEL } from "@compill/api";
2
- import { DetailsViewConfig } from "./DetailsView.js";
3
- import { TabbedViewConfig } from "./TabbedView.js";
4
- import { TableViewConfig } from "./TableView.js";
5
- type SubScreen<T extends CRUD_MODEL, U> = TableViewConfig | DetailsViewConfig | TabbedViewConfig | QueryWrapperConfig<T, U>;
6
- export type QueryWrapperConfig<T extends CRUD_MODEL, U = T> = {
7
- type: "query";
8
- api: CRUDAPI<T> | ((id: string | number) => CRUDAPI<T>);
9
- queryField?: string;
10
- } & ({
11
- fn: "get";
12
- transformFn?: undefined;
13
- config: (data: T) => SubScreen<T, U>;
14
- } | {
15
- fn: "getTransformed";
16
- transformFn: (data: T) => U;
17
- config: (data: U) => SubScreen<T, U>;
18
- } | {
19
- fn: "getAll";
20
- transformFn?: undefined;
21
- config: (data: T[]) => SubScreen<T, U>;
22
- } | {
23
- fn: "getAllTransformed";
24
- transformFn: (data: T[]) => U;
25
- config: (data: U) => SubScreen<T, U>;
26
- });
27
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,22 +0,0 @@
1
- import { CRUDAPI, CRUD_MODEL } from "@compill/api";
2
- import { EditItemDialogConfig } from "./EditItemDialog.js";
3
- export type QueryWrapperDialogConfig<T extends CRUD_MODEL, U = T> = {
4
- type: "query";
5
- api: CRUDAPI<any>;
6
- } & ({
7
- fn: "get";
8
- transformFn?: undefined;
9
- config: (data: T) => Omit<EditItemDialogConfig, "type">;
10
- } | {
11
- fn: "getTransformed";
12
- transformFn: (data: T) => U;
13
- config: (data: U) => Omit<EditItemDialogConfig, "type">;
14
- } | {
15
- fn: "getAll";
16
- transformFn?: undefined;
17
- config: (data: T[]) => Omit<EditItemDialogConfig, "type">;
18
- } | {
19
- fn: "getAllTransformed";
20
- transformFn: (data: T[]) => U;
21
- config: (data: U) => Omit<EditItemDialogConfig, "type">;
22
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- import { ItemEditDialogProps } from "../dialog/ItemEditDialog.js";
2
- import { DetailsViewConfig } from "./DetailsView.js";
3
- import { MultiQueryWrapperConfig } from "./MultiQueryWrapper.js";
4
- import { QueryWrapperConfig } from "./QueryWrapper.js";
5
- import { TabbedViewConfig } from "./TabbedView.js";
6
- import { TableViewConfig } from "./TableView.js";
7
- export type ScreenConfig = TableViewConfig | DetailsViewConfig | TabbedViewConfig | QueryWrapperConfig<any, any> | MultiQueryWrapperConfig;
8
- export type TableViewEditItem = Omit<ItemEditDialogProps, "show" | "onClose">;
@@ -1 +0,0 @@
1
- export {};
@@ -1,22 +0,0 @@
1
- import { CRUDAPI } from "@compill/api";
2
- import { Breadcrumb } from "../../breadcrumbs/BreadCrumbs.js";
3
- import { DetailsViewConfig } from "./DetailsView.js";
4
- import { QueryWrapperConfig } from "./QueryWrapper.js";
5
- import { TableViewConfig } from "./TableView.js";
6
- import { MultiQueryWrapperConfig } from "./MultiQueryWrapper.js";
7
- export type TabbedViewConfig<T extends any = any> = {
8
- type: "tabbed";
9
- queryField: string;
10
- api: CRUDAPI<any>;
11
- screen: Screen | ((data: T) => Screen);
12
- };
13
- type Screen = {
14
- breadcrumbs: Breadcrumb[];
15
- tabs: Tab[];
16
- };
17
- export type Tab = {
18
- label: string;
19
- config?: TableViewConfig | DetailsViewConfig | QueryWrapperConfig<any> | MultiQueryWrapperConfig | TabbedViewConfig;
20
- component?: () => React.ReactNode;
21
- };
22
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,117 +0,0 @@
1
- import { API } from "@compill/admin-api";
2
- import { FormRendererConfig } from "@compill/form";
3
- import { TableProps } from "@compill/table";
4
- import { ButtonProps, ModalProps } from "@valerya/ui";
5
- import { Breadcrumb, QueryBreadcrumbs } from "../../breadcrumbs/BreadCrumbs.js";
6
- import { ItemDeleteDialogProps } from "../dialog/ItemDeleteDialog.js";
7
- import { EditItemDialogConfig } from "./EditItemDialog.js";
8
- import { QueryWrapperDialogConfig } from "./QueryWrapperDialog.js";
9
- import * as Yup from "yup";
10
- import { MutationQueryFn, MutationQueryKey } from "@compill/api";
11
- export type TableViewScreen = {
12
- api: API<any>;
13
- breadcrumbs?: Breadcrumb[] | QueryBreadcrumbs;
14
- buttonBar?: TableViewButtonConfig[];
15
- filters?: TableFilters;
16
- massActions?: TableMassActions;
17
- createView?: TableViewEditView | ((data?: any) => TableViewEditView);
18
- editView?: TableViewEditView | ((item: any) => TableViewEditView);
19
- deleteItem?: TableViewDeleteItem | ((item: any) => TableViewDeleteItem);
20
- table: TableViewTable;
21
- rowActions?: TableRowAction[] | ((item: any) => TableRowAction[]);
22
- queryParams?: any;
23
- };
24
- export type TableViewConfig = {
25
- type: "table";
26
- title: string;
27
- subtitle?: string | React.ReactNode | ((data: any) => string | React.ReactNode);
28
- queryField?: string;
29
- screen: TableViewScreen | ((id: string) => TableViewScreen);
30
- };
31
- export type CustomDialog = {
32
- type: "customDialog";
33
- render: (props: ModalProps) => React.ReactNode;
34
- };
35
- export type TableViewEditView = CustomDialog | EditItemDialogConfig | QueryWrapperDialogConfig<any>;
36
- export type TableViewTable = Omit<TableProps, "onRowClick" | "queryKey" | "queryFn" | "queryFilters"> & {
37
- filtersMethod?: "internal" | "nextRouter" | "reactRouter";
38
- initialVisibleColumns?: string[];
39
- onRowClick?: {
40
- type: "navigate" | "nextpush" | "link";
41
- path: string | ((item: any) => string);
42
- };
43
- };
44
- export type TableViewDeleteItem = Omit<ItemDeleteDialogProps, "show" | "onClose" | "itemLabel" | "queryId"> & {
45
- itemLabel: string | ((item: any) => string);
46
- };
47
- export type TableRowAction = {
48
- type: "link";
49
- path: string | ((item: any) => string);
50
- } | {
51
- type: "view";
52
- path: string | ((item: any) => string);
53
- } | {
54
- type: "edit";
55
- } | {
56
- type: "delete";
57
- msg?: (itemLabel: string) => (string | React.ReactNode);
58
- } | {
59
- type: "publish";
60
- api?: API<any>;
61
- } | {
62
- type: "custom";
63
- component: (item: any, queryKey: string[], icon?: string, label?: string) => React.ReactNode;
64
- icon?: string;
65
- label?: string;
66
- };
67
- export type TableViewButtonBar = TableViewButtonConfig[];
68
- type TableViewButtonConfig = {
69
- type: "create";
70
- data?: any;
71
- label?: string;
72
- icon?: string;
73
- } | {
74
- type: "invalidate";
75
- pathOrPermalink: string;
76
- } | {
77
- type: "custom";
78
- render: () => React.ReactNode;
79
- };
80
- type TableFilters = {
81
- form: FormRendererConfig;
82
- initialValues: any | ((data: any) => any);
83
- schema?: Yup.AnySchema;
84
- processInput?: (input: any) => any;
85
- };
86
- type TableMassActions = {
87
- items: MassAction[];
88
- };
89
- export type MassAction = ({
90
- type: "custom";
91
- render: (selectedRows: any[]) => React.ReactNode;
92
- } | {
93
- type: "select";
94
- provider?: Record<string, any>[] | ((selectedRows: any) => Record<string, any>[]);
95
- labelField?: string;
96
- valueField?: string;
97
- queryFn: MutationQueryFn<any, any>;
98
- queryKey: MutationQueryKey;
99
- } | {
100
- type: "dynamicChoiceList";
101
- } | {
102
- type: "button";
103
- label: string;
104
- icon?: string;
105
- buttonProps?: ButtonProps;
106
- queryFn: MutationQueryFn<any, any>;
107
- queryKey: MutationQueryKey;
108
- invalidateParent?: boolean;
109
- showConfirmationDialog?: boolean;
110
- confirmationDialogTitle?: string;
111
- confirmationDialogText?: string;
112
- confirmationDialogPositiveButtonLabel?: string;
113
- confirmationDialogNegativeButtonLabel?: string;
114
- successMsg?: (rows: any[]) => string;
115
- errorMsg?: (rows: any[]) => string;
116
- });
117
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,13 +0,0 @@
1
- import { Color, ParentComponent, SoperioComponent } from "@soperio/react";
2
- import { MenuConfig } from "./menu/MenuConfig.js";
3
- interface LayoutProps extends SoperioComponent, ParentComponent {
4
- color: Color;
5
- darkMode?: boolean;
6
- logo?: React.ReactNode;
7
- title?: string;
8
- menuConfig: MenuConfig;
9
- userMenuConfig?: MenuConfig;
10
- userSettingsPath: string;
11
- }
12
- export declare function AdminLayout({ color, darkMode, logo, title, menuConfig, userMenuConfig, userSettingsPath, ...props }: LayoutProps): JSX.Element;
13
- export {};
@@ -1,15 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@soperio/jsx-runtime";
2
- import { useBoolean } from "@compill/hooks";
3
- import { mdiArrowLeft } from "@mdi/js";
4
- import { IconButton } from "@valerya/ui";
5
- import { useHotkeys } from "react-hotkeys-hook";
6
- import Content from "./Content.js";
7
- import { Sidebar } from "./Sidebar.js";
8
- export function AdminLayout({ color, darkMode, logo, title, menuConfig, userMenuConfig, userSettingsPath, ...props }) {
9
- return (_jsxs("div", { w: "full", h: "screen", dflex: true, flexRow: true, bgColor: `${color}-${darkMode ? "900" : "100"}`, ...props, children: [_jsx(LeftPanel, { color: color, darkMode: darkMode, logo: logo, title: title, menuConfig: menuConfig, userMenuConfig: userMenuConfig, userSettingsPath: userSettingsPath }), _jsx("div", { w: "screen", py: "2", pe: "2", children: _jsx(Content, { bgColor: "white", rounded: "lg", shadow: true }) })] }));
10
- }
11
- function LeftPanel({ color, darkMode, logo, title, menuConfig, userMenuConfig, userSettingsPath }) {
12
- const [isOpen, __, toggle] = useBoolean(true);
13
- useHotkeys('ctrl+t', () => toggle(), [toggle]);
14
- return (_jsxs("div", { ms: isOpen ? "0" : "-14.5rem", transition: "all", duration: "500", transform: true, children: [_jsx(Sidebar, { flexShrink: "0", color: color, darkMode: darkMode, logo: logo, title: title, menuConfig: menuConfig, userMenuConfig: userMenuConfig, userSettingsPath: userSettingsPath }), _jsx(IconButton, { icon: mdiArrowLeft, transition: "all", duration: "500", transform: true, rotate: isOpen ? "0" : "180", position: "absolute", bottom: "14", end: "-5", size: "lg", corners: "pill", onClick: toggle, z: "100" })] }));
15
- }
@@ -1,19 +0,0 @@
1
- import { DialogButtonProps } from "../buttons/DialogButton.js";
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,19 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@soperio/jsx-runtime";
2
- import { DialogButton } from "../buttons/DialogButton.js";
3
- import { Button, Icon } from "@valerya/ui";
4
- import { useFormikContext } from "formik";
5
- import React from "react";
6
- export function ButtonBar({ children, ...props }) {
7
- return (_jsx("div", { dflex: true, border: "1px", borderColor: "zinc-200", divideX: "1px", divideColor: "zinc-200", rounded: "lg", overflow: "hidden", ...props, children: children }));
8
- }
9
- export const ButtonBarButton = React.forwardRef(function ({ icon, children, ...props }, ref) {
10
- return (_jsxs(Button, { scheme: "dark", size: "sm", aspectRatio: icon && !children ? "square" : undefined, variant: "borderless", dflex: true, alignItems: "center", placeContent: "center", corners: "square", gap: "2", ...props, ref: ref, children: [icon && _jsx(Icon, { path: icon }), children] }));
11
- });
12
- export const ButtonBarSubmitButton = React.forwardRef(function ({ useDirty, disabled, icon, children, ...props }, ref) {
13
- const { dirty, handleSubmit } = useFormikContext() ?? { dirty: false, handleSubmit: undefined, values: {} };
14
- const onSubmit = React.useCallback(() => handleSubmit(), [handleSubmit]);
15
- return (_jsxs(Button, { scheme: "dark", size: "sm", aspectRatio: icon && !children ? "square" : undefined, variant: "borderless", dflex: true, alignItems: "center", placeContent: "center", corners: "square", gap: "2", disabled: (useDirty && !dirty) || disabled, onClick: onSubmit, ...props, ref: ref, children: [icon && _jsx(Icon, { path: icon }), children] }));
16
- });
17
- export function ButtonBarDialogButton({ icon, children, ...props }) {
18
- return (_jsxs(DialogButton, { scheme: "dark", size: "sm", aspectRatio: icon && !children ? "square" : undefined, variant: "borderless", dflex: true, alignItems: "center", placeContent: "center", corners: "square", gap: "2", ...props, children: [icon && _jsx(Icon, { path: icon }), children] }));
19
- }
@@ -1,9 +0,0 @@
1
- import { SoperioComponent, ParentComponent } from "@soperio/react";
2
- interface ContentProps extends SoperioComponent, ParentComponent {
3
- }
4
- /**
5
- *
6
- *
7
- */
8
- export default function Content({ ...props }: ContentProps): JSX.Element;
9
- export {};
@@ -1,9 +0,0 @@
1
- import { jsx as _jsx } from "@soperio/jsx-runtime";
2
- import { Outlet } from "react-router-dom";
3
- /**
4
- *
5
- *
6
- */
7
- export default function Content({ ...props }) {
8
- return (_jsx("div", { w: "100%", h: "100%", overflowY: "auto", ...props, children: _jsx(Outlet, {}) }));
9
- }
@@ -1,6 +0,0 @@
1
- import { ParentComponent, SoperioComponent } from "@soperio/react";
2
- interface TableTopBarProps extends SoperioComponent, ParentComponent {
3
- title?: string;
4
- }
5
- export declare function PageTitleBar({ title, children, ...props }: TableTopBarProps): JSX.Element;
6
- export {};
@@ -1,4 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@soperio/jsx-runtime";
2
- export function PageTitleBar({ title, children, ...props }) {
3
- return (_jsxs("div", { dflex: true, flexRow: true, alignItems: "center", gap: "3", p: "8", ...props, children: [title && _jsx("h2", { textSize: "x2", fontWeight: "600", textColor: "#3f4254", textTransform: "capitalize", children: title }), _jsx("div", { flexGrow: true, children: "\u00A0" }), children] }));
4
- }
@@ -1,20 +0,0 @@
1
- import { Color, ParentComponent, SoperioComponent } from "@soperio/react";
2
- import { MenuConfig } from "./menu/MenuConfig.js";
3
- interface SidebarProps extends SoperioComponent, ParentComponent {
4
- show?: boolean;
5
- color: Color;
6
- darkMode?: boolean;
7
- logo?: React.ReactNode;
8
- title?: string;
9
- menuConfig: MenuConfig;
10
- userMenuConfig?: MenuConfig;
11
- userSettingsPath: string;
12
- }
13
- export declare function Sidebar({ show, logo, title, menuConfig, userMenuConfig, userSettingsPath, color, darkMode, ...props }: SidebarProps): JSX.Element;
14
- interface LogoProps extends SoperioComponent, ParentComponent {
15
- width: number;
16
- height: number;
17
- darkMode?: boolean;
18
- }
19
- export default function Logo({ width, height, darkMode, ...props }: LogoProps): JSX.Element;
20
- export {};
@@ -1,12 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@soperio/jsx-runtime";
2
- import { FlexCenter } from "@compill/components";
3
- import { Menu } from "./menu/Menu.js";
4
- import { AppEnv } from "@compill/env";
5
- import Image from "next/image";
6
- import { UserBlock } from "./menu/UserBlock.js";
7
- export function Sidebar({ show, logo, title, menuConfig, userMenuConfig, userSettingsPath, color, darkMode, ...props }) {
8
- return (_jsxs("div", { dflex: true, flexCol: true, w: "full", md_w: "64", minH: "screen", p: "0", textColor: darkMode ? "white" : "slate-800", ...props, children: [_jsxs(FlexCenter, { placeContent: "start", p: "4", font: "title", gap: "3", borderB: "px", borderBColor: "slate-900", borderOpacity: "5", children: [logo ?? _jsx(Logo, { width: 40, height: 40, darkMode: darkMode }), _jsx("h1", { textSize: "md", children: title || AppEnv.appName() })] }), _jsx(Menu, { overflowY: "auto", flexGrow: "1", p: "4", darkMode: darkMode, config: menuConfig }), _jsx("div", { p: "2", children: _jsx(UserBlock, { darkMode: darkMode, color: color, menuConfig: userMenuConfig, path: userSettingsPath }) })] }));
9
- }
10
- export default function Logo({ width, height, darkMode, ...props }) {
11
- return (_jsx("div", { ...props, children: _jsx(Image, { src: `/logo_${darkMode ? "light" : "dark"}.png`, alt: AppEnv.appName() || "", width: width, height: height, priority: true, unoptimized: true }) }));
12
- }
@@ -1,12 +0,0 @@
1
- import { ParentComponent, SoperioComponent } from "@soperio/react";
2
- import { MenuConfig } from "./MenuConfig.js";
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,23 +0,0 @@
1
- import { jsx as _jsx } from "@soperio/jsx-runtime";
2
- import { MenuItem } from "./MenuItem.js";
3
- import { NextMenuItem } from "./NextMenuItem.js";
4
- /**
5
- *
6
- *
7
- */
8
- export function Menu({ darkMode, config, useNextRouter, ...props }) {
9
- const Comp = useNextRouter ? NextMenuItem : MenuItem;
10
- return (_jsx("ul", { ...props, children: config.map((item, index) => {
11
- if (item.type == "divider")
12
- return _jsx(Divider, { title: item.label }, index);
13
- if (item.type == "item") {
14
- return (_jsx(Comp, { icon: item.icon, path: item.path, depth: 0, darkMode: darkMode, subMenu: item.children, children: item.label }, index));
15
- }
16
- }) }));
17
- }
18
- function Divider({ title }) {
19
- return (_jsx("div", { px: "2", mt: "5", mb: "2", opacity: "75", textTransform: "capitalize", letterSpacing: "widest", fontWeight: "700", textSize: "xs", children: title }));
20
- }
21
- function CategoryItem({ children, ...props }) {
22
- return (_jsx("li", { ps: "5", py: "2", mt: "5", textSize: "sm", textColor: "white", textOpacity: "80", fontWeight: "600", textTransform: "uppercase", children: children }));
23
- }
@@ -1,6 +0,0 @@
1
- import { ButtonProps } from "@valerya/ui";
2
- export declare function MenuButton({ depth, darkMode, icon, selected, children, ...props }: {
3
- depth?: number;
4
- icon?: string;
5
- darkMode?: boolean;
6
- } & ButtonProps): JSX.Element;
@@ -1,5 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@soperio/jsx-runtime";
2
- import { Button, Icon } from "@valerya/ui";
3
- export function MenuButton({ depth, darkMode, icon, selected, children, ...props }) {
4
- return (_jsxs(Button, { as: "li", minH: "8", ms: `${(depth ?? 0) * 2}`, p: "2", font: "title", textColor: darkMode ? "white" : "black", fontWeight: "600", rounded: "lg", textSize: "sm", variant: "borderless", hover_bgColor: darkMode ? "white" : "black", hover_bgOpacity: "10", hover_textColor: darkMode ? "white" : "zinc-800", cursor: "pointer", dflex: true, alignItems: "center", gap: "3", ...props, children: [icon && _jsx(Icon, { path: icon, opacity: selected ? "100" : "60" }), children] }));
5
- }
@@ -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 +0,0 @@
1
- export {};
@@ -1,11 +0,0 @@
1
- import { ParentComponent, SoperioComponent } from "@soperio/react";
2
- import { Item } from "./MenuConfig.js";
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 { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@soperio/jsx-runtime";
2
- import { SelectedIndicator } from "./SelectedIndicator.js";
3
- import { Link, useLocation, useMatch } from "react-router-dom";
4
- import { MenuButton } from "./MenuButton.js";
5
- export function MenuItem({ icon, path, depth, darkMode, subMenu, ...props }) {
6
- const location = useLocation();
7
- const selected = path == "/" ? location.pathname == "/" : location.pathname.startsWith(path.startsWith("/") ? path : `/${path}`);
8
- const match = useMatch("/" + path) != null;
9
- // const selected = match != null
10
- return (_jsxs(_Fragment, { children: [_jsxs(Link, { to: path, style: { position: "relative" }, children: [_jsx(MenuButton, { depth: depth, darkMode: darkMode, icon: icon, selected: selected, ...props }), match && _jsx(SelectedIndicator, { darkMode: darkMode })] }), subMenu?.map((item, index) => (_jsx(MenuItem, { icon: item.icon, path: item.path, depth: (depth ?? 0) + 1, darkMode: darkMode, subMenu: item.children, children: item.label }, index)))] }));
11
- }
@@ -1,11 +0,0 @@
1
- import { ParentComponent, SoperioComponent } from "@soperio/react";
2
- import { Item } from "./MenuConfig.js";
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,11 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@soperio/jsx-runtime";
2
- import { MenuButton } from "./MenuButton.js";
3
- import { SelectedIndicator } from "./SelectedIndicator.js";
4
- import Link from "next/link";
5
- import { useRouter } from "next/router";
6
- export function NextMenuItem({ icon, path, depth, darkMode, subMenu, ...props }) {
7
- const { pathname } = useRouter();
8
- const selected = path == "/" ? pathname == "/" : pathname.startsWith(path.startsWith("/") ? path : `/${path}`);
9
- const match = path == "/" ? pathname == "/" : pathname == (path.startsWith("/") ? path : `/${path}`);
10
- return (_jsxs(_Fragment, { children: [_jsxs(Link, { href: path, style: { position: "relative" }, children: [_jsx(MenuButton, { depth: depth, darkMode: darkMode, icon: icon, selected: selected, ...props }), match && _jsx(SelectedIndicator, { darkMode: darkMode })] }), subMenu?.map((item, index) => (_jsx(NextMenuItem, { icon: item.icon, path: item.path, depth: (depth ?? 0) + 1, darkMode: darkMode, subMenu: item.children, children: item.label }, index)))] }));
11
- }
@@ -1,3 +0,0 @@
1
- export declare function SelectedIndicator({ darkMode }: {
2
- darkMode?: boolean;
3
- }): JSX.Element;
@@ -1,4 +0,0 @@
1
- import { jsx as _jsx } from "@soperio/jsx-runtime";
2
- export function SelectedIndicator({ darkMode }) {
3
- return (_jsx("div", { position: "absolute", bgColor: darkMode ? "white" : "black", bgOpacity: "90", w: "0.5", h: "6", top: "1.5", start: "-4" }));
4
- }
@@ -1,9 +0,0 @@
1
- import { MenuConfig } from "./MenuConfig.js";
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 {};