@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.
Files changed (72) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +43 -0
  3. package/dist/Crud.d.ts +2 -2
  4. package/dist/component/BaseButtonContent.d.ts +2 -2
  5. package/dist/component/Button.d.ts +2 -2
  6. package/dist/component/Dropdown.d.ts +4 -4
  7. package/dist/component/Empty.d.ts +2 -2
  8. package/dist/component/Link.d.ts +1 -1
  9. package/dist/component/LottieAnimation.d.ts +1 -1
  10. package/dist/component/Modal.d.ts +3 -3
  11. package/dist/component/Money.d.ts +1 -1
  12. package/dist/component/Preloader.d.ts +4 -4
  13. package/dist/component/crud/ActionLink.d.ts +1 -1
  14. package/dist/component/crud/CrudLoader.d.ts +3 -3
  15. package/dist/component/crud/DynamicView.d.ts +1 -1
  16. package/dist/component/crud/FiltersView.d.ts +2 -1
  17. package/dist/component/crud/GridView.d.ts +2 -2
  18. package/dist/component/crud/IsListItemActionGranted.d.ts +1 -1
  19. package/dist/component/crud/ItemAction.d.ts +2 -2
  20. package/dist/component/crud/ItemActions.d.ts +2 -1
  21. package/dist/component/crud/ItemLabel.d.ts +2 -1
  22. package/dist/component/crud/ItemValue.d.ts +2 -1
  23. package/dist/component/crud/ListItem.d.ts +2 -1
  24. package/dist/component/crud/ListView.d.ts +2 -2
  25. package/dist/component/crud/Modify.d.ts +1 -1
  26. package/dist/component/crud/Paginator.d.ts +2 -1
  27. package/dist/component/crud/ViewLoader.d.ts +2 -1
  28. package/dist/component/crud/batch/BatchActionSelector.d.ts +2 -1
  29. package/dist/component/crud/batch/BatchActionsContext.d.ts +2 -2
  30. package/dist/component/crud/batch/BatchItemSelector.d.ts +2 -1
  31. package/dist/component/crud/form/Form.d.ts +1 -1
  32. package/dist/component/crud/form/FormError.d.ts +1 -1
  33. package/dist/component/crud/form/FormField.d.ts +1 -1
  34. package/dist/component/crud/form/FormGroup.d.ts +3 -3
  35. package/dist/component/crud/form/FormGroupViewLoader.d.ts +1 -1
  36. package/dist/component/crud/form/FormLabel.d.ts +1 -1
  37. package/dist/component/crud/form/FormRest.d.ts +1 -1
  38. package/dist/component/crud/form/FormRestError.d.ts +1 -1
  39. package/dist/component/error/ErrorBoundary.d.ts +2 -2
  40. package/dist/component/form/Choice.d.ts +4 -4
  41. package/dist/component/form/Collection.d.ts +2 -2
  42. package/dist/component/form/Form.d.ts +1 -1
  43. package/dist/component/form/FormAlert.d.ts +1 -1
  44. package/dist/component/form/FormFieldError.d.ts +1 -1
  45. package/dist/component/form/FormGroup.d.ts +1 -1
  46. package/dist/component/form/FormSetting.d.ts +2 -2
  47. package/dist/component/router/Route.d.ts +2 -1
  48. package/dist/component/templating/Template.d.ts +2 -2
  49. package/dist/component/templating/TemplateBlock.d.ts +1 -1
  50. package/dist/component/templating/TemplateParentBlock.d.ts +2 -2
  51. package/dist/context/ActionContext.d.ts +2 -2
  52. package/dist/context/AlertContext.d.ts +2 -2
  53. package/dist/context/ConfigContext.d.ts +2 -2
  54. package/dist/context/CrudProvider.d.ts +2 -2
  55. package/dist/context/GetData.d.ts +2 -2
  56. package/dist/context/ListContext.d.ts +2 -2
  57. package/dist/context/ListItemContext.d.ts +2 -2
  58. package/dist/context/LoaderContext.d.ts +2 -2
  59. package/dist/context/ModalContext.d.ts +2 -2
  60. package/dist/context/ModalScopeContext.d.ts +5 -0
  61. package/dist/context/NamespaceContext.d.ts +2 -2
  62. package/dist/crud-react.js +1159 -1170
  63. package/dist/layout/default/Base.d.ts +1 -1
  64. package/dist/layout/default/Error.d.ts +1 -1
  65. package/dist/layout/default/Main.d.ts +2 -1
  66. package/dist/main.d.ts +1 -0
  67. package/dist/type/ViewType.d.ts +2 -0
  68. package/package.json +1 -1
  69. /package/dist/{denied-Emsz18Y8.js → denied-Cg2igDWh.js} +0 -0
  70. /package/dist/{info-C897Uj_w.js → info-Dfyx45FU.js} +0 -0
  71. /package/dist/{success-YbPKEx5j.js → success-B5xn1-UX.js} +0 -0
  72. /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) => import("react/jsx-runtime").JSX.Element;
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) => import("react/jsx-runtime").JSX.Element;
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, PropsWithChildren, RefObject } from '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) => import("react/jsx-runtime").JSX.Element;
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
- }>) => import("react/jsx-runtime").JSX.Element;
5
+ }>) => React.JSX.Element;
6
6
  declare const DropdownContent: ({ children, position, ...props }: {
7
7
  children: any;
8
8
  position?: "end" | "start";
9
- }) => import("react/jsx-runtime").JSX.Element;
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
- }>) => import("react/jsx-runtime").JSX.Element;
15
+ }>) => React.JSX.Element;
16
16
  export { DropdownContent, DropdownButton };
