@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.
Files changed (54) hide show
  1. package/.out/core/mobx/field_adapter_builder.js +18 -6
  2. package/.out/core/mobx/{form_presenter.d.ts → form_model.d.ts} +15 -21
  3. package/.out/core/mobx/form_model.js +513 -0
  4. package/.out/core/mobx/hooks.d.ts +6 -25
  5. package/.out/core/mobx/hooks.js +14 -50
  6. package/.out/core/mobx/merge_field_adapters_with_validators.js +1 -5
  7. package/.out/core/mobx/specs/fixtures.js +2 -1
  8. package/.out/core/mobx/specs/{form_presenter.tests.js → form_model.tests.js} +52 -43
  9. package/.out/core/mobx/specs/sub_form_field_adapters.tests.js +2 -1
  10. package/.out/core/mobx/types.d.ts +4 -4
  11. package/.out/field_converters/integer_to_string_converter.js +12 -4
  12. package/.out/field_converters/maybe_identity_converter.js +12 -4
  13. package/.out/field_converters/nullable_to_boolean_converter.js +24 -7
  14. package/.out/field_converters/select_value_type_converter.js +36 -12
  15. package/.out/index.d.ts +1 -1
  16. package/.out/index.js +1 -1
  17. package/.out/mantine/create_checkbox.js +8 -4
  18. package/.out/mantine/create_fields_view.js +7 -4
  19. package/.out/mantine/create_form.js +1 -1
  20. package/.out/mantine/create_radio_group.js +8 -4
  21. package/.out/mantine/create_text_input.js +8 -4
  22. package/.out/mantine/create_value_input.js +8 -4
  23. package/.out/mantine/hooks.js +218 -92
  24. package/.out/mantine/specs/checkbox_hooks.stories.js +13 -1
  25. package/.out/mantine/specs/checkbox_hooks.tests.js +22 -9
  26. package/.out/mantine/specs/fields_view_hooks.stories.js +15 -2
  27. package/.out/mantine/specs/fields_view_hooks.tests.js +12 -3
  28. package/.out/mantine/specs/radio_group_hooks.stories.js +13 -1
  29. package/.out/mantine/specs/radio_group_hooks.tests.js +23 -10
  30. package/.out/mantine/specs/select_hooks.stories.js +13 -1
  31. package/.out/mantine/specs/text_input_hooks.stories.js +13 -1
  32. package/.out/mantine/specs/text_input_hooks.tests.js +18 -7
  33. package/.out/mantine/specs/value_input_hooks.stories.js +14 -2
  34. package/.out/tsconfig.tsbuildinfo +1 -1
  35. package/.out/tsup.config.js +2 -9
  36. package/.out/types/merge_validators.js +1 -4
  37. package/.out/util/partial.js +5 -5
  38. package/.out/vitest.workspace.js +2 -10
  39. package/.turbo/turbo-build.log +9 -9
  40. package/.turbo/turbo-check-types.log +1 -1
  41. package/.turbo/turbo-release$colon$exports.log +1 -1
  42. package/core/mobx/{form_presenter.ts → form_model.ts} +287 -329
  43. package/core/mobx/hooks.tsx +26 -123
  44. package/core/mobx/specs/{form_presenter.tests.ts → form_model.tests.ts} +101 -94
  45. package/core/mobx/types.ts +12 -12
  46. package/dist/index.cjs +639 -600
  47. package/dist/index.d.cts +51 -73
  48. package/dist/index.d.ts +51 -73
  49. package/dist/index.js +644 -601
  50. package/index.ts +1 -1
  51. package/mantine/hooks.tsx +2 -0
  52. package/package.json +1 -1
  53. package/.out/core/mobx/form_presenter.js +0 -422
  54. /package/.out/core/mobx/specs/{form_presenter.tests.d.ts → form_model.tests.d.ts} +0 -0
@@ -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
@@ -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, ...curriedProps, ...exposedProps }));
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
- { ...props },
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, ...curriedProps, ...exposedProps }));
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
- { ...props },
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, ...curriedProps, ...exposedProps }));
95
+ return (_jsx(C, Object.assign({ ref: ref }, curriedProps, exposedProps)));
96
96
  }));
97
97
  }
98
98
  export function usePartialObserverComponent(
@@ -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
  ]);
@@ -4,15 +4,15 @@ $ tsup
4
4
  CLI Using tsconfig: tsconfig.build.json
5
5
  CLI tsup v8.3.5
6
6
  CLI Using tsup config: /home/runner/work/strictly/strictly/packages/react-form/tsup.config.ts
7
- CLI Target: esnext
7
+ CLI Target: es6
8
8
  CJS Build start
9
9
  ESM Build start
10
- CJS dist/index.cjs 52.48 KB
11
- CJS ⚡️ Build success in 120ms
12
- ESM dist/index.js 48.52 KB
13
- ESM ⚡️ Build success in 120ms
10
+ CJS dist/index.cjs 59.07 KB
11
+ CJS ⚡️ Build success in 158ms
12
+ ESM dist/index.js 55.30 KB
13
+ ESM ⚡️ Build success in 159ms
14
14
  DTS Build start
15
- DTS ⚡️ Build success in 9937ms
16
- DTS dist/index.d.cts 39.16 KB
17
- DTS dist/index.d.ts 39.16 KB
18
- Done in 11.10s.
15
+ DTS ⚡️ Build success in 9941ms
16
+ DTS dist/index.d.cts 36.50 KB
17
+ DTS dist/index.d.ts 36.50 KB
18
+ Done in 11.06s.
@@ -1,3 +1,3 @@
1
1
  yarn run v1.22.22
2
2
  $ tsc
3
- Done in 7.83s.
3
+ Done in 7.59s.
@@ -1,3 +1,3 @@
1
1
  yarn run v1.22.22
2
2
  $ json -f package.json -f package.exports.json --merge > package.release.json
3
- Done in 0.13s.
3
+ Done in 0.11s.