@ansible/ansible-ui-framework 2.4.12 → 2.4.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -52,5 +52,6 @@ export type PageTableProps<T extends object> = {
52
52
  disableBodyPadding?: boolean;
53
53
  defaultSubtitle?: ReactNode;
54
54
  expandedRow?: (item: T) => ReactNode;
55
+ disableLastRowBorder?: boolean;
55
56
  };
56
57
  export declare function PageTable<T extends object>(props: PageTableProps<T>): JSX.Element;
package/index.js CHANGED
@@ -9732,17 +9732,17 @@ const pv = ct.div`
9732
9732
  display: flex;
9733
9733
  flex-direction: row;
9734
9734
  align-items: end;
9735
- gap: 16;
9735
+ gap: 16px;
9736
9736
  `, bv = ct.div`
9737
9737
  flex-grow: 1;
9738
9738
  `, wv = ct.div`
9739
9739
  display: flex;
9740
- gap: 16;
9741
- margin-top: 8;
9740
+ gap: 16px;
9741
+ margin-top: 8px;
9742
9742
  flex-wrap: wrap;
9743
9743
  `, xv = ct.div`
9744
9744
  display: flex;
9745
- gap: 6;
9745
+ gap: 6px;
9746
9746
  align-items: baseline;
9747
9747
  `;
9748
9748
  function Sv(t) {
@@ -10640,7 +10640,8 @@ function Mv(t) {
10640
10640
  unselectAll: p,
10641
10641
  onSelect: m,
10642
10642
  expandedRow: y,
10643
- isLastRow: w === r.length - 1
10643
+ isLastRow: w === r.length - 1,
10644
+ disableLastRowBorder: t.disableLastRowBorder
10644
10645
  },
10645
10646
  o ? o(_) : w
10646
10647
  )) })
