@bizy/core 19.0.24 → 19.0.26

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.
Files changed (113) hide show
  1. package/fesm2022/bizy-core.mjs +665 -563
  2. package/fesm2022/bizy-core.mjs.map +1 -1
  3. package/lib/directives/directives.module.d.ts +15 -0
  4. package/lib/directives/index.d.ts +1 -0
  5. package/lib/{components → modules}/index.d.ts +3 -0
  6. package/lib/{services → modules}/popup/index.d.ts +2 -1
  7. package/lib/modules/popup/popup.module.d.ts +7 -0
  8. package/lib/{services → modules}/popup/popup.service.d.ts +0 -1
  9. package/lib/{services → modules}/toast/index.d.ts +1 -0
  10. package/lib/modules/toast/toast.module.d.ts +7 -0
  11. package/lib/{services → modules}/translate/index.d.ts +1 -0
  12. package/lib/{services → modules}/translate/translate.module.d.ts +2 -2
  13. package/lib/{pipes → modules/translate}/translate.pipe.d.ts +1 -1
  14. package/lib/{services → modules}/translate/translate.service.d.ts +3 -3
  15. package/lib/pipes/index.d.ts +1 -1
  16. package/lib/pipes/pipes.module.d.ts +16 -0
  17. package/lib/services/index.d.ts +0 -4
  18. package/package.json +1 -1
  19. package/public-api.d.ts +1 -1
  20. /package/lib/{components → modules}/accordion/accordion.component.d.ts +0 -0
  21. /package/lib/{components → modules}/accordion/index.d.ts +0 -0
  22. /package/lib/{components → modules}/bar-line-chart/bar-line-chart.component.d.ts +0 -0
  23. /package/lib/{components → modules}/bar-line-chart/bar-line-chart.types.d.ts +0 -0
  24. /package/lib/{components → modules}/bar-line-chart/index.d.ts +0 -0
  25. /package/lib/{components → modules}/breadcrumb/breadcrumb.component.d.ts +0 -0
  26. /package/lib/{components → modules}/breadcrumb/breadcrumb.types.d.ts +0 -0
  27. /package/lib/{components → modules}/breadcrumb/index.d.ts +0 -0
  28. /package/lib/{components → modules}/button/button.component.d.ts +0 -0
  29. /package/lib/{components → modules}/button/index.d.ts +0 -0
  30. /package/lib/{components → modules}/calendar/calendar.component.d.ts +0 -0
  31. /package/lib/{components → modules}/calendar/calendar.formatter.d.ts +0 -0
  32. /package/lib/{components → modules}/calendar/calendar.types.d.ts +0 -0
  33. /package/lib/{components → modules}/calendar/index.d.ts +0 -0
  34. /package/lib/{components → modules}/card/card.component.d.ts +0 -0
  35. /package/lib/{components → modules}/card/index.d.ts +0 -0
  36. /package/lib/{components → modules}/checkbox/checkbox.component.d.ts +0 -0
  37. /package/lib/{components → modules}/checkbox/index.d.ts +0 -0
  38. /package/lib/{components → modules}/date-picker/date-picker.component.d.ts +0 -0
  39. /package/lib/{components → modules}/date-picker/index.d.ts +0 -0
  40. /package/lib/{components → modules}/file-uploader/file-uploader.component.d.ts +0 -0
  41. /package/lib/{components → modules}/file-uploader/file-uploader.service.d.ts +0 -0
  42. /package/lib/{components → modules}/file-uploader/index.d.ts +0 -0
  43. /package/lib/{components → modules}/filter/filter-content/filter-content.component.d.ts +0 -0
  44. /package/lib/{components → modules}/filter/filter-section/filter-section.component.d.ts +0 -0
  45. /package/lib/{components → modules}/filter/filter-section-checkbox-option/filter-section-checkbox-option.component.d.ts +0 -0
  46. /package/lib/{components → modules}/filter/filter-section-range-option/filter-section-range-option.component.d.ts +0 -0
  47. /package/lib/{components → modules}/filter/filter-section-search-option/filter-section-search-option.component.d.ts +0 -0
  48. /package/lib/{components → modules}/filter/filter-sections/filter-sections.component.d.ts +0 -0
  49. /package/lib/{components → modules}/filter/filter.component.d.ts +0 -0
  50. /package/lib/{components → modules}/filter/index.d.ts +0 -0
  51. /package/lib/{components → modules}/filter/pipes/filter.pipe.d.ts +0 -0
  52. /package/lib/{components → modules}/filter/pipes/index.d.ts +0 -0
  53. /package/lib/{components → modules}/filter/pipes/range-filter.pipe.d.ts +0 -0
  54. /package/lib/{components → modules}/form/form.component.d.ts +0 -0
  55. /package/lib/{components → modules}/form/index.d.ts +0 -0
  56. /package/lib/{components → modules}/grid/grid-row/grid-row.component.d.ts +0 -0
  57. /package/lib/{components → modules}/grid/grid.component.d.ts +0 -0
  58. /package/lib/{components → modules}/grid/grid.directive.d.ts +0 -0
  59. /package/lib/{components → modules}/grid/index.d.ts +0 -0
  60. /package/lib/{components → modules}/input/index.d.ts +0 -0
  61. /package/lib/{components → modules}/input/input-option/input-option.component.d.ts +0 -0
  62. /package/lib/{components → modules}/input/input.component.d.ts +0 -0
  63. /package/lib/{components → modules}/list/index.d.ts +0 -0
  64. /package/lib/{components → modules}/list/list.component.d.ts +0 -0
  65. /package/lib/{components → modules}/menu/index.d.ts +0 -0
  66. /package/lib/{components → modules}/menu/menu-option/menu-option.component.d.ts +0 -0
  67. /package/lib/{components → modules}/menu/menu-title/menu-title.component.d.ts +0 -0
  68. /package/lib/{components → modules}/menu/menu.component.d.ts +0 -0
  69. /package/lib/{components → modules}/pie-chart/index.d.ts +0 -0
  70. /package/lib/{components → modules}/pie-chart/pie-chart.component.d.ts +0 -0
  71. /package/lib/{components → modules}/pie-chart/pie-chart.types.d.ts +0 -0
  72. /package/lib/{services → modules}/popup/popup-wrapper/popup-wrapper.component.d.ts +0 -0
  73. /package/lib/{services → modules}/popup/popup.types.d.ts +0 -0
  74. /package/lib/{components → modules}/radio/index.d.ts +0 -0
  75. /package/lib/{components → modules}/radio/radio.component.d.ts +0 -0
  76. /package/lib/{components → modules}/select/index.d.ts +0 -0
  77. /package/lib/{components → modules}/select/select-option/select-option.component.d.ts +0 -0
  78. /package/lib/{components → modules}/select/select.component.d.ts +0 -0
  79. /package/lib/{components → modules}/sidebar/index.d.ts +0 -0
  80. /package/lib/{components → modules}/sidebar/sidebar-floating-option/sidebar-floating-option.component.d.ts +0 -0
  81. /package/lib/{components → modules}/sidebar/sidebar-floating-option-title/sidebar-floating-option-title.component.d.ts +0 -0
  82. /package/lib/{components → modules}/sidebar/sidebar-option/sidebar-option.component.d.ts +0 -0
  83. /package/lib/{components → modules}/sidebar/sidebar.component.d.ts +0 -0
  84. /package/lib/{components → modules}/skeleton/index.d.ts +0 -0
  85. /package/lib/{components → modules}/skeleton/skeleton.component.d.ts +0 -0
  86. /package/lib/{components → modules}/skeleton/skeleton.types.d.ts +0 -0
  87. /package/lib/{components → modules}/slider/index.d.ts +0 -0
  88. /package/lib/{components → modules}/slider/slider.component.d.ts +0 -0
  89. /package/lib/{components → modules}/table/directives/index.d.ts +0 -0
  90. /package/lib/{components → modules}/table/directives/table-column-fixed.directive.d.ts +0 -0
  91. /package/lib/{components → modules}/table/index.d.ts +0 -0
  92. /package/lib/{components → modules}/table/table-column/table-column.component.d.ts +0 -0
  93. /package/lib/{components → modules}/table/table-column-arrows/table-column-arrows.component.d.ts +0 -0
  94. /package/lib/{components → modules}/table/table-footer/table-footer.component.d.ts +0 -0
  95. /package/lib/{components → modules}/table/table-header/table-header.component.d.ts +0 -0
  96. /package/lib/{components → modules}/table/table-row/table-row.component.d.ts +0 -0
  97. /package/lib/{components → modules}/table/table-row-expand-content/table-row-expand-content.component.d.ts +0 -0
  98. /package/lib/{components → modules}/table/table-scrolling/table-scrolling.component.d.ts +0 -0
  99. /package/lib/{components → modules}/table/table-scrolling/table-scrolling.directive.d.ts +0 -0
  100. /package/lib/{components → modules}/table/table.component.d.ts +0 -0
  101. /package/lib/{components → modules}/tabs/index.d.ts +0 -0
  102. /package/lib/{components → modules}/tabs/tab/tab.component.d.ts +0 -0
  103. /package/lib/{components → modules}/tabs/tabs.component.d.ts +0 -0
  104. /package/lib/{components → modules}/tag/index.d.ts +0 -0
  105. /package/lib/{components → modules}/tag/tag.component.d.ts +0 -0
  106. /package/lib/{components → modules}/tag/tag.types.d.ts +0 -0
  107. /package/lib/{services → modules}/toast/toast-wrapper/toast-wrapper.component.d.ts +0 -0
  108. /package/lib/{services → modules}/toast/toast.service.d.ts +0 -0
  109. /package/lib/{components → modules}/toggle/index.d.ts +0 -0
  110. /package/lib/{components → modules}/toggle/toggle.component.d.ts +0 -0
  111. /package/lib/{components → modules}/toggle/toggle.types.d.ts +0 -0
  112. /package/lib/{components → modules}/toolbar/index.d.ts +0 -0
  113. /package/lib/{components → modules}/toolbar/toolbar.component.d.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  import * as i1 from '@angular/common';
2
2
  import { CommonModule, DOCUMENT, registerLocaleData, DatePipe } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { EventEmitter, ChangeDetectorRef, Output, Input, Inject, ChangeDetectionStrategy, Component, ElementRef, Renderer2, Injectable, Directive, ViewChild, ContentChildren, inject, Pipe, ContentChild, ViewContainerRef, TemplateRef, RendererFactory2, NgModule, HostListener, Host } from '@angular/core';
4
+ import { EventEmitter, ChangeDetectorRef, Output, Input, Inject, ChangeDetectionStrategy, Component, ElementRef, Renderer2, Injectable, Directive, ViewChild, ContentChildren, inject, Pipe, ContentChild, ViewContainerRef, TemplateRef, NgModule, RendererFactory2, HostListener, Host } from '@angular/core';
5
5
  import * as echarts from 'echarts';
6
6
  import html2canvas from 'html2canvas';
7
7
  import { Subscription, BehaviorSubject, Subject, filter, take, skip, auditTime, throttleTime, debounceTime, interval, fromEvent, merge, timer, of } from 'rxjs';
@@ -28,16 +28,15 @@ import * as i3 from '@angular/cdk/portal';
28
28
  import { TemplatePortal, PortalModule } from '@angular/cdk/portal';
29
29
  import * as i2$3 from '@angular/cdk/scrolling';
