@dhis2/ui-forms 8.14.9 → 8.15.0-alpha.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -63,17 +63,15 @@ var _translations27 = _interopRequireDefault(require("./uk/translations.json"));
63
63
 
64
64
  var _translations28 = _interopRequireDefault(require("./ur/translations.json"));
65
65
 
66
- var _translations29 = _interopRequireDefault(require("./uz_Latn/translations.json"));
66
+ var _translations29 = _interopRequireDefault(require("./uz/translations.json"));
67
67
 
68
- var _translations30 = _interopRequireDefault(require("./uz_UZ_Cyrl/translations.json"));
68
+ var _translations30 = _interopRequireDefault(require("./uz_Latn/translations.json"));
69
69
 
70
- var _translations31 = _interopRequireDefault(require("./uz_UZ_Latn/translations.json"));
70
+ var _translations31 = _interopRequireDefault(require("./vi/translations.json"));
71
71
 
72
- var _translations32 = _interopRequireDefault(require("./vi/translations.json"));
72
+ var _translations32 = _interopRequireDefault(require("./zh/translations.json"));
73
73
 
74
- var _translations33 = _interopRequireDefault(require("./zh/translations.json"));
75
-
76
- var _translations34 = _interopRequireDefault(require("./zh_CN/translations.json"));
74
+ var _translations33 = _interopRequireDefault(require("./zh_CN/translations.json"));
77
75
 
78
76
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
79
77
 
@@ -143,17 +141,15 @@ _d2I18n.default.addResources('uk', namespace, _translations27.default);
143
141
 
144
142
  _d2I18n.default.addResources('ur', namespace, _translations28.default);
145
143
 
146
- _d2I18n.default.addResources('uz_Latn', namespace, _translations29.default);
147
-
148
- _d2I18n.default.addResources('uz_UZ_Cyrl', namespace, _translations30.default);
144
+ _d2I18n.default.addResources('uz', namespace, _translations29.default);
149
145
 
150
- _d2I18n.default.addResources('uz_UZ_Latn', namespace, _translations31.default);
146
+ _d2I18n.default.addResources('uz_Latn', namespace, _translations30.default);
151
147
 
152
- _d2I18n.default.addResources('vi', namespace, _translations32.default);
148
+ _d2I18n.default.addResources('vi', namespace, _translations31.default);
153
149
 
154
- _d2I18n.default.addResources('zh', namespace, _translations33.default);
150
+ _d2I18n.default.addResources('zh', namespace, _translations32.default);
155
151
 
156
- _d2I18n.default.addResources('zh_CN', namespace, _translations34.default);
152
+ _d2I18n.default.addResources('zh_CN', namespace, _translations33.default);
157
153
 
158
154
  var _default = _d2I18n.default;
159
155
  exports.default = _default;
@@ -19,12 +19,12 @@
19
19
  "Password should contain at least one UPPERCASE letter": "Пароль таркибида камида 1 та БОШ ҳарф бўлиши лозим",
20
20
  "Password should contain at least one number": "Пароль таркибида камида 1 та рақам бўлиши лозим",
21
21
  "Password should have at least one special character": "Пароль таркибида камида 1 та махсус белги бўлиши лозим",
22
+ "Please provide a username between 4 and 255 characters": "",
22
23
  "Please provide a valid email address": "Илтимос, амалдаги е-почта манзилини кўрсатинг",
23
24
  "Please provide a value": "",
24
25
  "Please provide a round number without decimals": "",
25
26
  "Please provide a valid international phone number.": "",
26
27
  "Please provide a number": "",
27
28
  "Please provide a string": "",
28
- "Please provide a valid url": "Илтимос, ҳақиқий URL манзилни кўрсатинг",
29
- "Please provide a username between 4 and 255 characters long and possibly separated by . _ - or @": ""
29
+ "Please provide a valid url": "Илтимос, ҳақиқий URL манзилни кўрсатинг"
30
30
  }
