@verifiedinc-public/shared-ui-elements 9.1.0 → 9.1.2
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/form/NewOneClickForm/core/fields/healthInsurance.d.ts +5 -5
- package/dist/components/form/NewOneClickForm/core/fields/index.d.ts +5 -5
- package/dist/components/form/NewOneClickForm/core/form/form.d.ts +1 -1
- package/dist/components/form/NewOneClickForm/core/validations/healthInsurance/healthInsurance.schema.d.ts +5 -5
- package/dist/components/form/NewOneClickForm/core/validations/healthInsurance/healthInsurance.schema.mjs +1 -1
- package/dist/components/form/NewOneClickForm/react/ui/fields/input/healthInsurance.field.mjs +1 -1
- package/dist/components/form/NewOneClickForm/react/ui/fields/shared.d.ts +1 -1
- package/package.json +1 -1
|
@@ -61,22 +61,22 @@ export declare const healthInsurance: {
|
|
|
61
61
|
payer: z.ZodObject<{
|
|
62
62
|
verifiedId: z.ZodString;
|
|
63
63
|
name: z.ZodString;
|
|
64
|
-
logoUrl: z.ZodOptional<z.ZodString
|
|
64
|
+
logoUrl: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>>;
|
|
65
65
|
}, "strip", z.ZodTypeAny, {
|
|
66
66
|
name: string;
|
|
67
67
|
verifiedId: string;
|
|
68
|
-
logoUrl?: string | undefined;
|
|
68
|
+
logoUrl?: string | null | undefined;
|
|
69
69
|
}, {
|
|
70
70
|
name: string;
|
|
71
71
|
verifiedId: string;
|
|
72
|
-
logoUrl?: string | undefined;
|
|
72
|
+
logoUrl?: string | null | undefined;
|
|
73
73
|
}>;
|
|
74
74
|
}, "strip", z.ZodTypeAny, {
|
|
75
75
|
memberId: string;
|
|
76
76
|
payer: {
|
|
77
77
|
name: string;
|
|
78
78
|
verifiedId: string;
|
|
79
|
-
logoUrl?: string | undefined;
|
|
79
|
+
logoUrl?: string | null | undefined;
|
|
80
80
|
};
|
|
81
81
|
id?: number | undefined;
|
|
82
82
|
}, {
|
|
@@ -84,7 +84,7 @@ export declare const healthInsurance: {
|
|
|
84
84
|
payer: {
|
|
85
85
|
name: string;
|
|
86
86
|
verifiedId: string;
|
|
87
|
-
logoUrl?: string | undefined;
|
|
87
|
+
logoUrl?: string | null | undefined;
|
|
88
88
|
};
|
|
89
89
|
id?: number | undefined;
|
|
90
90
|
}>;
|
|
@@ -525,22 +525,22 @@ export declare const fields: {
|
|
|
525
525
|
payer: import('zod').ZodObject<{
|
|
526
526
|
verifiedId: import('zod').ZodString;
|
|
527
527
|
name: import('zod').ZodString;
|
|
528
|
-
logoUrl: import('zod').ZodOptional<import('zod').ZodString
|
|
528
|
+
logoUrl: import('zod').ZodOptional<import('zod').ZodNullable<import('zod').ZodUnion<[import('zod').ZodString, import('zod').ZodLiteral<"">]>>>;
|
|
529
529
|
}, "strip", import('zod').ZodTypeAny, {
|
|
530
530
|
name: string;
|
|
531
531
|
verifiedId: string;
|
|
532
|
-
logoUrl?: string | undefined;
|
|
532
|
+
logoUrl?: string | null | undefined;
|
|
533
533
|
}, {
|
|
534
534
|
name: string;
|
|
535
535
|
verifiedId: string;
|
|
536
|
-
logoUrl?: string | undefined;
|
|
536
|
+
logoUrl?: string | null | undefined;
|
|
537
537
|
}>;
|
|
538
538
|
}, "strip", import('zod').ZodTypeAny, {
|
|
539
539
|
memberId: string;
|
|
540
540
|
payer: {
|
|
541
541
|
name: string;
|
|
542
542
|
verifiedId: string;
|
|
543
|
-
logoUrl?: string | undefined;
|
|
543
|
+
logoUrl?: string | null | undefined;
|
|
544
544
|
};
|
|
545
545
|
id?: number | undefined;
|
|
546
546
|
}, {
|
|
@@ -548,7 +548,7 @@ export declare const fields: {
|
|
|
548
548
|
payer: {
|
|
549
549
|
name: string;
|
|
550
550
|
verifiedId: string;
|
|
551
|
-
logoUrl?: string | undefined;
|
|
551
|
+
logoUrl?: string | null | undefined;
|
|
552
552
|
};
|
|
553
553
|
id?: number | undefined;
|
|
554
554
|
}>;
|
|
@@ -5,22 +5,22 @@ export declare const healthInsuranceSchema: z.ZodObject<{
|
|
|
5
5
|
payer: z.ZodObject<{
|
|
6
6
|
verifiedId: z.ZodString;
|
|
7
7
|
name: z.ZodString;
|
|
8
|
-
logoUrl: z.ZodOptional<z.ZodString
|
|
8
|
+
logoUrl: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>>;
|
|
9
9
|
}, "strip", z.ZodTypeAny, {
|
|
10
10
|
name: string;
|
|
11
11
|
verifiedId: string;
|
|
12
|
-
logoUrl?: string | undefined;
|
|
12
|
+
logoUrl?: string | null | undefined;
|
|
13
13
|
}, {
|
|
14
14
|
name: string;
|
|
15
15
|
verifiedId: string;
|
|
16
|
-
logoUrl?: string | undefined;
|
|
16
|
+
logoUrl?: string | null | undefined;
|
|
17
17
|
}>;
|
|
18
18
|
}, "strip", z.ZodTypeAny, {
|
|
19
19
|
memberId: string;
|
|
20
20
|
payer: {
|
|
21
21
|
name: string;
|
|
22
22
|
verifiedId: string;
|
|
23
|
-
logoUrl?: string | undefined;
|
|
23
|
+
logoUrl?: string | null | undefined;
|
|
24
24
|
};
|
|
25
25
|
id?: number | undefined;
|
|
26
26
|
}, {
|
|
@@ -28,7 +28,7 @@ export declare const healthInsuranceSchema: z.ZodObject<{
|
|
|
28
28
|
payer: {
|
|
29
29
|
name: string;
|
|
30
30
|
verifiedId: string;
|
|
31
|
-
logoUrl?: string | undefined;
|
|
31
|
+
logoUrl?: string | null | undefined;
|
|
32
32
|
};
|
|
33
33
|
id?: number | undefined;
|
|
34
34
|
}>;
|
|
@@ -1 +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
|
|
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 a=e.object({id:e.number().optional(),memberId:r,payer:e.object({verifiedId:e.string().regex(/^V\d+$/),name:m,logoUrl:e.union([e.string().url(),e.literal("")]).nullish()})});export{a as healthInsuranceSchema};
|
package/dist/components/form/NewOneClickForm/react/ui/fields/input/healthInsurance.field.mjs
CHANGED
|
@@ -1 +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
|
|
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 o,l;const e=await((l=(o=a.servicePaths).oneClickHealthProviderPayers)==null?void 0:l.call(o,{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,o;if(!(t||!d)){u(!0);try{const l=await((o=(n=a.servicePaths).oneClickHealthProviderPayers)==null?void 0:o.call(n,{search:s||void 0,limit:g,skip:c.current}))??[];h(e=>[...e,...l]),c.current+=l.length,f(l.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 o=e=>{s({...n,...e})},l=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:l.verifiedId?l:null,inputValue:p,onInputChange:(e,r)=>{h(r)},onChange:(e,r)=>{o(r?{payer:{name:r.name,logoUrl:r.logoUrl,verifiedId:r.verifiedId},memberId:""}:{payer:{name:"",logoUrl:void 0,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??void 0,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=>o({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:()=>o({memberId:""}),children:i(w,{fontSize:"small"})})}):null}})]})}export{W as HealthInsuranceInputField};
|