17
17
  export default Dropdown;
@@ -1,5 +1,5 @@
1
- import { ReactNode } from 'react';
1
+ import { default as React, ReactNode } from 'react';
2
2
  declare const Empty: ({ children }: {
3
3
  children?: ReactNode;
4
- }) => import("react/jsx-runtime").JSX.Element;
4
+ }) => React.JSX.Element;
5
5
  export default Empty;
@@ -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) => import("react/jsx-runtime").JSX.Element;
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/jsx-runtime").JSX.Element;
7
+ }) => import("react").JSX.Element;
8
8
  export default LottieAnimation;
@@ -1,4 +1,4 @@
1
- import { default as React, ReactNode } from '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?: 'sm' | 'lg' | 'xl' | 'auto';
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.FC<ModalType & React.RefAttributes<unknown>>;
21
+ declare const Modal: React.ForwardRefExoticComponent<ModalType & React.RefAttributes<ModalRefType | undefined>>;
22
22
  export default Modal;
@@ -3,5 +3,5 @@ declare const Money: ({ currency, locale, children, precision }: {
3
3
  locale?: string;
4
4
  precision?: number;
5
5
  children: number | null | string;
6
- }) => import("react/jsx-runtime").JSX.Element;
6
+ }) => import("react").JSX.Element;
7
7
  export default Money;
@@ -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) => import("react/jsx-runtime").JSX.Element | undefined;
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) => import("react/jsx-runtime").JSX.Element;
19
- declare const PreloaderProvider: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
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) => import("react/jsx-runtime").JSX.Element;
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): import("react/jsx-runtime").JSX.Element;
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): import("react/jsx-runtime").JSX.Element;
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
- }) => import("react/jsx-runtime").JSX.Element | null;
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 | import("react/jsx-runtime").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>;
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 | import("react/jsx-runtime").JSX.Element;
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>) => import("react/jsx-runtime").JSX.Element;
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/jsx-runtime").JSX.Element | undefined;
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
- }) => import("react/jsx-runtime").JSX.Element;
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
- }) => import("react/jsx-runtime").JSX.Element;
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
- }) => import("react/jsx-runtime").JSX.Element;
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
- }) => import("react/jsx-runtime").JSX.Element | null;
6
+ }) => React.JSX.Element | null;
6
7
  export default ItemValue;
@@ -1,4 +1,5 @@
1
+ import { default as React } from 'react';
1
2
  declare const ListItem: ({ namespace }: {
2
3
  namespace?: string;
3
- }) => import("react/jsx-runtime").JSX.Element;
4
+ }) => React.JSX.Element;
4
5
  export default ListItem;
@@ -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 | import("react/jsx-runtime").JSX.Element | import("react/jsx-runtime").JSX.Element[] | null;
7
+ declare const ListView: ({ itemView, emptyView, namespace }: ListViewType) => false | React.JSX.Element | React.JSX.Element[] | null;
8
8
  export default ListView;
@@ -1,4 +1,4 @@
1
- import { default as React, ComponentType, ReactNode } from 'react';
1
+ import { ComponentType, ReactNode, default as React } from 'react';
2
2
  import { ModifyType } from '../../type/ModifyType.tsx';
3
3
  declare const Modify: React.FC<{
4
4
  template?: ComponentType;
@@ -1,2 +1,3 @@
1
- declare const Paginator: () => false | import("react/jsx-runtime").JSX.Element;
1
+ import { default as React } from 'react';
2
+ declare const Paginator: () => false | React.JSX.Element;
2
3
  export default Paginator;
@@ -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
- }) => import("react/jsx-runtime").JSX.Element;
7
+ }) => React.JSX.Element;
7
8
  declare const ViewLoader: ({ view, namespace, props }: {
8
9
  view: string;
9
10
  namespace?: string;
@@ -1,2 +1,3 @@
1
- declare const BatchActionSelector: () => import("react/jsx-runtime").JSX.Element | undefined;
1
+ import { default as React } from 'react';
2
+ declare const BatchActionSelector: () => React.JSX.Element | undefined;
2
3
  export default BatchActionSelector;
@@ -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): import("react/jsx-runtime").JSX.Element;
17
+ } & PropsWithChildren): React.JSX.Element;
@@ -1,4 +1,5 @@
1
+ import { default as React } from 'react';
1
2
  declare const BatchItemSelector: ({ className }: {
2
3
  className?: string;
3
- }) => false | import("react/jsx-runtime").JSX.Element;
4
+ }) => false | React.JSX.Element;
4
5
  export default BatchItemSelector;
