extended-dynamic-forms 0.3.6 → 0.3.7
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 +127 -1
- package/dist/icons/LucideIcon.d.ts +11 -0
- package/dist/index.es.js +43293 -14146
- package/dist/index.umd.js +7749 -54
- package/dist/widgets/base/types.d.ts +164 -0
- package/dist/widgets/base/utils.d.ts +36 -1
- package/dist/widgets/choice/ChoiceWidget.types.d.ts +20 -0
- package/dist/widgets/date/TimeWidget.d.ts +9 -0
- package/dist/widgets/date/dayjsSetup.d.ts +3 -0
- package/dist/widgets/date/index.d.ts +1 -0
- package/dist/widgets/index.d.ts +8 -0
- package/dist/widgets/input/AlertWidget.d.ts +10 -0
- package/dist/widgets/input/ImageWidget.d.ts +10 -0
- package/dist/widgets/input/SwitchWidget.d.ts +9 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -24,6 +24,14 @@ Extended Dynamic Forms is an extension library for React JSON Schema Form (RJSF)
|
|
|
24
24
|
- **25+ Ant Design components** for professional UI
|
|
25
25
|
- **TypeScript-first** development with full type safety
|
|
26
26
|
|
|
27
|
+
### Ant Design Prop Pass-through
|
|
28
|
+
|
|
29
|
+
All custom widgets built on Ant Design components forward their props via `ui:options`. For example, Rate, Slider, DatePicker, Input, InputNumber, ColorPicker, and TimePicker can be configured using the same prop names from AntD. In addition, you can customize the containing `Form.Item` using `ui:options.formItem`. See docs/custom-widgets-configuration.md for details and examples.
|
|
30
|
+
|
|
31
|
+
- DatePicker notes:
|
|
32
|
+
- JSON-only flags: `disablePastDates`, `disableFutureDates`, `disableWeekends` (builds `disabledDate` internally)
|
|
33
|
+
- Range support: set `ui:options.range: true` to render AntD `RangePicker` (see examples below)
|
|
34
|
+
|
|
27
35
|
## Installation
|
|
28
36
|
|
|
29
37
|
**Note:** This library currently requires local development setup and cannot be installed via npm due to local file dependencies.
|
|
@@ -345,6 +353,88 @@ Common patterns for migrating from function-based conditions:
|
|
|
345
353
|
}
|
|
346
354
|
```
|
|
347
355
|
|
|
356
|
+
#### Text Input with Variant and Auto-complete
|
|
357
|
+
```json
|
|
358
|
+
{
|
|
359
|
+
"schema": { "type": "string", "title": "Username" },
|
|
360
|
+
"uiSchema": {
|
|
361
|
+
"ui:widget": "text",
|
|
362
|
+
"ui:options": {
|
|
363
|
+
"variant": "outlined",
|
|
364
|
+
"autoFocus": true,
|
|
365
|
+
"autoComplete": "username",
|
|
366
|
+
"allowClear": true
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
#### Date Range (RangePicker)
|
|
373
|
+
```json
|
|
374
|
+
{
|
|
375
|
+
"schema": {
|
|
376
|
+
"type": "array",
|
|
377
|
+
"title": "Date Range",
|
|
378
|
+
"items": { "type": "string" },
|
|
379
|
+
"minItems": 2,
|
|
380
|
+
"maxItems": 2
|
|
381
|
+
},
|
|
382
|
+
"uiSchema": {
|
|
383
|
+
"ui:widget": "date",
|
|
384
|
+
"ui:options": {
|
|
385
|
+
"range": true,
|
|
386
|
+
"format": "YYYY-MM-DD",
|
|
387
|
+
"placeholder": ["Start date", "End date"],
|
|
388
|
+
"picker": "date"
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
With time selection:
|
|
395
|
+
```json
|
|
396
|
+
{
|
|
397
|
+
"schema": {
|
|
398
|
+
"type": "array",
|
|
399
|
+
"title": "Date Range With Time",
|
|
400
|
+
"items": { "type": "string" },
|
|
401
|
+
"minItems": 2,
|
|
402
|
+
"maxItems": 2
|
|
403
|
+
},
|
|
404
|
+
"uiSchema": {
|
|
405
|
+
"ui:widget": "date",
|
|
406
|
+
"ui:options": {
|
|
407
|
+
"range": true,
|
|
408
|
+
"showTime": true,
|
|
409
|
+
"format": "YYYY-MM-DD HH:mm",
|
|
410
|
+
"placeholder": ["Start date/time", "End date/time"]
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
Month range:
|
|
417
|
+
```json
|
|
418
|
+
{
|
|
419
|
+
"schema": {
|
|
420
|
+
"type": "array",
|
|
421
|
+
"title": "Month Range",
|
|
422
|
+
"items": { "type": "string" },
|
|
423
|
+
"minItems": 2,
|
|
424
|
+
"maxItems": 2
|
|
425
|
+
},
|
|
426
|
+
"uiSchema": {
|
|
427
|
+
"ui:widget": "date",
|
|
428
|
+
"ui:options": {
|
|
429
|
+
"range": true,
|
|
430
|
+
"picker": "month",
|
|
431
|
+
"format": "YYYY-MM",
|
|
432
|
+
"placeholder": ["Start month", "End month"]
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
```
|
|
437
|
+
|
|
348
438
|
#### Number Input with Range
|
|
349
439
|
```json
|
|
350
440
|
{
|
|
@@ -394,6 +484,25 @@ Common patterns for migrating from function-based conditions:
|
|
|
394
484
|
}
|
|
395
485
|
```
|
|
396
486
|
|
|
487
|
+
#### Choice Widget with AntD props (Dropdown)
|
|
488
|
+
```json
|
|
489
|
+
{
|
|
490
|
+
"schema": { "type": "string", "title": "Country" },
|
|
491
|
+
"uiSchema": {
|
|
492
|
+
"ui:widget": "choice",
|
|
493
|
+
"ui:options": {
|
|
494
|
+
"choiceConfig": {
|
|
495
|
+
"presentationMode": "dropdown",
|
|
496
|
+
"dataSource": { "type": "static", "options": [
|
|
497
|
+
{ "label": "USA", "value": "us" }, { "label": "UK", "value": "uk" }
|
|
498
|
+
]},
|
|
499
|
+
"antd": { "select": { "dropdownMatchSelectWidth": 280, "placement": "bottomLeft" } }
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
```
|
|
505
|
+
|
|
397
506
|
#### Choice Widget (Radio Group)
|
|
398
507
|
```json
|
|
399
508
|
{
|
|
@@ -459,7 +568,7 @@ Common patterns for migrating from function-based conditions:
|
|
|
459
568
|
"format": "data-url"
|
|
460
569
|
},
|
|
461
570
|
"uiSchema": {
|
|
462
|
-
"ui:widget": "
|
|
571
|
+
"ui:widget": "fileUpload",
|
|
463
572
|
"ui:options": {
|
|
464
573
|
"accept": ".pdf,.doc,.docx",
|
|
465
574
|
"maxSize": 5242880,
|
|
@@ -469,6 +578,23 @@ Common patterns for migrating from function-based conditions:
|
|
|
469
578
|
}
|
|
470
579
|
```
|
|
471
580
|
|
|
581
|
+
#### File Upload (Ant Upload options)
|
|
582
|
+
```json
|
|
583
|
+
{
|
|
584
|
+
"schema": { "type": "string", "title": "Profile Picture" },
|
|
585
|
+
"uiSchema": {
|
|
586
|
+
"ui:widget": "fileUpload",
|
|
587
|
+
"ui:options": {
|
|
588
|
+
"useAntUpload": true,
|
|
589
|
+
"listType": "picture-card",
|
|
590
|
+
"showUploadList": { "showPreviewIcon": true, "showRemoveIcon": true },
|
|
591
|
+
"maxCount": 1,
|
|
592
|
+
"accept": "image/*"
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
```
|
|
597
|
+
|
|
472
598
|
#### Color Picker
|
|
473
599
|
```json
|
|
474
600
|
{
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface LucideIconProps {
|
|
4
|
+
name: string;
|
|
5
|
+
size?: number;
|
|
6
|
+
color?: string;
|
|
7
|
+
strokeWidth?: number;
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
}
|
|
11
|
+
export declare const LucideIcon: React.FC<LucideIconProps>;
|