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

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 (37) hide show
  1. package/.github/workflows/npm-publish.yml +37 -15
  2. package/core/components/extra-info/extra-info-details.js +109 -126
  3. package/core/components/landing-api/landing-api.js +22 -30
  4. package/core/lib/Store.js +20 -18
  5. package/core/lib/components/index.js +4 -1
  6. package/core/lib/components/sidemenu/sidemenu.js +153 -256
  7. package/core/lib/components/sidemenu/sidemenu.scss +39 -26
  8. package/core/lib/elements/basic/dragabble-wrapper/draggable-wrapper.js +119 -42
  9. package/core/lib/elements/basic/rangepicker/rangepicker.js +118 -29
  10. package/core/lib/elements/basic/switch/switch.js +35 -25
  11. package/core/lib/hooks/index.js +2 -12
  12. package/core/lib/hooks/use-otp-timer.js +99 -0
  13. package/core/lib/pages/login/login.js +255 -139
  14. package/core/lib/pages/login/login.scss +140 -32
  15. package/core/models/dashboard/dashboard.js +14 -0
  16. package/core/models/doctor/components/doctor-add/doctor-add.js +403 -0
  17. package/core/models/doctor/components/doctor-add/doctor-add.scss +32 -0
  18. package/core/models/menus/components/menu-add/menu-add.js +220 -267
  19. package/core/models/menus/components/menu-lists/menu-lists.js +366 -211
  20. package/core/models/menus/components/menu-lists/menu-lists.scss +6 -2
  21. package/core/models/menus/menus.js +256 -267
  22. package/core/models/roles/components/role-add/role-add.js +265 -228
  23. package/core/models/roles/components/role-list/role-list.js +326 -348
  24. package/core/models/roles/roles.js +191 -174
  25. package/core/models/staff/components/staff-add/staff-add.js +352 -0
  26. package/core/models/staff/components/staff-add/staff-add.scss +0 -0
  27. package/core/models/users/components/user-add/user-add.js +723 -367
  28. package/core/models/users/components/user-add/user-edit.js +90 -0
  29. package/core/models/users/users.js +318 -165
  30. package/core/modules/index.js +5 -8
  31. package/core/modules/reporting/components/index.js +5 -0
  32. package/core/modules/reporting/components/reporting-dashboard/reporting-dashboard.js +65 -2
  33. package/core/modules/steps/action-buttons.js +79 -0
  34. package/core/modules/steps/steps.js +553 -0
  35. package/core/modules/steps/steps.scss +158 -0
  36. package/core/modules/steps/timeline.js +49 -0
  37. 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,263 @@ 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
+ setLoading(true);
169
111
 
170
- // callback();
171
- message.success('Menu Added');
172
-
173
- setLoading(false);
174
-
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'>
112
+ let id = formContent.id;
192
113
 
114
+ // ✅ ONLY set step if it's NOT already provided
115
+ if (!values.step) {
116
+ values.step = formContent.step || step;
117
+ }
193
118
 
194
- {/* Caption */}
195
- <Form.Item name={"caption"} label="Caption" required>
196
- <Input placeholder="Enter caption" />
197
- </Form.Item>
198
- {/* Caption Ends */}
119
+ if (values.attributes && typeof values === 'object') {
120
+ values = {
121
+ ...values,
122
+ attributes: JSON.stringify(values.attributes),
123
+ };
124
+ }
199
125
 
