hplx-feature-library 1.0.169 → 1.0.171
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/Attachments/components/document-canvas/document-pen-tool.d.ts +1 -1
- package/dist/Attachments/components/drag-drop-overlay.d.ts +1 -1
- package/dist/Attachments/components/edit-document-modal.d.ts +1 -1
- package/dist/Attachments/components/uploading-toast.d.ts +1 -1
- package/dist/Attachments/context/index.d.ts +2 -2
- package/dist/Attachments/hooks/useDropdownPosition.d.ts +1 -1
- package/dist/Attachments/index.js +12670 -11144
- package/dist/CameraCapture/index.d.ts +1 -1
- package/dist/PediatricsCalculator/components/PediatricsCalculatorTableContext.d.ts +1 -1
- package/dist/PediatricsCalculator/index.js +1 -1
- package/dist/PediatricsCalculatorTable-BglWcUGO.cjs +40 -0
- package/dist/PediatricsCalculatorTable-Dwluo5W0.js +2163 -0
- package/dist/components/{customDropdown/CustomDropdown.d.ts → CustomDropdown.d.ts} +2 -2
- package/dist/components/{toggleButtons/ToggleButtons.d.ts → ToggleButtons.d.ts} +1 -1
- package/dist/hplx-feature-library.css +1 -1
- package/dist/index.d.ts +0 -5
- package/dist/index.js +2 -12
- package/dist/useOutsideClick-COATBT9j.cjs +92 -0
- package/dist/useOutsideClick-CYAjbj1N.js +6878 -0
- package/package.json +4 -60
- package/dist/APIAction--DyoXs57.js +0 -3752
- package/dist/APIAction-B5XQnkiF.cjs +0 -9
- package/dist/AlertPopup/index.js +0 -79
- package/dist/AllInvestigations/components/AllInvestigationsTable.d.ts +0 -19
- package/dist/AllInvestigations/index.d.ts +0 -1
- package/dist/AllInvestigations/index.js +0 -4
- package/dist/AllInvestigations/utils/test-tange-util.d.ts +0 -8
- package/dist/AllInvestigationsTable-Dj3AKVVv.js +0 -17066
- package/dist/AllInvestigationsTable-aw_zEJj_.cjs +0 -79
- package/dist/CustomDropdown/index.js +0 -256
- package/dist/DateTimePicker/DateAndTimePicker/index.js +0 -5930
- package/dist/PatientAddEdit/index.js +0 -1662
- package/dist/PatientPopup/action/APIAction.d.ts +0 -65
- package/dist/PatientPopup/app/PatientPopupContainer.d.ts +0 -6
- package/dist/PatientPopup/app/PatientPopupContext.d.ts +0 -30
- package/dist/PatientPopup/common/common.d.ts +0 -14
- package/dist/PatientPopup/components/Lab/HPLXLab.d.ts +0 -8
- package/dist/PatientPopup/components/Lab/LISLab.d.ts +0 -8
- package/dist/PatientPopup/components/Lab/LabTable.d.ts +0 -5
- package/dist/PatientPopup/components/Lab/index.d.ts +0 -5
- package/dist/PatientPopup/components/Loader/Loader.d.ts +0 -2
- package/dist/PatientPopup/components/Pagination.d.ts +0 -9
- package/dist/PatientPopup/components/Profile/Abha.d.ts +0 -11
- package/dist/PatientPopup/components/Profile/PatientDetailsModal.d.ts +0 -1
- package/dist/PatientPopup/components/Profile/Profile.d.ts +0 -11
- package/dist/PatientPopup/components/Profile/Sms.d.ts +0 -2
- package/dist/PatientPopup/components/Visits/Table.d.ts +0 -11
- package/dist/PatientPopup/components/Visits/index.d.ts +0 -15
- package/dist/PatientPopup/components/addBills/AddBillFooter.d.ts +0 -2
- package/dist/PatientPopup/components/addBills/AddBills.d.ts +0 -5
- package/dist/PatientPopup/components/addBills/AddBillsTable.d.ts +0 -17
- package/dist/PatientPopup/components/addBills/DropDown.d.ts +0 -15
- package/dist/PatientPopup/components/appointment/AllAppts.d.ts +0 -8
- package/dist/PatientPopup/components/appointment/Appointment.d.ts +0 -2
- package/dist/PatientPopup/components/appointment/AppointmentsTable.d.ts +0 -10
- package/dist/PatientPopup/components/bills/Bills.d.ts +0 -6
- package/dist/PatientPopup/components/bills/BillsTable.d.ts +0 -11
- package/dist/PatientPopup/components/deposit/DepositSection.d.ts +0 -9
- package/dist/PatientPopup/components/mainNavItem/MainNavItem.d.ts +0 -13
- package/dist/PatientPopup/components/patientPopupBody/PatientPopupBody.d.ts +0 -8
- package/dist/PatientPopup/components/patientPopupHeader/PatientPopupHeader.d.ts +0 -10
- package/dist/PatientPopup/components/patientPopupSummary/BillSummary.d.ts +0 -19
- package/dist/PatientPopup/components/patientPopupSummary/ConsultationDetails.d.ts +0 -14
- package/dist/PatientPopup/components/patientPopupSummary/DeleteItem.d.ts +0 -11
- package/dist/PatientPopup/components/patientPopupSummary/DepositRefundSummary.d.ts +0 -8
- package/dist/PatientPopup/components/patientPopupSummary/LabServiceDetails.d.ts +0 -13
- package/dist/PatientPopup/components/patientPopupSummary/OtherServiceDetails.d.ts +0 -13
- package/dist/PatientPopup/components/patientPopupSummary/PatientPopupSummary.d.ts +0 -8
- package/dist/PatientPopup/components/patientPopupSummary/PaymentCard.d.ts +0 -25
- package/dist/PatientPopup/components/patientPopupSummary/ServiceLevelBillSummary.d.ts +0 -18
- package/dist/PatientPopup/components/payments/DepositRefundTable.d.ts +0 -14
- package/dist/PatientPopup/components/payments/OtherServicesTable.d.ts +0 -16
- package/dist/PatientPopup/components/payments/PaymentEditModal.d.ts +0 -15
- package/dist/PatientPopup/components/payments/PaymentHeader.d.ts +0 -7
- package/dist/PatientPopup/components/payments/Payments.d.ts +0 -5
- package/dist/PatientPopup/components/payments/PaymentsTable.d.ts +0 -14
- package/dist/PatientPopup/constants/AppConstants.d.ts +0 -123
- package/dist/PatientPopup/index.d.ts +0 -1
- package/dist/PatientPopup/index.js +0 -135376
- package/dist/PatientPopup/types/hplxAPITypes.d.ts +0 -37
- package/dist/PatientPopup/utils/PrintFontLoader.d.ts +0 -4
- package/dist/PatientPopup/utils/helperFunctions.d.ts +0 -3
- package/dist/PediatricsCalculatorTable-CTA61g3h.cjs +0 -1
- package/dist/PediatricsCalculatorTable-QgonqxbR.js +0 -833
- package/dist/ReusableModal-CIgDYOWZ.cjs +0 -1
- package/dist/ReusableModal-pSi21hnc.js +0 -29
- package/dist/ReusableTable/ReusableTable.d.ts +0 -3
- package/dist/ReusableTable/ReusableTableConstants.d.ts +0 -8
- package/dist/ReusableTable/ReusableTableTypes.d.ts +0 -96
- package/dist/ReusableTable/components/EmptyTableContainer.d.ts +0 -12
- package/dist/ReusableTable/components/FilterCheckbox.d.ts +0 -8
- package/dist/ReusableTable/components/FilterDropdown.d.ts +0 -17
- package/dist/ReusableTable/components/Pagination.d.ts +0 -2
- package/dist/ReusableTable/components/TableBody.d.ts +0 -2
- package/dist/ReusableTable/components/TableCell.d.ts +0 -3
- package/dist/ReusableTable/components/TableFilterSelect.d.ts +0 -12
- package/dist/ReusableTable/components/TableHead.d.ts +0 -2
- package/dist/ReusableTable/components/TableMain.d.ts +0 -2
- package/dist/ReusableTable/components/TableRow.d.ts +0 -3
- package/dist/ReusableTable/context/TableContext.d.ts +0 -21
- package/dist/ReusableTable/context/TableContextBase.d.ts +0 -26
- package/dist/ReusableTable/context/useTableContext.d.ts +0 -2
- package/dist/Subscription/components/SubscriptionBadge.d.ts +0 -2
- package/dist/ToggleButtons/index.js +0 -17
- package/dist/TrendGraphs/AreaChartComponent.d.ts +0 -9
- package/dist/TrendGraphs/LineChartComponent/DataPointToolTip.d.ts +0 -16
- package/dist/TrendGraphs/LineChartComponent/LineChartBody.d.ts +0 -2
- package/dist/TrendGraphs/LineChartComponent/LineChartHeader.d.ts +0 -2
- package/dist/TrendGraphs/LineChartComponent/index.d.ts +0 -2
- package/dist/TrendGraphs/context/index.d.ts +0 -2
- package/dist/TrendGraphs/hooks/useTrendGraphContext.d.ts +0 -2
- package/dist/TrendGraphs/utils/index.d.ts +0 -4
- package/dist/changePasswordModal/APIAction/APIActions.d.ts +0 -8
- package/dist/changePasswordModal/component/ChangePasswordModal.d.ts +0 -14
- package/dist/clsx-C11secjj.cjs +0 -1
- package/dist/clsx-OuTLNxxd.js +0 -16
- package/dist/common/APIAction/APIAction.d.ts +0 -28
- package/dist/common/components/BorderFullWidth.d.ts +0 -2
- package/dist/common/components/table/ExistingPatients.d.ts +0 -17
- package/dist/common/editRibbon/EditRibbon.d.ts +0 -9
- package/dist/common/utils/NetworkInstance.d.ts +0 -4
- package/dist/common/utils/common-utils.d.ts +0 -36
- package/dist/components/Modal.d.ts +0 -5
- package/dist/components/PatientAddEdit.d.ts +0 -3
- package/dist/components/alertPopup/index.d.ts +0 -1
- package/dist/components/customDropdown/index.d.ts +0 -1
- package/dist/components/dateTimePicker/DateAndTimePicker.d.ts +0 -21
- package/dist/components/dateTimePicker/index.d.ts +0 -1
- package/dist/components/toggleButtons/index.d.ts +0 -1
- package/dist/constants/CommonConstant.d.ts +0 -70
- package/dist/constants/TrendGraphsConstants.d.ts +0 -2
- package/dist/dayjs.min-BbV4duaj.js +0 -284
- package/dist/dayjs.min-DXp74Ozx.cjs +0 -1
- package/dist/fonts/AnekMalayalam-Bold.ttf +0 -0
- package/dist/fonts/AnekMalayalam-Regular.ttf +0 -0
- package/dist/fonts/Arial-Bold-Italic.ttf +0 -0
- package/dist/fonts/Arial-Bold.ttf +0 -0
- package/dist/fonts/Arial-Italic.ttf +0 -0
- package/dist/fonts/Arial.ttf +0 -0
- package/dist/fonts/IndianRupee.ttf +0 -0
- package/dist/fonts/MuktaMaheePunjabi-Bold.ttf +0 -0
- package/dist/fonts/MuktaMaheePunjabi-Regular.ttf +0 -0
- package/dist/fonts/Noto-Sans-Telugu-Bold.ttf +0 -0
- package/dist/fonts/Noto-Sans-Telugu-Regular.ttf +0 -0
- package/dist/fonts/NotoNastaliqUrdu-Bold.ttf +0 -0
- package/dist/fonts/NotoNastaliqUrdu-Regular.ttf +0 -0
- package/dist/fonts/NotoSansArabic-Bold.ttf +0 -0
- package/dist/fonts/NotoSansArabic.ttf +0 -0
- package/dist/fonts/NotoSansHindi-Bold.ttf +0 -0
- package/dist/fonts/NotoSansHindi.ttf +0 -0
- package/dist/fonts/NotoSansKannada-Bold.ttf +0 -0
- package/dist/fonts/NotoSansKannada.ttf +0 -0
- package/dist/fonts/NotoSansOriya-Bold.ttf +0 -0
- package/dist/fonts/NotoSansOriya.ttf +0 -0
- package/dist/fonts/NotoSansTamil-Bold.ttf +0 -0
- package/dist/fonts/NotoSansTamil.ttf +0 -0
- package/dist/fonts/NotoSerifGujarati-Bold.ttf +0 -0
- package/dist/fonts/NotoSerifGujarati-Regular.ttf +0 -0
- package/dist/fonts/Roboto-Regular.ttf +0 -0
- package/dist/fonts/Times-Bold-Italic.ttf +0 -0
- package/dist/fonts/Times-Bold.ttf +0 -0
- package/dist/fonts/Times-Italic.ttf +0 -0
- package/dist/fonts/Times.ttf +0 -0
- package/dist/fonts/TiroBangla-Bold.ttf +0 -0
- package/dist/fonts/TiroBangla-Regular.ttf +0 -0
- package/dist/fonts/Verdana-Bold-Italic.ttf +0 -0
- package/dist/fonts/Verdana-Bold.ttf +0 -0
- package/dist/fonts/Verdana-Italic.ttf +0 -0
- package/dist/fonts/Verdana.ttf +0 -0
- package/dist/hooks/useMediaQuery.d.ts +0 -1
- package/dist/index-CJFGOBPb.js +0 -122
- package/dist/index-DQlbIHh3.cjs +0 -102
- package/dist/index-DfcUmlge.cjs +0 -17
- package/dist/index-DkA8S5IK.cjs +0 -32
- package/dist/index-sG1tIMJ6.js +0 -7242
- package/dist/index-vVtPa2-N.js +0 -961
- package/dist/nineDots/NineDotsTypes.d.ts +0 -22
- package/dist/nineDots/NineDotsUtils.d.ts +0 -3
- package/dist/nineDots/nineDots.d.ts +0 -3
- package/dist/parseISO-AwyR5Nhg.cjs +0 -1
- package/dist/parseISO-Cso9HWPX.js +0 -1414
- package/dist/searchPatients/SearchPatients.d.ts +0 -11
- package/dist/types/APIEndPoints.d.ts +0 -11
- package/dist/types/AllInvestigationTypes/index.js +0 -4
- package/dist/types/AllInvestigationTypes.d.ts +0 -45
- package/dist/types/ApiResponseTypes.d.ts +0 -290
- package/dist/types/CommonTypes.d.ts +0 -255
- package/dist/types/PatientAddEditTypes/index.js +0 -1
- package/dist/types/PatientAddEditTypes.d.ts +0 -7
- package/dist/types/PatientPopupTypes/index.js +0 -1
- package/dist/types/PatientPopupTypes.d.ts +0 -836
- package/dist/types/TrendGraphTypes.d.ts +0 -19
- package/dist/useClickOutside-BjJyGTec.js +0 -14
- package/dist/useClickOutside-DsVG12Cs.cjs +0 -1
- package/dist/useOutsideClick-C4Q0aGuf.js +0 -15
- package/dist/useOutsideClick-CicUjzPP.cjs +0 -1
- package/dist/userProfile/APIAction/APIActions.d.ts +0 -18
- package/dist/userProfile/UserProfile.d.ts +0 -18
- package/dist/userProfile/UserProfileItem.d.ts +0 -7
- package/dist/warning-BozzKWdr.js +0 -38
- package/dist/warning-W0tkkrLJ.cjs +0 -1
- /package/dist/components/{alertPopup/AlertPopup.d.ts → AlertPopup.d.ts} +0 -0
|
@@ -3,5 +3,5 @@ interface CameraCaptureProps {
|
|
|
3
3
|
onClose: () => void;
|
|
4
4
|
onCapture: (file: File) => Promise<void>;
|
|
5
5
|
}
|
|
6
|
-
declare function CameraCapture({ isOpen, onClose, onCapture }: CameraCaptureProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function CameraCapture({ isOpen, onClose, onCapture }: CameraCaptureProps): import("react/jsx-runtime").JSX.Element | null;
|
|
7
7
|
export default CameraCapture;
|
|
@@ -10,5 +10,5 @@ export interface IPediatricsCalculatorTableContext {
|
|
|
10
10
|
setRowToDelete?: (id: string | null) => void;
|
|
11
11
|
openPopupForRow?: (row: IMedicineViewData) => void;
|
|
12
12
|
}
|
|
13
|
-
export declare const PediatricsCalculatorTableContext: import('react').Context<IPediatricsCalculatorTableContext>;
|
|
13
|
+
export declare const PediatricsCalculatorTableContext: import('react').Context<IPediatricsCalculatorTableContext | null>;
|
|
14
14
|
export declare const usePediatricsCalculatorTableContext: () => IPediatricsCalculatorTableContext;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";const t=require("./useOutsideClick-COATBT9j.cjs"),j=require("react"),z=require("./constants/PediatricsCalculatorConstants/index.js"),ut=require("react-dom"),Ke=j.createContext(null),Ye=()=>{const o=j.useContext(Ke);if(!o)throw new Error("usePediatricsCalculatorTableContext must be used inside a MedicineTableProvider");return o},ct=({effectiveEditMode:o,rowData:r,isSavedToLibrary:v,onSave:c,onCancel:f,onEdit:y,onCheckboxToggle:m})=>{const{variant:n,externallyTriggeredEditMode:w,setRowToDelete:b,openPopupForRow:h}=Ye();return n==="standard"?o?t.jsxRuntimeExports.jsxs("div",{className:"hfl-grid hfl-grid-cols-[1fr_1fr] hfl-border-1 hfl-border-Gray-200 hfl-rounded-lg ",children:[t.jsxRuntimeExports.jsx("button",{className:"hfl-px-3 hfl-py-1 hfl-text-Blue_gray-800 hfl-border-r-1 hover:hfl-bg-Primary-50",onClick:c,children:t.jsxRuntimeExports.jsx(t.bs,{variant:"Medium",type:"Text xs",className:"hfl-text-Blue_gray-800",children:"Save"})}),t.jsxRuntimeExports.jsx("button",{className:"hfl-px-3 hfl-py-2 hfl-text-Error-600 hover:hfl-bg-Error-50",onClick:f,children:t.jsxRuntimeExports.jsx(t.bs,{variant:"Medium",type:"Text xs",className:"",children:"Cancel"})})]}):t.jsxRuntimeExports.jsxs("div",{className:"hfl-grid hfl-grid-cols-[1fr_1fr_1fr] hfl-border-1 hfl-border-Gray-200 hfl-rounded-lg",children:[t.jsxRuntimeExports.jsx("button",{className:"hfl-px-3 hfl-py-1 hfl-text-Blue_gray-800 hover:hfl-bg-Primary-50",onClick:y,children:t.jsxRuntimeExports.jsx(t.bs,{variant:"Medium",type:"Text xs",className:"",children:"Edit"})}),t.jsxRuntimeExports.jsx("button",{className:"hfl-px-3 hfl-py-2 hfl-text-Blue_gray-800 hfl-border-x-1 hover:hfl-bg-Primary-50",onClick:()=>h?.(r),children:t.jsxRuntimeExports.jsx(t.bs,{variant:"Medium",type:"Text xs",className:"",children:"Copy"})}),t.jsxRuntimeExports.jsx("button",{className:"hx_delete hfl-px-3 hfl-py-2 hfl-text-Error-500 hover:hfl-bg-Error-50",onClick:()=>b?.(r.rowId)})]}):t.jsxRuntimeExports.jsx(t.Os,{disabled:!w,text:"Save this to Pediatric Calculator Library ",id:r.rowId,size:"md",onClick:m,isMarked:v??!1,checkboxClasses:"hfl-mt-2",checkBoxInnerDivClasses:"hfl-text-Blue-600 hfl-bg-Blue-50"},r.rowId)},ft=(o,r)=>{j.useEffect(()=>{const v=c=>{o.current&&!o.current.contains(c.target)&&r()};return document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)}},[o,r])};function dt(o){const{options:r,selectedOption:v,onChangeHandler:c}=o;return t.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-gap-2 hfl-h-full hfl-items-center hfl-px-4 hfl-justify-center hfl-py-1",children:r?.map(f=>t.jsxRuntimeExports.jsx("div",{className:"hfl-bg-White hfl-rounded-lg",children:t.jsxRuntimeExports.jsx(t.Ku,{onClick:()=>c&&c(f),hierarchy:v?.label===f.label?"Primary":"Secondary-Grey",size:"sm",textField:f.label,className:v?.label===f.label?"hfl-bg-Blue-600":""})},f.label))})}const pt="data:image/svg+xml,%3csvg%20width='10'%20height='6'%20viewBox='0%200%2010%206'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0.480062%200.819173C0.650418%200.648817%200.92662%200.648817%201.09698%200.819173L4.71454%204.43674L8.3321%200.819173C8.50246%200.648817%208.77866%200.648817%208.94902%200.819173C9.11937%200.98953%209.11937%201.26573%208.94902%201.43609L5.023%205.36211C4.85264%205.53246%204.57644%205.53246%204.40608%205.36211L0.480062%201.43609C0.309706%201.26573%200.309706%200.98953%200.480062%200.819173Z'%20fill='%23667085'/%3e%3c/svg%3e";function U(o){const{label:r,labelClassName:v,hideDropdownIcon:c,showClearOption:f,isRequiredField:y,btnClassName:m,placeholder:n,options:w,selectedOption:b,onChangeHandler:h,inputValue:a,inputChangeHandler:g,onInputFocusOutEvent:x,inputClassName:s,isSearchable:E,inputType:S,showInput:D,inputSuffix:L,selectedLabel:B,suffixPadding:W,disableInputAutoSize:R,selectedOptions:I,isMulti:T,dropDownItemClickHandler:F,showToggle:P,toggleChangeHandler:A,selectedToggleOption:p,toggleOptionsList:l,border:C,height:i,disabled:u,fieldColor:O,errorMsg:e,showErrorMsg:d,placeholderStyle:_,onInputKeyDown:N,showEmptyDropdownPopup:M=!0,isDropdownFixed:H=!1,dropdownClassName:V="",wrapperClass:ee="",maxInputLength:se,alternateListBgStyle:oe,showLabelTooltip:q=!1,labelToolTipContent:X="",inputContainerClasses:ne="",onInputFocus:ie}=o,[le,ce]=j.useState(!1),[fe,rt]=j.useState(null),me=j.useRef(null),be=j.useRef(null),Se=j.useRef(null),_e=j.useRef([]),ot=j.useMemo(()=>w?.filter(k=>k?k.label.toLowerCase().includes((a??"").toLowerCase()):void 0),[a,w]),[lt,Ee]=j.useState(!1),at=()=>{ce(!1),T&&g&&g(""),rt(null)},Me=j.useCallback(k=>{k.stopPropagation(),u||ce($=>!$)},[u]),Te=(a?.length||0)+2+Number(W||0);t.useOutsideClick(me,at),j.useEffect(()=>{fe!==null&&_e.current[fe]&&_e.current[fe].scrollIntoView({block:"nearest"})},[fe]);const de=j.useCallback(()=>{if(H&&le){const k=D?be.current:Se.current,$=me.current;if(k&&$){const Z=k.getBoundingClientRect();$.style.position="fixed",$.style.top=`${window.scrollY?Z.bottom+window.scrollY:Z.bottom}px`,$.style.left=`${Z.left}px`,$.style.width=`${Z.width}px`}}},[H,le,D]);j.useEffect(()=>{if(H)return le?(de(),window.addEventListener("scroll",de,!0)):window.removeEventListener("scroll",de,!0),()=>{window.removeEventListener("scroll",de,!0)}},[H,de,le]),ft(me,()=>{lt&&x&&x()});const De=k=>{if(T&&F){const $=I?.some(Z=>Z.value===k.value);F(!!$,k)}},st=j.useCallback(async k=>{k.stopPropagation(),le||ce(!0),ie&&await ie()},[ie,le]);return t.jsxRuntimeExports.jsxs("div",{className:`hfl-relative hfl-inline-block hfl-text-left ${ee||""}`,children:[!!r&&t.jsxRuntimeExports.jsxs("div",{className:"hfl-text-Gray-700 hfl-mb-1 hfl-flex",children:[t.jsxRuntimeExports.jsx(t.bs,{type:"Text sm",variant:"Medium",className:v||"",children:`${r}`}),y&&t.jsxRuntimeExports.jsx("span",{className:"hfl-ml-1 hfl-text-Error-600",children:"*"}),q&&t.jsxRuntimeExports.jsx(t.Nu,{variant:"Right",text:X,theme:"dark",children:t.jsxRuntimeExports.jsx("i",{className:"hx_info-filled"})})]}),D?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:`hfl-flex hfl-items-center hfl-shadow-xs hfl-px-2 ${ne||""} ${C||"hfl-border-1"} hfl-rounded-lg hfl-overflow-x-auto ${e?"hfl-border-Error-300":"hfl-border-Gray-300"} ${i||"hfl-h-10"} ${u?"!hfl-bg-Gray-50 !hfl-pointer-events-none":O||"hfl-bg-White"} hover:hfl-border-Primary-300 hover:hfl-shadow-xs-primary`,onClick:u?()=>{}:Me,children:[I?.map((k,$)=>t.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center hfl-bg-Blue-100 hfl-mr-2 hfl-py-1 hfl-px-2 hfl-rounded-sm hfl-font-inter-0 hfl-text-nowrap",children:[t.jsxRuntimeExports.jsx("span",{className:"hfl-pointer-events-none",children:k.label}),t.jsxRuntimeExports.jsx("span",{onClick:Z=>{Z.stopPropagation(),De(k)},className:"hx_close hfl-text-Gray-500 hfl-my-0 hfl-text-[14px] hfl-ml-[1px] hfl-cursor-pointer"})]},`${k.label}-${$}`)),Object.keys(_||{}).length>0&&t.jsxRuntimeExports.jsx("style",{children:`
|
|
2
|
+
input.input-placeholder::placeholder {
|
|
3
|
+
font-family: ${_?.fontFamily};
|
|
4
|
+
font-weight: ${_?.fontWeight};
|
|
5
|
+
line-height: ${_?.lineHeight};
|
|
6
|
+
font-size: ${_?.fontSize};
|
|
7
|
+
color: ${_?.color};
|
|
8
|
+
}
|
|
9
|
+
`}),t.jsxRuntimeExports.jsx("input",{ref:be,style:R?{}:{width:`${Number(a?.length)>4?(a?.length||0)+5:12}ch`},type:S,placeholder:n,value:a,className:`input-placeholder hfl-flex-1 hfl-pl-2 hfl-placeholder hfl-py-1 focus-visible:hfl-outline-0 focus-visible:hfl-outline-none hfl-border-0 focus:hfl-border-0 ${u?"!hfl-bg-Gray-50 !hfl-cursor-not-allowed":O||"hfl-bg-White"} ${s||""}`,onChange:k=>{g&&g(k.target.value),Ee(!0)},onClick:st,onKeyDown:k=>N&&N(k,ce,be),maxLength:se??se,...o.inputProps||{}}),!c&&!f&&t.jsxRuntimeExports.jsx("i",{className:"hx_down hfl-mx-2"}),f&&t.jsxRuntimeExports.jsx("i",{className:`${a?"hx_close hfl-cursor-pointer":"hx_down"} hfl-mx-2`,onClick:()=>{(b?.value||a)&&(g&&g(""),Ee(!0))}}),L?t.jsxRuntimeExports.jsx("span",{style:{left:`${Te<2?"3":Te}ch`},className:"hfl-absolute hfl-top-1/2 hfl--translate-y-1/2 hfl-pointer-events-none",children:L}):null]}),d&&t.jsxRuntimeExports.jsx("span",{className:"hfl-text-0 hfl-text-Error-600",children:e})]}):t.jsxRuntimeExports.jsxs("button",{ref:Se,onClick:Me,className:`hfl-w-full hfl-bg-White hfl-py-[6px] hfl-px-4 hfl-rounded-lg hfl-inline-flex hfl-justify-between hfl-items-center ${m||""} ${C||"hfl-border-1"} ${e?"hfl-border-Error-300":"hfl-border-Gray-300"} ${i||"hfl-h-[40px]"} ${u?"!hfl-bg-Gray-50 !hfl-cursor-not-allowed":""}`,style:B||b?.label?{}:_?{fontFamily:_?.fontFamily,fontSize:_?.fontSize,fontWeight:_?.fontWeight,lineHeight:_?.lineHeight,color:_?.color}:{},children:[t.jsxRuntimeExports.jsx("span",{className:"hfl-pr-4",children:B||b?.label||n||"Select an option"}),t.jsxRuntimeExports.jsx("img",{src:pt,alt:"down arrow"})]}),w&&w?.length>=0&&t.jsxRuntimeExports.jsxs("ul",{ref:me,className:`custom-dropdown-menu ${le?"hfl-visible":"hfl-invisible"} hfl-absolute hfl-z-50 hfl-grid hfl-gap-1 hfl-mt-3 hfl-w-full hfl-rounded-lg hfl-shadow-lg hfl-bg-White hfl-font-inter-0 hfl-p-1 hfl-px-2 ${T?"hfl-min-w-[20em]":"hfl-min-w-[16em]"} hfl-max-h-[330px] hfl-overflow-y-scroll ${V}`,role:"menu","aria-orientation":"vertical","aria-labelledby":"options-menu",children:[P?t.jsxRuntimeExports.jsx(dt,{onChangeHandler:A,selectedOption:p,options:l}):!1,(E?ot:w)?.map((k,$)=>{const Z=T?!!I?.some(we=>we.value===k?.value):!1,Ie=b?.value===k?.value,it=fe===$;return k?t.jsxRuntimeExports.jsx("li",{onClick:()=>{T?De(k):(h&&h(k),ce(!1),Ee(!1))},className:`hfl-text-1 hfl-block hfl-px-4 hfl-py-2 hfl-rounded-md hover:hfl-bg-Blue-50 hfl-cursor-pointer custom_dropdown_item ${oe?"odd:hfl-bg-Gray-100":""} ${Ie?"hfl-bg-Blue-50 hfl-text-Blue-500":""}`,role:"menuitem","aria-selected":Ie,tabIndex:it?0:-1,ref:we=>{_e.current[$]=we},children:T?t.jsxRuntimeExports.jsx(t.Os,{size:"sm",disabled:!1,text:t.jsxRuntimeExports.jsx("span",{children:k.label}),secondaryText:"",id:`${k.label}-${$}`,isMarked:Z}):k.label},`${k.label}-${$}`):null}),w?.length===0&&M&&t.jsxRuntimeExports.jsx("li",{className:"hfl-block hfl-px-4 hfl-py-2 hfl-rounded-md hover:hfl-bg-Blue-50 hfl-cursor-pointer custom_dropdown_item",children:"No items found, please change the search criteria"})]})]})}var je,Fe;function ht(){if(Fe)return je;Fe=1;var o="Expected a function",r=NaN,v="[object Symbol]",c=/^\s+|\s+$/g,f=/^[-+]0x[0-9a-f]+$/i,y=/^0b[01]+$/i,m=/^0o[0-7]+$/i,n=parseInt,w=typeof t.commonjsGlobal=="object"&&t.commonjsGlobal&&t.commonjsGlobal.Object===Object&&t.commonjsGlobal,b=typeof self=="object"&&self&&self.Object===Object&&self,h=w||b||Function("return this")(),a=Object.prototype,g=a.toString,x=Math.max,s=Math.min,E=function(){return h.Date.now()};function S(R,I,T){var F,P,A,p,l,C,i=0,u=!1,O=!1,e=!0;if(typeof R!="function")throw new TypeError(o);I=W(I)||0,D(T)&&(u=!!T.leading,O="maxWait"in T,A=O?x(W(T.maxWait)||0,I):A,e="trailing"in T?!!T.trailing:e);function d(q){var X=F,ne=P;return F=P=void 0,i=q,p=R.apply(ne,X),p}function _(q){return i=q,l=setTimeout(H,I),u?d(q):p}function N(q){var X=q-C,ne=q-i,ie=I-X;return O?s(ie,A-ne):ie}function M(q){var X=q-C,ne=q-i;return C===void 0||X>=I||X<0||O&&ne>=A}function H(){var q=E();if(M(q))return V(q);l=setTimeout(H,N(q))}function V(q){return l=void 0,e&&F?d(q):(F=P=void 0,p)}function ee(){l!==void 0&&clearTimeout(l),i=0,F=C=P=l=void 0}function se(){return l===void 0?p:V(E())}function oe(){var q=E(),X=M(q);if(F=arguments,P=this,C=q,X){if(l===void 0)return _(C);if(O)return l=setTimeout(H,I),d(C)}return l===void 0&&(l=setTimeout(H,I)),p}return oe.cancel=ee,oe.flush=se,oe}function D(R){var I=typeof R;return!!R&&(I=="object"||I=="function")}function L(R){return!!R&&typeof R=="object"}function B(R){return typeof R=="symbol"||L(R)&&g.call(R)==v}function W(R){if(typeof R=="number")return R;if(B(R))return r;if(D(R)){var I=typeof R.valueOf=="function"?R.valueOf():R;R=D(I)?I+"":I}if(typeof R!="string")return R===0?R:+R;R=R.replace(c,"");var T=y.test(R);return T||m.test(R)?n(R.slice(2),T?2:8):f.test(R)?r:+R}return je=S,je}var mt=ht();const xt=t.getDefaultExportFromCjs(mt),Ce=(o,r)=>{const v=parseFloat(o),c=parseFloat(r);if(!o||!r||isNaN(v)||isNaN(c)||c===0)return"";const f=v/c;return Number.isInteger(f)?f.toString(10):f.toFixed(3).replace(/\.?0+$/,"")},te=o=>/^(\d+)?(\.)?(\d*)?$/.test(o),K=({label:o,children:r})=>t.jsxRuntimeExports.jsxs(t.bs,{variant:"Regular",type:"Text sm",className:"hfl-grid hfl-grid-cols-2 hfl-items-center hfl-text-Blue_gray-800 hfl-justify-between hfl-gap-8",children:[t.jsxRuntimeExports.jsxs("span",{className:"hfl-flex-shrink-0",children:[o,":"]}),t.jsxRuntimeExports.jsx("div",{className:"hfl-flex-1 hfl-min-w-0",children:r})]}),Y=({label:o,value:r})=>t.jsxRuntimeExports.jsxs(t.bs,{variant:"Regular",type:"Text sm",className:"hfl-flex hfl-text-Blue_gray-800 hfl-gap-1",children:[t.jsxRuntimeExports.jsxs("span",{className:"hfl-flex-shrink-0",children:[o,":"]}),t.jsxRuntimeExports.jsx(t.bs,{variant:"Bold",type:"Text sm",className:"hfl-text-Blue_gray-800 hfl-break-words hfl-min-w-0",children:r||"--"})]}),pe=({children:o,className:r=""})=>t.jsxRuntimeExports.jsx(t.bs,{variant:"Regular",type:"Text sm",className:`hfl-text-Blue_gray-800 hfl-px-2 hfl-break-words hfl-overflow-wrap-anywhere hfl-min-w-0 ${r}`,children:o}),gt=j.memo(function({rowData:r,isEditing:v,setIsEditing:c,onSaveRow:f,allowCustomMedicineInput:y}){const{variant:m,externallyTriggeredEditMode:n,externallyTriggeredEditRowIds:w,getMedicineOptions:b,onRowChange:h,onRowDelete:a}=Ye(),[g,x]=j.useState([]),[s,E]=j.useState(r),[S,D]=j.useState(r.medicine_name);j.useEffect(()=>{v||D(r.medicine_name)},[r.medicine_name,v]),j.useEffect(()=>{v||E(r)},[r,v]);const L=async e=>(await b?.(e))?.map(_=>({label:_.doctorMedicineName,value:_}))||[],W=n||w?.includes(r.rowId)||v,R=j.useMemo(()=>s.out_of_range||r.out_of_range,[s.out_of_range,r.out_of_range]),I=j.useMemo(()=>s?.isDosageMismatch||r?.isDosageMismatch,[s?.isDosageMismatch,r?.isDosageMismatch]),T=j.useMemo(()=>s.calculation_type===z.C_MedicineCalculatorList[0]?s.calculation_fields:null,[s.calculation_fields,s.calculation_type]),F=j.useMemo(()=>s.calculation_type===z.C_MedicineCalculatorList[1]?s.calculation_fields:null,[s.calculation_fields,s.calculation_type]),P=(e,d)=>{let _;if(e==="calculation_type"){const N=d,M={frequency:s.calculation_fields.frequency,pedia_dosage:m==="standard"?s.calculation_fields.pedia_dosage:s.pedia_dosage};_={...s,calculation_type:N,calculation_fields:N==="mg/kg/dose"?{...z.C_DefaultMgKgFields,...M}:{...z.C_DefaultMlKgFields,...M}}}else _={...s,[e]:d};E(_),m==="prescription"&&A(_,e)},A=j.useMemo(()=>xt((e,d)=>{h?.(e,d||void 0)},500),[h]),p=j.useMemo(()=>t.jsxRuntimeExports.jsxs("div",{className:"hfl-mb-1 hfl-flex hfl-w-max hfl-items-center hfl-rounded hfl-border-1 hfl-border-Warning-400 hfl-bg-Warning-50 hfl-p-1 hfl-px-2",children:[t.jsxRuntimeExports.jsx("div",{className:"hx_warning hfl-text-Error-400"}),t.jsxRuntimeExports.jsx(t.bs,{variant:"Regular",type:"Text sm",className:"hfl-px-2 hfl-text-1 hfl-text-Error-500",children:"Dosage exceed safety limits"})]}),[]);j.useEffect(()=>()=>{A.cancel()},[A]);const l=j.useCallback((e,d)=>{E(_=>{let N={..._.calculation_fields,[e]:d};if(e==="frequency"&&m==="standard"){const H=z.C_FrequencyDosageMap[d]||[];H.length>0&&(N={...N,pedia_dosage:H[0]})}const M={..._,calculation_fields:N};return m==="prescription"&&A(M,e),M})},[A,m]),C=async()=>{const e={...s,calculation_fields:{...s.calculation_fields}};await f?.(e)&&A({...e,isNewlyAdded:!1,isEditing:!1})},i=async()=>{if(!r.medicine_name||r.medicine_name.trim()===""){a?.(r.rowId);return}E(r),m==="standard"&&c(!1)},u=e=>m==="prescription"&&(e==="medicine_name"||e==="generic_name"||e==="type"||e==="calculation_type")?!1:W,O=()=>{const e=!(s?.isSavedToLibrary??!1),d={...s,isSavedToLibrary:e};E(d),A(d,"isSavedToLibrary")};return t.jsxRuntimeExports.jsxs("div",{className:`medicine-row hfl-grid hfl-grid-cols-[1.36fr_1.36fr_1.02fr_1.25fr_2.27fr_1.36fr_1.36fr] hfl-gap-2 hfl-px-2 hfl-py-1 hfl-border-b-1 hfl-border-Gray-200 ${W?"hfl-bg-gradient-to-b hfl-from-White_20 hfl-to-Primary-50":""} ${m==="prescription"&&!s.pedia_data_available?"hfl-hidden":""}`,children:[t.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:u("medicine_name")?t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",btnClassName:"hfl-w-full",inputClassName:"hfl-w-full",inputValue:s.medicine_name,showInput:!0,disableInputAutoSize:!0,inputChangeHandler:async e=>{if(P("medicine_name",e),e.trim()){const d=await L(e);x(d)}else x([])},onInputFocus:async()=>{const e=await L(s.medicine_name);x(e)},onChangeHandler:e=>{const d=e.value,_=z.C_MedicineTypeList.find(N=>N.val===d.medicineType);E(N=>({...N,medicine_name:d.doctorMedicineName,medicine_id:d.medicineId,generic_name:d.doctorGenericName,type:_?.type??""})),D(d.doctorMedicineName)},options:g,isSearchable:!0,placeholder:"Search medicine",disabled:!s?.isNewlyAdded,inputProps:{onBlur:e=>{const d=e.relatedTarget;if(!(d&&d.closest(".custom-dropdown-menu"))&&!y){const _=s.medicine_name?.trim()||"";g.some(M=>M.label===_)||E(M=>({...M,medicine_name:S}))}}}}):t.jsxRuntimeExports.jsx(pe,{children:r.medicine_name})}),t.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:u("generic_name")?t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",inputClassName:"hfl-w-full",btnClassName:"hfl-w-full",inputValue:s.generic_name,showInput:!0,disableInputAutoSize:!0,inputChangeHandler:e=>P("generic_name",e),hideDropdownIcon:!0}):t.jsxRuntimeExports.jsx(pe,{children:r.generic_name})}),t.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:u("type")?t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",btnClassName:"hfl-w-full",placeholder:"Select",showInput:!1,disableInputAutoSize:!0,selectedOption:(()=>{const e=z.C_MedicineTypeList.find(d=>d.type===s.type);return e?{label:e.type,value:e.type}:void 0})(),options:z.C_MedicineTypeList.map(e=>({label:e.type,value:e.type})),onChangeHandler:e=>P("type",e.value)}):t.jsxRuntimeExports.jsx(pe,{children:r.type||""})}),t.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:u("calculation_type")?t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",btnClassName:"hfl-w-full",placeholder:"Select",showInput:!1,disableInputAutoSize:!0,selectedOption:{label:s.calculation_type,value:s.calculation_type},options:z.C_MedicineCalculatorList.map(e=>({label:e,value:e})),onChangeHandler:e=>P("calculation_type",e.value)}):t.jsxRuntimeExports.jsx(pe,{children:r.calculation_type})}),t.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-w-full hfl-flex-col hfl-gap-2 hfl-py-2.5 hfl-px-2",children:u("calculation_fields")?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[T&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(K,{label:"Drug Strength",children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",placeholder:"e.g., 250",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:T.drug_strength||"",inputChangeHandler:e=>{te(e)&&l("drug_strength",e)}})}),t.jsxRuntimeExports.jsx(K,{label:"Dose/mg/kg",children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",placeholder:"e.g., 15",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:T.dose_mg_kg||"",inputChangeHandler:e=>{te(e)&&l("dose_mg_kg",e)}})}),t.jsxRuntimeExports.jsx(K,{label:"Frequency",children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",placeholder:"Frequency",showInput:!1,selectedOption:s.calculation_fields.frequency?{label:s.calculation_fields.frequency,value:s.calculation_fields.frequency}:void 0,options:z.C_MedicineFrequencyList.map(e=>({label:e,value:e})),onChangeHandler:e=>{l("frequency",e.value)}})}),t.jsxRuntimeExports.jsx(K,{label:"Max Dose (mg)",children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",placeholder:"Max mg/dose",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:T.max_mg_dose||"",inputChangeHandler:e=>{te(e)&&l("max_mg_dose",e)}})}),t.jsxRuntimeExports.jsx(K,{label:"Max Day (mg)",children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",placeholder:"Max mg/day",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:T.max_mg_day||"",inputChangeHandler:e=>{te(e)&&l("max_mg_day",e)}})})]}),F&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(K,{label:"Drug Strength/mL",children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",placeholder:"e.g., 250",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:F.drug_strength||"",inputChangeHandler:e=>{te(e)&&(l("drug_strength",e),l("dose_ml_kg",Ce(F.dose_mg_kg,e)))}})}),t.jsxRuntimeExports.jsx(K,{label:"Dose/mg/kg",children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",placeholder:"e.g., 15",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:F.dose_mg_kg||"",inputChangeHandler:e=>{te(e)&&(l("dose_mg_kg",e),l("dose_ml_kg",Ce(e,F.drug_strength)))}})}),t.jsxRuntimeExports.jsx(K,{label:"Dose/mL/kg",children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",disabled:!0,placeholder:"e.g., 5",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:Ce(F.dose_mg_kg,F.drug_strength)||"",inputChangeHandler:e=>{te(e)&&l("dose_ml_kg",e)}})}),t.jsxRuntimeExports.jsx(K,{label:"Frequency",children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",placeholder:"Frequency",showInput:!1,selectedOption:s.calculation_fields.frequency?{label:s.calculation_fields.frequency,value:s.calculation_fields.frequency}:void 0,options:z.C_MedicineFrequencyList.map(e=>({label:e,value:e})),onChangeHandler:e=>{l("frequency",e.value)}})}),t.jsxRuntimeExports.jsx(K,{label:"Max Dose (mL)",children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",placeholder:"Max mL/dose",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:F.max_ml_dose||"",inputChangeHandler:e=>{te(e)&&l("max_ml_dose",e)}})}),t.jsxRuntimeExports.jsx(K,{label:"Max Day (mL)",children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",placeholder:"Max mL/day",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:F.max_ml_day||"",inputChangeHandler:e=>{te(e)&&l("max_ml_day",e)}})})]})]}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[T&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(Y,{label:"Drug Strength",value:T.drug_strength}),t.jsxRuntimeExports.jsx(Y,{label:"Dose/mg/kg",value:T.dose_mg_kg}),t.jsxRuntimeExports.jsx(Y,{label:"Frequency",value:T.frequency}),t.jsxRuntimeExports.jsx(Y,{label:"Max Dose (mg)",value:T.max_mg_dose}),t.jsxRuntimeExports.jsx(Y,{label:"Max Day (mg)",value:T.max_mg_day})]}),F&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(Y,{label:"Drug Strength/mL",value:F.drug_strength}),t.jsxRuntimeExports.jsx(Y,{label:"Dose/mg/kg",value:F.dose_mg_kg}),t.jsxRuntimeExports.jsx(Y,{label:"Dose/mL/kg",value:F.dose_ml_kg}),t.jsxRuntimeExports.jsx(Y,{label:"Frequency",value:F.frequency}),t.jsxRuntimeExports.jsx(Y,{label:"Max Dose (mL)",value:F.max_ml_dose}),t.jsxRuntimeExports.jsx(Y,{label:"Max Day (mL)",value:F.max_ml_day})]})]})}),t.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:u("pedia_dosage")?(()=>{const e=s.calculation_fields.frequency,d=z.C_FrequencyDosageMap[e]||[];return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",btnClassName:"hfl-w-full",inputClassName:"hfl-w-full",placeholder:"Select",showInput:m!=="standard",disableInputAutoSize:!0,inputValue:m==="standard"?s.calculation_fields.pedia_dosage:s.pedia_dosage,inputChangeHandler:_=>m==="prescription"?P("pedia_dosage",_):l("pedia_dosage",_),selectedOption:m==="standard"?{label:s.calculation_fields.pedia_dosage,value:s.calculation_fields.pedia_dosage}:void 0,options:m!=="prescription"?d.map(_=>({label:_,value:_})):void 0,onChangeHandler:m!=="prescription"?_=>l("pedia_dosage",_.value):void 0,hideDropdownIcon:m==="prescription",showEmptyDropdownPopup:m!=="prescription",showErrorMsg:m==="prescription"?R||I:!1,errorMsg:m==="prescription"&&R?"Dosage Exceeds Safety Limits":m==="prescription"&&I?"Dosage is in mismatch with selected type of Frequency":""})})})():t.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-col hfl-h-full hfl-justify-between hfl-min-w-0",children:[t.jsxRuntimeExports.jsx(pe,{children:m==="prescription"?r.pedia_dosage:r.calculation_fields.pedia_dosage}),R&&p]})}),t.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:t.jsxRuntimeExports.jsx(ct,{effectiveEditMode:W,rowData:r,isSavedToLibrary:s.isSavedToLibrary??!1,onSave:C,onCancel:i,onEdit:()=>c(!0),onCheckboxToggle:O})})]})},(o,r)=>o.isEditing===r.isEditing&&o.rowData.rowId===r.rowData.rowId&&o.rowData.isEditing===r.rowData.isEditing&&o.rowData.medicine_name===r.rowData.medicine_name&&o.rowData.generic_name===r.rowData.generic_name&&o.rowData.type===r.rowData.type&&o.rowData.pedia_dosage===r.rowData.pedia_dosage&&o.rowData.calculation_type===r.rowData.calculation_type&&JSON.stringify(o.rowData.calculation_fields)===JSON.stringify(r.rowData.calculation_fields)&&o.rowData.out_of_range===r.rowData.out_of_range&&o.rowData.isDosageMismatch===r.rowData.isDosageMismatch&&o.rowData.calculation_fields.pedia_dosage===r.rowData.calculation_fields.pedia_dosage&&o.rowData?.isNewlyAdded===r.rowData?.isNewlyAdded&&o.rowData?.pedia_data_available===r.rowData?.pedia_data_available);var xe={exports:{}},re={},ge={exports:{}},G={},ve={exports:{}},ke;function Je(){return ke||(ke=1,function(o,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=h;/*!
|
|
10
|
+
* Adapted from jQuery UI core
|
|
11
|
+
*
|
|
12
|
+
* http://jqueryui.com
|
|
13
|
+
*
|
|
14
|
+
* Copyright 2014 jQuery Foundation and other contributors
|
|
15
|
+
* Released under the MIT license.
|
|
16
|
+
* http://jquery.org/license
|
|
17
|
+
*
|
|
18
|
+
* http://api.jqueryui.com/category/ui-core/
|
|
19
|
+
*/var v="none",c="contents",f=/^(input|select|textarea|button|object|iframe)$/;function y(a,g){return g.getPropertyValue("overflow")!=="visible"||a.scrollWidth<=0&&a.scrollHeight<=0}function m(a){var g=a.offsetWidth<=0&&a.offsetHeight<=0;if(g&&!a.innerHTML)return!0;try{var x=window.getComputedStyle(a),s=x.getPropertyValue("display");return g?s!==c&&y(a,x):s===v}catch{return console.warn("Failed to inspect element style"),!1}}function n(a){for(var g=a,x=a.getRootNode&&a.getRootNode();g&&g!==document.body;){if(x&&g===x&&(g=x.host.parentNode),m(g))return!1;g=g.parentNode}return!0}function w(a,g){var x=a.nodeName.toLowerCase(),s=f.test(x)&&!a.disabled||x==="a"&&a.href||g;return s&&n(a)}function b(a){var g=a.getAttribute("tabindex");g===null&&(g=void 0);var x=isNaN(g);return(x||g>=0)&&w(a,!x)}function h(a){var g=[].slice.call(a.querySelectorAll("*"),0).reduce(function(x,s){return x.concat(s.shadowRoot?h(s.shadowRoot):[s])},[]);return g.filter(b)}o.exports=r.default}(ve,ve.exports)),ve.exports}var Le;function vt(){if(Le)return G;Le=1,Object.defineProperty(G,"__esModule",{value:!0}),G.resetState=m,G.log=n,G.handleBlur=w,G.handleFocus=b,G.markForFocusLater=h,G.returnFocus=a,G.popWithoutFocus=g,G.setupScopedFocus=x,G.teardownScopedFocus=s;var o=Je(),r=v(o);function v(E){return E&&E.__esModule?E:{default:E}}var c=[],f=null,y=!1;function m(){c=[]}function n(){process.env.NODE_ENV!=="production"&&(console.log("focusManager ----------"),c.forEach(function(E){var S=E||{};console.log(S.nodeName,S.className,S.id)}),console.log("end focusManager ----------"))}function w(){y=!0}function b(){if(y){if(y=!1,!f)return;setTimeout(function(){if(!f.contains(document.activeElement)){var E=(0,r.default)(f)[0]||f;E.focus()}},0)}}function h(){c.push(document.activeElement)}function a(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,S=null;try{c.length!==0&&(S=c.pop(),S.focus({preventScroll:E}));return}catch{console.warn(["You tried to return focus to",S,"but it is not in the DOM anymore"].join(" "))}}function g(){c.length>0&&c.pop()}function x(E){f=E,window.addEventListener?(window.addEventListener("blur",w,!1),document.addEventListener("focus",b,!0)):(window.attachEvent("onBlur",w),document.attachEvent("onFocus",b))}function s(){f=null,window.addEventListener?(window.removeEventListener("blur",w),document.removeEventListener("focus",b)):(window.detachEvent("onBlur",w),document.detachEvent("onFocus",b))}return G}var ye={exports:{}},Ae;function yt(){return Ae||(Ae=1,function(o,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=m;var v=Je(),c=f(v);function f(n){return n&&n.__esModule?n:{default:n}}function y(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return n.activeElement.shadowRoot?y(n.activeElement.shadowRoot):n.activeElement}function m(n,w){var b=(0,c.default)(n);if(!b.length){w.preventDefault();return}var h=void 0,a=w.shiftKey,g=b[0],x=b[b.length-1],s=y();if(n===s){if(!a)return;h=x}if(x===s&&!a&&(h=g),g===s&&a&&(h=x),h){w.preventDefault(),h.focus();return}var E=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent),S=E!=null&&E[1]!="Chrome"&&/\biPod\b|\biPad\b/g.exec(navigator.userAgent)==null;if(S){var D=b.indexOf(s);if(D>-1&&(D+=a?-1:1),h=b[D],typeof h>"u"){w.preventDefault(),h=a?x:g,h.focus();return}w.preventDefault(),h.focus()}}o.exports=r.default}(ye,ye.exports)),ye.exports}var J={},Re,Pe;function bt(){if(Pe)return Re;Pe=1;var o=process.env.NODE_ENV!=="production",r=function(){};if(o){var v=function(f,y){var m=arguments.length;y=new Array(m>1?m-1:0);for(var n=1;n<m;n++)y[n-1]=arguments[n];var w=0,b="Warning: "+f.replace(/%s/g,function(){return y[w++]});typeof console<"u"&&console.error(b);try{throw new Error(b)}catch{}};r=function(c,f,y){var m=arguments.length;y=new Array(m>2?m-2:0);for(var n=2;n<m;n++)y[n-2]=arguments[n];if(f===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");c||v.apply(null,[f].concat(y))}}return Re=r,Re}var Q={},Oe={exports:{}};/*!
|
|
20
|
+
Copyright (c) 2015 Jed Watson.
|
|
21
|
+
Based on code that is Copyright 2013-2015, Facebook, Inc.
|
|
22
|
+
All rights reserved.
|
|
23
|
+
*/var qe;function _t(){return qe||(qe=1,function(o){(function(){var r=!!(typeof window<"u"&&window.document&&window.document.createElement),v={canUseDOM:r,canUseWorkers:typeof Worker<"u",canUseEventListeners:r&&!!(window.addEventListener||window.attachEvent),canUseViewport:r&&!!window.screen};o.exports?o.exports=v:window.ExecutionEnvironment=v})()}(Oe)),Oe.exports}var He;function Ne(){if(He)return Q;He=1,Object.defineProperty(Q,"__esModule",{value:!0}),Q.canUseDOM=Q.SafeNodeList=Q.SafeHTMLCollection=void 0;var o=_t(),r=v(o);function v(y){return y&&y.__esModule?y:{default:y}}var c=r.default,f=c.canUseDOM?window.HTMLElement:{};return Q.SafeHTMLCollection=c.canUseDOM?window.HTMLCollection:{},Q.SafeNodeList=c.canUseDOM?window.NodeList:{},Q.canUseDOM=c.canUseDOM,Q.default=f,Q}var We;function Xe(){if(We)return J;We=1,Object.defineProperty(J,"__esModule",{value:!0}),J.resetState=y,J.log=m,J.assertNodeList=n,J.setElement=w,J.validateElement=b,J.hide=h,J.show=a,J.documentNotReadyOrSSRTesting=g;var o=bt(),r=c(o),v=Ne();function c(x){return x&&x.__esModule?x:{default:x}}var f=null;function y(){f&&(f.removeAttribute?f.removeAttribute("aria-hidden"):f.length!=null?f.forEach(function(x){return x.removeAttribute("aria-hidden")}):document.querySelectorAll(f).forEach(function(x){return x.removeAttribute("aria-hidden")})),f=null}function m(){if(process.env.NODE_ENV!=="production"){var x=f||{};console.log("ariaAppHider ----------"),console.log(x.nodeName,x.className,x.id),console.log("end ariaAppHider ----------")}}function n(x,s){if(!x||!x.length)throw new Error("react-modal: No elements were found for selector "+s+".")}function w(x){var s=x;if(typeof s=="string"&&v.canUseDOM){var E=document.querySelectorAll(s);n(E,s),s=E}return f=s||f,f}function b(x){var s=x||f;return s?Array.isArray(s)||s instanceof HTMLCollection||s instanceof NodeList?s:[s]:((0,r.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),[])}function h(x){var s=!0,E=!1,S=void 0;try{for(var D=b(x)[Symbol.iterator](),L;!(s=(L=D.next()).done);s=!0){var B=L.value;B.setAttribute("aria-hidden","true")}}catch(W){E=!0,S=W}finally{try{!s&&D.return&&D.return()}finally{if(E)throw S}}}function a(x){var s=!0,E=!1,S=void 0;try{for(var D=b(x)[Symbol.iterator](),L;!(s=(L=D.next()).done);s=!0){var B=L.value;B.removeAttribute("aria-hidden")}}catch(W){E=!0,S=W}finally{try{!s&&D.return&&D.return()}finally{if(E)throw S}}}function g(){f=null}return J}var ae={},Be;function Et(){if(Be)return ae;Be=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.resetState=c,ae.log=f;var o={},r={};function v(b,h){b.classList.remove(h)}function c(){var b=document.getElementsByTagName("html")[0];for(var h in o)v(b,o[h]);var a=document.body;for(var g in r)v(a,r[g]);o={},r={}}function f(){if(process.env.NODE_ENV!=="production"){var b=document.getElementsByTagName("html")[0].className,h=`Show tracked classes:
|
|
24
|
+
|
|
25
|
+
`;h+="<html /> ("+b+`):
|
|
26
|
+
`;for(var a in o)h+=" "+a+" "+o[a]+`
|
|
27
|
+
`;b=document.body.className,h+=`
|
|
28
|
+
|
|
29
|
+
doc.body (`+b+`):
|
|
30
|
+
`;for(var g in r)h+=" "+g+" "+r[g]+`
|
|
31
|
+
`;h+=`
|
|
32
|
+
`,console.log(h)}}var y=function(h,a){return h[a]||(h[a]=0),h[a]+=1,a},m=function(h,a){return h[a]&&(h[a]-=1),a},n=function(h,a,g){g.forEach(function(x){y(a,x),h.add(x)})},w=function(h,a,g){g.forEach(function(x){m(a,x),a[x]===0&&h.remove(x)})};return ae.add=function(h,a){return n(h.classList,h.nodeName.toLowerCase()=="html"?o:r,a.split(" "))},ae.remove=function(h,a){return w(h.classList,h.nodeName.toLowerCase()=="html"?o:r,a.split(" "))},ae}var ue={},Ue;function Ze(){if(Ue)return ue;Ue=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.log=c,ue.resetState=f;function o(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")}var r=function y(){var m=this;o(this,y),this.register=function(n){if(m.openInstances.indexOf(n)!==-1){process.env.NODE_ENV!=="production"&&console.warn("React-Modal: Cannot register modal instance that's already open");return}m.openInstances.push(n),m.emit("register")},this.deregister=function(n){var w=m.openInstances.indexOf(n);if(w===-1){process.env.NODE_ENV!=="production"&&console.warn("React-Modal: Unable to deregister "+n+" as it was never registered");return}m.openInstances.splice(w,1),m.emit("deregister")},this.subscribe=function(n){m.subscribers.push(n)},this.emit=function(n){m.subscribers.forEach(function(w){return w(n,m.openInstances.slice())})},this.openInstances=[],this.subscribers=[]},v=new r;function c(){console.log("portalOpenInstances ----------"),console.log(v.openInstances.length),v.openInstances.forEach(function(y){return console.log(y)}),console.log("end portalOpenInstances ----------")}function f(){v=new r}return ue.default=v,ue}var he={},$e;function wt(){if($e)return he;$e=1,Object.defineProperty(he,"__esModule",{value:!0}),he.resetState=m,he.log=n;var o=Ze(),r=v(o);function v(h){return h&&h.__esModule?h:{default:h}}var c=void 0,f=void 0,y=[];function m(){for(var h=[c,f],a=0;a<h.length;a++){var g=h[a];g&&g.parentNode&&g.parentNode.removeChild(g)}c=f=null,y=[]}function n(){console.log("bodyTrap ----------"),console.log(y.length);for(var h=[c,f],a=0;a<h.length;a++){var g=h[a],x=g||{};console.log(x.nodeName,x.className,x.id)}console.log("edn bodyTrap ----------")}function w(){if(y.length===0){process.env.NODE_ENV!=="production"&&console.warn("React-Modal: Open instances > 0 expected");return}y[y.length-1].focusContent()}function b(h,a){!c&&!f&&(c=document.createElement("div"),c.setAttribute("data-react-modal-body-trap",""),c.style.position="absolute",c.style.opacity="0",c.setAttribute("tabindex","0"),c.addEventListener("focus",w),f=c.cloneNode(),f.addEventListener("focus",w)),y=a,y.length>0?(document.body.firstChild!==c&&document.body.insertBefore(c,document.body.firstChild),document.body.lastChild!==f&&document.body.appendChild(f)):(c.parentElement&&c.parentElement.removeChild(c),f.parentElement&&f.parentElement.removeChild(f))}return r.default.subscribe(b),he}var ze;function jt(){return ze||(ze=1,function(o,r){Object.defineProperty(r,"__esModule",{value:!0});var v=Object.assign||function(i){for(var u=1;u<arguments.length;u++){var O=arguments[u];for(var e in O)Object.prototype.hasOwnProperty.call(O,e)&&(i[e]=O[e])}return i},c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},f=function(){function i(u,O){for(var e=0;e<O.length;e++){var d=O[e];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(u,d.key,d)}}return function(u,O,e){return O&&i(u.prototype,O),e&&i(u,e),u}}(),y=j,m=t.requirePropTypes(),n=R(m),w=vt(),b=W(w),h=yt(),a=R(h),g=Xe(),x=W(g),s=Et(),E=W(s),S=Ne(),D=R(S),L=Ze(),B=R(L);wt();function W(i){if(i&&i.__esModule)return i;var u={};if(i!=null)for(var O in i)Object.prototype.hasOwnProperty.call(i,O)&&(u[O]=i[O]);return u.default=i,u}function R(i){return i&&i.__esModule?i:{default:i}}function I(i,u){if(!(i instanceof u))throw new TypeError("Cannot call a class as a function")}function T(i,u){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u&&(typeof u=="object"||typeof u=="function")?u:i}function F(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof u);i.prototype=Object.create(u&&u.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(i,u):i.__proto__=u)}var P={overlay:"ReactModal__Overlay",content:"ReactModal__Content"},A=function(u){return u.code==="Tab"||u.keyCode===9},p=function(u){return u.code==="Escape"||u.keyCode===27},l=0,C=function(i){F(u,i);function u(O){I(this,u);var e=T(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,O));return e.setOverlayRef=function(d){e.overlay=d,e.props.overlayRef&&e.props.overlayRef(d)},e.setContentRef=function(d){e.content=d,e.props.contentRef&&e.props.contentRef(d)},e.afterClose=function(){var d=e.props,_=d.appElement,N=d.ariaHideApp,M=d.htmlOpenClassName,H=d.bodyOpenClassName,V=d.parentSelector,ee=V&&V().ownerDocument||document;H&&E.remove(ee.body,H),M&&E.remove(ee.getElementsByTagName("html")[0],M),N&&l>0&&(l-=1,l===0&&x.show(_)),e.props.shouldFocusAfterRender&&(e.props.shouldReturnFocusAfterClose?(b.returnFocus(e.props.preventScroll),b.teardownScopedFocus()):b.popWithoutFocus()),e.props.onAfterClose&&e.props.onAfterClose(),B.default.deregister(e)},e.open=function(){e.beforeOpen(),e.state.afterOpen&&e.state.beforeClose?(clearTimeout(e.closeTimer),e.setState({beforeClose:!1})):(e.props.shouldFocusAfterRender&&(b.setupScopedFocus(e.node),b.markForFocusLater()),e.setState({isOpen:!0},function(){e.openAnimationFrame=requestAnimationFrame(function(){e.setState({afterOpen:!0}),e.props.isOpen&&e.props.onAfterOpen&&e.props.onAfterOpen({overlayEl:e.overlay,contentEl:e.content})})}))},e.close=function(){e.props.closeTimeoutMS>0?e.closeWithTimeout():e.closeWithoutTimeout()},e.focusContent=function(){return e.content&&!e.contentHasFocus()&&e.content.focus({preventScroll:!0})},e.closeWithTimeout=function(){var d=Date.now()+e.props.closeTimeoutMS;e.setState({beforeClose:!0,closesAt:d},function(){e.closeTimer=setTimeout(e.closeWithoutTimeout,e.state.closesAt-Date.now())})},e.closeWithoutTimeout=function(){e.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},e.afterClose)},e.handleKeyDown=function(d){A(d)&&(0,a.default)(e.content,d),e.props.shouldCloseOnEsc&&p(d)&&(d.stopPropagation(),e.requestClose(d))},e.handleOverlayOnClick=function(d){e.shouldClose===null&&(e.shouldClose=!0),e.shouldClose&&e.props.shouldCloseOnOverlayClick&&(e.ownerHandlesClose()?e.requestClose(d):e.focusContent()),e.shouldClose=null},e.handleContentOnMouseUp=function(){e.shouldClose=!1},e.handleOverlayOnMouseDown=function(d){!e.props.shouldCloseOnOverlayClick&&d.target==e.overlay&&d.preventDefault()},e.handleContentOnClick=function(){e.shouldClose=!1},e.handleContentOnMouseDown=function(){e.shouldClose=!1},e.requestClose=function(d){return e.ownerHandlesClose()&&e.props.onRequestClose(d)},e.ownerHandlesClose=function(){return e.props.onRequestClose},e.shouldBeClosed=function(){return!e.state.isOpen&&!e.state.beforeClose},e.contentHasFocus=function(){return document.activeElement===e.content||e.content.contains(document.activeElement)},e.buildClassName=function(d,_){var N=(typeof _>"u"?"undefined":c(_))==="object"?_:{base:P[d],afterOpen:P[d]+"--after-open",beforeClose:P[d]+"--before-close"},M=N.base;return e.state.afterOpen&&(M=M+" "+N.afterOpen),e.state.beforeClose&&(M=M+" "+N.beforeClose),typeof _=="string"&&_?M+" "+_:M},e.attributesFromObject=function(d,_){return Object.keys(_).reduce(function(N,M){return N[d+"-"+M]=_[M],N},{})},e.state={afterOpen:!1,beforeClose:!1},e.shouldClose=null,e.moveFromContentToOverlay=null,e}return f(u,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function(e,d){process.env.NODE_ENV!=="production"&&(e.bodyOpenClassName!==this.props.bodyOpenClassName&&console.warn('React-Modal: "bodyOpenClassName" prop has been modified. This may cause unexpected behavior when multiple modals are open.'),e.htmlOpenClassName!==this.props.htmlOpenClassName&&console.warn('React-Modal: "htmlOpenClassName" prop has been modified. This may cause unexpected behavior when multiple modals are open.')),this.props.isOpen&&!e.isOpen?this.open():!this.props.isOpen&&e.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!d.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer),cancelAnimationFrame(this.openAnimationFrame)}},{key:"beforeOpen",value:function(){var e=this.props,d=e.appElement,_=e.ariaHideApp,N=e.htmlOpenClassName,M=e.bodyOpenClassName,H=e.parentSelector,V=H&&H().ownerDocument||document;M&&E.add(V.body,M),N&&E.add(V.getElementsByTagName("html")[0],N),_&&(l+=1,x.hide(d)),B.default.register(this)}},{key:"render",value:function(){var e=this.props,d=e.id,_=e.className,N=e.overlayClassName,M=e.defaultStyles,H=e.children,V=_?{}:M.content,ee=N?{}:M.overlay;if(this.shouldBeClosed())return null;var se={ref:this.setOverlayRef,className:this.buildClassName("overlay",N),style:v({},ee,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},oe=v({id:d,ref:this.setContentRef,style:v({},V,this.props.style.content),className:this.buildClassName("content",_),tabIndex:"-1",onKeyDown:this.handleKeyDown,onMouseDown:this.handleContentOnMouseDown,onMouseUp:this.handleContentOnMouseUp,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.attributesFromObject("aria",v({modal:!0},this.props.aria)),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),q=this.props.contentElement(oe,H);return this.props.overlayElement(se,q)}}]),u}(y.Component);C.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}},C.propTypes={isOpen:n.default.bool.isRequired,defaultStyles:n.default.shape({content:n.default.object,overlay:n.default.object}),style:n.default.shape({content:n.default.object,overlay:n.default.object}),className:n.default.oneOfType([n.default.string,n.default.object]),overlayClassName:n.default.oneOfType([n.default.string,n.default.object]),parentSelector:n.default.func,bodyOpenClassName:n.default.string,htmlOpenClassName:n.default.string,ariaHideApp:n.default.bool,appElement:n.default.oneOfType([n.default.instanceOf(D.default),n.default.instanceOf(S.SafeHTMLCollection),n.default.instanceOf(S.SafeNodeList),n.default.arrayOf(n.default.instanceOf(D.default))]),onAfterOpen:n.default.func,onAfterClose:n.default.func,onRequestClose:n.default.func,closeTimeoutMS:n.default.number,shouldFocusAfterRender:n.default.bool,shouldCloseOnOverlayClick:n.default.bool,shouldReturnFocusAfterClose:n.default.bool,preventScroll:n.default.bool,role:n.default.string,contentLabel:n.default.string,aria:n.default.object,data:n.default.object,children:n.default.node,shouldCloseOnEsc:n.default.bool,overlayRef:n.default.func,contentRef:n.default.func,id:n.default.string,overlayElement:n.default.func,contentElement:n.default.func,testId:n.default.string},r.default=C,o.exports=r.default}(ge,ge.exports)),ge.exports}function Qe(){var o=this.constructor.getDerivedStateFromProps(this.props,this.state);o!=null&&this.setState(o)}function et(o){function r(v){var c=this.constructor.getDerivedStateFromProps(o,v);return c??null}this.setState(r.bind(this))}function tt(o,r){try{var v=this.props,c=this.state;this.props=o,this.state=r,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(v,c)}finally{this.props=v,this.state=c}}Qe.__suppressDeprecationWarning=!0;et.__suppressDeprecationWarning=!0;tt.__suppressDeprecationWarning=!0;function Ct(o){var r=o.prototype;if(!r||!r.isReactComponent)throw new Error("Can only polyfill class components");if(typeof o.getDerivedStateFromProps!="function"&&typeof r.getSnapshotBeforeUpdate!="function")return o;var v=null,c=null,f=null;if(typeof r.componentWillMount=="function"?v="componentWillMount":typeof r.UNSAFE_componentWillMount=="function"&&(v="UNSAFE_componentWillMount"),typeof r.componentWillReceiveProps=="function"?c="componentWillReceiveProps":typeof r.UNSAFE_componentWillReceiveProps=="function"&&(c="UNSAFE_componentWillReceiveProps"),typeof r.componentWillUpdate=="function"?f="componentWillUpdate":typeof r.UNSAFE_componentWillUpdate=="function"&&(f="UNSAFE_componentWillUpdate"),v!==null||c!==null||f!==null){var y=o.displayName||o.name,m=typeof o.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs.
|
|
33
|
+
|
|
34
|
+
`+y+" uses "+m+" but also contains the following legacy lifecycles:"+(v!==null?`
|
|
35
|
+
`+v:"")+(c!==null?`
|
|
36
|
+
`+c:"")+(f!==null?`
|
|
37
|
+
`+f:"")+`
|
|
38
|
+
|
|
39
|
+
The above lifecycles should be removed. Learn more about this warning here:
|
|
40
|
+
https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof o.getDerivedStateFromProps=="function"&&(r.componentWillMount=Qe,r.componentWillReceiveProps=et),typeof r.getSnapshotBeforeUpdate=="function"){if(typeof r.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");r.componentWillUpdate=tt;var n=r.componentDidUpdate;r.componentDidUpdate=function(b,h,a){var g=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:a;n.call(this,b,h,g)}}return o}const Rt=Object.freeze(Object.defineProperty({__proto__:null,polyfill:Ct},Symbol.toStringTag,{value:"Module"})),Ot=t.getAugmentedNamespace(Rt);var Ve;function Nt(){if(Ve)return re;Ve=1,Object.defineProperty(re,"__esModule",{value:!0}),re.bodyOpenClassName=re.portalClassName=void 0;var o=Object.assign||function(p){for(var l=1;l<arguments.length;l++){var C=arguments[l];for(var i in C)Object.prototype.hasOwnProperty.call(C,i)&&(p[i]=C[i])}return p},r=function(){function p(l,C){for(var i=0;i<C.length;i++){var u=C[i];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(l,u.key,u)}}return function(l,C,i){return C&&p(l.prototype,C),i&&p(l,i),l}}(),v=j,c=S(v),f=ut,y=S(f),m=t.requirePropTypes(),n=S(m),w=jt(),b=S(w),h=Xe(),a=E(h),g=Ne(),x=S(g),s=Ot;function E(p){if(p&&p.__esModule)return p;var l={};if(p!=null)for(var C in p)Object.prototype.hasOwnProperty.call(p,C)&&(l[C]=p[C]);return l.default=p,l}function S(p){return p&&p.__esModule?p:{default:p}}function D(p,l){if(!(p instanceof l))throw new TypeError("Cannot call a class as a function")}function L(p,l){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:p}function B(p,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);p.prototype=Object.create(l&&l.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(p,l):p.__proto__=l)}var W=re.portalClassName="ReactModalPortal",R=re.bodyOpenClassName="ReactModal__Body--open",I=g.canUseDOM&&y.default.createPortal!==void 0,T=function(l){return document.createElement(l)},F=function(){return I?y.default.createPortal:y.default.unstable_renderSubtreeIntoContainer};function P(p){return p()}var A=function(p){B(l,p);function l(){var C,i,u,O;D(this,l);for(var e=arguments.length,d=Array(e),_=0;_<e;_++)d[_]=arguments[_];return O=(i=(u=L(this,(C=l.__proto__||Object.getPrototypeOf(l)).call.apply(C,[this].concat(d))),u),u.removePortal=function(){!I&&y.default.unmountComponentAtNode(u.node);var N=P(u.props.parentSelector);N&&N.contains(u.node)?N.removeChild(u.node):console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.')},u.portalRef=function(N){u.portal=N},u.renderPortal=function(N){var M=F(),H=M(u,c.default.createElement(b.default,o({defaultStyles:l.defaultStyles},N)),u.node);u.portalRef(H)},i),L(u,O)}return r(l,[{key:"componentDidMount",value:function(){if(g.canUseDOM){I||(this.node=T("div")),this.node.className=this.props.portalClassName;var i=P(this.props.parentSelector);i.appendChild(this.node),!I&&this.renderPortal(this.props)}}},{key:"getSnapshotBeforeUpdate",value:function(i){var u=P(i.parentSelector),O=P(this.props.parentSelector);return{prevParent:u,nextParent:O}}},{key:"componentDidUpdate",value:function(i,u,O){if(g.canUseDOM){var e=this.props,d=e.isOpen,_=e.portalClassName;i.portalClassName!==_&&(this.node.className=_);var N=O.prevParent,M=O.nextParent;M!==N&&(N.removeChild(this.node),M.appendChild(this.node)),!(!i.isOpen&&!d)&&!I&&this.renderPortal(this.props)}}},{key:"componentWillUnmount",value:function(){if(!(!g.canUseDOM||!this.node||!this.portal)){var i=this.portal.state,u=Date.now(),O=i.isOpen&&this.props.closeTimeoutMS&&(i.closesAt||u+this.props.closeTimeoutMS);O?(i.beforeClose||this.portal.closeWithTimeout(),setTimeout(this.removePortal,O-u)):this.removePortal()}}},{key:"render",value:function(){if(!g.canUseDOM||!I)return null;!this.node&&I&&(this.node=T("div"));var i=F();return i(c.default.createElement(b.default,o({ref:this.portalRef,defaultStyles:l.defaultStyles},this.props)),this.node)}}],[{key:"setAppElement",value:function(i){a.setElement(i)}}]),l}(v.Component);return A.propTypes={isOpen:n.default.bool.isRequired,style:n.default.shape({content:n.default.object,overlay:n.default.object}),portalClassName:n.default.string,bodyOpenClassName:n.default.string,htmlOpenClassName:n.default.string,className:n.default.oneOfType([n.default.string,n.default.shape({base:n.default.string.isRequired,afterOpen:n.default.string.isRequired,beforeClose:n.default.string.isRequired})]),overlayClassName:n.default.oneOfType([n.default.string,n.default.shape({base:n.default.string.isRequired,afterOpen:n.default.string.isRequired,beforeClose:n.default.string.isRequired})]),appElement:n.default.oneOfType([n.default.instanceOf(x.default),n.default.instanceOf(g.SafeHTMLCollection),n.default.instanceOf(g.SafeNodeList),n.default.arrayOf(n.default.instanceOf(x.default))]),onAfterOpen:n.default.func,onRequestClose:n.default.func,closeTimeoutMS:n.default.number,ariaHideApp:n.default.bool,shouldFocusAfterRender:n.default.bool,shouldCloseOnOverlayClick:n.default.bool,shouldReturnFocusAfterClose:n.default.bool,preventScroll:n.default.bool,parentSelector:n.default.func,aria:n.default.object,data:n.default.object,role:n.default.string,contentLabel:n.default.string,shouldCloseOnEsc:n.default.bool,overlayRef:n.default.func,contentRef:n.default.func,id:n.default.string,overlayElement:n.default.func,contentElement:n.default.func},A.defaultProps={isOpen:!1,portalClassName:W,bodyOpenClassName:R,role:"dialog",ariaHideApp:!0,closeTimeoutMS:0,shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,shouldReturnFocusAfterClose:!0,preventScroll:!1,parentSelector:function(){return document.body},overlayElement:function(l,C){return c.default.createElement("div",l,C)},contentElement:function(l,C){return c.default.createElement("div",l,C)}},A.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},(0,s.polyfill)(A),process.env.NODE_ENV!=="production"&&(A.setCreateHTMLElement=function(p){return T=p}),re.default=A,re}var Ge;function St(){return Ge||(Ge=1,function(o,r){Object.defineProperty(r,"__esModule",{value:!0});var v=Nt(),c=f(v);function f(y){return y&&y.__esModule?y:{default:y}}r.default=c.default,o.exports=r.default}(xe,xe.exports)),xe.exports}var Mt=St();const nt=t.getDefaultExportFromCjs(Mt),Tt=o=>{const{openState:r,closePopupCallback:v,headingIconFile:c,headingText:f,subHeadingText:y,positiveButtonText:m,negativeButtonText:n,classNamePositiveBtn:w,classNameNegativeBtn:b,positiveActionCallback:h,negativeActionCallback:a}=o;return t.jsxRuntimeExports.jsxs(nt,{isOpen:r,onRequestClose:v,shouldCloseOnOverlayClick:!1,style:{overlay:{backgroundColor:"rgba(52, 64, 84, 0.5)",position:"fixed",alignContent:"center",justifyContent:"center",zIndex:1030,display:r?"block":"none"},content:{zIndex:1030,padding:"24px",maxWidth:"750px",maxHeight:"600px",width:"400px",height:"fit-content",margin:"auto",borderRadius:"12px",overflow:"unset",display:r?"block":"none"}},children:[c=="warning"&&t.jsxRuntimeExports.jsx("div",{className:"hfl-hx_warning hfl-mb-4 hfl-flex hfl-h-12 hfl-w-12 hfl-items-center hfl-justify-center hfl-rounded-full hfl-border-8 hfl-border-Warning-50 hfl-bg-Warning-100 hfl-text-Warning-600",children:t.jsxRuntimeExports.jsx("i",{className:"hx_warning hfl-text-5"})}),t.jsxRuntimeExports.jsx(t.bs,{variant:"Medium",type:"Text xl",className:"hfl-mt-5 hfl-text-Gray-900",children:f}),y&&t.jsxRuntimeExports.jsx(t.bs,{variant:"Regular",type:"Text sm",className:"hfl-mt-1 hfl-text-Gray-500 ",children:y}),t.jsxRuntimeExports.jsxs("div",{className:"hfl-mt-4 hfl-flex hfl-items-center hfl-justify-center hfl-gap-4",children:[n&&t.jsxRuntimeExports.jsx(t.Ku,{size:"md",textField:n,hierarchy:"Primary",className:b||"",onClick:a,"data-qa":"negative-action"}),m&&t.jsxRuntimeExports.jsx(t.Ku,{size:"md",textField:m,hierarchy:"Secondary",className:w||"",onClick:h,"data-qa":"positive-action"})]})]})},Dt=({open:o,onCancel:r,onCopySave:v,rowMedicineData:c,getMedicineOptions:f})=>{const[y,m]=j.useState([]),[n,w]=j.useState(""),[b,h]=j.useState([]),a=j.useCallback(async E=>{const D=(await f?.(E))?.map(L=>({label:L.doctorMedicineName,value:L}));h(D||[])},[f]);j.useEffect(()=>{o&&a(n)},[n,a,o]);const g=E=>{const S=E.value;y.some(L=>L.medicineId===S.medicineId&&L.doctorMedicineName.trim().toLowerCase()===S.doctorMedicineName.trim().toLowerCase())||m(L=>[...L,S]),w(""),h([])},x=E=>{m(S=>S.filter(D=>D.medicineId!==E))},s=async()=>{n.trim()||await a("")};return t.jsxRuntimeExports.jsxs(nt,{isOpen:o,onRequestClose:r,shouldCloseOnOverlayClick:!1,style:{overlay:{backgroundColor:"rgba(52, 64, 84, 0.5)",zIndex:1030},content:{zIndex:1031,maxWidth:"600px",maxHeight:"50vh",height:"auto",margin:"auto",borderRadius:"12px",padding:"0px",display:"flex",flexDirection:"column"}},children:[t.jsxRuntimeExports.jsx(t.bs,{variant:"Bold",type:"Text lg",className:"hfl-text-White hfl-bg-gradient_primary_600_500_90 hfl-px-6 hfl-py-2",children:"Please select medicine to copy"}),t.jsxRuntimeExports.jsxs("div",{className:"hfl-px-6 hfl-py-5 hfl-flex hfl-flex-col hfl-gap-6 hfl-overflow-y-auto hfl-flex-1",children:[t.jsxRuntimeExports.jsx(U,{inputValue:n,showInput:!0,isSearchable:!0,disableInputAutoSize:!0,inputChangeHandler:w,onChangeHandler:g,onInputFocus:s,options:b,placeholder:"Search for medicines"}),t.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-flex-wrap hfl-gap-2",children:y.map(E=>t.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center hfl-bg-Gray-100 hfl-px-2 hfl-py-0.5 hfl-rounded-md hfl-gap-1",children:[t.jsxRuntimeExports.jsx(t.bs,{variant:"Regular",type:"Text sm",className:"hfl-text-nowrap",children:E.doctorMedicineName}),t.jsxRuntimeExports.jsx("button",{className:"hfl-text-Blue_gray-800",onClick:()=>x(E.medicineId),children:t.jsxRuntimeExports.jsx("i",{className:"hx_close"})})]},E.doctorMedicineName+E.medicineId))})]}),t.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-justify-end hfl-gap-2.5 hfl-bg-Gray-50 hfl-px-7 hfl-py-3 hfl-border-t hfl-border-Gray-200",children:[t.jsxRuntimeExports.jsx(t.Ku,{size:"md",textField:"Cancel",onClick:r,hierarchy:"Secondary-Grey"}),t.jsxRuntimeExports.jsx(t.Ku,{size:"md",textField:"Save",disabled:!y||y.length==0,onClick:async()=>{await v(c,y)&&r()},className:"hfl-bg-Primary-600 hfl-text-White disabled:hfl-opacity-50 disabled:hfl-cursor-not-allowed",hierarchy:"Primary"})]})]})},It=j.forwardRef(({data:o=[],variant:r,externallyTriggeredEditRowIds:v=[],externallyTriggeredEditMode:c=!1,allowCustomMedicineInput:f=!0,getMedicineOptions:y,onRowChange:m,onRowDelete:n,onRowCopy:w,onSaveRow:b,externalSaveTrigger:h,setSearchDisabled:a},g)=>{const[x,s]=j.useState(null),[E,S]=j.useState(!1),[D,L]=j.useState(),B=j.useCallback((p,l,C)=>{const i=o.find(O=>O.rowId===p);if(!i)return;const u={...i,...l};m?.(u,C||void 0)},[o,m]),W=j.useCallback(async()=>{const p=o.filter(l=>l.isEditing&&l.medicine_name);if(p.length!==0)try{await b?.(p)&&p.forEach(C=>{m?.({...C,isEditing:!1})})}catch(l){console.error("Bulk save failed",l)}finally{a?.(!1)}},[o,b,m,a]);j.useEffect(()=>{h&&W()},[h,W]),j.useEffect(()=>{const p=o.some(l=>l.isEditing);a?.(p)},[o,a]);const R=j.useCallback(p=>{L(p),S(!0)},[]),I=j.useCallback(async()=>{if(x)try{await n?.(x)}catch(p){console.error("Delete failed",p)}finally{s(null)}},[x,n]),T=j.useCallback(()=>{s(null)},[]),F=j.useCallback(async p=>{try{return await b?.([p])?(m?.({...p,isEditing:!1}),!0):!1}catch(l){return console.error("Save row failed",l),!1}},[b,m]),P=j.useCallback(async()=>{const p=o.filter(l=>l.isEditing&&l.medicine_name);if(p.length===0)return!0;try{const l=await b?.(p);return l&&o.map(i=>i.isEditing?{...i,isEditing:!1}:i).forEach(i=>m?.(i)),!!l}catch(l){return console.error("External bulk save failed",l),!1}},[o,b,m]);j.useImperativeHandle(g,()=>({triggerExternalSave:P}));const A={variant:r,externallyTriggeredEditMode:c,externallyTriggeredEditRowIds:v,getMedicineOptions:y,onRowChange:(p,l)=>{B(p.rowId,p,l),m?.(p,l)},onRowDelete:n,onRowCopy:w,setRowToDelete:s,openPopupForRow:R};return t.jsxRuntimeExports.jsxs("div",{className:"hfl-border-1 hfl-border-Gray-200",children:[t.jsxRuntimeExports.jsx("div",{className:"table-header hfl-grid hfl-grid-cols-[1.36fr_1.36fr_1.02fr_1.25fr_2.27fr_1.36fr_1.36fr] hfl-gap-2 hfl-py-2 hfl-px-2 hfl-font-bold hfl-border-b-1 hfl-border-Gray-200 hfl-bg-Blue_gray-50",children:z.C_Table_Column_Name.map(p=>t.jsxRuntimeExports.jsx(t.bs,{variant:"Medium",type:"Text sm",className:"hfl-text-Blue_gray-600",children:p},p))}),t.jsxRuntimeExports.jsxs(Ke.Provider,{value:A,children:[t.jsxRuntimeExports.jsx("div",{className:"table-body",children:o.length===0?t.jsxRuntimeExports.jsx(t.bs,{variant:"Medium",type:"Text sm",className:"hfl-text-Blue_gray-600 hfl-px-2 hfl-py-3",children:"No medicines added"}):o.map(p=>t.jsxRuntimeExports.jsx(gt,{rowData:p,isEditing:p.isEditing||!1,setIsEditing:l=>B(p.rowId,{isEditing:l}),onSaveRow:F,allowCustomMedicineInput:f},p.rowId))}),t.jsxRuntimeExports.jsx(Tt,{headingText:"Delete Medicine",subHeadingText:"Are you sure you want to delete this medicine?",openState:!!x,positiveButtonText:"Delete",negativeButtonText:"Cancel",positiveActionCallback:I,negativeActionCallback:T,classNameNegativeBtn:"hfl-bg-Blue-600",classNamePositiveBtn:"hfl-bg-Error-500 hover:hfl-bg-Error-700 hfl-text-White",closePopupCallback:T}),t.jsxRuntimeExports.jsx(Dt,{open:E,onCancel:()=>S(!1),onCopySave:w,rowMedicineData:D,getMedicineOptions:y})]})]})});exports.PediatricsCalculatorTable=It;
|