hplx-feature-library 1.0.159 → 1.0.160
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/AlertPopup/index.js +5 -0
- package/dist/AlertPopup-CSD_rZzv.js +1069 -0
- package/dist/AlertPopup-DdrHGPKR.cjs +32 -0
- package/dist/AllInvestigations/components/AllInvestigationsTable.d.ts +19 -0
- package/dist/AllInvestigations/index.d.ts +1 -0
- package/dist/AllInvestigations/index.js +4 -0
- package/dist/AllInvestigations/utils/test-tange-util.d.ts +8 -0
- package/dist/AllInvestigationsTable-XjuW68nm.js +16963 -0
- package/dist/AllInvestigationsTable-pe1ZJejz.cjs +80 -0
- package/dist/Attachments/index.js +11153 -12657
- package/dist/CustomDropdown/index.js +256 -0
- package/dist/DateTimePicker/DateAndTimePicker/index.js +5907 -0
- package/dist/PediatricsCalculator/index.js +1 -1
- package/dist/PediatricsCalculatorTable-DGWlajqt.js +832 -0
- package/dist/PediatricsCalculatorTable-DSVe0_z0.cjs +1 -0
- package/dist/ReusableTable/ReusableTable.d.ts +3 -0
- package/dist/ReusableTable/ReusableTableConstants.d.ts +8 -0
- package/dist/ReusableTable/ReusableTableTypes.d.ts +96 -0
- package/dist/ReusableTable/components/EmptyTableContainer.d.ts +12 -0
- package/dist/ReusableTable/components/FilterCheckbox.d.ts +8 -0
- package/dist/ReusableTable/components/FilterDropdown.d.ts +17 -0
- package/dist/ReusableTable/components/Pagination.d.ts +2 -0
- package/dist/ReusableTable/components/TableBody.d.ts +2 -0
- package/dist/ReusableTable/components/TableCell.d.ts +3 -0
- package/dist/ReusableTable/components/TableFilterSelect.d.ts +12 -0
- package/dist/ReusableTable/components/TableHead.d.ts +2 -0
- package/dist/ReusableTable/components/TableMain.d.ts +2 -0
- package/dist/ReusableTable/components/TableRow.d.ts +3 -0
- package/dist/ReusableTable/context/TableContext.d.ts +21 -0
- package/dist/ReusableTable/context/TableContextBase.d.ts +26 -0
- package/dist/ReusableTable/context/useTableContext.d.ts +2 -0
- package/dist/ToggleButtons/index.js +17 -0
- package/dist/TrendGraphs/AreaChartComponent.d.ts +9 -0
- package/dist/TrendGraphs/LineChartComponent/DataPointToolTip.d.ts +16 -0
- package/dist/TrendGraphs/LineChartComponent/LineChartBody.d.ts +2 -0
- package/dist/TrendGraphs/LineChartComponent/LineChartHeader.d.ts +2 -0
- package/dist/TrendGraphs/LineChartComponent/index.d.ts +2 -0
- package/dist/TrendGraphs/context/index.d.ts +2 -0
- package/dist/TrendGraphs/hooks/useTrendGraphContext.d.ts +2 -0
- package/dist/TrendGraphs/utils/index.d.ts +4 -0
- package/dist/common/APIAction/APIAction.d.ts +55 -0
- package/dist/common/components/BorderFullWidth.d.ts +2 -0
- package/dist/common/components/table/ExistingPatients.d.ts +17 -0
- package/dist/common/editRibbon/EditRibbon.d.ts +9 -0
- package/dist/common/utils/NetworkInstance.d.ts +4 -0
- package/dist/common/utils/common-utils.d.ts +38 -0
- package/dist/components/Modal.d.ts +5 -0
- package/dist/components/PatientAddEdit.d.ts +3 -0
- package/dist/components/alertPopup/index.d.ts +1 -0
- package/dist/components/{CustomDropdown.d.ts → customDropdown/CustomDropdown.d.ts} +1 -1
- package/dist/components/customDropdown/index.d.ts +1 -0
- package/dist/components/dateTimePicker/DateAndTimePicker.d.ts +21 -0
- package/dist/components/dateTimePicker/index.d.ts +1 -0
- package/dist/components/{ToggleButtons.d.ts → toggleButtons/ToggleButtons.d.ts} +1 -1
- package/dist/components/toggleButtons/index.d.ts +1 -0
- package/dist/constants/CommonConstant.d.ts +58 -0
- package/dist/constants/TrendGraphsConstants.d.ts +2 -0
- package/dist/dayjs.min-DQn5T5hy.js +298 -0
- package/dist/dayjs.min-DvmTfmHo.cjs +1 -0
- package/dist/hplx-feature-library.css +1 -1
- package/dist/{useOutsideClick-CYAjbj1N.js → index-4whwJbrk.js} +812 -823
- package/dist/{useOutsideClick-COATBT9j.cjs → index-C6KQLMQs.cjs} +23 -23
- package/dist/index-CJFGOBPb.js +122 -0
- package/dist/index-DfcUmlge.cjs +17 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +12 -2
- package/dist/parseISO-AwyR5Nhg.cjs +1 -0
- package/dist/parseISO-Cso9HWPX.js +1414 -0
- package/dist/types/APIEndPoints.d.ts +11 -0
- package/dist/types/AllInvestigationTypes/index.js +4 -0
- package/dist/types/AllInvestigationTypes.d.ts +45 -0
- package/dist/types/ApiResponseTypes.d.ts +249 -0
- package/dist/types/CommonTypes.d.ts +228 -0
- package/dist/types/PatientAddEditTypes.d.ts +13 -0
- package/dist/types/TrendGraphTypes.d.ts +19 -0
- package/dist/useClickOutside-BjJyGTec.js +14 -0
- package/dist/useClickOutside-DsVG12Cs.cjs +1 -0
- package/dist/useOutsideClick-C4Q0aGuf.js +15 -0
- package/dist/useOutsideClick-CicUjzPP.cjs +1 -0
- package/package.json +45 -3
- package/dist/PediatricsCalculatorTable-BglWcUGO.cjs +0 -40
- package/dist/PediatricsCalculatorTable-Dwluo5W0.js +0 -2163
- /package/dist/components/{AlertPopup.d.ts → alertPopup/AlertPopup.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./index-C6KQLMQs.cjs"),c=require("react"),k=require("./constants/PediatricsCalculatorConstants/index.js"),g=require("./CustomDropdown/index.js"),se=require("./AlertPopup-DdrHGPKR.cjs"),le=c.createContext(null),ne=()=>{const i=c.useContext(le);if(!i)throw new Error("usePediatricsCalculatorTableContext must be used inside a MedicineTableProvider");return i},re=({effectiveEditMode:i,rowData:s,isSavedToLibrary:j,onSave:_,onCancel:b,onEdit:E,onCheckboxToggle:o})=>{const{variant:w,externallyTriggeredEditMode:L,setRowToDelete:R,openPopupForRow:D}=ne();return w==="standard"?i?e.jsxRuntimeExports.jsxs("div",{className:"hfl-grid hfl-grid-cols-[1fr_1fr] hfl-border-1 hfl-border-Gray-200 hfl-rounded-lg ",children:[e.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:_,children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text xs",className:"hfl-text-Blue_gray-800",children:"Save"})}),e.jsxRuntimeExports.jsx("button",{className:"hfl-px-3 hfl-py-2 hfl-text-Error-600 hover:hfl-bg-Error-50",onClick:b,children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text xs",className:"",children:"Cancel"})})]}):e.jsxRuntimeExports.jsxs("div",{className:"hfl-grid hfl-grid-cols-[1fr_1fr_1fr] hfl-border-1 hfl-border-Gray-200 hfl-rounded-lg",children:[e.jsxRuntimeExports.jsx("button",{className:"hfl-px-3 hfl-py-1 hfl-text-Blue_gray-800 hover:hfl-bg-Primary-50",onClick:E,children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text xs",className:"",children:"Edit"})}),e.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:()=>D?.(s),children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text xs",className:"",children:"Copy"})}),e.jsxRuntimeExports.jsx("button",{className:"hx_delete hfl-px-3 hfl-py-2 hfl-text-Error-500 hover:hfl-bg-Error-50",onClick:()=>R?.(s.rowId)})]}):e.jsxRuntimeExports.jsx(e.Os,{disabled:!L,text:"Save this to Pediatric Calculator Library ",id:s.rowId,size:"md",onClick:o,isMarked:j??!1,checkboxClasses:"hfl-mt-2",checkBoxInnerDivClasses:"hfl-text-Blue-600 hfl-bg-Blue-50"},s.rowId)};var Q,te;function oe(){if(te)return Q;te=1;var i="Expected a function",s=NaN,j="[object Symbol]",_=/^\s+|\s+$/g,b=/^[-+]0x[0-9a-f]+$/i,E=/^0b[01]+$/i,o=/^0o[0-7]+$/i,w=parseInt,L=typeof e.commonjsGlobal=="object"&&e.commonjsGlobal&&e.commonjsGlobal.Object===Object&&e.commonjsGlobal,R=typeof self=="object"&&self&&self.Object===Object&&self,D=L||R||Function("return this")(),F=Object.prototype,W=F.toString,O=Math.max,n=Math.min,d=function(){return D.Date.now()};function N(a,m,x){var f,T,v,r,l,I,y=0,A=!1,V=!1,t=!0;if(typeof a!="function")throw new TypeError(i);m=z(m)||0,M(x)&&(A=!!x.leading,V="maxWait"in x,v=V?O(z(x.maxWait)||0,m):v,t="trailing"in x?!!x.trailing:t);function u(h){var $=f,J=T;return f=T=void 0,y=h,r=a.apply(J,$),r}function p(h){return y=h,l=setTimeout(P,m),A?u(h):r}function S(h){var $=h-I,J=h-y,ee=m-$;return V?n(ee,v-J):ee}function q(h){var $=h-I,J=h-y;return I===void 0||$>=m||$<0||V&&J>=v}function P(){var h=d();if(q(h))return Z(h);l=setTimeout(P,S(h))}function Z(h){return l=void 0,t&&f?u(h):(f=T=void 0,r)}function ie(){l!==void 0&&clearTimeout(l),y=0,f=I=T=l=void 0}function ae(){return l===void 0?r:Z(d())}function X(){var h=d(),$=q(h);if(f=arguments,T=this,I=h,$){if(l===void 0)return p(I);if(V)return l=setTimeout(P,m),u(I)}return l===void 0&&(l=setTimeout(P,m)),r}return X.cancel=ie,X.flush=ae,X}function M(a){var m=typeof a;return!!a&&(m=="object"||m=="function")}function C(a){return!!a&&typeof a=="object"}function K(a){return typeof a=="symbol"||C(a)&&W.call(a)==j}function z(a){if(typeof a=="number")return a;if(K(a))return s;if(M(a)){var m=typeof a.valueOf=="function"?a.valueOf():a;a=M(m)?m+"":m}if(typeof a!="string")return a===0?a:+a;a=a.replace(_,"");var x=E.test(a);return x||o.test(a)?w(a.slice(2),x?2:8):b.test(a)?s:+a}return Q=N,Q}var ce=oe();const ue=e.getDefaultExportFromCjs(ce),Y=(i,s)=>{const j=parseFloat(i),_=parseFloat(s);if(!i||!s||isNaN(j)||isNaN(_)||_===0)return"";const b=j/_;return Number.isInteger(b)?b.toString(10):b.toFixed(3).replace(/\.?0+$/,"")},G=i=>/^(\d+)?(\.)?(\d*)?$/.test(i),B=({label:i,children:s})=>e.jsxRuntimeExports.jsxs(e.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:[e.jsxRuntimeExports.jsxs("span",{className:"hfl-flex-shrink-0",children:[i,":"]}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex-1 hfl-min-w-0",children:s})]}),H=({label:i,value:s})=>e.jsxRuntimeExports.jsxs(e.bs,{variant:"Regular",type:"Text sm",className:"hfl-flex hfl-text-Blue_gray-800 hfl-gap-1",children:[e.jsxRuntimeExports.jsxs("span",{className:"hfl-flex-shrink-0",children:[i,":"]}),e.jsxRuntimeExports.jsx(e.bs,{variant:"Bold",type:"Text sm",className:"hfl-text-Blue_gray-800 hfl-break-words hfl-min-w-0",children:s||"--"})]}),U=({children:i,className:s=""})=>e.jsxRuntimeExports.jsx(e.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 ${s}`,children:i}),de=c.memo(function({rowData:s,isEditing:j,setIsEditing:_,onSaveRow:b,allowCustomMedicineInput:E}){const{variant:o,externallyTriggeredEditMode:w,externallyTriggeredEditRowIds:L,getMedicineOptions:R,onRowChange:D,onRowDelete:F}=ne(),[W,O]=c.useState([]),[n,d]=c.useState(s),[N,M]=c.useState(s.medicine_name);c.useEffect(()=>{j||M(s.medicine_name)},[s.medicine_name,j]),c.useEffect(()=>{j||d(s)},[s,j]);const C=async t=>(await R?.(t))?.map(p=>({label:p.doctorMedicineName,value:p}))||[],z=w||L?.includes(s.rowId)||j,a=c.useMemo(()=>n.out_of_range||s.out_of_range,[n.out_of_range,s.out_of_range]),m=c.useMemo(()=>n?.isDosageMismatch||s?.isDosageMismatch,[n?.isDosageMismatch,s?.isDosageMismatch]),x=c.useMemo(()=>n.calculation_type===k.C_MedicineCalculatorList[0]?n.calculation_fields:null,[n.calculation_fields,n.calculation_type]),f=c.useMemo(()=>n.calculation_type===k.C_MedicineCalculatorList[1]?n.calculation_fields:null,[n.calculation_fields,n.calculation_type]),T=(t,u)=>{let p;if(t==="calculation_type"){const S=u,q={frequency:n.calculation_fields.frequency,pedia_dosage:o==="standard"?n.calculation_fields.pedia_dosage:n.pedia_dosage};p={...n,calculation_type:S,calculation_fields:S==="mg/kg/dose"?{...k.C_DefaultMgKgFields,...q}:{...k.C_DefaultMlKgFields,...q}}}else p={...n,[t]:u};d(p),o==="prescription"&&v(p,t)},v=c.useMemo(()=>ue((t,u)=>{D?.(t,u||void 0)},500),[D]),r=c.useMemo(()=>e.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:[e.jsxRuntimeExports.jsx("div",{className:"hx_warning hfl-text-Error-400"}),e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text sm",className:"hfl-px-2 hfl-text-1 hfl-text-Error-500",children:"Dosage exceed safety limits"})]}),[]);c.useEffect(()=>()=>{v.cancel()},[v]);const l=c.useCallback((t,u)=>{d(p=>{let S={...p.calculation_fields,[t]:u};if(t==="frequency"&&o==="standard"){const P=k.C_FrequencyDosageMap[u]||[];P.length>0&&(S={...S,pedia_dosage:P[0]})}const q={...p,calculation_fields:S};return o==="prescription"&&v(q,t),q})},[v,o]),I=async()=>{const t={...n,calculation_fields:{...n.calculation_fields}};await b?.(t)&&v({...t,isNewlyAdded:!1,isEditing:!1})},y=async()=>{if(!s.medicine_name||s.medicine_name.trim()===""){F?.(s.rowId);return}d(s),o==="standard"&&_(!1)},A=t=>o==="prescription"&&(t==="medicine_name"||t==="generic_name"||t==="type"||t==="calculation_type")?!1:z,V=()=>{const t=!(n?.isSavedToLibrary??!1),u={...n,isSavedToLibrary:t};d(u),v(u,"isSavedToLibrary")};return e.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 ${z?"hfl-bg-gradient-to-b hfl-from-White_20 hfl-to-Primary-50":""} ${o==="prescription"&&!n.pedia_data_available?"hfl-hidden":""}`,children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:A("medicine_name")?e.jsxRuntimeExports.jsx(g,{wrapperClass:"hfl-w-full",btnClassName:"hfl-w-full",inputClassName:"hfl-w-full",inputValue:n.medicine_name,showInput:!0,disableInputAutoSize:!0,inputChangeHandler:async t=>{if(T("medicine_name",t),t.trim()){const u=await C(t);O(u)}else O([])},onInputFocus:async()=>{const t=await C(n.medicine_name);O(t)},onChangeHandler:t=>{const u=t.value,p=k.C_MedicineTypeList.find(S=>S.val===u.medicineType);d(S=>({...S,medicine_name:u.doctorMedicineName,medicine_id:u.medicineId,generic_name:u.doctorGenericName,type:p?.type??""})),M(u.doctorMedicineName)},options:W,isSearchable:!0,placeholder:"Search medicine",disabled:!n?.isNewlyAdded,inputProps:{onBlur:t=>{const u=t.relatedTarget;if(!(u&&u.closest(".custom-dropdown-menu"))&&!E){const p=n.medicine_name?.trim()||"";W.some(q=>q.label===p)||d(q=>({...q,medicine_name:N}))}}}}):e.jsxRuntimeExports.jsx(U,{children:s.medicine_name})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:A("generic_name")?e.jsxRuntimeExports.jsx(g,{wrapperClass:"hfl-w-full",inputClassName:"hfl-w-full",btnClassName:"hfl-w-full",inputValue:n.generic_name,showInput:!0,disableInputAutoSize:!0,inputChangeHandler:t=>T("generic_name",t),hideDropdownIcon:!0}):e.jsxRuntimeExports.jsx(U,{children:s.generic_name})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:A("type")?e.jsxRuntimeExports.jsx(g,{wrapperClass:"hfl-w-full",btnClassName:"hfl-w-full",placeholder:"Select",showInput:!1,disableInputAutoSize:!0,selectedOption:(()=>{const t=k.C_MedicineTypeList.find(u=>u.type===n.type);return t?{label:t.type,value:t.type}:void 0})(),options:k.C_MedicineTypeList.map(t=>({label:t.type,value:t.type})),onChangeHandler:t=>T("type",t.value)}):e.jsxRuntimeExports.jsx(U,{children:s.type||""})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:A("calculation_type")?e.jsxRuntimeExports.jsx(g,{wrapperClass:"hfl-w-full",btnClassName:"hfl-w-full",placeholder:"Select",showInput:!1,disableInputAutoSize:!0,selectedOption:{label:n.calculation_type,value:n.calculation_type},options:k.C_MedicineCalculatorList.map(t=>({label:t,value:t})),onChangeHandler:t=>T("calculation_type",t.value)}):e.jsxRuntimeExports.jsx(U,{children:s.calculation_type})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-w-full hfl-flex-col hfl-gap-2 hfl-py-2.5 hfl-px-2",children:A("calculation_fields")?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[x&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(B,{label:"Drug Strength",children:e.jsxRuntimeExports.jsx(g,{wrapperClass:"hfl-w-full",placeholder:"e.g., 250",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:x.drug_strength||"",inputChangeHandler:t=>{G(t)&&l("drug_strength",t)}})}),e.jsxRuntimeExports.jsx(B,{label:"Dose/mg/kg",children:e.jsxRuntimeExports.jsx(g,{wrapperClass:"hfl-w-full",placeholder:"e.g., 15",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:x.dose_mg_kg||"",inputChangeHandler:t=>{G(t)&&l("dose_mg_kg",t)}})}),e.jsxRuntimeExports.jsx(B,{label:"Frequency",children:e.jsxRuntimeExports.jsx(g,{wrapperClass:"hfl-w-full",placeholder:"Frequency",showInput:!1,selectedOption:n.calculation_fields.frequency?{label:n.calculation_fields.frequency,value:n.calculation_fields.frequency}:void 0,options:k.C_MedicineFrequencyList.map(t=>({label:t,value:t})),onChangeHandler:t=>{l("frequency",t.value)}})}),e.jsxRuntimeExports.jsx(B,{label:"Max Dose (mg)",children:e.jsxRuntimeExports.jsx(g,{wrapperClass:"hfl-w-full",placeholder:"Max mg/dose",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:x.max_mg_dose||"",inputChangeHandler:t=>{G(t)&&l("max_mg_dose",t)}})}),e.jsxRuntimeExports.jsx(B,{label:"Max Day (mg)",children:e.jsxRuntimeExports.jsx(g,{wrapperClass:"hfl-w-full",placeholder:"Max mg/day",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:x.max_mg_day||"",inputChangeHandler:t=>{G(t)&&l("max_mg_day",t)}})})]}),f&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(B,{label:"Drug Strength/mL",children:e.jsxRuntimeExports.jsx(g,{wrapperClass:"hfl-w-full",placeholder:"e.g., 250",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:f.drug_strength||"",inputChangeHandler:t=>{G(t)&&(l("drug_strength",t),l("dose_ml_kg",Y(f.dose_mg_kg,t)))}})}),e.jsxRuntimeExports.jsx(B,{label:"Dose/mg/kg",children:e.jsxRuntimeExports.jsx(g,{wrapperClass:"hfl-w-full",placeholder:"e.g., 15",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:f.dose_mg_kg||"",inputChangeHandler:t=>{G(t)&&(l("dose_mg_kg",t),l("dose_ml_kg",Y(t,f.drug_strength)))}})}),e.jsxRuntimeExports.jsx(B,{label:"Dose/mL/kg",children:e.jsxRuntimeExports.jsx(g,{wrapperClass:"hfl-w-full",disabled:!0,placeholder:"e.g., 5",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:Y(f.dose_mg_kg,f.drug_strength)||"",inputChangeHandler:t=>{G(t)&&l("dose_ml_kg",t)}})}),e.jsxRuntimeExports.jsx(B,{label:"Frequency",children:e.jsxRuntimeExports.jsx(g,{wrapperClass:"hfl-w-full",placeholder:"Frequency",showInput:!1,selectedOption:n.calculation_fields.frequency?{label:n.calculation_fields.frequency,value:n.calculation_fields.frequency}:void 0,options:k.C_MedicineFrequencyList.map(t=>({label:t,value:t})),onChangeHandler:t=>{l("frequency",t.value)}})}),e.jsxRuntimeExports.jsx(B,{label:"Max Dose (mL)",children:e.jsxRuntimeExports.jsx(g,{wrapperClass:"hfl-w-full",placeholder:"Max mL/dose",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:f.max_ml_dose||"",inputChangeHandler:t=>{G(t)&&l("max_ml_dose",t)}})}),e.jsxRuntimeExports.jsx(B,{label:"Max Day (mL)",children:e.jsxRuntimeExports.jsx(g,{wrapperClass:"hfl-w-full",placeholder:"Max mL/day",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:f.max_ml_day||"",inputChangeHandler:t=>{G(t)&&l("max_ml_day",t)}})})]})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[x&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(H,{label:"Drug Strength",value:x.drug_strength}),e.jsxRuntimeExports.jsx(H,{label:"Dose/mg/kg",value:x.dose_mg_kg}),e.jsxRuntimeExports.jsx(H,{label:"Frequency",value:x.frequency}),e.jsxRuntimeExports.jsx(H,{label:"Max Dose (mg)",value:x.max_mg_dose}),e.jsxRuntimeExports.jsx(H,{label:"Max Day (mg)",value:x.max_mg_day})]}),f&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(H,{label:"Drug Strength/mL",value:f.drug_strength}),e.jsxRuntimeExports.jsx(H,{label:"Dose/mg/kg",value:f.dose_mg_kg}),e.jsxRuntimeExports.jsx(H,{label:"Dose/mL/kg",value:f.dose_ml_kg}),e.jsxRuntimeExports.jsx(H,{label:"Frequency",value:f.frequency}),e.jsxRuntimeExports.jsx(H,{label:"Max Dose (mL)",value:f.max_ml_dose}),e.jsxRuntimeExports.jsx(H,{label:"Max Day (mL)",value:f.max_ml_day})]})]})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:A("pedia_dosage")?(()=>{const t=n.calculation_fields.frequency,u=k.C_FrequencyDosageMap[t]||[];return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(g,{wrapperClass:"hfl-w-full",btnClassName:"hfl-w-full",inputClassName:"hfl-w-full",placeholder:"Select",showInput:o!=="standard",disableInputAutoSize:!0,inputValue:o==="standard"?n.calculation_fields.pedia_dosage:n.pedia_dosage,inputChangeHandler:p=>o==="prescription"?T("pedia_dosage",p):l("pedia_dosage",p),selectedOption:o==="standard"?{label:n.calculation_fields.pedia_dosage,value:n.calculation_fields.pedia_dosage}:void 0,options:o!=="prescription"?u.map(p=>({label:p,value:p})):void 0,onChangeHandler:o!=="prescription"?p=>l("pedia_dosage",p.value):void 0,hideDropdownIcon:o==="prescription",showEmptyDropdownPopup:o!=="prescription",showErrorMsg:o==="prescription"?a||m:!1,errorMsg:o==="prescription"&&a?"Dosage Exceeds Safety Limits":o==="prescription"&&m?"Dosage is in mismatch with selected type of Frequency":""})})})():e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-col hfl-h-full hfl-justify-between hfl-min-w-0",children:[e.jsxRuntimeExports.jsx(U,{children:o==="prescription"?s.pedia_dosage:s.calculation_fields.pedia_dosage}),a&&r]})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:e.jsxRuntimeExports.jsx(re,{effectiveEditMode:z,rowData:s,isSavedToLibrary:n.isSavedToLibrary??!1,onSave:I,onCancel:y,onEdit:()=>_(!0),onCheckboxToggle:V})})]})},(i,s)=>i.isEditing===s.isEditing&&i.rowData.rowId===s.rowData.rowId&&i.rowData.isEditing===s.rowData.isEditing&&i.rowData.medicine_name===s.rowData.medicine_name&&i.rowData.generic_name===s.rowData.generic_name&&i.rowData.type===s.rowData.type&&i.rowData.pedia_dosage===s.rowData.pedia_dosage&&i.rowData.calculation_type===s.rowData.calculation_type&&JSON.stringify(i.rowData.calculation_fields)===JSON.stringify(s.rowData.calculation_fields)&&i.rowData.out_of_range===s.rowData.out_of_range&&i.rowData.isDosageMismatch===s.rowData.isDosageMismatch&&i.rowData.calculation_fields.pedia_dosage===s.rowData.calculation_fields.pedia_dosage&&i.rowData?.isNewlyAdded===s.rowData?.isNewlyAdded&&i.rowData?.pedia_data_available===s.rowData?.pedia_data_available),fe=({open:i,onCancel:s,onCopySave:j,rowMedicineData:_,getMedicineOptions:b})=>{const[E,o]=c.useState([]),[w,L]=c.useState(""),[R,D]=c.useState([]),F=c.useCallback(async d=>{const M=(await b?.(d))?.map(C=>({label:C.doctorMedicineName,value:C}));D(M||[])},[b]);c.useEffect(()=>{i&&F(w)},[w,F,i]);const W=d=>{const N=d.value;E.some(C=>C.medicineId===N.medicineId&&C.doctorMedicineName.trim().toLowerCase()===N.doctorMedicineName.trim().toLowerCase())||o(C=>[...C,N]),L(""),D([])},O=d=>{o(N=>N.filter(M=>M.medicineId!==d))},n=async()=>{w.trim()||await F("")};return e.jsxRuntimeExports.jsxs(se.Modal,{isOpen:i,onRequestClose:s,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:[e.jsxRuntimeExports.jsx(e.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"}),e.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:[e.jsxRuntimeExports.jsx(g,{inputValue:w,showInput:!0,isSearchable:!0,disableInputAutoSize:!0,inputChangeHandler:L,onChangeHandler:W,onInputFocus:n,options:R,placeholder:"Search for medicines"}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-flex-wrap hfl-gap-2",children:E.map(d=>e.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:[e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text sm",className:"hfl-text-nowrap",children:d.doctorMedicineName}),e.jsxRuntimeExports.jsx("button",{className:"hfl-text-Blue_gray-800",onClick:()=>O(d.medicineId),children:e.jsxRuntimeExports.jsx("i",{className:"hx_close"})})]},d.doctorMedicineName+d.medicineId))})]}),e.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:[e.jsxRuntimeExports.jsx(e.Ku,{size:"md",textField:"Cancel",onClick:s,hierarchy:"Secondary-Grey"}),e.jsxRuntimeExports.jsx(e.Ku,{size:"md",textField:"Save",disabled:!E||E.length==0,onClick:async()=>{await j(_,E)&&s()},className:"hfl-bg-Primary-600 hfl-text-White disabled:hfl-opacity-50 disabled:hfl-cursor-not-allowed",hierarchy:"Primary"})]})]})},xe=c.forwardRef(({data:i=[],variant:s,externallyTriggeredEditRowIds:j=[],externallyTriggeredEditMode:_=!1,allowCustomMedicineInput:b=!0,getMedicineOptions:E,onRowChange:o,onRowDelete:w,onRowCopy:L,onSaveRow:R,externalSaveTrigger:D,setSearchDisabled:F},W)=>{const[O,n]=c.useState(null),[d,N]=c.useState(!1),[M,C]=c.useState(),K=c.useCallback((r,l,I)=>{const y=i.find(V=>V.rowId===r);if(!y)return;const A={...y,...l};o?.(A,I||void 0)},[i,o]),z=c.useCallback(async()=>{const r=i.filter(l=>l.isEditing&&l.medicine_name);if(r.length!==0)try{await R?.(r)&&r.forEach(I=>{o?.({...I,isEditing:!1})})}catch(l){console.error("Bulk save failed",l)}finally{F?.(!1)}},[i,R,o,F]);c.useEffect(()=>{D&&z()},[D,z]),c.useEffect(()=>{const r=i.some(l=>l.isEditing);F?.(r)},[i,F]);const a=c.useCallback(r=>{C(r),N(!0)},[]),m=c.useCallback(async()=>{if(O)try{await w?.(O)}catch(r){console.error("Delete failed",r)}finally{n(null)}},[O,w]),x=c.useCallback(()=>{n(null)},[]),f=c.useCallback(async r=>{try{return await R?.([r])?(o?.({...r,isEditing:!1}),!0):!1}catch(l){return console.error("Save row failed",l),!1}},[R,o]),T=c.useCallback(async()=>{const r=i.filter(l=>l.isEditing&&l.medicine_name);if(r.length===0)return!0;try{const l=await R?.(r);return l&&i.map(y=>y.isEditing?{...y,isEditing:!1}:y).forEach(y=>o?.(y)),!!l}catch(l){return console.error("External bulk save failed",l),!1}},[i,R,o]);c.useImperativeHandle(W,()=>({triggerExternalSave:T}));const v={variant:s,externallyTriggeredEditMode:_,externallyTriggeredEditRowIds:j,getMedicineOptions:E,onRowChange:(r,l)=>{K(r.rowId,r,l),o?.(r,l)},onRowDelete:w,onRowCopy:L,setRowToDelete:n,openPopupForRow:a};return e.jsxRuntimeExports.jsxs("div",{className:"hfl-border-1 hfl-border-Gray-200",children:[e.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:k.C_Table_Column_Name.map(r=>e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text sm",className:"hfl-text-Blue_gray-600",children:r},r))}),e.jsxRuntimeExports.jsxs(le.Provider,{value:v,children:[e.jsxRuntimeExports.jsx("div",{className:"table-body",children:i.length===0?e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text sm",className:"hfl-text-Blue_gray-600 hfl-px-2 hfl-py-3",children:"No medicines added"}):i.map(r=>e.jsxRuntimeExports.jsx(de,{rowData:r,isEditing:r.isEditing||!1,setIsEditing:l=>K(r.rowId,{isEditing:l}),onSaveRow:f,allowCustomMedicineInput:b},r.rowId))}),e.jsxRuntimeExports.jsx(se.AlertPopup,{headingText:"Delete Medicine",subHeadingText:"Are you sure you want to delete this medicine?",openState:!!O,positiveButtonText:"Delete",negativeButtonText:"Cancel",positiveActionCallback:m,negativeActionCallback:x,classNameNegativeBtn:"hfl-bg-Blue-600",classNamePositiveBtn:"hfl-bg-Error-500 hover:hfl-bg-Error-700 hfl-text-White",closePopupCallback:x}),e.jsxRuntimeExports.jsx(fe,{open:d,onCancel:()=>N(!1),onCopySave:L,rowMedicineData:M,getMedicineOptions:E})]})]})});exports.PediatricsCalculatorTable=xe;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { I_TableFilterProps } from './components/TableFilterSelect';
|
|
2
|
+
import { PinnableValues } from './ReusableTableConstants';
|
|
3
|
+
export interface IPaginationProps {
|
|
4
|
+
activePage: number;
|
|
5
|
+
pageSize: number;
|
|
6
|
+
currentPageRowCount: number;
|
|
7
|
+
totalRecords: number;
|
|
8
|
+
}
|
|
9
|
+
export interface ResuableTableNoDataProps {
|
|
10
|
+
title: string;
|
|
11
|
+
description: string;
|
|
12
|
+
onPageReload: () => void;
|
|
13
|
+
titleClassName?: string;
|
|
14
|
+
descriptionClassName?: string;
|
|
15
|
+
containerClassName?: string;
|
|
16
|
+
buttonClassName?: string;
|
|
17
|
+
imageClassName?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ReusableTableProps<T> {
|
|
20
|
+
tableRef: React.RefObject<HTMLDivElement>;
|
|
21
|
+
tableMainParentDivRef?: React.RefObject<HTMLDivElement>;
|
|
22
|
+
tableBodyParentDivRef?: React.RefObject<HTMLDivElement>;
|
|
23
|
+
columns: ITableColDef<T>[];
|
|
24
|
+
tableName: string;
|
|
25
|
+
rows: Array<T>;
|
|
26
|
+
paginationProps?: IPaginationProps;
|
|
27
|
+
showPagination?: boolean;
|
|
28
|
+
onPaginationClick?: ((activePage: number) => void) | undefined;
|
|
29
|
+
displayHeaderName?: string;
|
|
30
|
+
tableClassesToOverride?: string;
|
|
31
|
+
headerRowClasses?: string;
|
|
32
|
+
rowClassesForSpecificIndex?: {
|
|
33
|
+
index: number;
|
|
34
|
+
rowClasses: string;
|
|
35
|
+
};
|
|
36
|
+
tableBodyClassesToOverride?: string;
|
|
37
|
+
hideHeader?: boolean;
|
|
38
|
+
displayHeaderClassesToOverride?: string;
|
|
39
|
+
displayPaginationClassesToOverride?: string;
|
|
40
|
+
displayNoDataFoundProps?: ResuableTableNoDataProps;
|
|
41
|
+
enableTableFilter?: boolean;
|
|
42
|
+
tableFilterProps?: I_TableFilterProps;
|
|
43
|
+
headerAndPaginationDivClasses?: string;
|
|
44
|
+
tableMainParentDivClasses?: string;
|
|
45
|
+
tableMainDivClasses?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface ITableColDef<T> {
|
|
48
|
+
field: string;
|
|
49
|
+
headerCellClasses?: string;
|
|
50
|
+
cellClasses?: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
fieldHeaderName: string;
|
|
53
|
+
width?: string;
|
|
54
|
+
maxWidth?: string;
|
|
55
|
+
minWidth?: string;
|
|
56
|
+
pinned?: (typeof PinnableValues)[keyof typeof PinnableValues];
|
|
57
|
+
renderHeaderCell?: (column: ITableColDef<T>) => React.ReactNode;
|
|
58
|
+
renderCell?: (value: unknown, row: T, column: ITableColDef<T>, rowIndex: number) => React.ReactNode;
|
|
59
|
+
valueFormatter?: (value: unknown, row: T, column: ITableColDef<T>, rowIndex: number) => React.ReactNode;
|
|
60
|
+
enableFilter?: boolean;
|
|
61
|
+
enableColumnCheckbox?: boolean;
|
|
62
|
+
isCheckBoxMarked?: boolean;
|
|
63
|
+
onColumnCheckboxClick?: (isMarked: boolean) => void;
|
|
64
|
+
filterValues?: ITableDropdown[];
|
|
65
|
+
onFilterCheck?: (value: string) => void;
|
|
66
|
+
filterClassName?: string;
|
|
67
|
+
filterButtonClassName?: string;
|
|
68
|
+
showApplyFilter?: boolean;
|
|
69
|
+
onApplyFilter?: (field: string) => void;
|
|
70
|
+
resetFilterData?: (field: string) => void;
|
|
71
|
+
showSearch?: boolean;
|
|
72
|
+
searchQuery?: string;
|
|
73
|
+
setSearchQuery?: (value: string) => void;
|
|
74
|
+
dropdownCloseEventOnClickOutside?: () => void;
|
|
75
|
+
}
|
|
76
|
+
export interface ITableCellProps<T> {
|
|
77
|
+
children: React.ReactNode;
|
|
78
|
+
isHeaderCell?: boolean;
|
|
79
|
+
column: ITableColDef<T>;
|
|
80
|
+
colIndex: number;
|
|
81
|
+
rowIndex?: number;
|
|
82
|
+
}
|
|
83
|
+
export interface ITableRowProps {
|
|
84
|
+
children: React.ReactNode;
|
|
85
|
+
isHeaderRow: boolean;
|
|
86
|
+
classes?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface ITableHeadProps<T> {
|
|
89
|
+
columns: ITableColDef<T>[];
|
|
90
|
+
}
|
|
91
|
+
export interface ITableDropdown {
|
|
92
|
+
key?: string;
|
|
93
|
+
name: string;
|
|
94
|
+
isSelected: boolean;
|
|
95
|
+
isDisabled?: boolean;
|
|
96
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface EmptyTableProps {
|
|
2
|
+
title: string;
|
|
3
|
+
description: string;
|
|
4
|
+
onPageRefresh: () => void;
|
|
5
|
+
buttonClassName: string;
|
|
6
|
+
titleClassName: string;
|
|
7
|
+
descriptionClassName: string;
|
|
8
|
+
containerClassName: string;
|
|
9
|
+
imageClassName: string;
|
|
10
|
+
}
|
|
11
|
+
declare function EmptyTableContainer(props: EmptyTableProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default EmptyTableContainer;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface FilterCheckboxProps {
|
|
2
|
+
label: string;
|
|
3
|
+
onCheck: (value: string) => void;
|
|
4
|
+
isSelected: boolean;
|
|
5
|
+
isDisabled: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare function FilterCheckbox(props: FilterCheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default FilterCheckbox;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ITableDropdown } from '../ReusableTableTypes';
|
|
2
|
+
interface FilterDropdownProps {
|
|
3
|
+
options: ITableDropdown[];
|
|
4
|
+
onCheck: (name: string) => void;
|
|
5
|
+
showSearch: boolean;
|
|
6
|
+
searchQuery?: string;
|
|
7
|
+
setSearchQuery?: (query: string) => void;
|
|
8
|
+
filterclassname: string;
|
|
9
|
+
filterButtonStyles?: string;
|
|
10
|
+
showApplyFilter: boolean;
|
|
11
|
+
onApplyFilter?: (field: string) => void;
|
|
12
|
+
field: string;
|
|
13
|
+
resetDropDownData?: (field: string) => void;
|
|
14
|
+
dropdownCloseEventOnClickOutside?: () => void;
|
|
15
|
+
}
|
|
16
|
+
declare const FilterDropdown: <T>(props: FilterDropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default FilterDropdown;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ITableDropdown } from '../ReusableTableTypes';
|
|
2
|
+
export interface I_TableFilterProps {
|
|
3
|
+
options: ITableDropdown[];
|
|
4
|
+
filterclassname: string;
|
|
5
|
+
filterButtonStyles: string;
|
|
6
|
+
clearFilterButtonStyles: string;
|
|
7
|
+
showApplyFilter: boolean;
|
|
8
|
+
onApplyFilter: (filterOptions: ITableDropdown[]) => void;
|
|
9
|
+
onClearFilter: () => void;
|
|
10
|
+
}
|
|
11
|
+
declare const TableFilterSelect: (props: I_TableFilterProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default TableFilterSelect;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ITableColDef, ResuableTableNoDataProps, IPaginationProps } from '../ReusableTableTypes';
|
|
3
|
+
export declare const TableProvider: <T>({ children, initialColumns, rowData, headerRowClasses, rowClassesForSpecificIndex, tableBodyClassesToOverride, hideHeader, paginationProps, onPaginationClick, displayPaginationClassesToOverride, displayNoDataFoundProps, enableTableFilter, tableBodyParentDivRef, tableMainDivClasses, }: {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
initialColumns: Array<ITableColDef<T>>;
|
|
6
|
+
rowData: Array<T>;
|
|
7
|
+
headerRowClasses: string;
|
|
8
|
+
rowClassesForSpecificIndex: {
|
|
9
|
+
index: number;
|
|
10
|
+
rowClasses: string;
|
|
11
|
+
};
|
|
12
|
+
tableBodyClassesToOverride: string;
|
|
13
|
+
hideHeader: boolean;
|
|
14
|
+
paginationProps: IPaginationProps;
|
|
15
|
+
onPaginationClick: ((activePage: number) => void) | undefined;
|
|
16
|
+
displayPaginationClassesToOverride: string;
|
|
17
|
+
displayNoDataFoundProps: ResuableTableNoDataProps | undefined;
|
|
18
|
+
enableTableFilter: boolean;
|
|
19
|
+
tableBodyParentDivRef?: React.RefObject<HTMLDivElement>;
|
|
20
|
+
tableMainDivClasses?: string;
|
|
21
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { default as React, SetStateAction } from 'react';
|
|
2
|
+
import { IPaginationProps, ITableColDef, ResuableTableNoDataProps } from '../ReusableTableTypes';
|
|
3
|
+
export interface TableContextProps<T> {
|
|
4
|
+
rowsData: Array<T>;
|
|
5
|
+
allColumns: ITableColDef<T>[];
|
|
6
|
+
headerRowClasses: string;
|
|
7
|
+
rowClassesForSpecificIndex: {
|
|
8
|
+
index: number;
|
|
9
|
+
rowClasses: string;
|
|
10
|
+
};
|
|
11
|
+
tableBodyClassesToOverride: string;
|
|
12
|
+
hideHeader: boolean;
|
|
13
|
+
leftPinnedColumns: ITableColDef<T>[];
|
|
14
|
+
rightPinnedColumns: ITableColDef<T>[];
|
|
15
|
+
nonPinnedColumns: ITableColDef<T>[];
|
|
16
|
+
paginationProps: IPaginationProps;
|
|
17
|
+
onPaginationClick: ((activePage: number) => void) | undefined;
|
|
18
|
+
showDropdown: string | null;
|
|
19
|
+
setShowDropdown: React.Dispatch<SetStateAction<string | null>>;
|
|
20
|
+
displayPaginationClassesToOverride: string;
|
|
21
|
+
displayNoDataFoundProps: ResuableTableNoDataProps | undefined;
|
|
22
|
+
enableTableFilter: boolean;
|
|
23
|
+
tableBodyParentDivRef?: React.RefObject<HTMLDivElement>;
|
|
24
|
+
tableMainDivClasses?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const TableContext: React.Context<TableContextProps<any> | undefined>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { j as e, K as f } from "../index-4whwJbrk.js";
|
|
2
|
+
function n(r) {
|
|
3
|
+
const { options: h, selectedOption: a, onChangeHandler: s } = r;
|
|
4
|
+
return /* @__PURE__ */ e.jsx("div", { className: "hfl-flex hfl-gap-2 hfl-h-full hfl-items-center hfl-px-4 hfl-justify-center hfl-py-1", children: h?.map((l) => /* @__PURE__ */ e.jsx("div", { className: "hfl-bg-White hfl-rounded-lg", children: /* @__PURE__ */ e.jsx(
|
|
5
|
+
f,
|
|
6
|
+
{
|
|
7
|
+
onClick: () => s && s(l),
|
|
8
|
+
hierarchy: a?.label === l.label ? "Primary" : "Secondary-Grey",
|
|
9
|
+
size: "sm",
|
|
10
|
+
textField: l.label,
|
|
11
|
+
className: a?.label === l.label ? "hfl-bg-Blue-600" : ""
|
|
12
|
+
}
|
|
13
|
+
) }, l.label)) });
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
n as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TrendGraphData } from '../types/TrendGraphTypes';
|
|
2
|
+
interface AreaChartProps {
|
|
3
|
+
trendData: TrendGraphData;
|
|
4
|
+
containerWidth: number;
|
|
5
|
+
containerHeight: number;
|
|
6
|
+
showError?: (message: string) => void;
|
|
7
|
+
}
|
|
8
|
+
declare function AreaChartComponent(props: AreaChartProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default AreaChartComponent;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface PayloadItem {
|
|
2
|
+
value: number;
|
|
3
|
+
payload: {
|
|
4
|
+
date: string;
|
|
5
|
+
value: number;
|
|
6
|
+
};
|
|
7
|
+
dataKey: string;
|
|
8
|
+
name: string;
|
|
9
|
+
}
|
|
10
|
+
interface DataPointTooltipProps {
|
|
11
|
+
active?: boolean;
|
|
12
|
+
payload?: PayloadItem[];
|
|
13
|
+
label?: string | number;
|
|
14
|
+
}
|
|
15
|
+
declare const DataPointTooltip: React.FC<DataPointTooltipProps>;
|
|
16
|
+
export default DataPointTooltip;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { I_AllInvestigations } from '../../types/AllInvestigationTypes';
|
|
2
|
+
import { TrendGraphData, TrendGraphDataPoint } from '../../types/TrendGraphTypes';
|
|
3
|
+
export declare function isValidTrendGraphData(data: TrendGraphData): boolean;
|
|
4
|
+
export declare const convertRowToTrendGraphData: (row: I_AllInvestigations) => TrendGraphDataPoint[];
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ADD_PATIENT_IMAGE_RESPONSE, ADD_PATIENT_RESPONSE, DELETE_PATIENT_IMAGE_RESPONSE, GET_APPOINTMENTS_RESPONSE, GET_BRANCH_PREFERENCE_RESPONSE, GET_PATIENT_DETAILS_RESPONSE, GET_REFERRED_BY_LISTS_RESPONSE, IAddPatientPayload, IGetPatientListPayload, IGetPatientListResponse, IUpdatePatientPayload, UPDATE_PATIENT_RESPONSE } from '../../types/ApiResponseTypes';
|
|
2
|
+
import { E_ENVIRONMENT } from '../../types/CommonTypes';
|
|
3
|
+
export declare const getDoctorPreference: (fields_required: string | string[] | undefined, data: {
|
|
4
|
+
doc_rid?: string;
|
|
5
|
+
} | undefined, doctor_role_id: string, org_branch_id: string, token_env: {
|
|
6
|
+
token: string;
|
|
7
|
+
env: E_ENVIRONMENT;
|
|
8
|
+
}) => Promise<GET_BRANCH_PREFERENCE_RESPONSE>;
|
|
9
|
+
export declare const getBranchPreferences: (fields_required: string | undefined, org_branch_id: string, token_env: {
|
|
10
|
+
token: string;
|
|
11
|
+
env: E_ENVIRONMENT;
|
|
12
|
+
}) => Promise<GET_BRANCH_PREFERENCE_RESPONSE>;
|
|
13
|
+
export declare const getAppointments: (appnt_date: string, doctor_role_id: string, org_branch_id: string, person_id: string, token_env: {
|
|
14
|
+
token: string;
|
|
15
|
+
env: E_ENVIRONMENT;
|
|
16
|
+
}) => Promise<GET_APPOINTMENTS_RESPONSE>;
|
|
17
|
+
export declare const getPatientList: (payload: IGetPatientListPayload, token_env: {
|
|
18
|
+
token: string;
|
|
19
|
+
env: E_ENVIRONMENT;
|
|
20
|
+
}) => Promise<IGetPatientListResponse | null>;
|
|
21
|
+
export declare const getReferredByList: (token_env: {
|
|
22
|
+
token: string;
|
|
23
|
+
env: E_ENVIRONMENT;
|
|
24
|
+
}) => Promise<GET_REFERRED_BY_LISTS_RESPONSE>;
|
|
25
|
+
export declare const addPatientDetails: (payload: IAddPatientPayload, token_env: {
|
|
26
|
+
token: string;
|
|
27
|
+
env: E_ENVIRONMENT;
|
|
28
|
+
}) => Promise<ADD_PATIENT_RESPONSE>;
|
|
29
|
+
export declare const updatePatientDetails: (payload: IUpdatePatientPayload, token_env: {
|
|
30
|
+
token: string;
|
|
31
|
+
env: E_ENVIRONMENT;
|
|
32
|
+
}) => Promise<UPDATE_PATIENT_RESPONSE>;
|
|
33
|
+
export declare const addPatientImage: (payload: FormData, token_env: {
|
|
34
|
+
token: string;
|
|
35
|
+
env: E_ENVIRONMENT;
|
|
36
|
+
}) => Promise<ADD_PATIENT_IMAGE_RESPONSE>;
|
|
37
|
+
export declare const deletePatientImage: (payload: FormData, token_env: {
|
|
38
|
+
token: string;
|
|
39
|
+
env: E_ENVIRONMENT;
|
|
40
|
+
}) => Promise<DELETE_PATIENT_IMAGE_RESPONSE>;
|
|
41
|
+
export declare const getPatientDetails: ({ callback, payload, token_env, isCallbackNeeded, }: {
|
|
42
|
+
callback: (data: GET_PATIENT_DETAILS_RESPONSE) => void;
|
|
43
|
+
payload: {
|
|
44
|
+
branch_id: string;
|
|
45
|
+
person_id: string;
|
|
46
|
+
person_role_id: string;
|
|
47
|
+
patient_role_id: string;
|
|
48
|
+
partner_service_enabled?: boolean;
|
|
49
|
+
};
|
|
50
|
+
token_env: {
|
|
51
|
+
token: string;
|
|
52
|
+
env: E_ENVIRONMENT;
|
|
53
|
+
};
|
|
54
|
+
isCallbackNeeded?: boolean;
|
|
55
|
+
}) => Promise<GET_PATIENT_DETAILS_RESPONSE | undefined>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface Patient {
|
|
2
|
+
org_person_name?: string;
|
|
3
|
+
name?: string;
|
|
4
|
+
org_person_phone?: string;
|
|
5
|
+
phone?: string;
|
|
6
|
+
org_person_email?: string;
|
|
7
|
+
email?: string;
|
|
8
|
+
person_role_id?: string | number;
|
|
9
|
+
}
|
|
10
|
+
interface ExistingPatientsProps {
|
|
11
|
+
conflicts: Patient[];
|
|
12
|
+
handleAddPatient: (isNew: boolean, redirectAction: string) => void;
|
|
13
|
+
redirectAction: string;
|
|
14
|
+
manipulateExistingDOM?: () => void;
|
|
15
|
+
}
|
|
16
|
+
declare const ExistingPatients: ({ conflicts, handleAddPatient, redirectAction }: ExistingPatientsProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default ExistingPatients;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
editPatient: boolean;
|
|
3
|
+
setEditPatient: (value: boolean) => void;
|
|
4
|
+
createAsNew: boolean;
|
|
5
|
+
setCreateAsNew: (value: boolean) => void;
|
|
6
|
+
showEditPrompt?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare function EditRibbon(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default EditRibbon;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { E_ENVIRONMENT } from '../../types/CommonTypes';
|
|
2
|
+
export declare const hplxAPI: (token: string | undefined, env: E_ENVIRONMENT) => import('axios').AxiosInstance;
|
|
3
|
+
export declare const externalAPI: () => import('axios').AxiosInstance;
|
|
4
|
+
export declare const ReArchAPI: (token: string | undefined, env: E_ENVIRONMENT) => import('axios').AxiosInstance;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export declare const getCookie: (cname: string) => string;
|
|
2
|
+
export declare const goToPage: (params: string) => void;
|
|
3
|
+
export declare const parseThroughChannelList: (channelList: string[]) => {
|
|
4
|
+
title: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}[];
|
|
7
|
+
export declare const parseReferredByDocList: (referredList: Array<{
|
|
8
|
+
doctor_id: string;
|
|
9
|
+
doctor_name: string;
|
|
10
|
+
specialist: string;
|
|
11
|
+
}>) => {
|
|
12
|
+
doctor_id: string;
|
|
13
|
+
doctor_name: string;
|
|
14
|
+
label: string;
|
|
15
|
+
specialist: string;
|
|
16
|
+
}[];
|
|
17
|
+
export declare const parseReferredByList: (referredList: Array<{
|
|
18
|
+
doctor_id: string;
|
|
19
|
+
doctor_name: string;
|
|
20
|
+
specialist: string;
|
|
21
|
+
}>) => Record<string, {
|
|
22
|
+
doctor_id: string;
|
|
23
|
+
doctor_name: string;
|
|
24
|
+
specialist: string;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const isJson: (str: string) => boolean;
|
|
27
|
+
export declare const calculateDate: (value: string, unitVal: string) => string | null;
|
|
28
|
+
export declare const getGenderKey: (gender: string) => "M" | "F" | "O";
|
|
29
|
+
export declare const getGender: (gender: number) => string;
|
|
30
|
+
export declare const validateMobileNo: (value: string) => {
|
|
31
|
+
isError: boolean;
|
|
32
|
+
msg: string;
|
|
33
|
+
};
|
|
34
|
+
export declare const isValidDate: (dateObject: string | Date) => boolean;
|
|
35
|
+
export declare function calculateAge(pat_dob: string): string;
|
|
36
|
+
export declare const debounceFn: <T extends (...args: unknown[]) => void>(func: T, timing?: number) => ((...args: Parameters<T>) => void);
|
|
37
|
+
export declare const calculateDOB: (value: string, unitVal: string) => string | null;
|
|
38
|
+
export declare const handle401Status: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as AlertPopup } from './AlertPopup';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CustomDropdown } from './CustomDropdown';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
interface DateAndTimePickerProps {
|
|
3
|
+
inputDate: Date;
|
|
4
|
+
triggerType?: 'button' | 'input';
|
|
5
|
+
placeholderCTA?: string;
|
|
6
|
+
placeholderCTAStyles?: string;
|
|
7
|
+
inputPlaceholder?: string;
|
|
8
|
+
inputFieldClassName?: string;
|
|
9
|
+
displayDateFormat?: string;
|
|
10
|
+
minDate?: Date | null;
|
|
11
|
+
maxDate?: Date | null;
|
|
12
|
+
applyChanges: (selectedDate: Date) => void;
|
|
13
|
+
datePickerAbsoluteClasses: string;
|
|
14
|
+
highlightClickedCell?: boolean;
|
|
15
|
+
sectionRef?: RefObject<HTMLDivElement>;
|
|
16
|
+
inputIcon?: string;
|
|
17
|
+
inputIconClasses?: string;
|
|
18
|
+
datePickerMainDivClasses?: string;
|
|
19
|
+
}
|
|
20
|
+
declare const DateAndTimePicker: ({ inputDate, placeholderCTA, placeholderCTAStyles, minDate, maxDate, applyChanges, datePickerAbsoluteClasses, triggerType, inputPlaceholder, inputFieldClassName, displayDateFormat, sectionRef, highlightClickedCell, inputIcon, inputIconClasses, datePickerMainDivClasses, }: DateAndTimePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export default DateAndTimePicker;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DateAndTimePicker } from './DateAndTimePicker';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ToggleButtons';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { EAPP_ROUTES } from '../types/CommonTypes';
|
|
2
|
+
export declare const OccupationList: string[];
|
|
3
|
+
export declare const CityList: string[];
|
|
4
|
+
export declare const HonorificList: {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
gender: string;
|
|
8
|
+
}[];
|
|
9
|
+
export declare const bloodGroups: {
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
}[];
|
|
13
|
+
export declare const DefinedLanguages: {
|
|
14
|
+
en: string;
|
|
15
|
+
hi: string;
|
|
16
|
+
kn: string;
|
|
17
|
+
ml: string;
|
|
18
|
+
te: string;
|
|
19
|
+
gu: string;
|
|
20
|
+
mr: string;
|
|
21
|
+
ta: string;
|
|
22
|
+
bn: string;
|
|
23
|
+
ur: string;
|
|
24
|
+
pa: string;
|
|
25
|
+
od: string;
|
|
26
|
+
ar: string;
|
|
27
|
+
asa: string;
|
|
28
|
+
};
|
|
29
|
+
export declare const SpecialityList: {
|
|
30
|
+
label: string;
|
|
31
|
+
value: string;
|
|
32
|
+
}[];
|
|
33
|
+
export declare const genderList: {
|
|
34
|
+
value: number;
|
|
35
|
+
text: string;
|
|
36
|
+
}[];
|
|
37
|
+
export declare const MARITAL_STATUS: string[];
|
|
38
|
+
export declare const C_ALL_APP_ROUTES: EAPP_ROUTES[];
|
|
39
|
+
export declare const UnauthorizedAccessMessage: {
|
|
40
|
+
title: string;
|
|
41
|
+
subTitle: string;
|
|
42
|
+
type: string;
|
|
43
|
+
time: number;
|
|
44
|
+
};
|
|
45
|
+
export declare const BASE_URLS: {
|
|
46
|
+
STAGING: {
|
|
47
|
+
php_url: string;
|
|
48
|
+
rearch_url: string;
|
|
49
|
+
};
|
|
50
|
+
DEVELOPMENT: {
|
|
51
|
+
php_url: string;
|
|
52
|
+
rearch_url: string;
|
|
53
|
+
};
|
|
54
|
+
PRODUCTION: {
|
|
55
|
+
php_url: string;
|
|
56
|
+
rearch_url: string;
|
|
57
|
+
};
|
|
58
|
+
};
|