@ansible/ansible-ui-framework 2.4.429 → 2.4.431

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,11 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  interface PageNavigationGroup {
3
+ id?: string;
3
4
  label?: string;
4
5
  path: string;
5
6
  children: PageNavigationItem[];
6
7
  }
7
8
  interface PageNavigationComponent {
8
- id: string;
9
+ id?: string;
9
10
  label?: string;
10
11
  path: string;
11
12
  element: JSX.Element;
package/index.js CHANGED
@@ -35775,7 +35775,7 @@ function m5e(e, t, n, r, a) {
35775
35775
  {
35776
35776
  value: bi.Expanded,
35777
35777
  label: i("Expanded"),
35778
- description: i("Show the column when the item is expandedas a detail.")
35778
+ description: i("Show the column when the item is expanded as a detail.")
35779
35779
  },
35780
35780
  {
35781
35781
  value: bi.Hidden,
@@ -43759,7 +43759,7 @@ function A3(e, t) {
43759
43759
  const n = {};
43760
43760
  return t.forEach((r) => {
43761
43761
  const a = (e + "/" + r.path).replace("//", "/");
43762
- "id" in r && (n[r.id] = a), "children" in r && Object.assign(n, A3(a, r.children));
43762
+ "id" in r && typeof r.id == "string" && (n[r.id] = a), "children" in r && Object.assign(n, A3(a, r.children));
43763
43763
  }), n;
43764
43764
  }
43765
43765
  function JAe(e) {
package/index.umd.cjs CHANGED
@@ -377,7 +377,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
377
377
  row-gap: 16px;
378
378
  justify-content: end;
379
379
  }
380
- `;function Nk(e){const{itemCount:t,page:n,perPage:r,setPage:i,setPerPage:a,toolbarFilters:o,selectedItems:l,filterState:s,setFilterState:u,openColumnModal:c,bottomBorder:f,sort:d,setSort:h,sortDirection:g,setSortDirection:p,sortOptions:y,clearAllFilters:_}=e,b=x.useCallback(()=>{_?_():u&&u({})},[u,_]),S=bn("md"),{viewType:O,setViewType:w}=e;let{toolbarActions:A}=e;A=A??[];const T=x.useCallback((D,I)=>i?i(I):null,[i]),k=x.useCallback((D,I)=>a?a(I):null,[a]),j=o!==void 0,N=A!==void 0&&A.length>0,M=e.showSelect===!0||l!==void 0&&A&&A.find(D=>"selection"in D&&D.selection===ot.Multiple);return M||j||N?t===void 0?v.jsx(C.Toolbar,{className:"border-bottom dark-2",style:{paddingBottom:S?void 0:8,paddingTop:S?void 0:8,zIndex:400},children:v.jsx(Fk,{children:v.jsx(C.ToolbarItem,{style:{width:"100%"},children:v.jsx(C.Skeleton,{height:"36px"})})})}):v.jsx(C.Toolbar,{clearAllFilters:b,className:"dark-2 page-table-toolbar",style:{paddingBottom:S?void 0:8,paddingTop:S?void 0:8,borderBottom:f?"thin solid var(--pf-global--BorderColor--100)":void 0},inset:{default:"insetMd",sm:"insetMd",md:"insetMd",lg:"insetMd",xl:"insetLg","2xl":"insetLg"},children:v.jsxs(Fk,{children:[M&&v.jsx(C.ToolbarGroup,{children:v.jsx(C.ToolbarItem,{variant:"bulk-select",children:v.jsx(ik,{...e})})}),s&&u&&v.jsx($k,{toolbarFilters:o,filterState:s,setFilterState:u}),v.jsx(C.ToolbarGroup,{variant:"button-group",children:v.jsx(za,{actions:A,selectedItems:l,wrapper:C.ToolbarItem})}),v.jsxs(Hge,{children:[v.jsx(Wge,{sort:d,setSort:h,sortDirection:g,setSortDirection:p,sortOptions:y}),O&&w&&v.jsx(Uge,{disableTableView:e.disableTableView,disableListView:e.disableListView,disableCardView:e.disableCardView,viewType:O,setViewType:w,openColumnModal:c}),!e.disablePagination&&v.jsx(C.ToolbarItem,{visibility:{default:"hidden","2xl":"visible"},style:{marginLeft:24,alignSelf:"center"},children:v.jsx(C.Pagination,{variant:C.PaginationVariant.top,isCompact:!0,itemCount:t,perPage:r,page:n,onSetPage:T,onPerPageSelect:k,style:{marginTop:-8,marginBottom:-8}})})]})]})}):v.jsx(x.Fragment,{})}function qge(e){const{t}=yt(),n=t("Something went wrong"),r=t("Please refresh the page by using the button below."),i=t("Refresh"),{titleProp:a,message:o}=e;return v.jsxs(C.EmptyState,{variant:C.EmptyStateVariant.small,style:{paddingTop:48},children:[v.jsx(C.EmptyStateIcon,{icon:Ce.ExclamationCircleIcon,color:"var(--pf-global--danger-color--100)"}),v.jsx(C.Title,{headingLevel:"h2",size:"lg",children:a||n}),v.jsx(C.EmptyStateBody,{children:o}),v.jsx(C.EmptyStateBody,{children:r}),v.jsx(C.Button,{variant:"primary",onClick:()=>window.location.reload(),children:i})]})}function Gge(e){const{title:t,description:n,icon:r,button:i,footNote:a,image:o,variant:l,style:s}=e;return v.jsxs(C.EmptyState,{variant:l||C.EmptyStateVariant.full,style:s,children:[r&&v.jsx(C.EmptyStateIcon,{icon:r}),v.jsx(C.Title,{headingLevel:"h4",size:"lg",children:t}),v.jsx(C.EmptyStateBody,{children:n}),i&&v.jsx(C.EmptyStatePrimary,{children:i}),o&&v.jsxs(v.Fragment,{children:[" ",v.jsx("br",{})," ",v.jsx(C.EmptyStateBody,{children:o})]}),a&&v.jsx(C.EmptyStateBody,{children:a})]})}function Yge(e){const{button:t,description:n,title:r,variant:i}=e;return v.jsx(Gge,{icon:t?Ce.PlusCircleIcon:Ce.CubesIcon,title:r,description:n,button:t,variant:i,style:{paddingTop:"48px"}})}function Pv(e,t,n){var r,i,a,o,l;t==null&&(t=100);function s(){var c=Date.now()-o;c<t&&c>=0?r=setTimeout(s,t-c):(r=null,n||(l=e.apply(a,i),a=i=null))}var u=function(){a=this,i=arguments,o=Date.now();var c=n&&!r;return r||(r=setTimeout(s,t)),c&&(l=e.apply(a,i),a=i=null),l};return u.clear=function(){r&&(clearTimeout(r),r=null)},u.flush=function(){r&&(l=e.apply(a,i),a=i=null,clearTimeout(r),r=null)},u}Pv.debounce=Pv;var Kge=Pv;const Zge=Ae(Kge);function Xge(e,t,n){const{selectedItems:r,selectItem:i,unselectItem:a,isSelected:o,selectItems:l,unselectAll:s,allSelected:u}=jv(e,t),{sorted:c,sort:f,setSort:d}=Mv(e),{filtered:h,setFilterFn:g}=Dv(c,t),{searched:p,search:y,setSearch:_,setSearchFn:b}=Jge(h,t,n==null?void 0:n.search),{paged:S,page:O,setPage:w,perPage:A,setPerPage:T}=Ms(p),k=x.useCallback(()=>l(S),[S,l]),j=x.useCallback(()=>l(p),[p,l]);return x.useMemo(()=>({allSelected:u,filtered:h,isSelected:o,page:O,paged:S,perPage:A,search:y,searched:p,selectAll:j,selectItem:i,selectPage:k,selectedItems:r,setFilterFn:g,setPage:w,setPerPage:T,setSearch:_,setSearchFn:b,setSort:d,sort:f,sorted:c,unselectAll:s,unselectItem:a}),[u,h,o,O,S,A,y,p,j,i,k,r,g,w,T,_,b,d,f,c,s,a])}function jv(e,t,n){const[r,i]=x.useState(()=>n?n.reduce((g,p)=>(g[t(p)]=p,g),{}):{});x.useEffect(()=>{i(g=>{let p=!1;return e.forEach(y=>{const _=t(y);g[_]&&g[_]!==y&&(p=!0,g[_]=y)}),p?{...g}:g})},[e,t]);const a=x.useCallback(g=>{i(p=>{const y=t(g);return p[y]!==g&&(p={...p},p[y]=g),p})},[t]),o=x.useCallback(g=>{i(p=>{const y=t(g);return p[y]&&(p={...p},delete p[y]),p})},[t]),l=x.useCallback(g=>{const p=t(g);return r[p]!==void 0},[t,r]),s=x.useCallback(g=>{i(p=>{p={...p};for(const y of g){const _=t(y);p[_]=y}return p})},[t]),u=x.useCallback(()=>s(e),[e,s]),c=x.useCallback(g=>{for(const p of g)o(p)},[o]),f=x.useCallback(()=>{i(g=>Object.keys(g).length>0?{}:g)},[]),d=x.useMemo(()=>Object.values(r),[r]),h=x.useMemo(()=>d.length===e.length,[e.length,d.length]);return x.useMemo(()=>({selectedItems:d,selectItem:a,unselectItem:o,isSelected:l,selectItems:s,selectAll:u,unselectAll:f,allSelected:h,keyFn:t,unselectItems:c}),[h,l,t,u,a,s,d,f,o,c])}function Bk(e,t){const[n,r]=x.useState({});x.useEffect(()=>{r(h=>{let g=!1;const p=e?e.reduce((b,S)=>{const O=t(S);return b[O]=S,h[O]&&h[O]!==S&&(g=!0,h[O]=S),b},{}):{},y={};for(const b in h)p[b]||(y[b]=!0);const _=Object.keys(y);if(_.length){g=!0;for(const b of _)delete h[b]}return g?{...h}:h})},[e,t]);const i=x.useCallback(h=>{r(g=>{const p=t(h);return g[p]!==h&&(g={...g},g[p]=h),g})},[t]),a=x.useCallback(h=>{r(g=>{const p=t(h);return g[p]&&(g={...g},delete g[p]),g})},[t]),o=x.useCallback(h=>{for(const g of h)a(g)},[a]),l=x.useCallback(h=>{const g=t(h);return n[g]!==void 0},[t,n]),s=x.useCallback(h=>{r(g=>{g={...g};for(const p of h){const y=t(p);g[y]=p}return g})},[t]),u=x.useCallback(()=>{s(e??[])},[e,s]),c=x.useCallback(()=>{r(h=>Object.keys(h).length>0?{}:h)},[]),f=x.useMemo(()=>Object.values(n),[n]),d=x.useMemo(()=>f.length===(e==null?void 0:e.length),[e,f.length]);return x.useMemo(()=>({selectedItems:f,selectItem:i,unselectItem:a,isSelected:l,selectItems:s,selectAll:u,unselectAll:c,allSelected:d,keyFn:t,unselectItems:o}),[d,l,t,u,i,s,f,c,a,o])}function Mv(e){const[t,n]=x.useState(),{direction:r,sortFn:i}=t??{},a=x.useMemo(()=>e?i?r==="asc"?[...e.sort(i)]:[...e.sort(i).reverse()]:e:[],[r,e,i]);return x.useMemo(()=>({sorted:a,sort:t,setSort:n}),[t,a])}function Dv(e,t){const n=x.useRef({map:{}}),[r,i]=x.useState(),a=x.useCallback(u=>i(()=>u),[]),[o,l]=x.useState([]);x.useEffect(()=>{n.current.map={}},[r]);const s=x.useCallback(u=>{const c=t(u);let f=n.current.map[c];return f?f.item!==u&&(f.item=u,f.passes=r?r(u):!0):(f={item:u,passes:r?r(u):!0},n.current.map[c]=f),f.passes},[r,t]);return x.useEffect(()=>{l(r?e.filter(s):e)},[e,r,s]),x.useMemo(function(){return{filtered:o,setFilterFn:a}},[o,a])}function Jge(e,t,n){const r=x.useRef({map:{}}),[i,a]=x.useState(),o=x.useCallback(h=>a(()=>h),[]),[l,s]=x.useState([]),[u,c]=x.useState(n??""),f=x.useCallback(Zge(h=>c(h),200),[]);x.useEffect(()=>{r.current.map={}},[u,i]);const d=x.useCallback(h=>{const g=t(h);let p=r.current.map[g];return p?p.item!==h&&(p.item=h,p.score=i?i(h,u):0):(p={item:h,score:i?i(h,u):0},r.current.map[g]=p),p},[t,i,u]);return x.useEffect(()=>{s(i&&u?e.map(d).filter(h=>h.score<.5).sort((h,g)=>h.score-g.score).map(h=>h.item):e)},[u,e,i,d]),x.useMemo(function(){return{searched:l,search:u,setSearch:f,setSearchFn:o}},[l,u,f,o])}function Ms(e){const[t,n]=x.useState([]),[r,i]=x.useState(1),[a,o]=x.useState(10);return x.useEffect(()=>{n(l=>{const s=e.slice((r-1)*a,r*a);if(l.length!==s.length)return s;let u=0;for(const c of s)if(l[u++]!==c)return s;return l})},[r,a,e]),x.useEffect(()=>{r>Math.ceil(e.length/a)&&i(1)},[r,a,e.length]),x.useMemo(()=>({paged:t,page:r,setPage:i,perPage:a,setPerPage:o}),[r,t,a])}const Qwe="",Iv={button:"pf-c-button",modifiers:{hidden:"pf-m-hidden",hiddenOnSm:"pf-m-hidden-on-sm",visibleOnSm:"pf-m-visible-on-sm",hiddenOnMd:"pf-m-hidden-on-md",visibleOnMd:"pf-m-visible-on-md",hiddenOnLg:"pf-m-hidden-on-lg",visibleOnLg:"pf-m-visible-on-lg",hiddenOnXl:"pf-m-hidden-on-xl",visibleOnXl:"pf-m-visible-on-xl",hiddenOn_2xl:"pf-m-hidden-on-2xl",visibleOn_2xl:"pf-m-visible-on-2xl",fixed:"pf-m-fixed",stickyHeader:"pf-m-sticky-header",nestedColumnHeader:"pf-m-nested-column-header",borderRow:"pf-m-border-row",striped:"pf-m-striped",expandable:"pf-m-expandable",stripedEven:"pf-m-striped-even",ghostRow:"pf-m-ghost-row",center:"pf-m-center",help:"pf-m-help",favorite:"pf-m-favorite",borderRight:"pf-m-border-right",borderLeft:"pf-m-border-left",truncate:"pf-m-truncate",wrap:"pf-m-wrap",nowrap:"pf-m-nowrap",fitContent:"pf-m-fit-content",breakWord:"pf-m-break-word",noBorderRows:"pf-m-no-border-rows",expanded:"pf-m-expanded",hoverable:"pf-m-hoverable",selected:"pf-m-selected",firstCellOffsetReset:"pf-m-first-cell-offset-reset",dragOver:"pf-m-drag-over",favorited:"pf-m-favorited",noPadding:"pf-m-no-padding",compact:"pf-m-compact",width_10:"pf-m-width-10",width_15:"pf-m-width-15",width_20:"pf-m-width-20",width_25:"pf-m-width-25",width_30:"pf-m-width-30",width_35:"pf-m-width-35",width_40:"pf-m-width-40",width_45:"pf-m-width-45",width_50:"pf-m-width-50",width_60:"pf-m-width-60",width_70:"pf-m-width-70",width_80:"pf-m-width-80",width_90:"pf-m-width-90",width_100:"pf-m-width-100"},table:"pf-c-table",tableAction:"pf-c-table__action",tableButton:"pf-c-table__button",tableButtonContent:"pf-c-table__button-content",tableCheck:"pf-c-table__check",tableColumnHelp:"pf-c-table__column-help",tableColumnHelpAction:"pf-c-table__column-help-action",tableCompoundExpansionToggle:"pf-c-table__compound-expansion-toggle",tableControlRow:"pf-c-table__control-row",tableDraggable:"pf-c-table__draggable",tableExpandableRow:"pf-c-table__expandable-row",tableExpandableRowContent:"pf-c-table__expandable-row-content",tableFavorite:"pf-c-table__favorite",tableIcon:"pf-c-table__icon",tableIconInline:"pf-c-table__icon-inline",tableInlineEditAction:"pf-c-table__inline-edit-action",tableSort:"pf-c-table__sort",tableSortIndicator:"pf-c-table__sort-indicator",tableSubhead:"pf-c-table__subhead",tableText:"pf-c-table__text",tableToggle:"pf-c-table__toggle",tableToggleIcon:"pf-c-table__toggle-icon",themeDark:"pf-theme-dark"};function Qge(e){const{t}=yt(),{columns:n,keyFn:r,items:i,setItems:a,isSelected:o,selectItem:l,unselectItem:s,allSelected:u,selectAll:c,unselectAll:f,hideColumnHeaders:d,isSelectableWithCheckbox:h}=e,[g,p]=x.useState(null),[y,_]=x.useState(null),[b,S]=x.useState(!1),O=x.useRef(null),w=I=>{if(O.current){const W=O.current.getBoundingClientRect();return I.clientX>W.x&&I.clientX<W.x+W.width&&I.clientY>W.y&&I.clientY<W.y+W.height}return!1},A=I=>{w(I)||T()},T=()=>{O.current&&Array.from(O.current.children).forEach(I=>{I.classList.remove(Iv.modifiers.ghostRow),I.setAttribute("aria-pressed","false")}),_(null),p(null),S(!1)},k=I=>{I.preventDefault();const W=I.target.closest("tr");if(!W||!(O.current&&O.current.contains(W))||W.id===y)return null;{const Z=W.id,ne=Array.from(O.current.children).findIndex(re=>re.id===Z);if(ne!==g&&y){const re=j([...i],y,ne);a(re)}}return null},j=(I,W,Z)=>{const ne=I.findIndex(J=>r(J)===W);if(ne===Z)return I;const re=I.splice(ne,1);return I.splice(Z,0,re[0]),I},N=I=>{w(I)||p(null)},M=I=>{const W=I.target;W.classList.remove(Iv.modifiers.ghostRow),W.setAttribute("aria-pressed","false"),_(null),p(null),S(!1)},E=I=>{if(O.current){I.dataTransfer.effectAllowed="move";const W=I.currentTarget.id,Z=Array.from(O.current.children).findIndex(ne=>ne.id===I.currentTarget.id);I.currentTarget.setAttribute("aria-pressed","true"),_(W),p(Z)}},D=x.useCallback(I=>{const W=i.findIndex(ne=>r(ne)===r(I)),Z=[...i];Z[W]=I,a(Z)},[i,a,r]);return v.jsxs(je.TableComposable,{"aria-label":t("Table with draggable rows"),className:b?Iv.modifiers.dragOver:"",variant:"compact",gridBreakPoint:"",children:[!d&&v.jsx(je.Thead,{children:v.jsxs(je.Tr,{children:[v.jsx(je.Th,{}),h&&v.jsx(je.Th,{select:{onSelect:(I,W)=>{W?c():f()},isSelected:u}}),n.map((I,W)=>v.jsx(je.Th,{children:I.header},W))]})}),v.jsx(je.Tbody,{ref:O,onDragOver:k,onDragLeave:N,children:i.map((I,W)=>{const Z=r(I);return v.jsxs(je.Tr,{id:Z.toString(),draggable:!0,onDrop:A,onDragEnd:M,onDragStart:E,children:[v.jsx(je.Td,{draggableRow:{id:`draggable-row-${Z.toString()}`}}),h&&v.jsx(je.Td,{select:{rowIndex:W,variant:"checkbox",onSelect:(ne,re)=>{re?l(I):s(I)},isSelected:o(I)}}),n.map(ne=>v.jsx(je.Td,{children:ne.cell(I,D)},ne.header))]},Z)})})]})}function epe(e){const[t,n]=vr(),[r]=x.useState(()=>e.keyFn),[i]=x.useState(()=>e.saveFn),[a]=x.useState(()=>e.loadFn),[o,l]=x.useState(()=>{try{const d=localStorage.getItem(e.id);if(typeof d=="string"){const h=JSON.parse(d);if(Array.isArray(h)&&h.every(g=>typeof g=="object")&&h.every(g=>"key"in g&&"enabled"in g))return h}}catch{}}),s=x.useMemo(()=>o?e.items.map(d=>{if(a){const h=o.find(g=>g.key===r(d));h&&h.state&&a(d,h.state)}return d}).sort((d,h)=>{const g=o.findIndex(y=>y.key===r(d)),p=o.findIndex(y=>y.key===r(h));return g===-1&&p===-1?0:g===-1?1:p===-1?-1:g-p}):e.items,[o,r,a,e.items]),u=x.useMemo(()=>o?s.filter(d=>{const h=o.find(g=>g.key===r(d));return h?h.enabled:!0}):s,[s,o,r]),c=x.useCallback((d,h)=>{const g=d.map(p=>({key:r(p),enabled:h.includes(p),state:i?i(p):void 0}));l(g),localStorage.setItem(e.id,JSON.stringify(g))},[r,e.id,i]);return{openManageItems:()=>n(v.jsx(tpe,{...e,keyFn:r,items:s,defaultSelectedItems:u,onApplyChanges:c})),managedItems:u}}function tpe(e){const{t}=yt(),{title:n,description:r,columns:i,onApplyChanges:a}=e,[o]=x.useState(()=>e.keyFn),[l,s]=vr(),u=()=>s(void 0),[c,f]=x.useState(()=>e.items),{selectedItems:d,isSelected:h,selectItem:g,unselectItem:p,allSelected:y,selectAll:_,unselectAll:b}=jv(c,o,e.defaultSelectedItems),S=()=>{a(c,d),s(void 0)};return v.jsxs(C.Modal,{title:n,"aria-label":n,description:v.jsx("div",{style:{marginBottom:16},children:r}),variant:e.variant??C.ModalVariant.medium,isOpen:!0,onClose:u,actions:[v.jsx(C.Button,{variant:"primary",onClick:S,children:t`Apply`},"apply"),v.jsx(C.Button,{variant:"link",onClick:u,children:t`Cancel`},"cancel")],hasNoBodyWrapper:!0,children:[v.jsx(C.Divider,{}),v.jsx(C.ModalBoxBody,{style:{padding:0},children:v.jsx(Qge,{keyFn:o,items:c,setItems:f,columns:i,isSelected:h,selectItem:g,unselectItem:p,allSelected:y,selectAll:_,unselectAll:b,hideColumnHeaders:e.hideColumnHeaders,isSelectableWithCheckbox:e.hideSelection!==!0})}),v.jsx(C.Divider,{})]})}function npe(e,t,n,r,i){const{t:a}=yt(),o=x.useMemo(()=>{const f=[{header:a("Column Name"),cell:d=>d.header}];return n||f.push({header:a("Table View"),cell:(d,h)=>v.jsx(Wi,{value:d.table??"",onSelect:g=>{switch(g){case"":h({...d,table:void 0});break;case Bi.Description:case Bi.Expanded:case Bi.Hidden:h({...d,table:g});break}},placeholder:a("Column"),options:[{value:"",label:a("Column"),description:a("Show the column in the table.")},{value:Bi.Description,label:a("Description"),description:a("Show the column when the item is expanded as a full width description.")},{value:Bi.Expanded,label:a("Expanded"),description:a("Show the column when the item is expandedas a detail.")},{value:Bi.Hidden,label:a("Hidden"),description:a("Hide the column.")}]})}),r||f.push({header:a("List View"),cell:(d,h)=>v.jsx(Wi,{value:d.list??"",onSelect:g=>{switch(g){case"":h({...d,list:void 0});break;case"name":case"subtitle":case"description":case"primary":case"secondary":case"hidden":h({...d,list:g});break}},options:[{value:"name",label:a("Name"),description:a("Show the column as the name of the list item.")},{value:"subtitle",label:a("Subtitle"),description:a("Show the column as the subtitle under the name on the list.")},{value:"description",label:a("Description"),description:a("Show the column as the list item description.")},{value:"",label:a("Left side"),description:a("Show the column on the left side of the list.")},{value:"primary",label:a("Left side"),description:a("Show the column on the left side of the list.")},{value:"secondary",label:a("Right side"),description:a("Show the column on the right side of the list.")},{value:"hidden",label:a("Hidden"),description:a("Hide the column on the list.")}],placeholder:a("Left side")})}),i||f.push({header:a("Card View"),cell:(d,h)=>v.jsx(Wi,{value:d.card??"",onSelect:g=>{switch(g){case"":h({...d,card:void 0});break;case"name":case"subtitle":case"description":case"hidden":h({...d,card:g});break}},placeholder:a("Detail"),options:[{value:"name",label:a("Name"),description:a("Show the column as the name on the card.")},{value:"subtitle",label:a("Subtitle"),description:a("Show the column as the subtitle under the name on the card.")},{value:"description",label:a("Description"),description:a("Show the column as the card description.")},{value:"",label:a("Detail"),description:a("Show the column one of the details on the card.")},{value:"hidden",label:a("Hidden"),description:a("Hide the column on the card.")}]})}),f},[i,r,n,a]),l=x.useCallback((f,d)=>{typeof d=="object"&&d!==null&&("table"in d&&typeof d.table=="string"?f.table=d.table:f.table=void 0,"list"in d&&typeof d.list=="string"?f.list=d.list:f.list=void 0,"card"in d&&typeof d.card=="string"?f.card=d.card:f.card=void 0)},[]),s=x.useCallback(f=>{const{table:d,list:h,card:g}=f;return{table:d,list:h,card:g}},[]),{openManageItems:u,managedItems:c}=epe({id:e,title:a("Manage Columns"),description:a("Manage the order, placement, and format of columns."),items:t,keyFn:f=>f.id??f.header,columns:o,loadFn:l,saveFn:s,hideSelection:!0});return{openColumnManagement:u,managedColumns:c}}function rpe(e){const{setPage:t,setPerPage:n}=e,r=x.useCallback((o,l)=>t(l),[t]),i=x.useCallback((o,l)=>n(l),[n]),a=!bn("md");return v.jsx(C.Pagination,{variant:C.PaginationVariant.bottom,itemCount:e.itemCount,page:e.page,perPage:e.perPage,onSetPage:r,onPerPageSelect:i,style:{...e.style,boxShadow:"none",zIndex:400,paddingTop:a?4:6,paddingBottom:a?4:6,borderTop:e.topBorder?"thin solid var(--pf-global--BorderColor--100)":void 0},className:"dark-2"})}const eOe="";function ipe(e){const t=e.size??350,n=x.useRef(null),[r,i]=x.useState("1fr"),a=x.useCallback(l=>{let s=Math.min(e.maxColumns??12,Math.max(Math.floor(l/t),1));s<1&&(s=1),i(()=>new Array(s).fill("1fr").join(" "))},[e.maxColumns,t]);no(n,l=>a(l.contentRect.width)),x.useLayoutEffect(()=>{var l;a(((l=n.current)==null?void 0:l.clientWidth)??0)},[a]);const o=16;return v.jsx("div",{ref:n,style:{display:"grid",gridAutoRows:"1fr",gridTemplateColumns:r,gap:o},children:e.children})}const ape=Me.small`
380
+ `;function Nk(e){const{itemCount:t,page:n,perPage:r,setPage:i,setPerPage:a,toolbarFilters:o,selectedItems:l,filterState:s,setFilterState:u,openColumnModal:c,bottomBorder:f,sort:d,setSort:h,sortDirection:g,setSortDirection:p,sortOptions:y,clearAllFilters:_}=e,b=x.useCallback(()=>{_?_():u&&u({})},[u,_]),S=bn("md"),{viewType:O,setViewType:w}=e;let{toolbarActions:A}=e;A=A??[];const T=x.useCallback((D,I)=>i?i(I):null,[i]),k=x.useCallback((D,I)=>a?a(I):null,[a]),j=o!==void 0,N=A!==void 0&&A.length>0,M=e.showSelect===!0||l!==void 0&&A&&A.find(D=>"selection"in D&&D.selection===ot.Multiple);return M||j||N?t===void 0?v.jsx(C.Toolbar,{className:"border-bottom dark-2",style:{paddingBottom:S?void 0:8,paddingTop:S?void 0:8,zIndex:400},children:v.jsx(Fk,{children:v.jsx(C.ToolbarItem,{style:{width:"100%"},children:v.jsx(C.Skeleton,{height:"36px"})})})}):v.jsx(C.Toolbar,{clearAllFilters:b,className:"dark-2 page-table-toolbar",style:{paddingBottom:S?void 0:8,paddingTop:S?void 0:8,borderBottom:f?"thin solid var(--pf-global--BorderColor--100)":void 0},inset:{default:"insetMd",sm:"insetMd",md:"insetMd",lg:"insetMd",xl:"insetLg","2xl":"insetLg"},children:v.jsxs(Fk,{children:[M&&v.jsx(C.ToolbarGroup,{children:v.jsx(C.ToolbarItem,{variant:"bulk-select",children:v.jsx(ik,{...e})})}),s&&u&&v.jsx($k,{toolbarFilters:o,filterState:s,setFilterState:u}),v.jsx(C.ToolbarGroup,{variant:"button-group",children:v.jsx(za,{actions:A,selectedItems:l,wrapper:C.ToolbarItem})}),v.jsxs(Hge,{children:[v.jsx(Wge,{sort:d,setSort:h,sortDirection:g,setSortDirection:p,sortOptions:y}),O&&w&&v.jsx(Uge,{disableTableView:e.disableTableView,disableListView:e.disableListView,disableCardView:e.disableCardView,viewType:O,setViewType:w,openColumnModal:c}),!e.disablePagination&&v.jsx(C.ToolbarItem,{visibility:{default:"hidden","2xl":"visible"},style:{marginLeft:24,alignSelf:"center"},children:v.jsx(C.Pagination,{variant:C.PaginationVariant.top,isCompact:!0,itemCount:t,perPage:r,page:n,onSetPage:T,onPerPageSelect:k,style:{marginTop:-8,marginBottom:-8}})})]})]})}):v.jsx(x.Fragment,{})}function qge(e){const{t}=yt(),n=t("Something went wrong"),r=t("Please refresh the page by using the button below."),i=t("Refresh"),{titleProp:a,message:o}=e;return v.jsxs(C.EmptyState,{variant:C.EmptyStateVariant.small,style:{paddingTop:48},children:[v.jsx(C.EmptyStateIcon,{icon:Ce.ExclamationCircleIcon,color:"var(--pf-global--danger-color--100)"}),v.jsx(C.Title,{headingLevel:"h2",size:"lg",children:a||n}),v.jsx(C.EmptyStateBody,{children:o}),v.jsx(C.EmptyStateBody,{children:r}),v.jsx(C.Button,{variant:"primary",onClick:()=>window.location.reload(),children:i})]})}function Gge(e){const{title:t,description:n,icon:r,button:i,footNote:a,image:o,variant:l,style:s}=e;return v.jsxs(C.EmptyState,{variant:l||C.EmptyStateVariant.full,style:s,children:[r&&v.jsx(C.EmptyStateIcon,{icon:r}),v.jsx(C.Title,{headingLevel:"h4",size:"lg",children:t}),v.jsx(C.EmptyStateBody,{children:n}),i&&v.jsx(C.EmptyStatePrimary,{children:i}),o&&v.jsxs(v.Fragment,{children:[" ",v.jsx("br",{})," ",v.jsx(C.EmptyStateBody,{children:o})]}),a&&v.jsx(C.EmptyStateBody,{children:a})]})}function Yge(e){const{button:t,description:n,title:r,variant:i}=e;return v.jsx(Gge,{icon:t?Ce.PlusCircleIcon:Ce.CubesIcon,title:r,description:n,button:t,variant:i,style:{paddingTop:"48px"}})}function Pv(e,t,n){var r,i,a,o,l;t==null&&(t=100);function s(){var c=Date.now()-o;c<t&&c>=0?r=setTimeout(s,t-c):(r=null,n||(l=e.apply(a,i),a=i=null))}var u=function(){a=this,i=arguments,o=Date.now();var c=n&&!r;return r||(r=setTimeout(s,t)),c&&(l=e.apply(a,i),a=i=null),l};return u.clear=function(){r&&(clearTimeout(r),r=null)},u.flush=function(){r&&(l=e.apply(a,i),a=i=null,clearTimeout(r),r=null)},u}Pv.debounce=Pv;var Kge=Pv;const Zge=Ae(Kge);function Xge(e,t,n){const{selectedItems:r,selectItem:i,unselectItem:a,isSelected:o,selectItems:l,unselectAll:s,allSelected:u}=jv(e,t),{sorted:c,sort:f,setSort:d}=Mv(e),{filtered:h,setFilterFn:g}=Dv(c,t),{searched:p,search:y,setSearch:_,setSearchFn:b}=Jge(h,t,n==null?void 0:n.search),{paged:S,page:O,setPage:w,perPage:A,setPerPage:T}=Ms(p),k=x.useCallback(()=>l(S),[S,l]),j=x.useCallback(()=>l(p),[p,l]);return x.useMemo(()=>({allSelected:u,filtered:h,isSelected:o,page:O,paged:S,perPage:A,search:y,searched:p,selectAll:j,selectItem:i,selectPage:k,selectedItems:r,setFilterFn:g,setPage:w,setPerPage:T,setSearch:_,setSearchFn:b,setSort:d,sort:f,sorted:c,unselectAll:s,unselectItem:a}),[u,h,o,O,S,A,y,p,j,i,k,r,g,w,T,_,b,d,f,c,s,a])}function jv(e,t,n){const[r,i]=x.useState(()=>n?n.reduce((g,p)=>(g[t(p)]=p,g),{}):{});x.useEffect(()=>{i(g=>{let p=!1;return e.forEach(y=>{const _=t(y);g[_]&&g[_]!==y&&(p=!0,g[_]=y)}),p?{...g}:g})},[e,t]);const a=x.useCallback(g=>{i(p=>{const y=t(g);return p[y]!==g&&(p={...p},p[y]=g),p})},[t]),o=x.useCallback(g=>{i(p=>{const y=t(g);return p[y]&&(p={...p},delete p[y]),p})},[t]),l=x.useCallback(g=>{const p=t(g);return r[p]!==void 0},[t,r]),s=x.useCallback(g=>{i(p=>{p={...p};for(const y of g){const _=t(y);p[_]=y}return p})},[t]),u=x.useCallback(()=>s(e),[e,s]),c=x.useCallback(g=>{for(const p of g)o(p)},[o]),f=x.useCallback(()=>{i(g=>Object.keys(g).length>0?{}:g)},[]),d=x.useMemo(()=>Object.values(r),[r]),h=x.useMemo(()=>d.length===e.length,[e.length,d.length]);return x.useMemo(()=>({selectedItems:d,selectItem:a,unselectItem:o,isSelected:l,selectItems:s,selectAll:u,unselectAll:f,allSelected:h,keyFn:t,unselectItems:c}),[h,l,t,u,a,s,d,f,o,c])}function Bk(e,t){const[n,r]=x.useState({});x.useEffect(()=>{r(h=>{let g=!1;const p=e?e.reduce((b,S)=>{const O=t(S);return b[O]=S,h[O]&&h[O]!==S&&(g=!0,h[O]=S),b},{}):{},y={};for(const b in h)p[b]||(y[b]=!0);const _=Object.keys(y);if(_.length){g=!0;for(const b of _)delete h[b]}return g?{...h}:h})},[e,t]);const i=x.useCallback(h=>{r(g=>{const p=t(h);return g[p]!==h&&(g={...g},g[p]=h),g})},[t]),a=x.useCallback(h=>{r(g=>{const p=t(h);return g[p]&&(g={...g},delete g[p]),g})},[t]),o=x.useCallback(h=>{for(const g of h)a(g)},[a]),l=x.useCallback(h=>{const g=t(h);return n[g]!==void 0},[t,n]),s=x.useCallback(h=>{r(g=>{g={...g};for(const p of h){const y=t(p);g[y]=p}return g})},[t]),u=x.useCallback(()=>{s(e??[])},[e,s]),c=x.useCallback(()=>{r(h=>Object.keys(h).length>0?{}:h)},[]),f=x.useMemo(()=>Object.values(n),[n]),d=x.useMemo(()=>f.length===(e==null?void 0:e.length),[e,f.length]);return x.useMemo(()=>({selectedItems:f,selectItem:i,unselectItem:a,isSelected:l,selectItems:s,selectAll:u,unselectAll:c,allSelected:d,keyFn:t,unselectItems:o}),[d,l,t,u,i,s,f,c,a,o])}function Mv(e){const[t,n]=x.useState(),{direction:r,sortFn:i}=t??{},a=x.useMemo(()=>e?i?r==="asc"?[...e.sort(i)]:[...e.sort(i).reverse()]:e:[],[r,e,i]);return x.useMemo(()=>({sorted:a,sort:t,setSort:n}),[t,a])}function Dv(e,t){const n=x.useRef({map:{}}),[r,i]=x.useState(),a=x.useCallback(u=>i(()=>u),[]),[o,l]=x.useState([]);x.useEffect(()=>{n.current.map={}},[r]);const s=x.useCallback(u=>{const c=t(u);let f=n.current.map[c];return f?f.item!==u&&(f.item=u,f.passes=r?r(u):!0):(f={item:u,passes:r?r(u):!0},n.current.map[c]=f),f.passes},[r,t]);return x.useEffect(()=>{l(r?e.filter(s):e)},[e,r,s]),x.useMemo(function(){return{filtered:o,setFilterFn:a}},[o,a])}function Jge(e,t,n){const r=x.useRef({map:{}}),[i,a]=x.useState(),o=x.useCallback(h=>a(()=>h),[]),[l,s]=x.useState([]),[u,c]=x.useState(n??""),f=x.useCallback(Zge(h=>c(h),200),[]);x.useEffect(()=>{r.current.map={}},[u,i]);const d=x.useCallback(h=>{const g=t(h);let p=r.current.map[g];return p?p.item!==h&&(p.item=h,p.score=i?i(h,u):0):(p={item:h,score:i?i(h,u):0},r.current.map[g]=p),p},[t,i,u]);return x.useEffect(()=>{s(i&&u?e.map(d).filter(h=>h.score<.5).sort((h,g)=>h.score-g.score).map(h=>h.item):e)},[u,e,i,d]),x.useMemo(function(){return{searched:l,search:u,setSearch:f,setSearchFn:o}},[l,u,f,o])}function Ms(e){const[t,n]=x.useState([]),[r,i]=x.useState(1),[a,o]=x.useState(10);return x.useEffect(()=>{n(l=>{const s=e.slice((r-1)*a,r*a);if(l.length!==s.length)return s;let u=0;for(const c of s)if(l[u++]!==c)return s;return l})},[r,a,e]),x.useEffect(()=>{r>Math.ceil(e.length/a)&&i(1)},[r,a,e.length]),x.useMemo(()=>({paged:t,page:r,setPage:i,perPage:a,setPerPage:o}),[r,t,a])}const Qwe="",Iv={button:"pf-c-button",modifiers:{hidden:"pf-m-hidden",hiddenOnSm:"pf-m-hidden-on-sm",visibleOnSm:"pf-m-visible-on-sm",hiddenOnMd:"pf-m-hidden-on-md",visibleOnMd:"pf-m-visible-on-md",hiddenOnLg:"pf-m-hidden-on-lg",visibleOnLg:"pf-m-visible-on-lg",hiddenOnXl:"pf-m-hidden-on-xl",visibleOnXl:"pf-m-visible-on-xl",hiddenOn_2xl:"pf-m-hidden-on-2xl",visibleOn_2xl:"pf-m-visible-on-2xl",fixed:"pf-m-fixed",stickyHeader:"pf-m-sticky-header",nestedColumnHeader:"pf-m-nested-column-header",borderRow:"pf-m-border-row",striped:"pf-m-striped",expandable:"pf-m-expandable",stripedEven:"pf-m-striped-even",ghostRow:"pf-m-ghost-row",center:"pf-m-center",help:"pf-m-help",favorite:"pf-m-favorite",borderRight:"pf-m-border-right",borderLeft:"pf-m-border-left",truncate:"pf-m-truncate",wrap:"pf-m-wrap",nowrap:"pf-m-nowrap",fitContent:"pf-m-fit-content",breakWord:"pf-m-break-word",noBorderRows:"pf-m-no-border-rows",expanded:"pf-m-expanded",hoverable:"pf-m-hoverable",selected:"pf-m-selected",firstCellOffsetReset:"pf-m-first-cell-offset-reset",dragOver:"pf-m-drag-over",favorited:"pf-m-favorited",noPadding:"pf-m-no-padding",compact:"pf-m-compact",width_10:"pf-m-width-10",width_15:"pf-m-width-15",width_20:"pf-m-width-20",width_25:"pf-m-width-25",width_30:"pf-m-width-30",width_35:"pf-m-width-35",width_40:"pf-m-width-40",width_45:"pf-m-width-45",width_50:"pf-m-width-50",width_60:"pf-m-width-60",width_70:"pf-m-width-70",width_80:"pf-m-width-80",width_90:"pf-m-width-90",width_100:"pf-m-width-100"},table:"pf-c-table",tableAction:"pf-c-table__action",tableButton:"pf-c-table__button",tableButtonContent:"pf-c-table__button-content",tableCheck:"pf-c-table__check",tableColumnHelp:"pf-c-table__column-help",tableColumnHelpAction:"pf-c-table__column-help-action",tableCompoundExpansionToggle:"pf-c-table__compound-expansion-toggle",tableControlRow:"pf-c-table__control-row",tableDraggable:"pf-c-table__draggable",tableExpandableRow:"pf-c-table__expandable-row",tableExpandableRowContent:"pf-c-table__expandable-row-content",tableFavorite:"pf-c-table__favorite",tableIcon:"pf-c-table__icon",tableIconInline:"pf-c-table__icon-inline",tableInlineEditAction:"pf-c-table__inline-edit-action",tableSort:"pf-c-table__sort",tableSortIndicator:"pf-c-table__sort-indicator",tableSubhead:"pf-c-table__subhead",tableText:"pf-c-table__text",tableToggle:"pf-c-table__toggle",tableToggleIcon:"pf-c-table__toggle-icon",themeDark:"pf-theme-dark"};function Qge(e){const{t}=yt(),{columns:n,keyFn:r,items:i,setItems:a,isSelected:o,selectItem:l,unselectItem:s,allSelected:u,selectAll:c,unselectAll:f,hideColumnHeaders:d,isSelectableWithCheckbox:h}=e,[g,p]=x.useState(null),[y,_]=x.useState(null),[b,S]=x.useState(!1),O=x.useRef(null),w=I=>{if(O.current){const W=O.current.getBoundingClientRect();return I.clientX>W.x&&I.clientX<W.x+W.width&&I.clientY>W.y&&I.clientY<W.y+W.height}return!1},A=I=>{w(I)||T()},T=()=>{O.current&&Array.from(O.current.children).forEach(I=>{I.classList.remove(Iv.modifiers.ghostRow),I.setAttribute("aria-pressed","false")}),_(null),p(null),S(!1)},k=I=>{I.preventDefault();const W=I.target.closest("tr");if(!W||!(O.current&&O.current.contains(W))||W.id===y)return null;{const Z=W.id,ne=Array.from(O.current.children).findIndex(re=>re.id===Z);if(ne!==g&&y){const re=j([...i],y,ne);a(re)}}return null},j=(I,W,Z)=>{const ne=I.findIndex(J=>r(J)===W);if(ne===Z)return I;const re=I.splice(ne,1);return I.splice(Z,0,re[0]),I},N=I=>{w(I)||p(null)},M=I=>{const W=I.target;W.classList.remove(Iv.modifiers.ghostRow),W.setAttribute("aria-pressed","false"),_(null),p(null),S(!1)},E=I=>{if(O.current){I.dataTransfer.effectAllowed="move";const W=I.currentTarget.id,Z=Array.from(O.current.children).findIndex(ne=>ne.id===I.currentTarget.id);I.currentTarget.setAttribute("aria-pressed","true"),_(W),p(Z)}},D=x.useCallback(I=>{const W=i.findIndex(ne=>r(ne)===r(I)),Z=[...i];Z[W]=I,a(Z)},[i,a,r]);return v.jsxs(je.TableComposable,{"aria-label":t("Table with draggable rows"),className:b?Iv.modifiers.dragOver:"",variant:"compact",gridBreakPoint:"",children:[!d&&v.jsx(je.Thead,{children:v.jsxs(je.Tr,{children:[v.jsx(je.Th,{}),h&&v.jsx(je.Th,{select:{onSelect:(I,W)=>{W?c():f()},isSelected:u}}),n.map((I,W)=>v.jsx(je.Th,{children:I.header},W))]})}),v.jsx(je.Tbody,{ref:O,onDragOver:k,onDragLeave:N,children:i.map((I,W)=>{const Z=r(I);return v.jsxs(je.Tr,{id:Z.toString(),draggable:!0,onDrop:A,onDragEnd:M,onDragStart:E,children:[v.jsx(je.Td,{draggableRow:{id:`draggable-row-${Z.toString()}`}}),h&&v.jsx(je.Td,{select:{rowIndex:W,variant:"checkbox",onSelect:(ne,re)=>{re?l(I):s(I)},isSelected:o(I)}}),n.map(ne=>v.jsx(je.Td,{children:ne.cell(I,D)},ne.header))]},Z)})})]})}function epe(e){const[t,n]=vr(),[r]=x.useState(()=>e.keyFn),[i]=x.useState(()=>e.saveFn),[a]=x.useState(()=>e.loadFn),[o,l]=x.useState(()=>{try{const d=localStorage.getItem(e.id);if(typeof d=="string"){const h=JSON.parse(d);if(Array.isArray(h)&&h.every(g=>typeof g=="object")&&h.every(g=>"key"in g&&"enabled"in g))return h}}catch{}}),s=x.useMemo(()=>o?e.items.map(d=>{if(a){const h=o.find(g=>g.key===r(d));h&&h.state&&a(d,h.state)}return d}).sort((d,h)=>{const g=o.findIndex(y=>y.key===r(d)),p=o.findIndex(y=>y.key===r(h));return g===-1&&p===-1?0:g===-1?1:p===-1?-1:g-p}):e.items,[o,r,a,e.items]),u=x.useMemo(()=>o?s.filter(d=>{const h=o.find(g=>g.key===r(d));return h?h.enabled:!0}):s,[s,o,r]),c=x.useCallback((d,h)=>{const g=d.map(p=>({key:r(p),enabled:h.includes(p),state:i?i(p):void 0}));l(g),localStorage.setItem(e.id,JSON.stringify(g))},[r,e.id,i]);return{openManageItems:()=>n(v.jsx(tpe,{...e,keyFn:r,items:s,defaultSelectedItems:u,onApplyChanges:c})),managedItems:u}}function tpe(e){const{t}=yt(),{title:n,description:r,columns:i,onApplyChanges:a}=e,[o]=x.useState(()=>e.keyFn),[l,s]=vr(),u=()=>s(void 0),[c,f]=x.useState(()=>e.items),{selectedItems:d,isSelected:h,selectItem:g,unselectItem:p,allSelected:y,selectAll:_,unselectAll:b}=jv(c,o,e.defaultSelectedItems),S=()=>{a(c,d),s(void 0)};return v.jsxs(C.Modal,{title:n,"aria-label":n,description:v.jsx("div",{style:{marginBottom:16},children:r}),variant:e.variant??C.ModalVariant.medium,isOpen:!0,onClose:u,actions:[v.jsx(C.Button,{variant:"primary",onClick:S,children:t`Apply`},"apply"),v.jsx(C.Button,{variant:"link",onClick:u,children:t`Cancel`},"cancel")],hasNoBodyWrapper:!0,children:[v.jsx(C.Divider,{}),v.jsx(C.ModalBoxBody,{style:{padding:0},children:v.jsx(Qge,{keyFn:o,items:c,setItems:f,columns:i,isSelected:h,selectItem:g,unselectItem:p,allSelected:y,selectAll:_,unselectAll:b,hideColumnHeaders:e.hideColumnHeaders,isSelectableWithCheckbox:e.hideSelection!==!0})}),v.jsx(C.Divider,{})]})}function npe(e,t,n,r,i){const{t:a}=yt(),o=x.useMemo(()=>{const f=[{header:a("Column Name"),cell:d=>d.header}];return n||f.push({header:a("Table View"),cell:(d,h)=>v.jsx(Wi,{value:d.table??"",onSelect:g=>{switch(g){case"":h({...d,table:void 0});break;case Bi.Description:case Bi.Expanded:case Bi.Hidden:h({...d,table:g});break}},placeholder:a("Column"),options:[{value:"",label:a("Column"),description:a("Show the column in the table.")},{value:Bi.Description,label:a("Description"),description:a("Show the column when the item is expanded as a full width description.")},{value:Bi.Expanded,label:a("Expanded"),description:a("Show the column when the item is expanded as a detail.")},{value:Bi.Hidden,label:a("Hidden"),description:a("Hide the column.")}]})}),r||f.push({header:a("List View"),cell:(d,h)=>v.jsx(Wi,{value:d.list??"",onSelect:g=>{switch(g){case"":h({...d,list:void 0});break;case"name":case"subtitle":case"description":case"primary":case"secondary":case"hidden":h({...d,list:g});break}},options:[{value:"name",label:a("Name"),description:a("Show the column as the name of the list item.")},{value:"subtitle",label:a("Subtitle"),description:a("Show the column as the subtitle under the name on the list.")},{value:"description",label:a("Description"),description:a("Show the column as the list item description.")},{value:"",label:a("Left side"),description:a("Show the column on the left side of the list.")},{value:"primary",label:a("Left side"),description:a("Show the column on the left side of the list.")},{value:"secondary",label:a("Right side"),description:a("Show the column on the right side of the list.")},{value:"hidden",label:a("Hidden"),description:a("Hide the column on the list.")}],placeholder:a("Left side")})}),i||f.push({header:a("Card View"),cell:(d,h)=>v.jsx(Wi,{value:d.card??"",onSelect:g=>{switch(g){case"":h({...d,card:void 0});break;case"name":case"subtitle":case"description":case"hidden":h({...d,card:g});break}},placeholder:a("Detail"),options:[{value:"name",label:a("Name"),description:a("Show the column as the name on the card.")},{value:"subtitle",label:a("Subtitle"),description:a("Show the column as the subtitle under the name on the card.")},{value:"description",label:a("Description"),description:a("Show the column as the card description.")},{value:"",label:a("Detail"),description:a("Show the column one of the details on the card.")},{value:"hidden",label:a("Hidden"),description:a("Hide the column on the card.")}]})}),f},[i,r,n,a]),l=x.useCallback((f,d)=>{typeof d=="object"&&d!==null&&("table"in d&&typeof d.table=="string"?f.table=d.table:f.table=void 0,"list"in d&&typeof d.list=="string"?f.list=d.list:f.list=void 0,"card"in d&&typeof d.card=="string"?f.card=d.card:f.card=void 0)},[]),s=x.useCallback(f=>{const{table:d,list:h,card:g}=f;return{table:d,list:h,card:g}},[]),{openManageItems:u,managedItems:c}=epe({id:e,title:a("Manage Columns"),description:a("Manage the order, placement, and format of columns."),items:t,keyFn:f=>f.id??f.header,columns:o,loadFn:l,saveFn:s,hideSelection:!0});return{openColumnManagement:u,managedColumns:c}}function rpe(e){const{setPage:t,setPerPage:n}=e,r=x.useCallback((o,l)=>t(l),[t]),i=x.useCallback((o,l)=>n(l),[n]),a=!bn("md");return v.jsx(C.Pagination,{variant:C.PaginationVariant.bottom,itemCount:e.itemCount,page:e.page,perPage:e.perPage,onSetPage:r,onPerPageSelect:i,style:{...e.style,boxShadow:"none",zIndex:400,paddingTop:a?4:6,paddingBottom:a?4:6,borderTop:e.topBorder?"thin solid var(--pf-global--BorderColor--100)":void 0},className:"dark-2"})}const eOe="";function ipe(e){const t=e.size??350,n=x.useRef(null),[r,i]=x.useState("1fr"),a=x.useCallback(l=>{let s=Math.min(e.maxColumns??12,Math.max(Math.floor(l/t),1));s<1&&(s=1),i(()=>new Array(s).fill("1fr").join(" "))},[e.maxColumns,t]);no(n,l=>a(l.contentRect.width)),x.useLayoutEffect(()=>{var l;a(((l=n.current)==null?void 0:l.clientWidth)??0)},[a]);const o=16;return v.jsx("div",{ref:n,style:{display:"grid",gridAutoRows:"1fr",gridTemplateColumns:r,gap:o},children:e.children})}const ape=Me.small`
381
381
  opacity: 0.7;
382
382
  `,ope=Me.div`
383
383
  display: flex;
@@ -533,7 +533,7 @@ ${o}${y}`}else g=`${p}${s}${h.join(" ")}${s}${y}`;return e&&(g+=Ia(g,o,u(e)),a&&
533
533
  flex-grow: 1;
534
534
  `,Dxe=Me(C.Toolbar)`
535
535
  padding: 0px;
536
- `;function Ixe(e){return v.jsxs(C.Masthead,{children:[v.jsx(dP,{}),v.jsx(C.MastheadMain,{children:v.jsx(C.Title,{headingLevel:"h1",style:{fontWeight:"bold",lineHeight:1.2},children:e.title})}),v.jsx(Dxe,{id:"toolbar",children:v.jsxs(C.ToolbarContent,{children:[v.jsx(Mxe,{}),x.Children.toArray(e.children).map((t,n)=>v.jsx(C.ToolbarItem,{children:t},n))]})})]})}function dP(){const e=Js();return v.jsx(C.MastheadToggle,{onClick:()=>e.setState({isOpen:!e.isOpen}),children:v.jsx(C.PageToggleButton,{variant:"plain","aria-label":"Global navigation",children:v.jsx(Ce.BarsIcon,{})})})}function $xe(e){const{t}=yt(),n=Rt.useNavigate(),{dashboardUrl:r}=e;return React.createElement(C.Page,null,React.createElement(C.EmptyState,{variant:C.EmptyStateVariant.small,style:{paddingTop:48}},React.createElement(C.EmptyStateIcon,{icon:Ce.ExclamationCircleIcon}),React.createElement(C.Title,{headingLevel:"h2",size:"lg"},t("We could not find that page")),React.createElement(C.EmptyStateSecondaryActions,null,React.createElement(C.Stack,{hasGutter:!0},React.createElement(C.Button,{onClick:()=>n(-1)},t("Return to previous page")),React.createElement(C.Button,{component:i=>React.createElement(Rt.Link,{to:r,...i})},t("Return to dashboard"))))))}function hP(e){const{navigation:t}=e,n=Js();return v.jsx(C.PageSidebar,{isNavOpen:n.isOpen,nav:v.jsx(C.Nav,{children:v.jsx(C.NavList,{children:v.jsx(Jd,{baseRoute:"",items:t})})})})}function Jd(e){return v.jsx(v.Fragment,{children:e.items.map((t,n)=>v.jsx(Lxe,{item:t,baseRoute:e.baseRoute},n))})}function Lxe(e){let t;if("id"in e.item)t=e.item.id;else if("children"in e.item){const a=e.item.children.find(o=>o.path==="");a&&"id"in a&&(t=a.id)}const n=uP(),{item:r}=e;let i=e.baseRoute+"/"+r.path;return i=i.replace("//","/"),r.path==="/"&&"children"in r?v.jsx(Jd,{items:r.children,baseRoute:""}):"children"in r&&r.children.find(a=>a.label!==void 0)!==void 0?r.label===void 0?v.jsx(v.Fragment,{}):r.label===""?v.jsx(Jd,{items:r.children,baseRoute:i}):v.jsx(C.NavExpandable,{title:r.label,isActive:location.pathname.startsWith(i),isExpanded:!0,children:v.jsx(Jd,{items:r.children,baseRoute:i})}):"label"in r?v.jsx(C.NavItem,{id:t,isActive:location.pathname.startsWith(i),onClick:()=>n(i),"data-cy":t,children:r.label}):v.jsx(v.Fragment,{})}const mP=x.createContext({});function Fxe(){return x.useContext(mP)}function Nxe(e){const t=x.useMemo(()=>gP("",e.navigation),[e.navigation]);return v.jsx(mP.Provider,{value:t,children:e.children})}function gP(e,t){const n={};return t.forEach(r=>{const i=(e+"/"+r.path).replace("//","/");"id"in r&&(n[r.id]=i),"children"in r&&Object.assign(n,gP(i,r.children))}),n}function Bxe(e){const{navigation:t,basename:n,header:r}=e,i=x.useMemo(()=>[{path:"",element:v.jsx(cP,{children:v.jsx(Rt.Outlet,{})}),children:[{path:"login",element:e.login},{path:"",element:e.root??v.jsx(v.Fragment,{}),children:[{path:"",element:v.jsx(C.Page,{header:r,sidebar:v.jsx(hP,{navigation:t}),children:v.jsx(fP,{children:v.jsx(Rt.Outlet,{})})}),children:t}]},{path:"*",element:v.jsx($xe,{})}]}],[r,t,e.login,e.root]),a=x.useMemo(()=>Rt.createBrowserRouter(i,{basename:n}),[n,i]);return v.jsx(Nxe,{navigation:t,children:v.jsx(Rt.RouterProvider,{router:a})})}function Rxe(e){return e.replace(/^\//,"")}function pP(e,t){for(const n of e){if("id"in n&&n.id===t)return n;if("children"in n){const r=pP(n.children,t);if(r)return r}}}function vP(e,t){for(let n=0;n<e.length;n++){const r=e[n];if("id"in r&&r.id===t)return e.splice(n,1),r;if("children"in r){const i=vP(r.children,t);if(i)return i}}}function yP(e,t,n){for(const r of e)if("id"in r&&r.id===t){const i=r;"children"in r||(i.children=[]),i.children.push(n);return}else"children"in r&&yP(r.children,t,n)}function bP(e,t,n){for(let r=0;r<e.length;r++){const i=e[r];if("id"in i&&i.id===t){e.splice(r+1,0,n);return}else"children"in i&&bP(i.children,t,n)}}function _P(e,t,n){for(let r=0;r<e.length;r++){const i=e[r];if("id"in i&&i.id===t){e.splice(r,0,n);return}else"children"in i&&_P(i.children,t,n)}}function xP(){const e=Fxe();return(t,n)=>{let r=e[t]??"";const i=n==null?void 0:n.params,a=n==null?void 0:n.query;return r?(i&&(r=Object.keys(i).reduce((o,l)=>o.replace(`:${l}`,(i[l]??"").toString()),r)),a&&(r=`${r}?${Object.keys(a).map(o=>`${o}=${a[o]}`).join("&")}`)):console.error(`Page id ${t} not found`),r}}function Wxe(){const e=Rt.useNavigate(),t=xP();return(n,r)=>{const i=t(n,r);i&&e(i)}}function SP(e){const{loading:t}=e,[n,r]=x.useState((e==null?void 0:e.initialTabIndex)??0),i=x.useCallback((s,u)=>r(u),[r]),a=x.Children.toArray(e.children),o=a.map((s,u)=>{if(x.isValidElement(s)&&s.type===Py){const c=s.props.label;return v.jsx(C.Tab,{title:c||v.jsx(C.Skeleton,{width:"60px"}),eventKey:u},c??u)}return s}),l=a[n];return t?v.jsx(SP,{children:v.jsx(Py,{children:v.jsx(C.PageSection,{variant:"light",children:v.jsx(C.Skeleton,{})})})}):v.jsxs(v.Fragment,{children:[v.jsx(C.PageSection,{type:C.PageSectionTypes.tabs,className:"border-bottom",children:v.jsxs(C.Flex,{spaceItems:{default:"spaceItemsNone"},children:[e.preComponents&&v.jsxs(v.Fragment,{children:[v.jsx(C.FlexItem,{children:e.preComponents}),v.jsx(C.Divider,{orientation:{default:"vertical"},component:"div"})]}),v.jsx(C.FlexItem,{grow:{default:"grow"},children:v.jsx(C.Tabs,{activeKey:n,onSelect:i,inset:e.preComponents?void 0:{default:"insetNone",sm:"insetNone",md:"insetNone",lg:"insetNone",xl:"insetSm","2xl":"insetSm"},hasBorderBottom:!1,children:o})}),e.postComponents&&v.jsxs(v.Fragment,{children:[v.jsx(C.Divider,{orientation:{default:"vertical"}}),v.jsx(C.FlexItem,{style:{paddingRight:16},children:e.postComponents})]})]})}),l]})}function Py(e){return v.jsx(v.Fragment,{children:e.children})}function zxe(e){const{activeKey:t,setActiveKey:n}=e,r=x.useCallback((i,a)=>n(a),[n]);return v.jsx(C.PageSection,{type:C.PageSectionTypes.tabs,style:{flexGrow:1},children:v.jsx(C.Tabs,{activeKey:t,onSelect:r,inset:{default:"insetNone",sm:"insetNone",md:"insetNone",lg:"insetNone",xl:"insetSm","2xl":"insetSm"},children:e.children})})}const Vxe=z3`
536
+ `;function Ixe(e){return v.jsxs(C.Masthead,{children:[v.jsx(dP,{}),v.jsx(C.MastheadMain,{children:v.jsx(C.Title,{headingLevel:"h1",style:{fontWeight:"bold",lineHeight:1.2},children:e.title})}),v.jsx(Dxe,{id:"toolbar",children:v.jsxs(C.ToolbarContent,{children:[v.jsx(Mxe,{}),x.Children.toArray(e.children).map((t,n)=>v.jsx(C.ToolbarItem,{children:t},n))]})})]})}function dP(){const e=Js();return v.jsx(C.MastheadToggle,{onClick:()=>e.setState({isOpen:!e.isOpen}),children:v.jsx(C.PageToggleButton,{variant:"plain","aria-label":"Global navigation",children:v.jsx(Ce.BarsIcon,{})})})}function $xe(e){const{t}=yt(),n=Rt.useNavigate(),{dashboardUrl:r}=e;return React.createElement(C.Page,null,React.createElement(C.EmptyState,{variant:C.EmptyStateVariant.small,style:{paddingTop:48}},React.createElement(C.EmptyStateIcon,{icon:Ce.ExclamationCircleIcon}),React.createElement(C.Title,{headingLevel:"h2",size:"lg"},t("We could not find that page")),React.createElement(C.EmptyStateSecondaryActions,null,React.createElement(C.Stack,{hasGutter:!0},React.createElement(C.Button,{onClick:()=>n(-1)},t("Return to previous page")),React.createElement(C.Button,{component:i=>React.createElement(Rt.Link,{to:r,...i})},t("Return to dashboard"))))))}function hP(e){const{navigation:t}=e,n=Js();return v.jsx(C.PageSidebar,{isNavOpen:n.isOpen,nav:v.jsx(C.Nav,{children:v.jsx(C.NavList,{children:v.jsx(Jd,{baseRoute:"",items:t})})})})}function Jd(e){return v.jsx(v.Fragment,{children:e.items.map((t,n)=>v.jsx(Lxe,{item:t,baseRoute:e.baseRoute},n))})}function Lxe(e){let t;if("id"in e.item)t=e.item.id;else if("children"in e.item){const a=e.item.children.find(o=>o.path==="");a&&"id"in a&&(t=a.id)}const n=uP(),{item:r}=e;let i=e.baseRoute+"/"+r.path;return i=i.replace("//","/"),r.path==="/"&&"children"in r?v.jsx(Jd,{items:r.children,baseRoute:""}):"children"in r&&r.children.find(a=>a.label!==void 0)!==void 0?r.label===void 0?v.jsx(v.Fragment,{}):r.label===""?v.jsx(Jd,{items:r.children,baseRoute:i}):v.jsx(C.NavExpandable,{title:r.label,isActive:location.pathname.startsWith(i),isExpanded:!0,children:v.jsx(Jd,{items:r.children,baseRoute:i})}):"label"in r?v.jsx(C.NavItem,{id:t,isActive:location.pathname.startsWith(i),onClick:()=>n(i),"data-cy":t,children:r.label}):v.jsx(v.Fragment,{})}const mP=x.createContext({});function Fxe(){return x.useContext(mP)}function Nxe(e){const t=x.useMemo(()=>gP("",e.navigation),[e.navigation]);return v.jsx(mP.Provider,{value:t,children:e.children})}function gP(e,t){const n={};return t.forEach(r=>{const i=(e+"/"+r.path).replace("//","/");"id"in r&&typeof r.id=="string"&&(n[r.id]=i),"children"in r&&Object.assign(n,gP(i,r.children))}),n}function Bxe(e){const{navigation:t,basename:n,header:r}=e,i=x.useMemo(()=>[{path:"",element:v.jsx(cP,{children:v.jsx(Rt.Outlet,{})}),children:[{path:"login",element:e.login},{path:"",element:e.root??v.jsx(v.Fragment,{}),children:[{path:"",element:v.jsx(C.Page,{header:r,sidebar:v.jsx(hP,{navigation:t}),children:v.jsx(fP,{children:v.jsx(Rt.Outlet,{})})}),children:t}]},{path:"*",element:v.jsx($xe,{})}]}],[r,t,e.login,e.root]),a=x.useMemo(()=>Rt.createBrowserRouter(i,{basename:n}),[n,i]);return v.jsx(Nxe,{navigation:t,children:v.jsx(Rt.RouterProvider,{router:a})})}function Rxe(e){return e.replace(/^\//,"")}function pP(e,t){for(const n of e){if("id"in n&&n.id===t)return n;if("children"in n){const r=pP(n.children,t);if(r)return r}}}function vP(e,t){for(let n=0;n<e.length;n++){const r=e[n];if("id"in r&&r.id===t)return e.splice(n,1),r;if("children"in r){const i=vP(r.children,t);if(i)return i}}}function yP(e,t,n){for(const r of e)if("id"in r&&r.id===t){const i=r;"children"in r||(i.children=[]),i.children.push(n);return}else"children"in r&&yP(r.children,t,n)}function bP(e,t,n){for(let r=0;r<e.length;r++){const i=e[r];if("id"in i&&i.id===t){e.splice(r+1,0,n);return}else"children"in i&&bP(i.children,t,n)}}function _P(e,t,n){for(let r=0;r<e.length;r++){const i=e[r];if("id"in i&&i.id===t){e.splice(r,0,n);return}else"children"in i&&_P(i.children,t,n)}}function xP(){const e=Fxe();return(t,n)=>{let r=e[t]??"";const i=n==null?void 0:n.params,a=n==null?void 0:n.query;return r?(i&&(r=Object.keys(i).reduce((o,l)=>o.replace(`:${l}`,(i[l]??"").toString()),r)),a&&(r=`${r}?${Object.keys(a).map(o=>`${o}=${a[o]}`).join("&")}`)):console.error(`Page id ${t} not found`),r}}function Wxe(){const e=Rt.useNavigate(),t=xP();return(n,r)=>{const i=t(n,r);i&&e(i)}}function SP(e){const{loading:t}=e,[n,r]=x.useState((e==null?void 0:e.initialTabIndex)??0),i=x.useCallback((s,u)=>r(u),[r]),a=x.Children.toArray(e.children),o=a.map((s,u)=>{if(x.isValidElement(s)&&s.type===Py){const c=s.props.label;return v.jsx(C.Tab,{title:c||v.jsx(C.Skeleton,{width:"60px"}),eventKey:u},c??u)}return s}),l=a[n];return t?v.jsx(SP,{children:v.jsx(Py,{children:v.jsx(C.PageSection,{variant:"light",children:v.jsx(C.Skeleton,{})})})}):v.jsxs(v.Fragment,{children:[v.jsx(C.PageSection,{type:C.PageSectionTypes.tabs,className:"border-bottom",children:v.jsxs(C.Flex,{spaceItems:{default:"spaceItemsNone"},children:[e.preComponents&&v.jsxs(v.Fragment,{children:[v.jsx(C.FlexItem,{children:e.preComponents}),v.jsx(C.Divider,{orientation:{default:"vertical"},component:"div"})]}),v.jsx(C.FlexItem,{grow:{default:"grow"},children:v.jsx(C.Tabs,{activeKey:n,onSelect:i,inset:e.preComponents?void 0:{default:"insetNone",sm:"insetNone",md:"insetNone",lg:"insetNone",xl:"insetSm","2xl":"insetSm"},hasBorderBottom:!1,children:o})}),e.postComponents&&v.jsxs(v.Fragment,{children:[v.jsx(C.Divider,{orientation:{default:"vertical"}}),v.jsx(C.FlexItem,{style:{paddingRight:16},children:e.postComponents})]})]})}),l]})}function Py(e){return v.jsx(v.Fragment,{children:e.children})}function zxe(e){const{activeKey:t,setActiveKey:n}=e,r=x.useCallback((i,a)=>n(a),[n]);return v.jsx(C.PageSection,{type:C.PageSectionTypes.tabs,style:{flexGrow:1},children:v.jsx(C.Tabs,{activeKey:t,onSelect:r,inset:{default:"insetNone",sm:"insetNone",md:"insetNone",lg:"insetNone",xl:"insetSm","2xl":"insetSm"},children:e.children})})}const Vxe=z3`
537
537
  from {
538
538
  transform: rotate(0);
539
539
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ansible/ansible-ui-framework",
3
3
  "description": "A framework for building applications using PatternFly.",
4
- "version": "2.4.429",
4
+ "version": "2.4.431",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",