@ansible/ansible-ui-framework 2.4.509 → 2.4.510

Sign up to get free protection for your applications and to get access to all the features.
@@ -56,6 +56,7 @@ export type PageTableProps<T extends object> = {
56
56
  disableLastRowBorder?: boolean;
57
57
  maxSelections?: number;
58
58
  topContent?: React.ReactNode;
59
+ toolbarContent?: React.ReactNode;
59
60
  scrollTopContent?: boolean;
60
61
  };
61
62
  export declare function PageTable<T extends object>(props: PageTableProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { Dispatch, SetStateAction } from 'react';
1
+ import React, { Dispatch, SetStateAction } from 'react';
2
2
  import { IPageAction } from '../PageActions/PageAction';
3
3
  import { PageTableViewType } from './PageTableViewType';
4
4
  import './PageToolbar.css';
@@ -39,5 +39,6 @@ export type PageToolbarProps<T extends object> = {
39
39
  bottomBorder?: boolean;
40
40
  sortOptions?: PageTableSortOption[];
41
41
  maxSelections?: number;
42
+ toolbarContent?: React.ReactNode;
42
43
  };
43
44
  export declare function PageToolbar<T extends object>(props: PageToolbarProps<T>): import("react/jsx-runtime").JSX.Element;
package/index.js CHANGED
@@ -35100,6 +35100,7 @@ function s5e(e) {
35100
35100
  setFilterState: c
35101
35101
  }
35102
35102
  ),
