reactaform 1.1.1 → 1.1.3
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 +10 -15
- package/dist/reactaform.cjs.js +6 -7
- package/dist/reactaform.es.js +1909 -2504
- package/package.json +83 -54
- package/dist/common-BD9zx3GT.js +0 -1
- package/dist/common-BxyjIoe1.js +0 -1
- package/dist/common-COyDhNL-.js +0 -1
- package/dist/common-hRFTL4KF.js +0 -1
- package/dist/components/LayoutComponents.d.ts +0 -76
- package/dist/components/PopupOptionMenu.d.ts +0 -15
- package/dist/components/ReactaForm.d.ts +0 -4
- package/dist/components/ReactaFormProvider.d.ts +0 -3
- package/dist/components/ReactaFormRenderer.d.ts +0 -13
- package/dist/components/Tooltip.d.ts +0 -8
- package/dist/components/VirtualizedFieldList.d.ts +0 -36
- package/dist/components/fields/CheckboxInput.d.ts +0 -9
- package/dist/components/fields/ColorInput.d.ts +0 -17
- package/dist/components/fields/DateInput.d.ts +0 -11
- package/dist/components/fields/DropdownInput.d.ts +0 -13
- package/dist/components/fields/EmailInput.d.ts +0 -5
- package/dist/components/fields/FileInput.d.ts +0 -5
- package/dist/components/fields/FloatArrayInput.d.ts +0 -5
- package/dist/components/fields/FloatInput.d.ts +0 -24
- package/dist/components/fields/ImageDisplay.d.ts +0 -17
- package/dist/components/fields/IntegerArrayInput.d.ts +0 -23
- package/dist/components/fields/IntegerInput.d.ts +0 -28
- package/dist/components/fields/MultiSelection.d.ts +0 -9
- package/dist/components/fields/MultilineTextInput.d.ts +0 -6
- package/dist/components/fields/NumericStepperInput.d.ts +0 -6
- package/dist/components/fields/PhoneInput.d.ts +0 -6
- package/dist/components/fields/RadioInput.d.ts +0 -13
- package/dist/components/fields/RatingInput.d.ts +0 -6
- package/dist/components/fields/Separator.d.ts +0 -20
- package/dist/components/fields/SliderInput.d.ts +0 -22
- package/dist/components/fields/SpinInput.d.ts +0 -6
- package/dist/components/fields/SwitchInput.d.ts +0 -13
- package/dist/components/fields/TextInput.d.ts +0 -6
- package/dist/components/fields/TimeInput.d.ts +0 -6
- package/dist/components/fields/UnitValueInput.d.ts +0 -5
- package/dist/components/fields/UrlInput.d.ts +0 -21
- package/dist/components/renderFields.d.ts +0 -4
- package/dist/core/fieldVisibility.d.ts +0 -25
- package/dist/core/index.d.ts +0 -19
- package/dist/core/reactaFormModel.d.ts +0 -38
- package/dist/core/reactaFormTypes.d.ts +0 -137
- package/dist/core/registries/baseRegistry.d.ts +0 -15
- package/dist/core/registries/componentRegistry.d.ts +0 -10
- package/dist/core/registries/index.d.ts +0 -7
- package/dist/core/registries/submissionHandlerRegistry.d.ts +0 -6
- package/dist/core/registries/validationHandlerRegistry.d.ts +0 -16
- package/dist/core/submitForm.d.ts +0 -12
- package/dist/core/validation.d.ts +0 -10
- package/dist/hooks/useDebouncedCallback.d.ts +0 -25
- package/dist/hooks/useReactaFormContext.d.ts +0 -4
- package/dist/utils/cssClasses.d.ts +0 -14
- package/dist/utils/definitionSerializers.d.ts +0 -62
- package/dist/utils/groupingHelpers.d.ts +0 -24
- package/dist/utils/index.d.ts +0 -11
- package/dist/utils/translationCache.d.ts +0 -43
- package/dist/utils/unitValueMapper.d.ts +0 -8
- /package/dist/{common-BQcVe8MY.mjs → common-BQcVe8MY.js} +0 -0
- /package/dist/{common-BnnwzTl2.mjs → common-BnnwzTl2.js} +0 -0
- /package/dist/{common-Bzz0clAC.mjs → common-Bzz0clAC.js} +0 -0
- /package/dist/{common-DLqVHgfX.mjs → common-DLqVHgfX.js} +0 -0
package/README.md
CHANGED
|
@@ -355,7 +355,7 @@ function App() {
|
|
|
355
355
|
<ReactaFormProvider
|
|
356
356
|
defaultLanguage="en"
|
|
357
357
|
defaultDarkMode={false}
|
|
358
|
-
|
|
358
|
+
definitionName="myForm"
|
|
359
359
|
>
|
|
360
360
|
<ReactaFormRenderer
|
|
361
361
|
properties={definition.properties}
|
|
@@ -366,6 +366,13 @@ function App() {
|
|
|
366
366
|
}
|
|
367
367
|
```
|
|
368
368
|
|
|
369
|
+
### Note: `definitionName` vs renderer-level override
|
|
370
|
+
|
|
371
|
+
- `ReactaFormProvider` accepts an optional `definitionName` prop which can be used as a top-level default when you are rendering a single form or when tests/storybook rely on a global active definition.
|
|
372
|
+
- `ReactaFormRenderer` injects its own `definitionName` into the React context (it wraps its output in a nested provider). This means multiple renderers with different definitions can safely coexist under the same `ReactaFormProvider`.
|
|
373
|
+
- Recommendation: prefer leaving `definitionName` empty at the top-level and let each `ReactaFormRenderer` provide the definitive `definitionName` for the fields it renders. Use the provider-level `definitionName` only for special cases (tests, single-form pages) where you need a global fallback.
|
|
374
|
+
|
|
375
|
+
|
|
369
376
|
## 📚 API Reference
|
|
370
377
|
|
|
371
378
|
### ReactaForm Props
|
|
@@ -402,7 +409,7 @@ function App() {
|
|
|
402
409
|
| `min` | `number` | No | Minimum numeric value |
|
|
403
410
|
| `max` | `number` | No | Maximum numeric value |
|
|
404
411
|
| `step` | `number` | No | Numeric step increment |
|
|
405
|
-
| `labelLayout` | `'row' \| 'column' \| 'column-center'` | No | Label positioning |
|
|
412
|
+
| `labelLayout` | `'row' \| 'column-left' \| 'column-center'` | No | Label positioning |
|
|
406
413
|
|
|
407
414
|
## 🧪 Testing
|
|
408
415
|
|
|
@@ -417,13 +424,12 @@ npm run typecheck # Type checking
|
|
|
417
424
|
|
|
418
425
|
```bash
|
|
419
426
|
npm run build:lib # Build library
|
|
420
|
-
npm
|
|
427
|
+
npm pack # Create .tgz package
|
|
421
428
|
```
|
|
422
429
|
|
|
423
430
|
Output formats:
|
|
424
431
|
- **ESM**: `dist/reactaform.es.js`
|
|
425
432
|
- **CommonJS**: `dist/reactaform.cjs.js`
|
|
426
|
-
- **UMD**: `dist/reactaform.umd.js`
|
|
427
433
|
- **Types**: `dist/index.d.ts`
|
|
428
434
|
|
|
429
435
|
## 📄 License
|
|
@@ -483,17 +489,6 @@ registerSubmissionHandler('myHandler', ...);
|
|
|
483
489
|
|
|
484
490
|
**Solution**: Either pass `darkMode={true}` prop, or wrap your app with `[data-reactaform-theme="dark"]` attribute on a parent element.
|
|
485
491
|
|
|
486
|
-
## 💡 Examples
|
|
487
|
-
|
|
488
|
-
Check the `packages/apps` directory for complete working examples:
|
|
489
|
-
- **instance-app** - Create, load, and edit multiple form instances
|
|
490
|
-
- **group-app** - Organize fields into logical groups
|
|
491
|
-
- **parents-app** - Conditional field visibility based on parent values
|
|
492
|
-
- **custom-validation-app** - Custom validation rules
|
|
493
|
-
- **translation-app** - Multi-language forms with custom translations
|
|
494
|
-
- **dark-mode-app** - Light/dark theme switching
|
|
495
|
-
- **submit-handler-app** - Custom submission handlers
|
|
496
|
-
|
|
497
492
|
---
|
|
498
493
|
|
|
499
494
|
**Built with ❤️ using React and TypeScript**
|