extended-dynamic-forms 0.3.13 → 0.4.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.
Files changed (43) hide show
  1. package/README.md +253 -674
  2. package/dist/WizardForm.d.ts +17 -2
  3. package/dist/components/FieldFeedbackContext.d.ts +4 -0
  4. package/dist/components/FieldStyleContext.d.ts +7 -0
  5. package/dist/components/SchemaSelectionContext.d.ts +20 -0
  6. package/dist/components/URLBlurValidationContext.d.ts +38 -0
  7. package/dist/components/fields/TextChangeScope.d.ts +28 -0
  8. package/dist/components/fields/TextEmptyArrayField.d.ts +3 -0
  9. package/dist/conditionals/v2/createConditionalEngineHook.d.ts +3 -1
  10. package/dist/conditionals/v2/index.d.ts +2 -1
  11. package/dist/conditionals/v2/types.d.ts +13 -0
  12. package/dist/conditionals/v2/utils/stepRules.d.ts +35 -0
  13. package/dist/events/FormEventContext.d.ts +3 -0
  14. package/dist/index.es.js +41796 -32825
  15. package/dist/index.umd.js +1618 -1606
  16. package/dist/layouts/wizard/WizardLayout.d.ts +1 -0
  17. package/dist/style.css +1 -1
  18. package/dist/utils/normalizeUrlValue.d.ts +3 -0
  19. package/dist/utils/urlValue.d.ts +12 -0
  20. package/dist/widgets/base/URLParts.d.ts +5 -0
  21. package/dist/widgets/base/URLPreviewLink.d.ts +5 -0
  22. package/dist/widgets/base/inputStyles.d.ts +4 -0
  23. package/dist/widgets/base/inputTypography.d.ts +3 -0
  24. package/dist/widgets/base/numberInputStyles.d.ts +4 -0
  25. package/dist/widgets/base/telephoneAddons.d.ts +3 -0
  26. package/dist/widgets/base/types.d.ts +15 -1
  27. package/dist/widgets/base/useInputChrome.d.ts +5 -0
  28. package/dist/widgets/base/utils.d.ts +9 -1
  29. package/dist/widgets/choice/ChoiceWidget.types.d.ts +2 -0
  30. package/dist/widgets/choice/dropdownValidation.d.ts +8 -0
  31. package/dist/widgets/choice/inlineChoiceValidation.d.ts +5 -0
  32. package/dist/widgets/choice/presenters/InlineChoiceGroup.d.ts +888 -0
  33. package/dist/widgets/date/DateTimeWidget.d.ts +2 -21
  34. package/dist/widgets/date/calendarConstraints.d.ts +5 -0
  35. package/dist/widgets/date/dateRangeValue.d.ts +20 -0
  36. package/dist/widgets/date/dateTimeValue.d.ts +15 -0
  37. package/dist/widgets/file/FileUploadWidget.d.ts +3 -32
  38. package/dist/widgets/index.d.ts +6 -6
  39. package/dist/widgets/input/TelephoneWidget.d.ts +1 -1
  40. package/dist/widgets/input/emailValidation.d.ts +7 -0
  41. package/dist/widgets/input/telephoneMask.d.ts +7 -0
  42. package/dist/widgets/input/telephoneOptions.d.ts +14 -0
  43. package/package.json +9 -11
@@ -1,26 +1,7 @@
1
1
  import { FC } from 'react';
2
2
  import { WidgetProps } from '@rjsf/utils';
3
3
 
4
- /**
5
- * DateTime Widget for date and time selection
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
- * File Upload Widget with support for both native input and Ant Design Upload
6
- *
7
- * @description
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;
@@ -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<any, import('@rjsf/utils').RJSFSchema, any>>;
37
- telephone: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
38
- TelWidget: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
39
- TelephoneWidget: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
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<any, import('@rjsf/utils').RJSFSchema, any>>;
65
- DateTimeWidget: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
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>>;
@@ -29,6 +29,6 @@ import { WidgetProps } from '@rjsf/utils';
29
29
  * }
30
30
  * }
31
31
  */
32
- declare const TelephoneWidget: FC<WidgetProps>;
32
+ declare const TelephoneWidget: FC<WidgetProps<unknown>>;
33
33
  export default TelephoneWidget;
34
34
  export { TelephoneWidget };
@@ -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.13",
3
+ "version": "0.4.1",
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}\"",
@@ -55,14 +56,6 @@
55
56
  ],
56
57
  "author": "",
57
58
  "license": "MIT",
58
- "repository": {
59
- "type": "git",
60
- "url": "https://github.com/user/extended-dynamic-forms.git"
61
- },
62
- "homepage": "https://github.com/user/extended-dynamic-forms#readme",
63
- "bugs": {
64
- "url": "https://github.com/user/extended-dynamic-forms/issues"
65
- },
66
59
  "peerDependencies": {
67
60
  "antd": "^5.24.0",
68
61
  "dayjs": "^1.11.13",
@@ -74,6 +67,7 @@
74
67
  "@rjsf/core": "6.0.0-beta.17",
75
68
  "@rjsf/utils": "6.0.0-beta.17",
76
69
  "@rjsf/validator-ajv8": "6.0.0-beta.17",
70
+ "@types/lodash": "^4.17.20",
77
71
  "@types/node": "^24.0.1",
78
72
  "@types/react": "^18.2.43",
79
73
  "@types/react-dom": "^18.2.17",
@@ -81,7 +75,7 @@
81
75
  "@typescript-eslint/parser": "^6.14.0",
82
76
  "@vitejs/plugin-react": "^4.2.1",
83
77
  "@vitest/coverage-v8": "^2.1.9",
84
- "antd": "^5.26.0",
78
+ "antd": "5.26.0",
85
79
  "clsx": "^2.1.1",
86
80
  "dotenv": "^16.3.1",
87
81
  "eslint": "^8.55.0",
@@ -89,6 +83,7 @@
89
83
  "eslint-plugin-prettier": "^5.4.1",
90
84
  "eslint-plugin-react-hooks": "^4.6.0",
91
85
  "eslint-plugin-react-refresh": "^0.4.5",
86
+ "jsdom": "^24.1.1",
92
87
  "plop": "^4.0.1",
93
88
  "prettier": "^3.5.3",
94
89
  "react": "^18.2.0",
@@ -100,12 +95,15 @@
100
95
  "vitest": "^2.1.9"
101
96
  },
102
97
  "dependencies": {
98
+ "@rc-component/mini-decimal": "^1.0.1",
103
99
  "@types/json-logic-js": "^2.0.8",
104
100
  "date-fns": "^4.1.0",
101
+ "handlebars": "^4.7.8",
105
102
  "json-logic-js": "^2.0.5",
106
103
  "json-rules-engine-simplified": "^0.2.0",
104
+ "libphonenumber-js": "^1.13.15",
107
105
  "lucide-react": "^0.452.0",
108
- "handlebars": "^4.7.8"
106
+ "markdown-to-jsx": "^7.7.13"
109
107
  },
110
108
  "type": "module"
111
109
  }