@@ -10741,35 +10742,36 @@ function Lv(t) {
10741
10742
  rowIndex: c,
10742
10743
  showSelect: d,
10743
10744
  onSelect: h,
10744
- expandedRow: u
10745
- } = t, [m, p] = ye(!1), y = Hn(), v = u == null ? void 0 : u(o);
10745
+ expandedRow: u,
10746
+ disableLastRowBorder: m
10747
+ } = t, [p, y] = ye(!1), v = Hn(), E = u == null ? void 0 : u(o);
10746
10748
  return /* @__PURE__ */ f.jsxs(f.Fragment, { children: [
10747
10749
  /* @__PURE__ */ f.jsxs(
10748
10750
  ln,
10749
10751
  {
10750
- isRowSelected: m,
10752
+ isRowSelected: p,
10751
10753
  style: {
10752
10754
  boxShadow: "unset",
10753
- borderBottom: m || t.isLastRow ? "unset" : void 0
10755
+ borderBottom: p || t.isLastRow && m ? "unset" : void 0
10754
10756
  },
10755
10757
  children: [
10756
10758
  u && /* @__PURE__ */ f.jsx(
10757
10759
  Vt,
10758
10760
  {
10759
- expand: v ? {
10761
+ expand: E ? {
10760
10762
  rowIndex: c,
10761
- isExpanded: m,
10762
- onToggle: () => p((E) => !E)
10763
+ isExpanded: p,
10764
+ onToggle: () => y((C) => !C)
10763
10765
  } : void 0,
10764
- style: { paddingLeft: v ? 8 : 4 }
10766
+ style: { paddingLeft: E ? 8 : 4 }
10765
10767
  }
10766
10768
  ),
10767
10769
  d && /* @__PURE__ */ f.jsx(
10768
10770
  cn,
10769
10771
  {
10770
10772
  select: i !== void 0 ? {
10771
- onSelect: (E, C) => {
10772
- C ? n == null || n(o) : s == null || s(o);
10773
+ onSelect: (C, S) => {
10774
+ S ? n == null || n(o) : s == null || s(o);
10773
10775
  },
10774
10776
  isSelected: i
10775
10777
  } : void 0,
@@ -10807,16 +10809,16 @@ function Lv(t) {
10807
10809
  ]
10808
10810
  }
10809
10811
  ),
10810
- u && m && v && /* @__PURE__ */ f.jsxs(ln, { isExpanded: m, style: { boxShadow: "unset" }, children: [
10812
+ u && p && E && /* @__PURE__ */ f.jsxs(ln, { isExpanded: p, style: { boxShadow: "unset" }, children: [
10811
10813
  /* @__PURE__ */ f.jsx(Vt, {}),
10812
10814
  d && /* @__PURE__ */ f.jsx(cn, { isStickyColumn: !0, stickyMinWidth: "0px", hasRightBorder: t.scrollLeft }),
10813
10815
  h && /* @__PURE__ */ f.jsx(Vt, { isStickyColumn: !0, stickyMinWidth: "0px", hasRightBorder: t.scrollLeft }),
10814
10816
  /* @__PURE__ */ f.jsx(
10815
10817
  Vt,
10816
10818
  {
10817
- colSpan: e.filter((E) => E.enabled !== !1).length,
10818
- style: { paddingBottom: y.tableLayout === "compact" ? 12 : 24, paddingTop: 0 },
10819
- children: /* @__PURE__ */ f.jsx(Pf, { children: v })
10819
+ colSpan: e.filter((C) => C.enabled !== !1).length,
10820
+ style: { paddingBottom: v.tableLayout === "compact" ? 12 : 24, paddingTop: 0 },
10821
+ children: /* @__PURE__ */ f.jsx(Pf, { children: E })
10820
10822
  }
10821
10823
  ),
10822
10824
  l !== void 0 && l.length > 0 && /* @__PURE__ */ f.jsx(
package/index.umd.cjs CHANGED
@@ -156,17 +156,17 @@ See https://s-c.sh/2BAXzed for more info.`),window["__styled-components-init__"]
156
156
  display: flex;
157
157
  flex-direction: row;
158
158
  align-items: end;
159
- gap: 16;
159
+ gap: 16px;
160
160
  `,fg=at.div`
161
161
  flex-grow: 1;
162
162
  `,hg=at.div`
163
163
  display: flex;
164
- gap: 16;
165
- margin-top: 8;
164
+ gap: 16px;
165
+ margin-top: 8px;
166
166
  flex-wrap: wrap;
167
167
  `,mg=at.div`
168
168
  display: flex;
169
- gap: 6;
169
+ gap: 6px;
170
170
  align-items: baseline;
171
171
  `;function pg(t){const{item:e,itemToCardFn:r,isSelected:n,selectItem:s,unselectItem:i,itemActions:o,showSelect:a,defaultCardSubtitle:l}=t,c=x.useMemo(()=>r(e),[e,r]),d=!!(n!=null&&n(e)),h=x.useCallback(()=>{n!=null&&n(e)?i==null||i(e):s==null||s(e)},[n,e,s,i]),u=o!==void 0&&o.length>0,m=a||u;return f.jsxs(v.Card,{id:c.id,isFlat:!0,isLarge:!0,isRounded:!0,isSelectable:d,isSelected:d,style:{transition:"box-shadow 0.25s",cursor:"default",maxWidth:"100%"},children:[f.jsxs(v.CardHeader,{style:{display:"flex",flexWrap:"nowrap",maxWidth:"100%"},children:[f.jsxs(lg,{children:[f.jsxs(cg,{children:[c.icon&&f.jsx(Ti,{size:"xl",children:c.icon}),f.jsxs(ug,{children:[f.jsx(v.CardTitle,{children:f.jsx(v.Truncate,{content:c.title})}),c.subtitle?f.jsx(v.Text,{component:"small",style:{opacity:.7},children:c.subtitle}):l&&f.jsx(v.Text,{component:"small",style:{opacity:.7},children:l})]})]}),c.badge&&c.badgeTooltip&&f.jsx(v.FlexItem,{children:f.jsx("div",{onClick:p=>p.stopPropagation(),children:f.jsx(v.Popover,{headerContent:c.badgeTooltipTitle,bodyContent:c.badgeTooltip,removeFindDomNode:!0,children:f.jsx(v.Label,{color:c.badgeColor,children:c.badge})})})}),c.badge&&!c.badgeTooltip&&f.jsx(v.FlexItem,{children:f.jsx(v.Label,{color:c.badgeColor,children:c.badge})})]}),m&&f.jsxs(v.CardActions,{children:[o&&o.length&&f.jsx(Br,{actions:o,position:v.DropdownPosition.right,selectedItem:e,iconOnly:!0,collapse:"always"}),a&&f.jsx(v.Checkbox,{isChecked:n==null?void 0:n(e),onChange:h,id:"check-1"})]})]}),c.cardBody,c.labels&&f.jsx(v.CardFooter,{children:f.jsx(dg,{children:f.jsx(fg,{children:c.labels&&f.jsx(v.LabelGroup,{numLabels:999,children:c.labels.map(p=>f.jsx(v.Label,{color:p.color,children:f.jsx(v.Truncate,{content:p.label,style:{minWidth:0}})},p.label))})})})}),c.alertTitle&&f.jsx(v.Alert,{title:c.alertTitle,isInline:!0,variant:c.alertVariant,children:c.alertContent})]},c.id??c.title)}function gg(t,e){const r=x.useMemo(()=>{let c,d,h;const u=[];let m;const p=[];for(const y of t)switch(y.type){case"description":h||(h=y);break;case"labels":m||(m=y);break;case"count":u.push(y);break;default:switch(y.card){case"name":c=y;break;case"subtitle":d=y;break;case"description":h=y;break;case"hidden":break;default:p.push(y);break}break}return{nameColumn:c,subtitleColumn:d,descriptionColumn:h,countColumns:u,cardColumns:p,labelColumn:m}},[t]),{nameColumn:n,subtitleColumn:s,descriptionColumn:i,countColumns:o,cardColumns:a,labelColumn:l}=r;return x.useMemo(()=>c=>{var u,m;const d=i&&(!i.value||i.value(c)),h={id:e(c),icon:(u=n==null?void 0:n.icon)==null?void 0:u.call(n,c),title:f.jsx(St,{column:n,item:c}),subtitle:s&&(!s.value||s.value(c))&&f.jsx(St,{column:s,item:c}),cardBody:f.jsx(v.CardBody,{children:f.jsxs(v.DescriptionList,{isCompact:!0,children:[d&&f.jsx(bn,{children:i.type==="description"?f.jsx("div",{children:i.value(c)}):f.jsx(St,{column:i,item:c})},i.id),a.filter(p=>!p.value||p.value(c)).map(p=>f.jsx(bn,{label:p.header,children:f.jsx(St,{column:p,item:c})},p.id)),o.length>0&&f.jsx(bn,{children:f.jsx(hg,{children:o.map((p,y)=>f.jsxs(mg,{children:[f.jsx(St,{column:p,item:c}),f.jsx("small",{style:{opacity:.7},children:p.header})]},y))})})]})}),labels:l&&((m=l.value(c))==null?void 0:m.map(p=>({label:p})))};return!d&&a.length===0&&o.length===0&&(h.cardBody=void 0),h},[a,o,i,l,n,s,e])}function $c(t){const{keyFn:e,pageItems:r,tableColumns:n,isSelected:s,selectItem:i,unselectItem:o,rowActions:a,showSelect:l,defaultSubtitle:c}=t,d=gg(n,e),h=x.useMemo(()=>f.jsx(ag,{size:400,children:r==null?void 0:r.map(u=>f.jsx(pg,{item:u,itemToCardFn:d,isSelected:s,selectItem:i,unselectItem:o,itemActions:a,showSelect:l,defaultCardSubtitle:c},e(u)))}),[r,e,d,s,i,o,a,l,c]);return f.jsx(v.PageSection,{style:{flexGrow:1},children:h})}function yg(t){const{keyFn:e,pageItems:r,tableColumns:n,isSelected:s,selectItem:i,unselectItem:o,rowActions:a,defaultSubtitle:l,showSelect:c}=t,d=vg(n,e,s,i,o,a,l,c);return f.jsx(v.DataList,{"aria-label":"TODO",style:{marginTop:-1,maxWidth:"100%",overflow:"hidden"},children:r==null?void 0:r.map(d)})}function vg(t,e,r,n,s,i,o,a){const l=x.useMemo(()=>{let _,T,$;const E=[];let w;const V=[],B=[];for(const j of t)switch(j.type){case"description":$||($=j);break;case"labels":w||(w=j);break;case"count":E.push(j);break;default:switch(j.list){case"name":_=j;break;case"subtitle":T=j;break;case"description":$=j;break;case"hidden":break;case"secondary":B.push(j);break;default:V.push(j);break}break}return{nameColumn:_,subtitleColumn:T,descriptionColumn:$,countColumns:E,primaryColumns:V,secondaryColumns:B,labelColumn:w}},[t]),c=x.useCallback(_=>{r!=null&&r(_)?s==null||s(_):n==null||n(_)},[r,n,s]),{nameColumn:d,subtitleColumn:h,descriptionColumn:u,countColumns:m,primaryColumns:p,secondaryColumns:y,labelColumn:b}=l;return x.useCallback(_=>{const T=e(_),$=r==null?void 0:r(_);return f.jsx(v.DataListItem,{"aria-labelledby":`data-list-${T}`,isExpanded:$,children:f.jsxs(v.DataListItemRow,{children:[a&&f.jsx(v.DataListCheck,{"aria-labelledby":`data-list-check-${T}`,name:`data-list-check-${T}`,isChecked:r==null?void 0:r(_),onClick:()=>c(_)}),f.jsx(v.DataListItemCells,{dataListCells:[f.jsx(v.DataListCell,{width:5,children:f.jsx(v.Flex,{children:f.jsxs(v.Stack,{hasGutter:!0,children:[f.jsxs(v.Flex,{alignItems:{default:"alignItemsCenter"},children:[(d==null?void 0:d.icon)&&f.jsx(Ti,{size:"xl",children:d==null?void 0:d.icon(_)}),f.jsxs(v.Stack,{children:[f.jsx(v.Title,{headingLevel:"h2",style:{marginTop:-4,fontWeight:"bold"},children:f.jsx("span",{id:`data-list-${T}`,children:f.jsx(St,{column:d,item:_})})}),h?f.jsx(v.Text,{component:"small",style:{opacity:.7},children:f.jsx(St,{column:h,item:_})}):o&&f.jsx(v.Text,{component:"small",style:{opacity:.7},children:o})]})]}),(u||p.length>0||m.length>0||b)&&f.jsxs(v.DescriptionList,{isCompact:!0,children:[u&&(!u.value||u.value(_))&&f.jsx(v.DescriptionListGroup,{children:f.jsx(v.DescriptionListDescription,{children:f.jsx(St,{column:u,item:_})})},u.header),p.map(E=>E.value&&!E.value(_)?f.jsx(f.Fragment,{}):f.jsxs(v.DescriptionListGroup,{children:[f.jsx(v.DescriptionListTerm,{style:{whiteSpace:"nowrap"},children:E.header}),f.jsx(v.DescriptionListDescription,{children:f.jsx(St,{column:E,item:_})})]},E.header)),m.length>0&&f.jsx(v.DescriptionListGroup,{children:f.jsx(v.DescriptionListDescription,{children:f.jsx("div",{style:{display:"flex",gap:16,marginTop:8,flexWrap:"wrap"},children:m.map((E,w)=>f.jsxs("div",{style:{display:"flex",gap:6,alignItems:"baseline"},children:[f.jsx(St,{column:E,item:_}),f.jsx("small",{style:{opacity:.7},children:E.header})]},w))})})},"counts"),b&&f.jsx(v.DescriptionListGroup,{children:f.jsx(v.DescriptionListDescription,{children:f.jsx(St,{column:b,item:_})})},b.header)]})]})})},"primary"),y.length>0?f.jsx(v.DataListCell,{children:f.jsx(v.DescriptionList,{isCompact:!0,children:y.map(E=>E.value&&!E.value(_)?f.jsx(f.Fragment,{}):f.jsxs(v.DescriptionListGroup,{children:[f.jsx(v.DescriptionListTerm,{style:{whiteSpace:"nowrap"},children:E.header}),f.jsx(v.DescriptionListDescription,{children:f.jsx(St,{column:E,item:_})})]},E.header))})},"secondary"):null]}),i&&f.jsx(v.DataListAction,{"aria-labelledby":"check-action-item1 check-action-action1",id:"check-action-action1","aria-label":"Actions",isPlainButtonAction:!0,style:{whiteSpace:"nowrap"},children:f.jsx(Br,{actions:i,position:v.DropdownPosition.right,selectedItem:_,iconOnly:!0})})]})},T)},[e,r,a,d,h,o,p,u,m,b,y,i,c])}function _c(t){const[e,r]=x.useState(!1),n=Vt("sm"),[s]=pt(),{pageItems:i,selectedItems:o,selectItems:a,unselectAll:l}=t,c=t.itemCount!==void 0&&t.itemCount>0&&i&&i.length>0&&(i??[]).every(b=>o==null?void 0:o.includes(b)),d=x.useCallback(()=>{c?l==null||l():a==null||a(i??[])},[c,l,a,i]),h=x.useMemo(()=>n?o&&o.length>0?`${o.length} selected`:"":o&&o.length>0?`${o.length}`:"",[n,o]),u=x.useMemo(()=>{const b=o?o.length:0;return f.jsx(v.DropdownToggle,{splitButtonItems:[f.jsx(v.DropdownToggleCheckbox,{id:"select-all","aria-label":"Select all",isChecked:c?!0:b>0?null:!1,onChange:d,children:h},"select-all")],onToggle:_=>r(_)})},[o,c,d,h]),m=x.useMemo(()=>f.jsx(v.DropdownItem,{id:"select-none",onClick:()=>{l==null||l(),r(!1)},children:t.selectNoneText??s.selectNone},"select-none"),[t.selectNoneText,s.selectNone,l]),p=x.useMemo(()=>f.jsx(v.DropdownItem,{id:"select-page",onClick:()=>{a==null||a(i??[]),r(!1)},children:`Select ${(i==null?void 0:i.length)??0} page items`},"select-page"),[a,i]),y=x.useMemo(()=>[m,p],[m,p]);return f.jsx(v.Dropdown,{isOpen:e,toggle:u,dropdownItems:y,style:{zIndex:400}})}const r0="",bg=at.div`
172
172
  flex-grow: 1;
@@ -183,7 +183,7 @@ See https://s-c.sh/2BAXzed for more info.`),window["__styled-components-init__"]
183
183
  `,jg=at.div`
184
184
  padding-top: 5px;
185
185
  padding-bottom: 5px;
186
- `;function Sn(t){const{toolbarActions:e,filters:r,error:n,itemCount:s,disableBodyPadding:i}=t,{openColumnModal:o,columnModal:a,managedColumns:l}=ig(t.tableColumns),c=Oi(l),d=oc(l),h=ac(l),u=x.useMemo(()=>{const $=[];if(d.length)for(const w of d)"value"in w?$.push(V=>{var j;const B=(j=w.value)==null?void 0:j.call(w,V);if(B)return f.jsx("div",{children:B})}):$.push(V=>w.cell(V));return h.length&&$.push(w=>f.jsx(lc,{item:w,columns:h,disablePadding:!0,numberOfColumns:"multiple"})),t.expandedRow&&$.push(t.expandedRow),$.length===0?void 0:$.length===1?$[0]:w=>f.jsx(v.Stack,{hasGutter:!0,style:{gap:12},children:$.map(V=>V(w))})},[d,h,t.expandedRow]),m=t.showSelect||(e==null?void 0:e.find($=>"selection"in $&&$.selection===tt.Multiple))!==void 0,p=!t.disableTableView,y=!t.disableListView,[b,_]=x.useState(()=>t.defaultTableView??(p?ot.Table:y?ot.List:ot.Cards)),T=Vt("md")&&i!==!0;return n?f.jsx(kg,{className:"dark-2",children:f.jsxs(v.EmptyState,{variant:v.EmptyStateVariant.small,style:{paddingTop:48},children:[f.jsx(v.EmptyStateIcon,{icon:Me.ExclamationCircleIcon,color:"var(--pf-global--danger-color--100)"}),f.jsx(v.Title,{headingLevel:"h2",size:"lg",children:t.errorStateTitle}),f.jsx(v.EmptyStateBody,{children:n.message})]})}):s===0&&Object.keys(r??{}).length===0?f.jsxs(v.EmptyState,{variant:v.EmptyStateVariant.large,children:[f.jsx(v.EmptyStateIcon,{icon:t.emptyStateIcon??Me.PlusCircleIcon}),f.jsx(v.Title,{headingLevel:"h4",size:"lg",children:t.emptyStateTitle}),t.emptyStateDescription&&f.jsx(v.EmptyStateBody,{children:t.emptyStateDescription}),t.emptyStateActions&&f.jsx(v.Flex,{justifyContent:{default:"justifyContentCenter"},children:f.jsx(Br,{actions:t.emptyStateActions})}),t.emptyStateButtonClick&&f.jsx(v.Button,{variant:"primary",onClick:t.emptyStateButtonClick,icon:t.emptyStateButtonIcon?t.emptyStateButtonIcon:null,children:t.emptyStateButtonText})]}):s===void 0?f.jsx(v.PageSection,{isFilled:!0,variant:"light",children:f.jsx(v.Bullseye,{children:f.jsx(v.Spinner,{})})}):f.jsxs(f.Fragment,{children:[f.jsx(kc,{...t,openColumnModal:o,showSelect:m,viewType:b,setViewType:_,bottomBorder:!0}),b===ot.Table&&f.jsx(ri,{disablePadding:i,children:f.jsx(Og,{...t,tableColumns:c,expandedRow:u})}),b===ot.List&&f.jsx(Ai,{children:f.jsx(v.PageSection,{padding:{default:"noPadding",md:"padding"},children:f.jsx("div",{style:{borderLeft:T?"thin solid var(--pf-global--BorderColor--100)":void 0,borderRight:T?"thin solid var(--pf-global--BorderColor--100)":void 0},children:f.jsx(yg,{...t,showSelect:m})})})}),b===ot.Cards&&f.jsx(Ai,{children:f.jsx($c,{...t,showSelect:m})}),(!t.autoHidePagination||(t.itemCount??0)>t.perPage)&&f.jsx(og,{...t,topBorder:!0}),a]})}function Og(t){const{tableColumns:e,pageItems:r,selectItem:n,unselectItem:s,isSelected:i,isSelectMultiple:o,keyFn:a,rowActions:l,toolbarActions:c,itemCount:d,perPage:h,clearAllFilters:u,onSelect:m,unselectAll:p,expandedRow:y}=t,[b]=pt(),_=t.showSelect||(c==null?void 0:c.find(j=>"selection"in j&&j.selection===tt.Multiple))!==void 0,T=x.useRef(null),[$,E]=x.useState({left:0,right:0,top:0,bottom:0}),w=x.useCallback(j=>{j&&E({top:j.scrollTop,bottom:j.scrollHeight-j.clientHeight-j.scrollTop,left:j.scrollLeft,right:j.scrollWidth-j.clientWidth-j.scrollLeft})},[]),V=x.useCallback(j=>w(j.currentTarget),[w]);gs(T,()=>w(T.current)),x.useEffect(()=>w(T.current),[w]);const B=Ur();return f.jsxs(_g,{className:"pf-c-scroll-inner-wrapper",ref:T,onScroll:V,children:[f.jsxs(Le.TableComposable,{"aria-label":"Simple table",variant:t.compact||B.tableLayout==="compact"?"compact":void 0,gridBreakPoint:"",isStickyHeader:!0,className:"page-table",children:[d===void 0?f.jsx(Le.Thead,{children:f.jsx(Le.Tr,{children:f.jsx(Le.Th,{children:f.jsx(v.Skeleton,{})})})}):f.jsx(Cg,{...t,showSelect:_,scrollLeft:$.left>0,scrollRight:$.right>1,tableColumns:e,onSelect:m}),f.jsx(Le.Tbody,{children:d===void 0?new Array(h).fill(0).map((j,S)=>f.jsx(Le.Tr,{children:f.jsx(Le.Td,{children:f.jsx(Tg,{children:f.jsx(v.Skeleton,{height:"27px"})})})},S)):r===void 0?new Array(Math.min(h,d)).fill(0).map((j,S)=>f.jsxs(Le.Tr,{children:[_&&f.jsx(Le.Td,{}),f.jsx(Le.Td,{colSpan:e.length,children:f.jsx(jg,{children:f.jsx(v.Skeleton,{height:"27px"})})})]},S)):r==null?void 0:r.map((j,S)=>f.jsx(Pg,{columns:e,item:j,isItemSelected:i==null?void 0:i(j),isSelectMultiple:o,selectItem:n,unselectItem:s,rowActions:l,rowIndex:S,showSelect:_,scrollLeft:$.left>0,scrollRight:$.right>1,unselectAll:p,onSelect:m,expandedRow:y,isLastRow:S===r.length-1},a?a(j):S))})]}),d===0&&f.jsxs(v.EmptyState,{style:{paddingTop:48},children:[f.jsx(v.EmptyStateIcon,{icon:Me.SearchIcon}),f.jsx(v.Title,{headingLevel:"h2",size:"lg",children:b.noResultsFound}),f.jsx(v.EmptyStateBody,{children:b.noResultsMatchCriteria}),u&&f.jsx(v.EmptyStateSecondaryActions,{children:f.jsx(v.Button,{variant:"primary",onClick:u,children:b.clearAllFilters})})]})]})}function Cg(t){const{tableColumns:e,rowActions:r,sort:n,setSort:s,sortDirection:i,setSortDirection:o,showSelect:a,onSelect:l,expandedRow:c}=t,d=x.useCallback((h,u)=>{if(u.sort)return{onSort:(m,p,y)=>{u.sort&&(s==null||s(u.sort),o==null||o(y))},sortBy:{index:u.sort===n?h:void 0,direction:u.sort===n?i:void 0,defaultDirection:u.defaultSortDirection},columnIndex:h}},[s,o,n,i]);return f.jsx(Le.Thead,{children:f.jsxs(Le.Tr,{className:"light dark-2",children:[c&&f.jsx(Le.Th,{style:{padding:0,backgroundColor:"inherit"}}),(a||l)&&f.jsx(Le.Th,{isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:t.scrollLeft,style:{backgroundColor:"inherit"},children:" "}),e.filter(h=>h.enabled!==!1).map((h,u)=>f.jsx(Le.Th,{sort:d(u,h),modifier:"nowrap",style:{minWidth:h.minWidth===0?"1%":h.minWidth!==void 0?h.minWidth:void 0,maxWidth:h.maxWidth!==void 0?h.maxWidth:void 0,backgroundColor:"inherit"},children:h.header},h.header)),r!==void 0&&f.jsx(Le.Td,{isActionCell:!0,isStickyColumn:!0,stickyMinWidth:"0px",style:{right:0,padding:0,paddingRight:0,backgroundColor:"inherit",zIndex:302},className:t.scrollRight?"pf-m-border-left":void 0,children:" "})]})})}function Pg(t){const{columns:e,unselectAll:r,selectItem:n,unselectItem:s,isItemSelected:i,isSelectMultiple:o,item:a,rowActions:l,rowIndex:c,showSelect:d,onSelect:h,expandedRow:u}=t,[m,p]=x.useState(!1),y=Ur(),b=u==null?void 0:u(a);return f.jsxs(f.Fragment,{children:[f.jsxs(Le.Tr,{isRowSelected:m,style:{boxShadow:"unset",borderBottom:m||t.isLastRow?"unset":void 0},children:[u&&f.jsx(Le.Td,{expand:b?{rowIndex:c,isExpanded:m,onToggle:()=>p(_=>!_)}:void 0,style:{paddingLeft:b?8:4}}),d&&f.jsx(Le.Th,{select:i!==void 0?{onSelect:(_,T)=>{T?n==null||n(a):s==null||s(a)},isSelected:i}:void 0,isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:t.scrollLeft}),h&&f.jsx(Le.Td,{select:{rowIndex:c,onSelect:()=>{o||r==null||r(),n==null||n(a),h==null||h(a)},isSelected:i??!1,variant:o?"checkbox":"radio"},isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:t.scrollLeft}),f.jsx(Ng,{columns:e,item:a,rowActions:l,scrollLeft:t.scrollLeft,scrollRight:t.scrollRight})]}),u&&m&&b&&f.jsxs(Le.Tr,{isExpanded:m,style:{boxShadow:"unset"},children:[f.jsx(Le.Td,{}),d&&f.jsx(Le.Th,{isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:t.scrollLeft}),h&&f.jsx(Le.Td,{isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:t.scrollLeft}),f.jsx(Le.Td,{colSpan:e.filter(_=>_.enabled!==!1).length,style:{paddingBottom:y.tableLayout==="compact"?12:24,paddingTop:0},children:f.jsx(Le.CollapseColumn,{children:b})}),l!==void 0&&l.length>0&&f.jsx(Le.Td,{isActionCell:!0,isStickyColumn:!0,stickyMinWidth:"0px",style:{right:0,padding:0,paddingRight:0},className:t.scrollRight?"pf-m-border-left":void 0,children:" "})]})]})}function Ng(t){const{columns:e,item:r,rowActions:n}=t,[s,i]=x.useState(!1);return f.jsxs(x.Fragment,{children:[e.filter(o=>o.enabled!==!1).map(o=>f.jsx(Le.Td,{dataLabel:o.header,modifier:"nowrap",style:{width:o.minWidth===0?"0%":void 0},children:f.jsx(St,{item:r,column:o})},o.header)),n!==void 0&&n.length>0&&f.jsx(Le.Td,{isActionCell:!0,isStickyColumn:!0,stickyMinWidth:"0px",style:{right:0,padding:0,paddingRight:0,zIndex:s?400:void 0},className:t.scrollRight?"pf-m-border-left":void 0,children:f.jsx(Br,{actions:n,selectedItem:r,position:v.DropdownPosition.right,iconOnly:!0,onOpen:i})})]})}function Fi(t,e,r){var n,s,i,o,a;e==null&&(e=100);function l(){var d=Date.now()-o;d<e&&d>=0?n=setTimeout(l,e-d):(n=null,r||(a=t.apply(i,s),i=s=null))}var c=function(){i=this,s=arguments,o=Date.now();var d=r&&!n;return n||(n=setTimeout(l,e)),d&&(a=t.apply(i,s),i=s=null),a};return c.clear=function(){n&&(clearTimeout(n),n=null)},c.flush=function(){n&&(a=t.apply(i,s),i=s=null,clearTimeout(n),n=null)},c}Fi.debounce=Fi;var Dg=Fi;function Ig(t,e,r){const{selectedItems:n,selectItem:s,unselectItem:i,isSelected:o,selectItems:a,unselectAll:l,allSelected:c}=Tc(t,e),{sorted:d,sort:h,setSort:u}=Mi(t),{filtered:m,setFilterFn:p}=Vi(d,e),{searched:y,search:b,setSearch:_,setSearchFn:T}=Ag(m,e,r==null?void 0:r.search),{paged:$,page:E,setPage:w,perPage:V,setPerPage:B}=En(y),j=x.useCallback(()=>a($),[$,a]),S=x.useCallback(()=>a(y),[y,a]);return x.useMemo(()=>({allSelected:c,filtered:m,isSelected:o,page:E,paged:$,perPage:V,search:b,searched:y,selectAll:S,selectItem:s,selectPage:j,selectedItems:n,setFilterFn:p,setPage:w,setPerPage:B,setSearch:_,setSearchFn:T,setSort:u,sort:h,sorted:d,unselectAll:l,unselectItem:i}),[c,m,o,E,$,V,b,y,S,s,j,n,p,w,B,_,T,u,h,d,l,i])}function Tc(t,e,r){const[n,s]=x.useState(()=>r?r.reduce((p,y)=>(p[e(y)]=y,p),{}):{});x.useEffect(()=>{s(p=>{let y=!1;return t.forEach(b=>{const _=e(b);p[_]&&p[_]!==b&&(y=!0,p[_]=b)}),y?{...p}:p})},[t,e]);const i=x.useCallback(p=>{s(y=>{const b=e(p);return y[b]!==p&&(y={...y},y[b]=p),y})},[e]),o=x.useCallback(p=>{s(y=>{const b=e(p);return y[b]&&(y={...y},delete y[b]),y})},[e]),a=x.useCallback(p=>{const y=e(p);return n[y]!==void 0},[e,n]),l=x.useCallback(p=>{s(y=>{y={...y};for(const b of p){const _=e(b);y[_]=b}return y})},[e]),c=x.useCallback(()=>l(t),[t,l]),d=x.useCallback(p=>{for(const y of p)o(y)},[o]),h=x.useCallback(()=>{s(p=>Object.keys(p).length>0?{}:p)},[]),u=x.useMemo(()=>Object.values(n),[n]),m=x.useMemo(()=>u.length===t.length,[t.length,u.length]);return x.useMemo(()=>({selectedItems:u,selectItem:i,unselectItem:o,isSelected:a,selectItems:l,selectAll:c,unselectAll:h,allSelected:m,keyFn:e,unselectItems:d}),[m,a,e,c,i,l,u,h,o,d])}function jc(t,e){const[r,n]=x.useState({});x.useEffect(()=>{n(m=>{let p=!1;const y=t?t.reduce((T,$)=>{const E=e($);return T[E]=$,m[E]&&m[E]!==$&&(p=!0,m[E]=$),T},{}):{},b={};for(const T in m)y[T]||(b[T]=!0);const _=Object.keys(b);if(_.length){p=!0;for(const T of _)delete m[T]}return p?{...m}:m})},[t,e]);const s=x.useCallback(m=>{n(p=>{const y=e(m);return p[y]!==m&&(p={...p},p[y]=m),p})},[e]),i=x.useCallback(m=>{n(p=>{const y=e(m);return p[y]&&(p={...p},delete p[y]),p})},[e]),o=x.useCallback(m=>{for(const p of m)i(p)},[i]),a=x.useCallback(m=>{const p=e(m);return r[p]!==void 0},[e,r]),l=x.useCallback(m=>{n(p=>{p={...p};for(const y of m){const b=e(y);p[b]=y}return p})},[e]),c=x.useCallback(()=>{l(t??[])},[t,l]),d=x.useCallback(()=>{n(m=>Object.keys(m).length>0?{}:m)},[]),h=x.useMemo(()=>Object.values(r),[r]),u=x.useMemo(()=>h.length===(t==null?void 0:t.length),[t,h.length]);return x.useMemo(()=>({selectedItems:h,selectItem:s,unselectItem:i,isSelected:a,selectItems:l,selectAll:c,unselectAll:d,allSelected:u,keyFn:e,unselectItems:o}),[u,a,e,c,s,l,h,d,i,o])}function Mi(t){const[e,r]=x.useState(),{direction:n,sortFn:s}=e??{},i=x.useMemo(()=>t?s?n==="asc"?[...t.sort(s)]:[...t.sort(s).reverse()]:t:[],[n,t,s]);return x.useMemo(()=>({sorted:i,sort:e,setSort:r}),[e,i])}function Vi(t,e){const r=x.useRef({map:{}}),[n,s]=x.useState(),i=x.useCallback(c=>s(()=>c),[]),[o,a]=x.useState([]);x.useEffect(()=>{r.current.map={}},[n]);const l=x.useCallback(c=>{const d=e(c);let h=r.current.map[d];return h?h.item!==c&&(h.item=c,h.passes=n?n(c):!0):(h={item:c,passes:n?n(c):!0},r.current.map[d]=h),h.passes},[n,e]);return x.useEffect(()=>{a(n?t.filter(l):t)},[t,n,l]),x.useMemo(function(){return{filtered:o,setFilterFn:i}},[o,i])}function Ag(t,e,r){const n=x.useRef({map:{}}),[s,i]=x.useState(),o=x.useCallback(m=>i(()=>m),[]),[a,l]=x.useState([]),[c,d]=x.useState(r??""),h=x.useCallback(Dg(m=>d(m),200),[]);x.useEffect(()=>{n.current.map={}},[c,s]);const u=x.useCallback(m=>{const p=e(m);let y=n.current.map[p];return y?y.item!==m&&(y.item=m,y.score=s?s(m,c):0):(y={item:m,score:s?s(m,c):0},n.current.map[p]=y),y},[e,s,c]);return x.useEffect(()=>{l(s&&c?t.map(u).filter(m=>m.score<.5).sort((m,p)=>m.score-p.score).map(m=>m.item):t)},[c,t,s,u]),x.useMemo(function(){return{searched:a,search:c,setSearch:h,setSearchFn:o}},[a,c,h,o])}function En(t){const[e,r]=x.useState([]),[n,s]=x.useState(1),[i,o]=x.useState(10);return x.useEffect(()=>{r(a=>{const l=t.slice((n-1)*i,n*i);if(a.length!==l.length)return l;let c=0;for(const d of l)if(a[c++]!==d)return l;return a})},[n,i,t]),x.useEffect(()=>{n>Math.ceil(t.length/i)&&s(1)},[n,i,t.length]),x.useMemo(()=>({paged:e,page:n,setPage:s,perPage:i,setPerPage:o}),[n,e,i])}function Fg(t){const{title:e,items:r,keyFn:n,actionColumns:s,actionFn:i,onComplete:o,onClose:a,processingText:l,isDanger:c}=t,[d]=pt(),[h,u]=x.useState(!0),[m,p]=x.useState(!1),[y,b]=x.useState(0),[_,T]=x.useState(""),[$,E]=x.useState(),[w]=x.useState(()=>new AbortController),[V,B]=fr(),j=x.useCallback(()=>{p(!0),w.abort(),u(!1),E(K=>{const J={...K};for(const te of r){const ne=n(te);J[ne]===void 0&&(J[ne]="Cancelled")}return J})},[w,r,n]),S=x.useCallback(()=>{B(void 0),a==null||a()},[a,B]);x.useEffect(()=>{async function K(){const J=Pp(5);let te=0;const ne=[];await Promise.all(r.map(I=>J(async()=>{if(w.signal.aborted)return;const k=n(I);try{await i(I,w.signal),w.signal.aborted||E(L=>({...L??{},[k]:null})),ne.push(I)}catch(L){if(!w.signal.aborted){if(L instanceof Error){const H=L.message;E(Z=>({...Z??{},[k]:H}))}else E(H=>({...H??{},[k]:"Unknown error"}));T(d.errorText)}}finally{w.signal.aborted||b(++te)}}))),w.signal.aborted||u(!1),o==null||o(ne)}K()},[w,i,r,n,o,d.errorText]);const{paged:C,page:N,perPage:M,setPage:R,setPerPage:Y}=En(r);return f.jsxs(v.Modal,{titleIconVariant:c?"warning":void 0,title:e,variant:v.ModalVariant.medium,isOpen:!0,onClose:()=>{j(),S()},actions:h?[f.jsx(v.Button,{variant:"link",onClick:j,children:d.cancelText},"cancel")]:[f.jsx(v.Button,{variant:"secondary",onClick:S,children:d.closeText},"close")],hasNoBodyWrapper:!0,children:[f.jsx(v.ModalBoxBody,{style:{paddingBottom:0,paddingLeft:0,paddingRight:0},children:f.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:560,overflow:"hidden",borderTop:"thin solid var(--pf-global--BorderColor--100)"},children:f.jsx(Sn,{pageItems:[...C],itemCount:r.length,tableColumns:[...s,{header:"Status",cell:K=>{const J=n(K),te=$==null?void 0:$[J];return te===void 0?f.jsxs("span",{style:{color:ki},children:[f.jsx(Me.PendingIcon,{}),"  ",d.pendingText]}):te===null?f.jsxs("span",{style:{color:$i},children:[f.jsx(Me.CheckCircleIcon,{}),"  ",d.successText]}):f.jsxs("span",{style:{color:_i},children:[f.jsx(Me.ExclamationCircleIcon,{}),"  ",$==null?void 0:$[J]]})}}],keyFn:n,page:N,perPage:M,setPage:R,setPerPage:Y,compact:!0,errorStateTitle:"",emptyStateTitle:"No items",autoHidePagination:!0,disableBodyPadding:!0},"status")})}),f.jsx(v.ModalBoxBody,{style:{paddingTop:0},children:f.jsx(v.Progress,{value:y/r.length*100,title:w.signal.aborted?d.canceledText:_?d.errorText:h?l??d.processingText:d.successText,size:v.ProgressSize.lg,variant:_||m?v.ProgressVariant.danger:y===r.length?v.ProgressVariant.success:void 0})})]})}function Oc(){const[t,e]=fr(),[r,n]=x.useState();return x.useEffect(()=>{if(r){const s=()=>{var i;n(void 0),(i=r.onClose)==null||i.call(r)};e(f.jsx(Fg,{...r,onClose:s}))}else e(void 0)},[r,e]),n}function Cc(t,e){if(t==null&&e==null)return 0;if(t==null)return 1;if(e==null)return-1;if(typeof t=="string"){if(typeof e=="string")return $n(t,e);if(typeof e=="number")return $n(t,e.toString())}else if(typeof t=="number"){if(typeof e=="number")return Pc(t,e);if(typeof e=="string")return $n(t.toString(),e)}return 0}function $n(t,e){return t==null&&e==null?0:t==null?1:e==null||t<e?-1:t>e?1:0}function Pc(t,e){return t==null&&e==null?0:t==null?1:e==null||t<e?-1:t>e?1:0}const Mg=at.div`
186
+ `;function Sn(t){const{toolbarActions:e,filters:r,error:n,itemCount:s,disableBodyPadding:i}=t,{openColumnModal:o,columnModal:a,managedColumns:l}=ig(t.tableColumns),c=Oi(l),d=oc(l),h=ac(l),u=x.useMemo(()=>{const $=[];if(d.length)for(const w of d)"value"in w?$.push(V=>{var j;const B=(j=w.value)==null?void 0:j.call(w,V);if(B)return f.jsx("div",{children:B})}):$.push(V=>w.cell(V));return h.length&&$.push(w=>f.jsx(lc,{item:w,columns:h,disablePadding:!0,numberOfColumns:"multiple"})),t.expandedRow&&$.push(t.expandedRow),$.length===0?void 0:$.length===1?$[0]:w=>f.jsx(v.Stack,{hasGutter:!0,style:{gap:12},children:$.map(V=>V(w))})},[d,h,t.expandedRow]),m=t.showSelect||(e==null?void 0:e.find($=>"selection"in $&&$.selection===tt.Multiple))!==void 0,p=!t.disableTableView,y=!t.disableListView,[b,_]=x.useState(()=>t.defaultTableView??(p?ot.Table:y?ot.List:ot.Cards)),T=Vt("md")&&i!==!0;return n?f.jsx(kg,{className:"dark-2",children:f.jsxs(v.EmptyState,{variant:v.EmptyStateVariant.small,style:{paddingTop:48},children:[f.jsx(v.EmptyStateIcon,{icon:Me.ExclamationCircleIcon,color:"var(--pf-global--danger-color--100)"}),f.jsx(v.Title,{headingLevel:"h2",size:"lg",children:t.errorStateTitle}),f.jsx(v.EmptyStateBody,{children:n.message})]})}):s===0&&Object.keys(r??{}).length===0?f.jsxs(v.EmptyState,{variant:v.EmptyStateVariant.large,children:[f.jsx(v.EmptyStateIcon,{icon:t.emptyStateIcon??Me.PlusCircleIcon}),f.jsx(v.Title,{headingLevel:"h4",size:"lg",children:t.emptyStateTitle}),t.emptyStateDescription&&f.jsx(v.EmptyStateBody,{children:t.emptyStateDescription}),t.emptyStateActions&&f.jsx(v.Flex,{justifyContent:{default:"justifyContentCenter"},children:f.jsx(Br,{actions:t.emptyStateActions})}),t.emptyStateButtonClick&&f.jsx(v.Button,{variant:"primary",onClick:t.emptyStateButtonClick,icon:t.emptyStateButtonIcon?t.emptyStateButtonIcon:null,children:t.emptyStateButtonText})]}):s===void 0?f.jsx(v.PageSection,{isFilled:!0,variant:"light",children:f.jsx(v.Bullseye,{children:f.jsx(v.Spinner,{})})}):f.jsxs(f.Fragment,{children:[f.jsx(kc,{...t,openColumnModal:o,showSelect:m,viewType:b,setViewType:_,bottomBorder:!0}),b===ot.Table&&f.jsx(ri,{disablePadding:i,children:f.jsx(Og,{...t,tableColumns:c,expandedRow:u})}),b===ot.List&&f.jsx(Ai,{children:f.jsx(v.PageSection,{padding:{default:"noPadding",md:"padding"},children:f.jsx("div",{style:{borderLeft:T?"thin solid var(--pf-global--BorderColor--100)":void 0,borderRight:T?"thin solid var(--pf-global--BorderColor--100)":void 0},children:f.jsx(yg,{...t,showSelect:m})})})}),b===ot.Cards&&f.jsx(Ai,{children:f.jsx($c,{...t,showSelect:m})}),(!t.autoHidePagination||(t.itemCount??0)>t.perPage)&&f.jsx(og,{...t,topBorder:!0}),a]})}function Og(t){const{tableColumns:e,pageItems:r,selectItem:n,unselectItem:s,isSelected:i,isSelectMultiple:o,keyFn:a,rowActions:l,toolbarActions:c,itemCount:d,perPage:h,clearAllFilters:u,onSelect:m,unselectAll:p,expandedRow:y}=t,[b]=pt(),_=t.showSelect||(c==null?void 0:c.find(j=>"selection"in j&&j.selection===tt.Multiple))!==void 0,T=x.useRef(null),[$,E]=x.useState({left:0,right:0,top:0,bottom:0}),w=x.useCallback(j=>{j&&E({top:j.scrollTop,bottom:j.scrollHeight-j.clientHeight-j.scrollTop,left:j.scrollLeft,right:j.scrollWidth-j.clientWidth-j.scrollLeft})},[]),V=x.useCallback(j=>w(j.currentTarget),[w]);gs(T,()=>w(T.current)),x.useEffect(()=>w(T.current),[w]);const B=Ur();return f.jsxs(_g,{className:"pf-c-scroll-inner-wrapper",ref:T,onScroll:V,children:[f.jsxs(Le.TableComposable,{"aria-label":"Simple table",variant:t.compact||B.tableLayout==="compact"?"compact":void 0,gridBreakPoint:"",isStickyHeader:!0,className:"page-table",children:[d===void 0?f.jsx(Le.Thead,{children:f.jsx(Le.Tr,{children:f.jsx(Le.Th,{children:f.jsx(v.Skeleton,{})})})}):f.jsx(Cg,{...t,showSelect:_,scrollLeft:$.left>0,scrollRight:$.right>1,tableColumns:e,onSelect:m}),f.jsx(Le.Tbody,{children:d===void 0?new Array(h).fill(0).map((j,S)=>f.jsx(Le.Tr,{children:f.jsx(Le.Td,{children:f.jsx(Tg,{children:f.jsx(v.Skeleton,{height:"27px"})})})},S)):r===void 0?new Array(Math.min(h,d)).fill(0).map((j,S)=>f.jsxs(Le.Tr,{children:[_&&f.jsx(Le.Td,{}),f.jsx(Le.Td,{colSpan:e.length,children:f.jsx(jg,{children:f.jsx(v.Skeleton,{height:"27px"})})})]},S)):r==null?void 0:r.map((j,S)=>f.jsx(Pg,{columns:e,item:j,isItemSelected:i==null?void 0:i(j),isSelectMultiple:o,selectItem:n,unselectItem:s,rowActions:l,rowIndex:S,showSelect:_,scrollLeft:$.left>0,scrollRight:$.right>1,unselectAll:p,onSelect:m,expandedRow:y,isLastRow:S===r.length-1,disableLastRowBorder:t.disableLastRowBorder},a?a(j):S))})]}),d===0&&f.jsxs(v.EmptyState,{style:{paddingTop:48},children:[f.jsx(v.EmptyStateIcon,{icon:Me.SearchIcon}),f.jsx(v.Title,{headingLevel:"h2",size:"lg",children:b.noResultsFound}),f.jsx(v.EmptyStateBody,{children:b.noResultsMatchCriteria}),u&&f.jsx(v.EmptyStateSecondaryActions,{children:f.jsx(v.Button,{variant:"primary",onClick:u,children:b.clearAllFilters})})]})]})}function Cg(t){const{tableColumns:e,rowActions:r,sort:n,setSort:s,sortDirection:i,setSortDirection:o,showSelect:a,onSelect:l,expandedRow:c}=t,d=x.useCallback((h,u)=>{if(u.sort)return{onSort:(m,p,y)=>{u.sort&&(s==null||s(u.sort),o==null||o(y))},sortBy:{index:u.sort===n?h:void 0,direction:u.sort===n?i:void 0,defaultDirection:u.defaultSortDirection},columnIndex:h}},[s,o,n,i]);return f.jsx(Le.Thead,{children:f.jsxs(Le.Tr,{className:"light dark-2",children:[c&&f.jsx(Le.Th,{style:{padding:0,backgroundColor:"inherit"}}),(a||l)&&f.jsx(Le.Th,{isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:t.scrollLeft,style:{backgroundColor:"inherit"},children:" "}),e.filter(h=>h.enabled!==!1).map((h,u)=>f.jsx(Le.Th,{sort:d(u,h),modifier:"nowrap",style:{minWidth:h.minWidth===0?"1%":h.minWidth!==void 0?h.minWidth:void 0,maxWidth:h.maxWidth!==void 0?h.maxWidth:void 0,backgroundColor:"inherit"},children:h.header},h.header)),r!==void 0&&f.jsx(Le.Td,{isActionCell:!0,isStickyColumn:!0,stickyMinWidth:"0px",style:{right:0,padding:0,paddingRight:0,backgroundColor:"inherit",zIndex:302},className:t.scrollRight?"pf-m-border-left":void 0,children:" "})]})})}function Pg(t){const{columns:e,unselectAll:r,selectItem:n,unselectItem:s,isItemSelected:i,isSelectMultiple:o,item:a,rowActions:l,rowIndex:c,showSelect:d,onSelect:h,expandedRow:u,disableLastRowBorder:m}=t,[p,y]=x.useState(!1),b=Ur(),_=u==null?void 0:u(a);return f.jsxs(f.Fragment,{children:[f.jsxs(Le.Tr,{isRowSelected:p,style:{boxShadow:"unset",borderBottom:p||t.isLastRow&&m?"unset":void 0},children:[u&&f.jsx(Le.Td,{expand:_?{rowIndex:c,isExpanded:p,onToggle:()=>y(T=>!T)}:void 0,style:{paddingLeft:_?8:4}}),d&&f.jsx(Le.Th,{select:i!==void 0?{onSelect:(T,$)=>{$?n==null||n(a):s==null||s(a)},isSelected:i}:void 0,isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:t.scrollLeft}),h&&f.jsx(Le.Td,{select:{rowIndex:c,onSelect:()=>{o||r==null||r(),n==null||n(a),h==null||h(a)},isSelected:i??!1,variant:o?"checkbox":"radio"},isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:t.scrollLeft}),f.jsx(Ng,{columns:e,item:a,rowActions:l,scrollLeft:t.scrollLeft,scrollRight:t.scrollRight})]}),u&&p&&_&&f.jsxs(Le.Tr,{isExpanded:p,style:{boxShadow:"unset"},children:[f.jsx(Le.Td,{}),d&&f.jsx(Le.Th,{isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:t.scrollLeft}),h&&f.jsx(Le.Td,{isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:t.scrollLeft}),f.jsx(Le.Td,{colSpan:e.filter(T=>T.enabled!==!1).length,style:{paddingBottom:b.tableLayout==="compact"?12:24,paddingTop:0},children:f.jsx(Le.CollapseColumn,{children:_})}),l!==void 0&&l.length>0&&f.jsx(Le.Td,{isActionCell:!0,isStickyColumn:!0,stickyMinWidth:"0px",style:{right:0,padding:0,paddingRight:0},className:t.scrollRight?"pf-m-border-left":void 0,children:" "})]})]})}function Ng(t){const{columns:e,item:r,rowActions:n}=t,[s,i]=x.useState(!1);return f.jsxs(x.Fragment,{children:[e.filter(o=>o.enabled!==!1).map(o=>f.jsx(Le.Td,{dataLabel:o.header,modifier:"nowrap",style:{width:o.minWidth===0?"0%":void 0},children:f.jsx(St,{item:r,column:o})},o.header)),n!==void 0&&n.length>0&&f.jsx(Le.Td,{isActionCell:!0,isStickyColumn:!0,stickyMinWidth:"0px",style:{right:0,padding:0,paddingRight:0,zIndex:s?400:void 0},className:t.scrollRight?"pf-m-border-left":void 0,children:f.jsx(Br,{actions:n,selectedItem:r,position:v.DropdownPosition.right,iconOnly:!0,onOpen:i})})]})}function Fi(t,e,r){var n,s,i,o,a;e==null&&(e=100);function l(){var d=Date.now()-o;d<e&&d>=0?n=setTimeout(l,e-d):(n=null,r||(a=t.apply(i,s),i=s=null))}var c=function(){i=this,s=arguments,o=Date.now();var d=r&&!n;return n||(n=setTimeout(l,e)),d&&(a=t.apply(i,s),i=s=null),a};return c.clear=function(){n&&(clearTimeout(n),n=null)},c.flush=function(){n&&(a=t.apply(i,s),i=s=null,clearTimeout(n),n=null)},c}Fi.debounce=Fi;var Dg=Fi;function Ig(t,e,r){const{selectedItems:n,selectItem:s,unselectItem:i,isSelected:o,selectItems:a,unselectAll:l,allSelected:c}=Tc(t,e),{sorted:d,sort:h,setSort:u}=Mi(t),{filtered:m,setFilterFn:p}=Vi(d,e),{searched:y,search:b,setSearch:_,setSearchFn:T}=Ag(m,e,r==null?void 0:r.search),{paged:$,page:E,setPage:w,perPage:V,setPerPage:B}=En(y),j=x.useCallback(()=>a($),[$,a]),S=x.useCallback(()=>a(y),[y,a]);return x.useMemo(()=>({allSelected:c,filtered:m,isSelected:o,page:E,paged:$,perPage:V,search:b,searched:y,selectAll:S,selectItem:s,selectPage:j,selectedItems:n,setFilterFn:p,setPage:w,setPerPage:B,setSearch:_,setSearchFn:T,setSort:u,sort:h,sorted:d,unselectAll:l,unselectItem:i}),[c,m,o,E,$,V,b,y,S,s,j,n,p,w,B,_,T,u,h,d,l,i])}function Tc(t,e,r){const[n,s]=x.useState(()=>r?r.reduce((p,y)=>(p[e(y)]=y,p),{}):{});x.useEffect(()=>{s(p=>{let y=!1;return t.forEach(b=>{const _=e(b);p[_]&&p[_]!==b&&(y=!0,p[_]=b)}),y?{...p}:p})},[t,e]);const i=x.useCallback(p=>{s(y=>{const b=e(p);return y[b]!==p&&(y={...y},y[b]=p),y})},[e]),o=x.useCallback(p=>{s(y=>{const b=e(p);return y[b]&&(y={...y},delete y[b]),y})},[e]),a=x.useCallback(p=>{const y=e(p);return n[y]!==void 0},[e,n]),l=x.useCallback(p=>{s(y=>{y={...y};for(const b of p){const _=e(b);y[_]=b}return y})},[e]),c=x.useCallback(()=>l(t),[t,l]),d=x.useCallback(p=>{for(const y of p)o(y)},[o]),h=x.useCallback(()=>{s(p=>Object.keys(p).length>0?{}:p)},[]),u=x.useMemo(()=>Object.values(n),[n]),m=x.useMemo(()=>u.length===t.length,[t.length,u.length]);return x.useMemo(()=>({selectedItems:u,selectItem:i,unselectItem:o,isSelected:a,selectItems:l,selectAll:c,unselectAll:h,allSelected:m,keyFn:e,unselectItems:d}),[m,a,e,c,i,l,u,h,o,d])}function jc(t,e){const[r,n]=x.useState({});x.useEffect(()=>{n(m=>{let p=!1;const y=t?t.reduce((T,$)=>{const E=e($);return T[E]=$,m[E]&&m[E]!==$&&(p=!0,m[E]=$),T},{}):{},b={};for(const T in m)y[T]||(b[T]=!0);const _=Object.keys(b);if(_.length){p=!0;for(const T of _)delete m[T]}return p?{...m}:m})},[t,e]);const s=x.useCallback(m=>{n(p=>{const y=e(m);return p[y]!==m&&(p={...p},p[y]=m),p})},[e]),i=x.useCallback(m=>{n(p=>{const y=e(m);return p[y]&&(p={...p},delete p[y]),p})},[e]),o=x.useCallback(m=>{for(const p of m)i(p)},[i]),a=x.useCallback(m=>{const p=e(m);return r[p]!==void 0},[e,r]),l=x.useCallback(m=>{n(p=>{p={...p};for(const y of m){const b=e(y);p[b]=y}return p})},[e]),c=x.useCallback(()=>{l(t??[])},[t,l]),d=x.useCallback(()=>{n(m=>Object.keys(m).length>0?{}:m)},[]),h=x.useMemo(()=>Object.values(r),[r]),u=x.useMemo(()=>h.length===(t==null?void 0:t.length),[t,h.length]);return x.useMemo(()=>({selectedItems:h,selectItem:s,unselectItem:i,isSelected:a,selectItems:l,selectAll:c,unselectAll:d,allSelected:u,keyFn:e,unselectItems:o}),[u,a,e,c,s,l,h,d,i,o])}function Mi(t){const[e,r]=x.useState(),{direction:n,sortFn:s}=e??{},i=x.useMemo(()=>t?s?n==="asc"?[...t.sort(s)]:[...t.sort(s).reverse()]:t:[],[n,t,s]);return x.useMemo(()=>({sorted:i,sort:e,setSort:r}),[e,i])}function Vi(t,e){const r=x.useRef({map:{}}),[n,s]=x.useState(),i=x.useCallback(c=>s(()=>c),[]),[o,a]=x.useState([]);x.useEffect(()=>{r.current.map={}},[n]);const l=x.useCallback(c=>{const d=e(c);let h=r.current.map[d];return h?h.item!==c&&(h.item=c,h.passes=n?n(c):!0):(h={item:c,passes:n?n(c):!0},r.current.map[d]=h),h.passes},[n,e]);return x.useEffect(()=>{a(n?t.filter(l):t)},[t,n,l]),x.useMemo(function(){return{filtered:o,setFilterFn:i}},[o,i])}function Ag(t,e,r){const n=x.useRef({map:{}}),[s,i]=x.useState(),o=x.useCallback(m=>i(()=>m),[]),[a,l]=x.useState([]),[c,d]=x.useState(r??""),h=x.useCallback(Dg(m=>d(m),200),[]);x.useEffect(()=>{n.current.map={}},[c,s]);const u=x.useCallback(m=>{const p=e(m);let y=n.current.map[p];return y?y.item!==m&&(y.item=m,y.score=s?s(m,c):0):(y={item:m,score:s?s(m,c):0},n.current.map[p]=y),y},[e,s,c]);return x.useEffect(()=>{l(s&&c?t.map(u).filter(m=>m.score<.5).sort((m,p)=>m.score-p.score).map(m=>m.item):t)},[c,t,s,u]),x.useMemo(function(){return{searched:a,search:c,setSearch:h,setSearchFn:o}},[a,c,h,o])}function En(t){const[e,r]=x.useState([]),[n,s]=x.useState(1),[i,o]=x.useState(10);return x.useEffect(()=>{r(a=>{const l=t.slice((n-1)*i,n*i);if(a.length!==l.length)return l;let c=0;for(const d of l)if(a[c++]!==d)return l;return a})},[n,i,t]),x.useEffect(()=>{n>Math.ceil(t.length/i)&&s(1)},[n,i,t.length]),x.useMemo(()=>({paged:e,page:n,setPage:s,perPage:i,setPerPage:o}),[n,e,i])}function Fg(t){const{title:e,items:r,keyFn:n,actionColumns:s,actionFn:i,onComplete:o,onClose:a,processingText:l,isDanger:c}=t,[d]=pt(),[h,u]=x.useState(!0),[m,p]=x.useState(!1),[y,b]=x.useState(0),[_,T]=x.useState(""),[$,E]=x.useState(),[w]=x.useState(()=>new AbortController),[V,B]=fr(),j=x.useCallback(()=>{p(!0),w.abort(),u(!1),E(K=>{const J={...K};for(const te of r){const ne=n(te);J[ne]===void 0&&(J[ne]="Cancelled")}return J})},[w,r,n]),S=x.useCallback(()=>{B(void 0),a==null||a()},[a,B]);x.useEffect(()=>{async function K(){const J=Pp(5);let te=0;const ne=[];await Promise.all(r.map(I=>J(async()=>{if(w.signal.aborted)return;const k=n(I);try{await i(I,w.signal),w.signal.aborted||E(L=>({...L??{},[k]:null})),ne.push(I)}catch(L){if(!w.signal.aborted){if(L instanceof Error){const H=L.message;E(Z=>({...Z??{},[k]:H}))}else E(H=>({...H??{},[k]:"Unknown error"}));T(d.errorText)}}finally{w.signal.aborted||b(++te)}}))),w.signal.aborted||u(!1),o==null||o(ne)}K()},[w,i,r,n,o,d.errorText]);const{paged:C,page:N,perPage:M,setPage:R,setPerPage:Y}=En(r);return f.jsxs(v.Modal,{titleIconVariant:c?"warning":void 0,title:e,variant:v.ModalVariant.medium,isOpen:!0,onClose:()=>{j(),S()},actions:h?[f.jsx(v.Button,{variant:"link",onClick:j,children:d.cancelText},"cancel")]:[f.jsx(v.Button,{variant:"secondary",onClick:S,children:d.closeText},"close")],hasNoBodyWrapper:!0,children:[f.jsx(v.ModalBoxBody,{style:{paddingBottom:0,paddingLeft:0,paddingRight:0},children:f.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:560,overflow:"hidden",borderTop:"thin solid var(--pf-global--BorderColor--100)"},children:f.jsx(Sn,{pageItems:[...C],itemCount:r.length,tableColumns:[...s,{header:"Status",cell:K=>{const J=n(K),te=$==null?void 0:$[J];return te===void 0?f.jsxs("span",{style:{color:ki},children:[f.jsx(Me.PendingIcon,{}),"  ",d.pendingText]}):te===null?f.jsxs("span",{style:{color:$i},children:[f.jsx(Me.CheckCircleIcon,{}),"  ",d.successText]}):f.jsxs("span",{style:{color:_i},children:[f.jsx(Me.ExclamationCircleIcon,{}),"  ",$==null?void 0:$[J]]})}}],keyFn:n,page:N,perPage:M,setPage:R,setPerPage:Y,compact:!0,errorStateTitle:"",emptyStateTitle:"No items",autoHidePagination:!0,disableBodyPadding:!0},"status")})}),f.jsx(v.ModalBoxBody,{style:{paddingTop:0},children:f.jsx(v.Progress,{value:y/r.length*100,title:w.signal.aborted?d.canceledText:_?d.errorText:h?l??d.processingText:d.successText,size:v.ProgressSize.lg,variant:_||m?v.ProgressVariant.danger:y===r.length?v.ProgressVariant.success:void 0})})]})}function Oc(){const[t,e]=fr(),[r,n]=x.useState();return x.useEffect(()=>{if(r){const s=()=>{var i;n(void 0),(i=r.onClose)==null||i.call(r)};e(f.jsx(Fg,{...r,onClose:s}))}else e(void 0)},[r,e]),n}function Cc(t,e){if(t==null&&e==null)return 0;if(t==null)return 1;if(e==null)return-1;if(typeof t=="string"){if(typeof e=="string")return $n(t,e);if(typeof e=="number")return $n(t,e.toString())}else if(typeof t=="number"){if(typeof e=="number")return Pc(t,e);if(typeof e=="string")return $n(t.toString(),e)}return 0}function $n(t,e){return t==null&&e==null?0:t==null?1:e==null||t<e?-1:t>e?1:0}function Pc(t,e){return t==null&&e==null?0:t==null?1:e==null||t<e?-1:t>e?1:0}const Mg=at.div`
187
187
  display: flex;
188
188
  flex-direction: column;
189
189
  max-height: 560px;
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.12",
4
+ "version": "2.4.14",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",