30
30
  import { ScrollingModule, CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
31
- import * as i1$1 from '@angular/router';
31
+ import { TranslateService, TranslateModule } from '@ngx-translate/core';
32
+ import * as i1$1 from '@angular/cdk/dialog';
33
+ import { Dialog, DIALOG_DATA, DialogModule, DialogRef } from '@angular/cdk/dialog';
34
+ import * as i1$2 from '@angular/cdk/drag-drop';
35
+ import { DragDropModule } from '@angular/cdk/drag-drop';
36
+ import * as i1$3 from '@angular/router';
32
37
  import { NavigationEnd, NavigationStart, Router } from '@angular/router';
33
38
  import { Clipboard } from '@angular/cdk/clipboard';
34
- import * as i1$2 from '@ngx-translate/core';
35
- import { TranslateModule, TranslateService } from '@ngx-translate/core';
36
- import * as i1$4 from '@angular/cdk/dialog';
37
- import { DIALOG_DATA, DialogRef, DialogModule, Dialog } from '@angular/cdk/dialog';
38
- import * as i1$3 from '@angular/cdk/drag-drop';
39
- import { DragDropModule } from '@angular/cdk/drag-drop';
40
- import * as i1$5 from '@angular/platform-browser';
39
+ import * as i1$4 from '@angular/platform-browser';
41
40
  import { DomSanitizer } from '@angular/platform-browser';
42
41
  import Fuse from 'fuse.js';
43
42
 
@@ -4454,175 +4453,492 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
4454
4453
  args: [{ selector: 'bizy-toolbar', imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"bizy-toolbar\">\n\n <span class=\"bizy-toolbar__start\">\n \n <ng-content select=\"[slot=start]\"></ng-content>\n\n </span>\n\n <span class=\"bizy-toolbar__end\">\n\n <ng-content select=\"[slot=end]\"></ng-content>\n\n </span>\n\n</div>\n", styles: [":host{font-size:1rem}.bizy-toolbar{height:var(--bizy-toolbar-height);width:100%;background-color:var(--bizy-toolbar-background-color);display:flex;align-items:center;justify-content:space-between;column-gap:var(--bizy-toolbar-column-gap);padding:var(--bizy-toolbar-padding)}.bizy-toolbar__start{height:100%;display:flex;align-items:center;column-gap:var(--bizy-toolbar-column-gap)}.bizy-toolbar__end{height:100%;display:flex;align-items:center;justify-content:flex-end;column-gap:var(--bizy-toolbar-column-gap)}::ng-deep .bizy-toolbar *[toolbar-option]{height:100%}\n"] }]
4455
4454
  }] });
4456
4455
 
4457
- var BIZY_ANIMATION;
4458
- (function (BIZY_ANIMATION) {
4459
- BIZY_ANIMATION["FADE_IN"] = "fade-in";
4460
- BIZY_ANIMATION["FADE_OUT"] = "fade-out";
4461
- BIZY_ANIMATION["FADE_IN_UP"] = "fade-in-up";
4462
- BIZY_ANIMATION["FADE_IN_RIGHT"] = "fade-in-right";
4463
- BIZY_ANIMATION["FADE_IN_DOWN"] = "fade-in-down";
4464
- BIZY_ANIMATION["FADE_IN_LEFT"] = "fade-in-left";
4465
- BIZY_ANIMATION["SLIDE_IN_UP"] = "slide-in-up";
4466
- BIZY_ANIMATION["SLIDE_IN_RIGHT"] = "slide-in-right";
4467
- BIZY_ANIMATION["SLIDE_IN_DOWN"] = "slide-in-down";
4468
- BIZY_ANIMATION["SLIDE_IN_LEFT"] = "slide-in-left";
4469
- BIZY_ANIMATION["SLIDE_OUT_RIGHT"] = "slide-out-right";
4470
- BIZY_ANIMATION["SLIDE_OUT_LEFT"] = "slide-out-left";
4471
- })(BIZY_ANIMATION || (BIZY_ANIMATION = {}));
4472
- class BizyAnimationService {
4473
- rendererFactory;
4474
- #renderer;
4475
- constructor(rendererFactory) {
4476
- this.rendererFactory = rendererFactory;
4477
- this.#renderer = this.rendererFactory.createRenderer(null, null);
4478
- }
4479
- setAnimation(element, animation) {
4480
- return new Promise(resolve => {
4481
- if (!element || !animation || !this.#renderer) {
4482
- return;
4483
- }
4484
- const root = this.#renderer.selectRootElement(':root', true);
4485
- const animationTimeout = getComputedStyle(root).getPropertyValue('--bizy-animation-timeout').trim();
4486
- this.#renderer.addClass(element, 'animated');
4487
- this.#renderer.addClass(element, animation);
4488
- setTimeout(() => {
4489
- this.#renderer.removeClass(element, 'animated');
4490
- this.#renderer.removeClass(element, animation);
4491
- resolve();
4492
- }, Number(animationTimeout.match(/\d/g).join('')));
4456
+ var LANGUAGE;
4457
+ (function (LANGUAGE) {
4458
+ LANGUAGE["SPANISH"] = "es";
4459
+ LANGUAGE["ENGLISH"] = "en";
4460
+ })(LANGUAGE || (LANGUAGE = {}));
4461
+ class BizyTranslateService {
4462
+ #translate = inject(TranslateService);
4463
+ forRoot = TranslateModule.forRoot;
4464
+ loadTranslations(...args) {
4465
+ const locales = [...args];
4466
+ locales.forEach(locale => {
4467
+ this.#translate.setTranslation(locale.lang, locale.translations, true);
4493
4468
  });
4494
4469
  }
4495
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyAnimationService, deps: [{ token: RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
4496
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyAnimationService, providedIn: 'root' });
4497
- }
4498
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyAnimationService, decorators: [{
4499
- type: Injectable,
4500
- args: [{
4501
- providedIn: 'root'
4502
- }]
4503
- }], ctorParameters: () => [{ type: i0.RendererFactory2, decorators: [{
4504
- type: Inject,
4505
- args: [RendererFactory2]
4506
- }] }] });
4507
-
4508
- class BizyViewportService {
4509
- window;
4510
- #viewportSizeChanged;
4511
- get sizeChange$() {
4512
- return this.#viewportSizeChanged.asObservable();
4470
+ addLangs(langs) {
4471
+ this.#translate.addLangs(langs);
4513
4472
  }
4514
- constructor(window) {
4515
- this.window = window;
4516
- this.#viewportSizeChanged = new BehaviorSubject({
4517
- width: this.window.innerWidth,
4518
- height: this.window.innerHeight
4519
- });
4520
- fromEvent(window, 'resize')
4521
- .pipe(debounceTime$1(200), map((event) => ({
4522
- width: event.currentTarget.innerWidth,
4523
- height: event.currentTarget.innerHeight
4524
- })))
4525
- .subscribe(windowSize => {
4526
- this.#viewportSizeChanged.next(windowSize);
4527
- });
4473
+ getLangs() {
4474
+ return this.#translate.getLangs();
4528
4475
  }
4529
- width() {
4530
- return this.window.screen.availWidth;
4476
+ setDefault(lang) {
4477
+ this.#translate.setDefaultLang(lang);
4531
4478
  }
4532
- height() {
4533
- return this.window.screen.availHeight;
4479
+ getCurrentLang() {
4480
+ return this.#translate.currentLang;
4534
4481
  }
4535
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyViewportService, deps: [{ token: Window }], target: i0.ɵɵFactoryTarget.Injectable });
4536
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyViewportService, providedIn: 'root' });
4482
+ use(lang) {
4483
+ this.#translate.use(lang);
4484
+ }
4485
+ get(translation) {
4486
+ return this.#translate.instant(translation);
4487
+ }
4488
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyTranslateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4489
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyTranslateService, providedIn: 'root' });
4537
4490
  }
4538
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyViewportService, decorators: [{
4491
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyTranslateService, decorators: [{
4539
4492
  type: Injectable,
4540
4493
  args: [{
4541
4494
  providedIn: 'root'
4542
4495
  }]
4543
- }], ctorParameters: () => [{ type: Window, decorators: [{
4544
- type: Inject,
4545
- args: [Window]
4546
- }] }] });
4496
+ }] });
4547
4497
 
4548
- class BizyKeyboardService {
4549
- document;
4550
- #shiftHolding = new BehaviorSubject(false);
4551
- get shiftHolding$() {
4552
- return this.#shiftHolding.asObservable();
4553
- }
4554
- constructor(document) {
4555
- this.document = document;
4556
- this.document.addEventListener('keydown', (event) => {
4557
- if (event.key === 'Shift') {
4558
- this.#shiftHolding.next(true);
4559
- }
4560
- });
4561
- this.document.addEventListener('keyup', (event) => {
4562
- if (event.key === 'Shift') {
4563
- this.#shiftHolding.next(false);
4564
- }
4565
- });
4498
+ class BizyTranslatePipe {
4499
+ translate;
4500
+ constructor(translate) {
4501
+ this.translate = translate;
4566
4502
  }
4567
- isShiftHolding() {
4568
- return this.#shiftHolding.value;
4503
+ transform(label) {
4504
+ return this.translate.get(label);
4569
4505
  }
4570
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyKeyboardService, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
4571
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyKeyboardService, providedIn: 'root' });
4506
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyTranslatePipe, deps: [{ token: BizyTranslateService }], target: i0.ɵɵFactoryTarget.Pipe });
4507
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.1", ngImport: i0, type: BizyTranslatePipe, isStandalone: true, name: "translate" });
4572
4508
  }
