@bizy/core 20.6.7 → 20.6.9
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 +28 -14
- package/fesm2022/bizy-core.mjs.map +1 -1
- package/index.d.ts +2 -3
- package/package.json +1 -1
- package/styles/variables.css +8 -0
package/fesm2022/bizy-core.mjs
CHANGED
|
@@ -7466,11 +7466,11 @@ class BizyTagComponent {
|
|
|
7466
7466
|
}
|
|
7467
7467
|
getNativeElement = () => this.#elementRef?.nativeElement;
|
|
7468
7468
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyTagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7469
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.5", type: BizyTagComponent, isStandalone: true, selector: "bizy-tag", inputs: { id: "id", customClass: "customClass", disabled: "disabled", type: "type" }, outputs: { onSelect: "onSelect" }, ngImport: i0, template: "<button \n type=\"button\"\n [id]=\"id\"\n (focus)=\"_focused = true\"\n (blur)=\"_focused = false\"\n [ngClass]=\"{'bizy-tag--disabled': disabled}\"\n class=\"bizy-tag bizy-tag--{{type}} {{customClass}}\"\n (click)=\"_focused = true; _onSelect($event)\"\n (keyup.enter)=\"_onSelect($event)\">\n\n <ng-content></ng-content>\n\n</button>", styles: [":host{font-size:1rem}.bizy-tag{border:none;
|
|
7469
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.5", type: BizyTagComponent, isStandalone: true, selector: "bizy-tag", inputs: { id: "id", customClass: "customClass", disabled: "disabled", type: "type" }, outputs: { onSelect: "onSelect" }, ngImport: i0, template: "<button \n type=\"button\"\n [id]=\"id\"\n (focus)=\"_focused = true\"\n (blur)=\"_focused = false\"\n [ngClass]=\"{'bizy-tag--disabled': disabled}\"\n class=\"bizy-tag bizy-tag--{{type}} {{customClass}}\"\n (click)=\"_focused = true; _onSelect($event)\"\n (keyup.enter)=\"_onSelect($event)\">\n\n <ng-content></ng-content>\n\n</button>", styles: [":host{font-size:1rem;display:inline-block;height:var(--bizy-tag-height);width:var(--bizy-tag-width);min-height:var(--bizy-tag-min-height);min-width:var(--bizy-tag-min-width);max-height:var(--bizy-tag-max-height);max-width:var(--bizy-tag-max-width)}.bizy-tag{height:100%;width:100%;cursor:var(--bizy-tag-cursor);border-top:var(--bizy-tag-border-top, var(--bizy-tag-border, none));border-right:var(--bizy-tag-border-right, var(--bizy-tag-border, none));border-bottom:var(--bizy-tag-border-bottom, var(--bizy-tag-border, none));border-left:var(--bizy-tag-border-left, var(--bizy-tag-border, none));border-radius:var(--bizy-tag-border-radius);padding:var(--bizy-tag-padding);display:flex;justify-content:center;column-gap:.5rem;align-items:center;text-wrap:nowrap}.bizy-tag--default{background-color:var(--bizy-tag-default-background-color)}::ng-deep .bizy-tag--default *{color:var(--bizy-tag-default-color)!important}.bizy-tag--info{background-color:var(--bizy-tag-info-background-color)}::ng-deep .bizy-tag--info *{color:var(--bizy-tag-info-color)!important}.bizy-tag--success{background-color:var(--bizy-tag-success-background-color)}::ng-deep .bizy-tag--success *{color:var(--bizy-tag-success-color)!important}.bizy-tag--warning{background-color:var(--bizy-tag-warning-background-color)}::ng-deep .bizy-tag--warning *{color:var(--bizy-tag-warning-color)!important}.bizy-tag--danger{background-color:var(--bizy-tag-danger-background-color)}::ng-deep .bizy-tag--danger *{color:var(--bizy-tag-danger-color)!important}.bizy-tag--disabled{opacity:.5;cursor:not-allowed!important;pointer-events:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7470
7470
|
}
|
|
7471
7471
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyTagComponent, decorators: [{
|
|
7472
7472
|
type: Component,
|
|
7473
|
-
args: [{ selector: 'bizy-tag', imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button \n type=\"button\"\n [id]=\"id\"\n (focus)=\"_focused = true\"\n (blur)=\"_focused = false\"\n [ngClass]=\"{'bizy-tag--disabled': disabled}\"\n class=\"bizy-tag bizy-tag--{{type}} {{customClass}}\"\n (click)=\"_focused = true; _onSelect($event)\"\n (keyup.enter)=\"_onSelect($event)\">\n\n <ng-content></ng-content>\n\n</button>", styles: [":host{font-size:1rem}.bizy-tag{border:none;
|
|
7473
|
+
args: [{ selector: 'bizy-tag', imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button \n type=\"button\"\n [id]=\"id\"\n (focus)=\"_focused = true\"\n (blur)=\"_focused = false\"\n [ngClass]=\"{'bizy-tag--disabled': disabled}\"\n class=\"bizy-tag bizy-tag--{{type}} {{customClass}}\"\n (click)=\"_focused = true; _onSelect($event)\"\n (keyup.enter)=\"_onSelect($event)\">\n\n <ng-content></ng-content>\n\n</button>", styles: [":host{font-size:1rem;display:inline-block;height:var(--bizy-tag-height);width:var(--bizy-tag-width);min-height:var(--bizy-tag-min-height);min-width:var(--bizy-tag-min-width);max-height:var(--bizy-tag-max-height);max-width:var(--bizy-tag-max-width)}.bizy-tag{height:100%;width:100%;cursor:var(--bizy-tag-cursor);border-top:var(--bizy-tag-border-top, var(--bizy-tag-border, none));border-right:var(--bizy-tag-border-right, var(--bizy-tag-border, none));border-bottom:var(--bizy-tag-border-bottom, var(--bizy-tag-border, none));border-left:var(--bizy-tag-border-left, var(--bizy-tag-border, none));border-radius:var(--bizy-tag-border-radius);padding:var(--bizy-tag-padding);display:flex;justify-content:center;column-gap:.5rem;align-items:center;text-wrap:nowrap}.bizy-tag--default{background-color:var(--bizy-tag-default-background-color)}::ng-deep .bizy-tag--default *{color:var(--bizy-tag-default-color)!important}.bizy-tag--info{background-color:var(--bizy-tag-info-background-color)}::ng-deep .bizy-tag--info *{color:var(--bizy-tag-info-color)!important}.bizy-tag--success{background-color:var(--bizy-tag-success-background-color)}::ng-deep .bizy-tag--success *{color:var(--bizy-tag-success-color)!important}.bizy-tag--warning{background-color:var(--bizy-tag-warning-background-color)}::ng-deep .bizy-tag--warning *{color:var(--bizy-tag-warning-color)!important}.bizy-tag--danger{background-color:var(--bizy-tag-danger-background-color)}::ng-deep .bizy-tag--danger *{color:var(--bizy-tag-danger-color)!important}.bizy-tag--disabled{opacity:.5;cursor:not-allowed!important;pointer-events:none}\n"] }]
|
|
7474
7474
|
}], propDecorators: { id: [{
|
|
7475
7475
|
type: Input
|
|
7476
7476
|
}], customClass: [{
|
|
@@ -7613,28 +7613,41 @@ class BizyToastService {
|
|
|
7613
7613
|
disableClose: false,
|
|
7614
7614
|
panelClass: ['bizy-toast', 'bizy-toast--in']
|
|
7615
7615
|
});
|
|
7616
|
-
|
|
7617
|
-
|
|
7616
|
+
let container = null;
|
|
7617
|
+
let tries = 3;
|
|
7618
|
+
const interval = setInterval(() => {
|
|
7619
|
+
if (tries <= 0) {
|
|
7620
|
+
_a.toasts.push({ ref: toastRef, element: null });
|
|
7621
|
+
clearInterval(interval);
|
|
7622
|
+
}
|
|
7623
|
+
container = this.#document.getElementById(id);
|
|
7618
7624
|
if (!container || !container.parentElement) {
|
|
7625
|
+
tries--;
|
|
7619
7626
|
return;
|
|
7620
7627
|
}
|
|
7621
7628
|
const offset = this.#calculateOffset();
|
|
7622
7629
|
container.parentElement.style.top = `${offset}px`;
|
|
7623
7630
|
_a.toasts.push({ ref: toastRef, element: container.parentElement });
|
|
7624
|
-
|
|
7631
|
+
tries = 0;
|
|
7632
|
+
clearInterval(interval);
|
|
7633
|
+
}, 300);
|
|
7625
7634
|
}
|
|
7626
7635
|
#calculateOffset = () => {
|
|
7627
7636
|
let offset = 10;
|
|
7628
7637
|
for (const toast of _a.toasts) {
|
|
7629
|
-
|
|
7638
|
+
if (toast.element) {
|
|
7639
|
+
offset += toast.element.offsetHeight + 10;
|
|
7640
|
+
}
|
|
7630
7641
|
}
|
|
7631
7642
|
return offset;
|
|
7632
7643
|
};
|
|
7633
7644
|
#repositionToasts = () => {
|
|
7634
7645
|
let offset = 10;
|
|
7635
7646
|
for (const toast of _a.toasts) {
|
|
7636
|
-
toast.element
|
|
7637
|
-
|
|
7647
|
+
if (toast.element) {
|
|
7648
|
+
toast.element.style.top = `${offset}px`;
|
|
7649
|
+
offset += toast.element.offsetHeight + 10;
|
|
7650
|
+
}
|
|
7638
7651
|
}
|
|
7639
7652
|
};
|
|
7640
7653
|
config(data) {
|
|
@@ -7677,10 +7690,13 @@ class BizyToastService {
|
|
|
7677
7690
|
this.#open({ type: TOAST.DANGER, data });
|
|
7678
7691
|
}
|
|
7679
7692
|
close = (id) => {
|
|
7680
|
-
if (!
|
|
7693
|
+
if (!_a.toasts || _a.toasts.length === 0) {
|
|
7681
7694
|
return;
|
|
7682
7695
|
}
|
|
7683
|
-
|
|
7696
|
+
let toast = _a.toasts.find(_toastRef => _toastRef.ref.id === id);
|
|
7697
|
+
if (!toast) {
|
|
7698
|
+
toast = _a.toasts[_a.toasts.length - 1];
|
|
7699
|
+
}
|
|
7684
7700
|
if (toast.ref) {
|
|
7685
7701
|
toast.ref.removePanelClass('bizy-toast--in');
|
|
7686
7702
|
toast.ref.addPanelClass('bizy-toast--out');
|
|
@@ -7700,14 +7716,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
|
|
|
7700
7716
|
}] });
|
|
7701
7717
|
|
|
7702
7718
|
class BizyToastWrapperComponent {
|
|
7703
|
-
#elementRef = inject(ElementRef);
|
|
7704
7719
|
#data = inject(DIALOG_DATA);
|
|
7705
7720
|
#toast = inject(BizyToastService);
|
|
7706
7721
|
type = TOAST.INFO;
|
|
7707
7722
|
title = '';
|
|
7708
7723
|
msg = '';
|
|
7709
7724
|
id;
|
|
7710
|
-
|
|
7725
|
+
constructor() {
|
|
7711
7726
|
if (!this.#data) {
|
|
7712
7727
|
this.close();
|
|
7713
7728
|
return;
|
|
@@ -7720,7 +7735,6 @@ class BizyToastWrapperComponent {
|
|
|
7720
7735
|
this.close();
|
|
7721
7736
|
}, this.#data.duration || 3000);
|
|
7722
7737
|
}
|
|
7723
|
-
getNativeElement = () => this.#elementRef?.nativeElement;
|
|
7724
7738
|
close() {
|
|
7725
7739
|
this.#toast.close(this.id);
|
|
7726
7740
|
}
|
|
@@ -7730,7 +7744,7 @@ class BizyToastWrapperComponent {
|
|
|
7730
7744
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyToastWrapperComponent, decorators: [{
|
|
7731
7745
|
type: Component,
|
|
7732
7746
|
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"] }]
|
|
7733
|
-
}] });
|
|
7747
|
+
}], ctorParameters: () => [] });
|
|
7734
7748
|
|
|
7735
7749
|
class BizyToastModule {
|
|
7736
7750
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyToastModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|