@visns-studio/visns-components 4.7.0 → 4.7.2

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 (110) hide show
  1. package/dist/104e5636d8ddb791614c.woff2 +0 -0
  2. package/dist/11fe6a83d647de5daf95.woff +0 -0
  3. package/dist/141e2a8c7836495afe2a.woff +0 -0
  4. package/dist/2ba5877f7079830b5383.woff +0 -0
  5. package/dist/2d6836f45b2037be41f3.woff +0 -0
  6. package/dist/399.0a0f3e0d21be1057d599.css +8 -0
  7. package/dist/399.b8f57fa3f8c0c10119e4.js +1 -0
  8. package/dist/47d566c3b1293dfd9d77.woff +0 -0
  9. package/dist/6282a13cbba671a71913.woff2 +0 -0
  10. package/dist/78266f551031aa9db127.woff +0 -0
  11. package/dist/7b7da89f1e3fdcbfe36c.woff2 +0 -0
  12. package/dist/7e78e8338af7efeda712.woff2 +0 -0
  13. package/dist/7fa387951673abf164b1.woff2 +0 -0
  14. package/dist/819d59862c2d0640aad8.woff +0 -0
  15. package/dist/b615e1a6c838ea059a56.woff +0 -0
  16. package/dist/b9b1aa739c660c4ce67c.woff2 +0 -0
  17. package/dist/c5f3640b11df9414facb.woff +0 -0
  18. package/dist/da26d162ff5af71d6590.woff2 +0 -0
  19. package/dist/dd5b2912dbf896310865.woff2 +0 -0
  20. package/dist/f282b331272463c1aa6c.woff2 +0 -0
  21. package/dist/index.css +2902 -0
  22. package/dist/index.js +2 -0
  23. package/dist/index.js.LICENSE.txt +150 -0
  24. package/dist/main.83b033670d64419bb497.css +1 -0
  25. package/dist/main.b1723d17cd2d3513ab62.js +1 -0
  26. package/dist/report.html +39 -0
  27. package/dist/runtime.33c276593b23f8035b8d.js +1 -0
  28. package/package.json +26 -6
  29. package/.idea/codeStyles/Project.xml +0 -50
  30. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  31. package/.idea/deployment.xml +0 -4
  32. package/.idea/modules.xml +0 -8
  33. package/.idea/php.xml +0 -19
  34. package/.idea/vcs.xml +0 -6
  35. package/.idea/visns-components.iml +0 -8
  36. package/.prettierrc.json +0 -7
  37. package/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +0 -541
  38. package/.yarn/releases/yarn-3.6.1.cjs +0 -874
  39. package/.yarnrc.yml +0 -7
  40. package/components/cms/DataGrid.jsx +0 -1461
  41. package/components/cms/DropZone.jsx +0 -349
  42. package/components/cms/Field.jsx +0 -802
  43. package/components/cms/Form.jsx +0 -476
  44. package/components/cms/generic/CmsDetail.jsx +0 -36
  45. package/components/cms/generic/CmsIndex.jsx +0 -73
  46. package/components/cms/generic/CmsSort.jsx +0 -125
  47. package/components/cms/sorting/Item.jsx +0 -115
  48. package/components/cms/sorting/List.jsx +0 -30
  49. package/components/crm/AsyncSelect.jsx +0 -125
  50. package/components/crm/Autocomplete.jsx +0 -174
  51. package/components/crm/Breadcrumb.jsx +0 -52
  52. package/components/crm/Call.jsx +0 -220
  53. package/components/crm/DataGrid.jsx +0 -2701
  54. package/components/crm/Download.jsx +0 -101
  55. package/components/crm/Fetch.jsx +0 -119
  56. package/components/crm/Field.jsx +0 -1557
  57. package/components/crm/Form.jsx +0 -1409
  58. package/components/crm/Loader.jsx +0 -29
  59. package/components/crm/MultiSelect.jsx +0 -78
  60. package/components/crm/Navigation.jsx +0 -619
  61. package/components/crm/Notification.jsx +0 -197
  62. package/components/crm/QrCode.jsx +0 -83
  63. package/components/crm/Select.jsx +0 -58
  64. package/components/crm/SelectList.jsx +0 -21
  65. package/components/crm/TableFilter.jsx +0 -198
  66. package/components/crm/auth/Login.jsx +0 -223
  67. package/components/crm/auth/Profile.jsx +0 -280
  68. package/components/crm/auth/Reset.jsx +0 -111
  69. package/components/crm/auth/Verify.jsx +0 -174
  70. package/components/crm/auth/styles/Login.module.css +0 -243
  71. package/components/crm/auth/styles/Profile.module.css +0 -222
  72. package/components/crm/auth/styles/Reset.module.css +0 -216
  73. package/components/crm/auth/styles/Verify.module.css +0 -216
  74. package/components/crm/generic/AuditLog.jsx +0 -108
  75. package/components/crm/generic/AuditLogs.jsx +0 -115
  76. package/components/crm/generic/GenericAuth.jsx +0 -166
  77. package/components/crm/generic/GenericDashboard.jsx +0 -42
  78. package/components/crm/generic/GenericDetail.jsx +0 -1499
  79. package/components/crm/generic/GenericDynamic.jsx +0 -915
  80. package/components/crm/generic/GenericFormBuilder.jsx +0 -1765
  81. package/components/crm/generic/GenericIndex.jsx +0 -376
  82. package/components/crm/generic/GenericMain.jsx +0 -129
  83. package/components/crm/generic/GenericSort.jsx +0 -188
  84. package/components/crm/generic/NotificationList.jsx +0 -64
  85. package/components/crm/generic/styles/AuditLog.module.css +0 -147
  86. package/components/crm/generic/styles/AuditLogs.module.css +0 -92
  87. package/components/crm/generic/styles/GenericDetail.module.css +0 -634
  88. package/components/crm/generic/styles/GenericDynamic.module.css +0 -932
  89. package/components/crm/generic/styles/GenericFormBuilder.module.css +0 -944
  90. package/components/crm/generic/styles/GenericIndex.module.css +0 -247
  91. package/components/crm/generic/styles/GenericMain.module.css +0 -91
  92. package/components/crm/generic/styles/GenericSort.module.css +0 -123
  93. package/components/crm/generic/styles/NotificationList.module.css +0 -67
  94. package/components/crm/sorting/Item.jsx +0 -117
  95. package/components/crm/sorting/List.jsx +0 -32
  96. package/components/crm/sorting/styles/Item.module.css +0 -68
  97. package/components/crm/sorting/styles/List.module.css +0 -68
  98. package/components/crm/styles/AsyncSelect.module.css +0 -8
  99. package/components/crm/styles/Autocomplete.module.css +0 -44
  100. package/components/crm/styles/DataGrid.module.css +0 -210
  101. package/components/crm/styles/Field.module.css +0 -311
  102. package/components/crm/styles/Form.module.css +0 -499
  103. package/components/crm/styles/Loader.module.css +0 -94
  104. package/components/crm/styles/MultiSelect.module.css +0 -8
  105. package/components/crm/styles/Navigation.module.css +0 -978
  106. package/components/crm/styles/Notification.module.css +0 -147
  107. package/components/crm/styles/QrCode.module.css +0 -87
  108. package/components/crm/styles/TableFilter.module.css +0 -52
  109. package/components/styles/global.css +0 -73
  110. package/index.js +0 -86