4573
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyKeyboardService, decorators: [{
4574
- type: Injectable,
4509
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyTranslatePipe, decorators: [{
4510
+ type: Pipe,
4575
4511
  args: [{
4576
- providedIn: 'root'
4512
+ name: 'translate',
4577
4513
  }]
4578
- }], ctorParameters: () => [{ type: Document, decorators: [{
4514
+ }], ctorParameters: () => [{ type: BizyTranslateService, decorators: [{
4579
4515
  type: Inject,
4580
- args: [DOCUMENT]
4516
+ args: [BizyTranslateService]
4581
4517
  }] }] });
4582
4518
 
4583
- class BizyExportToCSVService {
4584
- document;
4585
- rendererFactory;
4586
- #loading = false;
4587
- #renderer;
4588
- constructor(document, rendererFactory) {
4589
- this.document = document;
4590
- this.rendererFactory = rendererFactory;
4591
- this.#renderer = this.rendererFactory.createRenderer(null, null);
4519
+ class BizyTranslateModule {
4520
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyTranslateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4521
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.1", ngImport: i0, type: BizyTranslateModule, imports: [BizyTranslatePipe], exports: [BizyTranslatePipe] });
4522
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyTranslateModule, providers: [BizyTranslateService] });
4523
+ }
4524
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyTranslateModule, decorators: [{
4525
+ type: NgModule,
4526
+ args: [{
4527
+ imports: [BizyTranslatePipe],
4528
+ exports: [BizyTranslatePipe],
4529
+ providers: [BizyTranslateService]
4530
+ }]
4531
+ }] });
4532
+
4533
+ var _a;
4534
+ var TOAST;
4535
+ (function (TOAST) {
4536
+ TOAST["DEFAULT"] = "default";
4537
+ TOAST["SUCCESS"] = "success";
4538
+ TOAST["INFO"] = "info";
4539
+ TOAST["WARNING"] = "warning";
4540
+ TOAST["DANGER"] = "danger";
4541
+ })(TOAST || (TOAST = {}));
4542
+ class BizyToastService {
4543
+ dialog;
4544
+ static toasts = new Set();
4545
+ duration = 3000;
4546
+ defaultSuccessTitle = 'Operación exitosa';
4547
+ defaultDangerTitle = 'Hubo un problema';
4548
+ constructor(dialog) {
4549
+ this.dialog = dialog;
4592
4550
  }
4593
- download(data) {
4594
- if (this.#loading || !data.items || !Array.isArray(data.items) || !data.model) {
4551
+ #open(data) {
4552
+ const id = `bizy-toast-${Math.random()}`;
4553
+ const toastRef = this.dialog.open(BizyToastWrapperComponent, {
4554
+ id,
4555
+ data: {
4556
+ type: data.type,
4557
+ duration: this.duration,
4558
+ id,
4559
+ title: typeof data.data === 'string' ? data.data : data.data.title,
4560
+ msg: typeof data.data === 'string' ? '' : data.data.msg
4561
+ },
4562
+ autoFocus: false,
4563
+ hasBackdrop: false,
4564
+ disableClose: false,
4565
+ panelClass: ['bizy-toast', 'bizy-toast--in']
4566
+ });
4567
+ _a.toasts.add(toastRef);
4568
+ }
4569
+ config(data) {
4570
+ if (!data) {
4595
4571
  return;
4596
4572
  }
4597
- try {
4598
- this.#loading = true;
4599
- const csv = this.getCSV(data);
4600
- if (!data.fileName) {
4601
- data.fileName = 'bizy-csv';
4602
- }
4603
- this.#downloadCSV({ csv, fileName: data.fileName });
4573
+ if (data.defaultSuccessTitle) {
4574
+ this.defaultSuccessTitle = data.defaultSuccessTitle;
4604
4575
  }
4605
- finally {
4606
- this.#loading = false;
4576
+ if (data.defaultDangerTitle) {
4577
+ this.defaultDangerTitle = data.defaultDangerTitle;
4578
+ }
4579
+ if (data.duration) {
4580
+ this.duration = data.duration;
4607
4581
  }
4608
4582
  }
4609
- getCSV(data) {
4610
- let csv = '';
4611
- function escapeCommas(str) {
4612
- return str.includes(',') ? `"${str}"` : str;
4583
+ default(data) {
4584
+ this.#open({ type: TOAST.DEFAULT, data });
4585
+ }
4586
+ info(data) {
4587
+ this.#open({ type: TOAST.INFO, data });
4588
+ }
4589
+ success(data = this.defaultSuccessTitle) {
4590
+ this.#open({ type: TOAST.SUCCESS, data });
4591
+ }
4592
+ warning(data) {
4593
+ this.#open({ type: TOAST.WARNING, data });
4594
+ }
4595
+ danger(data = this.defaultDangerTitle) {
4596
+ this.#open({ type: TOAST.DANGER, data });
4597
+ }
4598
+ close = (id) => {
4599
+ if (!id) {
4600
+ return;
4613
4601
  }
4614
- for (const key in data.model) {
4615
- if (key) {
4616
- csv += `${data.model[key]},`;
4617
- }
4602
+ let toastRef = null;
4603
+ toastRef = Array.from(_a.toasts).find(_toastRef => _toastRef.id === id);
4604
+ if (toastRef) {
4605
+ toastRef.removePanelClass('bizy-toast--in');
4606
+ toastRef.addPanelClass('bizy-toast--out');
4607
+ setTimeout(() => {
4608
+ toastRef.close();
4609
+ _a.toasts.delete(toastRef);
4610
+ }, 500);
4618
4611
  }
4619
- data.items.forEach(_item => {
4620
- // Remove the last character (',')
4621
- csv = csv.slice(0, -1);
4622
- csv += '\n';
4623
- for (const key in data.model) {
4624
- let value = _item;
4625
- const nestedProperty = key.split('.');
4612
+ };
4613
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyToastService, deps: [{ token: Dialog }], target: i0.ɵɵFactoryTarget.Injectable });
4614
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyToastService });
4615
+ }
4616
+ _a = BizyToastService;
4617
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyToastService, decorators: [{
4618
+ type: Injectable
4619
+ }], ctorParameters: () => [{ type: i1$1.Dialog, decorators: [{
4620
+ type: Inject,
4621
+ args: [Dialog]
4622
+ }] }] });
4623
+
4624
+ class BizyToastWrapperComponent {
4625
+ data;
4626
+ toast;
4627
+ type = TOAST.INFO;
4628
+ title = '';
4629
+ msg = '';
4630
+ id;
4631
+ constructor(data, toast) {
4632
+ this.data = data;
4633
+ this.toast = toast;
4634
+ this.type = this.data.type;
4635
+ this.title = this.data.title;
4636
+ this.msg = this.data.msg;
4637
+ this.id = this.data.id;
4638
+ setTimeout(() => {
4639
+ this.close();
4640
+ }, 3000);
4641
+ }
4642
+ close() {
4643
+ this.toast.close(this.id);
4644
+ }
4645
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyToastWrapperComponent, deps: [{ token: DIALOG_DATA }, { token: BizyToastService }], target: i0.ɵɵFactoryTarget.Component });
4646
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.1", type: BizyToastWrapperComponent, isStandalone: true, selector: "bizy-toast-wrapper", providers: [BizyToastService], ngImport: i0, template: "<div class=\"bizy-toast-wrapper bizy-toast-wrapper--{{type}}\">\n\n <button (click)=\"close()\" (keyup.enter)=\"close()\" class=\"bizy-toast-wrapper__close-button\">\n\n <svg \n data-name=\"Cancel button\"\n id=\"bizy-toast-wrapper-close-svg\" \n viewBox=\"0 0 200 200\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path id=\"bizy-toast-wrapper-close-svg-content\" d=\"M114,100l49-49a9.9,9.9,0,0,0-14-14L100,86,51,37A9.9,9.9,0,0,0,37,51l49,49L37,149a9.9,9.9,0,0,0,14,14l49-49,49,49a9.9,9.9,0,0,0,14-14Z\"/>\n </svg>\n\n </button>\n\n\n <h3 class=\"bizy-toast-wrapper__title bizy-toast-wrapper__title--{{type}}\" *ngIf=\"title\">{{title}}</h3>\n\n <h5 class=\"bizy-toast-wrapper__msg\" *ngIf=\"msg\">{{msg}}</h5>\n\n\n <span class=\"bizy-toast__progress bizy-toast__progress--{{type}}\"></span>\n \n</div>", styles: [":host{font-size:1rem}.bizy-toast-wrapper{position:relative;width:100%;min-width:20rem;height:fit-content;min-height:3rem;border-left:var(--bizy-toast-border-left);border-top-left-radius:.5rem;border-bottom-left-radius:.5rem;display:flex;flex-direction:column;justify-content:center;row-gap:.5rem;padding:.5rem;box-shadow:0 18px 25px #32325d40,0 3px 6px #0000001a}.bizy-toast-wrapper__title{max-width:min(28rem,60vw)}.bizy-toast-wrapper__msg{max-width:min(30rem,70vw)}.bizy-toast-wrapper--default{background-color:var(--bizy-toast-default-background-color, );border-left-color:var(--bizy-toast-default-color)}.bizy-toast-wrapper__title--default{color:var(--bizy-toast-default-color)}.bizy-toast-wrapper--info{background-color:var(--bizy-toast-info-background-color, );border-left-color:var(--bizy-toast-info-color)}.bizy-toast-wrapper__title--info{color:var(--bizy-toast-info-color)}.bizy-toast-wrapper--success{background-color:var(--bizy-toast-success-background-color);border-left-color:var(--bizy-toast-success-color)}.bizy-toast-wrapper__title--success{color:var(--bizy-toast-success-color)}.bizy-toast-wrapper--warning{background-color:var(--bizy-toast-warning-background-color);border-left-color:var(--bizy-toast-warning-color)}.bizy-toast-wrapper__title--warning{color:var(--bizy-toast-warning-color)}.bizy-toast-wrapper--danger{background-color:var(--bizy-toast-danger-background-color);border-left-color:var(--bizy-toast-danger-color)}.bizy-toast-wrapper__title--danger{color:var(--bizy-toast-danger-color)}.bizy-toast-wrapper__close-button{position:absolute;right:.5rem;top:.5rem;border:none;cursor:pointer;background-color:transparent;transition:color .2s;z-index:1}.bizy-toast-wrapper__close-button #bizy-toast-wrapper-close-svg{height:1rem}.bizy-toast-wrapper__close-button #bizy-toast-wrapper-close-svg-content{fill:var(--bizy-toast-close-button-color)}.bizy-toast-wrapper__close-button:hover #bizy-toast-wrapper-close-svg-content{fill:var(--bizy-toast-close-button-hover-color)}.bizy-toast__progress{width:100%;height:.1rem;display:inline-block;position:absolute;bottom:0;left:0;right:0;overflow:hidden}.bizy-toast__progress--default{background-color:var(--bizy-toast-default-color)}.bizy-toast__progress--info{background-color:var(--bizy-toast-info-color)}.bizy-toast__progress--success{background-color:var(--bizy-toast-success-color)}.bizy-toast__progress--warning{background-color:var(--bizy-toast-warning-color)}.bizy-toast__progress--danger{background-color:var(--bizy-toast-danger-color)}.bizy-toast__progress:after{content:\"\";box-sizing:border-box;width:0;height:.1rem;background-color:#fff;position:absolute;top:0;left:0;animation:progress 2.5s linear infinite}@keyframes progress{0%{width:0}to{width:100%}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: DialogModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4647
+ }
4648
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyToastWrapperComponent, decorators: [{
4649
+ type: Component,
4650
+ args: [{ selector: 'bizy-toast-wrapper', imports: [CommonModule, DialogModule], providers: [BizyToastService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"bizy-toast-wrapper bizy-toast-wrapper--{{type}}\">\n\n <button (click)=\"close()\" (keyup.enter)=\"close()\" class=\"bizy-toast-wrapper__close-button\">\n\n <svg \n data-name=\"Cancel button\"\n id=\"bizy-toast-wrapper-close-svg\" \n viewBox=\"0 0 200 200\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path id=\"bizy-toast-wrapper-close-svg-content\" d=\"M114,100l49-49a9.9,9.9,0,0,0-14-14L100,86,51,37A9.9,9.9,0,0,0,37,51l49,49L37,149a9.9,9.9,0,0,0,14,14l49-49,49,49a9.9,9.9,0,0,0,14-14Z\"/>\n </svg>\n\n </button>\n\n\n <h3 class=\"bizy-toast-wrapper__title bizy-toast-wrapper__title--{{type}}\" *ngIf=\"title\">{{title}}</h3>\n\n <h5 class=\"bizy-toast-wrapper__msg\" *ngIf=\"msg\">{{msg}}</h5>\n\n\n <span class=\"bizy-toast__progress bizy-toast__progress--{{type}}\"></span>\n \n</div>", styles: [":host{font-size:1rem}.bizy-toast-wrapper{position:relative;width:100%;min-width:20rem;height:fit-content;min-height:3rem;border-left:var(--bizy-toast-border-left);border-top-left-radius:.5rem;border-bottom-left-radius:.5rem;display:flex;flex-direction:column;justify-content:center;row-gap:.5rem;padding:.5rem;box-shadow:0 18px 25px #32325d40,0 3px 6px #0000001a}.bizy-toast-wrapper__title{max-width:min(28rem,60vw)}.bizy-toast-wrapper__msg{max-width:min(30rem,70vw)}.bizy-toast-wrapper--default{background-color:var(--bizy-toast-default-background-color, );border-left-color:var(--bizy-toast-default-color)}.bizy-toast-wrapper__title--default{color:var(--bizy-toast-default-color)}.bizy-toast-wrapper--info{background-color:var(--bizy-toast-info-background-color, );border-left-color:var(--bizy-toast-info-color)}.bizy-toast-wrapper__title--info{color:var(--bizy-toast-info-color)}.bizy-toast-wrapper--success{background-color:var(--bizy-toast-success-background-color);border-left-color:var(--bizy-toast-success-color)}.bizy-toast-wrapper__title--success{color:var(--bizy-toast-success-color)}.bizy-toast-wrapper--warning{background-color:var(--bizy-toast-warning-background-color);border-left-color:var(--bizy-toast-warning-color)}.bizy-toast-wrapper__title--warning{color:var(--bizy-toast-warning-color)}.bizy-toast-wrapper--danger{background-color:var(--bizy-toast-danger-background-color);border-left-color:var(--bizy-toast-danger-color)}.bizy-toast-wrapper__title--danger{color:var(--bizy-toast-danger-color)}.bizy-toast-wrapper__close-button{position:absolute;right:.5rem;top:.5rem;border:none;cursor:pointer;background-color:transparent;transition:color .2s;z-index:1}.bizy-toast-wrapper__close-button #bizy-toast-wrapper-close-svg{height:1rem}.bizy-toast-wrapper__close-button #bizy-toast-wrapper-close-svg-content{fill:var(--bizy-toast-close-button-color)}.bizy-toast-wrapper__close-button:hover #bizy-toast-wrapper-close-svg-content{fill:var(--bizy-toast-close-button-hover-color)}.bizy-toast__progress{width:100%;height:.1rem;display:inline-block;position:absolute;bottom:0;left:0;right:0;overflow:hidden}.bizy-toast__progress--default{background-color:var(--bizy-toast-default-color)}.bizy-toast__progress--info{background-color:var(--bizy-toast-info-color)}.bizy-toast__progress--success{background-color:var(--bizy-toast-success-color)}.bizy-toast__progress--warning{background-color:var(--bizy-toast-warning-color)}.bizy-toast__progress--danger{background-color:var(--bizy-toast-danger-color)}.bizy-toast__progress:after{content:\"\";box-sizing:border-box;width:0;height:.1rem;background-color:#fff;position:absolute;top:0;left:0;animation:progress 2.5s linear infinite}@keyframes progress{0%{width:0}to{width:100%}}\n"] }]
4651
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
4652
+ type: Inject,
4653
+ args: [DIALOG_DATA]
4654
+ }] }, { type: BizyToastService, decorators: [{
4655
+ type: Inject,
4656
+ args: [BizyToastService]
4657
+ }] }] });
4658
+
4659
+ class BizyToastModule {
4660
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyToastModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4661
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.1", ngImport: i0, type: BizyToastModule, imports: [BizyToastWrapperComponent], exports: [BizyToastWrapperComponent] });
4662
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyToastModule, providers: [BizyToastService], imports: [BizyToastWrapperComponent] });
4663
+ }
4664
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyToastModule, decorators: [{
4665
+ type: NgModule,
4666
+ args: [{
4667
+ imports: [BizyToastWrapperComponent],
4668
+ exports: [BizyToastWrapperComponent],
4669
+ providers: [BizyToastService]
4670
+ }]
4671
+ }] });
4672
+
4673
+ class BizyPopupWrapperComponent {
4674
+ dynamicComponentContainer;
4675
+ #component = inject(DIALOG_DATA);
4676
+ #dialogRef = inject(DialogRef);
4677
+ #ref = inject(ChangeDetectorRef);
4678
+ ngAfterViewInit() {
4679
+ this.loadDynamicComponent();
4680
+ }
4681
+ loadDynamicComponent() {
4682
+ if (this.#component) {
4683
+ this.dynamicComponentContainer.clear();
4684
+ this.dynamicComponentContainer.createComponent(this.#component);
4685
+ this.#ref.detectChanges();
4686
+ }
4687
+ }
4688
+ close() {
4689
+ this.#dialogRef.close();
4690
+ }
4691
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyPopupWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4692
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.1", type: BizyPopupWrapperComponent, isStandalone: true, selector: "bizy-popup-wrapper", viewQueries: [{ propertyName: "dynamicComponentContainer", first: true, predicate: ["dynamicComponentContainer"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div class=\"bizy-popup-wrapper\" cdkDrag>\n\n <button class=\"bizy-popup-wrapper__drag-button\" cdkDragHandle>\n\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\" class=\"bizy-popup-wrapper__drag-button__icon\">\n <path d=\"M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4V224H109.3l9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4H224V402.7l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4V288H402.7l-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4H288V109.3l9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z\"/>\n </svg>\n\n </button>\n\n <button class=\"bizy-popup-wrapper__close-button\" (click)=\"close()\" (keyup.enter)=\"close()\">\n\n\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\" class=\"bizy-popup-wrapper__close-button__icon\">\n <path d=\"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z\"/>\n </svg>\n\n </button>\n\n <ng-container #dynamicComponentContainer></ng-container>\n\n</div>", styles: [":host{font-size:1rem}.bizy-popup-wrapper{position:relative;background-color:var(--bizy-popup-background-color);min-width:var(--bizy-popup-min-width);width:var(--bizy-popup-width);max-width:var(--bizy-popup-max-width)}.bizy-popup-wrapper__drag-button{position:absolute;left:-.9rem;top:-.9rem;border:.1rem solid var(--bizy-popup-drag-button-border-color);border-radius:50%;padding:.2rem;place-items:center;display:grid;border:.1rem solid #ccc;background-color:var(--bizy-popup-drag-button-background-color);cursor:pointer;transition:transform .2s;z-index:1}.bizy-popup-wrapper__drag-button:hover{transform:scale(1.1)}.bizy-popup-wrapper__drag-button__icon{height:1rem}.bizy-popup-wrapper__drag-button__icon{fill:var(--bizy-popup-drag-button-color)}.bizy-popup-wrapper__close-button{position:absolute;right:-.9rem;top:-.9rem;border:.1rem solid var(--bizy-popup-close-button-border-color);border-radius:50%;padding:.25rem .35rem;place-items:center;display:grid;border:.1rem solid #ccc;background-color:var(--bizy-popup-close-button-background-color);cursor:pointer;transition:transform .2s;z-index:1}.bizy-popup-wrapper__close-button:hover .bizy-popup-wrapper__close-button__icon{transform:scale(1.1)}.bizy-popup-wrapper__close-button:hover .bizy-popup-wrapper__close-button__icon{fill:var(--bizy-popup-close-button-hover-color)}.bizy-popup-wrapper__close-button__icon{height:1rem;transition:fill .2s ease,}.bizy-popup-wrapper__close-button__icon{fill:var(--bizy-popup-close-button-color)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: DialogModule }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i1$2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i1$2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4693
+ }
4694
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyPopupWrapperComponent, decorators: [{
4695
+ type: Component,
4696
+ args: [{ selector: 'bizy-popup-wrapper', imports: [CommonModule, DialogModule, DragDropModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"bizy-popup-wrapper\" cdkDrag>\n\n <button class=\"bizy-popup-wrapper__drag-button\" cdkDragHandle>\n\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\" class=\"bizy-popup-wrapper__drag-button__icon\">\n <path d=\"M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4V224H109.3l9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4H224V402.7l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4V288H402.7l-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4H288V109.3l9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z\"/>\n </svg>\n\n </button>\n\n <button class=\"bizy-popup-wrapper__close-button\" (click)=\"close()\" (keyup.enter)=\"close()\">\n\n\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\" class=\"bizy-popup-wrapper__close-button__icon\">\n <path d=\"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z\"/>\n </svg>\n\n </button>\n\n <ng-container #dynamicComponentContainer></ng-container>\n\n</div>", styles: [":host{font-size:1rem}.bizy-popup-wrapper{position:relative;background-color:var(--bizy-popup-background-color);min-width:var(--bizy-popup-min-width);width:var(--bizy-popup-width);max-width:var(--bizy-popup-max-width)}.bizy-popup-wrapper__drag-button{position:absolute;left:-.9rem;top:-.9rem;border:.1rem solid var(--bizy-popup-drag-button-border-color);border-radius:50%;padding:.2rem;place-items:center;display:grid;border:.1rem solid #ccc;background-color:var(--bizy-popup-drag-button-background-color);cursor:pointer;transition:transform .2s;z-index:1}.bizy-popup-wrapper__drag-button:hover{transform:scale(1.1)}.bizy-popup-wrapper__drag-button__icon{height:1rem}.bizy-popup-wrapper__drag-button__icon{fill:var(--bizy-popup-drag-button-color)}.bizy-popup-wrapper__close-button{position:absolute;right:-.9rem;top:-.9rem;border:.1rem solid var(--bizy-popup-close-button-border-color);border-radius:50%;padding:.25rem .35rem;place-items:center;display:grid;border:.1rem solid #ccc;background-color:var(--bizy-popup-close-button-background-color);cursor:pointer;transition:transform .2s;z-index:1}.bizy-popup-wrapper__close-button:hover .bizy-popup-wrapper__close-button__icon{transform:scale(1.1)}.bizy-popup-wrapper__close-button:hover .bizy-popup-wrapper__close-button__icon{fill:var(--bizy-popup-close-button-hover-color)}.bizy-popup-wrapper__close-button__icon{height:1rem;transition:fill .2s ease,}.bizy-popup-wrapper__close-button__icon{fill:var(--bizy-popup-close-button-color)}\n"] }]
4697
+ }], propDecorators: { dynamicComponentContainer: [{
4698
+ type: ViewChild,
4699
+ args: ['dynamicComponentContainer', { read: ViewContainerRef }]
4700
+ }] } });
4701
+
4702
+ class BizyPopupService {
4703
+ #dialog = inject(Dialog);
4704
+ static dialogs = new Set();
4705
+ #data = null;
4706
+ ;
4707
+ open(data, callback) {
4708
+ this.#data = data.data;
4709
+ const dialogRef = this.#dialog.open(BizyPopupWrapperComponent, ({
4710
+ id: data.id,
4711
+ data: data.component,
4712
+ autoFocus: true,
4713
+ hasBackdrop: true,
4714
+ disableClose: data.disableClose ?? false,
4715
+ panelClass: ['bizy-popup', data.customClass]
4716
+ }));
4717
+ BizyPopupService.dialogs.add(dialogRef);
4718
+ dialogRef.closed.pipe(take(1)).subscribe(response => {
4719
+ BizyPopupService.dialogs.delete(dialogRef);
4720
+ if (callback) {
4721
+ callback(response);
4722
+ }
4723
+ });
4724
+ }
4725
+ getData() {
4726
+ return this.#data;
4727
+ }
4728
+ close(data) {
4729
+ let dialogRef = null;
4730
+ if (data && data.id) {
4731
+ dialogRef = Array.from(BizyPopupService.dialogs).find(_dialogRef => _dialogRef.id === data.id);
4732
+ }
4733
+ else {
4734
+ dialogRef = Array.from(BizyPopupService.dialogs).pop();
4735
+ }
4736
+ if (dialogRef) {
4737
+ dialogRef.close(data ? data.response : null);
4738
+ BizyPopupService.dialogs.delete(dialogRef);
4739
+ }
4740
+ this.#data = null;
4741
+ }
4742
+ closeAll() {
4743
+ Array.from(BizyPopupService.dialogs).forEach(_dialogRef => {
4744
+ _dialogRef.close();
4745
+ });
4746
+ BizyPopupService.dialogs.clear();
4747
+ this.#data = null;
4748
+ }
4749
+ openedPopups() {
4750
+ return BizyPopupService.dialogs.size;
4751
+ }
4752
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyPopupService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4753
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyPopupService });
4754
+ }
4755
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyPopupService, decorators: [{
4756
+ type: Injectable
4757
+ }] });
4758
+
4759
+ class BizyPopupModule {
4760
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyPopupModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4761
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.1", ngImport: i0, type: BizyPopupModule, imports: [BizyPopupWrapperComponent], exports: [BizyPopupWrapperComponent] });
4762
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyPopupModule, providers: [BizyPopupService], imports: [BizyPopupWrapperComponent] });
4763
+ }
4764
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyPopupModule, decorators: [{
4765
+ type: NgModule,
4766
+ args: [{
4767
+ imports: [BizyPopupWrapperComponent],
4768
+ exports: [BizyPopupWrapperComponent],
4769
+ providers: [BizyPopupService]
4770
+ }]
4771
+ }] });
4772
+
4773
+ var BIZY_ANIMATION;
4774
+ (function (BIZY_ANIMATION) {
4775
+ BIZY_ANIMATION["FADE_IN"] = "fade-in";
4776
+ BIZY_ANIMATION["FADE_OUT"] = "fade-out";
4777
+ BIZY_ANIMATION["FADE_IN_UP"] = "fade-in-up";
4778
+ BIZY_ANIMATION["FADE_IN_RIGHT"] = "fade-in-right";
4779
+ BIZY_ANIMATION["FADE_IN_DOWN"] = "fade-in-down";
4780
+ BIZY_ANIMATION["FADE_IN_LEFT"] = "fade-in-left";
4781
+ BIZY_ANIMATION["SLIDE_IN_UP"] = "slide-in-up";
4782
+ BIZY_ANIMATION["SLIDE_IN_RIGHT"] = "slide-in-right";
4783
+ BIZY_ANIMATION["SLIDE_IN_DOWN"] = "slide-in-down";
4784
+ BIZY_ANIMATION["SLIDE_IN_LEFT"] = "slide-in-left";
4785
+ BIZY_ANIMATION["SLIDE_OUT_RIGHT"] = "slide-out-right";
4786
+ BIZY_ANIMATION["SLIDE_OUT_LEFT"] = "slide-out-left";
4787
+ })(BIZY_ANIMATION || (BIZY_ANIMATION = {}));
4788
+ class BizyAnimationService {
4789
+ rendererFactory;
4790
+ #renderer;
4791
+ constructor(rendererFactory) {
4792
+ this.rendererFactory = rendererFactory;
4793
+ this.#renderer = this.rendererFactory.createRenderer(null, null);
4794
+ }
4795
+ setAnimation(element, animation) {
4796
+ return new Promise(resolve => {
4797
+ if (!element || !animation || !this.#renderer) {
4798
+ return;
4799
+ }
4800
+ const root = this.#renderer.selectRootElement(':root', true);
4801
+ const animationTimeout = getComputedStyle(root).getPropertyValue('--bizy-animation-timeout').trim();
4802
+ this.#renderer.addClass(element, 'animated');
4803
+ this.#renderer.addClass(element, animation);
4804
+ setTimeout(() => {
4805
+ this.#renderer.removeClass(element, 'animated');
4806
+ this.#renderer.removeClass(element, animation);
4807
+ resolve();
4808
+ }, Number(animationTimeout.match(/\d/g).join('')));
4809
+ });
4810
+ }
4811
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyAnimationService, deps: [{ token: RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
4812
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyAnimationService, providedIn: 'root' });
4813
+ }
4814
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyAnimationService, decorators: [{
4815
+ type: Injectable,
4816
+ args: [{
4817
+ providedIn: 'root'
4818
+ }]
4819
+ }], ctorParameters: () => [{ type: i0.RendererFactory2, decorators: [{
4820
+ type: Inject,
4821
+ args: [RendererFactory2]
4822
+ }] }] });
4823
+
4824
+ class BizyViewportService {
4825
+ window;
4826
+ #viewportSizeChanged;
4827
+ get sizeChange$() {
4828
+ return this.#viewportSizeChanged.asObservable();
4829
+ }
4830
+ constructor(window) {
4831
+ this.window = window;
4832
+ this.#viewportSizeChanged = new BehaviorSubject({
4833
+ width: this.window.innerWidth,
4834
+ height: this.window.innerHeight
4835
+ });
4836
+ fromEvent(window, 'resize')
4837
+ .pipe(debounceTime$1(200), map((event) => ({
4838
+ width: event.currentTarget.innerWidth,
4839
+ height: event.currentTarget.innerHeight
4840
+ })))
4841
+ .subscribe(windowSize => {
4842
+ this.#viewportSizeChanged.next(windowSize);
4843
+ });
4844
+ }
4845
+ width() {
4846
+ return this.window.screen.availWidth;
4847
+ }
4848
+ height() {
4849
+ return this.window.screen.availHeight;
4850
+ }
4851
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyViewportService, deps: [{ token: Window }], target: i0.ɵɵFactoryTarget.Injectable });
4852
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyViewportService, providedIn: 'root' });
4853
+ }
4854
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyViewportService, decorators: [{
4855
+ type: Injectable,
4856
+ args: [{
4857
+ providedIn: 'root'
4858
+ }]
4859
+ }], ctorParameters: () => [{ type: Window, decorators: [{
4860
+ type: Inject,
4861
+ args: [Window]
4862
+ }] }] });
4863
+
4864
+ class BizyKeyboardService {
4865
+ document;
4866
+ #shiftHolding = new BehaviorSubject(false);
4867
+ get shiftHolding$() {
4868
+ return this.#shiftHolding.asObservable();
4869
+ }
4870
+ constructor(document) {
4871
+ this.document = document;
4872
+ this.document.addEventListener('keydown', (event) => {
4873
+ if (event.key === 'Shift') {
4874
+ this.#shiftHolding.next(true);
4875
+ }
4876
+ });
4877
+ this.document.addEventListener('keyup', (event) => {
4878
+ if (event.key === 'Shift') {
4879
+ this.#shiftHolding.next(false);
4880
+ }
4881
+ });
4882
+ }
4883
+ isShiftHolding() {
4884
+ return this.#shiftHolding.value;
4885
+ }
4886
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyKeyboardService, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
4887
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyKeyboardService, providedIn: 'root' });
4888
+ }
4889
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyKeyboardService, decorators: [{
4890
+ type: Injectable,
4891
+ args: [{
4892
+ providedIn: 'root'
4893
+ }]
4894
+ }], ctorParameters: () => [{ type: Document, decorators: [{
4895
+ type: Inject,
4896
+ args: [DOCUMENT]
4897
+ }] }] });
4898
+
4899
+ class BizyExportToCSVService {
4900
+ document;
4901
+ rendererFactory;
4902
+ #loading = false;
4903
+ #renderer;
4904
+ constructor(document, rendererFactory) {
4905
+ this.document = document;
4906
+ this.rendererFactory = rendererFactory;
4907
+ this.#renderer = this.rendererFactory.createRenderer(null, null);
4908
+ }
4909
+ download(data) {
4910
+ if (this.#loading || !data.items || !Array.isArray(data.items) || !data.model) {
4911
+ return;
4912
+ }
4913
+ try {
4914
+ this.#loading = true;
4915
+ const csv = this.getCSV(data);
4916
+ if (!data.fileName) {
4917
+ data.fileName = 'bizy-csv';
4918
+ }
4919
+ this.#downloadCSV({ csv, fileName: data.fileName });
4920
+ }
4921
+ finally {
4922
+ this.#loading = false;
4923
+ }
4924
+ }
4925
+ getCSV(data) {
4926
+ let csv = '';
4927
+ function escapeCommas(str) {
4928
+ return str.includes(',') ? `"${str}"` : str;
4929
+ }
4930
+ for (const key in data.model) {
4931
+ if (key) {
4932
+ csv += `${data.model[key]},`;
4933
+ }
4934
+ }
4935
+ data.items.forEach(_item => {
4936
+ // Remove the last character (',')
4937
+ csv = csv.slice(0, -1);
4938
+ csv += '\n';
4939
+ for (const key in data.model) {
4940
+ let value = _item;
4941
+ const nestedProperty = key.split('.');
4626
4942
  for (let i = 0; i < nestedProperty.length; i++) {
4627
4943
  const _property = nestedProperty[i];
4628
4944
  if (value) {
@@ -4767,7 +5083,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
4767
5083
  args: [{
4768
5084
  providedIn: 'root'
4769
5085
  }]
4770
- }], ctorParameters: () => [{ type: i1$1.Router, decorators: [{
5086
+ }], ctorParameters: () => [{ type: i1$3.Router, decorators: [{
4771
5087
  type: Inject,
4772
5088
  args: [Router]
4773
5089
  }] }] });
@@ -5195,420 +5511,143 @@ class BizyLogService {
5195
5511
  }
5196
5512
  else {
5197
5513
  this.#template({ ...data, param: data.param, title: 'Debug', color: COLOR.DEFAULT });
5198
- }
5199
- }
5200
- info(data, param) {
5201
- if (typeof data === 'string') {
5202
- this.#log(data, COLOR.INFO, param);
5203
- }
5204
- else {
5205
- this.#template({ ...data, param: data.param, title: 'Info', color: COLOR.INFO });
5206
- }
5207
- }
5208
- success(data, param) {
5209
- if (typeof data === 'string') {
5210
- this.#log(data, COLOR.SUCCESS, param);
5211
- }
5212
- else {
5213
- this.#template({ ...data, param: data.param, title: 'Success', color: COLOR.SUCCESS });
5214
- }
5215
- }
5216
- warning(data, param) {
5217
- if (typeof data === 'string') {
5218
- this.#log(data, COLOR.WARNING, param);
5219
- }
5220
- else {
5221
- this.#template({ ...data, param: data.param, title: 'Warning', color: COLOR.WARNING });
5222
- }
5223
- }
5224
- error(data, param) {
5225
- if (typeof data === 'string') {
5226
- this.#log(data, COLOR.ERROR, param);
5227
- }
5228
- else {
5229
- this.#template({ ...data, param: data.param, title: 'Error', color: COLOR.ERROR });
5230
- }
5231
- }
5232
- /** DEPRECATED */
5233
- templateDebug(data) {
5234
- this.#template({ ...data, title: 'Debug', color: COLOR.DEFAULT });
5235
- }
5236
- /** DEPRECATED */
5237
- templateSucc(data) {
5238
- this.#template({ ...data, title: 'Success', color: COLOR.SUCCESS });
5239
- }
5240
- /** DEPRECATED */
5241
- templateInfo(data) {
5242
- this.#template({ ...data, title: 'Info', color: COLOR.INFO });
5243
- }
5244
- /** DEPRECATED */
5245
- templateWarn(data) {
5246
- this.#template({ ...data, title: 'Warning', color: COLOR.WARNING });
5247
- }
5248
- /** DEPRECATED */
5249
- templateError(data) {
5250
- this.#template({ ...data, title: 'Error', color: COLOR.ERROR });
5251
- }
5252
- #template(data) {
5253
- const log = `(${data.title}) ${data.fileName} - ${data.functionName}`;
5254
- this.#log(log, data.color, data.param);
5255
- }
5256
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyLogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5257
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyLogService, providedIn: 'root' });
5258
- }
5259
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyLogService, decorators: [{
5260
- type: Injectable,
5261
- args: [{
5262
- providedIn: 'root'
5263
- }]
5264
- }] });
5265
-
5266
- class BizyCopyToClipboardService {
5267
- #clipboard = inject(Clipboard);
5268
- copy(data) {
5269
- return new Promise((resolve, reject) => {
5270
- try {
5271
- if (!data) {
5272
- resolve();
5273
- return;
5274
- }
5275
- setTimeout(() => {
5276
- let toCopy = '';
5277
- if (typeof data === 'string' || data instanceof String) {
5278
- toCopy = data;
5279
- }
5280
- else if (data.items && data.items.length > 0 && data.model) {
5281
- for (const key in data.model) {
5282
- if (key) {
5283
- toCopy += `${data.model[key]},`;
5284
- }
5285
- }
5286
- data.items.forEach(_item => {
5287
- // Remove the last character (',')
5288
- toCopy = toCopy.slice(0, -2);
5289
- toCopy += '\n';
5290
- for (const key in data.model) {
5291
- let value = _item;
5292
- const nestedProperty = key.split('.');
5293
- nestedProperty.forEach(_property => {
5294
- value = value[_property];
5295
- });
5296
- if (typeof value !== undefined && value !== null) {
5297
- toCopy += `${String(value).replace(/\n/g, '')},`;
5298
- }
5299
- else {
5300
- toCopy += ',';
5301
- }
5302
- }
5303
- });
5304
- }
5305
- const pending = this.#clipboard.beginCopy(toCopy);
5306
- let remainingAttempts = 3;
5307
- const attempt = () => {
5308
- const result = pending.copy();
5309
- if (!result && --remainingAttempts) {
5310
- setTimeout(attempt);
5311
- }
5312
- else {
5313
- // Remember to destroy when you're done!
5314
- pending.destroy();
5315
- resolve();
5316
- }
5317
- };
5318
- attempt();
5319
- }, 100);
5320
- }
5321
- catch (error) {
5322
- reject(error);
5323
- }
5324
- });
5325
- }
5326
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyCopyToClipboardService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5327
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyCopyToClipboardService, providedIn: 'root' });
5328
- }
5329
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyCopyToClipboardService, decorators: [{
5330
- type: Injectable,
5331
- args: [{
5332
- providedIn: 'root'
5333
- }]
5334
- }] });
5335
-
5336
- class BizyTranslateModule {
5337
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyTranslateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
5338
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.1", ngImport: i0, type: BizyTranslateModule, imports: [i1$2.TranslateModule] });
5339
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyTranslateModule, imports: [TranslateModule.forRoot()] });
5340
- }
5341
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyTranslateModule, decorators: [{
5342
- type: NgModule,
5343
- args: [{
5344
- imports: [TranslateModule.forRoot()]
5345
- }]
5346
- }] });
5347
-
5348
- var LANGUAGE;
5349
- (function (LANGUAGE) {
5350
- LANGUAGE["SPANISH"] = "es";
5351
- LANGUAGE["ENGLISH"] = "en";
5352
- })(LANGUAGE || (LANGUAGE = {}));
5353
- class BizyTranslateService {
5354
- translate;
5355
- constructor(translate) {
5356
- this.translate = translate;
5357
- }
5358
- loadTranslations(...args) {
5359
- const locales = [...args];
5360
- locales.forEach(locale => {
5361
- this.translate.setTranslation(locale.lang, locale.translations, true);
5362
- });
5363
- }
5364
- addLangs(langs) {
5365
- this.translate.addLangs(langs);
5366
- }
5367
- getLangs() {
5368
- return this.translate.getLangs();
5369
- }
5370
- setDefault(lang) {
5371
- this.translate.setDefaultLang(lang);
5372
- }
5373
- getCurrentLang() {
5374
- return this.translate.currentLang;
5375
- }
5376
- use(lang) {
5377
- this.translate.use(lang);
5378
- }
5379
- get(translation) {
5380
- return this.translate.instant(translation);
5381
- }
5382
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyTranslateService, deps: [{ token: TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
5383
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyTranslateService, providedIn: 'root' });
5384
- }
5385
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyTranslateService, decorators: [{
5386
- type: Injectable,
5387
- args: [{
5388
- providedIn: 'root'
5389
- }]
5390
- }], ctorParameters: () => [{ type: i1$2.TranslateService, decorators: [{
5391
- type: Inject,
5392
- args: [TranslateService]
5393
- }] }] });
5394
-
5395
- class BizyPopupWrapperComponent {
5396
- dynamicComponentContainer;
5397
- #component = inject(DIALOG_DATA);
5398
- #dialogRef = inject(DialogRef);
5399
- #ref = inject(ChangeDetectorRef);
5400
- ngAfterViewInit() {
5401
- this.loadDynamicComponent();
5402
- }
5403
- loadDynamicComponent() {
5404
- if (this.#component) {
5405
- this.dynamicComponentContainer.clear();
5406
- this.dynamicComponentContainer.createComponent(this.#component);
5407
- this.#ref.detectChanges();
5408
- }
5409
- }
5410
- close() {
5411
- this.#dialogRef.close();
5412
- }
5413
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyPopupWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
5414
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.1", type: BizyPopupWrapperComponent, isStandalone: true, selector: "bizy-popup-wrapper", viewQueries: [{ propertyName: "dynamicComponentContainer", first: true, predicate: ["dynamicComponentContainer"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div class=\"bizy-popup-wrapper\" cdkDrag>\n\n <button class=\"bizy-popup-wrapper__drag-button\" cdkDragHandle>\n\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\" class=\"bizy-popup-wrapper__drag-button__icon\">\n <path d=\"M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4V224H109.3l9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4H224V402.7l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4V288H402.7l-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4H288V109.3l9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z\"/>\n </svg>\n\n </button>\n\n <button class=\"bizy-popup-wrapper__close-button\" (click)=\"close()\" (keyup.enter)=\"close()\">\n\n\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\" class=\"bizy-popup-wrapper__close-button__icon\">\n <path d=\"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z\"/>\n </svg>\n\n </button>\n\n <ng-container #dynamicComponentContainer></ng-container>\n\n</div>", styles: [":host{font-size:1rem}.bizy-popup-wrapper{position:relative;background-color:var(--bizy-popup-background-color);min-width:var(--bizy-popup-min-width);width:var(--bizy-popup-width);max-width:var(--bizy-popup-max-width)}.bizy-popup-wrapper__drag-button{position:absolute;left:-.9rem;top:-.9rem;border:.1rem solid var(--bizy-popup-drag-button-border-color);border-radius:50%;padding:.2rem;place-items:center;display:grid;border:.1rem solid #ccc;background-color:var(--bizy-popup-drag-button-background-color);cursor:pointer;transition:transform .2s;z-index:1}.bizy-popup-wrapper__drag-button:hover{transform:scale(1.1)}.bizy-popup-wrapper__drag-button__icon{height:1rem}.bizy-popup-wrapper__drag-button__icon{fill:var(--bizy-popup-drag-button-color)}.bizy-popup-wrapper__close-button{position:absolute;right:-.9rem;top:-.9rem;border:.1rem solid var(--bizy-popup-close-button-border-color);border-radius:50%;padding:.25rem .35rem;place-items:center;display:grid;border:.1rem solid #ccc;background-color:var(--bizy-popup-close-button-background-color);cursor:pointer;transition:transform .2s;z-index:1}.bizy-popup-wrapper__close-button:hover .bizy-popup-wrapper__close-button__icon{transform:scale(1.1)}.bizy-popup-wrapper__close-button:hover .bizy-popup-wrapper__close-button__icon{fill:var(--bizy-popup-close-button-hover-color)}.bizy-popup-wrapper__close-button__icon{height:1rem;transition:fill .2s ease,}.bizy-popup-wrapper__close-button__icon{fill:var(--bizy-popup-close-button-color)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: DialogModule }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i1$3.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i1$3.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
5415
- }
5416
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyPopupWrapperComponent, decorators: [{
5417
- type: Component,
5418
- args: [{ selector: 'bizy-popup-wrapper', imports: [CommonModule, DialogModule, DragDropModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"bizy-popup-wrapper\" cdkDrag>\n\n <button class=\"bizy-popup-wrapper__drag-button\" cdkDragHandle>\n\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\" class=\"bizy-popup-wrapper__drag-button__icon\">\n <path d=\"M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4V224H109.3l9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4H224V402.7l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4V288H402.7l-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4H288V109.3l9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z\"/>\n </svg>\n\n </button>\n\n <button class=\"bizy-popup-wrapper__close-button\" (click)=\"close()\" (keyup.enter)=\"close()\">\n\n\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\" class=\"bizy-popup-wrapper__close-button__icon\">\n <path d=\"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z\"/>\n </svg>\n\n </button>\n\n <ng-container #dynamicComponentContainer></ng-container>\n\n</div>", styles: [":host{font-size:1rem}.bizy-popup-wrapper{position:relative;background-color:var(--bizy-popup-background-color);min-width:var(--bizy-popup-min-width);width:var(--bizy-popup-width);max-width:var(--bizy-popup-max-width)}.bizy-popup-wrapper__drag-button{position:absolute;left:-.9rem;top:-.9rem;border:.1rem solid var(--bizy-popup-drag-button-border-color);border-radius:50%;padding:.2rem;place-items:center;display:grid;border:.1rem solid #ccc;background-color:var(--bizy-popup-drag-button-background-color);cursor:pointer;transition:transform .2s;z-index:1}.bizy-popup-wrapper__drag-button:hover{transform:scale(1.1)}.bizy-popup-wrapper__drag-button__icon{height:1rem}.bizy-popup-wrapper__drag-button__icon{fill:var(--bizy-popup-drag-button-color)}.bizy-popup-wrapper__close-button{position:absolute;right:-.9rem;top:-.9rem;border:.1rem solid var(--bizy-popup-close-button-border-color);border-radius:50%;padding:.25rem .35rem;place-items:center;display:grid;border:.1rem solid #ccc;background-color:var(--bizy-popup-close-button-background-color);cursor:pointer;transition:transform .2s;z-index:1}.bizy-popup-wrapper__close-button:hover .bizy-popup-wrapper__close-button__icon{transform:scale(1.1)}.bizy-popup-wrapper__close-button:hover .bizy-popup-wrapper__close-button__icon{fill:var(--bizy-popup-close-button-hover-color)}.bizy-popup-wrapper__close-button__icon{height:1rem;transition:fill .2s ease,}.bizy-popup-wrapper__close-button__icon{fill:var(--bizy-popup-close-button-color)}\n"] }]
5419
- }], propDecorators: { dynamicComponentContainer: [{
5420
- type: ViewChild,
5421
- args: ['dynamicComponentContainer', { read: ViewContainerRef }]
5422
- }] } });
5423
-
5424
- class BizyPopupService {
5425
- #dialog = inject(Dialog);
5426
- static dialogs = new Set();
5427
- static data = null;
5428
- ;
5429
- open(data, callback) {
5430
- BizyPopupService.data = data.data;
5431
- const dialogRef = this.#dialog.open(BizyPopupWrapperComponent, ({
5432
- id: data.id,
5433
- data: data.component,
5434
- autoFocus: true,
5435
- hasBackdrop: true,
5436
- disableClose: data.disableClose ?? false,
5437
- panelClass: ['bizy-popup', data.customClass]
5438
- }));
5439
- BizyPopupService.dialogs.add(dialogRef);
5440
- dialogRef.closed.pipe(take(1)).subscribe(response => {
5441
- BizyPopupService.dialogs.delete(dialogRef);
5442
- if (callback) {
5443
- callback(response);
5444
- }
5445
- });
5446
- }
5447
- getData() {
5448
- return BizyPopupService.data;
5449
- }
5450
- close(data) {
5451
- let dialogRef = null;
5452
- if (data && data.id) {
5453
- dialogRef = Array.from(BizyPopupService.dialogs).find(_dialogRef => _dialogRef.id === data.id);
5454
- }
5455
- else {
5456
- dialogRef = Array.from(BizyPopupService.dialogs).pop();
5457
- }
5458
- if (dialogRef) {
5459
- dialogRef.close(data ? data.response : null);
5460
- BizyPopupService.dialogs.delete(dialogRef);
5461
- }
5462
- BizyPopupService.data = null;
5463
- }
5464
- closeAll() {
5465
- Array.from(BizyPopupService.dialogs).forEach(_dialogRef => {
5466
- _dialogRef.close();
5467
- });
5468
- BizyPopupService.dialogs.clear();
5469
- BizyPopupService.data = null;
5470
- }
5471
- openedPopups() {
5472
- return BizyPopupService.dialogs.size;
5514
+ }
5473
5515
  }
