-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue 1945: Implemented changes for Blockquote component as per new r…
…equirementss (#1964) Blockquote implementation as per new requirements alongwith Angular, React support and documentation update
- Loading branch information
1 parent
9b33ded
commit 22f0780
Showing
21 changed files
with
769 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# VfBlockquoteAngular | ||
|
||
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.2.0. | ||
|
||
## Code scaffolding | ||
|
||
Run `ng generate component component-name --project vf-blockquote.angular` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project vf-blockquote.angular`. | ||
> Note: Don't forget to add `--project vf-blockquote.angular` or else it will be added to the default project in your `angular.json` file. | ||
## Build | ||
|
||
Run `ng build vf-blockquote.angular` to build the project. The build artifacts will be stored in the `dist/` directory. | ||
|
||
## Publishing | ||
|
||
After building your library with `ng build vf-blockquote.angular`, go to the dist folder `cd dist/vf-blockquote.angular` and run `npm publish`. | ||
|
||
## Running unit tests | ||
|
||
Run `ng test vf-blockquote.angular` to execute the unit tests via [Karma](https://karma-runner.github.io). | ||
|
||
## Further help | ||
|
||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. |
92 changes: 92 additions & 0 deletions
92
...nents/vf-blockquote/vf-blockquote.angular/esm2020/lib/vf-blockquote.angular.component.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import { Component, Input } from '@angular/core'; | ||
import * as i0 from "@angular/core"; | ||
import * as i1 from "@angular/common"; | ||
export class VfBlockquoteAngularComponent { | ||
constructor() { | ||
this.html = ''; | ||
this.text = ''; | ||
this.blockquote_text = ''; | ||
this.blockquote_author = ''; | ||
this.blockquote_author_href = ''; | ||
this.blockquote_author_details = ''; | ||
this.blockquote_author_imageurl = ''; | ||
this.override_class = ''; | ||
this.class = ''; | ||
this.quote = ''; | ||
} | ||
ngOnInit() { | ||
//Initialize something | ||
} | ||
ngOnChanges() { | ||
this.setValues(); | ||
} | ||
/* Set values as per input and updated changes */ | ||
setValues() { | ||
/* Conditional styles, strings, nullables, arrays of styles */ | ||
this.class = 'vf-blockquote'; | ||
this.class += this.override_class ? this.override_class : ''; | ||
/* Inner content of the quote based on whether HTML or Text */ | ||
this.quote = this.blockquote_text | ||
? this.blockquote_text | ||
: this.html | ||
? this.html | ||
: this.text; | ||
} | ||
} | ||
VfBlockquoteAngularComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VfBlockquoteAngularComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); | ||
VfBlockquoteAngularComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: VfBlockquoteAngularComponent, selector: "vf-blockquote", inputs: { id: "id", html: "html", text: "text", blockquote_text: "blockquote_text", blockquote_author: "blockquote_author", blockquote_author_href: "blockquote_author_href", blockquote_author_details: "blockquote_author_details", blockquote_author_imageurl: "blockquote_author_imageurl", override_class: "override_class" }, usesOnChanges: true, ngImport: i0, template: ` | ||
<blockquote [attr.id]="id !== undefined ? id : null" [class]="class"> | ||
<div class="vf-blockquote-flex-container"> | ||
<div *ngIf="blockquote_author_imageurl !== ''" class="vf-blockquote_author__image"> | ||
<img [src]="blockquote_author_imageurl" alt="" loading="lazy" /> | ||
</div> | ||
<div> | ||
<div>{{ quote }}</div> | ||
<footer> | ||
<a *ngIf="blockquote_author_href !== ''; else quoteauthorplain" class="vf-blockquote_author__link" [href]="blockquote_author_href" [innerHTML]="blockquote_author"></a> | ||
<ng-template #quoteauthorplain>{{ blockquote_author }}</ng-template> | ||
<div *ngIf="blockquote_author_details !== ''" class="vf-blockquote_author_details">{{ blockquote_author_details }}</div> | ||
</footer> | ||
</div> | ||
</div> | ||
</blockquote> | ||
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); | ||
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VfBlockquoteAngularComponent, decorators: [{ | ||
type: Component, | ||
args: [{ selector: 'vf-blockquote', template: ` | ||
<blockquote [attr.id]="id !== undefined ? id : null" [class]="class"> | ||
<div class="vf-blockquote-flex-container"> | ||
<div *ngIf="blockquote_author_imageurl !== ''" class="vf-blockquote_author__image"> | ||
<img [src]="blockquote_author_imageurl" alt="" loading="lazy" /> | ||
</div> | ||
<div> | ||
<div>{{ quote }}</div> | ||
<footer> | ||
<a *ngIf="blockquote_author_href !== ''; else quoteauthorplain" class="vf-blockquote_author__link" [href]="blockquote_author_href" [innerHTML]="blockquote_author"></a> | ||
<ng-template #quoteauthorplain>{{ blockquote_author }}</ng-template> | ||
<div *ngIf="blockquote_author_details !== ''" class="vf-blockquote_author_details">{{ blockquote_author_details }}</div> | ||
</footer> | ||
</div> | ||
</div> | ||
</blockquote> | ||
` }] | ||
}], propDecorators: { id: [{ | ||
type: Input | ||
}], html: [{ | ||
type: Input | ||
}], text: [{ | ||
type: Input | ||
}], blockquote_text: [{ | ||
type: Input | ||
}], blockquote_author: [{ | ||
type: Input | ||
}], blockquote_author_href: [{ | ||
type: Input | ||
}], blockquote_author_details: [{ | ||
type: Input | ||
}], blockquote_author_imageurl: [{ | ||
type: Input | ||
}], override_class: [{ | ||
type: Input | ||
}] } }); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmYtYmxvY2txdW90ZS5hbmd1bGFyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL3ZmLWJsb2NrcXVvdGUuYW5ndWxhci9zcmMvbGliL3ZmLWJsb2NrcXVvdGUuYW5ndWxhci5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQVUsTUFBTSxlQUFlLENBQUM7OztBQXVCekQsTUFBTSxPQUFPLDRCQUE0QjtJQXJCekM7UUF3QlcsU0FBSSxHQUFHLEVBQUUsQ0FBQztRQUNWLFNBQUksR0FBRyxFQUFFLENBQUM7UUFDVixvQkFBZSxHQUFHLEVBQUUsQ0FBQztRQUNyQixzQkFBaUIsR0FBRyxFQUFFLENBQUM7UUFDdkIsMkJBQXNCLEdBQUcsRUFBRSxDQUFDO1FBQzVCLDhCQUF5QixHQUFHLEVBQUUsQ0FBQztRQUMvQiwrQkFBMEIsR0FBRyxFQUFFLENBQUM7UUFDaEMsbUJBQWMsR0FBRyxFQUFFLENBQUM7UUFFN0IsVUFBSyxHQUFHLEVBQUUsQ0FBQztRQUNYLFVBQUssR0FBRyxFQUFFLENBQUM7S0F1Qlo7SUFyQkMsUUFBUTtRQUNOLHVCQUF1QjtJQUN6QixDQUFDO0lBRUQsV0FBVztRQUNULElBQUksQ0FBQyxTQUFTLEVBQUUsQ0FBQztJQUNuQixDQUFDO0lBRUQsaURBQWlEO0lBQ2pELFNBQVM7UUFDUCw4REFBOEQ7UUFDOUQsSUFBSSxDQUFDLEtBQUssR0FBRyxlQUFlLENBQUM7UUFDN0IsSUFBSS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