Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
variant="filled"
binary="true"
[inputId]="item().id"
[(ngModel)]="item().checked"
[ngModel]="item().checked"
(ngModelChange)="onCheckboxChange($event)"
[disabled]="item().disabled"
></p-checkbox>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ import { InfoIconComponent } from '../info-icon/info-icon.component';
export class ComponentCheckboxItemComponent {
item = model.required<ComponentCheckboxItemModel>();
tooltipText = input('');

onCheckboxChange(checked: boolean) {
this.item.set({ ...this.item(), checked });
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
/>
</div>

@for (item of components(); track item.id) {
<osf-component-checkbox-item [item]="item" [tooltipText]="disabledTooltip()" />
@for (item of components(); track item.id; let idx = $index) {
<osf-component-checkbox-item
[item]="item"
[tooltipText]="disabledTooltip()"
(itemChange)="onItemChange($event, idx)"
/>
}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ export class ComponentsSelectionListComponent {
.every((item) => !item.checked)
);

onItemChange(changedItem: ComponentCheckboxItemModel, index: number) {
const updatedComponents = [...this.components()];
updatedComponents[index] = { ...changedItem };

this.components.set(updatedComponents);
}

removeAll() {
const filteredItems = this.components().map((item) => ({ ...item, checked: item.disabled ? item.checked : false }));

Expand Down
Loading