5474
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyPopupService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5475
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyPopupService, providedIn: 'root' });
5476
- }
5477
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyPopupService, decorators: [{
5478
- type: Injectable,
5479
- args: [{
5480
- providedIn: 'root'
5481
- }]
5482
- }] });
5483
-
5484
- var _a;
5485
- var TOAST;
5486
- (function (TOAST) {
5487
- TOAST["DEFAULT"] = "default";
5488
- TOAST["SUCCESS"] = "success";
5489
- TOAST["INFO"] = "info";
5490
- TOAST["WARNING"] = "warning";
5491
- TOAST["DANGER"] = "danger";
5492
- })(TOAST || (TOAST = {}));
5493
- class BizyToastService {
5494
- dialog;
5495
- static toasts = new Set();
5496
- duration = 3000;
5497
- defaultSuccessTitle = 'Operación exitosa';
5498
- defaultDangerTitle = 'Hubo un problema';
5499
- constructor(dialog) {
5500
- this.dialog = dialog;
5516
+ info(data, param) {
5517
+ if (typeof data === 'string') {
5518
+ this.#log(data, COLOR.INFO, param);
5519
+ }
5520
+ else {
5521
+ this.#template({ ...data, param: data.param, title: 'Info', color: COLOR.INFO });
5522
+ }
5501
5523
  }
5502
- #open(data) {
5503
- const id = `bizy-toast-${Math.random()}`;
5504
- const toastRef = this.dialog.open(BizyToastWrapperComponent, {
5505
- id,
5506
- data: {
5507
- type: data.type,
5508
- duration: this.duration,
5509
- id,
5510
- title: typeof data.data === 'string' ? data.data : data.data.title,
5511
- msg: typeof data.data === 'string' ? '' : data.data.msg
5512
- },
5513
- autoFocus: false,
5514
- hasBackdrop: false,
5515
- disableClose: false,
5516
- panelClass: ['bizy-toast', 'bizy-toast--in']
5517
- });
5518
- _a.toasts.add(toastRef);
5524
+ success(data, param) {
5525
+ if (typeof data === 'string') {
5526
+ this.#log(data, COLOR.SUCCESS, param);
5527
+ }
5528
+ else {
5529
+ this.#template({ ...data, param: data.param, title: 'Success', color: COLOR.SUCCESS });
5530
+ }
5519
5531
  }
5520
- config(data) {
5521
- if (!data) {
5522
- return;
5532
+ warning(data, param) {
5533
+ if (typeof data === 'string') {
5534
+ this.#log(data, COLOR.WARNING, param);
5523
5535
  }
5524
- if (data.defaultSuccessTitle) {
5525
- this.defaultSuccessTitle = data.defaultSuccessTitle;
5536
+ else {
5537
+ this.#template({ ...data, param: data.param, title: 'Warning', color: COLOR.WARNING });
5526
5538
  }
5527
- if (data.defaultDangerTitle) {
5528
- this.defaultDangerTitle = data.defaultDangerTitle;
5539
+ }
5540
+ error(data, param) {
5541
+ if (typeof data === 'string') {
5542
+ this.#log(data, COLOR.ERROR, param);
5529
5543
  }
5530
- if (data.duration) {
5531
- this.duration = data.duration;
5544
+ else {
5545
+ this.#template({ ...data, param: data.param, title: 'Error', color: COLOR.ERROR });
5532
5546
  }
5533
5547
  }
5534
- default(data) {
5535
- this.#open({ type: TOAST.DEFAULT, data });
5548
+ /** DEPRECATED */
5549
+ templateDebug(data) {
5550
+ this.#template({ ...data, title: 'Debug', color: COLOR.DEFAULT });
5536
5551
  }
5537
- info(data) {
5538
- this.#open({ type: TOAST.INFO, data });
5552
+ /** DEPRECATED */
5553
+ templateSucc(data) {
5554
+ this.#template({ ...data, title: 'Success', color: COLOR.SUCCESS });
5539
5555
  }
5540
- success(data = this.defaultSuccessTitle) {
5541
- this.#open({ type: TOAST.SUCCESS, data });
5556
+ /** DEPRECATED */
5557
+ templateInfo(data) {
5558
+ this.#template({ ...data, title: 'Info', color: COLOR.INFO });
5542
5559
  }
5543
- warning(data) {
5544
- this.#open({ type: TOAST.WARNING, data });
5560
+ /** DEPRECATED */
5561
+ templateWarn(data) {
5562
+ this.#template({ ...data, title: 'Warning', color: COLOR.WARNING });
5545
5563
  }
5546
- danger(data = this.defaultDangerTitle) {
5547
- this.#open({ type: TOAST.DANGER, data });
5564
+ /** DEPRECATED */
5565
+ templateError(data) {
5566
+ this.#template({ ...data, title: 'Error', color: COLOR.ERROR });
5548
5567
  }
5549
- close = (id) => {
5550
- if (!id) {
5551
- return;
5552
- }
5553
- let toastRef = null;
5554
- toastRef = Array.from(_a.toasts).find(_toastRef => _toastRef.id === id);
5555
- if (toastRef) {
5556
- toastRef.removePanelClass('bizy-toast--in');
5557
- toastRef.addPanelClass('bizy-toast--out');
5558
- setTimeout(() => {
5559
- toastRef.close();
5560
- _a.toasts.delete(toastRef);
5561
- }, 500);
5562
- }
5563
- };
5564
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyToastService, deps: [{ token: Dialog }], target: i0.ɵɵFactoryTarget.Injectable });
5565
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyToastService, providedIn: 'root' });
5568
+ #template(data) {
5569
+ const log = `(${data.title}) ${data.fileName} - ${data.functionName}`;
5570
+ this.#log(log, data.color, data.param);
5571
+ }
5572
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyLogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5573
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyLogService, providedIn: 'root' });
5566
5574
  }
5567
- _a = BizyToastService;
5568
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyToastService, decorators: [{
5575
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyLogService, decorators: [{
5569
5576
  type: Injectable,
5570
5577
  args: [{
5571
5578
  providedIn: 'root'
5572
5579
  }]
5573
- }], ctorParameters: () => [{ type: i1$4.Dialog, decorators: [{
5574
- type: Inject,
5575
- args: [Dialog]
5576
- }] }] });
5580
+ }] });
5577
5581
 
