extended-dynamic-forms 0.1.9 → 0.1.11
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/dist/ExtendedForm.d.ts +4 -0
- package/dist/components/arrays/ArrayFieldItemTemplate.d.ts +3 -0
- package/dist/components/arrays/ArrayFieldTemplate.d.ts +3 -0
- package/dist/components/arrays/index.d.ts +2 -0
- package/dist/components/fields/AddressField.d.ts +4 -0
- package/dist/components/fields/CurrencyField.d.ts +4 -0
- package/dist/components/fields/PhoneField.d.ts +4 -0
- package/dist/components/index.d.ts +15 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/calendar.d.ts +8 -0
- package/dist/components/ui/card.d.ts +8 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/date-picker.d.ts +13 -0
- package/dist/components/ui/input.d.ts +5 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/popover.d.ts +6 -0
- package/dist/components/ui/select.d.ts +13 -0
- package/dist/components/ui/slider.d.ts +4 -0
- package/dist/components/ui/textarea.d.ts +5 -0
- package/dist/events/FormEventContext.d.ts +20 -0
- package/dist/events/FormEventHub.d.ts +27 -0
- package/dist/events/FormEventManager.d.ts +10 -0
- package/dist/events/index.d.ts +4 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.es.js +11501 -0
- package/dist/index.umd.js +106 -0
- package/dist/layouts/grid/GridLayout.d.ts +11 -0
- package/dist/layouts/horizontal/HorizontalLayout.d.ts +10 -0
- package/dist/layouts/index.d.ts +3 -0
- package/dist/layouts/vertical/VerticalLayout.d.ts +9 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/style.css +1 -0
- package/dist/types/index.d.ts +47 -0
- package/dist/utils/formDataUtils.d.ts +22 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/schemaUtils.d.ts +24 -0
- package/dist/utils/validationUtils.d.ts +26 -0
- package/dist/vanilla-wrapper.d.ts +33 -0
- package/dist/widgets/date/DateWidget.d.ts +4 -0
- package/dist/widgets/enhanced/EnhancedWidgets.d.ts +36 -0
- package/dist/widgets/file/FileWidget.d.ts +4 -0
- package/dist/widgets/index.d.ts +33 -0
- package/dist/widgets/input/ColorWidget.d.ts +4 -0
- package/dist/widgets/input/RangeWidget.d.ts +4 -0
- package/dist/widgets/input/RatingWidget.d.ts +4 -0
- package/package.json +2 -2
- package/dist/extended-dynamic-forms-vanilla.js +0 -38
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AddressField } from './fields/AddressField';
|
|
2
|
+
import { PhoneField } from './fields/PhoneField';
|
|
3
|
+
import { CurrencyField } from './fields/CurrencyField';
|
|
4
|
+
import { ArrayFieldTemplate, ArrayFieldItemTemplate } from './arrays';
|
|
5
|
+
|
|
6
|
+
export declare const customFields: {
|
|
7
|
+
address: import('react').FC<import('@rjsf/utils').FieldProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
8
|
+
phone: import('react').FC<import('@rjsf/utils').FieldProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
9
|
+
currency: import('react').FC<import('@rjsf/utils').FieldProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
10
|
+
};
|
|
11
|
+
export declare const customTemplates: {
|
|
12
|
+
ArrayFieldTemplate: (props: import('@rjsf/utils').ArrayFieldTemplateProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
ArrayFieldItemTemplate: (props: import('@rjsf/utils').ArrayFieldItemTemplateType) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
};
|
|
15
|
+
export { AddressField, PhoneField, CurrencyField, ArrayFieldTemplate, ArrayFieldItemTemplate, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
7
|
+
}
|
|
8
|
+
declare function Badge({ className, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DayPicker } from 'react-day-picker';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type CalendarProps = React.ComponentProps<typeof DayPicker>;
|
|
4
|
+
declare function Calendar({ className, classNames, showOutsideDays, ...props }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare namespace Calendar {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
8
|
+
export { Calendar };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
5
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
6
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
3
|
+
declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export { Checkbox };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface DatePickerProps {
|
|
2
|
+
id?: string;
|
|
3
|
+
value?: string;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
onChange?: (value: string) => void;
|
|
7
|
+
onBlur?: () => void;
|
|
8
|
+
onFocus?: () => void;
|
|
9
|
+
className?: string;
|
|
10
|
+
"aria-invalid"?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function DatePicker({ id, value, placeholder, disabled, onChange, onBlur, onFocus, className, "aria-invalid": ariaInvalid, }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
4
|
+
declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import('class-variance-authority/types').ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>>;
|
|
5
|
+
export { Label };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
3
|
+
declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
|
|
4
|
+
declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { Popover, PopoverTrigger, PopoverContent };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3
|
+
declare const Select: React.FC<SelectPrimitive.SelectProps>;
|
|
4
|
+
declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
6
|
+
declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
3
|
+
declare const Slider: React.ForwardRefExoticComponent<Omit<SliderPrimitive.SliderProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
4
|
+
export { Slider };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { FormEventHub } from './FormEventHub';
|
|
3
|
+
|
|
4
|
+
interface FormEventContextType {
|
|
5
|
+
eventHub: FormEventHub;
|
|
6
|
+
formData?: any;
|
|
7
|
+
}
|
|
8
|
+
interface FormEventProviderProps {
|
|
9
|
+
eventHub: FormEventHub;
|
|
10
|
+
formData?: any;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare const FormEventProvider: React.FC<FormEventProviderProps>;
|
|
14
|
+
export declare const useFormEventHub: () => FormEventContextType;
|
|
15
|
+
export declare const useFieldEventHandlers: (fieldId: string, schema?: any, fieldPath?: string[]) => {
|
|
16
|
+
onFocus: (value: any) => Promise<void>;
|
|
17
|
+
onBlur: (value: any) => Promise<void>;
|
|
18
|
+
onChange: (value: any) => Promise<void>;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FormEventHandlers, FieldEventHandlers, WebhookConfig } from '../types';
|
|
2
|
+
|
|
3
|
+
export declare class FormEventHub {
|
|
4
|
+
private formHandlers;
|
|
5
|
+
private fieldHandlers;
|
|
6
|
+
private webhooks;
|
|
7
|
+
private debounceTimers;
|
|
8
|
+
private webhookQueue;
|
|
9
|
+
private isProcessingQueue;
|
|
10
|
+
constructor(formHandlers: FormEventHandlers, fieldHandlers?: FieldEventHandlers, webhooks?: WebhookConfig[]);
|
|
11
|
+
handleBeforeSubmit(data: any): Promise<any>;
|
|
12
|
+
handleAfterSubmit(data: any): Promise<void>;
|
|
13
|
+
handleBeforeValidation(data: any): Promise<any>;
|
|
14
|
+
handleAfterValidation(data: any, errors: any): Promise<void>;
|
|
15
|
+
handleFieldEvent(eventType: 'focus' | 'blur' | 'change', fieldId: string, fieldValue: any, schema?: any, formData?: any, fieldPath?: string[]): Promise<void>;
|
|
16
|
+
private processWebhooks;
|
|
17
|
+
private debounceWebhook;
|
|
18
|
+
private queueWebhook;
|
|
19
|
+
private processWebhookQueue;
|
|
20
|
+
private callWebhook;
|
|
21
|
+
createFieldEventHandlers(fieldId: string, schema?: any, formData?: any, fieldPath?: string[]): {
|
|
22
|
+
onFocus: (value: any) => Promise<void>;
|
|
23
|
+
onBlur: (value: any) => Promise<void>;
|
|
24
|
+
onChange: (value: any) => Promise<void>;
|
|
25
|
+
};
|
|
26
|
+
cleanup(): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FormEventHandlers } from '../types';
|
|
2
|
+
|
|
3
|
+
export declare class FormEventManager {
|
|
4
|
+
private handlers;
|
|
5
|
+
constructor(handlers: FormEventHandlers);
|
|
6
|
+
handleBeforeSubmit(data: any): Promise<any>;
|
|
7
|
+
handleAfterSubmit(data: any): Promise<void>;
|
|
8
|
+
handleBeforeValidation(data: any): Promise<any>;
|
|
9
|
+
handleAfterValidation(data: any, errors: any): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { FormEventManager } from './FormEventManager';
|
|
2
|
+
export { FormEventHub } from './FormEventHub';
|
|
3
|
+
export { FormEventProvider, useFormEventHub, useFieldEventHandlers } from './FormEventContext';
|
|
4
|
+
export type { FormEventHandlers, FieldEventHandlers, FormFieldEvent, WebhookConfig } from '../types';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
export * from './components';
|
|
3
|
+
export * from './widgets';
|
|
4
|
+
export * from './layouts';
|
|
5
|
+
export * from './events';
|
|
6
|
+
export * from './types';
|
|
7
|
+
export * from './utils';
|
|
8
|
+
export * from './lib/utils';
|
|
9
|
+
export type { FormProps, IChangeEvent } from '@rjsf/core';
|
|
10
|
+
export type { RJSFSchema, UiSchema, WidgetProps, FieldProps, ArrayFieldTemplateProps, ObjectFieldTemplateProps, FieldTemplateProps, ErrorSchema, RJSFValidationError } from '@rjsf/utils';
|
|
11
|
+
export { default as validator } from '@rjsf/validator-ajv8';
|
|
12
|
+
export { generateTheme } from '@rjsf/shadcn';
|
|
13
|
+
export { ExtendedForm } from './ExtendedForm';
|