@bizy/core 20.4.3 → 20.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ChangeDetectorRef, ElementRef, EventEmitter, Output, Input, ChangeDetectionStrategy, Component, NgModule, DOCUMENT, Renderer2, Injectable, Inject, Directive, ViewChild, ContentChildren, ContentChild, Pipe, ViewContainerRef, TemplateRef, RendererFactory2, HostListener, Host } from '@angular/core';
2
+ import { inject, ChangeDetectorRef, ElementRef, EventEmitter, Output, Input, ChangeDetectionStrategy, Component, NgModule, Renderer2, DOCUMENT as DOCUMENT$1, Injectable, Inject, Directive, ViewChild, ContentChildren, ContentChild, Pipe, ViewContainerRef, TemplateRef, RendererFactory2, HostListener, Host } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
- import { CommonModule, registerLocaleData, DatePipe, DOCUMENT as DOCUMENT$1 } from '@angular/common';
5
- import { Subject, Subscription, BehaviorSubject, filter, take, skip, auditTime, throttleTime, debounceTime as debounceTime$1, interval, fromEvent, merge } from 'rxjs';
6
- import { debounceTime, distinctUntilChanged, takeUntil, map, filter as filter$1, take as take$1 } from 'rxjs/operators';
4
+ import { CommonModule, DOCUMENT, registerLocaleData, DatePipe } from '@angular/common';
5
+ import { BehaviorSubject, Subject, Subscription, filter, take as take$1, skip, auditTime, throttleTime, debounceTime as debounceTime$1, interval, fromEvent, merge } from 'rxjs';
6
+ import { skipWhile, take, debounceTime, distinctUntilChanged, takeUntil, map, filter as filter$1 } from 'rxjs/operators';
7
7
  import html2canvas from 'html2canvas';
8
8
  import * as i2 from 'angular-calendar';
9
9
  import { CalendarNativeDateFormatter, CalendarModule, CalendarUtils, CalendarA11y, CalendarEventTitleFormatter, DateAdapter, CalendarDateFormatter } from 'angular-calendar';
@@ -99,6 +99,10 @@ var MIME_TYPE;
99
99
  MIME_TYPE["MPEG"] = "audio/mpeg";
100
100
  MIME_TYPE["WAV"] = "audio/wav";
101
101
  })(MIME_TYPE || (MIME_TYPE = {}));
102
+ var MODE;
103
+ (function (MODE) {
104
+ MODE["NORMAL"] = "NORMAL";
105
+ })(MODE || (MODE = {}));
102
106
 
103
107
  class BizyButtonComponent {
104
108
  #elementRef = inject(ElementRef);
@@ -152,98 +156,460 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
152
156
  class BizyAudioPlayerComponent {
153
157
  #document = inject(DOCUMENT);
154
158
  #renderer = inject(Renderer2);
159
+ #ref = inject(ChangeDetectorRef);
155
160
  #elementRef = inject(ElementRef);
156
161
  id = `bizy-audio-player-${Math.random()}`;
157
- mimeType;
162
+ enableLogs = false;
158
163
  audioPlayerError = 'Error';
159
164
  showDownload = true;
160
165
  autoplay = false;
161
166
  disabled = false;
162
167
  downloadURL;
163
168
  downloadFileName = 'bizy_audio';
169
+ onTrackPlayerRate = new EventEmitter();
164
170
  onDownload = new EventEmitter();
171
+ canPlay = new EventEmitter();
172
+ onPause = new EventEmitter();
173
+ onEnded = new EventEmitter();
174
+ onStalled = new EventEmitter();
175
+ onAbort = new EventEmitter();
176
+ onError = new EventEmitter();
177
+ onEmptied = new EventEmitter();
165
178
  canPlayThrough = new EventEmitter();
166
- onTrackPlayerRate = new EventEmitter();
179
+ durationChange = new EventEmitter();
180
+ onLoadedData = new EventEmitter();
181
+ onLoadedMetadata = new EventEmitter();
182
+ onLoadStart = new EventEmitter();
183
+ onPlay = new EventEmitter();
184
+ onPlaying = new EventEmitter();
185
+ onProgress = new EventEmitter();
186
+ onRateChange = new EventEmitter();
187
+ onSeeked = new EventEmitter();
188
+ onSeeking = new EventEmitter();
189
+ onSuspend = new EventEmitter();
190
+ onTimeUpdate = new EventEmitter();
191
+ onVolumeChange = new EventEmitter();
192
+ onWaiting = new EventEmitter();
193
+ #abortAbortController = new AbortController();
194
+ #canPlayAbortController = new AbortController();
195
+ #canPlayThroughAbortController = new AbortController();
196
+ #pauseAbortController = new AbortController();
197
+ #endedAbortController = new AbortController();
198
+ #emptiedAbortController = new AbortController();
199
+ #errorAbortController = new AbortController();
200
+ #stalledAbortController = new AbortController();
201
+ #durationChangeAbortController = new AbortController();
202
+ #loadedDataAbortController = new AbortController();
203
+ #loadedMetadataAbortController = new AbortController();
204
+ #loadStartAbortController = new AbortController();
205
+ #playAbortController = new AbortController();
206
+ #playingAbortController = new AbortController();
207
+ #progressAbortController = new AbortController();
208
+ #rateChangeAbortController = new AbortController();
209
+ #seekedAbortController = new AbortController();
210
+ #seekingAbortController = new AbortController();
211
+ #suspendAbortController = new AbortController();
212
+ #timeUpdateAbortController = new AbortController();
213
+ #volumeChangeAbortController = new AbortController();
214
+ #waitingAbortController = new AbortController();
215
+ #afterViewInit = new BehaviorSubject(false);
216
+ MIME_TYPE = MIME_TYPE;
217
+ MODE = MODE;
218
+ BACKWARD_SECONDS = -15;
219
+ FORWARD_SECONDS = 15;
220
+ _duration = 0;
221
+ _currentTime = 0;
222
+ _paused = true;
223
+ #normalRef;
224
+ _mode = MODE.NORMAL;
225
+ _audioURL = null;
226
+ _playbackRate = 1;
227
+ _loading = false;
228
+ #trackPlaybackRate$ = new Subject();
229
+ #subscription = new Subscription();
230
+ get duration() {
231
+ return this._duration;
232
+ }
233
+ get currentTime() {
234
+ return this._currentTime;
235
+ }
236
+ get paused() {
237
+ return this._paused;
238
+ }
167
239
  set audioURL(audioURL) {
168
240
  if (!audioURL) {
241
+ this.#removeListeners();
242
+ this._currentTime = 0;
243
+ this._duration = 0;
244
+ this._paused = true;
245
+ this.#normalRef = null;
246
+ this.#ref.detectChanges();
169
247
  return;
170
248
  }
171
- this._ready = false;
172
249
  this._audioURL = audioURL;
173
- if (!this.mimeType) {
174
- const isOGG = this._audioURL.toLowerCase().includes('ogg');
175
- if (isOGG) {
176
- this.mimeType = MIME_TYPE.OGG;
177
- }
178
- else {
179
- const isWAV = this._audioURL.toLowerCase().includes('wav');
180
- if (isWAV) {
181
- this.mimeType = MIME_TYPE.WAV;
182
- }
183
- else {
184
- this.mimeType = MIME_TYPE.MPEG;
185
- }
250
+ if (this._mode === MODE.NORMAL) {
251
+ this.#onNormal();
252
+ }
253
+ }
254
+ set mode(mode) {
255
+ if (!mode) {
256
+ return;
257
+ }
258
+ this._mode = mode;
259
+ this.#ref.detectChanges();
260
+ if (this._audioURL) {
261
+ if (this._mode === MODE.NORMAL) {
262
+ this.#onNormal();
186
263
  }
187
264
  }
188
- this.#audioRef = this.#document.getElementById(this.id);
189
- if (this.#audioRef) {
190
- this.#audioRef.load();
191
- this._trackPlayerRate();
265
+ }
266
+ ngAfterViewInit() {
267
+ this.#afterViewInit.next(true);
268
+ }
269
+ getNativeElement = () => this.#elementRef?.nativeElement;
270
+ #onNormal() {
271
+ this.#removeListeners();
272
+ this.#subscription = new Subscription();
273
+ this.#subscription.add(this.#afterViewInit.pipe(skipWhile(val => !val), take(1)).subscribe(() => {
274
+ this.#normalRef = this.#document.getElementById(this.id);
275
+ if (!this.#normalRef) {
276
+ return;
277
+ }
278
+ this.#addEventListeners(this.#normalRef);
279
+ this.#normalRef.load();
192
280
  if (this.autoplay) {
193
- this.#audioRef.play();
281
+ this.play();
194
282
  }
195
- }
196
- else {
197
- const interval = setInterval(() => {
198
- this.#audioRef = this.#document.getElementById(this.id);
199
- if (this.#audioRef) {
200
- this.#audioRef.load();
201
- this._trackPlayerRate();
202
- if (this.autoplay) {
203
- this.#audioRef.play();
204
- }
205
- clearInterval(interval);
206
- }
207
- }, 300);
208
- }
283
+ this.#trackPlayerRate();
284
+ this.#normalRef.playbackRate = this._playbackRate;
285
+ this.#ref.detectChanges();
286
+ }));
209
287
  }
210
- _audioURL = null;
211
- _ready = false;
212
- #audioRef;
213
- _playbackRate = 1;
214
- #trackPlaybackRate$ = new Subject();
215
- #subscription = new Subscription();
216
- _trackPlayerRate() {
288
+ #trackPlayerRate() {
217
289
  this.#subscription.add(this.#trackPlaybackRate$.pipe(debounceTime(500), distinctUntilChanged()).subscribe(value => {
218
290
  this.onTrackPlayerRate.emit(value);
219
291
  }));
220
292
  }