5578
- class BizyToastWrapperComponent {
5579
- data;
5580
- toast;
5581
- type = TOAST.INFO;
5582
- title = '';
5583
- msg = '';
5584
- id;
5585
- constructor(data, toast) {
5586
- this.data = data;
5587
- this.toast = toast;
5588
- this.type = this.data.type;
5589
- this.title = this.data.title;
5590
- this.msg = this.data.msg;
5591
- this.id = this.data.id;
5592
- setTimeout(() => {
5593
- this.close();
5594
- }, 3000);
5595
- }
5596
- close() {
5597
- this.toast.close(this.id);
5582
+ class BizyCopyToClipboardService {
5583
+ #clipboard = inject(Clipboard);
5584
+ copy(data) {
5585
+ return new Promise((resolve, reject) => {
5586
+ try {
5587
+ if (!data) {
5588
+ resolve();
5589
+ return;
5590
+ }
5591
+ setTimeout(() => {
5592
+ let toCopy = '';
5593
+ if (typeof data === 'string' || data instanceof String) {
5594
+ toCopy = data;
5595
+ }
5596
+ else if (data.items && data.items.length > 0 && data.model) {
5597
+ for (const key in data.model) {
5598
+ if (key) {
5599
+ toCopy += `${data.model[key]},`;
5600
+ }
5601
+ }
5602
+ data.items.forEach(_item => {
5603
+ // Remove the last character (',')
5604
+ toCopy = toCopy.slice(0, -2);
5605
+ toCopy += '\n';
5606
+ for (const key in data.model) {
5607
+ let value = _item;
5608
+ const nestedProperty = key.split('.');
5609
+ nestedProperty.forEach(_property => {
5610
+ value = value[_property];
5611
+ });
5612
+ if (typeof value !== undefined && value !== null) {
5613
+ toCopy += `${String(value).replace(/\n/g, '')},`;
5614
+ }
5615
+ else {
5616
+ toCopy += ',';
5617
+ }
5618
+ }
5619
+ });
5620
+ }
5621
+ const pending = this.#clipboard.beginCopy(toCopy);
5622
+ let remainingAttempts = 3;
5623
+ const attempt = () => {
5624
+ const result = pending.copy();
5625
+ if (!result && --remainingAttempts) {
5626
+ setTimeout(attempt);
5627
+ }
5628
+ else {
5629
+ // Remember to destroy when you're done!
5630
+ pending.destroy();
5631
+ resolve();
5632
+ }
5633
+ };
5634
+ attempt();
5635
+ }, 100);
5636
+ }
5637
+ catch (error) {
5638
+ reject(error);
5639
+ }
5640
+ });
5598
5641
  }
5599
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyToastWrapperComponent, deps: [{ token: DIALOG_DATA }, { token: BizyToastService }], target: i0.ɵɵFactoryTarget.Component });
5600
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.1", type: BizyToastWrapperComponent, isStandalone: true, selector: "bizy-toast-wrapper", providers: [BizyToastService], ngImport: i0, template: "<div class=\"bizy-toast-wrapper bizy-toast-wrapper--{{type}}\">\n\n <button (click)=\"close()\" (keyup.enter)=\"close()\" class=\"bizy-toast-wrapper__close-button\">\n\n <svg \n data-name=\"Cancel button\"\n id=\"bizy-toast-wrapper-close-svg\" \n viewBox=\"0 0 200 200\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path id=\"bizy-toast-wrapper-close-svg-content\" d=\"M114,100l49-49a9.9,9.9,0,0,0-14-14L100,86,51,37A9.9,9.9,0,0,0,37,51l49,49L37,149a9.9,9.9,0,0,0,14,14l49-49,49,49a9.9,9.9,0,0,0,14-14Z\"/>\n </svg>\n\n </button>\n\n\n <h3 class=\"bizy-toast-wrapper__title bizy-toast-wrapper__title--{{type}}\" *ngIf=\"title\">{{title}}</h3>\n\n <h5 class=\"bizy-toast-wrapper__msg\" *ngIf=\"msg\">{{msg}}</h5>\n\n\n <span class=\"bizy-toast__progress bizy-toast__progress--{{type}}\"></span>\n \n</div>", styles: [":host{font-size:1rem}.bizy-toast-wrapper{position:relative;width:100%;min-width:20rem;height:fit-content;min-height:3rem;border-left:var(--bizy-toast-border-left);border-top-left-radius:.5rem;border-bottom-left-radius:.5rem;display:flex;flex-direction:column;justify-content:center;row-gap:.5rem;padding:.5rem;box-shadow:0 18px 25px #32325d40,0 3px 6px #0000001a}.bizy-toast-wrapper__title{max-width:min(28rem,60vw)}.bizy-toast-wrapper__msg{max-width:min(30rem,70vw)}.bizy-toast-wrapper--default{background-color:var(--bizy-toast-default-background-color, );border-left-color:var(--bizy-toast-default-color)}.bizy-toast-wrapper__title--default{color:var(--bizy-toast-default-color)}.bizy-toast-wrapper--info{background-color:var(--bizy-toast-info-background-color, );border-left-color:var(--bizy-toast-info-color)}.bizy-toast-wrapper__title--info{color:var(--bizy-toast-info-color)}.bizy-toast-wrapper--success{background-color:var(--bizy-toast-success-background-color);border-left-color:var(--bizy-toast-success-color)}.bizy-toast-wrapper__title--success{color:var(--bizy-toast-success-color)}.bizy-toast-wrapper--warning{background-color:var(--bizy-toast-warning-background-color);border-left-color:var(--bizy-toast-warning-color)}.bizy-toast-wrapper__title--warning{color:var(--bizy-toast-warning-color)}.bizy-toast-wrapper--danger{background-color:var(--bizy-toast-danger-background-color);border-left-color:var(--bizy-toast-danger-color)}.bizy-toast-wrapper__title--danger{color:var(--bizy-toast-danger-color)}.bizy-toast-wrapper__close-button{position:absolute;right:.5rem;top:.5rem;border:none;cursor:pointer;background-color:transparent;transition:color .2s;z-index:1}.bizy-toast-wrapper__close-button #bizy-toast-wrapper-close-svg{height:1rem}.bizy-toast-wrapper__close-button #bizy-toast-wrapper-close-svg-content{fill:var(--bizy-toast-close-button-color)}.bizy-toast-wrapper__close-button:hover #bizy-toast-wrapper-close-svg-content{fill:var(--bizy-toast-close-button-hover-color)}.bizy-toast__progress{width:100%;height:.1rem;display:inline-block;position:absolute;bottom:0;left:0;right:0;overflow:hidden}.bizy-toast__progress--default{background-color:var(--bizy-toast-default-color)}.bizy-toast__progress--info{background-color:var(--bizy-toast-info-color)}.bizy-toast__progress--success{background-color:var(--bizy-toast-success-color)}.bizy-toast__progress--warning{background-color:var(--bizy-toast-warning-color)}.bizy-toast__progress--danger{background-color:var(--bizy-toast-danger-color)}.bizy-toast__progress:after{content:\"\";box-sizing:border-box;width:0;height:.1rem;background-color:#fff;position:absolute;top:0;left:0;animation:progress 2.5s linear infinite}@keyframes progress{0%{width:0}to{width:100%}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: DialogModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
5642
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyCopyToClipboardService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5643
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyCopyToClipboardService, providedIn: 'root' });
5601
5644
  }
