hplx-feature-library 1.0.24 → 1.0.25
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/PediatricsCalculator/index.js +1 -1
- package/dist/{PediatricsCalculatorTable-BXVNFJll.js → PediatricsCalculatorTable-BWktuG48.js} +7 -7
- package/dist/{PediatricsCalculatorTable-C7SxzQSs.cjs → PediatricsCalculatorTable-C81GUxQO.cjs} +1 -1
- package/dist/constants/PediatricsCalculatorConstants/index.js +9 -9
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/{PediatricsCalculatorTable-BXVNFJll.js → PediatricsCalculatorTable-BWktuG48.js}
RENAMED
|
@@ -9683,11 +9683,11 @@ const xr = (t) => /^(\d+)?(\.)?(\d*)?$/.test(t), Xt = ({ label: t, children: r }
|
|
|
9683
9683
|
},
|
|
9684
9684
|
[o]
|
|
9685
9685
|
), w = async () => {
|
|
9686
|
-
|
|
9687
|
-
|
|
9688
|
-
|
|
9689
|
-
|
|
9690
|
-
}
|
|
9686
|
+
const j = {
|
|
9687
|
+
...d,
|
|
9688
|
+
calculation_fields: { ...d.calculation_fields }
|
|
9689
|
+
};
|
|
9690
|
+
await n?.(j) && u?.({ ...j, isEditing: !1 });
|
|
9691
9691
|
}, v = () => {
|
|
9692
9692
|
p(r), o === "standard" && e(!1);
|
|
9693
9693
|
}, M = (j) => {
|
|
@@ -9719,7 +9719,7 @@ const xr = (t) => /^(\d+)?(\.)?(\d*)?$/.test(t), Xt = ({ label: t, children: r }
|
|
|
9719
9719
|
f([]);
|
|
9720
9720
|
},
|
|
9721
9721
|
onInputFocus: async () => {
|
|
9722
|
-
const j = await h(
|
|
9722
|
+
const j = await h(d.medicine_name);
|
|
9723
9723
|
f(j);
|
|
9724
9724
|
},
|
|
9725
9725
|
onChangeHandler: (j) => {
|
|
@@ -9976,7 +9976,7 @@ const xr = (t) => /^(\d+)?(\.)?(\d*)?$/.test(t), Xt = ({ label: t, children: r }
|
|
|
9976
9976
|
{
|
|
9977
9977
|
effectiveEditMode: g,
|
|
9978
9978
|
rowData: r,
|
|
9979
|
-
isSavedToLibrary:
|
|
9979
|
+
isSavedToLibrary: d.isSavedToLibrary ?? !1,
|
|
9980
9980
|
onSave: w,
|
|
9981
9981
|
onCancel: v,
|
|
9982
9982
|
onEdit: () => e(!0),
|
package/dist/{PediatricsCalculatorTable-C7SxzQSs.cjs → PediatricsCalculatorTable-C81GUxQO.cjs}
RENAMED
|
@@ -90,7 +90,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
90
90
|
font-size: ${ee?.fontSize};
|
|
91
91
|
color: ${ee?.color};
|
|
92
92
|
}
|
|
93
|
-
`}),H.jsx("input",{ref:Ee,style:w?{}:{width:`${Number(f?.length)>4?(f?.length||0)+5:12}ch`},type:g,placeholder:i,value:f,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 ${k?"!hfl-bg-Gray-50 !hfl-cursor-not-allowed":B||"hfl-bg-White"} ${h||""}`,onChange:we=>{d&&d(we.target.value),At(!0)},onClick:Fr,onKeyDown:we=>A&&A(we,K,Ee),maxLength:V??V}),!e&&!n&&H.jsx("i",{className:"hx_down hfl-mx-2"}),n&&H.jsx("i",{className:`${f?"hx_close hfl-cursor-pointer":"hx_down"} hfl-mx-2`,onClick:()=>{(u?.value||f)&&(d&&d(""),At(!0))}}),C?H.jsx("span",{style:{left:`${ur<2?"3":ur}ch`},className:"hfl-absolute hfl-top-1/2 hfl--translate-y-1/2 hfl-pointer-events-none",children:C}):null]}),G&&H.jsx("span",{className:"hfl-text-0 hfl-text-Error-600",children:O})]}):H.jsxs("button",{ref:Ke,onClick:St,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 ${s||""} ${R||"hfl-border-1"} ${O?"hfl-border-Error-300":"hfl-border-Gray-300"} ${N||"hfl-h-[40px]"} ${k?"!hfl-bg-Gray-50 !hfl-cursor-not-allowed":""}`,style:D||u?.label?{}:ee?{fontFamily:ee?.fontFamily,fontSize:ee?.fontSize,fontWeight:ee?.fontWeight,lineHeight:ee?.lineHeight,color:ee?.color}:{},children:[H.jsx("span",{className:"hfl-pr-4",children:D||u?.label||i||"Select an option"}),H.jsx("img",{src:R1,alt:"down arrow"})]}),l&&l?.length>=0&&H.jsxs("ul",{ref:de,className:`${te?"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 ${M?"hfl-min-w-[20em]":"hfl-min-w-[16em]"} hfl-max-h-[330px] hfl-overflow-y-scroll ${I}`,role:"menu","aria-orientation":"vertical","aria-labelledby":"options-menu",children:[j?H.jsx(j1,{onChangeHandler:Y,selectedOption:P,options:T}):!1,(m?Qe:l)?.map((we,ze)=>{const ot=M?!!v?.some(Wn=>Wn.value===we?.value):!1,Lr=u?.value===we?.value,Ui=ue===ze;return we?H.jsx("li",{onClick:()=>{M?gr(we):(c&&c(we),K(!1),At(!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 ${E?"odd:hfl-bg-Gray-100":""} ${Lr?"hfl-bg-Blue-50 hfl-text-Blue-500":""}`,role:"menuitem","aria-selected":Lr,tabIndex:Ui?0:-1,ref:Wn=>{Ge.current[ze]=Wn},children:M?H.jsx(vm,{size:"sm",disabled:!1,text:H.jsx("span",{children:we.label}),secondaryText:"",id:`${we.label}-${ze}`,isMarked:ot}):we.label},`${we.label}-${ze}`):null}),l?.length===0&&z&&H.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"})]})]})}const wr=t=>/^(\d+)?(\.)?(\d*)?$/.test(t),Qt=({label:t,children:r})=>H.jsxs(Ye,{variant:"Regular",type:"Text sm",className:"hfl-flex hfl-items-center hfl-text-Blue_gray-800 hfl-justify-between",children:[t,": ",r]}),Xt=({label:t,value:r})=>H.jsxs(Ye,{variant:"Regular",type:"Text sm",className:"hfl-flex hfl-text-Blue_gray-800",children:[t,":"," ",H.jsx(Ye,{variant:"Bold",type:"Text sm",className:"hfl-text-Blue_gray-800 hfl-ml-1",children:r||"--"})]}),N1=ie.memo(function({rowData:r,isEditing:a,setIsEditing:e,onSaveRow:n}){const{variant:o,externallyTriggeredEditMode:s,externallyTriggeredEditRowIds:i,getMedicineOptions:l,onRowChange:u}=ry(),[c,f]=ie.useState([]),[d,p]=ie.useState(r);ie.useEffect(()=>{a||p(r)},[r,a]);const h=async j=>(await l?.(j))?.map(P=>({label:P.doctorMedicineName,value:P}))||[],g=s||i?.includes(r.rowId)||a,_=ie.useMemo(()=>d.calculation_type===wt.C_MedicineCalculatorList[0]?d.calculation_fields:null,[d.calculation_fields,d.calculation_type]),C=ie.useMemo(()=>d.calculation_type===wt.C_MedicineCalculatorList[1]?d.calculation_fields:null,[d.calculation_fields,d.calculation_type]),D=(j,Y)=>{if(j==="calculation_type"){const P=Y,T={frequency:d.calculation_fields.frequency,pedia_dosage:d.calculation_fields.pedia_dosage};p({...d,calculation_type:P,calculation_fields:P==="mg/kg/dose"?{...wt.C_DefaultMgKgFields,...T}:{...wt.C_DefaultMlKgFields,...T}})}else p({...d,[j]:Y})},S=ie.useCallback((j,Y)=>{p(P=>{let T={...P.calculation_fields,[j]:Y};if(j==="frequency"&&o==="standard"){const R=wt.C_FrequencyDosageMap[Y]||[];R.length>0?T={...T,pedia_dosage:R[0]}:T={...T,pedia_dosage:""}}return{...P,calculation_fields:T}})},[o]),w=async()=>{try{await n(d)&&(u?.(d),e(!1))}catch(j){console.error("Failed to save row",j)}},v=()=>{p(r),o==="standard"&&e(!1)},M=j=>{if(o==="prescription"){if(j==="medicine_name")return!1;if(j==="pedia_dosage")return!0}return g},q=()=>{const j=!(d?.isSavedToLibrary??!1),Y={...d,isSavedToLibrary:j};p(Y),u?.(Y)};return H.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 ${g?"hfl-bg-gradient-to-b hfl-from-White_20 hfl-to-Primary-50":""}`,children:[H.jsx("div",{className:"hfl-w-full hfl-py-2.5",children:M("medicine_name")?H.jsx(st,{inputValue:d.medicine_name,showInput:!0,disableInputAutoSize:!0,inputChangeHandler:async j=>{if(D("medicine_name",j),j.trim()){const Y=await h(j);f(Y)}else f([])},onInputFocus:async()=>{const j=await h("");f(j)},onChangeHandler:j=>{const Y=j.value;p(P=>({...P,medicine_name:Y.doctorMedicineName,medicine_id:Y.medicineId,generic_name:Y.doctorGenericName,type:wt.C_MedicineTypeList[Y.medicineType]||""}))},options:c,isSearchable:!0,placeholder:"Search medicine"}):H.jsx(Ye,{variant:"Regular",type:"Text sm",className:"hfl-text-Blue_gray-800 hfl-px-2",children:r.medicine_name})}),H.jsx("div",{className:"hfl-w-full hfl-py-2.5",children:M("generic_name")?H.jsx(st,{wrapperClass:"hfl-w-full",inputClassName:"hfl-w-full",inputContainerClasses:"hfl-w-full",btnClassName:"hfl-w-full",inputValue:d.generic_name,showInput:!0,disableInputAutoSize:!0,inputChangeHandler:j=>D("generic_name",j),hideDropdownIcon:!0}):H.jsx(Ye,{variant:"Regular",type:"Text sm",className:"hfl-text-Blue_gray-800 hfl-px-2",children:r.generic_name})}),H.jsx("div",{className:"hfl-w-full hfl-py-2.5",children:M("type")?H.jsx(st,{placeholder:"Select",showInput:!1,disableInputAutoSize:!0,selectedOption:{label:d.type,value:d.type},options:wt.C_MedicineTypeList.map(j=>({label:j,value:j})),onChangeHandler:j=>D("type",j.value)}):H.jsx(Ye,{variant:"Regular",type:"Text sm",className:"hfl-text-Blue_gray-800 hfl-px-2",children:typeof r.type=="number"?wt.C_MedicineTypeList[r.type]:r.type})}),H.jsx("div",{className:"hfl-w-full hfl-py-2.5",children:M("calculation_type")?H.jsx(st,{placeholder:"Select",showInput:!1,disableInputAutoSize:!0,selectedOption:{label:d.calculation_type,value:d.calculation_type},options:wt.C_MedicineCalculatorList.map(j=>({label:j,value:j})),onChangeHandler:j=>D("calculation_type",j.value)}):H.jsx(Ye,{variant:"Regular",type:"Text sm",className:"hfl-text-Blue_gray-800 hfl-px-2",children:r.calculation_type})}),H.jsx("div",{className:"hfl-flex hfl-w-full hfl-flex-col hfl-gap-2 hfl-py-2.5 hfl-px-2",children:M("calculation_fields")?H.jsxs(H.Fragment,{children:[_&&H.jsxs(H.Fragment,{children:[H.jsx(Qt,{label:"Drug Strength",children:H.jsx(st,{wrapperClass:"hfl-w-2/5",placeholder:"e.g., 250",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:_.drug_strength||"",inputChangeHandler:j=>{wr(j)&&S("drug_strength",j)}})}),H.jsx(Qt,{label:"Dose/mg/kg",children:H.jsx(st,{wrapperClass:"hfl-w-2/5",placeholder:"e.g., 15",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:_.dose_mg_kg||"",inputChangeHandler:j=>{wr(j)&&S("dose_mg_kg",j)}})}),H.jsx(Qt,{label:"Frequency",children:H.jsx(st,{wrapperClass:"hfl-w-2/5",placeholder:"Frequency",showInput:!1,selectedOption:d.calculation_fields.frequency?{label:d.calculation_fields.frequency,value:d.calculation_fields.frequency}:void 0,options:wt.C_MedicineFrequencyList.map(j=>({label:j,value:j})),onChangeHandler:j=>{S("frequency",j.value)}})}),H.jsx(Qt,{label:"Max Dose (mg)",children:H.jsx(st,{wrapperClass:"hfl-w-2/5",placeholder:"Max mg/dose",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:_.max_mg_dose||"",inputChangeHandler:j=>{wr(j)&&S("max_mg_dose",j)}})}),H.jsx(Qt,{label:"Max Day (mg)",children:H.jsx(st,{wrapperClass:"hfl-w-2/5",placeholder:"Max mg/day",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:_.max_mg_day||"",inputChangeHandler:j=>{wr(j)&&S("max_mg_day",j)}})})]}),C&&H.jsxs(H.Fragment,{children:[H.jsx(Qt,{label:"Multiplier",children:H.jsx(st,{wrapperClass:"hfl-w-2/5",placeholder:"e.g., 0.5",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:C.multiplier||"",inputChangeHandler:j=>{wr(j)&&S("multiplier",j)}})}),H.jsx(Qt,{label:"Dose/mL/kg",children:H.jsx(st,{wrapperClass:"hfl-w-2/5",placeholder:"e.g., 5",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:C.dose_ml_kg||"",inputChangeHandler:j=>{wr(j)&&S("dose_ml_kg",j)}})}),H.jsx(Qt,{label:"Frequency",children:H.jsx(st,{wrapperClass:"hfl-w-2/5",placeholder:"Frequency",showInput:!1,selectedOption:d.calculation_fields.frequency?{label:d.calculation_fields.frequency,value:d.calculation_fields.frequency}:void 0,options:wt.C_MedicineFrequencyList.map(j=>({label:j,value:j})),onChangeHandler:j=>{S("frequency",j.value)}})}),H.jsx(Qt,{label:"Max Dose (mL)",children:H.jsx(st,{wrapperClass:"hfl-w-2/5",placeholder:"Max mL/dose",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:C.max_ml_dose||"",inputChangeHandler:j=>{wr(j)&&S("max_ml_dose",j)}})}),H.jsx(Qt,{label:"Max Day (mL)",children:H.jsx(st,{wrapperClass:"hfl-w-2/5",placeholder:"Max mL/day",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:C.max_ml_day||"",inputChangeHandler:j=>{wr(j)&&S("max_ml_day",j)}})})]})]}):H.jsxs(H.Fragment,{children:[_&&H.jsxs(H.Fragment,{children:[H.jsx(Xt,{label:"Drug Strength",value:_.drug_strength}),H.jsx(Xt,{label:"Dose/mg/kg",value:_.dose_mg_kg}),H.jsx(Xt,{label:"Frequency",value:_.frequency}),H.jsx(Xt,{label:"Max Dose (mg)",value:_.max_mg_dose}),H.jsx(Xt,{label:"Max Day (mg)",value:_.max_mg_day})]}),C&&H.jsxs(H.Fragment,{children:[H.jsx(Xt,{label:"Multiplier",value:C.multiplier}),H.jsx(Xt,{label:"Dose/mL/kg",value:C.dose_ml_kg}),H.jsx(Xt,{label:"Frequency",value:C.frequency}),H.jsx(Xt,{label:"Max Dose (mL)",value:C.max_ml_dose}),H.jsx(Xt,{label:"Max Day (mL)",value:C.max_ml_day})]})]})}),H.jsx("div",{className:"hfl-w-full hfl-py-2.5",children:M("pedia_dosage")?(()=>{const j=d.calculation_fields.frequency,Y=wt.C_FrequencyDosageMap[j]||[];return H.jsx(st,{wrapperClass:"hfl-w-32",inputContainerClasses:"hfl-w-32",btnClassName:"hfl-w-32",inputClassName:"hfl-w-32",placeholder:"Select",showInput:o!=="standard",disableInputAutoSize:!0,inputValue:d.calculation_fields.pedia_dosage,inputChangeHandler:P=>S("pedia_dosage",P),selectedOption:{label:d.calculation_fields.pedia_dosage,value:d.calculation_fields.pedia_dosage},options:o!=="prescription"?Y.map(P=>({label:P,value:P})):void 0,onChangeHandler:o!=="prescription"?P=>S("pedia_dosage",P.value):void 0,hideDropdownIcon:o==="prescription",showEmptyDropdownPopup:o!=="prescription"})})():H.jsx(Ye,{variant:"Regular",type:"Text sm",className:"hfl-text-Blue_gray-800 hfl-px-2",children:r.calculation_fields.pedia_dosage})}),H.jsx("div",{className:"hfl-w-full hfl-py-2.5",children:H.jsx(E1,{effectiveEditMode:g,rowData:r,isSavedToLibrary:r.isSavedToLibrary??!1,onSave:w,onCancel:v,onEdit:()=>e(!0),onCheckboxToggle:q})})]})},(t,r)=>t.isEditing===r.isEditing&&t.rowData.rowId===r.rowData.rowId&&t.rowData.isEditing===r.rowData.isEditing&&t.rowData.medicine_name===r.rowData.medicine_name&&t.rowData.generic_name===r.rowData.generic_name&&t.rowData.type===r.rowData.type&&t.rowData.calculation_type===r.rowData.calculation_type&&JSON.stringify(t.rowData.calculation_fields)===JSON.stringify(r.rowData.calculation_fields)&&t.rowData.calculation_fields.pedia_dosage===r.rowData.calculation_fields.pedia_dosage);var ho={exports:{}},xr={},mo={exports:{}},kt={},vo={exports:{}},th;function ny(){return th||(th=1,function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=c;/*!
|
|
93
|
+
`}),H.jsx("input",{ref:Ee,style:w?{}:{width:`${Number(f?.length)>4?(f?.length||0)+5:12}ch`},type:g,placeholder:i,value:f,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 ${k?"!hfl-bg-Gray-50 !hfl-cursor-not-allowed":B||"hfl-bg-White"} ${h||""}`,onChange:we=>{d&&d(we.target.value),At(!0)},onClick:Fr,onKeyDown:we=>A&&A(we,K,Ee),maxLength:V??V}),!e&&!n&&H.jsx("i",{className:"hx_down hfl-mx-2"}),n&&H.jsx("i",{className:`${f?"hx_close hfl-cursor-pointer":"hx_down"} hfl-mx-2`,onClick:()=>{(u?.value||f)&&(d&&d(""),At(!0))}}),C?H.jsx("span",{style:{left:`${ur<2?"3":ur}ch`},className:"hfl-absolute hfl-top-1/2 hfl--translate-y-1/2 hfl-pointer-events-none",children:C}):null]}),G&&H.jsx("span",{className:"hfl-text-0 hfl-text-Error-600",children:O})]}):H.jsxs("button",{ref:Ke,onClick:St,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 ${s||""} ${R||"hfl-border-1"} ${O?"hfl-border-Error-300":"hfl-border-Gray-300"} ${N||"hfl-h-[40px]"} ${k?"!hfl-bg-Gray-50 !hfl-cursor-not-allowed":""}`,style:D||u?.label?{}:ee?{fontFamily:ee?.fontFamily,fontSize:ee?.fontSize,fontWeight:ee?.fontWeight,lineHeight:ee?.lineHeight,color:ee?.color}:{},children:[H.jsx("span",{className:"hfl-pr-4",children:D||u?.label||i||"Select an option"}),H.jsx("img",{src:R1,alt:"down arrow"})]}),l&&l?.length>=0&&H.jsxs("ul",{ref:de,className:`${te?"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 ${M?"hfl-min-w-[20em]":"hfl-min-w-[16em]"} hfl-max-h-[330px] hfl-overflow-y-scroll ${I}`,role:"menu","aria-orientation":"vertical","aria-labelledby":"options-menu",children:[j?H.jsx(j1,{onChangeHandler:Y,selectedOption:P,options:T}):!1,(m?Qe:l)?.map((we,ze)=>{const ot=M?!!v?.some(Wn=>Wn.value===we?.value):!1,Lr=u?.value===we?.value,Ui=ue===ze;return we?H.jsx("li",{onClick:()=>{M?gr(we):(c&&c(we),K(!1),At(!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 ${E?"odd:hfl-bg-Gray-100":""} ${Lr?"hfl-bg-Blue-50 hfl-text-Blue-500":""}`,role:"menuitem","aria-selected":Lr,tabIndex:Ui?0:-1,ref:Wn=>{Ge.current[ze]=Wn},children:M?H.jsx(vm,{size:"sm",disabled:!1,text:H.jsx("span",{children:we.label}),secondaryText:"",id:`${we.label}-${ze}`,isMarked:ot}):we.label},`${we.label}-${ze}`):null}),l?.length===0&&z&&H.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"})]})]})}const wr=t=>/^(\d+)?(\.)?(\d*)?$/.test(t),Qt=({label:t,children:r})=>H.jsxs(Ye,{variant:"Regular",type:"Text sm",className:"hfl-flex hfl-items-center hfl-text-Blue_gray-800 hfl-justify-between",children:[t,": ",r]}),Xt=({label:t,value:r})=>H.jsxs(Ye,{variant:"Regular",type:"Text sm",className:"hfl-flex hfl-text-Blue_gray-800",children:[t,":"," ",H.jsx(Ye,{variant:"Bold",type:"Text sm",className:"hfl-text-Blue_gray-800 hfl-ml-1",children:r||"--"})]}),N1=ie.memo(function({rowData:r,isEditing:a,setIsEditing:e,onSaveRow:n}){const{variant:o,externallyTriggeredEditMode:s,externallyTriggeredEditRowIds:i,getMedicineOptions:l,onRowChange:u}=ry(),[c,f]=ie.useState([]),[d,p]=ie.useState(r);ie.useEffect(()=>{a||p(r)},[r,a]);const h=async j=>(await l?.(j))?.map(P=>({label:P.doctorMedicineName,value:P}))||[],g=s||i?.includes(r.rowId)||a,_=ie.useMemo(()=>d.calculation_type===wt.C_MedicineCalculatorList[0]?d.calculation_fields:null,[d.calculation_fields,d.calculation_type]),C=ie.useMemo(()=>d.calculation_type===wt.C_MedicineCalculatorList[1]?d.calculation_fields:null,[d.calculation_fields,d.calculation_type]),D=(j,Y)=>{if(j==="calculation_type"){const P=Y,T={frequency:d.calculation_fields.frequency,pedia_dosage:d.calculation_fields.pedia_dosage};p({...d,calculation_type:P,calculation_fields:P==="mg/kg/dose"?{...wt.C_DefaultMgKgFields,...T}:{...wt.C_DefaultMlKgFields,...T}})}else p({...d,[j]:Y})},S=ie.useCallback((j,Y)=>{p(P=>{let T={...P.calculation_fields,[j]:Y};if(j==="frequency"&&o==="standard"){const R=wt.C_FrequencyDosageMap[Y]||[];R.length>0?T={...T,pedia_dosage:R[0]}:T={...T,pedia_dosage:""}}return{...P,calculation_fields:T}})},[o]),w=async()=>{const j={...d,calculation_fields:{...d.calculation_fields}};await n?.(j)&&u?.({...j,isEditing:!1})},v=()=>{p(r),o==="standard"&&e(!1)},M=j=>{if(o==="prescription"){if(j==="medicine_name")return!1;if(j==="pedia_dosage")return!0}return g},q=()=>{const j=!(d?.isSavedToLibrary??!1),Y={...d,isSavedToLibrary:j};p(Y),u?.(Y)};return H.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 ${g?"hfl-bg-gradient-to-b hfl-from-White_20 hfl-to-Primary-50":""}`,children:[H.jsx("div",{className:"hfl-w-full hfl-py-2.5",children:M("medicine_name")?H.jsx(st,{inputValue:d.medicine_name,showInput:!0,disableInputAutoSize:!0,inputChangeHandler:async j=>{if(D("medicine_name",j),j.trim()){const Y=await h(j);f(Y)}else f([])},onInputFocus:async()=>{const j=await h(d.medicine_name);f(j)},onChangeHandler:j=>{const Y=j.value;p(P=>({...P,medicine_name:Y.doctorMedicineName,medicine_id:Y.medicineId,generic_name:Y.doctorGenericName,type:wt.C_MedicineTypeList[Y.medicineType]||""}))},options:c,isSearchable:!0,placeholder:"Search medicine"}):H.jsx(Ye,{variant:"Regular",type:"Text sm",className:"hfl-text-Blue_gray-800 hfl-px-2",children:r.medicine_name})}),H.jsx("div",{className:"hfl-w-full hfl-py-2.5",children:M("generic_name")?H.jsx(st,{wrapperClass:"hfl-w-full",inputClassName:"hfl-w-full",inputContainerClasses:"hfl-w-full",btnClassName:"hfl-w-full",inputValue:d.generic_name,showInput:!0,disableInputAutoSize:!0,inputChangeHandler:j=>D("generic_name",j),hideDropdownIcon:!0}):H.jsx(Ye,{variant:"Regular",type:"Text sm",className:"hfl-text-Blue_gray-800 hfl-px-2",children:r.generic_name})}),H.jsx("div",{className:"hfl-w-full hfl-py-2.5",children:M("type")?H.jsx(st,{placeholder:"Select",showInput:!1,disableInputAutoSize:!0,selectedOption:{label:d.type,value:d.type},options:wt.C_MedicineTypeList.map(j=>({label:j,value:j})),onChangeHandler:j=>D("type",j.value)}):H.jsx(Ye,{variant:"Regular",type:"Text sm",className:"hfl-text-Blue_gray-800 hfl-px-2",children:typeof r.type=="number"?wt.C_MedicineTypeList[r.type]:r.type})}),H.jsx("div",{className:"hfl-w-full hfl-py-2.5",children:M("calculation_type")?H.jsx(st,{placeholder:"Select",showInput:!1,disableInputAutoSize:!0,selectedOption:{label:d.calculation_type,value:d.calculation_type},options:wt.C_MedicineCalculatorList.map(j=>({label:j,value:j})),onChangeHandler:j=>D("calculation_type",j.value)}):H.jsx(Ye,{variant:"Regular",type:"Text sm",className:"hfl-text-Blue_gray-800 hfl-px-2",children:r.calculation_type})}),H.jsx("div",{className:"hfl-flex hfl-w-full hfl-flex-col hfl-gap-2 hfl-py-2.5 hfl-px-2",children:M("calculation_fields")?H.jsxs(H.Fragment,{children:[_&&H.jsxs(H.Fragment,{children:[H.jsx(Qt,{label:"Drug Strength",children:H.jsx(st,{wrapperClass:"hfl-w-2/5",placeholder:"e.g., 250",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:_.drug_strength||"",inputChangeHandler:j=>{wr(j)&&S("drug_strength",j)}})}),H.jsx(Qt,{label:"Dose/mg/kg",children:H.jsx(st,{wrapperClass:"hfl-w-2/5",placeholder:"e.g., 15",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:_.dose_mg_kg||"",inputChangeHandler:j=>{wr(j)&&S("dose_mg_kg",j)}})}),H.jsx(Qt,{label:"Frequency",children:H.jsx(st,{wrapperClass:"hfl-w-2/5",placeholder:"Frequency",showInput:!1,selectedOption:d.calculation_fields.frequency?{label:d.calculation_fields.frequency,value:d.calculation_fields.frequency}:void 0,options:wt.C_MedicineFrequencyList.map(j=>({label:j,value:j})),onChangeHandler:j=>{S("frequency",j.value)}})}),H.jsx(Qt,{label:"Max Dose (mg)",children:H.jsx(st,{wrapperClass:"hfl-w-2/5",placeholder:"Max mg/dose",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:_.max_mg_dose||"",inputChangeHandler:j=>{wr(j)&&S("max_mg_dose",j)}})}),H.jsx(Qt,{label:"Max Day (mg)",children:H.jsx(st,{wrapperClass:"hfl-w-2/5",placeholder:"Max mg/day",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:_.max_mg_day||"",inputChangeHandler:j=>{wr(j)&&S("max_mg_day",j)}})})]}),C&&H.jsxs(H.Fragment,{children:[H.jsx(Qt,{label:"Multiplier",children:H.jsx(st,{wrapperClass:"hfl-w-2/5",placeholder:"e.g., 0.5",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:C.multiplier||"",inputChangeHandler:j=>{wr(j)&&S("multiplier",j)}})}),H.jsx(Qt,{label:"Dose/mL/kg",children:H.jsx(st,{wrapperClass:"hfl-w-2/5",placeholder:"e.g., 5",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:C.dose_ml_kg||"",inputChangeHandler:j=>{wr(j)&&S("dose_ml_kg",j)}})}),H.jsx(Qt,{label:"Frequency",children:H.jsx(st,{wrapperClass:"hfl-w-2/5",placeholder:"Frequency",showInput:!1,selectedOption:d.calculation_fields.frequency?{label:d.calculation_fields.frequency,value:d.calculation_fields.frequency}:void 0,options:wt.C_MedicineFrequencyList.map(j=>({label:j,value:j})),onChangeHandler:j=>{S("frequency",j.value)}})}),H.jsx(Qt,{label:"Max Dose (mL)",children:H.jsx(st,{wrapperClass:"hfl-w-2/5",placeholder:"Max mL/dose",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:C.max_ml_dose||"",inputChangeHandler:j=>{wr(j)&&S("max_ml_dose",j)}})}),H.jsx(Qt,{label:"Max Day (mL)",children:H.jsx(st,{wrapperClass:"hfl-w-2/5",placeholder:"Max mL/day",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:C.max_ml_day||"",inputChangeHandler:j=>{wr(j)&&S("max_ml_day",j)}})})]})]}):H.jsxs(H.Fragment,{children:[_&&H.jsxs(H.Fragment,{children:[H.jsx(Xt,{label:"Drug Strength",value:_.drug_strength}),H.jsx(Xt,{label:"Dose/mg/kg",value:_.dose_mg_kg}),H.jsx(Xt,{label:"Frequency",value:_.frequency}),H.jsx(Xt,{label:"Max Dose (mg)",value:_.max_mg_dose}),H.jsx(Xt,{label:"Max Day (mg)",value:_.max_mg_day})]}),C&&H.jsxs(H.Fragment,{children:[H.jsx(Xt,{label:"Multiplier",value:C.multiplier}),H.jsx(Xt,{label:"Dose/mL/kg",value:C.dose_ml_kg}),H.jsx(Xt,{label:"Frequency",value:C.frequency}),H.jsx(Xt,{label:"Max Dose (mL)",value:C.max_ml_dose}),H.jsx(Xt,{label:"Max Day (mL)",value:C.max_ml_day})]})]})}),H.jsx("div",{className:"hfl-w-full hfl-py-2.5",children:M("pedia_dosage")?(()=>{const j=d.calculation_fields.frequency,Y=wt.C_FrequencyDosageMap[j]||[];return H.jsx(st,{wrapperClass:"hfl-w-32",inputContainerClasses:"hfl-w-32",btnClassName:"hfl-w-32",inputClassName:"hfl-w-32",placeholder:"Select",showInput:o!=="standard",disableInputAutoSize:!0,inputValue:d.calculation_fields.pedia_dosage,inputChangeHandler:P=>S("pedia_dosage",P),selectedOption:{label:d.calculation_fields.pedia_dosage,value:d.calculation_fields.pedia_dosage},options:o!=="prescription"?Y.map(P=>({label:P,value:P})):void 0,onChangeHandler:o!=="prescription"?P=>S("pedia_dosage",P.value):void 0,hideDropdownIcon:o==="prescription",showEmptyDropdownPopup:o!=="prescription"})})():H.jsx(Ye,{variant:"Regular",type:"Text sm",className:"hfl-text-Blue_gray-800 hfl-px-2",children:r.calculation_fields.pedia_dosage})}),H.jsx("div",{className:"hfl-w-full hfl-py-2.5",children:H.jsx(E1,{effectiveEditMode:g,rowData:r,isSavedToLibrary:d.isSavedToLibrary??!1,onSave:w,onCancel:v,onEdit:()=>e(!0),onCheckboxToggle:q})})]})},(t,r)=>t.isEditing===r.isEditing&&t.rowData.rowId===r.rowData.rowId&&t.rowData.isEditing===r.rowData.isEditing&&t.rowData.medicine_name===r.rowData.medicine_name&&t.rowData.generic_name===r.rowData.generic_name&&t.rowData.type===r.rowData.type&&t.rowData.calculation_type===r.rowData.calculation_type&&JSON.stringify(t.rowData.calculation_fields)===JSON.stringify(r.rowData.calculation_fields)&&t.rowData.calculation_fields.pedia_dosage===r.rowData.calculation_fields.pedia_dosage);var ho={exports:{}},xr={},mo={exports:{}},kt={},vo={exports:{}},th;function ny(){return th||(th=1,function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=c;/*!
|
|
94
94
|
* Adapted from jQuery UI core
|
|
95
95
|
*
|
|
96
96
|
* http://jqueryui.com
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const
|
|
1
|
+
const s = [
|
|
2
2
|
"Medicine Name",
|
|
3
3
|
"Generic Name",
|
|
4
4
|
"Type",
|
|
5
5
|
"Calculator",
|
|
6
|
-
"Additional
|
|
6
|
+
"Additional Information",
|
|
7
7
|
"Dosage",
|
|
8
8
|
"Options"
|
|
9
9
|
], a = [
|
|
@@ -37,19 +37,19 @@ const o = [
|
|
|
37
37
|
"4(QID)": ["X-X-X-X"],
|
|
38
38
|
"6(Q4H)": ["X-X-X-X-X-X"]
|
|
39
39
|
};
|
|
40
|
-
var
|
|
40
|
+
var o = /* @__PURE__ */ ((e) => (e.MgKgDose = "mg/kg/dose", e.MlKg = "mL/kg", e))(o || {});
|
|
41
41
|
const _ = [
|
|
42
42
|
"mg/kg/dose",
|
|
43
43
|
"mL/kg"
|
|
44
44
|
/* MlKg */
|
|
45
|
-
],
|
|
45
|
+
], n = {
|
|
46
46
|
drug_strength: "",
|
|
47
47
|
dose_mg_kg: "",
|
|
48
48
|
frequency: "",
|
|
49
49
|
max_mg_dose: "",
|
|
50
50
|
max_mg_day: "",
|
|
51
51
|
pedia_dosage: ""
|
|
52
|
-
},
|
|
52
|
+
}, d = {
|
|
53
53
|
multiplier: "",
|
|
54
54
|
dose_ml_kg: "",
|
|
55
55
|
frequency: "",
|
|
@@ -58,12 +58,12 @@ const _ = [
|
|
|
58
58
|
pedia_dosage: ""
|
|
59
59
|
};
|
|
60
60
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
n as C_DefaultMgKgFields,
|
|
62
|
+
d as C_DefaultMlKgFields,
|
|
63
63
|
X as C_FrequencyDosageMap,
|
|
64
64
|
_ as C_MedicineCalculatorList,
|
|
65
65
|
g as C_MedicineFrequencyList,
|
|
66
66
|
a as C_MedicineTypeList,
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
s as C_Table_Column_Name,
|
|
68
|
+
o as E_CalculationType
|
|
69
69
|
};
|
package/dist/index.js
CHANGED