@ecodev/natural 66.0.13 → 66.0.15

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/README.md CHANGED
@@ -4,7 +4,6 @@
4
4
  [![Total Downloads](https://img.shields.io/npm/dt/@ecodev/natural.svg)](https://www.npmjs.com/package/@ecodev/natural)
5
5
  [![Latest Stable Version](https://img.shields.io/npm/v/@ecodev/natural.svg)](https://www.npmjs.com/package/@ecodev/natural)
6
6
  [![License](https://img.shields.io/npm/l/@ecodev/natural.svg)](https://www.npmjs.com/package/@ecodev/natural)
7
- [![Join the chat at https://gitter.im/Ecodev/natural](https://badges.gitter.im/Ecodev/natural.svg)](https://gitter.im/Ecodev/natural)
8
7
 
9
8
  This project is a collection of Angular Material components and various utilities classes for Angular projects.
10
9
 
@@ -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, 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';
@@ -196,17 +196,18 @@ function formatIsoDateTime(date) {
196
196
  const timezoneOffsetInMinutes = Math.round(date.getTimezoneOffset());
197
197
  const timezoneOffsetInHours = -Math.trunc(timezoneOffsetInMinutes / 60); // UTC minus local time
198
198
  const sign = timezoneOffsetInHours >= 0 ? '+' : '-';
199
- const remainderMinutes = -(timezoneOffsetInMinutes % 60);
199
+ const remainderMinutes = -timezoneOffsetInMinutes % 60;
200
200
  // It's a bit unfortunate that we need to construct a new Date instance,
201
201
  // but we don't want the original Date instance to be modified
202
202
  const correctedDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
203
203
  correctedDate.setHours(date.getHours() + timezoneOffsetInHours);
204
+ correctedDate.setMinutes(date.getMinutes() + remainderMinutes);
204
205
  const iso = correctedDate
205
206
  .toISOString()
206
207
  .replace(/\.\d{3}Z/, '')
207
208
  .replace('Z', '');
208
209
  const hours = Math.abs(timezoneOffsetInHours).toString().padStart(2, '0');
209
- const minutes = remainderMinutes.toString().padStart(2, '0');
210
+ const minutes = Math.abs(remainderMinutes).toString().padStart(2, '0');
210
211
  return iso + sign + hours + ':' + minutes;
211
212
  }
212
213
  /**
@@ -5329,8 +5330,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImpor
5329
5330
  }] });
5330
5331
 
5331
5332
  const NATURAL_THEMES_CONFIG = new InjectionToken('Configuration for Natural Theme');
5333
+ /**
5334
+ * If you are using themes, or color scheme, then you must provide themes at the application level.
5335
+ *
5336
+ * If there is a only one theme, you still need to provide a name for it (eg: "my-app"), even if
5337
+ * it is not used in the SCSS.
5338
+ */
5332
5339
  function provideThemes(config) {
5333
- return [
5340
+ return makeEnvironmentProviders([
5334
5341
  {
5335
5342
  provide: NATURAL_THEMES_CONFIG,
5336
5343
  useValue: config,
@@ -5338,7 +5345,7 @@ function provideThemes(config) {
5338
5345
  provideAppInitializer(() => {
5339
5346
  inject(NaturalThemeService);
5340
5347
  }),
5341
- ];
5348
+ ]);
5342
5349
  }
5343
5350
  var ColorScheme;
5344
5351
  (function (ColorScheme) {
@@ -5346,11 +5353,22 @@ var ColorScheme;
5346
5353
  ColorScheme["Dark"] = "dark";
5347
5354
  ColorScheme["Auto"] = "auto";
5348
5355
  })(ColorScheme || (ColorScheme = {}));
5356
+ const colorSchemeOptions = [
5357
+ { value: ColorScheme.Auto, label: $localize `Thème de l'appareil`, icon: 'routine' },
5358
+ { value: ColorScheme.Light, label: $localize `Thème clair`, icon: 'light_mode' },
5359
+ { value: ColorScheme.Dark, label: $localize `Thème sombre`, icon: 'dark_mode' },
5360
+ ];
5361
+ /**
5362
+ * The source of truth is the DOM. And thus the index.html (or equivalent) must use vanilla JavaScript
5363
+ * to restore `data-color-scheme` and `data-theme` attributes on the `<html>` element (eg: from
5364
+ * local storage, or from DB).
5365
+ */
5349
5366
  class NaturalThemeService {
5350
5367
  allThemes = inject(NATURAL_THEMES_CONFIG);
5351
5368
  storage = inject(LOCAL_STORAGE);
5352
5369
  platformId = inject(PLATFORM_ID);
5353
5370
  document = inject(DOCUMENT);
5371
+ htmlElement = this.document.documentElement;
5354
5372
  isDarkSystem = toSignal(isPlatformBrowser(this.platformId)
5355
5373
  ? 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))
5356
5374
  : of(false), { initialValue: false });
@@ -5369,28 +5387,28 @@ class NaturalThemeService {
5369
5387
  colorScheme = this._colorScheme.asReadonly();
5370
5388
  constructor() {
5371
5389
  effect(() => {
5372
- this.document.documentElement.setAttribute('data-is-dark', this.isDark() ? 'true' : 'false');
5390
+ this.htmlElement.setAttribute('data-is-dark', this.isDark() ? 'true' : 'false');
5373
5391
  });
5374
5392
  const storedScheme = this.storage.getItem('color-scheme');
5375
5393
  const isValidScheme = storedScheme && Object.values(ColorScheme).includes(storedScheme);
5376
5394
  this._colorScheme.set(isValidScheme ? storedScheme : ColorScheme.Auto);
5377
5395
  }
5378
5396
  /**
5379
- * Set theme in memory, local storage and dom
5397
+ * Set theme in memory and dom
5380
5398
  */
5381
5399
  setTheme(theme) {
5382
5400
  if (!this.allThemes.includes(theme)) {
5383
5401
  throw new Error(`Expecting one of the configured themes: ${this.allThemes.map(t => `'${t}'`).join(', ')}. But got invalid: '${theme}'`);
5384
5402
  }
5385
5403
  this._theme.set(theme);
5386
- this.document.documentElement.setAttribute('data-theme', theme);
5404
+ this.htmlElement.setAttribute('data-theme', theme);
5387
5405
  }
5388
5406
  /**
5389
5407
  * Set dark/light/auto
5390
5408
  */
5391
5409
  setColorScheme(scheme, persistInStorage = true) {
5392
5410
  this._colorScheme.set(scheme); // memory
5393
- this.document.documentElement.setAttribute('data-color-scheme', scheme); // dom
5411
+ this.htmlElement.setAttribute('data-color-scheme', scheme); // dom
5394
5412
  if (persistInStorage) {
5395
5413
  this.storage.setItem('color-scheme', this.colorScheme()); // storage
5396
5414
  }
@@ -9393,7 +9411,7 @@ class NaturalFileComponent {
9393
9411
  return subject.asObservable();
9394
9412
  }
9395
9413
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: NaturalFileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
9396
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.7", type: NaturalFileComponent, isStandalone: true, selector: "natural-file", inputs: { height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, action: { classPropertyName: "action", publicName: "action", isSignal: true, isRequired: false, transformFunction: null }, backgroundSize: { classPropertyName: "backgroundSize", publicName: "backgroundSize", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, uploader: { classPropertyName: "uploader", publicName: "uploader", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: false, isRequired: false, transformFunction: null }, formCtrl: { classPropertyName: "formCtrl", publicName: "formCtrl", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { modelChange: "modelChange" }, host: { properties: { "style.height.px": "height()" } }, usesOnChanges: true, ngImport: i0, template: "<a\n naturalFileDrop\n matRipple\n target=\"_blank\"\n [selectable]=\"true\"\n [accept]=\"accept()\"\n [attr.href]=\"getDownloadLink()\"\n [class.has-action]=\"!!action()\"\n [class.suggest-upload]=\"!model && action() === 'upload'\"\n [fileSelectionDisabled]=\"action() !== 'upload'\"\n [matRippleDisabled]=\"!action()\"\n [naturalBackgroundDensity]=\"imagePreview\"\n [style.backgroundSize]=\"backgroundSize()\"\n (fileChange)=\"upload($event)\"\n>\n @if (filePreview) {\n <div class=\"file-preview\" [style.font-size.px]=\"fontSize()\">\n <mat-icon naturalIcon=\"attachment\" [size]=\"iconHeight()\" />\n {{ filePreview | uppercase }}\n </div>\n }\n\n <div class=\"action-overlay\" [style.font-size.px]=\"fontSize()\">\n @if (action() === 'upload') {\n <mat-icon naturalIcon=\"cloud_upload\" [size]=\"iconHeight()\" />\n }\n @if (action() === 'download') {\n <mat-icon naturalIcon=\"get_app\" [size]=\"iconHeight()\" />\n }\n {{ action() | capitalize }}\n </div>\n</a>\n", styles: [":host{display:flex;position:relative;flex-direction:row;border-color:var(--mat-sys-secondary-container);background-color:var(--mat-sys-secondary-container);overflow:hidden}:host>a{position:relative;flex:1;background-position:center;background-repeat:no-repeat;background-color:var(--mat-sys-surface-container-lowest)}:host>a.has-action{cursor:pointer}:host>a.has-action.suggest-upload .action-overlay{opacity:.66}:host>a.has-action:hover .action-overlay,:host>a.has-action.natural-file-over .action-overlay{opacity:1}:host .action-overlay,:host .file-preview{display:flex;position:absolute;inset:0;flex-direction:column;justify-content:center;align-items:center;font-size:36px;line-height:1.3em;text-align:center}:host a[naturalFileDrop]{border:1px dashed var(--mat-sys-secondary-container)}:host .action-overlay,:host .file-preview{background-color:var(--mat-sys-secondary-fixed);color:var(--mat-sys-on-secondary-fixed)}:host .action-overlay{opacity:0}:host .action-overlay>div{display:flex;position:absolute;inset:0;justify-content:center;align-items:center;opacity:0}\n"], dependencies: [{ kind: "directive", type: NaturalFileDropDirective, selector: ":not([naturalFileSelect])[naturalFileDrop]", outputs: ["fileOver"] }, { kind: "directive", type: MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { 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: "directive", type: NaturalBackgroundDensityDirective, selector: "[naturalBackgroundDensity]", inputs: ["naturalBackgroundDensity"] }, { kind: "pipe", type: UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: NaturalCapitalizePipe, name: "capitalize" }] });
9414
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.7", type: NaturalFileComponent, isStandalone: true, selector: "natural-file", inputs: { height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, action: { classPropertyName: "action", publicName: "action", isSignal: true, isRequired: false, transformFunction: null }, backgroundSize: { classPropertyName: "backgroundSize", publicName: "backgroundSize", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, uploader: { classPropertyName: "uploader", publicName: "uploader", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: false, isRequired: false, transformFunction: null }, formCtrl: { classPropertyName: "formCtrl", publicName: "formCtrl", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { modelChange: "modelChange" }, host: { properties: { "style.height.px": "height()" } }, usesOnChanges: true, ngImport: i0, template: "<a\n naturalFileDrop\n matRipple\n target=\"_blank\"\n [selectable]=\"true\"\n [accept]=\"accept()\"\n [attr.href]=\"getDownloadLink()\"\n [class.has-action]=\"!!action()\"\n [class.suggest-upload]=\"!model && action() === 'upload'\"\n [fileSelectionDisabled]=\"action() !== 'upload'\"\n [matRippleDisabled]=\"!action()\"\n [naturalBackgroundDensity]=\"imagePreview\"\n [style.backgroundSize]=\"backgroundSize()\"\n (fileChange)=\"upload($event)\"\n>\n @if (filePreview) {\n <div class=\"file-preview\" [style.font-size.px]=\"fontSize()\">\n <mat-icon naturalIcon=\"attachment\" [size]=\"iconHeight()\" />\n {{ filePreview | uppercase }}\n </div>\n }\n\n <div class=\"action-overlay\" [style.font-size.px]=\"fontSize()\">\n @if (action() === 'upload') {\n <mat-icon naturalIcon=\"cloud_upload\" [size]=\"iconHeight()\" />\n }\n @if (action() === 'download') {\n <mat-icon naturalIcon=\"get_app\" [size]=\"iconHeight()\" />\n }\n {{ action() | capitalize }}\n </div>\n</a>\n", styles: [":host{display:flex;position:relative;flex-direction:row;border-color:var(--mat-sys-secondary-container);background-color:var(--mat-sys-secondary-container);overflow:hidden}:host>a{position:relative;flex:1;background-position:center;background-repeat:no-repeat;background-color:var(--mat-sys-surface-container-lowest)}:host>a.has-action{cursor:pointer}:host>a.has-action.suggest-upload .action-overlay{opacity:.66}:host>a.has-action:hover .action-overlay,:host>a.has-action.natural-file-over .action-overlay{opacity:1}:host .action-overlay,:host .file-preview{display:flex;position:absolute;inset:0;flex-direction:column;justify-content:center;align-items:center;font-size:36px;line-height:1.3em;text-align:center}:host .action-overlay{background-color:color-mix(in srgb,var(--mat-sys-primary-fixed) 85%,transparent);color:var(--mat-sys-on-primary-fixed)}:host .file-preview{background-color:color-mix(in srgb,var(--mat-sys-tertiary-fixed) 85%,transparent);color:var(--mat-sys-on-tertiary-fixed)}:host .action-overlay{opacity:0}:host .action-overlay>div{display:flex;position:absolute;inset:0;justify-content:center;align-items:center;opacity:0}\n"], dependencies: [{ kind: "directive", type: NaturalFileDropDirective, selector: ":not([naturalFileSelect])[naturalFileDrop]", outputs: ["fileOver"] }, { kind: "directive", type: MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { 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: "directive", type: NaturalBackgroundDensityDirective, selector: "[naturalBackgroundDensity]", inputs: ["naturalBackgroundDensity"] }, { kind: "pipe", type: UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: NaturalCapitalizePipe, name: "capitalize" }] });
9397
9415
  }
9398
9416
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: NaturalFileComponent, decorators: [{
9399
9417
  type: Component,
@@ -9407,7 +9425,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImpor
9407
9425
  NaturalBackgroundDensityDirective,
9408
9426
  ], host: {
9409
9427
  '[style.height.px]': 'height()',
9410
- }, template: "<a\n naturalFileDrop\n matRipple\n target=\"_blank\"\n [selectable]=\"true\"\n [accept]=\"accept()\"\n [attr.href]=\"getDownloadLink()\"\n [class.has-action]=\"!!action()\"\n [class.suggest-upload]=\"!model && action() === 'upload'\"\n [fileSelectionDisabled]=\"action() !== 'upload'\"\n [matRippleDisabled]=\"!action()\"\n [naturalBackgroundDensity]=\"imagePreview\"\n [style.backgroundSize]=\"backgroundSize()\"\n (fileChange)=\"upload($event)\"\n>\n @if (filePreview) {\n <div class=\"file-preview\" [style.font-size.px]=\"fontSize()\">\n <mat-icon naturalIcon=\"attachment\" [size]=\"iconHeight()\" />\n {{ filePreview | uppercase }}\n </div>\n }\n\n <div class=\"action-overlay\" [style.font-size.px]=\"fontSize()\">\n @if (action() === 'upload') {\n <mat-icon naturalIcon=\"cloud_upload\" [size]=\"iconHeight()\" />\n }\n @if (action() === 'download') {\n <mat-icon naturalIcon=\"get_app\" [size]=\"iconHeight()\" />\n }\n {{ action() | capitalize }}\n </div>\n</a>\n", styles: [":host{display:flex;position:relative;flex-direction:row;border-color:var(--mat-sys-secondary-container);background-color:var(--mat-sys-secondary-container);overflow:hidden}:host>a{position:relative;flex:1;background-position:center;background-repeat:no-repeat;background-color:var(--mat-sys-surface-container-lowest)}:host>a.has-action{cursor:pointer}:host>a.has-action.suggest-upload .action-overlay{opacity:.66}:host>a.has-action:hover .action-overlay,:host>a.has-action.natural-file-over .action-overlay{opacity:1}:host .action-overlay,:host .file-preview{display:flex;position:absolute;inset:0;flex-direction:column;justify-content:center;align-items:center;font-size:36px;line-height:1.3em;text-align:center}:host a[naturalFileDrop]{border:1px dashed var(--mat-sys-secondary-container)}:host .action-overlay,:host .file-preview{background-color:var(--mat-sys-secondary-fixed);color:var(--mat-sys-on-secondary-fixed)}:host .action-overlay{opacity:0}:host .action-overlay>div{display:flex;position:absolute;inset:0;justify-content:center;align-items:center;opacity:0}\n"] }]
9428
+ }, template: "<a\n naturalFileDrop\n matRipple\n target=\"_blank\"\n [selectable]=\"true\"\n [accept]=\"accept()\"\n [attr.href]=\"getDownloadLink()\"\n [class.has-action]=\"!!action()\"\n [class.suggest-upload]=\"!model && action() === 'upload'\"\n [fileSelectionDisabled]=\"action() !== 'upload'\"\n [matRippleDisabled]=\"!action()\"\n [naturalBackgroundDensity]=\"imagePreview\"\n [style.backgroundSize]=\"backgroundSize()\"\n (fileChange)=\"upload($event)\"\n>\n @if (filePreview) {\n <div class=\"file-preview\" [style.font-size.px]=\"fontSize()\">\n <mat-icon naturalIcon=\"attachment\" [size]=\"iconHeight()\" />\n {{ filePreview | uppercase }}\n </div>\n }\n\n <div class=\"action-overlay\" [style.font-size.px]=\"fontSize()\">\n @if (action() === 'upload') {\n <mat-icon naturalIcon=\"cloud_upload\" [size]=\"iconHeight()\" />\n }\n @if (action() === 'download') {\n <mat-icon naturalIcon=\"get_app\" [size]=\"iconHeight()\" />\n }\n {{ action() | capitalize }}\n </div>\n</a>\n", styles: [":host{display:flex;position:relative;flex-direction:row;border-color:var(--mat-sys-secondary-container);background-color:var(--mat-sys-secondary-container);overflow:hidden}:host>a{position:relative;flex:1;background-position:center;background-repeat:no-repeat;background-color:var(--mat-sys-surface-container-lowest)}:host>a.has-action{cursor:pointer}:host>a.has-action.suggest-upload .action-overlay{opacity:.66}:host>a.has-action:hover .action-overlay,:host>a.has-action.natural-file-over .action-overlay{opacity:1}:host .action-overlay,:host .file-preview{display:flex;position:absolute;inset:0;flex-direction:column;justify-content:center;align-items:center;font-size:36px;line-height:1.3em;text-align:center}:host .action-overlay{background-color:color-mix(in srgb,var(--mat-sys-primary-fixed) 85%,transparent);color:var(--mat-sys-on-primary-fixed)}:host .file-preview{background-color:color-mix(in srgb,var(--mat-sys-tertiary-fixed) 85%,transparent);color:var(--mat-sys-on-tertiary-fixed)}:host .action-overlay{opacity:0}:host .action-overlay>div{display:flex;position:absolute;inset:0;justify-content:center;align-items:center;opacity:0}\n"] }]
9411
9429
  }], propDecorators: { height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], action: [{ type: i0.Input, args: [{ isSignal: true, alias: "action", required: false }] }], backgroundSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "backgroundSize", required: false }] }], accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], uploader: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploader", required: false }] }], model: [{