@@ -1,223 +0,0 @@
1
- import '../../styles/global.css';
2
-
3
- import React, { useEffect, useState } from 'react';
4
- import { Link, useLocation } from 'react-router-dom';
5
- import Reveal from 'react-reveal/Reveal';
6
- import { toast } from 'react-toastify';
7
- import { Person, LockOff } from 'akar-icons';
8
-
9
- import CustomFetch from '../Fetch';
10
-
11
- import styles from './styles/Login.module.css';
12
-
13
- const Login = ({ logo, providers, setSystemAuth, setUserProfile }) => {
14
- const location = useLocation();
15
-
16
- const [auth, setAuth] = useState({
17
- email: '',
18
- password: '',
19
- location: location,
20
- });
21
-
22
- const [authClass, setAuthClass] = useState({
23
- username: '',
24
- password: '',
25
- });
26
-
27
- const renderSsoButton = () => {
28
- let content =
29
- providers && providers.length > 0 ? (
30
- <div className="formItem fwItem lastItem forgotten">
31
- <span>OR</span>
32
- </div>
33
- ) : null;
34
-
35
- if (providers) {
36
- providers.forEach((provider) => {
37
- switch (provider) {
38
- case 'azure':
39
- content = (
40
- <>
41
- {content}
42
- <div
43
- className={`${styles.formItem} ${styles.fwItem} ${styles.lastItem} ${styles.forgotten}`}
44
- >
45
- <button
46
- className={styles.btn}
47
- onClick={(e) => {
48
- e.preventDefault();
49
-
50
- window.location.href =
51
- '/auth/azure';
52
- }}
53
- >
54
- <img
55
- src={
56
- 'https://d16lktya8ojp5z.cloudfront.net/generic/images/microsoft.png'
57
- }
58
- width="13px"
59
- height="13px"
60
- />{' '}
61
- Microsoft
62
- </button>
63
- </div>
64
- </>
65
- );
66
- break;
67
- }
68
- });
69
- }
70
-
71
- return content;
72
- };
73
-
74
- const handleChange = (e) => {
75
- if (e) {
76
- setAuth((prevState) => ({
77
- ...prevState,
78
- [e.target.name]: e.target.value,
79
- }));
80
- }
81
- };
82
-
83
- const handleSubmit = (e) => {
84
- if (e) {
85
- e.preventDefault();
86
-
87
- CustomFetch(
88
- '/login/authenticate',
89
- 'POST',
90
- {
91
- ...auth,
92
- location:
93
- location.state && location.state.previousUrl
94
- ? location.state.previousUrl
95
- : '',
96
- },
97
- (result) => {
98
- if (result.error === '') {
99
- setUserProfile(result.user);
100
-
101
- if (result.previous && result.previous !== '') {
102
- window.location.href = result.previous;
103
- } else {
104
- setSystemAuth(true);
105
- }
106
- } else {
107
- setSystemAuth(false);
108
- setAuthClass((prevState) => ({
109
- ...prevState,
110
- username: 'inputError',
111
- password: 'inputError',
112
- }));
113
-
114
- toast.error(
115
- 'Could not log in with the supplied credentials, please try again.'
116
- );
117
- }
118
- },
119
- (error) => {
120
- setAuthClass((prevState) => ({
121
- ...prevState,
122
- username: 'inputError',
123
- password: 'inputError',
124
- }));
125
-
126
- if (String(error) === 'CSRF token mismatch.') {
127
- toast.error(
128
- 'Auth token has timed out, please reload the page before attempting to log back in.'
129
- );
130
- } else {
131
- toast.error(String(error));
132
- }
133
- }
134
- );
135
- }
136
- };
137
-
138
- return (
139
- <div className={styles.lcontainer}>
140
- <div className={styles.lwrap}>
141
- <div className={styles.logincontainer}>
142
- <form onSubmit={handleSubmit}>
143
- <Reveal effect="fadeInUp">
144
- <div className={styles.login}>
145
- <img
146
- src={logo}
147
- alt="CRM"
148
- className={styles.loginlogo}
149
- />
150
- <div
151
- className={`${styles.formItem} ${styles.fwItem}`}
152
- >
153
- <label className={styles.fi__label}>
154
- <input
155
- type="text"
156
- name="email"
157
- value={auth.email}
158
- onChange={handleChange}
159
- tabIndex="1"
160
- className={authClass.username}
161
- placeholder=" "
162
- />
163
- <span className={styles.fi__span}>
164
- Email
165
- </span>
166
- <small>
167
- <Person strokeWidth={2} size={18} />
168
- </small>
169
- </label>
170
- </div>
171
- <div
172
- className={`${styles.formItem} ${styles.fwItem}`}
173
- >
174
- <label className={styles.fi__label}>
175
- <input
176
- type="password"
177
- name="password"
178
- value={auth.password}
179
- onChange={handleChange}
180
- tabIndex="2"
181
- className={authClass.password}
182
- placeholder=" "
183
- />
184
- <span className={styles.fi__span}>
185
- Password
186
- </span>
187
- <small>
188
- <LockOff
189
- strokeWidth={2}
190
- size={18}
191
- />
192
- </small>
193
- </label>
194
- </div>
195
- <div
196
- className={`${styles.formItem} ${styles.fwItem} ${styles.lastItem}`}
197
- >
198
- <button
199
- className={styles.btn}
200
- type="submit"
201
- >
202
- Login
203
- </button>
204
- </div>
205
- <div
206
- className={`${styles.formItem} ${styles.fwItem} ${styles.lastItem} ${styles.forgotten}`}
207
- >
208
- <span>
209
- Forgot your password?{' '}
210
- <Link to="/reset">Click Here</Link>
211
- </span>
212
- </div>
213
- {renderSsoButton()}
214
- </div>
215
- </Reveal>
216
- </form>
217
- </div>
218
- </div>
219
- </div>
220
- );
221
- };
222
-
223
- export default Login;
@@ -1,280 +0,0 @@
1
- // src/components/Profile.jsx
2
- import '../../styles/global.css';
3
-
4
- import React, { useState, useEffect, useRef } from 'react';
5
- import PasswordStrengthBar from 'react-password-strength-bar';
6
- import { toast } from 'react-toastify';
7
- import SignaturePad from 'react-signature-pad-wrapper';
8
- import CustomFetch from '../Fetch';
9
- import TableFilter from '../TableFilter';
10
- import styles from './styles/Profile.module.css';
11
-
12
- const Profile = ({ userProfile, setUserProfile }) => {
13
- const signatureRef = useRef(null);
14
- const [profile, setProfile] = useState({
15
- name: '',
16
- email: '',
17
- password: '',
18
- password_confirmation: '',
19
- });
20
-
21
- const [inputClasses, setInputClasses] = useState({
22
- name: '',
23
- email: '',
24
- password: '',
25
- password_confirmation: '',
26
- });
27
-
28
- const [filters, setFilters] = useState([
29
- {
30
- id: 'overview',
31
- show: true,
32
- label: 'Overview',
33
- class: 'subactive',
34
- },
35
- ]);
36
-
37
- const handleClearSignature = (e) => {
38
- if (e) {
39
- e.preventDefault();
40
- signatureRef.current.clear();
41
- }
42
- };
43
-
44
- const handleChangeProfile = (e) => {
45
- const { name, value } = e.target;
46
- setProfile((prevProfile) => ({
47
- ...prevProfile,
48
- [name]: value,
49
- }));
50
- };
51
-
52
- const handleSubmitProfile = async (e) => {
53
- try {
54
- if (e) {
55
- e.preventDefault();
56
- }
57
-
58
- // Validate required fields
59
- if (profile.name.trim() === '' || profile.email.trim() === '') {
60
- setInputClasses({
61
- name: profile.name.trim() === '' ? styles.inputError : '',
62
- email: profile.email.trim() === '' ? styles.inputError : '',
63
- });
64
-
65
- toast.error('Please fill in all the required fields.');
66
- return;
67
- }
68
-
69
- // Validate password and confirmation
70
- if (
71
- profile.password &&
72
- profile.password !== profile.password_confirmation
73
- ) {
74
- setInputClasses({
75
- ...inputClasses,
76
- password: styles.inputError,
77
- password_confirmation: styles.inputError,
78
- });
79
-
80
- toast.error('Passwords do not match.');
81
- return;
82
- }
83
-
84
- // Create a new payload object
85
- let payload = {
86
- name: profile.name,
87
- email: profile.email,
88
- };
89
-
90
- // Conditionally add password to payload if it has a value
91
- if (profile.password.trim() !== '') {
92
- payload.password = profile.password;
93
- payload.password_confirmation = profile.password_confirmation;
94
- }
95
-
96
- payload.signature = signatureRef.current.toDataURL();
97
-
98
- const res = await CustomFetch(
99
- `/ajax/users/${userProfile.id}`,
100
- 'PUT',
101
- payload
102
- );
103
-
104
- setUserProfile((prevState) => ({
105
- ...prevState,
106
- name: res.data.user.name,
107
- signature: res.data.user.signature,
108
- }));
109
- toast.success('Your profile has been successfully updated.');
110
- } catch (err) {
111
- console.log(err);
112
- }
113
- };
114
-
115
- const renderContent = (filter) => {
116
- if (filter.show && filter.id === 'overview') {
117
- return (
118
- <div className={styles.gridtxt} key={filter.id}>
119
- <div className={styles.gridtxt__header}>
120
- <span>Overview</span>
121
- </div>
122
- <div className={styles.formcontainer}>
123
- <form
124
- className={styles.modalForm}
125
- onSubmit={handleSubmitProfile}
126
- >
127
- <div className={styles.formItem}>
128
- <label className={styles.fi__label}>
129
- <input
130
- type="text"
131
- name="name"
132
- onChange={handleChangeProfile}
133
- className={`${styles.input} ${inputClasses.name}`}
134
- value={profile.name}
135
- />
136
- <span className={styles.fi__span}>
137
- Name *
138
- </span>
139
- </label>
140
- </div>
141
- <div className={styles.formItem}>
142
- <label className={styles.fi__label}>
143
- <input
144
- type="text"
145
- name="email"
146
- readOnly
147
- className={`${styles.input} ${inputClasses.email}`}
148
- value={profile.email}
149
- />
150
- <span className={styles.fi__span}>
151
- Email *
152
- </span>
153
- </label>
154
- </div>
155
- <div className={styles.formItem}>
156
- <label className={styles.fi__label}>
157
- <span
158
- className={`${styles.fi__span} ${styles.prefocus}`}
159
- >
160
- Password
161
- </span>
162
- <input
163
- type="password"
164
- name="password"
165
- onChange={handleChangeProfile}
166
- value={profile.password}
167
- className={`${styles.input} ${inputClasses.password}`}
168
- />
169
- <PasswordStrengthBar
170
- password={profile.password}
171
- />
172
- </label>
173
- </div>
174
- <div className={styles.formItem}>
175
- <label className={styles.fi__label}>
176
- <span
177
- className={`${styles.fi__span} ${styles.prefocus}`}
178
- >
179
- Password Confirmation
180
- </span>
181
- <input
182
- type="password"
183
- name="password_confirmation"
184
- onChange={handleChangeProfile}
185
- value={profile.password_confirmation}
186
- className={`${styles.input} ${inputClasses.password_confirmation}`}
187
- />
188
- </label>
189
- </div>
190
- <div className={styles.formItem}>
191
- <label className={styles.fi__label}>
192
- <SignaturePad
193
- ref={signatureRef}
194
- height={200}
195
- options={{
196
- penColor: 'black',
197
- }}
198
- redrawOnResize
199
- canvasProps={{
200
- style: {
201
- border: '2px solid #ccc',
202
- borderRadius: '10px',
203
- padding: '10px',
204
- },
205
- className: styles.sigcanvas,
206
- }}
207
- />
208
- <span className={styles.fi__span}>
209
- Signature
210
- </span>
211
- </label>
212
- </div>
213
- </form>
214
- </div>
215
-
216
- <div className={styles.polActions}>
217
- <button
218
- className={styles.btn}
219
- onClick={handleSubmitProfile}
220
- >
221
- Save
222
- </button>
223
- <button
224
- className={styles.btn}
225
- onClick={handleClearSignature}
226
- >
227
- Clear
228
- </button>
229
- </div>
230
- </div>
231
- );
232
- }
233
- return null;
234
- };
235
-
236
- useEffect(() => {
237
- setProfile((prevState) => ({
238
- ...prevState,
239
- name: userProfile.name,
240
- email: userProfile.email,
241
- password: '',
242
- password_confirmation: '',
243
- }));
244
-
245
- if (userProfile.signature) {
246
- signatureRef.current.fromDataURL(userProfile.signature);
247
- }
248
- }, [userProfile]);
249
-
250
- return (
251
- <div>
252
- <div className={styles.grid}>
253
- <div className={styles.grid__row}>
254
- <div className={`${styles.grid__full} ${styles.crmtitle}`}>
255
- <h1>My Profile</h1>
256
- </div>
257
- </div>
258
- </div>
259
- <div className={styles.grid}>
260
- <div className={styles.grid__subrow}>
261
- <div className={styles.grid__subnav}>
262
- <TableFilter
263
- filters={filters}
264
- setFilters={setFilters}
265
- />
266
- </div>
267
- <div className={styles.grid__subcontent}>
268
- {filters.map((filter) => (
269
- <React.Fragment key={`filter-${filter.id}`}>
270
- {renderContent(filter)}
271
- </React.Fragment>
272
- ))}
273
- </div>
274
- </div>
275
- </div>
276
- </div>
277
- );
278
- };
279
-
280
- export default Profile;
@@ -1,111 +0,0 @@
1
- import '../../styles/global.css';
2
-
3
- import React, { useState } from 'react';
4
- import Reveal from 'react-reveal/Reveal';
5
- import { toast } from 'react-toastify';
6
- import parse from 'html-react-parser';
7
- import { Person } from 'akar-icons';
8
-
9
- import CustomFetch from '../Fetch';
10
-
11
- import styles from './styles/Reset.module.css';
12
-
13
- const Reset = ({ logo }) => {
14
- const [email, setEmail] = useState('');
15
- const [emailClass, setEmailClass] = useState('');
16
-
17
- const handleSubmit = (e) => {
18
- e.preventDefault();
19
-
20
- if (email === '') {
21
- const error = 'Please type in your email address.';
22
- setEmailClass('inputError');
23
- toast.error(<div>{parse(error)}</div>);
24
- return;
25
- }
26
-
27
- CustomFetch(
28
- '/password/forgot',
29
- 'POST',
30
- { email: email },
31
- function (result) {
32
- if (result.error === '') {
33
- setEmail('');
34
- toast.success(
35
- 'You have successfully requested to reset your password, an email will be sent shortly. Please follow the instruction on the email.'
36
- );
37
- } else {
38
- toast.error(result.error);
39
- }
40
- }
41
- );
42
- };
43
-
44
- return (
45
- <div className={styles.lcontainer}>
46
- <div className={styles.lwrap}>
47
- <aside
48
- className={styles.aside}
49
- style={{
50
- backgroundImage: `url(${loginBg})`,
51
- backgroundSize: 'cover',
52
- }}
53
- ></aside>
54
- <div className={styles.logincontainer}>
55
- <form onSubmit={handleSubmit}>
56
- <Reveal effect="fadeInUp">
57
- <div className={styles.login}>
58
- <img
59
- src={logo}
60
- alt="CRM"
61
- className={styles.loginlogo}
62
- />
63
- <div
64
- className={`${styles.formItem} ${styles.fwItem}`}
65
- >
66
- <h1>Forgot your password?</h1>
67
- </div>
68
- <div
69
- className={`${styles.formItem} ${styles.fwItem}`}
70
- >
71
- <label className={styles.fi__label}>
72
- <input
73
- type="email"
74
- name="email"
75
- value={email}
76
- onChange={(e) => {
77
- setEmail(e.target.value);
78
- setEmailClass('');
79
- }}
80
- tabIndex="1"
81
- className={emailClass}
82
- />
83
- <span className={styles.fi__span}>
84
- Email
85
- </span>
86
- <small>
87
- <Person strokeWidth={2} size={18} />
88
- </small>
89
- </label>
90
- </div>
91
- <div
92
- className={`${styles.formItem} ${styles.fwItem} ${styles.lastItem}`}
93
- >
94
- <button
95
- className={styles.btn}
96
- type="submit"
97
- tabIndex="2"
98
- >
99
- Reset Password
100
- </button>
101
- </div>
102
- </div>
103
- </Reveal>
104
- </form>
105
- </div>
106
- </div>
107
- </div>
108
- );
109
- };
110
-
111
- export default Reset;