5602
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyToastWrapperComponent, decorators: [{
5603
- type: Component,
5604
- args: [{ selector: 'bizy-toast-wrapper', imports: [CommonModule, DialogModule], providers: [BizyToastService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"bizy-toast-wrapper bizy-toast-wrapper--{{type}}\">\n\n <button (click)=\"close()\" (keyup.enter)=\"close()\" class=\"bizy-toast-wrapper__close-button\">\n\n <svg \n data-name=\"Cancel button\"\n id=\"bizy-toast-wrapper-close-svg\" \n viewBox=\"0 0 200 200\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path id=\"bizy-toast-wrapper-close-svg-content\" d=\"M114,100l49-49a9.9,9.9,0,0,0-14-14L100,86,51,37A9.9,9.9,0,0,0,37,51l49,49L37,149a9.9,9.9,0,0,0,14,14l49-49,49,49a9.9,9.9,0,0,0,14-14Z\"/>\n </svg>\n\n </button>\n\n\n <h3 class=\"bizy-toast-wrapper__title bizy-toast-wrapper__title--{{type}}\" *ngIf=\"title\">{{title}}</h3>\n\n <h5 class=\"bizy-toast-wrapper__msg\" *ngIf=\"msg\">{{msg}}</h5>\n\n\n <span class=\"bizy-toast__progress bizy-toast__progress--{{type}}\"></span>\n \n</div>", styles: [":host{font-size:1rem}.bizy-toast-wrapper{position:relative;width:100%;min-width:20rem;height:fit-content;min-height:3rem;border-left:var(--bizy-toast-border-left);border-top-left-radius:.5rem;border-bottom-left-radius:.5rem;display:flex;flex-direction:column;justify-content:center;row-gap:.5rem;padding:.5rem;box-shadow:0 18px 25px #32325d40,0 3px 6px #0000001a}.bizy-toast-wrapper__title{max-width:min(28rem,60vw)}.bizy-toast-wrapper__msg{max-width:min(30rem,70vw)}.bizy-toast-wrapper--default{background-color:var(--bizy-toast-default-background-color, );border-left-color:var(--bizy-toast-default-color)}.bizy-toast-wrapper__title--default{color:var(--bizy-toast-default-color)}.bizy-toast-wrapper--info{background-color:var(--bizy-toast-info-background-color, );border-left-color:var(--bizy-toast-info-color)}.bizy-toast-wrapper__title--info{color:var(--bizy-toast-info-color)}.bizy-toast-wrapper--success{background-color:var(--bizy-toast-success-background-color);border-left-color:var(--bizy-toast-success-color)}.bizy-toast-wrapper__title--success{color:var(--bizy-toast-success-color)}.bizy-toast-wrapper--warning{background-color:var(--bizy-toast-warning-background-color);border-left-color:var(--bizy-toast-warning-color)}.bizy-toast-wrapper__title--warning{color:var(--bizy-toast-warning-color)}.bizy-toast-wrapper--danger{background-color:var(--bizy-toast-danger-background-color);border-left-color:var(--bizy-toast-danger-color)}.bizy-toast-wrapper__title--danger{color:var(--bizy-toast-danger-color)}.bizy-toast-wrapper__close-button{position:absolute;right:.5rem;top:.5rem;border:none;cursor:pointer;background-color:transparent;transition:color .2s;z-index:1}.bizy-toast-wrapper__close-button #bizy-toast-wrapper-close-svg{height:1rem}.bizy-toast-wrapper__close-button #bizy-toast-wrapper-close-svg-content{fill:var(--bizy-toast-close-button-color)}.bizy-toast-wrapper__close-button:hover #bizy-toast-wrapper-close-svg-content{fill:var(--bizy-toast-close-button-hover-color)}.bizy-toast__progress{width:100%;height:.1rem;display:inline-block;position:absolute;bottom:0;left:0;right:0;overflow:hidden}.bizy-toast__progress--default{background-color:var(--bizy-toast-default-color)}.bizy-toast__progress--info{background-color:var(--bizy-toast-info-color)}.bizy-toast__progress--success{background-color:var(--bizy-toast-success-color)}.bizy-toast__progress--warning{background-color:var(--bizy-toast-warning-color)}.bizy-toast__progress--danger{background-color:var(--bizy-toast-danger-color)}.bizy-toast__progress:after{content:\"\";box-sizing:border-box;width:0;height:.1rem;background-color:#fff;position:absolute;top:0;left:0;animation:progress 2.5s linear infinite}@keyframes progress{0%{width:0}to{width:100%}}\n"] }]
5605
- }], ctorParameters: () => [{ type: undefined, decorators: [{
5606
- type: Inject,
5607
- args: [DIALOG_DATA]
5608
- }] }, { type: BizyToastService, decorators: [{
5609
- type: Inject,
5610
- args: [BizyToastService]
5611
- }] }] });
5645
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyCopyToClipboardService, decorators: [{
5646
+ type: Injectable,
5647
+ args: [{
5648
+ providedIn: 'root'
5649
+ }]
5650
+ }] });
5612
5651
 
