@bizy/core 19.14.6 → 19.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/fesm2022/bizy-core.mjs
CHANGED
|
@@ -27,7 +27,6 @@ import XHRUpload from '@uppy/xhr-upload';
|
|
|
27
27
|
import * as i3 from '@angular/cdk/portal';
|
|
28
28
|
import { TemplatePortal, PortalModule } from '@angular/cdk/portal';
|
|
29
29
|
import { ScrollingModule, CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
|
30
|
-
import * as i1$2 from '@angular/cdk/dialog';
|
|
31
30
|
import { DIALOG_DATA, DialogRef, DialogModule, Dialog } from '@angular/cdk/dialog';
|
|
32
31
|
import * as i2$3 from '@angular/cdk/drag-drop';
|
|
33
32
|
import { DragDropModule } from '@angular/cdk/drag-drop';
|
|
@@ -37,7 +36,7 @@ import validator from 'validator';
|
|
|
37
36
|
import { Clipboard } from '@angular/cdk/clipboard';
|
|
38
37
|
import { DeviceDetectorService } from 'ngx-device-detector';
|
|
39
38
|
import { TranslateService, TranslateModule } from '@ngx-translate/core';
|
|
40
|
-
import * as i1$
|
|
39
|
+
import * as i1$2 from '@angular/platform-browser';
|
|
41
40
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
42
41
|
import Fuse from 'fuse.js';
|
|
43
42
|
|
|
@@ -6528,24 +6527,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
|
6528
6527
|
var _a;
|
|
6529
6528
|
var TOAST;
|
|
6530
6529
|
(function (TOAST) {
|
|
6531
|
-
TOAST["
|
|
6530
|
+
TOAST["DEBUG"] = "debug";
|
|
6532
6531
|
TOAST["SUCCESS"] = "success";
|
|
6533
6532
|
TOAST["INFO"] = "info";
|
|
6534
6533
|
TOAST["WARNING"] = "warning";
|
|
6535
6534
|
TOAST["DANGER"] = "danger";
|
|
6536
6535
|
})(TOAST || (TOAST = {}));
|
|
6537
6536
|
class BizyToastService {
|
|
6538
|
-
|
|
6537
|
+
#document = inject(DOCUMENT);
|
|
6538
|
+
#dialog = inject(Dialog);
|
|
6539
6539
|
static toasts = new Set();
|
|
6540
6540
|
duration = 3000;
|
|
6541
|
+
defaultDebugTitle = 'Ha sucedido un evento';
|
|
6542
|
+
defaultInfoTitle = 'Observación';
|
|
6541
6543
|
defaultSuccessTitle = 'Operación exitosa';
|
|
6544
|
+
defaultWarningTitle = 'Advertencia';
|
|
6542
6545
|
defaultDangerTitle = 'Hubo un problema';
|
|
6543
|
-
constructor(dialog) {
|
|
6544
|
-
this.dialog = dialog;
|
|
6545
|
-
}
|
|
6546
6546
|
#open(data) {
|
|
6547
|
+
if (typeof data.data !== 'string' && data.data.duration) {
|
|
6548
|
+
this.duration = data.data.duration;
|
|
6549
|
+
this.#document.documentElement.style.setProperty('--bizy-toast-duration', `${data.data.duration}ms`);
|
|
6550
|
+
}
|
|
6547
6551
|
const id = `bizy-toast-${Math.random()}`;
|
|
6548
|
-
const toastRef = this
|
|
6552
|
+
const toastRef = this.#dialog.open(BizyToastWrapperComponent, {
|
|
6549
6553
|
id,
|
|
6550
6554
|
data: {
|
|
6551
6555
|
type: data.type,
|
|
@@ -6565,18 +6569,28 @@ class BizyToastService {
|
|
|
6565
6569
|
if (!data) {
|
|
6566
6570
|
return;
|
|
6567
6571
|
}
|
|
6572
|
+
if (data.defaultDebugTitle) {
|
|
6573
|
+
this.defaultDebugTitle = data.defaultDebugTitle;
|
|
6574
|
+
}
|
|
6575
|
+
if (data.defaultInfoTitle) {
|
|
6576
|
+
this.defaultInfoTitle = data.defaultInfoTitle;
|
|
6577
|
+
}
|
|
6568
6578
|
if (data.defaultSuccessTitle) {
|
|
6569
6579
|
this.defaultSuccessTitle = data.defaultSuccessTitle;
|
|
6570
6580
|
}
|
|
6581
|
+
if (data.defaultWarningTitle) {
|
|
6582
|
+
this.defaultWarningTitle = data.defaultWarningTitle;
|
|
6583
|
+
}
|
|
6571
6584
|
if (data.defaultDangerTitle) {
|
|
6572
6585
|
this.defaultDangerTitle = data.defaultDangerTitle;
|
|
6573
6586
|
}
|
|
6574
6587
|
if (data.duration) {
|
|
6575
6588
|
this.duration = data.duration;
|
|
6589
|
+
this.#document.documentElement.style.setProperty('--bizy-toast-duration', `${data.duration}ms`);
|
|
6576
6590
|
}
|
|
6577
6591
|
}
|
|
6578
|
-
|
|
6579
|
-
this.#open({ type: TOAST.
|
|
6592
|
+
debug(data) {
|
|
6593
|
+
this.#open({ type: TOAST.DEBUG, data });
|
|
6580
6594
|
}
|
|
6581
6595
|
info(data) {
|
|
6582
6596
|
this.#open({ type: TOAST.INFO, data });
|
|
@@ -6605,16 +6619,13 @@ class BizyToastService {
|
|
|
6605
6619
|
}, 500);
|
|
6606
6620
|
}
|
|
6607
6621
|
};
|
|
6608
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: BizyToastService, deps: [
|
|
6622
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: BizyToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6609
6623
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: BizyToastService });
|
|
6610
6624
|
}
|
|
6611
6625
|
_a = BizyToastService;
|
|
6612
6626
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: BizyToastService, decorators: [{
|
|
6613
6627
|
type: Injectable
|
|
6614
|
-
}]
|
|
6615
|
-
type: Inject,
|
|
6616
|
-
args: [Dialog]
|
|
6617
|
-
}] }] });
|
|
6628
|
+
}] });
|
|
6618
6629
|
|
|
6619
6630
|
class BizyToastWrapperComponent {
|
|
6620
6631
|
data;
|
|
@@ -6632,17 +6643,17 @@ class BizyToastWrapperComponent {
|
|
|
6632
6643
|
this.id = this.data.id;
|
|
6633
6644
|
setTimeout(() => {
|
|
6634
6645
|
this.close();
|
|
6635
|
-
}, 3000);
|
|
6646
|
+
}, this.data.duration || 3000);
|
|
6636
6647
|
}
|
|
6637
6648
|
close() {
|
|
6638
6649
|
this.toast.close(this.id);
|
|
6639
6650
|
}
|
|
6640
6651
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: BizyToastWrapperComponent, deps: [{ token: DIALOG_DATA }, { token: BizyToastService }], target: i0.ɵɵFactoryTarget.Component });
|
|
6641
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.10", 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
|
|
6652
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.10", type: BizyToastWrapperComponent, isStandalone: true, selector: "bizy-toast-wrapper", providers: [BizyToastService], ngImport: i0, template: "<div class=\"bizy-toast-wrapper bizy-toast-wrapper--{{type}}\">\n\n <span class=\"bizy-toast-wrapper__content\">\n\n <h4 class=\"bizy-toast-wrapper__title--{{type}}\" *ngIf=\"title\">{{title}}</h4>\n \n <h6 *ngIf=\"msg\">{{msg}}</h6>\n\n </span>\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 <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;max-width:min(30rem,80dvw);height:fit-content;min-height:3rem;max-height:95dvh;overflow-y:auto;border-top-width:var(--bizy-toast-border-top-width);border-right-width:var(--bizy-toast-border-right-width);border-bottom-width:var(--bizy-toast-border-bottom-width);border-left-width:var(--bizy-toast-border-left-width);border-top-style:var(--bizy-toast-border-top-style);border-right-style:var(--bizy-toast-border-right-style);border-bottom-style:var(--bizy-toast-border-bottom-style);border-left-style:var(--bizy-toast-border-left-style);border-top-left-radius:var(--bizy-toast-border-top-left-radius);border-top-right-radius:var(--bizy-toast-border-top-right-radius);border-bottom-left-radius:var(--bizy-toast-border-bottom-left-radius);border-bottom-right-radius:var(--bizy-toast-border-bottom-right-radius);display:flex;align-items:center;column-gap:.5rem;padding:.5rem;box-shadow:0 18px 25px #32325d40,0 3px 6px #0000001a}.bizy-toast-wrapper::-webkit-scrollbar{width:.5rem;height:.5rem}.bizy-toast-wrapper::-webkit-scrollbar-thumb{border-radius:1rem;background-color:var(--bizy-toast-scroll-bar-color)}.bizy-toast-wrapper::-webkit-scrollbar-thumb:hover{background-color:var(--bizy-toast-scroll-bar-hover-color)}.bizy-toast-wrapper__content{flex:1;display:flex;flex-direction:column;row-gap:.1rem}.bizy-toast-wrapper--debug{background-color:var(--bizy-toast-debug-background-color, );border-top-color:var(--bizy-toast-debug-color);border-right-color:var(--bizy-toast-debug-color);border-bottom-color:var(--bizy-toast-debug-color);border-left-color:var(--bizy-toast-debug-color)}.bizy-toast-wrapper__title--debug{color:var(--bizy-toast-debug-color)}.bizy-toast-wrapper--info{background-color:var(--bizy-toast-info-background-color, );border-top-color:var(--bizy-toast-info-color);border-right-color:var(--bizy-toast-info-color);border-bottom-color:var(--bizy-toast-info-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-top-color:var(--bizy-toast-success-color);border-right-color:var(--bizy-toast-success-color);border-bottom-color:var(--bizy-toast-success-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-top-color:var(--bizy-toast-warning-color);border-right-color:var(--bizy-toast-warning-color);border-bottom-color:var(--bizy-toast-warning-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-top-color:var(--bizy-toast-danger-color);border-right-color:var(--bizy-toast-danger-color);border-bottom-color:var(--bizy-toast-danger-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{border:none;cursor:pointer;align-self:flex-start;background-color:transparent;transition:color .2s;justify-self:flex-start}.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:var(--bizy-toast-progress-bar-height);display:inline-block;position:fixed;bottom:0;left:0;right:0;overflow:hidden}.bizy-toast__progress--debug{background-color:var(--bizy-toast-debug-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:var(--bizy-toast-progress-bar-height);background-color:#fff;position:absolute;top:0;left:0;animation:progress var(--bizy-toast-duration) 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 });
|
|
6642
6653
|
}
|
|
6643
6654
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: BizyToastWrapperComponent, decorators: [{
|
|
6644
6655
|
type: Component,
|
|
6645
|
-
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
|
|
6656
|
+
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 <span class=\"bizy-toast-wrapper__content\">\n\n <h4 class=\"bizy-toast-wrapper__title--{{type}}\" *ngIf=\"title\">{{title}}</h4>\n \n <h6 *ngIf=\"msg\">{{msg}}</h6>\n\n </span>\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 <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;max-width:min(30rem,80dvw);height:fit-content;min-height:3rem;max-height:95dvh;overflow-y:auto;border-top-width:var(--bizy-toast-border-top-width);border-right-width:var(--bizy-toast-border-right-width);border-bottom-width:var(--bizy-toast-border-bottom-width);border-left-width:var(--bizy-toast-border-left-width);border-top-style:var(--bizy-toast-border-top-style);border-right-style:var(--bizy-toast-border-right-style);border-bottom-style:var(--bizy-toast-border-bottom-style);border-left-style:var(--bizy-toast-border-left-style);border-top-left-radius:var(--bizy-toast-border-top-left-radius);border-top-right-radius:var(--bizy-toast-border-top-right-radius);border-bottom-left-radius:var(--bizy-toast-border-bottom-left-radius);border-bottom-right-radius:var(--bizy-toast-border-bottom-right-radius);display:flex;align-items:center;column-gap:.5rem;padding:.5rem;box-shadow:0 18px 25px #32325d40,0 3px 6px #0000001a}.bizy-toast-wrapper::-webkit-scrollbar{width:.5rem;height:.5rem}.bizy-toast-wrapper::-webkit-scrollbar-thumb{border-radius:1rem;background-color:var(--bizy-toast-scroll-bar-color)}.bizy-toast-wrapper::-webkit-scrollbar-thumb:hover{background-color:var(--bizy-toast-scroll-bar-hover-color)}.bizy-toast-wrapper__content{flex:1;display:flex;flex-direction:column;row-gap:.1rem}.bizy-toast-wrapper--debug{background-color:var(--bizy-toast-debug-background-color, );border-top-color:var(--bizy-toast-debug-color);border-right-color:var(--bizy-toast-debug-color);border-bottom-color:var(--bizy-toast-debug-color);border-left-color:var(--bizy-toast-debug-color)}.bizy-toast-wrapper__title--debug{color:var(--bizy-toast-debug-color)}.bizy-toast-wrapper--info{background-color:var(--bizy-toast-info-background-color, );border-top-color:var(--bizy-toast-info-color);border-right-color:var(--bizy-toast-info-color);border-bottom-color:var(--bizy-toast-info-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-top-color:var(--bizy-toast-success-color);border-right-color:var(--bizy-toast-success-color);border-bottom-color:var(--bizy-toast-success-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-top-color:var(--bizy-toast-warning-color);border-right-color:var(--bizy-toast-warning-color);border-bottom-color:var(--bizy-toast-warning-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-top-color:var(--bizy-toast-danger-color);border-right-color:var(--bizy-toast-danger-color);border-bottom-color:var(--bizy-toast-danger-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{border:none;cursor:pointer;align-self:flex-start;background-color:transparent;transition:color .2s;justify-self:flex-start}.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:var(--bizy-toast-progress-bar-height);display:inline-block;position:fixed;bottom:0;left:0;right:0;overflow:hidden}.bizy-toast__progress--debug{background-color:var(--bizy-toast-debug-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:var(--bizy-toast-progress-bar-height);background-color:#fff;position:absolute;top:0;left:0;animation:progress var(--bizy-toast-duration) linear infinite}@keyframes progress{0%{width:0}to{width:100%}}\n"] }]
|
|
6646
6657
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
6647
6658
|
type: Inject,
|
|
6648
6659
|
args: [DIALOG_DATA]
|
|
@@ -7038,7 +7049,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
|
7038
7049
|
args: [{
|
|
7039
7050
|
name: 'bizySafe'
|
|
7040
7051
|
}]
|
|
7041
|
-
}], ctorParameters: () => [{ type: i1$
|
|
7052
|
+
}], ctorParameters: () => [{ type: i1$2.DomSanitizer, decorators: [{
|
|
7042
7053
|
type: Inject,
|
|
7043
7054
|
args: [DomSanitizer]
|
|
7044
7055
|
}] }] });
|