()
| 147 | }; |
| 148 | |
| 149 | render() { |
| 150 | const { |
| 151 | color, |
| 152 | active, |
| 153 | collapsed, |
| 154 | disabled, |
| 155 | download, |
| 156 | el, |
| 157 | inheritedAttributes, |
| 158 | last, |
| 159 | routerAnimation, |
| 160 | routerDirection, |
| 161 | separator, |
| 162 | showCollapsedIndicator, |
| 163 | target, |
| 164 | } = this; |
| 165 | const clickable = this.isClickable(); |
| 166 | const TagType = this.href === undefined ? 'span' : ('a' as any); |
| 167 | |
| 168 | // Links can still be tabbed to when set to disabled if they have an href |
| 169 | // in order to truly disable them we can keep it as an anchor but remove the href |
| 170 | const href = disabled ? undefined : this.href; |
| 171 | const mode = getIonMode(this); |
| 172 | const attrs = |
| 173 | TagType === 'span' |
| 174 | ? {} |
| 175 | : { |
| 176 | download, |
| 177 | href, |
| 178 | target, |
| 179 | }; |
| 180 | |
| 181 | // If the breadcrumb is collapsed, check if it contains the collapsed indicator |
| 182 | // to show the separator as long as it isn't also the last breadcrumb |
| 183 | // otherwise if not collapsed use the value in separator |
| 184 | const showSeparator = last ? false : collapsed ? (showCollapsedIndicator && !last ? true : false) : separator; |
| 185 | |
| 186 | return ( |
| 187 | <Host |
| 188 | onClick={(ev: Event) => openURL(href, ev, routerDirection, routerAnimation)} |
| 189 | aria-disabled={disabled ? 'true' : null} |
| 190 | class={createColorClasses(color, { |
| 191 | [mode]: true, |
| 192 | 'breadcrumb-active': active, |
| 193 | 'breadcrumb-collapsed': collapsed, |
| 194 | 'breadcrumb-disabled': disabled, |
| 195 | 'in-breadcrumbs-color': hostContext('ion-breadcrumbs[color]', el), |
| 196 | 'in-toolbar': hostContext('ion-toolbar', this.el), |
| 197 | 'in-toolbar-color': hostContext('ion-toolbar[color]', this.el), |
| 198 | 'ion-activatable': clickable, |
| 199 | 'ion-focusable': clickable, |
| 200 | })} |
| 201 | > |
| 202 | <TagType |
| 203 | {...attrs} |
| 204 | class="breadcrumb-native" |
| 205 | part="native" |
| 206 | disabled={disabled} |
nothing calls this directly
no test coverage detected