/* eslint-disable prefer-const */ import BaseFoundation, { DefaultAdapter } from '../base/foundation'; import isEnterPress from '../utils/isEnterPress'; import { BreadcrumbItemInfo, Route } from './itemFoundation'; export interface BreadcrumbAdapter
, S = Record {
notifyClick: (itemInfo: BreadcrumbItemInfo, event: any) => void;
expandCollapsed: (clickEvent?: any) => void
}
export default class BreadcrumbFoundation , S = Record ) {
super({ ...adapter });
}
handleClick(info: BreadcrumbItemInfo, event: any) {
this._adapter.notifyClick(info, event);
}
handleExpand(clickEvent: any) {
this._adapter.expandCollapsed(clickEvent);
}
/**
* A11y: simulate clear button click
*/
handleExpandEnterPress(keyboardEvent: any) {
if (isEnterPress(keyboardEvent)) {
this.handleExpand(keyboardEvent);
}
}
genRoutes(routes: Array