@compill/admin 1.0.107 → 1.0.109

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 (86) hide show
  1. package/dist/index.cjs +2115 -0
  2. package/dist/index.d.ts +50 -565
  3. package/dist/index.js +605 -592
  4. package/dist/lib/SectionTitle.d.ts +2 -0
  5. package/dist/lib/breadcrumbs/BreadCrumbs.d.ts +15 -0
  6. package/dist/lib/buttons/DialogButton.d.ts +7 -0
  7. package/dist/lib/buttons/InvalidateButton.d.ts +6 -0
  8. package/dist/lib/buttons/NavigateButton.d.ts +4 -0
  9. package/dist/lib/buttons/PublishButton.d.ts +9 -0
  10. package/dist/lib/buttons/UpdateButton.d.ts +2 -0
  11. package/dist/lib/buttons/ViewButton.d.ts +5 -0
  12. package/dist/lib/cells/OrderCell.d.ts +11 -0
  13. package/dist/lib/json/DetailsView.d.ts +5 -0
  14. package/dist/lib/json/EditItemView.d.ts +2 -0
  15. package/dist/lib/json/MultiQueryWrapper.d.ts +5 -0
  16. package/dist/lib/json/QueryWrapper.d.ts +6 -0
  17. package/dist/lib/json/ScreenRenderer.d.ts +6 -0
  18. package/dist/lib/json/ScreenTopBar.d.ts +15 -0
  19. package/dist/lib/json/TabbedView.d.ts +3 -0
  20. package/dist/lib/json/buttons/ActionButton.d.ts +14 -0
  21. package/dist/lib/json/buttons/ConfirmationActionButton.d.ts +26 -0
  22. package/dist/lib/json/dialog/DialogRenderer.d.ts +11 -0
  23. package/dist/lib/json/dialog/ItemDeleteDialog.d.ts +17 -0
  24. package/dist/lib/json/dialog/ItemEditDialog.d.ts +32 -0
  25. package/dist/lib/json/dialog/MultiQueryWrapperDialog.d.ts +7 -0
  26. package/dist/lib/json/dialog/QueryWrapperDialog.d.ts +13 -0
  27. package/dist/lib/json/table/RefreshButton.d.ts +3 -0
  28. package/dist/lib/json/table/TableRowActionsView.d.ts +11 -0
  29. package/dist/lib/json/table/TableRowPublishPostButton.d.ts +8 -0
  30. package/dist/lib/json/table/TableView.d.ts +3 -0
  31. package/dist/lib/json/table/TableViewContext.d.ts +14 -0
  32. package/dist/lib/json/table/useTableProps.d.ts +3 -0
  33. package/dist/lib/json/types/DetailsView.d.ts +57 -0
  34. package/dist/lib/json/types/EditItemDialog.d.ts +4 -0
  35. package/dist/lib/json/types/MultiQueryWrapper.d.ts +18 -0
  36. package/dist/lib/json/types/MultiQueryWrapperDialog.d.ts +13 -0
  37. package/dist/lib/json/types/QueryWrapper.d.ts +27 -0
  38. package/dist/lib/json/types/QueryWrapperDialog.d.ts +22 -0
  39. package/dist/lib/json/types/ScreenConfig.d.ts +8 -0
  40. package/dist/lib/json/types/TabbedView.d.ts +22 -0
  41. package/dist/lib/json/types/TableView.d.ts +117 -0
  42. package/dist/lib/layout/AdminLayout.d.ts +13 -0
  43. package/dist/lib/layout/ButtonBar.d.ts +19 -0
  44. package/dist/lib/layout/Content.d.ts +9 -0
  45. package/dist/lib/layout/PageTitleBar.d.ts +6 -0
  46. package/dist/lib/layout/Sidebar.d.ts +20 -0
  47. package/dist/lib/layout/menu/Menu.d.ts +12 -0
  48. package/dist/lib/layout/menu/MenuButton.d.ts +6 -0
  49. package/dist/lib/layout/menu/MenuConfig.d.ts +13 -0
  50. package/dist/lib/layout/menu/MenuItem.d.ts +11 -0
  51. package/dist/lib/layout/menu/NextMenuItem.d.ts +11 -0
  52. package/dist/lib/layout/menu/SelectedIndicator.d.ts +3 -0
  53. package/dist/lib/layout/menu/UserBlock.d.ts +9 -0
  54. package/dist/lib/modal/AttachDialog.d.ts +30 -0
  55. package/dist/lib/modal/FormActionDialog.d.ts +23 -0
  56. package/dist/lib/page/PageContainer.d.ts +2 -0
  57. package/dist/lib/page/PageContentEditor.d.ts +4 -0
  58. package/dist/lib/page/PageMain.d.ts +2 -0
  59. package/dist/lib/page/PageQueryStateContainer.d.ts +21 -0
  60. package/dist/lib/page/PageSectionTitle.d.ts +2 -0
  61. package/dist/lib/page/PageSidebar.d.ts +2 -0
  62. package/dist/lib/page/PageSidebarSection.d.ts +4 -0
  63. package/dist/lib/page/PageStateContainer.d.ts +7 -0
  64. package/dist/lib/page/PageSubSectionTitle.d.ts +2 -0
  65. package/dist/lib/page/PageTitle.d.ts +2 -0
  66. package/dist/lib/page/PageTopBar.d.ts +13 -0
  67. package/dist/lib/status/StatusBadge.d.ts +4 -0
  68. package/dist/lib/table/TableColumnButton.d.ts +1 -0
  69. package/dist/lib/table/TableContainer.d.ts +10 -0
  70. package/dist/lib/table/TableContainerContext.d.ts +18 -0
  71. package/dist/lib/table/TableCreateButton.d.ts +4 -0
  72. package/dist/lib/table/TableFilterButton.d.ts +2 -0
  73. package/dist/lib/table/TableFilters.d.ts +9 -0
  74. package/dist/lib/table/TableMassActions.d.ts +6 -0
  75. package/dist/lib/table/TableRowActionBar.d.ts +10 -0
  76. package/dist/lib/table/TableRowActionButton.d.ts +4 -0
  77. package/dist/lib/table/TableRowActionDialogButton.d.ts +4 -0
  78. package/dist/lib/table/TableRowDeleteButton.d.ts +2 -0
  79. package/dist/lib/table/TableRowEditButton.d.ts +2 -0
  80. package/dist/lib/table/TableRowNavigateButton.d.ts +4 -0
  81. package/dist/lib/table/TableRowPublishPostButton.d.ts +8 -0
  82. package/dist/lib/table/TableRowViewButton.d.ts +4 -0
  83. package/dist/lib/table/TableTopBar.d.ts +8 -0
  84. package/package.json +15 -22
  85. package/dist/index.d.mts +0 -565
  86. package/dist/index.mjs +0 -2000