9412
9430
  type: Input
9413
9431
  }], formCtrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "formCtrl", required: false }] }], modelChange: [{ type: i0.Output, args: ["modelChange"] }] } });
@@ -11374,13 +11392,29 @@ function provideErrorHandler(url, extraService) {
11374
11392
 
11375
11393
  class NaturalColorSchemerComponent {
11376
11394
  themeService = inject(NaturalThemeService);
11377
- ColorScheme = ColorScheme;
11395
+ colorSchemeOptions = colorSchemeOptions;
11378
11396
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: NaturalColorSchemerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
11379
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.7", type: NaturalColorSchemerComponent, isStandalone: true, selector: "natural-color-schemer", ngImport: i0, template: "<div class=\"nat-horizontal wrapper\">\n <button\n matIconButton\n matTooltip=\"Th\u00E8me de l'appareil\"\n i18n-matTooltip\n matTooltipPosition=\"below\"\n (click)=\"themeService.setColorScheme(ColorScheme.Auto)\"\n >\n <mat-icon naturalIcon=\"routine\" />\n </button>\n <button\n matIconButton\n matTooltip=\"Th\u00E8me clair\"\n i18n-matTooltip\n matTooltipPosition=\"below\"\n (click)=\"themeService.setColorScheme(ColorScheme.Light)\"\n >\n <mat-icon naturalIcon=\"light_mode\" />\n </button>\n <button\n matIconButton\n matTooltip=\"Th\u00E8me sombre\"\n i18n-matTooltip\n matTooltipPosition=\"below\"\n (click)=\"themeService.setColorScheme(ColorScheme.Dark)\"\n >\n <mat-icon naturalIcon=\"dark_mode\" />\n </button>\n</div>\n", styles: [":host{display:block;width:fit-content}.wrapper{border-radius:var(--mat-sys-corner-full);background:var(--mat-sys-surface-bright);padding:5px}\n"], dependencies: [{ 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: "directive", type: NaturalIconDirective, selector: "mat-icon[naturalIcon]", inputs: ["naturalIcon", "size"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
11397
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.7", type: NaturalColorSchemerComponent, isStandalone: true, selector: "natural-color-schemer", ngImport: i0, template: "<div class=\"nat-horizontal wrapper\">\n @for (option of colorSchemeOptions; track $index) {\n <button\n matIconButton\n matTooltipPosition=\"below\"\n i18n-matTooltip\n [matTooltip]=\"option.label\"\n (click)=\"themeService.setColorScheme(option.value)\"\n >\n <mat-icon [fontIcon]=\"option.icon\" />\n </button>\n }\n</div>\n", styles: [":host{display:block;width:fit-content}.wrapper{border-radius:var(--mat-sys-corner-full);background:var(--mat-sys-surface-bright);padding:5px}\n"], dependencies: [{ 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
11380
11398
  }
11381
11399
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: NaturalColorSchemerComponent, decorators: [{
11382
11400
  type: Component,
11383
- args: [{ selector: 'natural-color-schemer', imports: [MatIconButton, MatTooltip, NaturalIconDirective, FormsModule, MatIcon], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"nat-horizontal wrapper\">\n <button\n matIconButton\n matTooltip=\"Th\u00E8me de l'appareil\"\n i18n-matTooltip\n matTooltipPosition=\"below\"\n (click)=\"themeService.setColorScheme(ColorScheme.Auto)\"\n >\n <mat-icon naturalIcon=\"routine\" />\n </button>\n <button\n matIconButton\n matTooltip=\"Th\u00E8me clair\"\n i18n-matTooltip\n matTooltipPosition=\"below\"\n (click)=\"themeService.setColorScheme(ColorScheme.Light)\"\n >\n <mat-icon naturalIcon=\"light_mode\" />\n </button>\n <button\n matIconButton\n matTooltip=\"Th\u00E8me sombre\"\n i18n-matTooltip\n matTooltipPosition=\"below\"\n (click)=\"themeService.setColorScheme(ColorScheme.Dark)\"\n >\n <mat-icon naturalIcon=\"dark_mode\" />\n </button>\n</div>\n", styles: [":host{display:block;width:fit-content}.wrapper{border-radius:var(--mat-sys-corner-full);background:var(--mat-sys-surface-bright);padding:5px}\n"] }]
11401
+ args: [{ selector: 'natural-color-schemer', imports: [MatIconButton, MatTooltip, MatIcon], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"nat-horizontal wrapper\">\n @for (option of colorSchemeOptions; track $index) {\n <button\n matIconButton\n matTooltipPosition=\"below\"\n i18n-matTooltip\n [matTooltip]=\"option.label\"\n (click)=\"themeService.setColorScheme(option.value)\"\n >\n <mat-icon [fontIcon]=\"option.icon\" />\n </button>\n }\n</div>\n", styles: [":host{display:block;width:fit-content}.wrapper{border-radius:var(--mat-sys-corner-full);background:var(--mat-sys-surface-bright);padding:5px}\n"] }]
11402
+ }] });
11403
+
11404
+ /*
11405
+ * Public API Surface of natural
11406
+ */
11407
+
11408
+ class NaturalCompactColorSchemerComponent {
11409
+ themeService = inject(NaturalThemeService);
11410
+ colorSchemeOptions = colorSchemeOptions;
11411
+ current = computed(() => colorSchemeOptions.find(choice => this.themeService.colorScheme() === choice.value), ...(ngDevMode ? [{ debugName: "current" }] : []));
11412
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: NaturalCompactColorSchemerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
11413
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.7", type: NaturalCompactColorSchemerComponent, isStandalone: true, selector: "natural-compact-color-schemer", ngImport: i0, template: "<button\n matIconButton\n matTooltipPosition=\"below\"\n i18n-matTooltip\n [matTooltip]=\"current()?.label\"\n [matMenuTriggerFor]=\"menu\"\n ><mat-icon [fontIcon]=\"current()?.icon ?? ''\"\n/></button>\n<mat-menu #menu=\"matMenu\">\n @for (option of colorSchemeOptions; track $index) {\n <button mat-menu-item (click)=\"themeService.setColorScheme(option.value)\">\n <mat-icon [fontIcon]=\"themeService.colorScheme() === option.value ? 'check' : ''\" />\n {{ option.label }}</button\n >\n }\n</mat-menu>\n", dependencies: [{ 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: "component", type: MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
11414
+ }
11415
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: NaturalCompactColorSchemerComponent, decorators: [{
11416
+ type: Component,
11417
+ args: [{ selector: 'natural-compact-color-schemer', imports: [MatIconButton, MatTooltip, MatIcon, MatMenu, MatMenuItem, MatMenuTrigger], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n matIconButton\n matTooltipPosition=\"below\"\n i18n-matTooltip\n [matTooltip]=\"current()?.label\"\n [matMenuTriggerFor]=\"menu\"\n ><mat-icon [fontIcon]=\"current()?.icon ?? ''\"\n/></button>\n<mat-menu #menu=\"matMenu\">\n @for (option of colorSchemeOptions; track $index) {\n <button mat-menu-item (click)=\"themeService.setColorScheme(option.value)\">\n <mat-icon [fontIcon]=\"themeService.colorScheme() === option.value ? 'check' : ''\" />\n {{ option.label }}</button\n >\n }\n</mat-menu>\n" }]
11384
11418
  }] });
11385
11419
 
11386
11420
  /*
@@ -11452,7 +11486,6 @@ const naturalProviders = [
11452
11486
  importProvidersFrom([MatDialogModule, MatSnackBarModule]),
11453
11487
  sessionStorageProvider,
11454
11488
  localStorageProvider,
11455
- provideThemes(['natural']),
11456
11489
  ];
11457
11490
 
11458
11491
  function getOperations(req) {
@@ -11505,5 +11538,5 @@ function graphqlQuerySigner(key) {
11505
11538
  * Generated bundle index. Do not edit.
11506
11539
  */
11507
11540
 
11508
- 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, 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 };
11541
+ 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 };
11509
11542
  //# sourceMappingURL=ecodev-natural.mjs.map