221
- _onTrackPlayerRate() {
222
- if (!this.disabled) {
293
+ #addEventListeners = (audio) => {
294
+ if (!audio) {
295
+ return;
296
+ }
297
+ this.#abortAbortController = new AbortController();
298
+ this.#canPlayAbortController = new AbortController();
299
+ this.#canPlayThroughAbortController = new AbortController();
300
+ this.#durationChangeAbortController = new AbortController();
301
+ this.#emptiedAbortController = new AbortController();
302
+ this.#endedAbortController = new AbortController();
303
+ this.#errorAbortController = new AbortController();
304
+ this.#loadedDataAbortController = new AbortController();
305
+ this.#loadedMetadataAbortController = new AbortController();
306
+ this.#loadStartAbortController = new AbortController();
307
+ this.#pauseAbortController = new AbortController();
308
+ this.#playAbortController = new AbortController();
309
+ this.#playingAbortController = new AbortController();
310
+ this.#progressAbortController = new AbortController();
311
+ this.#rateChangeAbortController = new AbortController();
312
+ this.#seekedAbortController = new AbortController();
313
+ this.#seekingAbortController = new AbortController();
314
+ this.#stalledAbortController = new AbortController();
315
+ this.#suspendAbortController = new AbortController();
316
+ this.#timeUpdateAbortController = new AbortController();
317
+ this.#volumeChangeAbortController = new AbortController();
318
+ this.#waitingAbortController = new AbortController();
319
+ audio.addEventListener('abort', (event) => {
320
+ if (this.enableLogs) {
321
+ console.debug('bizy audio player - abort', event);
322
+ }
323
+ this.onAbort.emit(event);
324
+ }, {
325
+ signal: this.#abortAbortController.signal
326
+ });
327
+ audio.addEventListener('canplay', (event) => {
328
+ if (this.enableLogs) {
329
+ console.debug('bizy audio player - canplay', event);
330
+ }
331
+ this.canPlay.emit(event);
332
+ }, {
333
+ once: true,
334
+ signal: this.#canPlayAbortController.signal
335
+ });
336
+ audio.addEventListener('canplaythrough', (event) => {
337
+ if (this.enableLogs) {
338
+ console.debug('bizy audio player - canplaythrough', event);
339
+ }
340
+ this.canPlayThrough.emit(event);
341
+ }, {
342
+ signal: this.#canPlayThroughAbortController.signal
343
+ });
344
+ audio.addEventListener('durationchange', (event) => {
345
+ if (this.enableLogs) {
346
+ console.debug('bizy audio player - durationchange', event);
347
+ }
348
+ this.durationChange.emit(event);
349
+ }, {
350
+ signal: this.#durationChangeAbortController.signal
351
+ });
352
+ audio.addEventListener('emptied', (event) => {
353
+ if (this.enableLogs) {
354
+ console.debug('bizy audio player - emptied', event);
355
+ }
356
+ this.onEmptied.emit(event);
357
+ }, {
358
+ signal: this.#emptiedAbortController.signal
359
+ });
360
+ audio.addEventListener('ended', (event) => {
361
+ if (this.enableLogs) {
362
+ console.debug('bizy audio player - ended', event);
363
+ }
364
+ this._paused = true;
365
+ this.#ref.detectChanges();
366
+ this.onEnded.emit(event);
367
+ }, {
368
+ signal: this.#endedAbortController.signal
369
+ });
370
+ audio.addEventListener('error', (event) => {
371
+ if (this.enableLogs) {
372
+ console.debug('bizy audio player - error', event);
373
+ }
374
+ this.onError.emit(event);
375
+ }, {
376
+ signal: this.#errorAbortController.signal
377
+ });
378
+ audio.addEventListener('loadeddata', (event) => {
379
+ if (this.enableLogs) {
380
+ console.debug('bizy audio player - loadeddata', event);
381
+ }
382
+ const audio = this.#normalRef;
383
+ this._duration = audio.duration;
384
+ this.onLoadedData.emit(event);
385
+ }, {
386
+ signal: this.#loadedDataAbortController.signal
387
+ });
388
+ audio.addEventListener('loadedmetadata', (event) => {
389
+ if (this.enableLogs) {
390
+ console.debug('bizy audio player - loadedmetadata', event);
391
+ }
392
+ this.onLoadedMetadata.emit(event);
393
+ }, {
394
+ signal: this.#loadedMetadataAbortController.signal
395
+ });
396
+ audio.addEventListener('loadstart', (event) => {
397
+ if (this.enableLogs) {
398
+ console.debug('bizy audio player - loadstart', event);
399
+ }
400
+ this.onLoadStart.emit(event);
401
+ }, {
402
+ signal: this.#loadStartAbortController.signal
403
+ });
404
+ audio.addEventListener('pause', (event) => {
405
+ if (this.enableLogs) {
406
+ console.debug('bizy audio player - pause', event);
407
+ }
408
+ this._paused = true;
409
+ this.#ref.detectChanges();
410
+ this.onPause.emit(event);
411
+ }, {
412
+ signal: this.#pauseAbortController.signal
413
+ });
414
+ audio.addEventListener('play', (event) => {
415
+ if (this.enableLogs) {
416
+ console.debug('bizy audio player - play', event);
417
+ }
418
+ this._paused = false;
419
+ this.#ref.detectChanges();
420
+ this.onPlay.emit(event);
421
+ }, {
422
+ signal: this.#playAbortController.signal
423
+ });
424
+ audio.addEventListener('playing', (event) => {
425
+ if (this.enableLogs) {
426
+ console.debug('bizy audio player - playing', event);
427
+ }
428
+ this._paused = false;
429
+ this.#ref.detectChanges();
430
+ this.onPlaying.emit(event);
431
+ }, {
432
+ signal: this.#playingAbortController.signal
433
+ });
434
+ audio.addEventListener('progress', (event) => {
435
+ if (this.enableLogs) {
436
+ console.debug('bizy audio player - progress', event);
437
+ }
438
+ this.onProgress.emit(event);
439
+ }, {
440
+ signal: this.#progressAbortController.signal
441
+ });
442
+ audio.addEventListener('ratechange', (event) => {
443
+ if (this.enableLogs) {
444
+ console.debug('bizy audio player - ratechange', event);
445
+ }
446
+ this.onRateChange.emit(event);
447
+ }, {
448
+ signal: this.#rateChangeAbortController.signal
449
+ });
450
+ audio.addEventListener('seeked', (event) => {
451
+ if (this.enableLogs) {
452
+ console.debug('bizy audio player - seeked', event);
453
+ }
454
+ this.onSeeked.emit(event);
455
+ }, {
456
+ signal: this.#seekedAbortController.signal
457
+ });
458
+ audio.addEventListener('seeking', (event) => {
459
+ if (this.enableLogs) {
460
+ console.debug('bizy audio player - seeking', event);
461
+ }
462
+ this.onSeeking.emit(event);
463
+ }, {
464
+ signal: this.#seekingAbortController.signal
465
+ });
466
+ audio.addEventListener('stalled', (event) => {
467
+ if (this.enableLogs) {
468
+ console.debug('bizy audio player - stalled', event);
469
+ }
470
+ this.onStalled.emit(event);
471
+ }, {
472
+ signal: this.#stalledAbortController.signal
473
+ });
474
+ audio.addEventListener('suspend', (event) => {
475
+ if (this.enableLogs) {
476
+ console.debug('bizy audio player - suspend', event);
477
+ }
478
+ this.onSuspend.emit(event);
479
+ }, {
480
+ signal: this.#suspendAbortController.signal
481
+ });
482
+ audio.addEventListener('timeupdate', (event) => {
483
+ if (this.enableLogs) {
484
+ console.debug('bizy audio player - timeupdate', event);
485
+ }
486
+ this._currentTime = audio.currentTime;
487
+ this.onTimeUpdate.emit(event);
488
+ }, {
489
+ signal: this.#timeUpdateAbortController.signal
490
+ });
491
+ audio.addEventListener('volumechange', (event) => {
492
+ if (this.enableLogs) {
493
+ console.debug('bizy audio player - volumechange', event);
494
+ }
495
+ this.onVolumeChange.emit(event);
496
+ }, {
497
+ signal: this.#volumeChangeAbortController.signal
498
+ });
499
+ audio.addEventListener('waiting', (event) => {
500
+ if (this.enableLogs) {
501
+ console.debug('bizy audio player - waiting', event);
502
+ }
503
+ this.onWaiting.emit(event);
504
+ }, {
505
+ signal: this.#waitingAbortController.signal
506
+ });
507
+ };
508
+ #removeListeners = () => {
509
+ this.#subscription.unsubscribe();
510
+ this.#abortAbortController.abort();
511
+ this.#canPlayAbortController.abort();
512
+ this.#canPlayThroughAbortController.abort();
513
+ this.#durationChangeAbortController.abort();
514
+ this.#emptiedAbortController.abort();
515
+ this.#endedAbortController.abort();
516
+ this.#errorAbortController.abort();
517
+ this.#loadedDataAbortController.abort();
518
+ this.#loadedMetadataAbortController.abort();
519
+ this.#loadStartAbortController.abort();
520
+ this.#pauseAbortController.abort();
521
+ this.#playAbortController.abort();
522
+ this.#playingAbortController.abort();
523
+ this.#progressAbortController.abort();
524
+ this.#rateChangeAbortController.abort();
525
+ this.#seekedAbortController.abort();
526
+ this.#seekingAbortController.abort();
527
+ this.#stalledAbortController.abort();
528
+ this.#suspendAbortController.abort();
529
+ this.#timeUpdateAbortController.abort();
530
+ this.#volumeChangeAbortController.abort();
531
+ this.#waitingAbortController.abort();
532
+ };
533
+ async play() {
534
+ try {
535
+ if (this.disabled || !this._audioURL || !this._paused) {
536
+ return Promise.resolve();
537
+ }
538
+ this._paused = false;
539
+ this.#ref.detectChanges();
540
+ const audio = this.#normalRef;
541
+ if (!audio) {
542
+ this._paused = true;
543
+ this.#ref.detectChanges();
544
+ return Promise.resolve();
545
+ }
546
+ await audio.play();
547
+ }
548
+ catch (error) {
549
+ this._paused = true;
550
+ return Promise.reject();
551
+ }
552
+ }
553
+ async pause() {
554
+ try {
555
+ if (this.disabled || !this._audioURL || this._paused) {
556
+ return Promise.resolve();
557
+ }
558
+ this._paused = true;
559
+ this.#ref.detectChanges();
560
+ const audio = this.#normalRef;
561
+ if (!audio) {
562
+ this._paused = false;
563
+ this.#ref.detectChanges();
564
+ return Promise.resolve();
565
+ }
566
+ await audio.pause();
567
+ }
568
+ catch (error) {
569
+ this._paused = false;
570
+ return Promise.reject();
571
+ }
572
+ }
573
+ async stop() {
574
+ if (this.disabled || !this._audioURL) {
575
+ return Promise.resolve();
576
+ }
577
+ await this.pause();
578
+ this.seekTo(0);
579
+ }
580
+ seekTo(seconds) {
581
+ if (this.disabled || this._loading) {
223
582
  return;
224
583
  }
225
- if (!this.#audioRef) {
226
- this.#audioRef = this.#document.getElementById(this.id);
584
+ const audio = this.#normalRef;
585
+ if (audio.duration && seconds <= audio.duration) {
586
+ audio.currentTime = seconds;
227
587
  }
228
- if (this.#audioRef) {
229
- switch (this.#audioRef.playbackRate) {
588
+ }
589
+ _onTrackPlayerRate() {
590
+ if (this.disabled || this._loading) {
591
+ return;
592
+ }
593
+ const audio = this.#normalRef;
594
+ if (audio) {
595
+ switch (audio.playbackRate) {
230
596
  case 1:
231
- this.#audioRef.playbackRate = 1.5;
597
+ audio.playbackRate = 1.5;
232
598
  this._playbackRate = 1.5;
233
599
  this.#trackPlaybackRate$.next('1.5');
234
600
  break;
235
601
  case 1.5:
236
- this.#audioRef.playbackRate = 2;
602
+ audio.playbackRate = 2;
237
603
  this._playbackRate = 2;
238
604
  this.#trackPlaybackRate$.next('2');
239
605
  break;
240
606
  case 2:
241
- this.#audioRef.playbackRate = 1;
607
+ audio.playbackRate = 1;
242
608
  this._playbackRate = 1;
243
609
  this.#trackPlaybackRate$.next('1');
244
610
  break;
245
611
  default:
246
- this.#audioRef.playbackRate = 1;
612
+ audio.playbackRate = 1;
247
613
  this._playbackRate = 1;
248
614
  this.#trackPlaybackRate$.next('1');
249
615
  }
@@ -261,19 +627,19 @@ class BizyAudioPlayerComponent {
261
627
  this.#renderer.removeChild(this.#document.body, downloadButton);
262
628
  this.onDownload.emit();
263
629
  }
264
- getNativeElement = () => this.#elementRef?.nativeElement;
265
630
  ngOnDestroy() {
266
631
  this.#subscription.unsubscribe();
632
+ this.#removeListeners();
267
633
  }
268
634
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyAudioPlayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
269
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.5", type: BizyAudioPlayerComponent, isStandalone: true, selector: "bizy-audio-player", inputs: { id: "id", mimeType: "mimeType", audioPlayerError: "audioPlayerError", showDownload: "showDownload", autoplay: "autoplay", disabled: "disabled", downloadURL: "downloadURL", downloadFileName: "downloadFileName", audioURL: "audioURL" }, outputs: { onDownload: "onDownload", canPlayThrough: "canPlayThrough", onTrackPlayerRate: "onTrackPlayerRate" }, ngImport: i0, template: "<audio\n class=\"bizy-audio-player__audio\"\n [ngClass]=\"{'bizy-audio-player__audio--disabled': disabled || !_audioURL || !_ready}\"\n [id]=\"id\"\n [autoplay]=\"autoplay\"\n controls\n (canplaythrough)=\"_ready = true; canPlayThrough.emit($event)\"\n controlslist=\"nodownload noplaybackrate\">\n <source [src]=\"_audioURL\" [type]=\"mimeType\">\n {{audioPlayerError}}\n</audio>\n\n<bizy-button customClass=\"bizy-audio-player__playback-rate\" (onSelect)=\"_onTrackPlayerRate()\" [disabled]=\"disabled || !_audioURL || !_ready\">\n <span>{{_playbackRate}}x</span>\n</bizy-button>\n\n<bizy-button customClass=\"bizy-audio-player__download-button\" *ngIf=\"showDownload\" (onSelect)=\"_onDownload()\" [disabled]=\"disabled || !_audioURL || !_ready\">\n <svg \n class=\"bizy-audio-player__download-button__icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"/><polyline points=\"7 10 12 15 17 10\"/><line x1=\"12\" x2=\"12\" y1=\"15\" y2=\"3\"/>\n </svg>\n</bizy-button>\n", styles: [":host{font-size:1rem;width:100%;display:flex;align-items:center;column-gap:1rem}.bizy-audio-player__audio--disabled{opacity:.5;pointer-events:none;cursor:not-allowed!important}.bizy-audio-player__audio{flex:1;width:100%}::ng-deep .bizy-audio-player__playback-rate{font-size:1rem;--bizy-button-background-color: var(--bizy-audio-player-playback-rate-background-color);--bizy-button-color: var(--bizy-audio-player-playback-rate-color);font-weight:700;border-radius:50%!important;width:4rem;height:2rem;display:grid;place-items:center;cursor:pointer}::ng-deep .bizy-audio-player__download-button{--bizy-button-background-color: var(--bizy-audio-player-download-button-background-color);--bizy-button-color: var(--bizy-audio-player-download-button-color)}.bizy-audio-player__download-button__icon{height:1rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: BizyButtonModule }, { kind: "component", type: BizyButtonComponent, selector: "bizy-button", inputs: ["id", "disabled", "type", "customClass"], outputs: ["onSelect"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
635
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.5", type: BizyAudioPlayerComponent, isStandalone: true, selector: "bizy-audio-player", inputs: { id: "id", enableLogs: "enableLogs", audioPlayerError: "audioPlayerError", showDownload: "showDownload", autoplay: "autoplay", disabled: "disabled", downloadURL: "downloadURL", downloadFileName: "downloadFileName", audioURL: "audioURL", mode: "mode" }, outputs: { onTrackPlayerRate: "onTrackPlayerRate", onDownload: "onDownload", canPlay: "canPlay", onPause: "onPause", onEnded: "onEnded", onStalled: "onStalled", onAbort: "onAbort", onError: "onError", onEmptied: "onEmptied", canPlayThrough: "canPlayThrough", durationChange: "durationChange", onLoadedData: "onLoadedData", onLoadedMetadata: "onLoadedMetadata", onLoadStart: "onLoadStart", onPlay: "onPlay", onPlaying: "onPlaying", onProgress: "onProgress", onRateChange: "onRateChange", onSeeked: "onSeeked", onSeeking: "onSeeking", onSuspend: "onSuspend", onTimeUpdate: "onTimeUpdate", onVolumeChange: "onVolumeChange", onWaiting: "onWaiting" }, ngImport: i0, template: "<audio\n class=\"bizy-audio-player__normal animated fade-in\"\n [ngClass]=\"{'bizy-audio-player--disabled': disabled || !_audioURL, 'animated fade-in': !disabled }\"\n [id]=\"id\"\n *ngIf=\"_mode === MODE.NORMAL\"\n controls\n controlslist=\"nodownload noplaybackrate\">\n <source [src]=\"_audioURL\" [type]=\"MIME_TYPE.WAV\">\n <source [src]=\"_audioURL\" [type]=\"MIME_TYPE.OGG\">\n <source [src]=\"_audioURL\" [type]=\"MIME_TYPE.MPEG\">\n {{audioPlayerError}}\n</audio>\n\n<bizy-button class=\"bizy-audio-player__rate-button\" (onSelect)=\"_onTrackPlayerRate()\" [disabled]=\"disabled || !_audioURL || _loading\">\n <h6>{{_playbackRate}}x</h6>\n</bizy-button>\n\n<bizy-button class=\"bizy-audio-player__download-button\" *ngIf=\"showDownload\" (onSelect)=\"_onDownload()\" [disabled]=\"disabled || !_audioURL\">\n <svg \n class=\"bizy-audio-player__button__icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"/><polyline points=\"7 10 12 15 17 10\"/><line x1=\"12\" x2=\"12\" y1=\"15\" y2=\"3\"/>\n </svg>\n</bizy-button>\n", styles: [":host{font-size:1rem;max-width:var(--bizy-audio-player-max-width);flex:1;display:flex;justify-content:flex-end;align-items:center;column-gap:1rem}.bizy-audio-player__normal{flex:1;width:100%;overflow:hidden;min-width:var(--bizy-audio-player-min-width)}.bizy-audio-player--disabled{opacity:.5;pointer-events:none;cursor:not-allowed!important}.bizy-audio-player__rate-button{--bizy-button-min-width: 2rem;--bizy-button-background-color: var(--bizy-audio-player-rate-button-background-color);--bizy-button-color: var(--bizy-audio-player-rate-button-color)}.bizy-audio-player__download-button{--bizy-button-background-color: var(--bizy-audio-player-download-button-background-color);--bizy-button-color: var(--bizy-audio-player-download-button-color)}.bizy-audio-player__button__icon{height:1rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: BizyButtonModule }, { kind: "component", type: BizyButtonComponent, selector: "bizy-button", inputs: ["id", "disabled", "type", "customClass"], outputs: ["onSelect"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
270
636
  }
271
637
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyAudioPlayerComponent, decorators: [{
272
638
  type: Component,
273
- args: [{ selector: 'bizy-audio-player', imports: [CommonModule, BizyButtonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<audio\n class=\"bizy-audio-player__audio\"\n [ngClass]=\"{'bizy-audio-player__audio--disabled': disabled || !_audioURL || !_ready}\"\n [id]=\"id\"\n [autoplay]=\"autoplay\"\n controls\n (canplaythrough)=\"_ready = true; canPlayThrough.emit($event)\"\n controlslist=\"nodownload noplaybackrate\">\n <source [src]=\"_audioURL\" [type]=\"mimeType\">\n {{audioPlayerError}}\n</audio>\n\n<bizy-button customClass=\"bizy-audio-player__playback-rate\" (onSelect)=\"_onTrackPlayerRate()\" [disabled]=\"disabled || !_audioURL || !_ready\">\n <span>{{_playbackRate}}x</span>\n</bizy-button>\n\n<bizy-button customClass=\"bizy-audio-player__download-button\" *ngIf=\"showDownload\" (onSelect)=\"_onDownload()\" [disabled]=\"disabled || !_audioURL || !_ready\">\n <svg \n class=\"bizy-audio-player__download-button__icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"/><polyline points=\"7 10 12 15 17 10\"/><line x1=\"12\" x2=\"12\" y1=\"15\" y2=\"3\"/>\n </svg>\n</bizy-button>\n", styles: [":host{font-size:1rem;width:100%;display:flex;align-items:center;column-gap:1rem}.bizy-audio-player__audio--disabled{opacity:.5;pointer-events:none;cursor:not-allowed!important}.bizy-audio-player__audio{flex:1;width:100%}::ng-deep .bizy-audio-player__playback-rate{font-size:1rem;--bizy-button-background-color: var(--bizy-audio-player-playback-rate-background-color);--bizy-button-color: var(--bizy-audio-player-playback-rate-color);font-weight:700;border-radius:50%!important;width:4rem;height:2rem;display:grid;place-items:center;cursor:pointer}::ng-deep .bizy-audio-player__download-button{--bizy-button-background-color: var(--bizy-audio-player-download-button-background-color);--bizy-button-color: var(--bizy-audio-player-download-button-color)}.bizy-audio-player__download-button__icon{height:1rem}\n"] }]
639
+ args: [{ selector: 'bizy-audio-player', imports: [CommonModule, BizyButtonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<audio\n class=\"bizy-audio-player__normal animated fade-in\"\n [ngClass]=\"{'bizy-audio-player--disabled': disabled || !_audioURL, 'animated fade-in': !disabled }\"\n [id]=\"id\"\n *ngIf=\"_mode === MODE.NORMAL\"\n controls\n controlslist=\"nodownload noplaybackrate\">\n <source [src]=\"_audioURL\" [type]=\"MIME_TYPE.WAV\">\n <source [src]=\"_audioURL\" [type]=\"MIME_TYPE.OGG\">\n <source [src]=\"_audioURL\" [type]=\"MIME_TYPE.MPEG\">\n {{audioPlayerError}}\n</audio>\n\n<bizy-button class=\"bizy-audio-player__rate-button\" (onSelect)=\"_onTrackPlayerRate()\" [disabled]=\"disabled || !_audioURL || _loading\">\n <h6>{{_playbackRate}}x</h6>\n</bizy-button>\n\n<bizy-button class=\"bizy-audio-player__download-button\" *ngIf=\"showDownload\" (onSelect)=\"_onDownload()\" [disabled]=\"disabled || !_audioURL\">\n <svg \n class=\"bizy-audio-player__button__icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"/><polyline points=\"7 10 12 15 17 10\"/><line x1=\"12\" x2=\"12\" y1=\"15\" y2=\"3\"/>\n </svg>\n</bizy-button>\n", styles: [":host{font-size:1rem;max-width:var(--bizy-audio-player-max-width);flex:1;display:flex;justify-content:flex-end;align-items:center;column-gap:1rem}.bizy-audio-player__normal{flex:1;width:100%;overflow:hidden;min-width:var(--bizy-audio-player-min-width)}.bizy-audio-player--disabled{opacity:.5;pointer-events:none;cursor:not-allowed!important}.bizy-audio-player__rate-button{--bizy-button-min-width: 2rem;--bizy-button-background-color: var(--bizy-audio-player-rate-button-background-color);--bizy-button-color: var(--bizy-audio-player-rate-button-color)}.bizy-audio-player__download-button{--bizy-button-background-color: var(--bizy-audio-player-download-button-background-color);--bizy-button-color: var(--bizy-audio-player-download-button-color)}.bizy-audio-player__button__icon{height:1rem}\n"] }]
274
640
  }], propDecorators: { id: [{
275
641
  type: Input
276
- }], mimeType: [{
642
+ }], enableLogs: [{
277
643
  type: Input
278
644
  }], audioPlayerError: [{
279
645
  type: Input
@@ -287,14 +653,58 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
287
653
  type: Input
288
654
  }], downloadFileName: [{
289
655
  type: Input
656
+ }], onTrackPlayerRate: [{
657
+ type: Output
290
658
  }], onDownload: [{
291
659
  type: Output
660
+ }], canPlay: [{
661
+ type: Output
662
+ }], onPause: [{
663
+ type: Output
664
+ }], onEnded: [{
665
+ type: Output
666
+ }], onStalled: [{
667
+ type: Output
668
+ }], onAbort: [{
669
+ type: Output
670
+ }], onError: [{
671
+ type: Output
672
+ }], onEmptied: [{
673
+ type: Output
292
674
  }], canPlayThrough: [{
293
675
  type: Output
294
- }], onTrackPlayerRate: [{
676
+ }], durationChange: [{
677
+ type: Output
678
+ }], onLoadedData: [{
679
+ type: Output
680
+ }], onLoadedMetadata: [{
681
+ type: Output
682
+ }], onLoadStart: [{
683
+ type: Output
684
+ }], onPlay: [{
685
+ type: Output
686
+ }], onPlaying: [{
687
+ type: Output
688
+ }], onProgress: [{
689
+ type: Output
690
+ }], onRateChange: [{
691
+ type: Output
692
+ }], onSeeked: [{
693
+ type: Output
694
+ }], onSeeking: [{
695
+ type: Output
696
+ }], onSuspend: [{
697
+ type: Output
698
+ }], onTimeUpdate: [{
699
+ type: Output
700
+ }], onVolumeChange: [{
701
+ type: Output
702
+ }], onWaiting: [{
295
703
  type: Output
296
704
  }], audioURL: [{
297
705
  type: Input
706
+ }], mode: [{
707
+ type: Input
298
708
  }] } });
299
709
 
300
710
  const COMPONENTS$u = [
@@ -318,16 +728,14 @@ const GRID_BOTTOM = 30;
318
728
  const DEFAULT_CHART_SIZE$2 = '300px';
319
729
  class BizyBarLineChartComponent {
320
730
  #elementRef = inject(ElementRef);
321
- #document = inject(DOCUMENT);
731
+ #document = inject(DOCUMENT$1);
322
732
  #ref = inject(ChangeDetectorRef);
323
733
  #renderer = inject(Renderer2);
324
734
  resizeRef = null;
325
- tooltip = true;
326
- download = { show: true, label: 'Descargar', name: 'Bizy' };
735
+ tooltip = null;
736
+ download = null;
327
737
  axisPointer = 'line';
328
- xAxisLabels = [];
329
- onTooltipFormatter;
330
- onXAxisLabelFormatter;
738
+ xAxis = null;
331
739
  onDownload = new EventEmitter();
332
740
  onSelect = new EventEmitter();
333
741
  #echarts = null;
@@ -362,7 +770,7 @@ class BizyBarLineChartComponent {
362
770
  this.#leftYAxis = 0;
363
771
  this.#chartStacks = [];
364
772
  this.#chartNames = [];
365
- this.#subscription.add(this.#afterViewInit.pipe(filter(value => value === true), take(1)).subscribe(() => {
773
+ this.#subscription.add(this.#afterViewInit.pipe(filter(value => value === true), take$1(1)).subscribe(() => {
366
774
  this.#createChartContainer();
367
775
  if (!this.#chartContainer) {
368
776
  return;
@@ -499,13 +907,13 @@ class BizyBarLineChartComponent {
499
907
  }
500
908
  });
501
909
  const tooltip = {
502
- show: this.tooltip,
910
+ show: this.tooltip?.show,
503
911
  trigger: 'axis',
504
912
  appendToBody: true,
505
913
  axisPointer: {
506
914
  type: this.axisPointer
507
915
  },
508
- formatter: this.onTooltipFormatter
916
+ formatter: this.tooltip?.formatter
509
917
  };
510
918
  const grid = {
511
919
  left: this.#leftYAxis > 2 ? (this.#leftYAxis - 2) * Y_AXIS_OFFSET : 10,
@@ -519,9 +927,9 @@ class BizyBarLineChartComponent {
519
927
  axisTick: {
520
928
  alignWithLabel: true
521
929
  },
522
- data: this.xAxisLabels,
930
+ data: this.xAxis?.labels,
523
931
  axisLabel: {
524
- formatter: this.onXAxisLabelFormatter,
932
+ formatter: this.xAxis.formatter,
525
933
  }
526
934
  }
527
935
  ];
@@ -533,13 +941,15 @@ class BizyBarLineChartComponent {
533
941
  const textColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-bar-line-chart-tooltip-color');
534
942
  const textBackgroundColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-bar-line-chart-tooltip-background-color');
535
943
  const borderColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-bar-line-chart-tooltip-border-color');
944
+ const downloadTitle = this.download?.label || 'Descargar';
945
+ const downloadName = this.download?.name || 'bizy_chart';
536
946
  const toolbox = {
537
947
  show: true,
538
948
  feature: {
539
949
  mySaveAsImage: {
540
- show: this.download.show,
950
+ show: this.download?.show,
541
951
  icon: 'path://M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 242.7-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7 288 32zM64 352c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-101.5 0-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352 64 352zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z',
542
- title: this.download.label,
952
+ title: downloadTitle,
543
953
  onclick: () => {
544
954
  const showAllLegends = (chart) => {
545
955
  const option = chart.getOption();
@@ -568,7 +978,7 @@ class BizyBarLineChartComponent {
568
978
  html2canvas(this.#chartContainer).then(canvas => {
569
979
  var link = this.#renderer.createElement('a');
570
980
  link.href = canvas.toDataURL('image/png');
571
- link.download = `${this.download.name}.png`;
981
+ link.download = downloadName;
572
982
  this.#renderer.appendChild(this.#document.body, link);
573
983
  link.click();
574
984
  this.#renderer.removeChild(this.#document.body, link);
@@ -668,7 +1078,7 @@ class BizyBarLineChartComponent {
668
1078
  }
669
1079
  }
670
1080
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyBarLineChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
671
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.5", type: BizyBarLineChartComponent, isStandalone: true, selector: "bizy-bar-line-chart", inputs: { resizeRef: "resizeRef", tooltip: "tooltip", download: "download", axisPointer: "axisPointer", xAxisLabels: "xAxisLabels", onTooltipFormatter: "onTooltipFormatter", onXAxisLabelFormatter: "onXAxisLabelFormatter", data: "data" }, outputs: { onDownload: "onDownload", onSelect: "onSelect" }, ngImport: i0, template: '', isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1081
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.5", type: BizyBarLineChartComponent, isStandalone: true, selector: "bizy-bar-line-chart", inputs: { resizeRef: "resizeRef", tooltip: "tooltip", download: "download", axisPointer: "axisPointer", xAxis: "xAxis", data: "data" }, outputs: { onDownload: "onDownload", onSelect: "onSelect" }, ngImport: i0, template: '', isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
672
1082
  }
673
1083
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyBarLineChartComponent, decorators: [{
674
1084
  type: Component,
@@ -686,11 +1096,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
686
1096
  type: Input
687
1097
  }], axisPointer: [{
688
1098
  type: Input
689
- }], xAxisLabels: [{
690
- type: Input
691
- }], onTooltipFormatter: [{
692
- type: Input
693
- }], onXAxisLabelFormatter: [{
1099
+ }], xAxis: [{
694
1100
  type: Input
695
1101
  }], onDownload: [{
696
1102
  type: Output
@@ -1085,11 +1491,11 @@ class BizyCardComponent {
1085
1491
  }
1086
1492
  getNativeElement = () => this.#elementRef?.nativeElement;
1087
1493
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1088
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.5", type: BizyCardComponent, isStandalone: true, selector: "bizy-card", inputs: { id: "id", disabled: "disabled", selected: "selected", customClass: "customClass" }, outputs: { onSelect: "onSelect" }, ngImport: i0, template: "<button \n type=\"button\"\n (click)=\"_onSelect($event)\"\n (keyup.enter)=\"_onSelect($event)\"\n class=\"bizy-card {{customClass}}\"\n [ngClass]=\"{'bizy-card--disabled': disabled}\">\n\n <span class=\"bizy-card__header\">\n\n <span class=\"bizy-card__header__start bizy-card__slot\">\n <ng-content select=\"[slot=header-start]\"></ng-content>\n </span>\n\n <span class=\"bizy-card__header__end bizy-card__slot\">\n <ng-content select=\"[slot=header-end]\"></ng-content>\n </span>\n\n </span>\n\n <span class=\"bizy-card__content\">\n\n <ng-content></ng-content>\n\n </span>\n\n <span class=\"bizy-card__footer\">\n\n <span class=\"bizy-card__footer__start bizy-card__slot\">\n <ng-content select=\"[slot=footer-start]\"></ng-content>\n </span>\n\n <span class=\"bizy-card__footer__end bizy-card__slot\">\n <ng-content select=\"[slot=footer-end]\"></ng-content>\n </span>\n\n </span>\n\n</button>", styles: [":host{font-size:1rem;height:var(--bizy-card-height);min-height:var(--bizy-card-min-height);max-height:var(--bizy-card-max-height);width:var(--bizy-card-width);min-width:var(--bizy-card-min-width);max-width:var(--bizy-card-max-width)}.bizy-card{height:100%;width:100%;cursor:var(--bizy-card-cursor);border-top:var(--bizy-card-border-top, var(--bizy-card-border, none));border-right:var(--bizy-card-border-right, var(--bizy-card-border, none));border-bottom:var(--bizy-card-border-bottom, var(--bizy-card-border, none));border-left:var(--bizy-card-border-left, var(--bizy-card-border, none));border-radius:var(--bizy-card-border-radius);overflow:hidden;padding:var(--bizy-card-padding);display:flex;flex-direction:column;justify-content:space-between;row-gap:.3rem;background-color:var(--bizy-card-background-color);transition:transform .25s ease-in-out;box-shadow:var(--bizy-card-box-shadow)}.bizy-card:hover{transform:translateY(-1px);box-shadow:var(--bizy-card-hover-box-shadow)}.bizy-card:has(>.bizy-card__content:empty)>.bizy-card__content{display:none}.bizy-card:has(>.bizy-card__content:empty)>.bizy-card__header:not(:empty){height:100%!important}.bizy-card:has(>.bizy-card__content:empty)>.bizy-card__footer:not(:empty){height:100%!important}.bizy-card--disabled{pointer-events:none;opacity:.5;cursor:not-allowed!important}.bizy-card__content:not(:empty){display:flex;align-items:center;column-gap:.5rem;height:100%;width:100%;background-color:var(--bizy-card-content-background-color)}.bizy-card__header:has(>.bizy-card__header__start:empty):has(>.bizy-card__header__end:empty){display:none}.bizy-card__header:not(:empty){width:100%;height:fit-content;display:grid;grid-template-columns:auto auto;align-items:center;column-gap:.5rem;background-color:var(--bizy-card-header-background-color)}.bizy-card__header__start{justify-content:flex-start}.bizy-card__header__end{justify-content:flex-end}.bizy-card__slot{width:100%;display:flex;align-items:center;column-gap:.5rem;height:100%;overflow:hidden}.bizy-card__footer:has(>.bizy-card__footer__start:empty):has(>.bizy-card__footer__end:empty){display:none}.bizy-card__footer:not(:empty){width:100%;height:fit-content;display:grid;grid-template-columns:auto auto;align-items:center;column-gap:.5rem;background-color:var(--bizy-card-footer-background-color)}.bizy-card__footer__start{justify-content:flex-start}.bizy-card__footer__end{justify-content:flex-end}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1494
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.5", type: BizyCardComponent, isStandalone: true, selector: "bizy-card", inputs: { id: "id", disabled: "disabled", selected: "selected", customClass: "customClass" }, outputs: { onSelect: "onSelect" }, ngImport: i0, template: "<button \n type=\"button\"\n (click)=\"_onSelect($event)\"\n (keyup.enter)=\"_onSelect($event)\"\n class=\"bizy-card {{customClass}}\"\n [ngClass]=\"{'bizy-card--disabled': disabled}\">\n\n <span class=\"bizy-card__header\">\n\n <span class=\"bizy-card__header__start bizy-card__slot\">\n <ng-content select=\"[slot=header-start]\"></ng-content>\n </span>\n\n <span class=\"bizy-card__header__end bizy-card__slot\">\n <ng-content select=\"[slot=header-end]\"></ng-content>\n </span>\n\n </span>\n\n <span class=\"bizy-card__content\">\n\n <ng-content></ng-content>\n\n </span>\n\n <span class=\"bizy-card__footer\">\n\n <span class=\"bizy-card__footer__start bizy-card__slot\">\n <ng-content select=\"[slot=footer-start]\"></ng-content>\n </span>\n\n <span class=\"bizy-card__footer__end bizy-card__slot\">\n <ng-content select=\"[slot=footer-end]\"></ng-content>\n </span>\n\n </span>\n\n</button>", styles: [":host{font-size:1rem;height:var(--bizy-card-height);min-height:var(--bizy-card-min-height);max-height:var(--bizy-card-max-height);width:var(--bizy-card-width);min-width:var(--bizy-card-min-width);max-width:var(--bizy-card-max-width)}.bizy-card{height:100%;width:100%;cursor:var(--bizy-card-cursor);border-top:var(--bizy-card-border-top, var(--bizy-card-border, none));border-right:var(--bizy-card-border-right, var(--bizy-card-border, none));border-bottom:var(--bizy-card-border-bottom, var(--bizy-card-border, none));border-left:var(--bizy-card-border-left, var(--bizy-card-border, none));border-radius:var(--bizy-card-border-radius);overflow:hidden;padding:var(--bizy-card-padding);display:flex;flex-direction:column;justify-content:space-between;row-gap:var(--bizy-card-row-gap);background-color:var(--bizy-card-background-color);transition:transform .25s ease-in-out;box-shadow:var(--bizy-card-box-shadow)}.bizy-card:hover{transform:translateY(-1px);box-shadow:var(--bizy-card-hover-box-shadow)}.bizy-card:has(>.bizy-card__content:empty)>.bizy-card__content{display:none}.bizy-card:has(>.bizy-card__content:empty)>.bizy-card__header:not(:empty){height:100%!important}.bizy-card:has(>.bizy-card__content:empty)>.bizy-card__footer:not(:empty){height:100%!important}.bizy-card--disabled{pointer-events:none;opacity:.5;cursor:not-allowed!important}.bizy-card__content:not(:empty){display:flex;align-items:center;column-gap:.5rem;height:100%;width:100%;background-color:var(--bizy-card-content-background-color)}.bizy-card__header:has(>.bizy-card__header__start:empty):has(>.bizy-card__header__end:empty){display:none}.bizy-card__header:not(:empty){width:100%;height:fit-content;display:grid;grid-template-columns:auto auto;align-items:center;column-gap:.5rem;background-color:var(--bizy-card-header-background-color)}.bizy-card__header__start{justify-content:flex-start}.bizy-card__header__end{justify-content:flex-end}.bizy-card__slot{width:100%;display:flex;align-items:center;column-gap:.5rem;height:100%;overflow:hidden}.bizy-card__footer:has(>.bizy-card__footer__start:empty):has(>.bizy-card__footer__end:empty){display:none}.bizy-card__footer:not(:empty){width:100%;height:fit-content;display:grid;grid-template-columns:auto auto;align-items:center;column-gap:.5rem;background-color:var(--bizy-card-footer-background-color)}.bizy-card__footer__start{justify-content:flex-start}.bizy-card__footer__end{justify-content:flex-end}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1089
1495
  }
1090
1496
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyCardComponent, decorators: [{
1091
1497
  type: Component,
1092
- args: [{ selector: 'bizy-card', imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button \n type=\"button\"\n (click)=\"_onSelect($event)\"\n (keyup.enter)=\"_onSelect($event)\"\n class=\"bizy-card {{customClass}}\"\n [ngClass]=\"{'bizy-card--disabled': disabled}\">\n\n <span class=\"bizy-card__header\">\n\n <span class=\"bizy-card__header__start bizy-card__slot\">\n <ng-content select=\"[slot=header-start]\"></ng-content>\n </span>\n\n <span class=\"bizy-card__header__end bizy-card__slot\">\n <ng-content select=\"[slot=header-end]\"></ng-content>\n </span>\n\n </span>\n\n <span class=\"bizy-card__content\">\n\n <ng-content></ng-content>\n\n </span>\n\n <span class=\"bizy-card__footer\">\n\n <span class=\"bizy-card__footer__start bizy-card__slot\">\n <ng-content select=\"[slot=footer-start]\"></ng-content>\n </span>\n\n <span class=\"bizy-card__footer__end bizy-card__slot\">\n <ng-content select=\"[slot=footer-end]\"></ng-content>\n </span>\n\n </span>\n\n</button>", styles: [":host{font-size:1rem;height:var(--bizy-card-height);min-height:var(--bizy-card-min-height);max-height:var(--bizy-card-max-height);width:var(--bizy-card-width);min-width:var(--bizy-card-min-width);max-width:var(--bizy-card-max-width)}.bizy-card{height:100%;width:100%;cursor:var(--bizy-card-cursor);border-top:var(--bizy-card-border-top, var(--bizy-card-border, none));border-right:var(--bizy-card-border-right, var(--bizy-card-border, none));border-bottom:var(--bizy-card-border-bottom, var(--bizy-card-border, none));border-left:var(--bizy-card-border-left, var(--bizy-card-border, none));border-radius:var(--bizy-card-border-radius);overflow:hidden;padding:var(--bizy-card-padding);display:flex;flex-direction:column;justify-content:space-between;row-gap:.3rem;background-color:var(--bizy-card-background-color);transition:transform .25s ease-in-out;box-shadow:var(--bizy-card-box-shadow)}.bizy-card:hover{transform:translateY(-1px);box-shadow:var(--bizy-card-hover-box-shadow)}.bizy-card:has(>.bizy-card__content:empty)>.bizy-card__content{display:none}.bizy-card:has(>.bizy-card__content:empty)>.bizy-card__header:not(:empty){height:100%!important}.bizy-card:has(>.bizy-card__content:empty)>.bizy-card__footer:not(:empty){height:100%!important}.bizy-card--disabled{pointer-events:none;opacity:.5;cursor:not-allowed!important}.bizy-card__content:not(:empty){display:flex;align-items:center;column-gap:.5rem;height:100%;width:100%;background-color:var(--bizy-card-content-background-color)}.bizy-card__header:has(>.bizy-card__header__start:empty):has(>.bizy-card__header__end:empty){display:none}.bizy-card__header:not(:empty){width:100%;height:fit-content;display:grid;grid-template-columns:auto auto;align-items:center;column-gap:.5rem;background-color:var(--bizy-card-header-background-color)}.bizy-card__header__start{justify-content:flex-start}.bizy-card__header__end{justify-content:flex-end}.bizy-card__slot{width:100%;display:flex;align-items:center;column-gap:.5rem;height:100%;overflow:hidden}.bizy-card__footer:has(>.bizy-card__footer__start:empty):has(>.bizy-card__footer__end:empty){display:none}.bizy-card__footer:not(:empty){width:100%;height:fit-content;display:grid;grid-template-columns:auto auto;align-items:center;column-gap:.5rem;background-color:var(--bizy-card-footer-background-color)}.bizy-card__footer__start{justify-content:flex-start}.bizy-card__footer__end{justify-content:flex-end}\n"] }]
1498
+ args: [{ selector: 'bizy-card', imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button \n type=\"button\"\n (click)=\"_onSelect($event)\"\n (keyup.enter)=\"_onSelect($event)\"\n class=\"bizy-card {{customClass}}\"\n [ngClass]=\"{'bizy-card--disabled': disabled}\">\n\n <span class=\"bizy-card__header\">\n\n <span class=\"bizy-card__header__start bizy-card__slot\">\n <ng-content select=\"[slot=header-start]\"></ng-content>\n </span>\n\n <span class=\"bizy-card__header__end bizy-card__slot\">\n <ng-content select=\"[slot=header-end]\"></ng-content>\n </span>\n\n </span>\n\n <span class=\"bizy-card__content\">\n\n <ng-content></ng-content>\n\n </span>\n\n <span class=\"bizy-card__footer\">\n\n <span class=\"bizy-card__footer__start bizy-card__slot\">\n <ng-content select=\"[slot=footer-start]\"></ng-content>\n </span>\n\n <span class=\"bizy-card__footer__end bizy-card__slot\">\n <ng-content select=\"[slot=footer-end]\"></ng-content>\n </span>\n\n </span>\n\n</button>", styles: [":host{font-size:1rem;height:var(--bizy-card-height);min-height:var(--bizy-card-min-height);max-height:var(--bizy-card-max-height);width:var(--bizy-card-width);min-width:var(--bizy-card-min-width);max-width:var(--bizy-card-max-width)}.bizy-card{height:100%;width:100%;cursor:var(--bizy-card-cursor);border-top:var(--bizy-card-border-top, var(--bizy-card-border, none));border-right:var(--bizy-card-border-right, var(--bizy-card-border, none));border-bottom:var(--bizy-card-border-bottom, var(--bizy-card-border, none));border-left:var(--bizy-card-border-left, var(--bizy-card-border, none));border-radius:var(--bizy-card-border-radius);overflow:hidden;padding:var(--bizy-card-padding);display:flex;flex-direction:column;justify-content:space-between;row-gap:var(--bizy-card-row-gap);background-color:var(--bizy-card-background-color);transition:transform .25s ease-in-out;box-shadow:var(--bizy-card-box-shadow)}.bizy-card:hover{transform:translateY(-1px);box-shadow:var(--bizy-card-hover-box-shadow)}.bizy-card:has(>.bizy-card__content:empty)>.bizy-card__content{display:none}.bizy-card:has(>.bizy-card__content:empty)>.bizy-card__header:not(:empty){height:100%!important}.bizy-card:has(>.bizy-card__content:empty)>.bizy-card__footer:not(:empty){height:100%!important}.bizy-card--disabled{pointer-events:none;opacity:.5;cursor:not-allowed!important}.bizy-card__content:not(:empty){display:flex;align-items:center;column-gap:.5rem;height:100%;width:100%;background-color:var(--bizy-card-content-background-color)}.bizy-card__header:has(>.bizy-card__header__start:empty):has(>.bizy-card__header__end:empty){display:none}.bizy-card__header:not(:empty){width:100%;height:fit-content;display:grid;grid-template-columns:auto auto;align-items:center;column-gap:.5rem;background-color:var(--bizy-card-header-background-color)}.bizy-card__header__start{justify-content:flex-start}.bizy-card__header__end{justify-content:flex-end}.bizy-card__slot{width:100%;display:flex;align-items:center;column-gap:.5rem;height:100%;overflow:hidden}.bizy-card__footer:has(>.bizy-card__footer__start:empty):has(>.bizy-card__footer__end:empty){display:none}.bizy-card__footer:not(:empty){width:100%;height:fit-content;display:grid;grid-template-columns:auto auto;align-items:center;column-gap:.5rem;background-color:var(--bizy-card-footer-background-color)}.bizy-card__footer__start{justify-content:flex-start}.bizy-card__footer__end{justify-content:flex-end}\n"] }]
1093
1499
  }], propDecorators: { id: [{
1094
1500
  type: Input
1095
1501
  }], disabled: [{
@@ -1735,7 +2141,7 @@ const EN = {
1735
2141
  };
1736
2142
  class BizyFileUploaderService {
1737
2143
  #renderer = inject(Renderer2);
1738
- #document = inject(DOCUMENT);
2144
+ #document = inject(DOCUMENT$1);
1739
2145
  #fileLoaded = new Subject();
1740
2146
  #fileRemoved = new Subject();
1741
2147
  #upload = new Subject();
@@ -2314,7 +2720,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
2314
2720
 
2315
2721
  class BizyFilterSectionComponent {
2316
2722
  #elementRef = inject(ElementRef);
2317
- #document = inject(DOCUMENT);
2723
+ #document = inject(DOCUMENT$1);
2318
2724
  #ref = inject(ChangeDetectorRef);
2319
2725
  checkboxOptions;
2320
2726
  rangeOption;
@@ -2447,7 +2853,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
2447
2853
 
2448
2854
  class BizyFilterComponent {
2449
2855
  #elementRef = inject(ElementRef);
2450
- #document = inject(DOCUMENT);
2856
+ #document = inject(DOCUMENT$1);
2451
2857
  #ref = inject(ChangeDetectorRef);
2452
2858
  sections;
2453
2859
  id = `bizy-filter-${Math.random()}`;
@@ -3014,7 +3420,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
3014
3420
  class BizyGridComponent {
3015
3421
  #elementRef = inject(ElementRef);
3016
3422
  #ref = inject(ChangeDetectorRef);
3017
- #document = inject(DOCUMENT);
3423
+ #document = inject(DOCUMENT$1);
3018
3424
  #renderer = inject(Renderer2);
3019
3425
  virtualScroll;
3020
3426
  content;
@@ -3169,18 +3575,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
3169
3575
  const DEFAULT_CHART_SIZE$1 = '300px';
3170
3576
  class BizyHeatMapChartComponent {
3171
3577
  #elementRef = inject(ElementRef);
3172
- #document = inject(DOCUMENT$1);
3578
+ #document = inject(DOCUMENT);
3173
3579
  #ref = inject(ChangeDetectorRef);
3174
3580
  #renderer = inject(Renderer2);
3175
3581
  resizeRef = null;
3176
- tooltip = true;
3582
+ tooltip = null;
3583
+ download = null;
3177
3584
  ranges = [];
3178
- download = { show: true, label: 'Descargar', name: 'Bizy' };
3179
- xAxisLabels = [];
3180
- yAxisLabels = [];
3181
- onTooltipFormatter;
3182
- onXAxisLabelFormatter;
3183
- onYAxisLabelFormatter;
3585
+ xAxis = null;
3586
+ yAxis = null;
3184
3587
  onDownload = new EventEmitter();
3185
3588
  onSelect = new EventEmitter();
3186
3589
  #echarts = null;
@@ -3207,7 +3610,7 @@ class BizyHeatMapChartComponent {
3207
3610
  }
3208
3611
  async #setChartData(data) {
3209
3612
  this.#data = data;
3210
- this.#subscription.add(this.#afterViewInit.pipe(filter(value => value === true), take(1)).subscribe(() => {
3613
+ this.#subscription.add(this.#afterViewInit.pipe(filter(value => value === true), take$1(1)).subscribe(() => {
3211
3614
  this.#createChartContainer();
3212
3615
  if (!this.#chartContainer) {
3213
3616
  return;
@@ -3220,7 +3623,7 @@ class BizyHeatMapChartComponent {
3220
3623
  show: this.tooltip,
3221
3624
  trigger: 'item',
3222
3625
  appendToBody: true,
3223
- formatter: this.onTooltipFormatter
3626
+ formatter: this.tooltip?.formatter
3224
3627
  };
3225
3628
  const xAxis = [
3226
3629
  {
@@ -3229,21 +3632,21 @@ class BizyHeatMapChartComponent {
3229
3632
  show: true
3230
3633
  },
3231
3634
  position: 'top',
3232
- data: this.xAxisLabels,
3635
+ data: this.xAxis?.labels,
3233
3636
  axisLabel: {
3234
- formatter: this.onXAxisLabelFormatter,
3637
+ formatter: this.xAxis?.formatter,
3235
3638
  }
3236
3639
  }
3237
3640
  ];
3238
3641
  const yAxis = [
3239
3642
  {
3240
3643
  type: 'category',
3241
- data: this.yAxisLabels,
3644
+ data: this.yAxis?.labels,
3242
3645
  splitArea: {
3243
3646
  show: true
3244
3647
  },
3245
3648
  axisLabel: {
3246
- formatter: this.onYAxisLabelFormatter,
3649
+ formatter: this.yAxis?.formatter,
3247
3650
  }
3248
3651
  }
3249
3652
  ];
@@ -3260,19 +3663,21 @@ class BizyHeatMapChartComponent {
3260
3663
  const textColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-heat-map-chart-tooltip-color');
3261
3664
  const textBackgroundColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-heat-map-chart-tooltip-background-color');
3262
3665
  const borderColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-heat-map-chart-tooltip-border-color');
3666
+ const downloadTitle = this.download?.label || 'Descargar';
3667
+ const downloadName = this.download?.name || 'bizy_chart';
3263
3668
  const toolbox = {
3264
3669
  show: true,
3265
3670
  feature: {
3266
3671
  mySaveAsImage: {
3267
- show: this.download.show,
3672
+ show: this.download?.show,
3268
3673
  icon: 'path://M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 242.7-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7 288 32zM64 352c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-101.5 0-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352 64 352zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z',
3269
- title: this.download.label,
3674
+ title: downloadTitle,
3270
3675
  onclick: () => {
3271
3676
  setTimeout(() => {
3272
3677
  html2canvas(this.#chartContainer).then(canvas => {
3273
3678
  var link = this.#renderer.createElement('a');
3274
3679
  link.href = canvas.toDataURL('image/png');
3275
- link.download = `${this.download.name}.png`;
3680
+ link.download = downloadName;
3276
3681
  this.#renderer.appendChild(this.#document.body, link);
3277
3682
  link.click();
3278
3683
  this.#renderer.removeChild(this.#document.body, link);
@@ -3370,7 +3775,7 @@ class BizyHeatMapChartComponent {
3370
3775
  }
3371
3776
  }
3372
3777
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyHeatMapChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3373
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.5", type: BizyHeatMapChartComponent, isStandalone: true, selector: "bizy-heat-map-chart", inputs: { resizeRef: "resizeRef", tooltip: "tooltip", ranges: "ranges", download: "download", xAxisLabels: "xAxisLabels", yAxisLabels: "yAxisLabels", onTooltipFormatter: "onTooltipFormatter", onXAxisLabelFormatter: "onXAxisLabelFormatter", onYAxisLabelFormatter: "onYAxisLabelFormatter", data: "data" }, outputs: { onDownload: "onDownload", onSelect: "onSelect" }, ngImport: i0, template: '', isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3778
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.5", type: BizyHeatMapChartComponent, isStandalone: true, selector: "bizy-heat-map-chart", inputs: { resizeRef: "resizeRef", tooltip: "tooltip", download: "download", ranges: "ranges", xAxis: "xAxis", yAxis: "yAxis", data: "data" }, outputs: { onDownload: "onDownload", onSelect: "onSelect" }, ngImport: i0, template: '', isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3374
3779
  }
3375
3780
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyHeatMapChartComponent, decorators: [{
3376
3781
  type: Component,
@@ -3384,19 +3789,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
3384
3789
  type: Input
3385
3790
  }], tooltip: [{
3386
3791
  type: Input
3387
- }], ranges: [{
3388
- type: Input
3389
3792
  }], download: [{
3390
3793
  type: Input
3391
- }], xAxisLabels: [{
3392
- type: Input
3393
- }], yAxisLabels: [{
3394
- type: Input
3395
- }], onTooltipFormatter: [{
3794
+ }], ranges: [{
3396
3795
  type: Input
3397
- }], onXAxisLabelFormatter: [{
3796
+ }], xAxis: [{
3398
3797
  type: Input
3399
- }], onYAxisLabelFormatter: [{
3798
+ }], yAxis: [{
3400
3799
  type: Input
3401
3800
  }], onDownload: [{
3402
3801
  type: Output
@@ -3642,17 +4041,16 @@ const EMPTY_CHART = [0];
3642
4041
  const DEFAULT_CHART_SIZE = '300px';
3643
4042
  class BizyPieChartComponent {
3644
4043
  #elementRef = inject(ElementRef);
3645
- #document = inject(DOCUMENT);
4044
+ #document = inject(DOCUMENT$1);
3646
4045
  #ref = inject(ChangeDetectorRef);
3647
4046
  #renderer = inject(Renderer2);
3648
4047
  resizeRef = null;
3649
- tooltip = true;
3650
4048
  centerLabel = null;
3651
4049
  type = 'pie';
3652
4050
  legend = null;
3653
- download = { show: true, label: 'Descargar', name: 'Bizy' };
3654
- onLabelFormatter;
3655
- onTooltipFormatter;
4051
+ download = null;
4052
+ label = null;
4053
+ tooltip = null;
3656
4054
  onSelect = new EventEmitter();
3657
4055
  onDownload = new EventEmitter();
3658
4056
  #echarts = null;
@@ -3679,7 +4077,7 @@ class BizyPieChartComponent {
3679
4077
  }
3680
4078
  }
3681
4079
  async #setChartData(data) {
3682
- this.#subscription.add(this.#afterViewInit.pipe(filter(value => value === true), take(1)).subscribe(() => {
4080
+ this.#subscription.add(this.#afterViewInit.pipe(filter(value => value === true), take$1(1)).subscribe(() => {
3683
4081
  this.#createChartContainer();
3684
4082
  if (!this.#chartContainer) {
3685
4083
  return;
@@ -3704,52 +4102,56 @@ class BizyPieChartComponent {
3704
4102
  else {
3705
4103
  this.#data = EMPTY_CHART;
3706
4104
  }
3707
- const itemStyle = this.type === 'pie' ? {
3708
- emphasis: {
3709
- label: {
3710
- show: true
3711
- }
3712
- },
3713
- normal: {
3714
- label: {
3715
- position: 'outer',
3716
- formatter: this.onLabelFormatter
3717
- },
3718
- labelLine: {
3719
- show: true
3720
- }
3721
- }
3722
- } :
4105
+ const itemStyle = this.type === 'donut' ?
3723
4106
  {
3724
4107
  borderRadius: 10,
3725
4108
  borderColor: '#fff',
3726
4109
  borderWidth: 2
3727
- };
3728
- const label = this.type === 'pie' ? undefined : { show: false, position: 'center' };
4110
+ } : {};
4111
+ const label = this.label ?
4112
+ {
4113
+ show: this.label.show ?? true,
4114
+ overflow: this.label.overflow ?? 'break',
4115
+ formatter: this.label?.formatter
4116
+ } :
4117
+ this.type === 'pie' ?
4118
+ {
4119
+ show: true
4120
+ } :
4121
+ {
4122
+ show: false,
4123
+ position: 'center'
4124
+ };
4125
+ const labelLine = {
4126
+ show: this.label?.line ?? true
4127
+ };
3729
4128
  const series = [{
3730
4129
  type: 'pie',
3731
4130
  radius: this.type === 'pie' ? '50%' : ['50%', '70%'],
3732
4131
  center: ['50%', '50%'],
3733
4132
  data: this.#data,
3734
4133
  itemStyle,
3735
- label
4134
+ label,
4135
+ labelLine
3736
4136
  }];
3737
4137
  const textColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-pie-chart-tooltip-color');
3738
4138
  const textBackgroundColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-pie-chart-tooltip-background-color');
3739
4139
  const borderColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-pie-chart-tooltip-border-color');
4140
+ const downloadTitle = this.download?.label || 'Descargar';
4141
+ const downloadName = this.download?.name || 'bizy_chart';
3740
4142
  const toolbox = {
3741
4143
  show: true,
3742
4144
  feature: {
3743
4145
  mySaveAsImage: {
3744
- show: this.download.show,
4146
+ show: this.download?.show,
3745
4147
  icon: 'path://M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 242.7-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7 288 32zM64 352c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-101.5 0-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352 64 352zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z',
3746
- title: this.download.label,
4148
+ title: downloadTitle,
3747
4149
  onclick: () => {
3748
4150
  setTimeout(() => {
3749
4151
  html2canvas(this.#chartContainer).then(canvas => {
3750
4152
  var link = this.#renderer.createElement('a');
3751
4153
  link.href = canvas.toDataURL('image/png');
3752
- link.download = `${this.download.name}.png`;
4154
+ link.download = downloadName;
3753
4155
  this.#renderer.appendChild(this.#document.body, link);
3754
4156
  link.click();
3755
4157
  this.#renderer.removeChild(this.#document.body, link);
@@ -3770,10 +4172,10 @@ class BizyPieChartComponent {
3770
4172
  }
3771
4173
  };
3772
4174
  const tooltip = {
3773
- show: this.tooltip,
4175
+ show: this.tooltip?.show,
3774
4176
  trigger: 'item',
3775
4177
  appendToBody: true,
3776
- formatter: this.onTooltipFormatter
4178
+ formatter: this.tooltip?.formatter
3777
4179
  };
3778
4180
  let legend = {};
3779
4181
  if (this.legend) {
@@ -3885,7 +4287,7 @@ class BizyPieChartComponent {
3885
4287
  }
3886
4288
  }
3887
4289
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyPieChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3888
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.5", type: BizyPieChartComponent, isStandalone: true, selector: "bizy-pie-chart", inputs: { resizeRef: "resizeRef", tooltip: "tooltip", centerLabel: "centerLabel", type: "type", legend: "legend", download: "download", onLabelFormatter: "onLabelFormatter", onTooltipFormatter: "onTooltipFormatter", data: "data" }, outputs: { onSelect: "onSelect", onDownload: "onDownload" }, ngImport: i0, template: '', isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4290
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.5", type: BizyPieChartComponent, isStandalone: true, selector: "bizy-pie-chart", inputs: { resizeRef: "resizeRef", centerLabel: "centerLabel", type: "type", legend: "legend", download: "download", label: "label", tooltip: "tooltip", data: "data" }, outputs: { onSelect: "onSelect", onDownload: "onDownload" }, ngImport: i0, template: '', isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3889
4291
  }
3890
4292
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyPieChartComponent, decorators: [{
3891
4293
  type: Component,
@@ -3897,8 +4299,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
3897
4299
  }]
3898
4300
  }], propDecorators: { resizeRef: [{
3899
4301
  type: Input
3900
- }], tooltip: [{
3901
- type: Input
3902
4302
  }], centerLabel: [{
3903
4303
  type: Input
3904
4304
  }], type: [{
@@ -3907,9 +4307,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
3907
4307
  type: Input
3908
4308
  }], download: [{
3909
4309
  type: Input
3910
- }], onLabelFormatter: [{
4310
+ }], label: [{
3911
4311
  type: Input
3912
- }], onTooltipFormatter: [{
4312
+ }], tooltip: [{
3913
4313
  type: Input
3914
4314
  }], onSelect: [{
3915
4315
  type: Output
@@ -4123,7 +4523,7 @@ class BizyKeyboardService {
4123
4523
  isControlHolding() {
4124
4524
  return this.#controlHolding.value;
4125
4525
  }
4126
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyKeyboardService, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
4526
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyKeyboardService, deps: [{ token: DOCUMENT$1 }], target: i0.ɵɵFactoryTarget.Injectable });
4127
4527
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyKeyboardService, providedIn: 'root' });
4128
4528
  }
4129
4529
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyKeyboardService, decorators: [{
@@ -4133,7 +4533,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
4133
4533
  }]
4134
4534
  }], ctorParameters: () => [{ type: Document, decorators: [{
4135
4535
  type: Inject,
4136
- args: [DOCUMENT]
4536
+ args: [DOCUMENT$1]
4137
4537
  }] }] });
4138
4538
 
4139
4539
  class BizyExportToCSVService {
@@ -4212,7 +4612,7 @@ class BizyExportToCSVService {
4212
4612
  downloadButton.click();
4213
4613
  this.#renderer.removeChild(this.document.body, downloadButton);
4214
4614
  }
4215
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyExportToCSVService, deps: [{ token: DOCUMENT }, { token: RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
4615
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyExportToCSVService, deps: [{ token: DOCUMENT$1 }, { token: RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
4216
4616
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyExportToCSVService, providedIn: 'root' });
4217
4617
  }
4218
4618
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyExportToCSVService, decorators: [{
@@ -4222,7 +4622,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
4222
4622
  }]
4223
4623
  }], ctorParameters: () => [{ type: Document, decorators: [{
4224
4624
  type: Inject,
4225
- args: [DOCUMENT]
4625
+ args: [DOCUMENT$1]
4226
4626
  }] }, { type: i0.RendererFactory2, decorators: [{
4227
4627
  type: Inject,
4228
4628
  args: [RendererFactory2]
@@ -5183,7 +5583,7 @@ class BizyPopupService {
5183
5583
  panelClass: Array.isArray(data.customClass) ? data.customClass : this.#validator.isString(data.customClass) ? [data.customClass] : []
5184
5584
  }));
5185
5585
  BizyPopupService.dialogs.add(dialogRef);
5186
- dialogRef.closed.pipe(take(1)).subscribe(response => {
5586
+ dialogRef.closed.pipe(take$1(1)).subscribe(response => {
5187
5587
  BizyPopupService.dialogs.delete(dialogRef);
5188
5588
  if (callback) {
5189
5589
  callback(response);
@@ -6333,7 +6733,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
6333
6733
  // https://github.com/angular/components/issues/15277
6334
6734
  class BizyTableScrollingComponent {
6335
6735
  #elementRef = inject(ElementRef);
6336
- #document = inject(DOCUMENT);
6736
+ #document = inject(DOCUMENT$1);
6337
6737
  #ref = inject(ChangeDetectorRef);
6338
6738
  viewport;
6339
6739
  content;
@@ -6349,7 +6749,7 @@ class BizyTableScrollingComponent {
6349
6749
  return;
6350
6750
  }
6351
6751
  let itemSize = 30;
6352
- const rowHeight = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--anura-table-row-height');
6752
+ const rowHeight = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-table-row-height');
6353
6753
  const fontSize = getComputedStyle(this.#document.documentElement).getPropertyValue('font-size');
6354
6754
  const gap = Number(fontSize.split('px')[0]) * 0.1;
6355
6755
  if (rowHeight && rowHeight.includes('rem')) {
@@ -6405,7 +6805,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
6405
6805
 
6406
6806
  class BizyTableComponent {
6407
6807
  #elementRef = inject(ElementRef);
6408
- #document = inject(DOCUMENT);
6808
+ #document = inject(DOCUMENT$1);
6409
6809
  #ref = inject(ChangeDetectorRef);
6410
6810
  #renderer = inject(Renderer2);
6411
6811
  viewport;
@@ -6934,7 +7334,7 @@ var TOAST;
6934
7334
  TOAST["DANGER"] = "danger";
6935
7335
  })(TOAST || (TOAST = {}));
6936
7336
  class BizyToastService {
6937
- #document = inject(DOCUMENT);
7337
+ #document = inject(DOCUMENT$1);
6938
7338
  #dialog = inject(Dialog);
6939
7339
  static toasts = [];
6940
7340
  duration = 3000;
@@ -8180,7 +8580,7 @@ class BizyTooltipDirective {
8180
8580
  tooltipLongPressDuration = 500; // Milliseconds
8181
8581
  #elementRef = inject(ElementRef);
8182
8582
  #renderer = inject(Renderer2);
8183
- #document = inject(DOCUMENT);
8583
+ #document = inject(DOCUMENT$1);
8184
8584
  #tooltip;
8185
8585
  #hiding;
8186
8586
  #longPressTimeout = null;
@@ -8427,7 +8827,7 @@ class BizyAutoFocusDirective {
8427
8827
  this.elementRef.nativeElement.focus();
8428
8828
  this.ref.detectChanges();
8429
8829
  }, 300);
8430
- fromEvent(this.elementRef.nativeElement, 'focus').pipe(take$1(1)).subscribe(() => {
8830
+ fromEvent(this.elementRef.nativeElement, 'focus').pipe(take(1)).subscribe(() => {
8431
8831
  clearInterval(interval);
8432
8832
  });
8433
8833
  }
@@ -8500,5 +8900,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
8500
8900
  * Generated bundle index. Do not edit.
8501
8901
  */
8502
8902
 
8503
- export { BIZY_ANIMATION, BIZY_CALENDAR_DAY, BIZY_CALENDAR_EVENT_ACTION, BIZY_CALENDAR_LANGUAGE, BIZY_CALENDAR_MODE, BIZY_FORMAT_SECONDS_FORMAT, BIZY_FORMAT_SECONDS_LANGUAGE, BIZY_SKELETON_SHAPE, BIZY_TAG_TYPE, BizyAccordionComponent, BizyAccordionModule, BizyAnimationService, BizyAudioPlayerComponent, BizyAudioPlayerModule, BizyAutoFocusDirective, BizyAveragePipe, BizyBarLineChartComponent, BizyBarLineChartModule, BizyBreadcrumbComponent, BizyBreadcrumbModule, BizyButtonComponent, BizyButtonModule, BizyCacheService, BizyCalendarComponent, BizyCalendarModule, BizyCardComponent, BizyCardModule, BizyCheckboxComponent, BizyCheckboxModule, BizyContentComponent, BizyContentModule, BizyCopyToClipboardDirective, BizyCopyToClipboardService, BizyCurrencyFormatDirective, BizyDatePickerComponent, BizyDatePickerModule, BizyDeviceService, BizyDirectivesModule, BizyEnumToArrayPipe, BizyExportToCSVService, BizyExtractNumbersPipe, BizyFileUploaderComponent, BizyFileUploaderModule, BizyFileUploaderService, BizyFilterComponent, BizyFilterContentComponent, BizyFilterModule, BizyFilterPipe, BizyFilterSectionCheckboxOptionComponent, BizyFilterSectionComponent, BizyFilterSectionRangeOptionComponent, BizyFilterSectionSearchOptionComponent, BizyFilterSectionsComponent, BizyFormComponent, BizyFormModule, BizyFormatSecondsPipe, BizyFormatSecondsService, BizyFullScreenPopupWrapperComponent, BizyGridComponent, BizyGridForDirective, BizyGridModule, BizyGridRowComponent, BizyHeatMapChartComponent, BizyHeatMapChartModule, BizyInputComponent, BizyInputModule, BizyInputOptionComponent, BizyKeyboardService, BizyListComponent, BizyListModule, BizyLoadingDirective, BizyLogService, BizyLongPressDirective, BizyMenuComponent, BizyMenuModule, BizyMenuOptionComponent, BizyMenuTitleComponent, BizyOnlyNumbersDirective, BizyOnlyPhoneDigitsDirective, BizyOrderByPipe, BizyPieChartComponent, BizyPieChartModule, BizyPipesModule, BizyPopupModule, BizyPopupService, BizyPopupWrapperComponent, BizyProgressBarComponent, BizyProgressBarModule, BizyRadioComponent, BizyRadioModule, BizyRangeFilterPipe, BizyReducePipe, BizyReloadDirective, BizyRepeatPipe, BizyRouterService, BizySafePipe, BizySearchPipe, BizySectionCenterComponent, BizySectionComponent, BizySectionEndComponent, BizySectionModule, BizySectionStartComponent, BizySelectComponent, BizySelectModule, BizySelectOptionComponent, BizyServicesModule, BizySetToArrayPipe, BizySidebarComponent, BizySidebarFloatingOptionComponent, BizySidebarFloatingOptionTitleComponent, BizySidebarModule, BizySidebarOptionComponent, BizySkeletonComponent, BizySkeletonModule, BizySliderComponent, BizySliderModule, BizyStorageService, BizyTabComponent, BizyTableColumnArrowsComponent, BizyTableColumnComponent, BizyTableColumnFixedDirective, BizyTableComponent, BizyTableFooterComponent, BizyTableHeaderComponent, BizyTableModule, BizyTableRowComponent, BizyTableRowExpandContentComponent, BizyTableScrollingComponent, BizyTableScrollingDirective, BizyTabsComponent, BizyTabsModule, BizyTagComponent, BizyTagModule, BizyTextEllipsisDirective, BizyTimelineComponent, BizyTimelineEventComponent, BizyTimelineModule, BizyToastModule, BizyToastService, BizyToastWrapperComponent, BizyToggleComponent, BizyToggleModule, BizyToolbarComponent, BizyToolbarModule, BizyTooltipDirective, BizyTrackByIdDirective, BizyTranslateModule, BizyTranslatePipe, BizyTranslateService, BizyValidatorService, BizyViewportService, LANGUAGE, LOADING_TYPE, MIME_TYPE };
8903
+ export { BIZY_ANIMATION, BIZY_CALENDAR_DAY, BIZY_CALENDAR_EVENT_ACTION, BIZY_CALENDAR_LANGUAGE, BIZY_CALENDAR_MODE, BIZY_FORMAT_SECONDS_FORMAT, BIZY_FORMAT_SECONDS_LANGUAGE, BIZY_SKELETON_SHAPE, BIZY_TAG_TYPE, BizyAccordionComponent, BizyAccordionModule, BizyAnimationService, BizyAudioPlayerComponent, BizyAudioPlayerModule, BizyAutoFocusDirective, BizyAveragePipe, BizyBarLineChartComponent, BizyBarLineChartModule, BizyBreadcrumbComponent, BizyBreadcrumbModule, BizyButtonComponent, BizyButtonModule, BizyCacheService, BizyCalendarComponent, BizyCalendarModule, BizyCardComponent, BizyCardModule, BizyCheckboxComponent, BizyCheckboxModule, BizyContentComponent, BizyContentModule, BizyCopyToClipboardDirective, BizyCopyToClipboardService, BizyCurrencyFormatDirective, BizyDatePickerComponent, BizyDatePickerModule, BizyDeviceService, BizyDirectivesModule, BizyEnumToArrayPipe, BizyExportToCSVService, BizyExtractNumbersPipe, BizyFileUploaderComponent, BizyFileUploaderModule, BizyFileUploaderService, BizyFilterComponent, BizyFilterContentComponent, BizyFilterModule, BizyFilterPipe, BizyFilterSectionCheckboxOptionComponent, BizyFilterSectionComponent, BizyFilterSectionRangeOptionComponent, BizyFilterSectionSearchOptionComponent, BizyFilterSectionsComponent, BizyFormComponent, BizyFormModule, BizyFormatSecondsPipe, BizyFormatSecondsService, BizyFullScreenPopupWrapperComponent, BizyGridComponent, BizyGridForDirective, BizyGridModule, BizyGridRowComponent, BizyHeatMapChartComponent, BizyHeatMapChartModule, BizyInputComponent, BizyInputModule, BizyInputOptionComponent, BizyKeyboardService, BizyListComponent, BizyListModule, BizyLoadingDirective, BizyLogService, BizyLongPressDirective, BizyMenuComponent, BizyMenuModule, BizyMenuOptionComponent, BizyMenuTitleComponent, BizyOnlyNumbersDirective, BizyOnlyPhoneDigitsDirective, BizyOrderByPipe, BizyPieChartComponent, BizyPieChartModule, BizyPipesModule, BizyPopupModule, BizyPopupService, BizyPopupWrapperComponent, BizyProgressBarComponent, BizyProgressBarModule, BizyRadioComponent, BizyRadioModule, BizyRangeFilterPipe, BizyReducePipe, BizyReloadDirective, BizyRepeatPipe, BizyRouterService, BizySafePipe, BizySearchPipe, BizySectionCenterComponent, BizySectionComponent, BizySectionEndComponent, BizySectionModule, BizySectionStartComponent, BizySelectComponent, BizySelectModule, BizySelectOptionComponent, BizyServicesModule, BizySetToArrayPipe, BizySidebarComponent, BizySidebarFloatingOptionComponent, BizySidebarFloatingOptionTitleComponent, BizySidebarModule, BizySidebarOptionComponent, BizySkeletonComponent, BizySkeletonModule, BizySliderComponent, BizySliderModule, BizyStorageService, BizyTabComponent, BizyTableColumnArrowsComponent, BizyTableColumnComponent, BizyTableColumnFixedDirective, BizyTableComponent, BizyTableFooterComponent, BizyTableHeaderComponent, BizyTableModule, BizyTableRowComponent, BizyTableRowExpandContentComponent, BizyTableScrollingComponent, BizyTableScrollingDirective, BizyTabsComponent, BizyTabsModule, BizyTagComponent, BizyTagModule, BizyTextEllipsisDirective, BizyTimelineComponent, BizyTimelineEventComponent, BizyTimelineModule, BizyToastModule, BizyToastService, BizyToastWrapperComponent, BizyToggleComponent, BizyToggleModule, BizyToolbarComponent, BizyToolbarModule, BizyTooltipDirective, BizyTrackByIdDirective, BizyTranslateModule, BizyTranslatePipe, BizyTranslateService, BizyValidatorService, BizyViewportService, LANGUAGE, LOADING_TYPE, MIME_TYPE, MODE };
8504
8904
  //# sourceMappingURL=bizy-core.mjs.map