package/dist/index.d.mts DELETED
@@ -1,565 +0,0 @@
1
- import { SoperioComponent, ParentComponent, Color } from '@soperio/react';
2
- import { ButtonProps, ModalProps, ContainerProps, TileProps } from '@valerya/ui';
3
- import React$1 from 'react';
4
- import { API } from '@compill/admin-api';
5
- import { CRUDAPI, CRUD_MODEL, MutationQueryFn, MutationQueryKey, UseMutateOptions } from '@compill/api';
6
- import { FormRendererConfig } from '@compill/form';
7
- import { UseQueryOptions, UseMutationOptions, QueryFunctionContext } from '@tanstack/react-query';
8
- import { FormikConfig } from 'formik';
9
- import * as Yup from 'yup';
10
- import { TableProps } from '@compill/table';
11
- import { ColumnDef } from '@tanstack/react-table';
12
-
13
- declare function SectionTitle({ children, ...props }: SoperioComponent & ParentComponent): JSX.Element;
14
-
15
- interface Breadcrumb {
16
- label: string;
17
- path?: string;
18
- }
19
- interface BreadcrumbsProps extends SoperioComponent {
20
- breadcrumbs: Breadcrumb[] | QueryBreadcrumbs;
21
- }
22
- type QueryBreadcrumbs = {
23
- queryFn: (...args: any) => Promise<any>;
24
- queryField?: string;
25
- generate: (results: any) => Breadcrumb[];
26
- };
27
- declare function Breadcrumbs({ breadcrumbs, ...props }: BreadcrumbsProps): JSX.Element;
28
-
29
- interface DialogButtonProps extends SoperioComponent, ParentComponent, ButtonProps {
30
- buildDialog: (onClose: () => void) => React$1.ReactNode;
31
- }
32
- declare function DialogButton({ buildDialog, ...props }: DialogButtonProps): JSX.Element;
33
-
34
- declare function ButtonBar({ children, ...props }: ParentComponent & SoperioComponent): JSX.Element;
35
- type ButtonBarButtonProps = {
36
- icon?: string;
37
- } & ButtonProps;
38
- declare const ButtonBarButton: React$1.ForwardRefExoticComponent<{
39
- icon?: string;
40
- } & ButtonProps & React$1.RefAttributes<HTMLDivElement>>;
41
- interface ButtonBarSubmitButtonProps extends ButtonBarButtonProps {
42
- useDirty?: boolean;
43
- }
44
- declare const ButtonBarSubmitButton: React$1.ForwardRefExoticComponent<ButtonBarSubmitButtonProps & React$1.RefAttributes<HTMLDivElement>>;
45
- type ButtonBarDialogButtonProps = {
46
- icon?: string;
47
- } & DialogButtonProps;
48
- declare function ButtonBarDialogButton({ icon, children, ...props }: ButtonBarDialogButtonProps): JSX.Element;
49
-
50
- interface InvalidateButtonProps extends ButtonBarButtonProps {
51
- pathOrPermalink: string;
52
- }
53
- declare function InvalidateButton({ pathOrPermalink, ...props }: InvalidateButtonProps): JSX.Element;
54
-
55
- declare function NavigateButton({ path, ...props }: {
56
- path: string;
57
- } & ButtonProps): JSX.Element;
58
-
59
- interface PublishButtonProps extends ButtonProps {
60
- status: string;
61
- queryId: string;
62
- api: API<any>;
63
- }
64
- declare function PublishButton({ status, queryId, api, ...props }: PublishButtonProps): JSX.Element;
65
-
66
- declare function UpdateButton({ ...props }: ButtonProps): JSX.Element;
67
-
68
- declare function ViewButton({ label, path, icon, ...props }: ButtonBarButtonProps & {
69
- label?: string;
70
- path: string;
71
- }): JSX.Element;
72
-
73
- interface OrderApi {
74
- moveUp: (id: string) => Promise<any>;
75
- moveDown: (id: string) => Promise<any>;
76
- queryKey: string[];
77
- }
78
- declare function OrderCell({ api, postId, order }: {
79
- api: OrderApi;
80
- postId: string;
81
- order: number;
82
- }): JSX.Element;
83
-
84
- interface ItemEditDialogProps<TFormData extends {} = any, TResultData extends {} = any> extends Omit<ModalProps, "id" | "children" | "title" | "position"> {
85
- itemLabel?: string;
86
- queryId?: string;
87
- api: CRUDAPI<any>;
88
- initialValues?: any;
89
- queryFetchOptions?: UseQueryOptions;
90
- querySaveOptions?: UseMutationOptions<TResultData, unknown, TFormData>;
91
- onSuccess?: (item: TResultData, response: any) => void;
92
- onFetchError?: () => void;
93
- fetchErrorMsg?: string;
94
- onSaveError?: (item: TFormData) => void;
95
- saveErrorMsg?: string;
96
- fetchToFormData?: (item: TResultData) => TFormData;
97
- formToQueryData?: (TFormData: any) => Partial<TResultData>;
98
- invalidateQueriesOnSuccess?: boolean;
99
- invalidateQueryKey?: string[];
100
- retryText?: string;
101
- cancelLabel?: string;
102
- saveLabel?: string;
103
- title?: ((item?: TResultData) => string);
104
- formikProps: Omit<FormikConfig<any>, "initialValues" | "onSubmit">;
105
- form: React$1.ReactNode | FormRendererConfig | ((item: TResultData) => FormRendererConfig);
106
- show: boolean;
107
- onClose: () => void;
108
- }
109
- 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;
110
-
111
- type DetailsViewConfig<T = any> = {
112
- type: "details";
113
- api: CRUDAPI<T> | API<T>;
114
- queryField: string;
115
- useNextRouter?: boolean;
116
- processInput?: (input: T) => any;
117
- screen: Screen$1 | ((data: T) => Screen$1);
118
- };
119
- type Screen$1 = {
120
- invalidateParentQueryKey?: string[];
121
- invalidatePage?: string;
122
- breadcrumbs?: Breadcrumb[];
123
- initialValues: any | ((data: any) => any);
124
- schema: Yup.Schema;
125
- header?: React.ReactNode;
126
- sections?: DetailSection[];
127
- buttonBar?: DetailViewButton[];
128
- } & ({
129
- type: "form";
130
- } | {
131
- type?: "post" | "section";
132
- editor?: DetailEditor;
133
- editorFooter?: React.ReactNode;
134
- });
135
- type DetailEditor = {
136
- type?: "blockEditor";
137
- name: string;
138
- } | {
139
- type?: "textarea";
140
- name: string;
141
- };
142
- type DetailSection = {
143
- type: "section";
144
- title?: string;
145
- form: FormRendererConfig | ((item: any) => FormRendererConfig);
146
- } | {
147
- type: "custom";
148
- component: ((item: any) => React.ReactNode);
149
- };
150
- type DetailViewButton = {
151
- type: "invalidate";
152
- pathOrPermalink: string;
153
- } | {
154
- type: "link";
155
- path: string;
156
- icon?: string;
157
- label?: string;
158
- } | {
159
- type: "custom";
160
- render: (item: any) => React.ReactNode;
161
- };
162
-
163
- interface ItemDeleteDialogProps extends ModalProps {
164
- itemLabel: string;
165
- queryId: string;
166
- api: CRUDAPI<any>;
167
- apiFn?: string;
168
- invalidateQueriesOnSuccess?: boolean;
169
- invalidateQueryKey?: string[];
170
- msg?: (itemLabel: string) => string | React$1.ReactNode;
171
- actionButtonLabel?: string;
172
- closeActionButtonLabel?: string;
173
- title?: string;
174
- onSuccess?: () => void;
175
- }
176
- declare function ItemDeleteDialog({ title, actionButtonLabel, closeActionButtonLabel, itemLabel, queryId, api, apiFn, invalidateQueriesOnSuccess, invalidateQueryKey, size, md_boxSizing, msg, show, onClose, onSuccess, ...props }: ItemDeleteDialogProps): JSX.Element;
177
-
178
- type EditItemDialogConfig = Omit<ItemEditDialogProps, "show" | "onClose"> & {
179
- type: "dialog";
180
- };
181
-
182
- type QueryWrapperDialogConfig<T extends CRUD_MODEL, U = T> = {
183
- type: "query";
184
- api: CRUDAPI<any>;
185
- } & ({
186
- fn: "get";
187
- transformFn?: undefined;
188
- config: (data: T) => Omit<EditItemDialogConfig, "type">;
189
- } | {
190
- fn: "getTransformed";
191
- transformFn: (data: T) => U;
192
- config: (data: U) => Omit<EditItemDialogConfig, "type">;
193
- } | {
194
- fn: "getAll";
195
- transformFn?: undefined;
196
- config: (data: T[]) => Omit<EditItemDialogConfig, "type">;
197
- } | {
198
- fn: "getAllTransformed";
199
- transformFn: (data: T[]) => U;
200
- config: (data: U) => Omit<EditItemDialogConfig, "type">;
201
- });
202
-
203
- type TableViewScreen = {
204
- api: API<any>;
205
- breadcrumbs?: Breadcrumb[] | QueryBreadcrumbs;
206
- buttonBar?: TableViewButtonConfig[];
207
- filters?: TableFilters;
208
- massActions?: TableMassActions;
209
- createView?: TableViewEditView | ((data?: any) => TableViewEditView);
210
- editView?: TableViewEditView | ((item: any) => TableViewEditView);
211
- deleteItem?: TableViewDeleteItem | ((item: any) => TableViewDeleteItem);
212
- table: TableViewTable;
213
- rowActions?: TableRowAction[] | ((item: any) => TableRowAction[]);
214
- queryParams?: any;
215
- };
216
- type TableViewConfig = {
217
- type: "table";
218
- title: string;
219
- subtitle?: string | React.ReactNode | ((data: any) => string | React.ReactNode);
220
- queryField?: string;
221
- screen: TableViewScreen | ((id: string) => TableViewScreen);
222
- };
223
- type CustomDialog = {
224
- type: "customDialog";
225
- render: (props: ModalProps) => React.ReactNode;
226
- };
227
- type TableViewEditView = CustomDialog | EditItemDialogConfig | QueryWrapperDialogConfig<any>;
228
- type TableViewTable = Omit<TableProps, "onRowClick" | "queryKey" | "queryFn" | "queryFilters"> & {
229
- filtersMethod?: "internal" | "nextRouter" | "reactRouter";
230
- initialVisibleColumns?: string[];
231
- onRowClick?: {
232
- type: "navigate" | "nextpush" | "link";
233
- path: string | ((item: any) => string);
234
- };
235
- };
236
- type TableViewDeleteItem = Omit<ItemDeleteDialogProps, "show" | "onClose" | "itemLabel" | "queryId"> & {
237
- itemLabel: string | ((item: any) => string);
238
- };
239
- type TableRowAction = {
240
- type: "link";
241
- path: string | ((item: any) => string);
242
- } | {
243
- type: "view";
244
- path: string | ((item: any) => string);
245
- } | {
246
- type: "edit";
247
- } | {
248
- type: "delete";
249
- msg?: (itemLabel: string) => (string | React.ReactNode);
250
- } | {
251
- type: "publish";
252
- api?: API<any>;
253
- } | {
254
- type: "custom";
255
- component: (item: any, queryKey: string[], icon?: string, label?: string) => React.ReactNode;
256
- icon?: string;
257
- label?: string;
258
- };
259
- type TableViewButtonBar = TableViewButtonConfig[];
260
- type TableViewButtonConfig = {
261
- type: "create";
262
- data?: any;
263
- label?: string;
264
- icon?: string;
265
- } | {
266
- type: "invalidate";
267
- pathOrPermalink: string;
268
- } | {
269
- type: "custom";
270
- render: () => React.ReactNode;
271
- };
272
- type TableFilters = {
273
- form: FormRendererConfig;
274
- initialValues: any | ((data: any) => any);
275
- schema?: Yup.AnySchema;
276
- processInput?: (input: any) => any;
277
- };
278
- type TableMassActions = {
279
- items: MassAction[];
280
- };
281
- type MassAction = ({
282
- type: "custom";
283
- render: (selectedRows: any[]) => React.ReactNode;
284
- } | {
285
- type: "select";
286
- provider?: Record<string, any>[] | ((selectedRows: any) => Record<string, any>[]);
287
- labelField?: string;
288
- valueField?: string;
289
- queryFn: MutationQueryFn<any, any>;
290
- queryKey: MutationQueryKey;
291
- } | {
292
- type: "dynamicChoiceList";
293
- } | {
294
- type: "button";
295
- label: string;
296
- icon?: string;
297
- buttonProps?: ButtonProps;
298
- queryFn: MutationQueryFn<any, any>;
299
- queryKey: MutationQueryKey;
300
- invalidateParent?: boolean;
301
- showConfirmationDialog?: boolean;
302
- confirmationDialogTitle?: string;
303
- confirmationDialogText?: string;
304
- confirmationDialogPositiveButtonLabel?: string;
305
- confirmationDialogNegativeButtonLabel?: string;
306
- successMsg?: (rows: any[]) => string;
307
- errorMsg?: (rows: any[]) => string;
308
- });
309
-
310
- type SubScreen$1<T extends CRUD_MODEL, U> = TableViewConfig | DetailsViewConfig | TabbedViewConfig | QueryWrapperConfig<T, U>;
311
- type QueryWrapperConfig<T extends CRUD_MODEL, U = T> = {
312
- type: "query";
313
- api: CRUDAPI<T> | ((id: string | number) => CRUDAPI<T>);
314
- queryField?: string;
315
- } & ({
316
- fn: "get";
317
- transformFn?: undefined;
318
- config: (data: T) => SubScreen$1<T, U>;
319
- } | {
320
- fn: "getTransformed";
321
- transformFn: (data: T) => U;
322
- config: (data: U) => SubScreen$1<T, U>;
323
- } | {
324
- fn: "getAll";
325
- transformFn?: undefined;
326
- config: (data: T[]) => SubScreen$1<T, U>;
327
- } | {
328
- fn: "getAllTransformed";
329
- transformFn: (data: T[]) => U;
330
- config: (data: U) => SubScreen$1<T, U>;
331
- });
332
-
333
- type TabbedViewConfig<T extends any = any> = {
334
- type: "tabbed";
335
- queryField: string;
336
- api: CRUDAPI<any>;
337
- screen: Screen | ((data: T) => Screen);
338
- };
339
- type Screen = {
340
- breadcrumbs: Breadcrumb[];
341
- tabs: Tab[];
342
- };
343
- type Tab = {
344
- label: string;
345
- config?: TableViewConfig | DetailsViewConfig | QueryWrapperConfig<any> | MultiQueryWrapperConfig | TabbedViewConfig;
346
- component?: () => React.ReactNode;
347
- };
348
-
349
- type SubScreen = TableViewConfig | DetailsViewConfig | TabbedViewConfig;
350
- type QueryDef = {
351
- api: CRUDAPI<any> | ((id: string) => CRUDAPI<any>);
352
- fn: "get" | "getAll";
353
- queryField?: string;
354
- transformFn?: (data: any) => any;
355
- params?: any;
356
- };
357
- type MultiQueryWrapperConfig = {
358
- type: "multiQuery";
359
- queries: QueryDef[];
360
- config: (...data: any[]) => SubScreen;
361
- };
362
-
363
- type ScreenConfig = TableViewConfig | DetailsViewConfig | TabbedViewConfig | QueryWrapperConfig<any, any> | MultiQueryWrapperConfig;
364
- type TableViewEditItem = Omit<ItemEditDialogProps, "show" | "onClose">;
365
-
366
- declare function ScreenRenderer({ config, tabbed, ...props }: {
367
- config: ScreenConfig;
368
- tabbed?: boolean;
369
- } & SoperioComponent): JSX.Element;
370
-
371
- type MenuConfig = MenuItems;
372
- type MenuItems = (Item | MenuDivider)[];
373
- type Item = {
374
- type: "item";
375
- path: string;
376
- icon?: string;
377
- label: string;
378
- children?: Item[];
379
- };
380
- type MenuDivider = {
381
- type: "divider";
382
- label?: string;
383
- };
384
-
385
- interface LayoutProps extends SoperioComponent, ParentComponent {
386
- color: Color;
387
- darkMode?: boolean;
388
- logo?: React.ReactNode;
389
- title?: string;
390
- menuConfig: MenuConfig;
391
- userMenuConfig?: MenuConfig;
392
- userSettingsPath: string;
393
- }
394
- declare function AdminLayout({ color, darkMode, logo, title, menuConfig, userMenuConfig, userSettingsPath, ...props }: LayoutProps): JSX.Element;
395
-
396
- interface MenuProps extends SoperioComponent, ParentComponent {
397
- darkMode?: boolean;
398
- config: MenuConfig;
399
- useNextRouter?: boolean;
400
- }
401
- /**
402
- *
403
- *
404
- */
405
- declare function Menu({ darkMode, config, useNextRouter, ...props }: MenuProps): JSX.Element;
406
-
407
- interface AttachDialogProps<T> extends Omit<ModalProps, "id" | "children" | "title" | "position"> {
408
- queryId?: string;
409
- queryKey: string[];
410
- queryFetchFn: (context: QueryFunctionContext) => Promise<T>;
411
- queryFetchAllFn: (context: QueryFunctionContext) => Promise<T>;
412
- queryFetchAllKey: string[];
413
- querySaveFn: ({ resources }: {
414
- resources: string[];
415
- }) => Promise<any>;
416
- matchKey: string;
417
- show: boolean;
418
- onClose: () => void;
419
- itemLabel?: string;
420
- onSuccess?: (response: any) => void;
421
- onFetchError?: () => void;
422
- fetchErrorMsg?: string;
423
- onSaveError?: () => void;
424
- saveErrorMsg?: string;
425
- invalidateQueriesOnSuccess?: boolean;
426
- retryText?: string;
427
- cancelLabel?: string;
428
- saveLabel?: string;
429
- formikProps?: Omit<FormikConfig<any>, "initialValues" | "onSubmit">;
430
- getItemName?: (item: any) => string;
431
- }
432
- declare function AttachDialog({ queryId, queryKey, queryFetchFn, queryFetchAllKey, queryFetchAllFn, querySaveFn, matchKey, size, show, onClose, itemLabel, onSuccess, onFetchError, fetchErrorMsg, onSaveError, saveErrorMsg, invalidateQueriesOnSuccess, retryText, cancelLabel, saveLabel, formikProps, getItemName, ...props }: AttachDialogProps<any>): JSX.Element;
433
-
434
- interface FormActionDialogProps<TFormData extends {} = any, TResultData extends {} = any> extends Omit<ModalProps, "id" | "children" | "title" | "position" | "onError">, UseMutateOptions<TResultData, TFormData> {
435
- itemLabel?: string;
436
- queryId?: string;
437
- queryKey: string[];
438
- initialValues: any;
439
- queryFn: (item: TFormData) => Promise<TResultData>;
440
- queryOptions?: UseMutationOptions<TResultData, unknown, TFormData>;
441
- invalidateQueriesOnSuccess?: boolean;
442
- cancelLabel?: string;
443
- saveLabel?: string;
444
- title: string;
445
- formikProps?: Omit<FormikConfig<TFormData>, "initialValues" | "onSubmit">;
446
- form: React$1.ReactNode | FormRendererConfig;
447
- show: boolean;
448
- onClose: () => void;
449
- }
450
- declare function FormActionDialog<TFormData extends {}, TResultData extends {}>({ initialValues, itemLabel, queryId, queryKey, queryFn, queryOptions, onSuccess, successMsg, showSuccessMsg, onError, errorMsg, showErrorMsg, processInput, invalidateQueriesOnSuccess, cancelLabel, saveLabel, size, title, form, show, onClose, formikProps, ...props }: FormActionDialogProps<TFormData, TResultData>): JSX.Element;
451
-
452
- declare function PageContainer({ children, ...props }: ContainerProps): JSX.Element;
453
-
454
- declare function PageContentEditor({ name, ...props }: {
455
- name: string;
456
- } & SoperioComponent): JSX.Element;
457
-
458
- declare function PageMain({ children, ...props }: SoperioComponent & ParentComponent): JSX.Element;
459
-
460
- type PageQueryContainerProps<T extends CRUD_MODEL> = Omit<ContainerProps, "children"> & ({
461
- api: CRUDAPI<T>;
462
- queryId?: string;
463
- loadingStyles?: SoperioComponent;
464
- errorStyles?: SoperioComponent;
465
- } & ({
466
- apiFn: "get";
467
- children: (data: T) => React$1.ReactElement;
468
- } | {
469
- apiFn: "getAll";
470
- apiParams?: any;
471
- children: (data: T[]) => React$1.ReactElement;
472
- }));
473
- declare const PageQueryStateContainer: <T extends CRUD_MODEL>(p: PageQueryContainerProps<T> & {
474
- ref?: React$1.Ref<HTMLDivElement>;
475
- }) => React$1.ReactElement;
476
-
477
- declare function PageSectionTitle({ children, ...props }: SoperioComponent & ParentComponent): JSX.Element;
478
-
479
- declare function PageSidebar({ children, ...props }: SoperioComponent & ParentComponent): JSX.Element;
480
-
481
- declare function PageSidebarSection({ title, children, ...props }: {
482
- title?: string;
483
- } & SoperioComponent & ParentComponent): JSX.Element;
484
-
485
- interface PageStateContainerProps extends ContainerProps {
486
- loading?: boolean;
487
- }
488
- declare const PageStateContainer: React$1.ForwardRefExoticComponent<PageStateContainerProps & React$1.RefAttributes<HTMLDivElement>>;
489
-
490
- declare function PageSubSectionTitle({ children, ...props }: SoperioComponent & ParentComponent): JSX.Element;
491
-
492
- declare function PageTitle({ children, ...props }: SoperioComponent & ParentComponent): JSX.Element;
493
-
494
- interface PageTopBarProps extends SoperioComponent, ParentComponent {
495
- title?: string;
496
- breadcrumbs?: Breadcrumb[] | QueryBreadcrumbs;
497
- }
498
- declare function PageTopBar({ title, breadcrumbs, children, ...props }: PageTopBarProps): JSX.Element;
499
- declare function PageTabbedTopBarProvider({ children }: ParentComponent): JSX.Element;
500
- declare function PageTabbedTopBar({ title, breadcrumbs, children, ...props }: PageTopBarProps): JSX.Element;
501
- declare function PageTopBarToolbar({ trackingRef, children }: {
502
- trackingRef?: Element | null;
503
- } & ParentComponent): React$1.ReactPortal | null;
504
-
505
- declare function StatusBadge({ status, ...props }: {
506
- status: "draft" | "published";
507
- } & SoperioComponent): JSX.Element;
508
-
509
- interface TableContainerProps extends TileProps {
510
- filtersMethod?: "internal" | "nextRouter" | "reactRouter";
511
- initialPageSize?: number;
512
- columns?: ColumnDef<any>[];
513
- initialVisibleColumns?: string[];
514
- }
515
- declare function TableContainer({ initialPageSize, initialVisibleColumns, columns, filtersMethod, children, ...props }: TableContainerProps): JSX.Element;
516
-
517
- declare function TableCreateButton({ icon, children, ...props }: {
518
- icon?: string;
519
- } & DialogButtonProps): JSX.Element;
520
-
521
- declare function TableFilterButton({ ...props }: ButtonProps): JSX.Element;
522
-
523
- interface TableRowActionBarProps extends SoperioComponent, ParentComponent {
524
- publishId?: string;
525
- viewPath?: string;
526
- navigatePath?: string;
527
- editDialog?: (onClose: () => void) => React.ReactNode;
528
- deleteDialog?: (onClose: () => void) => React.ReactNode;
529
- }
530
- declare function TableRowActionBar({ publishId, viewPath, navigatePath, editDialog, deleteDialog, children, ...props }: TableRowActionBarProps): JSX.Element;
531
-
532
- declare function TableRowActionButton({ icon, children, ...props }: {
533
- icon?: string;
534
- } & ButtonProps): JSX.Element;
535
-
536
- declare function TableRowActionDialogButton({ icon, children, ...props }: {
537
- icon?: string;
538
- } & DialogButtonProps): JSX.Element;
539
-
540
- declare function TableRowDeleteButton({ children, ...props }: DialogButtonProps): JSX.Element;
541
-
542
- declare function TableRowEditButton({ children, ...props }: DialogButtonProps): JSX.Element;
543
-
544
- declare function TableRowNavigateButton({ path, ...props }: {
545
- path: string;
546
- } & ButtonProps): JSX.Element;
547
-
548
- declare function TableRowPublishPostButton({ id, api, status, invalidateQueryKey, ...props }: {
549
- id: string;
550
- api: API<any>;
551
- status: "draft" | "published";
552
- invalidateQueryKey?: string[];
553
- } & ButtonProps): JSX.Element;
554
-
555
- declare function TableRowViewButton({ path, ...props }: {
556
- path: string;
557
- } & ButtonProps): JSX.Element;
558
-
559
- interface TableTopBarProps extends SoperioComponent, ParentComponent {
560
- title?: string;
561
- breadcrumbs?: Breadcrumb[] | QueryBreadcrumbs;
562
- }
563
- declare function TableTopBar({ title, breadcrumbs, children, ...props }: TableTopBarProps): JSX.Element;
564
-
565
- export { AdminLayout, AttachDialog, type Breadcrumb, Breadcrumbs, ButtonBar, ButtonBarButton, type ButtonBarButtonProps, ButtonBarDialogButton, type ButtonBarDialogButtonProps, ButtonBarSubmitButton, type ButtonBarSubmitButtonProps, type CustomDialog, type DetailSection, type DetailViewButton, type DetailsViewConfig, DialogButton, type DialogButtonProps, type EditItemDialogConfig, FormActionDialog, type FormActionDialogProps, InvalidateButton, type Item, ItemDeleteDialog, type ItemDeleteDialogProps, ItemEditDialog, type ItemEditDialogProps, type MassAction, Menu, type MenuConfig, type MenuDivider, type MenuItems, type MenuProps, type MultiQueryWrapperConfig, NavigateButton, OrderCell, PageContainer, PageContentEditor, PageMain, PageQueryStateContainer, PageSectionTitle, PageSidebar, PageSidebarSection, PageStateContainer, PageSubSectionTitle, PageTabbedTopBar, PageTabbedTopBarProvider, PageTitle, PageTopBar, type PageTopBarProps, PageTopBarToolbar, PublishButton, type QueryBreadcrumbs, type QueryDef, type QueryWrapperConfig, type QueryWrapperDialogConfig, type ScreenConfig, ScreenRenderer, SectionTitle, StatusBadge, type Tab, type TabbedViewConfig, TableContainer, TableCreateButton, TableFilterButton, type TableRowAction, TableRowActionBar, TableRowActionButton, TableRowActionDialogButton, TableRowDeleteButton, TableRowEditButton, TableRowNavigateButton, TableRowPublishPostButton, TableRowViewButton, TableTopBar, type TableViewButtonBar, type TableViewConfig, type TableViewDeleteItem, type TableViewEditItem, type TableViewEditView, type TableViewScreen, type TableViewTable, UpdateButton, ViewButton };