@ansible/ansible-ui-framework 2.4.416 → 2.4.418
Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
|
|
1
|
-
export declare function useGetPageUrl(): (id: string, params?: Record<string, string>) => string;
|
1
|
+
export declare function useGetPageUrl(): (id: string, params?: Record<string, string | number>) => string;
|
@@ -1 +1 @@
|
|
1
|
-
export declare function usePageNavigate(): (pageId: string, params?: Record<string, string>) => void;
|
1
|
+
export declare function usePageNavigate(): (pageId: string, params?: Record<string, string | number>) => void;
|
package/index.js
CHANGED
@@ -116219,7 +116219,10 @@ function $yt() {
|
|
116219
116219
|
const n = Wyt();
|
116220
116220
|
return (e, t) => {
|
116221
116221
|
const i = n[e];
|
116222
|
-
return i ? t ? Object.keys(t).reduce(
|
116222
|
+
return i ? t ? Object.keys(t).reduce(
|
116223
|
+
(r, o) => r.replace(`:${o}`, (t[o] ?? "").toString()),
|
116224
|
+
i
|
116225
|
+
) : i : "";
|
116223
116226
|
};
|
116224
116227
|
}
|
116225
116228
|
function mSt() {
|
package/index.umd.cjs
CHANGED
@@ -1177,7 +1177,7 @@ ${s}${p}`}else g=`${m}${l}${f.join(" ")}${l}${p}`;return n&&(g+=gg(g,s,c(n)),o&&
|
|
1177
1177
|
flex-grow: 1;
|
1178
1178
|
`,Cmt=qt(P.Toolbar)`
|
1179
1179
|
padding: 0px;
|
1180
|
-
`;function Smt(n){return x.jsxs(P.Masthead,{children:[x.jsx(ise,{}),x.jsx(P.MastheadMain,{children:x.jsx(P.Title,{headingLevel:"h1",style:{fontWeight:"bold",lineHeight:1.2},children:n.title})}),x.jsx(Cmt,{id:"toolbar",children:x.jsxs(P.ToolbarContent,{children:[x.jsx(wmt,{}),E.Children.toArray(n.children).map((e,t)=>x.jsx(P.ToolbarItem,{children:e},t))]})})]})}function ise(){const n=vy();return x.jsx(P.MastheadToggle,{onClick:()=>n.setState({isOpen:!n.isOpen}),children:x.jsx(P.PageToggleButton,{variant:"plain","aria-label":"Global navigation",children:x.jsx(pt.BarsIcon,{})})})}function xmt(n){const{t:e}=Pi(),t=Lr.useNavigate(),{dashboardUrl:i}=n;return React.createElement(P.Page,null,React.createElement(P.EmptyState,{variant:P.EmptyStateVariant.small,style:{paddingTop:48}},React.createElement(P.EmptyStateIcon,{icon:pt.ExclamationCircleIcon}),React.createElement(P.Title,{headingLevel:"h2",size:"lg"},e("We could not find that page")),React.createElement(P.EmptyStateSecondaryActions,null,React.createElement(P.Stack,{hasGutter:!0},React.createElement(P.Button,{onClick:()=>t(-1)},e("Return to previous page")),React.createElement(P.Button,{component:r=>React.createElement(Lr.Link,{to:i,...r})},e("Return to dashboard"))))))}function rse(n){const{navigation:e}=n,t=vy();return x.jsx(P.PageSidebar,{isNavOpen:t.isOpen,nav:x.jsx(P.Nav,{children:x.jsx(P.NavList,{children:x.jsx(mD,{baseRoute:"",items:e})})})})}function mD(n){return x.jsx(x.Fragment,{children:n.items.map((e,t)=>x.jsx(Lmt,{item:e,baseRoute:n.baseRoute},t))})}function Lmt(n){let e;if("id"in n.item)e=n.item.id;else if("children"in n.item){const o=n.item.children.find(s=>s.path==="");o&&"id"in o&&(e=o.id)}const t=ese(),{item:i}=n;let r=n.baseRoute+"/"+i.path;return r=r.replace("//","/"),i.path==="/"&&"children"in i?x.jsx(mD,{items:i.children,baseRoute:""}):"children"in i&&i.children.find(o=>o.label!==void 0)!==void 0?i.label===void 0?x.jsx(x.Fragment,{}):i.label===""?x.jsx(mD,{items:i.children,baseRoute:r}):x.jsx(P.NavExpandable,{title:i.label,isActive:location.pathname.startsWith(r),isExpanded:!0,children:x.jsx(mD,{items:i.children,baseRoute:r})}):"label"in i?x.jsx(P.NavItem,{id:e,isActive:location.pathname.startsWith(r),onClick:()=>t(r),"data-cy":e,children:i.label}):x.jsx(x.Fragment,{})}const ose=E.createContext({});function kmt(){return E.useContext(ose)}function Dmt(n){const e=E.useMemo(()=>sse("",n.navigation),[n.navigation]);return x.jsx(ose.Provider,{value:e,children:n.children})}function sse(n,e){const t={};return e.forEach(i=>{const r=(n+"/"+i.path).replace("//","/");"id"in i&&(t[i.id]=r),"children"in i&&Object.assign(t,sse(r,i.children))}),t}function Emt(n){const{navigation:e,basename:t,header:i}=n,r=E.useMemo(()=>[{path:"",element:x.jsx(tse,{children:x.jsx(Lr.Outlet,{})}),children:[{path:"login",element:n.login},{path:"",element:n.root??x.jsx(x.Fragment,{}),children:[{path:"",element:x.jsx(P.Page,{header:i,sidebar:x.jsx(rse,{navigation:e}),children:x.jsx(nse,{children:x.jsx(Lr.Outlet,{})})}),children:e}]},{path:"*",element:x.jsx(xmt,{})}]}],[i,e,n.login,n.root]),o=E.useMemo(()=>Lr.createBrowserRouter(r,{basename:t}),[t,r]);return x.jsx(Dmt,{navigation:e,children:x.jsx(Lr.RouterProvider,{router:o})})}function Tmt(n){return n.replace(/^\//,"")}function ase(){const n=kmt();return(e,t)=>{const i=n[e];return i?t?Object.keys(t).reduce((r,o)=>r.replace(`:${o}`,t[o]),i):i:""}}function Imt(){const n=Lr.useNavigate(),e=ase();return(t,i)=>{const r=e(t,i);r&&n(r)}}function lse(n){const{loading:e}=n,[t,i]=E.useState((n==null?void 0:n.initialTabIndex)??0),r=E.useCallback((l,c)=>i(c),[i]),o=E.Children.toArray(n.children),s=o.map((l,c)=>{if(E.isValidElement(l)&&l.type===j7){const u=l.props.label;return x.jsx(P.Tab,{title:u||x.jsx(P.Skeleton,{width:"60px"}),eventKey:c},u??c)}return l}),a=o[t];return e?x.jsx(lse,{children:x.jsx(j7,{children:x.jsx(P.PageSection,{variant:"light",children:x.jsx(P.Skeleton,{})})})}):x.jsxs(x.Fragment,{children:[x.jsx(P.PageSection,{type:P.PageSectionTypes.tabs,className:"border-bottom",children:x.jsxs(P.Flex,{spaceItems:{default:"spaceItemsNone"},children:[n.preComponents&&x.jsxs(x.Fragment,{children:[x.jsx(P.FlexItem,{children:n.preComponents}),x.jsx(P.Divider,{orientation:{default:"vertical"},component:"div"})]}),x.jsx(P.FlexItem,{grow:{default:"grow"},children:x.jsx(P.Tabs,{activeKey:t,onSelect:r,inset:n.preComponents?void 0:{default:"insetNone",sm:"insetNone",md:"insetNone",lg:"insetNone",xl:"insetSm","2xl":"insetSm"},hasBorderBottom:!1,children:s})}),n.postComponents&&x.jsxs(x.Fragment,{children:[x.jsx(P.Divider,{orientation:{default:"vertical"}}),x.jsx(P.FlexItem,{style:{paddingRight:16},children:n.postComponents})]})]})}),a]})}function j7(n){return x.jsx(x.Fragment,{children:n.children})}function Amt(n){const{activeKey:e,setActiveKey:t}=n,i=E.useCallback((r,o)=>t(o),[t]);return x.jsx(P.PageSection,{type:P.PageSectionTypes.tabs,style:{flexGrow:1},children:x.jsx(P.Tabs,{activeKey:e,onSelect:i,inset:{default:"insetNone",sm:"insetNone",md:"insetNone",lg:"insetNone",xl:"insetSm","2xl":"insetSm"},children:n.children})})}const Omt=xae`
|
1180
|
+
`;function Smt(n){return x.jsxs(P.Masthead,{children:[x.jsx(ise,{}),x.jsx(P.MastheadMain,{children:x.jsx(P.Title,{headingLevel:"h1",style:{fontWeight:"bold",lineHeight:1.2},children:n.title})}),x.jsx(Cmt,{id:"toolbar",children:x.jsxs(P.ToolbarContent,{children:[x.jsx(wmt,{}),E.Children.toArray(n.children).map((e,t)=>x.jsx(P.ToolbarItem,{children:e},t))]})})]})}function ise(){const n=vy();return x.jsx(P.MastheadToggle,{onClick:()=>n.setState({isOpen:!n.isOpen}),children:x.jsx(P.PageToggleButton,{variant:"plain","aria-label":"Global navigation",children:x.jsx(pt.BarsIcon,{})})})}function xmt(n){const{t:e}=Pi(),t=Lr.useNavigate(),{dashboardUrl:i}=n;return React.createElement(P.Page,null,React.createElement(P.EmptyState,{variant:P.EmptyStateVariant.small,style:{paddingTop:48}},React.createElement(P.EmptyStateIcon,{icon:pt.ExclamationCircleIcon}),React.createElement(P.Title,{headingLevel:"h2",size:"lg"},e("We could not find that page")),React.createElement(P.EmptyStateSecondaryActions,null,React.createElement(P.Stack,{hasGutter:!0},React.createElement(P.Button,{onClick:()=>t(-1)},e("Return to previous page")),React.createElement(P.Button,{component:r=>React.createElement(Lr.Link,{to:i,...r})},e("Return to dashboard"))))))}function rse(n){const{navigation:e}=n,t=vy();return x.jsx(P.PageSidebar,{isNavOpen:t.isOpen,nav:x.jsx(P.Nav,{children:x.jsx(P.NavList,{children:x.jsx(mD,{baseRoute:"",items:e})})})})}function mD(n){return x.jsx(x.Fragment,{children:n.items.map((e,t)=>x.jsx(Lmt,{item:e,baseRoute:n.baseRoute},t))})}function Lmt(n){let e;if("id"in n.item)e=n.item.id;else if("children"in n.item){const o=n.item.children.find(s=>s.path==="");o&&"id"in o&&(e=o.id)}const t=ese(),{item:i}=n;let r=n.baseRoute+"/"+i.path;return r=r.replace("//","/"),i.path==="/"&&"children"in i?x.jsx(mD,{items:i.children,baseRoute:""}):"children"in i&&i.children.find(o=>o.label!==void 0)!==void 0?i.label===void 0?x.jsx(x.Fragment,{}):i.label===""?x.jsx(mD,{items:i.children,baseRoute:r}):x.jsx(P.NavExpandable,{title:i.label,isActive:location.pathname.startsWith(r),isExpanded:!0,children:x.jsx(mD,{items:i.children,baseRoute:r})}):"label"in i?x.jsx(P.NavItem,{id:e,isActive:location.pathname.startsWith(r),onClick:()=>t(r),"data-cy":e,children:i.label}):x.jsx(x.Fragment,{})}const ose=E.createContext({});function kmt(){return E.useContext(ose)}function Dmt(n){const e=E.useMemo(()=>sse("",n.navigation),[n.navigation]);return x.jsx(ose.Provider,{value:e,children:n.children})}function sse(n,e){const t={};return e.forEach(i=>{const r=(n+"/"+i.path).replace("//","/");"id"in i&&(t[i.id]=r),"children"in i&&Object.assign(t,sse(r,i.children))}),t}function Emt(n){const{navigation:e,basename:t,header:i}=n,r=E.useMemo(()=>[{path:"",element:x.jsx(tse,{children:x.jsx(Lr.Outlet,{})}),children:[{path:"login",element:n.login},{path:"",element:n.root??x.jsx(x.Fragment,{}),children:[{path:"",element:x.jsx(P.Page,{header:i,sidebar:x.jsx(rse,{navigation:e}),children:x.jsx(nse,{children:x.jsx(Lr.Outlet,{})})}),children:e}]},{path:"*",element:x.jsx(xmt,{})}]}],[i,e,n.login,n.root]),o=E.useMemo(()=>Lr.createBrowserRouter(r,{basename:t}),[t,r]);return x.jsx(Dmt,{navigation:e,children:x.jsx(Lr.RouterProvider,{router:o})})}function Tmt(n){return n.replace(/^\//,"")}function ase(){const n=kmt();return(e,t)=>{const i=n[e];return i?t?Object.keys(t).reduce((r,o)=>r.replace(`:${o}`,(t[o]??"").toString()),i):i:""}}function Imt(){const n=Lr.useNavigate(),e=ase();return(t,i)=>{const r=e(t,i);r&&n(r)}}function lse(n){const{loading:e}=n,[t,i]=E.useState((n==null?void 0:n.initialTabIndex)??0),r=E.useCallback((l,c)=>i(c),[i]),o=E.Children.toArray(n.children),s=o.map((l,c)=>{if(E.isValidElement(l)&&l.type===j7){const u=l.props.label;return x.jsx(P.Tab,{title:u||x.jsx(P.Skeleton,{width:"60px"}),eventKey:c},u??c)}return l}),a=o[t];return e?x.jsx(lse,{children:x.jsx(j7,{children:x.jsx(P.PageSection,{variant:"light",children:x.jsx(P.Skeleton,{})})})}):x.jsxs(x.Fragment,{children:[x.jsx(P.PageSection,{type:P.PageSectionTypes.tabs,className:"border-bottom",children:x.jsxs(P.Flex,{spaceItems:{default:"spaceItemsNone"},children:[n.preComponents&&x.jsxs(x.Fragment,{children:[x.jsx(P.FlexItem,{children:n.preComponents}),x.jsx(P.Divider,{orientation:{default:"vertical"},component:"div"})]}),x.jsx(P.FlexItem,{grow:{default:"grow"},children:x.jsx(P.Tabs,{activeKey:t,onSelect:r,inset:n.preComponents?void 0:{default:"insetNone",sm:"insetNone",md:"insetNone",lg:"insetNone",xl:"insetSm","2xl":"insetSm"},hasBorderBottom:!1,children:s})}),n.postComponents&&x.jsxs(x.Fragment,{children:[x.jsx(P.Divider,{orientation:{default:"vertical"}}),x.jsx(P.FlexItem,{style:{paddingRight:16},children:n.postComponents})]})]})}),a]})}function j7(n){return x.jsx(x.Fragment,{children:n.children})}function Amt(n){const{activeKey:e,setActiveKey:t}=n,i=E.useCallback((r,o)=>t(o),[t]);return x.jsx(P.PageSection,{type:P.PageSectionTypes.tabs,style:{flexGrow:1},children:x.jsx(P.Tabs,{activeKey:e,onSelect:i,inset:{default:"insetNone",sm:"insetNone",md:"insetNone",lg:"insetNone",xl:"insetSm","2xl":"insetSm"},children:n.children})})}const Omt=xae`
|
1181
1181
|
from {
|
1182
1182
|
transform: rotate(0);
|
1183
1183
|
}
|