@kashifd/jwero-components 0.5.3 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -284,5 +284,5 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
284
284
|
* LICENSE.md file in the root directory of this source tree.
|
|
285
285
|
*
|
|
286
286
|
* @license MIT
|
|
287
|
-
*/function vc(){return vc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},vc.apply(this,arguments)}const xc=g.createContext(null);process.env.NODE_ENV!=="production"&&(xc.displayName="DataRouter");const UI=g.createContext(null);process.env.NODE_ENV!=="production"&&(UI.displayName="DataRouterState");const HI=g.createContext(null);process.env.NODE_ENV!=="production"&&(HI.displayName="Await");const Cc=g.createContext(null);process.env.NODE_ENV!=="production"&&(Cc.displayName="Navigation");const Tc=g.createContext(null);process.env.NODE_ENV!=="production"&&(Tc.displayName="Location");const Zi=g.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(Zi.displayName="Route");const qI=g.createContext(null);process.env.NODE_ENV!=="production"&&(qI.displayName="RouteError");function Ph(){return g.useContext(Tc)!=null}function YI(){return Ph()||(process.env.NODE_ENV!=="production"?en(!1,"useLocation() may be used only in the context of a <Router> component."):en(!1)),g.useContext(Tc).location}const kh="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Mh(e){g.useContext(Cc).static||g.useLayoutEffect(e)}function KI(){let{isDataRoute:e}=g.useContext(Zi);return e?QI():GI()}function GI(){Ph()||(process.env.NODE_ENV!=="production"?en(!1,"useNavigate() may be used only in the context of a <Router> component."):en(!1));let e=g.useContext(xc),{basename:t,future:o,navigator:r}=g.useContext(Cc),{matches:s}=g.useContext(Zi),{pathname:i}=YI(),a=JSON.stringify(FI(s,o.v7_relativeSplatPath)),l=g.useRef(!1);return Mh(()=>{l.current=!0}),g.useCallback(function(u,d){if(d===void 0&&(d={}),process.env.NODE_ENV!=="production"&&Oh(l.current,kh),!l.current)return;if(typeof u=="number"){r.go(u);return}let p=LI(u,JSON.parse(a),i,d.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:VI([t,p.pathname])),(d.replace?r.replace:r.push)(p,d.state,d)},[t,r,a,i,e])}var Dh=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Dh||{}),Ih=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Ih||{});function $h(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function XI(e){let t=g.useContext(xc);return t||(process.env.NODE_ENV!=="production"?en(!1,$h(e)):en(!1)),t}function ZI(e){let t=g.useContext(Zi);return t||(process.env.NODE_ENV!=="production"?en(!1,$h(e)):en(!1)),t}function JI(e){let t=ZI(e),o=t.matches[t.matches.length-1];return o.route.id||(process.env.NODE_ENV!=="production"?en(!1,e+' can only be used on routes that contain a unique "id"'):en(!1)),o.route.id}function QI(){let{router:e}=XI(Dh.UseNavigateStable),t=JI(Ih.UseNavigateStable),o=g.useRef(!1);return Mh(()=>{o.current=!0}),g.useCallback(function(s,i){i===void 0&&(i={}),process.env.NODE_ENV!=="production"&&Oh(o.current,kh),o.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,vc({fromRouteId:t},i)))},[e,t])}new Promise(()=>{});const e$=({currentPage:e,primaryNavigationData:t,secondaryNavigationData:o,onClickFunction:r})=>{const s=KI(),i=l=>{e!==l.value&&s(`/${l.redirect_to}`)},a=l=>{r?r(l):i(l)};return m.jsxs(Mn,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:"
|
|
287
|
+
*/function vc(){return vc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},vc.apply(this,arguments)}const xc=g.createContext(null);process.env.NODE_ENV!=="production"&&(xc.displayName="DataRouter");const UI=g.createContext(null);process.env.NODE_ENV!=="production"&&(UI.displayName="DataRouterState");const HI=g.createContext(null);process.env.NODE_ENV!=="production"&&(HI.displayName="Await");const Cc=g.createContext(null);process.env.NODE_ENV!=="production"&&(Cc.displayName="Navigation");const Tc=g.createContext(null);process.env.NODE_ENV!=="production"&&(Tc.displayName="Location");const Zi=g.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(Zi.displayName="Route");const qI=g.createContext(null);process.env.NODE_ENV!=="production"&&(qI.displayName="RouteError");function Ph(){return g.useContext(Tc)!=null}function YI(){return Ph()||(process.env.NODE_ENV!=="production"?en(!1,"useLocation() may be used only in the context of a <Router> component."):en(!1)),g.useContext(Tc).location}const kh="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Mh(e){g.useContext(Cc).static||g.useLayoutEffect(e)}function KI(){let{isDataRoute:e}=g.useContext(Zi);return e?QI():GI()}function GI(){Ph()||(process.env.NODE_ENV!=="production"?en(!1,"useNavigate() may be used only in the context of a <Router> component."):en(!1));let e=g.useContext(xc),{basename:t,future:o,navigator:r}=g.useContext(Cc),{matches:s}=g.useContext(Zi),{pathname:i}=YI(),a=JSON.stringify(FI(s,o.v7_relativeSplatPath)),l=g.useRef(!1);return Mh(()=>{l.current=!0}),g.useCallback(function(u,d){if(d===void 0&&(d={}),process.env.NODE_ENV!=="production"&&Oh(l.current,kh),!l.current)return;if(typeof u=="number"){r.go(u);return}let p=LI(u,JSON.parse(a),i,d.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:VI([t,p.pathname])),(d.replace?r.replace:r.push)(p,d.state,d)},[t,r,a,i,e])}var Dh=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Dh||{}),Ih=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Ih||{});function $h(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function XI(e){let t=g.useContext(xc);return t||(process.env.NODE_ENV!=="production"?en(!1,$h(e)):en(!1)),t}function ZI(e){let t=g.useContext(Zi);return t||(process.env.NODE_ENV!=="production"?en(!1,$h(e)):en(!1)),t}function JI(e){let t=ZI(e),o=t.matches[t.matches.length-1];return o.route.id||(process.env.NODE_ENV!=="production"?en(!1,e+' can only be used on routes that contain a unique "id"'):en(!1)),o.route.id}function QI(){let{router:e}=XI(Dh.UseNavigateStable),t=JI(Ih.UseNavigateStable),o=g.useRef(!1);return Mh(()=>{o.current=!0}),g.useCallback(function(s,i){i===void 0&&(i={}),process.env.NODE_ENV!=="production"&&Oh(o.current,kh),o.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,vc({fromRouteId:t},i)))},[e,t])}new Promise(()=>{});const e$=({currentPage:e,primaryNavigationData:t,secondaryNavigationData:o,onClickFunction:r})=>{const s=KI(),i=l=>{e!==l.value&&s(`/${l.redirect_to}`)},a=l=>{r?r(l):i(l)};return m.jsxs(Mn,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:"2.5rem",justifyContent:"space-between",backgroundColor:"#012687",padding:"2rem 0",height:"100%"},children:[m.jsx(qe,{alignItems:"center",sx:{gap:"2rem",height:"100%",padding:"0 0.5rem"},children:m.jsx(qe,{alignItems:"center",sx:{gap:"1rem"},children:t.map(l=>{var c;return m.jsx(Jo,{title:l.label,placement:"right",children:m.jsxs(Mn,{onClick:()=>a(l),sx:{height:"2.5rem",width:"2.5rem",position:"relative",cursor:"pointer",borderRadius:"0.75rem",transition:"0.3s ease",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:l.value===e?"#616ADA":"transparent",color:"#ffffff","&:hover":{backgroundColor:l.value===e?"white":"#acb1ec"}},children:[l.icon,((c=l.badge_props)==null?void 0:c.badge_count)&&l.badge_props.badge_count>0&&m.jsx(Mn,{sx:{position:"absolute",top:0,right:"4px"},children:m.jsx(Ua,{type:"multi",stroke:!0,count:l.badge_props.badge_count})})]})},l.value)})})}),m.jsx(qe,{alignItems:"center",sx:{gap:"1rem"},children:o.map(l=>m.jsx(Jo,{title:l.label,placement:"right",children:m.jsx(Mn,{onClick:()=>a(l),sx:{padding:"0.85rem 0.85rem",cursor:"pointer",borderRadius:"0.75rem",display:"flex",alignItems:"center",justifyContent:"center",transition:"0.3s ease",backgroundColor:l.value===e||l.value==="home"&&e===""?"#616ADA":"transparent",color:"#ffffff","&:hover":{backgroundColor:l.value===e?"white":"#acb1ec"}},children:l.icon})},l.value))})]})},jh=({tableSx:e,data:t,tableHeaderList:o,rowData:r,onClick:s=()=>{}})=>{const i=kt();return m.jsx(Mf,{component:Vn,sx:{boxShadow:"none",...e},children:m.jsxs(Rf,{stickyHeader:!0,children:[m.jsx(If,{children:m.jsx(Il,{sx:{border:0},children:ds.isArrayWithValues(o)&&o.map(a=>m.jsx(Dl,{sx:{backgroundColor:i.colors.white,border:0,padding:"1rem 1rem 0.5rem 1rem"},align:a.align,children:m.jsx($t,{sx:{color:i.colors.light_text_color},children:a.label})},a.value))})}),m.jsx(kf,{children:ds.isArrayWithValues(t)&&t.map(a=>m.jsx(Il,{onClick:l=>s(l,a),sx:{"&:last-child td, &:last-child th":{border:0},borderBottom:`1px solid ${i.colors.surface_2}`,cursor:"pointer",transition:"0.3s ease","&:hover":{backgroundColor:i.colors.surface_2}},children:o.map(l=>m.jsx(Dl,{component:"th",scope:"row",align:l.align,children:He.cloneElement(r[l.value],{data:a})},l.value))},a.id))})]})})},Nh=({currentPage:e,totalPages:t,onChange:o})=>m.jsx(mf,{count:e,page:t,onChange:o,sx:{"& .MuiPaginationItem-root":{borderRadius:"0.625rem"}}}),t$=({tableSx:e,data:t,tableHeaderList:o,rowData:r,customTableHeader:s,onClick:i=()=>{},pagination:a={flag:!1,currentPage:1,totalPages:1,onChange:()=>{}},sx:l})=>{const c=[{value:"title",label:"Title",align:"left"},{value:"event",label:"Event",align:"left"}],u={title:m.jsx($t,{children:"TITLE"}),event:m.jsx($t,{children:"EVENT"})};return m.jsxs(qe,{sx:{gap:"1rem",...l},children:[s,m.jsx(jh,{tableSx:e,data:t,tableHeaderList:o||c,rowData:r||u,onClick:i}),a.flag&&m.jsx(qe,{direction:"row",justifyContent:"center",children:m.jsx(Nh,{currentPage:a.currentPage,totalPages:a.totalPages,onChange:a.onChange})})]})};at.JweroBadge=Ua,at.JweroCheckbox=$I,at.JweroConfirmationDialog=IE,at.JweroCustomField=GD,at.JweroDataTable=t$,at.JweroDateFilter=dI,at.JweroDialogHeader=jI,at.JweroPagination=Nh,at.JweroPopper=mh,at.JweroPrimaryButton=jl,at.JweroRadio=hh,at.JweroSearchBox=fI,at.JweroSidebar=e$,at.JweroSnackbar=mI,at.JweroStatusChip=wI,at.JweroTable=jh,at.JweroTabs=MI,at.JweroTooltip=DI,at.JweroTypography=$t,at.JweroViewOptions=II,Object.defineProperty(at,Symbol.toStringTag,{value:"Module"})});
|
|
288
288
|
//# sourceMappingURL=index.umd.js.map
|