unifyedx-storybook-new 0.1.66 → 0.1.68
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.
|
@@ -42982,7 +42982,7 @@ const computePosition = (reference, floating, options) => {
|
|
|
42982
42982
|
* @copyright ReactTooltip Team
|
|
42983
42983
|
* @license MIT
|
|
42984
42984
|
*/
|
|
42985
|
-
const h="react-tooltip-core-styles",w="react-tooltip-base-styles",b={core:false,base:false};function S({css:e,id:t=w,type:o="base",ref:l}){var r,n;if(!e||"undefined"==typeof document||b[o])return;if("core"===o&&"undefined"!=typeof process&&(null===(r=null===process||void 0===process?void 0:process.env)||void 0===r?void 0:r.REACT_TOOLTIP_DISABLE_CORE_STYLES))return;if("base"!==o&&"undefined"!=typeof process&&(null===(n=null===process||void 0===process?void 0:process.env)||void 0===n?void 0:n.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;"core"===o&&(t=h),l||(l={});const{insertAt:i}=l;if(document.getElementById(t))return;const c=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.id=t,s.type="text/css","top"===i&&c.firstChild?c.insertBefore(s,c.firstChild):c.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e)),b[o]=true;}const E=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:o=null,place:l="top",offset:r=10,strategy:n="absolute",middlewares:i=[offset(Number(r)),flip({fallbackAxisSideDirection:"start"}),shift({padding:5})],border:c,arrowSize:s=8})=>{if(!e)return {tooltipStyles:{},tooltipArrowStyles:{},place:l};if(null===t)return {tooltipStyles:{},tooltipArrowStyles:{},place:l};const a=i;return o?(a.push(arrow({element:o,padding:5})),computePosition(e,t,{placement:l,strategy:n,middleware:a}).then((({x:e,y:t,placement:o,middlewareData:l})=>{var r,n;const i={left:`${e}px`,top:`${t}px`,border:c},{x:a,y:u}=null!==(r=l.arrow)&&void 0!==r?r:{x:0,y:0},d=null!==(n={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]])&&void 0!==n?n:"bottom",p=c&&{borderBottom:c,borderRight:c};let v=0;if(c){const e=`${c}`.match(/(\d+)px/);v=(null==e?void 0:e[1])?Number(e[1]):1;}return {tooltipStyles:i,tooltipArrowStyles:{left:null!=a?`${a}px`:"",top:null!=u?`${u}px`:"",right:"",bottom:"",...p,[d]:`-${s/2+v}px`},place:o}}))):computePosition(e,t,{placement:"bottom",strategy:n,middleware:a}).then((({x:e,y:t,placement:o})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:o})))},A=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),_$2=(e,t,o)=>{let l=null;const r=function(...r){const n=()=>{l=null;};!l&&(e.apply(this,r),l=setTimeout(n,t));};return r.cancel=()=>{l&&(clearTimeout(l),l=null);},r},O=e=>null!==e&&!Array.isArray(e)&&"object"==typeof e,k=(e,t)=>{if(e===t)return true;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(((e,o)=>k(e,t[o])));if(Array.isArray(e)!==Array.isArray(t))return false;if(!O(e)||!O(t))return e===t;const o=Object.keys(e),l=Object.keys(t);return o.length===l.length&&o.every((o=>k(e[o],t[o])))},T=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return false;const t=getComputedStyle(e);return ["overflow","overflow-x","overflow-y"].some((e=>{const o=t.getPropertyValue(e);return "auto"===o||"scroll"===o}))},L$1=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(T(t))return t;t=t.parentElement;}return document.scrollingElement||document.documentElement},C="undefined"!=typeof window?useLayoutEffect:useEffect,R=e=>{e.current&&(clearTimeout(e.current),e.current=null);},x="DEFAULT_TOOLTIP_ID",N$1={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},$$1=createContext({getTooltipData:()=>N$1});function z$1(e=x){return useContext($$1).getTooltipData(e)}var B$1={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},D={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const q=({forwardRef:t,id:l,className:i,classNameArrow:c,variant:u="dark",anchorId:d,anchorSelect:p,place:v="top",offset:m=10,events:h=["hover"],openOnClick:w=false,positionStrategy:b="absolute",middlewares:S,wrapper:g,delayShow:A=0,delayHide:O=0,float:T=false,hidden:x=false,noArrow:N=false,clickable:$=false,closeOnEsc:I=false,closeOnScroll:j=false,closeOnResize:q=false,openEvents:H,closeEvents:M,globalCloseEvents:W,imperativeModeOnly:P,style:V,position:F,afterShow:K,afterHide:U,disableTooltip:X,content:Y,contentWrapperRef:G,isOpen:Z,defaultIsOpen:J=false,setIsOpen:Q,activeAnchor:ee,setActiveAnchor:te,border:oe,opacity:le,arrowColor:re,arrowSize:ne=8,role:ie="tooltip"})=>{var ce;const se=useRef(null),ae=useRef(null),ue=useRef(null),de=useRef(null),pe=useRef(null),[ve,me]=useState({tooltipStyles:{},tooltipArrowStyles:{},place:v}),[fe,ye]=useState(false),[he,we]=useState(false),[be,Se]=useState(null),ge=useRef(false),Ee=useRef(null),{anchorRefs:Ae,setActiveAnchor:_e}=z$1(l),Oe=useRef(false),[ke,Te]=useState([]),Le=useRef(false),Ce=w||h.includes("click"),Re=Ce||(null==H?void 0:H.click)||(null==H?void 0:H.dblclick)||(null==H?void 0:H.mousedown),xe=H?{...H}:{mouseover:true,focus:true,mouseenter:false,click:false,dblclick:false,mousedown:false};!H&&Ce&&Object.assign(xe,{mouseenter:false,focus:false,mouseover:false,click:true});const Ne=M?{...M}:{mouseout:true,blur:true,mouseleave:false,click:false,dblclick:false,mouseup:false};!M&&Ce&&Object.assign(Ne,{mouseleave:false,blur:false,mouseout:false});const $e=W?{...W}:{escape:I||false,scroll:j||false,resize:q||false,clickOutsideAnchor:Re||false};P&&(Object.assign(xe,{mouseover:false,focus:false,mouseenter:false,click:false,dblclick:false,mousedown:false}),Object.assign(Ne,{mouseout:false,blur:false,mouseleave:false,click:false,dblclick:false,mouseup:false}),Object.assign($e,{escape:false,scroll:false,resize:false,clickOutsideAnchor:false})),C((()=>(Le.current=true,()=>{Le.current=false;})),[]);const Ie=e=>{Le.current&&(e&&we(true),setTimeout((()=>{Le.current&&(null==Q||Q(e),void 0===Z&&ye(e));}),10));};useEffect((()=>{if(void 0===Z)return ()=>null;Z&&we(true);const e=setTimeout((()=>{ye(Z);}),10);return ()=>{clearTimeout(e);}}),[Z]),useEffect((()=>{if(fe!==ge.current)if(R(pe),ge.current=fe,fe)null==K||K();else {const e=(e=>{const t=e.match(/^([\d.]+)(ms|s)$/);if(!t)return 0;const[,o,l]=t;return Number(o)*("ms"===l?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));pe.current=setTimeout((()=>{we(false),Se(null),null==U||U();}),e+25);}}),[fe]);const ze=e=>{me((t=>k(t,e)?t:e));},je=(e=A)=>{R(ue),he?Ie(true):ue.current=setTimeout((()=>{Ie(true);}),e);},Be=(e=O)=>{R(de),de.current=setTimeout((()=>{Oe.current||Ie(false);}),e);},De=e=>{var t;if(!e)return;const o=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==o?void 0:o.isConnected))return te(null),void _e({current:null});A?je():Ie(true),te(o),_e({current:o}),R(de);},qe=()=>{$?Be(O||100):O?Be():Ie(false),R(ue);},He=({x:e,y:t})=>{var o;const l={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};E({place:null!==(o=null==be?void 0:be.place)&&void 0!==o?o:v,offset:m,elementReference:l,tooltipReference:se.current,tooltipArrowReference:ae.current,strategy:b,middlewares:S,border:oe,arrowSize:ne}).then((e=>{ze(e);}));},Me=e=>{if(!e)return;const t=e,o={x:t.clientX,y:t.clientY};He(o),Ee.current=o;},We=e=>{var t;if(!fe)return;const o=e.target;if(!o.isConnected)return;if(null===(t=se.current)||void 0===t?void 0:t.contains(o))return;[document.querySelector(`[id='${d}']`),...ke].some((e=>null==e?void 0:e.contains(o)))||(Ie(false),R(ue));},Pe=_$2(De,50),Ve=_$2(qe,50),Fe=e=>{Ve.cancel(),Pe(e);},Ke=()=>{Pe.cancel(),Ve();},Ue=useCallback((()=>{var e,t;const o=null!==(e=null==be?void 0:be.position)&&void 0!==e?e:F;o?He(o):T?Ee.current&&He(Ee.current):(null==ee?void 0:ee.isConnected)&&E({place:null!==(t=null==be?void 0:be.place)&&void 0!==t?t:v,offset:m,elementReference:ee,tooltipReference:se.current,tooltipArrowReference:ae.current,strategy:b,middlewares:S,border:oe,arrowSize:ne}).then((e=>{Le.current&&ze(e);}));}),[fe,ee,Y,V,v,null==be?void 0:be.place,m,b,F,null==be?void 0:be.position,T,ne]);useEffect((()=>{var e,t;const o=new Set(Ae);ke.forEach((e=>{(null==X?void 0:X(e))||o.add({current:e});}));const l=document.querySelector(`[id='${d}']`);l&&!(null==X?void 0:X(l))&&o.add({current:l});const r=()=>{Ie(false);},n=L$1(ee),i=L$1(se.current);$e.scroll&&(window.addEventListener("scroll",r),null==n||n.addEventListener("scroll",r),null==i||i.addEventListener("scroll",r));let c=null;$e.resize?window.addEventListener("resize",r):ee&&se.current&&(c=autoUpdate(ee,se.current,Ue,{ancestorResize:true,elementResize:true,layoutShift:true}));const s=e=>{"Escape"===e.key&&Ie(false);};$e.escape&&window.addEventListener("keydown",s),$e.clickOutsideAnchor&&window.addEventListener("click",We);const a=[],u=e=>Boolean((null==e?void 0:e.target)&&(null==ee?void 0:ee.contains(e.target))),p=e=>{fe&&u(e)||De(e);},v=e=>{fe&&u(e)&&qe();},m=["mouseover","mouseout","mouseenter","mouseleave","focus","blur"],y=["click","dblclick","mousedown","mouseup"];Object.entries(xe).forEach((([e,t])=>{t&&(m.includes(e)?a.push({event:e,listener:Fe}):y.includes(e)&&a.push({event:e,listener:p}));})),Object.entries(Ne).forEach((([e,t])=>{t&&(m.includes(e)?a.push({event:e,listener:Ke}):y.includes(e)&&a.push({event:e,listener:v}));})),T&&a.push({event:"pointermove",listener:Me});const h=()=>{Oe.current=true;},w=()=>{Oe.current=false,qe();},b=$&&(Ne.mouseout||Ne.mouseleave);return b&&(null===(e=se.current)||void 0===e||e.addEventListener("mouseover",h),null===(t=se.current)||void 0===t||t.addEventListener("mouseout",w)),a.forEach((({event:e,listener:t})=>{o.forEach((o=>{var l;null===(l=o.current)||void 0===l||l.addEventListener(e,t);}));})),()=>{var e,t;$e.scroll&&(window.removeEventListener("scroll",r),null==n||n.removeEventListener("scroll",r),null==i||i.removeEventListener("scroll",r)),$e.resize?window.removeEventListener("resize",r):null==c||c(),$e.clickOutsideAnchor&&window.removeEventListener("click",We),$e.escape&&window.removeEventListener("keydown",s),b&&(null===(e=se.current)||void 0===e||e.removeEventListener("mouseover",h),null===(t=se.current)||void 0===t||t.removeEventListener("mouseout",w)),a.forEach((({event:e,listener:t})=>{o.forEach((o=>{var l;null===(l=o.current)||void 0===l||l.removeEventListener(e,t);}));}));}}),[ee,Ue,he,Ae,ke,H,M,W,Ce,A,O]),useEffect((()=>{var e,t;let o=null!==(t=null!==(e=null==be?void 0:be.anchorSelect)&&void 0!==e?e:p)&&void 0!==t?t:"";!o&&l&&(o=`[data-tooltip-id='${l.replace(/'/g,"\\'")}']`);const r=new MutationObserver((e=>{const t=[],r=[];e.forEach((e=>{if("attributes"===e.type&&"data-tooltip-id"===e.attributeName){e.target.getAttribute("data-tooltip-id")===l?t.push(e.target):e.oldValue===l&&r.push(e.target);}if("childList"===e.type){if(ee){const t=[...e.removedNodes].filter((e=>1===e.nodeType));if(o)try{r.push(...t.filter((e=>e.matches(o)))),r.push(...t.flatMap((e=>[...e.querySelectorAll(o)])));}catch(e){}t.some((e=>{var t;return !!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,ee))&&(we(false),Ie(false),te(null),R(ue),R(de),true)}));}if(o)try{const l=[...e.addedNodes].filter((e=>1===e.nodeType));t.push(...l.filter((e=>e.matches(o)))),t.push(...l.flatMap((e=>[...e.querySelectorAll(o)])));}catch(e){}}})),(t.length||r.length)&&Te((e=>[...e.filter((e=>!r.includes(e))),...t]));}));return r.observe(document.body,{childList:true,subtree:true,attributes:true,attributeFilter:["data-tooltip-id"],attributeOldValue:true}),()=>{r.disconnect();}}),[l,p,null==be?void 0:be.anchorSelect,ee]),useEffect((()=>{Ue();}),[Ue]),useEffect((()=>{if(!(null==G?void 0:G.current))return ()=>null;const e=new ResizeObserver((()=>{setTimeout((()=>Ue()));}));return e.observe(G.current),()=>{e.disconnect();}}),[Y,null==G?void 0:G.current]),useEffect((()=>{var e;const t=document.querySelector(`[id='${d}']`),o=[...ke,t];ee&&o.includes(ee)||te(null!==(e=ke[0])&&void 0!==e?e:t);}),[d,ke,ee]),useEffect((()=>(J&&Ie(true),()=>{R(ue),R(de);})),[]),useEffect((()=>{var e;let t=null!==(e=null==be?void 0:be.anchorSelect)&&void 0!==e?e:p;if(!t&&l&&(t=`[data-tooltip-id='${l.replace(/'/g,"\\'")}']`),t)try{const e=Array.from(document.querySelectorAll(t));Te(e);}catch(e){Te([]);}}),[l,p,null==be?void 0:be.anchorSelect]),useEffect((()=>{ue.current&&(R(ue),je(A));}),[A]);const Xe=null!==(ce=null==be?void 0:be.content)&&void 0!==ce?ce:Y,Ye=fe&&Object.keys(ve.tooltipStyles).length>0;return useImperativeHandle(t,(()=>({open:e=>{if(null==e?void 0:e.anchorSelect)try{document.querySelector(e.anchorSelect);}catch(t){return void console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`)}Se(null!=e?e:null),(null==e?void 0:e.delay)?je(e.delay):Ie(true);},close:e=>{(null==e?void 0:e.delay)?Be(e.delay):Ie(false);},activeAnchor:ee,place:ve.place,isOpen:Boolean(he&&!x&&Xe&&Ye)}))),he&&!x&&Xe?React__default.createElement(g,{id:l,role:ie,className:classNames$1("react-tooltip",B$1.tooltip,D.tooltip,D[u],i,`react-tooltip__place-${ve.place}`,B$1[Ye?"show":"closing"],Ye?"react-tooltip__show":"react-tooltip__closing","fixed"===b&&B$1.fixed,$&&B$1.clickable),onTransitionEnd:e=>{R(pe),fe||"opacity"!==e.propertyName||(we(false),Se(null),null==U||U());},style:{...V,...ve.tooltipStyles,opacity:void 0!==le&&Ye?le:void 0},ref:se},Xe,React__default.createElement(g,{className:classNames$1("react-tooltip-arrow",B$1.arrow,D.arrow,c,N&&B$1.noArrow),style:{...ve.tooltipArrowStyles,background:re?`linear-gradient(to right bottom, transparent 50%, ${re} 50%)`:void 0,"--rt-arrow-size":`${ne}px`},ref:ae})):null},H=({content:t})=>React__default.createElement("span",{dangerouslySetInnerHTML:{__html:t}}),M=React__default.forwardRef((({id:t,anchorId:l,anchorSelect:n,content:i,html:c,render:a,className:u,classNameArrow:d,variant:p="dark",place:v="top",offset:m=10,wrapper:f="div",children:h=null,events:w=["hover"],openOnClick:b=false,positionStrategy:S="absolute",middlewares:g,delayShow:E=0,delayHide:_=0,float:O=false,hidden:k=false,noArrow:T=false,clickable:L=false,closeOnEsc:C=false,closeOnScroll:R=false,closeOnResize:x=false,openEvents:N,closeEvents:$,globalCloseEvents:I,imperativeModeOnly:j=false,style:B,position:D,isOpen:M,defaultIsOpen:W=false,disableStyleInjection:P=false,border:V,opacity:F,arrowColor:K,arrowSize:U,setIsOpen:X,afterShow:Y,afterHide:G,disableTooltip:Z,role:J="tooltip"},Q)=>{const[ee,te]=useState(i),[oe,le]=useState(c),[re,ne]=useState(v),[ie,ce]=useState(p),[se,ae]=useState(m),[ue,de]=useState(E),[pe,ve]=useState(_),[me,fe]=useState(O),[ye,he]=useState(k),[we,be]=useState(f),[Se,ge]=useState(w),[Ee,Ae]=useState(S),[_e,Oe]=useState(null),[ke,Te]=useState(null),Le=useRef(P),{anchorRefs:Ce,activeAnchor:Re}=z$1(t),xe=e=>null==e?void 0:e.getAttributeNames().reduce(((t,o)=>{var l;if(o.startsWith("data-tooltip-")){t[o.replace(/^data-tooltip-/,"")]=null!==(l=null==e?void 0:e.getAttribute(o))&&void 0!==l?l:null;}return t}),{}),Ne=e=>{const t={place:e=>{var t;ne(null!==(t=e)&&void 0!==t?t:v);},content:e=>{te(null!=e?e:i);},html:e=>{le(null!=e?e:c);},variant:e=>{var t;ce(null!==(t=e)&&void 0!==t?t:p);},offset:e=>{ae(null===e?m:Number(e));},wrapper:e=>{var t;be(null!==(t=e)&&void 0!==t?t:f);},events:e=>{const t=null==e?void 0:e.split(" ");ge(null!=t?t:w);},"position-strategy":e=>{var t;Ae(null!==(t=e)&&void 0!==t?t:S);},"delay-show":e=>{de(null===e?E:Number(e));},"delay-hide":e=>{ve(null===e?_:Number(e));},float:e=>{fe(null===e?O:"true"===e);},hidden:e=>{he(null===e?k:"true"===e);},"class-name":e=>{Oe(e);}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,o])=>{var l;null===(l=t[e])||void 0===l||l.call(t,o);}));};useEffect((()=>{te(i);}),[i]),useEffect((()=>{le(c);}),[c]),useEffect((()=>{ne(v);}),[v]),useEffect((()=>{ce(p);}),[p]),useEffect((()=>{ae(m);}),[m]),useEffect((()=>{de(E);}),[E]),useEffect((()=>{ve(_);}),[_]),useEffect((()=>{fe(O);}),[O]),useEffect((()=>{he(k);}),[k]),useEffect((()=>{Ae(S);}),[S]),useEffect((()=>{Le.current!==P&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.");}),[P]),useEffect((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===P,disableBase:P}}));}),[]),useEffect((()=>{var e;const o=new Set(Ce);let r=n;if(!r&&t&&(r=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`),r)try{document.querySelectorAll(r).forEach((e=>{o.add({current:e});}));}catch(e){console.warn(`[react-tooltip] "${r}" is not a valid CSS selector`);}const i=document.querySelector(`[id='${l}']`);if(i&&o.add({current:i}),!o.size)return ()=>null;const c=null!==(e=null!=ke?ke:i)&&void 0!==e?e:Re.current,s=new MutationObserver((e=>{e.forEach((e=>{var t;if(!c||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const o=xe(c);Ne(o);}));})),a={attributes:true,childList:false,subtree:false};if(c){const e=xe(c);Ne(e),s.observe(c,a);}return ()=>{s.disconnect();}}),[Ce,Re,ke,l,n]),useEffect((()=>{(null==B?void 0:B.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),V&&!A("border",`${V}`)&&console.warn(`[react-tooltip] "${V}" is not a valid \`border\`.`),(null==B?void 0:B.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),F&&!A("opacity",`${F}`)&&console.warn(`[react-tooltip] "${F}" is not a valid \`opacity\`.`);}),[]);let $e=h;const Ie=useRef(null);if(a){const t=a({content:(null==ke?void 0:ke.getAttribute("data-tooltip-content"))||ee||null,activeAnchor:ke});$e=t?React__default.createElement("div",{ref:Ie,className:"react-tooltip-content-wrapper"},t):null;}else ee&&($e=ee);oe&&($e=React__default.createElement(H,{content:oe}));const ze={forwardRef:Q,id:t,anchorId:l,anchorSelect:n,className:classNames$1(u,_e),classNameArrow:d,content:$e,contentWrapperRef:Ie,place:re,variant:ie,offset:se,wrapper:we,events:Se,openOnClick:b,positionStrategy:Ee,middlewares:g,delayShow:ue,delayHide:pe,float:me,hidden:ye,noArrow:T,clickable:L,closeOnEsc:C,closeOnScroll:R,closeOnResize:x,openEvents:N,closeEvents:$,globalCloseEvents:I,imperativeModeOnly:j,style:B,position:D,isOpen:M,defaultIsOpen:W,border:V,opacity:F,arrowColor:K,arrowSize:U,setIsOpen:X,afterShow:Y,afterHide:G,disableTooltip:Z,activeAnchor:ke,setActiveAnchor:e=>Te(e),role:J};return React__default.createElement(q,{...ze})}));"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||S({css:`:root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s;--rt-arrow-size:8px}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit;z-index:-1}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}`,type:"core"}),e.detail.disableBase||S({css:`
|
|
42985
|
+
const h="react-tooltip-core-styles",w="react-tooltip-base-styles",b={core:false,base:false};function S({css:e,id:t=w,type:o="base",ref:l}){var r,n;if(!e||"undefined"==typeof document||b[o])return;if("core"===o&&"undefined"!=typeof process&&(null===(r=null===process||void 0===process?void 0:process.env)||void 0===r?void 0:r.REACT_TOOLTIP_DISABLE_CORE_STYLES))return;if("base"!==o&&"undefined"!=typeof process&&(null===(n=null===process||void 0===process?void 0:process.env)||void 0===n?void 0:n.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;"core"===o&&(t=h),l||(l={});const{insertAt:i}=l;if(document.getElementById(t))return;const c=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.id=t,s.type="text/css","top"===i&&c.firstChild?c.insertBefore(s,c.firstChild):c.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e)),b[o]=true;}const E=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:o=null,place:l="top",offset:r=10,strategy:n="absolute",middlewares:i=[offset(Number(r)),flip({fallbackAxisSideDirection:"start"}),shift({padding:5})],border:c,arrowSize:s=8})=>{if(!e)return {tooltipStyles:{},tooltipArrowStyles:{},place:l};if(null===t)return {tooltipStyles:{},tooltipArrowStyles:{},place:l};const a=i;return o?(a.push(arrow({element:o,padding:5})),computePosition(e,t,{placement:l,strategy:n,middleware:a}).then((({x:e,y:t,placement:o,middlewareData:l})=>{var r,n;const i={left:`${e}px`,top:`${t}px`,border:c},{x:a,y:u}=null!==(r=l.arrow)&&void 0!==r?r:{x:0,y:0},d=null!==(n={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]])&&void 0!==n?n:"bottom",p=c&&{borderBottom:c,borderRight:c};let v=0;if(c){const e=`${c}`.match(/(\d+)px/);v=(null==e?void 0:e[1])?Number(e[1]):1;}return {tooltipStyles:i,tooltipArrowStyles:{left:null!=a?`${a}px`:"",top:null!=u?`${u}px`:"",right:"",bottom:"",...p,[d]:`-${s/2+v}px`},place:o}}))):computePosition(e,t,{placement:"bottom",strategy:n,middleware:a}).then((({x:e,y:t,placement:o})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:o})))},A=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),_$1=(e,t,o)=>{let l=null;const r=function(...r){const n=()=>{l=null;};!l&&(e.apply(this,r),l=setTimeout(n,t));};return r.cancel=()=>{l&&(clearTimeout(l),l=null);},r},O=e=>null!==e&&!Array.isArray(e)&&"object"==typeof e,k=(e,t)=>{if(e===t)return true;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(((e,o)=>k(e,t[o])));if(Array.isArray(e)!==Array.isArray(t))return false;if(!O(e)||!O(t))return e===t;const o=Object.keys(e),l=Object.keys(t);return o.length===l.length&&o.every((o=>k(e[o],t[o])))},T=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return false;const t=getComputedStyle(e);return ["overflow","overflow-x","overflow-y"].some((e=>{const o=t.getPropertyValue(e);return "auto"===o||"scroll"===o}))},L$1=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(T(t))return t;t=t.parentElement;}return document.scrollingElement||document.documentElement},C="undefined"!=typeof window?useLayoutEffect:useEffect,R=e=>{e.current&&(clearTimeout(e.current),e.current=null);},x="DEFAULT_TOOLTIP_ID",N$1={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},$$1=createContext({getTooltipData:()=>N$1});function z$1(e=x){return useContext($$1).getTooltipData(e)}var B$1={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},D={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const q=({forwardRef:t,id:l,className:i,classNameArrow:c,variant:u="dark",anchorId:d,anchorSelect:p,place:v="top",offset:m=10,events:h=["hover"],openOnClick:w=false,positionStrategy:b="absolute",middlewares:S,wrapper:g,delayShow:A=0,delayHide:O=0,float:T=false,hidden:x=false,noArrow:N=false,clickable:$=false,closeOnEsc:I=false,closeOnScroll:j=false,closeOnResize:q=false,openEvents:H,closeEvents:M,globalCloseEvents:W,imperativeModeOnly:P,style:V,position:F,afterShow:K,afterHide:U,disableTooltip:X,content:Y,contentWrapperRef:G,isOpen:Z,defaultIsOpen:J=false,setIsOpen:Q,activeAnchor:ee,setActiveAnchor:te,border:oe,opacity:le,arrowColor:re,arrowSize:ne=8,role:ie="tooltip"})=>{var ce;const se=useRef(null),ae=useRef(null),ue=useRef(null),de=useRef(null),pe=useRef(null),[ve,me]=useState({tooltipStyles:{},tooltipArrowStyles:{},place:v}),[fe,ye]=useState(false),[he,we]=useState(false),[be,Se]=useState(null),ge=useRef(false),Ee=useRef(null),{anchorRefs:Ae,setActiveAnchor:_e}=z$1(l),Oe=useRef(false),[ke,Te]=useState([]),Le=useRef(false),Ce=w||h.includes("click"),Re=Ce||(null==H?void 0:H.click)||(null==H?void 0:H.dblclick)||(null==H?void 0:H.mousedown),xe=H?{...H}:{mouseover:true,focus:true,mouseenter:false,click:false,dblclick:false,mousedown:false};!H&&Ce&&Object.assign(xe,{mouseenter:false,focus:false,mouseover:false,click:true});const Ne=M?{...M}:{mouseout:true,blur:true,mouseleave:false,click:false,dblclick:false,mouseup:false};!M&&Ce&&Object.assign(Ne,{mouseleave:false,blur:false,mouseout:false});const $e=W?{...W}:{escape:I||false,scroll:j||false,resize:q||false,clickOutsideAnchor:Re||false};P&&(Object.assign(xe,{mouseover:false,focus:false,mouseenter:false,click:false,dblclick:false,mousedown:false}),Object.assign(Ne,{mouseout:false,blur:false,mouseleave:false,click:false,dblclick:false,mouseup:false}),Object.assign($e,{escape:false,scroll:false,resize:false,clickOutsideAnchor:false})),C((()=>(Le.current=true,()=>{Le.current=false;})),[]);const Ie=e=>{Le.current&&(e&&we(true),setTimeout((()=>{Le.current&&(null==Q||Q(e),void 0===Z&&ye(e));}),10));};useEffect((()=>{if(void 0===Z)return ()=>null;Z&&we(true);const e=setTimeout((()=>{ye(Z);}),10);return ()=>{clearTimeout(e);}}),[Z]),useEffect((()=>{if(fe!==ge.current)if(R(pe),ge.current=fe,fe)null==K||K();else {const e=(e=>{const t=e.match(/^([\d.]+)(ms|s)$/);if(!t)return 0;const[,o,l]=t;return Number(o)*("ms"===l?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));pe.current=setTimeout((()=>{we(false),Se(null),null==U||U();}),e+25);}}),[fe]);const ze=e=>{me((t=>k(t,e)?t:e));},je=(e=A)=>{R(ue),he?Ie(true):ue.current=setTimeout((()=>{Ie(true);}),e);},Be=(e=O)=>{R(de),de.current=setTimeout((()=>{Oe.current||Ie(false);}),e);},De=e=>{var t;if(!e)return;const o=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==o?void 0:o.isConnected))return te(null),void _e({current:null});A?je():Ie(true),te(o),_e({current:o}),R(de);},qe=()=>{$?Be(O||100):O?Be():Ie(false),R(ue);},He=({x:e,y:t})=>{var o;const l={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};E({place:null!==(o=null==be?void 0:be.place)&&void 0!==o?o:v,offset:m,elementReference:l,tooltipReference:se.current,tooltipArrowReference:ae.current,strategy:b,middlewares:S,border:oe,arrowSize:ne}).then((e=>{ze(e);}));},Me=e=>{if(!e)return;const t=e,o={x:t.clientX,y:t.clientY};He(o),Ee.current=o;},We=e=>{var t;if(!fe)return;const o=e.target;if(!o.isConnected)return;if(null===(t=se.current)||void 0===t?void 0:t.contains(o))return;[document.querySelector(`[id='${d}']`),...ke].some((e=>null==e?void 0:e.contains(o)))||(Ie(false),R(ue));},Pe=_$1(De,50),Ve=_$1(qe,50),Fe=e=>{Ve.cancel(),Pe(e);},Ke=()=>{Pe.cancel(),Ve();},Ue=useCallback((()=>{var e,t;const o=null!==(e=null==be?void 0:be.position)&&void 0!==e?e:F;o?He(o):T?Ee.current&&He(Ee.current):(null==ee?void 0:ee.isConnected)&&E({place:null!==(t=null==be?void 0:be.place)&&void 0!==t?t:v,offset:m,elementReference:ee,tooltipReference:se.current,tooltipArrowReference:ae.current,strategy:b,middlewares:S,border:oe,arrowSize:ne}).then((e=>{Le.current&&ze(e);}));}),[fe,ee,Y,V,v,null==be?void 0:be.place,m,b,F,null==be?void 0:be.position,T,ne]);useEffect((()=>{var e,t;const o=new Set(Ae);ke.forEach((e=>{(null==X?void 0:X(e))||o.add({current:e});}));const l=document.querySelector(`[id='${d}']`);l&&!(null==X?void 0:X(l))&&o.add({current:l});const r=()=>{Ie(false);},n=L$1(ee),i=L$1(se.current);$e.scroll&&(window.addEventListener("scroll",r),null==n||n.addEventListener("scroll",r),null==i||i.addEventListener("scroll",r));let c=null;$e.resize?window.addEventListener("resize",r):ee&&se.current&&(c=autoUpdate(ee,se.current,Ue,{ancestorResize:true,elementResize:true,layoutShift:true}));const s=e=>{"Escape"===e.key&&Ie(false);};$e.escape&&window.addEventListener("keydown",s),$e.clickOutsideAnchor&&window.addEventListener("click",We);const a=[],u=e=>Boolean((null==e?void 0:e.target)&&(null==ee?void 0:ee.contains(e.target))),p=e=>{fe&&u(e)||De(e);},v=e=>{fe&&u(e)&&qe();},m=["mouseover","mouseout","mouseenter","mouseleave","focus","blur"],y=["click","dblclick","mousedown","mouseup"];Object.entries(xe).forEach((([e,t])=>{t&&(m.includes(e)?a.push({event:e,listener:Fe}):y.includes(e)&&a.push({event:e,listener:p}));})),Object.entries(Ne).forEach((([e,t])=>{t&&(m.includes(e)?a.push({event:e,listener:Ke}):y.includes(e)&&a.push({event:e,listener:v}));})),T&&a.push({event:"pointermove",listener:Me});const h=()=>{Oe.current=true;},w=()=>{Oe.current=false,qe();},b=$&&(Ne.mouseout||Ne.mouseleave);return b&&(null===(e=se.current)||void 0===e||e.addEventListener("mouseover",h),null===(t=se.current)||void 0===t||t.addEventListener("mouseout",w)),a.forEach((({event:e,listener:t})=>{o.forEach((o=>{var l;null===(l=o.current)||void 0===l||l.addEventListener(e,t);}));})),()=>{var e,t;$e.scroll&&(window.removeEventListener("scroll",r),null==n||n.removeEventListener("scroll",r),null==i||i.removeEventListener("scroll",r)),$e.resize?window.removeEventListener("resize",r):null==c||c(),$e.clickOutsideAnchor&&window.removeEventListener("click",We),$e.escape&&window.removeEventListener("keydown",s),b&&(null===(e=se.current)||void 0===e||e.removeEventListener("mouseover",h),null===(t=se.current)||void 0===t||t.removeEventListener("mouseout",w)),a.forEach((({event:e,listener:t})=>{o.forEach((o=>{var l;null===(l=o.current)||void 0===l||l.removeEventListener(e,t);}));}));}}),[ee,Ue,he,Ae,ke,H,M,W,Ce,A,O]),useEffect((()=>{var e,t;let o=null!==(t=null!==(e=null==be?void 0:be.anchorSelect)&&void 0!==e?e:p)&&void 0!==t?t:"";!o&&l&&(o=`[data-tooltip-id='${l.replace(/'/g,"\\'")}']`);const r=new MutationObserver((e=>{const t=[],r=[];e.forEach((e=>{if("attributes"===e.type&&"data-tooltip-id"===e.attributeName){e.target.getAttribute("data-tooltip-id")===l?t.push(e.target):e.oldValue===l&&r.push(e.target);}if("childList"===e.type){if(ee){const t=[...e.removedNodes].filter((e=>1===e.nodeType));if(o)try{r.push(...t.filter((e=>e.matches(o)))),r.push(...t.flatMap((e=>[...e.querySelectorAll(o)])));}catch(e){}t.some((e=>{var t;return !!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,ee))&&(we(false),Ie(false),te(null),R(ue),R(de),true)}));}if(o)try{const l=[...e.addedNodes].filter((e=>1===e.nodeType));t.push(...l.filter((e=>e.matches(o)))),t.push(...l.flatMap((e=>[...e.querySelectorAll(o)])));}catch(e){}}})),(t.length||r.length)&&Te((e=>[...e.filter((e=>!r.includes(e))),...t]));}));return r.observe(document.body,{childList:true,subtree:true,attributes:true,attributeFilter:["data-tooltip-id"],attributeOldValue:true}),()=>{r.disconnect();}}),[l,p,null==be?void 0:be.anchorSelect,ee]),useEffect((()=>{Ue();}),[Ue]),useEffect((()=>{if(!(null==G?void 0:G.current))return ()=>null;const e=new ResizeObserver((()=>{setTimeout((()=>Ue()));}));return e.observe(G.current),()=>{e.disconnect();}}),[Y,null==G?void 0:G.current]),useEffect((()=>{var e;const t=document.querySelector(`[id='${d}']`),o=[...ke,t];ee&&o.includes(ee)||te(null!==(e=ke[0])&&void 0!==e?e:t);}),[d,ke,ee]),useEffect((()=>(J&&Ie(true),()=>{R(ue),R(de);})),[]),useEffect((()=>{var e;let t=null!==(e=null==be?void 0:be.anchorSelect)&&void 0!==e?e:p;if(!t&&l&&(t=`[data-tooltip-id='${l.replace(/'/g,"\\'")}']`),t)try{const e=Array.from(document.querySelectorAll(t));Te(e);}catch(e){Te([]);}}),[l,p,null==be?void 0:be.anchorSelect]),useEffect((()=>{ue.current&&(R(ue),je(A));}),[A]);const Xe=null!==(ce=null==be?void 0:be.content)&&void 0!==ce?ce:Y,Ye=fe&&Object.keys(ve.tooltipStyles).length>0;return useImperativeHandle(t,(()=>({open:e=>{if(null==e?void 0:e.anchorSelect)try{document.querySelector(e.anchorSelect);}catch(t){return void console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`)}Se(null!=e?e:null),(null==e?void 0:e.delay)?je(e.delay):Ie(true);},close:e=>{(null==e?void 0:e.delay)?Be(e.delay):Ie(false);},activeAnchor:ee,place:ve.place,isOpen:Boolean(he&&!x&&Xe&&Ye)}))),he&&!x&&Xe?React__default.createElement(g,{id:l,role:ie,className:classNames$1("react-tooltip",B$1.tooltip,D.tooltip,D[u],i,`react-tooltip__place-${ve.place}`,B$1[Ye?"show":"closing"],Ye?"react-tooltip__show":"react-tooltip__closing","fixed"===b&&B$1.fixed,$&&B$1.clickable),onTransitionEnd:e=>{R(pe),fe||"opacity"!==e.propertyName||(we(false),Se(null),null==U||U());},style:{...V,...ve.tooltipStyles,opacity:void 0!==le&&Ye?le:void 0},ref:se},Xe,React__default.createElement(g,{className:classNames$1("react-tooltip-arrow",B$1.arrow,D.arrow,c,N&&B$1.noArrow),style:{...ve.tooltipArrowStyles,background:re?`linear-gradient(to right bottom, transparent 50%, ${re} 50%)`:void 0,"--rt-arrow-size":`${ne}px`},ref:ae})):null},H=({content:t})=>React__default.createElement("span",{dangerouslySetInnerHTML:{__html:t}}),M=React__default.forwardRef((({id:t,anchorId:l,anchorSelect:n,content:i,html:c,render:a,className:u,classNameArrow:d,variant:p="dark",place:v="top",offset:m=10,wrapper:f="div",children:h=null,events:w=["hover"],openOnClick:b=false,positionStrategy:S="absolute",middlewares:g,delayShow:E=0,delayHide:_=0,float:O=false,hidden:k=false,noArrow:T=false,clickable:L=false,closeOnEsc:C=false,closeOnScroll:R=false,closeOnResize:x=false,openEvents:N,closeEvents:$,globalCloseEvents:I,imperativeModeOnly:j=false,style:B,position:D,isOpen:M,defaultIsOpen:W=false,disableStyleInjection:P=false,border:V,opacity:F,arrowColor:K,arrowSize:U,setIsOpen:X,afterShow:Y,afterHide:G,disableTooltip:Z,role:J="tooltip"},Q)=>{const[ee,te]=useState(i),[oe,le]=useState(c),[re,ne]=useState(v),[ie,ce]=useState(p),[se,ae]=useState(m),[ue,de]=useState(E),[pe,ve]=useState(_),[me,fe]=useState(O),[ye,he]=useState(k),[we,be]=useState(f),[Se,ge]=useState(w),[Ee,Ae]=useState(S),[_e,Oe]=useState(null),[ke,Te]=useState(null),Le=useRef(P),{anchorRefs:Ce,activeAnchor:Re}=z$1(t),xe=e=>null==e?void 0:e.getAttributeNames().reduce(((t,o)=>{var l;if(o.startsWith("data-tooltip-")){t[o.replace(/^data-tooltip-/,"")]=null!==(l=null==e?void 0:e.getAttribute(o))&&void 0!==l?l:null;}return t}),{}),Ne=e=>{const t={place:e=>{var t;ne(null!==(t=e)&&void 0!==t?t:v);},content:e=>{te(null!=e?e:i);},html:e=>{le(null!=e?e:c);},variant:e=>{var t;ce(null!==(t=e)&&void 0!==t?t:p);},offset:e=>{ae(null===e?m:Number(e));},wrapper:e=>{var t;be(null!==(t=e)&&void 0!==t?t:f);},events:e=>{const t=null==e?void 0:e.split(" ");ge(null!=t?t:w);},"position-strategy":e=>{var t;Ae(null!==(t=e)&&void 0!==t?t:S);},"delay-show":e=>{de(null===e?E:Number(e));},"delay-hide":e=>{ve(null===e?_:Number(e));},float:e=>{fe(null===e?O:"true"===e);},hidden:e=>{he(null===e?k:"true"===e);},"class-name":e=>{Oe(e);}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,o])=>{var l;null===(l=t[e])||void 0===l||l.call(t,o);}));};useEffect((()=>{te(i);}),[i]),useEffect((()=>{le(c);}),[c]),useEffect((()=>{ne(v);}),[v]),useEffect((()=>{ce(p);}),[p]),useEffect((()=>{ae(m);}),[m]),useEffect((()=>{de(E);}),[E]),useEffect((()=>{ve(_);}),[_]),useEffect((()=>{fe(O);}),[O]),useEffect((()=>{he(k);}),[k]),useEffect((()=>{Ae(S);}),[S]),useEffect((()=>{Le.current!==P&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.");}),[P]),useEffect((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===P,disableBase:P}}));}),[]),useEffect((()=>{var e;const o=new Set(Ce);let r=n;if(!r&&t&&(r=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`),r)try{document.querySelectorAll(r).forEach((e=>{o.add({current:e});}));}catch(e){console.warn(`[react-tooltip] "${r}" is not a valid CSS selector`);}const i=document.querySelector(`[id='${l}']`);if(i&&o.add({current:i}),!o.size)return ()=>null;const c=null!==(e=null!=ke?ke:i)&&void 0!==e?e:Re.current,s=new MutationObserver((e=>{e.forEach((e=>{var t;if(!c||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const o=xe(c);Ne(o);}));})),a={attributes:true,childList:false,subtree:false};if(c){const e=xe(c);Ne(e),s.observe(c,a);}return ()=>{s.disconnect();}}),[Ce,Re,ke,l,n]),useEffect((()=>{(null==B?void 0:B.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),V&&!A("border",`${V}`)&&console.warn(`[react-tooltip] "${V}" is not a valid \`border\`.`),(null==B?void 0:B.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),F&&!A("opacity",`${F}`)&&console.warn(`[react-tooltip] "${F}" is not a valid \`opacity\`.`);}),[]);let $e=h;const Ie=useRef(null);if(a){const t=a({content:(null==ke?void 0:ke.getAttribute("data-tooltip-content"))||ee||null,activeAnchor:ke});$e=t?React__default.createElement("div",{ref:Ie,className:"react-tooltip-content-wrapper"},t):null;}else ee&&($e=ee);oe&&($e=React__default.createElement(H,{content:oe}));const ze={forwardRef:Q,id:t,anchorId:l,anchorSelect:n,className:classNames$1(u,_e),classNameArrow:d,content:$e,contentWrapperRef:Ie,place:re,variant:ie,offset:se,wrapper:we,events:Se,openOnClick:b,positionStrategy:Ee,middlewares:g,delayShow:ue,delayHide:pe,float:me,hidden:ye,noArrow:T,clickable:L,closeOnEsc:C,closeOnScroll:R,closeOnResize:x,openEvents:N,closeEvents:$,globalCloseEvents:I,imperativeModeOnly:j,style:B,position:D,isOpen:M,defaultIsOpen:W,border:V,opacity:F,arrowColor:K,arrowSize:U,setIsOpen:X,afterShow:Y,afterHide:G,disableTooltip:Z,activeAnchor:ke,setActiveAnchor:e=>Te(e),role:J};return React__default.createElement(q,{...ze})}));"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||S({css:`:root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s;--rt-arrow-size:8px}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit;z-index:-1}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}`,type:"core"}),e.detail.disableBase||S({css:`
|
|
42986
42986
|
.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:var(--rt-arrow-size);height:var(--rt-arrow-size)}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:"base"});}));
|
|
42987
42987
|
|
|
42988
42988
|
const Tooltip = ({
|
|
@@ -69682,7 +69682,7 @@ function requireLodash () {
|
|
|
69682
69682
|
}
|
|
69683
69683
|
|
|
69684
69684
|
var lodashExports = requireLodash();
|
|
69685
|
-
const _
|
|
69685
|
+
const _ = /*@__PURE__*/getDefaultExportFromCjs(lodashExports);
|
|
69686
69686
|
|
|
69687
69687
|
// src/hooks/useDebounce.js
|
|
69688
69688
|
|
|
@@ -70681,9 +70681,9 @@ const AddUserGroupsRolesModal = ({
|
|
|
70681
70681
|
const handleBack = (changedExistingShares) => {
|
|
70682
70682
|
console.log("changedExistingShares", changedExistingShares);
|
|
70683
70683
|
setShares(changedExistingShares);
|
|
70684
|
-
const hasPermissionChanged = !_
|
|
70685
|
-
_
|
|
70686
|
-
_
|
|
70684
|
+
const hasPermissionChanged = !_.isEqual(
|
|
70685
|
+
_.mapValues(existingShares, (arr) => arr.map((o) => ({ id: o.id, permission: o.permission }))),
|
|
70686
|
+
_.mapValues(changedExistingShares, (arr) => arr.map((o) => ({ id: o.id, permission: o.permission })))
|
|
70687
70687
|
);
|
|
70688
70688
|
setDataChanged(hasPermissionChanged);
|
|
70689
70689
|
setView(view === ModalView.MEMBERS ? returnView : ModalView.INVITE);
|
|
@@ -75241,11 +75241,9 @@ function TreeView({
|
|
|
75241
75241
|
}
|
|
75242
75242
|
|
|
75243
75243
|
function SectionRenderer({ item, data: initialData, updateHandler, validationErrors = {} }) {
|
|
75244
|
-
console.log(item);
|
|
75245
75244
|
const [section, setSection] = React__default.useState(item);
|
|
75246
75245
|
const [data, setData] = React__default.useState(() => {
|
|
75247
75246
|
const sectionData = initialData && initialData[item.key] || (item.type === "datatable" ? [] : {});
|
|
75248
|
-
console.log("Initial Section data for", item.key, sectionData);
|
|
75249
75247
|
return sectionData;
|
|
75250
75248
|
});
|
|
75251
75249
|
const getOptions = React__default.useCallback((field) => {
|
|
@@ -75254,6 +75252,8 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75254
75252
|
const configData = initialData[config];
|
|
75255
75253
|
if (Array.isArray(configData)) {
|
|
75256
75254
|
return configData.map((item2) => ({
|
|
75255
|
+
id: item2[valueField],
|
|
75256
|
+
// Add id for backward compatibility
|
|
75257
75257
|
value: item2[valueField],
|
|
75258
75258
|
label: item2[labelField]
|
|
75259
75259
|
}));
|
|
@@ -75262,6 +75262,15 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75262
75262
|
}
|
|
75263
75263
|
return field.options || [];
|
|
75264
75264
|
}, [initialData]);
|
|
75265
|
+
const handleFieldChange = React__default.useCallback((fieldKey, value) => {
|
|
75266
|
+
setData((prevData) => {
|
|
75267
|
+
const newData = { ...prevData, [fieldKey]: value };
|
|
75268
|
+
if (updateHandler) {
|
|
75269
|
+
updateHandler(section.key, newData);
|
|
75270
|
+
}
|
|
75271
|
+
return newData;
|
|
75272
|
+
});
|
|
75273
|
+
}, [updateHandler, section.key]);
|
|
75265
75274
|
React__default.useEffect(() => {
|
|
75266
75275
|
if (initialData && initialData[item.key]) {
|
|
75267
75276
|
setData(initialData[item.key]);
|
|
@@ -75272,18 +75281,9 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75272
75281
|
if (prevInitialDataRef.current !== initialData) {
|
|
75273
75282
|
prevInitialDataRef.current = initialData;
|
|
75274
75283
|
const sectionData = initialData && initialData[item.key] || {};
|
|
75275
|
-
console.log("Updated Section data for", item.key, sectionData);
|
|
75276
75284
|
setData(sectionData);
|
|
75277
75285
|
}
|
|
75278
75286
|
}, [initialData, item.key]);
|
|
75279
|
-
console.log("Section data", data);
|
|
75280
|
-
const prevDataRef = useRef(data);
|
|
75281
|
-
useEffect(() => {
|
|
75282
|
-
if (prevDataRef.current !== data && updateHandler && typeof updateHandler === "function") {
|
|
75283
|
-
prevDataRef.current = data;
|
|
75284
|
-
updateHandler(section.key, data);
|
|
75285
|
-
}
|
|
75286
|
-
}, [section.key, data, updateHandler]);
|
|
75287
75287
|
const shouldShowField = (field) => {
|
|
75288
75288
|
if (!field.dependsOn) return true;
|
|
75289
75289
|
const { field: dependentField, value: requiredValue, operator = "equals" } = field.dependsOn;
|
|
@@ -75346,13 +75346,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75346
75346
|
name: field.key,
|
|
75347
75347
|
placeholder: field.placeholder,
|
|
75348
75348
|
value: data[field.key] || field.default || "",
|
|
75349
|
-
onChange: (e) =>
|
|
75350
|
-
const newData = { ...data, [field.key]: e.target.value };
|
|
75351
|
-
setData(newData);
|
|
75352
|
-
if (updateHandler) {
|
|
75353
|
-
updateHandler(section.key, newData);
|
|
75354
|
-
}
|
|
75355
|
-
},
|
|
75349
|
+
onChange: (e) => handleFieldChange(field.key, e.target.value),
|
|
75356
75350
|
required: field.required,
|
|
75357
75351
|
disabled: field.disabled ? field.disabled : false,
|
|
75358
75352
|
className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
@@ -75367,13 +75361,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75367
75361
|
name: field.key,
|
|
75368
75362
|
placeholder: field.placeholder,
|
|
75369
75363
|
value: data[field.key] || field.default || "",
|
|
75370
|
-
onChange: (e) =>
|
|
75371
|
-
const newData = { ...data, [field.key]: e.target.value };
|
|
75372
|
-
setData(newData);
|
|
75373
|
-
if (updateHandler) {
|
|
75374
|
-
updateHandler(section.key, newData);
|
|
75375
|
-
}
|
|
75376
|
-
},
|
|
75364
|
+
onChange: (e) => handleFieldChange(field.key, e.target.value),
|
|
75377
75365
|
rows: 3,
|
|
75378
75366
|
required: field.required,
|
|
75379
75367
|
disabled: field.disabled ? field.disabled : false,
|
|
@@ -75390,13 +75378,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75390
75378
|
name: field.key,
|
|
75391
75379
|
placeholder: field.placeholder,
|
|
75392
75380
|
value: data[field.key] || field.default || "",
|
|
75393
|
-
onChange: (e) =>
|
|
75394
|
-
const newData = { ...data, [field.key]: e.target.value };
|
|
75395
|
-
setData(newData);
|
|
75396
|
-
if (updateHandler) {
|
|
75397
|
-
updateHandler(section.key, newData);
|
|
75398
|
-
}
|
|
75399
|
-
},
|
|
75381
|
+
onChange: (e) => handleFieldChange(field.key, e.target.value),
|
|
75400
75382
|
required: field.required,
|
|
75401
75383
|
disabled: field.disabled ? field.disabled : false,
|
|
75402
75384
|
className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
@@ -75410,13 +75392,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75410
75392
|
{
|
|
75411
75393
|
name: field.key,
|
|
75412
75394
|
checked: Boolean(data[field.key] || field.default),
|
|
75413
|
-
onChange: (checked) =>
|
|
75414
|
-
const newData = { ...data, [field.key]: checked };
|
|
75415
|
-
setData(newData);
|
|
75416
|
-
if (updateHandler) {
|
|
75417
|
-
updateHandler(section.key, newData);
|
|
75418
|
-
}
|
|
75419
|
-
},
|
|
75395
|
+
onChange: (checked) => handleFieldChange(field.key, checked),
|
|
75420
75396
|
label: field.placeholder || field.label,
|
|
75421
75397
|
disabled: field.disabled ? field.disabled : false,
|
|
75422
75398
|
className: "w-full"
|
|
@@ -75430,13 +75406,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75430
75406
|
{
|
|
75431
75407
|
name: field.key,
|
|
75432
75408
|
value: data[field.key] || field.default || "",
|
|
75433
|
-
onChange: (value) =>
|
|
75434
|
-
const newData = { ...data, [field.key]: value };
|
|
75435
|
-
setData(newData);
|
|
75436
|
-
if (updateHandler) {
|
|
75437
|
-
updateHandler(section.key, newData);
|
|
75438
|
-
}
|
|
75439
|
-
},
|
|
75409
|
+
onChange: (value) => handleFieldChange(field.key, value),
|
|
75440
75410
|
options: getOptions(field),
|
|
75441
75411
|
placeholder: field.placeholder || `Select ${field.label}`,
|
|
75442
75412
|
required: field.required,
|
|
@@ -75455,13 +75425,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75455
75425
|
defaultValue: field.default,
|
|
75456
75426
|
placeholder: field.placeholder || "Enter email address",
|
|
75457
75427
|
value: data[field.key] || "",
|
|
75458
|
-
onChange: (e) =>
|
|
75459
|
-
const newData = { ...data, [field.key]: e.target.value };
|
|
75460
|
-
setData(newData);
|
|
75461
|
-
if (updateHandler) {
|
|
75462
|
-
updateHandler(section.key, newData);
|
|
75463
|
-
}
|
|
75464
|
-
},
|
|
75428
|
+
onChange: (e) => handleFieldChange(field.key, e.target.value),
|
|
75465
75429
|
required: field.required,
|
|
75466
75430
|
disabled: field.disabled ? field.disabled : false,
|
|
75467
75431
|
className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
@@ -75478,13 +75442,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75478
75442
|
defaultValue: field.default,
|
|
75479
75443
|
placeholder: field.placeholder || "Enter URL",
|
|
75480
75444
|
value: data[field.key] || "",
|
|
75481
|
-
onChange: (e) =>
|
|
75482
|
-
const newData = { ...data, [field.key]: e.target.value };
|
|
75483
|
-
setData(newData);
|
|
75484
|
-
if (updateHandler) {
|
|
75485
|
-
updateHandler(section.key, newData);
|
|
75486
|
-
}
|
|
75487
|
-
},
|
|
75445
|
+
onChange: (e) => handleFieldChange(field.key, e.target.value),
|
|
75488
75446
|
required: field.required,
|
|
75489
75447
|
disabled: field.disabled ? field.disabled : false,
|
|
75490
75448
|
className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
@@ -75501,13 +75459,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75501
75459
|
defaultValue: field.default,
|
|
75502
75460
|
placeholder: field.placeholder || "Enter password",
|
|
75503
75461
|
value: data[field.key] || "",
|
|
75504
|
-
onChange: (e) =>
|
|
75505
|
-
const newData = { ...data, [field.key]: e.target.value };
|
|
75506
|
-
setData(newData);
|
|
75507
|
-
if (updateHandler) {
|
|
75508
|
-
updateHandler(section.key, newData);
|
|
75509
|
-
}
|
|
75510
|
-
},
|
|
75462
|
+
onChange: (e) => handleFieldChange(field.key, e.target.value),
|
|
75511
75463
|
required: field.required,
|
|
75512
75464
|
disabled: field.disabled ? field.disabled : false,
|
|
75513
75465
|
className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
@@ -75520,13 +75472,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75520
75472
|
MultiSelect,
|
|
75521
75473
|
{
|
|
75522
75474
|
selectedItems: data[field.key] || [],
|
|
75523
|
-
onSelectionChange: (selectedItems) =>
|
|
75524
|
-
const newData = { ...data, [field.key]: selectedItems };
|
|
75525
|
-
setData(newData);
|
|
75526
|
-
if (updateHandler) {
|
|
75527
|
-
updateHandler(section.key, newData);
|
|
75528
|
-
}
|
|
75529
|
-
},
|
|
75475
|
+
onSelectionChange: (selectedItems) => handleFieldChange(field.key, selectedItems),
|
|
75530
75476
|
options: field.options || [],
|
|
75531
75477
|
placeholder: field.placeholder || `Select ${field.label}`,
|
|
75532
75478
|
disabled: field.disabled ? field.disabled : false,
|
|
@@ -75540,14 +75486,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75540
75486
|
ToggleSwitch,
|
|
75541
75487
|
{
|
|
75542
75488
|
checked: typeof data[field.key] === "boolean" ? data[field.key] : field.default,
|
|
75543
|
-
onChange: (isOn) =>
|
|
75544
|
-
console.log("Toggle changed:", field.key, isOn);
|
|
75545
|
-
const newData = { ...data, [field.key]: isOn };
|
|
75546
|
-
setData(newData);
|
|
75547
|
-
if (updateHandler) {
|
|
75548
|
-
updateHandler(section.key, newData);
|
|
75549
|
-
}
|
|
75550
|
-
},
|
|
75489
|
+
onChange: (isOn) => handleFieldChange(field.key, isOn),
|
|
75551
75490
|
label: field.placeholder || field.label,
|
|
75552
75491
|
disabled: field.disabled ? field.disabled : false
|
|
75553
75492
|
}
|
|
@@ -75559,13 +75498,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75559
75498
|
{
|
|
75560
75499
|
label: field.label,
|
|
75561
75500
|
value: data[field.key] ? new Date(data[field.key]) : null,
|
|
75562
|
-
onChange: (date) =>
|
|
75563
|
-
const newData = { ...data, [field.key]: date ? date.toISOString().split("T")[0] : "" };
|
|
75564
|
-
setData(newData);
|
|
75565
|
-
if (updateHandler) {
|
|
75566
|
-
updateHandler(section.key, newData);
|
|
75567
|
-
}
|
|
75568
|
-
},
|
|
75501
|
+
onChange: (date) => handleFieldChange(field.key, date ? date.toISOString().split("T")[0] : ""),
|
|
75569
75502
|
placeholder: field.placeholder || "Select date",
|
|
75570
75503
|
disabled: field.disabled ? field.disabled : false,
|
|
75571
75504
|
error: validationErrors[section.key]?.[field.key],
|
|
@@ -75577,13 +75510,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75577
75510
|
{
|
|
75578
75511
|
label: field.label,
|
|
75579
75512
|
value: data[field.key] || { from: null, to: null },
|
|
75580
|
-
onChange: (dateRange) =>
|
|
75581
|
-
const newData = { ...data, [field.key]: dateRange };
|
|
75582
|
-
setData(newData);
|
|
75583
|
-
if (updateHandler) {
|
|
75584
|
-
updateHandler(section.key, newData);
|
|
75585
|
-
}
|
|
75586
|
-
},
|
|
75513
|
+
onChange: (dateRange) => handleFieldChange(field.key, dateRange),
|
|
75587
75514
|
placeholder: field.placeholder || "Select date range",
|
|
75588
75515
|
disabled: field.disabled ? field.disabled : false,
|
|
75589
75516
|
error: validationErrors[section.key]?.[field.key],
|
|
@@ -75641,13 +75568,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75641
75568
|
SearchBar,
|
|
75642
75569
|
{
|
|
75643
75570
|
value: data[field.key] || "",
|
|
75644
|
-
onChange: (value) =>
|
|
75645
|
-
const newData = { ...data, [field.key]: value };
|
|
75646
|
-
setData(newData);
|
|
75647
|
-
if (updateHandler) {
|
|
75648
|
-
updateHandler(section.key, newData);
|
|
75649
|
-
}
|
|
75650
|
-
},
|
|
75571
|
+
onChange: (value) => handleFieldChange(field.key, value),
|
|
75651
75572
|
placeholder: field.placeholder || `Search ${field.label}`,
|
|
75652
75573
|
className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
75653
75574
|
}
|
|
@@ -75663,13 +75584,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75663
75584
|
defaultValue: field.default,
|
|
75664
75585
|
placeholder: field.placeholder || "Select date and time",
|
|
75665
75586
|
value: data[field.key] || "",
|
|
75666
|
-
onChange: (e) =>
|
|
75667
|
-
const newData = { ...data, [field.key]: e.target.value };
|
|
75668
|
-
setData(newData);
|
|
75669
|
-
if (updateHandler) {
|
|
75670
|
-
updateHandler(section.key, newData);
|
|
75671
|
-
}
|
|
75672
|
-
},
|
|
75587
|
+
onChange: (e) => handleFieldChange(field.key, e.target.value),
|
|
75673
75588
|
required: field.required,
|
|
75674
75589
|
className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
75675
75590
|
}
|
|
@@ -75685,13 +75600,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75685
75600
|
defaultValue: field.default,
|
|
75686
75601
|
placeholder: field.placeholder || "Select time",
|
|
75687
75602
|
value: data[field.key] || "",
|
|
75688
|
-
onChange: (e) =>
|
|
75689
|
-
const newData = { ...data, [field.key]: e.target.value };
|
|
75690
|
-
setData(newData);
|
|
75691
|
-
if (updateHandler) {
|
|
75692
|
-
updateHandler(section.key, newData);
|
|
75693
|
-
}
|
|
75694
|
-
},
|
|
75603
|
+
onChange: (e) => handleFieldChange(field.key, e.target.value),
|
|
75695
75604
|
required: field.required,
|
|
75696
75605
|
className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
75697
75606
|
}
|
|
@@ -75706,13 +75615,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75706
75615
|
name: field.key,
|
|
75707
75616
|
defaultValue: field.default || "#000000",
|
|
75708
75617
|
value: data[field.key] || "#000000",
|
|
75709
|
-
onChange: (e) =>
|
|
75710
|
-
const newData = { ...data, [field.key]: e.target.value };
|
|
75711
|
-
setData(newData);
|
|
75712
|
-
if (updateHandler) {
|
|
75713
|
-
updateHandler(section.key, newData);
|
|
75714
|
-
}
|
|
75715
|
-
},
|
|
75618
|
+
onChange: (e) => handleFieldChange(field.key, e.target.value),
|
|
75716
75619
|
className: `w-full h-10 ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
75717
75620
|
}
|
|
75718
75621
|
),
|
|
@@ -75726,13 +75629,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75726
75629
|
name: field.key,
|
|
75727
75630
|
defaultValue: field.default || field.min || 0,
|
|
75728
75631
|
value: data[field.key] || field.min || 0,
|
|
75729
|
-
onChange: (e) =>
|
|
75730
|
-
const newData = { ...data, [field.key]: e.target.value };
|
|
75731
|
-
setData(newData);
|
|
75732
|
-
if (updateHandler) {
|
|
75733
|
-
updateHandler(section.key, newData);
|
|
75734
|
-
}
|
|
75735
|
-
},
|
|
75632
|
+
onChange: (e) => handleFieldChange(field.key, e.target.value),
|
|
75736
75633
|
min: field.min || 0,
|
|
75737
75634
|
max: field.max || 100,
|
|
75738
75635
|
step: field.step || 1,
|
|
@@ -75757,11 +75654,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75757
75654
|
name: field.key,
|
|
75758
75655
|
onChange: (e) => {
|
|
75759
75656
|
const file = e.target.files[0];
|
|
75760
|
-
|
|
75761
|
-
setData(newData);
|
|
75762
|
-
if (updateHandler) {
|
|
75763
|
-
updateHandler(section.key, newData);
|
|
75764
|
-
}
|
|
75657
|
+
handleFieldChange(field.key, file ? file.name : "");
|
|
75765
75658
|
},
|
|
75766
75659
|
accept: field.accept,
|
|
75767
75660
|
className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
@@ -75776,13 +75669,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75776
75669
|
endpoints: field.endpoints || {},
|
|
75777
75670
|
initialData: data[field.key] || field.initialData || [],
|
|
75778
75671
|
className: field.className || "",
|
|
75779
|
-
onCollectionChange: (newCollections) =>
|
|
75780
|
-
const newData = { ...data, [field.key]: newCollections };
|
|
75781
|
-
setData(newData);
|
|
75782
|
-
if (updateHandler) {
|
|
75783
|
-
updateHandler(section.key, newData);
|
|
75784
|
-
}
|
|
75785
|
-
},
|
|
75672
|
+
onCollectionChange: (newCollections) => handleFieldChange(field.key, newCollections),
|
|
75786
75673
|
showSearch: field.showSearch !== false,
|
|
75787
75674
|
allowAdd: field.allowAdd !== false,
|
|
75788
75675
|
allowEdit: field.allowEdit !== false,
|
|
@@ -75806,6 +75693,9 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75806
75693
|
] }, idx)) })
|
|
75807
75694
|
] }) });
|
|
75808
75695
|
}
|
|
75696
|
+
const SectionRenderer$1 = React__default.memo(SectionRenderer, (prevProps, nextProps) => {
|
|
75697
|
+
return prevProps.item === nextProps.item && prevProps.data === nextProps.data && prevProps.updateHandler === nextProps.updateHandler && JSON.stringify(prevProps.validationErrors) === JSON.stringify(nextProps.validationErrors);
|
|
75698
|
+
});
|
|
75809
75699
|
|
|
75810
75700
|
const AvatarGroup = ({ children }) => /* @__PURE__ */ jsx("div", { className: "flex -space-x-2", children });
|
|
75811
75701
|
function DataTableRenderer({ item, data: initialData, updateHandler, validationErrors = {} }) {
|
|
@@ -75813,6 +75703,7 @@ function DataTableRenderer({ item, data: initialData, updateHandler, validationE
|
|
|
75813
75703
|
const [section, setSection] = useState(item);
|
|
75814
75704
|
const [audienceRowId, setAudienceRowId] = useState(null);
|
|
75815
75705
|
const [audienceFieldName, setAudienceFieldName] = useState(null);
|
|
75706
|
+
const isStructuralChangeRef = useRef(false);
|
|
75816
75707
|
const [data, setData] = useState(() => {
|
|
75817
75708
|
const existingData = initialData && initialData[section.key] || [];
|
|
75818
75709
|
return existingData.length > 0 ? existingData : [{ id: 0 }];
|
|
@@ -75820,32 +75711,35 @@ function DataTableRenderer({ item, data: initialData, updateHandler, validationE
|
|
|
75820
75711
|
useEffect(() => {
|
|
75821
75712
|
const existingData = initialData && initialData[section.key] || [];
|
|
75822
75713
|
const newData = existingData.length > 0 ? existingData : [{ id: 0 }];
|
|
75823
|
-
|
|
75824
|
-
|
|
75825
|
-
|
|
75826
|
-
|
|
75714
|
+
setData((prevData) => {
|
|
75715
|
+
if (JSON.stringify(prevData) !== JSON.stringify(newData)) {
|
|
75716
|
+
return newData;
|
|
75717
|
+
}
|
|
75718
|
+
return prevData;
|
|
75827
75719
|
});
|
|
75828
|
-
setData(newData);
|
|
75829
75720
|
}, [initialData, section.key]);
|
|
75721
|
+
const debounce = React__default.useCallback((func, delay) => {
|
|
75722
|
+
let timeoutId;
|
|
75723
|
+
return (...args) => {
|
|
75724
|
+
clearTimeout(timeoutId);
|
|
75725
|
+
timeoutId = setTimeout(() => func.apply(null, args), delay);
|
|
75726
|
+
};
|
|
75727
|
+
}, []);
|
|
75830
75728
|
const debouncedUpdate = React__default.useCallback(
|
|
75831
|
-
|
|
75729
|
+
debounce((newData) => {
|
|
75832
75730
|
if (updateHandler && typeof updateHandler === "function") {
|
|
75833
75731
|
updateHandler(section.key, newData);
|
|
75834
75732
|
}
|
|
75835
75733
|
}, 300),
|
|
75836
|
-
[section.key, updateHandler]
|
|
75734
|
+
[section.key, updateHandler, debounce]
|
|
75837
75735
|
);
|
|
75838
75736
|
useEffect(() => {
|
|
75839
|
-
|
|
75840
|
-
|
|
75737
|
+
if (!isStructuralChangeRef.current) {
|
|
75738
|
+
debouncedUpdate(data);
|
|
75739
|
+
} else {
|
|
75740
|
+
isStructuralChangeRef.current = false;
|
|
75741
|
+
}
|
|
75841
75742
|
}, [data, debouncedUpdate]);
|
|
75842
|
-
useEffect(() => {
|
|
75843
|
-
return () => {
|
|
75844
|
-
if (updateTimeoutRef.current) {
|
|
75845
|
-
clearTimeout(updateTimeoutRef.current);
|
|
75846
|
-
}
|
|
75847
|
-
};
|
|
75848
|
-
}, []);
|
|
75849
75743
|
const updateFieldValue = React__default.useCallback((field, rowIndex, value) => {
|
|
75850
75744
|
setData((prevData) => {
|
|
75851
75745
|
const newData = [...prevData];
|
|
@@ -75853,14 +75747,39 @@ function DataTableRenderer({ item, data: initialData, updateHandler, validationE
|
|
|
75853
75747
|
return newData;
|
|
75854
75748
|
});
|
|
75855
75749
|
}, []);
|
|
75750
|
+
const getFieldError = React__default.useCallback((field, rowIndex) => {
|
|
75751
|
+
return validationErrors[section.key]?.[rowIndex]?.[field.key];
|
|
75752
|
+
}, [validationErrors, section.key]);
|
|
75753
|
+
const renderError = React__default.useCallback((field, rowIndex) => {
|
|
75754
|
+
const error = getFieldError(field, rowIndex);
|
|
75755
|
+
return error ? /* @__PURE__ */ jsx("div", { className: "text-red-500 text-xs mt-1", children: error }) : null;
|
|
75756
|
+
}, [getFieldError]);
|
|
75757
|
+
const fieldOptionsCache = React__default.useMemo(() => {
|
|
75758
|
+
const cache = /* @__PURE__ */ new Map();
|
|
75759
|
+
section.fields.forEach((field) => {
|
|
75760
|
+
if (field.optionsFrom && initialData) {
|
|
75761
|
+
const { config, valueField, labelField } = field.optionsFrom;
|
|
75762
|
+
const configData = initialData[config] || [];
|
|
75763
|
+
if (Array.isArray(configData)) {
|
|
75764
|
+
const options = configData.map((item2) => ({
|
|
75765
|
+
id: item2[valueField] || "",
|
|
75766
|
+
value: item2[valueField] || "",
|
|
75767
|
+
label: item2[labelField] || ""
|
|
75768
|
+
}));
|
|
75769
|
+
cache.set(field.key, options);
|
|
75770
|
+
} else {
|
|
75771
|
+
cache.set(field.key, field.options || []);
|
|
75772
|
+
}
|
|
75773
|
+
} else {
|
|
75774
|
+
cache.set(field.key, field.options || []);
|
|
75775
|
+
}
|
|
75776
|
+
});
|
|
75777
|
+
return cache;
|
|
75778
|
+
}, [initialData, section.fields]);
|
|
75779
|
+
const getDynamicOptions = React__default.useCallback((field) => {
|
|
75780
|
+
return fieldOptionsCache.get(field.key) || [];
|
|
75781
|
+
}, [fieldOptionsCache]);
|
|
75856
75782
|
const getFieldRenderer = React__default.useCallback((field) => {
|
|
75857
|
-
const getFieldError = React__default.useCallback((rowIndex) => {
|
|
75858
|
-
return validationErrors[section.key]?.[rowIndex]?.[field.key];
|
|
75859
|
-
}, [validationErrors, section.key, field.key]);
|
|
75860
|
-
const renderError = React__default.useCallback((rowIndex) => {
|
|
75861
|
-
const error = getFieldError(rowIndex);
|
|
75862
|
-
return error ? /* @__PURE__ */ jsx("div", { className: "text-red-500 text-xs mt-1", children: error }) : null;
|
|
75863
|
-
}, [getFieldError]);
|
|
75864
75783
|
switch (field.fieldtype) {
|
|
75865
75784
|
case "text":
|
|
75866
75785
|
return (props, rowIndex) => /* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -75871,10 +75790,10 @@ function DataTableRenderer({ item, data: initialData, updateHandler, validationE
|
|
|
75871
75790
|
onChange: (e) => updateFieldValue(field, rowIndex, e.target.value),
|
|
75872
75791
|
placeholder: field.placeholder || `Enter ${field.label}`,
|
|
75873
75792
|
required: field.required,
|
|
75874
|
-
className: `w-full ${getFieldError(rowIndex) ? "border-red-500" : ""}`
|
|
75793
|
+
className: `w-full ${getFieldError(field, rowIndex) ? "border-red-500" : ""}`
|
|
75875
75794
|
}
|
|
75876
75795
|
),
|
|
75877
|
-
renderError(rowIndex)
|
|
75796
|
+
renderError(field, rowIndex)
|
|
75878
75797
|
] });
|
|
75879
75798
|
case "textarea":
|
|
75880
75799
|
return (props, rowIndex) => /* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -75885,11 +75804,11 @@ function DataTableRenderer({ item, data: initialData, updateHandler, validationE
|
|
|
75885
75804
|
onChange: (e) => updateFieldValue(field, rowIndex, e.target.value),
|
|
75886
75805
|
placeholder: field.placeholder || `Enter ${field.label}`,
|
|
75887
75806
|
required: field.required,
|
|
75888
|
-
className: `w-full ${getFieldError(rowIndex) ? "border-red-500" : ""}`,
|
|
75807
|
+
className: `w-full ${getFieldError(field, rowIndex) ? "border-red-500" : ""}`,
|
|
75889
75808
|
rows: 3
|
|
75890
75809
|
}
|
|
75891
75810
|
),
|
|
75892
|
-
renderError(rowIndex)
|
|
75811
|
+
renderError(field, rowIndex)
|
|
75893
75812
|
] });
|
|
75894
75813
|
case "number":
|
|
75895
75814
|
return (props, rowIndex) => /* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -75901,10 +75820,10 @@ function DataTableRenderer({ item, data: initialData, updateHandler, validationE
|
|
|
75901
75820
|
onChange: (e) => updateFieldValue(field, rowIndex, e.target.value),
|
|
75902
75821
|
placeholder: field.placeholder || `Enter ${field.label}`,
|
|
75903
75822
|
required: field.required,
|
|
75904
|
-
className: `w-full ${getFieldError(rowIndex) ? "border-red-500" : ""}`
|
|
75823
|
+
className: `w-full ${getFieldError(field, rowIndex) ? "border-red-500" : ""}`
|
|
75905
75824
|
}
|
|
75906
75825
|
),
|
|
75907
|
-
renderError(rowIndex)
|
|
75826
|
+
renderError(field, rowIndex)
|
|
75908
75827
|
] });
|
|
75909
75828
|
case "email":
|
|
75910
75829
|
return (props, rowIndex) => /* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -75916,10 +75835,10 @@ function DataTableRenderer({ item, data: initialData, updateHandler, validationE
|
|
|
75916
75835
|
onChange: (e) => updateFieldValue(field, rowIndex, e.target.value),
|
|
75917
75836
|
placeholder: field.placeholder || "Enter email address",
|
|
75918
75837
|
required: field.required,
|
|
75919
|
-
className: `w-full ${getFieldError(rowIndex) ? "border-red-500" : ""}`
|
|
75838
|
+
className: `w-full ${getFieldError(field, rowIndex) ? "border-red-500" : ""}`
|
|
75920
75839
|
}
|
|
75921
75840
|
),
|
|
75922
|
-
renderError(rowIndex)
|
|
75841
|
+
renderError(field, rowIndex)
|
|
75923
75842
|
] });
|
|
75924
75843
|
case "url":
|
|
75925
75844
|
return (props, rowIndex) => /* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -75931,10 +75850,10 @@ function DataTableRenderer({ item, data: initialData, updateHandler, validationE
|
|
|
75931
75850
|
onChange: (e) => updateFieldValue(field, rowIndex, e.target.value),
|
|
75932
75851
|
placeholder: field.placeholder || "Enter URL",
|
|
75933
75852
|
required: field.required,
|
|
75934
|
-
className: `w-full ${getFieldError(rowIndex) ? "border-red-500" : ""}`
|
|
75853
|
+
className: `w-full ${getFieldError(field, rowIndex) ? "border-red-500" : ""}`
|
|
75935
75854
|
}
|
|
75936
75855
|
),
|
|
75937
|
-
renderError(rowIndex)
|
|
75856
|
+
renderError(field, rowIndex)
|
|
75938
75857
|
] });
|
|
75939
75858
|
case "password":
|
|
75940
75859
|
return (props, rowIndex) => /* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -75946,48 +75865,30 @@ function DataTableRenderer({ item, data: initialData, updateHandler, validationE
|
|
|
75946
75865
|
onChange: (e) => updateFieldValue(field, rowIndex, e.target.value),
|
|
75947
75866
|
placeholder: field.placeholder || "Enter password",
|
|
75948
75867
|
required: field.required,
|
|
75949
|
-
className: `w-full ${getFieldError(rowIndex) ? "border-red-500" : ""}`
|
|
75868
|
+
className: `w-full ${getFieldError(field, rowIndex) ? "border-red-500" : ""}`
|
|
75950
75869
|
}
|
|
75951
75870
|
),
|
|
75952
|
-
renderError(rowIndex)
|
|
75871
|
+
renderError(field, rowIndex)
|
|
75953
75872
|
] });
|
|
75954
75873
|
case "select":
|
|
75955
|
-
case "dropdown":
|
|
75956
|
-
|
|
75957
|
-
|
|
75958
|
-
const { config, valueField, labelField } = field.optionsFrom;
|
|
75959
|
-
const configData = initialData[config] || [];
|
|
75960
|
-
if (Array.isArray(configData)) {
|
|
75961
|
-
return configData.map((item2) => ({
|
|
75962
|
-
value: item2[valueField] || "",
|
|
75963
|
-
label: item2[labelField] || ""
|
|
75964
|
-
}));
|
|
75965
|
-
}
|
|
75966
|
-
}
|
|
75967
|
-
return field.options || [];
|
|
75968
|
-
}, [field.optionsFrom, initialData?.[field.optionsFrom?.config], field.options]);
|
|
75969
|
-
const SelectField = React__default.memo(({ props, rowIndex }) => {
|
|
75970
|
-
const handleChange = React__default.useCallback((value) => {
|
|
75971
|
-
updateFieldValue(field, rowIndex, value);
|
|
75972
|
-
}, [rowIndex]);
|
|
75973
|
-
const error = getFieldError(rowIndex);
|
|
75874
|
+
case "dropdown":
|
|
75875
|
+
return (props, rowIndex) => {
|
|
75876
|
+
const options = getDynamicOptions(field);
|
|
75974
75877
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
75975
75878
|
/* @__PURE__ */ jsx(
|
|
75976
75879
|
Select,
|
|
75977
75880
|
{
|
|
75978
75881
|
value: props[field.key] || "",
|
|
75979
|
-
onChange:
|
|
75882
|
+
onChange: (value) => updateFieldValue(field, rowIndex, value),
|
|
75980
75883
|
options,
|
|
75981
75884
|
placeholder: field.placeholder || `Select ${field.label}`,
|
|
75982
75885
|
required: field.required,
|
|
75983
|
-
className: `w-full ${
|
|
75886
|
+
className: `w-full ${getFieldError(field, rowIndex) ? "border-red-500" : ""}`
|
|
75984
75887
|
}
|
|
75985
75888
|
),
|
|
75986
|
-
|
|
75889
|
+
renderError(field, rowIndex)
|
|
75987
75890
|
] });
|
|
75988
|
-
}
|
|
75989
|
-
return (props, rowIndex) => /* @__PURE__ */ jsx(SelectField, { props, rowIndex });
|
|
75990
|
-
}
|
|
75891
|
+
};
|
|
75991
75892
|
case "multiselect":
|
|
75992
75893
|
return (props, rowIndex) => {
|
|
75993
75894
|
const currentValue = props[field.key] || [];
|
|
@@ -76167,17 +76068,16 @@ function DataTableRenderer({ item, data: initialData, updateHandler, validationE
|
|
|
76167
76068
|
onChange: (e) => updateFieldValue(field, rowIndex, e.target.value),
|
|
76168
76069
|
placeholder: field.placeholder || `Enter ${field.label}`,
|
|
76169
76070
|
required: field.required,
|
|
76170
|
-
className: `w-full ${getFieldError(rowIndex) ? "border-red-500" : ""}`
|
|
76071
|
+
className: `w-full ${getFieldError(field, rowIndex) ? "border-red-500" : ""}`
|
|
76171
76072
|
}
|
|
76172
76073
|
),
|
|
76173
|
-
renderError(rowIndex)
|
|
76074
|
+
renderError(field, rowIndex)
|
|
76174
76075
|
] });
|
|
76175
76076
|
}
|
|
76176
|
-
}, [updateFieldValue, validationErrors, section.key, initialData]);
|
|
76077
|
+
}, [updateFieldValue, validationErrors, section.key, initialData, getDynamicOptions, getFieldError, renderError]);
|
|
76177
76078
|
const addBlankRow = useCallback(() => {
|
|
76178
|
-
|
|
76079
|
+
isStructuralChangeRef.current = true;
|
|
76179
76080
|
setData((prevData) => {
|
|
76180
|
-
console.log("[DataTableRenderer] Current data before add:", prevData);
|
|
76181
76081
|
const blankRow = {
|
|
76182
76082
|
id: prevData.length
|
|
76183
76083
|
// Assign next available ID
|
|
@@ -76189,22 +76089,31 @@ function DataTableRenderer({ item, data: initialData, updateHandler, validationE
|
|
|
76189
76089
|
blankRow[field.key] = "";
|
|
76190
76090
|
}
|
|
76191
76091
|
});
|
|
76192
|
-
console.log("[DataTableRenderer] New blank row:", blankRow);
|
|
76193
76092
|
const newData = [...prevData, blankRow];
|
|
76194
|
-
|
|
76093
|
+
setTimeout(() => {
|
|
76094
|
+
if (updateHandler && typeof updateHandler === "function") {
|
|
76095
|
+
updateHandler(section.key, newData);
|
|
76096
|
+
}
|
|
76097
|
+
}, 0);
|
|
76195
76098
|
return newData;
|
|
76196
76099
|
});
|
|
76197
|
-
}, [section.fields]);
|
|
76100
|
+
}, [section.fields, updateHandler, section.key]);
|
|
76198
76101
|
const removeRow = useCallback((index) => {
|
|
76102
|
+
isStructuralChangeRef.current = true;
|
|
76199
76103
|
setData((prevData) => {
|
|
76200
76104
|
if (prevData.length <= 1) {
|
|
76201
76105
|
return prevData;
|
|
76202
76106
|
}
|
|
76203
76107
|
const newData = [...prevData];
|
|
76204
76108
|
newData.splice(index, 1);
|
|
76109
|
+
setTimeout(() => {
|
|
76110
|
+
if (updateHandler && typeof updateHandler === "function") {
|
|
76111
|
+
updateHandler(section.key, newData);
|
|
76112
|
+
}
|
|
76113
|
+
}, 0);
|
|
76205
76114
|
return newData;
|
|
76206
76115
|
});
|
|
76207
|
-
}, []);
|
|
76116
|
+
}, [updateHandler, section.key]);
|
|
76208
76117
|
const [draggedIndex, setDraggedIndex] = useState(null);
|
|
76209
76118
|
const handleDragStart = useCallback((e, index) => {
|
|
76210
76119
|
setDraggedIndex(index);
|
|
@@ -76231,7 +76140,6 @@ function DataTableRenderer({ item, data: initialData, updateHandler, validationE
|
|
|
76231
76140
|
setDraggedIndex(null);
|
|
76232
76141
|
}, []);
|
|
76233
76142
|
const handleAddAudience = useCallback((selectedEntities) => {
|
|
76234
|
-
console.log("[DataTableRenderer] handleAddAudience called with:", selectedEntities);
|
|
76235
76143
|
setData((prevData) => {
|
|
76236
76144
|
const newData = [...prevData];
|
|
76237
76145
|
if (audienceRowId !== null && audienceFieldName && newData[audienceRowId]) {
|
|
@@ -76244,7 +76152,6 @@ function DataTableRenderer({ item, data: initialData, updateHandler, validationE
|
|
|
76244
76152
|
groups: [...newData[audienceRowId][audienceFieldName]?.groups || [], ...groups],
|
|
76245
76153
|
roles: [...newData[audienceRowId][audienceFieldName]?.roles || [], ...roles]
|
|
76246
76154
|
};
|
|
76247
|
-
console.log("[DataTableRenderer] Updated audience data:", newData[audienceRowId][audienceFieldName]);
|
|
76248
76155
|
}
|
|
76249
76156
|
return newData;
|
|
76250
76157
|
});
|
|
@@ -76290,7 +76197,7 @@ function DataTableRenderer({ item, data: initialData, updateHandler, validationE
|
|
|
76290
76197
|
onDragEnd: handleDragEnd,
|
|
76291
76198
|
children: [
|
|
76292
76199
|
/* @__PURE__ */ jsx("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ jsx("div", { className: "cursor-move text-gray-400 hover:text-gray-600", children: /* @__PURE__ */ jsx(GripVertical, { size: 16 }) }) }),
|
|
76293
|
-
section.fields.map((field, fieldIndex) => /* @__PURE__ */ jsx("td", { className: "px-4 py-2 ", children: getFieldRenderer(field)(row, rowIndex) }, fieldIndex)),
|
|
76200
|
+
section.fields.map((field, fieldIndex) => /* @__PURE__ */ jsx("td", { className: "px-4 py-2 ", children: getFieldRenderer(field)(row, rowIndex) }, `field-${rowIndex}-${fieldIndex}-${field.key}`)),
|
|
76294
76201
|
/* @__PURE__ */ jsx("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ jsx(
|
|
76295
76202
|
"button",
|
|
76296
76203
|
{
|
|
@@ -76302,7 +76209,7 @@ function DataTableRenderer({ item, data: initialData, updateHandler, validationE
|
|
|
76302
76209
|
) })
|
|
76303
76210
|
]
|
|
76304
76211
|
},
|
|
76305
|
-
rowIndex
|
|
76212
|
+
`row-${rowIndex}-${row.id || "empty"}`
|
|
76306
76213
|
)) })
|
|
76307
76214
|
] }) }),
|
|
76308
76215
|
audienceRowId !== null && (() => {
|
|
@@ -76311,9 +76218,6 @@ function DataTableRenderer({ item, data: initialData, updateHandler, validationE
|
|
|
76311
76218
|
groups: data[audienceRowId][audienceFieldName].groups || [],
|
|
76312
76219
|
roles: data[audienceRowId][audienceFieldName].roles || []
|
|
76313
76220
|
} : { users: [], groups: [], roles: [] };
|
|
76314
|
-
console.log("[DataTableRenderer] Opening modal with existing data:", existingAudienceData);
|
|
76315
|
-
console.log("[DataTableRenderer] Row data:", data[audienceRowId]);
|
|
76316
|
-
console.log("[DataTableRenderer] Field name:", audienceFieldName);
|
|
76317
76221
|
return /* @__PURE__ */ jsx(
|
|
76318
76222
|
AddUserGroupsRolesModal,
|
|
76319
76223
|
{
|
|
@@ -76769,7 +76673,7 @@ const UnknownType = ({ item }) => /* @__PURE__ */ jsxs("div", { className: "p-3
|
|
|
76769
76673
|
/* @__PURE__ */ jsx("span", { className: "font-mono", children: String(item?.type ?? "N/A") })
|
|
76770
76674
|
] });
|
|
76771
76675
|
const REGISTRY = /* @__PURE__ */ Object.create(null);
|
|
76772
|
-
REGISTRY.section = SectionRenderer;
|
|
76676
|
+
REGISTRY.section = SectionRenderer$1;
|
|
76773
76677
|
REGISTRY.datatable = DataTableRenderer$1;
|
|
76774
76678
|
REGISTRY.managecollectionlist = ManageCollectionListRenderer;
|
|
76775
76679
|
REGISTRY["manage-collection-list"] = ManageCollectionListRenderer;
|
|
@@ -76939,16 +76843,10 @@ function DynamicConfig({
|
|
|
76939
76843
|
}
|
|
76940
76844
|
}
|
|
76941
76845
|
}, [configdata, reload, appid, disableApi]);
|
|
76942
|
-
const handleSectionChange = (name, sectiondata) => {
|
|
76943
|
-
console.log("Section change:", { name, sectiondata });
|
|
76846
|
+
const handleSectionChange = React__default.useCallback((name, sectiondata) => {
|
|
76944
76847
|
setData((prev) => {
|
|
76945
76848
|
const newData = JSON.parse(JSON.stringify(prev || {}));
|
|
76946
76849
|
newData[name] = sectiondata;
|
|
76947
|
-
console.log("Complete data after update:", {
|
|
76948
|
-
updatedSection: name,
|
|
76949
|
-
sectionData: sectiondata,
|
|
76950
|
-
allData: newData
|
|
76951
|
-
});
|
|
76952
76850
|
return newData;
|
|
76953
76851
|
});
|
|
76954
76852
|
setValidationErrors((prevErrors) => {
|
|
@@ -76958,7 +76856,7 @@ function DynamicConfig({
|
|
|
76958
76856
|
}
|
|
76959
76857
|
return newErrors;
|
|
76960
76858
|
});
|
|
76961
|
-
};
|
|
76859
|
+
}, []);
|
|
76962
76860
|
const validateRequiredFields = () => {
|
|
76963
76861
|
const errors = {};
|
|
76964
76862
|
if (!config || !data) {
|