@digigov/form 0.6.4 → 0.6.7
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/CHANGELOG.md +22 -1
- package/Questions/index.mdx +0 -2
- package/es/Questions/index.mdx +0 -2
- package/es/index.js +1 -1
- package/es/validators.js +120 -3
- package/es/validators.spec.js +52 -1
- package/esm/Questions/index.mdx +0 -2
- package/esm/index.js +2 -2
- package/esm/validators.js +120 -3
- package/esm/validators.spec.js +52 -1
- package/index.js +1 -1
- package/libs/form/src/index.d.ts +1 -1
- package/libs/form/src/validators.d.ts +4 -0
- package/libs/ui/src/core/Accordion/index.d.ts +4 -1
- package/libs/ui/src/core/index.d.ts +0 -1
- package/libs/ui/src/locales/el.d.ts +4 -0
- package/package.json +2 -2
- package/validators.js +127 -3
- package/validators.spec.js +51 -0
- package/libs/ui/src/app/App.d.ts +0 -14
- package/libs/ui/src/app/CopyToClipboard.d.ts +0 -8
- package/libs/ui/src/app/Header/HeaderLogo.d.ts +0 -3
- package/libs/ui/src/app/Header/HeaderSection.d.ts +0 -5
- package/libs/ui/src/app/Header/HeaderTitle.d.ts +0 -5
- package/libs/ui/src/app/Header/index.d.ts +0 -11
- package/libs/ui/src/app/I18nText.d.ts +0 -10
- package/libs/ui/src/app/PhaseBannerHeader.d.ts +0 -8
- package/libs/ui/src/app/QrCodeScanner/index.d.ts +0 -29
- package/libs/ui/src/app/index.d.ts +0 -8
- package/libs/ui/src/core/PaginationLabel/index.d.ts +0 -21
- package/libs-ui/react-core/src/Header/index.d.ts +0 -10
- package/libs-ui/react-core/src/HeaderContent/index.d.ts +0 -9
- package/libs-ui/react-core/src/HeaderLogo/index.d.ts +0 -17
- package/libs-ui/react-core/src/HeaderSecondaryLogo/index.d.ts +0 -17
- package/libs-ui/react-core/src/HeaderSection/index.d.ts +0 -9
- package/libs-ui/react-core/src/HeaderSubtitle/index.d.ts +0 -9
- package/libs-ui/react-core/src/HeaderTitle/index.d.ts +0 -13
- package/libs-ui/react-core/src/PhaseBannerHeaderContainer/index.d.ts +0 -8
- package/libs-ui/react-extensions/src/admin/CopyToClipboardMessage/index.d.ts +0 -21
- package/libs-ui/react-extensions/src/admin/PaginationLabel/index.d.ts +0 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
# Change Log - @digigov/form
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 08 Jun 2022 12:26:07 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 0.6.7
|
|
6
|
+
Wed, 08 Jun 2022 12:26:07 GMT
|
|
7
|
+
|
|
8
|
+
### Patches
|
|
9
|
+
|
|
10
|
+
- create phone_number validation rule which accepts country and type of phone
|
|
11
|
+
- Add missing dependency in handleSubmit
|
|
12
|
+
|
|
13
|
+
## 0.6.6
|
|
14
|
+
Tue, 24 May 2022 09:13:18 GMT
|
|
15
|
+
|
|
16
|
+
### Patches
|
|
17
|
+
|
|
18
|
+
- Update MDX examples
|
|
19
|
+
- create postal code validator
|
|
20
|
+
|
|
21
|
+
## 0.6.5
|
|
22
|
+
Tue, 17 May 2022 11:04:22 GMT
|
|
23
|
+
|
|
24
|
+
_Version update only_
|
|
4
25
|
|
|
5
26
|
## 0.6.4
|
|
6
27
|
Mon, 16 May 2022 14:42:45 GMT
|
package/Questions/index.mdx
CHANGED
|
@@ -10,8 +10,6 @@ import Questions, {
|
|
|
10
10
|
StepTitle,
|
|
11
11
|
} from '@digigov/form/Questions';
|
|
12
12
|
import { Field } from '@digigov/form';
|
|
13
|
-
import PropsDoc from '@docs-components/propsDoc';
|
|
14
|
-
import StylesDoc from '@docs-components/stylesDoc';
|
|
15
13
|
const steps = [
|
|
16
14
|
{
|
|
17
15
|
name: 'intro',
|
package/es/Questions/index.mdx
CHANGED
|
@@ -10,8 +10,6 @@ import Questions, {
|
|
|
10
10
|
StepTitle,
|
|
11
11
|
} from '@digigov/form/Questions';
|
|
12
12
|
import { Field } from '@digigov/form';
|
|
13
|
-
import PropsDoc from '@docs-components/propsDoc';
|
|
14
|
-
import StylesDoc from '@docs-components/stylesDoc';
|
|
15
13
|
const steps = [
|
|
16
14
|
{
|
|
17
15
|
name: 'intro',
|
package/es/index.js
CHANGED
package/es/validators.js
CHANGED
|
@@ -14,6 +14,19 @@ import dayjs from 'dayjs';
|
|
|
14
14
|
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
15
15
|
dayjs.extend(customParseFormat);
|
|
16
16
|
var DEFAULT_FILE_MAX_SIZE = 10000000;
|
|
17
|
+
export function validatePostalCode(number, countries) {
|
|
18
|
+
if (!countries) {
|
|
19
|
+
return false;
|
|
20
|
+
} else {
|
|
21
|
+
if (countries.length === 1 && countries[0].toUpperCase() === 'GR') {
|
|
22
|
+
// Greek postal code must be 5 digits long and shouldn't start with 0 or 9.
|
|
23
|
+
var CODE_REGEX = /^[12345678][0-9]{4}$/;
|
|
24
|
+
return CODE_REGEX.test(number);
|
|
25
|
+
} else {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
17
30
|
export function validateAFM(afm) {
|
|
18
31
|
if (afm.length !== 9) {
|
|
19
32
|
// "afm should be 9 digits"
|
|
@@ -38,6 +51,58 @@ export function validateAFM(afm) {
|
|
|
38
51
|
var valid = calc % 10 === d9;
|
|
39
52
|
return valid;
|
|
40
53
|
}
|
|
54
|
+
export function validatePhoneNumber(phoneNumber) {
|
|
55
|
+
var countries = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['gr'];
|
|
56
|
+
var typeOfPhoneNumber = arguments.length > 2 ? arguments[2] : undefined;
|
|
57
|
+
var phoneUtil = gPhoneNumber.PhoneNumberUtil.getInstance();
|
|
58
|
+
|
|
59
|
+
if (!countries || countries.length === 0) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return countries.some(function (country) {
|
|
64
|
+
try {
|
|
65
|
+
var phone = phoneUtil.parse(phoneNumber, country.toUpperCase());
|
|
66
|
+
|
|
67
|
+
if (phoneUtil.isValidNumber(phone)) {
|
|
68
|
+
if (typeOfPhoneNumber) {
|
|
69
|
+
if (matchTypeOfPhoneNumber(phone, typeOfPhoneNumber, phoneUtil)) {
|
|
70
|
+
return true;
|
|
71
|
+
} else {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
} else {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return false;
|
|
80
|
+
} catch (error) {
|
|
81
|
+
console.error(error);
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
var phoneNumberTypes = {
|
|
87
|
+
0: 'landline',
|
|
88
|
+
1: 'mobile',
|
|
89
|
+
2: 'landline_or_mobile'
|
|
90
|
+
};
|
|
91
|
+
export function matchTypeOfPhoneNumber(phone, type, phoneUtil) {
|
|
92
|
+
try {
|
|
93
|
+
var phoneNumberType = phoneUtil.getNumberType(phone);
|
|
94
|
+
var numberType = phoneNumberTypes[phoneNumberType];
|
|
95
|
+
|
|
96
|
+
if (numberType === 'landline_or_mobile' || numberType === type) {
|
|
97
|
+
return true;
|
|
98
|
+
} else {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
} catch (error) {
|
|
102
|
+
console.error(error);
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
41
106
|
|
|
42
107
|
function validateMobile(value) {
|
|
43
108
|
var phoneUtil = gPhoneNumber.PhoneNumberUtil.getInstance();
|
|
@@ -69,6 +134,23 @@ function validateMobile(value) {
|
|
|
69
134
|
}
|
|
70
135
|
}
|
|
71
136
|
|
|
137
|
+
var POSTALCODE_VALIDATOR = function POSTALCODE_VALIDATOR(field) {
|
|
138
|
+
var _field$extra;
|
|
139
|
+
|
|
140
|
+
var countryCode = field === null || field === void 0 ? void 0 : (_field$extra = field.extra) === null || _field$extra === void 0 ? void 0 : _field$extra.countries;
|
|
141
|
+
return {
|
|
142
|
+
name: 'postal-code-validator',
|
|
143
|
+
message: 'form.error.postalCode',
|
|
144
|
+
test: function test(value) {
|
|
145
|
+
if (!value) {
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return validatePostalCode(value, countryCode);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
|
|
72
154
|
var MOBILE_PHONE_VALIDATOR = {
|
|
73
155
|
name: 'mobile-phone-validator',
|
|
74
156
|
message: 'form.error.mobile_phone',
|
|
@@ -80,6 +162,35 @@ var MOBILE_PHONE_VALIDATOR = {
|
|
|
80
162
|
return true;
|
|
81
163
|
}
|
|
82
164
|
};
|
|
165
|
+
|
|
166
|
+
var PHONE_NUMBER_VALIDATOR = function PHONE_NUMBER_VALIDATOR(field) {
|
|
167
|
+
var _field$extra2, _field$extra3;
|
|
168
|
+
|
|
169
|
+
var countryCode = field === null || field === void 0 ? void 0 : (_field$extra2 = field.extra) === null || _field$extra2 === void 0 ? void 0 : _field$extra2.countries;
|
|
170
|
+
var typeOfPhone = field === null || field === void 0 ? void 0 : (_field$extra3 = field.extra) === null || _field$extra3 === void 0 ? void 0 : _field$extra3.phoneType;
|
|
171
|
+
return {
|
|
172
|
+
name: 'phone-number-validator',
|
|
173
|
+
message: function message() {
|
|
174
|
+
if (typeOfPhone === 'mobile') {
|
|
175
|
+
return 'form.error.mobile_phone';
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (typeOfPhone === 'landline') {
|
|
179
|
+
return 'form.error.landline';
|
|
180
|
+
} else {
|
|
181
|
+
return 'form.error.phone_number';
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
test: function test(value) {
|
|
185
|
+
if (!value) {
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
return validatePhoneNumber(value, countryCode, typeOfPhone);
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
|
|
83
194
|
var AFM_VALIDATOR = {
|
|
84
195
|
name: 'afm-validator',
|
|
85
196
|
message: 'form.error.afm',
|
|
@@ -267,14 +378,14 @@ export function validateIban(value, countryCode) {
|
|
|
267
378
|
}
|
|
268
379
|
|
|
269
380
|
var IBAN_VALIDATOR = function IBAN_VALIDATOR(field) {
|
|
270
|
-
var _field$
|
|
381
|
+
var _field$extra4;
|
|
271
382
|
|
|
272
|
-
var countryCode = field === null || field === void 0 ? void 0 : (_field$
|
|
383
|
+
var countryCode = field === null || field === void 0 ? void 0 : (_field$extra4 = field.extra) === null || _field$extra4 === void 0 ? void 0 : _field$extra4.country;
|
|
273
384
|
return {
|
|
274
385
|
name: 'iban-validator',
|
|
275
386
|
message: 'form.error.iban',
|
|
276
387
|
test: function test(value) {
|
|
277
|
-
if (!value
|
|
388
|
+
if (!value) {
|
|
278
389
|
return true;
|
|
279
390
|
}
|
|
280
391
|
|
|
@@ -418,9 +529,15 @@ var getYUPTypeMap = function getYUPTypeMap() {
|
|
|
418
529
|
iban: function iban(field) {
|
|
419
530
|
return yup.string().test(IBAN_VALIDATOR(field));
|
|
420
531
|
},
|
|
532
|
+
postal_code: function postal_code(field) {
|
|
533
|
+
return yup.string().test(POSTALCODE_VALIDATOR(field));
|
|
534
|
+
},
|
|
421
535
|
mobile_phone: function mobile_phone() {
|
|
422
536
|
return yup.string().test(MOBILE_PHONE_VALIDATOR);
|
|
423
537
|
},
|
|
538
|
+
phone_number: function phone_number(field) {
|
|
539
|
+
return yup.string().test(PHONE_NUMBER_VALIDATOR(field));
|
|
540
|
+
},
|
|
424
541
|
'choice:multiple': function choiceMultiple() {
|
|
425
542
|
return yup.array().of(yup.string()).nullable();
|
|
426
543
|
},
|
package/es/validators.spec.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { validateUUID4, validateIban } from '@digigov/form/validators';
|
|
1
|
+
import { validateUUID4, validateIban, validatePostalCode, validatePhoneNumber } from '@digigov/form/validators';
|
|
2
2
|
it('validates wrong uuid4 for empty value', function () {
|
|
3
3
|
expect(validateUUID4('')).toBe(false);
|
|
4
4
|
});
|
|
@@ -31,4 +31,55 @@ it('validates wrong iban for non existing country code', function () {
|
|
|
31
31
|
});
|
|
32
32
|
it('validates correct greek iban whithout country code', function () {
|
|
33
33
|
expect(validateIban('7801100800000008009825202', '')).toBe(true);
|
|
34
|
+
});
|
|
35
|
+
it('validates wrong postal code without country code', function () {
|
|
36
|
+
expect(validatePostalCode('123', [])).toBe(true);
|
|
37
|
+
});
|
|
38
|
+
it('validates wrong postal code with wrong country code', function () {
|
|
39
|
+
expect(validatePostalCode('123', ['FR'])).toBe(true);
|
|
40
|
+
});
|
|
41
|
+
it('validates wrong postal code with greek country code', function () {
|
|
42
|
+
expect(validatePostalCode('123', ['GR'])).toBe(false);
|
|
43
|
+
});
|
|
44
|
+
it('validates postal code with greek country code', function () {
|
|
45
|
+
expect(validatePostalCode('11143', ['GR'])).toBe(true);
|
|
46
|
+
});
|
|
47
|
+
it('validates phone number type landline with greek country code', function () {
|
|
48
|
+
expect(validatePhoneNumber('2102934896', ['GR'], 'landline')).toBe(true);
|
|
49
|
+
});
|
|
50
|
+
it('validates phone number type landline with ch country code', function () {
|
|
51
|
+
expect(validatePhoneNumber('2102934896', ['CH'], 'landline')).toBe(false);
|
|
52
|
+
});
|
|
53
|
+
it('validates phone number type landline with ch and gr countries code', function () {
|
|
54
|
+
expect(validatePhoneNumber('2102934896', ['GR', 'CH'], 'landline')).toBe(true);
|
|
55
|
+
});
|
|
56
|
+
it('validatesphone number type landline with ch and gr countries code', function () {
|
|
57
|
+
expect(validatePhoneNumber('41446681800', ['GR', 'CH'], 'landline')).toBe(true);
|
|
58
|
+
});
|
|
59
|
+
it('validates phone number type landline with ch and gr countries code but phone number is mobile', function () {
|
|
60
|
+
expect(validatePhoneNumber('2102934896', ['GR', 'CH'], 'mobile')).toBe(false);
|
|
61
|
+
});
|
|
62
|
+
it('validates phone number type mobile with ch and gr countries code', function () {
|
|
63
|
+
expect(validatePhoneNumber('6934100982', ['GR', 'CH'], 'mobile')).toBe(true);
|
|
64
|
+
});
|
|
65
|
+
it('validates phone number type mobile with gr country code', function () {
|
|
66
|
+
expect(validatePhoneNumber('6934100982', ['GR'], 'mobile')).toBe(true);
|
|
67
|
+
});
|
|
68
|
+
it('validates phone number type mobile with ch country code', function () {
|
|
69
|
+
expect(validatePhoneNumber('6934100982', ['CH'], 'mobile')).toBe(false);
|
|
70
|
+
});
|
|
71
|
+
it('validates phone number with no type and ch country code', function () {
|
|
72
|
+
expect(validatePhoneNumber('6934100982', ['CH'], null)).toBe(false);
|
|
73
|
+
});
|
|
74
|
+
it('validates phone number with no type and gr country code', function () {
|
|
75
|
+
expect(validatePhoneNumber('6934100982', ['gr'], null)).toBe(true);
|
|
76
|
+
});
|
|
77
|
+
it('validates phone number with no type and ch country code', function () {
|
|
78
|
+
expect(validatePhoneNumber('41446681800', ['CH'], null)).toBe(true);
|
|
79
|
+
});
|
|
80
|
+
it('validates phone number with no type and gr country code', function () {
|
|
81
|
+
expect(validatePhoneNumber('41446681800', ['gr'], null)).toBe(false);
|
|
82
|
+
});
|
|
83
|
+
it('validates phone number with no type and gr and ch countries code', function () {
|
|
84
|
+
expect(validatePhoneNumber('41446681800', ['gr', 'ch'], null)).toBe(true);
|
|
34
85
|
});
|
package/esm/Questions/index.mdx
CHANGED
|
@@ -10,8 +10,6 @@ import Questions, {
|
|
|
10
10
|
StepTitle,
|
|
11
11
|
} from '@digigov/form/Questions';
|
|
12
12
|
import { Field } from '@digigov/form';
|
|
13
|
-
import PropsDoc from '@docs-components/propsDoc';
|
|
14
|
-
import StylesDoc from '@docs-components/stylesDoc';
|
|
15
13
|
const steps = [
|
|
16
14
|
{
|
|
17
15
|
name: 'intro',
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license Digigov v0.6.
|
|
1
|
+
/** @license Digigov v0.6.7
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the BSD-2-Clause license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -55,7 +55,7 @@ export var FormBase = /*#__PURE__*/React.forwardRef(function FormBase(_ref, ref)
|
|
|
55
55
|
form.setError(key, errors[key]);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
}, []);
|
|
58
|
+
}, [onSubmit]);
|
|
59
59
|
var ctx = {
|
|
60
60
|
fieldsMap: fieldsMap,
|
|
61
61
|
fieldsetsMap: fieldsetsMap,
|
package/esm/validators.js
CHANGED
|
@@ -14,6 +14,19 @@ import dayjs from 'dayjs';
|
|
|
14
14
|
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
15
15
|
dayjs.extend(customParseFormat);
|
|
16
16
|
var DEFAULT_FILE_MAX_SIZE = 10000000;
|
|
17
|
+
export function validatePostalCode(number, countries) {
|
|
18
|
+
if (!countries) {
|
|
19
|
+
return false;
|
|
20
|
+
} else {
|
|
21
|
+
if (countries.length === 1 && countries[0].toUpperCase() === 'GR') {
|
|
22
|
+
// Greek postal code must be 5 digits long and shouldn't start with 0 or 9.
|
|
23
|
+
var CODE_REGEX = /^[12345678][0-9]{4}$/;
|
|
24
|
+
return CODE_REGEX.test(number);
|
|
25
|
+
} else {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
17
30
|
export function validateAFM(afm) {
|
|
18
31
|
if (afm.length !== 9) {
|
|
19
32
|
// "afm should be 9 digits"
|
|
@@ -38,6 +51,58 @@ export function validateAFM(afm) {
|
|
|
38
51
|
var valid = calc % 10 === d9;
|
|
39
52
|
return valid;
|
|
40
53
|
}
|
|
54
|
+
export function validatePhoneNumber(phoneNumber) {
|
|
55
|
+
var countries = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['gr'];
|
|
56
|
+
var typeOfPhoneNumber = arguments.length > 2 ? arguments[2] : undefined;
|
|
57
|
+
var phoneUtil = gPhoneNumber.PhoneNumberUtil.getInstance();
|
|
58
|
+
|
|
59
|
+
if (!countries || countries.length === 0) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return countries.some(function (country) {
|
|
64
|
+
try {
|
|
65
|
+
var phone = phoneUtil.parse(phoneNumber, country.toUpperCase());
|
|
66
|
+
|
|
67
|
+
if (phoneUtil.isValidNumber(phone)) {
|
|
68
|
+
if (typeOfPhoneNumber) {
|
|
69
|
+
if (matchTypeOfPhoneNumber(phone, typeOfPhoneNumber, phoneUtil)) {
|
|
70
|
+
return true;
|
|
71
|
+
} else {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
} else {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return false;
|
|
80
|
+
} catch (error) {
|
|
81
|
+
console.error(error);
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
var phoneNumberTypes = {
|
|
87
|
+
0: 'landline',
|
|
88
|
+
1: 'mobile',
|
|
89
|
+
2: 'landline_or_mobile'
|
|
90
|
+
};
|
|
91
|
+
export function matchTypeOfPhoneNumber(phone, type, phoneUtil) {
|
|
92
|
+
try {
|
|
93
|
+
var phoneNumberType = phoneUtil.getNumberType(phone);
|
|
94
|
+
var numberType = phoneNumberTypes[phoneNumberType];
|
|
95
|
+
|
|
96
|
+
if (numberType === 'landline_or_mobile' || numberType === type) {
|
|
97
|
+
return true;
|
|
98
|
+
} else {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
} catch (error) {
|
|
102
|
+
console.error(error);
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
41
106
|
|
|
42
107
|
function validateMobile(value) {
|
|
43
108
|
var phoneUtil = gPhoneNumber.PhoneNumberUtil.getInstance();
|
|
@@ -69,6 +134,23 @@ function validateMobile(value) {
|
|
|
69
134
|
}
|
|
70
135
|
}
|
|
71
136
|
|
|
137
|
+
var POSTALCODE_VALIDATOR = function POSTALCODE_VALIDATOR(field) {
|
|
138
|
+
var _field$extra;
|
|
139
|
+
|
|
140
|
+
var countryCode = field === null || field === void 0 ? void 0 : (_field$extra = field.extra) === null || _field$extra === void 0 ? void 0 : _field$extra.countries;
|
|
141
|
+
return {
|
|
142
|
+
name: 'postal-code-validator',
|
|
143
|
+
message: 'form.error.postalCode',
|
|
144
|
+
test: function test(value) {
|
|
145
|
+
if (!value) {
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return validatePostalCode(value, countryCode);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
|
|
72
154
|
var MOBILE_PHONE_VALIDATOR = {
|
|
73
155
|
name: 'mobile-phone-validator',
|
|
74
156
|
message: 'form.error.mobile_phone',
|
|
@@ -80,6 +162,35 @@ var MOBILE_PHONE_VALIDATOR = {
|
|
|
80
162
|
return true;
|
|
81
163
|
}
|
|
82
164
|
};
|
|
165
|
+
|
|
166
|
+
var PHONE_NUMBER_VALIDATOR = function PHONE_NUMBER_VALIDATOR(field) {
|
|
167
|
+
var _field$extra2, _field$extra3;
|
|
168
|
+
|
|
169
|
+
var countryCode = field === null || field === void 0 ? void 0 : (_field$extra2 = field.extra) === null || _field$extra2 === void 0 ? void 0 : _field$extra2.countries;
|
|
170
|
+
var typeOfPhone = field === null || field === void 0 ? void 0 : (_field$extra3 = field.extra) === null || _field$extra3 === void 0 ? void 0 : _field$extra3.phoneType;
|
|
171
|
+
return {
|
|
172
|
+
name: 'phone-number-validator',
|
|
173
|
+
message: function message() {
|
|
174
|
+
if (typeOfPhone === 'mobile') {
|
|
175
|
+
return 'form.error.mobile_phone';
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (typeOfPhone === 'landline') {
|
|
179
|
+
return 'form.error.landline';
|
|
180
|
+
} else {
|
|
181
|
+
return 'form.error.phone_number';
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
test: function test(value) {
|
|
185
|
+
if (!value) {
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
return validatePhoneNumber(value, countryCode, typeOfPhone);
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
|
|
83
194
|
var AFM_VALIDATOR = {
|
|
84
195
|
name: 'afm-validator',
|
|
85
196
|
message: 'form.error.afm',
|
|
@@ -267,14 +378,14 @@ export function validateIban(value, countryCode) {
|
|
|
267
378
|
}
|
|
268
379
|
|
|
269
380
|
var IBAN_VALIDATOR = function IBAN_VALIDATOR(field) {
|
|
270
|
-
var _field$
|
|
381
|
+
var _field$extra4;
|
|
271
382
|
|
|
272
|
-
var countryCode = field === null || field === void 0 ? void 0 : (_field$
|
|
383
|
+
var countryCode = field === null || field === void 0 ? void 0 : (_field$extra4 = field.extra) === null || _field$extra4 === void 0 ? void 0 : _field$extra4.country;
|
|
273
384
|
return {
|
|
274
385
|
name: 'iban-validator',
|
|
275
386
|
message: 'form.error.iban',
|
|
276
387
|
test: function test(value) {
|
|
277
|
-
if (!value
|
|
388
|
+
if (!value) {
|
|
278
389
|
return true;
|
|
279
390
|
}
|
|
280
391
|
|
|
@@ -418,9 +529,15 @@ var getYUPTypeMap = function getYUPTypeMap() {
|
|
|
418
529
|
iban: function iban(field) {
|
|
419
530
|
return yup.string().test(IBAN_VALIDATOR(field));
|
|
420
531
|
},
|
|
532
|
+
postal_code: function postal_code(field) {
|
|
533
|
+
return yup.string().test(POSTALCODE_VALIDATOR(field));
|
|
534
|
+
},
|
|
421
535
|
mobile_phone: function mobile_phone() {
|
|
422
536
|
return yup.string().test(MOBILE_PHONE_VALIDATOR);
|
|
423
537
|
},
|
|
538
|
+
phone_number: function phone_number(field) {
|
|
539
|
+
return yup.string().test(PHONE_NUMBER_VALIDATOR(field));
|
|
540
|
+
},
|
|
424
541
|
'choice:multiple': function choiceMultiple() {
|
|
425
542
|
return yup.array().of(yup.string()).nullable();
|
|
426
543
|
},
|
package/esm/validators.spec.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { validateUUID4, validateIban } from '@digigov/form/validators';
|
|
1
|
+
import { validateUUID4, validateIban, validatePostalCode, validatePhoneNumber } from '@digigov/form/validators';
|
|
2
2
|
it('validates wrong uuid4 for empty value', function () {
|
|
3
3
|
expect(validateUUID4('')).toBe(false);
|
|
4
4
|
});
|
|
@@ -31,4 +31,55 @@ it('validates wrong iban for non existing country code', function () {
|
|
|
31
31
|
});
|
|
32
32
|
it('validates correct greek iban whithout country code', function () {
|
|
33
33
|
expect(validateIban('7801100800000008009825202', '')).toBe(true);
|
|
34
|
+
});
|
|
35
|
+
it('validates wrong postal code without country code', function () {
|
|
36
|
+
expect(validatePostalCode('123', [])).toBe(true);
|
|
37
|
+
});
|
|
38
|
+
it('validates wrong postal code with wrong country code', function () {
|
|
39
|
+
expect(validatePostalCode('123', ['FR'])).toBe(true);
|
|
40
|
+
});
|
|
41
|
+
it('validates wrong postal code with greek country code', function () {
|
|
42
|
+
expect(validatePostalCode('123', ['GR'])).toBe(false);
|
|
43
|
+
});
|
|
44
|
+
it('validates postal code with greek country code', function () {
|
|
45
|
+
expect(validatePostalCode('11143', ['GR'])).toBe(true);
|
|
46
|
+
});
|
|
47
|
+
it('validates phone number type landline with greek country code', function () {
|
|
48
|
+
expect(validatePhoneNumber('2102934896', ['GR'], 'landline')).toBe(true);
|
|
49
|
+
});
|
|
50
|
+
it('validates phone number type landline with ch country code', function () {
|
|
51
|
+
expect(validatePhoneNumber('2102934896', ['CH'], 'landline')).toBe(false);
|
|
52
|
+
});
|
|
53
|
+
it('validates phone number type landline with ch and gr countries code', function () {
|
|
54
|
+
expect(validatePhoneNumber('2102934896', ['GR', 'CH'], 'landline')).toBe(true);
|
|
55
|
+
});
|
|
56
|
+
it('validatesphone number type landline with ch and gr countries code', function () {
|
|
57
|
+
expect(validatePhoneNumber('41446681800', ['GR', 'CH'], 'landline')).toBe(true);
|
|
58
|
+
});
|
|
59
|
+
it('validates phone number type landline with ch and gr countries code but phone number is mobile', function () {
|
|
60
|
+
expect(validatePhoneNumber('2102934896', ['GR', 'CH'], 'mobile')).toBe(false);
|
|
61
|
+
});
|
|
62
|
+
it('validates phone number type mobile with ch and gr countries code', function () {
|
|
63
|
+
expect(validatePhoneNumber('6934100982', ['GR', 'CH'], 'mobile')).toBe(true);
|
|
64
|
+
});
|
|
65
|
+
it('validates phone number type mobile with gr country code', function () {
|
|
66
|
+
expect(validatePhoneNumber('6934100982', ['GR'], 'mobile')).toBe(true);
|
|
67
|
+
});
|
|
68
|
+
it('validates phone number type mobile with ch country code', function () {
|
|
69
|
+
expect(validatePhoneNumber('6934100982', ['CH'], 'mobile')).toBe(false);
|
|
70
|
+
});
|
|
71
|
+
it('validates phone number with no type and ch country code', function () {
|
|
72
|
+
expect(validatePhoneNumber('6934100982', ['CH'], null)).toBe(false);
|
|
73
|
+
});
|
|
74
|
+
it('validates phone number with no type and gr country code', function () {
|
|
75
|
+
expect(validatePhoneNumber('6934100982', ['gr'], null)).toBe(true);
|
|
76
|
+
});
|
|
77
|
+
it('validates phone number with no type and ch country code', function () {
|
|
78
|
+
expect(validatePhoneNumber('41446681800', ['CH'], null)).toBe(true);
|
|
79
|
+
});
|
|
80
|
+
it('validates phone number with no type and gr country code', function () {
|
|
81
|
+
expect(validatePhoneNumber('41446681800', ['gr'], null)).toBe(false);
|
|
82
|
+
});
|
|
83
|
+
it('validates phone number with no type and gr and ch countries code', function () {
|
|
84
|
+
expect(validatePhoneNumber('41446681800', ['gr', 'ch'], null)).toBe(true);
|
|
34
85
|
});
|
package/index.js
CHANGED
package/libs/form/src/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export interface FieldCondition {
|
|
|
19
19
|
}
|
|
20
20
|
export interface FieldSpec {
|
|
21
21
|
key: string;
|
|
22
|
-
type?: 'int' | 'string' | 'boolean' | 'choice:multiple' | 'choice:single' | 'mobile_phone' | 'afm';
|
|
22
|
+
type?: 'int' | 'string' | 'boolean' | 'choice:multiple' | 'choice:single' | 'mobile_phone' | 'afm' | 'iban' | 'postal_code' | 'phone_number';
|
|
23
23
|
component?: any;
|
|
24
24
|
condition?: Record<string, FieldCondition>;
|
|
25
25
|
controlled?: boolean;
|
|
@@ -2,7 +2,11 @@ import * as yup from 'yup';
|
|
|
2
2
|
import { FieldSpec } from '@digigov/form';
|
|
3
3
|
import { MutableRefObject } from 'react';
|
|
4
4
|
export declare type ValidatorSchema = yup.BaseTestOptions;
|
|
5
|
+
export declare function validatePostalCode(number: string, countries: Array<string>): boolean;
|
|
5
6
|
export declare function validateAFM(afm: string): boolean;
|
|
7
|
+
export declare type PhoneNumberType = 'landline' | 'mobile' | null;
|
|
8
|
+
export declare function validatePhoneNumber(phoneNumber: string, countries: string[] | undefined, typeOfPhoneNumber: PhoneNumberType): boolean;
|
|
9
|
+
export declare function matchTypeOfPhoneNumber(phone: any, type: string, phoneUtil: any): boolean;
|
|
6
10
|
export declare function validateUUID4(uuid4: string): boolean;
|
|
7
11
|
export declare function validateIban(value: string, countryCode: string): boolean;
|
|
8
12
|
export interface MutableRefObjectProps {
|
|
@@ -8,7 +8,10 @@ import AccordionControls from '@digigov/react-core/AccordionControls';
|
|
|
8
8
|
import { UseTogglableSectionsReturn } from '@digigov/ui/hooks/useTogglableSections';
|
|
9
9
|
export declare const AccordionSectionHeader: React.ForwardRefExoticComponent<Pick<import("@digigov/react-core/AccordionSectionHeader").AccordionSectionHeaderProps, "className" | "style" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
10
|
export declare const AccordionItemDetails: React.ForwardRefExoticComponent<Pick<import("@digigov/react-core/AccordionSectionContent").AccordionSectionContentProps, "className" | "style" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
-
export declare const AccordionItemSummary:
|
|
11
|
+
export declare const AccordionItemSummary: ({ children, ...props }: {
|
|
12
|
+
[x: string]: any;
|
|
13
|
+
children: any;
|
|
14
|
+
}) => JSX.Element;
|
|
12
15
|
export declare const AccordionItem: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<import("@digigov/react-core/AccordionSection").AccordionSectionProps, "className" | "style" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "open"> & React.RefAttributes<HTMLDivElement>>>;
|
|
13
16
|
export interface UseAccordionProps {
|
|
14
17
|
singleOpen?: boolean;
|
|
@@ -18,6 +18,5 @@ export * from '@digigov/ui/core/Table';
|
|
|
18
18
|
export * from '@digigov/ui/core/Tabs';
|
|
19
19
|
export * from '@digigov/ui/core/VisuallyHidden';
|
|
20
20
|
export { default as WarningText } from '@digigov/ui/core/WarningText';
|
|
21
|
-
export * from '@digigov/ui/core/PaginationLabel';
|
|
22
21
|
export * from '@digigov/ui/core/SvgIcon';
|
|
23
22
|
export * from '@digigov/ui/core/FileUpload';
|