@strictly/react-form 0.0.30 → 0.0.32
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/.out/.storybook/preview.js +7 -0
- package/.out/core/mobx/{field_adapter.d.ts → FieldAdapter.d.ts} +1 -1
- package/.out/core/mobx/{field_adapters_of_values.d.ts → FieldAdaptersOfValues.d.ts} +1 -1
- package/.out/core/mobx/{flattened_adapters_of_fields.d.ts → FlattenedAdaptersOfFields.d.ts} +2 -2
- package/.out/core/mobx/{form_fields_of_field_adapters.d.ts → FormFieldsOfFieldAdapters.d.ts} +2 -2
- package/.out/core/mobx/{form_model.d.ts → FormModel.d.ts} +6 -5
- package/.out/core/mobx/{form_model.js → FormModel.js} +47 -35
- package/.out/core/mobx/{field_adapter_builder.d.ts → fieldAdapterBuilder.d.ts} +2 -2
- package/.out/core/mobx/{field_adapter_builder.js → fieldAdapterBuilder.js} +6 -6
- package/.out/core/mobx/hooks.d.ts +1 -1
- package/.out/core/mobx/hooks.js +15 -6
- package/.out/core/mobx/{merge_field_adapters_with_two_way_converter.d.ts → mergeFieldAdaptersWithTwoWayConverter.d.ts} +2 -2
- package/.out/core/mobx/{merge_field_adapters_with_two_way_converter.js → mergeFieldAdaptersWithTwoWayConverter.js} +1 -1
- package/.out/core/mobx/{merge_field_adapters_with_validators.d.ts → mergeFieldAdaptersWithValidators.d.ts} +1 -1
- package/.out/core/mobx/{merge_field_adapters_with_validators.js → mergeFieldAdaptersWithValidators.js} +1 -1
- package/.out/core/mobx/peek.d.ts +5 -0
- package/.out/core/mobx/peek.js +16 -0
- package/.out/core/mobx/specs/{form_model.tests.js → FormModel.tests.js} +8 -8
- package/.out/core/mobx/specs/{merge_field_adapters_with_two_way_converter.tests.js → MergeFieldAdaptersWithTwoWayConverter.tests.js} +4 -4
- package/.out/core/mobx/specs/{merge_field_adapters_with_validators.tests.js → MergeFieldAdaptersWithValidators.tests.js} +3 -3
- package/.out/core/mobx/specs/fixtures.d.ts +2 -2
- package/.out/core/mobx/specs/{sub_form_field_adapters.tests.js → subFormFieldAdapters.tests.js} +2 -2
- package/.out/core/mobx/{sub_form_field_adapters.d.ts → subFormFieldAdapters.d.ts} +1 -1
- package/.out/core/props.d.ts +1 -1
- package/.out/field_converters/{integer_to_string_converter.d.ts → IntegerToStringConverter.d.ts} +1 -1
- package/.out/field_converters/{integer_to_string_converter.js → IntegerToStringConverter.js} +1 -1
- package/.out/field_converters/{maybe_identity_converter.d.ts → MaybeIdentityConverter.d.ts} +1 -1
- package/.out/field_converters/{nullable_to_boolean_converter.d.ts → NullableToBooleanConverter.d.ts} +1 -1
- package/.out/field_converters/{nullable_to_boolean_converter.js → NullableToBooleanConverter.js} +1 -1
- package/.out/field_converters/{select_value_type_converter.d.ts → SelectValueTypeConverter.d.ts} +1 -1
- package/.out/field_converters/{select_value_type_converter.js → SelectValueTypeConverter.js} +1 -1
- package/.out/field_converters/{trimming_string_converter.d.ts → TrimmingStringConverter.d.ts} +1 -1
- package/.out/field_converters/{trimming_string_converter.js → TrimmingStringConverter.js} +1 -1
- package/.out/field_converters/{chain_field_converter.d.ts → chainFieldConverter.d.ts} +1 -1
- package/.out/field_converters/{chain_field_converter.js → chainFieldConverter.js} +1 -1
- package/.out/field_converters/{identity_converter.d.ts → identityConverter.d.ts} +1 -1
- package/.out/field_converters/{identity_converter.js → identityConverter.js} +1 -1
- package/.out/field_converters/specs/{chain_field_converter.tests.js → chainFieldConverter.tests.js} +2 -2
- package/.out/field_converters/{validating_converter.d.ts → validatingConverter.d.ts} +1 -1
- package/.out/field_converters/{validating_converter.js → validatingConverter.js} +1 -1
- package/.out/field_value_factories/{prototyping_field_value_factory.d.ts → prototypingFieldValueFactory.d.ts} +1 -1
- package/.out/index.d.ts +23 -22
- package/.out/index.js +23 -22
- package/.out/mantine/{error_renderer.d.ts → ErrorRenderer.d.ts} +2 -2
- package/.out/mantine/{create_checkbox.d.ts → createCheckbox.d.ts} +3 -3
- package/.out/mantine/{create_checkbox.js → createCheckbox.js} +2 -2
- package/.out/mantine/{create_field_view.d.ts → createFieldView.d.ts} +4 -4
- package/.out/mantine/{create_field_view.js → createFieldView.js} +1 -1
- package/.out/mantine/{create_fields_view.d.ts → createFieldsView.d.ts} +3 -3
- package/.out/mantine/{create_form.d.ts → createForm.d.ts} +3 -3
- package/.out/mantine/{create_list.d.ts → createList.d.ts} +3 -3
- package/.out/mantine/{create_list.js → createList.js} +1 -1
- package/.out/mantine/{create_pill.d.ts → createPill.d.ts} +2 -2
- package/.out/mantine/{create_pill.js → createPill.js} +1 -1
- package/.out/mantine/{create_radio.d.ts → createRadio.d.ts} +3 -3
- package/.out/mantine/{create_radio.js → createRadio.js} +1 -1
- package/.out/mantine/{create_radio_group.d.ts → createRadioGroup.d.ts} +3 -3
- package/.out/mantine/{create_radio_group.js → createRadioGroup.js} +2 -2
- package/.out/mantine/{create_text_input.d.ts → createTextInput.d.ts} +3 -3
- package/.out/mantine/{create_text_input.js → createTextInput.js} +2 -2
- package/.out/mantine/{create_value_input.d.ts → createValueInput.d.ts} +4 -4
- package/.out/mantine/{create_value_input.js → createValueInput.js} +2 -2
- package/.out/mantine/hooks.d.ts +18 -18
- package/.out/mantine/hooks.js +10 -10
- package/.out/mantine/specs/{checkbox_hooks.stories.d.ts → checkboxHooks.stories.d.ts} +1 -1
- package/.out/mantine/specs/{checkbox_hooks.stories.js → checkboxHooks.stories.js} +1 -1
- package/.out/mantine/specs/{checkbox_hooks.tests.js → checkboxHooks.tests.js} +2 -2
- package/.out/mantine/specs/{field_view_hooks.stories.d.ts → fieldViewHooks.stories.d.ts} +1 -1
- package/.out/mantine/specs/{field_view_hooks.tests.js → fieldViewHooks.tests.js} +1 -1
- package/.out/mantine/specs/{fields_view_hooks.stories.d.ts → fieldsViewHooks.stories.d.ts} +1 -1
- package/.out/mantine/specs/{fields_view_hooks.tests.js → fieldsViewHooks.tests.js} +1 -1
- package/.out/mantine/specs/{form_hooks.stories.d.ts → formHooks.stories.d.ts} +1 -1
- package/.out/mantine/specs/{form_hooks.tests.js → formHooks.tests.js} +1 -1
- package/.out/mantine/specs/{list_hooks.stories.d.ts → listHooks.stories.d.ts} +1 -1
- package/.out/mantine/specs/{list_hooks.tests.js → listHooks.tests.js} +1 -1
- package/.out/mantine/specs/{radio_group_hooks.stories.d.ts → radioGroupHooks.stories.d.ts} +2 -2
- package/.out/mantine/specs/{radio_group_hooks.stories.js → radioGroupHooks.stories.js} +1 -1
- package/.out/mantine/specs/{radio_group_hooks.tests.js → radioGroupHooks.tests.js} +2 -2
- package/.out/mantine/specs/{select_hooks.stories.d.ts → selectHooks.stories.d.ts} +1 -1
- package/.out/mantine/specs/{select_hooks.stories.js → selectHooks.stories.js} +1 -1
- package/.out/mantine/specs/{select_hooks.tests.js → selectHooks.tests.js} +1 -1
- package/.out/mantine/specs/{text_input_hooks.stories.d.ts → textInputHooks.stories.d.ts} +2 -2
- package/.out/mantine/specs/{text_input_hooks.stories.js → textInputHooks.stories.js} +1 -1
- package/.out/mantine/specs/{text_input_hooks.tests.js → textInputHooks.tests.js} +2 -2
- package/.out/mantine/specs/{value_input_hooks.stories.d.ts → valueInputHooks.stories.d.ts} +2 -2
- package/.out/mantine/specs/{value_input_hooks.stories.js → valueInputHooks.stories.js} +1 -1
- package/.out/mantine/specs/{value_input_hooks.tests.js → valueInputHooks.tests.js} +1 -1
- package/.out/mantine/types.d.ts +3 -3
- package/.out/tsconfig.tsbuildinfo +1 -1
- package/.out/types/{all_fields_of_fields.d.ts → AllFieldsOfFields.d.ts} +2 -2
- package/.out/types/{boolean_fields_of_fields.d.ts → BooleanFieldsOfFields.d.ts} +2 -2
- package/.out/types/{error_of_field.d.ts → ErrorOfField.d.ts} +1 -1
- package/.out/types/{flattened_validators_of_fields.d.ts → FlattenedValidatorsOfFields.d.ts} +1 -1
- package/.out/types/{list_fields_of_fields.d.ts → ListFieldsOfFields.d.ts} +2 -2
- package/.out/types/{string_fields_of_fields.d.ts → StringFieldsOfFields.d.ts} +2 -2
- package/.out/types/{sub_form_fields.d.ts → SubFormFields.d.ts} +1 -1
- package/.out/types/{value_type_of_field.d.ts → ValueTypeOfField.d.ts} +1 -1
- package/.out/types/specs/{merge_validators.tests.js → MergeValidators.tests.js} +1 -1
- package/.out/vitest.workspace.js +4 -4
- package/.storybook/preview.tsx +8 -0
- package/.turbo/turbo-build.log +7 -7
- package/.turbo/turbo-check-types.log +1 -1
- package/.turbo/turbo-release$colon$exports.log +1 -1
- package/core/mobx/{field_adapter.ts → FieldAdapter.ts} +1 -1
- package/core/mobx/{field_adapters_of_values.ts → FieldAdaptersOfValues.ts} +1 -1
- package/core/mobx/{flattened_adapters_of_fields.ts → FlattenedAdaptersOfFields.ts} +2 -2
- package/core/mobx/{form_fields_of_field_adapters.ts → FormFieldsOfFieldAdapters.ts} +2 -2
- package/core/mobx/{form_model.ts → FormModel.ts} +33 -26
- package/core/mobx/{field_adapter_builder.ts → fieldAdapterBuilder.ts} +7 -7
- package/core/mobx/hooks.tsx +19 -7
- package/core/mobx/{merge_field_adapters_with_two_way_converter.ts → mergeFieldAdaptersWithTwoWayConverter.ts} +3 -3
- package/core/mobx/{merge_field_adapters_with_validators.ts → mergeFieldAdaptersWithValidators.ts} +2 -2
- package/core/mobx/peek.ts +17 -0
- package/core/mobx/specs/{flattened_adapters_of_fields.tests.ts → FlattenedAdaptersOfFields.tests.ts} +3 -3
- package/core/mobx/specs/{flattened_list_types_of_types.tests.ts → FlattenedListTypesOfTypes.tests.ts} +1 -1
- package/core/mobx/specs/{form_model.tests.ts → FormModel.tests.ts} +10 -10
- package/core/mobx/specs/{merge_field_adapters_with_two_way_converter.tests.ts → MergeFieldAdaptersWithTwoWayConverter.tests.ts} +5 -5
- package/core/mobx/specs/{merge_field_adapters_with_validators.tests.ts → MergeFieldAdaptersWithValidators.tests.ts} +4 -4
- package/core/mobx/specs/fixtures.ts +2 -2
- package/core/mobx/specs/{sub_form_field_adapters.tests.ts → subFormFieldAdapters.tests.ts} +3 -3
- package/core/mobx/{sub_form_field_adapters.ts → subFormFieldAdapters.ts} +1 -1
- package/core/props.ts +1 -1
- package/dist/index.cjs +161 -132
- package/dist/index.d.cts +19 -12
- package/dist/index.d.ts +19 -12
- package/dist/index.js +166 -136
- package/field_converters/{integer_to_string_converter.ts → IntegerToStringConverter.ts} +1 -1
- package/field_converters/{maybe_identity_converter.ts → MaybeIdentityConverter.ts} +1 -1
- package/field_converters/{nullable_to_boolean_converter.ts → NullableToBooleanConverter.ts} +1 -1
- package/field_converters/{select_value_type_converter.ts → SelectValueTypeConverter.ts} +1 -1
- package/field_converters/{trimming_string_converter.ts → TrimmingStringConverter.ts} +1 -1
- package/field_converters/{chain_field_converter.ts → chainFieldConverter.ts} +1 -1
- package/field_converters/{identity_converter.ts → identityConverter.ts} +1 -1
- package/field_converters/specs/{chain_field_converter.tests.ts → chainFieldConverter.tests.ts} +2 -2
- package/field_converters/{validating_converter.ts → validatingConverter.ts} +1 -1
- package/field_value_factories/{prototyping_field_value_factory.ts → prototypingFieldValueFactory.ts} +1 -1
- package/index.ts +23 -22
- package/mantine/{error_renderer.ts → ErrorRenderer.ts} +2 -2
- package/mantine/{create_checkbox.tsx → createCheckbox.tsx} +5 -5
- package/mantine/{create_field_view.tsx → createFieldView.tsx} +5 -5
- package/mantine/{create_fields_view.tsx → createFieldsView.tsx} +4 -4
- package/mantine/{create_form.tsx → createForm.tsx} +3 -3
- package/mantine/{create_list.tsx → createList.tsx} +4 -4
- package/mantine/{create_pill.tsx → createPill.tsx} +3 -3
- package/mantine/{create_radio.tsx → createRadio.tsx} +4 -4
- package/mantine/{create_radio_group.tsx → createRadioGroup.tsx} +5 -5
- package/mantine/{create_text_input.tsx → createTextInput.tsx} +5 -5
- package/mantine/{create_value_input.tsx → createValueInput.tsx} +6 -6
- package/mantine/hooks.tsx +22 -22
- package/mantine/specs/{create_fields_view.tests.ts → CreateFieldsView.tests.ts} +1 -1
- package/mantine/specs/{checkbox_hooks.stories.tsx → checkboxHooks.stories.tsx} +2 -2
- package/mantine/specs/{checkbox_hooks.tests.tsx → checkboxHooks.tests.tsx} +2 -2
- package/mantine/specs/{field_view_hooks.stories.tsx → fieldViewHooks.stories.tsx} +1 -1
- package/mantine/specs/{field_view_hooks.tests.tsx → fieldViewHooks.tests.tsx} +1 -1
- package/mantine/specs/{fields_view_hooks.stories.tsx → fieldsViewHooks.stories.tsx} +1 -1
- package/mantine/specs/{fields_view_hooks.tests.tsx → fieldsViewHooks.tests.tsx} +1 -1
- package/mantine/specs/{form_hooks.stories.tsx → formHooks.stories.tsx} +1 -1
- package/mantine/specs/{form_hooks.tests.tsx → formHooks.tests.tsx} +1 -1
- package/mantine/specs/{list_hooks.stories.tsx → listHooks.stories.tsx} +1 -1
- package/mantine/specs/{list_hooks.tests.tsx → listHooks.tests.tsx} +1 -1
- package/mantine/specs/{radio_group_hooks.stories.tsx → radioGroupHooks.stories.tsx} +3 -3
- package/mantine/specs/{radio_group_hooks.tests.tsx → radioGroupHooks.tests.tsx} +2 -2
- package/mantine/specs/{select_hooks.stories.tsx → selectHooks.stories.tsx} +2 -2
- package/mantine/specs/{select_hooks.tests.tsx → selectHooks.tests.tsx} +1 -1
- package/mantine/specs/{text_input_hooks.stories.tsx → textInputHooks.stories.tsx} +3 -3
- package/mantine/specs/{text_input_hooks.tests.tsx → textInputHooks.tests.tsx} +2 -2
- package/mantine/specs/{value_input_hooks.stories.tsx → valueInputHooks.stories.tsx} +3 -3
- package/mantine/specs/{value_input_hooks.tests.tsx → valueInputHooks.tests.tsx} +1 -1
- package/mantine/types.ts +3 -3
- package/package.json +1 -1
- package/types/{all_fields_of_fields.ts → AllFieldsOfFields.ts} +2 -2
- package/types/{boolean_fields_of_fields.ts → BooleanFieldsOfFields.ts} +2 -2
- package/types/{error_of_field.ts → ErrorOfField.ts} +1 -1
- package/types/{flattened_validators_of_fields.ts → FlattenedValidatorsOfFields.ts} +1 -1
- package/types/{list_fields_of_fields.ts → ListFieldsOfFields.ts} +2 -2
- package/types/{string_fields_of_fields.ts → StringFieldsOfFields.ts} +2 -2
- package/types/{sub_form_fields.ts → SubFormFields.ts} +1 -1
- package/types/{value_type_of_field.ts → ValueTypeOfField.ts} +1 -1
- package/types/specs/{boolean_fields_of_fields.tests.ts → BooleanFieldsOfFields.tests.ts} +2 -2
- package/types/specs/{error_of_field.tests.ts → ErrorOfField.tests.ts} +2 -2
- package/types/specs/{flattened_validators_of_fields.tests.ts → FlattenedValidatorsOfFields.tests.ts} +2 -2
- package/types/specs/{list_fields_of_fields.tests.ts → ListFieldsOfFields.tests.ts} +2 -2
- package/types/specs/{merge_validators.tests.ts → MergeValidators.tests.ts} +1 -1
- package/types/specs/{string_fields_of_fields.tests.ts → StringFieldsOfFields.tests.ts} +2 -2
- package/types/specs/{sub_form_fields.tests.ts → SubFormFields.tests.ts} +2 -2
- package/types/specs/{value_type_of_field.tests.ts → ValueTypeOfField.tests.ts} +2 -2
- package/util/specs/partial.tests.tsx +1 -1
- package/vitest.workspace.ts +4 -4
- /package/.out/.vitest/{install_deterministic_random.d.ts → installDeterministicRandom.d.ts} +0 -0
- /package/.out/.vitest/{install_deterministic_random.js → installDeterministicRandom.js} +0 -0
- /package/.out/.vitest/{install_storybook_preview.d.ts → installStorybookPreview.d.ts} +0 -0
- /package/.out/.vitest/{install_storybook_preview.js → installStorybookPreview.js} +0 -0
- /package/.out/.vitest/{match_media.d.ts → matchMedia.d.ts} +0 -0
- /package/.out/.vitest/{match_media.js → matchMedia.js} +0 -0
- /package/.out/.vitest/{resize_observer.d.ts → resizeObserver.d.ts} +0 -0
- /package/.out/.vitest/{resize_observer.js → resizeObserver.js} +0 -0
- /package/.out/core/mobx/{field_adapter.js → FieldAdapter.js} +0 -0
- /package/.out/core/mobx/{field_adapters_of_values.js → FieldAdaptersOfValues.js} +0 -0
- /package/.out/core/mobx/{flattened_adapters_of_fields.js → FlattenedAdaptersOfFields.js} +0 -0
- /package/.out/core/mobx/{flattened_list_types_of_type.d.ts → FlattenedListTypesOfType.d.ts} +0 -0
- /package/.out/core/mobx/{flattened_list_types_of_type.js → FlattenedListTypesOfType.js} +0 -0
- /package/.out/core/mobx/{form_fields_of_field_adapters.js → FormFieldsOfFieldAdapters.js} +0 -0
- /package/.out/core/mobx/specs/{flattened_adapters_of_fields.tests.d.ts → FlattenedAdaptersOfFields.tests.d.ts} +0 -0
- /package/.out/core/mobx/specs/{flattened_adapters_of_fields.tests.js → FlattenedAdaptersOfFields.tests.js} +0 -0
- /package/.out/core/mobx/specs/{flattened_list_types_of_types.tests.d.ts → FlattenedListTypesOfTypes.tests.d.ts} +0 -0
- /package/.out/core/mobx/specs/{flattened_list_types_of_types.tests.js → FlattenedListTypesOfTypes.tests.js} +0 -0
- /package/.out/core/mobx/specs/{form_model.tests.d.ts → FormModel.tests.d.ts} +0 -0
- /package/.out/core/mobx/specs/{merge_field_adapters_with_two_way_converter.tests.d.ts → MergeFieldAdaptersWithTwoWayConverter.tests.d.ts} +0 -0
- /package/.out/core/mobx/specs/{merge_field_adapters_with_validators.tests.d.ts → MergeFieldAdaptersWithValidators.tests.d.ts} +0 -0
- /package/.out/core/mobx/specs/{sub_form_field_adapters.tests.d.ts → subFormFieldAdapters.tests.d.ts} +0 -0
- /package/.out/core/mobx/{sub_form_field_adapters.js → subFormFieldAdapters.js} +0 -0
- /package/.out/field_converters/{maybe_identity_converter.js → MaybeIdentityConverter.js} +0 -0
- /package/.out/field_converters/specs/{chain_field_converter.tests.d.ts → chainFieldConverter.tests.d.ts} +0 -0
- /package/.out/field_value_factories/{prototyping_field_value_factory.js → prototypingFieldValueFactory.js} +0 -0
- /package/.out/mantine/{error_renderer.js → ErrorRenderer.js} +0 -0
- /package/.out/mantine/{create_fields_view.js → createFieldsView.js} +0 -0
- /package/.out/mantine/{create_form.js → createForm.js} +0 -0
- /package/.out/mantine/specs/{checkbox_hooks.tests.d.ts → CreateFieldsView.tests.d.ts} +0 -0
- /package/.out/mantine/specs/{create_fields_view.tests.js → CreateFieldsView.tests.js} +0 -0
- /package/.out/mantine/specs/{checkbox_constants.d.ts → checkboxConstants.d.ts} +0 -0
- /package/.out/mantine/specs/{checkbox_constants.js → checkboxConstants.js} +0 -0
- /package/.out/mantine/specs/{create_fields_view.tests.d.ts → checkboxHooks.tests.d.ts} +0 -0
- /package/.out/mantine/specs/{field_view_hooks.stories.js → fieldViewHooks.stories.js} +0 -0
- /package/.out/mantine/specs/{field_view_hooks.tests.d.ts → fieldViewHooks.tests.d.ts} +0 -0
- /package/.out/mantine/specs/{fields_view_hooks.stories.js → fieldsViewHooks.stories.js} +0 -0
- /package/.out/mantine/specs/{fields_view_hooks.tests.d.ts → fieldsViewHooks.tests.d.ts} +0 -0
- /package/.out/mantine/specs/{form_hooks.stories.js → formHooks.stories.js} +0 -0
- /package/.out/mantine/specs/{form_hooks.tests.d.ts → formHooks.tests.d.ts} +0 -0
- /package/.out/mantine/specs/{list_hooks.stories.js → listHooks.stories.js} +0 -0
- /package/.out/mantine/specs/{list_hooks.tests.d.ts → listHooks.tests.d.ts} +0 -0
- /package/.out/mantine/specs/{radio_group_constants.d.ts → radioGroupConstants.d.ts} +0 -0
- /package/.out/mantine/specs/{radio_group_constants.js → radioGroupConstants.js} +0 -0
- /package/.out/mantine/specs/{radio_group_hooks.tests.d.ts → radioGroupHooks.tests.d.ts} +0 -0
- /package/.out/mantine/specs/{select_hooks.tests.d.ts → selectHooks.tests.d.ts} +0 -0
- /package/.out/mantine/specs/{select_hooks_constant.d.ts → selectHooksConstant.d.ts} +0 -0
- /package/.out/mantine/specs/{select_hooks_constant.js → selectHooksConstant.js} +0 -0
- /package/.out/mantine/specs/{text_input_constants.d.ts → textInputConstants.d.ts} +0 -0
- /package/.out/mantine/specs/{text_input_constants.js → textInputConstants.js} +0 -0
- /package/.out/mantine/specs/{text_input_hooks.tests.d.ts → textInputHooks.tests.d.ts} +0 -0
- /package/.out/mantine/specs/{value_input_constants.d.ts → valueInputConstants.d.ts} +0 -0
- /package/.out/mantine/specs/{value_input_constants.js → valueInputConstants.js} +0 -0
- /package/.out/mantine/specs/{value_input_hooks.tests.d.ts → valueInputHooks.tests.d.ts} +0 -0
- /package/.out/types/{all_fields_of_fields.js → AllFieldsOfFields.js} +0 -0
- /package/.out/types/{boolean_fields_of_fields.js → BooleanFieldsOfFields.js} +0 -0
- /package/.out/types/{error_of_field.js → ErrorOfField.js} +0 -0
- /package/.out/types/{field.d.ts → Field.d.ts} +0 -0
- /package/.out/types/{field.js → Field.js} +0 -0
- /package/.out/types/{field_converters.d.ts → FieldConverters.d.ts} +0 -0
- /package/.out/types/{field_converters.js → FieldConverters.js} +0 -0
- /package/.out/types/{flattened_validators_of_fields.js → FlattenedValidatorsOfFields.js} +0 -0
- /package/.out/types/{list_fields_of_fields.js → ListFieldsOfFields.js} +0 -0
- /package/.out/types/{specs/boolean_fields_of_fields.tests.d.ts → StringFieldsOfFields.js} +0 -0
- /package/.out/types/{specs/error_of_field.tests.d.ts → SubFormFields.js} +0 -0
- /package/.out/types/{specs/flattened_validators_of_fields.tests.d.ts → ValueTypeOfField.js} +0 -0
- /package/.out/types/{merge_validators.d.ts → mergeValidators.d.ts} +0 -0
- /package/.out/types/{merge_validators.js → mergeValidators.js} +0 -0
- /package/.out/types/specs/{list_fields_of_fields.tests.d.ts → BooleanFieldsOfFields.tests.d.ts} +0 -0
- /package/.out/types/specs/{boolean_fields_of_fields.tests.js → BooleanFieldsOfFields.tests.js} +0 -0
- /package/.out/types/specs/{merge_validators.tests.d.ts → ErrorOfField.tests.d.ts} +0 -0
- /package/.out/types/specs/{error_of_field.tests.js → ErrorOfField.tests.js} +0 -0
- /package/.out/types/specs/{string_fields_of_fields.tests.d.ts → FlattenedValidatorsOfFields.tests.d.ts} +0 -0
- /package/.out/types/specs/{flattened_validators_of_fields.tests.js → FlattenedValidatorsOfFields.tests.js} +0 -0
- /package/.out/types/specs/{sub_form_fields.tests.d.ts → ListFieldsOfFields.tests.d.ts} +0 -0
- /package/.out/types/specs/{list_fields_of_fields.tests.js → ListFieldsOfFields.tests.js} +0 -0
- /package/.out/types/specs/{value_type_of_field.tests.d.ts → MergeValidators.tests.d.ts} +0 -0
- /package/.out/types/{string_fields_of_fields.js → specs/StringFieldsOfFields.tests.d.ts} +0 -0
- /package/.out/types/specs/{string_fields_of_fields.tests.js → StringFieldsOfFields.tests.js} +0 -0
- /package/.out/types/{sub_form_fields.js → specs/SubFormFields.tests.d.ts} +0 -0
- /package/.out/types/specs/{sub_form_fields.tests.js → SubFormFields.tests.js} +0 -0
- /package/.out/types/{value_type_of_field.js → specs/ValueTypeOfField.tests.d.ts} +0 -0
- /package/.out/types/specs/{value_type_of_field.tests.js → ValueTypeOfField.tests.js} +0 -0
- /package/.out/util/{empty.d.ts → Empty.d.ts} +0 -0
- /package/.out/util/{empty.js → Empty.js} +0 -0
- /package/.out/util/{partial.d.ts → Partial.d.ts} +0 -0
- /package/.out/util/{partial.js → Partial.js} +0 -0
- /package/.vitest/{install_deterministic_random.ts → installDeterministicRandom.ts} +0 -0
- /package/.vitest/{install_storybook_preview.ts → installStorybookPreview.ts} +0 -0
- /package/.vitest/{match_media.ts → matchMedia.ts} +0 -0
- /package/.vitest/{resize_observer.ts → resizeObserver.ts} +0 -0
- /package/core/mobx/{flattened_list_types_of_type.ts → FlattenedListTypesOfType.ts} +0 -0
- /package/mantine/specs/__snapshots__/{checkbox_hooks.tests.tsx.snap → checkboxHooks.tests.tsx.snap} +0 -0
- /package/mantine/specs/__snapshots__/{field_view_hooks.tests.tsx.snap → fieldViewHooks.tests.tsx.snap} +0 -0
- /package/mantine/specs/__snapshots__/{fields_view_hooks.tests.tsx.snap → fieldsViewHooks.tests.tsx.snap} +0 -0
- /package/mantine/specs/__snapshots__/{form_hooks.tests.tsx.snap → formHooks.tests.tsx.snap} +0 -0
- /package/mantine/specs/__snapshots__/{list_hooks.tests.tsx.snap → listHooks.tests.tsx.snap} +0 -0
- /package/mantine/specs/__snapshots__/{radio_group_hooks.tests.tsx.snap → radioGroupHooks.tests.tsx.snap} +0 -0
- /package/mantine/specs/__snapshots__/{select_hooks.tests.tsx.snap → selectHooks.tests.tsx.snap} +0 -0
- /package/mantine/specs/__snapshots__/{text_input_hooks.tests.tsx.snap → textInputHooks.tests.tsx.snap} +0 -0
- /package/mantine/specs/__snapshots__/{value_input_hooks.tests.tsx.snap → valueInputHooks.tests.tsx.snap} +0 -0
- /package/mantine/specs/{checkbox_constants.ts → checkboxConstants.ts} +0 -0
- /package/mantine/specs/{radio_group_constants.ts → radioGroupConstants.ts} +0 -0
- /package/mantine/specs/{select_hooks_constant.ts → selectHooksConstant.ts} +0 -0
- /package/mantine/specs/{text_input_constants.ts → textInputConstants.ts} +0 -0
- /package/mantine/specs/{value_input_constants.ts → valueInputConstants.ts} +0 -0
- /package/types/{field.ts → Field.ts} +0 -0
- /package/types/{field_converters.ts → FieldConverters.ts} +0 -0
- /package/types/{merge_validators.ts → mergeValidators.ts} +0 -0
- /package/util/{empty.tsx → Empty.tsx} +0 -0
- /package/util/{partial.tsx → Partial.tsx} +0 -0
package/dist/index.js
CHANGED
|
@@ -68,19 +68,19 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
68
68
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
69
69
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
70
70
|
|
|
71
|
-
// field_converters/
|
|
71
|
+
// field_converters/chainFieldConverter.ts
|
|
72
72
|
import {
|
|
73
73
|
UnreachableError
|
|
74
74
|
} from "@strictly/base";
|
|
75
75
|
|
|
76
|
-
// types/
|
|
76
|
+
// types/FieldConverters.ts
|
|
77
77
|
var UnreliableFieldConversionType = /* @__PURE__ */ ((UnreliableFieldConversionType2) => {
|
|
78
78
|
UnreliableFieldConversionType2[UnreliableFieldConversionType2["Success"] = 0] = "Success";
|
|
79
79
|
UnreliableFieldConversionType2[UnreliableFieldConversionType2["Failure"] = 1] = "Failure";
|
|
80
80
|
return UnreliableFieldConversionType2;
|
|
81
81
|
})(UnreliableFieldConversionType || {});
|
|
82
82
|
|
|
83
|
-
// field_converters/
|
|
83
|
+
// field_converters/chainFieldConverter.ts
|
|
84
84
|
function chainUnreliableFieldConverter(from, to) {
|
|
85
85
|
return function(value, valuePath, context) {
|
|
86
86
|
const fromConversion = from(value, valuePath, context);
|
|
@@ -138,7 +138,7 @@ function chainAnnotatedFieldConverter(from, to) {
|
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
// field_converters/
|
|
141
|
+
// field_converters/identityConverter.ts
|
|
142
142
|
function annotatedIdentityConverter(required = false) {
|
|
143
143
|
return function(value) {
|
|
144
144
|
return {
|
|
@@ -157,7 +157,7 @@ function unreliableIdentityConverter() {
|
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
// field_converters/
|
|
160
|
+
// field_converters/MaybeIdentityConverter.ts
|
|
161
161
|
var MaybeIdentityConverter = class {
|
|
162
162
|
constructor(converter, isFrom) {
|
|
163
163
|
this.converter = converter;
|
|
@@ -172,7 +172,7 @@ var MaybeIdentityConverter = class {
|
|
|
172
172
|
}
|
|
173
173
|
};
|
|
174
174
|
|
|
175
|
-
// field_converters/
|
|
175
|
+
// field_converters/TrimmingStringConverter.ts
|
|
176
176
|
var TrimmingStringConverter = class {
|
|
177
177
|
constructor() {
|
|
178
178
|
}
|
|
@@ -191,14 +191,14 @@ var TrimmingStringConverter = class {
|
|
|
191
191
|
}
|
|
192
192
|
};
|
|
193
193
|
|
|
194
|
-
// field_value_factories/
|
|
194
|
+
// field_value_factories/prototypingFieldValueFactory.ts
|
|
195
195
|
function prototypingFieldValueFactory(prototype) {
|
|
196
196
|
return function() {
|
|
197
197
|
return prototype;
|
|
198
198
|
};
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
// core/mobx/
|
|
201
|
+
// core/mobx/fieldAdapterBuilder.ts
|
|
202
202
|
var FieldAdapterBuilder = class _FieldAdapterBuilder {
|
|
203
203
|
constructor(convert, create, revert) {
|
|
204
204
|
this.convert = convert;
|
|
@@ -302,7 +302,7 @@ function listAdapter() {
|
|
|
302
302
|
);
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
// core/mobx/
|
|
305
|
+
// core/mobx/FormModel.ts
|
|
306
306
|
import {
|
|
307
307
|
assertExists,
|
|
308
308
|
assertExistsAndReturn,
|
|
@@ -312,6 +312,7 @@ import {
|
|
|
312
312
|
UnreachableError as UnreachableError2
|
|
313
313
|
} from "@strictly/base";
|
|
314
314
|
import {
|
|
315
|
+
copy,
|
|
315
316
|
equals,
|
|
316
317
|
flattenAccessorsOfType,
|
|
317
318
|
flattenTypesOfType,
|
|
@@ -322,6 +323,7 @@ import {
|
|
|
322
323
|
valuePathToTypePath
|
|
323
324
|
} from "@strictly/define";
|
|
324
325
|
import {
|
|
326
|
+
action,
|
|
325
327
|
computed,
|
|
326
328
|
observable,
|
|
327
329
|
runInAction
|
|
@@ -332,8 +334,8 @@ var Validation = /* @__PURE__ */ ((Validation2) => {
|
|
|
332
334
|
Validation2[Validation2["Always"] = 2] = "Always";
|
|
333
335
|
return Validation2;
|
|
334
336
|
})(Validation || {});
|
|
335
|
-
var _valueChanged_dec, _dirty_dec, _accessors_dec, _knownFields_dec, _fields_dec, _validation_dec, _errorOverrides_dec, _fieldOverrides_dec,
|
|
336
|
-
|
|
337
|
+
var _validateAll_dec, _validateField_dec, _setFieldValue_dec, _valueChanged_dec, _dirty_dec, _accessors_dec, _knownFields_dec, _fields_dec, _value_dec, _validation_dec, _errorOverrides_dec, _fieldOverrides_dec, _observableValue_dec, _init, _observableValue, _fieldOverrides, _errorOverrides, _validation;
|
|
338
|
+
_observableValue_dec = [observable.ref], _fieldOverrides_dec = [observable.shallow], _errorOverrides_dec = [observable.shallow], _validation_dec = [observable.shallow], _value_dec = [computed], _fields_dec = [computed], _knownFields_dec = [computed], _accessors_dec = [computed], _dirty_dec = [computed], _valueChanged_dec = [computed], _setFieldValue_dec = [action], _validateField_dec = [action], _validateAll_dec = [action];
|
|
337
339
|
var FormModel = class {
|
|
338
340
|
constructor(type, originalValue, adapters, mode) {
|
|
339
341
|
this.type = type;
|
|
@@ -341,7 +343,7 @@ var FormModel = class {
|
|
|
341
343
|
this.adapters = adapters;
|
|
342
344
|
this.mode = mode;
|
|
343
345
|
__runInitializers(_init, 5, this);
|
|
344
|
-
__privateAdd(this,
|
|
346
|
+
__privateAdd(this, _observableValue, __runInitializers(_init, 8, this)), __runInitializers(_init, 11, this);
|
|
345
347
|
__privateAdd(this, _fieldOverrides, __runInitializers(_init, 12, this)), __runInitializers(_init, 15, this);
|
|
346
348
|
__privateAdd(this, _errorOverrides, __runInitializers(_init, 16, this, {})), __runInitializers(_init, 19, this);
|
|
347
349
|
__privateAdd(this, _validation, __runInitializers(_init, 20, this, {})), __runInitializers(_init, 23, this);
|
|
@@ -352,11 +354,11 @@ var FormModel = class {
|
|
|
352
354
|
// maintains the value paths of lists when the original order is destroyed by deletes or reordering
|
|
353
355
|
__publicField(this, "listIndicesToKeys", {});
|
|
354
356
|
this.originalValues = flattenValuesOfType(type, originalValue, this.listIndicesToKeys);
|
|
355
|
-
this.
|
|
357
|
+
this.observableValue = mobxCopy(type, originalValue);
|
|
356
358
|
this.flattenedTypeDefs = flattenTypesOfType(type);
|
|
357
359
|
const conversions = flattenValueTo(
|
|
358
360
|
type,
|
|
359
|
-
|
|
361
|
+
originalValue,
|
|
360
362
|
() => {
|
|
361
363
|
},
|
|
362
364
|
(_t, fieldValue, _setter, typePath, valuePath) => {
|
|
@@ -390,6 +392,9 @@ var FormModel = class {
|
|
|
390
392
|
throw new UnreachableError2(this.mode);
|
|
391
393
|
}
|
|
392
394
|
}
|
|
395
|
+
get value() {
|
|
396
|
+
return copy(this.type, this.observableValue);
|
|
397
|
+
}
|
|
393
398
|
get fields() {
|
|
394
399
|
return new Proxy(
|
|
395
400
|
this.knownFields,
|
|
@@ -409,7 +414,7 @@ var FormModel = class {
|
|
|
409
414
|
get knownFields() {
|
|
410
415
|
return flattenValueTo(
|
|
411
416
|
this.type,
|
|
412
|
-
this.
|
|
417
|
+
this.observableValue,
|
|
413
418
|
() => {
|
|
414
419
|
},
|
|
415
420
|
// TODO swap these to valuePath, typePath in flatten
|
|
@@ -451,7 +456,7 @@ var FormModel = class {
|
|
|
451
456
|
const fieldOverride = this.fieldOverrides[valuePath];
|
|
452
457
|
const accessor = this.getAccessorForValuePath(valuePath);
|
|
453
458
|
const fieldTypeDef = this.flattenedTypeDefs[typePath];
|
|
454
|
-
const context = this.toContext(this.
|
|
459
|
+
const context = this.toContext(this.observableValue, valuePath);
|
|
455
460
|
const defaultValue = create(valuePath, context);
|
|
456
461
|
const {
|
|
457
462
|
value,
|
|
@@ -543,9 +548,9 @@ var FormModel = class {
|
|
|
543
548
|
get accessors() {
|
|
544
549
|
return flattenAccessorsOfType(
|
|
545
550
|
this.type,
|
|
546
|
-
this.
|
|
551
|
+
this.observableValue,
|
|
547
552
|
(value) => {
|
|
548
|
-
this.
|
|
553
|
+
this.observableValue = mobxCopy(this.type, value);
|
|
549
554
|
},
|
|
550
555
|
this.listIndicesToKeys
|
|
551
556
|
);
|
|
@@ -567,7 +572,7 @@ var FormModel = class {
|
|
|
567
572
|
});
|
|
568
573
|
}
|
|
569
574
|
get valueChanged() {
|
|
570
|
-
return !equals(this.type, this.
|
|
575
|
+
return !equals(this.type, this.observableValue, this.originalValue);
|
|
571
576
|
}
|
|
572
577
|
typePath(valuePath) {
|
|
573
578
|
return valuePathToTypePath(this.type, valuePath, true);
|
|
@@ -592,7 +597,7 @@ var FormModel = class {
|
|
|
592
597
|
elementTypePath,
|
|
593
598
|
// TODO what can we use for the value path here?
|
|
594
599
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
595
|
-
this.toContext(this.
|
|
600
|
+
this.toContext(this.observableValue, valuePath)
|
|
596
601
|
);
|
|
597
602
|
const originalList = accessor.value;
|
|
598
603
|
const newList = [
|
|
@@ -647,7 +652,7 @@ var FormModel = class {
|
|
|
647
652
|
internalSetFieldValue(valuePath, value, validation) {
|
|
648
653
|
const { revert } = this.getAdapterForValuePath(valuePath);
|
|
649
654
|
assertExists(revert, "setting value not supported {}", valuePath);
|
|
650
|
-
const conversion = revert(value, valuePath, this.toContext(this.
|
|
655
|
+
const conversion = revert(value, valuePath, this.toContext(this.observableValue, valuePath));
|
|
651
656
|
const accessor = this.getAccessorForValuePath(valuePath);
|
|
652
657
|
return runInAction(() => {
|
|
653
658
|
this.fieldOverrides[valuePath] = [value];
|
|
@@ -702,7 +707,7 @@ var FormModel = class {
|
|
|
702
707
|
convert,
|
|
703
708
|
create
|
|
704
709
|
} = adapter2;
|
|
705
|
-
const context = this.toContext(this.
|
|
710
|
+
const context = this.toContext(this.observableValue, valuePath);
|
|
706
711
|
const value = create(valuePath, context);
|
|
707
712
|
const {
|
|
708
713
|
value: displayValue
|
|
@@ -719,11 +724,11 @@ var FormModel = class {
|
|
|
719
724
|
this.validation = {};
|
|
720
725
|
this.fieldOverrides = {};
|
|
721
726
|
this.errorOverrides = {};
|
|
722
|
-
this.
|
|
727
|
+
this.observableValue = mobxCopy(this.type, value);
|
|
723
728
|
});
|
|
724
729
|
}
|
|
725
730
|
isValuePathActive(valuePath) {
|
|
726
|
-
const values = flattenValuesOfType(this.type, this.
|
|
731
|
+
const values = flattenValuesOfType(this.type, this.observableValue, this.listIndicesToKeys);
|
|
727
732
|
const keys = new Set(Object.keys(values));
|
|
728
733
|
return keys.has(valuePath);
|
|
729
734
|
}
|
|
@@ -766,18 +771,14 @@ var FormModel = class {
|
|
|
766
771
|
return displayedValue !== originalDisplayedValue;
|
|
767
772
|
}
|
|
768
773
|
validateField(valuePath, validation = 2 /* Always */) {
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
delete this.errorOverrides[valuePath];
|
|
772
|
-
});
|
|
774
|
+
this.validation[valuePath] = validation;
|
|
775
|
+
delete this.errorOverrides[valuePath];
|
|
773
776
|
return this.fields[valuePath].error == null;
|
|
774
777
|
}
|
|
775
778
|
validateAll(validation = 2 /* Always */) {
|
|
776
779
|
const accessors = toArray(this.accessors);
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
this.validation[valuePath] = validation;
|
|
780
|
-
});
|
|
780
|
+
accessors.forEach(([valuePath]) => {
|
|
781
|
+
this.validation[valuePath] = validation;
|
|
781
782
|
});
|
|
782
783
|
return accessors.every(
|
|
783
784
|
([valuePath]) => {
|
|
@@ -791,32 +792,50 @@ var FormModel = class {
|
|
|
791
792
|
}
|
|
792
793
|
};
|
|
793
794
|
_init = __decoratorStart(null);
|
|
794
|
-
|
|
795
|
+
_observableValue = new WeakMap();
|
|
795
796
|
_fieldOverrides = new WeakMap();
|
|
796
797
|
_errorOverrides = new WeakMap();
|
|
797
798
|
_validation = new WeakMap();
|
|
798
|
-
__decorateElement(_init, 4, "
|
|
799
|
+
__decorateElement(_init, 4, "observableValue", _observableValue_dec, FormModel, _observableValue);
|
|
799
800
|
__decorateElement(_init, 4, "fieldOverrides", _fieldOverrides_dec, FormModel, _fieldOverrides);
|
|
800
801
|
__decorateElement(_init, 4, "errorOverrides", _errorOverrides_dec, FormModel, _errorOverrides);
|
|
801
802
|
__decorateElement(_init, 4, "validation", _validation_dec, FormModel, _validation);
|
|
803
|
+
__decorateElement(_init, 2, "value", _value_dec, FormModel);
|
|
802
804
|
__decorateElement(_init, 2, "fields", _fields_dec, FormModel);
|
|
803
805
|
__decorateElement(_init, 2, "knownFields", _knownFields_dec, FormModel);
|
|
804
806
|
__decorateElement(_init, 2, "accessors", _accessors_dec, FormModel);
|
|
805
807
|
__decorateElement(_init, 2, "dirty", _dirty_dec, FormModel);
|
|
806
808
|
__decorateElement(_init, 2, "valueChanged", _valueChanged_dec, FormModel);
|
|
809
|
+
__decorateElement(_init, 1, "setFieldValue", _setFieldValue_dec, FormModel);
|
|
810
|
+
__decorateElement(_init, 1, "validateField", _validateField_dec, FormModel);
|
|
811
|
+
__decorateElement(_init, 1, "validateAll", _validateAll_dec, FormModel);
|
|
807
812
|
__decoratorMetadata(_init, FormModel);
|
|
808
813
|
|
|
809
814
|
// core/mobx/hooks.tsx
|
|
810
815
|
import {
|
|
811
816
|
useCallback
|
|
812
817
|
} from "react";
|
|
818
|
+
|
|
819
|
+
// core/mobx/peek.ts
|
|
820
|
+
import { when } from "mobx";
|
|
821
|
+
function peek(operation) {
|
|
822
|
+
let result;
|
|
823
|
+
void when(() => {
|
|
824
|
+
result = operation();
|
|
825
|
+
return true;
|
|
826
|
+
});
|
|
827
|
+
return result;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
// core/mobx/hooks.tsx
|
|
813
831
|
function useDefaultMobxFormHooks(model, {
|
|
814
832
|
onValidFieldSubmit,
|
|
815
833
|
onValidFormSubmit
|
|
816
834
|
} = {}) {
|
|
817
835
|
const onFieldValueChange = useCallback(
|
|
818
836
|
function(path, value) {
|
|
819
|
-
const
|
|
837
|
+
const activeValidation = peek(() => model.getValidation(path));
|
|
838
|
+
const validation = Math.min(activeValidation, 1 /* Changed */);
|
|
820
839
|
model.setFieldValue(path, value, validation);
|
|
821
840
|
},
|
|
822
841
|
[model]
|
|
@@ -836,8 +855,16 @@ function useDefaultMobxFormHooks(model, {
|
|
|
836
855
|
const onFieldBlur = useCallback(
|
|
837
856
|
function(path) {
|
|
838
857
|
setTimeout(function() {
|
|
839
|
-
|
|
840
|
-
|
|
858
|
+
const [
|
|
859
|
+
validate4,
|
|
860
|
+
activeValidation
|
|
861
|
+
] = peek(() => [
|
|
862
|
+
model.isValuePathActive(path) && model.isFieldDirty(path) && model.fields[path].error == null,
|
|
863
|
+
model.getValidation(path)
|
|
864
|
+
]);
|
|
865
|
+
if (validate4) {
|
|
866
|
+
const validation = Math.max(1 /* Changed */, activeValidation);
|
|
867
|
+
model.validateField(path, validation);
|
|
841
868
|
}
|
|
842
869
|
}, 100);
|
|
843
870
|
},
|
|
@@ -845,8 +872,10 @@ function useDefaultMobxFormHooks(model, {
|
|
|
845
872
|
);
|
|
846
873
|
const onFormSubmit = useCallback(
|
|
847
874
|
function() {
|
|
848
|
-
|
|
849
|
-
|
|
875
|
+
const valid = peek(() => model.validateSubmit());
|
|
876
|
+
if (valid && onValidFormSubmit) {
|
|
877
|
+
const value = peek(() => model.value);
|
|
878
|
+
onValidFormSubmit(value);
|
|
850
879
|
}
|
|
851
880
|
},
|
|
852
881
|
[
|
|
@@ -862,7 +891,7 @@ function useDefaultMobxFormHooks(model, {
|
|
|
862
891
|
};
|
|
863
892
|
}
|
|
864
893
|
|
|
865
|
-
// core/mobx/
|
|
894
|
+
// core/mobx/mergeFieldAdaptersWithTwoWayConverter.ts
|
|
866
895
|
import { map as map2 } from "@strictly/base";
|
|
867
896
|
function mergeFieldAdaptersWithTwoWayConverter(fieldAdapters, converter) {
|
|
868
897
|
return map2(
|
|
@@ -883,7 +912,7 @@ function mergeFieldAdaptersWithTwoWayConverter(fieldAdapters, converter) {
|
|
|
883
912
|
);
|
|
884
913
|
}
|
|
885
914
|
|
|
886
|
-
// core/mobx/
|
|
915
|
+
// core/mobx/mergeFieldAdaptersWithValidators.ts
|
|
887
916
|
import { reduce } from "@strictly/base";
|
|
888
917
|
import {
|
|
889
918
|
annotations,
|
|
@@ -940,7 +969,7 @@ function mergeAdaptersWithValidators(adapters, validators) {
|
|
|
940
969
|
);
|
|
941
970
|
}
|
|
942
971
|
|
|
943
|
-
// core/mobx/
|
|
972
|
+
// core/mobx/subFormFieldAdapters.ts
|
|
944
973
|
function subFormFieldAdapters(subAdapters, parentTypePath) {
|
|
945
974
|
const dotCount = parentTypePath.split(".").length;
|
|
946
975
|
function getSubValuePath(valuePath) {
|
|
@@ -969,7 +998,7 @@ function subFormFieldAdapters(subAdapters, parentTypePath) {
|
|
|
969
998
|
}, {});
|
|
970
999
|
}
|
|
971
1000
|
|
|
972
|
-
// field_converters/
|
|
1001
|
+
// field_converters/IntegerToStringConverter.ts
|
|
973
1002
|
var IntegerToStringConverter = class {
|
|
974
1003
|
constructor(isNanError, base = 10) {
|
|
975
1004
|
this.isNanError = isNanError;
|
|
@@ -1000,9 +1029,9 @@ var IntegerToStringConverter = class {
|
|
|
1000
1029
|
}
|
|
1001
1030
|
};
|
|
1002
1031
|
|
|
1003
|
-
// field_converters/
|
|
1032
|
+
// field_converters/NullableToBooleanConverter.ts
|
|
1004
1033
|
import {
|
|
1005
|
-
copy
|
|
1034
|
+
copy as copy2
|
|
1006
1035
|
} from "@strictly/define";
|
|
1007
1036
|
var NullableToBooleanConverter = class {
|
|
1008
1037
|
constructor(typeDef, prototype, nullType, defaultToNull = true) {
|
|
@@ -1021,7 +1050,7 @@ var NullableToBooleanConverter = class {
|
|
|
1021
1050
|
}
|
|
1022
1051
|
revert(from) {
|
|
1023
1052
|
if (from) {
|
|
1024
|
-
const value =
|
|
1053
|
+
const value = copy2(this.typeDef, this.prototype);
|
|
1025
1054
|
return {
|
|
1026
1055
|
type: 0 /* Success */,
|
|
1027
1056
|
value
|
|
@@ -1037,12 +1066,12 @@ var NullableToBooleanConverter = class {
|
|
|
1037
1066
|
}
|
|
1038
1067
|
};
|
|
1039
1068
|
|
|
1040
|
-
// field_converters/
|
|
1069
|
+
// field_converters/SelectValueTypeConverter.ts
|
|
1041
1070
|
import {
|
|
1042
1071
|
reverse
|
|
1043
1072
|
} from "@strictly/base";
|
|
1044
1073
|
import {
|
|
1045
|
-
copy as
|
|
1074
|
+
copy as copy3
|
|
1046
1075
|
} from "@strictly/define";
|
|
1047
1076
|
var AbstractSelectValueTypeConverter = class {
|
|
1048
1077
|
constructor(typeDef, values, defaultValueKey, noSuchValueError, required) {
|
|
@@ -1061,7 +1090,7 @@ var AbstractSelectValueTypeConverter = class {
|
|
|
1061
1090
|
value: null
|
|
1062
1091
|
};
|
|
1063
1092
|
}
|
|
1064
|
-
const value = prototype == null ? prototype :
|
|
1093
|
+
const value = prototype == null ? prototype : copy3(this.typeDef, prototype);
|
|
1065
1094
|
return {
|
|
1066
1095
|
type: 0 /* Success */,
|
|
1067
1096
|
value
|
|
@@ -1134,7 +1163,7 @@ var SelectStringConverter = class extends AbstractSelectValueTypeConverter {
|
|
|
1134
1163
|
}
|
|
1135
1164
|
};
|
|
1136
1165
|
|
|
1137
|
-
// field_converters/
|
|
1166
|
+
// field_converters/validatingConverter.ts
|
|
1138
1167
|
import {
|
|
1139
1168
|
validate as validate2
|
|
1140
1169
|
} from "@strictly/define";
|
|
@@ -1162,7 +1191,7 @@ function validatingConverter(validators = []) {
|
|
|
1162
1191
|
};
|
|
1163
1192
|
}
|
|
1164
1193
|
|
|
1165
|
-
// mantine/
|
|
1194
|
+
// mantine/ErrorRenderer.ts
|
|
1166
1195
|
function DefaultErrorRenderer({
|
|
1167
1196
|
error
|
|
1168
1197
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1190,7 +1219,7 @@ import {
|
|
|
1190
1219
|
useMemo as useMemo2
|
|
1191
1220
|
} from "react";
|
|
1192
1221
|
|
|
1193
|
-
// util/
|
|
1222
|
+
// util/Partial.tsx
|
|
1194
1223
|
import { observer } from "mobx-react";
|
|
1195
1224
|
import {
|
|
1196
1225
|
forwardRef,
|
|
@@ -1338,7 +1367,7 @@ function usePartialObserverComponent(curriedPropsSource, deps, Component, additi
|
|
|
1338
1367
|
);
|
|
1339
1368
|
}
|
|
1340
1369
|
|
|
1341
|
-
// mantine/
|
|
1370
|
+
// mantine/createCheckbox.tsx
|
|
1342
1371
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
1343
1372
|
function createCheckbox(valuePath, Checkbox) {
|
|
1344
1373
|
const onChange = (e) => {
|
|
@@ -1390,19 +1419,87 @@ function createCheckbox(valuePath, Checkbox) {
|
|
|
1390
1419
|
);
|
|
1391
1420
|
}
|
|
1392
1421
|
|
|
1393
|
-
// mantine/
|
|
1422
|
+
// mantine/createFieldsView.tsx
|
|
1423
|
+
import {
|
|
1424
|
+
jsonPathPrefix,
|
|
1425
|
+
jsonPathUnprefix
|
|
1426
|
+
} from "@strictly/define";
|
|
1427
|
+
import { observer as observer2 } from "mobx-react";
|
|
1428
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
1429
|
+
function createFieldsView(valuePath, FieldsView, observableProps) {
|
|
1430
|
+
function toKey(subKey) {
|
|
1431
|
+
return jsonPathPrefix(valuePath, subKey);
|
|
1432
|
+
}
|
|
1433
|
+
function toSubKey(key) {
|
|
1434
|
+
return jsonPathUnprefix(valuePath, key);
|
|
1435
|
+
}
|
|
1436
|
+
function onFieldValueChange(subKey, value) {
|
|
1437
|
+
observableProps.onFieldValueChange(toKey(subKey), value);
|
|
1438
|
+
}
|
|
1439
|
+
function onFieldBlur(subKey) {
|
|
1440
|
+
var _a;
|
|
1441
|
+
(_a = observableProps.onFieldBlur) == null ? void 0 : _a.call(observableProps, toKey(subKey));
|
|
1442
|
+
}
|
|
1443
|
+
function onFieldFocus(subKey) {
|
|
1444
|
+
var _a;
|
|
1445
|
+
(_a = observableProps.onFieldFocus) == null ? void 0 : _a.call(observableProps, toKey(subKey));
|
|
1446
|
+
}
|
|
1447
|
+
function onFieldSubmit(subKey) {
|
|
1448
|
+
var _a;
|
|
1449
|
+
(_a = observableProps.onFieldSubmit) == null ? void 0 : _a.call(observableProps, toKey(subKey));
|
|
1450
|
+
}
|
|
1451
|
+
const Component = observer2(
|
|
1452
|
+
function(props) {
|
|
1453
|
+
const subFields = Object.entries(observableProps.fields).reduce(
|
|
1454
|
+
(acc, [
|
|
1455
|
+
fieldKey,
|
|
1456
|
+
fieldValue
|
|
1457
|
+
]) => {
|
|
1458
|
+
if (fieldKey.startsWith(valuePath)) {
|
|
1459
|
+
acc[toSubKey(fieldKey)] = fieldValue;
|
|
1460
|
+
}
|
|
1461
|
+
return acc;
|
|
1462
|
+
},
|
|
1463
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
1464
|
+
{}
|
|
1465
|
+
);
|
|
1466
|
+
return /* @__PURE__ */ jsx3(
|
|
1467
|
+
FieldsView,
|
|
1468
|
+
__spreadProps(__spreadValues({}, props), {
|
|
1469
|
+
fields: subFields,
|
|
1470
|
+
onFieldBlur,
|
|
1471
|
+
onFieldFocus,
|
|
1472
|
+
onFieldSubmit,
|
|
1473
|
+
onFieldValueChange
|
|
1474
|
+
})
|
|
1475
|
+
);
|
|
1476
|
+
}
|
|
1477
|
+
);
|
|
1478
|
+
const callbackMapper = (callback) => {
|
|
1479
|
+
return (subFormValuePath, ...args) => {
|
|
1480
|
+
const valuePath2 = toKey(subFormValuePath);
|
|
1481
|
+
return callback(valuePath2, ...args);
|
|
1482
|
+
};
|
|
1483
|
+
};
|
|
1484
|
+
return {
|
|
1485
|
+
Component,
|
|
1486
|
+
callbackMapper
|
|
1487
|
+
};
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
// mantine/createFieldView.tsx
|
|
1394
1491
|
import { Observer } from "mobx-react";
|
|
1395
1492
|
import {
|
|
1396
1493
|
useCallback as useCallback2
|
|
1397
1494
|
} from "react";
|
|
1398
1495
|
|
|
1399
|
-
// util/
|
|
1496
|
+
// util/Empty.tsx
|
|
1400
1497
|
function Empty() {
|
|
1401
1498
|
return null;
|
|
1402
1499
|
}
|
|
1403
1500
|
|
|
1404
|
-
// mantine/
|
|
1405
|
-
import { jsx as
|
|
1501
|
+
// mantine/createFieldView.tsx
|
|
1502
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
1406
1503
|
function FieldView({
|
|
1407
1504
|
valuePath,
|
|
1408
1505
|
form,
|
|
@@ -1436,7 +1533,7 @@ function FieldView({
|
|
|
1436
1533
|
form,
|
|
1437
1534
|
valuePath
|
|
1438
1535
|
]);
|
|
1439
|
-
return /* @__PURE__ */
|
|
1536
|
+
return /* @__PURE__ */ jsx4(Observer, { children: () => {
|
|
1440
1537
|
const {
|
|
1441
1538
|
value,
|
|
1442
1539
|
error
|
|
@@ -1454,7 +1551,7 @@ function FieldView({
|
|
|
1454
1551
|
}
|
|
1455
1552
|
function createFieldView(valuePath) {
|
|
1456
1553
|
return (props) => {
|
|
1457
|
-
return /* @__PURE__ */
|
|
1554
|
+
return /* @__PURE__ */ jsx4(
|
|
1458
1555
|
FieldView,
|
|
1459
1556
|
__spreadValues({
|
|
1460
1557
|
form: this,
|
|
@@ -1464,75 +1561,7 @@ function createFieldView(valuePath) {
|
|
|
1464
1561
|
};
|
|
1465
1562
|
}
|
|
1466
1563
|
|
|
1467
|
-
// mantine/
|
|
1468
|
-
import {
|
|
1469
|
-
jsonPathPrefix,
|
|
1470
|
-
jsonPathUnprefix
|
|
1471
|
-
} from "@strictly/define";
|
|
1472
|
-
import { observer as observer2 } from "mobx-react";
|
|
1473
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
1474
|
-
function createFieldsView(valuePath, FieldsView, observableProps) {
|
|
1475
|
-
function toKey(subKey) {
|
|
1476
|
-
return jsonPathPrefix(valuePath, subKey);
|
|
1477
|
-
}
|
|
1478
|
-
function toSubKey(key) {
|
|
1479
|
-
return jsonPathUnprefix(valuePath, key);
|
|
1480
|
-
}
|
|
1481
|
-
function onFieldValueChange(subKey, value) {
|
|
1482
|
-
observableProps.onFieldValueChange(toKey(subKey), value);
|
|
1483
|
-
}
|
|
1484
|
-
function onFieldBlur(subKey) {
|
|
1485
|
-
var _a;
|
|
1486
|
-
(_a = observableProps.onFieldBlur) == null ? void 0 : _a.call(observableProps, toKey(subKey));
|
|
1487
|
-
}
|
|
1488
|
-
function onFieldFocus(subKey) {
|
|
1489
|
-
var _a;
|
|
1490
|
-
(_a = observableProps.onFieldFocus) == null ? void 0 : _a.call(observableProps, toKey(subKey));
|
|
1491
|
-
}
|
|
1492
|
-
function onFieldSubmit(subKey) {
|
|
1493
|
-
var _a;
|
|
1494
|
-
(_a = observableProps.onFieldSubmit) == null ? void 0 : _a.call(observableProps, toKey(subKey));
|
|
1495
|
-
}
|
|
1496
|
-
const Component = observer2(
|
|
1497
|
-
function(props) {
|
|
1498
|
-
const subFields = Object.entries(observableProps.fields).reduce(
|
|
1499
|
-
(acc, [
|
|
1500
|
-
fieldKey,
|
|
1501
|
-
fieldValue
|
|
1502
|
-
]) => {
|
|
1503
|
-
if (fieldKey.startsWith(valuePath)) {
|
|
1504
|
-
acc[toSubKey(fieldKey)] = fieldValue;
|
|
1505
|
-
}
|
|
1506
|
-
return acc;
|
|
1507
|
-
},
|
|
1508
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
1509
|
-
{}
|
|
1510
|
-
);
|
|
1511
|
-
return /* @__PURE__ */ jsx4(
|
|
1512
|
-
FieldsView,
|
|
1513
|
-
__spreadProps(__spreadValues({}, props), {
|
|
1514
|
-
fields: subFields,
|
|
1515
|
-
onFieldBlur,
|
|
1516
|
-
onFieldFocus,
|
|
1517
|
-
onFieldSubmit,
|
|
1518
|
-
onFieldValueChange
|
|
1519
|
-
})
|
|
1520
|
-
);
|
|
1521
|
-
}
|
|
1522
|
-
);
|
|
1523
|
-
const callbackMapper = (callback) => {
|
|
1524
|
-
return (subFormValuePath, ...args) => {
|
|
1525
|
-
const valuePath2 = toKey(subFormValuePath);
|
|
1526
|
-
return callback(valuePath2, ...args);
|
|
1527
|
-
};
|
|
1528
|
-
};
|
|
1529
|
-
return {
|
|
1530
|
-
Component,
|
|
1531
|
-
callbackMapper
|
|
1532
|
-
};
|
|
1533
|
-
}
|
|
1534
|
-
|
|
1535
|
-
// mantine/create_form.tsx
|
|
1564
|
+
// mantine/createForm.tsx
|
|
1536
1565
|
import { observer as observer3 } from "mobx-react";
|
|
1537
1566
|
import {
|
|
1538
1567
|
useCallback as useCallback3
|
|
@@ -1554,7 +1583,7 @@ function createForm(valuePath, Form, observableProps) {
|
|
|
1554
1583
|
});
|
|
1555
1584
|
}
|
|
1556
1585
|
|
|
1557
|
-
// mantine/
|
|
1586
|
+
// mantine/createList.tsx
|
|
1558
1587
|
import {
|
|
1559
1588
|
assertExistsAndReturn as assertExistsAndReturn2
|
|
1560
1589
|
} from "@strictly/base";
|
|
@@ -1587,7 +1616,7 @@ function DefaultList({
|
|
|
1587
1616
|
indexKeys[index]
|
|
1588
1617
|
];
|
|
1589
1618
|
}).filter(function([
|
|
1590
|
-
|
|
1619
|
+
_value,
|
|
1591
1620
|
_index,
|
|
1592
1621
|
key
|
|
1593
1622
|
]) {
|
|
@@ -1602,7 +1631,7 @@ function DefaultList({
|
|
|
1602
1631
|
}) });
|
|
1603
1632
|
}
|
|
1604
1633
|
|
|
1605
|
-
// mantine/
|
|
1634
|
+
// mantine/createPill.tsx
|
|
1606
1635
|
function createPill(valuePath, Pill) {
|
|
1607
1636
|
const propSource = () => {
|
|
1608
1637
|
const {
|
|
@@ -1620,7 +1649,7 @@ function createPill(valuePath, Pill) {
|
|
|
1620
1649
|
return createUnsafePartialObserverComponent(Pill, propSource);
|
|
1621
1650
|
}
|
|
1622
1651
|
|
|
1623
|
-
// mantine/
|
|
1652
|
+
// mantine/createRadio.tsx
|
|
1624
1653
|
function createRadio(valuePath, value, Radio) {
|
|
1625
1654
|
const propSource = () => {
|
|
1626
1655
|
return {
|
|
@@ -1634,7 +1663,7 @@ function createRadio(valuePath, value, Radio) {
|
|
|
1634
1663
|
);
|
|
1635
1664
|
}
|
|
1636
1665
|
|
|
1637
|
-
// mantine/
|
|
1666
|
+
// mantine/createRadioGroup.tsx
|
|
1638
1667
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1639
1668
|
function createRadioGroup(valuePath, RadioGroup) {
|
|
1640
1669
|
const onChange = (value) => {
|
|
@@ -1677,7 +1706,7 @@ function createRadioGroup(valuePath, RadioGroup) {
|
|
|
1677
1706
|
return createUnsafePartialObserverComponent(RadioGroup, propSource, ["ErrorRenderer"]);
|
|
1678
1707
|
}
|
|
1679
1708
|
|
|
1680
|
-
// mantine/
|
|
1709
|
+
// mantine/createTextInput.tsx
|
|
1681
1710
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1682
1711
|
function createTextInput(valuePath, TextInput) {
|
|
1683
1712
|
const onChange = (e) => {
|
|
@@ -1733,7 +1762,7 @@ function createTextInput(valuePath, TextInput) {
|
|
|
1733
1762
|
);
|
|
1734
1763
|
}
|
|
1735
1764
|
|
|
1736
|
-
// mantine/
|
|
1765
|
+
// mantine/createValueInput.tsx
|
|
1737
1766
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1738
1767
|
function createValueInput(valuePath, ValueInput) {
|
|
1739
1768
|
const onChange = (value) => {
|
|
@@ -1966,7 +1995,7 @@ _fields = new WeakMap();
|
|
|
1966
1995
|
__decorateElement(_init2, 4, "fields", _fields_dec2, MantineFormImpl, _fields);
|
|
1967
1996
|
__decoratorMetadata(_init2, MantineFormImpl);
|
|
1968
1997
|
|
|
1969
|
-
// types/
|
|
1998
|
+
// types/mergeValidators.ts
|
|
1970
1999
|
import {
|
|
1971
2000
|
annotations as annotations2,
|
|
1972
2001
|
validate as validate3
|
|
@@ -2029,6 +2058,7 @@ export {
|
|
|
2029
2058
|
mergeAdaptersWithValidators,
|
|
2030
2059
|
mergeFieldAdaptersWithTwoWayConverter,
|
|
2031
2060
|
mergeValidators,
|
|
2061
|
+
peek,
|
|
2032
2062
|
prototypingFieldValueFactory,
|
|
2033
2063
|
subFormFieldAdapters,
|
|
2034
2064
|
trimmingStringAdapter,
|