carbon-components-angular
Version:
Next generation components
114 lines (108 loc) • 4.69 kB
JavaScript
import * as i0 from '@angular/core';
import { Directive, HostBinding, Input, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
/**
* A convenience directive for applying styling to a link. Get started with importing the module:
*
* ```typescript
* import { LinkModule } from 'carbon-components-angular';
* ```
*
* ```html
* <a href="#" cdsLink>A link</a>
* ```
*
* See the [vanilla carbon docs](http://www.carbondesignsystem.com/components/link/code) for more detail.
*
* [See demo](../../?path=/story/components-link--basic)
*/
class Link {
constructor() {
this.baseClass = true;
/**
* Set to true to show links inline in a sentence or paragraph.
*/
this.inline = false;
}
/**
* Set to true to disable link.
*/
set disabled(disabled) {
this._disabled = disabled;
this.tabindex = this.disabled ? -1 : null;
}
get disabled() {
return this._disabled;
}
}
Link.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: Link, deps: [], target: i0.ɵɵFactoryTarget.Directive });
Link.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: Link, selector: "[cdsLink], [ibmLink]", inputs: { inline: "inline", disabled: "disabled" }, host: { properties: { "class.cds--link": "this.baseClass", "attr.tabindex": "this.tabindex", "class.cds--link--inline": "this.inline", "attr.aria-disabled": "this.disabled", "class.cds--link--disabled": "this.disabled" } }, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: Link, decorators: [{
type: Directive,
args: [{
selector: "[cdsLink], [ibmLink]"
}]
}], propDecorators: { baseClass: [{
type: HostBinding,
args: ["class.cds--link"]
}], tabindex: [{
type: HostBinding,
args: ["attr.tabindex"]
}], inline: [{
type: Input
}, {
type: HostBinding,
args: ["class.cds--link--inline"]
}], disabled: [{
type: Input
}, {
type: HostBinding,
args: ["attr.aria-disabled"]
}, {
type: HostBinding,
args: ["class.cds--link--disabled"]
}] } });
class LinkIconDirective {
constructor() {
this.iconClass = true;
}
}
LinkIconDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LinkIconDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
LinkIconDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: LinkIconDirective, selector: "[ibmLinkIcon], [cdsLinkIcon]", host: { properties: { "class.cds--link__icon": "this.iconClass" } }, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LinkIconDirective, decorators: [{
type: Directive,
args: [{
selector: "[ibmLinkIcon], [cdsLinkIcon]"
}]
}], propDecorators: { iconClass: [{
type: HostBinding,
args: ["class.cds--link__icon"]
}] } });
class LinkModule {
}
LinkModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LinkModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
LinkModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: LinkModule, declarations: [Link,
LinkIconDirective], imports: [CommonModule], exports: [Link,
LinkIconDirective] });
LinkModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LinkModule, imports: [CommonModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LinkModule, decorators: [{
type: NgModule,
args: [{
declarations: [
Link,
LinkIconDirective
],
exports: [
Link,
LinkIconDirective
],
imports: [
CommonModule
]
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { Link, LinkIconDirective, LinkModule };
//# sourceMappingURL=carbon-components-angular-link.mjs.map