5613
5652
  class BizyRepeatPipe {
5614
5653
  transform(value) {
@@ -5833,7 +5872,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
5833
5872
  args: [{
5834
5873
  name: 'bizySafe'
5835
5874
  }]
5836
- }], ctorParameters: () => [{ type: i1$5.DomSanitizer, decorators: [{
5875
+ }], ctorParameters: () => [{ type: i1$4.DomSanitizer, decorators: [{
5837
5876
  type: Inject,
5838
5877
  args: [DomSanitizer]
5839
5878
  }] }] });
@@ -6074,26 +6113,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
6074
6113
  args: [BizyFormatSecondsService]
6075
6114
  }] }] });
6076
6115
 
6077
- class BizyTranslatePipe {
6078
- translate;
6079
- constructor(translate) {
6080
- this.translate = translate;
6081
- }
6082
- transform(label) {
6083
- return this.translate.get(label);
6084
- }
6085
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyTranslatePipe, deps: [{ token: BizyTranslateService }], target: i0.ɵɵFactoryTarget.Pipe });
6086
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.1", ngImport: i0, type: BizyTranslatePipe, isStandalone: true, name: "translate" });
6116
+ const PIPES = [
6117
+ BizyRepeatPipe,
6118
+ BizySetToArrayPipe,
6119
+ BizyEnumToArrayPipe,
6120
+ BizySelectedPipe,
6121
+ BizyOrderByPipe,
6122
+ BizyReducePipe,
6123
+ BizySafePipe,
6124
+ BizyAveragePipe,
6125
+ BizySearchPipe,
6126
+ BizyFormatSecondsPipe,
6127
+ ];
6128
+ class BizyPipesModule {
6129
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyPipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
6130
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.1", ngImport: i0, type: BizyPipesModule, imports: [BizyRepeatPipe,
6131
+ BizySetToArrayPipe,
6132
+ BizyEnumToArrayPipe,
6133
+ BizySelectedPipe,
6134
+ BizyOrderByPipe,
6135
+ BizyReducePipe,
6136
+ BizySafePipe,
6137
+ BizyAveragePipe,
6138
+ BizySearchPipe,
6139
+ BizyFormatSecondsPipe], exports: [BizyRepeatPipe,
6140
+ BizySetToArrayPipe,
6141
+ BizyEnumToArrayPipe,
6142
+ BizySelectedPipe,
6143
+ BizyOrderByPipe,
6144
+ BizyReducePipe,
6145
+ BizySafePipe,
6146
+ BizyAveragePipe,
6147
+ BizySearchPipe,
6148
+ BizyFormatSecondsPipe] });
6149
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyPipesModule, providers: PIPES });
6087
6150
  }