@@ -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
- }) => import("react/jsx-runtime").JSX.Element;
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/jsx-runtime").JSX.Element;
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
- }) => import("react/jsx-runtime").JSX.Element | null;
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): import("react/jsx-runtime").JSX.Element;
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) => import("react/jsx-runtime").JSX.Element | null;
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/jsx-runtime").JSX.Element;
1
+ declare const FormGroupViewLoader: () => import("react").JSX.Element;
2
2
  export default FormGroupViewLoader;
@@ -1,4 +1,4 @@
1
1
  declare const FormLabel: ({ name }: {
2
2
  name?: string;
3
- }) => import("react/jsx-runtime").JSX.Element;
3
+ }) => import("react").JSX.Element;
4
4
  export default FormLabel;
@@ -1,2 +1,2 @@
1
- declare const FormRest: () => import("react/jsx-runtime").JSX.Element;
1
+ declare const FormRest: () => import("react").JSX.Element;
2
2
  export default FormRest;
@@ -1,4 +1,4 @@
1
1
  declare const FormRestError: ({ className }: {
2
2
  className?: string;
3
- }) => import("react/jsx-runtime").JSX.Element;
3
+ }) => import("react").JSX.Element;
4
4
  export default FormRestError;
@@ -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): import("react/jsx-runtime").JSX.Element;
12
- declare const ErrorBoundary: ({ children, fallback, ...props }: ErrorBoundaryProps) => import("react/jsx-runtime").JSX.Element;
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
- }) => import("react/jsx-runtime").JSX.Element;
12
+ }) => React.JSX.Element;
13
13
  declare const SelectGroupOption: ({ view, group }: {
14
14
  view: FormViewType;
15
15
  group: ChoiceGroupType;
16
- }) => import("react/jsx-runtime").JSX.Element;
16
+ }) => React.JSX.Element;
17
17
  declare const ChoiceOption: ({ view, choice, constraints, onChange, choiceValueTransform, choiceLabelTransform }: ChoiceProps & {
18
18
  choice: ChoiceType;
19
- }) => import("react/jsx-runtime").JSX.Element;
19
+ }) => React.JSX.Element;
20
20
  declare const ChoiceGroupOption: ({ view, group, ...props }: ChoiceProps & {
21
21
  group: ChoiceGroupType;
22
- }) => import("react/jsx-runtime").JSX.Element;
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: () => import("react/jsx-runtime").JSX.Element;
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
- }) => import("react/jsx-runtime").JSX.Element;
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) => import("react/jsx-runtime").JSX.Element;
62
+ export declare const Form: ({ id, children, onBeforeSubmit, onSubmit: onSubmitCallback, onReset: onResetCallback, onStateChange, ref, ...props }: FormProps) => React.JSX.Element;
@@ -1,3 +1,3 @@
1
1
  export declare const FormAlert: ({ name }: {
2
2
  name?: string;
3
- }) => import("react/jsx-runtime").JSX.Element | null;
3
+ }) => import("react").JSX.Element | null;
@@ -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/jsx-runtime").JSX.Element | null;
5
+ declare const FormFieldError: ({ name, ...attributes }: FormFieldErrorProps) => import("react").JSX.Element | null;
6
6
  export default FormFieldError;
@@ -4,5 +4,5 @@ export declare const FormGroup: ({ view, className, size, type }: {
4
4
  className?: string;
5
5
  size?: "lg" | "sm";
6
6
  type?: string;
7
- }) => import("react/jsx-runtime").JSX.Element;
7
+ }) => import("react").JSX.Element;
8
8
  export default FormGroup;
@@ -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) => import("react/jsx-runtime").JSX.Element;
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) => import("react/jsx-runtime").JSX.Element | undefined;
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) => import("react/jsx-runtime").JSX.Element;
4
+ } & PropsWithChildren) => React.JSX.Element;
5
5
  declare const Block: ({ name, template, children }: PropsWithChildren & {
6
6
  name: string;
7
7
  template?: string;
8
- }) => import("react/jsx-runtime").JSX.Element;
8
+ }) => React.JSX.Element;
9
9
  declare const Extend: ({ name, template, children }: PropsWithChildren & {
10
10
  name: string;
11
11
  template?: string;