@@ -35,9 +35,8 @@ import tetTranslations from './tet/translations.json';
35
35
  import tgTranslations from './tg/translations.json';
36
36
  import ukTranslations from './uk/translations.json';
37
37
  import urTranslations from './ur/translations.json';
38
+ import uzTranslations from './uz/translations.json';
38
39
  import uz_LatnTranslations from './uz_Latn/translations.json';
39
- import uz_UZ_CyrlTranslations from './uz_UZ_Cyrl/translations.json';
40
- import uz_UZ_LatnTranslations from './uz_UZ_Latn/translations.json';
41
40
  import viTranslations from './vi/translations.json';
42
41
  import zhTranslations from './zh/translations.json';
43
42
  import zh_CNTranslations from './zh_CN/translations.json';
@@ -70,9 +69,8 @@ i18n.addResources('tet', namespace, tetTranslations);
70
69
  i18n.addResources('tg', namespace, tgTranslations);
71
70
  i18n.addResources('uk', namespace, ukTranslations);
72
71
  i18n.addResources('ur', namespace, urTranslations);
72
+ i18n.addResources('uz', namespace, uzTranslations);
73
73
  i18n.addResources('uz_Latn', namespace, uz_LatnTranslations);
74
- i18n.addResources('uz_UZ_Cyrl', namespace, uz_UZ_CyrlTranslations);
75
- i18n.addResources('uz_UZ_Latn', namespace, uz_UZ_LatnTranslations);
76
74
  i18n.addResources('vi', namespace, viTranslations);
77
75
  i18n.addResources('zh', namespace, zhTranslations);
78
76
  i18n.addResources('zh_CN', namespace, zh_CNTranslations);
@@ -19,12 +19,12 @@
19
19
  "Password should contain at least one UPPERCASE letter": "Пароль таркибида камида 1 та БОШ ҳарф бўлиши лозим",
20
20
  "Password should contain at least one number": "Пароль таркибида камида 1 та рақам бўлиши лозим",
21
21
  "Password should have at least one special character": "Пароль таркибида камида 1 та махсус белги бўлиши лозим",
22
+ "Please provide a username between 4 and 255 characters": "",
22
23
  "Please provide a valid email address": "Илтимос, амалдаги е-почта манзилини кўрсатинг",
23
24
  "Please provide a value": "",
24
25
  "Please provide a round number without decimals": "",
25
26
  "Please provide a valid international phone number.": "",
26
27
  "Please provide a number": "",
27
28
  "Please provide a string": "",
28
- "Please provide a valid url": "Илтимос, ҳақиқий URL манзилни кўрсатинг",
29
- "Please provide a username between 4 and 255 characters long and possibly separated by . _ - or @": ""
29
+ "Please provide a valid url": "Илтимос, ҳақиқий URL манзилни кўрсатинг"
30
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2/ui-forms",
3
- "version": "8.14.9",
3
+ "version": "8.15.0-alpha.2",
4
4
  "main": "./build/cjs/index.js",
5
5
  "module": "./build/es/index.js",
6
6
  "sideEffects": [
@@ -34,25 +34,27 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@dhis2/prop-types": "^3.1.2",
37
- "@dhis2-ui/button": "8.14.9",
38
- "@dhis2-ui/checkbox": "8.14.9",
39
- "@dhis2-ui/field": "8.14.9",
40
- "@dhis2-ui/file-input": "8.14.9",
41
- "@dhis2-ui/input": "8.14.9",
42
- "@dhis2-ui/radio": "8.14.9",
43
- "@dhis2-ui/select": "8.14.9",
44
- "@dhis2-ui/switch": "8.14.9",
45
- "@dhis2-ui/text-area": "8.14.9",
37
+ "@dhis2-ui/button": "8.15.0-alpha.2",
38
+ "@dhis2-ui/checkbox": "8.15.0-alpha.2",
39
+ "@dhis2-ui/field": "8.15.0-alpha.2",
40
+ "@dhis2-ui/file-input": "8.15.0-alpha.2",
41
+ "@dhis2-ui/input": "8.15.0-alpha.2",
42
+ "@dhis2-ui/radio": "8.15.0-alpha.2",
43
+ "@dhis2-ui/select": "8.15.0-alpha.2",
44
+ "@dhis2-ui/switch": "8.15.0-alpha.2",
45
+ "@dhis2-ui/text-area": "8.15.0-alpha.2",
46
46
  "classnames": "^2.3.1",
47
47
  "final-form": "^4.20.2",
48
48
  "prop-types": "^15.7.2",
49
49
  "react-final-form": "^6.5.3"
50
50
  },
