@axinom/mosaic-ui 0.34.0-rc.12 → 0.34.0-rc.14

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 (25) hide show
  1. package/dist/components/FormElements/Checkbox/Checkbox.d.ts.map +1 -1
  2. package/dist/components/FormElements/Checkbox/CheckboxField.d.ts +1 -1
  3. package/dist/components/FormElements/Checkbox/CheckboxField.d.ts.map +1 -1
  4. package/dist/components/FormElements/CustomTags/CustomTagsField.d.ts.map +1 -1
  5. package/dist/components/FormElements/DateTimeField/DateTimeTextField.d.ts +1 -1
  6. package/dist/components/FormElements/DateTimeField/DateTimeTextField.d.ts.map +1 -1
  7. package/dist/components/FormElements/DynamicDataListControl/DynamicDataListField.d.ts.map +1 -1
  8. package/dist/components/FormElements/FileUploadControl/FileUploadField.d.ts.map +1 -1
  9. package/dist/components/FormElements/MaskedSingleLineText/MaskedSingleLineTextField.d.ts +1 -1
  10. package/dist/components/FormElements/MaskedSingleLineText/MaskedSingleLineTextField.d.ts.map +1 -1
  11. package/dist/index.es.js +1 -1
  12. package/dist/index.es.js.map +1 -1
  13. package/dist/index.js +2 -2
  14. package/dist/index.js.map +1 -1
  15. package/package.json +3 -3
  16. package/src/components/FormElements/Checkbox/Checkbox.tsx +1 -1
  17. package/src/components/FormElements/Checkbox/CheckboxField.tsx +4 -5
  18. package/src/components/FormElements/CustomTags/CustomTags.spec.tsx +3 -3
  19. package/src/components/FormElements/CustomTags/CustomTags.tsx +3 -3
  20. package/src/components/FormElements/CustomTags/CustomTagsField.tsx +1 -2
  21. package/src/components/FormElements/DateTimeField/DateTimeTextField.tsx +3 -3
  22. package/src/components/FormElements/DynamicDataListControl/DynamicDataListField.tsx +1 -2
  23. package/src/components/FormElements/FileUploadControl/FileUploadField.tsx +1 -2
  24. package/src/components/FormElements/MaskedSingleLineText/MaskedSingleLineTextField.tsx +1 -1
  25. package/src/components/FormElements/Radio/RadioField.tsx +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axinom/mosaic-ui",
3
- "version": "0.34.0-rc.12",
3
+ "version": "0.34.0-rc.14",
4
4
  "description": "UI components for building Axinom Mosaic applications",
5
5
  "author": "Axinom",
6
6
  "license": "PROPRIETARY",
@@ -32,7 +32,7 @@
32
32
  "build-storybook": "storybook build"
33
33
  },
34
34
  "dependencies": {
35
- "@axinom/mosaic-core": "^0.4.7-rc.12",
35
+ "@axinom/mosaic-core": "^0.4.7-rc.14",
36
36
  "@faker-js/faker": "^7.4.0",
37
37
  "@popperjs/core": "^2.9.2",
38
38
  "clsx": "^1.1.0",
@@ -102,5 +102,5 @@
102
102
  "publishConfig": {
103
103
  "access": "public"
104
104
  },
105
- "gitHead": "1983c112d033b5205764344529b14a937977152a"
105
+ "gitHead": "2751ae062b2c342c8534242fff6a61909a1b8598"
106
106
  }
@@ -1,9 +1,9 @@
1
1
  import clsx from 'clsx';
2
2
  import React, { useRef, useState } from 'react';
3
3
  import {
4
+ ConfirmDialog,
4
5
  ConfirmationConfig,
5
6
  ConfirmationMode,
6
- ConfirmDialog,
7
7
  } from '../../ConfirmDialog';
8
8
  import { BaseFormControl, BaseInputEvents } from '../Form.models';
9
9
  import { FormElementContainer } from '../FormElementContainer';
@@ -2,12 +2,11 @@ import { useField } from 'formik';
2
2
  import React from 'react';
3
3
  import { useFormikError } from '../useFormikError';
4
4
  import { Checkbox, CheckboxProps } from './Checkbox';
