@verifiedinc-public/shared-ui-elements 8.21.2 → 8.22.0
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/components/chart/OneClickHealthBigNumbers/OneClickHealthBigNumbers.d.ts +1 -1
- package/dist/components/chart/OneClickHealthBigNumbers/OneClickHealthBigNumbers.mjs +1 -1
- package/dist/components/chart/OneClickHealthBigNumbers/OneClickHealthBigNumbersMapper.d.ts +3 -8
- package/dist/components/chart/OneClickHealthBigNumbers/OneClickHealthBigNumbersMapper.mjs +1 -1
- package/dist/components/chart/OneClickHealthOutcomeOverTimeChart/OneClickHealthOutcomeOverTimeChart.d.ts +16 -0
- package/dist/components/chart/OneClickHealthOutcomeOverTimeChart/OneClickHealthOutcomeOverTimeChart.map.d.ts +22 -0
- package/dist/components/chart/OneClickHealthOutcomeOverTimeChart/OneClickHealthOutcomeOverTimeChart.map.mjs +1 -0
- package/dist/components/chart/OneClickHealthOutcomeOverTimeChart/OneClickHealthOutcomeOverTimeChart.mjs +1 -0
- package/dist/components/chart/OneClickHealthOutcomeOverTimeChart/index.d.ts +2 -0
- package/dist/components/chart/OneClickHealthOverTimeChart/OneClickHealthOverTimeChart.d.ts +4 -0
- package/dist/components/chart/OneClickHealthPercentageChart/OneClickHealthPercentageChart.d.ts +4 -0
- package/dist/components/chart/OneClickHealthSynchronizedMetricsChart/OneClickHealthSynchronizedMetricsChart.d.ts +17 -0
- package/dist/components/chart/OneClickHealthSynchronizedMetricsChart/OneClickHealthSynchronizedMetricsChart.map.d.ts +18 -0
- package/dist/components/chart/OneClickHealthSynchronizedMetricsChart/OneClickHealthSynchronizedMetricsChart.map.mjs +1 -0
- package/dist/components/chart/OneClickHealthSynchronizedMetricsChart/OneClickHealthSynchronizedMetricsChart.mjs +1 -0
- package/dist/components/chart/OneClickHealthSynchronizedMetricsChart/index.d.ts +2 -0
- package/dist/components/chart/OneClickOverTimeChart/OneClickOverTimeChart.d.ts +4 -0
- package/dist/components/chart/OneClickPercentageChart/OneClickPercentageChart.d.ts +4 -0
- package/dist/components/chart/OneClickSignupOutcomeOverTimeChart/OneClickSignupOutcomeOverTimeChart.d.ts +16 -0
- package/dist/components/chart/OneClickSignupOutcomeOverTimeChart/OneClickSignupOutcomeOverTimeChart.map.d.ts +21 -0
- package/dist/components/chart/OneClickSignupOutcomeOverTimeChart/OneClickSignupOutcomeOverTimeChart.map.mjs +1 -0
- package/dist/components/chart/OneClickSignupOutcomeOverTimeChart/OneClickSignupOutcomeOverTimeChart.mjs +1 -0
- package/dist/components/chart/OneClickSignupOutcomeOverTimeChart/index.d.ts +2 -0
- package/dist/components/chart/OneClickSignupSynchronizedMetricsChart/OneClickSignupSynchronizedMetricsChart.d.ts +17 -0
- package/dist/components/chart/OneClickSignupSynchronizedMetricsChart/OneClickSignupSynchronizedMetricsChart.map.d.ts +18 -0
- package/dist/components/chart/OneClickSignupSynchronizedMetricsChart/OneClickSignupSynchronizedMetricsChart.map.mjs +1 -0
- package/dist/components/chart/OneClickSignupSynchronizedMetricsChart/OneClickSignupSynchronizedMetricsChart.mjs +1 -0
- package/dist/components/chart/OneClickSignupSynchronizedMetricsChart/index.d.ts +2 -0
- package/dist/components/chart/OneClickVerificationBigNumbers/OneClickVerificationBigNumbers.d.ts +3 -3
- package/dist/components/chart/OneClickVerificationBigNumbers/OneClickVerificationBigNumbers.mjs +1 -1
- package/dist/components/chart/OneClickVerificationBigNumbers/OneClickVerificationBigNumbersMapper.d.ts +5 -7
- package/dist/components/chart/OneClickVerificationBigNumbers/OneClickVerificationBigNumbersMapper.mjs +1 -1
- package/dist/components/chart/OneClickVerificationFunnelChart/OneClickVerificationFunnelChart.mjs +1 -1
- package/dist/components/chart/OneClickVerificationOutcomeOverTimeChart/OneClickVerificationOutcomeOverTimeChart.d.ts +9 -4
- package/dist/components/chart/OneClickVerificationOutcomeOverTimeChart/OneClickVerificationOutcomeOverTimeChart.mjs +1 -1
- package/dist/components/chart/OutcomeOverTimeChart/OutcomeOverTimeChart.d.ts +18 -0
- package/dist/components/chart/OutcomeOverTimeChart/OutcomeOverTimeChart.mjs +1 -0
- package/dist/components/chart/OutcomeOverTimeChart/index.d.ts +1 -0
- package/dist/components/chart/OverviewBigNumbers/OverviewBigNumbers.d.ts +7 -0
- package/dist/components/chart/OverviewBigNumbers/OverviewBigNumbers.mjs +1 -0
- package/dist/components/chart/OverviewBigNumbers/OverviewBigNumbers.types.d.ts +13 -0
- package/dist/components/chart/OverviewBigNumbers/OverviewBigNumbers.types.mjs +1 -0
- package/dist/components/chart/OverviewBigNumbers/index.d.ts +2 -0
- package/dist/components/chart/SignupBigNumbers/SignupBigNumbers.d.ts +1 -1
- package/dist/components/chart/SignupBigNumbers/SignupBigNumbers.mjs +1 -1
- package/dist/components/chart/SignupBigNumbers/SignupBigNumbersMapper.d.ts +5 -8
- package/dist/components/chart/SignupBigNumbers/SignupBigNumbersMapper.mjs +1 -1
- package/dist/components/chart/SynchronizedMetricsChart/SynchronizedMetricsChart.d.ts +3 -0
- package/dist/components/chart/SynchronizedMetricsChart/SynchronizedMetricsChart.mjs +1 -0
- package/dist/components/chart/SynchronizedMetricsChart/SynchronizedMetricsChart.types.d.ts +21 -0
- package/dist/components/chart/SynchronizedMetricsChart/index.d.ts +2 -0
- package/dist/components/chart/TTSBigNumbers/TTSBigNumbers.d.ts +1 -1
- package/dist/components/chart/TTSBigNumbers/TTSBigNumbers.mjs +1 -1
- package/dist/components/chart/TTSBigNumbers/TTSBigNumbersMapper.d.ts +5 -8
- package/dist/components/chart/TTSBigNumbers/TTSBigNumbersMapper.mjs +1 -1
- package/dist/components/chart/index.d.ts +7 -0
- package/dist/components/chart/index.mjs +1 -1
- package/dist/components/form/DateInput/index.mjs +1 -1
- package/dist/components/form/MemberIdInput.d.ts +21 -0
- package/dist/components/form/MemberIdInput.mjs +1 -0
- package/dist/components/form/NewOneClickForm/core/fields/healthInsurance.d.ts +104 -0
- package/dist/components/form/NewOneClickForm/core/fields/healthInsurance.mjs +1 -0
- package/dist/components/form/NewOneClickForm/core/fields/index.d.ts +86 -0
- package/dist/components/form/NewOneClickForm/core/fields/index.mjs +1 -1
- package/dist/components/form/NewOneClickForm/core/form/form.d.ts +8 -0
- package/dist/components/form/NewOneClickForm/core/form/formBuilder.mjs +1 -1
- package/dist/components/form/NewOneClickForm/core/form/formField.mjs +1 -1
- package/dist/components/form/NewOneClickForm/core/form/formFieldBuilder.mjs +1 -1
- package/dist/components/form/NewOneClickForm/core/formats/healthInsurance.format.d.ts +3 -0
- package/dist/components/form/NewOneClickForm/core/formats/healthInsurance.format.mjs +1 -0
- package/dist/components/form/NewOneClickForm/core/formats/index.d.ts +1 -0
- package/dist/components/form/NewOneClickForm/core/internal/mappers/domain.map.d.ts +2 -0
- package/dist/components/form/NewOneClickForm/core/internal/mappers/domain.map.mjs +1 -0
- package/dist/components/form/NewOneClickForm/core/internal/mappers/index.d.ts +1 -0
- package/dist/components/form/NewOneClickForm/core/validations/healthInsurance/healthInsurance.schema.d.ts +35 -0
- package/dist/components/form/NewOneClickForm/core/validations/healthInsurance/healthInsurance.schema.mjs +1 -0
- package/dist/components/form/NewOneClickForm/core/validations/healthInsurance/index.d.ts +3 -0
- package/dist/components/form/NewOneClickForm/core/validations/healthInsurance/memberId.schema.d.ts +3 -0
- package/dist/components/form/NewOneClickForm/core/validations/healthInsurance/memberId.schema.mjs +1 -0
- package/dist/components/form/NewOneClickForm/core/validations/healthInsurance/payerName.schema.d.ts +3 -0
- package/dist/components/form/NewOneClickForm/core/validations/healthInsurance/payerName.schema.mjs +1 -0
- package/dist/components/form/NewOneClickForm/core/validations/index.d.ts +1 -0
- package/dist/components/form/NewOneClickForm/react/ui/fields/input/date.field.mjs +1 -1
- package/dist/components/form/NewOneClickForm/react/ui/fields/input/field.mjs +1 -1
- package/dist/components/form/NewOneClickForm/react/ui/fields/input/healthInsurance.field.d.ts +3 -0
- package/dist/components/form/NewOneClickForm/react/ui/fields/input/healthInsurance.field.mjs +1 -0
- package/dist/components/form/NewOneClickForm/react/ui/fields/readonly/driversLicense.field.d.ts +3 -0
- package/dist/components/form/NewOneClickForm/react/ui/fields/readonly/driversLicense.field.mjs +1 -0
- package/dist/components/form/NewOneClickForm/react/ui/fields/readonly/field.mjs +1 -1
- package/dist/components/form/NewOneClickForm/react/ui/fields/readonly/healthInsurance.field.d.ts +3 -0
- package/dist/components/form/NewOneClickForm/react/ui/fields/readonly/healthInsurance.field.mjs +1 -0
- package/dist/components/form/NewOneClickForm/react/ui/fields/readonly/variantSelect.field.d.ts +8 -0
- package/dist/components/form/NewOneClickForm/react/ui/fields/readonly/variantSelect.field.mjs +1 -0
- package/dist/components/form/NewOneClickForm/react/ui/fields/shared.mjs +1 -1
- package/dist/components/form/NewOneClickForm/react/ui/fields/style.d.ts +13 -3
- package/dist/components/form/NewOneClickForm/react/ui/fields/style.mjs +1 -1
- package/dist/components/form/NewOneClickForm/react/ui/form-content.mjs +1 -1
- package/dist/components/form/NewOneClickForm/react/ui/form.context.d.ts +10 -0
- package/dist/components/form/NewOneClickForm/react/ui/form.context.mjs +1 -1
- package/dist/components/form/NewOneClickForm/react/ui/form.mjs +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/utils/color/index.d.ts +8 -0
- package/dist/utils/color/index.mjs +1 -1
- package/dist/utils/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";import{defaultOverviewMetrics as f}from"../OverviewBigNumbers/OverviewBigNumbers.types.mjs";const a=f;function v(e){if(!(e!=null&&e.length))return a;let t=0,c=0;const i=0;e.forEach(r=>{var n;if((n=r.interval)!=null&&n.length){const o=r.interval.reduce((s,l)=>s+(l.ttsSent||0),0),d=r.interval.reduce((s,l)=>s+(l.ttsVerified||0),0);t+=o,c+=d}});const u=t>0?c/t:0;return{started:t,succeeded:c,totalCost:i,successRate:u}}export{v as calculateTTSMetrics,a as defaultMetrics};
|
|
@@ -16,6 +16,7 @@ export * from './MonthlySignupsOverviewTable';
|
|
|
16
16
|
export * from './LoadingChartSection';
|
|
17
17
|
export * from './EmptyChartSection';
|
|
18
18
|
export * from './MetricLastUpdated';
|
|
19
|
+
export * from './OverviewBigNumbers';
|
|
19
20
|
export * from './SignupBigNumbers';
|
|
20
21
|
export * from './TTSOverTimeChart';
|
|
21
22
|
export * from './TTSBigNumbers';
|
|
@@ -27,5 +28,11 @@ export * from './OneClickVerificationEventsOverTimeChart';
|
|
|
27
28
|
export * from './OneClickVerificationSuccessOverTimeChart';
|
|
28
29
|
export * from './FunnelChart';
|
|
29
30
|
export * from './OneClickVerificationFunnelChart';
|
|
31
|
+
export * from './OutcomeOverTimeChart';
|
|
30
32
|
export * from './OneClickVerificationOutcomeOverTimeChart';
|
|
33
|
+
export * from './OneClickHealthOutcomeOverTimeChart';
|
|
34
|
+
export * from './OneClickSignupOutcomeOverTimeChart';
|
|
31
35
|
export * from './oneClickVerification.types';
|
|
36
|
+
export * from './SynchronizedMetricsChart';
|
|
37
|
+
export * from './OneClickSignupSynchronizedMetricsChart';
|
|
38
|
+
export * from './OneClickHealthSynchronizedMetricsChart';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{SeriesChart as e}from"./SeriesChart/index.mjs";import{SeriesChartLegend as a}from"./SeriesChartLegend/index.mjs";import{SeriesPercentageChart as r}from"./SeriesPercentageChart/index.mjs";import{BigNumber as i}from"./BigNumber/index.mjs";import{SimpleBarChart as t}from"./SimpleBarChart/index.mjs";import{AreaChart as m}from"./AreaChart/index.mjs";import{ErrorCodesChart as s}from"./ErrorCodesChart/index.mjs";import{ReasonCodesChart as o}from"./ReasonCodesChart/index.mjs";import{PieChart as n}from"./PieChart/index.mjs";import{RiskScorePieChart as c}from"./RiskScorePieChart/index.mjs";import{RiskScoreBarChart as C}from"./RiskScoreBarChart/index.mjs";import{SimpleLegend as p}from"./SimpleLegend/index.mjs";import{LoadingChartSection as
|
|
1
|
+
"use strict";import{SeriesChart as e}from"./SeriesChart/index.mjs";import{SeriesChartLegend as a}from"./SeriesChartLegend/index.mjs";import{SeriesPercentageChart as r}from"./SeriesPercentageChart/index.mjs";import{BigNumber as i}from"./BigNumber/index.mjs";import{SimpleBarChart as t}from"./SimpleBarChart/index.mjs";import{AreaChart as m}from"./AreaChart/index.mjs";import{ErrorCodesChart as s}from"./ErrorCodesChart/index.mjs";import{ReasonCodesChart as o}from"./ReasonCodesChart/index.mjs";import{PieChart as n}from"./PieChart/index.mjs";import{RiskScorePieChart as c}from"./RiskScorePieChart/index.mjs";import{RiskScoreBarChart as C}from"./RiskScoreBarChart/index.mjs";import{SimpleLegend as p}from"./SimpleLegend/index.mjs";import{LoadingChartSection as h}from"./LoadingChartSection.mjs";import{EmptyChartSection as O}from"./EmptyChartSection.mjs";import{MetricLastUpdated as l}from"./MetricLastUpdated.mjs";import{FunnelChart as f}from"./FunnelChart/index.mjs";import{mapSeriesTimeSeriesData as S}from"./SeriesChart/SeriesChart.map.mjs";import{OneClickPercentageChart as u}from"./OneClickPercentageChart/OneClickPercentageChart.mjs";import{OneClickOverTimeChart as k}from"./OneClickOverTimeChart/OneClickOverTimeChart.mjs";import{mapOneClickTimeSeriesData as T}from"./OneClickOverTimeChart/OneClickOverTimeChart.map.mjs";import{mapMonthlySignupsOverviewTableData as v}from"./MonthlySignupsOverviewTable/MonthlySignupsOverviewTableDataMapper.mjs";import{MonthlySignupsOverviewTable as g}from"./MonthlySignupsOverviewTable/MonthlySignupsOverviewTable.mjs";import{OverviewBigNumbers as d}from"./OverviewBigNumbers/OverviewBigNumbers.mjs";import{defaultOverviewMetrics as D}from"./OverviewBigNumbers/OverviewBigNumbers.types.mjs";import{SignupBigNumbers as H}from"./SignupBigNumbers/SignupBigNumbers.mjs";import{TTSOverTimeChart as M}from"./TTSOverTimeChart/TTSOverTimeChart.mjs";import{mapTTSTimeSeriesData as V}from"./TTSOverTimeChart/TTSOverTimeChart.map.mjs";import{TTSBigNumbers as b}from"./TTSBigNumbers/TTSBigNumbers.mjs";import{OneClickHealthOverTimeChart as y}from"./OneClickHealthOverTimeChart/OneClickHealthOverTimeChart.mjs";import{mapOneClickHealthTimeSeriesData as B}from"./OneClickHealthOverTimeChart/OneClickHealthOverTimeChart.map.mjs";import{OneClickHealthBigNumbers as N}from"./OneClickHealthBigNumbers/OneClickHealthBigNumbers.mjs";import{calculateOneClickHealthMetrics as z,defaultMetrics as P}from"./OneClickHealthBigNumbers/OneClickHealthBigNumbersMapper.mjs";import{OneClickHealthPercentageChart as w}from"./OneClickHealthPercentageChart/OneClickHealthPercentageChart.mjs";import{OneClickVerificationBigNumbers as L}from"./OneClickVerificationBigNumbers/OneClickVerificationBigNumbers.mjs";import{OneClickVerificationEventsOverTimeChart as E}from"./OneClickVerificationEventsOverTimeChart/OneClickVerificationEventsOverTimeChart.mjs";import{mapOneClickVerificationAreaSeriesData as F}from"./OneClickVerificationEventsOverTimeChart/OneClickVerificationEventsOverTimeChart.map.mjs";import{OneClickVerificationSuccessOverTimeChart as R}from"./OneClickVerificationSuccessOverTimeChart/OneClickVerificationSuccessOverTimeChart.mjs";import{mapOneClickVerificationSuccessOverTimeChartData as A}from"./OneClickVerificationSuccessOverTimeChart/OneClickVerificationSuccessOverTimeChart.map.mjs";import{OneClickVerificationFunnelChart as U}from"./OneClickVerificationFunnelChart/OneClickVerificationFunnelChart.mjs";import{mapOneClickVerificationFunnelChartData as x}from"./OneClickVerificationFunnelChart/OneClickVerificationFunnelChart.map.mjs";import{OutcomeOverTimeChart as j}from"./OutcomeOverTimeChart/OutcomeOverTimeChart.mjs";import{OneClickVerificationOutcomeOverTimeChart as q}from"./OneClickVerificationOutcomeOverTimeChart/OneClickVerificationOutcomeOverTimeChart.mjs";import{mapOneClickVerificationOutcomeOverTimeChartData as G}from"./OneClickVerificationOutcomeOverTimeChart/OneClickVerificationOutcomeOverTimeChart.map.mjs";import{OneClickHealthOutcomeOverTimeChart as I}from"./OneClickHealthOutcomeOverTimeChart/OneClickHealthOutcomeOverTimeChart.mjs";import{mapOneClickHealthOutcomeOverTimeChartData as J}from"./OneClickHealthOutcomeOverTimeChart/OneClickHealthOutcomeOverTimeChart.map.mjs";import{OneClickSignupOutcomeOverTimeChart as K}from"./OneClickSignupOutcomeOverTimeChart/OneClickSignupOutcomeOverTimeChart.mjs";import{mapOneClickSignupOutcomeOverTimeChartData as Q}from"./OneClickSignupOutcomeOverTimeChart/OneClickSignupOutcomeOverTimeChart.map.mjs";import{SynchronizedMetricsChart as W}from"./SynchronizedMetricsChart/SynchronizedMetricsChart.mjs";import{OneClickSignupSynchronizedMetricsChart as X}from"./OneClickSignupSynchronizedMetricsChart/OneClickSignupSynchronizedMetricsChart.mjs";import{mapOneClickSignupSynchronizedData as Y}from"./OneClickSignupSynchronizedMetricsChart/OneClickSignupSynchronizedMetricsChart.map.mjs";import{OneClickHealthSynchronizedMetricsChart as Z}from"./OneClickHealthSynchronizedMetricsChart/OneClickHealthSynchronizedMetricsChart.mjs";import{mapOneClickHealthSynchronizedData as _}from"./OneClickHealthSynchronizedMetricsChart/OneClickHealthSynchronizedMetricsChart.map.mjs";export{m as AreaChart,i as BigNumber,O as EmptyChartSection,s as ErrorCodesChart,f as FunnelChart,h as LoadingChartSection,l as MetricLastUpdated,g as MonthlySignupsOverviewTable,N as OneClickHealthBigNumbers,I as OneClickHealthOutcomeOverTimeChart,y as OneClickHealthOverTimeChart,w as OneClickHealthPercentageChart,Z as OneClickHealthSynchronizedMetricsChart,k as OneClickOverTimeChart,u as OneClickPercentageChart,K as OneClickSignupOutcomeOverTimeChart,X as OneClickSignupSynchronizedMetricsChart,L as OneClickVerificationBigNumbers,E as OneClickVerificationEventsOverTimeChart,U as OneClickVerificationFunnelChart,q as OneClickVerificationOutcomeOverTimeChart,R as OneClickVerificationSuccessOverTimeChart,j as OutcomeOverTimeChart,d as OverviewBigNumbers,n as PieChart,o as ReasonCodesChart,C as RiskScoreBarChart,c as RiskScorePieChart,e as SeriesChart,a as SeriesChartLegend,r as SeriesPercentageChart,H as SignupBigNumbers,t as SimpleBarChart,p as SimpleLegend,W as SynchronizedMetricsChart,b as TTSBigNumbers,M as TTSOverTimeChart,z as calculateOneClickHealthMetrics,P as defaultMetrics,D as defaultOverviewMetrics,v as mapMonthlySignupsOverviewTableData,J as mapOneClickHealthOutcomeOverTimeChartData,_ as mapOneClickHealthSynchronizedData,B as mapOneClickHealthTimeSeriesData,Q as mapOneClickSignupOutcomeOverTimeChartData,Y as mapOneClickSignupSynchronizedData,T as mapOneClickTimeSeriesData,F as mapOneClickVerificationAreaSeriesData,x as mapOneClickVerificationFunnelChartData,G as mapOneClickVerificationOutcomeOverTimeChartData,A as mapOneClickVerificationSuccessOverTimeChartData,S as mapSeriesTimeSeriesData,V as mapTTSTimeSeriesData};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{forwardRef as S,useState as M,useRef as
|
|
1
|
+
"use strict";import{forwardRef as S,useState as M,useRef as O,useMemo as Y}from"react";import{TextField as F,Box as T,Stack as A,IconButton as N}from"@mui/material";import{CalendarToday as $}from"@mui/icons-material";import y from"../../../node_modules/react-datepicker/dist/es/index.mjs";import{useOnClickOutside as E}from"../../../hooks/useOnClickOutside.mjs";import R from"../../../styles/lib/react-datepicker.css.mjs";import{masks as B}from"../../../utils/masks/index.mjs";import{InputMask as j}from"../InputMask.mjs";import{jsxs as C,Fragment as z,jsx as a}from"react/jsx-runtime";const K=y.default??y,W=S(function(t,r){return a(A,{ref:r,sx:{position:"relative"},children:a(N,{edge:"end",size:"small",onClick:()=>{var l;t.disabled||(l=t.onFocus)==null||l.call(t)},disabled:t.disabled,children:a($,{fontSize:"small"})})})}),_=function({value:t,onChange:r,defaultSelectedDate:l,overflow:h=!1,clickOutsideBoundaryElement:u,minDate:x,maxDate:p,disabled:c}){const[b,d]=M(!1),m=O(null),k=new Date("08/01/1989"),f=x??new Date(1900,0,1),n=p??new Date,w=e=>{if(!e||!(e instanceof Date)||isNaN(e.getTime()))return"";try{const o=e.getDate().toString().padStart(2,"0"),s=(e.getMonth()+1).toString().padStart(2,"0"),i=e.getFullYear();return s==="00"||s>"12"||o==="00"||o>"31"||i<1900||i>n.getFullYear()?"":`${s}/${o}/${i}`}catch{return""}},D=Y(()=>{if(!t)return l??void 0;const e=new Date(t);return isNaN(+e)||!/^\d{2}\/\d{2}\/\d{4}$/.test(t)||e<f||e>n?k:e},[t]);return E(m,()=>{d(!1)},"mousedown",{},u),C(T,{ref:m,sx:{position:"relative","& .react-datepicker-popper":h?{transform:"translate(calc(-100% + 32px), calc(-50% + 10px))!important"}:{}},children:[a("style",{children:R}),a(K,{open:b,onFocus:()=>{d(e=>!e)},popperPlacement:"bottom-end",placeholderText:"MM/DD/YYYY",showPopperArrow:!1,showYearDropdown:!0,showMonthDropdown:!0,scrollableYearDropdown:!1,dateFormat:"MM/dd/yyyy",minDate:f,maxDate:n,selected:D,dropdownMode:"select",onSelect:e=>{const o=w(e);o&&(r?.({target:{value:o}}),d(!1))},disabled:c,customInput:a(W,{disabled:c})})]})};function G({label:t="Date",value:r,error:l,helperText:h,onChange:u,onBlur:x,disabled:p,pickerDefaultSelectedDate:c,pickerClickOutsideBoundaryElement:b,pickerInputOverflow:d=!1,inputMaskProps:m,minDate:k,maxDate:f,...n},w){var D;const[e,o]=M(""),s=r!==void 0,i=s?r:e,g=P=>{const v=P.target.value;s||o(v),u&&u(v)},I={label:t,error:l,helperText:h,fullWidth:!0,...n,autoComplete:"bday",inputProps:{...n.inputProps,inputMode:"numeric",tabIndex:0,mask:B.DOB_MASK},InputProps:{...n.InputProps,endAdornment:C(z,{children:[a(_,{onChange:g,value:i,overflow:d,clickOutsideBoundaryElement:b,defaultSelectedDate:c,minDate:k,maxDate:f,disabled:p}),(D=n.InputProps)==null?void 0:D.endAdornment]})}};return a(j,{mask:B.DOB_MASK,maskPlaceholder:null,disabled:p,value:i,onBlur:x,onChange:g,...m,children:a(F,{...I,inputRef:w,fullWidth:!0,sx:{flex:1,"& input":{boxShadow:"none!important",border:"none!important",letterSpacing:"1px"}}})})}const q=S(G);export{q as DateInput};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TextFieldProps } from '@mui/material';
|
|
3
|
+
export type MemberIdInputProps = Omit<TextFieldProps, 'onChange'> & {
|
|
4
|
+
onChange?: (event: {
|
|
5
|
+
target: {
|
|
6
|
+
value: string;
|
|
7
|
+
};
|
|
8
|
+
}) => void;
|
|
9
|
+
name?: string;
|
|
10
|
+
value?: string;
|
|
11
|
+
label?: ReactNode;
|
|
12
|
+
error?: boolean;
|
|
13
|
+
helperText?: string;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Masked input for member IDs. Displays the middle characters as bullets.
|
|
18
|
+
* - Pre-filled / redacted values: any keystroke starts fresh; backspace clears.
|
|
19
|
+
* - User-typed values: normal editing; backspace always clears the whole field.
|
|
20
|
+
*/
|
|
21
|
+
export declare function MemberIdInput({ onChange, label, value, placeholder, InputProps, ...rest }: MemberIdInputProps): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{useRef as m}from"react";import{Box as K,TextField as b}from"@mui/material";import{jsx as y}from"react/jsx-runtime";function M(n){return n.includes("*")||n.includes("\u2022")}function v(n){const t=n.replace(/\*/g,"\u2022");if(t.includes("\u2022"))return t;const s=t.length;return s<=2?t:s<5?"\u2022".repeat(s-2)+t.slice(-2):t.slice(0,2)+"\u2022".repeat(s-4)+t.slice(-2)}function P({onChange:n,label:t="Member ID",value:s,placeholder:k="",InputProps:g,...x}){const h=m(null),f=m(0),i=s??"",d=!M(i)&&(i===""||h.current===i),D=v(i);function a(e){h.current=e,n?.({target:{value:e}})}return y(K,{width:"100%",children:y(b,{...x,label:t,value:D,placeholder:k,onChange:e=>{const l=e.target.value,r=h.current??"",o=v(r),c=f.current;if(!d){a(l.replace(/•/g,""));return}let p;if(l.length>o.length){const u=l.slice(c,c+(l.length-o.length));p=r.slice(0,c)+u.replace(/•/g,"")+r.slice(c)}else if(l.length<o.length){const u=e.target.selectionStart??0,I=o.length-l.length;p=r.slice(0,u)+r.slice(u+I)}else{const u=l[c]??"";p=r.slice(0,c)+u+r.slice(c+1)}a(p)},inputProps:{onKeyDown:e=>{if(f.current=e.currentTarget.selectionStart??0,e.key==="Backspace"||e.key==="Delete"){e.preventDefault(),i!==""&&a("");return}d||e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&(e.preventDefault(),a(e.key))}},InputProps:{...g,endAdornment:g?.endAdornment},fullWidth:!0})})}export{P as MemberIdInput};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HealthInsuranceValue } from '../validations';
|
|
3
|
+
import { TextFieldDefinition, CompositeFieldDefinition } from './types';
|
|
4
|
+
declare const healthInsuranceKey = "healthInsurance";
|
|
5
|
+
declare const memberIdKey = "memberId";
|
|
6
|
+
declare const payerKey = "payer";
|
|
7
|
+
export declare const memberId: {
|
|
8
|
+
key: string;
|
|
9
|
+
characteristics: {
|
|
10
|
+
inputType: "text";
|
|
11
|
+
label: string;
|
|
12
|
+
placeholder: string;
|
|
13
|
+
};
|
|
14
|
+
zodSchema: z.ZodString;
|
|
15
|
+
};
|
|
16
|
+
export declare const payerName: {
|
|
17
|
+
key: string;
|
|
18
|
+
characteristics: {
|
|
19
|
+
inputType: "text";
|
|
20
|
+
label: string;
|
|
21
|
+
placeholder: string;
|
|
22
|
+
};
|
|
23
|
+
zodSchema: z.ZodString;
|
|
24
|
+
};
|
|
25
|
+
export declare const payer: {
|
|
26
|
+
key: string;
|
|
27
|
+
characteristics: {
|
|
28
|
+
inputType: "composite";
|
|
29
|
+
label: string;
|
|
30
|
+
defaultOrder: readonly ["name"];
|
|
31
|
+
};
|
|
32
|
+
children: {
|
|
33
|
+
name: {
|
|
34
|
+
key: string;
|
|
35
|
+
characteristics: {
|
|
36
|
+
inputType: "text";
|
|
37
|
+
label: string;
|
|
38
|
+
placeholder: string;
|
|
39
|
+
};
|
|
40
|
+
zodSchema: z.ZodString;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
zodSchema: z.ZodObject<{
|
|
44
|
+
name: z.ZodOptional<z.ZodString>;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
name?: string | undefined;
|
|
47
|
+
}, {
|
|
48
|
+
name?: string | undefined;
|
|
49
|
+
}>;
|
|
50
|
+
};
|
|
51
|
+
export declare const healthInsurance: {
|
|
52
|
+
key: string;
|
|
53
|
+
characteristics: {
|
|
54
|
+
inputType: "composite";
|
|
55
|
+
label: string;
|
|
56
|
+
defaultOrder: readonly ["memberId", "payer"];
|
|
57
|
+
};
|
|
58
|
+
zodSchema: z.ZodObject<{
|
|
59
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
memberId: z.ZodString;
|
|
61
|
+
payer: z.ZodObject<{
|
|
62
|
+
verifiedId: z.ZodString;
|
|
63
|
+
name: z.ZodString;
|
|
64
|
+
logoUrl: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
name: string;
|
|
67
|
+
verifiedId: string;
|
|
68
|
+
logoUrl?: string | undefined;
|
|
69
|
+
}, {
|
|
70
|
+
name: string;
|
|
71
|
+
verifiedId: string;
|
|
72
|
+
logoUrl?: string | undefined;
|
|
73
|
+
}>;
|
|
74
|
+
}, "strip", z.ZodTypeAny, {
|
|
75
|
+
memberId: string;
|
|
76
|
+
payer: {
|
|
77
|
+
name: string;
|
|
78
|
+
verifiedId: string;
|
|
79
|
+
logoUrl?: string | undefined;
|
|
80
|
+
};
|
|
81
|
+
id?: number | undefined;
|
|
82
|
+
}, {
|
|
83
|
+
memberId: string;
|
|
84
|
+
payer: {
|
|
85
|
+
name: string;
|
|
86
|
+
verifiedId: string;
|
|
87
|
+
logoUrl?: string | undefined;
|
|
88
|
+
};
|
|
89
|
+
id?: number | undefined;
|
|
90
|
+
}>;
|
|
91
|
+
format: (value: HealthInsuranceValue) => string | null;
|
|
92
|
+
};
|
|
93
|
+
declare module '../declarations' {
|
|
94
|
+
interface FieldSchemaDefinitions {
|
|
95
|
+
healthInsurance: CompositeFieldDefinition<typeof healthInsuranceKey>;
|
|
96
|
+
memberId: TextFieldDefinition<typeof memberIdKey>;
|
|
97
|
+
payer: CompositeFieldDefinition<typeof payerKey>;
|
|
98
|
+
payerName: TextFieldDefinition<'name'>;
|
|
99
|
+
}
|
|
100
|
+
interface FieldValueDefinitions {
|
|
101
|
+
healthInsurance: HealthInsuranceValue;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{z as t}from"zod";import{payerNameSchema as e}from"../validations/healthInsurance/payerName.schema.mjs";import{memberIdSchema as c}from"../validations/healthInsurance/memberId.schema.mjs";import{healthInsuranceFormat as o}from"../formats/healthInsurance.format.mjs";import{healthInsuranceSchema as n}from"../validations/healthInsurance/healthInsurance.schema.mjs";const s="healthInsurance",a="memberId",r="payer",h={key:a,characteristics:{inputType:"text",label:"Member ID",placeholder:"Enter member ID"},zodSchema:c},m={key:"name",characteristics:{inputType:"text",label:"Payer Name",placeholder:"Enter insurance payer name"},zodSchema:e},p={key:r,characteristics:{inputType:"composite",label:"Payer",defaultOrder:["name"]},children:{name:m},zodSchema:t.object({name:e.optional()})},i={key:s,characteristics:{inputType:"composite",label:"Health Insurance",defaultOrder:[a,r]},zodSchema:n,format:o};export{i as healthInsurance,h as memberId,p as payer,m as payerName};
|
|
@@ -512,6 +512,92 @@ export declare const fields: {
|
|
|
512
512
|
zodSchema: import('zod').ZodEffects<import('zod').ZodEffects<import('zod').ZodString, string, string>, string, string>;
|
|
513
513
|
format: (value: string) => string;
|
|
514
514
|
};
|
|
515
|
+
healthInsurance: {
|
|
516
|
+
key: string;
|
|
517
|
+
characteristics: {
|
|
518
|
+
inputType: "composite";
|
|
519
|
+
label: string;
|
|
520
|
+
defaultOrder: readonly ["memberId", "payer"];
|
|
521
|
+
};
|
|
522
|
+
zodSchema: import('zod').ZodObject<{
|
|
523
|
+
id: import('zod').ZodOptional<import('zod').ZodNumber>;
|
|
524
|
+
memberId: import('zod').ZodString;
|
|
525
|
+
payer: import('zod').ZodObject<{
|
|
526
|
+
verifiedId: import('zod').ZodString;
|
|
527
|
+
name: import('zod').ZodString;
|
|
528
|
+
logoUrl: import('zod').ZodOptional<import('zod').ZodString>;
|
|
529
|
+
}, "strip", import('zod').ZodTypeAny, {
|
|
530
|
+
name: string;
|
|
531
|
+
verifiedId: string;
|
|
532
|
+
logoUrl?: string | undefined;
|
|
533
|
+
}, {
|
|
534
|
+
name: string;
|
|
535
|
+
verifiedId: string;
|
|
536
|
+
logoUrl?: string | undefined;
|
|
537
|
+
}>;
|
|
538
|
+
}, "strip", import('zod').ZodTypeAny, {
|
|
539
|
+
memberId: string;
|
|
540
|
+
payer: {
|
|
541
|
+
name: string;
|
|
542
|
+
verifiedId: string;
|
|
543
|
+
logoUrl?: string | undefined;
|
|
544
|
+
};
|
|
545
|
+
id?: number | undefined;
|
|
546
|
+
}, {
|
|
547
|
+
memberId: string;
|
|
548
|
+
payer: {
|
|
549
|
+
name: string;
|
|
550
|
+
verifiedId: string;
|
|
551
|
+
logoUrl?: string | undefined;
|
|
552
|
+
};
|
|
553
|
+
id?: number | undefined;
|
|
554
|
+
}>;
|
|
555
|
+
format: (value: import('../validations').HealthInsuranceValue) => string | null;
|
|
556
|
+
};
|
|
557
|
+
memberId: {
|
|
558
|
+
key: string;
|
|
559
|
+
characteristics: {
|
|
560
|
+
inputType: "text";
|
|
561
|
+
label: string;
|
|
562
|
+
placeholder: string;
|
|
563
|
+
};
|
|
564
|
+
zodSchema: import('zod').ZodString;
|
|
565
|
+
};
|
|
566
|
+
payer: {
|
|
567
|
+
key: string;
|
|
568
|
+
characteristics: {
|
|
569
|
+
inputType: "composite";
|
|
570
|
+
label: string;
|
|
571
|
+
defaultOrder: readonly ["name"];
|
|
572
|
+
};
|
|
573
|
+
children: {
|
|
574
|
+
name: {
|
|
575
|
+
key: string;
|
|
576
|
+
characteristics: {
|
|
577
|
+
inputType: "text";
|
|
578
|
+
label: string;
|
|
579
|
+
placeholder: string;
|
|
580
|
+
};
|
|
581
|
+
zodSchema: import('zod').ZodString;
|
|
582
|
+
};
|
|
583
|
+
};
|
|
584
|
+
zodSchema: import('zod').ZodObject<{
|
|
585
|
+
name: import('zod').ZodOptional<import('zod').ZodString>;
|
|
586
|
+
}, "strip", import('zod').ZodTypeAny, {
|
|
587
|
+
name?: string | undefined;
|
|
588
|
+
}, {
|
|
589
|
+
name?: string | undefined;
|
|
590
|
+
}>;
|
|
591
|
+
};
|
|
592
|
+
payerName: {
|
|
593
|
+
key: string;
|
|
594
|
+
characteristics: {
|
|
595
|
+
inputType: "text";
|
|
596
|
+
label: string;
|
|
597
|
+
placeholder: string;
|
|
598
|
+
};
|
|
599
|
+
zodSchema: import('zod').ZodString;
|
|
600
|
+
};
|
|
515
601
|
ssn: {
|
|
516
602
|
key: string;
|
|
517
603
|
characteristics: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{middleName as
|
|
1
|
+
"use strict";import{middleName as s,lastName as r,firstName as t,fullName as m}from"./fullName.mjs";import{zipCode as i,country as o,state as n,city as p,line2 as c,line1 as d,address as l}from"./address.mjs";import{expirationDate as f,issuanceDate as u,issuanceState as N,documentNumber as y,driversLicense as b}from"./driversLicense.mjs";import{payerName as h,payer as D,memberId as x,healthInsurance as I}from"./healthInsurance.mjs";import{ssn as j}from"./ssn.mjs";import{phone as v}from"./phone.mjs";import{sex as z}from"./sex.mjs";import{birthDate as O}from"./birthDate.mjs";const a={fullName:m,firstName:t,lastName:r,middleName:s,address:l,line1:d,line2:c,city:p,state:n,country:o,zipCode:i,driversLicense:b,documentNumber:y,issuanceState:N,issuanceDate:u,expirationDate:f,healthInsurance:I,memberId:x,payer:D,payerName:h,ssn:j,phone:v,sex:z,birthDate:O},C=Object.fromEntries(Object.keys(a).map(e=>[e,e]));export{C as credentialKeys,a as fields};
|
|
@@ -8,6 +8,14 @@ export declare class Form {
|
|
|
8
8
|
get isDisabled(): boolean;
|
|
9
9
|
get values(): {
|
|
10
10
|
[k: string]: string | {
|
|
11
|
+
memberId: string;
|
|
12
|
+
payer: {
|
|
13
|
+
name: string;
|
|
14
|
+
verifiedId: string;
|
|
15
|
+
logoUrl?: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
id?: number | undefined;
|
|
18
|
+
} | {
|
|
11
19
|
firstName?: string | undefined;
|
|
12
20
|
lastName?: string | undefined;
|
|
13
21
|
middleName?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var C=Object.defineProperty,F=(u,e,t)=>e in u?C(u,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[e]=t,w=(u,e,t)=>F(u,typeof e!="symbol"?e+"":e,t);import{fields as p}from"../fields/index.mjs";import{FormFieldBuilder as O}from"./formFieldBuilder.mjs";import{Form as T}from"./form.mjs";import{normalizeCredentialType as m}from"./utils.mjs";import{fieldInputTypes as f}from"../fields/constants.mjs";class x{constructor(){w(this,"fieldBuilder",new O)}createFromCredentialAndRequests(e,t){const i={};for(const l of t){let r;if(typeof l=="string")r=this.expandCredentialType(l);else if(r=l,!r.children){const c=r.type.replace(/Credential$/,""),h=c.charAt(0).toLowerCase()+c.slice(1),d=p[h],y=["healthInsurance"];if(d&&d.characteristics.inputType===f.composite&&"children"in d&&"defaultOrder"in d.characteristics&&d.characteristics.defaultOrder&&!y.includes(h)){const v=this.expandCredentialType(r.type);r={...r,children:v.children}}}const n=m(r.type),s=e.filter(c=>c.type===n).filter(c=>this.credentialMeetsRequirements(r,c)),a=this.createField(r,s,n),o=p[n];o&&(i[o.key]=a)}return new T(i)}createField(e,t,i){const l=p[i];if(!l)throw new Error(`Unknown credential type: ${i}`);const r=this.extractRequestOptions(e);if(t.length===0)return this.fieldBuilder.createFromSchema(e,l);const n=t[0],s=this.createChildFields(e,n);let a;return t.length>1&&(a=t.map(o=>{const c=this.createChildFields(e,o);return this.fieldBuilder.createFromCredential(o,c,r)})),this.fieldBuilder.createFromCredential(n,s,r,a)}createChildFields(e,t){if(!e.children)return;const i={};for(const l of e.children){const r=m(l.type),n=p[r];if(!n)continue;const s=n.key;if(t.value&&s in t.value){let a;n.characteristics.inputType===f.composite?a=t.value[s]:a=t.value;const o={...t,uuid:void 0,type:r,value:a},c=this.extractRequestOptions(l,e);let h;n.characteristics.inputType===f.composite&&l.children&&(h=this.createChildFields(l,o));const d=this.fieldBuilder.createFromCredential(o,h,c);i[s]=d}else{const a=this.extractRequestOptions(l,e),o={...l,...a},c=this.fieldBuilder.createFromSchema(o,n);i[s]=c}}return Object.keys(i).length>0?i:void 0}expandCredentialType(e){var t;const i=e.replace(/Credential$/,""),l=i.charAt(0).toLowerCase()+i.slice(1),r=p[l];if(!r)throw new Error(`Unknown credential type: ${e}`);const n={type:e,allowUserInput:!0,mandatory:"no",multi:!1};if(r.characteristics.inputType===f.composite&&"children"in r&&"defaultOrder"in r.characteristics&&r.characteristics.defaultOrder){const s=[];for(const a of r.characteristics.defaultOrder){const o=(t=r.children)==null?void 0:t[a];if(o){const c=this.expandCredentialType(o.key);s.push(c)}}return{...n,children:s}}return n}credentialMeetsRequirements(e,t){if(!e.children)return!0;for(const i of e.children){const l=m(typeof i=="string"?i:i.type);if((typeof i=="string"?"no":i.mandatory??"no")==="no")continue;let r=!1;const n=p[l];if(n&&t.value){const s=n.key;r=s in t.value&&t.value[s]!==void 0&&t.value[s]!==null&&t.value[s]!==""}if(!r)return!1}return!0}extractRequestOptions(e,t){return{allowUserInput:e.allowUserInput??t?.allowUserInput??!0,mandatory:e.mandatory??t?.mandatory??"no",multi:e.multi??!1,description:e.description}}}export{x as FormBuilder};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var y=Object.defineProperty,b=(n,e,t)=>e in n?y(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,l=(n,e,t)=>b(n,typeof e!="symbol"?e+"":e,t);import{z as v}from"zod";import{cloneDeep as m}from"lodash";class f{constructor(e,t,s,i,r={}){if(l(this,"id"),l(this,"_defaultValue"),l(this,"_value"),l(this,"schema"),l(this,"children"),l(this,"touched"),l(this,"allowUserInput"),l(this,"mandatory"),l(this,"multi"),l(this,"variants"),l(this,"description"),this.id=e,this._defaultValue=t,this._value=s,this.children=r.children,this.touched=!1,this.allowUserInput=r.allowUserInput??!0,this.mandatory=r.mandatory??"no",this.multi=r.multi??!1,this.variants=r.variants,this.description=r.description,i.characteristics.inputType==="composite"&&r.children)if("_def"in i.zodSchema&&i.zodSchema._def.typeName==="ZodEffects")this.schema=i;else{let a;if("shape"in i.zodSchema)a=i.zodSchema;else throw new Error("Composite field could not be modified.");const h=a.shape,o={};Object.entries(r.children).forEach(([c,u])=>{if(h[c]){const d=h[c];u.isRequired?d instanceof v.ZodString?o[c]=d.refine(p=>!u.isRequired&&u.isEmpty?!0:p!==""&&p!==null&&p!==void 0,`${u.schema.characteristics.label} is required`):o[c]=d:o[c]=d.optional()}}),this.schema={...i,zodSchema:v.object(o)}}else this.schema={...i,zodSchema:i.zodSchema.refine(a=>!this.isRequired&&this.isEmpty?!0:a!==""&&a!==null&&a!==void 0,`${i.characteristics.label} is required`)}}get defaultValue(){if(this.schema.characteristics.inputType==="composite"&&this.children){const e={};return Object.entries(this.children).forEach(([t,s])=>{e[t]=s.defaultValue}),Object.keys(e).length>0?e:void 0}return this._defaultValue}get value(){if(this.schema.characteristics.inputType==="composite"&&this.children){const e={};return Object.entries(this.children).forEach(([t,s])=>{s.schema.characteristics.inputType==="composite"?e[t]=s.value:e[t]=s.isEmpty?"":s.value}),Object.keys(e).length>0?e:void 0}return this._value}set value(e){this._value=e}get hasVariants(){return this.variants?this.variants.length>1:!1}get isValid(){return this.errors===null}get isRequired(){return this.mandatory==="yes"||this.mandatory==="if_available"}get isDisabled(){return!this.allowUserInput}get isEmpty(){const e=t=>t==null||t===""?!0:typeof t=="object"&&t!==null?Object.values(t).every(e):!1;return e(this.value)}get isDirty(){return this.schema.characteristics.inputType==="composite"&&this.children?Object.values(this.children).some(e=>e.isDirty)
|
|
1
|
+
"use strict";var y=Object.defineProperty,b=(n,e,t)=>e in n?y(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,l=(n,e,t)=>b(n,typeof e!="symbol"?e+"":e,t);import{z as v}from"zod";import{isEqual as g,cloneDeep as m}from"lodash";class f{constructor(e,t,s,i,r={}){if(l(this,"id"),l(this,"_defaultValue"),l(this,"_value"),l(this,"schema"),l(this,"children"),l(this,"touched"),l(this,"allowUserInput"),l(this,"mandatory"),l(this,"multi"),l(this,"variants"),l(this,"description"),this.id=e,this._defaultValue=t,this._value=s,this.children=r.children,this.touched=!1,this.allowUserInput=r.allowUserInput??!0,this.mandatory=r.mandatory??"no",this.multi=r.multi??!1,this.variants=r.variants,this.description=r.description,i.characteristics.inputType==="composite"&&r.children)if("_def"in i.zodSchema&&i.zodSchema._def.typeName==="ZodEffects")this.schema=i;else{let a;if("shape"in i.zodSchema)a=i.zodSchema;else throw new Error("Composite field could not be modified.");const h=a.shape,o={};Object.entries(r.children).forEach(([c,u])=>{if(h[c]){const d=h[c];u.isRequired?d instanceof v.ZodString?o[c]=d.refine(p=>!u.isRequired&&u.isEmpty?!0:p!==""&&p!==null&&p!==void 0,`${u.schema.characteristics.label} is required`):o[c]=d:o[c]=d.optional()}}),this.schema={...i,zodSchema:v.object(o)}}else this.schema={...i,zodSchema:i.zodSchema.refine(a=>!this.isRequired&&this.isEmpty?!0:a!==""&&a!==null&&a!==void 0,`${i.characteristics.label} is required`)}}get defaultValue(){if(this.schema.characteristics.inputType==="composite"&&this.children){const e={};return Object.entries(this.children).forEach(([t,s])=>{e[t]=s.defaultValue}),Object.keys(e).length>0?e:void 0}return this._defaultValue}get value(){if(this.schema.characteristics.inputType==="composite"&&this.children){const e={};return Object.entries(this.children).forEach(([t,s])=>{s.schema.characteristics.inputType==="composite"?e[t]=s.value:e[t]=s.isEmpty?"":s.value}),Object.keys(e).length>0?e:void 0}return this._value}set value(e){this._value=e}get hasVariants(){return this.variants?this.variants.length>1:!1}get isValid(){return this.errors===null}get isRequired(){return this.mandatory==="yes"||this.mandatory==="if_available"}get isDisabled(){return!this.allowUserInput}get isEmpty(){const e=t=>t==null||t===""?!0:typeof t=="object"&&t!==null?Object.values(t).every(e):!1;return e(this.value)}get isDirty(){return this.schema.characteristics.inputType==="composite"&&this.children?Object.values(this.children).some(e=>e.isDirty):!g(this._value,this._defaultValue)}get errors(){let e=null;const t={};if(this.schema.characteristics.inputType==="composite"&&this.children){const s={};Object.entries(this.children).forEach(([r,a])=>{a.isEmpty&&!a.isRequired?s[r]=void 0:s[r]=a.value});const i=this.schema.zodSchema.safeParse(s);e=i.success?null:i.error,e!=null&&e.issues&&e.issues.length>0||Object.entries(this.children).forEach(([r,a])=>{const h=a.errors;h&&(t[r]=h)})}else if(!this.isRequired&&this.isEmpty)e=null;else{const s=this.schema.zodSchema.safeParse(this.value);e=s.success?null:s.error}return!e&&Object.keys(t).length===0?null:{error:e,childrenErrors:t}}get errorMessage(){var e,t,s,i;return((i=(s=(t=(e=this.errors)==null?void 0:e.error)==null?void 0:t.issues)==null?void 0:s.find(r=>typeof r.message=="string"))==null?void 0:i.message)??null}get displayValue(){if(typeof this.schema.format=="function")if(this.schema.characteristics.inputType==="composite"&&this.children){const e={};return Object.entries(this.children).forEach(([t,s])=>{e[t]=s.value}),this.schema.format(e)??null}else return this.isEmpty?null:this.schema.format(this.value)??this.value;return this.value}replaceWithVariant(e){if(!this.variants){console.warn(`Field ${this.id} has no variants`);return}const t=this.variants.find(i=>i.id===e);if(!t){console.warn(`Variant ${e} not found for field ${this.id}`);return}const s=this.variants;this.id=t.id,this.schema=t.schema,this.description=t.description,this.allowUserInput=t.allowUserInput,this.mandatory=t.mandatory,this.multi=t.multi,this._value=t.value&&typeof t.value=="object"?m(t.value):t.value,this._defaultValue=t.defaultValue&&typeof t.defaultValue=="object"?m(t.defaultValue):t.defaultValue,this.variants=s,t.children?(this.children={},Object.entries(t.children).forEach(([i,r])=>{this.children&&(this.children[i]=this.deepCloneFormField(r))})):this.children=void 0}deepCloneFormField(e){const t=e._value&&typeof e._value=="object"?m(e._value):e._value,s=e._defaultValue&&typeof e._defaultValue=="object"?m(e._defaultValue):e._defaultValue;let i;return e.children&&(i={},Object.entries(e.children).forEach(([r,a])=>{i&&(i[r]=this.deepCloneFormField(a))})),new f(e.id,s,t,e.schema,{children:i,allowUserInput:e.allowUserInput,mandatory:e.mandatory,multi:e.multi,variants:e.variants,description:e.description})}}export{f as FormField};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{cloneDeep as y}from"lodash";import{fields as p}from"../fields/index.mjs";import{FormField as
|
|
1
|
+
"use strict";import{cloneDeep as y}from"lodash";import{fields as p}from"../fields/index.mjs";import{FormField as u}from"./formField.mjs";import{normalizeCredentialType as f}from"./utils.mjs";import{fieldInputTypes as d}from"../fields/constants.mjs";class v{createFromCredential(i,o,e,r){var n;const a=p[i.type];if(!a)throw new Error(`Invalid credential type: ${i.type}`);const l=a.key;let t;if(a.characteristics.inputType===d.composite)if(i.value&&Object.keys(i.value).length>0)if(o&&Object.keys(o).length>0){const s={};Object.keys(o).forEach(c=>{c in i.value&&(s[c]=i.value[c])}),t=Object.keys(s).length>0?s:void 0}else t=i.value;else t=void 0;else t=(n=i.value)==null?void 0:n[l];return new u(i.uuid,t,t,a,{children:o,allowUserInput:e?.allowUserInput??!0,mandatory:e?.mandatory??"no",multi:e?.multi??!1,variants:r,description:e?.description})}createFromSchema(i,o){let e,r;const n={allowUserInput:i.allowUserInput??!0,mandatory:i.mandatory??"no",multi:i.multi??!1,description:i.description};if(o.characteristics.inputType===d.composite&&i.children){const l={};for(const t of i.children){const s=f(t.type),c=p[s];if(c){const m=this.createFromSchema(t,c);l[c.key]=m}}r=Object.keys(l).length>0?l:void 0}if(o.characteristics.inputType===d.composite)if(r&&Object.keys(r).length>0){const l={};Object.entries(r).forEach(([t,s])=>{l[t]=s.defaultValue}),e=l}else e=void 0;else e="";const a=typeof e=="object"&&e!==null?y(e):e;return new u(void 0,e,a,o,{children:r,allowUserInput:n.allowUserInput,mandatory:n.mandatory,multi:n.multi,variants:void 0,description:n.description})}}export{v as FormFieldBuilder};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=r=>{const e=r.replace(/\*/g,"\u2022");if(e.includes("\u2022"))return e;const n=e.length;if(n<=2)return e;if(n<5){const u=e.slice(-2);return"\u2022".repeat(n-2)+u}const l=e.slice(0,2),s=e.slice(-2),c=n-4,t="\u2022".repeat(c);return l+t+s},m=r=>{var e;return!((e=r?.payer)!=null&&e.name)||!(r!=null&&r.memberId)?null:`${r.payer.name}-${a(r.memberId)}`};export{m as healthInsuranceFormat,a as maskMemberId};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(n){return n.filter(Boolean)}export{e as toDomainCredentials};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './domain.map';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const healthInsuranceSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
memberId: z.ZodString;
|
|
5
|
+
payer: z.ZodObject<{
|
|
6
|
+
verifiedId: z.ZodString;
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
logoUrl: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
name: string;
|
|
11
|
+
verifiedId: string;
|
|
12
|
+
logoUrl?: string | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
name: string;
|
|
15
|
+
verifiedId: string;
|
|
16
|
+
logoUrl?: string | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
memberId: string;
|
|
20
|
+
payer: {
|
|
21
|
+
name: string;
|
|
22
|
+
verifiedId: string;
|
|
23
|
+
logoUrl?: string | undefined;
|
|
24
|
+
};
|
|
25
|
+
id?: number | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
memberId: string;
|
|
28
|
+
payer: {
|
|
29
|
+
name: string;
|
|
30
|
+
verifiedId: string;
|
|
31
|
+
logoUrl?: string | undefined;
|
|
32
|
+
};
|
|
33
|
+
id?: number | undefined;
|
|
34
|
+
}>;
|
|
35
|
+
export type HealthInsuranceValue = z.infer<typeof healthInsuranceSchema>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{z as e}from"zod";import{memberIdSchema as r}from"./memberId.schema.mjs";import{payerNameSchema as m}from"./payerName.schema.mjs";const o=e.object({id:e.number().optional(),memberId:r,payer:e.object({verifiedId:e.string().regex(/^V\d+$/),name:m,logoUrl:e.string().url().optional()})});export{o as healthInsuranceSchema};
|
package/dist/components/form/NewOneClickForm/core/validations/healthInsurance/memberId.schema.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{z as m}from"zod";const e="Member ID is required",r=m.string().min(1,e).max(255,e);export{r as memberIdSchema,e as memberIdValidationMessage};
|
package/dist/components/form/NewOneClickForm/core/validations/healthInsurance/payerName.schema.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{z as e}from"zod";const a="Payer name is required",m=e.string().min(1,a).max(255,a).trim();export{m as payerNameSchema,a as payerNameValidationMessage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useRef as
|
|
1
|
+
"use strict";import{useRef as x,useState as M}from"react";import{Box as S}from"@mui/material";import{USDateSchema as A}from"../../../../../../../validations/date.schema.mjs";import{formatDateMMDDYYYY as I}from"../../../../../../../utils/date.mjs";import{credentialKeys as B}from"../../../../core/fields/index.mjs";import{useFormField as K}from"../../../core/field.hook.mjs";import{useOneClickForm as N}from"../../form.context.mjs";import{getAutoCompleteAttributeValue as O}from"../shared.mjs";import{FieldLabel as P}from"./label.mjs";import{ClearFieldAdornment as V}from"./clear-field-adornment.mjs";import{jsx as i}from"react/jsx-runtime";import{fieldInputTypes as E}from"../../../../core/fields/constants.mjs";import{DateInput as R}from"../../../../../DateInput/index.mjs";function L({fieldKey:l}){var o;const{options:m}=N(),{field:e,setValue:t}=K({key:l}),u=x(null),[d,n]=M(e!=null&&e.value?I(e?.value):"");if(!e||e.schema.characteristics.inputType!==E.date)return null;const s=e.schema.key===B.birthDate,a=new Date,p=1900,c=1,f=1,D=s?a.getUTCFullYear()-18:a.getUTCFullYear()+100,h=s?a.getUTCMonth()+1:12,C=s?a.getUTCDate():31,g=new Date(p,c-1,f),k=new Date(D,h-1,C),y=r=>{if(e.isDisabled)return;const F=A.safeParse(r),T=r.replace(/[^0-9]/g,"");if(n(r),T.length<=0)return t("");if(!F.success)return t("NaN");const[v,U,Y]=r.split("/").map(Number),w=Date.UTC(Y,v-1,U,12,0,0,0);t(String(w))},b=()=>{n(""),t("")};return i(S,{width:"100%",children:i(R,{inputRef:u,variant:"outlined",size:"small",autoComplete:O(e.schema.key),label:i(P,{fieldKey:l}),value:d,onChange:y,error:!(e!=null&&e.isValid),helperText:(o=e.errorMessage)!=null&&o.length?e.errorMessage:e?.description,placeholder:e.schema.characteristics.placeholder,pickerClickOutsideBoundaryElement:m.features.datePickerClickOutsideBoundaryElement,pickerDefaultSelectedDate:new Date("08/01/1989"),minDate:g,maxDate:k,disabled:e.isDisabled,InputProps:{"data-mask-me":!0,endAdornment:i(V,{fieldKey:l,onClick:b,disabled:e.isDisabled})}})})}export{L as DateInputField};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{Stack as
|
|
1
|
+
"use strict";import{Stack as h}from"@mui/material";import{credentialKeys as d}from"../../../../core/fields/index.mjs";import{useFormField as y}from"../../../core/field.hook.mjs";import{useOneClickForm as K}from"../../form.context.mjs";import{FieldRowContainer as n,FieldSectionTitle as m,FieldSectionContent as p}from"../style.mjs";import{AddressInputField as F}from"./address.field.mjs";import{TextInputField as f}from"./text.field.mjs";import{SelectInputField as k}from"./select.field.mjs";import{SSNInputField as v}from"./ssn.field.mjs";import{DateInputField as x}from"./date.field.mjs";import{HealthInsuranceInputField as I}from"./healthInsurance.field.mjs";import{jsx as e,jsxs as c,Fragment as T}from"react/jsx-runtime";import{fieldInputTypes as r}from"../../../../core/fields/constants.mjs";function u({fieldKey:i}){var a;const{field:l}=y({key:i}),o=(s,t)=>t?.schema.characteristics.inputType===r.text&&t?.schema.key===d.ssn?e(v,{fieldKey:s}):t?.schema.characteristics.inputType===r.date?e(x,{fieldKey:s}):t?.schema.characteristics.inputType===r.select?e(k,{fieldKey:s}):t?.schema.characteristics.inputType===r.text?e(f,{fieldKey:s}):(console.warn("Field not supported:",t?.schema.key),null);return((a=l?.schema)==null?void 0:a.key)===d.healthInsurance?c(n,{fieldKey:i,spacing:1.25,children:[e(m,{fieldKey:i,description:"Enter your insurance info:"}),e(p,{spacing:1.25,children:e(I,{fieldKey:i})})]}):l?.schema.characteristics.inputType===r.composite?l!=null&&l.children?l.schema.key===d.fullName?Object.keys(l.children).map(s=>{var t;return e(n,{fieldKey:`${i}.${s}`,children:o(`${i}.${s}`,(t=l.children)==null?void 0:t[s])},s)}):l.schema.key===d.address?c(T,{children:[e(n,{fieldKey:i,children:e(F,{fieldKey:i})}),e(n,{fieldKey:`${i}.line2`,children:e(f,{fieldKey:`${i}.line2`})})]}):c(n,{fieldKey:i,spacing:1.25,children:[e(m,{fieldKey:i}),e(p,{spacing:2,sx:{pt:1},children:Object.keys(l.children).map(s=>e(u,{fieldKey:`${i}.${s}`},s))})]}):null:e(n,{fieldKey:i,children:o(i,l)})}function $(){const i=K(),{fields:a}=i.formContext.state.form;return e(h,{spacing:2,sx:{width:"100%"},children:Object.entries(a).map(([l,o])=>o.schema.key===d.phone?null:e(u,{fieldKey:l},l))})}export{$ as EditFields};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{useState as v,useRef as x,useCallback as C,createElement as D}from"react";import{Stack as M,Autocomplete as A,TextField as H,Box as O,Avatar as S,Typography as T,InputAdornment as U,IconButton as z}from"@mui/material";import{Close as w}from"@mui/icons-material";import{useQuery as E}from"@tanstack/react-query";import{useDebounceValue as q}from"../../../../../../../hooks/useDebounceValue.mjs";import{MemberIdInput as V}from"../../../../../MemberIdInput.mjs";import{useFormField as j}from"../../../core/field.hook.mjs";import{useOneClickForm as B}from"../../form.context.mjs";import{jsxs as y,jsx as i,Fragment as K}from"react/jsx-runtime";const g=20;function R(m){const{options:a}=B(),s=q(m,300),[p,h]=v([]),[d,f]=v(!0),[t,u]=v(!1),c=x(0),{isLoading:I}=E({queryKey:["insurance-providers",s],queryFn:async({signal:n})=>{var l,o;const e=await((o=(l=a.servicePaths).oneClickHealthProviderPayers)==null?void 0:o.call(l,{search:s||void 0,limit:g,skip:0},n))??[];return c.current=e.length,h(e),f(e.length>=g),e},refetchOnMount:!0,enabled:!!a.servicePaths.oneClickHealthProviderPayers}),b=C(async()=>{var n,l;if(!(t||!d)){u(!0);try{const o=await((l=(n=a.servicePaths).oneClickHealthProviderPayers)==null?void 0:l.call(n,{search:s||void 0,limit:g,skip:c.current}))??[];h(e=>[...e,...o]),c.current+=o.length,f(o.length>=g)}finally{u(!1)}}},[t,d,s,a.servicePaths]);return{providers:p,isLoading:I,isLoadingMore:t,hasMore:d,loadMore:b}}function F({children:m}){return y(K,{children:[m," ",i(T,{"data-asterisk":!0,component:"span",color:"error",variant:"subtitle2",sx:{fontSize:"inherit"},children:"\u273D"})]})}function W({fieldKey:m}){const{field:a,setValue:s}=j({key:m}),[p,h]=v(""),{providers:d,isLoading:f,isLoadingMore:t,hasMore:u,loadMore:c}=R(p),I=x(null),b=C(e=>{const r=e.currentTarget;r.scrollTop+r.clientHeight>=r.scrollHeight-50&&u&&!t&&c()},[u,t,c]);if(!a)return null;const n=a.value;if(!n)return null;const l=e=>{s({...n,...e})},o=d.find(e=>e.verifiedId===n.payer.verifiedId)??n.payer;return y(M,{spacing:2,children:[i(A,{fullWidth:!0,disabled:a.isDisabled,options:d,loading:f||t,filterOptions:e=>e,value:o.verifiedId?o:null,inputValue:p,onInputChange:(e,r)=>{h(r)},onChange:(e,r)=>{l(r?{payer:{name:r.name,logoUrl:r.logoUrl,verifiedId:r.verifiedId},memberId:""}:{payer:{name:"",logoUrl:"",verifiedId:""},memberId:""})},isOptionEqualToValue:(e,r)=>!!e&&!!r&&e.verifiedId===r.verifiedId,getOptionLabel:e=>e.name,ListboxProps:{ref:I,onScroll:b},renderOption:(e,r)=>{var P,k;return D(O,{component:"li",...e,key:r.verifiedId},y(M,{direction:"row",spacing:1.5,alignItems:"center",children:[i(S,{src:r.logoUrl,alt:(P=r.name[0])==null?void 0:P.toUpperCase(),sx:{width:32,height:32,bgcolor:"primary.main"},slotProps:{img:{onError:L=>{L.currentTarget.style.display="none"}}},children:(k=r.name[0])==null?void 0:k.toUpperCase()}),i(T,{sx:{textAlign:"left"},children:r.name})]}))},renderInput:e=>i(H,{...e,label:i(F,{children:"Insurer"}),helperText:"The company that provides your health insurance",placeholder:"Search...",size:"small",InputLabelProps:{shrink:!0},InputProps:{...e.InputProps,"data-mask-me":!0,endAdornment:e.InputProps.endAdornment}})}),i(V,{fullWidth:!0,label:i(F,{children:"Member ID"}),placeholder:"Enter member ID",size:"small",disabled:a.isDisabled,value:n.memberId,onChange:e=>l({memberId:e.target.value}),helperText:"From your health insurance ID card",InputProps:{"data-mask-me":!0,endAdornment:n.memberId?i(U,{position:"end",children:i(z,{tabIndex:-1,"aria-label":"clear member id",edge:"end",size:"small",disabled:a.isDisabled,onClick:()=>l({memberId:""}),children:i(w,{fontSize:"small"})})}):null}})]})}export{W as HealthInsuranceInputField};
|
package/dist/components/form/NewOneClickForm/react/ui/fields/readonly/driversLicense.field.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{MenuItem as h,Typography as o,Stack as c}from"@mui/material";import{useFormField as y}from"../../../core/field.hook.mjs";import{FieldLabelBase as b}from"../style.mjs";import{VariantSelectField as k}from"./variantSelect.field.mjs";import{jsx as i,jsxs as v}from"react/jsx-runtime";const x={maxWidth:"100%",whiteSpace:"pre-wrap"},S=[{key:"documentNumber",label:"Number"},{key:"issuanceState",label:"State"},{key:"issuanceDate",label:"Issued"},{key:"expirationDate",label:"Expires"},{key:"address",label:"Address"}];function g({fieldChildren:l}){return i(c,{spacing:1.5,py:1,children:S.map(({key:e,label:r})=>{const a=l?.[e];return a?v(c,{direction:"row",children:[i(b,{label:r}),i(o,{"data-mask-me":!0,variant:"body1",sx:{fontSize:20,fontWeight:300,wordBreak:"break-word",textAlign:"left"},children:a.displayValue})]},e):null})})}function w({fieldKey:l}){const{field:e}=y({key:l});if(!e||!e.hasVariants)return null;const r=e.variants??[];return i(k,{fieldKey:l,testId:`data-drivers-license-select-${l}`,renderValue:()=>i(g,{fieldChildren:e.children}),children:r.map(a=>{var n,t,s,d;const u=(t=(n=a.children)==null?void 0:n.documentNumber)==null?void 0:t.displayValue,m=(d=(s=a.children)==null?void 0:s.issuanceState)==null?void 0:d.displayValue,p=[u,m].filter(Boolean).join(" \u2014 ")||"-";return i(h,{value:a.id,onClick:f=>f.stopPropagation(),sx:x,children:i(o,{variant:"body1",fontWeight:500,children:p})},a.id)})})}export{w as DriversLicenseField};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{Stack as
|
|
1
|
+
"use strict";import{Stack as m}from"@mui/material";import{credentialKeys as d}from"../../../../core/fields/index.mjs";import{useFormField as f}from"../../../core/field.hook.mjs";import{useOneClickForm as p}from"../../form.context.mjs";import{FieldRowContainer as t,FieldRow as r,FieldSectionTitle as y,FieldSectionContent as h}from"../style.mjs";import{MultiField as c}from"./multi.field.mjs";import{SingleField as u}from"./single.field.mjs";import{HealthInsuranceField as K}from"./healthInsurance.field.mjs";import{DriversLicenseField as F}from"./driversLicense.field.mjs";import{jsx as l,jsxs as k}from"react/jsx-runtime";import{fieldInputTypes as v}from"../../../../core/fields/constants.mjs";function o({fieldKey:e}){var a,s;const{field:i}=f({key:e});return((a=i?.schema)==null?void 0:a.key)===d.driversLicense&&i.hasVariants?l(t,{fieldKey:e,spacing:1.25,children:l(F,{fieldKey:e})}):((s=i?.schema)==null?void 0:s.key)===d.healthInsurance?l(t,{fieldKey:e,spacing:1.25,children:l(K,{fieldKey:e})}):i?.schema.characteristics.inputType===v.composite&&i.children?i.schema.key===d.address?l(r,{fieldKey:e,children:l(c,{fieldKey:e})}):i.schema.key===d.fullName?l(t,{fieldKey:e,spacing:1.25,children:Object.keys(i.children).map(n=>l(o,{fieldKey:`${e}.${n}`},n))}):k(t,{fieldKey:e,spacing:1.25,children:[l(y,{fieldKey:e}),l(h,{spacing:1.25,children:Object.keys(i.children).map(n=>l(o,{fieldKey:`${e}.${n}`},n))})]}):l(r,{fieldKey:e,children:i!=null&&i.hasVariants?l(c,{fieldKey:e}):l(u,{fieldKey:e})})}function g(){const e=p(),{fields:a}=e.formContext.state.form;return l(m,{spacing:1.25,sx:{width:"100%"},onClick:()=>{var s,i;(((s=e.options.features.editMode)==null?void 0:s.hide)??((i=e.formContext.state.form)==null?void 0:i.isDisabled))||e.setEditMode(!0)},children:Object.entries(a).map(([s,i])=>i.schema.key===d.phone?null:l(o,{fieldKey:s},s))})}export{g as ReadonlyFields};
|
package/dist/components/form/NewOneClickForm/react/ui/fields/readonly/healthInsurance.field.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{Typography as s,Stack as i,MenuItem as I,Avatar as f}from"@mui/material";import{useFormField as S}from"../../../core/field.hook.mjs";import{FieldSectionTitle as F,FieldSectionContent as A,FieldLabelBase as v,FieldDescriptionBase as C}from"../style.mjs";import{VariantSelectField as B}from"./variantSelect.field.mjs";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{maskMemberId as y}from"../../../../core/formats/healthInsurance.format.mjs";const x=48,D={pointerEvents:"auto"};function b({item:n}){var d,a,c,r,o;return e(i,{py:1,children:t(i,{direction:"row",sx:{flex:1},spacing:1.5,children:[e(f,{draggable:!1,src:((d=n.payer)==null?void 0:d.logoUrl)??"",sx:{bgcolor:"primary.main",width:x,height:x,borderRadius:2,flexShrink:0},slotProps:{img:{onError:m=>{m.currentTarget.style.display="none"}}},children:(r=(c=(a=n.payer)==null?void 0:a.name)==null?void 0:c[0])==null?void 0:r.toUpperCase()}),t(i,{direction:"column",spacing:1.5,children:[e(i,{direction:"row",spacing:1.5,children:t(i,{direction:"row",sx:{flex:1},children:[e(v,{label:"Insurer"}),e(s,{"data-mask-me":!0,variant:"body1",sx:{fontSize:20,fontWeight:300,wordBreak:"break-word",textAlign:"left"},children:(o=n.payer)==null?void 0:o.name})]})}),t(i,{direction:"row",children:[e(v,{label:"Member ID"}),t(i,{children:[e(s,{"data-mask-me":!0,variant:"body1",sx:{fontSize:20,fontWeight:300,wordBreak:"break-word",textAlign:"left"},children:y(n.memberId)}),e(C,{description:"Hidden for privacy"})]})]})]})]})})}function P({fieldKey:n}){var d;const{field:a}=S({key:n});if(!a)return null;if(!a.hasVariants){const r=a.value;return(d=r?.payer)!=null&&d.name?t(i,{spacing:1.25,sx:D,onClick:o=>{o.preventDefault(),o.stopPropagation()},children:[e(F,{fieldKey:n}),e(A,{spacing:1.25,children:e(b,{item:r})})]}):e(s,{sx:{textAlign:"left"},children:"No health insurance information available."})}const c=a.variants??[];return e(B,{fieldKey:n,testId:`data-health-insurance-select-${n}`,renderValue:()=>{const r=a.value;return r?e(b,{item:r}):null},children:c.map(r=>{var o,m,u,h,g;const l=r.value,k=((o=l?.payer)==null?void 0:o.name)??"-",w=l!=null&&l.memberId?y(l.memberId):"-";return e(I,{value:r.id,onClick:p=>p.stopPropagation(),sx:{maxWidth:"100%",whiteSpace:"pre-wrap"},children:t(i,{direction:"row",spacing:1.5,alignItems:"center",children:[e(f,{draggable:!1,src:((m=l?.payer)==null?void 0:m.logoUrl)??"",sx:{bgcolor:"primary.main",width:32,height:32,borderRadius:1,flexShrink:0},slotProps:{img:{onError:p=>{p.currentTarget.style.display="none"}}},children:(g=(h=(u=l?.payer)==null?void 0:u.name)==null?void 0:h[0])==null?void 0:g.toUpperCase()}),t(i,{sx:{alignItems:"flex-start",textAlign:"left"},children:[e(s,{variant:"body1",fontWeight:500,children:k}),e(s,{variant:"caption",color:"text.secondary",children:w})]})]})},r.id)})})}export{P as HealthInsuranceField};
|
package/dist/components/form/NewOneClickForm/react/ui/fields/readonly/variantSelect.field.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface VariantSelectFieldProps {
|
|
2
|
+
fieldKey: string;
|
|
3
|
+
testId: string;
|
|
4
|
+
renderValue: () => React.ReactNode;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function VariantSelectField({ fieldKey, testId, renderValue, children, }: VariantSelectFieldProps): import("react").JSX.Element | null;
|
|
8
|
+
export {};
|