ui-soxo-bootstrap-core 2.4.24 → 2.4.25-dev.6

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 (33) hide show
  1. package/.github/workflows/npm-publish.yml +37 -15
  2. package/README.md +260 -0
  3. package/core/components/extra-info/extra-info-details.js +109 -126
  4. package/core/components/landing-api/landing-api.js +22 -30
  5. package/core/lib/Store.js +20 -18
  6. package/core/lib/components/index.js +4 -1
  7. package/core/lib/components/sidemenu/sidemenu.js +153 -256
  8. package/core/lib/components/sidemenu/sidemenu.scss +39 -26
  9. package/core/lib/hooks/index.js +2 -12
  10. package/core/lib/hooks/use-otp-timer.js +99 -0
  11. package/core/lib/pages/login/login.js +255 -139
  12. package/core/lib/pages/login/login.scss +140 -32
  13. package/core/models/dashboard/dashboard.js +14 -0
  14. package/core/models/doctor/components/doctor-add/doctor-add.js +403 -0
  15. package/core/models/doctor/components/doctor-add/doctor-add.scss +32 -0
  16. package/core/models/menus/components/menu-add/menu-add.js +230 -268
  17. package/core/models/menus/components/menu-lists/menu-lists.js +126 -89
  18. package/core/models/menus/components/menu-lists/menu-lists.scss +9 -0
  19. package/core/models/menus/menus.js +247 -267
  20. package/core/models/roles/components/role-add/role-add.js +269 -227
  21. package/core/models/roles/components/role-list/role-list.js +8 -6
  22. package/core/models/roles/roles.js +182 -174
  23. package/core/models/users/components/user-add/user-add.js +619 -365
  24. package/core/models/users/components/user-add/user-edit.js +90 -0
  25. package/core/models/users/users.js +261 -165
  26. package/core/modules/index.js +5 -8
  27. package/core/modules/reporting/components/index.js +5 -0
  28. package/core/modules/reporting/components/reporting-dashboard/reporting-dashboard.js +65 -2
  29. package/core/modules/steps/action-buttons.js +79 -0
  30. package/core/modules/steps/steps.js +553 -0
  31. package/core/modules/steps/steps.scss +158 -0
  32. package/core/modules/steps/timeline.js +49 -0
  33. package/package.json +2 -2
@@ -0,0 +1,32 @@
1
+ .signature-method {
2
+ margin-bottom: 10px;
3
+ }
4
+ .signature-image {
5
+ border: 2px dashed #b4b5b7ff;
6
+ border-radius: 5px;
7
+ padding: 2px;
8
+ margin-bottom: 5px;
9
+ width: 500px;
10
+ }
11
+ .upload-container {
12
+ display: flex;
13
+ flex-direction: column;
14
+ justify-content: center;
15
+ align-items: center;
16
+ text-align: center;
17
+ gap: 12px; // optional spacing
18
+ width: 500px;
19
+ height: 200px;
20
+ border: 2px dashed #b4b5b7ff;
21
+ border-radius: 5px;
22
+ padding: 2px;
23
+ margin-bottom: 5px;
24
+ }
25
+ .signature-pad {
26
+ padding: 0 !important;
27
+ .sigCanvas {
28
+ width: 500px !important;
29
+ border: 2px dashed #b4b5b7ff !important;
30
+ border-radius: 5px !important;
31
+ }
32
+ }
@@ -16,310 +16,272 @@ const { Option } = Select;
16
16
 
17
17
  import './menu-add.scss';
18
18
 
