@ecodev/natural 63.8.0 → 63.9.0
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/fesm2022/ecodev-natural.mjs +362 -346
- package/fesm2022/ecodev-natural.mjs.map +1 -1
- package/lib/modules/hierarchic-selector/hierarchic-selector/hierarchic-selector.component.d.ts +10 -1
- package/lib/modules/hierarchic-selector/hierarchic-selector-dialog/hierarchic-selector-dialog.component.d.ts +4 -0
- package/package.json +1 -1
|
@@ -56,10 +56,10 @@ import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
|
56
56
|
import * as i8 from '@angular/material/progress-spinner';
|
|
57
57
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
58
58
|
import { FlatTreeControl } from '@angular/cdk/tree';
|
|
59
|
-
import * as i3$2 from '@angular/material/tree';
|
|
60
|
-
import { MatTreeFlattener, MatTreeFlatDataSource, MatTreeModule } from '@angular/material/tree';
|
|
61
59
|
import * as i7 from '@angular/material/chips';
|
|
62
60
|
import { MatChipsModule } from '@angular/material/chips';
|
|
61
|
+
import * as i3$2 from '@angular/material/tree';
|
|
62
|
+
import { MatTreeFlattener, MatTreeFlatDataSource, MatTreeModule } from '@angular/material/tree';
|
|
63
63
|
import { MatDividerModule } from '@angular/material/divider';
|
|
64
64
|
import * as i2$2 from '@angular/material/button-toggle';
|
|
65
65
|
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
|
@@ -7304,367 +7304,100 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
7304
7304
|
args: [{ imports: [FormsModule, ReactiveFormsModule, MatFormFieldModule, MatSelectModule, MatOptionModule, MatInputModule], template: "<form [formGroup]=\"form\">\n <mat-form-field style=\"max-width: 4em; margin-right: 1em\">\n <mat-label i18n=\"Mathematical operator < > =\">Op\u00E9rateur</mat-label>\n <mat-select panelWidth=\"\" [formControl]=\"operatorCtrl\" [required]=\"true\">\n @for (item of operators; track item) {\n <mat-option [value]=\"item.key\">\n {{ item.label }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label i18n>Valeur</mat-label>\n <input\n matInput\n type=\"number\"\n [errorStateMatcher]=\"matcher\"\n [formControl]=\"valueCtrl\"\n [attr.max]=\"configuration.max\"\n [attr.min]=\"configuration.min\"\n [required]=\"true\"\n [step]=\"configuration.step\"\n (keydown.enter)=\"close()\"\n />\n @if (valueCtrl.hasError('min')) {\n <mat-error>< {{ configuration.min }}</mat-error>\n }\n @if (valueCtrl.hasError('max')) {\n <mat-error>> {{ configuration.max }}</mat-error>\n }\n </mat-form-field>\n</form>\n", styles: [":host input::-webkit-outer-spin-button,:host input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}\n"] }]
|
|
7305
7305
|
}], ctorParameters: () => [] });
|
|
7306
7306
|
|
|
7307
|
-
class
|
|
7308
|
-
|
|
7309
|
-
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
|
|
7313
|
-
|
|
7314
|
-
|
|
7315
|
-
|
|
7316
|
-
|
|
7317
|
-
|
|
7318
|
-
|
|
7319
|
-
this.expandable = expandable;
|
|
7320
|
-
this.selectable = selectable;
|
|
7321
|
-
this.deselectable = deselectable;
|
|
7307
|
+
class FacetSelectorComponent {
|
|
7308
|
+
data = inject(NATURAL_DROPDOWN_DATA);
|
|
7309
|
+
dropdownRef = inject(NaturalDropdownRef);
|
|
7310
|
+
// Never has a real value
|
|
7311
|
+
renderedValue = new BehaviorSubject('');
|
|
7312
|
+
facets = this.data.configuration.facets;
|
|
7313
|
+
selection = null;
|
|
7314
|
+
/**
|
|
7315
|
+
* Get value, including rich object types
|
|
7316
|
+
*/
|
|
7317
|
+
getCondition() {
|
|
7318
|
+
return {};
|
|
7322
7319
|
}
|
|
7323
|
-
|
|
7324
|
-
|
|
7325
|
-
|
|
7326
|
-
|
|
7327
|
-
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
|
|
7331
|
-
|
|
7320
|
+
/**
|
|
7321
|
+
* Allow to close the dropdown with a valid value
|
|
7322
|
+
*/
|
|
7323
|
+
close() {
|
|
7324
|
+
if (this.selection) {
|
|
7325
|
+
this.dropdownRef.close({
|
|
7326
|
+
condition: {},
|
|
7327
|
+
facet: this.selection,
|
|
7328
|
+
});
|
|
7329
|
+
}
|
|
7332
7330
|
}
|
|
7333
|
-
|
|
7334
|
-
return this.
|
|
7331
|
+
isValid() {
|
|
7332
|
+
return !!this.selection;
|
|
7333
|
+
}
|
|
7334
|
+
isDirty() {
|
|
7335
|
+
return true;
|
|
7335
7336
|
}
|
|
7337
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: FacetSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7338
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.13", type: FacetSelectorComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "@if (data.title) {\n <div class=\"dropdown-title mat-body-2\">{{ data.title }}</div>\n}\n<mat-nav-list>\n @for (facet of facets; track $index) {\n <mat-list-item (click)=\"selection = facet; close()\">\n <a>{{ facet.display }}</a>\n </mat-list-item>\n }\n</mat-nav-list>\n", styles: [".mat-nav-list{padding:0}.dropdown-title{opacity:.7;padding:5px;font-variant:all-small-caps;font-size:18px}\n"], dependencies: [{ kind: "ngmodule", type: MatListModule }, { kind: "component", type: i4$1.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i4$1.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }] });
|
|
7336
7339
|
}
|
|
7340
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: FacetSelectorComponent, decorators: [{
|
|
7341
|
+
type: Component,
|
|
7342
|
+
args: [{ imports: [MatListModule], template: "@if (data.title) {\n <div class=\"dropdown-title mat-body-2\">{{ data.title }}</div>\n}\n<mat-nav-list>\n @for (facet of facets; track $index) {\n <mat-list-item (click)=\"selection = facet; close()\">\n <a>{{ facet.display }}</a>\n </mat-list-item>\n }\n</mat-nav-list>\n", styles: [".mat-nav-list{padding:0}.dropdown-title{opacity:.7;padding:5px;font-variant:all-small-caps;font-size:18px}\n"] }]
|
|
7343
|
+
}] });
|
|
7337
7344
|
|
|
7338
|
-
|
|
7339
|
-
|
|
7345
|
+
// Required to check invalid fields when initializing natural-search
|
|
7346
|
+
class AlwaysErrorStateMatcher {
|
|
7347
|
+
isErrorState(control) {
|
|
7348
|
+
return !!control && control.invalid;
|
|
7349
|
+
}
|
|
7350
|
+
}
|
|
7351
|
+
function isComponentValid(component) {
|
|
7352
|
+
return () => {
|
|
7353
|
+
if (!component.isValid()) {
|
|
7354
|
+
return { component: true };
|
|
7355
|
+
}
|
|
7356
|
+
return null;
|
|
7357
|
+
};
|
|
7358
|
+
}
|
|
7359
|
+
class NaturalInputComponent {
|
|
7360
|
+
element = inject(ElementRef);
|
|
7361
|
+
dropdownService = inject(NaturalDropdownService);
|
|
7362
|
+
injector = inject(EnvironmentInjector);
|
|
7340
7363
|
/**
|
|
7341
|
-
*
|
|
7342
|
-
* This observable contains Node.
|
|
7343
|
-
* When it's updated, the TreeController and TreeFlattener process the new array to generate the flat tree.
|
|
7364
|
+
* Controls the ripple effect, used when opening a dropdown
|
|
7344
7365
|
*/
|
|
7345
|
-
|
|
7366
|
+
ripple = viewChild.required(MatRipple);
|
|
7346
7367
|
/**
|
|
7347
|
-
*
|
|
7348
|
-
*
|
|
7349
|
-
* The list should be sorted in the order of the hierarchic (list first parent rules, then child rules)
|
|
7368
|
+
* Native element ref for <input> related to this <natural-input> component
|
|
7350
7369
|
*/
|
|
7351
|
-
|
|
7370
|
+
input = viewChild.required('input');
|
|
7352
7371
|
/**
|
|
7353
|
-
*
|
|
7354
|
-
* Updates **another** observable (this.dataChange) when data is retrieved.
|
|
7372
|
+
* Label for this field
|
|
7355
7373
|
*/
|
|
7356
|
-
|
|
7357
|
-
this.validateConfiguration(config);
|
|
7358
|
-
this.configuration = config;
|
|
7359
|
-
return this.getList(null, contextFilter, searchVariables).pipe(map(data => this.dataChange.next(data)));
|
|
7360
|
-
}
|
|
7374
|
+
placeholder;
|
|
7361
7375
|
/**
|
|
7362
|
-
*
|
|
7363
|
-
* Mark loading status individually on nodes.
|
|
7376
|
+
* Name of the field on which do a global search (without facet)
|
|
7364
7377
|
*/
|
|
7365
|
-
|
|
7366
|
-
// Dont refetch children. Improve performances
|
|
7367
|
-
// Prevents interferences between HierarchicModelNode structure and angular components navigation.
|
|
7368
|
-
// Prevents a bug where grand children were lost if closing root
|
|
7369
|
-
if (flatNode.node.children.length) {
|
|
7370
|
-
return;
|
|
7371
|
-
}
|
|
7372
|
-
flatNode.loading = true;
|
|
7373
|
-
this.getList(flatNode, contextFilter)
|
|
7374
|
-
.pipe(finalize$1(() => (flatNode.loading = false)))
|
|
7375
|
-
.subscribe(items => {
|
|
7376
|
-
flatNode.node.childrenChange.next(items);
|
|
7377
|
-
this.dataChange.next(this.dataChange.value);
|
|
7378
|
-
});
|
|
7379
|
-
}
|
|
7380
|
-
search(searchVariables, contextFilter = null) {
|
|
7381
|
-
this.getList(null, contextFilter, searchVariables).subscribe(items => {
|
|
7382
|
-
this.dataChange.next(items);
|
|
7383
|
-
});
|
|
7384
|
-
}
|
|
7378
|
+
searchFieldName = 'search';
|
|
7385
7379
|
/**
|
|
7386
|
-
*
|
|
7387
|
-
* Get root elements if node is null, or child elements if node is given
|
|
7380
|
+
* Selected setted for this component
|
|
7388
7381
|
*/
|
|
7389
|
-
|
|
7390
|
-
const configurations = this.getContextualizedConfigs(node, contextFilters, searchVariables);
|
|
7391
|
-
const observables = configurations.map(c => c.injectedService.getAll(c.variablesManager));
|
|
7392
|
-
// Fire queries, and merge results, transforming apollo items into Node Object.
|
|
7393
|
-
return forkJoin(observables).pipe(map(results => {
|
|
7394
|
-
const listing = [];
|
|
7395
|
-
// For each result of an observable
|
|
7396
|
-
for (let i = 0; i < results.length; i++) {
|
|
7397
|
-
// For each item of the result, convert into Node object
|
|
7398
|
-
for (const item of results[i].items) {
|
|
7399
|
-
listing.push(this.getOrCreateModelNode(item, configurations[i].configuration));
|
|
7400
|
-
}
|
|
7401
|
-
}
|
|
7402
|
-
return listing;
|
|
7403
|
-
}));
|
|
7404
|
-
}
|
|
7405
|
-
countItems(node, contextFilters = null) {
|
|
7406
|
-
const configurations = this.getContextualizedConfigs(node, contextFilters, null);
|
|
7407
|
-
const observables = configurations.map(c => c.injectedService.count(c.variablesManager).pipe(first$1()));
|
|
7408
|
-
forkJoin(observables).subscribe(results => {
|
|
7409
|
-
const totalItems = results.reduce((total, length) => total + length, 0);
|
|
7410
|
-
node.expandable = totalItems > 0;
|
|
7411
|
-
});
|
|
7412
|
-
}
|
|
7413
|
-
getContextualizedConfigs(node = null, contextFilters = null, searchVariables = null) {
|
|
7414
|
-
const configsAndServices = [];
|
|
7415
|
-
// Considering the whole configuration may cause queries with no/wrong results we have imperatively to avoid !
|
|
7416
|
-
// e.g there are cross dependencies between equipments and taxonomies filters. Both have "parents" and "taxonomies" filters...
|
|
7417
|
-
// When clicking on a equipment, the configuration of taxonomies with match "parents" filter, but use the id of the equipment
|
|
7418
|
-
// To fix this, we should only consider configuration after the one given by the node passed as argument.
|
|
7419
|
-
// That would mean : no child can affect parent.
|
|
7420
|
-
// That would mean : sorting in the configuration have semantic/hierarchy implications
|
|
7421
|
-
const configs = node ? this.getNextConfigs(node.node.config) : this.configuration;
|
|
7422
|
-
const pagination = { pageIndex: 0, pageSize: 999 };
|
|
7423
|
-
for (const config of configs) {
|
|
7424
|
-
const contextFilter = this.getFilterByService(config, contextFilters);
|
|
7425
|
-
const filter = this.getServiceFilter(node, config, contextFilter, !!searchVariables);
|
|
7426
|
-
if (!filter) {
|
|
7427
|
-
continue;
|
|
7428
|
-
}
|
|
7429
|
-
const variablesManager = new NaturalQueryVariablesManager();
|
|
7430
|
-
variablesManager.set('variables', { filter: filter, pagination: pagination });
|
|
7431
|
-
variablesManager.set('config-filter', { filter: config.filter });
|
|
7432
|
-
if (searchVariables) {
|
|
7433
|
-
variablesManager.set('natural-search', searchVariables);
|
|
7434
|
-
}
|
|
7435
|
-
const injectedService = this.injector.get(config.service);
|
|
7436
|
-
configsAndServices.push({
|
|
7437
|
-
configuration: config,
|
|
7438
|
-
injectedService: injectedService,
|
|
7439
|
-
variablesManager: variablesManager,
|
|
7440
|
-
});
|
|
7441
|
-
}
|
|
7442
|
-
return configsAndServices;
|
|
7443
|
-
}
|
|
7382
|
+
selection = null;
|
|
7444
7383
|
/**
|
|
7445
|
-
*
|
|
7446
|
-
* Returns a Literal of models grouped by their configuration attribute "selectableAtKey"
|
|
7384
|
+
* Available facets, allows the user to pick one, than generated then a selection
|
|
7447
7385
|
*/
|
|
7448
|
-
|
|
7449
|
-
const selection = this.configuration.reduce((group, config) => {
|
|
7450
|
-
if (config.selectableAtKey) {
|
|
7451
|
-
group[config.selectableAtKey] = [];
|
|
7452
|
-
}
|
|
7453
|
-
return group;
|
|
7454
|
-
}, {});
|
|
7455
|
-
for (const node of nodes) {
|
|
7456
|
-
if (node.config.selectableAtKey) {
|
|
7457
|
-
selection[node.config.selectableAtKey].push(node.model);
|
|
7458
|
-
}
|
|
7459
|
-
}
|
|
7460
|
-
return selection;
|
|
7461
|
-
}
|
|
7386
|
+
facets;
|
|
7462
7387
|
/**
|
|
7463
|
-
*
|
|
7388
|
+
* Text display in the dropdown to select the facet
|
|
7464
7389
|
*/
|
|
7465
|
-
|
|
7466
|
-
if (!organizedModelSelection) {
|
|
7467
|
-
return [];
|
|
7468
|
-
}
|
|
7469
|
-
const result = [];
|
|
7470
|
-
for (const selectableAtKey of Object.keys(organizedModelSelection)) {
|
|
7471
|
-
const config = this.getConfigurationBySelectableKey(selectableAtKey);
|
|
7472
|
-
if (config) {
|
|
7473
|
-
for (const model of organizedModelSelection[selectableAtKey]) {
|
|
7474
|
-
result.push(new HierarchicModelNode(model, config));
|
|
7475
|
-
}
|
|
7476
|
-
}
|
|
7477
|
-
}
|
|
7478
|
-
return result;
|
|
7479
|
-
}
|
|
7390
|
+
dropdownTitle = '';
|
|
7480
7391
|
/**
|
|
7481
|
-
*
|
|
7392
|
+
* Emits when user a added/updated/deleted a search (from global context or from facet)
|
|
7482
7393
|
*/
|
|
7483
|
-
|
|
7484
|
-
const selectableAtKeyAttributes = [];
|
|
7485
|
-
for (const config of configurations) {
|
|
7486
|
-
if (config.selectableAtKey) {
|
|
7487
|
-
const keyIndex = selectableAtKeyAttributes.indexOf(config.selectableAtKey);
|
|
7488
|
-
if (keyIndex === -1 && config.selectableAtKey) {
|
|
7489
|
-
selectableAtKeyAttributes.push(config.selectableAtKey);
|
|
7490
|
-
}
|
|
7491
|
-
// TODO : remove ?
|
|
7492
|
-
// This behavior maybe dangerous in case we re-open hierarchical selector with the last returned config having non-unique
|
|
7493
|
-
// keys
|
|
7494
|
-
if (keyIndex < -1) {
|
|
7495
|
-
console.warn('Invalid hierarchic configuration : selectableAtKey attribute should be unique');
|
|
7496
|
-
}
|
|
7497
|
-
}
|
|
7498
|
-
}
|
|
7499
|
-
}
|
|
7394
|
+
selectionChange = output();
|
|
7500
7395
|
/**
|
|
7501
|
-
*
|
|
7396
|
+
* Emits when user removes the search by pressing the cross icon
|
|
7502
7397
|
*/
|
|
7503
|
-
|
|
7504
|
-
const configIndex = this.configuration.findIndex(c => c === config);
|
|
7505
|
-
return this.configuration.slice(configIndex);
|
|
7506
|
-
}
|
|
7398
|
+
cleared = output();
|
|
7507
7399
|
/**
|
|
7508
|
-
*
|
|
7509
|
-
*/
|
|
7510
|
-
getServiceFilter(flatNode, config, contextFilter = null, allDeeps = false) {
|
|
7511
|
-
const fieldCondition = {};
|
|
7512
|
-
// if no parent, filter empty elements
|
|
7513
|
-
if (!flatNode) {
|
|
7514
|
-
if (!config.parentsRelationNames) {
|
|
7515
|
-
return contextFilter ? contextFilter : {};
|
|
7516
|
-
}
|
|
7517
|
-
if (!allDeeps) {
|
|
7518
|
-
config.parentsRelationNames.forEach(f => {
|
|
7519
|
-
fieldCondition[f] = { empty: {} };
|
|
7520
|
-
});
|
|
7521
|
-
}
|
|
7522
|
-
}
|
|
7523
|
-
else {
|
|
7524
|
-
if (!flatNode.node.config.childrenRelationNames || !config.parentsRelationNames) {
|
|
7525
|
-
return null;
|
|
7526
|
-
}
|
|
7527
|
-
const matchingFilters = intersection(flatNode.node.config.childrenRelationNames, config.parentsRelationNames);
|
|
7528
|
-
if (!matchingFilters.length) {
|
|
7529
|
-
return null;
|
|
7530
|
-
}
|
|
7531
|
-
fieldCondition[matchingFilters[0]] = { have: { values: [flatNode.node.model.id] } };
|
|
7532
|
-
}
|
|
7533
|
-
const filters = { groups: [{ conditions: [fieldCondition] }] };
|
|
7534
|
-
// todo : is it right ? shouldn't it be managed with QueryVariablesManager's channels ? ?
|
|
7535
|
-
if (contextFilter) {
|
|
7536
|
-
filters.groups.push(...contextFilter.groups);
|
|
7537
|
-
}
|
|
7538
|
-
return filters;
|
|
7539
|
-
}
|
|
7540
|
-
/**
|
|
7541
|
-
* Return a context filter applicable to the service for given config
|
|
7542
|
-
*
|
|
7543
|
-
* @param config Applicable config
|
|
7544
|
-
* @param contextFilters List of context filters
|
|
7545
|
-
*/
|
|
7546
|
-
getFilterByService(config, contextFilters) {
|
|
7547
|
-
if (!contextFilters || !config) {
|
|
7548
|
-
return null;
|
|
7549
|
-
}
|
|
7550
|
-
const filter = contextFilters.find(f => f.service === config.service);
|
|
7551
|
-
return filter ? filter.filter : null;
|
|
7552
|
-
}
|
|
7553
|
-
/**
|
|
7554
|
-
* Search in configurations.selectableAtKey attribute to find given key and return the configuration
|
|
7555
|
-
*/
|
|
7556
|
-
getConfigurationBySelectableKey(key) {
|
|
7557
|
-
if (!this.configuration) {
|
|
7558
|
-
return null;
|
|
7559
|
-
}
|
|
7560
|
-
return this.configuration.find(conf => conf.selectableAtKey === key) || null;
|
|
7561
|
-
}
|
|
7562
|
-
getOrCreateModelNode(item, configuration) {
|
|
7563
|
-
const node = this.dataChange.value.find(n => n.model.id === item.id && n.model.__typename === item.__typename);
|
|
7564
|
-
return node || new HierarchicModelNode(item, configuration);
|
|
7565
|
-
}
|
|
7566
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: NaturalHierarchicSelectorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
7567
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: NaturalHierarchicSelectorService, providedIn: 'root' });
|
|
7568
|
-
}
|
|
7569
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: NaturalHierarchicSelectorService, decorators: [{
|
|
7570
|
-
type: Injectable,
|
|
7571
|
-
args: [{ providedIn: 'root' }]
|
|
7572
|
-
}] });
|
|
7573
|
-
|
|
7574
|
-
class FacetSelectorComponent {
|
|
7575
|
-
data = inject(NATURAL_DROPDOWN_DATA);
|
|
7576
|
-
dropdownRef = inject(NaturalDropdownRef);
|
|
7577
|
-
// Never has a real value
|
|
7578
|
-
renderedValue = new BehaviorSubject('');
|
|
7579
|
-
facets = this.data.configuration.facets;
|
|
7580
|
-
selection = null;
|
|
7581
|
-
/**
|
|
7582
|
-
* Get value, including rich object types
|
|
7583
|
-
*/
|
|
7584
|
-
getCondition() {
|
|
7585
|
-
return {};
|
|
7586
|
-
}
|
|
7587
|
-
/**
|
|
7588
|
-
* Allow to close the dropdown with a valid value
|
|
7589
|
-
*/
|
|
7590
|
-
close() {
|
|
7591
|
-
if (this.selection) {
|
|
7592
|
-
this.dropdownRef.close({
|
|
7593
|
-
condition: {},
|
|
7594
|
-
facet: this.selection,
|
|
7595
|
-
});
|
|
7596
|
-
}
|
|
7597
|
-
}
|
|
7598
|
-
isValid() {
|
|
7599
|
-
return !!this.selection;
|
|
7600
|
-
}
|
|
7601
|
-
isDirty() {
|
|
7602
|
-
return true;
|
|
7603
|
-
}
|
|
7604
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: FacetSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7605
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.13", type: FacetSelectorComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "@if (data.title) {\n <div class=\"dropdown-title mat-body-2\">{{ data.title }}</div>\n}\n<mat-nav-list>\n @for (facet of facets; track $index) {\n <mat-list-item (click)=\"selection = facet; close()\">\n <a>{{ facet.display }}</a>\n </mat-list-item>\n }\n</mat-nav-list>\n", styles: [".mat-nav-list{padding:0}.dropdown-title{opacity:.7;padding:5px;font-variant:all-small-caps;font-size:18px}\n"], dependencies: [{ kind: "ngmodule", type: MatListModule }, { kind: "component", type: i4$1.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i4$1.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }] });
|
|
7606
|
-
}
|
|
7607
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: FacetSelectorComponent, decorators: [{
|
|
7608
|
-
type: Component,
|
|
7609
|
-
args: [{ imports: [MatListModule], template: "@if (data.title) {\n <div class=\"dropdown-title mat-body-2\">{{ data.title }}</div>\n}\n<mat-nav-list>\n @for (facet of facets; track $index) {\n <mat-list-item (click)=\"selection = facet; close()\">\n <a>{{ facet.display }}</a>\n </mat-list-item>\n }\n</mat-nav-list>\n", styles: [".mat-nav-list{padding:0}.dropdown-title{opacity:.7;padding:5px;font-variant:all-small-caps;font-size:18px}\n"] }]
|
|
7610
|
-
}] });
|
|
7611
|
-
|
|
7612
|
-
// Required to check invalid fields when initializing natural-search
|
|
7613
|
-
class AlwaysErrorStateMatcher {
|
|
7614
|
-
isErrorState(control) {
|
|
7615
|
-
return !!control && control.invalid;
|
|
7616
|
-
}
|
|
7617
|
-
}
|
|
7618
|
-
function isComponentValid(component) {
|
|
7619
|
-
return () => {
|
|
7620
|
-
if (!component.isValid()) {
|
|
7621
|
-
return { component: true };
|
|
7622
|
-
}
|
|
7623
|
-
return null;
|
|
7624
|
-
};
|
|
7625
|
-
}
|
|
7626
|
-
class NaturalInputComponent {
|
|
7627
|
-
element = inject(ElementRef);
|
|
7628
|
-
dropdownService = inject(NaturalDropdownService);
|
|
7629
|
-
injector = inject(EnvironmentInjector);
|
|
7630
|
-
/**
|
|
7631
|
-
* Controls the ripple effect, used when opening a dropdown
|
|
7632
|
-
*/
|
|
7633
|
-
ripple = viewChild.required(MatRipple);
|
|
7634
|
-
/**
|
|
7635
|
-
* Native element ref for <input> related to this <natural-input> component
|
|
7636
|
-
*/
|
|
7637
|
-
input = viewChild.required('input');
|
|
7638
|
-
/**
|
|
7639
|
-
* Label for this field
|
|
7640
|
-
*/
|
|
7641
|
-
placeholder;
|
|
7642
|
-
/**
|
|
7643
|
-
* Name of the field on which do a global search (without facet)
|
|
7644
|
-
*/
|
|
7645
|
-
searchFieldName = 'search';
|
|
7646
|
-
/**
|
|
7647
|
-
* Selected setted for this component
|
|
7648
|
-
*/
|
|
7649
|
-
selection = null;
|
|
7650
|
-
/**
|
|
7651
|
-
* Available facets, allows the user to pick one, than generated then a selection
|
|
7652
|
-
*/
|
|
7653
|
-
facets;
|
|
7654
|
-
/**
|
|
7655
|
-
* Text display in the dropdown to select the facet
|
|
7656
|
-
*/
|
|
7657
|
-
dropdownTitle = '';
|
|
7658
|
-
/**
|
|
7659
|
-
* Emits when user a added/updated/deleted a search (from global context or from facet)
|
|
7660
|
-
*/
|
|
7661
|
-
selectionChange = output();
|
|
7662
|
-
/**
|
|
7663
|
-
* Emits when user removes the search by pressing the cross icon
|
|
7664
|
-
*/
|
|
7665
|
-
cleared = output();
|
|
7666
|
-
/**
|
|
7667
|
-
* Selected facet from the list of available facets
|
|
7400
|
+
* Selected facet from the list of available facets
|
|
7668
7401
|
*/
|
|
7669
7402
|
facet = null;
|
|
7670
7403
|
/**
|
|
@@ -8082,6 +7815,273 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
8082
7815
|
type: Input
|
|
8083
7816
|
}] } });
|
|
8084
7817
|
|
|
7818
|
+
class HierarchicFlatNode {
|
|
7819
|
+
node;
|
|
7820
|
+
name;
|
|
7821
|
+
level;
|
|
7822
|
+
expandable;
|
|
7823
|
+
selectable;
|
|
7824
|
+
deselectable;
|
|
7825
|
+
loading = false;
|
|
7826
|
+
constructor(node, name, level = 0, expandable = false, selectable = true, deselectable = true) {
|
|
7827
|
+
this.node = node;
|
|
7828
|
+
this.name = name;
|
|
7829
|
+
this.level = level;
|
|
7830
|
+
this.expandable = expandable;
|
|
7831
|
+
this.selectable = selectable;
|
|
7832
|
+
this.deselectable = deselectable;
|
|
7833
|
+
}
|
|
7834
|
+
}
|
|
7835
|
+
|
|
7836
|
+
class HierarchicModelNode {
|
|
7837
|
+
model;
|
|
7838
|
+
config;
|
|
7839
|
+
childrenChange = new BehaviorSubject([]);
|
|
7840
|
+
constructor(model, config) {
|
|
7841
|
+
this.model = model;
|
|
7842
|
+
this.config = config;
|
|
7843
|
+
}
|
|
7844
|
+
get children() {
|
|
7845
|
+
return this.childrenChange.value;
|
|
7846
|
+
}
|
|
7847
|
+
}
|
|
7848
|
+
|
|
7849
|
+
class NaturalHierarchicSelectorService {
|
|
7850
|
+
injector = inject(Injector);
|
|
7851
|
+
/**
|
|
7852
|
+
* Stores the global result of the tree
|
|
7853
|
+
* This observable contains Node.
|
|
7854
|
+
* When it's updated, the TreeController and TreeFlattener process the new array to generate the flat tree.
|
|
7855
|
+
*/
|
|
7856
|
+
dataChange = new BehaviorSubject([]);
|
|
7857
|
+
/**
|
|
7858
|
+
* Configuration for relations and selection constraints
|
|
7859
|
+
*
|
|
7860
|
+
* The list should be sorted in the order of the hierarchic (list first parent rules, then child rules)
|
|
7861
|
+
*/
|
|
7862
|
+
configuration = [];
|
|
7863
|
+
/**
|
|
7864
|
+
* Init component by saving the complete configuration, and then retrieving root elements.
|
|
7865
|
+
* Updates **another** observable (this.dataChange) when data is retrieved.
|
|
7866
|
+
*/
|
|
7867
|
+
init(config, contextFilter = null, searchVariables = null) {
|
|
7868
|
+
this.validateConfiguration(config);
|
|
7869
|
+
this.configuration = config;
|
|
7870
|
+
return this.getList(null, contextFilter, searchVariables).pipe(map(data => this.dataChange.next(data)));
|
|
7871
|
+
}
|
|
7872
|
+
/**
|
|
7873
|
+
* Get list of children, considering given FlatNode id as a parent.
|
|
7874
|
+
* Mark loading status individually on nodes.
|
|
7875
|
+
*/
|
|
7876
|
+
loadChildren(flatNode, contextFilter = null) {
|
|
7877
|
+
// Dont refetch children. Improve performances
|
|
7878
|
+
// Prevents interferences between HierarchicModelNode structure and angular components navigation.
|
|
7879
|
+
// Prevents a bug where grand children were lost if closing root
|
|
7880
|
+
if (flatNode.node.children.length) {
|
|
7881
|
+
return;
|
|
7882
|
+
}
|
|
7883
|
+
flatNode.loading = true;
|
|
7884
|
+
this.getList(flatNode, contextFilter)
|
|
7885
|
+
.pipe(finalize$1(() => (flatNode.loading = false)))
|
|
7886
|
+
.subscribe(items => {
|
|
7887
|
+
flatNode.node.childrenChange.next(items);
|
|
7888
|
+
this.dataChange.next(this.dataChange.value);
|
|
7889
|
+
});
|
|
7890
|
+
}
|
|
7891
|
+
search(searchVariables, contextFilter = null) {
|
|
7892
|
+
this.getList(null, contextFilter, searchVariables).subscribe(items => {
|
|
7893
|
+
this.dataChange.next(items);
|
|
7894
|
+
});
|
|
7895
|
+
}
|
|
7896
|
+
/**
|
|
7897
|
+
* Retrieve elements from the server
|
|
7898
|
+
* Get root elements if node is null, or child elements if node is given
|
|
7899
|
+
*/
|
|
7900
|
+
getList(node = null, contextFilters = null, searchVariables = null) {
|
|
7901
|
+
const configurations = this.getContextualizedConfigs(node, contextFilters, searchVariables);
|
|
7902
|
+
const observables = configurations.map(c => c.injectedService.getAll(c.variablesManager));
|
|
7903
|
+
// Fire queries, and merge results, transforming apollo items into Node Object.
|
|
7904
|
+
return forkJoin(observables).pipe(map(results => {
|
|
7905
|
+
const listing = [];
|
|
7906
|
+
// For each result of an observable
|
|
7907
|
+
for (let i = 0; i < results.length; i++) {
|
|
7908
|
+
// For each item of the result, convert into Node object
|
|
7909
|
+
for (const item of results[i].items) {
|
|
7910
|
+
listing.push(this.getOrCreateModelNode(item, configurations[i].configuration));
|
|
7911
|
+
}
|
|
7912
|
+
}
|
|
7913
|
+
return listing;
|
|
7914
|
+
}));
|
|
7915
|
+
}
|
|
7916
|
+
countItems(node, contextFilters = null) {
|
|
7917
|
+
const configurations = this.getContextualizedConfigs(node, contextFilters, null);
|
|
7918
|
+
const observables = configurations.map(c => c.injectedService.count(c.variablesManager).pipe(first$1()));
|
|
7919
|
+
forkJoin(observables).subscribe(results => {
|
|
7920
|
+
const totalItems = results.reduce((total, length) => total + length, 0);
|
|
7921
|
+
node.expandable = totalItems > 0;
|
|
7922
|
+
});
|
|
7923
|
+
}
|
|
7924
|
+
getContextualizedConfigs(node = null, contextFilters = null, searchVariables = null) {
|
|
7925
|
+
const configsAndServices = [];
|
|
7926
|
+
// Considering the whole configuration may cause queries with no/wrong results we have imperatively to avoid !
|
|
7927
|
+
// e.g there are cross dependencies between equipments and taxonomies filters. Both have "parents" and "taxonomies" filters...
|
|
7928
|
+
// When clicking on a equipment, the configuration of taxonomies with match "parents" filter, but use the id of the equipment
|
|
7929
|
+
// To fix this, we should only consider configuration after the one given by the node passed as argument.
|
|
7930
|
+
// That would mean : no child can affect parent.
|
|
7931
|
+
// That would mean : sorting in the configuration have semantic/hierarchy implications
|
|
7932
|
+
const configs = node ? this.getNextConfigs(node.node.config) : this.configuration;
|
|
7933
|
+
const pagination = { pageIndex: 0, pageSize: 999 };
|
|
7934
|
+
for (const config of configs) {
|
|
7935
|
+
const contextFilter = this.getFilterByService(config, contextFilters);
|
|
7936
|
+
const filter = this.getServiceFilter(node, config, contextFilter, !!searchVariables);
|
|
7937
|
+
if (!filter) {
|
|
7938
|
+
continue;
|
|
7939
|
+
}
|
|
7940
|
+
const variablesManager = new NaturalQueryVariablesManager();
|
|
7941
|
+
variablesManager.set('variables', { filter: filter, pagination: pagination });
|
|
7942
|
+
variablesManager.set('config-filter', { filter: config.filter });
|
|
7943
|
+
if (searchVariables) {
|
|
7944
|
+
variablesManager.set('natural-search', searchVariables);
|
|
7945
|
+
}
|
|
7946
|
+
const injectedService = this.injector.get(config.service);
|
|
7947
|
+
configsAndServices.push({
|
|
7948
|
+
configuration: config,
|
|
7949
|
+
injectedService: injectedService,
|
|
7950
|
+
variablesManager: variablesManager,
|
|
7951
|
+
});
|
|
7952
|
+
}
|
|
7953
|
+
return configsAndServices;
|
|
7954
|
+
}
|
|
7955
|
+
/**
|
|
7956
|
+
* Return models matching given FlatNodes
|
|
7957
|
+
* Returns a Literal of models grouped by their configuration attribute "selectableAtKey"
|
|
7958
|
+
*/
|
|
7959
|
+
toOrganizedSelection(nodes) {
|
|
7960
|
+
const selection = this.configuration.reduce((group, config) => {
|
|
7961
|
+
if (config.selectableAtKey) {
|
|
7962
|
+
group[config.selectableAtKey] = [];
|
|
7963
|
+
}
|
|
7964
|
+
return group;
|
|
7965
|
+
}, {});
|
|
7966
|
+
for (const node of nodes) {
|
|
7967
|
+
if (node.config.selectableAtKey) {
|
|
7968
|
+
selection[node.config.selectableAtKey].push(node.model);
|
|
7969
|
+
}
|
|
7970
|
+
}
|
|
7971
|
+
return selection;
|
|
7972
|
+
}
|
|
7973
|
+
/**
|
|
7974
|
+
* Transforms an OrganizedModelSelection into a list of ModelNodes
|
|
7975
|
+
*/
|
|
7976
|
+
fromOrganizedSelection(organizedModelSelection) {
|
|
7977
|
+
if (!organizedModelSelection) {
|
|
7978
|
+
return [];
|
|
7979
|
+
}
|
|
7980
|
+
const result = [];
|
|
7981
|
+
for (const selectableAtKey of Object.keys(organizedModelSelection)) {
|
|
7982
|
+
const config = this.getConfigurationBySelectableKey(selectableAtKey);
|
|
7983
|
+
if (config) {
|
|
7984
|
+
for (const model of organizedModelSelection[selectableAtKey]) {
|
|
7985
|
+
result.push(new HierarchicModelNode(model, config));
|
|
7986
|
+
}
|
|
7987
|
+
}
|
|
7988
|
+
}
|
|
7989
|
+
return result;
|
|
7990
|
+
}
|
|
7991
|
+
/**
|
|
7992
|
+
* Checks that each configuration.selectableAtKey attribute is unique
|
|
7993
|
+
*/
|
|
7994
|
+
validateConfiguration(configurations) {
|
|
7995
|
+
const selectableAtKeyAttributes = [];
|
|
7996
|
+
for (const config of configurations) {
|
|
7997
|
+
if (config.selectableAtKey) {
|
|
7998
|
+
const keyIndex = selectableAtKeyAttributes.indexOf(config.selectableAtKey);
|
|
7999
|
+
if (keyIndex === -1 && config.selectableAtKey) {
|
|
8000
|
+
selectableAtKeyAttributes.push(config.selectableAtKey);
|
|
8001
|
+
}
|
|
8002
|
+
// TODO : remove ?
|
|
8003
|
+
// This behavior maybe dangerous in case we re-open hierarchical selector with the last returned config having non-unique
|
|
8004
|
+
// keys
|
|
8005
|
+
if (keyIndex < -1) {
|
|
8006
|
+
console.warn('Invalid hierarchic configuration : selectableAtKey attribute should be unique');
|
|
8007
|
+
}
|
|
8008
|
+
}
|
|
8009
|
+
}
|
|
8010
|
+
}
|
|
8011
|
+
/**
|
|
8012
|
+
* Return configurations setup in the list after the given one
|
|
8013
|
+
*/
|
|
8014
|
+
getNextConfigs(config) {
|
|
8015
|
+
const configIndex = this.configuration.findIndex(c => c === config);
|
|
8016
|
+
return this.configuration.slice(configIndex);
|
|
8017
|
+
}
|
|
8018
|
+
/**
|
|
8019
|
+
* Builds queryVariables filter for children query
|
|
8020
|
+
*/
|
|
8021
|
+
getServiceFilter(flatNode, config, contextFilter = null, allDeeps = false) {
|
|
8022
|
+
const fieldCondition = {};
|
|
8023
|
+
// if no parent, filter empty elements
|
|
8024
|
+
if (!flatNode) {
|
|
8025
|
+
if (!config.parentsRelationNames) {
|
|
8026
|
+
return contextFilter ? contextFilter : {};
|
|
8027
|
+
}
|
|
8028
|
+
if (!allDeeps) {
|
|
8029
|
+
config.parentsRelationNames.forEach(f => {
|
|
8030
|
+
fieldCondition[f] = { empty: {} };
|
|
8031
|
+
});
|
|
8032
|
+
}
|
|
8033
|
+
}
|
|
8034
|
+
else {
|
|
8035
|
+
if (!flatNode.node.config.childrenRelationNames || !config.parentsRelationNames) {
|
|
8036
|
+
return null;
|
|
8037
|
+
}
|
|
8038
|
+
const matchingFilters = intersection(flatNode.node.config.childrenRelationNames, config.parentsRelationNames);
|
|
8039
|
+
if (!matchingFilters.length) {
|
|
8040
|
+
return null;
|
|
8041
|
+
}
|
|
8042
|
+
fieldCondition[matchingFilters[0]] = { have: { values: [flatNode.node.model.id] } };
|
|
8043
|
+
}
|
|
8044
|
+
const filters = { groups: [{ conditions: [fieldCondition] }] };
|
|
8045
|
+
// todo : is it right ? shouldn't it be managed with QueryVariablesManager's channels ? ?
|
|
8046
|
+
if (contextFilter) {
|
|
8047
|
+
filters.groups.push(...contextFilter.groups);
|
|
8048
|
+
}
|
|
8049
|
+
return filters;
|
|
8050
|
+
}
|
|
8051
|
+
/**
|
|
8052
|
+
* Return a context filter applicable to the service for given config
|
|
8053
|
+
*
|
|
8054
|
+
* @param config Applicable config
|
|
8055
|
+
* @param contextFilters List of context filters
|
|
8056
|
+
*/
|
|
8057
|
+
getFilterByService(config, contextFilters) {
|
|
8058
|
+
if (!contextFilters || !config) {
|
|
8059
|
+
return null;
|
|
8060
|
+
}
|
|
8061
|
+
const filter = contextFilters.find(f => f.service === config.service);
|
|
8062
|
+
return filter ? filter.filter : null;
|
|
8063
|
+
}
|
|
8064
|
+
/**
|
|
8065
|
+
* Search in configurations.selectableAtKey attribute to find given key and return the configuration
|
|
8066
|
+
*/
|
|
8067
|
+
getConfigurationBySelectableKey(key) {
|
|
8068
|
+
if (!this.configuration) {
|
|
8069
|
+
return null;
|
|
8070
|
+
}
|
|
8071
|
+
return this.configuration.find(conf => conf.selectableAtKey === key) || null;
|
|
8072
|
+
}
|
|
8073
|
+
getOrCreateModelNode(item, configuration) {
|
|
8074
|
+
const node = this.dataChange.value.find(n => n.model.id === item.id && n.model.__typename === item.__typename);
|
|
8075
|
+
return node || new HierarchicModelNode(item, configuration);
|
|
8076
|
+
}
|
|
8077
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: NaturalHierarchicSelectorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
8078
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: NaturalHierarchicSelectorService, providedIn: 'root' });
|
|
8079
|
+
}
|
|
8080
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: NaturalHierarchicSelectorService, decorators: [{
|
|
8081
|
+
type: Injectable,
|
|
8082
|
+
args: [{ providedIn: 'root' }]
|
|
8083
|
+
}] });
|
|
8084
|
+
|
|
8085
8085
|
class NaturalHierarchicSelectorComponent {
|
|
8086
8086
|
destroyRef = inject(DestroyRef);
|
|
8087
8087
|
hierarchicSelectorService = inject(NaturalHierarchicSelectorService);
|
|
@@ -8118,6 +8118,14 @@ class NaturalHierarchicSelectorComponent {
|
|
|
8118
8118
|
* Selections to apply on natural-search on component initialisation
|
|
8119
8119
|
*/
|
|
8120
8120
|
searchSelections = [];
|
|
8121
|
+
/**
|
|
8122
|
+
* Select all fetched items of the current search result
|
|
8123
|
+
*
|
|
8124
|
+
* Use very carefully as recursivity is ignored. The selection includes children (if any) even if the child list has been closed
|
|
8125
|
+
*
|
|
8126
|
+
* Should be used __only__ for non-recursive use cases. Avoid with recursive because it's not intuitive for end user
|
|
8127
|
+
*/
|
|
8128
|
+
allowSelectAll = input(false);
|
|
8121
8129
|
/**
|
|
8122
8130
|
* Emits when natural-search selections change
|
|
8123
8131
|
*/
|
|
@@ -8209,6 +8217,14 @@ class NaturalHierarchicSelectorComponent {
|
|
|
8209
8217
|
}
|
|
8210
8218
|
}
|
|
8211
8219
|
}
|
|
8220
|
+
selectAll() {
|
|
8221
|
+
this.flatNodeMap.forEach(flatNode => {
|
|
8222
|
+
if (!this.isNodeSelected(flatNode.node)) {
|
|
8223
|
+
this.selectFlatNode(flatNode);
|
|
8224
|
+
}
|
|
8225
|
+
});
|
|
8226
|
+
this.updateSelection(this.selectedNodes);
|
|
8227
|
+
}
|
|
8212
8228
|
/**
|
|
8213
8229
|
* When unselecting an element from the mat-chips, it can be deep in the hierarchy, and the tree element may not exist...
|
|
8214
8230
|
* ... but we still need to remove the element from the mat-chips list.
|
|
@@ -8385,8 +8401,8 @@ class NaturalHierarchicSelectorComponent {
|
|
|
8385
8401
|
replaceObjectKeepingReference(this.selected, organizedFlatNodesSelection);
|
|
8386
8402
|
this.selectionChange.emit(organizedFlatNodesSelection);
|
|
8387
8403
|
}
|
|
8388
|
-
isNodeSelected(
|
|
8389
|
-
const key = this.getMapKey(
|
|
8404
|
+
isNodeSelected(modelNode) {
|
|
8405
|
+
const key = this.getMapKey(modelNode.model);
|
|
8390
8406
|
return this.selectedNodes.some(n => this.getMapKey(n.model) === key);
|
|
8391
8407
|
}
|
|
8392
8408
|
getFlatNode(node) {
|
|
@@ -8422,7 +8438,7 @@ class NaturalHierarchicSelectorComponent {
|
|
|
8422
8438
|
return model.__typename + '-' + model.id;
|
|
8423
8439
|
}
|
|
8424
8440
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: NaturalHierarchicSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8425
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.13", 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 [facets]=\"searchFacets\" [selections]=\"searchSelections\" (selectionChange)=\"search($event)\" />\n</div>\n\n<div class=\"body\">\n @if (loading) {\n <mat-progress-spinner mode=\"indeterminate\" style=\"margin: 10px\" [diameter]=\"36\" />\n }\n\n <mat-tree [dataSource]=\"dataSource\" [treeControl]=\"treeControl\">\n <mat-tree-node *matTreeNodeDef=\"let node\" matTreeNodePadding [ngClass]=\"{leaf: !node.expandable}\">\n @if (node.expandable) {\n <button\n mat-icon-button\n matTreeNodeToggle\n [attr.aria-label]=\"'toggle ' + node.name\"\n (click)=\"loadChildren(node)\"\n >\n @if (node.loading) {\n <mat-progress-spinner mode=\"indeterminate\" [diameter]=\"24\" [strokeWidth]=\"5\" />\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 style=\"margin-right: 10px\"\n [checked]=\"flatNodesSelection.isSelected(node)\"\n [disabled]=\"!isNodeTogglable(node)\"\n (change)=\"toggleFlatNode(node)\"\n >\n @if (node.node.config.icon) {\n <mat-icon style=\"margin-right: 10px\" [naturalIcon]=\"node.node.config.icon\" />\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 [removable]=\"true\" [selectable]=\"false\" (removed)=\"unselectModelNode(node)\">\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: i6.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "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.MatChipAvatar, selector: "mat-chip-avatar, [matChipAvatar]" }, { kind: "component", type: i7.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i7.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.MatChipRemove, selector: "[matChipRemove]" }] });
|
|
8441
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.13", type: NaturalHierarchicSelectorComponent, isStandalone: true, selector: "natural-hierarchic-selector", inputs: { displayWith: { classPropertyName: "displayWith", publicName: "displayWith", isSignal: false, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: false, isRequired: true, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: false, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: false, isRequired: false, transformFunction: null }, allowUnselect: { classPropertyName: "allowUnselect", publicName: "allowUnselect", isSignal: false, isRequired: false, transformFunction: null }, filters: { classPropertyName: "filters", publicName: "filters", isSignal: false, isRequired: false, transformFunction: null }, searchFacets: { classPropertyName: "searchFacets", publicName: "searchFacets", isSignal: false, isRequired: false, transformFunction: null }, searchSelections: { classPropertyName: "searchSelections", publicName: "searchSelections", isSignal: false, isRequired: false, transformFunction: null }, allowSelectAll: { classPropertyName: "allowSelectAll", publicName: "allowSelectAll", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { searchSelectionChange: "searchSelectionChange", selectionChange: "selectionChange" }, providers: [NaturalHierarchicSelectorService], usesOnChanges: true, ngImport: i0, template: "<div [style.margin-bottom.px]=\"20\">\n <natural-search [facets]=\"searchFacets\" [selections]=\"searchSelections\" (selectionChange)=\"search($event)\" />\n</div>\n\n@if (allowSelectAll() && multiple) {\n <a i18n mat-button (click)=\"selectAll()\">Tout s\u00E9lectionner</a>\n}\n\n<div class=\"body\">\n @if (loading) {\n <mat-progress-spinner mode=\"indeterminate\" style=\"margin: 10px\" [diameter]=\"36\" />\n }\n\n <mat-tree [dataSource]=\"dataSource\" [treeControl]=\"treeControl\">\n <mat-tree-node *matTreeNodeDef=\"let node\" matTreeNodePadding [ngClass]=\"{leaf: !node.expandable}\">\n @if (node.expandable) {\n <button\n mat-icon-button\n matTreeNodeToggle\n [attr.aria-label]=\"'toggle ' + node.name\"\n (click)=\"loadChildren(node)\"\n >\n @if (node.loading) {\n <mat-progress-spinner mode=\"indeterminate\" [diameter]=\"24\" [strokeWidth]=\"5\" />\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 style=\"margin-right: 10px\"\n [checked]=\"flatNodesSelection.isSelected(node)\"\n [disabled]=\"!isNodeTogglable(node)\"\n (change)=\"toggleFlatNode(node)\"\n >\n @if (node.node.config.icon) {\n <mat-icon style=\"margin-right: 10px\" [naturalIcon]=\"node.node.config.icon\" />\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 [removable]=\"true\" [selectable]=\"false\" (removed)=\"unselectModelNode(node)\">\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 .select-all{margin-bottom:5px}: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.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button]", exportAs: ["matButton", "matAnchor"] }, { 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: i6.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "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.MatChipAvatar, selector: "mat-chip-avatar, [matChipAvatar]" }, { kind: "component", type: i7.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i7.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.MatChipRemove, selector: "[matChipRemove]" }] });
|
|
8426
8442
|
}
|
|
8427
8443
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: NaturalHierarchicSelectorComponent, decorators: [{
|
|
8428
8444
|
type: Component,
|
|
@@ -8436,7 +8452,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
8436
8452
|
NaturalIconDirective,
|
|
8437
8453
|
MatCheckboxModule,
|
|
8438
8454
|
MatChipsModule,
|
|
8439
|
-
], template: "<div [style.margin-bottom.px]=\"20\">\n <natural-search [facets]=\"searchFacets\" [selections]=\"searchSelections\" (selectionChange)=\"search($event)\" />\n</div>\n\n<div class=\"body\">\n @if (loading) {\n <mat-progress-spinner mode=\"indeterminate\" style=\"margin: 10px\" [diameter]=\"36\" />\n }\n\n <mat-tree [dataSource]=\"dataSource\" [treeControl]=\"treeControl\">\n <mat-tree-node *matTreeNodeDef=\"let node\" matTreeNodePadding [ngClass]=\"{leaf: !node.expandable}\">\n @if (node.expandable) {\n <button\n mat-icon-button\n matTreeNodeToggle\n [attr.aria-label]=\"'toggle ' + node.name\"\n (click)=\"loadChildren(node)\"\n >\n @if (node.loading) {\n <mat-progress-spinner mode=\"indeterminate\" [diameter]=\"24\" [strokeWidth]=\"5\" />\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 style=\"margin-right: 10px\"\n [checked]=\"flatNodesSelection.isSelected(node)\"\n [disabled]=\"!isNodeTogglable(node)\"\n (change)=\"toggleFlatNode(node)\"\n >\n @if (node.node.config.icon) {\n <mat-icon style=\"margin-right: 10px\" [naturalIcon]=\"node.node.config.icon\" />\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 [removable]=\"true\" [selectable]=\"false\" (removed)=\"unselectModelNode(node)\">\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"] }]
|
|
8455
|
+
], template: "<div [style.margin-bottom.px]=\"20\">\n <natural-search [facets]=\"searchFacets\" [selections]=\"searchSelections\" (selectionChange)=\"search($event)\" />\n</div>\n\n@if (allowSelectAll() && multiple) {\n <a i18n mat-button (click)=\"selectAll()\">Tout s\u00E9lectionner</a>\n}\n\n<div class=\"body\">\n @if (loading) {\n <mat-progress-spinner mode=\"indeterminate\" style=\"margin: 10px\" [diameter]=\"36\" />\n }\n\n <mat-tree [dataSource]=\"dataSource\" [treeControl]=\"treeControl\">\n <mat-tree-node *matTreeNodeDef=\"let node\" matTreeNodePadding [ngClass]=\"{leaf: !node.expandable}\">\n @if (node.expandable) {\n <button\n mat-icon-button\n matTreeNodeToggle\n [attr.aria-label]=\"'toggle ' + node.name\"\n (click)=\"loadChildren(node)\"\n >\n @if (node.loading) {\n <mat-progress-spinner mode=\"indeterminate\" [diameter]=\"24\" [strokeWidth]=\"5\" />\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 style=\"margin-right: 10px\"\n [checked]=\"flatNodesSelection.isSelected(node)\"\n [disabled]=\"!isNodeTogglable(node)\"\n (change)=\"toggleFlatNode(node)\"\n >\n @if (node.node.config.icon) {\n <mat-icon style=\"margin-right: 10px\" [naturalIcon]=\"node.node.config.icon\" />\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 [removable]=\"true\" [selectable]=\"false\" (removed)=\"unselectModelNode(node)\">\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 .select-all{margin-bottom:5px}: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"] }]
|
|
8440
8456
|
}], propDecorators: { displayWith: [{
|
|
8441
8457
|
type: Input
|
|
8442
8458
|
}], config: [{
|
|
@@ -8507,7 +8523,7 @@ class TypeHierarchicSelectorComponent extends AbstractAssociationSelectComponent
|
|
|
8507
8523
|
return selection[this.configuration.key].length ? selection : null;
|
|
8508
8524
|
}
|
|
8509
8525
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: TypeHierarchicSelectorComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
8510
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.13", type: TypeHierarchicSelectorComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<form [formGroup]=\"form\">\n <mat-form-field style=\"max-width: 7em; margin-right: 1em\">\n <mat-label i18n=\"Mathematical operator < > =\">Op\u00E9rateur</mat-label>\n <mat-select panelWidth=\"\" [formControl]=\"operatorCtrl\" [required]=\"true\">\n @for (item of operators; track item) {\n <mat-option [value]=\"item.key\">\n {{ item.label }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n @if (requireValueCtrl) {\n <natural-hierarchic-selector\n style=\"margin-right: 20px\"\n [config]=\"configuration.config\"\n [filters]=\"configuration.filters\"\n [multiple]=\"true\"\n [selected]=\"valueCtrl.value || {}\"\n (selectionChange)=\"selectionChange($event)\"\n />\n }\n</form>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { 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: "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", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatOptionModule }, { kind: "component", type: NaturalHierarchicSelectorComponent, selector: "natural-hierarchic-selector", inputs: ["displayWith", "config", "multiple", "selected", "allowUnselect", "filters", "searchFacets", "searchSelections"], outputs: ["searchSelectionChange", "selectionChange"] }] });
|
|
8526
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.13", type: TypeHierarchicSelectorComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<form [formGroup]=\"form\">\n <mat-form-field style=\"max-width: 7em; margin-right: 1em\">\n <mat-label i18n=\"Mathematical operator < > =\">Op\u00E9rateur</mat-label>\n <mat-select panelWidth=\"\" [formControl]=\"operatorCtrl\" [required]=\"true\">\n @for (item of operators; track item) {\n <mat-option [value]=\"item.key\">\n {{ item.label }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n @if (requireValueCtrl) {\n <natural-hierarchic-selector\n style=\"margin-right: 20px\"\n [config]=\"configuration.config\"\n [filters]=\"configuration.filters\"\n [multiple]=\"true\"\n [selected]=\"valueCtrl.value || {}\"\n (selectionChange)=\"selectionChange($event)\"\n />\n }\n</form>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { 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: "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", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatOptionModule }, { kind: "component", type: NaturalHierarchicSelectorComponent, selector: "natural-hierarchic-selector", inputs: ["displayWith", "config", "multiple", "selected", "allowUnselect", "filters", "searchFacets", "searchSelections", "allowSelectAll"], outputs: ["searchSelectionChange", "selectionChange"] }] });
|
|
8511
8527
|
}
|
|
8512
8528
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: TypeHierarchicSelectorComponent, decorators: [{
|
|
8513
8529
|
type: Component,
|
|
@@ -9502,11 +9518,11 @@ class NaturalHierarchicSelectorDialogComponent {
|
|
|
9502
9518
|
this.dialogRef.close(result);
|
|
9503
9519
|
}
|
|
9504
9520
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: NaturalHierarchicSelectorDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9505
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: NaturalHierarchicSelectorDialogComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<h2 i18n mat-dialog-title>S\u00E9lection</h2>\n\n<mat-dialog-content>\n <natural-hierarchic-selector\n [selected]=\"config.hierarchicSelection ?? {}\"\n [config]=\"config.hierarchicConfig\"\n [filters]=\"config.hierarchicFilters\"\n [multiple]=\"config.multiple ?? false\"\n [allowUnselect]=\"config.allowUnselect ?? true\"\n [searchFacets]=\"config.searchFacets ?? []\"\n [searchSelections]=\"config.searchSelections ?? []\"\n (selectionChange)=\"config.hierarchicSelection = $event\"\n (searchSelectionChange)=\"searchSelectionsOutput = $event\"\n />\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\">\n <button mat-dialog-close mat-button i18n>Annuler</button>\n <button color=\"primary\" mat-raised-button (click)=\"close(config.hierarchicSelection)\"\n ><span i18n>Valider</span>\n </button>\n</mat-dialog-actions>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: NaturalHierarchicSelectorComponent, selector: "natural-hierarchic-selector", inputs: ["displayWith", "config", "multiple", "selected", "allowUnselect", "filters", "searchFacets", "searchSelections"], outputs: ["searchSelectionChange", "selectionChange"] }, { 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"] }] });
|
|
9521
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: NaturalHierarchicSelectorDialogComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<h2 i18n mat-dialog-title>S\u00E9lection</h2>\n\n<mat-dialog-content>\n <natural-hierarchic-selector\n [selected]=\"config.hierarchicSelection ?? {}\"\n [config]=\"config.hierarchicConfig\"\n [filters]=\"config.hierarchicFilters\"\n [multiple]=\"config.multiple ?? false\"\n [allowUnselect]=\"config.allowUnselect ?? true\"\n [allowSelectAll]=\"config.allowSelectAll ?? false\"\n [searchFacets]=\"config.searchFacets ?? []\"\n [searchSelections]=\"config.searchSelections ?? []\"\n (selectionChange)=\"config.hierarchicSelection = $event\"\n (searchSelectionChange)=\"searchSelectionsOutput = $event\"\n />\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\">\n <button mat-dialog-close mat-button i18n>Annuler</button>\n <button color=\"primary\" mat-raised-button (click)=\"close(config.hierarchicSelection)\"\n ><span i18n>Valider</span>\n </button>\n</mat-dialog-actions>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: NaturalHierarchicSelectorComponent, selector: "natural-hierarchic-selector", inputs: ["displayWith", "config", "multiple", "selected", "allowUnselect", "filters", "searchFacets", "searchSelections", "allowSelectAll"], outputs: ["searchSelectionChange", "selectionChange"] }, { 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"] }] });
|
|
9506
9522
|
}
|
|
9507
9523
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: NaturalHierarchicSelectorDialogComponent, decorators: [{
|
|
9508
9524
|
type: Component,
|
|
9509
|
-
args: [{ imports: [MatDialogModule, NaturalHierarchicSelectorComponent, MatButtonModule], template: "<h2 i18n mat-dialog-title>S\u00E9lection</h2>\n\n<mat-dialog-content>\n <natural-hierarchic-selector\n [selected]=\"config.hierarchicSelection ?? {}\"\n [config]=\"config.hierarchicConfig\"\n [filters]=\"config.hierarchicFilters\"\n [multiple]=\"config.multiple ?? false\"\n [allowUnselect]=\"config.allowUnselect ?? true\"\n [searchFacets]=\"config.searchFacets ?? []\"\n [searchSelections]=\"config.searchSelections ?? []\"\n (selectionChange)=\"config.hierarchicSelection = $event\"\n (searchSelectionChange)=\"searchSelectionsOutput = $event\"\n />\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\">\n <button mat-dialog-close mat-button i18n>Annuler</button>\n <button color=\"primary\" mat-raised-button (click)=\"close(config.hierarchicSelection)\"\n ><span i18n>Valider</span>\n </button>\n</mat-dialog-actions>\n" }]
|
|
9525
|
+
args: [{ imports: [MatDialogModule, NaturalHierarchicSelectorComponent, MatButtonModule], template: "<h2 i18n mat-dialog-title>S\u00E9lection</h2>\n\n<mat-dialog-content>\n <natural-hierarchic-selector\n [selected]=\"config.hierarchicSelection ?? {}\"\n [config]=\"config.hierarchicConfig\"\n [filters]=\"config.hierarchicFilters\"\n [multiple]=\"config.multiple ?? false\"\n [allowUnselect]=\"config.allowUnselect ?? true\"\n [allowSelectAll]=\"config.allowSelectAll ?? false\"\n [searchFacets]=\"config.searchFacets ?? []\"\n [searchSelections]=\"config.searchSelections ?? []\"\n (selectionChange)=\"config.hierarchicSelection = $event\"\n (searchSelectionChange)=\"searchSelectionsOutput = $event\"\n />\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\">\n <button mat-dialog-close mat-button i18n>Annuler</button>\n <button color=\"primary\" mat-raised-button (click)=\"close(config.hierarchicSelection)\"\n ><span i18n>Valider</span>\n </button>\n</mat-dialog-actions>\n" }]
|
|
9510
9526
|
}], ctorParameters: () => [] });
|
|
9511
9527
|
|
|
9512
9528
|
class NaturalHierarchicSelectorDialogService {
|