6088
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyTranslatePipe, decorators: [{
6089
- type: Pipe,
6151
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyPipesModule, decorators: [{
6152
+ type: NgModule,
6090
6153
  args: [{
6091
- name: 'translate',
6154
+ imports: PIPES,
6155
+ exports: PIPES,
6156
+ providers: PIPES
6092
6157
  }]
6093
- }], ctorParameters: () => [{ type: BizyTranslateService, decorators: [{
6094
- type: Inject,
6095
- args: [BizyTranslateService]
6096
- }] }] });
6158
+ }] });
6097
6159
 
6098
6160
  class BizyCopyToClipboardDirective {
6099
6161
  elementRef;
@@ -6718,9 +6780,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
6718
6780
  type: Host
6719
6781
  }] }] });
6720
6782
 
6783
+ const DIRECTIVES = [
6784
+ BizyCopyToClipboardDirective,
6785
+ BizyCurrencyFormatDirective,
6786
+ BizyLoadingDirective,
6787
+ BizyLongPressDirective,
6788
+ BizyOnlyNumbersDirective,
6789
+ BizyOnlyPhoneDigitsDirective,
6790
+ BizyTextEllipsisDirective,
6791
+ BizyTooltipDirective,
6792
+ BizyTrackByIdDirective
6793
+ ];
6794
+ class BizyDirectivesModule {
6795
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyDirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
6796
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.1", ngImport: i0, type: BizyDirectivesModule, imports: [BizyCopyToClipboardDirective,
6797
+ BizyCurrencyFormatDirective,
6798
+ BizyLoadingDirective,
6799
+ BizyLongPressDirective,
6800
+ BizyOnlyNumbersDirective,
6801
+ BizyOnlyPhoneDigitsDirective,
6802
+ BizyTextEllipsisDirective,
6803
+ BizyTooltipDirective,
6804
+ BizyTrackByIdDirective], exports: [BizyCopyToClipboardDirective,
6805
+ BizyCurrencyFormatDirective,
6806
+ BizyLoadingDirective,
6807
+ BizyLongPressDirective,
6808
+ BizyOnlyNumbersDirective,
6809
+ BizyOnlyPhoneDigitsDirective,
6810
+ BizyTextEllipsisDirective,
6811
+ BizyTooltipDirective,
6812
+ BizyTrackByIdDirective] });
6813
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyDirectivesModule });
6814
+ }
6815
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyDirectivesModule, decorators: [{
6816
+ type: NgModule,
6817
+ args: [{
6818
+ imports: DIRECTIVES,
6819
+ exports: DIRECTIVES
6820
+ }]
6821
+ }] });
6822
+
6721
6823
  /**
6722
6824
  * Generated bundle index. Do not edit.
6723
6825
  */
6724
6826
 
6725
- export { BIZY_CALENDAR_DAY, BIZY_CALENDAR_EVENT_ACTION, BIZY_CALENDAR_LANGUAGE, BIZY_CALENDAR_MODE, BIZY_SKELETON_SHAPE, BIZY_TAG_TYPE, BizyAccordionComponent, BizyAnimationService, BizyAveragePipe, BizyBarLineChartComponent, BizyBreadcrumbComponent, BizyButtonComponent, BizyCacheService, BizyCalendarComponent, BizyCardComponent, BizyCheckboxComponent, BizyCopyToClipboardDirective, BizyCopyToClipboardService, BizyCurrencyFormatDirective, BizyDatePickerComponent, BizyEnumToArrayPipe, BizyExportToCSVService, BizyFileUploaderComponent, BizyFileUploaderService, BizyFilterComponent, BizyFilterContentComponent, BizyFilterPipe, BizyFilterSectionCheckboxOptionComponent, BizyFilterSectionComponent, BizyFilterSectionRangeOptionComponent, BizyFilterSectionSearchOptionComponent, BizyFilterSectionsComponent, BizyFormComponent, BizyFormatSecondsPipe, BizyGridComponent, BizyGridForDirective, BizyGridRowComponent, BizyInputComponent, BizyInputOptionComponent, BizyKeyboardService, BizyListComponent, BizyLoadingDirective, BizyLogService, BizyLongPressDirective, BizyMenuComponent, BizyMenuOptionComponent, BizyMenuTitleComponent, BizyOnlyNumbersDirective, BizyOnlyPhoneDigitsDirective, BizyOrderByPipe, BizyPieChartComponent, BizyPopupService, BizyPopupWrapperComponent, BizyRadioComponent, BizyRangeFilterPipe, BizyReducePipe, BizyRepeatPipe, BizyRouterService, BizySafePipe, BizySearchPipe, BizySelectComponent, BizySelectOptionComponent, BizySelectedPipe, BizySetToArrayPipe, BizySidebarComponent, BizySidebarFloatingOptionComponent, BizySidebarFloatingOptionTitleComponent, BizySidebarOptionComponent, BizySkeletonComponent, BizySliderComponent, BizyStorageService, BizyTabComponent, BizyTableColumnArrowsComponent, BizyTableColumnComponent, BizyTableColumnFixedDirective, BizyTableComponent, BizyTableFooterComponent, BizyTableHeaderComponent, BizyTableRowComponent, BizyTableRowExpandContentComponent, BizyTableScrollingComponent, BizyTableScrollingDirective, BizyTabsComponent, BizyTagComponent, BizyTextEllipsisDirective, BizyToastService, BizyToastWrapperComponent, BizyToggleComponent, BizyToolbarComponent, BizyTooltipDirective, BizyTrackByIdDirective, BizyTranslateModule, BizyTranslatePipe, BizyTranslateService, BizyUserAgentService, BizyValidatorService, BizyViewportService, LANGUAGE, LOADING_TYPE };
6827
+ export { BIZY_CALENDAR_DAY, BIZY_CALENDAR_EVENT_ACTION, BIZY_CALENDAR_LANGUAGE, BIZY_CALENDAR_MODE, BIZY_SKELETON_SHAPE, BIZY_TAG_TYPE, BizyAccordionComponent, BizyAnimationService, BizyAveragePipe, BizyBarLineChartComponent, BizyBreadcrumbComponent, BizyButtonComponent, BizyCacheService, BizyCalendarComponent, BizyCardComponent, BizyCheckboxComponent, BizyCopyToClipboardDirective, BizyCopyToClipboardService, BizyCurrencyFormatDirective, BizyDatePickerComponent, BizyDirectivesModule, BizyEnumToArrayPipe, BizyExportToCSVService, BizyFileUploaderComponent, BizyFileUploaderService, BizyFilterComponent, BizyFilterContentComponent, BizyFilterPipe, BizyFilterSectionCheckboxOptionComponent, BizyFilterSectionComponent, BizyFilterSectionRangeOptionComponent, BizyFilterSectionSearchOptionComponent, BizyFilterSectionsComponent, BizyFormComponent, BizyFormatSecondsPipe, BizyGridComponent, BizyGridForDirective, BizyGridRowComponent, BizyInputComponent, BizyInputOptionComponent, BizyKeyboardService, BizyListComponent, BizyLoadingDirective, BizyLogService, BizyLongPressDirective, BizyMenuComponent, BizyMenuOptionComponent, BizyMenuTitleComponent, BizyOnlyNumbersDirective, BizyOnlyPhoneDigitsDirective, BizyOrderByPipe, BizyPieChartComponent, BizyPipesModule, BizyPopupModule, BizyPopupService, BizyPopupWrapperComponent, BizyRadioComponent, BizyRangeFilterPipe, BizyReducePipe, BizyRepeatPipe, BizyRouterService, BizySafePipe, BizySearchPipe, BizySelectComponent, BizySelectOptionComponent, BizySelectedPipe, BizySetToArrayPipe, BizySidebarComponent, BizySidebarFloatingOptionComponent, BizySidebarFloatingOptionTitleComponent, BizySidebarOptionComponent, BizySkeletonComponent, BizySliderComponent, BizyStorageService, BizyTabComponent, BizyTableColumnArrowsComponent, BizyTableColumnComponent, BizyTableColumnFixedDirective, BizyTableComponent, BizyTableFooterComponent, BizyTableHeaderComponent, BizyTableRowComponent, BizyTableRowExpandContentComponent, BizyTableScrollingComponent, BizyTableScrollingDirective, BizyTabsComponent, BizyTagComponent, BizyTextEllipsisDirective, BizyToastModule, BizyToastService, BizyToastWrapperComponent, BizyToggleComponent, BizyToolbarComponent, BizyTooltipDirective, BizyTrackByIdDirective, BizyTranslateModule, BizyTranslatePipe, BizyTranslateService, BizyUserAgentService, BizyValidatorService, BizyViewportService, LANGUAGE, LOADING_TYPE };
6726
6828
  //# sourceMappingURL=bizy-core.mjs.map