@argusoft/medplat-app-shell 1.0.6 → 1.0.8

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 (264) hide show
  1. package/package.json +139 -141
  2. package/src/GlobalErrorBoundary.jsx +31 -0
  3. package/src/SilentErrorFallback.jsx +68 -0
  4. package/src/TrackingProviderWrapper.jsx +40 -0
  5. package/src/_tests_/__mocks__/MockTranslationProvider.jsx +21 -0
  6. package/src/_tests_/__mocks__/ckeditor.js +45 -0
  7. package/src/_tests_/__mocks__/fileMock.js +1 -0
  8. package/src/_tests_/__mocks__/useranalytics.js +5 -0
  9. package/src/_tests_/views/components/Dashboard/DashboardUI.test.jsx +137 -0
  10. package/src/_tests_/views/components/Dashboard/DashboardUIMock.js +877 -0
  11. package/src/_tests_/views/components/ForgotPassword/ForgotPassword.test.jsx +314 -0
  12. package/src/_tests_/views/components/LocationDirective/LocationDirective.test.jsx.disable +229 -0
  13. package/src/_tests_/views/components/LocationDirective/mockLocationDirective.js +810 -0
  14. package/src/_tests_/views/components/LocationType/MockLocationType.js +42259 -0
  15. package/src/_tests_/views/components/LocationType/addlocationtype.test.jsx.disable +276 -0
  16. package/src/_tests_/views/components/LocationType/editlocationtype.test.jsx.disable +262 -0
  17. package/src/_tests_/views/components/LocationType/locationtype.test.jsx.disable +148 -0
  18. package/src/_tests_/views/components/Profile/UpdateProfileModalData.js +4396 -0
  19. package/src/_tests_/views/components/Profile/updateprofilemodal.test.jsx +282 -0
  20. package/src/_tests_/views/components/SideBar/MockSideBar.js +1379 -0
  21. package/src/_tests_/views/components/SideBar/SideBar.test.jsx +98 -0
  22. package/src/_tests_/views/components/SystemConfig/ManageSystemConfig/AddManageSystemConfig.test.jsx.disable +164 -0
  23. package/src/_tests_/views/components/SystemConfig/ManageSystemConfig/UpdateManageSystemConfig.test.jsx.disable +157 -0
  24. package/src/_tests_/views/components/SystemConfig/MockSystemConfig.js +1280 -0
  25. package/src/_tests_/views/components/SystemConfig/SystemConfig.test.jsx.disable +165 -0
  26. package/src/_tests_/views/components/login/Login.test.jsx +276 -0
  27. package/src/_tests_/views/components/login/MockAuthorise.js +2414 -0
  28. package/src/_tests_/views/components/login/ServiceResponse.js +595 -0
  29. package/src/_tests_/views/components/user/MockManageUser.js +7965 -0
  30. package/src/_tests_/views/components/user/manageuser.test.jsx.disable +989 -0
  31. package/src/_tests_/views/components/user/mockUsersData.js +582 -0
  32. package/src/assets/img/OASISLogin.png +0 -0
  33. package/src/assets/img/bahaarNew.png +0 -0
  34. package/src/assets/img/dnhdd4K.png +0 -0
  35. package/src/assets/img/govtofup.png +0 -0
  36. package/src/assets/img/sewarural4K.png +0 -0
  37. package/src/assets/img/techo4K.png +0 -0
  38. package/src/assets/img/up4K.png +0 -0
  39. package/src/common/HolidayList.jsx +573 -0
  40. package/src/common/MalaciaousInputUtil.js +23 -0
  41. package/src/common/SafeHtml.jsx +17 -0
  42. package/src/common/VersionManager.jsx +109 -0
  43. package/src/common/constants/PerformanceDashboard.js +514 -0
  44. package/src/common/constants/app.constant.js +781 -0
  45. package/src/common/constants/cccVerificationConstants.js +18 -0
  46. package/src/common/constants/fhsrConstant.js +33 -0
  47. package/src/common/constants/gvk-verification.constant.js +76 -0
  48. package/src/common/constants/search.constant.js +23 -0
  49. package/src/common/constants/teleconsulatationConstant.jsx +1339 -0
  50. package/src/common/directives/SearchTemplate.jsx +784 -0
  51. package/src/common/directives/SearchTemplate.scss +14 -0
  52. package/src/common/dynamicView/DynamicView.jsx +353 -0
  53. package/src/common/dynamicView/InputFieldComponent.jsx +1501 -0
  54. package/src/common/dynamicView/InputViewComponent.jsx +298 -0
  55. package/src/common/dynamicView/InputViewComponent.scss +15 -0
  56. package/src/common/env.js +5 -0
  57. package/src/common/filters/locationNameFilter.js +26 -0
  58. package/src/common/fontAwesomeIcons/FontAwesomeIcons.jsx +27 -0
  59. package/src/common/fontAwesomeIcons/FontAwesomeIconsNames.js +1968 -0
  60. package/src/common/fontPreferences/fontSizeProvider.jsx +34 -0
  61. package/src/common/fontPreferences/fontSizeSelector.jsx +116 -0
  62. package/src/common/getAssignedFeature/getAssignedFeature.js +32 -0
  63. package/src/common/interceptors/AxiosInterceptor.js +216 -0
  64. package/src/common/languageTranslator/TranslationContext.js +5 -0
  65. package/src/common/languageTranslator/TranslationProvider.jsx +24 -0
  66. package/src/common/languageTranslator/i18n.js +49 -0
  67. package/src/common/services/AuthenticateService.js +116 -0
  68. package/src/common/services/DownloadFile.js +35 -0
  69. package/src/common/services/ForgotPassword.js +18 -0
  70. package/src/common/services/FormConfiguratorService.js +195 -0
  71. package/src/common/services/GlobalApis.js +84 -0
  72. package/src/common/services/InterceptorNavigationService.js +17 -0
  73. package/src/common/services/LocationService.js +65 -0
  74. package/src/common/services/LocationType.js +11 -0
  75. package/src/common/services/QueryBuilder.js +36 -0
  76. package/src/common/services/Roles.js +28 -0
  77. package/src/common/services/SyncWithServer.js +15 -0
  78. package/src/common/services/SystemConfig.js +15 -0
  79. package/src/common/services/TranslationService.js +70 -0
  80. package/src/common/services/TwoFactorService.js +7 -0
  81. package/src/common/services/Users.js +91 -0
  82. package/src/common/services/Webtasks.js +27 -0
  83. package/src/common/services/util/Convert-pad-data-to-API-format.jsx +167 -0
  84. package/src/common/services/util/Convert-to-UI-format.jsx +82 -0
  85. package/src/common/services/util/EmptyPrescriptionPadData.jsx +11 -0
  86. package/src/common/services/util/GeneralUtil.js +456 -0
  87. package/src/common/services/util/Prescription-pad-util.js +339 -0
  88. package/src/common/services/util/PrescriptionPadData.js +67 -0
  89. package/src/common/services/util/PrescriptionpadCommonUtil.js +96 -0
  90. package/src/common/services/util/ReportFieldUtil.jsx +398 -0
  91. package/src/common/services/util/WebSocketContext.jsx +261 -0
  92. package/src/common/syncWithServer/SyncWithServerDialog.jsx +170 -0
  93. package/src/common/syncWithServer/SyncWithServerDialogSkeleton.jsx +67 -0
  94. package/src/common/tests/CustomWrapper.jsx +49 -0
  95. package/src/common/tests/TranslationWrapper.jsx +38 -0
  96. package/src/common/themeProvider/ColorInputs.jsx +97 -0
  97. package/src/common/themeProvider/EditableColorInput.jsx +128 -0
  98. package/src/common/themeProvider/ThemeEditor.jsx +319 -0
  99. package/src/common/themeProvider/ThemeProvider.jsx +210 -0
  100. package/src/common/themeProvider/themeConfig.js +558 -0
  101. package/src/common/toaster/toaster.jsx +30 -0
  102. package/src/firebaseConfig.js +24 -0
  103. package/src/global.scss +221 -0
  104. package/src/hooks/.gitkeep +0 -0
  105. package/src/hooks/useAESEncryption.js +56 -0
  106. package/src/hooks/useCaching.js +43 -0
  107. package/src/hooks/useDebounce.js +34 -0
  108. package/src/hooks/useDebounceFn.js +50 -0
  109. package/src/hooks/useDownloadPdf.js +358 -0
  110. package/src/hooks/useDownloadXlsx.js +55 -0
  111. package/src/hooks/useListValueFieldValues.js +30 -0
  112. package/src/hooks/useLocationHierarchies.js +63 -0
  113. package/src/hooks/useLocationHierarchyTranslate.js +16 -0
  114. package/src/hooks/useOnline.js +27 -0
  115. package/src/hooks/usePagination.js +63 -0
  116. package/src/hooks/useRefreshToken.js +87 -0
  117. package/src/hooks/useScript.js +25 -0
  118. package/src/hooks/useStopwatch.js +75 -0
  119. package/src/hooks/useTrackEvent.js +22 -0
  120. package/src/hooks/useWebAudioRecorder.js +115 -0
  121. package/src/layout/LoaderComponet.jsx +22 -0
  122. package/src/layout/LoaderContext.jsx +29 -0
  123. package/src/layout/mainLayout/AdaptiveZoom.jsx +27 -0
  124. package/src/layout/mainLayout/Chatbot.jsx +243 -0
  125. package/src/layout/mainLayout/Layout.jsx +445 -0
  126. package/src/layout/mainLayout/Profile/UpdateProfileModal.jsx +684 -0
  127. package/src/layout/mainLayout/header/LogoutModal.jsx +131 -0
  128. package/src/layout/mainLayout/header/Navbar.jsx +1677 -0
  129. package/src/layout/mainLayout/header/Navbar.scss +4 -0
  130. package/src/layout/mainLayout/header/index.js +0 -0
  131. package/src/layout/mainLayout/sidebar/SideBar.jsx +1402 -0
  132. package/src/layout/mainLayout/sidebar/Sidebar.css +159 -0
  133. package/src/layout/mainLayout/sidebar/index.js +0 -0
  134. package/src/logo.svg +1 -0
  135. package/src/reportWebVitals.js +13 -0
  136. package/src/setupFirebaseMessaging.js +28 -0
  137. package/src/setupTests.js +8 -0
  138. package/src/store/actions/AuthenticationActions.js +0 -0
  139. package/src/store/actions/ReportsActions.js +0 -0
  140. package/src/store/actions/TranslationAction.js +0 -0
  141. package/src/store/index.js +8 -0
  142. package/src/store/reducer.js +46 -0
  143. package/src/store/reducers/AuthenticationReducer.js +50 -0
  144. package/src/store/reducers/CalendarEventReducer.js +41 -0
  145. package/src/store/reducers/ConditionClipboardReducer.js +45 -0
  146. package/src/store/reducers/FeatureReducer.js +27 -0
  147. package/src/store/reducers/FormConfiguratorReducer.js +38 -0
  148. package/src/store/reducers/LoadingReducer.js +20 -0
  149. package/src/store/reducers/MembersAuthenticationReducer.js +28 -0
  150. package/src/store/reducers/PrescriptionPadReducer.js +329 -0
  151. package/src/store/reducers/QuestionaireReducer.js +29 -0
  152. package/src/store/reducers/ReportsReducer.js +24 -0
  153. package/src/store/reducers/SkeletonReducer.js +20 -0
  154. package/src/store/reducers/ThemeReducer.js +106 -0
  155. package/src/store/reducers/TranslationReducer.js +126 -0
  156. package/src/store/reducers/dashboardEditorSlice.js +77 -0
  157. package/src/store/reducers/districtHealthDashboardSlice.js +58 -0
  158. package/src/store/reducers/immunizationSlice.js +234 -0
  159. package/src/store/slices/dashboardPagesSlice.js +51 -0
  160. package/src/store/slices/dashboardSlice.js +14 -0
  161. package/src/utils/.gitkeep +0 -0
  162. package/src/utils/FormConstants.js +2629 -0
  163. package/src/utils/GujaratTopoChart.jsx +483 -0
  164. package/src/utils/UUIDgenerator.js +8 -0
  165. package/src/utils/appointment-utils/appointment-utils.js +123 -0
  166. package/src/utils/feature.js +42 -0
  167. package/src/utils/getThemeColor.js +12 -0
  168. package/src/utils/localStorageHelper.js +11 -0
  169. package/src/utils/notifications/enable-push-notifications.js +27 -0
  170. package/src/utils/resolveAppliedStyle.js +11 -0
  171. package/src/utils/themeConfigs.js +1483 -0
  172. package/src/views/custom-components/.gitkeep +0 -0
  173. package/src/views/custom-components/AgIconButton/RIf.jsx +14 -0
  174. package/src/views/custom-components/AgIconButton/button.jsx +108 -0
  175. package/src/views/custom-components/AgIconButton/waterDrop.jsx +95 -0
  176. package/src/views/custom-components/AgIconButton/waterDrop.scss +37 -0
  177. package/src/views/custom-components/AlertPlaceholder.jsx +32 -0
  178. package/src/views/custom-components/AllFaIconsSelector.jsx +56 -0
  179. package/src/views/custom-components/CkEditor/CkEditor.js +102 -0
  180. package/src/views/custom-components/CustomAccordion.jsx +72 -0
  181. package/src/views/custom-components/CustomActionIcons.jsx +118 -0
  182. package/src/views/custom-components/CustomAutoComplete.jsx +188 -0
  183. package/src/views/custom-components/CustomCheckBox.jsx +60 -0
  184. package/src/views/custom-components/CustomConfirmationModal.jsx +118 -0
  185. package/src/views/custom-components/CustomCountrySelect.jsx +129 -0
  186. package/src/views/custom-components/CustomDatePicker.jsx +122 -0
  187. package/src/views/custom-components/CustomDropdown.jsx +191 -0
  188. package/src/views/custom-components/CustomFileUpload.jsx +387 -0
  189. package/src/views/custom-components/CustomFullCalendar.jsx +514 -0
  190. package/src/views/custom-components/CustomInfiniteScroll.jsx +126 -0
  191. package/src/views/custom-components/CustomRadioComponent.jsx +65 -0
  192. package/src/views/custom-components/CustomStatsComponent.jsx +114 -0
  193. package/src/views/custom-components/CustomSvgUpload.jsx +170 -0
  194. package/src/views/custom-components/CustomSwitch.jsx +37 -0
  195. package/src/views/custom-components/CustomTabPanel.jsx +19 -0
  196. package/src/views/custom-components/CustomTextArea.jsx +62 -0
  197. package/src/views/custom-components/CustomTextArea.scss +27 -0
  198. package/src/views/custom-components/CustomTextField.jsx +116 -0
  199. package/src/views/custom-components/CustomToggleSwitch.jsx +138 -0
  200. package/src/views/custom-components/CustomTooltip.jsx +51 -0
  201. package/src/views/custom-components/CustomZoomImage.jsx +134 -0
  202. package/src/views/custom-components/CustomizedTable/CustomizedTableV2.jsx +1407 -0
  203. package/src/views/custom-components/CustomizedTable/VirtualizeTableBody.jsx +295 -0
  204. package/src/views/custom-components/CustomizedTable/helper.jsx +159 -0
  205. package/src/views/custom-components/CustomizedTable.jsx +532 -0
  206. package/src/views/custom-components/EditInputField.jsx +174 -0
  207. package/src/views/custom-components/FieldDescription.jsx +22 -0
  208. package/src/views/custom-components/FileDisplayComponent.jsx +138 -0
  209. package/src/views/custom-components/FormItem.jsx +53 -0
  210. package/src/views/custom-components/GenericChart.jsx +80 -0
  211. package/src/views/custom-components/InfoBadge.jsx +60 -0
  212. package/src/views/custom-components/PostgresEditor.jsx +801 -0
  213. package/src/views/custom-components/ResizableEditAutocompleteField.jsx +249 -0
  214. package/src/views/custom-components/ResizableEditInputField.jsx +215 -0
  215. package/src/views/custom-components/ResizeableEditSelectField.jsx +197 -0
  216. package/src/views/custom-components/SideOverlay.jsx +113 -0
  217. package/src/views/custom-components/SideOverlay.scss +42 -0
  218. package/src/views/custom-components/calendar.scss +571 -0
  219. package/src/views/feature-components/.gitkeep +0 -0
  220. package/src/views/feature-components/Dashboard/DashboardUI.jsx +1043 -0
  221. package/src/views/feature-components/Dashboard/DhnddModal/AshaDataQualityVerificationModal.jsx +278 -0
  222. package/src/views/feature-components/Dashboard/PinFeatureModal.jsx +143 -0
  223. package/src/views/feature-components/Dashboard/QuickLinks.jsx +163 -0
  224. package/src/views/feature-components/Dashboard/Taskbar.jsx +56 -0
  225. package/src/views/feature-components/Dashboard/WebtasksFilterForm.jsx +109 -0
  226. package/src/views/feature-components/Dashboard/WidgetCard.jsx +161 -0
  227. package/src/views/feature-components/Dashboard/actionModal.jsx +263 -0
  228. package/src/views/feature-components/Dashboard/ekavachModal/HealthWorkerIncorrectDetailsModal.jsx +332 -0
  229. package/src/views/feature-components/Dashboard/ekavachModal/MoMaternalDeathVerifcationModal.jsx +275 -0
  230. package/src/views/feature-components/Dashboard/ekavachModal/MoVerficationForChildScreeningMoadal.jsx +566 -0
  231. package/src/views/feature-components/FeatureUsageAnalytics/FeatureUsageAnalytics.jsx +989 -0
  232. package/src/views/feature-components/Features/NewServerManagement.jsx +217 -0
  233. package/src/views/feature-components/Features/ServerManagement.scss +120 -0
  234. package/src/views/feature-components/ForgotPassword/ForgotPassword.jsx +226 -0
  235. package/src/views/feature-components/LocationDirective/LocationDirective.jsx +992 -0
  236. package/src/views/feature-components/LocationDirective/LocationDirectiveV2.jsx +909 -0
  237. package/src/views/feature-components/NotFound.jsx +66 -0
  238. package/src/views/feature-components/Onboarding/Onboarding.jsx +1400 -0
  239. package/src/views/feature-components/Skeletons.js +115 -0
  240. package/src/views/feature-components/Unauthorized.jsx +48 -0
  241. package/src/views/feature-components/VerifyRoute.jsx +88 -0
  242. package/src/views/feature-components/YearlyRecap/YearlyRecap.jsx +357 -0
  243. package/src/views/feature-components/YearlyRecap/components/RecapSlide.jsx +183 -0
  244. package/src/views/feature-components/YearlyRecap/languageTranslator/TranslationContext.js +5 -0
  245. package/src/views/feature-components/YearlyRecap/languageTranslator/TranslationProvider.jsx +26 -0
  246. package/src/views/feature-components/YearlyRecap/languageTranslator/i18n.js +46 -0
  247. package/src/views/feature-components/YearlyRecap/languageTranslator/translations.json +167 -0
  248. package/src/views/feature-components/YearlyRecap/slides/IntroSlide.jsx +233 -0
  249. package/src/views/feature-components/YearlyRecap/slides/MaternalHealthSlide.jsx +146 -0
  250. package/src/views/feature-components/YearlyRecap/slides/MetricSlide.jsx +227 -0
  251. package/src/views/feature-components/YearlyRecap/slides/OutroSlide.jsx +701 -0
  252. package/src/views/feature-components/YearlyRecap/slides/ReachSlide.jsx +273 -0
  253. package/src/views/feature-components/login/Login.jsx +840 -0
  254. package/src/views/feature-components/login/Login.scss +154 -0
  255. package/src/views/feature-components/login/LoginConfigurator.jsx +1149 -0
  256. package/src/views/feature-components/login/TwoFactorSetupModal.jsx +411 -0
  257. package/src/views/feature-components/login/simplifyMenu.js +45 -0
  258. package/src/views/feature-components/system-config/ManageSystemConfigs.jsx +284 -0
  259. package/src/views/feature-components/system-config/SystemConfig.jsx +299 -0
  260. package/src/views/feature-components/users/ChangePasswordModal.jsx +243 -0
  261. package/src/views/feature-components/users/PasswordField.jsx +56 -0
  262. package/dist/index.css +0 -1
  263. package/dist/index.js +0 -32001
  264. package/dist/index.js.map +0 -1
