@qbs-origin/origin-form 0.6.4 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/formly/formly-checkboxes/formly-checkboxes.component.mjs +73 -0
- package/esm2022/lib/formly/formly-dictionary-dropdown-tree/formly-dictionary-dropdown-tree.component.mjs +52 -12
- package/esm2022/lib/formly/formly-field-stepper/formly-field-stepper.component.mjs +15 -3
- package/esm2022/lib/models/forms.model.mjs +4 -2
- package/esm2022/lib/origin-form.component.mjs +59 -13
- package/esm2022/lib/origin-form.module.mjs +6 -1
- package/esm2022/lib/shared-components/dictionaries-tree.component.mjs +10 -3
- package/esm2022/lib/shared-components/treeview/treeview.component.mjs +19 -3
- package/fesm2022/qbs-origin-origin-form.mjs +221 -30
- package/fesm2022/qbs-origin-origin-form.mjs.map +1 -1
- package/lib/formly/formly-checkboxes/formly-checkboxes.component.d.ts +17 -0
- package/lib/formly/formly-dictionary-dropdown-tree/formly-dictionary-dropdown-tree.component.d.ts +3 -0
- package/lib/models/forms.model.d.ts +5 -1
- package/lib/origin-form.module.d.ts +64 -63
- package/lib/shared-components/treeview/treeview.component.d.ts +1 -0
- package/package.json +2 -2
|
@@ -2666,10 +2666,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2666
2666
|
class FormModel {
|
|
2667
2667
|
}
|
|
2668
2668
|
class AppDataControl {
|
|
2669
|
-
constructor(controlId = '', fillValue = '', fillValueId = '') {
|
|
2669
|
+
constructor(controlId = '', fillValue = '', fillValueId = '', fillValues, fillValueIds) {
|
|
2670
2670
|
this.controlId = controlId || '';
|
|
2671
2671
|
this.fillValue = fillValue || '';
|
|
2672
2672
|
this.fillValueId = fillValueId || '';
|
|
2673
|
+
this.fillValues = fillValues;
|
|
2674
|
+
this.fillValueIds = fillValueIds;
|
|
2673
2675
|
}
|
|
2674
2676
|
}
|
|
2675
2677
|
class AppDataSection {
|
|
@@ -4376,12 +4378,28 @@ class AppTreeviewComponent {
|
|
|
4376
4378
|
const filterValue = event.target.value;
|
|
4377
4379
|
return this.filterText(filterValue);
|
|
4378
4380
|
}
|
|
4381
|
+
updateSelectionByIds(ids) {
|
|
4382
|
+
if (!this.treeControl.dataNodes)
|
|
4383
|
+
return;
|
|
4384
|
+
// Clear current selection
|
|
4385
|
+
this.checklistSelection.clear();
|
|
4386
|
+
// Select nodes that match the IDs
|
|
4387
|
+
this.treeControl.dataNodes.forEach((node) => {
|
|
4388
|
+
if (node.data && ids.includes(node.data.id)) {
|
|
4389
|
+
this.checklistSelection.select(node);
|
|
4390
|
+
node.isSelected = true;
|
|
4391
|
+
}
|
|
4392
|
+
else {
|
|
4393
|
+
node.isSelected = false;
|
|
4394
|
+
}
|
|
4395
|
+
});
|
|
4396
|
+
}
|
|
4379
4397
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AppTreeviewComponent, deps: [{ token: ChecklistDatabase }, { token: TranslatePipe }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4380
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: AppTreeviewComponent, selector: "app-treeview", inputs: { allowAddItems: "allowAddItems", autoSelectDescendants: "autoSelectDescendants", allowCheckItems: "allowCheckItems", allowFilter: "allowFilter" }, outputs: { selectionChanged: "selectionChanged" }, providers: [ChecklistDatabase], ngImport: i0, template: "<mat-form-field class=\"full-width p-10\"\n *ngIf=\"allowFilter\"\n appearance=\"outline\">\n <mat-label> {{ commonKeys.actions.filter | translate }}</mat-label>\n <input matInput\n minlength=\"1\"\n (keyup)=\"applyFilter($event)\"\n placeholder=\"{{ commonKeys.actions.filter }}\"\n #input />\n</mat-form-field>\n\n<!--<cdk-virtual-scroll-viewport itemSize=\"30\" class=\"dictionary-viewport\">-->\n<mat-tree [dataSource]=\"dataSource\" [treeControl]=\"treeControl\">\n <!-- Leaf Nodes -->\n <mat-tree-node *matTreeNodeDef=\"let node\"\n matTreeNodePadding>\n <button mat-icon-button disabled></button>\n <!-- Node Content -->\n <ng-container>\n <!-- Checkbox for Selectable Nodes when checkboxes are allowed -->\n <ng-container *ngIf=\"node.canSelect && allowCheckItems\">\n <mat-checkbox class=\"checklist-leaf-node\"\n [checked]=\"checklistSelection.isSelected(node)\"\n (change)=\"leafItemSelectionToggle(node)\"\n color=\"primary\">\n {{ node.name }}\n </mat-checkbox>\n </ng-container>\n <!-- Clickable Label for Selectable Nodes when checkboxes are not allowed -->\n <ng-container *ngIf=\"node.canSelect && !allowCheckItems\">\n <mat-label class=\"mdc-label\"\n style=\"cursor: pointer\"\n (click)=\"leafItemSelectionToggle(node)\">\n {{ node.name }}\n </mat-label>\n </ng-container>\n <!-- Non-clickable Label for Non-selectable Nodes -->\n <ng-container *ngIf=\"!node.canSelect\">\n <mat-label class=\"mdc-label\">\n {{ node.name }}\n </mat-label>\n </ng-container>\n </ng-container>\n </mat-tree-node>\n\n <!-- Nodes with Children -->\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\"\n matTreeNodePadding>\n <!-- Expand/Collapse Button -->\n <button mat-icon-button\n matTreeNodeToggle\n [attr.aria-label]=\"'Toggle ' + node.name\"\n *ngIf=\"!node.hideArrow\">\n <mat-icon class=\"mat-icon-rtl-mirror\">\n {{ treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right' }}\n </mat-icon>\n </button>\n <!-- Node Content -->\n <ng-container>\n <!-- Checkbox for Selectable Nodes when checkboxes are allowed -->\n <ng-container *ngIf=\"node.canSelect && allowCheckItems\">\n <mat-checkbox [checked]=\"checklistSelection.isSelected(node)\"\n (change)=\"selectionToggle(node)\"\n color=\"primary\">\n {{ node.name }}\n </mat-checkbox>\n </ng-container>\n <!-- Clickable Label for Selectable Nodes when checkboxes are not allowed -->\n <ng-container *ngIf=\"node.canSelect && !allowCheckItems\">\n <mat-label class=\"mdc-label\"\n style=\"cursor: pointer\"\n (click)=\"leafItemSelectionToggle(node)\">\n {{ node.name }}\n </mat-label>\n </ng-container>\n <!-- Non-clickable Label for Non-selectable Nodes -->\n <ng-container *ngIf=\"!node.canSelect\">\n <mat-label class=\"mdc-label\">\n {{ node.name }}\n </mat-label>\n </ng-container>\n </ng-container>\n <!-- Add New Item Button -->\n <button mat-icon-button (click)=\"addNewItem(node)\" *ngIf=\"allowAddItems\">\n <mat-icon>add</mat-icon>\n </button>\n </mat-tree-node>\n</mat-tree>\n<!--</cdk-virtual-scroll-viewport>-->\n", styles: [".dictionary-viewport{height:400px;width:100%}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5$1.MatLabel, selector: "mat-label" }, { kind: "component", type: i4$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i7.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "directive", type: i7.MatTreeNodePadding, selector: "[matTreeNodePadding]", inputs: ["matTreeNodePadding", "matTreeNodePaddingIndent"] }, { kind: "directive", type: i7.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { kind: "component", type: i7.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i7.MatTreeNode, selector: "mat-tree-node", inputs: ["tabIndex", "disabled"], outputs: ["activation", "expandedChange"], exportAs: ["matTreeNode"] }, { kind: "component", type: i4$3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i5$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
4398
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: AppTreeviewComponent, selector: "app-treeview", inputs: { allowAddItems: "allowAddItems", autoSelectDescendants: "autoSelectDescendants", allowCheckItems: "allowCheckItems", allowFilter: "allowFilter" }, outputs: { selectionChanged: "selectionChanged" }, providers: [ChecklistDatabase], ngImport: i0, template: "<mat-form-field class=\"full-width p-10\"\n *ngIf=\"allowFilter\"\n appearance=\"outline\">\n <mat-label> {{ commonKeys.actions.filter | translate }}</mat-label>\n <input matInput\n minlength=\"1\"\n (keyup)=\"applyFilter($event)\"\n placeholder=\"{{ commonKeys.actions.filter }}\"\n #input />\n</mat-form-field>\n\n<!--<cdk-virtual-scroll-viewport itemSize=\"30\" class=\"dictionary-viewport\">-->\n<mat-tree [dataSource]=\"dataSource\" [treeControl]=\"treeControl\">\n <!-- Leaf Nodes -->\n <mat-tree-node *matTreeNodeDef=\"let node\"\n matTreeNodePadding>\n <button mat-icon-button disabled></button>\n <!-- Node Content -->\n <ng-container>\n <!-- Checkbox for Selectable Nodes when checkboxes are allowed -->\n <ng-container *ngIf=\"node.canSelect && allowCheckItems\">\n <mat-checkbox class=\"checklist-leaf-node\"\n [checked]=\"checklistSelection.isSelected(node)\"\n (change)=\"leafItemSelectionToggle(node)\"\n (click)=\"$event.stopPropagation()\"\n color=\"primary\">\n {{ node.name }}\n </mat-checkbox>\n </ng-container>\n <!-- Clickable Label for Selectable Nodes when checkboxes are not allowed -->\n <ng-container *ngIf=\"node.canSelect && !allowCheckItems\">\n <mat-label class=\"mdc-label\"\n style=\"cursor: pointer\"\n (click)=\"leafItemSelectionToggle(node)\">\n {{ node.name }}\n </mat-label>\n </ng-container>\n <!-- Non-clickable Label for Non-selectable Nodes -->\n <ng-container *ngIf=\"!node.canSelect\">\n <mat-label class=\"mdc-label\">\n {{ node.name }}\n </mat-label>\n </ng-container>\n </ng-container>\n </mat-tree-node>\n\n <!-- Nodes with Children -->\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\"\n matTreeNodePadding>\n <!-- Expand/Collapse Button -->\n <button mat-icon-button\n matTreeNodeToggle\n [attr.aria-label]=\"'Toggle ' + node.name\"\n *ngIf=\"!node.hideArrow\">\n <mat-icon class=\"mat-icon-rtl-mirror\">\n {{ treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right' }}\n </mat-icon>\n </button>\n <!-- Node Content -->\n <ng-container>\n <!-- Checkbox for Selectable Nodes when checkboxes are allowed -->\n <ng-container *ngIf=\"node.canSelect && allowCheckItems && treeControl.getLevel(node) > 0\">\n <mat-checkbox [checked]=\"checklistSelection.isSelected(node)\"\n (change)=\"selectionToggle(node)\"\n (click)=\"$event.stopPropagation()\"\n color=\"primary\">\n {{ node.name }}\n </mat-checkbox>\n </ng-container>\n <!-- Clickable Label for Selectable Nodes when checkboxes are not allowed -->\n <ng-container *ngIf=\"node.canSelect && !allowCheckItems\">\n <mat-label class=\"mdc-label\"\n style=\"cursor: pointer\"\n (click)=\"leafItemSelectionToggle(node)\">\n {{ node.name }}\n </mat-label>\n </ng-container>\n <!-- Non-clickable Label for Non-selectable Nodes -->\n <ng-container *ngIf=\"!node.canSelect\">\n <mat-label class=\"mdc-label\">\n {{ node.name }}\n </mat-label>\n </ng-container>\n </ng-container>\n <!-- Add New Item Button -->\n <button mat-icon-button (click)=\"addNewItem(node)\" *ngIf=\"allowAddItems\">\n <mat-icon>add</mat-icon>\n </button>\n </mat-tree-node>\n</mat-tree>\n<!--</cdk-virtual-scroll-viewport>-->\n", styles: [".dictionary-viewport{height:400px;width:100%}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5$1.MatLabel, selector: "mat-label" }, { kind: "component", type: i4$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i7.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "directive", type: i7.MatTreeNodePadding, selector: "[matTreeNodePadding]", inputs: ["matTreeNodePadding", "matTreeNodePaddingIndent"] }, { kind: "directive", type: i7.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { kind: "component", type: i7.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i7.MatTreeNode, selector: "mat-tree-node", inputs: ["tabIndex", "disabled"], outputs: ["activation", "expandedChange"], exportAs: ["matTreeNode"] }, { kind: "component", type: i4$3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i5$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
4381
4399
|
}
|
|
4382
4400
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AppTreeviewComponent, decorators: [{
|
|
4383
4401
|
type: Component,
|
|
4384
|
-
args: [{ selector: 'app-treeview', providers: [ChecklistDatabase], template: "<mat-form-field class=\"full-width p-10\"\n *ngIf=\"allowFilter\"\n appearance=\"outline\">\n <mat-label> {{ commonKeys.actions.filter | translate }}</mat-label>\n <input matInput\n minlength=\"1\"\n (keyup)=\"applyFilter($event)\"\n placeholder=\"{{ commonKeys.actions.filter }}\"\n #input />\n</mat-form-field>\n\n<!--<cdk-virtual-scroll-viewport itemSize=\"30\" class=\"dictionary-viewport\">-->\n<mat-tree [dataSource]=\"dataSource\" [treeControl]=\"treeControl\">\n <!-- Leaf Nodes -->\n <mat-tree-node *matTreeNodeDef=\"let node\"\n matTreeNodePadding>\n <button mat-icon-button disabled></button>\n <!-- Node Content -->\n <ng-container>\n <!-- Checkbox for Selectable Nodes when checkboxes are allowed -->\n <ng-container *ngIf=\"node.canSelect && allowCheckItems\">\n <mat-checkbox class=\"checklist-leaf-node\"\n [checked]=\"checklistSelection.isSelected(node)\"\n (change)=\"leafItemSelectionToggle(node)\"\n color=\"primary\">\n {{ node.name }}\n </mat-checkbox>\n </ng-container>\n <!-- Clickable Label for Selectable Nodes when checkboxes are not allowed -->\n <ng-container *ngIf=\"node.canSelect && !allowCheckItems\">\n <mat-label class=\"mdc-label\"\n style=\"cursor: pointer\"\n (click)=\"leafItemSelectionToggle(node)\">\n {{ node.name }}\n </mat-label>\n </ng-container>\n <!-- Non-clickable Label for Non-selectable Nodes -->\n <ng-container *ngIf=\"!node.canSelect\">\n <mat-label class=\"mdc-label\">\n {{ node.name }}\n </mat-label>\n </ng-container>\n </ng-container>\n </mat-tree-node>\n\n <!-- Nodes with Children -->\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\"\n matTreeNodePadding>\n <!-- Expand/Collapse Button -->\n <button mat-icon-button\n matTreeNodeToggle\n [attr.aria-label]=\"'Toggle ' + node.name\"\n *ngIf=\"!node.hideArrow\">\n <mat-icon class=\"mat-icon-rtl-mirror\">\n {{ treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right' }}\n </mat-icon>\n </button>\n <!-- Node Content -->\n <ng-container>\n <!-- Checkbox for Selectable Nodes when checkboxes are allowed -->\n <ng-container *ngIf=\"node.canSelect && allowCheckItems\">\n <mat-checkbox [checked]=\"checklistSelection.isSelected(node)\"\n (change)=\"selectionToggle(node)\"\n color=\"primary\">\n {{ node.name }}\n </mat-checkbox>\n </ng-container>\n <!-- Clickable Label for Selectable Nodes when checkboxes are not allowed -->\n <ng-container *ngIf=\"node.canSelect && !allowCheckItems\">\n <mat-label class=\"mdc-label\"\n style=\"cursor: pointer\"\n (click)=\"leafItemSelectionToggle(node)\">\n {{ node.name }}\n </mat-label>\n </ng-container>\n <!-- Non-clickable Label for Non-selectable Nodes -->\n <ng-container *ngIf=\"!node.canSelect\">\n <mat-label class=\"mdc-label\">\n {{ node.name }}\n </mat-label>\n </ng-container>\n </ng-container>\n <!-- Add New Item Button -->\n <button mat-icon-button (click)=\"addNewItem(node)\" *ngIf=\"allowAddItems\">\n <mat-icon>add</mat-icon>\n </button>\n </mat-tree-node>\n</mat-tree>\n<!--</cdk-virtual-scroll-viewport>-->\n", styles: [".dictionary-viewport{height:400px;width:100%}\n"] }]
|
|
4402
|
+
args: [{ selector: 'app-treeview', providers: [ChecklistDatabase], template: "<mat-form-field class=\"full-width p-10\"\n *ngIf=\"allowFilter\"\n appearance=\"outline\">\n <mat-label> {{ commonKeys.actions.filter | translate }}</mat-label>\n <input matInput\n minlength=\"1\"\n (keyup)=\"applyFilter($event)\"\n placeholder=\"{{ commonKeys.actions.filter }}\"\n #input />\n</mat-form-field>\n\n<!--<cdk-virtual-scroll-viewport itemSize=\"30\" class=\"dictionary-viewport\">-->\n<mat-tree [dataSource]=\"dataSource\" [treeControl]=\"treeControl\">\n <!-- Leaf Nodes -->\n <mat-tree-node *matTreeNodeDef=\"let node\"\n matTreeNodePadding>\n <button mat-icon-button disabled></button>\n <!-- Node Content -->\n <ng-container>\n <!-- Checkbox for Selectable Nodes when checkboxes are allowed -->\n <ng-container *ngIf=\"node.canSelect && allowCheckItems\">\n <mat-checkbox class=\"checklist-leaf-node\"\n [checked]=\"checklistSelection.isSelected(node)\"\n (change)=\"leafItemSelectionToggle(node)\"\n (click)=\"$event.stopPropagation()\"\n color=\"primary\">\n {{ node.name }}\n </mat-checkbox>\n </ng-container>\n <!-- Clickable Label for Selectable Nodes when checkboxes are not allowed -->\n <ng-container *ngIf=\"node.canSelect && !allowCheckItems\">\n <mat-label class=\"mdc-label\"\n style=\"cursor: pointer\"\n (click)=\"leafItemSelectionToggle(node)\">\n {{ node.name }}\n </mat-label>\n </ng-container>\n <!-- Non-clickable Label for Non-selectable Nodes -->\n <ng-container *ngIf=\"!node.canSelect\">\n <mat-label class=\"mdc-label\">\n {{ node.name }}\n </mat-label>\n </ng-container>\n </ng-container>\n </mat-tree-node>\n\n <!-- Nodes with Children -->\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\"\n matTreeNodePadding>\n <!-- Expand/Collapse Button -->\n <button mat-icon-button\n matTreeNodeToggle\n [attr.aria-label]=\"'Toggle ' + node.name\"\n *ngIf=\"!node.hideArrow\">\n <mat-icon class=\"mat-icon-rtl-mirror\">\n {{ treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right' }}\n </mat-icon>\n </button>\n <!-- Node Content -->\n <ng-container>\n <!-- Checkbox for Selectable Nodes when checkboxes are allowed -->\n <ng-container *ngIf=\"node.canSelect && allowCheckItems && treeControl.getLevel(node) > 0\">\n <mat-checkbox [checked]=\"checklistSelection.isSelected(node)\"\n (change)=\"selectionToggle(node)\"\n (click)=\"$event.stopPropagation()\"\n color=\"primary\">\n {{ node.name }}\n </mat-checkbox>\n </ng-container>\n <!-- Clickable Label for Selectable Nodes when checkboxes are not allowed -->\n <ng-container *ngIf=\"node.canSelect && !allowCheckItems\">\n <mat-label class=\"mdc-label\"\n style=\"cursor: pointer\"\n (click)=\"leafItemSelectionToggle(node)\">\n {{ node.name }}\n </mat-label>\n </ng-container>\n <!-- Non-clickable Label for Non-selectable Nodes -->\n <ng-container *ngIf=\"!node.canSelect\">\n <mat-label class=\"mdc-label\">\n {{ node.name }}\n </mat-label>\n </ng-container>\n </ng-container>\n <!-- Add New Item Button -->\n <button mat-icon-button (click)=\"addNewItem(node)\" *ngIf=\"allowAddItems\">\n <mat-icon>add</mat-icon>\n </button>\n </mat-tree-node>\n</mat-tree>\n<!--</cdk-virtual-scroll-viewport>-->\n", styles: [".dictionary-viewport{height:400px;width:100%}\n"] }]
|
|
4385
4403
|
}], ctorParameters: () => [{ type: ChecklistDatabase }, { type: TranslatePipe }], propDecorators: { allowAddItems: [{
|
|
4386
4404
|
type: Input
|
|
4387
4405
|
}], autoSelectDescendants: [{
|
|
@@ -4438,6 +4456,13 @@ class DictionariesTreeComponent {
|
|
|
4438
4456
|
let text = changes['filterText'].currentValue;
|
|
4439
4457
|
this.treeViewControl.filterText(text);
|
|
4440
4458
|
}
|
|
4459
|
+
// Sync selection when selectedValueIds changes
|
|
4460
|
+
if (changes['selectedValueIds'] && this.treeViewControl && this.allowCheckItems) {
|
|
4461
|
+
const newIds = changes['selectedValueIds'].currentValue;
|
|
4462
|
+
if (newIds) {
|
|
4463
|
+
this.treeViewControl.updateSelectionByIds(newIds);
|
|
4464
|
+
}
|
|
4465
|
+
}
|
|
4441
4466
|
}
|
|
4442
4467
|
ngAfterViewInit() {
|
|
4443
4468
|
// If we have a main dictionary but haven't built the tree yet, build it now
|
|
@@ -4645,11 +4670,11 @@ class DictionariesTreeComponent {
|
|
|
4645
4670
|
return JSON.parse(news);
|
|
4646
4671
|
}
|
|
4647
4672
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DictionariesTreeComponent, deps: [{ token: DictionaryService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4648
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: DictionariesTreeComponent, selector: "app-dictionaries-tree", inputs: { dictionaryId: "dictionaryId", selectedValueIds: "selectedValueIds", allowCheckItems: "allowCheckItems", allowFilter: "allowFilter", drawReferenceDictionariesAsSeparateNode: "drawReferenceDictionariesAsSeparateNode", drawChildDictionariesAsSeparateNode: "drawChildDictionariesAsSeparateNode", drawRootNode: "drawRootNode", filterText: "filterText", allowSelectNonLeafNodes: "allowSelectNonLeafNodes", languageId: "languageId", valuesIdsToShow: "valuesIdsToShow", hideParentArrow: "hideParentArrow", preloadedDictionary: "preloadedDictionary", preloadedDictionaries: "preloadedDictionaries", usePreloadedData: "usePreloadedData" }, outputs: { selectedDictionaryValuesChanged: "selectedDictionaryValuesChanged" }, viewQueries: [{ propertyName: "treeViewControl", first: true, predicate: ["treeView"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<mat-spinner *ngIf=\"isLoading === true\" class=\"m-x-auto\"></mat-spinner>\n<app-treeview #treeView [autoSelectDescendants]=\"false\"\n
|
|
4673
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: DictionariesTreeComponent, selector: "app-dictionaries-tree", inputs: { dictionaryId: "dictionaryId", selectedValueIds: "selectedValueIds", allowCheckItems: "allowCheckItems", allowFilter: "allowFilter", drawReferenceDictionariesAsSeparateNode: "drawReferenceDictionariesAsSeparateNode", drawChildDictionariesAsSeparateNode: "drawChildDictionariesAsSeparateNode", drawRootNode: "drawRootNode", filterText: "filterText", allowSelectNonLeafNodes: "allowSelectNonLeafNodes", languageId: "languageId", valuesIdsToShow: "valuesIdsToShow", hideParentArrow: "hideParentArrow", preloadedDictionary: "preloadedDictionary", preloadedDictionaries: "preloadedDictionaries", usePreloadedData: "usePreloadedData" }, outputs: { selectedDictionaryValuesChanged: "selectedDictionaryValuesChanged" }, viewQueries: [{ propertyName: "treeViewControl", first: true, predicate: ["treeView"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<mat-spinner *ngIf=\"isLoading === true\" class=\"m-x-auto\"></mat-spinner>\n<div (click)=\"$event.stopPropagation()\">\n <app-treeview #treeView [autoSelectDescendants]=\"false\"\n [allowCheckItems]=\"allowCheckItems\"\n [allowFilter]=\"allowFilter\"\n (selectionChanged)=\"onTreeSelectionChanged($event)\">\n </app-treeview>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: AppTreeviewComponent, selector: "app-treeview", inputs: ["allowAddItems", "autoSelectDescendants", "allowCheckItems", "allowFilter"], outputs: ["selectionChanged"] }] }); }
|
|
4649
4674
|
}
|
|
4650
4675
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DictionariesTreeComponent, decorators: [{
|
|
4651
4676
|
type: Component,
|
|
4652
|
-
args: [{ selector: 'app-dictionaries-tree', template: "<mat-spinner *ngIf=\"isLoading === true\" class=\"m-x-auto\"></mat-spinner>\n<app-treeview #treeView [autoSelectDescendants]=\"false\"\n
|
|
4677
|
+
args: [{ selector: 'app-dictionaries-tree', template: "<mat-spinner *ngIf=\"isLoading === true\" class=\"m-x-auto\"></mat-spinner>\n<div (click)=\"$event.stopPropagation()\">\n <app-treeview #treeView [autoSelectDescendants]=\"false\"\n [allowCheckItems]=\"allowCheckItems\"\n [allowFilter]=\"allowFilter\"\n (selectionChanged)=\"onTreeSelectionChanged($event)\">\n </app-treeview>\n</div>\n" }]
|
|
4653
4678
|
}], ctorParameters: () => [{ type: DictionaryService }], propDecorators: { treeViewControl: [{
|
|
4654
4679
|
type: ViewChild,
|
|
4655
4680
|
args: ['treeView']
|
|
@@ -4699,6 +4724,9 @@ class FormlyDictionaryDropdownTreeComponent extends FieldType {
|
|
|
4699
4724
|
this.valuesIdsToShow = [];
|
|
4700
4725
|
this.selectedRelatedDictionaries = [];
|
|
4701
4726
|
this.dictionaryLabels = {};
|
|
4727
|
+
// Multiple selection support
|
|
4728
|
+
this.allowMultipleSelection = false;
|
|
4729
|
+
this.selectedValues = [];
|
|
4702
4730
|
// NEW: Properties for preloaded dictionary data
|
|
4703
4731
|
this.preloadedDictionary = null;
|
|
4704
4732
|
this.preloadedDictionaries = null;
|
|
@@ -4721,6 +4749,10 @@ class FormlyDictionaryDropdownTreeComponent extends FieldType {
|
|
|
4721
4749
|
if (this.props['dictionaryLabels']) {
|
|
4722
4750
|
this.dictionaryLabels = this.props['dictionaryLabels'];
|
|
4723
4751
|
}
|
|
4752
|
+
// Initialize multiple selection
|
|
4753
|
+
if (this.props['allowMultipleSelection']) {
|
|
4754
|
+
this.allowMultipleSelection = this.props['allowMultipleSelection'];
|
|
4755
|
+
}
|
|
4724
4756
|
// NEW: Initialize preloaded dictionary data
|
|
4725
4757
|
if (this.props['dictionaryData']) {
|
|
4726
4758
|
this.preloadedDictionary = this.props['dictionaryData'];
|
|
@@ -4849,11 +4881,24 @@ class FormlyDictionaryDropdownTreeComponent extends FieldType {
|
|
|
4849
4881
|
}
|
|
4850
4882
|
onSelectedDictionaryValuesChanged(values) {
|
|
4851
4883
|
if (values && values.length > 0) {
|
|
4852
|
-
this.
|
|
4853
|
-
|
|
4854
|
-
this.
|
|
4884
|
+
if (this.allowMultipleSelection) {
|
|
4885
|
+
// Multiple selection mode
|
|
4886
|
+
this.selectedValues = values;
|
|
4887
|
+
this.selectedValueIds = values.map(v => v.id);
|
|
4888
|
+
this.formControl.setValue(values);
|
|
4889
|
+
this.updateSelectedValueText();
|
|
4890
|
+
if (this.props['onSelectedValuesChanged']) {
|
|
4891
|
+
this.props['onSelectedValuesChanged'](values);
|
|
4892
|
+
}
|
|
4893
|
+
}
|
|
4894
|
+
else {
|
|
4895
|
+
// Single selection mode
|
|
4896
|
+
this.selectedValue = values[0];
|
|
4897
|
+
if (this.autocompleteTrigger) {
|
|
4898
|
+
this.autocompleteTrigger.closePanel();
|
|
4899
|
+
}
|
|
4900
|
+
this.onSelectedValueChanged(this.selectedValue);
|
|
4855
4901
|
}
|
|
4856
|
-
this.onSelectedValueChanged(this.selectedValue);
|
|
4857
4902
|
if (this.autoInput) {
|
|
4858
4903
|
this.autoInput.nativeElement.value = this.filteredText = '';
|
|
4859
4904
|
}
|
|
@@ -4884,6 +4929,23 @@ class FormlyDictionaryDropdownTreeComponent extends FieldType {
|
|
|
4884
4929
|
}
|
|
4885
4930
|
}
|
|
4886
4931
|
updateSelectedValueText() {
|
|
4932
|
+
if (this.allowMultipleSelection) {
|
|
4933
|
+
// Multiple selection mode - show comma-separated values
|
|
4934
|
+
const formValue = this.formControl?.value;
|
|
4935
|
+
if (Array.isArray(formValue) && formValue.length > 0) {
|
|
4936
|
+
this.selectedValues = formValue;
|
|
4937
|
+
this.selectedValueIds = formValue.map(v => v.id);
|
|
4938
|
+
const texts = formValue.map(v => this.getValueDisplayText(v));
|
|
4939
|
+
this.selectedValueText = texts.join(', ');
|
|
4940
|
+
}
|
|
4941
|
+
else {
|
|
4942
|
+
this.selectedValueText = '';
|
|
4943
|
+
this.selectedValues = [];
|
|
4944
|
+
this.selectedValueIds = [];
|
|
4945
|
+
}
|
|
4946
|
+
return;
|
|
4947
|
+
}
|
|
4948
|
+
// Single selection mode
|
|
4887
4949
|
if (!this.selectedValue) {
|
|
4888
4950
|
const formValue = this.formControl?.value;
|
|
4889
4951
|
if (formValue && typeof formValue === 'object' && formValue.id) {
|
|
@@ -4900,24 +4962,27 @@ class FormlyDictionaryDropdownTreeComponent extends FieldType {
|
|
|
4900
4962
|
return;
|
|
4901
4963
|
}
|
|
4902
4964
|
}
|
|
4903
|
-
|
|
4965
|
+
this.selectedValueText = this.getValueDisplayText(this.selectedValue);
|
|
4966
|
+
}
|
|
4967
|
+
getValueDisplayText(value) {
|
|
4968
|
+
if (!value)
|
|
4969
|
+
return '';
|
|
4970
|
+
const translation = value.translations?.find((t) => t.languageId === this.currentLanguageId ||
|
|
4904
4971
|
t.languageIso === this.currentLanguageIso);
|
|
4905
4972
|
if (translation) {
|
|
4906
|
-
|
|
4907
|
-
}
|
|
4908
|
-
else {
|
|
4909
|
-
this.selectedValueText = this.selectedValue.name || '';
|
|
4973
|
+
return translation.value;
|
|
4910
4974
|
}
|
|
4975
|
+
return value.name || '';
|
|
4911
4976
|
}
|
|
4912
4977
|
getDictionaryLabel(dictionaryId) {
|
|
4913
4978
|
return this.dictionaryLabels[dictionaryId] || '';
|
|
4914
4979
|
}
|
|
4915
4980
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FormlyDictionaryDropdownTreeComponent, deps: [{ token: DictionaryService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4916
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: FormlyDictionaryDropdownTreeComponent, selector: "formly-dictionary-dropdown-tree", inputs: { dictionaryId: "dictionaryId" }, outputs: { selectedValue: "selectedValue" }, viewQueries: [{ propertyName: "autocompleteTrigger", first: true, predicate: MatAutocompleteTrigger, descendants: true }, { propertyName: "autoInput", first: true, predicate: ["autoInput"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<form>\n <mat-label class=\"component-data-label m-l-2\" [ngStyle]=\"labelStyle\">\n {{ label }}</mat-label\n >\n <mat-form-field class=\"full-width\">\n <input\n type=\"text\"\n placeholder=\"{{ selectedValueText }}\"\n #autoInput\n aria-label=\"Text\"\n matInput\n [matAutocomplete]=\"auto\"\n (input)=\"filterChanged($event)\"\n (focus)=\"openAutocomplete()\"\n />\n <mat-icon matSuffix (click)=\"toggleAutocomplete($event)\"\n >keyboard_arrow_down</mat-icon\n >\n <mat-autocomplete\n #matAutocomplete=\"matAutocomplete\"\n #auto=\"matAutocomplete\"\n autoActiveFirstOption\n (optionSelected)=\"\n onSelectedDictionaryValuesChanged([$event.option.value])\n \"\n >\n <mat-option disabled>{{\n formlyKeys.selectAnItem | translate\n }}</mat-option>\n <app-dictionaries-tree\n [allowCheckItems]=\"
|
|
4981
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: FormlyDictionaryDropdownTreeComponent, selector: "formly-dictionary-dropdown-tree", inputs: { dictionaryId: "dictionaryId" }, outputs: { selectedValue: "selectedValue" }, viewQueries: [{ propertyName: "autocompleteTrigger", first: true, predicate: MatAutocompleteTrigger, descendants: true }, { propertyName: "autoInput", first: true, predicate: ["autoInput"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<form>\n <mat-label class=\"component-data-label m-l-2\" [ngStyle]=\"labelStyle\">\n {{ label }}</mat-label\n >\n <mat-form-field class=\"full-width\">\n <input\n type=\"text\"\n placeholder=\"{{ selectedValueText }}\"\n #autoInput\n aria-label=\"Text\"\n matInput\n [matAutocomplete]=\"auto\"\n (input)=\"filterChanged($event)\"\n (focus)=\"openAutocomplete()\"\n />\n <mat-icon matSuffix (click)=\"toggleAutocomplete($event)\"\n >keyboard_arrow_down</mat-icon\n >\n <mat-autocomplete\n #matAutocomplete=\"matAutocomplete\"\n #auto=\"matAutocomplete\"\n autoActiveFirstOption\n (optionSelected)=\"\n onSelectedDictionaryValuesChanged([$event.option.value])\n \"\n >\n <mat-option disabled>{{\n formlyKeys.selectAnItem | translate\n }}</mat-option>\n <app-dictionaries-tree\n [allowCheckItems]=\"allowMultipleSelection\"\n [drawReferenceDictionariesAsSeparateNode]=\"false\"\n [drawChildDictionariesAsSeparateNode]=\"false\"\n [drawRootNode]=\"false\"\n [filterText]=\"filteredText\"\n [allowSelectNonLeafNodes]=\"true\"\n [selectedValueIds]=\"selectedValueIds\"\n [languageId]=\"currentLanguageId\"\n [valuesIdsToShow]=\"valuesIdsToShow\"\n [selectedRelatedDictionaries]=\"selectedRelatedDictionaries\"\n [dictionaryLabels]=\"dictionaryLabels\"\n [preloadedDictionary]=\"preloadedDictionary\"\n [preloadedDictionaries]=\"preloadedDictionaries\"\n [usePreloadedData]=\"usePreloadedData\"\n (selectedDictionaryValuesChanged)=\"\n onSelectedDictionaryValuesChanged($event)\n \"\n >\n </app-dictionaries-tree>\n </mat-autocomplete>\n </mat-form-field>\n\n <formly-validation-message *ngIf=\"showError\" [field]=\"field\">\n </formly-validation-message>\n</form>\n", styles: ["formly-validation-message{color:red;font-size:12px}::ng-deep .mat-mdc-autocomplete-panel>app-dictionaries-tree>app-treeview>cdk-virtual-scroll-viewport{overflow:hidden}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i6.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i6$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i6.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: i5$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { kind: "component", type: DictionariesTreeComponent, selector: "app-dictionaries-tree", inputs: ["dictionaryId", "selectedValueIds", "allowCheckItems", "allowFilter", "drawReferenceDictionariesAsSeparateNode", "drawChildDictionariesAsSeparateNode", "drawRootNode", "filterText", "allowSelectNonLeafNodes", "languageId", "valuesIdsToShow", "hideParentArrow", "preloadedDictionary", "preloadedDictionaries", "usePreloadedData"], outputs: ["selectedDictionaryValuesChanged"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
4917
4982
|
}
|
|
4918
4983
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FormlyDictionaryDropdownTreeComponent, decorators: [{
|
|
4919
4984
|
type: Component,
|
|
4920
|
-
args: [{ selector: 'formly-dictionary-dropdown-tree', template: "<form>\n <mat-label class=\"component-data-label m-l-2\" [ngStyle]=\"labelStyle\">\n {{ label }}</mat-label\n >\n <mat-form-field class=\"full-width\">\n <input\n type=\"text\"\n placeholder=\"{{ selectedValueText }}\"\n #autoInput\n aria-label=\"Text\"\n matInput\n [matAutocomplete]=\"auto\"\n (input)=\"filterChanged($event)\"\n (focus)=\"openAutocomplete()\"\n />\n <mat-icon matSuffix (click)=\"toggleAutocomplete($event)\"\n >keyboard_arrow_down</mat-icon\n >\n <mat-autocomplete\n #matAutocomplete=\"matAutocomplete\"\n #auto=\"matAutocomplete\"\n autoActiveFirstOption\n (optionSelected)=\"\n onSelectedDictionaryValuesChanged([$event.option.value])\n \"\n >\n <mat-option disabled>{{\n formlyKeys.selectAnItem | translate\n }}</mat-option>\n <app-dictionaries-tree\n [allowCheckItems]=\"
|
|
4985
|
+
args: [{ selector: 'formly-dictionary-dropdown-tree', template: "<form>\n <mat-label class=\"component-data-label m-l-2\" [ngStyle]=\"labelStyle\">\n {{ label }}</mat-label\n >\n <mat-form-field class=\"full-width\">\n <input\n type=\"text\"\n placeholder=\"{{ selectedValueText }}\"\n #autoInput\n aria-label=\"Text\"\n matInput\n [matAutocomplete]=\"auto\"\n (input)=\"filterChanged($event)\"\n (focus)=\"openAutocomplete()\"\n />\n <mat-icon matSuffix (click)=\"toggleAutocomplete($event)\"\n >keyboard_arrow_down</mat-icon\n >\n <mat-autocomplete\n #matAutocomplete=\"matAutocomplete\"\n #auto=\"matAutocomplete\"\n autoActiveFirstOption\n (optionSelected)=\"\n onSelectedDictionaryValuesChanged([$event.option.value])\n \"\n >\n <mat-option disabled>{{\n formlyKeys.selectAnItem | translate\n }}</mat-option>\n <app-dictionaries-tree\n [allowCheckItems]=\"allowMultipleSelection\"\n [drawReferenceDictionariesAsSeparateNode]=\"false\"\n [drawChildDictionariesAsSeparateNode]=\"false\"\n [drawRootNode]=\"false\"\n [filterText]=\"filteredText\"\n [allowSelectNonLeafNodes]=\"true\"\n [selectedValueIds]=\"selectedValueIds\"\n [languageId]=\"currentLanguageId\"\n [valuesIdsToShow]=\"valuesIdsToShow\"\n [selectedRelatedDictionaries]=\"selectedRelatedDictionaries\"\n [dictionaryLabels]=\"dictionaryLabels\"\n [preloadedDictionary]=\"preloadedDictionary\"\n [preloadedDictionaries]=\"preloadedDictionaries\"\n [usePreloadedData]=\"usePreloadedData\"\n (selectedDictionaryValuesChanged)=\"\n onSelectedDictionaryValuesChanged($event)\n \"\n >\n </app-dictionaries-tree>\n </mat-autocomplete>\n </mat-form-field>\n\n <formly-validation-message *ngIf=\"showError\" [field]=\"field\">\n </formly-validation-message>\n</form>\n", styles: ["formly-validation-message{color:red;font-size:12px}::ng-deep .mat-mdc-autocomplete-panel>app-dictionaries-tree>app-treeview>cdk-virtual-scroll-viewport{overflow:hidden}\n"] }]
|
|
4921
4986
|
}], ctorParameters: () => [{ type: DictionaryService }, { type: i0.ChangeDetectorRef }], propDecorators: { autocompleteTrigger: [{
|
|
4922
4987
|
type: ViewChild,
|
|
4923
4988
|
args: [MatAutocompleteTrigger]
|
|
@@ -7269,6 +7334,12 @@ class CollectorFormComponent {
|
|
|
7269
7334
|
fieldGroup: formlyFilteredSteps,
|
|
7270
7335
|
},
|
|
7271
7336
|
];
|
|
7337
|
+
// For display mode, populate values immediately after config is built
|
|
7338
|
+
if (this.showDisplayMode && this.formlyConfig[0]?.fieldGroup) {
|
|
7339
|
+
for (const step of this.formlyConfig[0].fieldGroup) {
|
|
7340
|
+
this.setPresentationControlValuesRecursively(step);
|
|
7341
|
+
}
|
|
7342
|
+
}
|
|
7272
7343
|
}
|
|
7273
7344
|
async onSelectedPageChanging(stepTransition) {
|
|
7274
7345
|
let fromIndex;
|
|
@@ -7307,7 +7378,12 @@ class CollectorFormComponent {
|
|
|
7307
7378
|
let filteredSteps = this.flux.filter((s) => {
|
|
7308
7379
|
if (s.dependentDictionary &&
|
|
7309
7380
|
s.dependentDictionary.isDictionaryDependent) {
|
|
7310
|
-
const
|
|
7381
|
+
const modelValue = this.model[s.dependentDictionary.dictionaryControlIdentifier];
|
|
7382
|
+
// Skip dependency check for multiple selection (array)
|
|
7383
|
+
if (Array.isArray(modelValue)) {
|
|
7384
|
+
return true;
|
|
7385
|
+
}
|
|
7386
|
+
const selectedValue = modelValue?.id;
|
|
7311
7387
|
if (selectedValue &&
|
|
7312
7388
|
s.dependentDictionary.dependentValueIds.includes(selectedValue)) {
|
|
7313
7389
|
return true;
|
|
@@ -7371,7 +7447,32 @@ class CollectorFormComponent {
|
|
|
7371
7447
|
if (associatedControlId) {
|
|
7372
7448
|
const found = this.findControlInFillDataControls(associatedControlId);
|
|
7373
7449
|
if (found) {
|
|
7374
|
-
|
|
7450
|
+
// Multiple selection - show values with comma
|
|
7451
|
+
const valueIdsArray = found.fillValueIds || found.fillvalueids || found.FillValueIds;
|
|
7452
|
+
const valuesArray = found.fillValues || found.fillvalues || found.FillValues;
|
|
7453
|
+
if (valueIdsArray && Array.isArray(valueIdsArray) && valueIdsArray.length > 0) {
|
|
7454
|
+
const currentLanguageId = this.getCurrentLanguageId();
|
|
7455
|
+
const displayValues = [];
|
|
7456
|
+
for (const valueId of valueIdsArray) {
|
|
7457
|
+
const numericValueId = typeof valueId === 'string' ? parseInt(valueId, 10) : valueId;
|
|
7458
|
+
for (const [key, dict] of this.dictionaryMap.entries()) {
|
|
7459
|
+
const value = dict.values?.find((v) => v.id === numericValueId);
|
|
7460
|
+
if (value) {
|
|
7461
|
+
const translation = value.valueTranslations.find((t) => t.languageId == currentLanguageId);
|
|
7462
|
+
displayValues.push(translation?.value || value.name);
|
|
7463
|
+
break;
|
|
7464
|
+
}
|
|
7465
|
+
}
|
|
7466
|
+
}
|
|
7467
|
+
if (displayValues.length > 0) {
|
|
7468
|
+
fg.defaultValue = displayValues.join(', ');
|
|
7469
|
+
}
|
|
7470
|
+
}
|
|
7471
|
+
else if (valuesArray && Array.isArray(valuesArray) && valuesArray.length > 0) {
|
|
7472
|
+
// Fallback: use fillValues array directly
|
|
7473
|
+
fg.defaultValue = valuesArray.join(', ');
|
|
7474
|
+
}
|
|
7475
|
+
else if (found.fillValueId) {
|
|
7375
7476
|
const currentLanguageId = this.getCurrentLanguageId();
|
|
7376
7477
|
for (const [key, dict] of this.dictionaryMap.entries()) {
|
|
7377
7478
|
const value = dict.values?.find((v) => v.id == found.fillValueId);
|
|
@@ -7444,7 +7545,12 @@ class CollectorFormComponent {
|
|
|
7444
7545
|
if (s.props && s.props['dependentDictionary']) {
|
|
7445
7546
|
const depDict = s.props['dependentDictionary'];
|
|
7446
7547
|
if (depDict && depDict.isDictionaryDependent) {
|
|
7447
|
-
const
|
|
7548
|
+
const modelValue = this.model[depDict.dictionaryControlIdentifier];
|
|
7549
|
+
// Skip dependency check for multiple selection (array)
|
|
7550
|
+
if (Array.isArray(modelValue)) {
|
|
7551
|
+
return true;
|
|
7552
|
+
}
|
|
7553
|
+
const selectedValue = modelValue?.id;
|
|
7448
7554
|
if (selectedValue &&
|
|
7449
7555
|
depDict.dependentValueIds.includes(selectedValue)) {
|
|
7450
7556
|
return true;
|
|
@@ -7687,7 +7793,7 @@ class CollectorFormComponent {
|
|
|
7687
7793
|
token: this.kycToken,
|
|
7688
7794
|
api_url: this.kycApiUrl,
|
|
7689
7795
|
appDataId: this.appDataUuid,
|
|
7690
|
-
env: '
|
|
7796
|
+
env: 'DOCKER', // Consider making this dynamic if needed
|
|
7691
7797
|
redirect_id: this.kycRedirectId,
|
|
7692
7798
|
phone_number: '',
|
|
7693
7799
|
lang_iso: this.kycLangIso,
|
|
@@ -8635,10 +8741,16 @@ class CollectorFormComponent {
|
|
|
8635
8741
|
}
|
|
8636
8742
|
async constructDictionary(control, options) {
|
|
8637
8743
|
const specificData = control.specificControlData;
|
|
8638
|
-
|
|
8639
|
-
|
|
8640
|
-
|
|
8641
|
-
|
|
8744
|
+
// Determine component type based on settings
|
|
8745
|
+
if (specificData.showAsCheckboxes === true) {
|
|
8746
|
+
options.type = 'formly-checkboxes';
|
|
8747
|
+
}
|
|
8748
|
+
else if (specificData.showAsRadioButtonsList === true) {
|
|
8749
|
+
options.type = 'formly-radio';
|
|
8750
|
+
}
|
|
8751
|
+
else {
|
|
8752
|
+
options.type = 'formly-dictionary-dropdown-tree';
|
|
8753
|
+
}
|
|
8642
8754
|
options.props['specificData'] = specificData;
|
|
8643
8755
|
const dictionaryUuid = specificData.dictionaryUUID;
|
|
8644
8756
|
if (dictionaryUuid) {
|
|
@@ -8650,10 +8762,7 @@ class CollectorFormComponent {
|
|
|
8650
8762
|
this.attachToValueChanges(control.identifier, options);
|
|
8651
8763
|
}
|
|
8652
8764
|
else {
|
|
8653
|
-
|
|
8654
|
-
specificData.showAsRadioButtonsList === true
|
|
8655
|
-
? 'formly-radio'
|
|
8656
|
-
: 'formly-dictionary-dropdown-tree';
|
|
8765
|
+
// Type is already set at the beginning of the method
|
|
8657
8766
|
options.props['dictionaryId'] = dictionaryUuid;
|
|
8658
8767
|
this.constructDictionaryWithReferences(dictionary, options, specificData);
|
|
8659
8768
|
this.attachToValueChanges(control.identifier, options);
|
|
@@ -8759,6 +8868,8 @@ class CollectorFormComponent {
|
|
|
8759
8868
|
}));
|
|
8760
8869
|
options.props['selectedRelatedDictionaries'] =
|
|
8761
8870
|
dictionaryControlData.selectedRelatedDictionaries || [];
|
|
8871
|
+
options.props['allowMultipleSelection'] =
|
|
8872
|
+
dictionaryControlData.allowMultipleSelection || false;
|
|
8762
8873
|
let initialValueObject = null;
|
|
8763
8874
|
const controlKey = options.key;
|
|
8764
8875
|
const dictionaryDefaultValueId = dictionaryControlData.dictionaryDefaultValueId;
|
|
@@ -9562,8 +9673,20 @@ class FormlyFieldStepperComponent extends FieldType {
|
|
|
9562
9673
|
else {
|
|
9563
9674
|
let fillValueId = '';
|
|
9564
9675
|
let fillValueName = '';
|
|
9676
|
+
let fillValueIds;
|
|
9677
|
+
let fillValueNames;
|
|
9565
9678
|
if (value !== null && value !== undefined) {
|
|
9566
|
-
|
|
9679
|
+
// Check for multiple selection (array of values)
|
|
9680
|
+
if (Array.isArray(value)) {
|
|
9681
|
+
fillValueIds = value.map((v) => String(v.id));
|
|
9682
|
+
fillValueNames = value.map((v) => v.name || '');
|
|
9683
|
+
// For backwards compatibility, also set single values
|
|
9684
|
+
if (value.length > 0) {
|
|
9685
|
+
fillValueId = String(value[0].id);
|
|
9686
|
+
fillValueName = value[0].name || '';
|
|
9687
|
+
}
|
|
9688
|
+
}
|
|
9689
|
+
else if (typeof value === 'object' && value.id != null) {
|
|
9567
9690
|
fillValueId = String(value.id);
|
|
9568
9691
|
fillValueName = value.name || '';
|
|
9569
9692
|
}
|
|
@@ -9586,7 +9709,7 @@ class FormlyFieldStepperComponent extends FieldType {
|
|
|
9586
9709
|
}
|
|
9587
9710
|
}
|
|
9588
9711
|
}
|
|
9589
|
-
return new AppDataControl(control.identifier, fillValueName, fillValueId);
|
|
9712
|
+
return new AppDataControl(control.identifier, fillValueName, fillValueId, fillValueNames, fillValueIds);
|
|
9590
9713
|
}
|
|
9591
9714
|
})))));
|
|
9592
9715
|
if (this.appData.fillData) {
|
|
@@ -10150,6 +10273,70 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
10150
10273
|
args: [{ selector: 'formly-radio', template: "<div class=\"mat-mdc-text-field-wrapper mdc-radiobox-field\" appExternalLink>\n <label>\n <markdown [data]=\"title\"></markdown>\n </label>\n <div *ngIf=\"radioOptionsList.length > 0\">\n <mat-radio-group [value]=\"formControl.value?.id\"\n (change)=\"onRadioChange($event)\">\n <ng-container *ngFor=\"let option of radioOptionsList\">\n <div>\n <mat-radio-button [value]=\"option.value.id\">\n {{ option.label }}\n </mat-radio-button>\n </div>\n </ng-container>\n </mat-radio-group>\n </div>\n <formly-validation-message *ngIf=\"showError\" [field]=\"field\">\n </formly-validation-message>\n</div>\n", styles: ["formly-validation-message{color:red;font-size:12px}\n"] }]
|
|
10151
10274
|
}] });
|
|
10152
10275
|
|
|
10276
|
+
class FormlyCheckboxesComponent extends FieldType {
|
|
10277
|
+
constructor() {
|
|
10278
|
+
super(...arguments);
|
|
10279
|
+
this.checkboxOptionsList = [];
|
|
10280
|
+
this.title = '';
|
|
10281
|
+
this.langIso = 'en';
|
|
10282
|
+
this.selectedValues = [];
|
|
10283
|
+
}
|
|
10284
|
+
ngOnInit() {
|
|
10285
|
+
this.langIso = this.props['currentLanguageIso'];
|
|
10286
|
+
this.title = this.props['label'] || '';
|
|
10287
|
+
if (this.props.required) {
|
|
10288
|
+
this.title += ' *';
|
|
10289
|
+
}
|
|
10290
|
+
if (Array.isArray(this.to.options)) {
|
|
10291
|
+
this.checkboxOptionsList = this.to.options;
|
|
10292
|
+
}
|
|
10293
|
+
// Initialize selected values from form control
|
|
10294
|
+
const currentValue = this.formControl.value;
|
|
10295
|
+
if (Array.isArray(currentValue)) {
|
|
10296
|
+
this.selectedValues = currentValue;
|
|
10297
|
+
}
|
|
10298
|
+
else if (currentValue && currentValue.id) {
|
|
10299
|
+
this.selectedValues = [currentValue];
|
|
10300
|
+
}
|
|
10301
|
+
}
|
|
10302
|
+
get formControl() {
|
|
10303
|
+
if (this.field.key) {
|
|
10304
|
+
const keyPath = typeof this.field.key === 'string' || Array.isArray(this.field.key)
|
|
10305
|
+
? this.field.key
|
|
10306
|
+
: String(this.field.key);
|
|
10307
|
+
return this.form.get(keyPath);
|
|
10308
|
+
}
|
|
10309
|
+
return new FormControl();
|
|
10310
|
+
}
|
|
10311
|
+
isChecked(option) {
|
|
10312
|
+
return this.selectedValues.some((v) => v.id === option.value.id);
|
|
10313
|
+
}
|
|
10314
|
+
onCheckboxChange(event, option) {
|
|
10315
|
+
if (event.checked) {
|
|
10316
|
+
// Add to selection
|
|
10317
|
+
if (!this.isChecked(option)) {
|
|
10318
|
+
this.selectedValues = [...this.selectedValues, option.value];
|
|
10319
|
+
}
|
|
10320
|
+
}
|
|
10321
|
+
else {
|
|
10322
|
+
// Remove from selection
|
|
10323
|
+
this.selectedValues = this.selectedValues.filter((v) => v.id !== option.value.id);
|
|
10324
|
+
}
|
|
10325
|
+
// Update form control with array of values
|
|
10326
|
+
this.formControl.setValue(this.selectedValues);
|
|
10327
|
+
// Notify parent component
|
|
10328
|
+
if (this.props['onSelectedValuesChanged']) {
|
|
10329
|
+
this.props['onSelectedValuesChanged'](this.selectedValues);
|
|
10330
|
+
}
|
|
10331
|
+
}
|
|
10332
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FormlyCheckboxesComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
10333
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: FormlyCheckboxesComponent, selector: "formly-checkboxes", usesInheritance: true, ngImport: i0, template: "<div class=\"mat-mdc-text-field-wrapper mdc-checkbox-field\" appExternalLink>\n <label class=\"checkbox-label\">\n <markdown [data]=\"title\"></markdown>\n </label>\n <div *ngIf=\"checkboxOptionsList.length > 0\" class=\"checkbox-list\">\n <ng-container *ngFor=\"let option of checkboxOptionsList\">\n <div class=\"checkbox-item\">\n <mat-checkbox\n [checked]=\"isChecked(option)\"\n (change)=\"onCheckboxChange($event, option)\"\n color=\"primary\">\n {{ option.label }}\n </mat-checkbox>\n </div>\n </ng-container>\n </div>\n <div *ngIf=\"showError\" class=\"validation-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </div>\n</div>\n", styles: [".mdc-checkbox-field .checkbox-label{display:block;margin-bottom:8px}.mdc-checkbox-field .checkbox-list{display:flex;flex-direction:column;gap:4px}.mdc-checkbox-field .checkbox-item{padding:4px 0}.mdc-checkbox-field .validation-error{color:red;font-size:12px;margin-top:4px}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.MarkdownComponent, selector: "markdown, [markdown]", inputs: ["data", "src", "disableSanitizer", "inline", "clipboard", "clipboardButtonComponent", "clipboardButtonTemplate", "emoji", "katex", "katexOptions", "mermaid", "mermaidOptions", "lineHighlight", "line", "lineOffset", "lineNumbers", "start", "commandLine", "filterOutput", "host", "prompt", "output", "user"], outputs: ["error", "load", "ready"] }, { kind: "component", type: i4$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: i4.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { kind: "directive", type: ExternalLinkDirective, selector: "[appExternalLink]" }] }); }
|
|
10334
|
+
}
|
|
10335
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FormlyCheckboxesComponent, decorators: [{
|
|
10336
|
+
type: Component,
|
|
10337
|
+
args: [{ selector: 'formly-checkboxes', template: "<div class=\"mat-mdc-text-field-wrapper mdc-checkbox-field\" appExternalLink>\n <label class=\"checkbox-label\">\n <markdown [data]=\"title\"></markdown>\n </label>\n <div *ngIf=\"checkboxOptionsList.length > 0\" class=\"checkbox-list\">\n <ng-container *ngFor=\"let option of checkboxOptionsList\">\n <div class=\"checkbox-item\">\n <mat-checkbox\n [checked]=\"isChecked(option)\"\n (change)=\"onCheckboxChange($event, option)\"\n color=\"primary\">\n {{ option.label }}\n </mat-checkbox>\n </div>\n </ng-container>\n </div>\n <div *ngIf=\"showError\" class=\"validation-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </div>\n</div>\n", styles: [".mdc-checkbox-field .checkbox-label{display:block;margin-bottom:8px}.mdc-checkbox-field .checkbox-list{display:flex;flex-direction:column;gap:4px}.mdc-checkbox-field .checkbox-item{padding:4px 0}.mdc-checkbox-field .validation-error{color:red;font-size:12px;margin-top:4px}\n"] }]
|
|
10338
|
+
}] });
|
|
10339
|
+
|
|
10153
10340
|
class RowFillerComponent extends FieldType {
|
|
10154
10341
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RowFillerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
10155
10342
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: RowFillerComponent, selector: "formly-row-filler", usesInheritance: true, ngImport: i0, template: `<div class="row-filler"></div>`, isInline: true, styles: [".row-filler{width:100%}\n"] }); }
|
|
@@ -14893,6 +15080,7 @@ class OriginFormModule {
|
|
|
14893
15080
|
FormlyFieldIdentificationComponent,
|
|
14894
15081
|
FormlyParagraphComponent,
|
|
14895
15082
|
FormlyRadioComponent,
|
|
15083
|
+
FormlyCheckboxesComponent,
|
|
14896
15084
|
RowFillerComponent,
|
|
14897
15085
|
FormlyScanIdComponent,
|
|
14898
15086
|
FormlySignComponent,
|
|
@@ -15064,6 +15252,7 @@ class OriginFormModule {
|
|
|
15064
15252
|
component: FormlyParagraphComponent,
|
|
15065
15253
|
},
|
|
15066
15254
|
{ name: 'formly-radio', component: FormlyRadioComponent },
|
|
15255
|
+
{ name: 'formly-checkboxes', component: FormlyCheckboxesComponent },
|
|
15067
15256
|
{
|
|
15068
15257
|
name: 'formly-validate-contact-info',
|
|
15069
15258
|
component: FormlyValidateContactInfoComponent,
|
|
@@ -15099,6 +15288,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
15099
15288
|
FormlyFieldIdentificationComponent,
|
|
15100
15289
|
FormlyParagraphComponent,
|
|
15101
15290
|
FormlyRadioComponent,
|
|
15291
|
+
FormlyCheckboxesComponent,
|
|
15102
15292
|
RowFillerComponent,
|
|
15103
15293
|
FormlyScanIdComponent,
|
|
15104
15294
|
FormlySignComponent,
|
|
@@ -15211,6 +15401,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
15211
15401
|
component: FormlyParagraphComponent,
|
|
15212
15402
|
},
|
|
15213
15403
|
{ name: 'formly-radio', component: FormlyRadioComponent },
|
|
15404
|
+
{ name: 'formly-checkboxes', component: FormlyCheckboxesComponent },
|
|
15214
15405
|
{
|
|
15215
15406
|
name: 'formly-validate-contact-info',
|
|
15216
15407
|
component: FormlyValidateContactInfoComponent,
|