@ecodev/natural 66.0.14 → 66.0.16
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 +72 -16
- package/fesm2022/ecodev-natural.mjs.map +1 -1
- package/index.d.ts +49 -7
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Component, Injectable, DestroyRef, HostListener, HostBinding, Directive, InjectionToken, ElementRef, viewChild, ViewEncapsulation, Injector, Input, input, PLATFORM_ID, signal, provideAppInitializer, DOCUMENT, computed, effect, output, Pipe, LOCALE_ID, contentChild, TemplateRef, EnvironmentInjector, createEnvironmentInjector, createComponent, runInInjectionContext, ChangeDetectionStrategy, linkedSignal, ErrorHandler, importProvidersFrom } from '@angular/core';
|
|
2
|
+
import { inject, Component, Injectable, DestroyRef, HostListener, HostBinding, Directive, InjectionToken, ElementRef, viewChild, ViewEncapsulation, Injector, Input, input, PLATFORM_ID, signal, makeEnvironmentProviders, provideAppInitializer, DOCUMENT, computed, effect, output, Pipe, LOCALE_ID, contentChild, TemplateRef, EnvironmentInjector, createEnvironmentInjector, createComponent, runInInjectionContext, forwardRef, ChangeDetectionStrategy, linkedSignal, ErrorHandler, importProvidersFrom } from '@angular/core';
|
|
3
3
|
import * as i1$1 from '@angular/forms';
|
|
4
4
|
import { FormGroup, FormArray, Validators, UntypedFormGroup, UntypedFormArray, FormControl, FormsModule, ReactiveFormsModule, UntypedFormControl, NgControl, FormControlDirective, FormControlName } from '@angular/forms';
|
|
5
5
|
import { NavigationStart, NavigationEnd, ActivatedRoute, Router, RouteConfigLoadStart, RouteConfigLoadEnd, PRIMARY_OUTLET, RouterLink, NavigationError, DefaultUrlSerializer, UrlTree } from '@angular/router';
|
|
@@ -12,7 +12,7 @@ import { Observable, switchMap, take, BehaviorSubject, of, timer, tap, endWith,
|
|
|
12
12
|
import { takeUntilDestroyed, toSignal, outputFromObservable } from '@angular/core/rxjs-interop';
|
|
13
13
|
import { filter, switchMap as switchMap$1, first, map, takeUntil, takeWhile, debounceTime as debounceTime$1, tap as tap$1, shareReplay as shareReplay$1, startWith as startWith$1, distinctUntilChanged, finalize as finalize$1, throttleTime } from 'rxjs/operators';
|
|
14
14
|
import { mergeWith, defaultsDeep, pick, defaults, isEmpty, isEqual as isEqual$1 } from 'es-toolkit/compat';
|
|
15
|
-
import { MatTableDataSource, MatTable, MatHeaderCellDef, MatHeaderRowDef, MatColumnDef,
|
|
15
|
+
import { MatTableDataSource, MatCellDef, MatTable, MatHeaderCellDef, MatHeaderRowDef, MatColumnDef, MatRowDef, MatHeaderCell, MatCell, MatHeaderRow, MatRow } from '@angular/material/table';
|
|
16
16
|
import { DataSource, SelectionModel } from '@angular/cdk/collections';
|
|
17
17
|
import { DateAdapter, MAT_DATE_FORMATS, MatOption, NativeDateAdapter, ErrorStateMatcher, MatRipple } from '@angular/material/core';
|
|
18
18
|
import { createOverlayRef, OverlayConfig, createFlexibleConnectedPositionStrategy } from '@angular/cdk/overlay';
|
|
@@ -45,6 +45,7 @@ import { MatTreeNestedDataSource, MatNestedTreeNode, MatTreeNodeDef, MatTreeNode
|
|
|
45
45
|
import { MatDivider } from '@angular/material/divider';
|
|
46
46
|
import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle';
|
|
47
47
|
import { MatPaginator } from '@angular/material/paginator';
|
|
48
|
+
import { CdkCellDef } from '@angular/cdk/table';
|
|
48
49
|
import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav';
|
|
49
50
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
50
51
|
|
|
@@ -196,17 +197,18 @@ function formatIsoDateTime(date) {
|
|
|
196
197
|
const timezoneOffsetInMinutes = Math.round(date.getTimezoneOffset());
|
|
197
198
|
const timezoneOffsetInHours = -Math.trunc(timezoneOffsetInMinutes / 60); // UTC minus local time
|
|
198
199
|
const sign = timezoneOffsetInHours >= 0 ? '+' : '-';
|
|
199
|
-
const remainderMinutes = -
|
|
200
|
+
const remainderMinutes = -timezoneOffsetInMinutes % 60;
|
|
200
201
|
// It's a bit unfortunate that we need to construct a new Date instance,
|
|
201
202
|
// but we don't want the original Date instance to be modified
|
|
202
203
|
const correctedDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
|
|
203
204
|
correctedDate.setHours(date.getHours() + timezoneOffsetInHours);
|
|
205
|
+
correctedDate.setMinutes(date.getMinutes() + remainderMinutes);
|
|
204
206
|
const iso = correctedDate
|
|
205
207
|
.toISOString()
|
|
206
208
|
.replace(/\.\d{3}Z/, '')
|
|
207
209
|
.replace('Z', '');
|
|
208
210
|
const hours = Math.abs(timezoneOffsetInHours).toString().padStart(2, '0');
|
|
209
|
-
const minutes = remainderMinutes.toString().padStart(2, '0');
|
|
211
|
+
const minutes = Math.abs(remainderMinutes).toString().padStart(2, '0');
|
|
210
212
|
return iso + sign + hours + ':' + minutes;
|
|
211
213
|
}
|
|
212
214
|
/**
|
|
@@ -5329,8 +5331,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImpor
|
|
|
5329
5331
|
}] });
|
|
5330
5332
|
|
|
5331
5333
|
const NATURAL_THEMES_CONFIG = new InjectionToken('Configuration for Natural Theme');
|
|
5334
|
+
/**
|
|
5335
|
+
* If you are using themes, or color scheme, then you must provide themes at the application level.
|
|
5336
|
+
*
|
|
5337
|
+
* If there is a only one theme, you still need to provide a name for it (eg: "my-app"), even if
|
|
5338
|
+
* it is not used in the SCSS.
|
|
5339
|
+
*/
|
|
5332
5340
|
function provideThemes(config) {
|
|
5333
|
-
return [
|
|
5341
|
+
return makeEnvironmentProviders([
|
|
5334
5342
|
{
|
|
5335
5343
|
provide: NATURAL_THEMES_CONFIG,
|
|
5336
5344
|
useValue: config,
|
|
@@ -5338,7 +5346,7 @@ function provideThemes(config) {
|
|
|
5338
5346
|
provideAppInitializer(() => {
|
|
5339
5347
|
inject(NaturalThemeService);
|
|
5340
5348
|
}),
|
|
5341
|
-
];
|
|
5349
|
+
]);
|
|
5342
5350
|
}
|
|
5343
5351
|
var ColorScheme;
|
|
5344
5352
|
(function (ColorScheme) {
|
|
@@ -5351,11 +5359,17 @@ const colorSchemeOptions = [
|
|
|
5351
5359
|
{ value: ColorScheme.Light, label: $localize `Thème clair`, icon: 'light_mode' },
|
|
5352
5360
|
{ value: ColorScheme.Dark, label: $localize `Thème sombre`, icon: 'dark_mode' },
|
|
5353
5361
|
];
|
|
5362
|
+
/**
|
|
5363
|
+
* The source of truth is the DOM. And thus the index.html (or equivalent) must use vanilla JavaScript
|
|
5364
|
+
* to restore `data-color-scheme` and `data-theme` attributes on the `<html>` element (eg: from
|
|
5365
|
+
* local storage, or from DB).
|
|
5366
|
+
*/
|
|
5354
5367
|
class NaturalThemeService {
|
|
5355
5368
|
allThemes = inject(NATURAL_THEMES_CONFIG);
|
|
5356
5369
|
storage = inject(LOCAL_STORAGE);
|
|
5357
5370
|
platformId = inject(PLATFORM_ID);
|
|
5358
5371
|
document = inject(DOCUMENT);
|
|
5372
|
+
htmlElement = this.document.documentElement;
|
|
5359
5373
|
isDarkSystem = toSignal(isPlatformBrowser(this.platformId)
|
|
5360
5374
|
? fromEvent(this.document.defaultView.matchMedia('(prefers-color-scheme: dark)'), 'change').pipe(startWith$1(this.document.defaultView.matchMedia('(prefers-color-scheme: dark)')), map$1(e => e.matches))
|
|
5361
5375
|
: of(false), { initialValue: false });
|
|
@@ -5374,28 +5388,28 @@ class NaturalThemeService {
|
|
|
5374
5388
|
colorScheme = this._colorScheme.asReadonly();
|
|
5375
5389
|
constructor() {
|
|
5376
5390
|
effect(() => {
|
|
5377
|
-
this.
|
|
5391
|
+
this.htmlElement.setAttribute('data-is-dark', this.isDark() ? 'true' : 'false');
|
|
5378
5392
|
});
|
|
5379
5393
|
const storedScheme = this.storage.getItem('color-scheme');
|
|
5380
5394
|
const isValidScheme = storedScheme && Object.values(ColorScheme).includes(storedScheme);
|
|
5381
5395
|
this._colorScheme.set(isValidScheme ? storedScheme : ColorScheme.Auto);
|
|
5382
5396
|
}
|
|
5383
5397
|
/**
|
|
5384
|
-
* Set theme in memory
|
|
5398
|
+
* Set theme in memory and dom
|
|
5385
5399
|
*/
|
|
5386
5400
|
setTheme(theme) {
|
|
5387
5401
|
if (!this.allThemes.includes(theme)) {
|
|
5388
5402
|
throw new Error(`Expecting one of the configured themes: ${this.allThemes.map(t => `'${t}'`).join(', ')}. But got invalid: '${theme}'`);
|
|
5389
5403
|
}
|
|
5390
5404
|
this._theme.set(theme);
|
|
5391
|
-
this.
|
|
5405
|
+
this.htmlElement.setAttribute('data-theme', theme);
|
|
5392
5406
|
}
|
|
5393
5407
|
/**
|
|
5394
5408
|
* Set dark/light/auto
|
|
5395
5409
|
*/
|
|
5396
5410
|
setColorScheme(scheme, persistInStorage = true) {
|
|
5397
5411
|
this._colorScheme.set(scheme); // memory
|
|
5398
|
-
this.
|
|
5412
|
+
this.htmlElement.setAttribute('data-color-scheme', scheme); // dom
|
|
5399
5413
|
if (persistInStorage) {
|
|
5400
5414
|
this.storage.setItem('color-scheme', this.colorScheme()); // storage
|
|
5401
5415
|
}
|
|
@@ -5497,7 +5511,9 @@ class NaturalIconDirective {
|
|
|
5497
5511
|
domSanitizer = inject(DomSanitizer);
|
|
5498
5512
|
config = inject(NATURAL_ICONS_CONFIG, { optional: true });
|
|
5499
5513
|
matIconComponent = inject(MatIcon, { host: true, self: true });
|
|
5500
|
-
naturalIcon = input.required(...(ngDevMode ? [{ debugName: "naturalIcon" }] : [
|
|
5514
|
+
naturalIcon = input.required(...(ngDevMode ? [{ debugName: "naturalIcon", transform: (value) => value ?? '' }] : [{
|
|
5515
|
+
transform: (value) => value ?? '',
|
|
5516
|
+
}]));
|
|
5501
5517
|
size = input(undefined, ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
5502
5518
|
icon = computed(() => {
|
|
5503
5519
|
const value = this.naturalIcon();
|
|
@@ -10017,6 +10033,44 @@ const fallbackIfNoOpenedPanels = (segments) => {
|
|
|
10017
10033
|
* Public API Surface of natural
|
|
10018
10034
|
*/
|
|
10019
10035
|
|
|
10036
|
+
/* eslint-disable @angular-eslint/directive-class-suffix */
|
|
10037
|
+
/**
|
|
10038
|
+
* Exactly the same as the original `MatCellDef`, but with the additional `dataSource`
|
|
10039
|
+
* input to specify the type of the element.
|
|
10040
|
+
*
|
|
10041
|
+
* Usage:
|
|
10042
|
+
*
|
|
10043
|
+
* ```html
|
|
10044
|
+
* <table mat-table [dataSource]="dataSource">
|
|
10045
|
+
* <ng-container matColumnDef="name">
|
|
10046
|
+
* <th *matHeaderCellDef mat-header-cell>Name</th>
|
|
10047
|
+
* <td *matCellDef="let element; dataSource: dataSource" mat-cell>
|
|
10048
|
+
* {{ element.name }}
|
|
10049
|
+
* </td>
|
|
10050
|
+
* </ng-container>
|
|
10051
|
+
* </table>
|
|
10052
|
+
* ```
|
|
10053
|
+
*/
|
|
10054
|
+
class TypedMatCellDef extends MatCellDef {
|
|
10055
|
+
/**
|
|
10056
|
+
* Should be the same value as the one used in `<table mat-table [dataSource]="dataSource">`
|
|
10057
|
+
*/
|
|
10058
|
+
matCellDefDataSource = input(...(ngDevMode ? [undefined, { debugName: "matCellDefDataSource" }] : []));
|
|
10059
|
+
static ngTemplateContextGuard(dir, ctx) {
|
|
10060
|
+
return true;
|
|
10061
|
+
}
|
|
10062
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: TypedMatCellDef, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
10063
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.7", type: TypedMatCellDef, isStandalone: true, selector: "[matCellDef]", inputs: { matCellDefDataSource: { classPropertyName: "matCellDefDataSource", publicName: "matCellDefDataSource", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: CdkCellDef, useExisting: forwardRef(() => TypedMatCellDef) }], usesInheritance: true, ngImport: i0 });
|
|
10064
|
+
}
|
|
10065
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: TypedMatCellDef, decorators: [{
|
|
10066
|
+
type: Directive,
|
|
10067
|
+
args: [{
|
|
10068
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
10069
|
+
selector: '[matCellDef]', // same selector as MatCellDef
|
|
10070
|
+
providers: [{ provide: CdkCellDef, useExisting: forwardRef(() => TypedMatCellDef) }],
|
|
10071
|
+
}]
|
|
10072
|
+
}], propDecorators: { matCellDefDataSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "matCellDefDataSource", required: false }] }] } });
|
|
10073
|
+
|
|
10020
10074
|
/**
|
|
10021
10075
|
* Custom template usage :
|
|
10022
10076
|
*
|
|
@@ -10212,7 +10266,7 @@ class NaturalRelationsComponent {
|
|
|
10212
10266
|
return hierarchicSelectorConfig.find(c => !!c.selectableAtKey)?.selectableAtKey;
|
|
10213
10267
|
}
|
|
10214
10268
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: NaturalRelationsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10215
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.7", type: NaturalRelationsComponent, isStandalone: true, selector: "natural-relations", inputs: { service: { classPropertyName: "service", publicName: "service", isSignal: false, isRequired: true, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, autocompleteSelectorFilter: { classPropertyName: "autocompleteSelectorFilter", publicName: "autocompleteSelectorFilter", isSignal: true, isRequired: false, transformFunction: null }, displayWith: { classPropertyName: "displayWith", publicName: "displayWith", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, main: { classPropertyName: "main", publicName: "main", isSignal: false, isRequired: true, transformFunction: null }, hierarchicSelectorFilters: { classPropertyName: "hierarchicSelectorFilters", publicName: "hierarchicSelectorFilters", isSignal: true, isRequired: false, transformFunction: null }, hierarchicSelectorConfig: { classPropertyName: "hierarchicSelectorConfig", publicName: "hierarchicSelectorConfig", isSignal: true, isRequired: false, transformFunction: null }, otherName: { classPropertyName: "otherName", publicName: "otherName", isSignal: false, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: false, isRequired: false, transformFunction: null }, sorting: { classPropertyName: "sorting", publicName: "sorting", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { selectionChange: "selectionChange" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "select", first: true, predicate: NaturalSelectComponent, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"body\">\n <ng-template #defaultNameCell let-item=\"item\">\n {{ getDisplayFn()(item) }}\n </ng-template>\n\n <table class=\"natural-row-click\" mat-table [dataSource]=\"dataSource\">\n <tr *matHeaderRowDef=\"displayedColumns\" mat-header-row style=\"display: none\"></tr>\n <tr *matRowDef=\"let row; columns: displayedColumns\" mat-row></tr>\n\n <ng-container matColumnDef=\"name\">\n <th *matHeaderCellDef i18n mat-header-cell>Titre</th>\n <td *matCellDef=\"let
|
|
10269
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.7", type: NaturalRelationsComponent, isStandalone: true, selector: "natural-relations", inputs: { service: { classPropertyName: "service", publicName: "service", isSignal: false, isRequired: true, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, autocompleteSelectorFilter: { classPropertyName: "autocompleteSelectorFilter", publicName: "autocompleteSelectorFilter", isSignal: true, isRequired: false, transformFunction: null }, displayWith: { classPropertyName: "displayWith", publicName: "displayWith", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, main: { classPropertyName: "main", publicName: "main", isSignal: false, isRequired: true, transformFunction: null }, hierarchicSelectorFilters: { classPropertyName: "hierarchicSelectorFilters", publicName: "hierarchicSelectorFilters", isSignal: true, isRequired: false, transformFunction: null }, hierarchicSelectorConfig: { classPropertyName: "hierarchicSelectorConfig", publicName: "hierarchicSelectorConfig", isSignal: true, isRequired: false, transformFunction: null }, otherName: { classPropertyName: "otherName", publicName: "otherName", isSignal: false, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: false, isRequired: false, transformFunction: null }, sorting: { classPropertyName: "sorting", publicName: "sorting", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { selectionChange: "selectionChange" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "select", first: true, predicate: NaturalSelectComponent, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"body\">\n <ng-template #defaultNameCell let-item=\"item\">\n {{ getDisplayFn()(item) }}\n </ng-template>\n\n <table class=\"natural-row-click\" mat-table [dataSource]=\"dataSource\">\n <tr *matHeaderRowDef=\"displayedColumns\" mat-header-row style=\"display: none\"></tr>\n <tr *matRowDef=\"let row; columns: displayedColumns\" mat-row></tr>\n\n <ng-container matColumnDef=\"name\">\n <th *matHeaderCellDef i18n mat-header-cell>Titre</th>\n <td *matCellDef=\"let element; dataSource: dataSource\" mat-cell>\n @let customTemplate = itemTemplate();\n <ng-template\n [ngTemplateOutletContext]=\"{item: element}\"\n [ngTemplateOutlet]=\"customTemplate ? customTemplate : defaultNameCell\"\n />\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"unlink\">\n <th *matHeaderCellDef mat-header-cell></th>\n <td *matCellDef=\"let element; dataSource: dataSource\" mat-cell>\n @if (!disabled) {\n <button\n color=\"error\"\n matIconButton\n i18n-matTooltip\n matTooltip=\"Dissocier\"\n [disabled]=\"removing.has(element)\"\n (click)=\"removeRelation(element)\"\n >\n <mat-icon naturalIcon=\"link_off\" />\n </button>\n }\n </td>\n </ng-container>\n </table>\n\n @if (dataSource.data && (dataSource.data.length || 0) > (dataSource.data.pageSize || 0)) {\n <mat-paginator\n [length]=\"dataSource.data.length || 0\"\n [pageIndex]=\"dataSource.data.pageIndex || 0\"\n [pageSizeOptions]=\"pageSizeOptions\"\n [pageSize]=\"dataSource.data.pageSize || 0\"\n (page)=\"pagination($event)\"\n />\n }\n\n @if (!loading && dataSource.data?.length === 0) {\n <div class=\"nat-margin-vertical mat-body\">\n <span i18n>Aucun r\u00E9sultat</span>\n </div>\n }\n\n @if (loading) {\n <mat-progress-spinner class=\"loading\" mode=\"indeterminate\" [diameter]=\"40\" />\n }\n</div>\n\n@if (!disabled) {\n @if (hierarchicSelectorConfig()) {\n <div>\n <button color=\"primary\" mat-flat-button (click)=\"openNaturalHierarchicSelector()\">{{\n placeholder()\n }}</button>\n </div>\n } @else {\n <natural-select\n [displayWith]=\"$any(getDisplayFn())\"\n [filter]=\"autocompleteSelectorFilter()\"\n [placeholder]=\"placeholder()\"\n [service]=\"service\"\n [showIcon]=\"false\"\n (selectionChange)=\"addRelations([$event])\"\n />\n }\n}\n", styles: [":host{display:flex;flex-direction:column}:host>*:not(:last-child){margin-bottom:20px}:host .body{display:flex;flex-direction:column}:host .loading{margin:20px auto}:host .mat-column-unlink{width:2.5em}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: TypedMatCellDef, selector: "[matCellDef]", inputs: ["matCellDefDataSource"] }, { kind: "directive", type: MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NaturalIconDirective, selector: "mat-icon[naturalIcon]", inputs: ["naturalIcon", "size"] }, { kind: "component", type: MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: NaturalSelectComponent, selector: "natural-select", inputs: ["service", "optionRequired", "searchField", "searchOperator", "filter", "pageSize", "disabled"] }] });
|
|
10216
10270
|
}
|
|
10217
10271
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: NaturalRelationsComponent, decorators: [{
|
|
10218
10272
|
type: Component,
|
|
@@ -10222,7 +10276,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImpor
|
|
|
10222
10276
|
MatHeaderCellDef,
|
|
10223
10277
|
MatHeaderRowDef,
|
|
10224
10278
|
MatColumnDef,
|
|
10225
|
-
|
|
10279
|
+
TypedMatCellDef,
|
|
10226
10280
|
MatRowDef,
|
|
10227
10281
|
MatHeaderCell,
|
|
10228
10282
|
MatCell,
|
|
@@ -10236,7 +10290,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImpor
|
|
|
10236
10290
|
MatPaginator,
|
|
10237
10291
|
MatProgressSpinner,
|
|
10238
10292
|
NaturalSelectComponent,
|
|
10239
|
-
], template: "<div class=\"body\">\n <ng-template #defaultNameCell let-item=\"item\">\n {{ getDisplayFn()(item) }}\n </ng-template>\n\n <table class=\"natural-row-click\" mat-table [dataSource]=\"dataSource\">\n <tr *matHeaderRowDef=\"displayedColumns\" mat-header-row style=\"display: none\"></tr>\n <tr *matRowDef=\"let row; columns: displayedColumns\" mat-row></tr>\n\n <ng-container matColumnDef=\"name\">\n <th *matHeaderCellDef i18n mat-header-cell>Titre</th>\n <td *matCellDef=\"let
|
|
10293
|
+
], template: "<div class=\"body\">\n <ng-template #defaultNameCell let-item=\"item\">\n {{ getDisplayFn()(item) }}\n </ng-template>\n\n <table class=\"natural-row-click\" mat-table [dataSource]=\"dataSource\">\n <tr *matHeaderRowDef=\"displayedColumns\" mat-header-row style=\"display: none\"></tr>\n <tr *matRowDef=\"let row; columns: displayedColumns\" mat-row></tr>\n\n <ng-container matColumnDef=\"name\">\n <th *matHeaderCellDef i18n mat-header-cell>Titre</th>\n <td *matCellDef=\"let element; dataSource: dataSource\" mat-cell>\n @let customTemplate = itemTemplate();\n <ng-template\n [ngTemplateOutletContext]=\"{item: element}\"\n [ngTemplateOutlet]=\"customTemplate ? customTemplate : defaultNameCell\"\n />\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"unlink\">\n <th *matHeaderCellDef mat-header-cell></th>\n <td *matCellDef=\"let element; dataSource: dataSource\" mat-cell>\n @if (!disabled) {\n <button\n color=\"error\"\n matIconButton\n i18n-matTooltip\n matTooltip=\"Dissocier\"\n [disabled]=\"removing.has(element)\"\n (click)=\"removeRelation(element)\"\n >\n <mat-icon naturalIcon=\"link_off\" />\n </button>\n }\n </td>\n </ng-container>\n </table>\n\n @if (dataSource.data && (dataSource.data.length || 0) > (dataSource.data.pageSize || 0)) {\n <mat-paginator\n [length]=\"dataSource.data.length || 0\"\n [pageIndex]=\"dataSource.data.pageIndex || 0\"\n [pageSizeOptions]=\"pageSizeOptions\"\n [pageSize]=\"dataSource.data.pageSize || 0\"\n (page)=\"pagination($event)\"\n />\n }\n\n @if (!loading && dataSource.data?.length === 0) {\n <div class=\"nat-margin-vertical mat-body\">\n <span i18n>Aucun r\u00E9sultat</span>\n </div>\n }\n\n @if (loading) {\n <mat-progress-spinner class=\"loading\" mode=\"indeterminate\" [diameter]=\"40\" />\n }\n</div>\n\n@if (!disabled) {\n @if (hierarchicSelectorConfig()) {\n <div>\n <button color=\"primary\" mat-flat-button (click)=\"openNaturalHierarchicSelector()\">{{\n placeholder()\n }}</button>\n </div>\n } @else {\n <natural-select\n [displayWith]=\"$any(getDisplayFn())\"\n [filter]=\"autocompleteSelectorFilter()\"\n [placeholder]=\"placeholder()\"\n [service]=\"service\"\n [showIcon]=\"false\"\n (selectionChange)=\"addRelations([$event])\"\n />\n }\n}\n", styles: [":host{display:flex;flex-direction:column}:host>*:not(:last-child){margin-bottom:20px}:host .body{display:flex;flex-direction:column}:host .loading{margin:20px auto}:host .mat-column-unlink{width:2.5em}\n"] }]
|
|
10240
10294
|
}], propDecorators: { select: [{ type: i0.ViewChild, args: [i0.forwardRef(() => NaturalSelectComponent), { isSignal: true }] }], itemTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }], service: [{
|
|
10241
10295
|
type: Input,
|
|
10242
10296
|
args: [{ required: true }]
|
|
@@ -10814,7 +10868,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImpor
|
|
|
10814
10868
|
class NaturalTableButtonComponent {
|
|
10815
10869
|
queryParams = input({}, ...(ngDevMode ? [{ debugName: "queryParams" }] : []));
|
|
10816
10870
|
queryParamsHandling = input('', ...(ngDevMode ? [{ debugName: "queryParamsHandling" }] : []));
|
|
10817
|
-
label = input(...(ngDevMode ? [
|
|
10871
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label", transform: (value) => typeof value === 'number' ? value.toString() : (value ?? '') }] : [{
|
|
10872
|
+
transform: (value) => typeof value === 'number' ? value.toString() : (value ?? ''),
|
|
10873
|
+
}]));
|
|
10818
10874
|
icon = input(...(ngDevMode ? [undefined, { debugName: "icon" }] : []));
|
|
10819
10875
|
href = input(...(ngDevMode ? [undefined, { debugName: "href" }] : []));
|
|
10820
10876
|
navigate = input(null, ...(ngDevMode ? [{ debugName: "navigate" }] : []));
|
|
@@ -11525,5 +11581,5 @@ function graphqlQuerySigner(key) {
|
|
|
11525
11581
|
* Generated bundle index. Do not edit.
|
|
11526
11582
|
*/
|
|
11527
11583
|
|
|
11528
|
-
export { AvatarService, ColorScheme, InvalidWithValueStateMatcher$1 as InvalidWithValueStateMatcher, LOCAL_STORAGE, NATURAL_DROPDOWN_DATA, NATURAL_ICONS_CONFIG, NATURAL_PERSISTENCE_VALIDATOR, NATURAL_SEO_CONFIG, NaturalAbstractDetail, NaturalAbstractEditableList, NaturalAbstractList, NaturalAbstractModelService, NaturalAbstractNavigableList, NaturalAbstractPanel, NaturalAlertService, NaturalAvatarComponent, NaturalBackgroundDensityDirective, NaturalCapitalizePipe, NaturalColorSchemerComponent, NaturalColumnsPickerComponent, NaturalCompactColorSchemerComponent, NaturalConfirmComponent, NaturalDataSource, NaturalDebounceService, NaturalDetailHeaderComponent, NaturalDialogTriggerComponent, NaturalDropdownRef, NaturalEllipsisPipe, NaturalEnumPipe, NaturalEnumService, NaturalErrorHandler, NaturalErrorMessagePipe, NaturalFileComponent, NaturalFileDropDirective, NaturalFileSelectDirective, NaturalFileService, NaturalFixedButtonComponent, NaturalFixedButtonDetailComponent, NaturalHierarchicSelectorComponent, NaturalHierarchicSelectorDialogComponent, NaturalHierarchicSelectorDialogService, NaturalHierarchicSelectorService, NaturalHttpPrefixDirective, NaturalIconDirective, NaturalLinkMutationService, NaturalLinkableTabDirective, NaturalLoggerConfigExtra, NaturalLoggerConfigUrl, NaturalMatomoService, NaturalMemoryStorage, NaturalPanelsComponent, NaturalPanelsService, NaturalPersistenceService, NaturalQueryVariablesManager, NaturalRelationsComponent, NaturalSearchComponent, NaturalSelectComponent, NaturalSelectEnumComponent, NaturalSelectHierarchicComponent, NaturalSeoService, NaturalSidenavComponent, NaturalSidenavContainerComponent, NaturalSidenavContentComponent, NaturalSidenavService, NaturalSidenavStackService, NaturalSrcDensityDirective, NaturalStampComponent, NaturalSwissParsingDateAdapter, NaturalTableButtonComponent, NaturalThemeChangerComponent, NaturalThemeService, NaturalTimeAgoPipe, NetworkActivityService, PanelsHooksConfig, SESSION_STORAGE, SortingOrder, TypeBooleanComponent, TypeDateComponent, TypeDateRangeComponent, TypeHierarchicSelectorComponent, TypeNaturalSelectComponent, TypeNumberComponent, TypeOptionsComponent, TypeSelectComponent, TypeTextComponent, activityInterceptor, available, cancellableTimeout, cloneDeepButSkipFile, collectErrors, commonImageMimeTypes, copyToClipboard, createHttpLink, debug, decimal, deepFreeze, deliverableEmail, ensureHttpPrefix, fallbackIfNoOpenedPanels, formatIsoDate, formatIsoDateTime, fromUrl, getForegroundColor, graphqlQuerySigner, greaterThan, hasFilesAndProcessDate, ifValid, integer, isFile, localStorageFactory, localStorageProvider, makePlural, memoryLocalStorageProvider, memorySessionStorageProvider, mergeOverrideArray, money, naturalPanelsUrlMatcher, naturalProviders, nfcCardHex, onHistoryEvent, possibleComparableOperators, possibleNullComparableOperators, provideErrorHandler, provideIcons, providePanels, provideSeo, provideThemes, relationsToIds, replaceObjectKeepingReference, replaceOperatorByField, replaceOperatorByName, rgbToHex, sessionStorageFactory, sessionStorageProvider, time, toGraphQLDoctrineFilter, toNavigationParameters, toUrl, unique, upperCaseFirstLetter, url, urlPattern, validTlds, validateAllFormControls, validateColumns, validatePagination, validateSorting, wrapLike, wrapPrefix, wrapSuffix };
|
|
11584
|
+
export { AvatarService, ColorScheme, InvalidWithValueStateMatcher$1 as InvalidWithValueStateMatcher, LOCAL_STORAGE, NATURAL_DROPDOWN_DATA, NATURAL_ICONS_CONFIG, NATURAL_PERSISTENCE_VALIDATOR, NATURAL_SEO_CONFIG, NaturalAbstractDetail, NaturalAbstractEditableList, NaturalAbstractList, NaturalAbstractModelService, NaturalAbstractNavigableList, NaturalAbstractPanel, NaturalAlertService, NaturalAvatarComponent, NaturalBackgroundDensityDirective, NaturalCapitalizePipe, NaturalColorSchemerComponent, NaturalColumnsPickerComponent, NaturalCompactColorSchemerComponent, NaturalConfirmComponent, NaturalDataSource, NaturalDebounceService, NaturalDetailHeaderComponent, NaturalDialogTriggerComponent, NaturalDropdownRef, NaturalEllipsisPipe, NaturalEnumPipe, NaturalEnumService, NaturalErrorHandler, NaturalErrorMessagePipe, NaturalFileComponent, NaturalFileDropDirective, NaturalFileSelectDirective, NaturalFileService, NaturalFixedButtonComponent, NaturalFixedButtonDetailComponent, NaturalHierarchicSelectorComponent, NaturalHierarchicSelectorDialogComponent, NaturalHierarchicSelectorDialogService, NaturalHierarchicSelectorService, NaturalHttpPrefixDirective, NaturalIconDirective, NaturalLinkMutationService, NaturalLinkableTabDirective, NaturalLoggerConfigExtra, NaturalLoggerConfigUrl, NaturalMatomoService, NaturalMemoryStorage, NaturalPanelsComponent, NaturalPanelsService, NaturalPersistenceService, NaturalQueryVariablesManager, NaturalRelationsComponent, NaturalSearchComponent, NaturalSelectComponent, NaturalSelectEnumComponent, NaturalSelectHierarchicComponent, NaturalSeoService, NaturalSidenavComponent, NaturalSidenavContainerComponent, NaturalSidenavContentComponent, NaturalSidenavService, NaturalSidenavStackService, NaturalSrcDensityDirective, NaturalStampComponent, NaturalSwissParsingDateAdapter, NaturalTableButtonComponent, NaturalThemeChangerComponent, NaturalThemeService, NaturalTimeAgoPipe, NetworkActivityService, PanelsHooksConfig, SESSION_STORAGE, SortingOrder, TypeBooleanComponent, TypeDateComponent, TypeDateRangeComponent, TypeHierarchicSelectorComponent, TypeNaturalSelectComponent, TypeNumberComponent, TypeOptionsComponent, TypeSelectComponent, TypeTextComponent, TypedMatCellDef, activityInterceptor, available, cancellableTimeout, cloneDeepButSkipFile, collectErrors, commonImageMimeTypes, copyToClipboard, createHttpLink, debug, decimal, deepFreeze, deliverableEmail, ensureHttpPrefix, fallbackIfNoOpenedPanels, formatIsoDate, formatIsoDateTime, fromUrl, getForegroundColor, graphqlQuerySigner, greaterThan, hasFilesAndProcessDate, ifValid, integer, isFile, localStorageFactory, localStorageProvider, makePlural, memoryLocalStorageProvider, memorySessionStorageProvider, mergeOverrideArray, money, naturalPanelsUrlMatcher, naturalProviders, nfcCardHex, onHistoryEvent, possibleComparableOperators, possibleNullComparableOperators, provideErrorHandler, provideIcons, providePanels, provideSeo, provideThemes, relationsToIds, replaceObjectKeepingReference, replaceOperatorByField, replaceOperatorByName, rgbToHex, sessionStorageFactory, sessionStorageProvider, time, toGraphQLDoctrineFilter, toNavigationParameters, toUrl, unique, upperCaseFirstLetter, url, urlPattern, validTlds, validateAllFormControls, validateColumns, validatePagination, validateSorting, wrapLike, wrapPrefix, wrapSuffix };
|
|
11529
11585
|
//# sourceMappingURL=ecodev-natural.mjs.map
|