51
51
  "files": [
52
- "build"
52
+ "build",
53
+ "types"
53
54
  ],
54
55
  "devDependencies": {
55
56
  "react": "16.13",
56
57
  "react-dom": "16.13"
57
- }
58
+ },
59
+ "types": "types"
58
60
  }
@@ -0,0 +1,16 @@
1
+ import type { FieldRenderProps } from 'react-final-form'
2
+ import type { CheckboxFieldProps } from '@dhis2-ui/checkbox'
3
+ import React from 'react'
4
+
5
+ type CheckBoxValue = CheckboxFieldProps['value']
6
+ type CheckboxRestProps = Omit<
7
+ CheckboxFieldProps,
8
+ 'onChange' | 'value' | 'checked' | 'name'
9
+ >
10
+
11
+ export type CheckboxFieldFFProps = FieldRenderProps<CheckBoxValue> &
12
+ CheckboxRestProps & {
13
+ showValidStatus?: boolean
14
+ }
15
+
16
+ export const CheckboxFieldFF: React.FC<CheckboxFieldFFProps>
@@ -0,0 +1,9 @@
1
+ import React from 'react'
2
+ import type { FieldGroupProps } from '@dhis2-ui/field'
3
+
4
+ export type FieldGroupFFProps = Omit<
5
+ FieldGroupProps,
6
+ 'children' | 'label' | 'name' | 'required'
7
+ >
8
+
9
+ export const FieldGroupFF: React.FC<FieldGroupFFProps>
@@ -0,0 +1,18 @@
1
+ import React from 'react'
2
+ import type { FileInputFieldProps } from '@dhis2-ui/file-input'
3
+ import type { FieldRenderProps } from 'react-final-form'
4
+
5
+ export type FilesValue = File[] | undefined | null | ''
6
+
7
+ type FileInputRestProps = Omit<
8
+ FileInputFieldProps,
9
+ 'onChange' | 'multiple' | 'name'
10
+ >
11
+
12
+ export type FileInputFieldFFProps = FieldRenderProps<FilesValue> &
13
+ FileInputRestProps & {
14
+ showValidStatus?: boolean
15
+ multifile: FileInputFieldProps['multiple']
16
+ }
17
+
18
+ export const FileInputFieldFF: React.FC<FileInputFieldFFProps>
@@ -0,0 +1,15 @@
1
+ import React from 'react'
2
+ import type { InputFieldProps } from '@dhis2-ui/input'
3
+ import type { FieldRenderProps } from 'react-final-form'
4
+
5
+ export type InputValue = InputFieldProps['value']
6
+
7
+ type InputFieldRestProps = Omit<InputFieldProps, 'onChange' | 'value' | 'name'>
8
+
9
+ export type InputFieldFFProps = FieldRenderProps<InputValue> &
10
+ InputFieldRestProps & {
11
+ showLoadingStatus?: boolean
12
+ showValidStatus?: boolean
13
+ }
14
+
15
+ export const InputFieldFF: React.FC<InputFieldFFProps>
@@ -0,0 +1,24 @@
1
+ import React from 'react'
2
+ import type { FieldRenderProps } from 'react-final-form'
3
+ import type {
4
+ MultiSelectOptionProps,
5
+ MultiSelectFieldProps,
6
+ } from '@dhis2-ui/select'
7
+
8
+ type InputValue = MultiSelectFieldProps['selected'] | ''
9
+
10
+ type MultiSelectFieldRestProps = Omit<
11
+ MultiSelectFieldProps,
12
+ 'onChange' | 'value'
13
+ >
14
+
15
+ type MultiSelectOptions = Array<Pick<MultiSelectOptionProps, 'value' | 'label'>>
16
+
17
+ export type MultiSelectFieldFFProps = FieldRenderProps<InputValue> &
18
+ MultiSelectFieldRestProps & {
19
+ showLoadingStatus?: boolean
20
+ showValidStatus?: boolean
21
+ options: MultiSelectOptions
22
+ }
23
+
24
+ export const MultiSelectFieldFF: React.FC<MultiSelectFieldFFProps>
@@ -0,0 +1,17 @@
1
+ import React from 'react'
2
+ import type { FieldRenderProps } from 'react-final-form'
3
+ import type { RadioProps } from '@dhis2-ui/radio'
4
+
5
+ type InputValue = RadioProps['value']
6
+
7
+ type RadioRestProps = Omit<
8
+ RadioProps,
9
+ 'onChange' | 'value' | 'checked' | 'name'
10
+ >
11
+
12
+ export type RadioFieldFFProps = FieldRenderProps<InputValue> &
13
+ RadioRestProps & {
14
+ showValidStatus?: boolean
15
+ }
16
+
17
+ export const RadioFieldFF: React.FC<RadioFieldFFProps>
@@ -0,0 +1,26 @@
1
+ import React from 'react'
2
+ import type { FieldRenderProps } from 'react-final-form'
3
+ import type {
4
+ SingleSelectOptionProps,
5
+ SingleSelectFieldProps,
6
+ } from '@dhis2-ui/select'
7
+
8
+ type InputValue = SingleSelectFieldProps['selected']
9
+
10
+ type SingleSelectOptions = Array<
11
+ Pick<SingleSelectOptionProps, 'value' | 'label'>
12
+ >
13
+
14
+ type SingleSelectRestProps = Omit<
15
+ SingleSelectFieldProps,
16
+ 'onChange' | 'value' | 'name'
17
+ >
18
+
19
+ export type SingleSelectFieldFFProps = FieldRenderProps<InputValue> &
20
+ SingleSelectRestProps & {
21
+ showLoadingStatus?: boolean
22
+ showValidStatus?: boolean
23
+ options: SingleSelectOptions
24
+ }
25
+
26
+ export const SingleSelectFieldFF: React.FC<SingleSelectFieldFFProps>
@@ -0,0 +1,15 @@
1
+ import React from 'react'
2
+ import type { FieldRenderProps } from 'react-final-form'
3
+ import type { SwitchFieldProps } from '@dhis2-ui/switch'
4
+
5
+ type InputValue = SwitchFieldProps['value']
6
+
7
+ type SwitchFieldRestProps = Omit<
8
+ SwitchFieldProps,
9
+ 'onChange' | 'checked' | 'value' | 'name'
10
+ >
11
+
12
+ export type SwitchFieldFFProps = FieldRenderProps<InputValue> &
13
+ SwitchFieldRestProps
14
+
15
+ export const SwitchFieldFF: React.FC<SwitchFieldFFProps>
@@ -0,0 +1,15 @@
1
+ import React from 'react'
2
+ import type { FieldRenderProps } from 'react-final-form'
3
+ import type { TextAreaFieldProps } from '@dhis2-ui/text-area'
4
+
5
+ type InputValue = TextAreaFieldProps['value']
6
+
7
+ type TextAreaFieldRestProps = Omit<
8
+ TextAreaFieldProps,
9
+ 'onChange' | 'value' | 'name'
10
+ >
11
+
12
+ export type TextAreaFieldFFProps = FieldRenderProps<InputValue> &
13
+ TextAreaFieldRestProps
14
+
15
+ export const TextAreaFieldFF: React.FC<TextAreaFieldFFProps>
@@ -0,0 +1,28 @@
1
+ import * as FinalForm from 'final-form'
2
+ import * as ReactFinalForm from 'react-final-form'
3
+
4
+ export { CheckboxFieldFF } from './CheckboxFieldFF/CheckboxFieldFF'
5
+ export { FileInputFieldFF } from './FileInputFieldFF/FileInputFieldFF'
6
+ export { InputFieldFF } from './InputFieldFF/InputFieldFF'
7
+ export { MultiSelectFieldFF } from './MultiSelectFieldFF/MutliSelectFieldFF'
8
+ export { SingleSelectFieldFF } from './SingleSelectFieldFF/SingleSelectFieldFF'
9
+ export { RadioFieldFF } from './RadioFieldFF/RadioFieldFF'
10
+ export { SwitchFieldFF } from './SwitchFieldFF/SwitchFieldFF'
11
+ export { TextAreaFieldFF } from './TextAreaFieldFF/TextAreaFieldFF'
12
+ export { FieldGroupFF } from './FieldGroupFF/FieldGroupFF'
13
+
14
+ export * from './transformers'
15
+ export * from './validators'
16
+
17
+ /**
18
+ * Allows direct access to the FinalForm library. Please note that this is considered advanced
19
+ * usage and that you need to stay up to date with breaking changes in the FinalForm library.
20
+ */
21
+ export { FinalForm }
22
+
23
+ /**
24
+ * Allows direct access to the ReactFinalForm library. Please note that this is considered
25
+ * advanced usage and that you need to stay up to date with breaking changes in the FinalForm
26
+ * library.
27
+ */
28
+ export { ReactFinalForm }
@@ -0,0 +1,6 @@
1
+ export type ValuesWithId = Array<{ id: string }> | undefined
2
+
3
+ export const arrayWithIdObjects: {
4
+ format: (value: ValuesWithId) => string
5
+ pars: (value: string) => ValuesWithId
6
+ }
@@ -0,0 +1,31 @@
1
+ export type Validator = (value: unknown) => string | undefined
2
+
3
+ export const alphaNumeric: Validator
4
+ export const boolean: Validator
5
+ export const composeValidators: (...validators: Validator[]) => Validator
6
+
7
+ export const createCharacterLengthRange: (
8
+ lowerBound: number,
9
+ upperBound: number,
10
+ customMessage?: string
11
+ ) => Validator
12
+ export const createEqualTo: (key: string, description?: string) => Validator
13
+ export const createMaxCharacterLength: (upperBound: number) => Validator
14
+ export const createMaxNumber: (upperBound: number) => Validator
15
+ export const createMinCharacterLength: (lowerBound: number) => Validator
16
+ export const createMinNumber: (lowerBound: number) => Validator
17
+ export const createNumberRange: (
18
+ lowerBound: number,
19
+ upperBound: number,
20
+ customMessage?: string
21
+ ) => Validator
22
+ export const createPattern: (pattern: RegExp, message?: string) => Validator
23
+ export const dhis2Password: Validator
24
+ export const dhis2Username: Validator
25
+ export const email: Validator
26
+ export const hasValue: Validator
27
+ export const integer: Validator
28
+ export const internationalPhoneNumber: Validator
29
+ export const number: Validator
30
+ export const string: Validator
31
+ export const url: Validator
@@ -1,30 +0,0 @@
1
- {
2
- "Upload file": "Faylni yuklash",
3
- "Upload files": "",
4
- "Remove": "Олиб ташлаш",
5
- "Please provide an alpha-numeric value": "",
6
- "Please provide a boolean value": "",
7
- "Please enter between {{lowerBound}} and {{upperBound}} characters": "",
8
- "Please make sure the value of this input matches the value in \"{{otherField}}\".": "Ushbu yozuvning qiymati \"{{otherField}}\" dagi qiymatga mos kelishiga ishonch hosil qiling.",
9
- "Please enter a maximum of {{upperBound}} characters": "",
10
- "Please enter a number with a maximum of {{upperBound}}": "",
11
- "Please enter at least {{lowerBound}} characters": "",
12
- "Please enter a number of at least {{lowerBound}}": "",
13
- "Number cannot be less than {{lowerBound}} or more than {{upperBound}}": "",
14
- "Please make sure the value of this input matches the pattern {{patternString}}.": "",
15
- "Password should be a string": "",
16
- "Password should be at least 8 characters long": "Parol kamida 8 ta belgidan iborat boʼlishi lozim",
17
- "Password should be no longer than 34 characters": "Parol 34 ta belgidan oshmasligi lozim",
18
- "Password should contain at least one lowercase letter": "Parol tarkibida kamida 1 ta kichik harf boʼlishi lozim",
19
- "Password should contain at least one UPPERCASE letter": "Parol tarkibida kamida 1 ta BOSh harf boʼlishi lozim",
20
- "Password should contain at least one number": "Parol tarkibida kamida 1 ta raqam boʼlishi lozim",
21
- "Password should have at least one special character": "Parol tarkibida kamida 1 ta maxsus belgi boʼlishi lozim",
22
- "Please provide a valid email address": "Iltimos, amaldagi ye-pochta manzilini koʼrsating",
23
- "Please provide a value": "",
24
- "Please provide a round number without decimals": "",
25
- "Please provide a valid international phone number.": "",
26
- "Please provide a number": "",
27
- "Please provide a string": "",
28
- "Please provide a valid url": "Iltimos, haqiqiy URL manzilni koʼrsating",
29
- "Please provide a username between 4 and 255 characters long and possibly separated by . _ - or @": ""
30
- }
@@ -1,30 +0,0 @@
1
- {
2
- "Upload file": "Faylni yuklash",
3
- "Upload files": "",
4
- "Remove": "Олиб ташлаш",
5
- "Please provide an alpha-numeric value": "",
6
- "Please provide a boolean value": "",
7
- "Please enter between {{lowerBound}} and {{upperBound}} characters": "",
8
- "Please make sure the value of this input matches the value in \"{{otherField}}\".": "Ushbu yozuvning qiymati \"{{otherField}}\" dagi qiymatga mos kelishiga ishonch hosil qiling.",
9
- "Please enter a maximum of {{upperBound}} characters": "",
10
- "Please enter a number with a maximum of {{upperBound}}": "",
11
- "Please enter at least {{lowerBound}} characters": "",
12
- "Please enter a number of at least {{lowerBound}}": "",
13
- "Number cannot be less than {{lowerBound}} or more than {{upperBound}}": "",
14
- "Please make sure the value of this input matches the pattern {{patternString}}.": "",
15
- "Password should be a string": "",
16
- "Password should be at least 8 characters long": "Parol kamida 8 ta belgidan iborat boʼlishi lozim",
17
- "Password should be no longer than 34 characters": "Parol 34 ta belgidan oshmasligi lozim",
18
- "Password should contain at least one lowercase letter": "Parol tarkibida kamida 1 ta kichik harf boʼlishi lozim",
19
- "Password should contain at least one UPPERCASE letter": "Parol tarkibida kamida 1 ta BOSh harf boʼlishi lozim",
20
- "Password should contain at least one number": "Parol tarkibida kamida 1 ta raqam boʼlishi lozim",
21
- "Password should have at least one special character": "Parol tarkibida kamida 1 ta maxsus belgi boʼlishi lozim",
22
- "Please provide a valid email address": "Iltimos, amaldagi ye-pochta manzilini koʼrsating",
23
- "Please provide a value": "",
24
- "Please provide a round number without decimals": "",
25
- "Please provide a valid international phone number.": "",
26
- "Please provide a number": "",
27
- "Please provide a string": "",
28
- "Please provide a valid url": "Iltimos, haqiqiy URL manzilni koʼrsating",
29
- "Please provide a username between 4 and 255 characters long and possibly separated by . _ - or @": ""
30
- }