dce-reactkit 3.8.6 → 3.9.0-beta-loading-modal.1
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/dist/cjs/index.js +253 -381
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/Modal/ModalProps.d.ts +2 -0
- package/dist/cjs/types/index.d.ts +1 -3
- package/dist/esm/index.js +255 -381
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Modal/ModalProps.d.ts +2 -0
- package/dist/esm/types/index.d.ts +1 -3
- package/dist/index.d.ts +45 -79
- package/package.json +1 -1
- package/src/components/Modal/ModalProps.ts +4 -0
- package/src/components/Modal/index.tsx +49 -21
- package/src/components/MultiSwitch.tsx +1 -1
- package/src/index.ts +0 -4
- package/dist/cjs/types/components/Dropdown.d.ts +0 -32
- package/dist/cjs/types/helpers/validators/ChicagoTitleCase.d.ts +0 -9
- package/dist/cjs/types/helpers/validators/validURL.d.ts +0 -8
- package/dist/cjs/types/types/DropdownItemType.d.ts +0 -6
- package/dist/esm/types/components/Dropdown.d.ts +0 -32
- package/dist/esm/types/helpers/validators/ChicagoTitleCase.d.ts +0 -9
- package/dist/esm/types/helpers/validators/validURL.d.ts +0 -8
- package/dist/esm/types/types/DropdownItemType.d.ts +0 -6
- package/src/components/Dropdown.tsx +0 -317
- package/src/helpers/validators/ChicagoTitleCase.test.ts +0 -85
- package/src/helpers/validators/ChicagoTitleCase.ts +0 -32
- package/src/helpers/validators/findURL.test.ts +0 -83
- package/src/helpers/validators/findURL.ts +0 -43
- package/src/helpers/validators/validURL.test.ts +0 -90
- package/src/helpers/validators/validURL.ts +0 -18
- package/src/types/DropdownItemType.ts +0 -11
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// Import the function to be tested
|
|
3
|
-
// import isValid from './validURL';
|
|
4
|
-
|
|
5
|
-
// // Import constants
|
|
6
|
-
// import { INVALID_STRING_ERRORS, INVALID_REGEX_ERROR } from './shared/constants/ERROR_MESSAGES';
|
|
7
|
-
|
|
8
|
-
// /*------------------------------------------------------------------------*/
|
|
9
|
-
// /* ---------------------------- Valid Tests --------------------------- */
|
|
10
|
-
// /*------------------------------------------------------------------------*/
|
|
11
|
-
|
|
12
|
-
// const validUrls: string[] = [
|
|
13
|
-
// 'http://example.com',
|
|
14
|
-
// 'https://example.com',
|
|
15
|
-
// 'http://www.example.com',
|
|
16
|
-
// 'https://www.example.com',
|
|
17
|
-
// 'https://example.com/path',
|
|
18
|
-
// 'http://example.com/path',
|
|
19
|
-
// 'https://example.com?query=string',
|
|
20
|
-
// 'http://example.com?query=string',
|
|
21
|
-
// 'https://example.com#fragment',
|
|
22
|
-
// 'http://example.com#fragment',
|
|
23
|
-
// 'http://localhost',
|
|
24
|
-
// 'https://localhost:3000',
|
|
25
|
-
// 'http://localhost:3000',
|
|
26
|
-
// 'http://127.0.0.1',
|
|
27
|
-
// 'http://127.0.0.1:3000',
|
|
28
|
-
// 'ftp://example.com/path',
|
|
29
|
-
// 'ftp://example.com',
|
|
30
|
-
// 'https://127.0.0.1:3000',
|
|
31
|
-
// 'file:///C:/path/to/file'
|
|
32
|
-
// ];
|
|
33
|
-
|
|
34
|
-
// test(
|
|
35
|
-
// 'Returns true for a given valid URL.',
|
|
36
|
-
// async () => {
|
|
37
|
-
// validUrls.forEach((url) => {
|
|
38
|
-
// expect(isValid(url)).toBe(true);
|
|
39
|
-
// });
|
|
40
|
-
// },
|
|
41
|
-
// );
|
|
42
|
-
|
|
43
|
-
// /*------------------------------------------------------------------------*/
|
|
44
|
-
// /* ---------------------------- Invalid Tests --------------------------- */
|
|
45
|
-
// /*------------------------------------------------------------------------*/
|
|
46
|
-
|
|
47
|
-
// const invalidUrls: string[] = [
|
|
48
|
-
// '',
|
|
49
|
-
// ' ',
|
|
50
|
-
// 'example',
|
|
51
|
-
// 'http://',
|
|
52
|
-
// 'http://.',
|
|
53
|
-
// 'http://..',
|
|
54
|
-
// 'http://##/',
|
|
55
|
-
// 'http://../',
|
|
56
|
-
// 'http://??/',
|
|
57
|
-
// 'http://#',
|
|
58
|
-
// 'http://##',
|
|
59
|
-
// '//',
|
|
60
|
-
// '//a',
|
|
61
|
-
// '///a',
|
|
62
|
-
// '///',
|
|
63
|
-
// 'http:///a',
|
|
64
|
-
// 'http://www.foo.bar./',
|
|
65
|
-
// 'http://foo.bar/foo(bar)baz quux',
|
|
66
|
-
// 'http://3628126748',
|
|
67
|
-
// 'http://.www.foo.bar/',
|
|
68
|
-
// 'http://.www.foo.bar./',
|
|
69
|
-
// 'http://123.123.123',
|
|
70
|
-
// 'http://1.1.1.1.1',
|
|
71
|
-
// 'http://example.com:99999',
|
|
72
|
-
// 'http://example.com:80:80',
|
|
73
|
-
// 'http://example.com::80',
|
|
74
|
-
// 'http://example.com:-80',
|
|
75
|
-
// 'http://-example.com',
|
|
76
|
-
// 'http://example.com-',
|
|
77
|
-
// 'http://example.com_',
|
|
78
|
-
// 'http://example..com',
|
|
79
|
-
// 'http://example.com.',
|
|
80
|
-
// 'http://.example.com'
|
|
81
|
-
// ];
|
|
82
|
-
|
|
83
|
-
// test(
|
|
84
|
-
// 'Returns false for a given invalid URL.',
|
|
85
|
-
// async () => {
|
|
86
|
-
// invalidUrls.forEach((url) => {
|
|
87
|
-
// expect(isValid(url)).toBe(false);
|
|
88
|
-
// });
|
|
89
|
-
// },
|
|
90
|
-
// );
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This function checks if a given input string is a valid URL.
|
|
3
|
-
* @author Leisha Bhandari
|
|
4
|
-
* @param URL: The input string that needs checked as a URL or not.
|
|
5
|
-
* @returns A true boolean value if the input string is a valid URL, and a false
|
|
6
|
-
* boolean value if the input string is a invalid URL
|
|
7
|
-
*/
|
|
8
|
-
function isValid(url: string): boolean {
|
|
9
|
-
// Uses the input URL to create a URL object
|
|
10
|
-
try {
|
|
11
|
-
new URL(url);
|
|
12
|
-
// URL constructor does not throw an error, so input URL is valid
|
|
13
|
-
return true;
|
|
14
|
-
} catch (err) {
|
|
15
|
-
// URL constructor throws an error, so input URL is invalid
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
}
|