@dyrected/vue 2.23.0 → 2.24.1

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.
@@ -15,13 +15,7 @@ import * as ReactModule from 'react';
15
15
  * out of the box with zero manual provider ceremony.
16
16
  */
17
17
  export declare function wrapVueComponent(VueComp: Component, appContext?: AppContext | null): {
18
- (props: any): ReactModule.DetailedReactHTMLElement<{
19
- ref: ReactModule.RefObject<HTMLDivElement | null>;
20
- className: string;
21
- style: {
22
- display: "contents";
23
- };
24
- }, HTMLDivElement>;
18
+ (props: any): ReactModule.FunctionComponentElement<ReactModule.FragmentProps>;
25
19
  displayName: string;
26
20
  };
27
21
  /**
@@ -0,0 +1,18 @@
1
+ import { InjectionKey } from 'vue';
2
+ /** Which React component a Vue placeholder asks the bridge to render. */
3
+ export type ReactSlotKind = 'field' | 'fields' | 'defaultForm';
4
+ export interface ReactSlotHandle {
5
+ update(props: Record<string, unknown>): void;
6
+ unmount(): void;
7
+ }
8
+ /**
9
+ * Lets a Vue component render a React component *inside the React tree* that
10
+ * hosts the Vue island, through a portal into `el`.
11
+ *
12
+ * Built-in inputs need React contexts (the form engine, react-hook-form, the
13
+ * nested editor). A separate React root would lose them; a portal keeps them.
14
+ */
15
+ export interface ReactSlotRegistry {
16
+ mount(el: HTMLElement, kind: ReactSlotKind, props: Record<string, unknown>): ReactSlotHandle;
17
+ }
18
+ export declare const DYRECTED_REACT_SLOTS_KEY: InjectionKey<ReactSlotRegistry>;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Renders one built-in input, wired to the form. Keeps the field's label,
3
+ * validation message, conditions, read-only state and `admin.component` override.
4
+ */
5
+ export declare const DyrectedField: import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
6
+ [key: string]: any;
7
+ }>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {
8
+ [x: string]: any;
9
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
10
+ /** Renders several built-in inputs with the schema's layout rules. Pass `names`, or `exclude` to render the rest. */
11
+ export declare const DyrectedFields: import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
12
+ [key: string]: any;
13
+ }>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {
14
+ [x: string]: any;
15
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
16
+ /** Renders the whole built-in form body. Pass `exclude` to leave some fields to your own markup. */
17
+ export declare const DyrectedDefaultForm: import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
18
+ [key: string]: any;
19
+ }>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {
20
+ [x: string]: any;
21
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,30 @@
1
+ import { ComputedRef, InjectionKey, ShallowRef } from 'vue';
2
+ import { DocumentContextValue, DocumentFormApi, SubmitOptions, SubmitResult } from '@dyrected/admin/public';
3
+ import { VueStateify } from './useAdminSchemas';
4
+ export type { DocumentFormApi, SubmitOptions, SubmitResult };
5
+ /**
6
+ * Ambient key the bridge provides inside custom create and edit forms. The value
7
+ * is a ref the bridge keeps current, so the document and permissions stay reactive.
8
+ */
9
+ export declare const DYRECTED_DOCUMENT_KEY: InjectionKey<ShallowRef<DocumentContextValue>>;
10
+ /** Same shape as `DocumentFormApi`, with the state fields as refs. */
11
+ export interface VueDocumentFormApi {
12
+ mode: ComputedRef<DocumentFormApi['mode']>;
13
+ collection: ComputedRef<DocumentFormApi['collection']>;
14
+ document: ComputedRef<DocumentFormApi['document']>;
15
+ isLoadingDocument: ComputedRef<boolean>;
16
+ presentation: ComputedRef<DocumentFormApi['presentation']>;
17
+ permissions: ComputedRef<DocumentFormApi['permissions']>;
18
+ urls: ComputedRef<DocumentFormApi['urls']>;
19
+ /** Same as `useDyrectedForm()`: values, errors, `setValue` and the rest, as refs. */
20
+ form: VueStateify<DocumentFormApi['form']>;
21
+ submit: (options?: SubmitOptions) => Promise<SubmitResult>;
22
+ cancel: () => void;
23
+ }
24
+ /**
25
+ * Vue composable for custom create and edit forms. Mirrors `useDocumentForm()` in
26
+ * `@dyrected/react`; read state through `.value`.
27
+ *
28
+ * @experimental
29
+ */
30
+ export declare function useDocumentForm(): VueDocumentFormApi;