@hiver/connector-admin 4.13.0-multiRef-beta.0 → 4.13.0-multiRef-beta.1
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/index.es.js +26 -9
- package/index.umd.js +5 -5
- package/package.json +1 -1
package/index.es.js
CHANGED
|
@@ -26838,6 +26838,18 @@ const UP = T(Ee)`
|
|
|
26838
26838
|
...(A = e == null ? void 0 : e.control) == null ? void 0 : A.call(e, n, r)
|
|
26839
26839
|
};
|
|
26840
26840
|
},
|
|
26841
|
+
valueContainer: (n, r) => {
|
|
26842
|
+
var o;
|
|
26843
|
+
const A = r.isMulti;
|
|
26844
|
+
return {
|
|
26845
|
+
...n,
|
|
26846
|
+
// react-select's default horizontal padding (8px) + the chip's 2px margin makes the
|
|
26847
|
+
// first/last chip sit further from the edge than the top/bottom inset. Trim the
|
|
26848
|
+
// horizontal padding in multi mode so the chip inset is even on all sides.
|
|
26849
|
+
...A ? { paddingLeft: 4, paddingRight: 4 } : {},
|
|
26850
|
+
...(o = e == null ? void 0 : e.valueContainer) == null ? void 0 : o.call(e, n, r)
|
|
26851
|
+
};
|
|
26852
|
+
},
|
|
26841
26853
|
...t ? {
|
|
26842
26854
|
menuPortal: (n, r) => {
|
|
26843
26855
|
var A;
|
|
@@ -27829,7 +27841,7 @@ const Ok = T(Ee)`
|
|
|
27829
27841
|
padding-bottom: 0px;
|
|
27830
27842
|
}
|
|
27831
27843
|
& .hiverFormField__control {
|
|
27832
|
-
height:
|
|
27844
|
+
height: auto;
|
|
27833
27845
|
min-height: 34px;
|
|
27834
27846
|
border-color: #d6dde8;
|
|
27835
27847
|
&:hover {
|
|
@@ -28560,10 +28572,8 @@ const kc = (e) => !!e && typeof e == "object" && "value" in e && "label" in e, e
|
|
|
28560
28572
|
display: "flex",
|
|
28561
28573
|
alignItems: "center",
|
|
28562
28574
|
minHeight: "40px !important",
|
|
28563
|
-
|
|
28564
|
-
|
|
28565
|
-
paddingLeft: "8px",
|
|
28566
|
-
paddingRight: "8px"
|
|
28575
|
+
boxSizing: "border-box !important",
|
|
28576
|
+
padding: "6px 12px"
|
|
28567
28577
|
},
|
|
28568
28578
|
"& .MuiSelect-icon": {
|
|
28569
28579
|
color: "#97A3B7"
|
|
@@ -28571,17 +28581,23 @@ const kc = (e) => !!e && typeof e == "object" && "value" in e && "label" in e, e
|
|
|
28571
28581
|
}, uM = {
|
|
28572
28582
|
display: "flex",
|
|
28573
28583
|
flexWrap: "wrap",
|
|
28574
|
-
gap: "
|
|
28584
|
+
gap: "6px",
|
|
28575
28585
|
alignItems: "center",
|
|
28576
|
-
width: "100%"
|
|
28586
|
+
width: "100%",
|
|
28587
|
+
marginLeft: "-6px"
|
|
28577
28588
|
}, gM = {
|
|
28578
|
-
height:
|
|
28589
|
+
height: 28,
|
|
28590
|
+
boxSizing: "border-box !important",
|
|
28579
28591
|
borderRadius: "4px",
|
|
28580
28592
|
backgroundColor: "#EBECF0",
|
|
28581
28593
|
color: "#3E4C5A",
|
|
28582
28594
|
fontSize: 13,
|
|
28595
|
+
lineHeight: 14,
|
|
28583
28596
|
fontWeight: 400,
|
|
28584
28597
|
maxWidth: "100%",
|
|
28598
|
+
"&:hover": {
|
|
28599
|
+
backgroundColor: "#EBECF0"
|
|
28600
|
+
},
|
|
28585
28601
|
"& .MuiChip-label": {
|
|
28586
28602
|
paddingLeft: "8px",
|
|
28587
28603
|
paddingRight: "4px"
|
|
@@ -28789,7 +28805,7 @@ const kc = (e) => !!e && typeof e == "object" && "value" in e && "label" in e, e
|
|
|
28789
28805
|
}, fM = T(_s)`
|
|
28790
28806
|
width: 100%;
|
|
28791
28807
|
& input {
|
|
28792
|
-
padding:
|
|
28808
|
+
padding: 10px 12px !important;
|
|
28793
28809
|
color: #3e4c5a;
|
|
28794
28810
|
font-size: 14px;
|
|
28795
28811
|
font-weight: 400;
|
|
@@ -28883,6 +28899,7 @@ const kc = (e) => !!e && typeof e == "object" && "value" in e && "label" in e, e
|
|
|
28883
28899
|
width: "100%",
|
|
28884
28900
|
minWidth: 200,
|
|
28885
28901
|
height: "40px",
|
|
28902
|
+
boxSizing: "border-box !important",
|
|
28886
28903
|
background: "#F6F8FC",
|
|
28887
28904
|
borderRadius: "8px",
|
|
28888
28905
|
fontWeight: 500,
|
package/index.umd.js
CHANGED
|
@@ -1000,7 +1000,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1000
1000
|
&:after {
|
|
1001
1001
|
transform: rotate(-45deg);
|
|
1002
1002
|
}
|
|
1003
|
-
`,DQ=e=>c.jsx(Xa.ClearIndicator,{...e,children:c.jsx(kk,{})}),LQ=(e,t)=>({...e,placeholder:(n,r)=>{var o;return{...n,...(o=e==null?void 0:e.placeholder)==null?void 0:o.call(e,n,r),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},control:(n,r)=>{var o;return{...n,backgroundColor:"transparent",...(o=e==null?void 0:e.control)==null?void 0:o.call(e,n,r)}},...t?{menuPortal:(n,r)=>{var o;return{...n,...(o=e==null?void 0:e.menuPortal)==null?void 0:o.call(e,n,r),zIndex:t,fontFamily:g.theme.typography.fontFamily,fontSize:"13px"}}}:null}),Rk=g.styled(g.Stack)`
|
|
1003
|
+
`,DQ=e=>c.jsx(Xa.ClearIndicator,{...e,children:c.jsx(kk,{})}),LQ=(e,t)=>({...e,placeholder:(n,r)=>{var o;return{...n,...(o=e==null?void 0:e.placeholder)==null?void 0:o.call(e,n,r),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},control:(n,r)=>{var o;return{...n,backgroundColor:"transparent",...(o=e==null?void 0:e.control)==null?void 0:o.call(e,n,r)}},valueContainer:(n,r)=>{var A;const o=r.isMulti;return{...n,...o?{paddingLeft:4,paddingRight:4}:{},...(A=e==null?void 0:e.valueContainer)==null?void 0:A.call(e,n,r)}},...t?{menuPortal:(n,r)=>{var o;return{...n,...(o=e==null?void 0:e.menuPortal)==null?void 0:o.call(e,n,r),zIndex:t,fontFamily:g.theme.typography.fontFamily,fontSize:"13px"}}}:null}),Rk=g.styled(g.Stack)`
|
|
1004
1004
|
width: 0;
|
|
1005
1005
|
height: 0;
|
|
1006
1006
|
`,Pk=({root:e,rootMargin:t,callback:n})=>{const r=m.useRef(null),o=m.useCallback(A=>{if(!A||!e)return;r.current&&r.current.disconnect();const s=new IntersectionObserver(a=>{const i=a[0];n(i)},{root:e,rootMargin:t});s.observe(A),r.current=s},[e,t,n]);return c.jsx(Rk,{ref:o})},FQ=({options:e,isMulti:t,isScrollTarget:n})=>{const r=m.useRef(),o=m.useMemo(()=>e?Object.fromEntries(e.map(a=>[a.value,a])):{},[e]);return{optionsMap:o,getValue:a=>{var u;if(t||typeof a=="object")return a;const i=o[a];return i&&(r.current=i),a===((u=r.current)==null?void 0:u.value)?r.current:a},closeMenuOnScroll:n?a=>{const i=a.target;return!n||!i?!1:n(i)}:void 0}},Mk=e=>c.jsx(Xa.DropdownIndicator,{...e,children:c.jsx(g.Icon,{children:e.selectProps.menuIsOpen?c.jsx(g.icons.ArrowDropUp,{}):c.jsx(g.icons.ArrowDropDown,{})})}),NQ=()=>({ClearIndicator:DQ,DropdownIndicator:Mk,IndicatorSeparator:()=>null,Option:OQ}),kQ=({stackIndex:e,isScrollTarget:t,...n})=>{const{value:r,options:o,isMulti:A}=n,[s,a]=m.useState(!1),i=m.useCallback(d=>{a(!d.isIntersecting)},[]),{getValue:l,closeMenuOnScroll:u}=FQ({options:o,isMulti:A,isScrollTarget:t});return c.jsxs(c.Fragment,{children:[n.menuPortalTarget&&n.root?c.jsx(Pk,{root:n.root,rootMargin:"-38px 0px 0px 0px",callback:i}):null,c.jsx(Lk,{...n,isDisabled:n.disabled,value:r?l(r):void 0,styles:LQ(n.styles,e),components:n.components?n.components:NQ(),closeMenuOnScroll:u,...s&&{menuIsOpen:!1}})]})};kQ.getDefaultComponents=NQ;const RQ="Required Field",jk="Validation Failed";var PQ=(e=>(e.DATE="DD/MM/YYYY",e))(PQ||{}),Vk=["defaultOptions","cacheOptions","loadOptions","options","isLoading","onInputChange","filterOption"];function MQ(e){var t=e.defaultOptions,n=t===void 0?!1:t,r=e.cacheOptions,o=r===void 0?!1:r,A=e.loadOptions;e.options;var s=e.isLoading,a=s===void 0?!1:s,i=e.onInputChange,l=e.filterOption,u=l===void 0?null:l,d=Or(e,Vk),f=d.inputValue,B=m.useRef(void 0),I=m.useRef(!1),C=m.useState(Array.isArray(n)?n:void 0),E=dn(C,2),h=E[0],p=E[1],Q=m.useState(typeof f<"u"?f:""),y=dn(Q,2),x=y[0],v=y[1],w=m.useState(n===!0),b=dn(w,2),S=b[0],R=b[1],O=m.useState(void 0),N=dn(O,2),W=N[0],D=N[1],X=m.useState([]),ne=dn(X,2),ee=ne[0],ge=ne[1],q=m.useState(!1),M=dn(q,2),F=M[0],L=M[1],j=m.useState({}),G=dn(j,2),Z=G[0],oe=G[1],K=m.useState(void 0),ce=dn(K,2),$=ce[0],le=ce[1],Le=m.useState(void 0),Y=dn(Le,2),Je=Y[0],ve=Y[1];o!==Je&&(oe({}),ve(o)),n!==$&&(p(Array.isArray(n)?n:void 0),le(n)),m.useEffect(function(){return I.current=!0,function(){I.current=!1}},[]);var je=m.useCallback(function(Dt,Xt){if(!A)return Xt();var yt=A(Dt,Xt);yt&&typeof yt.then=="function"&&yt.then(Xt,function(){return Xt()})},[A]);m.useEffect(function(){n===!0&&je(x,function(Dt){I.current&&(p(Dt||[]),R(!!B.current))})},[]);var bt=m.useCallback(function(Dt,Xt){var yt=pF(Dt,Xt,i);if(!yt){B.current=void 0,v(""),D(""),ge([]),R(!1),L(!1);return}if(o&&Z[yt])v(yt),D(yt),ge(Z[yt]),R(!1),L(!1);else{var xn=B.current={};v(yt),R(!0),L(!W),je(yt,function(vn){I&&xn===B.current&&(B.current=void 0,R(!1),D(yt),ge(vn||[]),L(!1),oe(vn?De(De({},Z),{},Es({},yt,vn)):Z))})}},[o,je,W,Z,i]),En=F?[]:x&&W?ee:h||[];return De(De({},d),{},{options:En,isLoading:S||a,onInputChange:bt,filterOption:u})}var Gk=m.forwardRef(function(e,t){var n=MQ(e),r=Gd(n);return _.createElement(vc,Pe({ref:t},r))}),Hk=Gk,Wk=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],jQ=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,o=String(t).toLowerCase(),A=String(r.getOptionValue(n)).toLowerCase(),s=String(r.getOptionLabel(n)).toLowerCase();return A===o||s===o},CC={formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,n,r,o){return!(!t||n.some(function(A){return jQ(t,A,o)})||r.some(function(A){return jQ(t,A,o)}))},getNewOptionData:function(t,n){return{label:n,value:t,__isNew__:!0}}};function zk(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,o=r===void 0?"last":r,A=e.formatCreateLabel,s=A===void 0?CC.formatCreateLabel:A,a=e.isValidNewOption,i=a===void 0?CC.isValidNewOption:a,l=e.getNewOptionData,u=l===void 0?CC.getNewOptionData:l,d=e.onCreateOption,f=e.options,B=f===void 0?[]:f,I=e.onChange,C=Or(e,Wk),E=C.getOptionValue,h=E===void 0?hQ:E,p=C.getOptionLabel,Q=p===void 0?BQ:p,y=C.inputValue,x=C.isLoading,v=C.isMulti,w=C.value,b=C.name,S=m.useMemo(function(){return i(y,Bc(w),B,{getOptionValue:h,getOptionLabel:Q})?u(y,s(y)):void 0},[s,u,Q,h,y,i,B,w]),R=m.useMemo(function(){return(n||!x)&&S?o==="first"?[S].concat(fs(B)):[].concat(fs(B),[S]):B},[n,o,x,S,B]),O=m.useCallback(function(N,W){if(W.action!=="select-option")return I(N,W);var D=Array.isArray(N)?N:[N];if(D[D.length-1]===S){if(d)d(y);else{var X=u(y,y),ne={action:"create-option",name:b,option:X};I(Ja(v,[].concat(fs(Bc(w)),[X]),X),ne)}return}I(N,W)},[u,y,v,b,S,d,I,w]);return De(De({},C),{},{options:R,onChange:O})}var Yk=m.forwardRef(function(e,t){var n=MQ(e),r=Gd(n),o=zk(r);return _.createElement(vc,Pe({ref:t},o))}),Jk=Yk;const Xk=g.styled(g.Typography)`
|
|
@@ -1174,7 +1174,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1174
1174
|
padding-bottom: 0px;
|
|
1175
1175
|
}
|
|
1176
1176
|
& .hiverFormField__control {
|
|
1177
|
-
height:
|
|
1177
|
+
height: auto;
|
|
1178
1178
|
min-height: 34px;
|
|
1179
1179
|
border-color: #d6dde8;
|
|
1180
1180
|
&:hover {
|
|
@@ -1385,7 +1385,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1385
1385
|
width: 40px;
|
|
1386
1386
|
height: 40px;
|
|
1387
1387
|
}
|
|
1388
|
-
`,HR=e=>_.createElement("svg",{width:35,height:35,viewBox:"0 0 35 35",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("rect",{x:9,y:9,width:15,height:17,fill:"white"}),_.createElement("g",{clipPath:"url(#clip0_7787_114457)"},_.createElement("path",{d:"M17.1981 2.86633C9.28704 2.86633 2.86646 9.28691 2.86646 17.198C2.86646 25.1091 9.28704 31.5296 17.1981 31.5296C25.1092 31.5296 31.5298 25.1091 31.5298 17.198C31.5298 9.28691 25.1092 2.86633 17.1981 2.86633ZM14.3318 23.6472V10.7487L22.9308 17.198L14.3318 23.6472Z",fill:"#4D596C"})),_.createElement("defs",null,_.createElement("clipPath",{id:"clip0_7787_114457"},_.createElement("rect",{width:34.396,height:34.396,fill:"white"})))),Am=({aspectRatio:e="auto",...t})=>{const[n,r]=m.useState(!1);return n?null:c.jsxs(GR,{aspectRatio:e,children:[c.jsx("img",{className:"preview-img",onError:()=>r(!0),...t}),c.jsx(HR,{className:"play-icon"})]})};g.styled(({className:e,...t})=>c.jsx(g.Tooltip,{...t,classes:{popper:e}}))(({tooltipStyle:e,arrowStyle:t})=>({[`& .${g.tooltipClasses.arrow}`]:{...t},[`& .${g.tooltipClasses.tooltip}`]:{...e}}));function WR(e){return!!e.interfaceDetails||!!e.searchInterfaceDetails}const _c=e=>!!e&&typeof e=="object"&&"value"in e&&"label"in e,sm=e=>typeof e=="string"&&e.startsWith("{{")&&e.endsWith("}}")&&e.includes("."),zR=e=>{if(!e||!sm(e.value))return null;const t=String(e.value).replace(/\{|\}/g,"").split("."),n=e.label.split(".");return{name:n[0],id:t[0],option:{label:n[1],value:t[1]}}},am=e=>e?{label:`${e.name} > ${e.option.label}`,value:`{{${e.name}.${e.option.label}}}`}:null,YR=/\{\{([^}]*)\}\}/g,JR=/^[^{^}]+$/,XR="Invalid variable format. Please check inserted variables.",qR="Variable open brackets present. Please remove open brackets",ZR=e=>{let t=0,n=0;for(let r=0;r<e.length;r++){const o=e[r]+e[r+1];o==="{{"&&t++,o==="}}"&&n++}return t===n},UR=e=>{if(!e)return;const t=e.matchAll(YR);for(const[,n]of[...t])if(!JR.test(n))return XR;if(!ZR(e))return qR},$R=e=>{if(!e||e.includes("{{")&&e.includes("}}"))return;const t=new Date(e),n=/^\d{4}-\d{2}-\d{2}$/;if(isNaN(t.getTime())||!n.test(e))return"Invalid date format. Required date format is YYYY-MM-DD"},KR=({argsMap:e,optionalArgsMap:t,data:n})=>{const{args:r,enabled:o}=m.useMemo(()=>{const A={};for(const s in e){const a=e[s],i=n[a];if(!i)return{args:{},enabled:!1};A[s]=_c(i)?i.value:i}for(const s in t){const a=t[s],i=n[a];A[s]=_c(i)?i.value:i,A[s]||(A[s]=null)}return{args:A,enabled:!0}},[e,t,n]);return{args:r,enabled:o}},eP=({args:e,enabled:t,searchTerm:n,pagination:r,queryKey:o,debounceTime:A=500,fetchOptions:s})=>{const[a,i]=m.useState({args:e,enabled:t,searchTerm:n,pagination:r});m.useEffect(()=>{const p=setTimeout(()=>{i({args:e,enabled:t,searchTerm:n,pagination:r})},A);return()=>clearTimeout(p)},[e,t,n,r,A]);const l=m.useMemo(()=>{var p,Q;return{searchTerm:a.searchTerm,limit:((p=a.pagination)==null?void 0:p.limit)??10,enabled:((Q=a.pagination)==null?void 0:Q.enabled)??!1}},[a]),{data:u,isLoading:d,isError:f,isFetching:B,isFetchingNextPage:I,hasNextPage:C,fetchNextPage:E}=y3({queryKey:["fetch-options",o,a.args,l],queryFn:({pageParam:p})=>s({args:a.args,pagination:{...l,pageNumber:p}}),getNextPageParam:(p,Q)=>p.hasMore?Q.length+1:void 0,initialPageParam:1,enabled:a.enabled,refetchOnMount:!0});return{options:m.useMemo(()=>(u==null?void 0:u.pages.flatMap(p=>p.options))??[],[u]),isLoading:d,isError:f,isFetching:B,isFetchingNextPage:I,hasNextPage:C,fetchNextPage:E}},BC=e=>e instanceof Element,tP=({onIntersect:e,threshold:t,rootMargin:n,enabled:r=!0})=>{const[o,A]=m.useState(!1),s=m.useRef(null),a=m.useRef(null),i=m.useRef(e);i.current=e;const l=m.useCallback(d=>{BC(d)&&(a.current||(a.current=new IntersectionObserver(f=>{var I;const B=f[f.length-1];B.isIntersecting&&((I=i.current)==null||I.call(i,B))},{root:d,threshold:t,rootMargin:n}),A(!0)))},[t,n]),u=m.useCallback(d=>{var f,B;BC(s.current)&&((f=a.current)==null||f.unobserve(s.current)),BC(d)&&r&&o&&((B=a.current)==null||B.observe(d))},[r,o]);return m.useEffect(()=>()=>{a.current&&(a.current.disconnect(),a.current=null)},[]),{parentRef:l,childRef:u}},im=({value:e,isMulti:t=!1,interfaceDetails:n,formData:r,fieldKey:o,hasApiSearch:A,fetchOptions:s})=>{var v;const[a,i]=m.useState(""),{selectedOption:l,selectedOptions:u,selectedValue:d,selectedValues:f}=m.useMemo(()=>{if(t){const w=Array.isArray(e)?e.filter(_c):[];return{selectedOption:null,selectedOptions:w,selectedValue:void 0,selectedValues:w.map(b=>b.value)}}return _c(e)?{selectedOption:e,selectedOptions:[],selectedValue:e.value,selectedValues:[]}:{selectedOption:null,selectedOptions:[],selectedValue:Array.isArray(e)?void 0:e,selectedValues:[]}},[e,t]),{args:B,enabled:I}=KR({argsMap:n==null?void 0:n.args,optionalArgsMap:n==null?void 0:n.optionalArgs,data:r}),C=eP({args:B,enabled:I,queryKey:o,searchTerm:A?a:"",pagination:n==null?void 0:n.pagination,fetchOptions:s}),E=C.options,h=!!((v=n==null?void 0:n.pagination)!=null&&v.enabled),p=h&&!!C.hasNextPage,Q=tP({onIntersect:()=>C.fetchNextPage(),threshold:.1,enabled:p}),y=m.useMemo(()=>{const w=t?u:l?[l]:[];let b=E;if(w.length){const R=new Set(w.map(O=>O.value));b=[...w,...E.filter(O=>!R.has(O.value))]}const S=a.trim().toLowerCase();return!S||A?b:b.filter(R=>String(R.label).toLowerCase().includes(S))},[E,a,l,u,A,t]),x=m.useMemo(()=>{const w={};for(const b of u)w[b.value]=b.label;l&&(w[l.value]=l.label);for(const b of E)w[b.value]=b.label;return w},[E,u,l]);return{selectedOption:l,selectedOptions:u,selectedValue:d,selectedValues:f,search:a,optionsProps:C,observerProps:Q,filteredOptions:y,labelsMap:x,paginationEnabled:h,setSearch:i}},nP=e=>_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:10,viewBox:"0 0 12 10",fill:"none",...e},_.createElement("path",{d:"M4.0001 8.0299L1.2201 5.2499L0.273438 6.1899L4.0001 9.91656L12.0001 1.91656L11.0601 0.976562L4.0001 8.0299Z"})),rP={borderRadius:"8px",boxShadow:"0px 3px 15px 0px rgba(0, 0, 0, 0.25)",mt:.5,backgroundColor:"#FFFFFF"},oP={maxHeight:280,overflow:"auto",paddingTop:0,paddingBottom:1},AP={lineHeight:1,padding:"12px 12px 8px",backgroundColor:"#FFFFFF"},sP={display:"flex",alignItems:"center",gap:"4px",padding:"8px",border:"1px solid #ECEFF6",borderRadius:"6px",width:"100%",boxSizing:"border-box"},aP={flex:1,minWidth:0,fontSize:13,lineHeight:"18px","& .MuiInputBase-input":{padding:0,"&::placeholder":{color:"#97A3B7",opacity:1}}},lm={fontSize:"14px",width:"100%",minWidth:200,height:"40px",background:"#F6F8FC",borderRadius:"8px",fontWeight:400,"& .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"},"& .MuiSelect-select":{display:"flex",alignItems:"center",paddingLeft:"12px",paddingRight:"8px"},"& .MuiSelect-icon":{color:"#97A3B7"}},iP={...lm,height:"auto",minHeight:"40px","& .MuiSelect-select":{display:"flex",alignItems:"center",minHeight:"40px !important",
|
|
1388
|
+
`,HR=e=>_.createElement("svg",{width:35,height:35,viewBox:"0 0 35 35",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("rect",{x:9,y:9,width:15,height:17,fill:"white"}),_.createElement("g",{clipPath:"url(#clip0_7787_114457)"},_.createElement("path",{d:"M17.1981 2.86633C9.28704 2.86633 2.86646 9.28691 2.86646 17.198C2.86646 25.1091 9.28704 31.5296 17.1981 31.5296C25.1092 31.5296 31.5298 25.1091 31.5298 17.198C31.5298 9.28691 25.1092 2.86633 17.1981 2.86633ZM14.3318 23.6472V10.7487L22.9308 17.198L14.3318 23.6472Z",fill:"#4D596C"})),_.createElement("defs",null,_.createElement("clipPath",{id:"clip0_7787_114457"},_.createElement("rect",{width:34.396,height:34.396,fill:"white"})))),Am=({aspectRatio:e="auto",...t})=>{const[n,r]=m.useState(!1);return n?null:c.jsxs(GR,{aspectRatio:e,children:[c.jsx("img",{className:"preview-img",onError:()=>r(!0),...t}),c.jsx(HR,{className:"play-icon"})]})};g.styled(({className:e,...t})=>c.jsx(g.Tooltip,{...t,classes:{popper:e}}))(({tooltipStyle:e,arrowStyle:t})=>({[`& .${g.tooltipClasses.arrow}`]:{...t},[`& .${g.tooltipClasses.tooltip}`]:{...e}}));function WR(e){return!!e.interfaceDetails||!!e.searchInterfaceDetails}const _c=e=>!!e&&typeof e=="object"&&"value"in e&&"label"in e,sm=e=>typeof e=="string"&&e.startsWith("{{")&&e.endsWith("}}")&&e.includes("."),zR=e=>{if(!e||!sm(e.value))return null;const t=String(e.value).replace(/\{|\}/g,"").split("."),n=e.label.split(".");return{name:n[0],id:t[0],option:{label:n[1],value:t[1]}}},am=e=>e?{label:`${e.name} > ${e.option.label}`,value:`{{${e.name}.${e.option.label}}}`}:null,YR=/\{\{([^}]*)\}\}/g,JR=/^[^{^}]+$/,XR="Invalid variable format. Please check inserted variables.",qR="Variable open brackets present. Please remove open brackets",ZR=e=>{let t=0,n=0;for(let r=0;r<e.length;r++){const o=e[r]+e[r+1];o==="{{"&&t++,o==="}}"&&n++}return t===n},UR=e=>{if(!e)return;const t=e.matchAll(YR);for(const[,n]of[...t])if(!JR.test(n))return XR;if(!ZR(e))return qR},$R=e=>{if(!e||e.includes("{{")&&e.includes("}}"))return;const t=new Date(e),n=/^\d{4}-\d{2}-\d{2}$/;if(isNaN(t.getTime())||!n.test(e))return"Invalid date format. Required date format is YYYY-MM-DD"},KR=({argsMap:e,optionalArgsMap:t,data:n})=>{const{args:r,enabled:o}=m.useMemo(()=>{const A={};for(const s in e){const a=e[s],i=n[a];if(!i)return{args:{},enabled:!1};A[s]=_c(i)?i.value:i}for(const s in t){const a=t[s],i=n[a];A[s]=_c(i)?i.value:i,A[s]||(A[s]=null)}return{args:A,enabled:!0}},[e,t,n]);return{args:r,enabled:o}},eP=({args:e,enabled:t,searchTerm:n,pagination:r,queryKey:o,debounceTime:A=500,fetchOptions:s})=>{const[a,i]=m.useState({args:e,enabled:t,searchTerm:n,pagination:r});m.useEffect(()=>{const p=setTimeout(()=>{i({args:e,enabled:t,searchTerm:n,pagination:r})},A);return()=>clearTimeout(p)},[e,t,n,r,A]);const l=m.useMemo(()=>{var p,Q;return{searchTerm:a.searchTerm,limit:((p=a.pagination)==null?void 0:p.limit)??10,enabled:((Q=a.pagination)==null?void 0:Q.enabled)??!1}},[a]),{data:u,isLoading:d,isError:f,isFetching:B,isFetchingNextPage:I,hasNextPage:C,fetchNextPage:E}=y3({queryKey:["fetch-options",o,a.args,l],queryFn:({pageParam:p})=>s({args:a.args,pagination:{...l,pageNumber:p}}),getNextPageParam:(p,Q)=>p.hasMore?Q.length+1:void 0,initialPageParam:1,enabled:a.enabled,refetchOnMount:!0});return{options:m.useMemo(()=>(u==null?void 0:u.pages.flatMap(p=>p.options))??[],[u]),isLoading:d,isError:f,isFetching:B,isFetchingNextPage:I,hasNextPage:C,fetchNextPage:E}},BC=e=>e instanceof Element,tP=({onIntersect:e,threshold:t,rootMargin:n,enabled:r=!0})=>{const[o,A]=m.useState(!1),s=m.useRef(null),a=m.useRef(null),i=m.useRef(e);i.current=e;const l=m.useCallback(d=>{BC(d)&&(a.current||(a.current=new IntersectionObserver(f=>{var I;const B=f[f.length-1];B.isIntersecting&&((I=i.current)==null||I.call(i,B))},{root:d,threshold:t,rootMargin:n}),A(!0)))},[t,n]),u=m.useCallback(d=>{var f,B;BC(s.current)&&((f=a.current)==null||f.unobserve(s.current)),BC(d)&&r&&o&&((B=a.current)==null||B.observe(d))},[r,o]);return m.useEffect(()=>()=>{a.current&&(a.current.disconnect(),a.current=null)},[]),{parentRef:l,childRef:u}},im=({value:e,isMulti:t=!1,interfaceDetails:n,formData:r,fieldKey:o,hasApiSearch:A,fetchOptions:s})=>{var v;const[a,i]=m.useState(""),{selectedOption:l,selectedOptions:u,selectedValue:d,selectedValues:f}=m.useMemo(()=>{if(t){const w=Array.isArray(e)?e.filter(_c):[];return{selectedOption:null,selectedOptions:w,selectedValue:void 0,selectedValues:w.map(b=>b.value)}}return _c(e)?{selectedOption:e,selectedOptions:[],selectedValue:e.value,selectedValues:[]}:{selectedOption:null,selectedOptions:[],selectedValue:Array.isArray(e)?void 0:e,selectedValues:[]}},[e,t]),{args:B,enabled:I}=KR({argsMap:n==null?void 0:n.args,optionalArgsMap:n==null?void 0:n.optionalArgs,data:r}),C=eP({args:B,enabled:I,queryKey:o,searchTerm:A?a:"",pagination:n==null?void 0:n.pagination,fetchOptions:s}),E=C.options,h=!!((v=n==null?void 0:n.pagination)!=null&&v.enabled),p=h&&!!C.hasNextPage,Q=tP({onIntersect:()=>C.fetchNextPage(),threshold:.1,enabled:p}),y=m.useMemo(()=>{const w=t?u:l?[l]:[];let b=E;if(w.length){const R=new Set(w.map(O=>O.value));b=[...w,...E.filter(O=>!R.has(O.value))]}const S=a.trim().toLowerCase();return!S||A?b:b.filter(R=>String(R.label).toLowerCase().includes(S))},[E,a,l,u,A,t]),x=m.useMemo(()=>{const w={};for(const b of u)w[b.value]=b.label;l&&(w[l.value]=l.label);for(const b of E)w[b.value]=b.label;return w},[E,u,l]);return{selectedOption:l,selectedOptions:u,selectedValue:d,selectedValues:f,search:a,optionsProps:C,observerProps:Q,filteredOptions:y,labelsMap:x,paginationEnabled:h,setSearch:i}},nP=e=>_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:10,viewBox:"0 0 12 10",fill:"none",...e},_.createElement("path",{d:"M4.0001 8.0299L1.2201 5.2499L0.273438 6.1899L4.0001 9.91656L12.0001 1.91656L11.0601 0.976562L4.0001 8.0299Z"})),rP={borderRadius:"8px",boxShadow:"0px 3px 15px 0px rgba(0, 0, 0, 0.25)",mt:.5,backgroundColor:"#FFFFFF"},oP={maxHeight:280,overflow:"auto",paddingTop:0,paddingBottom:1},AP={lineHeight:1,padding:"12px 12px 8px",backgroundColor:"#FFFFFF"},sP={display:"flex",alignItems:"center",gap:"4px",padding:"8px",border:"1px solid #ECEFF6",borderRadius:"6px",width:"100%",boxSizing:"border-box"},aP={flex:1,minWidth:0,fontSize:13,lineHeight:"18px","& .MuiInputBase-input":{padding:0,"&::placeholder":{color:"#97A3B7",opacity:1}}},lm={fontSize:"14px",width:"100%",minWidth:200,height:"40px",background:"#F6F8FC",borderRadius:"8px",fontWeight:400,"& .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"},"& .MuiSelect-select":{display:"flex",alignItems:"center",paddingLeft:"12px",paddingRight:"8px"},"& .MuiSelect-icon":{color:"#97A3B7"}},iP={...lm,height:"auto",minHeight:"40px","& .MuiSelect-select":{display:"flex",alignItems:"center",minHeight:"40px !important",boxSizing:"border-box !important",padding:"6px 12px"},"& .MuiSelect-icon":{color:"#97A3B7"}},lP={display:"flex",flexWrap:"wrap",gap:"6px",alignItems:"center",width:"100%",marginLeft:"-6px"},cP={height:28,boxSizing:"border-box !important",borderRadius:"4px",backgroundColor:"#EBECF0",color:"#3E4C5A",fontSize:13,lineHeight:14,fontWeight:400,maxWidth:"100%","&:hover":{backgroundColor:"#EBECF0"},"& .MuiChip-label":{paddingLeft:"8px",paddingRight:"4px"},"& .MuiChip-deleteIcon":{fontSize:15,color:"#3E4C5A",margin:"0 6px 0 0","&:hover":{color:"#1A1F24"}}},uP=e=>({fontSize:14,lineHeight:"20px",minHeight:36,py:1,pl:2,pr:2.5,mx:0,borderRadius:"4px",color:"#343C45",backgroundColor:e?"#F6F8FC":"transparent","&:hover":{backgroundColor:"#F6F8FC"},"&.Mui-selected":{backgroundColor:"#F6F8FC","&:hover":{backgroundColor:"#F6F8FC"}}}),cm=g.styled(g.Box)`
|
|
1389
1389
|
height: 28px;
|
|
1390
1390
|
width: 28px;
|
|
1391
1391
|
border-radius: 50%;
|
|
@@ -1420,7 +1420,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1420
1420
|
`,um=String(Symbol("_no_results")),gm=({selectedValue:e,selectedValues:t=[],isMulti:n=!1,search:r,searchPlaceholder:o,paginationEnabled:A,filteredOptions:s,observerProps:{childRef:a},optionsProps:{options:i,isLoading:l,isFetchingNextPage:u,hasNextPage:d},searchOffset:f=0,setSearch:B})=>{const I=new Set(t.map(String)),C=l&&i.length===0,E=A&&d&&!C&&!r,h=c.jsx(g.ListSubheader,{sx:AP,style:{top:f},children:c.jsxs(g.Box,{sx:sP,children:[c.jsx(g.icons.Search,{sx:{fontSize:18,color:g.theme.palette.gray.gray3,flexShrink:0}}),c.jsx(g.InputBase,{autoFocus:!0,placeholder:o,value:r,onChange:y=>B(y.target.value),onKeyDown:y=>{y.key!=="Escape"&&y.stopPropagation()},sx:aP})]})}),p=C?c.jsx(g.MenuItem,{disabled:!0,sx:{justifyContent:"center",opacity:1,minHeight:120,cursor:"default"},children:c.jsx(g.CircularProgress,{size:24})}):s.length===0?c.jsx(g.MenuItem,{disabled:!0,value:um,sx:{opacity:1,color:g.theme.palette.gray.gray3},children:c.jsx(g.Typography,{variant:"body2",fontSize:14,children:"No results found"})}):s.map(y=>{const x=String(y.value),v=n?I.has(x):x===e;return c.jsxs(g.MenuItem,{value:x,sx:uP(v),children:[c.jsx("span",{children:y.label}),v?c.jsx(nP,{fill:"#97A3B7",style:{marginLeft:"auto"}}):null]},x)}),Q=E?c.jsx(g.MenuItem,{disabled:!0,disableRipple:!0,tabIndex:-1,ref:a,sx:{justifyContent:"center",minHeight:40,opacity:1,cursor:"default"},children:u?c.jsx(g.CircularProgress,{size:20}):c.jsx(g.Box,{sx:{minHeight:1,width:"100%"},"aria-hidden":!0})}):null;return[h,p,Q]},dm=String(Symbol("_no_results")),gP=e=>!!e&&typeof e=="object"&&"label"in e&&"value"in e,dP=({fieldKey:e,value:t,isMulti:n=!1,placeholder:r="Select",searchPlaceholder:o="Search",disabled:A=!1,menuZIndex:s=1600,interfaceDetails:a,formData:i,hasApiSearch:l=!1,onChange:u,fetchOptions:d})=>{const{selectedValue:f,selectedValues:B,selectedOptions:I,search:C,optionsProps:E,observerProps:h,filteredOptions:p,labelsMap:Q,paginationEnabled:y,setSearch:x}=im({value:t,isMulti:n,interfaceDetails:a,formData:i,fieldKey:e,hasApiSearch:l,fetchOptions:d}),{parentRef:v}=h,w=m.useMemo(()=>gP(t)?t.label:Q[String(t)]??String(t),[Q,t]),b=N=>{const W=N.target.value;if(n){const ne=(Array.isArray(W)?W:[W]).map(String).filter(ee=>ee!==dm).map(ee=>I.find(q=>String(q.value)===ee)??{value:ee,label:Q[ee]??ee});u(ne);return}const D=String(W);D!==dm&&u({value:D,label:Q[D]})},S=N=>{u(I.filter(W=>String(W.value)!==String(N)))},R=n?B.length>0:!!f,O=()=>n?I.length?c.jsx(g.Box,{sx:lP,children:I.map(N=>c.jsx(g.Chip,{label:N.label,size:"small",sx:cP,onMouseDown:W=>W.stopPropagation(),onDelete:()=>S(N.value),deleteIcon:c.jsx(g.icons.Close,{onMouseDown:W=>W.stopPropagation()})},String(N.value)))}):c.jsx(g.Typography,{component:"span",fontSize:14,noWrap:!0,sx:{color:g.theme.palette.gray.gray4},children:r}):t===""?c.jsx(g.Typography,{component:"span",fontSize:14,noWrap:!0,sx:{color:g.theme.palette.gray.gray4},children:r}):c.jsx(g.Typography,{component:"span",fontSize:14,noWrap:!0,sx:{color:g.theme.palette.gray.gray1},children:w});return c.jsx(g.FormControl,{fullWidth:!0,disabled:A,sx:{m:0,minWidth:0},children:c.jsx(g.Select,{displayEmpty:!0,multiple:n,value:n?B.map(String):f,variant:"outlined",size:"small",sx:n?iP:lm,onChange:b,onClose:()=>x(""),renderValue:O,endAdornment:R&&!n?c.jsx(cm,{onClick:()=>u(n?[]:void 0)}):null,MenuProps:{autoFocus:!1,sx:{zIndex:s},PaperProps:{sx:rP},MenuListProps:{sx:oP,ref:v}},children:gm({selectedValue:f,selectedValues:B,isMulti:n,search:C,searchPlaceholder:o,paginationEnabled:y,filteredOptions:p,observerProps:h,optionsProps:E,setSearch:x})})})},CP=g.styled(g.TextField)`
|
|
1421
1421
|
width: 100%;
|
|
1422
1422
|
& input {
|
|
1423
|
-
padding:
|
|
1423
|
+
padding: 10px 12px !important;
|
|
1424
1424
|
color: #3e4c5a;
|
|
1425
1425
|
font-size: 14px;
|
|
1426
1426
|
font-weight: 400;
|
|
@@ -1460,7 +1460,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1460
1460
|
overflow: hidden;
|
|
1461
1461
|
text-overflow: ellipsis;
|
|
1462
1462
|
padding-top: 2px;
|
|
1463
|
-
`,fP=e=>{const t=n=>{var o;const r=n.target;r&&((o=e.onChange)==null||o.call(e,r.value))};return c.jsx(CP,{...e,variant:"outlined",onChange:t,...e.multiline?{rows:4}:null})},Cm=()=>{const[e,t]=m.useState(null),[n,r]=m.useState(null),o=m.useRef(null);return{activeField:e,anchorEl:n,onEnter:a=>{o.current&&clearTimeout(o.current),a&&(t(a.field),r(a.currentTarget))},onLeave:()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{t(null),r(null)},100)}}},IP={borderRadius:"8px",boxShadow:"0px 3px 15px 0px rgba(0, 0, 0, 0.25)",mt:.5,backgroundColor:"#FFFFFF",minWidth:337},pP={maxHeight:280,overflow:"auto",paddingTop:0,paddingBottom:1},BP={lineHeight:1,padding:"12px 12px 2px",backgroundColor:"#FFFFFF",position:"sticky",top:0,zIndex:2},hP={m:0,minWidth:0,width:"100%"},QP={fontSize:"14px",width:"100%",minWidth:200,height:"40px",background:"#F6F8FC",borderRadius:"8px",fontWeight:500,"& .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"},"& .MuiSelect-select":{display:"flex",alignItems:"center",paddingLeft:"12px",paddingRight:"8px"},"& .MuiSelect-icon":{color:"#97A3B7"}},mP={fontSize:14,lineHeight:"18px",minHeight:36,py:.75,pl:2,pr:1.5,color:"#343C45",display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,boxSizing:"border-box"},yP=e=>({...mP,backgroundColor:e?"#F6F8FC":"transparent",cursor:"pointer",fontWeight:400,"&:hover":{backgroundColor:"#F6F8FC"}}),bP={display:"grid",gridTemplateColumns:"1fr 1fr",alignItems:"center",backgroundColor:"#F6F8FC",borderRadius:"8px",padding:"3px"},Em=e=>({border:"none",borderRadius:"8px",backgroundColor:e?"#FFFFFF":"transparent",color:e?"#196fe0":"#343C45",lineHeight:"24px",padding:"4px 12px",cursor:"pointer"}),xP={fontSize:12,color:"#6F7C90",flexShrink:0},vP={display:"flex",flexDirection:"column",alignItems:"stretch",py:0},wP=e=>({fontSize:14,fontWeight:400,lineHeight:"18px",minHeight:36,py:.75,px:1.5,pl:2,pr:1.5,color:"#343C45",textTransform:"none",justifyContent:"flex-start",backgroundColor:e?"#F6F8FC":"transparent","&:hover":{backgroundColor:"#F6F8FC"}}),SP={color:"#97A3B7",fontSize:13,px:2,py:1.5},TP=g.styled(g.Stack)`
|
|
1463
|
+
`,fP=e=>{const t=n=>{var o;const r=n.target;r&&((o=e.onChange)==null||o.call(e,r.value))};return c.jsx(CP,{...e,variant:"outlined",onChange:t,...e.multiline?{rows:4}:null})},Cm=()=>{const[e,t]=m.useState(null),[n,r]=m.useState(null),o=m.useRef(null);return{activeField:e,anchorEl:n,onEnter:a=>{o.current&&clearTimeout(o.current),a&&(t(a.field),r(a.currentTarget))},onLeave:()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{t(null),r(null)},100)}}},IP={borderRadius:"8px",boxShadow:"0px 3px 15px 0px rgba(0, 0, 0, 0.25)",mt:.5,backgroundColor:"#FFFFFF",minWidth:337},pP={maxHeight:280,overflow:"auto",paddingTop:0,paddingBottom:1},BP={lineHeight:1,padding:"12px 12px 2px",backgroundColor:"#FFFFFF",position:"sticky",top:0,zIndex:2},hP={m:0,minWidth:0,width:"100%"},QP={fontSize:"14px",width:"100%",minWidth:200,height:"40px",boxSizing:"border-box !important",background:"#F6F8FC",borderRadius:"8px",fontWeight:500,"& .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"},"& .MuiSelect-select":{display:"flex",alignItems:"center",paddingLeft:"12px",paddingRight:"8px"},"& .MuiSelect-icon":{color:"#97A3B7"}},mP={fontSize:14,lineHeight:"18px",minHeight:36,py:.75,pl:2,pr:1.5,color:"#343C45",display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,boxSizing:"border-box"},yP=e=>({...mP,backgroundColor:e?"#F6F8FC":"transparent",cursor:"pointer",fontWeight:400,"&:hover":{backgroundColor:"#F6F8FC"}}),bP={display:"grid",gridTemplateColumns:"1fr 1fr",alignItems:"center",backgroundColor:"#F6F8FC",borderRadius:"8px",padding:"3px"},Em=e=>({border:"none",borderRadius:"8px",backgroundColor:e?"#FFFFFF":"transparent",color:e?"#196fe0":"#343C45",lineHeight:"24px",padding:"4px 12px",cursor:"pointer"}),xP={fontSize:12,color:"#6F7C90",flexShrink:0},vP={display:"flex",flexDirection:"column",alignItems:"stretch",py:0},wP=e=>({fontSize:14,fontWeight:400,lineHeight:"18px",minHeight:36,py:.75,px:1.5,pl:2,pr:1.5,color:"#343C45",textTransform:"none",justifyContent:"flex-start",backgroundColor:e?"#F6F8FC":"transparent","&:hover":{backgroundColor:"#F6F8FC"}}),SP={color:"#97A3B7",fontSize:13,px:2,py:1.5},TP=g.styled(g.Stack)`
|
|
1464
1464
|
flex-flow: row nowrap;
|
|
1465
1465
|
align-items: center;
|
|
1466
1466
|
color: #343c45;
|