File without changes
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ const RIf = ({ show, children }) => {
5
+ if (show) return <>{children}</>;
6
+ return null;
7
+ };
8
+
9
+ export default RIf;
10
+
11
+ RIf.propTypes = {
12
+ show: PropTypes.any,
13
+ children: PropTypes.any,
14
+ };
@@ -0,0 +1,108 @@
1
+ import React from 'react';
2
+ import RIf from './RIf';
3
+ import WaterDropWrapper from './waterDrop';
4
+ import { useTranslateProvider } from '@/common/languageTranslator/TranslationContext';
5
+ import PropTypes from 'prop-types';
6
+
7
+ /**
8
+ * A water-drop effect button component.
9
+ *
10
+ * @example
11
+ * <AgButton onClick={() => {}} label="Click me" className="btn-md-fill-primary" suffix={<i className="ri-arrow-right-line" />} prefix={<i className="ri-arrow-left-line" />} />
12
+ *
13
+ * @param {string} [className] - The class name to be applied to the button can be customized using the format "btn-1-2-3", where:
14
+
15
+ 1 can be sm, md, or lg (representing size),
16
+
17
+ 2 can be fill, outlined, text, or link (representing style), and
18
+
19
+ 3 can be primary, secondary, light, or error (representing theme)."
20
+
21
+ * @param {boolean} [disabled=false] - Whether the button is disabled or not.
22
+ * @param {function} onClick - Function to be called when the button is clicked.
23
+ * @param {string} label - The label of the button.
24
+ * @param {React.ReactNode} [suffix=null] - The suffix component to be rendered.
25
+ * @param {React.ReactNode} [prefix=null] - The prefix component to be rendered.
26
+ * @param {React.ReactNode} [children=null] - The children component to be rendered.
27
+ * @returns {React.ReactElement} The button component.
28
+ */
29
+
30
+ export function AgButton({ className, disabled, onClick, label, suffix, prefix, children, type }) {
31
+ const { translate } = useTranslateProvider();
32
+ return (
33
+ <WaterDropWrapper className={'rounded-md'} disabled={disabled} onClick={onClick}>
34
+ <button
35
+ className={`inline-flex items-center gap-x-1 ${className || 'btn-md-fill-primary'}`}
36
+ disabled={disabled}
37
+ type={type}
38
+ >
39
+ <RIf show={children}>{children}</RIf>
40
+ <RIf show={!children}>
41
+ {/* <div className="inline-flex items-center gap-x-1"> */}
42
+ <RIf show={prefix}>
43
+ <div className="start-adornment -ml-2">{prefix}</div>
44
+ </RIf>
45
+ <div className="text-label grow">
46
+ <span>{translate(label)}</span>
47
+ </div>
48
+ <RIf show={suffix}>
49
+ <div className="end-adornment">{suffix}</div>
50
+ </RIf>
51
+ {/* </div> */}
52
+ </RIf>
53
+ </button>
54
+ </WaterDropWrapper>
55
+ );
56
+ }
57
+
58
+ AgButton.propTypes = {
59
+ className: PropTypes.any,
60
+ onClick: PropTypes.any,
61
+ disabled: PropTypes.any,
62
+ label: PropTypes.any,
63
+ suffix: PropTypes.any,
64
+ prefix: PropTypes.any,
65
+ children: PropTypes.any,
66
+ type: PropTypes.any,
67
+ };
68
+
69
+ /**
70
+ * An icon button component with a water-drop effect.
71
+ *
72
+ * @param {string} [className] - The class name to be applied to the button can be customized using the format "icon-btn-1-2-3", where:
73
+
74
+ 1 can be sm, md, or lg (representing size),
75
+
76
+ 2 can be fill, outlined, text, or link (representing style), and
77
+
78
+ 3 can be primary, secondary, light, or error (representing theme)."
79
+ Note: If you want background to be transparent, use "bg-transparent"
80
+
81
+ * @param {boolean} [disabled=false] - Whether the button is disabled or not.
82
+ * @param {function} onClick - Function to be called when the button is clicked.
83
+ * @param {React.ReactNode} [icon=null] - The icon component to be rendered.
84
+ * @returns {React.ReactElement} The icon button component.
85
+ */
86
+ export function AgIconButton({ className, onClick, disabled, icon }) {
87
+ return (
88
+ <WaterDropWrapper disabled={disabled} onClick={onClick}>
89
+ <button
90
+ className={`${className || 'icon-btn-md-fill-primary'} ${disabled ? 'opacity-50 cursor-not-allowed' : ''}`}
91
+ disabled={disabled}
92
+ type="button"
93
+ >
94
+ <RIf show={icon}>{icon}</RIf>
95
+ <RIf show={!icon}>
96
+ <i className="ri-circle-line"></i>
97
+ </RIf>
98
+ </button>
99
+ </WaterDropWrapper>
100
+ );
101
+ }
102
+
103
+ AgIconButton.propTypes = {
104
+ className: PropTypes.any,
105
+ onClick: PropTypes.any,
106
+ disabled: PropTypes.any,
107
+ icon: PropTypes.any,
108
+ };
@@ -0,0 +1,95 @@
1
+ import React, { useState, useRef, useEffect } from "react";
2
+ import "./waterDrop.scss";
3
+ import PropTypes from "prop-types";
4
+
5
+ const WaterDropWrapper = ({ className = "", disabled, children, onClick }) => {
6
+ const wrapperRef = useRef(null);
7
+ const [isMouseDown, setIsMouseDown] = useState(false);
8
+ const [ripple, setRipple] = useState(null);
9
+ const [fadeOut, setFadeOut] = useState(false);
10
+
11
+ const handleMouseDown = (e) => {
12
+ if (disabled) return;
13
+
14
+ const rect = wrapperRef.current.getBoundingClientRect();
15
+ const x = e.clientX - rect.left;
16
+ const y = e.clientY - rect.top;
17
+
18
+ setRipple({ x, y, size: Math.max(rect.width * 2, rect.height * 2) });
19
+ setIsMouseDown(true);
20
+ setFadeOut(false);
21
+ };
22
+
23
+ const getIsMouseDown = () => isMouseDown;
24
+
25
+ const handleMouseUp = (e) => {
26
+ if (disabled) return;
27
+ setIsMouseDown(false);
28
+ setFadeOut(true);
29
+ if (onClick) {
30
+ onClick(e);
31
+ }
32
+ };
33
+
34
+ const handleMouseLeave = () => {
35
+ if (disabled) return;
36
+ setIsMouseDown(false);
37
+ setFadeOut(true);
38
+ };
39
+
40
+ useEffect(() => {
41
+ if (!ripple) return;
42
+
43
+ let timeoutId;
44
+
45
+ if (fadeOut) {
46
+ timeoutId = setTimeout(() => {
47
+ setRipple(null); // Remove ripple after fade-out
48
+ }, 300); // Match fade-out transition duration
49
+ } else {
50
+ timeoutId = setTimeout(() => {
51
+ if (getIsMouseDown()) return;
52
+ setRipple(null);
53
+ }, 500);
54
+ } // Adjust duration as needed
55
+
56
+ return () => clearTimeout(timeoutId);
57
+ }, [ripple, fadeOut]);
58
+
59
+ return (
60
+ <div
61
+ ref={wrapperRef}
62
+ className={`water-drop-wrapper ${className}`}
63
+ onMouseDown={handleMouseDown}
64
+ onMouseUp={handleMouseUp}
65
+ onMouseLeave={handleMouseLeave}
66
+ >
67
+ {!disabled && ripple && (
68
+ <span
69
+ className={`ripple ${fadeOut ? "fade-out" : ""}`}
70
+ style={{
71
+ left: ripple.x,
72
+ top: ripple.y,
73
+ width: ripple.size,
74
+ height: ripple.size,
75
+ }}
76
+ />
77
+ )}
78
+ {children}
79
+ </div>
80
+ );
81
+ };
82
+
83
+ export default WaterDropWrapper;
84
+
85
+
86
+ WaterDropWrapper.propTypes = {
87
+ className: PropTypes.any,
88
+ onClick: PropTypes.any,
89
+ disabled: PropTypes.any,
90
+ label: PropTypes.any,
91
+ suffix: PropTypes.any,
92
+ prefix: PropTypes.any,
93
+ children: PropTypes.any,
94
+ type: PropTypes.any,
95
+ };
@@ -0,0 +1,37 @@
1
+ .water-drop-wrapper {
2
+ padding: 0;
3
+ margin: 0;
4
+ position: relative;
5
+ overflow: hidden;
6
+ /* Crucial for clipping the ripple */
7
+ cursor: pointer;
8
+ height: fit-content;
9
+ /* Add any other styling for your wrapper here */
10
+ }
11
+
12
+ .ripple {
13
+ position: absolute;
14
+ border-radius: 50%;
15
+ transform: translate(-50%, -50%) scale(0);
16
+ background: rgba(0, 0, 0, 0.15);
17
+ /* Adjust ripple color and opacity */
18
+ animation: ripple-effect 0.5s ease-out forwards;
19
+ /* Adjust animation duration */
20
+ pointer-events: none;
21
+ /* Prevents the ripple from interfering with other clicks */
22
+
23
+ transition: opacity 0.3s ease-out;
24
+ /* Add transition for fade-out */
25
+ }
26
+
27
+ .ripple.fade-out {
28
+ opacity: 0;
29
+ /* Fade out to 0 opacity */
30
+ }
31
+
32
+ @keyframes ripple-effect {
33
+ to {
34
+ transform: translate(-50%, -50%) scale(1);
35
+ // opacity: 0;
36
+ }
37
+ }
@@ -0,0 +1,32 @@
1
+ import { Alert } from '@mui/material';
2
+ import PropTypes from 'prop-types';
3
+ import React from 'react';
4
+
5
+ const AlertPlaceholder = ({ severity = 'info', variant = 'outlined', height = '100%', children }) => {
6
+ return (
7
+ <Alert
8
+ severity={severity}
9
+ variant={variant}
10
+ sx={{
11
+ p: 2,
12
+ height: height,
13
+ display: 'flex',
14
+ justifyContent: 'center',
15
+ alignItems: 'center',
16
+ textAlign: 'center',
17
+ fontSize: '1.2rem',
18
+ }}
19
+ >
20
+ {children}
21
+ </Alert>
22
+ );
23
+ };
24
+
25
+ AlertPlaceholder.propTypes = {
26
+ severity: PropTypes.string,
27
+ variant: PropTypes.string,
28
+ height: PropTypes.string,
29
+ children: PropTypes.node,
30
+ };
31
+
32
+ export default AlertPlaceholder;
@@ -0,0 +1,56 @@
1
+ import React, { memo } from "react";
2
+ import { FontAwesomeIconsNames } from "@/common/fontAwesomeIcons/FontAwesomeIconsNames";
3
+ import Grid from "@mui/material/Grid2";
4
+ import { Alert, ButtonBase, Typography } from "@mui/material";
5
+ import { Box } from "@mui/system";
6
+ import { showToast } from "@/common/toaster/toaster";
7
+ import FontAwesomeIcons from "@/common/fontAwesomeIcons/FontAwesomeIcons";
8
+
9
+ const AllFaIconsSelector = () => {
10
+ return (
11
+ <Box sx={{ backgroundColor: "background.paper", my: 2, p: 2 }}>
12
+ <Alert severity="info" variant="outlined">
13
+ Click on the icon to copy its code
14
+ </Alert>
15
+ <Grid container spacing={3} flexWrap="wrap" sx={{ my: 1 }}>
16
+ {FontAwesomeIconsNames.map((icon) => (
17
+ <Grid size={{ xs: 12, sm: 6, md: 4, lg: 3 }} key={icon}>
18
+ <ButtonBase
19
+ sx={{ display: "flow", width: "100%", borderRadius: "0.5rem" }}
20
+ >
21
+ <Box
22
+ sx={{
23
+ m: 1,
24
+ p: 1,
25
+ display: "flex",
26
+ justifyContent: "center",
27
+ alignItems: "center",
28
+ flexDirection: "column",
29
+ backgroundColor: "background.default",
30
+ borderRadius: "0.5rem",
31
+ }}
32
+ onClick={() => {
33
+ navigator.clipboard.writeText(
34
+ `<FontAwesomeIcons iconName="${icon}" />`
35
+ );
36
+ showToast({
37
+ message: `${icon} icon copied`,
38
+ type: "success",
39
+ });
40
+ }}
41
+ key={icon}
42
+ >
43
+ <Box sx={{ mb: 1 }}>
44
+ <FontAwesomeIcons iconName={icon} size={"2xl"} />
45
+ </Box>
46
+ <Typography>{icon}</Typography>
47
+ </Box>
48
+ </ButtonBase>
49
+ </Grid>
50
+ ))}
51
+ </Grid>
52
+ </Box>
53
+ );
54
+ };
55
+
56
+ export default memo(AllFaIconsSelector);
@@ -0,0 +1,102 @@
1
+ import {
2
+ ClassicEditor as BaseClassicEditor,
3
+ Essentials,
4
+ CKFinderUploadAdapter,
5
+ Autoformat,
6
+ Bold,
7
+ Italic,
8
+ BlockQuote,
9
+ CKBox,
10
+ CKFinder,
11
+ EasyImage,
12
+ Heading,
13
+ Image,
14
+ ImageCaption,
15
+ ImageStyle,
16
+ ImageToolbar,
17
+ ImageUpload,
18
+ PictureEditing,
19
+ Indent,
20
+ Link,
21
+ List,
22
+ MediaEmbed,
23
+ Paragraph,
24
+ PasteFromOffice,
25
+ Table,
26
+ TableToolbar,
27
+ TextTransformation,
28
+ CloudServices,
29
+ } from 'ckeditor5';
30
+
31
+ import 'ckeditor5/ckeditor5.css';
32
+
33
+ export default class Editor extends BaseClassicEditor {}
34
+
35
+ Editor.builtinPlugins = [
36
+ Essentials,
37
+ CKFinderUploadAdapter,
38
+ Autoformat,
39
+ Bold,
40
+ Italic,
41
+ BlockQuote,
42
+ CKBox,
43
+ CKFinder,
44
+ CloudServices,
45
+ EasyImage,
46
+ Heading,
47
+ Image,
48
+ ImageCaption,
49
+ ImageStyle,
50
+ ImageToolbar,
51
+ ImageUpload,
52
+ Indent,
53
+ Link,
54
+ List,
55
+ MediaEmbed,
56
+ Paragraph,
57
+ PasteFromOffice,
58
+ PictureEditing,
59
+ Table,
60
+ TableToolbar,
61
+ TextTransformation,
62
+ ];
63
+
64
+ Editor.defaultConfig = {
65
+ licenseKey: 'GPL',
66
+ toolbar: {
67
+ items: [
68
+ 'undo',
69
+ 'redo',
70
+ '|',
71
+ 'heading',
72
+ '|',
73
+ 'bold',
74
+ 'italic',
75
+ '|',
76
+ 'link',
77
+ 'uploadImage',
78
+ 'insertTable',
79
+ 'blockQuote',
80
+ 'mediaEmbed',
81
+ '|',
82
+ 'bulletedList',
83
+ 'numberedList',
84
+ 'outdent',
85
+ 'indent',
86
+ ],
87
+ },
88
+ image: {
89
+ toolbar: [
90
+ 'imageStyle:inline',
91
+ 'imageStyle:block',
92
+ 'imageStyle:side',
93
+ '|',
94
+ 'toggleImageCaption',
95
+ 'imageTextAlternative',
96
+ ],
97
+ },
98
+ table: {
99
+ contentToolbar: ['tableColumn', 'tableRow', 'mergeTableCells'],
100
+ },
101
+ language: 'en',
102
+ };
@@ -0,0 +1,72 @@
1
+ import { Accordion, AccordionSummary, AccordionDetails } from '@mui/material';
2
+ import PropTypes from 'prop-types';
3
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
4
+ import { faChevronDown } from '@fortawesome/free-solid-svg-icons';
5
+
6
+
7
+ /**
8
+ * A customizable Accordion component using MUI.
9
+ *
10
+ * Props:
11
+ * - title: The header content of the accordion.
12
+ * - children: The content displayed when expanded.
13
+ * - expanded: Boolean to control whether this panel is expanded.
14
+ * - onChange: Callback (event, isExpanded) => void, forwarded to Accordion.
15
+ * - disabled: Boolean to disable the accordion.
16
+ * - summaryProps: Additional props to pass to AccordionSummarTeleconsultationy.
17
+ * - detailsProps: Additional props to pass to AccordionDetails.
18
+ * - accordionProps: Other props to pass to Accordion.
19
+ */
20
+ export default function CustomAccordion({
21
+ title,
22
+ children,
23
+ expanded = false,
24
+ onChange,
25
+ disabled,
26
+ summaryProps,
27
+ detailsProps,
28
+ dataTestId,
29
+ headerHeight = null,
30
+ iconRequired = true,
31
+ ...props
32
+ }) {
33
+ return (
34
+ <Accordion expanded={expanded} onChange={onChange} disabled={disabled} {...props} data-testid={dataTestId}>
35
+ <AccordionSummary
36
+ expandIcon={iconRequired && <FontAwesomeIcon icon={faChevronDown} className="pl-2" />}
37
+ {...summaryProps}
38
+ className="bg-gray-100 font-bold"
39
+ data-testid={`${dataTestId}-title`}
40
+ sx={{
41
+ '&.Mui-expanded': {
42
+ minHeight: headerHeight || 64,
43
+ },
44
+ '& .MuiAccordionSummary-content.Mui-expanded': {
45
+ margin: 0,
46
+ },
47
+ }}
48
+ >
49
+ {title}
50
+ </AccordionSummary>
51
+
52
+ <AccordionDetails {...detailsProps} className="bg-white" data-testid={`${dataTestId}-children`}>
53
+ {children}
54
+ </AccordionDetails>
55
+ </Accordion>
56
+ );
57
+ }
58
+
59
+ CustomAccordion.propTypes = {
60
+ title: PropTypes.any,
61
+ children: PropTypes.any,
62
+ expanded: PropTypes.any,
63
+ onChange: PropTypes.any,
64
+ disabled: PropTypes.any,
65
+ summaryProps: PropTypes.any,
66
+ detailsProps: PropTypes.any,
67
+ accordionProps: PropTypes.any,
68
+ props: PropTypes.any,
69
+ dataTestId: PropTypes.any,
70
+ headerHeight: PropTypes.any,
71
+ iconRequired: PropTypes.any,
72
+ };
@@ -0,0 +1,118 @@
1
+ import { Button, Menu, MenuItem, Typography } from '@mui/material';
2
+ import React, { useState } from 'react';
3
+ import PropTypes from 'prop-types';
4
+
5
+ function CustomActionIcons({
6
+ icon,
7
+ onClick,
8
+ menuItems,
9
+ row,
10
+ menuClick,
11
+ disabled,
12
+ dataTestId = 'icon',
13
+ iconColor = 'primary',
14
+ backgroundColor = 'blue',
15
+ hoverBackgroundColor = 'gray',
16
+ hoverIconColor = 'primary',
17
+ rotateIcon = false,
18
+ }) {
19
+ const [anchorEl, setAnchorEl] = useState(null);
20
+ const open = Boolean(anchorEl);
21
+ const [isHovered, setIsHovered] = useState(false);
22
+ const handleClick = (event) => {
23
+ if (menuClick) {
24
+ menuClick(row);
25
+ }
26
+ if (menuItems && menuItems.length > 0) {
27
+ setAnchorEl(event.currentTarget);
28
+ } else if (onClick) {
29
+ onClick();
30
+ }
31
+ };
32
+
33
+ const handleClose = () => {
34
+ setAnchorEl(null);
35
+ };
36
+
37
+ return (
38
+ <>
39
+ <div
40
+ onClick={handleClick}
41
+ onMouseEnter={() => setIsHovered(true)}
42
+ onMouseLeave={() => setIsHovered(false)}
43
+ className={
44
+ icon?.props?.children
45
+ ? 'flex items-center justify-center bg-transparent shadow-none cursor-pointer transition-colors duration-300'
46
+ : 'w-10 h-10 rounded-full border border-customBlue flex items-center justify-center shadow-none cursor-pointer transition-colors duration-300'
47
+ }
48
+ style={{
49
+ backgroundColor: isHovered && hoverBackgroundColor ? hoverBackgroundColor : backgroundColor,
50
+
51
+ transition: 'all 0.2s ease-in-out',
52
+ // 2. Add Scale (1.2x) and Tilt (12deg) based on hover state
53
+ transform: isHovered ? 'scale(1.1) ' : 'scale(1)',
54
+ }}
55
+ >
56
+ <Button
57
+ data-testid={dataTestId}
58
+ className="min-w-0 bg-transparent"
59
+ disabled={disabled}
60
+ sx={{
61
+ color: isHovered && hoverIconColor ? hoverIconColor : iconColor,
62
+ border: 'none',
63
+ '&:hover': {
64
+ border: 'none',
65
+ outline: 'none',
66
+ },
67
+ '&:focus': {
68
+ outline: 'none',
69
+ },
70
+
71
+ // 1. Add Smooth Transition
72
+ transition: 'all 0.2s ease-in-out',
73
+ // 2. Add Scale (1.2x) and Tilt (12deg) based on hover state
74
+ transform: isHovered
75
+ ? rotateIcon
76
+ ? 'scale(1.2) rotate(-12deg)'
77
+ : 'scale(1.2) rotate(0deg)'
78
+ : 'scale(1) rotate(0deg)',
79
+ }}
80
+ >
81
+ {React.cloneElement(icon, { sx: { fontSize: icon?.props?.sx?.fontSize || '21px' } })}
82
+ </Button>
83
+ </div>
84
+
85
+ {menuItems && menuItems.length > 0 && (
86
+ <Menu anchorEl={anchorEl} open={open} onClose={handleClose}>
87
+ {menuItems.map((menuItem, index) => (
88
+ <MenuItem
89
+ key={index + 1}
90
+ onClick={() => {
91
+ menuItem.onClick(row);
92
+ handleClose();
93
+ }}
94
+ >
95
+ <Typography variant="body2"> {menuItem.label} </Typography>
96
+ </MenuItem>
97
+ ))}
98
+ </Menu>
99
+ )}
100
+ </>
101
+ );
102
+ }
103
+ CustomActionIcons.propTypes = {
104
+ icon: PropTypes.any,
105
+ onClick: PropTypes.any,
106
+ menuItems: PropTypes.any,
107
+ row: PropTypes.any,
108
+ menuClick: PropTypes.any,
109
+ disabled: PropTypes.any,
110
+ dataTestId: PropTypes.any,
111
+ iconColor: PropTypes.any,
112
+ backgroundColor: PropTypes.any,
113
+ hoverBackgroundColor: PropTypes.any,
114
+ hoverIconColor: PropTypes.any,
115
+ rotateIcon: PropTypes.any,
116
+ };
117
+
118
+ export default CustomActionIcons;