@bizy/core 19.14.6 → 19.15.1
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 +65 -37
- package/fesm2022/bizy-core.mjs.map +1 -1
- package/lib/modules/popup/full-screen-popup-wrapper/full-screen-popup-wrapper.component.d.ts +1 -0
- package/lib/modules/popup/popup-wrapper/popup-wrapper.component.d.ts +7 -0
- package/lib/modules/popup/popup.service.d.ts +6 -0
- package/lib/modules/toast/toast-wrapper/toast-wrapper.component.d.ts +1 -0
- package/lib/modules/toast/toast.service.d.ts +14 -5
- package/package.json +1 -1
- package/styles/variables.css +18 -3
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
|
|
|
@@ -3652,14 +3651,22 @@ class BizyPopupWrapperComponent {
|
|
|
3652
3651
|
disabled = false;
|
|
3653
3652
|
disableClose = false;
|
|
3654
3653
|
disableDrag = false;
|
|
3654
|
+
position = null;
|
|
3655
|
+
ngOnInit() {
|
|
3656
|
+
if (this.#data) {
|
|
3657
|
+
if (this.#data.position) {
|
|
3658
|
+
this.position = this.#data.position;
|
|
3659
|
+
}
|
|
3660
|
+
if (this.#data.disableClose) {
|
|
3661
|
+
this.disableClose = this.#data.disableClose;
|
|
3662
|
+
}
|
|
3663
|
+
if (this.#data.disableDrag) {
|
|
3664
|
+
this.disableDrag = this.#data.disableDrag;
|
|
3665
|
+
}
|
|
3666
|
+
}
|
|
3667
|
+
}
|
|
3655
3668
|
ngAfterViewInit() {
|
|
3656
3669
|
this.loadDynamicComponent();
|
|
3657
|
-
if (this.#data && this.#data.disableClose) {
|
|
3658
|
-
this.disableClose = this.#data.disableClose;
|
|
3659
|
-
}
|
|
3660
|
-
if (this.#data && this.#data.disableDrag) {
|
|
3661
|
-
this.disableDrag = this.#data.disableDrag;
|
|
3662
|
-
}
|
|
3663
3670
|
}
|
|
3664
3671
|
loadDynamicComponent = () => {
|
|
3665
3672
|
if (this.#data && this.#data.component) {
|
|
@@ -3673,11 +3680,17 @@ class BizyPopupWrapperComponent {
|
|
|
3673
3680
|
this.#popup.close({ id: this.#dialogRef.id });
|
|
3674
3681
|
}
|
|
3675
3682
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: BizyPopupWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3676
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.10", type: BizyPopupWrapperComponent, isStandalone: true, selector: "bizy-popup-wrapper", viewQueries: [{ propertyName: "dynamicComponentContainer", first: true, predicate: ["dynamicComponentContainer"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div class=\"bizy-popup-wrapper\" cdkDrag
|
|
3683
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.10", type: BizyPopupWrapperComponent, isStandalone: true, selector: "bizy-popup-wrapper", host: { properties: { "style.top": "position && position.top ? position.top : position ? \"\" : \"50%\"", "style.right": "position && position.right ? position.right : position ? \"\" : \"50%\"", "style.bottom": "position && position.bottom ? position.bottom : position ? \"\" : \"50%\"", "style.left": "position && position.left ? position.left : position ? \"\" : \"50%\"", "style.transform": "position ? \"\" : \"translate(-50%, -50%)\"" } }, viewQueries: [{ propertyName: "dynamicComponentContainer", first: true, predicate: ["dynamicComponentContainer"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div class=\"bizy-popup-wrapper\" cdkDrag *ngIf=\"!disableDrag\">\n\n <button class=\"bizy-popup-wrapper__drag-button\" cdkDragHandle>\n\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\" class=\"bizy-popup-wrapper__drag-button__icon\">\n <path d=\"M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4V224H109.3l9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4H224V402.7l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4V288H402.7l-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4H288V109.3l9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z\"/>\n </svg>\n\n </button>\n\n <button *ngIf=\"!disableClose\" class=\"bizy-popup-wrapper__close-button\" (click)=\"close()\" (keyup.enter)=\"close()\">\n\n\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\" class=\"bizy-popup-wrapper__close-button__icon\">\n <path d=\"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z\"/>\n </svg>\n\n </button>\n\n <ng-container #dynamicComponentContainer></ng-container>\n\n</div>\n\n<div class=\"bizy-popup-wrapper\" *ngIf=\"disableDrag\">\n\n <button *ngIf=\"!disableClose\" class=\"bizy-popup-wrapper__close-button\" (click)=\"close()\" (keyup.enter)=\"close()\">\n\n\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\" class=\"bizy-popup-wrapper__close-button__icon\">\n <path d=\"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z\"/>\n </svg>\n\n </button>\n\n <ng-container #dynamicComponentContainer></ng-container>\n\n</div>", styles: [":host{font-size:1rem;position:fixed!important;min-height:150px;min-width:150px;width:fit-content;height:fit-content;z-index:10}.bizy-popup-wrapper{position:relative;padding:var(--bizy-popup-padding);background-color:var(--bizy-popup-background-color);min-width:var(--bizy-popup-min-width);width:var(--bizy-popup-width);max-width:var(--bizy-popup-max-width)}.bizy-popup-wrapper__drag-button{position:absolute;left:-.9rem;top:-.9rem;border:var(--bizy-popup-drag-button-border);border-radius:50%;padding:.2rem;place-items:center;display:grid;background-color:var(--bizy-popup-drag-button-background-color);cursor:pointer;transition:transform .2s;z-index:1}.bizy-popup-wrapper__drag-button:hover{transform:scale(1.1)}.bizy-popup-wrapper__drag-button__icon{height:1rem}.bizy-popup-wrapper__drag-button__icon{fill:var(--bizy-popup-drag-button-color)}.bizy-popup-wrapper__close-button{position:absolute;right:-.9rem;top:-.9rem;border:var(--bizy-popup-close-button-border);border-radius:50%;padding:.25rem .35rem;place-items:center;display:grid;background-color:var(--bizy-popup-close-button-background-color);cursor:pointer;transition:transform .2s;z-index:1}.bizy-popup-wrapper__close-button:hover .bizy-popup-wrapper__close-button__icon{transform:scale(1.1)}.bizy-popup-wrapper__close-button:hover .bizy-popup-wrapper__close-button__icon{fill:var(--bizy-popup-close-button-hover-color)}.bizy-popup-wrapper__close-button__icon{height:1rem;transition:fill .2s ease,}.bizy-popup-wrapper__close-button__icon{fill:var(--bizy-popup-close-button-color)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: DialogModule }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2$3.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i2$3.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3677
3684
|
}
|
|
3678
3685
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: BizyPopupWrapperComponent, decorators: [{
|
|
3679
3686
|
type: Component,
|
|
3680
|
-
args: [{ selector: 'bizy-popup-wrapper', imports: [CommonModule, DialogModule, DragDropModule], changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3687
|
+
args: [{ selector: 'bizy-popup-wrapper', imports: [CommonModule, DialogModule, DragDropModule], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
3688
|
+
'[style.top]': 'position && position.top ? position.top : position ? "" : "50%"',
|
|
3689
|
+
'[style.right]': 'position && position.right ? position.right : position ? "" : "50%"',
|
|
3690
|
+
'[style.bottom]': 'position && position.bottom ? position.bottom : position ? "" : "50%"',
|
|
3691
|
+
'[style.left]': 'position && position.left ? position.left : position ? "" : "50%"',
|
|
3692
|
+
'[style.transform]': 'position ? "" : "translate(-50%, -50%)"'
|
|
3693
|
+
}, template: "<div class=\"bizy-popup-wrapper\" cdkDrag *ngIf=\"!disableDrag\">\n\n <button class=\"bizy-popup-wrapper__drag-button\" cdkDragHandle>\n\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\" class=\"bizy-popup-wrapper__drag-button__icon\">\n <path d=\"M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4V224H109.3l9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4H224V402.7l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4V288H402.7l-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4H288V109.3l9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z\"/>\n </svg>\n\n </button>\n\n <button *ngIf=\"!disableClose\" class=\"bizy-popup-wrapper__close-button\" (click)=\"close()\" (keyup.enter)=\"close()\">\n\n\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\" class=\"bizy-popup-wrapper__close-button__icon\">\n <path d=\"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z\"/>\n </svg>\n\n </button>\n\n <ng-container #dynamicComponentContainer></ng-container>\n\n</div>\n\n<div class=\"bizy-popup-wrapper\" *ngIf=\"disableDrag\">\n\n <button *ngIf=\"!disableClose\" class=\"bizy-popup-wrapper__close-button\" (click)=\"close()\" (keyup.enter)=\"close()\">\n\n\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\" class=\"bizy-popup-wrapper__close-button__icon\">\n <path d=\"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z\"/>\n </svg>\n\n </button>\n\n <ng-container #dynamicComponentContainer></ng-container>\n\n</div>", styles: [":host{font-size:1rem;position:fixed!important;min-height:150px;min-width:150px;width:fit-content;height:fit-content;z-index:10}.bizy-popup-wrapper{position:relative;padding:var(--bizy-popup-padding);background-color:var(--bizy-popup-background-color);min-width:var(--bizy-popup-min-width);width:var(--bizy-popup-width);max-width:var(--bizy-popup-max-width)}.bizy-popup-wrapper__drag-button{position:absolute;left:-.9rem;top:-.9rem;border:var(--bizy-popup-drag-button-border);border-radius:50%;padding:.2rem;place-items:center;display:grid;background-color:var(--bizy-popup-drag-button-background-color);cursor:pointer;transition:transform .2s;z-index:1}.bizy-popup-wrapper__drag-button:hover{transform:scale(1.1)}.bizy-popup-wrapper__drag-button__icon{height:1rem}.bizy-popup-wrapper__drag-button__icon{fill:var(--bizy-popup-drag-button-color)}.bizy-popup-wrapper__close-button{position:absolute;right:-.9rem;top:-.9rem;border:var(--bizy-popup-close-button-border);border-radius:50%;padding:.25rem .35rem;place-items:center;display:grid;background-color:var(--bizy-popup-close-button-background-color);cursor:pointer;transition:transform .2s;z-index:1}.bizy-popup-wrapper__close-button:hover .bizy-popup-wrapper__close-button__icon{transform:scale(1.1)}.bizy-popup-wrapper__close-button:hover .bizy-popup-wrapper__close-button__icon{fill:var(--bizy-popup-close-button-hover-color)}.bizy-popup-wrapper__close-button__icon{height:1rem;transition:fill .2s ease,}.bizy-popup-wrapper__close-button__icon{fill:var(--bizy-popup-close-button-color)}\n"] }]
|
|
3681
3694
|
}], propDecorators: { dynamicComponentContainer: [{
|
|
3682
3695
|
type: ViewChild,
|
|
3683
3696
|
args: ['dynamicComponentContainer', { read: ViewContainerRef }]
|
|
@@ -4866,11 +4879,12 @@ class BizyPopupService {
|
|
|
4866
4879
|
data: {
|
|
4867
4880
|
component: data.component,
|
|
4868
4881
|
disableClose: data.disableCloseButton ?? false,
|
|
4869
|
-
disableDrag: data.disableDragButton ?? false
|
|
4882
|
+
disableDrag: data.disableDragButton ?? false,
|
|
4883
|
+
position: data.position,
|
|
4870
4884
|
},
|
|
4871
4885
|
autoFocus: true,
|
|
4872
4886
|
hasBackdrop: true,
|
|
4873
|
-
disableClose: data.disableBackdropClose ? data.disableBackdropClose : data.disableClose ? data.disableClose : true,
|
|
4887
|
+
disableClose: typeof data.disableBackdropClose !== 'undefined' && data.disableBackdropClose !== null ? data.disableBackdropClose : typeof data.disableClose !== 'undefined' && data.disableClose !== null ? data.disableClose : true,
|
|
4874
4888
|
panelClass: Array.isArray(data.customClass) ? data.customClass : this.#validator.isString(data.customClass) ? [data.customClass] : []
|
|
4875
4889
|
}));
|
|
4876
4890
|
BizyPopupService.dialogs.add(dialogRef);
|
|
@@ -4900,14 +4914,12 @@ class BizyPopupService {
|
|
|
4900
4914
|
dialogRef.close(data ? data.response : null);
|
|
4901
4915
|
BizyPopupService.dialogs.delete(dialogRef);
|
|
4902
4916
|
}
|
|
4903
|
-
this.#data = null;
|
|
4904
4917
|
}
|
|
4905
4918
|
closeAll() {
|
|
4906
4919
|
Array.from(BizyPopupService.dialogs).forEach(_dialogRef => {
|
|
4907
4920
|
_dialogRef.close();
|
|
4908
4921
|
});
|
|
4909
4922
|
BizyPopupService.dialogs.clear();
|
|
4910
|
-
this.#data = null;
|
|
4911
4923
|
}
|
|
4912
4924
|
openedPopups() {
|
|
4913
4925
|
return BizyPopupService.dialogs.size;
|
|
@@ -4928,14 +4940,18 @@ class BizyFullScreenPopupWrapperComponent {
|
|
|
4928
4940
|
disabled = false;
|
|
4929
4941
|
disableClose = false;
|
|
4930
4942
|
disableDrag = false;
|
|
4943
|
+
ngOnInit() {
|
|
4944
|
+
if (this.#data) {
|
|
4945
|
+
if (this.#data.disableClose) {
|
|
4946
|
+
this.disableClose = this.#data.disableClose;
|
|
4947
|
+
}
|
|
4948
|
+
if (this.#data.disableDrag) {
|
|
4949
|
+
this.disableDrag = this.#data.disableDrag;
|
|
4950
|
+
}
|
|
4951
|
+
}
|
|
4952
|
+
}
|
|
4931
4953
|
ngAfterViewInit() {
|
|
4932
4954
|
this.loadDynamicComponent();
|
|
4933
|
-
if (this.#data && this.#data.disableClose) {
|
|
4934
|
-
this.disableClose = this.#data.disableClose;
|
|
4935
|
-
}
|
|
4936
|
-
if (this.#data && this.#data.disableDrag) {
|
|
4937
|
-
this.disableDrag = this.#data.disableDrag;
|
|
4938
|
-
}
|
|
4939
4955
|
}
|
|
4940
4956
|
loadDynamicComponent = () => {
|
|
4941
4957
|
if (this.#data && this.#data.component) {
|
|
@@ -6528,24 +6544,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
|
6528
6544
|
var _a;
|
|
6529
6545
|
var TOAST;
|
|
6530
6546
|
(function (TOAST) {
|
|
6531
|
-
TOAST["
|
|
6547
|
+
TOAST["DEBUG"] = "debug";
|
|
6532
6548
|
TOAST["SUCCESS"] = "success";
|
|
6533
6549
|
TOAST["INFO"] = "info";
|
|
6534
6550
|
TOAST["WARNING"] = "warning";
|
|
6535
6551
|
TOAST["DANGER"] = "danger";
|
|
6536
6552
|
})(TOAST || (TOAST = {}));
|
|
6537
6553
|
class BizyToastService {
|
|
6538
|
-
|
|
6554
|
+
#document = inject(DOCUMENT);
|
|
6555
|
+
#dialog = inject(Dialog);
|
|
6539
6556
|
static toasts = new Set();
|
|
6540
6557
|
duration = 3000;
|
|
6558
|
+
defaultDebugTitle = 'Ha sucedido un evento';
|
|
6559
|
+
defaultInfoTitle = 'Observación';
|
|
6541
6560
|
defaultSuccessTitle = 'Operación exitosa';
|
|
6561
|
+
defaultWarningTitle = 'Advertencia';
|
|
6542
6562
|
defaultDangerTitle = 'Hubo un problema';
|
|
6543
|
-
constructor(dialog) {
|
|
6544
|
-
this.dialog = dialog;
|
|
6545
|
-
}
|
|
6546
6563
|
#open(data) {
|
|
6564
|
+
if (typeof data.data !== 'string' && data.data.duration) {
|
|
6565
|
+
this.duration = data.data.duration;
|
|
6566
|
+
this.#document.documentElement.style.setProperty('--bizy-toast-duration', `${data.data.duration}ms`);
|
|
6567
|
+
}
|
|
6547
6568
|
const id = `bizy-toast-${Math.random()}`;
|
|
6548
|
-
const toastRef = this
|
|
6569
|
+
const toastRef = this.#dialog.open(BizyToastWrapperComponent, {
|
|
6549
6570
|
id,
|
|
6550
6571
|
data: {
|
|
6551
6572
|
type: data.type,
|
|
@@ -6565,18 +6586,28 @@ class BizyToastService {
|
|
|
6565
6586
|
if (!data) {
|
|
6566
6587
|
return;
|
|
6567
6588
|
}
|
|
6589
|
+
if (data.defaultDebugTitle) {
|
|
6590
|
+
this.defaultDebugTitle = data.defaultDebugTitle;
|
|
6591
|
+
}
|
|
6592
|
+
if (data.defaultInfoTitle) {
|
|
6593
|
+
this.defaultInfoTitle = data.defaultInfoTitle;
|
|
6594
|
+
}
|
|
6568
6595
|
if (data.defaultSuccessTitle) {
|
|
6569
6596
|
this.defaultSuccessTitle = data.defaultSuccessTitle;
|
|
6570
6597
|
}
|
|
6598
|
+
if (data.defaultWarningTitle) {
|
|
6599
|
+
this.defaultWarningTitle = data.defaultWarningTitle;
|
|
6600
|
+
}
|
|
6571
6601
|
if (data.defaultDangerTitle) {
|
|
6572
6602
|
this.defaultDangerTitle = data.defaultDangerTitle;
|
|
6573
6603
|
}
|
|
6574
6604
|
if (data.duration) {
|
|
6575
6605
|
this.duration = data.duration;
|
|
6606
|
+
this.#document.documentElement.style.setProperty('--bizy-toast-duration', `${data.duration}ms`);
|
|
6576
6607
|
}
|
|
6577
6608
|
}
|
|
6578
|
-
|
|
6579
|
-
this.#open({ type: TOAST.
|
|
6609
|
+
debug(data) {
|
|
6610
|
+
this.#open({ type: TOAST.DEBUG, data });
|
|
6580
6611
|
}
|
|
6581
6612
|
info(data) {
|
|
6582
6613
|
this.#open({ type: TOAST.INFO, data });
|
|
@@ -6605,16 +6636,13 @@ class BizyToastService {
|
|
|
6605
6636
|
}, 500);
|
|
6606
6637
|
}
|
|
6607
6638
|
};
|
|
6608
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: BizyToastService, deps: [
|
|
6639
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: BizyToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6609
6640
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: BizyToastService });
|
|
6610
6641
|
}
|
|
6611
6642
|
_a = BizyToastService;
|
|
6612
6643
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: BizyToastService, decorators: [{
|
|
6613
6644
|
type: Injectable
|
|
6614
|
-
}]
|
|
6615
|
-
type: Inject,
|
|
6616
|
-
args: [Dialog]
|
|
6617
|
-
}] }] });
|
|
6645
|
+
}] });
|
|
6618
6646
|
|
|
6619
6647
|
class BizyToastWrapperComponent {
|
|
6620
6648
|
data;
|
|
@@ -6632,17 +6660,17 @@ class BizyToastWrapperComponent {
|
|
|
6632
6660
|
this.id = this.data.id;
|
|
6633
6661
|
setTimeout(() => {
|
|
6634
6662
|
this.close();
|
|
6635
|
-
}, 3000);
|
|
6663
|
+
}, this.data.duration || 3000);
|
|
6636
6664
|
}
|
|
6637
6665
|
close() {
|
|
6638
6666
|
this.toast.close(this.id);
|
|
6639
6667
|
}
|
|
6640
6668
|
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
|
|
6669
|
+
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
6670
|
}
|
|
6643
6671
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: BizyToastWrapperComponent, decorators: [{
|
|
6644
6672
|
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
|
|
6673
|
+
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
6674
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
6647
6675
|
type: Inject,
|
|
6648
6676
|
args: [DIALOG_DATA]
|
|
@@ -7038,7 +7066,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
|
7038
7066
|
args: [{
|
|
7039
7067
|
name: 'bizySafe'
|
|
7040
7068
|
}]
|
|
7041
|
-
}], ctorParameters: () => [{ type: i1$
|
|
7069
|
+
}], ctorParameters: () => [{ type: i1$2.DomSanitizer, decorators: [{
|
|
7042
7070
|
type: Inject,
|
|
7043
7071
|
args: [DomSanitizer]
|
|
7044
7072
|
}] }] });
|