19
-
20
19
  const MenuAdd = ({ model, callback, edit, history, formContent, match, additional_queries, ...props }) => {
21
-
22
- let mode = 'Add';
23
-
24
- if (formContent.id) {
25
- mode = 'Edit'
26
- } else if (formContent.copy) {
27
- mode = 'copy'
28
- }
29
-
30
- if (formContent.attributes) {
31
-
32
- if (typeof formContent.attributes === 'string') {
33
-
34
- if (formContent.attributes !== '') {
35
-
36
- formContent.attributes = JSON.parse(formContent.attributes);
37
-
38
- } else {
39
-
40
- formContent.attributes = {};
41
-
42
- }
43
- }
44
- } else {
45
- formContent.attributes = {}
20
+ let mode = 'Add';
21
+
22
+ if (formContent.id) {
23
+ mode = 'Edit';
24
+ } else if (formContent.copy) {
25
+ mode = 'copy';
26
+ }
27
+
28
+ if (formContent.attributes) {
29
+ if (typeof formContent.attributes === 'string') {
30
+ if (formContent.attributes !== '') {
31
+ formContent.attributes = JSON.parse(formContent.attributes);
32
+ } else {
33
+ formContent.attributes = {};
34
+ }
46
35
  }
36
+ } else {
37
+ formContent.attributes = {};
38
+ }
47
39
 
40
+ const [loading, setLoading] = useState(true);
48
41
 
49
- const [loading, setLoading] = useState(true);
50
-
51
- const [form] = Form.useForm();
52
-
53
- const [pages, setPages] = useState([]);
54
-
55
- const [models, setModels] = useState([]);
56
-
57
- const [menus, setMenus] = useState([])
58
-
59
- const [body, setBody] = useState(formContent);
60
-
61
- const { params } = match;
62
-
63
- let location = useLocation();
64
-
65
- const query = new URLSearchParams(location.search);
66
-
67
- console.log(query.get('step'));
68
-
69
- let step = parseInt(query.get('step')) || 1;
70
-
71
- console.log(step);
72
-
73
- useEffect(() => {
74
-
75
- // loadModelColumns();
76
- getPages();
77
-
78
- getModels();
79
-
80
- setLoading(false);
81
-
82
- getMenus();
83
-
84
- }, []);
85
-
86
-
87
- /**
88
- * Load the Staffs
89
- */
90
- const getPages = () => {
91
- PagesAPI.getPages().then((result) => {
92
-
93
- if (Array.isArray(result.result)) {
94
- setPages(result.result);
95
- }
96
- });
97
- };
98
-
99
- /**
100
- * Load the Models
101
- */
102
- const getModels = () => {
103
- ModelsAPI.get().then((result) => {
104
- // console.log(result);
105
-
106
- setModels(result.result);
107
- });
108
- };
109
-
42
+ const [form] = Form.useForm();
110
43
 
111
- /**
112
- * Load the Models
113
- */
114
- const getMenus = () => {
115
- MenusAPI.get().then((result) => {
116
- // console.log(result);
44
+ const [pages, setPages] = useState([]);
117
45
 
118
- setMenus(result.result);
119
- });
120
- };
46
+ const [models, setModels] = useState([]);
121
47
 
48
+ const [menus, setMenus] = useState([]);
122
49
 
123
- /**
124
- * Submit values
125
- */
126
- const onSubmit = (values) => {
127
- // console.log(values);
128
- setLoading(true);
50
+ const [body, setBody] = useState(formContent);
129
51
 
130
- let id = formContent.id;
52
+ const { params } = match;
131
53
 
132
- // Add the step to form content
133
- // values.step = step;
54
+ let location = useLocation();
134
55
 
135
- if (values.attributes && typeof values === 'object') {
56
+ const query = new URLSearchParams(location.search);
136
57
 
137
- values = {
138
- ...values,
139
- attributes: JSON.stringify(values.attributes)
140
- }
141
- }
58
+ let step = parseInt(query.get('step')) || 1;
142
59
 
143
- if (id) {
144
- // Update of model
145
- model.update({ id, values }).then(() => {
60
+ console.log(step);
146
61
 
147
- // callback();
148
- message.success('Menu Updated');
62
+ useEffect(() => {
63
+ // loadModelColumns();
64
+ getPages();
149
65
 
150
- setLoading(false);
66
+ getModels();
151
67
 
152
- callback();
68
+ setLoading(false);
153
69
 
154
- });
70
+ getMenus();
71
+ }, []);
155
72
 
156
- } else {
73
+ /**
74
+ * Load the Staffs
75
+ */
76
+ const getPages = () => {
77
+ PagesAPI.getPages().then((result) => {
78
+ if (Array.isArray(result.result)) {
79
+ setPages(result.result);
80
+ }
81
+ });
82
+ };
157
83
 
158
- values.step = step;
84
+ /**
85
+ * Load the Models
86
+ */
87
+ const getModels = () => {
88
+ ModelsAPI.get().then((result) => {
89
+ // console.log(result);
159
90
 
160
- // Append the additional queries to the object
161
- additional_queries.forEach(({ field, value }) => {
91
+ setModels(result.result);
92
+ });
93
+ };
162
94
 
163
- values[field] = value;
95
+ /**
96
+ * Load the Models
97
+ */
98
+ const getMenus = () => {
99
+ MenusAPI.get().then((result) => {
100
+ // console.log(result);
164
101
 
165
- })
102
+ setMenus(result.result);
103
+ });
104
+ };
166
105
 
167
- // add new model
168
- model.add({ values }).then(() => {
106
+ /**
107
+ * Submit values
108
+ */
109
+ const onSubmit = (values) => {
110
+ // console.log(values);
111
+ setLoading(true);
169
112
 
170
- // callback();
171
- message.success('Menu Added');
113
+ let id = formContent.id;
172
114
 
173
- setLoading(false);
115
+ // Add the step to form content
116
+ // values.step = step;
174
117
 
175
- callback();
176
-
177
- });
178
- }
179
- };
180
-
181
- return (
182
- <section className="collection-add menu-add">
183
- {/* <Title level={4}>{mode} Menu</Title> */}
184
-
185
- {loading ? (
186
- <Skeleton />
187
- ) : (
188
- <Form initialValues={{ ...body }} form={form} layout="vertical" onFinish={onSubmit}>
189
-
190
- <div className='form-container'>
191
- <div className='left-container'>
118
+ if (values.attributes && typeof values === 'object') {
119
+ values = {
120
+ ...values,
121
+ attributes: JSON.stringify(values.attributes),
122
+ };
123
+ }
192
124
 
125
+ if (id) {
126
+ // Update of model
127
+ model.update({ id, values }).then(() => {
128
+ // callback();
129
+ message.success('Menu Updated');
193
130
 
194
- {/* Caption */}
195
- <Form.Item name={"caption"} label="Caption" required>
196
- <Input placeholder="Enter caption" />
197
- </Form.Item>
198
- {/* Caption Ends */}
131
+ setLoading(false);
199
132
 
200
- {/* Name */}
201
- <Form.Item name={"name"} label="Name" required>
202
- <Input placeholder="Enter name" />
203
- </Form.Item>
204
- {/* Name Ends */}
133
+ callback();
134
+ });
135
+ } else {
136
+ values.step = step;
205
137
 
206
- {/* Description */}
207
- <Form.Item name={"description"} label="Description">
208
- <TextArea placeholder="Enter Description" />
209
- </Form.Item>
210
- {/* Description Ends */}
138
+ // Append the additional queries to the object
139
+ additional_queries.forEach(({ field, value }) => {
140
+ values[field] = value;
141
+ });
211
142
 
212
- {/* Model */}
213
- <Form.Item label="Models" name={'model_id'}>
143
+ // add new model
144
+ model.add({ values }).then(() => {
145
+ // callback();
146
+ message.success('Menu Added');
214
147
 
215
- {/* <ReferenceSelect value={model.id} label={model.name} model={Models} /> */}
216
- <Select showSearch style={{ width: '100%' }}
217
- placeholder="Select a Page"
218
- optionFilterProp="label"
219
- >
220
- {models.map((model, key) => (
221
- <Option key={key} label={model.name} value={model.id}>{model.name}</Option>
222
- ))}
223
- </Select>
148
+ setLoading(false);
224
149
 
225
- </Form.Item>
226
- {/* Model Ends
150
+ callback();
151
+ });
152
+ }
153
+ };
154
+
155
+ return (
156
+ <section className="collection-add menu-add">
157
+ <Title level={4}>{mode} Menu</Title>
158
+
159
+ {loading ? (
160
+ <Skeleton />
161
+ ) : (
162
+ <Form initialValues={{ ...body }} form={form} layout="vertical" onFinish={onSubmit}>
163
+ <div className="form-container">
164
+ <div className="left-container">
165
+ {/* Caption */}
166
+ <Form.Item name={'caption'} label="Caption" required>
167
+ <Input placeholder="Enter caption" />
168
+ </Form.Item>
169
+ {/* Caption Ends */}
170
+
171
+ {/* Name */}
172
+ <Form.Item name={'name'} label="Name" required>
173
+ <Input placeholder="Enter name" />
174
+ </Form.Item>
175
+ {/* Name Ends */}
176
+
177
+ {/* Description */}
178
+ <Form.Item name={'description'} label="Description">
179
+ <TextArea placeholder="Enter Description" />
180
+ </Form.Item>
181
+ {/* Description Ends */}
182
+
183
+ {/* Model */}
184
+ <Form.Item label="Models" name={'model_id'}>
185
+ {/* <ReferenceSelect value={model.id} label={model.name} model={Models} /> */}
186
+ <Select showSearch style={{ width: '100%' }} placeholder="Select a Page" optionFilterProp="label">
187
+ {models.map((model, key) => (
188
+ <Option key={key} label={model.name} value={model.id}>
189
+ {model.name}
190
+ </Option>
191
+ ))}
192
+ </Select>
193
+ </Form.Item>
194
+ {/* Model Ends
227
195
 
228
196
 
229
197
  {/* Pages */}
230
- <Form.Item label="Pages" name={'page_id'}>
231
-
232
- {/* <ReferenceSelect value={pages.id} label={pages.name} model={Pages} /> */}
233
-
234
- <Select showSearch optionFilterProp="children" style={{ width: '100%' }}>
235
- {pages.map((model, key) => (
236
- <Option key={key} value={model.id}>{model.name}</Option>
237
- ))}
238
- </Select>
239
-
240
- </Form.Item>
241
- {/* Pages Ends */}
242
-
243
-
244
-
245
- {/* Pages */}
246
- <Form.Item label="Header" name={'header_id'}>
247
-
248
- {/* <ReferenceSelect value={pages.id} label={pages.name} model={Pages} /> */}
249
-
250
- <Select showSearch style={{ width: '100%' }}>
251
- {menus.map((menu, key) => (
252
- <Option key={key} value={menu.id}>{menu.name}</Option>
253
- ))}
254
- </Select>
255
-
256
- </Form.Item>
257
- {/* Pages Ends */}
258
-
259
-
260
- {/* Path */}
261
- <Form.Item name="path" label="Path" required>
262
- <Input placeholder="Enter path" />
263
- </Form.Item>
264
- {/* Path Ends */}
265
-
266
- {/* Route */}
267
- <Form.Item name="route" label="Route" required>
268
- <Input placeholder="Enter route" />
269
- </Form.Item>
270
- {/* Route Ends */}
271
-
272
- {/* Switch */}
273
- <Form.Item name="is_visible" label="Visible" required>
274
- <Switch defaultChecked={body.is_visible} />
275
- </Form.Item>
276
- {/* Switch Ends */}
277
-
278
- {/* Step */}
279
- <Form.Item name={"order"} label="Order" required>
280
- <InputNumber placeholder="Enter order" />
281
- </Form.Item>
282
- {/* Step Ends */}
283
-
284
- {/* Icon Name*/}
285
- <Form.Item name="icon_name" label="Icon Name" required>
286
- <Input placeholder="Enter icon name" />
287
- </Form.Item>
288
- {/* Icon Name Ends */}
289
-
290
- {/* Step */}
291
- <Form.Item name={"step"} label="Step" required>
292
- <InputNumber placeholder="Enter step" />
293
- </Form.Item>
294
- {/* Step Ends */}
295
-
296
-
297
- <Form.Item>
298
- <Button loading={loading} htmlType={'submit'} type="primary">
299
- Submit
300
- </Button>
301
- </Form.Item>
302
-
303
- </div>
304
- <div className='right-container'>
305
-
306
-
307
- {/* Description */}
308
- <Form.Item name={"attributes"} label="Attributes">
309
-
310
- <JSONInput />
311
-
312
- </Form.Item>
313
- {/* Description Ends */}
314
-
315
- </div>
316
-
317
- </div>
318
-
319
- </Form>
320
- )}
321
- </section>
322
- );
198
+ <Form.Item label="Pages" name={'page_id'}>
199
+ {/* <ReferenceSelect value={pages.id} label={pages.name} model={Pages} /> */}
200
+
201
+ <Select showSearch optionFilterProp="children" style={{ width: '100%' }}>
202
+ {pages.map((model, key) => (
203
+ <Option key={key} value={model.id}>
204
+ {model.name}
205
+ </Option>
206
+ ))}
207
+ </Select>
208
+ </Form.Item>
209
+ {/* Pages Ends */}
210
+
211
+ {/* Pages */}
212
+ <Form.Item label="Header" name={'header_id'}>
213
+ {/* <ReferenceSelect value={pages.id} label={pages.name} model={Pages} /> */}
214
+
215
+ <Select
216
+ showSearch
217
+ style={{ width: '100%' }}
218
+ placeholder="Select header"
219
+ optionFilterProp="children"
220
+ filterOption={(input, option) => option.children.toLowerCase().includes(input.toLowerCase())}
221
+ >
222
+ {menus.map((menu) => (
223
+ <Option key={menu.id} value={menu.id}>
224
+ {menu.name}
225
+ </Option>
226
+ ))}
227
+ </Select>
228
+ </Form.Item>
229
+ {/* Pages Ends */}
230
+
231
+ {/* Path */}
232
+ <Form.Item name="path" label="Path" required>
233
+ <Input placeholder="Enter path" />
234
+ </Form.Item>
235
+ {/* Path Ends */}
236
+
237
+ {/* Route */}
238
+ <Form.Item name="route" label="Route" required>
239
+ <Input placeholder="Enter route" />
240
+ </Form.Item>
241
+ {/* Route Ends */}
242
+
243
+ {/* Switch */}
244
+ <Form.Item name="is_visible" label="Visible" required>
245
+ <Switch defaultChecked={body.is_visible} />
246
+ </Form.Item>
247
+ {/* Switch Ends */}
248
+
249
+ {/* Step */}
250
+ <Form.Item name={'order'} label="Order" required>
251
+ <InputNumber placeholder="Enter order" />
252
+ </Form.Item>
253
+ {/* Step Ends */}
254
+
255
+ {/* Icon Name*/}
256
+ <Form.Item name="icon_name" label="Icon Name" required>
257
+ <Input placeholder="Enter icon name" />
258
+ </Form.Item>
259
+ {/* Icon Name Ends */}
260
+
261
+ {/* Step */}
262
+ <Form.Item name={'step'} label="Step" required>
263
+ <InputNumber placeholder="Enter step" />
264
+ </Form.Item>
265
+ {/* Step Ends */}
266
+
267
+ <Form.Item>
268
+ <Button loading={loading} htmlType={'submit'} type="primary">
269
+ Submit
270
+ </Button>
271
+ </Form.Item>
272
+ </div>
273
+ <div className="right-container">
274
+ {/* Description */}
275
+ <Form.Item name={'attributes'} label="Attributes">
276
+ <JSONInput />
277
+ </Form.Item>
278
+ {/* Description Ends */}
279
+ </div>
280
+ </div>
281
+ </Form>
282
+ )}
283
+ </section>
284
+ );
323
285
  };
324
286
 
325
287
  export default MenuAdd;