35103
+ e.toolbarContent,
35103
35104
  /* @__PURE__ */ v.jsx(vs, { variant: "button-group", children: /* @__PURE__ */ v.jsx(
35104
35105
  Ks,
35105
35106
  {
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 Rk(e){const{itemCount:t,page:n,perPage:r,setPage:i,setPerPage:a,toolbarFilters:o,selectedItems:l,filterState:s,setFilterState:c,openColumnModal:u,bottomBorder:f,sort:d,setSort:h,sortDirection:g,setSortDirection:p,sortOptions:y,clearAllFilters:_}=e,b=x.useCallback(()=>{_?_():c&&c({})},[c,_]),S=cn("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]),P=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||P||N?t===void 0?v.jsx(C.Toolbar,{className:"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},children:v.jsx(Wk,{children:v.jsx(C.ToolbarItem,{style:{width:"100%"},children:v.jsx(C.Skeleton,{height:"36px"})})})}):v.jsx(C.Toolbar,{clearAllFilters:b,className:"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(Wk,{children:[M&&v.jsx(C.ToolbarGroup,{children:v.jsx(C.ToolbarItem,{variant:"bulk-select",children:v.jsx(sk,{...e})})}),s&&c&&v.jsx(zk,{toolbarFilters:o,filterState:s,setFilterState:c}),v.jsx(C.ToolbarGroup,{variant:"button-group",children:v.jsx(Va,{actions:A,selectedItems:l,wrapper:C.ToolbarItem})}),v.jsxs(Xge,{children:[v.jsx(Gge,{sort:d,setSort:h,sortDirection:g,setSortDirection:p,sortOptions:y}),O&&w&&v.jsx(Zge,{disableTableView:e.disableTableView,disableListView:e.disableListView,disableCardView:e.disableCardView,viewType:O,setViewType:w,openColumnModal:u}),!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 Jge(e){const{t}=ht(),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,{isFullHeight:!0,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 Qge(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,isFullHeight:!0,children:[r&&v.jsx(C.EmptyStateIcon,{icon:r}),v.jsx(C.Title,{"data-cy":e.title,headingLevel:"h4",size:"lg",children:t}),v.jsx(C.EmptyStateBody,{"data-cy":e.description,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 epe(e){const{button:t,description:n,title:r,variant:i}=e;return v.jsx(Qge,{icon:t?Ce.PlusCircleIcon:Ce.CubesIcon,title:r,description:n,button:t,variant:i})}function Iv(e,t,n){var r,i,a,o,l;t==null&&(t=100);function s(){var u=Date.now()-o;u<t&&u>=0?r=setTimeout(s,t-u):(r=null,n||(l=e.apply(a,i),a=i=null))}var c=function(){a=this,i=arguments,o=Date.now();var u=n&&!r;return r||(r=setTimeout(s,t)),u&&(l=e.apply(a,i),a=i=null),l};return c.clear=function(){r&&(clearTimeout(r),r=null)},c.flush=function(){r&&(l=e.apply(a,i),a=i=null,clearTimeout(r),r=null)},c}Iv.debounce=Iv;var tpe=Iv;const npe=Ae(tpe);function rpe(e,t,n){const{selectedItems:r,selectItem:i,unselectItem:a,isSelected:o,selectItems:l,unselectAll:s,allSelected:c}=Lv(e,t),{sorted:u,sort:f,setSort:d}=$v(e),{filtered:h,setFilterFn:g}=Fv(u,t),{searched:p,search:y,setSearch:_,setSearchFn:b}=ipe(h,t,n==null?void 0:n.search),{paged:S,page:O,setPage:w,perPage:A,setPerPage:T}=$s(p),k=x.useCallback(()=>l(S),[S,l]),P=x.useCallback(()=>l(p),[p,l]);return x.useMemo(()=>({allSelected:c,filtered:h,isSelected:o,page:O,paged:S,perPage:A,search:y,searched:p,selectAll:P,selectItem:i,selectPage:k,selectedItems:r,setFilterFn:g,setPage:w,setPerPage:T,setSearch:_,setSearchFn:b,setSort:d,sort:f,sorted:u,unselectAll:s,unselectItem:a}),[c,h,o,O,S,A,y,p,P,i,k,r,g,w,T,_,b,d,f,u,s,a])}function Lv(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]),c=x.useCallback(()=>s(e),[e,s]),u=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:c,unselectAll:f,allSelected:h,keyFn:t,unselectItems:u}),[h,l,t,c,a,s,d,f,o,u])}function Vk(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]),c=x.useCallback(()=>{s(e??[])},[e,s]),u=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:c,unselectAll:u,allSelected:d,keyFn:t,unselectItems:o}),[d,l,t,c,i,s,f,u,a,o])}function $v(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 Fv(e,t){const n=x.useRef({map:{}}),[r,i]=x.useState(),a=x.useCallback(c=>i(()=>c),[]),[o,l]=x.useState([]);x.useEffect(()=>{n.current.map={}},[r]);const s=x.useCallback(c=>{const u=t(c);let f=n.current.map[u];return f?f.item!==c&&(f.item=c,f.passes=r?r(c):!0):(f={item:c,passes:r?r(c):!0},n.current.map[u]=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 ipe(e,t,n){const r=x.useRef({map:{}}),[i,a]=x.useState(),o=x.useCallback(h=>a(()=>h),[]),[l,s]=x.useState([]),[c,u]=x.useState(n??""),f=x.useCallback(npe(h=>u(h),200),[]);x.useEffect(()=>{r.current.map={}},[c,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,c):0):(p={item:h,score:i?i(h,c):0},r.current.map[g]=p),p},[t,i,c]);return x.useEffect(()=>{s(i&&c?e.map(d).filter(h=>h.score<.5).sort((h,g)=>h.score-g.score).map(h=>h.item):e)},[c,e,i,d]),x.useMemo(function(){return{searched:l,search:c,setSearch:f,setSearchFn:o}},[l,c,f,o])}function $s(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 c=0;for(const u of s)if(l[c++]!==u)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 lOe="",Nv={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 ape(e){const{t}=ht(),{columns:n,keyFn:r,items:i,setItems:a,isSelected:o,selectItem:l,unselectItem:s,allSelected:c,selectAll:u,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(Nv.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=P([...i],y,ne);a(re)}}return null},P=(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(Nv.modifiers.ghostRow),W.setAttribute("aria-pressed","false"),_(null),p(null),S(!1)},j=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(Me.TableComposable,{"aria-label":t("Table with draggable rows"),className:b?Nv.modifiers.dragOver:"",variant:"compact",gridBreakPoint:"",children:[!d&&v.jsx(Me.Thead,{children:v.jsxs(Me.Tr,{children:[v.jsx(Me.Th,{}),h&&v.jsx(Me.Th,{select:{onSelect:(I,W)=>{W?u():f()},isSelected:c}}),n.map((I,W)=>v.jsx(Me.Th,{children:I.header},W))]})}),v.jsx(Me.Tbody,{ref:O,onDragOver:k,onDragLeave:N,children:i.map((I,W)=>{const Z=r(I);return v.jsxs(Me.Tr,{id:Z.toString(),draggable:!0,onDrop:A,onDragEnd:M,onDragStart:j,children:[v.jsx(Me.Td,{draggableRow:{id:`draggable-row-${Z.toString()}`}}),h&&v.jsx(Me.Td,{select:{rowIndex:W,variant:"checkbox",onSelect:(ne,re)=>{re?l(I):s(I)},isSelected:o(I)}}),n.map(ne=>v.jsx(Me.Td,{children:ne.cell(I,D)},ne.header))]},Z)})})]})}function ope(e){const[t,n]=yr(),[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]),c=x.useMemo(()=>o?s.filter(d=>{const h=o.find(g=>g.key===r(d));return h?h.enabled:!0}):s,[s,o,r]),u=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(lpe,{...e,keyFn:r,items:s,defaultSelectedItems:c,onApplyChanges:u})),managedItems:c}}function lpe(e){const{t}=ht(),{title:n,description:r,columns:i,onApplyChanges:a}=e,[o]=x.useState(()=>e.keyFn),[l,s]=yr(),c=()=>s(void 0),[u,f]=x.useState(()=>e.items),{selectedItems:d,isSelected:h,selectItem:g,unselectItem:p,allSelected:y,selectAll:_,unselectAll:b}=Lv(u,o,e.defaultSelectedItems),S=()=>{a(u,d),s(void 0)};return v.jsxs(C.Modal,{title:n,"aria-label":n,ouiaId:n,description:v.jsx("div",{style:{marginBottom:16},children:r}),variant:e.variant??C.ModalVariant.medium,isOpen:!0,onClose:c,actions:[v.jsx(C.Button,{variant:"primary",onClick:S,children:t`Apply`},"apply"),v.jsx(C.Button,{variant:"link",onClick:c,children:t`Cancel`},"cancel")],hasNoBodyWrapper:!0,children:[v.jsx(C.Divider,{}),v.jsx(C.ModalBoxBody,{style:{padding:0},children:v.jsx(ape,{keyFn:o,items:u,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 spe(e,t,n,r,i){const{t:a}=ht(),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(Vi,{value:d.table??"",onSelect:g=>{switch(g){case"":h({...d,table:void 0});break;case Wi.Description:case Wi.Expanded:case Wi.Hidden:h({...d,table:g});break}},placeholder:a("Column"),options:[{value:"",label:a("Column"),description:a("Show the column in the table.")},{value:Wi.Description,label:a("Description"),description:a("Show the column when the item is expanded as a full width description.")},{value:Wi.Expanded,label:a("Expanded"),description:a("Show the column when the item is expanded as a detail.")},{value:Wi.Hidden,label:a("Hidden"),description:a("Hide the column.")}]})}),r||f.push({header:a("List View"),cell:(d,h)=>v.jsx(Vi,{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(Vi,{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:c,managedItems:u}=ope({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:c,managedColumns:u}}const sOe="";function cpe(){return v.jsx(Me.TableComposable,{gridBreakPoint:"",className:"page-table",children:v.jsx(Me.Tbody,{children:new Array(10).fill(0).map((e,t)=>v.jsx(Me.Tr,{children:v.jsx(Me.Td,{children:v.jsx(C.Skeleton,{height:"27px"})})},t))})})}function upe(e){const{setPage:t,setPerPage:n}=e,r=x.useCallback((o,l)=>t(l),[t]),i=x.useCallback((o,l)=>n(l),[n]),a=!cn("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"})}function fpe(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]);ro(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 dpe=Le.small`
380
+ `;function Rk(e){const{itemCount:t,page:n,perPage:r,setPage:i,setPerPage:a,toolbarFilters:o,selectedItems:l,filterState:s,setFilterState:c,openColumnModal:u,bottomBorder:f,sort:d,setSort:h,sortDirection:g,setSortDirection:p,sortOptions:y,clearAllFilters:_}=e,b=x.useCallback(()=>{_?_():c&&c({})},[c,_]),S=cn("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]),P=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||P||N?t===void 0?v.jsx(C.Toolbar,{className:"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},children:v.jsx(Wk,{children:v.jsx(C.ToolbarItem,{style:{width:"100%"},children:v.jsx(C.Skeleton,{height:"36px"})})})}):v.jsx(C.Toolbar,{clearAllFilters:b,className:"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(Wk,{children:[M&&v.jsx(C.ToolbarGroup,{children:v.jsx(C.ToolbarItem,{variant:"bulk-select",children:v.jsx(sk,{...e})})}),s&&c&&v.jsx(zk,{toolbarFilters:o,filterState:s,setFilterState:c}),e.toolbarContent,v.jsx(C.ToolbarGroup,{variant:"button-group",children:v.jsx(Va,{actions:A,selectedItems:l,wrapper:C.ToolbarItem})}),v.jsxs(Xge,{children:[v.jsx(Gge,{sort:d,setSort:h,sortDirection:g,setSortDirection:p,sortOptions:y}),O&&w&&v.jsx(Zge,{disableTableView:e.disableTableView,disableListView:e.disableListView,disableCardView:e.disableCardView,viewType:O,setViewType:w,openColumnModal:u}),!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 Jge(e){const{t}=ht(),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,{isFullHeight:!0,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 Qge(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,isFullHeight:!0,children:[r&&v.jsx(C.EmptyStateIcon,{icon:r}),v.jsx(C.Title,{"data-cy":e.title,headingLevel:"h4",size:"lg",children:t}),v.jsx(C.EmptyStateBody,{"data-cy":e.description,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 epe(e){const{button:t,description:n,title:r,variant:i}=e;return v.jsx(Qge,{icon:t?Ce.PlusCircleIcon:Ce.CubesIcon,title:r,description:n,button:t,variant:i})}function Iv(e,t,n){var r,i,a,o,l;t==null&&(t=100);function s(){var u=Date.now()-o;u<t&&u>=0?r=setTimeout(s,t-u):(r=null,n||(l=e.apply(a,i),a=i=null))}var c=function(){a=this,i=arguments,o=Date.now();var u=n&&!r;return r||(r=setTimeout(s,t)),u&&(l=e.apply(a,i),a=i=null),l};return c.clear=function(){r&&(clearTimeout(r),r=null)},c.flush=function(){r&&(l=e.apply(a,i),a=i=null,clearTimeout(r),r=null)},c}Iv.debounce=Iv;var tpe=Iv;const npe=Ae(tpe);function rpe(e,t,n){const{selectedItems:r,selectItem:i,unselectItem:a,isSelected:o,selectItems:l,unselectAll:s,allSelected:c}=Lv(e,t),{sorted:u,sort:f,setSort:d}=$v(e),{filtered:h,setFilterFn:g}=Fv(u,t),{searched:p,search:y,setSearch:_,setSearchFn:b}=ipe(h,t,n==null?void 0:n.search),{paged:S,page:O,setPage:w,perPage:A,setPerPage:T}=$s(p),k=x.useCallback(()=>l(S),[S,l]),P=x.useCallback(()=>l(p),[p,l]);return x.useMemo(()=>({allSelected:c,filtered:h,isSelected:o,page:O,paged:S,perPage:A,search:y,searched:p,selectAll:P,selectItem:i,selectPage:k,selectedItems:r,setFilterFn:g,setPage:w,setPerPage:T,setSearch:_,setSearchFn:b,setSort:d,sort:f,sorted:u,unselectAll:s,unselectItem:a}),[c,h,o,O,S,A,y,p,P,i,k,r,g,w,T,_,b,d,f,u,s,a])}function Lv(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]),c=x.useCallback(()=>s(e),[e,s]),u=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:c,unselectAll:f,allSelected:h,keyFn:t,unselectItems:u}),[h,l,t,c,a,s,d,f,o,u])}function Vk(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]),c=x.useCallback(()=>{s(e??[])},[e,s]),u=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:c,unselectAll:u,allSelected:d,keyFn:t,unselectItems:o}),[d,l,t,c,i,s,f,u,a,o])}function $v(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 Fv(e,t){const n=x.useRef({map:{}}),[r,i]=x.useState(),a=x.useCallback(c=>i(()=>c),[]),[o,l]=x.useState([]);x.useEffect(()=>{n.current.map={}},[r]);const s=x.useCallback(c=>{const u=t(c);let f=n.current.map[u];return f?f.item!==c&&(f.item=c,f.passes=r?r(c):!0):(f={item:c,passes:r?r(c):!0},n.current.map[u]=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 ipe(e,t,n){const r=x.useRef({map:{}}),[i,a]=x.useState(),o=x.useCallback(h=>a(()=>h),[]),[l,s]=x.useState([]),[c,u]=x.useState(n??""),f=x.useCallback(npe(h=>u(h),200),[]);x.useEffect(()=>{r.current.map={}},[c,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,c):0):(p={item:h,score:i?i(h,c):0},r.current.map[g]=p),p},[t,i,c]);return x.useEffect(()=>{s(i&&c?e.map(d).filter(h=>h.score<.5).sort((h,g)=>h.score-g.score).map(h=>h.item):e)},[c,e,i,d]),x.useMemo(function(){return{searched:l,search:c,setSearch:f,setSearchFn:o}},[l,c,f,o])}function $s(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 c=0;for(const u of s)if(l[c++]!==u)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 lOe="",Nv={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 ape(e){const{t}=ht(),{columns:n,keyFn:r,items:i,setItems:a,isSelected:o,selectItem:l,unselectItem:s,allSelected:c,selectAll:u,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(Nv.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=P([...i],y,ne);a(re)}}return null},P=(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(Nv.modifiers.ghostRow),W.setAttribute("aria-pressed","false"),_(null),p(null),S(!1)},j=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(Me.TableComposable,{"aria-label":t("Table with draggable rows"),className:b?Nv.modifiers.dragOver:"",variant:"compact",gridBreakPoint:"",children:[!d&&v.jsx(Me.Thead,{children:v.jsxs(Me.Tr,{children:[v.jsx(Me.Th,{}),h&&v.jsx(Me.Th,{select:{onSelect:(I,W)=>{W?u():f()},isSelected:c}}),n.map((I,W)=>v.jsx(Me.Th,{children:I.header},W))]})}),v.jsx(Me.Tbody,{ref:O,onDragOver:k,onDragLeave:N,children:i.map((I,W)=>{const Z=r(I);return v.jsxs(Me.Tr,{id:Z.toString(),draggable:!0,onDrop:A,onDragEnd:M,onDragStart:j,children:[v.jsx(Me.Td,{draggableRow:{id:`draggable-row-${Z.toString()}`}}),h&&v.jsx(Me.Td,{select:{rowIndex:W,variant:"checkbox",onSelect:(ne,re)=>{re?l(I):s(I)},isSelected:o(I)}}),n.map(ne=>v.jsx(Me.Td,{children:ne.cell(I,D)},ne.header))]},Z)})})]})}function ope(e){const[t,n]=yr(),[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]),c=x.useMemo(()=>o?s.filter(d=>{const h=o.find(g=>g.key===r(d));return h?h.enabled:!0}):s,[s,o,r]),u=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(lpe,{...e,keyFn:r,items:s,defaultSelectedItems:c,onApplyChanges:u})),managedItems:c}}function lpe(e){const{t}=ht(),{title:n,description:r,columns:i,onApplyChanges:a}=e,[o]=x.useState(()=>e.keyFn),[l,s]=yr(),c=()=>s(void 0),[u,f]=x.useState(()=>e.items),{selectedItems:d,isSelected:h,selectItem:g,unselectItem:p,allSelected:y,selectAll:_,unselectAll:b}=Lv(u,o,e.defaultSelectedItems),S=()=>{a(u,d),s(void 0)};return v.jsxs(C.Modal,{title:n,"aria-label":n,ouiaId:n,description:v.jsx("div",{style:{marginBottom:16},children:r}),variant:e.variant??C.ModalVariant.medium,isOpen:!0,onClose:c,actions:[v.jsx(C.Button,{variant:"primary",onClick:S,children:t`Apply`},"apply"),v.jsx(C.Button,{variant:"link",onClick:c,children:t`Cancel`},"cancel")],hasNoBodyWrapper:!0,children:[v.jsx(C.Divider,{}),v.jsx(C.ModalBoxBody,{style:{padding:0},children:v.jsx(ape,{keyFn:o,items:u,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 spe(e,t,n,r,i){const{t:a}=ht(),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(Vi,{value:d.table??"",onSelect:g=>{switch(g){case"":h({...d,table:void 0});break;case Wi.Description:case Wi.Expanded:case Wi.Hidden:h({...d,table:g});break}},placeholder:a("Column"),options:[{value:"",label:a("Column"),description:a("Show the column in the table.")},{value:Wi.Description,label:a("Description"),description:a("Show the column when the item is expanded as a full width description.")},{value:Wi.Expanded,label:a("Expanded"),description:a("Show the column when the item is expanded as a detail.")},{value:Wi.Hidden,label:a("Hidden"),description:a("Hide the column.")}]})}),r||f.push({header:a("List View"),cell:(d,h)=>v.jsx(Vi,{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(Vi,{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:c,managedItems:u}=ope({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:c,managedColumns:u}}const sOe="";function cpe(){return v.jsx(Me.TableComposable,{gridBreakPoint:"",className:"page-table",children:v.jsx(Me.Tbody,{children:new Array(10).fill(0).map((e,t)=>v.jsx(Me.Tr,{children:v.jsx(Me.Td,{children:v.jsx(C.Skeleton,{height:"27px"})})},t))})})}function upe(e){const{setPage:t,setPerPage:n}=e,r=x.useCallback((o,l)=>t(l),[t]),i=x.useCallback((o,l)=>n(l),[n]),a=!cn("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"})}function fpe(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]);ro(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 dpe=Le.small`
381
381
  opacity: 0.7;
382
382
  `,hpe=Le.div`
383
383
  display: flex;
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.509",
4
+ "version": "2.4.510",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",