All Downloads are FREE. Search and download functionalities are using the official Maven repository.

theme.keycloak.v2.admin.resources.assets.DataListItemRow-COCiEHyF.js Maven / Gradle / Ivy

There is a newer version: 26.0.7
Show newest version
import{_ as L,l as h,aM as I}from"./index-C1LIsRX7.js";import*as a from"react";const e={dataList:"pf-v5-c-data-list",dataListAction:"pf-v5-c-data-list__action",dataListCell:"pf-v5-c-data-list__cell",dataListCheck:"pf-v5-c-data-list__check",dataListExpandableContent:"pf-v5-c-data-list__expandable-content",dataListExpandableContentBody:"pf-v5-c-data-list__expandable-content-body",dataListItem:"pf-v5-c-data-list__item",dataListItemAction:"pf-v5-c-data-list__item-action",dataListItemContent:"pf-v5-c-data-list__item-content",dataListItemControl:"pf-v5-c-data-list__item-control",dataListItemDraggableButton:"pf-v5-c-data-list__item-draggable-button",dataListItemDraggableIcon:"pf-v5-c-data-list__item-draggable-icon",dataListItemRow:"pf-v5-c-data-list__item-row",dataListText:"pf-v5-c-data-list__text",dataListToggle:"pf-v5-c-data-list__toggle",dataListToggleIcon:"pf-v5-c-data-list__toggle-icon",dirRtl:"pf-v5-m-dir-rtl",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",icon:"pf-m-icon",alignRight:"pf-m-align-right",noFill:"pf-m-no-fill",flex_2:"pf-m-flex-2",flex_3:"pf-m-flex-3",flex_4:"pf-m-flex-4",flex_5:"pf-m-flex-5",gridNone:"pf-m-grid-none",gridSm:"pf-m-grid-sm",gridMd:"pf-m-grid-md",gridLg:"pf-m-grid-lg",gridXl:"pf-m-grid-xl",grid_2xl:"pf-m-grid-2xl",compact:"pf-m-compact",dragOver:"pf-m-drag-over",truncate:"pf-m-truncate",breakWord:"pf-m-break-word",nowrap:"pf-m-nowrap",clickable:"pf-m-clickable",selected:"pf-m-selected",ghostRow:"pf-m-ghost-row",expanded:"pf-m-expanded",disabled:"pf-m-disabled",noPadding:"pf-m-no-padding"},themeDark:"pf-v5-theme-dark"},k={none:e.modifiers.gridNone,always:"pf-m-grid",sm:e.modifiers.gridSm,md:e.modifiers.gridMd,lg:e.modifiers.gridLg,xl:e.modifiers.gridXl,"2xl":e.modifiers.grid_2xl};var w;(function(t){t.nowrap="nowrap",t.truncate="truncate",t.breakWord="breakWord"})(w||(w={}));const C=a.createContext({isSelectable:!1});class N extends a.Component{constructor(i){super(i),this.ref=a.createRef(),this.getIndex=d=>Array.from(this.ref.current.children).findIndex(n=>n.id===d)}render(){const i=this.props,{className:d,children:n,"aria-label":r,onSelectDataListItem:l,selectedDataListItemId:o,isCompact:c,wrapModifier:p,gridBreakpoint:f,onSelectableRowChange:x}=i,g=L(i,["className","children","aria-label","onSelectDataListItem","selectedDataListItemId","isCompact","wrapModifier","gridBreakpoint","onSelectableRowChange"]),_=l!==void 0,u=(v,b)=>{l(v,b)};return a.createElement(C.Provider,{value:{isSelectable:_,selectedDataListItemId:o,updateSelectedDataListItem:u,onSelectableRowChange:x}},a.createElement("ul",Object.assign({className:h(e.dataList,c&&e.modifiers.compact,k[f],p&&e.modifiers[p],d),style:g.style,role:"list","aria-label":r},g,{ref:this.ref}),n))}}N.displayName="DataList";N.defaultProps={children:null,className:"",selectedDataListItemId:"",isCompact:!1,gridBreakpoint:"md",wrapModifier:null};const E=t=>{var{children:i=null,className:d="",width:n=1,isFilled:r=!0,alignRight:l=!1,isIcon:o=!1,wrapModifier:c=null}=t,p=L(t,["children","className","width","isFilled","alignRight","isIcon","wrapModifier"]);return a.createElement("div",Object.assign({className:h(e.dataListCell,n>1&&e.modifiers[`flex_${n}`],!r&&e.modifiers.noFill,l&&e.modifiers.alignRight,o&&e.modifiers.icon,d,c&&e.modifiers[c])},p),i)};E.displayName="DataListCell";class y extends a.Component{render(){const i=this.props,{children:d,isExpanded:n,className:r,id:l,"aria-labelledby":o,selectableInputAriaLabel:c}=i,p=L(i,["children","isExpanded","className","id","aria-labelledby","selectableInputAriaLabel"]);return a.createElement(C.Consumer,null,({isSelectable:f,selectedDataListItemId:x,updateSelectedDataListItem:g,onSelectableRowChange:_})=>{const u=s=>{let m=s.target;for(;s.currentTarget!==m;){if("onclick"in m&&m.onclick||m.parentNode.classList.contains(e.dataListItemAction)||m.parentNode.classList.contains(e.dataListItemControl))return;m=m.parentNode}g(s,l)},v=s=>{[I.Enter,I.Space].includes(s.key)&&(s.preventDefault(),g(s,l))},b=x===l,D=c?{"aria-label":c}:{"aria-labelledby":o};return a.createElement("li",Object.assign({id:l,className:h(e.dataListItem,n&&e.modifiers.expanded,f&&e.modifiers.clickable,x&&b&&e.modifiers.selected,r),"aria-labelledby":o},f&&{tabIndex:0,onClick:u,onKeyDown:v},f&&b&&{"aria-selected":!0},p),_&&a.createElement("input",Object.assign({className:"pf-v5-screen-reader",type:"radio",checked:b,onChange:s=>_(s,l),tabIndex:-1},D)),a.Children.map(d,s=>a.isValidElement(s)&&a.cloneElement(s,{rowid:o})))})}}y.displayName="DataListItem";y.defaultProps={isExpanded:!1,className:"",id:"",children:null,"aria-labelledby":""};const O=t=>{var{className:i="",dataListCells:d,rowid:n=""}=t,r=L(t,["className","dataListCells","rowid"]);return a.createElement("div",Object.assign({className:h(e.dataListItemContent,i)},r),d)};O.displayName="DataListItemCells";const R=t=>{var{children:i,className:d="",rowid:n="",wrapModifier:r=null}=t,l=L(t,["children","className","rowid","wrapModifier"]);return a.createElement("div",Object.assign({className:h(e.dataListItemRow,d,r&&e.modifiers[r])},l),a.Children.map(i,o=>a.isValidElement(o)&&a.cloneElement(o,{rowid:n})))};R.displayName="DataListItemRow";export{y as D,R as a,O as b,E as c,N as d,e as s};
//# sourceMappingURL=DataListItemRow-COCiEHyF.js.map




© 2015 - 2025 Weber Informatics LLC | Privacy Policy