@djangocfg/ui-tools 2.1.320 → 2.1.321
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/JsonSchemaForm-OSPUUUHM.cjs +13 -0
- package/dist/{JsonSchemaForm-IIYKSH6X.cjs.map → JsonSchemaForm-OSPUUUHM.cjs.map} +1 -1
- package/dist/JsonSchemaForm-TSLX2GRO.mjs +4 -0
- package/dist/{JsonSchemaForm-RN3XWSWX.mjs.map → JsonSchemaForm-TSLX2GRO.mjs.map} +1 -1
- package/dist/{chunk-L37FZYJU.cjs → chunk-4IW7GZFQ.cjs} +189 -74
- package/dist/chunk-4IW7GZFQ.cjs.map +1 -0
- package/dist/{chunk-JUGQNNDC.mjs → chunk-EXGXUK2N.mjs} +190 -76
- package/dist/chunk-EXGXUK2N.mjs.map +1 -0
- package/dist/index.cjs +28 -24
- package/dist/index.d.cts +240 -206
- package/dist/index.d.ts +240 -206
- package/dist/index.mjs +2 -2
- package/package.json +6 -6
- package/src/index.ts +15 -0
- package/src/tools/JsonForm/JsonForm.story.tsx +217 -1
- package/src/tools/JsonForm/JsonSchemaForm.tsx +15 -4
- package/src/tools/JsonForm/README.md +268 -0
- package/src/tools/JsonForm/index.ts +22 -1
- package/src/tools/JsonForm/templates/FieldTemplate.tsx +28 -5
- package/src/tools/JsonForm/templates/ObjectFieldTemplate.tsx +110 -3
- package/src/tools/JsonForm/types.ts +37 -5
- package/src/tools/JsonForm/utils.ts +25 -0
- package/src/tools/JsonForm/widgets/CheckboxWidget.tsx +6 -11
- package/src/tools/JsonForm/widgets/SelectWidget.tsx +20 -12
- package/src/tools/JsonForm/widgets/SliderWidget.tsx +9 -5
- package/src/tools/JsonForm/widgets/SwitchWidget.tsx +6 -10
- package/src/tools/JsonForm/widgets/_useWidgetEnv.ts +43 -0
- package/dist/JsonSchemaForm-IIYKSH6X.cjs +0 -13
- package/dist/JsonSchemaForm-RN3XWSWX.mjs +0 -4
- package/dist/chunk-JUGQNNDC.mjs.map +0 -1
- package/dist/chunk-L37FZYJU.cjs.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -6,7 +6,10 @@ import { ViewState } from 'react-map-gl/maplibre';
|
|
|
6
6
|
import { Language } from 'prism-react-renderer';
|
|
7
7
|
export { Language } from 'prism-react-renderer';
|
|
8
8
|
import { RJSFSchema, UiSchema, WidgetProps, FieldTemplateProps, ObjectFieldTemplateProps, ArrayFieldTemplateProps, ArrayFieldItemTemplateProps, ErrorListProps } from '@rjsf/utils';
|
|
9
|
+
export { RJSFSchema, UiSchema } from '@rjsf/utils';
|
|
9
10
|
import { FormProps, IChangeEvent } from '@rjsf/core';
|
|
11
|
+
import { CustomJsonSchema7, CustomJsonUiSchema7, CustomJsonUiDisabledWhenRule, CustomJsonUiGroup } from '@djangocfg/ui-core/lib';
|
|
12
|
+
export { CustomJsonSchema7, CustomJsonSchema7Type, CustomJsonUiDisabledWhenRule, CustomJsonUiGroup, CustomJsonUiSchema7 } from '@djangocfg/ui-core/lib';
|
|
10
13
|
import { CommonExternalProps } from 'react-json-tree';
|
|
11
14
|
import { b as TreeRootProps } from './types-CevSbyfD.cjs';
|
|
12
15
|
export { c as DEFAULT_TREE_APPEARANCE, D as DEFAULT_TREE_LABELS, F as FlatRow, R as ResolvedAppearance, m as TreeAccentIntensity, k as TreeAppearance, e as TreeContextMenuSlot, l as TreeDensity, f as TreeItemId, g as TreeLabels, j as TreeLoadChildren, T as TreeNode, n as TreeRadius, i as TreeRowRenderProps, a as TreeRowSlot, h as TreeSelectionMode, d as appearanceToStyle, r as resolveAppearance } from './types-CevSbyfD.cjs';
|
|
@@ -486,14 +489,33 @@ interface PlaygroundProps$1 {
|
|
|
486
489
|
|
|
487
490
|
declare const LazyOpenapiViewer: React$1.FC<PlaygroundProps$1>;
|
|
488
491
|
|
|
492
|
+
/** Visual density for form controls. */
|
|
493
|
+
type JsonFormDensity = 'comfortable' | 'compact';
|
|
494
|
+
/**
|
|
495
|
+
* Aliases that point to the portable schema types in `@djangocfg/ui-core/lib`.
|
|
496
|
+
* Kept under their old short names for back-compat — new code can import the
|
|
497
|
+
* `CustomJson*` originals directly from ui-core.
|
|
498
|
+
*/
|
|
499
|
+
type DisabledWhenRule = CustomJsonUiDisabledWhenRule;
|
|
500
|
+
type UiGroup = CustomJsonUiGroup;
|
|
501
|
+
/** What we put into RJSF's `formContext` so widgets/templates can react to global form state. */
|
|
502
|
+
interface JsonFormContext {
|
|
503
|
+
density: JsonFormDensity;
|
|
504
|
+
/** Latest form data — used by `evaluateDisabledWhen`. */
|
|
505
|
+
formData: unknown;
|
|
506
|
+
}
|
|
489
507
|
/**
|
|
490
508
|
* JSON Schema Form props interface
|
|
491
509
|
*/
|
|
492
|
-
interface JsonSchemaFormProps<T = any> extends Partial<FormProps<T
|
|
493
|
-
/**
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
510
|
+
interface JsonSchemaFormProps<T = any> extends Omit<Partial<FormProps<T>>, 'schema' | 'uiSchema'> {
|
|
511
|
+
/**
|
|
512
|
+
* JSON Schema that defines the form structure. Accepts either RJSF's
|
|
513
|
+
* `RJSFSchema` directly or our portable `CustomJsonSchema7` from
|
|
514
|
+
* `@djangocfg/ui-core/lib` — both are cast to RJSF internally.
|
|
515
|
+
*/
|
|
516
|
+
schema: RJSFSchema | CustomJsonSchema7;
|
|
517
|
+
/** UI Schema for customizing the form appearance. Same dual-shape acceptance as `schema`. */
|
|
518
|
+
uiSchema?: UiSchema | CustomJsonUiSchema7;
|
|
497
519
|
/** Initial form data */
|
|
498
520
|
formData?: T;
|
|
499
521
|
/** Callback when form is submitted */
|
|
@@ -516,6 +538,8 @@ interface JsonSchemaFormProps<T = any> extends Partial<FormProps<T>> {
|
|
|
516
538
|
showSubmitButton?: boolean;
|
|
517
539
|
/** Submit button text */
|
|
518
540
|
submitButtonText?: string;
|
|
541
|
+
/** Visual density preset. `'compact'` shrinks rows and hides description text (moves it to label `title=` tooltip). */
|
|
542
|
+
density?: JsonFormDensity;
|
|
519
543
|
}
|
|
520
544
|
|
|
521
545
|
/**
|
|
@@ -525,6 +549,216 @@ interface JsonSchemaFormProps<T = any> extends Partial<FormProps<T>> {
|
|
|
525
549
|
*/
|
|
526
550
|
declare const LazyJsonSchemaForm: React$1.ComponentType<JsonSchemaFormProps<any>>;
|
|
527
551
|
|
|
552
|
+
/**
|
|
553
|
+
* JSON Schema Form Component
|
|
554
|
+
*
|
|
555
|
+
* A fully-featured form generator that creates forms from JSON Schema.
|
|
556
|
+
* Built on top of react-jsonschema-form with custom widgets and templates
|
|
557
|
+
* using @djangocfg/ui components.
|
|
558
|
+
*
|
|
559
|
+
* @example
|
|
560
|
+
* ```tsx
|
|
561
|
+
* const schema = {
|
|
562
|
+
* type: 'object',
|
|
563
|
+
* required: ['name'],
|
|
564
|
+
* properties: {
|
|
565
|
+
* name: { type: 'string', title: 'Name' },
|
|
566
|
+
* age: { type: 'number', title: 'Age' },
|
|
567
|
+
* active: { type: 'boolean', title: 'Active' }
|
|
568
|
+
* }
|
|
569
|
+
* };
|
|
570
|
+
*
|
|
571
|
+
* <JsonSchemaForm
|
|
572
|
+
* schema={schema}
|
|
573
|
+
* onSubmit={(data) => console.log(data.formData)}
|
|
574
|
+
* />
|
|
575
|
+
* ```
|
|
576
|
+
*/
|
|
577
|
+
declare function JsonSchemaForm<T = any>(props: JsonSchemaFormProps<T>): react_jsx_runtime.JSX.Element;
|
|
578
|
+
|
|
579
|
+
/**
|
|
580
|
+
* Utility functions for JSON Schema Form
|
|
581
|
+
*/
|
|
582
|
+
/**
|
|
583
|
+
* Safely validates and normalizes JSON Schema
|
|
584
|
+
* Ensures schema is valid before rendering
|
|
585
|
+
*/
|
|
586
|
+
declare function validateSchema(schema: any): RJSFSchema | null;
|
|
587
|
+
/**
|
|
588
|
+
* Safely normalizes form data
|
|
589
|
+
* Removes undefined values and ensures data structure matches schema
|
|
590
|
+
*/
|
|
591
|
+
declare function normalizeFormData<T = any>(formData: any, schema: RJSFSchema): T;
|
|
592
|
+
/**
|
|
593
|
+
* Merges schema defaults with form data
|
|
594
|
+
*/
|
|
595
|
+
declare function mergeDefaults(formData: any, schema: RJSFSchema): any;
|
|
596
|
+
/**
|
|
597
|
+
* Safely parses JSON string with error handling
|
|
598
|
+
*/
|
|
599
|
+
declare function safeJsonParse<T = any>(jsonString: string, fallback: T): T;
|
|
600
|
+
/**
|
|
601
|
+
* Safely stringifies object to JSON
|
|
602
|
+
*/
|
|
603
|
+
declare function safeJsonStringify(obj: any, pretty?: boolean): string;
|
|
604
|
+
/**
|
|
605
|
+
* Checks if schema has required fields
|
|
606
|
+
*/
|
|
607
|
+
declare function hasRequiredFields(schema: RJSFSchema): boolean;
|
|
608
|
+
/**
|
|
609
|
+
* Gets all required field paths from schema
|
|
610
|
+
*/
|
|
611
|
+
declare function getRequiredFields(schema: RJSFSchema, prefix?: string): string[];
|
|
612
|
+
/**
|
|
613
|
+
* Validates form data against required fields
|
|
614
|
+
*/
|
|
615
|
+
declare function validateRequiredFields(formData: any, schema: RJSFSchema): {
|
|
616
|
+
valid: boolean;
|
|
617
|
+
missing: string[];
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
* Evaluates a `ui:disabledWhen` rule against form data. Returns `true` when the
|
|
622
|
+
* field should be disabled. If `rule` is undefined, returns `false`.
|
|
623
|
+
*
|
|
624
|
+
* Supported rule shapes:
|
|
625
|
+
* { path, eq } | { path, notEq } | { path, in } | { path, notIn }
|
|
626
|
+
* | { path, truthy: true } | { path, falsy: true }
|
|
627
|
+
*/
|
|
628
|
+
declare function evaluateDisabledWhen(rule: DisabledWhenRule | undefined, formData: unknown): boolean;
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* Text input widget for JSON Schema Form
|
|
632
|
+
* Handles string fields with optional textarea for multiline
|
|
633
|
+
*/
|
|
634
|
+
declare function TextWidget(props: WidgetProps): react_jsx_runtime.JSX.Element;
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* Number input widget for JSON Schema Form
|
|
638
|
+
* Handles integer and number fields
|
|
639
|
+
*/
|
|
640
|
+
declare function NumberWidget(props: WidgetProps): react_jsx_runtime.JSX.Element;
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* Checkbox widget for JSON Schema Form
|
|
644
|
+
* Handles boolean fields
|
|
645
|
+
*/
|
|
646
|
+
declare function CheckboxWidget(props: WidgetProps): react_jsx_runtime.JSX.Element;
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* Select dropdown widget for JSON Schema Form
|
|
650
|
+
* Handles enum fields
|
|
651
|
+
*/
|
|
652
|
+
declare function SelectWidget(props: WidgetProps): react_jsx_runtime.JSX.Element;
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* Switch toggle widget for JSON Schema Form
|
|
656
|
+
* Alternative boolean input
|
|
657
|
+
*/
|
|
658
|
+
declare function SwitchWidget(props: WidgetProps): react_jsx_runtime.JSX.Element;
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* Color input widget for JSON Schema Form
|
|
662
|
+
* Supports HSL format (h s% l%) and HEX format
|
|
663
|
+
* Click on color box to open native color picker directly
|
|
664
|
+
*/
|
|
665
|
+
declare function ColorWidget(props: WidgetProps): react_jsx_runtime.JSX.Element;
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* Slider widget for JSON Schema Form
|
|
669
|
+
*
|
|
670
|
+
* Supports:
|
|
671
|
+
* - number/integer types
|
|
672
|
+
* - min/max from schema
|
|
673
|
+
* - step from schema or options
|
|
674
|
+
* - unit suffix (e.g., "rem", "px", "%")
|
|
675
|
+
* - optional text input for precise values
|
|
676
|
+
*
|
|
677
|
+
* Usage in uiSchema:
|
|
678
|
+
* ```json
|
|
679
|
+
* {
|
|
680
|
+
* "radius": {
|
|
681
|
+
* "ui:widget": "slider",
|
|
682
|
+
* "ui:options": {
|
|
683
|
+
* "unit": "rem",
|
|
684
|
+
* "showInput": true,
|
|
685
|
+
* "step": 0.125
|
|
686
|
+
* }
|
|
687
|
+
* }
|
|
688
|
+
* }
|
|
689
|
+
* ```
|
|
690
|
+
*/
|
|
691
|
+
declare function SliderWidget(props: WidgetProps): react_jsx_runtime.JSX.Element;
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* Field template for JSON Schema Form
|
|
695
|
+
* Controls the layout and styling of individual form fields
|
|
696
|
+
*/
|
|
697
|
+
declare function FieldTemplate(props: FieldTemplateProps): react_jsx_runtime.JSX.Element;
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* Object field template for JSON Schema Form
|
|
701
|
+
*
|
|
702
|
+
* Supports:
|
|
703
|
+
* - Collapsible groups via ui:collapsible option
|
|
704
|
+
* - Grid layout via ui:grid option
|
|
705
|
+
* - Custom styling via ui:className
|
|
706
|
+
*
|
|
707
|
+
* Usage in uiSchema:
|
|
708
|
+
* ```json
|
|
709
|
+
* {
|
|
710
|
+
* "colors": {
|
|
711
|
+
* "ui:collapsible": true,
|
|
712
|
+
* "ui:collapsed": false,
|
|
713
|
+
* "ui:grid": 2
|
|
714
|
+
* }
|
|
715
|
+
* }
|
|
716
|
+
* ```
|
|
717
|
+
*/
|
|
718
|
+
declare function ObjectFieldTemplate(props: ObjectFieldTemplateProps): react_jsx_runtime.JSX.Element;
|
|
719
|
+
|
|
720
|
+
/**
|
|
721
|
+
* Array field template for JSON Schema Form
|
|
722
|
+
* Renders array items with add/remove controls
|
|
723
|
+
*
|
|
724
|
+
* NOTE: In RJSF v6, `items` is an array of ReactElement (already rendered),
|
|
725
|
+
* NOT an array of objects with {children, hasRemove, etc.}.
|
|
726
|
+
* The actual rendering of each item (including remove buttons) is handled
|
|
727
|
+
* by ArrayFieldItemTemplate.
|
|
728
|
+
*/
|
|
729
|
+
declare function ArrayFieldTemplate(props: ArrayFieldTemplateProps): react_jsx_runtime.JSX.Element;
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* Array field item template for JSON Schema Form
|
|
733
|
+
* Renders individual array items with proper styling and action buttons
|
|
734
|
+
*
|
|
735
|
+
* In RJSF v6, this template is responsible for rendering each item in an array,
|
|
736
|
+
* including the item content (children) and the action buttons (remove, move up/down, copy).
|
|
737
|
+
*/
|
|
738
|
+
declare function ArrayFieldItemTemplate(props: ArrayFieldItemTemplateProps): react_jsx_runtime.JSX.Element;
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* Error list template for JSON Schema Form
|
|
742
|
+
* Displays validation errors at the top of the form
|
|
743
|
+
*/
|
|
744
|
+
declare function ErrorListTemplate(props: ErrorListProps): react_jsx_runtime.JSX.Element;
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* Base input template for JSON Schema Form
|
|
748
|
+
*
|
|
749
|
+
* This template is CRITICAL for rendering primitive types (string, number)
|
|
750
|
+
* inside arrays. Without it, array items with primitive types will render
|
|
751
|
+
* as empty containers.
|
|
752
|
+
*
|
|
753
|
+
* RJSF uses this template for:
|
|
754
|
+
* - Array items with primitive types (e.g., array of strings)
|
|
755
|
+
* - Fields without explicit widget mapping
|
|
756
|
+
* - All text-based widgets internally
|
|
757
|
+
*
|
|
758
|
+
* @see https://rjsf-team.github.io/react-jsonschema-form/docs/advanced-customization/custom-templates/#baseinputtemplate
|
|
759
|
+
*/
|
|
760
|
+
declare function BaseInputTemplate(props: WidgetProps): react_jsx_runtime.JSX.Element;
|
|
761
|
+
|
|
528
762
|
/**
|
|
529
763
|
* LottiePlayer Types
|
|
530
764
|
*
|
|
@@ -1264,206 +1498,6 @@ declare function useLottie(options: UseLottieOptions): UseLottieReturn;
|
|
|
1264
1498
|
*/
|
|
1265
1499
|
declare function LottiePlayer(props: LottiePlayerProps): react_jsx_runtime.JSX.Element;
|
|
1266
1500
|
|
|
1267
|
-
/**
|
|
1268
|
-
* JSON Schema Form Component
|
|
1269
|
-
*
|
|
1270
|
-
* A fully-featured form generator that creates forms from JSON Schema.
|
|
1271
|
-
* Built on top of react-jsonschema-form with custom widgets and templates
|
|
1272
|
-
* using @djangocfg/ui components.
|
|
1273
|
-
*
|
|
1274
|
-
* @example
|
|
1275
|
-
* ```tsx
|
|
1276
|
-
* const schema = {
|
|
1277
|
-
* type: 'object',
|
|
1278
|
-
* required: ['name'],
|
|
1279
|
-
* properties: {
|
|
1280
|
-
* name: { type: 'string', title: 'Name' },
|
|
1281
|
-
* age: { type: 'number', title: 'Age' },
|
|
1282
|
-
* active: { type: 'boolean', title: 'Active' }
|
|
1283
|
-
* }
|
|
1284
|
-
* };
|
|
1285
|
-
*
|
|
1286
|
-
* <JsonSchemaForm
|
|
1287
|
-
* schema={schema}
|
|
1288
|
-
* onSubmit={(data) => console.log(data.formData)}
|
|
1289
|
-
* />
|
|
1290
|
-
* ```
|
|
1291
|
-
*/
|
|
1292
|
-
declare function JsonSchemaForm<T = any>(props: JsonSchemaFormProps<T>): react_jsx_runtime.JSX.Element;
|
|
1293
|
-
|
|
1294
|
-
/**
|
|
1295
|
-
* Text input widget for JSON Schema Form
|
|
1296
|
-
* Handles string fields with optional textarea for multiline
|
|
1297
|
-
*/
|
|
1298
|
-
declare function TextWidget(props: WidgetProps): react_jsx_runtime.JSX.Element;
|
|
1299
|
-
|
|
1300
|
-
/**
|
|
1301
|
-
* Number input widget for JSON Schema Form
|
|
1302
|
-
* Handles integer and number fields
|
|
1303
|
-
*/
|
|
1304
|
-
declare function NumberWidget(props: WidgetProps): react_jsx_runtime.JSX.Element;
|
|
1305
|
-
|
|
1306
|
-
/**
|
|
1307
|
-
* Checkbox widget for JSON Schema Form
|
|
1308
|
-
* Handles boolean fields
|
|
1309
|
-
*/
|
|
1310
|
-
declare function CheckboxWidget(props: WidgetProps): react_jsx_runtime.JSX.Element;
|
|
1311
|
-
|
|
1312
|
-
/**
|
|
1313
|
-
* Select dropdown widget for JSON Schema Form
|
|
1314
|
-
* Handles enum fields
|
|
1315
|
-
*/
|
|
1316
|
-
declare function SelectWidget(props: WidgetProps): react_jsx_runtime.JSX.Element;
|
|
1317
|
-
|
|
1318
|
-
/**
|
|
1319
|
-
* Switch toggle widget for JSON Schema Form
|
|
1320
|
-
* Alternative boolean input
|
|
1321
|
-
*/
|
|
1322
|
-
declare function SwitchWidget(props: WidgetProps): react_jsx_runtime.JSX.Element;
|
|
1323
|
-
|
|
1324
|
-
/**
|
|
1325
|
-
* Color input widget for JSON Schema Form
|
|
1326
|
-
* Supports HSL format (h s% l%) and HEX format
|
|
1327
|
-
* Click on color box to open native color picker directly
|
|
1328
|
-
*/
|
|
1329
|
-
declare function ColorWidget(props: WidgetProps): react_jsx_runtime.JSX.Element;
|
|
1330
|
-
|
|
1331
|
-
/**
|
|
1332
|
-
* Slider widget for JSON Schema Form
|
|
1333
|
-
*
|
|
1334
|
-
* Supports:
|
|
1335
|
-
* - number/integer types
|
|
1336
|
-
* - min/max from schema
|
|
1337
|
-
* - step from schema or options
|
|
1338
|
-
* - unit suffix (e.g., "rem", "px", "%")
|
|
1339
|
-
* - optional text input for precise values
|
|
1340
|
-
*
|
|
1341
|
-
* Usage in uiSchema:
|
|
1342
|
-
* ```json
|
|
1343
|
-
* {
|
|
1344
|
-
* "radius": {
|
|
1345
|
-
* "ui:widget": "slider",
|
|
1346
|
-
* "ui:options": {
|
|
1347
|
-
* "unit": "rem",
|
|
1348
|
-
* "showInput": true,
|
|
1349
|
-
* "step": 0.125
|
|
1350
|
-
* }
|
|
1351
|
-
* }
|
|
1352
|
-
* }
|
|
1353
|
-
* ```
|
|
1354
|
-
*/
|
|
1355
|
-
declare function SliderWidget(props: WidgetProps): react_jsx_runtime.JSX.Element;
|
|
1356
|
-
|
|
1357
|
-
/**
|
|
1358
|
-
* Field template for JSON Schema Form
|
|
1359
|
-
* Controls the layout and styling of individual form fields
|
|
1360
|
-
*/
|
|
1361
|
-
declare function FieldTemplate(props: FieldTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1362
|
-
|
|
1363
|
-
/**
|
|
1364
|
-
* Object field template for JSON Schema Form
|
|
1365
|
-
*
|
|
1366
|
-
* Supports:
|
|
1367
|
-
* - Collapsible groups via ui:collapsible option
|
|
1368
|
-
* - Grid layout via ui:grid option
|
|
1369
|
-
* - Custom styling via ui:className
|
|
1370
|
-
*
|
|
1371
|
-
* Usage in uiSchema:
|
|
1372
|
-
* ```json
|
|
1373
|
-
* {
|
|
1374
|
-
* "colors": {
|
|
1375
|
-
* "ui:collapsible": true,
|
|
1376
|
-
* "ui:collapsed": false,
|
|
1377
|
-
* "ui:grid": 2
|
|
1378
|
-
* }
|
|
1379
|
-
* }
|
|
1380
|
-
* ```
|
|
1381
|
-
*/
|
|
1382
|
-
declare function ObjectFieldTemplate(props: ObjectFieldTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1383
|
-
|
|
1384
|
-
/**
|
|
1385
|
-
* Array field template for JSON Schema Form
|
|
1386
|
-
* Renders array items with add/remove controls
|
|
1387
|
-
*
|
|
1388
|
-
* NOTE: In RJSF v6, `items` is an array of ReactElement (already rendered),
|
|
1389
|
-
* NOT an array of objects with {children, hasRemove, etc.}.
|
|
1390
|
-
* The actual rendering of each item (including remove buttons) is handled
|
|
1391
|
-
* by ArrayFieldItemTemplate.
|
|
1392
|
-
*/
|
|
1393
|
-
declare function ArrayFieldTemplate(props: ArrayFieldTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1394
|
-
|
|
1395
|
-
/**
|
|
1396
|
-
* Array field item template for JSON Schema Form
|
|
1397
|
-
* Renders individual array items with proper styling and action buttons
|
|
1398
|
-
*
|
|
1399
|
-
* In RJSF v6, this template is responsible for rendering each item in an array,
|
|
1400
|
-
* including the item content (children) and the action buttons (remove, move up/down, copy).
|
|
1401
|
-
*/
|
|
1402
|
-
declare function ArrayFieldItemTemplate(props: ArrayFieldItemTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1403
|
-
|
|
1404
|
-
/**
|
|
1405
|
-
* Error list template for JSON Schema Form
|
|
1406
|
-
* Displays validation errors at the top of the form
|
|
1407
|
-
*/
|
|
1408
|
-
declare function ErrorListTemplate(props: ErrorListProps): react_jsx_runtime.JSX.Element;
|
|
1409
|
-
|
|
1410
|
-
/**
|
|
1411
|
-
* Base input template for JSON Schema Form
|
|
1412
|
-
*
|
|
1413
|
-
* This template is CRITICAL for rendering primitive types (string, number)
|
|
1414
|
-
* inside arrays. Without it, array items with primitive types will render
|
|
1415
|
-
* as empty containers.
|
|
1416
|
-
*
|
|
1417
|
-
* RJSF uses this template for:
|
|
1418
|
-
* - Array items with primitive types (e.g., array of strings)
|
|
1419
|
-
* - Fields without explicit widget mapping
|
|
1420
|
-
* - All text-based widgets internally
|
|
1421
|
-
*
|
|
1422
|
-
* @see https://rjsf-team.github.io/react-jsonschema-form/docs/advanced-customization/custom-templates/#baseinputtemplate
|
|
1423
|
-
*/
|
|
1424
|
-
declare function BaseInputTemplate(props: WidgetProps): react_jsx_runtime.JSX.Element;
|
|
1425
|
-
|
|
1426
|
-
/**
|
|
1427
|
-
* Utility functions for JSON Schema Form
|
|
1428
|
-
*/
|
|
1429
|
-
/**
|
|
1430
|
-
* Safely validates and normalizes JSON Schema
|
|
1431
|
-
* Ensures schema is valid before rendering
|
|
1432
|
-
*/
|
|
1433
|
-
declare function validateSchema(schema: any): RJSFSchema | null;
|
|
1434
|
-
/**
|
|
1435
|
-
* Safely normalizes form data
|
|
1436
|
-
* Removes undefined values and ensures data structure matches schema
|
|
1437
|
-
*/
|
|
1438
|
-
declare function normalizeFormData<T = any>(formData: any, schema: RJSFSchema): T;
|
|
1439
|
-
/**
|
|
1440
|
-
* Merges schema defaults with form data
|
|
1441
|
-
*/
|
|
1442
|
-
declare function mergeDefaults(formData: any, schema: RJSFSchema): any;
|
|
1443
|
-
/**
|
|
1444
|
-
* Safely parses JSON string with error handling
|
|
1445
|
-
*/
|
|
1446
|
-
declare function safeJsonParse<T = any>(jsonString: string, fallback: T): T;
|
|
1447
|
-
/**
|
|
1448
|
-
* Safely stringifies object to JSON
|
|
1449
|
-
*/
|
|
1450
|
-
declare function safeJsonStringify(obj: any, pretty?: boolean): string;
|
|
1451
|
-
/**
|
|
1452
|
-
* Checks if schema has required fields
|
|
1453
|
-
*/
|
|
1454
|
-
declare function hasRequiredFields(schema: RJSFSchema): boolean;
|
|
1455
|
-
/**
|
|
1456
|
-
* Gets all required field paths from schema
|
|
1457
|
-
*/
|
|
1458
|
-
declare function getRequiredFields(schema: RJSFSchema, prefix?: string): string[];
|
|
1459
|
-
/**
|
|
1460
|
-
* Validates form data against required fields
|
|
1461
|
-
*/
|
|
1462
|
-
declare function validateRequiredFields(formData: any, schema: RJSFSchema): {
|
|
1463
|
-
valid: boolean;
|
|
1464
|
-
missing: string[];
|
|
1465
|
-
};
|
|
1466
|
-
|
|
1467
1501
|
interface PlaygroundProps {
|
|
1468
1502
|
config: PlaygroundConfig;
|
|
1469
1503
|
}
|
|
@@ -2366,4 +2400,4 @@ declare function useBlobUrlCleanup(key: string | null): void;
|
|
|
2366
2400
|
*/
|
|
2367
2401
|
declare function generateContentKey(content: ArrayBuffer): string;
|
|
2368
2402
|
|
|
2369
|
-
export { type ApiKey, ArrayFieldItemTemplate, ArrayFieldTemplate, type AspectRatioValue, Player as AudioPlayer, type PlayerProps as AudioPlayerProps, BaseInputTemplate, type BlobSource, CardLoadingFallback, CheckboxWidget, ColorWidget, type CreateLazyComponentOptions, type CreateVideoErrorFallbackOptions, CronScheduler, type CronSchedulerContextValue, type CronSchedulerProps, CronSchedulerProvider, type CronSchedulerState, CustomInput, type DASHSource, type DataUrlSource, DayChips, DiffEditor, type DiffEditorProps, Editor, type EditorContextValue, type EditorFile, type EditorOptions, type EditorProps, EditorProvider, type EditorRef, type ErrorFallbackProps, ErrorListTemplate, FieldTemplate, type HLSSource, type ImageFile, ImageViewer, type ImageViewerProps, JsonSchemaForm, type JsonSchemaFormProps, JsonTreeComponent as JsonTree, type JsonTreeConfig, type JsonTreeProps, LazyPlayer as LazyAudioPlayer, LazyCronScheduler, LazyImageViewer, LazyJsonSchemaForm, LazyJsonTree, LazyLottiePlayer, LazyMapContainer, LazyMapView, LazyMermaid, LazyOpenapiViewer, LazyPrettyCode, LazyTree, TreeRootProps as LazyTreeProps, LazyVideoPlayer, LazyWrapper, type LazyWrapperProps, type LinkRule, LoadingFallback, type LoadingFallbackProps, type LottieDirection, LottiePlayer, type LottiePlayerProps, type LottieSize, type LottieSpeed, type MapContainerProps, MapLoadingFallback, type MapStyleKey, type MapViewport, MarkdownEditor, type MarkdownEditorProps, MarkdownMessage, type MarkdownMessageProps, type MarkerData, type MentionAttrs, type MentionConfig, type MentionItem, type MentionMarkdownRenderer, Mermaid, type MermaidProps, type MonthDay, MonthDayGrid, NativeProvider, NumberWidget, ObjectFieldTemplate, Playground as OpenapiViewer, type PlayerMode, type PlaygroundConfig, type PlaygroundProps$1 as PlaygroundProps, PrettyCode, type PrettyCodeProps$1 as PrettyCodeProps, type ResolveFileSourceOptions, SchedulePreview, type ScheduleType, ScheduleTypeSelector, type SchemaSource, SelectWidget, type SimpleStreamSource, SliderWidget, Spinner, StreamProvider, type StreamSource, SwitchWidget, TextWidget, TimeSelector, TreeRootProps, type UrlSource, type UseCollapsibleContentOptions, type UseCollapsibleContentResult, type UseEditorReturn, type UseLottieOptions, type UseLottieReturn, type UseMonacoReturn, VideoControls, VideoErrorFallback, type VideoErrorFallbackProps, VideoPlayer, type VideoPlayerContextValue, type VideoPlayerProps, VideoPlayerProvider, type VideoPlayerProviderProps, type VideoPlayerRef, type VideoSourceUnion, VidstackProvider, type VimeoSource, type WeekDay, type YouTubeSource, buildCron, createLazyComponent, createVideoErrorFallback, extractTextFromChildren, generateContentKey, getRequiredFields, hasRequiredFields, humanizeCron, isSimpleStreamSource, isValidCron, mentionPresets, mergeDefaults, normalizeFormData, parseCron, resolveFileSource, resolvePlayerMode, resolveStreamSource, safeJsonParse, safeJsonStringify, useAudioCache, useBlobUrlCleanup, useCollapsibleContent, useCronCustom, useCronMonthDays, useCronPreview, useCronScheduler, useCronSchedulerContext, useCronTime, useCronType, useCronWeekDays, useEditor, useEditorContext, useImageCache, useLanguage, useLottie, useMediaCacheStore, useMonaco, useVideoCache, useVideoPlayerContext, useVideoPlayerSettings, validateRequiredFields, validateSchema };
|
|
2403
|
+
export { type ApiKey, ArrayFieldItemTemplate, ArrayFieldTemplate, type AspectRatioValue, Player as AudioPlayer, type PlayerProps as AudioPlayerProps, BaseInputTemplate, type BlobSource, CardLoadingFallback, CheckboxWidget, ColorWidget, type CreateLazyComponentOptions, type CreateVideoErrorFallbackOptions, CronScheduler, type CronSchedulerContextValue, type CronSchedulerProps, CronSchedulerProvider, type CronSchedulerState, CustomInput, type DASHSource, type DataUrlSource, DayChips, DiffEditor, type DiffEditorProps, type DisabledWhenRule, Editor, type EditorContextValue, type EditorFile, type EditorOptions, type EditorProps, EditorProvider, type EditorRef, type ErrorFallbackProps, ErrorListTemplate, FieldTemplate, type HLSSource, type ImageFile, ImageViewer, type ImageViewerProps, type JsonFormContext, type JsonFormDensity, JsonSchemaForm, type JsonSchemaFormProps, JsonTreeComponent as JsonTree, type JsonTreeConfig, type JsonTreeProps, LazyPlayer as LazyAudioPlayer, LazyCronScheduler, LazyImageViewer, LazyJsonSchemaForm, LazyJsonTree, LazyLottiePlayer, LazyMapContainer, LazyMapView, LazyMermaid, LazyOpenapiViewer, LazyPrettyCode, LazyTree, TreeRootProps as LazyTreeProps, LazyVideoPlayer, LazyWrapper, type LazyWrapperProps, type LinkRule, LoadingFallback, type LoadingFallbackProps, type LottieDirection, LottiePlayer, type LottiePlayerProps, type LottieSize, type LottieSpeed, type MapContainerProps, MapLoadingFallback, type MapStyleKey, type MapViewport, MarkdownEditor, type MarkdownEditorProps, MarkdownMessage, type MarkdownMessageProps, type MarkerData, type MentionAttrs, type MentionConfig, type MentionItem, type MentionMarkdownRenderer, Mermaid, type MermaidProps, type MonthDay, MonthDayGrid, NativeProvider, NumberWidget, ObjectFieldTemplate, Playground as OpenapiViewer, type PlayerMode, type PlaygroundConfig, type PlaygroundProps$1 as PlaygroundProps, PrettyCode, type PrettyCodeProps$1 as PrettyCodeProps, type ResolveFileSourceOptions, SchedulePreview, type ScheduleType, ScheduleTypeSelector, type SchemaSource, SelectWidget, type SimpleStreamSource, SliderWidget, Spinner, StreamProvider, type StreamSource, SwitchWidget, TextWidget, TimeSelector, TreeRootProps, type UiGroup, type UrlSource, type UseCollapsibleContentOptions, type UseCollapsibleContentResult, type UseEditorReturn, type UseLottieOptions, type UseLottieReturn, type UseMonacoReturn, VideoControls, VideoErrorFallback, type VideoErrorFallbackProps, VideoPlayer, type VideoPlayerContextValue, type VideoPlayerProps, VideoPlayerProvider, type VideoPlayerProviderProps, type VideoPlayerRef, type VideoSourceUnion, VidstackProvider, type VimeoSource, type WeekDay, type YouTubeSource, buildCron, createLazyComponent, createVideoErrorFallback, evaluateDisabledWhen, extractTextFromChildren, generateContentKey, getRequiredFields, hasRequiredFields, humanizeCron, isSimpleStreamSource, isValidCron, mentionPresets, mergeDefaults, normalizeFormData, parseCron, resolveFileSource, resolvePlayerMode, resolveStreamSource, safeJsonParse, safeJsonStringify, useAudioCache, useBlobUrlCleanup, useCollapsibleContent, useCronCustom, useCronMonthDays, useCronPreview, useCronScheduler, useCronSchedulerContext, useCronTime, useCronType, useCronWeekDays, useEditor, useEditorContext, useImageCache, useLanguage, useLottie, useMediaCacheStore, useMonaco, useVideoCache, useVideoPlayerContext, useVideoPlayerSettings, validateRequiredFields, validateSchema };
|