Skip to content

Commit e7c8636

Browse files
committed
update dist
1 parent 5476b80 commit e7c8636

File tree

4 files changed

+4442
-4122
lines changed

4 files changed

+4442
-4122
lines changed

dist/index.d.ts

Lines changed: 207 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,15 @@ export declare interface AuthInfo {
275275
};
276276
}
277277

278+
/**
279+
* Autocomplete component with support for ApiStateContext.
280+
*
281+
* The component can access error state from either:
282+
* 1. The `status` prop (explicit ResponseStatus)
283+
* 2. The `ApiStateContext` (from parent AutoForm, AutoCreateForm, AutoEditForm, or SignIn)
284+
*
285+
* The `status` prop takes precedence over the context error.
286+
*/
278287
export declare const Autocomplete: default_2.ForwardRefExoticComponent<AutocompleteProps & Omit<default_2.InputHTMLAttributes<HTMLInputElement>, keyof AutocompleteProps> & default_2.RefAttributes<AutocompleteRef>>;
279288

280289
export declare interface AutocompleteProps {
@@ -299,6 +308,32 @@ declare interface AutocompleteRef {
299308
toggle(expand: boolean): void;
300309
}
301310

311+
/**
312+
* AutoCreateForm component for creating new entities with ServiceStack AutoQuery CRUD APIs.
313+
*
314+
* The form provides ApiStateContext to all child components, allowing them to access
315+
* the form's loading and error state using the `useApiState()` hook.
316+
*
317+
* @example
318+
* ```tsx
319+
* // In a child component within AutoCreateForm:
320+
* import { useApiState } from '@servicestack/react'
321+
*
322+
* function CustomFormField() {
323+
* const apiState = useApiState()
324+
*
325+
* if (apiState?.loading) {
326+
* return <div>Saving...</div>
327+
* }
328+
*
329+
* if (apiState?.error) {
330+
* return <div>Error: {apiState.error.message}</div>
331+
* }
332+
*
333+
* return <div>Form field content</div>
334+
* }
335+
* ```
336+
*/
302337
export declare const AutoCreateForm: default_2.ForwardRefExoticComponent<AutoCreateFormProps & AutoCreateFormSlots & default_2.RefAttributes<AutoCreateFormRef>>;
303338

304339
export declare interface AutoCreateFormProps extends AutoFormBaseProps {
@@ -326,6 +361,32 @@ declare interface AutoCreateFormSlots {
326361
children?: ReactNode;
327362
}
328363

364+
/**
365+
* AutoEditForm component for editing existing entities with ServiceStack AutoQuery CRUD APIs.
366+
*
367+
* The form provides ApiStateContext to all child components, allowing them to access
368+
* the form's loading and error state using the `useApiState()` hook.
369+
*
370+
* @example
371+
* ```tsx
372+
* // In a child component within AutoEditForm:
373+
* import { useApiState } from '@servicestack/react'
374+
*
375+
* function CustomFormField() {
376+
* const apiState = useApiState()
377+
*
378+
* if (apiState?.loading) {
379+
* return <div>Updating...</div>
380+
* }
381+
*
382+
* if (apiState?.error) {
383+
* return <div>Error: {apiState.error.message}</div>
384+
* }
385+
*
386+
* return <div>Form field content</div>
387+
* }
388+
* ```
389+
*/
329390
export declare const AutoEditForm: default_2.ForwardRefExoticComponent<AutoEditFormProps & AutoEditFormSlots & default_2.RefAttributes<AutoEditFormRef>>;
330391

331392
export declare interface AutoEditFormProps extends AutoFormBaseProps {
@@ -356,6 +417,32 @@ declare interface AutoEditFormSlots {
356417
children?: ReactNode;
357418
}
358419

420+
/**
421+
* AutoForm component that automatically generates a form from a ServiceStack DTO type.
422+
*
423+
* The form provides ApiStateContext to all child components, allowing them to access
424+
* the form's loading and error state using the `useApiState()` hook.
425+
*
426+
* @example
427+
* ```tsx
428+
* // In a child component within AutoForm:
429+
* import { useApiState } from '@servicestack/react'
430+
*
431+
* function CustomFormField() {
432+
* const apiState = useApiState()
433+
*
434+
* if (apiState?.loading) {
435+
* return <div>Loading...</div>
436+
* }
437+
*
438+
* if (apiState?.error) {
439+
* return <div>Error: {apiState.error.message}</div>
440+
* }
441+
*
442+
* return <div>Form field content</div>
443+
* }
444+
* ```
445+
*/
359446
export declare const AutoForm: default_2.ForwardRefExoticComponent<AutoFormProps & AutoFormSlots & default_2.RefAttributes<AutoFormRef>>;
360447

361448
export declare interface AutoFormBaseProps {
@@ -425,10 +512,12 @@ export declare interface AutoFormProps {
425512
subHeadingClass?: string;
426513
submitLabel?: string;
427514
allowSubmit?: (model: any) => boolean;
515+
onSubmit?: (request: any) => Promise<ApiResult_2<any>>;
428516
onSuccess?: (response: any) => void;
429517
onError?: (error: ResponseStatus) => void;
430518
onDone?: () => void;
431519
onChange?: (value: any) => void;
520+
children?: ReactNode;
432521
}
433522

434523
declare interface AutoFormRef {
@@ -691,6 +780,15 @@ export declare interface CellFormatProps {
691780
value: Object;
692781
}
693782

783+
/**
784+
* CheckboxInput component with support for ApiStateContext.
785+
*
786+
* The component can access error state from either:
787+
* 1. The `status` prop (explicit ResponseStatus)
788+
* 2. The `ApiStateContext` (from parent AutoForm, AutoCreateForm, AutoEditForm, or SignIn)
789+
*
790+
* The `status` prop takes precedence over the context error.
791+
*/
694792
export declare const CheckboxInput: default_2.FC<CheckboxInputProps & default_2.HTMLAttributes<HTMLInputElement>>;
695793

696794
export declare interface CheckboxInputProps {
@@ -734,9 +832,16 @@ export declare type ColumnSettings = {
734832
sort?: "ASC" | "DESC";
735833
};
736834

835+
/**
836+
* Combobox component that wraps Autocomplete with key-value pair support.
837+
*
838+
* Error handling is delegated to the Autocomplete component, which supports ApiStateContext.
839+
* Pass the `status` prop to explicitly set errors, or let Autocomplete access errors from context.
840+
*/
737841
export declare const Combobox: default_2.ForwardRefExoticComponent<ComboboxProps & Omit<default_2.HTMLAttributes<HTMLDivElement>, keyof ComboboxProps> & default_2.RefAttributes<ComboboxRef>>;
738842

739843
export declare interface ComboboxProps {
844+
status?: ResponseStatus | null;
740845
id: string;
741846
value?: any;
742847
multiple?: boolean;
@@ -820,7 +925,7 @@ export declare interface DatabaseInfo {
820925
schemas: SchemaInfo[];
821926
}
822927

823-
export declare function DataGrid({ id, items, tableStyle, type, selectedColumns, className, gridClass: gridClassProp, grid2Class: grid2ClassProp, grid3Class: grid3ClassProp, grid4Class: grid4ClassProp, tableClass: tableClassProp, theadClass: theadClassProp, tbodyClass: tbodyClassProp, theadRowClass: theadRowClassProp, theadCellClass: theadCellClassProp, isSelected, headerTitle, headerTitles, visibleFrom, rowClass, rowStyle, onHeaderSelected, onRowSelected, children, }: DataGridProps & {
928+
export declare function DataGrid({ id, items, tableStyle, type, selectedColumns, className, gridClass: gridClassProp, grid2Class: grid2ClassProp, grid3Class: grid3ClassProp, grid4Class: grid4ClassProp, tableClass: tableClassProp, theadClass: theadClassProp, tbodyClass: tbodyClassProp, theadRowClass: theadRowClassProp, theadCellClass: theadCellClassProp, isSelected, headerTitle, headerTitles, visibleFrom, rowClass, rowStyle, onHeaderSelected, onRowSelected, slots: slotsProp, children, }: DataGridProps & {
824929
children?: default_2.ReactNode;
825930
}): JSX.Element;
826931

@@ -852,6 +957,9 @@ export declare interface DataGridProps {
852957
rowStyle?: (model: any, i: number) => CSSProperties | undefined;
853958
onHeaderSelected?: (name: string, ev: React.MouseEvent) => void;
854959
onRowSelected?: (item: any, ev: React.MouseEvent) => void;
960+
slots?: {
961+
[name: string]: React.ReactNode | ((props: any) => React.ReactNode);
962+
};
855963
}
856964

857965
/** Format Date into required input[type=date] format */
@@ -871,7 +979,7 @@ declare const dummy: {
871979
colspans: string;
872980
};
873981

874-
export declare const DynamicInput: default_2.FC<DynamicInputProps>;
982+
export declare function DynamicInput({ input, value: modelValue, onChange: onUpdateModelValue, api }: DynamicInputProps): JSX.Element;
875983

876984
export declare interface DynamicInputProps {
877985
input: InputProp | InputInfo;
@@ -955,6 +1063,15 @@ declare function fileImageUri(file: any | {
9551063
name: string;
9561064
}): string;
9571065

1066+
/**
1067+
* FileInput component with support for ApiStateContext.
1068+
*
1069+
* The component can access error state from either:
1070+
* 1. The `status` prop (explicit ResponseStatus)
1071+
* 2. The `ApiStateContext` (from parent AutoForm, AutoCreateForm, AutoEditForm, or SignIn)
1072+
*
1073+
* The `status` prop takes precedence over the context error.
1074+
*/
9581075
export declare const FileInput: default_2.FC<FileInputProps & Omit<default_2.InputHTMLAttributes<HTMLInputElement>, keyof FileInputProps>>;
9591076

9601077
export declare interface FileInputProps {
@@ -1423,6 +1540,15 @@ declare function makeDto(requestDto: string, obj?: any, ctx?: {
14231540
method?: string;
14241541
}): any;
14251542

1543+
/**
1544+
* MarkdownInput component with support for ApiStateContext.
1545+
*
1546+
* The component can access error state from either:
1547+
* 1. The `status` prop (explicit ResponseStatus)
1548+
* 2. The `ApiStateContext` (from parent AutoForm, AutoCreateForm, AutoEditForm, or SignIn)
1549+
*
1550+
* The `status` prop takes precedence over the context error.
1551+
*/
14261552
export declare const MarkdownInput: default_2.ForwardRefExoticComponent<MarkdownInputProps & default_2.RefAttributes<MarkdownInputRef>>;
14271553

14281554
export declare type MarkdownInputOptions = "bold" | "italics" | "link" | "image" | "blockquote" | "code" | "heading" | "orderedList" | "unorderedList" | "strikethrough" | "undo" | "redo" | "help";
@@ -1924,6 +2050,15 @@ export declare interface SecondaryButtonProps {
19242050
disabled?: boolean;
19252051
}
19262052

2053+
/**
2054+
* SelectInput component with support for ApiStateContext.
2055+
*
2056+
* The component can access error state from either:
2057+
* 1. The `status` prop (explicit ResponseStatus)
2058+
* 2. The `ApiStateContext` (from parent AutoForm, AutoCreateForm, AutoEditForm, or SignIn)
2059+
*
2060+
* The `status` prop takes precedence over the context error.
2061+
*/
19272062
export declare const SelectInput: default_2.FC<SelectInputProps & default_2.HTMLAttributes<HTMLSelectElement>>;
19282063

19292064
export declare interface SelectInputProps {
@@ -1993,6 +2128,32 @@ export declare interface SidebarLayoutRef {
19932128
toggle(show: boolean): void;
19942129
}
19952130

2131+
/**
2132+
* SignIn component for authenticating users with ServiceStack Auth.
2133+
*
2134+
* The component provides ApiStateContext to all child components, allowing them to access
2135+
* the authentication loading and error state using the `useApiState()` hook.
2136+
*
2137+
* @example
2138+
* ```tsx
2139+
* // In a child component within SignIn:
2140+
* import { useApiState } from '@servicestack/react'
2141+
*
2142+
* function CustomAuthField() {
2143+
* const apiState = useApiState()
2144+
*
2145+
* if (apiState?.loading) {
2146+
* return <div>Authenticating...</div>
2147+
* }
2148+
*
2149+
* if (apiState?.error) {
2150+
* return <div>Error: {apiState.error.message}</div>
2151+
* }
2152+
*
2153+
* return <div>Auth field content</div>
2154+
* }
2155+
* ```
2156+
*/
19962157
export declare const SignIn: default_2.FC<SignInProps>;
19972158

19982159
/** Sign In the currently Authenticated User */
@@ -2068,6 +2229,15 @@ export declare interface TabsProps {
20682229
clearQuery?: boolean;
20692230
}
20702231

2232+
/**
2233+
* TagInput component with support for ApiStateContext.
2234+
*
2235+
* The component can access error state from either:
2236+
* 1. The `status` prop (explicit ResponseStatus)
2237+
* 2. The `ApiStateContext` (from parent AutoForm, AutoCreateForm, AutoEditForm, or SignIn)
2238+
*
2239+
* The `status` prop takes precedence over the context error.
2240+
*/
20712241
export declare const TagInput: default_2.FC<TagInputProps & Omit<default_2.InputHTMLAttributes<HTMLInputElement>, keyof TagInputProps>>;
20722242

20732243
export declare interface TagInputProps {
@@ -2088,6 +2258,15 @@ export declare interface TagInputProps {
20882258
onChange?: (value: string | string[]) => void;
20892259
}
20902260

2261+
/**
2262+
* TextareaInput component with support for ApiStateContext.
2263+
*
2264+
* The component can access error state from either:
2265+
* 1. The `status` prop (explicit ResponseStatus)
2266+
* 2. The `ApiStateContext` (from parent AutoForm, AutoCreateForm, AutoEditForm, or SignIn)
2267+
*
2268+
* The `status` prop takes precedence over the context error.
2269+
*/
20912270
export declare const TextareaInput: default_2.FC<TextareaInputProps & default_2.HTMLAttributes<HTMLTextAreaElement>>;
20922271

20932272
export declare interface TextareaInputProps {
@@ -2103,6 +2282,26 @@ export declare interface TextareaInputProps {
21032282
onChange?: (value: string) => void;
21042283
}
21052284

2285+
/**
2286+
* TextInput component with support for ApiStateContext.
2287+
*
2288+
* The component can access error state from either:
2289+
* 1. The `status` prop (explicit ResponseStatus)
2290+
* 2. The `ApiStateContext` (from parent AutoForm, AutoCreateForm, AutoEditForm, or SignIn)
2291+
*
2292+
* The `status` prop takes precedence over the context error.
2293+
*
2294+
* @example
2295+
* ```tsx
2296+
* // With explicit status prop
2297+
* <TextInput id="email" status={responseStatus} />
2298+
*
2299+
* // Within a form component (uses context automatically)
2300+
* <AutoForm type={MyDto}>
2301+
* <TextInput id="email" />
2302+
* </AutoForm>
2303+
* ```
2304+
*/
21062305
export declare const TextInput: default_2.ForwardRefExoticComponent<TextInputProps & default_2.HTMLAttributes<HTMLInputElement> & default_2.RefAttributes<TextInputRef>>;
21072306

21082307
export declare interface TextInputProps {
@@ -2242,6 +2441,12 @@ export declare interface UploadedFile {
22422441
contentLength?: number;
22432442
}
22442443

2444+
/**
2445+
* Hook to access the API state (loading, error) from AutoForm context
2446+
* Use this in child components within AutoForm to access the form's API state
2447+
*/
2448+
export declare function useApiState(): ApiState | undefined;
2449+
22452450
export declare function useAuth(): {
22462451
signIn: typeof signIn;
22472452
signOut: typeof signOut;

dist/servicestack-react.min.mjs

Lines changed: 11 additions & 11 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)