UNPKG

carbon-react

Version:

A library of reusable React components for easily building user interfaces.

2 lines (1 loc) 615 B
import e from"react";import{ActionPopoverItem as r}from"../action-popover-item/action-popover-item.component.js";const t=t=>e.Children.toArray(t).filter((t=>e.isValidElement(t)&&t.type===r)),o=r=>{var t;return e.isValidElement(r)&&!!(null===(t=r.props)||void 0===t?void 0:t.disabled)},i=e=>e.findIndex(((r,t)=>!o(e[t]))),n=e=>{for(let r=e.length-1;r>=0;r--)if(!o(e[r]))return r;return-1},l=r=>e.Children.toArray(r).some((r=>"string"==typeof r||!!e.isValidElement(r)&&l(r.props.children)));export{l as checkChildrenForString,i as findFirstFocusableItem,n as findLastFocusableItem,t as getItems,o as isItemDisabled};