-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Work for #3390: implement ordinary toolbox
- Loading branch information
Showing
3 changed files
with
35 additions
and
1 deletion.
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
14 changes: 14 additions & 0 deletions
14
packages/survey-creator-angular/src/toolbox/toolbox.component.html
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,14 @@ | ||
<ng-template #template> | ||
<div class="svc-toolbox"> | ||
<div class="svc-toolbox__container"> | ||
<ng-container *ngIf="!(toolbox.categories.length == 1 || !toolbox.showCategoryTitles)"> | ||
<svc-toolbox-category *ngFor="let category of toolbox.categories" [category]="category" [toolbox]="toolbox"></svc-toolbox-category> | ||
</ng-container> | ||
<ng-container *ngIf="toolbox.categories.length == 1 || !toolbox.showCategoryTitles"> | ||
<div class="svc-toolbox__category"> | ||
<svc-toolbox-tool *ngFor="let item of toolbox.renderedActions" [creator]="model" [item]="item" [isCompact]="toolbox.isCompact"></svc-toolbox-tool> | ||
</div> | ||
</ng-container> | ||
</div> | ||
</div> | ||
</ng-template> |
19 changes: 19 additions & 0 deletions
19
packages/survey-creator-angular/src/toolbox/toolbox.component.ts
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,19 @@ | ||
import { Component, Input } from "@angular/core"; | ||
import { CreatorBase, QuestionToolbox } from "survey-creator-core"; | ||
import { AngularComponentFactory, BaseAngular } from "survey-angular-ui"; | ||
|
||
@Component({ | ||
selector: "svc-toolbox", | ||
templateUrl: "./toolbox.component.html", | ||
styles: [":host { display: none; }"] | ||
}) | ||
export class ToolboxComponent extends BaseAngular<QuestionToolbox> { | ||
@Input() model!: CreatorBase; | ||
public get toolbox() { | ||
return this.model.toolbox; | ||
} | ||
protected getModel(): QuestionToolbox { | ||
return this.toolbox; | ||
} | ||
} | ||
AngularComponentFactory.Instance.registerComponent("svc-toolbox", ToolboxComponent); |