200
- {/* Name */}
201
- <Form.Item name={"name"} label="Name" required>
202
- <Input placeholder="Enter name" />
203
- </Form.Item>
204
- {/* Name Ends */}
126
+ if (id) {
127
+ model.update({ id, values }).then(() => {
128
+ message.success('Menu Updated');
129
+ setLoading(false);
130
+ callback();
131
+ });
132
+ } else {
133
+ additional_queries.forEach(({ field, value }) => {
134
+ values[field] = value;
135
+ });
205
136
 
206
- {/* Description */}
207
- <Form.Item name={"description"} label="Description">
137
+ model.add({ values }).then(() => {
138
+ message.success('Menu Added');
139
+ setLoading(false);
140
+ callback();
141
+ });
142
+ }
143
+ };
144
+
145
+ return (
146
+ <section className="collection-add menu-add">
147
+ {/* <Title level={4}>{mode} Menu</Title> */}
148
+
149
+ {loading ? (
150
+ <Skeleton />
151
+ ) : (
152
+ <Form initialValues={{ ...body }} form={form} layout="vertical" onFinish={onSubmit}>
153
+ <div className="form-container">
154
+ <div className="left-container">
155
+ {/* Caption */}
156
+ <Form.Item name={'caption'} label="Caption" rules={[{ required: true, message: 'Caption is required' }]}>
157
+ <Input placeholder="Enter caption" />
158
+ </Form.Item>
159
+ {/* Caption Ends */}
160
+
161
+ {/* Name */}
162
+ <Form.Item name={'name'} label="Name" rules={[{ required: true, message: 'Name is required' }]}>
163
+ <Input placeholder="Enter name" />
164
+ </Form.Item>
165
+ {/* Name Ends */}
166
+
167
+ {/* Description */}
168
+ {/* <Form.Item name={"description"} label="Description">
208
169
  <TextArea placeholder="Enter Description" />
209
- </Form.Item>
210
- {/* Description Ends */}
211
-
212
- {/* Model */}
213
- <Form.Item label="Models" name={'model_id'}>
214
-
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>
224
-
225
- </Form.Item>
226
- {/* Model Ends
170
+ </Form.Item> */}
171
+ {/* Description Ends */}
172
+
173
+ {/* Model */}
174
+ <Form.Item label="Models" name={'model_id'}>
175
+ {/* <ReferenceSelect value={model.id} label={model.name} model={Models} /> */}
176
+ <Select showSearch style={{ width: '100%' }} placeholder="Select a Page" optionFilterProp="label">
177
+ {models.map((model, key) => (
178
+ <Option key={key} label={model.name} value={model.id}>
179
+ {model.name}
180
+ </Option>
181
+ ))}
182
+ </Select>
183
+ </Form.Item>
184
+ {/* Model Ends
227
185
 
228
186
 
229
187
  {/* 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>
188
+ <Form.Item label="Pages" name={'page_id'}>
189
+ {/* <ReferenceSelect value={pages.id} label={pages.name} model={Pages} /> */}
190
+
191
+ <Select showSearch optionFilterProp="children" style={{ width: '100%' }}>
192
+ {pages.map((model, key) => (
193
+ <Option key={key} value={model.id}>
194
+ {model.name}
195
+ </Option>
196
+ ))}
197
+ </Select>
198
+ </Form.Item>
199
+ {/* Pages Ends */}
200
+
201
+ {/* Pages */}
202
+ <Form.Item label="Header" name={'header_id'}>
203
+ {/* <ReferenceSelect value={pages.id} label={pages.name} model={Pages} /> */}
204
+
205
+ <Select
206
+ showSearch
207
+ style={{ width: '100%' }}
208
+ placeholder="Select header"
209
+ optionFilterProp="children"
210
+ filterOption={(input, option) => option.children.toLowerCase().includes(input.toLowerCase())}
211
+ >
212
+ {menus.map((menu) => (
213
+ <Option key={menu.id} value={menu.id}>
214
+ {menu.name}
215
+ </Option>
216
+ ))}
217
+ </Select>
218
+ </Form.Item>
219
+ {/* Pages Ends */}
220
+
221
+ {/* Path */}
222
+ {/* <Form.Item name="path" label="Path" required>
262
223
  <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 */}
224
+ </Form.Item> */}
225
+ {/* Path Ends */}
283
226
 
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 */}
227
+ {/* Route */}
228
+ <Form.Item name="route" label="Route" rules={[{ required: true, message: 'Route is required' }]}>
229
+ <Input placeholder="Enter route" />
230
+ </Form.Item>
231
+ {/* Route Ends */}
289
232
 
290
- {/* Step */}
291
- <Form.Item name={"step"} label="Step" required>
292
- <InputNumber placeholder="Enter step" />
293
- </Form.Item>
294
- {/* Step Ends */}
233
+ {/* Switch */}
234
+ <Form.Item name="is_visible" label="Visible" valuePropName="checked" rules={[{ required: true, message: 'Visibility is required' }]}>
235
+ <Switch />
236
+ </Form.Item>
295
237
 
238
+ {/* Switch Ends */}
296
239
 
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
- );
240
+ {/* Step */}
241
+ {/* <Form.Item name={"order"} label="Order" required>
242
+ <InputNumber placeholder="Enter order" />
243
+ </Form.Item> */}
244
+ {/* Step Ends */}
245
+
246
+ {/* Icon Name*/}
247
+ <Form.Item name="icon_name" label="Icon Name" rules={[{ required: true, message: 'Icon name is required' }]}>
248
+ <Input placeholder="Enter icon name" />
249
+ </Form.Item>
250
+ {/* Icon Name Ends */}
251
+
252
+ {/* Step */}
253
+ <Form.Item name={'step'} label="Step" rules={[{ required: true, message: 'Step is required' }]}>
254
+ <InputNumber placeholder="Enter step" />
255
+ </Form.Item>
256
+ {/* Step Ends */}
257
+
258
+ <Form.Item>
259
+ <Button loading={loading} htmlType={'submit'} type="primary">
260
+ Submit
261
+ </Button>
262
+ </Form.Item>
263
+ </div>
264
+ <div className="right-container">
265
+ {/* Description */}
266
+ <Form.Item name={'attributes'} label="Attributes">
267
+ <JSONInput />
268
+ </Form.Item>
269
+ {/* Description Ends */}
270
+ </div>
271
+ </div>
272
+ </Form>
273
+ )}
274
+ </section>
275
+ );
323
276
  };
324
277
 
325
278
  export default MenuAdd;