@strictly/react-form 0.0.10 → 0.0.12
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/core/mobx/field_adapter_builder.js +18 -6
- package/.out/core/mobx/{form_presenter.d.ts → form_model.d.ts} +15 -21
- package/.out/core/mobx/form_model.js +513 -0
- package/.out/core/mobx/hooks.d.ts +6 -25
- package/.out/core/mobx/hooks.js +14 -50
- package/.out/core/mobx/merge_field_adapters_with_validators.js +1 -5
- package/.out/core/mobx/specs/fixtures.js +2 -1
- package/.out/core/mobx/specs/{form_presenter.tests.js → form_model.tests.js} +52 -43
- package/.out/core/mobx/specs/sub_form_field_adapters.tests.js +2 -1
- package/.out/core/mobx/types.d.ts +4 -4
- package/.out/field_converters/integer_to_string_converter.js +12 -4
- package/.out/field_converters/maybe_identity_converter.js +12 -4
- package/.out/field_converters/nullable_to_boolean_converter.js +24 -7
- package/.out/field_converters/select_value_type_converter.js +36 -12
- package/.out/index.d.ts +1 -1
- package/.out/index.js +1 -1
- package/.out/mantine/create_checkbox.js +8 -4
- package/.out/mantine/create_fields_view.js +7 -4
- package/.out/mantine/create_form.js +1 -1
- package/.out/mantine/create_radio_group.js +8 -4
- package/.out/mantine/create_text_input.js +8 -4
- package/.out/mantine/create_value_input.js +8 -4
- package/.out/mantine/hooks.js +218 -92
- package/.out/mantine/specs/checkbox_hooks.stories.js +13 -1
- package/.out/mantine/specs/checkbox_hooks.tests.js +22 -9
- package/.out/mantine/specs/fields_view_hooks.stories.js +15 -2
- package/.out/mantine/specs/fields_view_hooks.tests.js +12 -3
- package/.out/mantine/specs/radio_group_hooks.stories.js +13 -1
- package/.out/mantine/specs/radio_group_hooks.tests.js +23 -10
- package/.out/mantine/specs/select_hooks.stories.js +13 -1
- package/.out/mantine/specs/text_input_hooks.stories.js +13 -1
- package/.out/mantine/specs/text_input_hooks.tests.js +18 -7
- package/.out/mantine/specs/value_input_hooks.stories.js +14 -2
- package/.out/tsconfig.tsbuildinfo +1 -1
- package/.out/tsup.config.js +2 -9
- package/.out/types/merge_validators.js +1 -4
- package/.out/util/partial.js +5 -5
- package/.out/vitest.workspace.js +2 -10
- package/.turbo/turbo-build.log +9 -9
- package/.turbo/turbo-check-types.log +1 -1
- package/.turbo/turbo-release$colon$exports.log +1 -1
- package/core/mobx/{form_presenter.ts → form_model.ts} +287 -329
- package/core/mobx/hooks.tsx +26 -123
- package/core/mobx/specs/{form_presenter.tests.ts → form_model.tests.ts} +101 -94
- package/core/mobx/types.ts +12 -12
- package/dist/index.cjs +639 -600
- package/dist/index.d.cts +51 -73
- package/dist/index.d.ts +51 -73
- package/dist/index.js +644 -601
- package/index.ts +1 -1
- package/mantine/hooks.tsx +2 -0
- package/package.json +1 -1
- package/.out/core/mobx/form_presenter.js +0 -422
- /package/.out/core/mobx/specs/{form_presenter.tests.d.ts → form_model.tests.d.ts} +0 -0
package/.out/tsup.config.js
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { defineConfig, } from 'tsup';
|
|
2
|
-
export default defineConfig((options) => ({
|
|
3
|
-
entry: ['index.ts'],
|
|
4
|
-
tsconfig: './tsconfig.build.json',
|
|
5
|
-
clean: false,
|
|
6
|
-
dts: true,
|
|
7
|
-
format: [
|
|
2
|
+
export default defineConfig((options) => (Object.assign({ entry: ['index.ts'], tsconfig: './tsconfig.build.json', clean: false, dts: true, format: [
|
|
8
3
|
'cjs',
|
|
9
4
|
'esm',
|
|
10
|
-
],
|
|
11
|
-
...options,
|
|
12
|
-
}));
|
|
5
|
+
] }, options)));
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { annotations, validate, } from '@strictly/define';
|
|
2
2
|
export function mergeValidators(validators1, validators2) {
|
|
3
|
-
const validators = {
|
|
4
|
-
...validators1,
|
|
5
|
-
...validators2,
|
|
6
|
-
};
|
|
3
|
+
const validators = Object.assign(Object.assign({}, validators1), validators2);
|
|
7
4
|
const keys1 = new Set(Object.keys(validators1));
|
|
8
5
|
const keys2 = new Set(Object.keys(validators2));
|
|
9
6
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
package/.out/util/partial.js
CHANGED
|
@@ -8,7 +8,7 @@ export function createSimplePartialComponent(Component, curriedProps) {
|
|
|
8
8
|
// still needs a cast as `extends ComponentType<any>` != `ComponentType<any>`
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unnecessary-type-assertion
|
|
10
10
|
const C = Component;
|
|
11
|
-
return (_jsx(C, { ref: ref,
|
|
11
|
+
return (_jsx(C, Object.assign({ ref: ref }, curriedProps, exposedProps)));
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
export function createPartialComponent(Component, curriedPropsSource, additionalPropKeys = []) {
|
|
@@ -34,11 +34,11 @@ export function createPartialComponent(Component, curriedPropsSource, additional
|
|
|
34
34
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
35
35
|
{},
|
|
36
36
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
37
|
-
{
|
|
37
|
+
Object.assign({}, props),
|
|
38
38
|
]);
|
|
39
39
|
// TODO is there any way we can memoize this transformation?
|
|
40
40
|
const curriedProps = curriedPropsSource(additionalProps);
|
|
41
|
-
return (_jsx(C, { ref: ref,
|
|
41
|
+
return (_jsx(C, Object.assign({ ref: ref }, curriedProps, exposedProps)));
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
export function usePartialComponent(
|
|
@@ -88,11 +88,11 @@ export function createUnsafePartialObserverComponent(Component, curriedPropsSour
|
|
|
88
88
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
89
89
|
{},
|
|
90
90
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
91
|
-
{
|
|
91
|
+
Object.assign({}, props),
|
|
92
92
|
]);
|
|
93
93
|
// TODO is there any way we can memoize this transformation?
|
|
94
94
|
const curriedProps = curriedPropsSource(additionalProps);
|
|
95
|
-
return (_jsx(C, { ref: ref,
|
|
95
|
+
return (_jsx(C, Object.assign({ ref: ref }, curriedProps, exposedProps)));
|
|
96
96
|
}));
|
|
97
97
|
}
|
|
98
98
|
export function usePartialObserverComponent(
|
package/.out/vitest.workspace.js
CHANGED
|
@@ -4,19 +4,11 @@ import tsconfig from './tsconfig.json';
|
|
|
4
4
|
const config = createVitestUserConfig(tsconfig);
|
|
5
5
|
export default defineWorkspace([
|
|
6
6
|
'.',
|
|
7
|
-
{
|
|
8
|
-
...config,
|
|
9
|
-
extends: './.storybook/vite.config.mts',
|
|
10
|
-
test: {
|
|
11
|
-
...(config.test || {}),
|
|
12
|
-
environment: 'jsdom',
|
|
13
|
-
setupFiles: [
|
|
7
|
+
Object.assign(Object.assign({}, config), { extends: './.storybook/vite.config.mts', test: Object.assign(Object.assign({}, (config.test || {})), { environment: 'jsdom', setupFiles: [
|
|
14
8
|
'./.vitest/install_deterministic_random.ts',
|
|
15
9
|
// install storybook setup for unit tests that import stories directly
|
|
16
10
|
'./.vitest/install_storybook_preview.ts',
|
|
17
11
|
'./.vitest/match_media.ts',
|
|
18
12
|
'./.vitest/resize_observer.ts',
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
},
|
|
13
|
+
] }) }),
|
|
22
14
|
]);
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -4,15 +4,15 @@ $ tsup
|
|
|
4
4
|
[34mCLI[39m Using tsconfig: tsconfig.build.json
|
|
5
5
|
[34mCLI[39m tsup v8.3.5
|
|
6
6
|
[34mCLI[39m Using tsup config: /home/runner/work/strictly/strictly/packages/react-form/tsup.config.ts
|
|
7
|
-
[34mCLI[39m Target:
|
|
7
|
+
[34mCLI[39m Target: es6
|
|
8
8
|
[34mCJS[39m Build start
|
|
9
9
|
[34mESM[39m Build start
|
|
10
|
-
[32mCJS[39m [1mdist/index.cjs [22m[
|
|
11
|
-
[32mCJS[39m ⚡️ Build success in
|
|
12
|
-
[32mESM[39m [1mdist/index.js [22m[
|
|
13
|
-
[32mESM[39m ⚡️ Build success in
|
|
10
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m59.07 KB[39m
|
|
11
|
+
[32mCJS[39m ⚡️ Build success in 158ms
|
|
12
|
+
[32mESM[39m [1mdist/index.js [22m[32m55.30 KB[39m
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 159ms
|
|
14
14
|
[34mDTS[39m Build start
|
|
15
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
-
[32mDTS[39m [1mdist/index.d.cts [22m[
|
|
17
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
18
|
-
Done in 11.
|
|
15
|
+
[32mDTS[39m ⚡️ Build success in 9941ms
|
|
16
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m36.50 KB[39m
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m36.50 KB[39m
|
|
18
|
+
Done in 11.06s.
|