Skip to content

Commit

Permalink
feat(front): Webcomponent config / Add column selection switch.
Browse files Browse the repository at this point in the history
  • Loading branch information
fxprunayre committed Sep 30, 2024
1 parent 2dd6122 commit 22e50fc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ <h2 class="text-3xl">Table of records</h2>
inputId="allowResultsTableExport"
[(ngModel)]="allowResultsTableExport" />
</div>
<div class="flex flex-col gap-2">
<label for="allowColumnsSelection"> Enable column toggle </label>
<p-inputSwitch
inputId="allowColumnsSelection"
[(ngModel)]="allowColumnsSelection" />
</div>
</g-webcomponent-configuration>
</div>

Expand All @@ -167,6 +173,7 @@ <h2 class="text-3xl">Table of records</h2>
landing-page="${apiUrl}/records/${uuid}"
landing-page-link-on="resourceTitleObject.default"
scroll-height="80vh"
[column-selection]="allowColumnsSelection()"
[selection-mode]="selectionMode" />

<g-webcomponents-doc-embed>
Expand All @@ -186,6 +193,7 @@ <h2 class="text-3xl">Table of records</h2>
landing-page="${apiUrl}/records/${uuid}"
landing-page-llink-on="resourceTitleObject.default"
scroll-height="80vh"
columnSelection="{{ allowColumnsSelection() }}"
selection-mode="{{ selectionMode }}" />
]]>
</pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export class GWebcomponentsDocComponent implements OnInit {

allowDataTableExport = signal(false);
allowResultsTableExport = signal(false);
allowColumnsSelection = signal(false);

selectionMode = SELECTION_MODE_LIST[0].type;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export class GcSearchResultsTableComponent extends GcBaseSearchComponent {
@Input({ alias: 'list-of-field' }) listOfField: string;
@Input({ alias: 'list-of-label' }) listOfLabel: string;
@Input({ alias: 'scroll-height' }) scrollHeight: string;
@Input({ alias: 'column-selection' }) columnSelection: boolean = false;
@Input() export: boolean = false;
@Input() columnSelection: boolean = true;

fields = signal<string[]>([]);
labels = signal<string[]>([]);
Expand Down

0 comments on commit 22e50fc

Please sign in to comment.