@ecodev/natural 61.1.0 → 61.1.2
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/modules/hierarchic-selector/classes/hierarchic-configuration.mjs +1 -1
- package/esm2022/lib/modules/hierarchic-selector/hierarchic-selector/hierarchic-selector.component.mjs +3 -3
- package/esm2022/lib/modules/hierarchic-selector/hierarchic-selector/hierarchic-selector.service.mjs +12 -20
- package/esm2022/lib/modules/select/abstract-select.component.mjs +7 -13
- package/esm2022/lib/modules/select/select-enum/select-enum.component.mjs +5 -9
- package/esm2022/lib/modules/select/select-hierarchic/select-hierarchic.component.mjs +4 -8
- package/fesm2022/ecodev-natural.mjs +22 -43
- package/fesm2022/ecodev-natural.mjs.map +1 -1
- package/lib/modules/hierarchic-selector/classes/hierarchic-configuration.d.ts +0 -4
- package/lib/modules/hierarchic-selector/hierarchic-selector/hierarchic-selector.service.d.ts +0 -1
- package/lib/modules/select/abstract-select.component.d.ts +3 -3
- package/lib/modules/select/select-enum/select-enum.component.d.ts +0 -1
- package/lib/modules/select/select-hierarchic/select-hierarchic.component.d.ts +0 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Component, Injectable, DestroyRef, Directive, HostBinding, HostListener, InjectionToken, ElementRef, TemplateRef, ViewEncapsulation, ViewChild, Injector, Input, EventEmitter, Output, Pipe, Optional, Inject, LOCALE_ID, APP_INITIALIZER,
|
|
2
|
+
import { inject, Component, Injectable, DestroyRef, Directive, HostBinding, HostListener, InjectionToken, ElementRef, TemplateRef, ViewEncapsulation, ViewChild, Injector, Input, EventEmitter, Output, Pipe, Optional, Inject, LOCALE_ID, APP_INITIALIZER, ContentChild, EnvironmentInjector, createEnvironmentInjector, createComponent, runInInjectionContext, PLATFORM_ID, ErrorHandler, importProvidersFrom } from '@angular/core';
|
|
3
3
|
import * as i1$2 from '@angular/forms';
|
|
4
|
-
import { FormGroup, FormArray, Validators, UntypedFormGroup, UntypedFormArray, FormControl, FormsModule, ReactiveFormsModule, UntypedFormControl, FormControlDirective, FormControlName
|
|
4
|
+
import { FormGroup, FormArray, Validators, UntypedFormGroup, UntypedFormArray, FormControl, FormsModule, ReactiveFormsModule, UntypedFormControl, NgControl, FormControlDirective, FormControlName } from '@angular/forms';
|
|
5
5
|
import { ActivatedRoute, Router, NavigationStart, NavigationEnd, RouteConfigLoadStart, RouteConfigLoadEnd, PRIMARY_OUTLET, RouterLink, NavigationError, DefaultUrlSerializer, UrlTree } from '@angular/router';
|
|
6
6
|
import { pickBy, cloneDeep, uniq, groupBy, mergeWith, defaultsDeep, omit, isEqual, kebabCase, merge, clone, pick, defaults, isEmpty, isObject, intersection, flatten, differenceWith } from 'lodash-es';
|
|
7
7
|
import * as i1 from '@angular/material/dialog';
|
|
@@ -6590,7 +6590,6 @@ class ExternalFormControlMatcher extends ErrorStateMatcher {
|
|
|
6590
6590
|
}
|
|
6591
6591
|
}
|
|
6592
6592
|
class AbstractSelect {
|
|
6593
|
-
ngControl;
|
|
6594
6593
|
placeholder;
|
|
6595
6594
|
/**
|
|
6596
6595
|
* Mat-hint
|
|
@@ -6662,8 +6661,8 @@ class AbstractSelect {
|
|
|
6662
6661
|
*/
|
|
6663
6662
|
onTouched;
|
|
6664
6663
|
matcher;
|
|
6665
|
-
|
|
6666
|
-
|
|
6664
|
+
ngControl = inject(NgControl, { optional: true, self: true });
|
|
6665
|
+
constructor() {
|
|
6667
6666
|
if (this.ngControl) {
|
|
6668
6667
|
this.ngControl.valueAccessor = this;
|
|
6669
6668
|
}
|
|
@@ -6758,17 +6757,13 @@ class AbstractSelect {
|
|
|
6758
6757
|
}
|
|
6759
6758
|
this.internalCtrl.updateValueAndValidity();
|
|
6760
6759
|
}
|
|
6761
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: AbstractSelect, deps: [
|
|
6760
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: AbstractSelect, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
6762
6761
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.3", type: AbstractSelect, isStandalone: true, inputs: { placeholder: "placeholder", hint: "hint", required: "required", navigateTo: "navigateTo", clearLabel: "clearLabel", showIcon: "showIcon", icon: "icon", displayWith: "displayWith", disabled: "disabled" }, outputs: { selectionChange: "selectionChange", blur: "blur" }, ngImport: i0 });
|
|
6763
6762
|
}
|
|
6764
6763
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: AbstractSelect, decorators: [{
|
|
6765
6764
|
type: Directive,
|
|
6766
6765
|
args: [{ standalone: true }]
|
|
6767
|
-
}], ctorParameters: () => [
|
|
6768
|
-
type: Optional
|
|
6769
|
-
}, {
|
|
6770
|
-
type: Self
|
|
6771
|
-
}] }], propDecorators: { placeholder: [{
|
|
6766
|
+
}], ctorParameters: () => [], propDecorators: { placeholder: [{
|
|
6772
6767
|
type: Input
|
|
6773
6768
|
}], hint: [{
|
|
6774
6769
|
type: Input
|
|
@@ -7302,7 +7297,7 @@ class NaturalHierarchicSelectorService {
|
|
|
7302
7297
|
*/
|
|
7303
7298
|
init(config, contextFilter = null, searchVariables = null) {
|
|
7304
7299
|
this.validateConfiguration(config);
|
|
7305
|
-
this.configuration =
|
|
7300
|
+
this.configuration = config;
|
|
7306
7301
|
return this.getList(null, contextFilter, searchVariables).pipe(map(data => this.dataChange.next(data)));
|
|
7307
7302
|
}
|
|
7308
7303
|
/**
|
|
@@ -7335,7 +7330,7 @@ class NaturalHierarchicSelectorService {
|
|
|
7335
7330
|
*/
|
|
7336
7331
|
getList(node = null, contextFilters = null, searchVariables = null) {
|
|
7337
7332
|
const configurations = this.getContextualizedConfigs(node, contextFilters, searchVariables);
|
|
7338
|
-
const observables = configurations.map(c => c.
|
|
7333
|
+
const observables = configurations.map(c => c.injectedService.getAll(c.variablesManager));
|
|
7339
7334
|
// Fire queries, and merge results, transforming apollo items into Node Object.
|
|
7340
7335
|
return forkJoin(observables).pipe(map(results => {
|
|
7341
7336
|
const listing = [];
|
|
@@ -7351,7 +7346,7 @@ class NaturalHierarchicSelectorService {
|
|
|
7351
7346
|
}
|
|
7352
7347
|
countItems(node, contextFilters = null) {
|
|
7353
7348
|
const configurations = this.getContextualizedConfigs(node, contextFilters, null);
|
|
7354
|
-
const observables = configurations.map(c => c.
|
|
7349
|
+
const observables = configurations.map(c => c.injectedService.count(c.variablesManager).pipe(first$1()));
|
|
7355
7350
|
forkJoin(observables).subscribe(results => {
|
|
7356
7351
|
const totalItems = results.reduce((total, length) => total + length, 0);
|
|
7357
7352
|
node.expandable = totalItems > 0;
|
|
@@ -7368,10 +7363,9 @@ class NaturalHierarchicSelectorService {
|
|
|
7368
7363
|
const configs = node ? this.getNextConfigs(node.node.config) : this.configuration;
|
|
7369
7364
|
const pagination = { pageIndex: 0, pageSize: 999 };
|
|
7370
7365
|
for (const config of configs) {
|
|
7371
|
-
const item = {};
|
|
7372
7366
|
const contextFilter = this.getFilterByService(config, contextFilters);
|
|
7373
7367
|
const filter = this.getServiceFilter(node, config, contextFilter, !!searchVariables);
|
|
7374
|
-
if (!filter
|
|
7368
|
+
if (!filter) {
|
|
7375
7369
|
continue;
|
|
7376
7370
|
}
|
|
7377
7371
|
const variablesManager = new NaturalQueryVariablesManager();
|
|
@@ -7380,11 +7374,12 @@ class NaturalHierarchicSelectorService {
|
|
|
7380
7374
|
if (searchVariables) {
|
|
7381
7375
|
variablesManager.set('natural-search', searchVariables);
|
|
7382
7376
|
}
|
|
7383
|
-
|
|
7384
|
-
|
|
7385
|
-
|
|
7386
|
-
|
|
7387
|
-
|
|
7377
|
+
const injectedService = this.injector.get(config.service);
|
|
7378
|
+
configsAndServices.push({
|
|
7379
|
+
configuration: config,
|
|
7380
|
+
injectedService: injectedService,
|
|
7381
|
+
variablesManager: variablesManager,
|
|
7382
|
+
});
|
|
7388
7383
|
}
|
|
7389
7384
|
return configsAndServices;
|
|
7390
7385
|
}
|
|
@@ -7424,14 +7419,6 @@ class NaturalHierarchicSelectorService {
|
|
|
7424
7419
|
}
|
|
7425
7420
|
return result;
|
|
7426
7421
|
}
|
|
7427
|
-
injectServicesInConfiguration(configurations) {
|
|
7428
|
-
for (const config of configurations) {
|
|
7429
|
-
if (!config.injectedService) {
|
|
7430
|
-
config.injectedService = this.injector.get(config.service);
|
|
7431
|
-
}
|
|
7432
|
-
}
|
|
7433
|
-
return configurations;
|
|
7434
|
-
}
|
|
7435
7422
|
/**
|
|
7436
7423
|
* Checks that each configuration.selectableAtKey attribute is unique
|
|
7437
7424
|
*/
|
|
@@ -8378,7 +8365,7 @@ class NaturalHierarchicSelectorComponent {
|
|
|
8378
8365
|
return model.__typename + '-' + model.id;
|
|
8379
8366
|
}
|
|
8380
8367
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: NaturalHierarchicSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8381
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.3", type: NaturalHierarchicSelectorComponent, isStandalone: true, selector: "natural-hierarchic-selector", inputs: { displayWith: "displayWith", config: "config", multiple: "multiple", selected: "selected", allowUnselect: "allowUnselect", filters: "filters", searchFacets: "searchFacets", searchSelections: "searchSelections" }, outputs: { searchSelectionChange: "searchSelectionChange", selectionChange: "selectionChange" }, providers: [NaturalHierarchicSelectorService], usesOnChanges: true, ngImport: i0, template: "<div [style.margin-bottom.px]=\"20\">\n <natural-search (selectionChange)=\"search($event)\" [facets]=\"searchFacets\" [selections]=\"searchSelections\" />\n</div>\n\n<div class=\"body\">\n @if (loading) {\n <mat-progress-spinner [diameter]=\"36\" mode=\"indeterminate\" style=\"margin: 10px\" />\n }\n\n <mat-tree [dataSource]=\"dataSource\" [treeControl]=\"treeControl\">\n <mat-tree-node *matTreeNodeDef=\"let node\" [ngClass]=\"{leaf: !node.expandable}\" matTreeNodePadding>\n @if (node.expandable) {\n <button\n (click)=\"loadChildren(node)\"\n [attr.aria-label]=\"'toggle ' + node.name\"\n mat-icon-button\n matTreeNodeToggle\n >\n @if (node.loading) {\n <mat-progress-spinner [diameter]=\"24\" [strokeWidth]=\"5\" mode=\"indeterminate\" />\n }\n @if (!node.loading) {\n <mat-icon [naturalIcon]=\"treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'\" />\n }\n </button>\n }\n\n <mat-checkbox\n (change)=\"toggleFlatNode(node)\"\n [checked]=\"flatNodesSelection.isSelected(node)\"\n [disabled]=\"!isNodeTogglable(node)\"\n style=\"margin-right: 10px\"\n >\n @if (node.node.config.icon) {\n <mat-icon [naturalIcon]=\"node.node.config.icon\" style=\"margin-right: 10px\" />\n }\n <span>{{ node.name }}</span>\n </mat-checkbox>\n </mat-tree-node>\n </mat-tree>\n\n <mat-chip-listbox aria-orientation=\"vertical\" class=\"mat-mdc-chip-set-stacked\">\n @for (node of selectedNodes; track node.model.id) {\n <mat-chip-option (removed)=\"unselectModelNode(node)\" [removable]=\"true\" [selectable]=\"false\">\n @if (node.config.icon) {\n <mat-icon [naturalIcon]=\"node.config.icon\" />\n }\n
|
|
8368
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.3", type: NaturalHierarchicSelectorComponent, isStandalone: true, selector: "natural-hierarchic-selector", inputs: { displayWith: "displayWith", config: "config", multiple: "multiple", selected: "selected", allowUnselect: "allowUnselect", filters: "filters", searchFacets: "searchFacets", searchSelections: "searchSelections" }, outputs: { searchSelectionChange: "searchSelectionChange", selectionChange: "selectionChange" }, providers: [NaturalHierarchicSelectorService], usesOnChanges: true, ngImport: i0, template: "<div [style.margin-bottom.px]=\"20\">\n <natural-search (selectionChange)=\"search($event)\" [facets]=\"searchFacets\" [selections]=\"searchSelections\" />\n</div>\n\n<div class=\"body\">\n @if (loading) {\n <mat-progress-spinner [diameter]=\"36\" mode=\"indeterminate\" style=\"margin: 10px\" />\n }\n\n <mat-tree [dataSource]=\"dataSource\" [treeControl]=\"treeControl\">\n <mat-tree-node *matTreeNodeDef=\"let node\" [ngClass]=\"{leaf: !node.expandable}\" matTreeNodePadding>\n @if (node.expandable) {\n <button\n (click)=\"loadChildren(node)\"\n [attr.aria-label]=\"'toggle ' + node.name\"\n mat-icon-button\n matTreeNodeToggle\n >\n @if (node.loading) {\n <mat-progress-spinner [diameter]=\"24\" [strokeWidth]=\"5\" mode=\"indeterminate\" />\n }\n @if (!node.loading) {\n <mat-icon [naturalIcon]=\"treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'\" />\n }\n </button>\n }\n\n <mat-checkbox\n (change)=\"toggleFlatNode(node)\"\n [checked]=\"flatNodesSelection.isSelected(node)\"\n [disabled]=\"!isNodeTogglable(node)\"\n style=\"margin-right: 10px\"\n >\n @if (node.node.config.icon) {\n <mat-icon [naturalIcon]=\"node.node.config.icon\" style=\"margin-right: 10px\" />\n }\n <span>{{ node.name }}</span>\n </mat-checkbox>\n </mat-tree-node>\n </mat-tree>\n\n <mat-chip-listbox aria-orientation=\"vertical\" class=\"mat-mdc-chip-set-stacked\">\n @for (node of selectedNodes; track node.model.id) {\n <mat-chip-option (removed)=\"unselectModelNode(node)\" [removable]=\"true\" [selectable]=\"false\">\n @if (node.config.icon) {\n <mat-icon matChipAvatar [naturalIcon]=\"node.config.icon\" />\n }\n {{ node.model.name || node.model.fullName }}\n <button matChipRemove>\n <mat-icon naturalIcon=\"cancel\" />\n </button>\n </mat-chip-option>\n } @empty {\n <p class=\"mat-body nat-padding-horizontal\" i18n>Aucune s\u00E9lection</p>\n }\n </mat-chip-listbox>\n</div>\n\n@if (!loading && !dataSource.data.length) {\n <div i18n>Aucun r\u00E9sultat</div>\n}\n", styles: [":host{display:block}:host ul,:host li{-webkit-margin-before:0;-webkit-margin-after:0;list-style-type:none}:host mat-icon{width:18px;height:18px;font-size:18px}:host .mat-tree-node.leaf{margin-left:48px}:host .body{display:flex;flex-direction:row;justify-content:space-between}:host .body mat-tree{flex:66}:host .body mat-chip-listbox{flex:33}:host mat-tree{flex-shrink:0}:host mat-chip-listbox{margin-left:10px}\n"], dependencies: [{ kind: "component", type: NaturalSearchComponent, selector: "natural-search", inputs: ["placeholder", "facets", "multipleGroups", "dropdownTitle", "selections"], outputs: ["selectionChange"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i8.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatTreeModule }, { kind: "directive", type: i3$2.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "directive", type: i3$2.MatTreeNodePadding, selector: "[matTreeNodePadding]", inputs: ["matTreeNodePadding", "matTreeNodePaddingIndent"] }, { kind: "directive", type: i3$2.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { kind: "component", type: i3$2.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i3$2.MatTreeNode, selector: "mat-tree-node", inputs: ["tabIndex", "disabled"], outputs: ["activation", "expandedChange"], exportAs: ["matTreeNode"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NaturalIconDirective, selector: "mat-icon[naturalIcon]", inputs: ["naturalIcon", "size"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i7.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: "ngmodule", type: MatChipsModule }, { kind: "directive", type: i7$1.MatChipAvatar, selector: "mat-chip-avatar, [matChipAvatar]" }, { kind: "component", type: i7$1.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i7$1.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["selectable", "selected"], outputs: ["selectionChange"] }, { kind: "directive", type: i7$1.MatChipRemove, selector: "[matChipRemove]" }] });
|
|
8382
8369
|
}
|
|
8383
8370
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: NaturalHierarchicSelectorComponent, decorators: [{
|
|
8384
8371
|
type: Component,
|
|
@@ -8392,7 +8379,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImpor
|
|
|
8392
8379
|
NaturalIconDirective,
|
|
8393
8380
|
MatCheckboxModule,
|
|
8394
8381
|
MatChipsModule,
|
|
8395
|
-
], template: "<div [style.margin-bottom.px]=\"20\">\n <natural-search (selectionChange)=\"search($event)\" [facets]=\"searchFacets\" [selections]=\"searchSelections\" />\n</div>\n\n<div class=\"body\">\n @if (loading) {\n <mat-progress-spinner [diameter]=\"36\" mode=\"indeterminate\" style=\"margin: 10px\" />\n }\n\n <mat-tree [dataSource]=\"dataSource\" [treeControl]=\"treeControl\">\n <mat-tree-node *matTreeNodeDef=\"let node\" [ngClass]=\"{leaf: !node.expandable}\" matTreeNodePadding>\n @if (node.expandable) {\n <button\n (click)=\"loadChildren(node)\"\n [attr.aria-label]=\"'toggle ' + node.name\"\n mat-icon-button\n matTreeNodeToggle\n >\n @if (node.loading) {\n <mat-progress-spinner [diameter]=\"24\" [strokeWidth]=\"5\" mode=\"indeterminate\" />\n }\n @if (!node.loading) {\n <mat-icon [naturalIcon]=\"treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'\" />\n }\n </button>\n }\n\n <mat-checkbox\n (change)=\"toggleFlatNode(node)\"\n [checked]=\"flatNodesSelection.isSelected(node)\"\n [disabled]=\"!isNodeTogglable(node)\"\n style=\"margin-right: 10px\"\n >\n @if (node.node.config.icon) {\n <mat-icon [naturalIcon]=\"node.node.config.icon\" style=\"margin-right: 10px\" />\n }\n <span>{{ node.name }}</span>\n </mat-checkbox>\n </mat-tree-node>\n </mat-tree>\n\n <mat-chip-listbox aria-orientation=\"vertical\" class=\"mat-mdc-chip-set-stacked\">\n @for (node of selectedNodes; track node.model.id) {\n <mat-chip-option (removed)=\"unselectModelNode(node)\" [removable]=\"true\" [selectable]=\"false\">\n @if (node.config.icon) {\n <mat-icon [naturalIcon]=\"node.config.icon\" />\n }\n
|
|
8382
|
+
], template: "<div [style.margin-bottom.px]=\"20\">\n <natural-search (selectionChange)=\"search($event)\" [facets]=\"searchFacets\" [selections]=\"searchSelections\" />\n</div>\n\n<div class=\"body\">\n @if (loading) {\n <mat-progress-spinner [diameter]=\"36\" mode=\"indeterminate\" style=\"margin: 10px\" />\n }\n\n <mat-tree [dataSource]=\"dataSource\" [treeControl]=\"treeControl\">\n <mat-tree-node *matTreeNodeDef=\"let node\" [ngClass]=\"{leaf: !node.expandable}\" matTreeNodePadding>\n @if (node.expandable) {\n <button\n (click)=\"loadChildren(node)\"\n [attr.aria-label]=\"'toggle ' + node.name\"\n mat-icon-button\n matTreeNodeToggle\n >\n @if (node.loading) {\n <mat-progress-spinner [diameter]=\"24\" [strokeWidth]=\"5\" mode=\"indeterminate\" />\n }\n @if (!node.loading) {\n <mat-icon [naturalIcon]=\"treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'\" />\n }\n </button>\n }\n\n <mat-checkbox\n (change)=\"toggleFlatNode(node)\"\n [checked]=\"flatNodesSelection.isSelected(node)\"\n [disabled]=\"!isNodeTogglable(node)\"\n style=\"margin-right: 10px\"\n >\n @if (node.node.config.icon) {\n <mat-icon [naturalIcon]=\"node.node.config.icon\" style=\"margin-right: 10px\" />\n }\n <span>{{ node.name }}</span>\n </mat-checkbox>\n </mat-tree-node>\n </mat-tree>\n\n <mat-chip-listbox aria-orientation=\"vertical\" class=\"mat-mdc-chip-set-stacked\">\n @for (node of selectedNodes; track node.model.id) {\n <mat-chip-option (removed)=\"unselectModelNode(node)\" [removable]=\"true\" [selectable]=\"false\">\n @if (node.config.icon) {\n <mat-icon matChipAvatar [naturalIcon]=\"node.config.icon\" />\n }\n {{ node.model.name || node.model.fullName }}\n <button matChipRemove>\n <mat-icon naturalIcon=\"cancel\" />\n </button>\n </mat-chip-option>\n } @empty {\n <p class=\"mat-body nat-padding-horizontal\" i18n>Aucune s\u00E9lection</p>\n }\n </mat-chip-listbox>\n</div>\n\n@if (!loading && !dataSource.data.length) {\n <div i18n>Aucun r\u00E9sultat</div>\n}\n", styles: [":host{display:block}:host ul,:host li{-webkit-margin-before:0;-webkit-margin-after:0;list-style-type:none}:host mat-icon{width:18px;height:18px;font-size:18px}:host .mat-tree-node.leaf{margin-left:48px}:host .body{display:flex;flex-direction:row;justify-content:space-between}:host .body mat-tree{flex:66}:host .body mat-chip-listbox{flex:33}:host mat-tree{flex-shrink:0}:host mat-chip-listbox{margin-left:10px}\n"] }]
|
|
8396
8383
|
}], propDecorators: { displayWith: [{
|
|
8397
8384
|
type: Input
|
|
8398
8385
|
}], config: [{
|
|
@@ -10229,10 +10216,6 @@ class NaturalSelectEnumComponent extends AbstractSelect {
|
|
|
10229
10216
|
*/
|
|
10230
10217
|
multiple = false;
|
|
10231
10218
|
items;
|
|
10232
|
-
constructor() {
|
|
10233
|
-
const ngControl = inject(NgControl, { optional: true, self: true });
|
|
10234
|
-
super(ngControl);
|
|
10235
|
-
}
|
|
10236
10219
|
ngOnInit() {
|
|
10237
10220
|
super.ngOnInit();
|
|
10238
10221
|
this.items = this.enumService.get(this.enumName);
|
|
@@ -10240,13 +10223,13 @@ class NaturalSelectEnumComponent extends AbstractSelect {
|
|
|
10240
10223
|
getDisplayFn() {
|
|
10241
10224
|
throw new Error('This should never be called');
|
|
10242
10225
|
}
|
|
10243
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: NaturalSelectEnumComponent, deps:
|
|
10226
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: NaturalSelectEnumComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
10244
10227
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.3", type: NaturalSelectEnumComponent, isStandalone: true, selector: "natural-select-enum", inputs: { enumName: "enumName", nullLabel: "nullLabel", optionDisabled: "optionDisabled", multiple: "multiple" }, usesInheritance: true, ngImport: i0, template: "<mat-form-field>\n <mat-label>{{ placeholder }}</mat-label>\n <mat-select\n (selectionChange)=\"propagateValue($event.value)\"\n [formControl]=\"internalCtrl\"\n (blur)=\"onBlur()\"\n [errorStateMatcher]=\"matcher\"\n [multiple]=\"multiple\"\n >\n @if (nullLabel) {\n <mat-option [value]=\"null\">{{ nullLabel }}</mat-option>\n }\n @for (item of items | async; track item.value) {\n <mat-option [value]=\"item.value\" [disabled]=\"optionDisabled ? optionDisabled(item) : false\">\n {{ item.name }}\n </mat-option>\n }\n </mat-select>\n\n @if (hint) {\n <mat-hint>{{ hint }}</mat-hint>\n }\n\n @if (hasRequiredError()) {\n <mat-error i18n>Ce champ est requis</mat-error>\n }\n</mat-form-field>\n", styles: [":host{display:flex;flex-direction:column}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i1$3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i3.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i4.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatOptionModule }] });
|
|
10245
10228
|
}
|
|
10246
10229
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: NaturalSelectEnumComponent, decorators: [{
|
|
10247
10230
|
type: Component,
|
|
10248
10231
|
args: [{ selector: 'natural-select-enum', standalone: true, imports: [MatFormFieldModule, MatSelectModule, FormsModule, ReactiveFormsModule, CommonModule, MatOptionModule], template: "<mat-form-field>\n <mat-label>{{ placeholder }}</mat-label>\n <mat-select\n (selectionChange)=\"propagateValue($event.value)\"\n [formControl]=\"internalCtrl\"\n (blur)=\"onBlur()\"\n [errorStateMatcher]=\"matcher\"\n [multiple]=\"multiple\"\n >\n @if (nullLabel) {\n <mat-option [value]=\"null\">{{ nullLabel }}</mat-option>\n }\n @for (item of items | async; track item.value) {\n <mat-option [value]=\"item.value\" [disabled]=\"optionDisabled ? optionDisabled(item) : false\">\n {{ item.name }}\n </mat-option>\n }\n </mat-select>\n\n @if (hint) {\n <mat-hint>{{ hint }}</mat-hint>\n }\n\n @if (hasRequiredError()) {\n <mat-error i18n>Ce champ est requis</mat-error>\n }\n</mat-form-field>\n", styles: [":host{display:flex;flex-direction:column}\n"] }]
|
|
10249
|
-
}],
|
|
10232
|
+
}], propDecorators: { enumName: [{
|
|
10250
10233
|
type: Input,
|
|
10251
10234
|
args: [{ required: true }]
|
|
10252
10235
|
}], nullLabel: [{
|
|
@@ -10307,10 +10290,6 @@ class NaturalSelectHierarchicComponent extends AbstractSelect {
|
|
|
10307
10290
|
* times This prevents it.
|
|
10308
10291
|
*/
|
|
10309
10292
|
lockOpenDialog = false;
|
|
10310
|
-
constructor() {
|
|
10311
|
-
const ngControl = inject(NgControl, { optional: true, self: true });
|
|
10312
|
-
super(ngControl);
|
|
10313
|
-
}
|
|
10314
10293
|
/**
|
|
10315
10294
|
* Very important to return something, above all if [select]='displayedValue' attribute value is used
|
|
10316
10295
|
*/
|
|
@@ -10374,7 +10353,7 @@ class NaturalSelectHierarchicComponent extends AbstractSelect {
|
|
|
10374
10353
|
getSelectKey() {
|
|
10375
10354
|
return this.config?.find(c => !!c.selectableAtKey)?.selectableAtKey;
|
|
10376
10355
|
}
|
|
10377
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: NaturalSelectHierarchicComponent, deps:
|
|
10356
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: NaturalSelectHierarchicComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
10378
10357
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.3", type: NaturalSelectHierarchicComponent, isStandalone: true, selector: "natural-select-hierarchic", inputs: { selectLabel: "selectLabel", config: "config", filters: "filters" }, usesInheritance: true, ngImport: i0, template: "<mat-form-field>\n <mat-label>{{ placeholder }}</mat-label>\n\n <!-- Input for hierarchical selector -->\n <input\n (blur)=\"blur.emit()\"\n (focus)=\"openDialog()\"\n [formControl]=\"internalCtrl\"\n [errorStateMatcher]=\"matcher\"\n aria-label=\"Recherche et s\u00E9lection\"\n i18n-aria-label\n matInput\n />\n\n <!-- Meta data -->\n @if (showIcon) {\n <mat-icon [naturalIcon]=\"icon\" matIconPrefix />\n }\n\n @if (hint) {\n <mat-hint>{{ hint }}</mat-hint>\n }\n\n <!-- Clear button -->\n <div matIconSuffix>\n @if (internalCtrl.value && internalCtrl.enabled && !clearLabel) {\n <button\n (click)=\"clear(); $event.stopPropagation()\"\n mat-icon-button\n i18n-matTooltip\n matTooltip=\"D\u00E9s\u00E9lectionner\"\n >\n <mat-icon naturalIcon=\"close\" />\n </button>\n }\n @if (internalCtrl.value && navigateTo) {\n <button\n [routerLink]=\"navigateTo\"\n (click)=\"$event.stopPropagation()\"\n mat-icon-button\n i18n-matTooltip\n matTooltip=\"Naviguer vers\"\n >\n <mat-icon naturalIcon=\"open_in_browser\" />\n </button>\n }\n </div>\n\n @if (hasRequiredError()) {\n <mat-error i18n>Ce champ est requis</mat-error>\n }\n</mat-form-field>\n\n<!-- Additional (un)select/(un)link buttons for more visual cohesion with natural-relations --><!-- [clearLabel] and/or [selectLabel] has to be given as attribute input -->\n@if (showSelectButton() || showClearButton()) {\n <div class=\"external-buttons\">\n @if (showSelectButton()) {\n <button (click)=\"openDialog()\" color=\"primary\" mat-flat-button>{{ selectLabel }}</button>\n }\n @if (showClearButton()) {\n <button (click)=\"clear()\" color=\"warn\" mat-button>{{ clearLabel }}</button>\n }\n </div>\n}\n", styles: [":host{display:flex;flex-direction:column}:host>*:not(:last-child){margin-bottom:20px}:host .external-buttons{display:flex;flex-direction:row}:host .external-buttons>*:not(:last-child){margin-right:10px}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i1$3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i1$3.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i1$3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i5.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: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NaturalIconDirective, selector: "mat-icon[naturalIcon]", inputs: ["naturalIcon", "size"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i6$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
|
|
10379
10358
|
}
|
|
10380
10359
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: NaturalSelectHierarchicComponent, decorators: [{
|
|
@@ -10390,7 +10369,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImpor
|
|
|
10390
10369
|
MatTooltipModule,
|
|
10391
10370
|
RouterLink,
|
|
10392
10371
|
], template: "<mat-form-field>\n <mat-label>{{ placeholder }}</mat-label>\n\n <!-- Input for hierarchical selector -->\n <input\n (blur)=\"blur.emit()\"\n (focus)=\"openDialog()\"\n [formControl]=\"internalCtrl\"\n [errorStateMatcher]=\"matcher\"\n aria-label=\"Recherche et s\u00E9lection\"\n i18n-aria-label\n matInput\n />\n\n <!-- Meta data -->\n @if (showIcon) {\n <mat-icon [naturalIcon]=\"icon\" matIconPrefix />\n }\n\n @if (hint) {\n <mat-hint>{{ hint }}</mat-hint>\n }\n\n <!-- Clear button -->\n <div matIconSuffix>\n @if (internalCtrl.value && internalCtrl.enabled && !clearLabel) {\n <button\n (click)=\"clear(); $event.stopPropagation()\"\n mat-icon-button\n i18n-matTooltip\n matTooltip=\"D\u00E9s\u00E9lectionner\"\n >\n <mat-icon naturalIcon=\"close\" />\n </button>\n }\n @if (internalCtrl.value && navigateTo) {\n <button\n [routerLink]=\"navigateTo\"\n (click)=\"$event.stopPropagation()\"\n mat-icon-button\n i18n-matTooltip\n matTooltip=\"Naviguer vers\"\n >\n <mat-icon naturalIcon=\"open_in_browser\" />\n </button>\n }\n </div>\n\n @if (hasRequiredError()) {\n <mat-error i18n>Ce champ est requis</mat-error>\n }\n</mat-form-field>\n\n<!-- Additional (un)select/(un)link buttons for more visual cohesion with natural-relations --><!-- [clearLabel] and/or [selectLabel] has to be given as attribute input -->\n@if (showSelectButton() || showClearButton()) {\n <div class=\"external-buttons\">\n @if (showSelectButton()) {\n <button (click)=\"openDialog()\" color=\"primary\" mat-flat-button>{{ selectLabel }}</button>\n }\n @if (showClearButton()) {\n <button (click)=\"clear()\" color=\"warn\" mat-button>{{ clearLabel }}</button>\n }\n </div>\n}\n", styles: [":host{display:flex;flex-direction:column}:host>*:not(:last-child){margin-bottom:20px}:host .external-buttons{display:flex;flex-direction:row}:host .external-buttons>*:not(:last-child){margin-right:10px}\n"] }]
|
|
10393
|
-
}],
|
|
10372
|
+
}], propDecorators: { selectLabel: [{
|
|
10394
10373
|
type: Input
|
|
10395
10374
|
}], config: [{
|
|
10396
10375
|
type: Input
|