extended-dynamic-forms 0.3.13 → 0.4.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/README.md +580 -25
- package/dist/WizardForm.d.ts +17 -2
- package/dist/components/FieldFeedbackContext.d.ts +4 -0
- package/dist/components/FieldStyleContext.d.ts +7 -0
- package/dist/components/SchemaSelectionContext.d.ts +20 -0
- package/dist/components/URLBlurValidationContext.d.ts +38 -0
- package/dist/components/fields/TextChangeScope.d.ts +28 -0
- package/dist/components/fields/TextEmptyArrayField.d.ts +3 -0
- package/dist/conditionals/v2/createConditionalEngineHook.d.ts +3 -1
- package/dist/conditionals/v2/index.d.ts +2 -1
- package/dist/conditionals/v2/types.d.ts +13 -0
- package/dist/conditionals/v2/utils/stepRules.d.ts +35 -0
- package/dist/events/FormEventContext.d.ts +3 -0
- package/dist/index.es.js +41796 -32825
- package/dist/index.umd.js +1618 -1606
- package/dist/layouts/wizard/WizardLayout.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/utils/normalizeUrlValue.d.ts +3 -0
- package/dist/utils/urlValue.d.ts +12 -0
- package/dist/widgets/base/URLParts.d.ts +5 -0
- package/dist/widgets/base/URLPreviewLink.d.ts +5 -0
- package/dist/widgets/base/inputStyles.d.ts +4 -0
- package/dist/widgets/base/inputTypography.d.ts +3 -0
- package/dist/widgets/base/numberInputStyles.d.ts +4 -0
- package/dist/widgets/base/telephoneAddons.d.ts +3 -0
- package/dist/widgets/base/types.d.ts +15 -1
- package/dist/widgets/base/useInputChrome.d.ts +5 -0
- package/dist/widgets/base/utils.d.ts +9 -1
- package/dist/widgets/choice/ChoiceWidget.types.d.ts +2 -0
- package/dist/widgets/choice/dropdownValidation.d.ts +8 -0
- package/dist/widgets/choice/inlineChoiceValidation.d.ts +5 -0
- package/dist/widgets/choice/presenters/InlineChoiceGroup.d.ts +888 -0
- package/dist/widgets/date/DateTimeWidget.d.ts +2 -21
- package/dist/widgets/date/calendarConstraints.d.ts +5 -0
- package/dist/widgets/date/dateRangeValue.d.ts +20 -0
- package/dist/widgets/date/dateTimeValue.d.ts +15 -0
- package/dist/widgets/file/FileUploadWidget.d.ts +3 -32
- package/dist/widgets/index.d.ts +6 -6
- package/dist/widgets/input/TelephoneWidget.d.ts +1 -1
- package/dist/widgets/input/emailValidation.d.ts +7 -0
- package/dist/widgets/input/telephoneMask.d.ts +7 -0
- package/dist/widgets/input/telephoneOptions.d.ts +14 -0
- package/package.json +9 -3
|
@@ -1,26 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { WidgetProps } from '@rjsf/utils';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
* Can be configured to use either:
|
|
8
|
-
* 1. Ant Design DatePicker with showTime option (default)
|
|
9
|
-
* 2. Native HTML datetime-local input (when useNativeInput is true)
|
|
10
|
-
*
|
|
11
|
-
* Supports Ant Design DatePicker API properties through uiSchema options:
|
|
12
|
-
* - useNativeInput: Use HTML datetime-local input instead of DatePicker
|
|
13
|
-
* - format: DateTime format (default: 'YYYY-MM-DD HH:mm:ss')
|
|
14
|
-
* - showTime: Time picker options (true or object with time picker config)
|
|
15
|
-
* - placeholder: Input placeholder text
|
|
16
|
-
* - placement: Dropdown placement
|
|
17
|
-
* - size: Component size ('small', 'middle', 'large')
|
|
18
|
-
* - bordered: Show border
|
|
19
|
-
* - status: Validation status ('error', 'warning')
|
|
20
|
-
* - style: Custom CSS styles
|
|
21
|
-
* - className: Custom CSS class
|
|
22
|
-
* - And all other Ant Design DatePicker props
|
|
23
|
-
*/
|
|
24
|
-
declare const DateTimeWidget: FC<WidgetProps>;
|
|
4
|
+
/** Browser-local wall-clock entry/display; accepted answers are UTC instants. */
|
|
5
|
+
declare const DateTimeWidget: FC<WidgetProps<unknown>>;
|
|
25
6
|
export default DateTimeWidget;
|
|
26
7
|
export { DateTimeWidget };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DatePickerProps } from 'antd';
|
|
2
|
+
import { AntDatePickerOptions } from '../base/types';
|
|
3
|
+
|
|
4
|
+
/** Calendar-label constraints for UTC-mode picker carriers. Shared by selection and validation. */
|
|
5
|
+
export declare function getCalendarDatePickerProps(options?: AntDatePickerOptions): Partial<DatePickerProps>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
import { RJSFSchema, UiSchema } from '@rjsf/utils';
|
|
3
|
+
import { SchemaSelections } from '../../components/SchemaSelectionContext';
|
|
4
|
+
|
|
5
|
+
type RangeOptions = {
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
range?: unknown;
|
|
8
|
+
showTime?: unknown;
|
|
9
|
+
withTime?: unknown;
|
|
10
|
+
allowEmpty?: unknown;
|
|
11
|
+
};
|
|
12
|
+
/** Explicit time ranges retain their separate, existing formatted-value contract. */
|
|
13
|
+
export declare function isCalendarRange(options: RangeOptions): boolean;
|
|
14
|
+
/** UTC mode is a calendar container only: never convert these values to/from local instants. */
|
|
15
|
+
export declare function parseCalendarDate(value: unknown): Dayjs | undefined;
|
|
16
|
+
export declare function parseCalendarInput(text: string, format: unknown): Dayjs | undefined;
|
|
17
|
+
export declare function calendarRangeError(value: unknown, options: RangeOptions, required: boolean): string | undefined;
|
|
18
|
+
/** Validate restored and edited calendar ranges even in native schemas without date item formats. */
|
|
19
|
+
export declare function validateDateRangeValues(data: unknown, errors: unknown, schema: RJSFSchema | boolean, uiSchema?: UiSchema, rootSchema?: RJSFSchema, selections?: SchemaSelections, id?: string, idSeparator?: string, required?: boolean): void;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
import { RJSFSchema, UiSchema } from '@rjsf/utils';
|
|
3
|
+
import { SchemaSelections } from '../../components/SchemaSelectionContext';
|
|
4
|
+
|
|
5
|
+
export declare const DATE_TIME_REENTRY = "Re-enter a valid date and time with a time zone; saved local text is not an instant.";
|
|
6
|
+
export declare const DATE_TIME_CONSTRAINT = "Select a date allowed by the date and time constraints.";
|
|
7
|
+
export declare const LOCAL_DATE_TIME_FORMAT = "YYYY-MM-DDTHH:mm:ss.SSS";
|
|
8
|
+
/** Read an explicit RFC3339 instant, never infer a zone for saved wall-clock text. */
|
|
9
|
+
export declare function parseDateTimeInstant(value: unknown): Dayjs | undefined;
|
|
10
|
+
/** UTC-mode Dayjs is only a calendar container here: it must never be serialized as an instant. */
|
|
11
|
+
export declare function parseLocalDateTime(text: string, formats: unknown): Dayjs | undefined;
|
|
12
|
+
/** Enumerate real instants whose browser-local calendar tuple equals the requested wall clock. */
|
|
13
|
+
export declare function localDateTimeInstants(wall: Dayjs): string[];
|
|
14
|
+
/** Scope the UTC contract to DateTime widgets, including RJSF's format-selected default. */
|
|
15
|
+
export declare function validateDateTimeValues(data: unknown, errors: unknown, schema: RJSFSchema | boolean, uiSchema?: UiSchema, rootSchema?: RJSFSchema, selections?: SchemaSelections, id?: string, idSeparator?: string): void;
|
|
@@ -2,38 +2,9 @@ import { FC } from 'react';
|
|
|
2
2
|
import { WidgetProps } from '@rjsf/utils';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* This widget provides two modes for file upload:
|
|
9
|
-
* 1. Native HTML input[type="file"] (default)
|
|
10
|
-
* 2. Ant Design Upload component (when ui:options.useAntUpload is true)
|
|
11
|
-
*
|
|
12
|
-
* Both modes convert files to base64 data URLs for storage in form data.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* // In uiSchema for native input
|
|
16
|
-
* {
|
|
17
|
-
* myFileField: {
|
|
18
|
-
* 'ui:widget': 'fileUpload',
|
|
19
|
-
* 'ui:options': {
|
|
20
|
-
* accept: 'image/*'
|
|
21
|
-
* }
|
|
22
|
-
* }
|
|
23
|
-
* }
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* // In uiSchema for Ant Design Upload
|
|
27
|
-
* {
|
|
28
|
-
* myFileField: {
|
|
29
|
-
* 'ui:widget': 'fileUpload',
|
|
30
|
-
* 'ui:options': {
|
|
31
|
-
* useAntUpload: true,
|
|
32
|
-
* accept: '.pdf,.doc,.docx',
|
|
33
|
-
* maxSize: 5 // in MB
|
|
34
|
-
* }
|
|
35
|
-
* }
|
|
36
|
-
* }
|
|
5
|
+
* Local file reader, not a network upload. Single mode preserves the published
|
|
6
|
+
* data-URL/undefined contract; explicit multiple mode emits data-URL arrays.
|
|
7
|
+
* Enhanced list/drag/button settings require useAntUpload: true.
|
|
37
8
|
*/
|
|
38
9
|
declare const FileUploadWidget: FC<WidgetProps>;
|
|
39
10
|
export default FileUploadWidget;
|
package/dist/widgets/index.d.ts
CHANGED
|
@@ -33,10 +33,10 @@ export declare const customWidgets: {
|
|
|
33
33
|
updown: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
34
34
|
number: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
35
35
|
NumberWidget: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
36
|
-
tel: import('react').FC<import('@rjsf/utils').WidgetProps<
|
|
37
|
-
telephone: import('react').FC<import('@rjsf/utils').WidgetProps<
|
|
38
|
-
TelWidget: import('react').FC<import('@rjsf/utils').WidgetProps<
|
|
39
|
-
TelephoneWidget: import('react').FC<import('@rjsf/utils').WidgetProps<
|
|
36
|
+
tel: import('react').FC<import('@rjsf/utils').WidgetProps<unknown, import('@rjsf/utils').RJSFSchema, any>>;
|
|
37
|
+
telephone: import('react').FC<import('@rjsf/utils').WidgetProps<unknown, import('@rjsf/utils').RJSFSchema, any>>;
|
|
38
|
+
TelWidget: import('react').FC<import('@rjsf/utils').WidgetProps<unknown, import('@rjsf/utils').RJSFSchema, any>>;
|
|
39
|
+
TelephoneWidget: import('react').FC<import('@rjsf/utils').WidgetProps<unknown, import('@rjsf/utils').RJSFSchema, any>>;
|
|
40
40
|
email: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
41
41
|
EmailWidget: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
42
42
|
url: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
@@ -61,8 +61,8 @@ export declare const customWidgets: {
|
|
|
61
61
|
DividerWidget: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
62
62
|
date: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
63
63
|
DateWidget: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
64
|
-
'datetime-local': import('react').FC<import('@rjsf/utils').WidgetProps<
|
|
65
|
-
DateTimeWidget: import('react').FC<import('@rjsf/utils').WidgetProps<
|
|
64
|
+
'datetime-local': import('react').FC<import('@rjsf/utils').WidgetProps<unknown, import('@rjsf/utils').RJSFSchema, any>>;
|
|
65
|
+
DateTimeWidget: import('react').FC<import('@rjsf/utils').WidgetProps<unknown, import('@rjsf/utils').RJSFSchema, any>>;
|
|
66
66
|
time: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
67
67
|
TimeWidget: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
68
68
|
file: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RJSFSchema, UiSchema } from '@rjsf/utils';
|
|
2
|
+
import { SchemaSelections } from '../../components/SchemaSelectionContext';
|
|
3
|
+
|
|
4
|
+
/** Validate without changing saved values; required/type/schema constraints remain schema-owned. */
|
|
5
|
+
export declare function emailValidationError(value: unknown, options: Record<string, unknown>): string | undefined;
|
|
6
|
+
/** Enforce Email options for restored data, submission, and wizard navigation as well as input feedback. */
|
|
7
|
+
export declare function validateEmailValues(data: unknown, errors: unknown, schema: RJSFSchema | boolean, uiSchema?: UiSchema, rootSchema?: RJSFSchema, selections?: SchemaSelections, id?: string, idSeparator?: string, formContext?: unknown): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** A mask changes presentation only. Letter slots never become phoneword digits. */
|
|
2
|
+
export declare function telephoneMask(value: unknown): string;
|
|
3
|
+
export declare function applyTelephoneMask(input: string, mask: string, code?: string, fromCanonical?: boolean): {
|
|
4
|
+
display: string;
|
|
5
|
+
canonical: string;
|
|
6
|
+
positions: number[];
|
|
7
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RJSFSchema } from '@rjsf/utils';
|
|
2
|
+
|
|
3
|
+
export interface PhoneCountry {
|
|
4
|
+
code: string;
|
|
5
|
+
name: string;
|
|
6
|
+
pattern?: unknown;
|
|
7
|
+
}
|
|
8
|
+
export declare function countryCode(value: unknown): string;
|
|
9
|
+
export declare function phoneCountries(value: unknown): PhoneCountry[];
|
|
10
|
+
export declare function numberCountry(value: string, countries: PhoneCountry[]): string;
|
|
11
|
+
export declare function withCountryCode(value: string, code: string): string;
|
|
12
|
+
export declare function internationalPhone(value: string): string;
|
|
13
|
+
/** Mirror explicit string constraints for immediate feedback; RJSF remains the submit validator. */
|
|
14
|
+
export declare function phoneError(value: unknown, schema: RJSFSchema, options: Record<string, unknown>, required?: boolean): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "extended-dynamic-forms",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Extended React JSON Schema Form (RJSF) v6 with custom components, widgets, templates, layouts, and form events",
|
|
5
5
|
"main": "dist/index.umd.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"preview": "vite preview",
|
|
35
35
|
"test": "vitest",
|
|
36
36
|
"test:ui": "vitest --ui",
|
|
37
|
+
"test:browser": "npm run build && vitest run --config vitest.browser.config.ts",
|
|
37
38
|
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 10",
|
|
38
39
|
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,md}\"",
|
|
39
40
|
"format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,css,md}\"",
|
|
@@ -74,6 +75,7 @@
|
|
|
74
75
|
"@rjsf/core": "6.0.0-beta.17",
|
|
75
76
|
"@rjsf/utils": "6.0.0-beta.17",
|
|
76
77
|
"@rjsf/validator-ajv8": "6.0.0-beta.17",
|
|
78
|
+
"@types/lodash": "^4.17.20",
|
|
77
79
|
"@types/node": "^24.0.1",
|
|
78
80
|
"@types/react": "^18.2.43",
|
|
79
81
|
"@types/react-dom": "^18.2.17",
|
|
@@ -81,7 +83,7 @@
|
|
|
81
83
|
"@typescript-eslint/parser": "^6.14.0",
|
|
82
84
|
"@vitejs/plugin-react": "^4.2.1",
|
|
83
85
|
"@vitest/coverage-v8": "^2.1.9",
|
|
84
|
-
"antd": "
|
|
86
|
+
"antd": "5.26.0",
|
|
85
87
|
"clsx": "^2.1.1",
|
|
86
88
|
"dotenv": "^16.3.1",
|
|
87
89
|
"eslint": "^8.55.0",
|
|
@@ -89,6 +91,7 @@
|
|
|
89
91
|
"eslint-plugin-prettier": "^5.4.1",
|
|
90
92
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
91
93
|
"eslint-plugin-react-refresh": "^0.4.5",
|
|
94
|
+
"jsdom": "^24.1.1",
|
|
92
95
|
"plop": "^4.0.1",
|
|
93
96
|
"prettier": "^3.5.3",
|
|
94
97
|
"react": "^18.2.0",
|
|
@@ -100,12 +103,15 @@
|
|
|
100
103
|
"vitest": "^2.1.9"
|
|
101
104
|
},
|
|
102
105
|
"dependencies": {
|
|
106
|
+
"@rc-component/mini-decimal": "^1.0.1",
|
|
103
107
|
"@types/json-logic-js": "^2.0.8",
|
|
104
108
|
"date-fns": "^4.1.0",
|
|
109
|
+
"handlebars": "^4.7.8",
|
|
105
110
|
"json-logic-js": "^2.0.5",
|
|
106
111
|
"json-rules-engine-simplified": "^0.2.0",
|
|
112
|
+
"libphonenumber-js": "^1.13.15",
|
|
107
113
|
"lucide-react": "^0.452.0",
|
|
108
|
-
"
|
|
114
|
+
"markdown-to-jsx": "^7.7.13"
|
|
109
115
|
},
|
|
110
116
|
"type": "module"
|
|
111
117
|
}
|