5
- export const CheckboxField: React.FC<Omit<CheckboxProps, 'error'>> = (
6
- props,
7
- ) => {
8
- const { name } = props;
5
+ export const CheckboxField: React.FC<
6
+ Omit<CheckboxProps, 'error' | 'onChange'>
7
+ > = (props) => {
9
8
  const error = useFormikError(props.name);
10
- const [field, , helpers] = useField(name);
9
+ const [field, , helpers] = useField(props.name);
11
10
 
12
11
  return (
13
12
  <Checkbox
@@ -70,7 +70,7 @@ describe('CustomTags', () => {
70
70
 
71
71
  it('displays a tag for each currently selected tag', () => {
72
72
  const mockCurrentTags = ['1', '2', '3'];
73
- const wrapper = shallow(
73
+ const wrapper = mount(
74
74
  <CustomTags name={'test-name'} value={mockCurrentTags} />,
75
75
  );
76
76
 
@@ -361,7 +361,7 @@ describe('CustomTags', () => {
361
361
  const onChangeSpy = jest.fn();
362
362
  const mockCurrentTags = ['1', '2', '3'];
363
363
  const mockTag = '';
364
- const wrapper = shallow(
364
+ const wrapper = mount(
365
365
  <CustomTags
366
366
  name={'test-name'}
367
367
  onChange={onChangeSpy}
@@ -394,7 +394,7 @@ describe('CustomTags', () => {
394
394
  const onChangeSpy = jest.fn();
395
395
  const mockCurrentTags = ['1', '2', '3'];
396
396
  const mockTag = '2';
397
- const wrapper = shallow(
397
+ const wrapper = mount(
398
398
  <CustomTags
399
399
  name={'test-name'}
400
400
  onChange={onChangeSpy}
@@ -56,7 +56,7 @@ export const CustomTags: React.FC<CustomTagsProps> = ({
56
56
  id,
57
57
  name,
58
58
  type = 'text',
59
- value = [],
59
+ value,
60
60
  disabled = false,
61
61
  placeholder,
62
62
  error = undefined,
@@ -70,12 +70,12 @@ export const CustomTags: React.FC<CustomTagsProps> = ({
70
70
  className = '',
71
71
  ...rest
72
72
  }) => {
73
- const [currentTags, setCurrentTags] = useState<string[]>(value); // Current tags the user has selected
73
+ const [currentTags, setCurrentTags] = useState<string[]>([]); // Current tags the user has selected
74
74
  const [shouldAnimate, setShouldAnimate] = useState<boolean>(false);
75
75
  const ref = useRef<FormEvent<HTMLInputElement>>();
76
76
 
77
77
  useEffect(() => {
78
- setCurrentTags((current) => (current === value ? current : value));
78
+ setCurrentTags(value ?? []);
79
79
  }, [value]);
80
80
 
81
81
  const styles = {
@@ -6,9 +6,8 @@ import { CustomTags, CustomTagsProps } from './CustomTags';
6
6
  export const CustomTagsField: React.FC<
7
7
  Omit<CustomTagsProps, 'error' | 'onChange'>
8
8
  > = (props) => {
9
- const { name } = props;
10
9
  const error = useFormikError(props.name);
11
- const [field, , helpers] = useField(name);
10
+ const [field, , helpers] = useField(props.name);
12
11
 
13
12
  return (
14
13
  <CustomTags
@@ -8,9 +8,9 @@ import { DateTimeText, DateTimeTextProps } from './DateTimeText';
8
8
  * @example
9
9
  * <Field name="title" label="Title" as={DateTimeTextField} />
10
10
  */
11
- export const DateTimeTextField: React.FC<Omit<DateTimeTextProps, 'error'>> = (
12
- props,
13
- ) => {
11
+ export const DateTimeTextField: React.FC<
12
+ Omit<DateTimeTextProps, 'error' | 'onChange'>
13
+ > = (props) => {
14
14
  const error = useFormikError(props.name);
15
15
  const [, meta, helpers] = useField(props.name);
16
16
 
@@ -24,9 +24,8 @@ export const DynamicDataListField = <T extends Data>(
24
24
  Omit<DynamicDataListControlProps<T>, 'error' | 'onChange'>
25
25
  >,
26
26
  ): JSX.Element => {
27
- const { name } = props;
28
27
  const error = useFormikError(props.name);
29
- const [field, , helpers] = useField(name);
28
+ const [field, , helpers] = useField(props.name);
30
29
 
31
30
  return (
32
31
  <DynamicDataListControl
@@ -6,9 +6,8 @@ import { FileUploadControl, FileUploadProps } from './FileUploadControl';
6
6
  export const FileUploadField: React.FC<
7
7
  Omit<FileUploadProps, 'onFileSelected' | 'error'>
8
8
  > = (props) => {
9
- const { name } = props;
10
9
  const error = useFormikError(props.name);
11
- const [field, , helpers] = useField(name);
10
+ const [field, , helpers] = useField(props.name);
12
11
 
13
12
  return (
14
13
  <FileUploadControl
@@ -17,7 +17,7 @@ import {
17
17
  placeholderChar={'0'}, />
18
18
  */
19
19
  export const MaskedSingleLineTextField: React.FC<
20
- Omit<MaskedSingleLineTextProps, 'error'>
20
+ Omit<MaskedSingleLineTextProps, 'error' | 'onChange'>
21
21
  > = (props) => {
22
22
  const error = useFormikError(props.name);
23
23
 
@@ -9,9 +9,9 @@ export const RadioField: React.FC<
9
9
  transform?: (value: unknown) => unknown;
10
10
  }
11
11
  > = (props) => {
12
- const { name, transform = (value: unknown) => value } = props;
12
+ const { transform = (value: unknown) => value } = props;
13
13
  const error = useFormikError(props.name);
14
- const [field, , helpers] = useField(name);
14
+ const [field, , helpers] = useField(props.name);
15
15
 
16
16
  return (
17
17
  <Radio