@dakataa/crud-react 2.0.0 → 2.1.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/CHANGELOG.md +25 -0
- package/README.md +43 -0
- package/dist/Crud.d.ts +2 -2
- package/dist/component/BaseButtonContent.d.ts +2 -2
- package/dist/component/Button.d.ts +2 -2
- package/dist/component/Dropdown.d.ts +4 -4
- package/dist/component/Empty.d.ts +2 -2
- package/dist/component/Link.d.ts +1 -1
- package/dist/component/LottieAnimation.d.ts +1 -1
- package/dist/component/Modal.d.ts +3 -3
- package/dist/component/Money.d.ts +1 -1
- package/dist/component/Preloader.d.ts +4 -4
- package/dist/component/crud/ActionLink.d.ts +1 -1
- package/dist/component/crud/CrudLoader.d.ts +3 -3
- package/dist/component/crud/DynamicView.d.ts +1 -1
- package/dist/component/crud/FiltersView.d.ts +2 -1
- package/dist/component/crud/GridView.d.ts +2 -2
- package/dist/component/crud/IsListItemActionGranted.d.ts +1 -1
- package/dist/component/crud/ItemAction.d.ts +2 -2
- package/dist/component/crud/ItemActions.d.ts +2 -1
- package/dist/component/crud/ItemLabel.d.ts +2 -1
- package/dist/component/crud/ItemValue.d.ts +2 -1
- package/dist/component/crud/ListItem.d.ts +2 -1
- package/dist/component/crud/ListView.d.ts +2 -2
- package/dist/component/crud/Modify.d.ts +1 -1
- package/dist/component/crud/Paginator.d.ts +2 -1
- package/dist/component/crud/ViewLoader.d.ts +2 -1
- package/dist/component/crud/batch/BatchActionSelector.d.ts +2 -1
- package/dist/component/crud/batch/BatchActionsContext.d.ts +2 -2
- package/dist/component/crud/batch/BatchItemSelector.d.ts +2 -1
- package/dist/component/crud/form/Form.d.ts +1 -1
- package/dist/component/crud/form/FormError.d.ts +1 -1
- package/dist/component/crud/form/FormField.d.ts +1 -1
- package/dist/component/crud/form/FormGroup.d.ts +3 -3
- package/dist/component/crud/form/FormGroupViewLoader.d.ts +1 -1
- package/dist/component/crud/form/FormLabel.d.ts +1 -1
- package/dist/component/crud/form/FormRest.d.ts +1 -1
- package/dist/component/crud/form/FormRestError.d.ts +1 -1
- package/dist/component/error/ErrorBoundary.d.ts +2 -2
- package/dist/component/form/Choice.d.ts +4 -4
- package/dist/component/form/Collection.d.ts +2 -2
- package/dist/component/form/Form.d.ts +1 -1
- package/dist/component/form/FormAlert.d.ts +1 -1
- package/dist/component/form/FormFieldError.d.ts +1 -1
- package/dist/component/form/FormGroup.d.ts +1 -1
- package/dist/component/form/FormSetting.d.ts +2 -2
- package/dist/component/router/Route.d.ts +2 -1
- package/dist/component/templating/Template.d.ts +2 -2
- package/dist/component/templating/TemplateBlock.d.ts +1 -1
- package/dist/component/templating/TemplateParentBlock.d.ts +2 -2
- package/dist/context/ActionContext.d.ts +2 -2
- package/dist/context/AlertContext.d.ts +2 -2
- package/dist/context/ConfigContext.d.ts +2 -2
- package/dist/context/CrudProvider.d.ts +2 -2
- package/dist/context/GetData.d.ts +2 -2
- package/dist/context/ListContext.d.ts +2 -2
- package/dist/context/ListItemContext.d.ts +2 -2
- package/dist/context/LoaderContext.d.ts +2 -2
- package/dist/context/ModalContext.d.ts +2 -2
- package/dist/context/ModalScopeContext.d.ts +5 -0
- package/dist/context/NamespaceContext.d.ts +2 -2
- package/dist/crud-react.js +1159 -1170
- package/dist/layout/default/Base.d.ts +1 -1
- package/dist/layout/default/Error.d.ts +1 -1
- package/dist/layout/default/Main.d.ts +2 -1
- package/dist/main.d.ts +1 -0
- package/dist/type/ViewType.d.ts +2 -0
- package/package.json +1 -1
- /package/dist/{denied-Emsz18Y8.js → denied-Cg2igDWh.js} +0 -0
- /package/dist/{info-C897Uj_w.js → info-Dfyx45FU.js} +0 -0
- /package/dist/{success-YbPKEx5j.js → success-B5xn1-UX.js} +0 -0
- /package/dist/{warning-DJITKJj5.js → warning-BaaC-X6i.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.1.0 — 2026-11-27
|
|
4
|
+
|
|
5
|
+
### What's new
|
|
6
|
+
|
|
7
|
+
- **Detect modal context.** The new `useIsModal()` hook tells a component whether
|
|
8
|
+
it belongs to a modal. It works in loaded CRUD views, directly rendered modals
|
|
9
|
+
and nested modals, including portal content. The page behind an open modal
|
|
10
|
+
still receives `false`.
|
|
11
|
+
- **Automatic modal layout.** `Modify` now detects modal context when its `modal`
|
|
12
|
+
prop is omitted, choosing the modal layout and embedded-form behavior automatically.
|
|
13
|
+
Explicit `modal={true}` and `modal={false}` still take priority.
|
|
14
|
+
- **Object actions in CRUD views.** `ViewType.action` lists the actions the backend
|
|
15
|
+
authorizes for the displayed object. An empty array means no actions are available.
|
|
16
|
+
|
|
17
|
+
### Fixes
|
|
18
|
+
|
|
19
|
+
- `Button` with `autoDisableOnInvalid` checks form validity without firing `invalid`
|
|
20
|
+
events during the check. Native validation on submission remains unchanged.
|
|
21
|
+
|
|
22
|
+
### Compatibility
|
|
23
|
+
|
|
24
|
+
- `dakataa/crud` v2.1.0 adds the `action` array to standard view responses.
|
|
25
|
+
Earlier versions omit it. If you construct a `ViewType` yourself, for example
|
|
26
|
+
in a custom response or a test fixture, include `action: []` when no actions are available.
|
|
27
|
+
|
|
3
28
|
## 2.0.0 — 2026-11-04
|
|
4
29
|
|
|
5
30
|
Forms now keep unsaved edits when fields are hidden and shown again, and better
|
package/README.md
CHANGED
|
@@ -708,6 +708,11 @@ Open CRUD actions inside modals.
|
|
|
708
708
|
const { openModal, closeModal } = UseModal();
|
|
709
709
|
```
|
|
710
710
|
|
|
711
|
+
### `useIsModal()`
|
|
712
|
+
|
|
713
|
+
Returns whether the current component belongs to a modal view. See
|
|
714
|
+
[modal context](#modal-and-usemodal) for usage and the distinction from `UseModal()`.
|
|
715
|
+
|
|
711
716
|
### `UseAlert()`
|
|
712
717
|
|
|
713
718
|
Open confirm, success, warning and error dialogs.
|
|
@@ -750,6 +755,44 @@ Loads a namespace-aware template file and falls back to children when no overrid
|
|
|
750
755
|
|
|
751
756
|
Render CRUD screens inside nested modals.
|
|
752
757
|
|
|
758
|
+
Use `useIsModal()` to detect whether a component is inside a modal:
|
|
759
|
+
|
|
760
|
+
```tsx
|
|
761
|
+
import { Modify, UseModal, useIsModal } from "@dakataa/crud-react";
|
|
762
|
+
|
|
763
|
+
function EditActions() {
|
|
764
|
+
const isModal = useIsModal();
|
|
765
|
+
const { closeModal } = UseModal();
|
|
766
|
+
|
|
767
|
+
return isModal ? (
|
|
768
|
+
<button type="button" onClick={closeModal}>
|
|
769
|
+
Cancel
|
|
770
|
+
</button>
|
|
771
|
+
) : null;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
function Edit() {
|
|
775
|
+
return <Modify />;
|
|
776
|
+
}
|
|
777
|
+
```
|
|
778
|
+
|
|
779
|
+
The hook returns `false` outside a modal. For actions opened with `openModal()`,
|
|
780
|
+
it returns `true` in the loaded `Edit`/`View` component itself and its descendants.
|
|
781
|
+
It also returns `true` for children of a directly rendered `<Modal>`, including
|
|
782
|
+
portal content and nested modals. The page behind an open modal remains outside
|
|
783
|
+
that scope and receives `false`.
|
|
784
|
+
|
|
785
|
+
`UseModal()` controls the modal stack; its `modal` value describes the currently
|
|
786
|
+
open modal and is shared with the underlying page. It does not indicate that the
|
|
787
|
+
calling component belongs to that modal.
|
|
788
|
+
|
|
789
|
+
`Modify` uses `useIsModal()` when its `modal` prop is omitted. An explicit
|
|
790
|
+
`modal={true}` or `modal={false}` overrides its layout and embedded-form behavior.
|
|
791
|
+
This override does not change the surrounding context: a component rendered
|
|
792
|
+
inside a modal still receives `true` even when a nested `Modify modal={false}`
|
|
793
|
+
uses a page template. Existing `modal` props supplied to loaded views remain
|
|
794
|
+
supported for compatibility.
|
|
795
|
+
|
|
753
796
|
### `UseAlert`
|
|
754
797
|
|
|
755
798
|
Display animated alerts and confirmation dialogs.
|
package/dist/Crud.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropsWithChildren, ReactElement } from 'react';
|
|
1
|
+
import { default as React, PropsWithChildren, ReactElement } from 'react';
|
|
2
2
|
import { default as Requester, Config as RequesterConfig } from '@dakataa/requester';
|
|
3
3
|
import { Config, Templates } from './context/ConfigContext.tsx';
|
|
4
4
|
export declare const CRUD_NAMESPACE = "dakataa_crud";
|
|
@@ -10,6 +10,6 @@ declare const CrudRequester: () => Requester;
|
|
|
10
10
|
declare const Crud: ({ children, config, errorFallback }: {
|
|
11
11
|
errorFallback?: ReactElement;
|
|
12
12
|
config?: Config;
|
|
13
|
-
} & PropsWithChildren) =>
|
|
13
|
+
} & PropsWithChildren) => React.JSX.Element;
|
|
14
14
|
export { CrudConfiguration, CrudRequester };
|
|
15
15
|
export default Crud;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropsWithChildren, ReactElement } from 'react';
|
|
1
|
+
import { default as React, PropsWithChildren, ReactElement } from 'react';
|
|
2
2
|
export type ButtonContentProps = {
|
|
3
3
|
icon?: ReactElement;
|
|
4
4
|
preloader?: ReactElement;
|
|
@@ -6,5 +6,5 @@ export type ButtonContentProps = {
|
|
|
6
6
|
permission?: string | string[];
|
|
7
7
|
preload?: boolean;
|
|
8
8
|
};
|
|
9
|
-
declare const BaseButtonContent: ({ icon, preloader, rightIcon, children, preload }: ButtonContentProps & PropsWithChildren) =>
|
|
9
|
+
declare const BaseButtonContent: ({ icon, preloader, rightIcon, children, preload }: ButtonContentProps & PropsWithChildren) => React.JSX.Element;
|
|
10
10
|
export default BaseButtonContent;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { default as React
|
|
1
|
+
import { PropsWithChildren, RefObject, default as React } from 'react';
|
|
2
2
|
import { ButtonContentProps } from './BaseButtonContent.tsx';
|
|
3
3
|
export type ButtonPropsType = {
|
|
4
4
|
loader?: string;
|
|
5
5
|
autoDisableOnInvalid?: boolean;
|
|
6
6
|
ref?: RefObject<HTMLButtonElement>;
|
|
7
7
|
} & ButtonContentProps & PropsWithChildren & React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
|
|
8
|
-
declare const _default: ({ children, type, form, preload, autoDisableOnInvalid, ref, ...props }: ButtonPropsType) =>
|
|
8
|
+
declare const _default: ({ children, type, form, preload, autoDisableOnInvalid, ref, ...props }: ButtonPropsType) => React.JSX.Element;
|
|
9
9
|
export default _default;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
1
|
+
import { default as React, PropsWithChildren } from 'react';
|
|
2
2
|
declare const DropdownButton: ({ children, disabled, className }: PropsWithChildren<{
|
|
3
3
|
className?: string;
|
|
4
4
|
disabled?: boolean;
|
|
5
|
-
}>) =>
|
|
5
|
+
}>) => React.JSX.Element;
|
|
6
6
|
declare const DropdownContent: ({ children, position, ...props }: {
|
|
7
7
|
children: any;
|
|
8
8
|
position?: "end" | "start";
|
|
9
|
-
}) =>
|
|
9
|
+
}) => React.JSX.Element;
|
|
10
10
|
declare const Dropdown: ({ className, children, autoClose, strategy, icon }: PropsWithChildren<{
|
|
11
11
|
className?: string;
|
|
12
12
|
icon?: any;
|
|
13
13
|
autoClose?: "outside" | "inside" | boolean;
|
|
14
14
|
strategy?: "absolute" | "fixed";
|
|
15
|
-
}>) =>
|
|
15
|
+
}>) => React.JSX.Element;
|
|
16
16
|
export { DropdownContent, DropdownButton };
|
|
17
17
|
export default Dropdown;
|
package/dist/component/Link.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { ButtonContentProps } from './BaseButtonContent.tsx';
|
|
3
3
|
declare const _default: ({ to, children, onClick, ...props }: {
|
|
4
4
|
to?: string;
|
|
5
|
-
} & React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> & ButtonContentProps) =>
|
|
5
|
+
} & React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> & ButtonContentProps) => React.JSX.Element;
|
|
6
6
|
export default _default;
|
|
@@ -4,5 +4,5 @@ declare const LottieAnimation: ({ animationData, path, options, width, height, c
|
|
|
4
4
|
height?: number | `${number}%`;
|
|
5
5
|
className?: string;
|
|
6
6
|
options?: Omit<AnimationConfig, "container">;
|
|
7
|
-
}) => import("react
|
|
7
|
+
}) => import("react").JSX.Element;
|
|
8
8
|
export default LottieAnimation;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as React
|
|
1
|
+
import { ReactNode, default as React } from 'react';
|
|
2
2
|
export type ModalType = {
|
|
3
3
|
children?: ReactNode;
|
|
4
4
|
open?: boolean;
|
|
@@ -6,7 +6,7 @@ export type ModalType = {
|
|
|
6
6
|
backdrop?: boolean;
|
|
7
7
|
animation?: Animation | string;
|
|
8
8
|
keyboard?: boolean;
|
|
9
|
-
size?:
|
|
9
|
+
size?: "sm" | "lg" | "xl" | "auto";
|
|
10
10
|
className?: string;
|
|
11
11
|
};
|
|
12
12
|
export type ModalRefType = {
|
|
@@ -18,5 +18,5 @@ export type ModalRefType = {
|
|
|
18
18
|
export declare enum Animation {
|
|
19
19
|
fade = "fade"
|
|
20
20
|
}
|
|
21
|
-
declare const Modal: React.
|
|
21
|
+
declare const Modal: React.ForwardRefExoticComponent<ModalType & React.RefAttributes<ModalRefType | undefined>>;
|
|
22
22
|
export default Modal;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
1
|
+
import { default as React, PropsWithChildren } from 'react';
|
|
2
2
|
type PreloaderProviderContextType = {
|
|
3
3
|
isLoading: (loader: string) => boolean;
|
|
4
4
|
startLoading: (loader: string) => void;
|
|
@@ -11,10 +11,10 @@ type LoadersState = {
|
|
|
11
11
|
export declare const UsePreloaderProvider: () => PreloaderProviderContextType | undefined;
|
|
12
12
|
export declare const PreloaderIndicator: ({ loader, children }: {
|
|
13
13
|
loader?: string;
|
|
14
|
-
} & PropsWithChildren) =>
|
|
14
|
+
} & PropsWithChildren) => React.JSX.Element | undefined;
|
|
15
15
|
export declare const UsePreloader: () => string | undefined;
|
|
16
16
|
export declare const Preloader: ({ loader, children }: {
|
|
17
17
|
loader?: string;
|
|
18
|
-
} & PropsWithChildren) =>
|
|
19
|
-
declare const PreloaderProvider: ({ children }: PropsWithChildren) =>
|
|
18
|
+
} & PropsWithChildren) => React.JSX.Element;
|
|
19
|
+
declare const PreloaderProvider: ({ children }: PropsWithChildren) => React.JSX.Element;
|
|
20
20
|
export default PreloaderProvider;
|
|
@@ -6,5 +6,5 @@ declare const ActionLink: ({ children, action, className, onClick, ...props }: {
|
|
|
6
6
|
className?: string;
|
|
7
7
|
children?: ReactNode;
|
|
8
8
|
onClick?: (e: SyntheticEvent) => void;
|
|
9
|
-
} & React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> & ButtonContentProps) =>
|
|
9
|
+
} & React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> & ButtonContentProps) => React.JSX.Element;
|
|
10
10
|
export default ActionLink;
|
|
@@ -10,7 +10,7 @@ type CurrentActionRequestCollectionContextType = {
|
|
|
10
10
|
get: (key: string) => CurrentActionRequestContextType | null;
|
|
11
11
|
unset: (key: string) => void;
|
|
12
12
|
};
|
|
13
|
-
export declare function CurrentActionCollectionProvider({ children }: PropsWithChildren):
|
|
13
|
+
export declare function CurrentActionCollectionProvider({ children }: PropsWithChildren): React.JSX.Element;
|
|
14
14
|
export declare function UseCurrentActionCollection(): CurrentActionRequestCollectionContextType;
|
|
15
15
|
export declare function UseCurrentActionRequest(): CurrentActionRequestContextType;
|
|
16
16
|
export type CurrentActionRequestProviderRef = {
|
|
@@ -20,10 +20,10 @@ export declare function CurrentActionRequestProvider({ actionRequest, name, ref,
|
|
|
20
20
|
actionRequest: ActionRequestType;
|
|
21
21
|
name?: string;
|
|
22
22
|
ref?: React.Ref<CurrentActionRequestProviderRef>;
|
|
23
|
-
} & PropsWithChildren):
|
|
23
|
+
} & PropsWithChildren): React.JSX.Element;
|
|
24
24
|
declare const CrudLoader: ({ path, preloader }: {
|
|
25
25
|
path?: string;
|
|
26
26
|
errorFallback?: ReactElement;
|
|
27
27
|
preloader?: ReactElement;
|
|
28
|
-
}) =>
|
|
28
|
+
}) => React.JSX.Element | null;
|
|
29
29
|
export default CrudLoader;
|
|
@@ -15,5 +15,5 @@ declare const DynamicView: React.MemoExoticComponent<({ view, prefix, namespace,
|
|
|
15
15
|
children?: ReactNode;
|
|
16
16
|
data?: any;
|
|
17
17
|
props?: any;
|
|
18
|
-
}) => string | number | bigint | boolean |
|
|
18
|
+
}) => string | number | bigint | boolean | React.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined>;
|
|
19
19
|
export default DynamicView;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FormViewType } from '../../type/FormViewType.tsx';
|
|
2
|
+
import { default as React } from 'react';
|
|
2
3
|
declare const FiltersView: ({ onClick }: {
|
|
3
4
|
formView: FormViewType;
|
|
4
5
|
onClick: (key: string) => void;
|
|
5
|
-
}) => false |
|
|
6
|
+
}) => false | React.JSX.Element;
|
|
6
7
|
export default FiltersView;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ColumnType } from '../../type/ColumnType';
|
|
2
|
-
import { HTMLAttributes, ReactElement, TableHTMLAttributes } from 'react';
|
|
2
|
+
import { default as React, HTMLAttributes, ReactElement, TableHTMLAttributes } from 'react';
|
|
3
3
|
type GridViewHeaderColumnAttributes = {
|
|
4
4
|
className?: string;
|
|
5
5
|
};
|
|
@@ -23,5 +23,5 @@ export type GridViewType = {
|
|
|
23
23
|
};
|
|
24
24
|
namespace?: string;
|
|
25
25
|
};
|
|
26
|
-
declare const GridView: ({ routeParams, namespace, options, tableOptions, ...HTMLAttributes }: GridViewType & HTMLAttributes<HTMLDivElement>) =>
|
|
26
|
+
declare const GridView: ({ routeParams, namespace, options, tableOptions, ...HTMLAttributes }: GridViewType & HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
|
|
27
27
|
export default GridView;
|
|
@@ -6,5 +6,5 @@ type IsGrantedProps = {
|
|
|
6
6
|
declare const useListItemActionGranted: () => {
|
|
7
7
|
isListItemGranted: ({ permission, id }: IsGrantedProps) => boolean;
|
|
8
8
|
};
|
|
9
|
-
declare const IsListItemActionGranted: ({ permission, children, id: itemId }: IsGrantedProps & PropsWithChildren) => import("react
|
|
9
|
+
declare const IsListItemActionGranted: ({ permission, children, id: itemId }: IsGrantedProps & PropsWithChildren) => import("react").JSX.Element | undefined;
|
|
10
10
|
export { IsListItemActionGranted as default, useListItemActionGranted };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
2
|
import { ActionRequestType } from '../../type/ActionRequestType.tsx';
|
|
3
3
|
declare const ItemAction: ({ action, icon, className, ...props }: {
|
|
4
4
|
action: ActionRequestType;
|
|
5
5
|
className?: string;
|
|
6
6
|
icon?: ReactNode;
|
|
7
7
|
children?: ReactNode;
|
|
8
|
-
}) =>
|
|
8
|
+
}) => React.JSX.Element;
|
|
9
9
|
export default ItemAction;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
declare const ItemActions: ({ namespace, routeParams }: {
|
|
2
3
|
namespace?: string;
|
|
3
4
|
routeParams?: {
|
|
4
5
|
[key: string]: any;
|
|
5
6
|
};
|
|
6
|
-
}) =>
|
|
7
|
+
}) => React.JSX.Element;
|
|
7
8
|
export default ItemActions;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ColumnType } from '../../type/ColumnType.tsx';
|
|
2
|
+
import { default as React } from 'react';
|
|
2
3
|
declare const ItemLabel: ({ column, namespace }: {
|
|
3
4
|
column: ColumnType;
|
|
4
5
|
namespace?: string;
|
|
5
|
-
}) =>
|
|
6
|
+
}) => React.JSX.Element;
|
|
6
7
|
export default ItemLabel;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ColumnType } from '../../type/ColumnType.tsx';
|
|
2
|
+
import { default as React } from 'react';
|
|
2
3
|
declare const ItemValue: ({ column, namespace }: {
|
|
3
4
|
column: ColumnType;
|
|
4
5
|
namespace?: string;
|
|
5
|
-
}) =>
|
|
6
|
+
}) => React.JSX.Element | null;
|
|
6
7
|
export default ItemValue;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
1
|
+
import { default as React, ReactElement } from 'react';
|
|
2
2
|
import { GridViewType } from './GridView.tsx';
|
|
3
3
|
type ListViewType = GridViewType & {
|
|
4
4
|
itemView?: ReactElement;
|
|
5
5
|
emptyView?: ReactElement | null;
|
|
6
6
|
};
|
|
7
|
-
declare const ListView: ({ itemView, emptyView, namespace }: ListViewType) => false |
|
|
7
|
+
declare const ListView: ({ itemView, emptyView, namespace }: ListViewType) => false | React.JSX.Element | React.JSX.Element[] | null;
|
|
8
8
|
export default ListView;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
declare const DefaultViewComponent: ({ view, props }: {
|
|
2
3
|
view: string;
|
|
3
4
|
props?: {
|
|
4
5
|
[key: string]: any;
|
|
5
6
|
};
|
|
6
|
-
}) =>
|
|
7
|
+
}) => React.JSX.Element;
|
|
7
8
|
declare const ViewLoader: ({ view, namespace, props }: {
|
|
8
9
|
view: string;
|
|
9
10
|
namespace?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
1
|
+
import { default as React, PropsWithChildren } from 'react';
|
|
2
2
|
export type BatchContextType = {
|
|
3
3
|
actions: {
|
|
4
4
|
[action: string]: string;
|
|
@@ -14,4 +14,4 @@ export type BatchContextType = {
|
|
|
14
14
|
export declare function UseBatchActions(): BatchContextType | undefined;
|
|
15
15
|
export declare function BatchActionsProvider({ onClick, ...props }: {
|
|
16
16
|
onClick?: (method: string, ids: any, data: FormData) => Promise<void>;
|
|
17
|
-
} & PropsWithChildren):
|
|
17
|
+
} & PropsWithChildren): React.JSX.Element;
|
|
@@ -17,7 +17,7 @@ export declare const FormViewProvider: ({ view, allowDuplicates, children, syncM
|
|
|
17
17
|
allowDuplicates?: boolean;
|
|
18
18
|
syncMode?: FormSyncMode;
|
|
19
19
|
submission?: FormSubmission;
|
|
20
|
-
}) =>
|
|
20
|
+
}) => React.JSX.Element;
|
|
21
21
|
export declare function UseFormView(): FormViewContextType;
|
|
22
22
|
export declare function UseParentFormView(): FormViewContextType | undefined;
|
|
23
23
|
declare const Form: React.FC<{
|
|
@@ -2,5 +2,5 @@ import { FormFieldErrorProps } from '../../form/FormFieldError.tsx';
|
|
|
2
2
|
export type FormErrorProps = Omit<FormFieldErrorProps, "name"> & {
|
|
3
3
|
name?: string | (string | null)[];
|
|
4
4
|
};
|
|
5
|
-
declare const FormError: ({ name, ...attributes }: FormErrorProps) => import("react
|
|
5
|
+
declare const FormError: ({ name, ...attributes }: FormErrorProps) => import("react").JSX.Element;
|
|
6
6
|
export default FormError;
|
|
@@ -7,5 +7,5 @@ declare const FormField: ({ name, options, optional, ref }: {
|
|
|
7
7
|
/** Return null when the requested view is missing. Defaults to false. */
|
|
8
8
|
optional?: boolean;
|
|
9
9
|
ref?: React.RefObject<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | null>;
|
|
10
|
-
}) =>
|
|
10
|
+
}) => React.JSX.Element | null;
|
|
11
11
|
export default FormField;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
1
|
+
import { PropsWithChildren, default as React } from 'react';
|
|
2
2
|
import { FormViewType } from '../../../type/FormViewType.tsx';
|
|
3
3
|
type FormGroupContextType = {
|
|
4
4
|
view: FormViewType;
|
|
@@ -16,7 +16,7 @@ export declare function UseFormGroup(): FormGroupContextType | undefined;
|
|
|
16
16
|
* @internal Consumers should render {@link FormGroup} instead of creating this
|
|
17
17
|
* context directly.
|
|
18
18
|
*/
|
|
19
|
-
export declare function FormGroupProvider({ view, children }: FormGroupContextType & PropsWithChildren):
|
|
19
|
+
export declare function FormGroupProvider({ view, children }: FormGroupContextType & PropsWithChildren): React.JSX.Element;
|
|
20
20
|
/** Props accepted by {@link FormGroup}. */
|
|
21
21
|
export type FormGroupProps = {
|
|
22
22
|
/**
|
|
@@ -72,5 +72,5 @@ export type FormGroupProps = {
|
|
|
72
72
|
* />
|
|
73
73
|
* ```
|
|
74
74
|
*/
|
|
75
|
-
declare const FormGroup: ({ name, options, optional }: FormGroupProps) =>
|
|
75
|
+
declare const FormGroup: ({ name, options, optional }: FormGroupProps) => React.JSX.Element | null;
|
|
76
76
|
export default FormGroup;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const FormGroupViewLoader: () => import("react
|
|
1
|
+
declare const FormGroupViewLoader: () => import("react").JSX.Element;
|
|
2
2
|
export default FormGroupViewLoader;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const FormRest: () => import("react
|
|
1
|
+
declare const FormRest: () => import("react").JSX.Element;
|
|
2
2
|
export default FormRest;
|
|
@@ -8,6 +8,6 @@ type ErrorBoundaryProps = {
|
|
|
8
8
|
children?: any;
|
|
9
9
|
};
|
|
10
10
|
export declare function UseErrorBoundary(): boolean;
|
|
11
|
-
export declare function ErrorBoundaryContextProvider({ ...props }: PropsWithChildren):
|
|
12
|
-
declare const ErrorBoundary: ({ children, fallback, ...props }: ErrorBoundaryProps) =>
|
|
11
|
+
export declare function ErrorBoundaryContextProvider({ ...props }: PropsWithChildren): React.JSX.Element;
|
|
12
|
+
declare const ErrorBoundary: ({ children, fallback, ...props }: ErrorBoundaryProps) => React.JSX.Element;
|
|
13
13
|
export default ErrorBoundary;
|
|
@@ -9,16 +9,16 @@ export type ChoiceProps = Omit<FormFieldProps, "ref"> & {
|
|
|
9
9
|
declare const SelectOption: ({ choice }: {
|
|
10
10
|
view: FormViewType;
|
|
11
11
|
choice: ChoiceType;
|
|
12
|
-
}) =>
|
|
12
|
+
}) => React.JSX.Element;
|
|
13
13
|
declare const SelectGroupOption: ({ view, group }: {
|
|
14
14
|
view: FormViewType;
|
|
15
15
|
group: ChoiceGroupType;
|
|
16
|
-
}) =>
|
|
16
|
+
}) => React.JSX.Element;
|
|
17
17
|
declare const ChoiceOption: ({ view, choice, constraints, onChange, choiceValueTransform, choiceLabelTransform }: ChoiceProps & {
|
|
18
18
|
choice: ChoiceType;
|
|
19
|
-
}) =>
|
|
19
|
+
}) => React.JSX.Element;
|
|
20
20
|
declare const ChoiceGroupOption: ({ view, group, ...props }: ChoiceProps & {
|
|
21
21
|
group: ChoiceGroupType;
|
|
22
|
-
}) =>
|
|
22
|
+
}) => React.JSX.Element;
|
|
23
23
|
declare const Choice: ({ view, constraints, className, onChange, choiceValueTransform, choiceLabelTransform, ref }: ChoiceProps) => React.JSX.Element;
|
|
24
24
|
export { Choice as default, ChoiceOption, ChoiceGroupOption, SelectOption, SelectGroupOption };
|
|
@@ -12,7 +12,7 @@ export type CollectionContextType = {
|
|
|
12
12
|
};
|
|
13
13
|
declare const UseCollection: () => CollectionContextType;
|
|
14
14
|
declare const Collection: ({ view }: InputProps) => React.JSX.Element;
|
|
15
|
-
declare const CollectionList: () =>
|
|
15
|
+
declare const CollectionList: () => React.JSX.Element;
|
|
16
16
|
export type CollectionItemContextType = {
|
|
17
17
|
index: number;
|
|
18
18
|
removeItem: () => void;
|
|
@@ -23,5 +23,5 @@ declare const CollectionItem: ({ view, name: itemName, index, isPrototype }: {
|
|
|
23
23
|
name?: string;
|
|
24
24
|
index: number;
|
|
25
25
|
isPrototype: boolean;
|
|
26
|
-
}) =>
|
|
26
|
+
}) => React.JSX.Element;
|
|
27
27
|
export { Collection as default, CollectionList, CollectionItem, UseCollection, UseCollectionItem };
|
|
@@ -59,4 +59,4 @@ export declare function useFormCollection(name: string, initialItems: string[]):
|
|
|
59
59
|
remove: (item: string) => void;
|
|
60
60
|
};
|
|
61
61
|
export declare const nameToId: (name: string, index?: string | number | null) => string;
|
|
62
|
-
export declare const Form: ({ id, children, onBeforeSubmit, onSubmit: onSubmitCallback, onReset: onResetCallback, onStateChange, ref, ...props }: FormProps) =>
|
|
62
|
+
export declare const Form: ({ id, children, onBeforeSubmit, onSubmit: onSubmitCallback, onReset: onResetCallback, onStateChange, ref, ...props }: FormProps) => React.JSX.Element;
|
|
@@ -2,5 +2,5 @@ import { HTMLAttributes } from 'react';
|
|
|
2
2
|
export type FormFieldErrorProps = Omit<HTMLAttributes<HTMLDivElement>, "children" | "dangerouslySetInnerHTML"> & {
|
|
3
3
|
name: string | string[];
|
|
4
4
|
};
|
|
5
|
-
declare const FormFieldError: ({ name, ...attributes }: FormFieldErrorProps) => import("react
|
|
5
|
+
declare const FormFieldError: ({ name, ...attributes }: FormFieldErrorProps) => import("react").JSX.Element | null;
|
|
6
6
|
export default FormFieldError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
1
|
+
import { default as React, PropsWithChildren } from 'react';
|
|
2
2
|
export type FormSettingContextType = {
|
|
3
3
|
size?: 'lg' | 'sm';
|
|
4
4
|
extraClassName?: string;
|
|
@@ -7,5 +7,5 @@ export type FormSettingContextType = {
|
|
|
7
7
|
placeholder?: string;
|
|
8
8
|
};
|
|
9
9
|
declare const UseFormSettings: () => FormSettingContextType | undefined;
|
|
10
|
-
declare const FormSetting: ({ children, ...props }: FormSettingContextType & PropsWithChildren) =>
|
|
10
|
+
declare const FormSetting: ({ children, ...props }: FormSettingContextType & PropsWithChildren) => React.JSX.Element;
|
|
11
11
|
export { FormSetting, UseFormSettings };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as React, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import Element = React.JSX.Element;
|
|
2
3
|
type RouteItemType = {
|
|
3
4
|
path?: string;
|
|
4
5
|
element?: ReactNode;
|
|
@@ -6,6 +7,6 @@ type RouteItemType = {
|
|
|
6
7
|
parent?: RouteItemType;
|
|
7
8
|
};
|
|
8
9
|
declare const Outlet: () => string | number | bigint | true | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined>;
|
|
9
|
-
declare const Router: ({ children }: PropsWithChildren) =>
|
|
10
|
+
declare const Router: ({ children }: PropsWithChildren) => Element | undefined;
|
|
10
11
|
declare const Route: (props: PropsWithChildren & RouteItemType) => null;
|
|
11
12
|
export { Route, Router, Outlet };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { default as React, ComponentType, FC, PropsWithChildren } from 'react';
|
|
2
2
|
declare const Template: ({ name, children }: {
|
|
3
3
|
name: string;
|
|
4
|
-
} & PropsWithChildren) =>
|
|
4
|
+
} & PropsWithChildren) => React.JSX.Element;
|
|
5
5
|
declare const Block: ({ name, template, children }: PropsWithChildren & {
|
|
6
6
|
name: string;
|
|
7
7
|
template?: string;
|
|
8
|
-
}) =>
|
|
8
|
+
}) => React.JSX.Element;
|
|
9
9
|
declare const Extend: ({ name, template, children }: PropsWithChildren & {
|
|
10
10
|
name: string;
|
|
11
11
|
template?: string;
|