ngx-kit 6.1.0 → 6.2.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/README.md +3 -3
- package/angle-selector/README.md +34 -34
- package/box-shadow/README.md +33 -33
- package/color-picker/README.md +49 -49
- package/data-table/README.md +113 -113
- package/date-picker/README.md +69 -69
- package/dialog/README.md +92 -92
- package/drawer-menu/README.md +77 -77
- package/dropzone/README.md +422 -422
- package/fesm2022/ngx-kit-angle-selector.mjs +2 -2
- package/fesm2022/ngx-kit-angle-selector.mjs.map +1 -1
- package/fesm2022/ngx-kit-box-shadow.mjs +2 -2
- package/fesm2022/ngx-kit-box-shadow.mjs.map +1 -1
- package/fesm2022/ngx-kit-color-picker.mjs +4 -4
- package/fesm2022/ngx-kit-color-picker.mjs.map +1 -1
- package/fesm2022/ngx-kit-data-table.mjs +2 -2
- package/fesm2022/ngx-kit-data-table.mjs.map +1 -1
- package/fesm2022/ngx-kit-date-picker.mjs +1322 -200
- package/fesm2022/ngx-kit-date-picker.mjs.map +1 -1
- package/fesm2022/ngx-kit-dialog.mjs +2 -2
- package/fesm2022/ngx-kit-dialog.mjs.map +1 -1
- package/fesm2022/ngx-kit-drawer-menu.mjs +2 -2
- package/fesm2022/ngx-kit-drawer-menu.mjs.map +1 -1
- package/fesm2022/ngx-kit-dropzone.mjs +2 -2
- package/fesm2022/ngx-kit-dropzone.mjs.map +1 -1
- package/fesm2022/ngx-kit-form-field.mjs.map +1 -1
- package/fesm2022/ngx-kit-gallery.mjs +2 -2
- package/fesm2022/ngx-kit-gallery.mjs.map +1 -1
- package/fesm2022/ngx-kit-gradient-picker.mjs.map +1 -1
- package/fesm2022/ngx-kit-image-editor.mjs +75 -11
- package/fesm2022/ngx-kit-image-editor.mjs.map +1 -1
- package/fesm2022/ngx-kit-menu.mjs +8 -8
- package/fesm2022/ngx-kit-menu.mjs.map +1 -1
- package/fesm2022/ngx-kit-message.mjs.map +1 -1
- package/fesm2022/ngx-kit-notify.mjs.map +1 -1
- package/fesm2022/ngx-kit-shared.mjs +2 -2
- package/fesm2022/ngx-kit-shared.mjs.map +1 -1
- package/fesm2022/ngx-kit-time-picker.mjs +2 -2
- package/fesm2022/ngx-kit-time-picker.mjs.map +1 -1
- package/gallery/README.md +71 -71
- package/gradient-picker/README.md +41 -41
- package/menu/README.md +85 -85
- package/message/README.md +70 -70
- package/notify/README.md +58 -58
- package/package.json +1 -1
- package/shared/README.md +117 -117
- package/time-picker/README.md +95 -95
- package/types/ngx-kit-date-picker.d.ts +302 -36
- package/types/ngx-kit-dropzone.d.ts +5 -5
- package/types/ngx-kit-image-editor.d.ts +29 -4
|
@@ -192,11 +192,11 @@ class NgxDialogComponent {
|
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NgxDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
195
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.4", type: NgxDialogComponent, isStandalone: false, selector: "ng-component", viewQueries: [{ propertyName: "ngxDialog", first: true, predicate: ["ngxDialog"], descendants: true }], ngImport: i0, template: "<div class=\"ngx-dialog-overlay\" (click)=\"onOverlayClicked($event)\">\n <div class=\"ngx-dialog\" (click)=\"onDialogClicked($event)\" #ngxDialog>\n <ng-container *ngComponentOutlet=\"component\"></ng-container>\n </div>\n</div>\n", styles: [".ngx-dialog-overlay{display:flex;flex-direction:column;position:fixed;inset:0;background:#0000004d;align-items:center;justify-content:center;transition:opacity .4s cubic-bezier(.25,.8,.25,1);z-index:999}::ng-deep .ngx-dialog{--ngx-dialog-bg: light-dark(#ffffff, #1c1c22);--ngx-dialog-fg: light-dark(#000000, #f0f0f5);--ngx-dialog-header-bg: light-dark(#1180f3, #2563eb);--ngx-dialog-header-fg: #ffffff;box-shadow:0 0 28px #3c3c3cd6;display:flex;flex-direction:column;border-radius:5px;overflow:hidden;background-color:var(--panel-bg, var(--ngx-dialog-bg));color:var(--side-config-fg, var(--ngx-dialog-fg));box-sizing:border-box;animation:ShowDialog .2s cubic-bezier(.25,.8,.25,1)}::ng-deep .ngx-dialog .dialog-header{display:block;background:var(--ngx-dialog-header-bg);display:flex;align-items:center;justify-content:space-between;padding:5px 15px;color:var(--ngx-dialog-header-fg);font-size:.8rem;box-sizing:border-box;height:35px}::ng-deep .ngx-dialog .dialog-header .close-btn{background:none;cursor:pointer;border:none;color:var(--ngx-dialog-header-fg)}::ng-deep .ngx-dialog .dialog-body{display:block;overflow:auto;padding:20px;box-sizing:border-box}::ng-deep .ngx-dialog .dialog-footer{display:block;box-shadow:0 0 10px #72727252;padding:0 15px;display:flex;align-items:center;min-height:44px}::ng-deep .ngx-dialog .dialog-footer.align-start{justify-content:flex-start}::ng-deep .ngx-dialog .dialog-footer.align-end{justify-content:flex-end}::ng-deep .ngx-dialog .dialog-footer.align-space-between{justify-content:space-between}::ng-deep .ngx-dialog .dialog-footer.align-center{justify-content:center}::ng-deep .ngx-dialog .dialog-footer.align-space-around{justify-content:space-around}@keyframes ShowDialog{0%{transform:translate(0) scale(0)}to{transform:translate(0) scale(1)}}\n"], dependencies: [{ kind: "directive", type: i1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
195
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.4", type: NgxDialogComponent, isStandalone: false, selector: "ng-component", viewQueries: [{ propertyName: "ngxDialog", first: true, predicate: ["ngxDialog"], descendants: true }], ngImport: i0, template: "<div class=\"ngx-dialog-overlay\" (click)=\"onOverlayClicked($event)\">\r\n <div class=\"ngx-dialog\" (click)=\"onDialogClicked($event)\" #ngxDialog>\r\n <ng-container *ngComponentOutlet=\"component\"></ng-container>\r\n </div>\r\n</div>\r\n", styles: [".ngx-dialog-overlay{display:flex;flex-direction:column;position:fixed;inset:0;background:#0000004d;align-items:center;justify-content:center;transition:opacity .4s cubic-bezier(.25,.8,.25,1);z-index:999}::ng-deep .ngx-dialog{--ngx-dialog-bg: light-dark(#ffffff, #1c1c22);--ngx-dialog-fg: light-dark(#000000, #f0f0f5);--ngx-dialog-header-bg: light-dark(#1180f3, #2563eb);--ngx-dialog-header-fg: #ffffff;box-shadow:0 0 28px #3c3c3cd6;display:flex;flex-direction:column;border-radius:5px;overflow:hidden;background-color:var(--panel-bg, var(--ngx-dialog-bg));color:var(--side-config-fg, var(--ngx-dialog-fg));box-sizing:border-box;animation:ShowDialog .2s cubic-bezier(.25,.8,.25,1)}::ng-deep .ngx-dialog .dialog-header{display:block;background:var(--ngx-dialog-header-bg);display:flex;align-items:center;justify-content:space-between;padding:5px 15px;color:var(--ngx-dialog-header-fg);font-size:.8rem;box-sizing:border-box;height:35px}::ng-deep .ngx-dialog .dialog-header .close-btn{background:none;cursor:pointer;border:none;color:var(--ngx-dialog-header-fg)}::ng-deep .ngx-dialog .dialog-body{display:block;overflow:auto;padding:20px;box-sizing:border-box}::ng-deep .ngx-dialog .dialog-footer{display:block;box-shadow:0 0 10px #72727252;padding:0 15px;display:flex;align-items:center;min-height:44px}::ng-deep .ngx-dialog .dialog-footer.align-start{justify-content:flex-start}::ng-deep .ngx-dialog .dialog-footer.align-end{justify-content:flex-end}::ng-deep .ngx-dialog .dialog-footer.align-space-between{justify-content:space-between}::ng-deep .ngx-dialog .dialog-footer.align-center{justify-content:center}::ng-deep .ngx-dialog .dialog-footer.align-space-around{justify-content:space-around}@keyframes ShowDialog{0%{transform:translate(0) scale(0)}to{transform:translate(0) scale(1)}}\n"], dependencies: [{ kind: "directive", type: i1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
196
196
|
}
|
|
197
197
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NgxDialogComponent, decorators: [{
|
|
198
198
|
type: Component,
|
|
199
|
-
args: [{ standalone: false, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ngx-dialog-overlay\" (click)=\"onOverlayClicked($event)\">\n <div class=\"ngx-dialog\" (click)=\"onDialogClicked($event)\" #ngxDialog>\n <ng-container *ngComponentOutlet=\"component\"></ng-container>\n </div>\n</div>\n", styles: [".ngx-dialog-overlay{display:flex;flex-direction:column;position:fixed;inset:0;background:#0000004d;align-items:center;justify-content:center;transition:opacity .4s cubic-bezier(.25,.8,.25,1);z-index:999}::ng-deep .ngx-dialog{--ngx-dialog-bg: light-dark(#ffffff, #1c1c22);--ngx-dialog-fg: light-dark(#000000, #f0f0f5);--ngx-dialog-header-bg: light-dark(#1180f3, #2563eb);--ngx-dialog-header-fg: #ffffff;box-shadow:0 0 28px #3c3c3cd6;display:flex;flex-direction:column;border-radius:5px;overflow:hidden;background-color:var(--panel-bg, var(--ngx-dialog-bg));color:var(--side-config-fg, var(--ngx-dialog-fg));box-sizing:border-box;animation:ShowDialog .2s cubic-bezier(.25,.8,.25,1)}::ng-deep .ngx-dialog .dialog-header{display:block;background:var(--ngx-dialog-header-bg);display:flex;align-items:center;justify-content:space-between;padding:5px 15px;color:var(--ngx-dialog-header-fg);font-size:.8rem;box-sizing:border-box;height:35px}::ng-deep .ngx-dialog .dialog-header .close-btn{background:none;cursor:pointer;border:none;color:var(--ngx-dialog-header-fg)}::ng-deep .ngx-dialog .dialog-body{display:block;overflow:auto;padding:20px;box-sizing:border-box}::ng-deep .ngx-dialog .dialog-footer{display:block;box-shadow:0 0 10px #72727252;padding:0 15px;display:flex;align-items:center;min-height:44px}::ng-deep .ngx-dialog .dialog-footer.align-start{justify-content:flex-start}::ng-deep .ngx-dialog .dialog-footer.align-end{justify-content:flex-end}::ng-deep .ngx-dialog .dialog-footer.align-space-between{justify-content:space-between}::ng-deep .ngx-dialog .dialog-footer.align-center{justify-content:center}::ng-deep .ngx-dialog .dialog-footer.align-space-around{justify-content:space-around}@keyframes ShowDialog{0%{transform:translate(0) scale(0)}to{transform:translate(0) scale(1)}}\n"] }]
|
|
199
|
+
args: [{ standalone: false, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ngx-dialog-overlay\" (click)=\"onOverlayClicked($event)\">\r\n <div class=\"ngx-dialog\" (click)=\"onDialogClicked($event)\" #ngxDialog>\r\n <ng-container *ngComponentOutlet=\"component\"></ng-container>\r\n </div>\r\n</div>\r\n", styles: [".ngx-dialog-overlay{display:flex;flex-direction:column;position:fixed;inset:0;background:#0000004d;align-items:center;justify-content:center;transition:opacity .4s cubic-bezier(.25,.8,.25,1);z-index:999}::ng-deep .ngx-dialog{--ngx-dialog-bg: light-dark(#ffffff, #1c1c22);--ngx-dialog-fg: light-dark(#000000, #f0f0f5);--ngx-dialog-header-bg: light-dark(#1180f3, #2563eb);--ngx-dialog-header-fg: #ffffff;box-shadow:0 0 28px #3c3c3cd6;display:flex;flex-direction:column;border-radius:5px;overflow:hidden;background-color:var(--panel-bg, var(--ngx-dialog-bg));color:var(--side-config-fg, var(--ngx-dialog-fg));box-sizing:border-box;animation:ShowDialog .2s cubic-bezier(.25,.8,.25,1)}::ng-deep .ngx-dialog .dialog-header{display:block;background:var(--ngx-dialog-header-bg);display:flex;align-items:center;justify-content:space-between;padding:5px 15px;color:var(--ngx-dialog-header-fg);font-size:.8rem;box-sizing:border-box;height:35px}::ng-deep .ngx-dialog .dialog-header .close-btn{background:none;cursor:pointer;border:none;color:var(--ngx-dialog-header-fg)}::ng-deep .ngx-dialog .dialog-body{display:block;overflow:auto;padding:20px;box-sizing:border-box}::ng-deep .ngx-dialog .dialog-footer{display:block;box-shadow:0 0 10px #72727252;padding:0 15px;display:flex;align-items:center;min-height:44px}::ng-deep .ngx-dialog .dialog-footer.align-start{justify-content:flex-start}::ng-deep .ngx-dialog .dialog-footer.align-end{justify-content:flex-end}::ng-deep .ngx-dialog .dialog-footer.align-space-between{justify-content:space-between}::ng-deep .ngx-dialog .dialog-footer.align-center{justify-content:center}::ng-deep .ngx-dialog .dialog-footer.align-space-around{justify-content:space-around}@keyframes ShowDialog{0%{transform:translate(0) scale(0)}to{transform:translate(0) scale(1)}}\n"] }]
|
|
200
200
|
}], ctorParameters: () => [], propDecorators: { ngxDialog: [{
|
|
201
201
|
type: ViewChild,
|
|
202
202
|
args: ['ngxDialog']
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-kit-dialog.mjs","sources":["../../../projects/libs/dialog/dialog.tokens.ts","../../../projects/libs/dialog/directives/body.directive.ts","../../../projects/libs/dialog/directives/footer.directive.ts","../../../projects/libs/dialog/directives/header.directive.ts","../../../projects/libs/dialog/ngx-dialog.component.ts","../../../projects/libs/dialog/ngx-dialog.component.html","../../../projects/libs/dialog/ngx-dialog-config.ts","../../../projects/libs/dialog/ngx-dialog-ref.ts","../../../projects/libs/dialog/ngx-dialog.service.ts","../../../projects/libs/dialog/dialog.facade.ts","../../../projects/libs/dialog/ngx-dialog.module.ts","../../../projects/libs/dialog/ngx-kit-dialog.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { NgxDialogRef } from './ngx-dialog-ref';\n\nexport const DIALOG_DATA = new InjectionToken<any>('DIALOG_DATA');\nexport const DIALOG_REF = new InjectionToken<NgxDialogRef>('DIALOG_REF');\n","import { AfterViewInit, Directive, ElementRef, inject, Renderer2 } from '@angular/core';\nimport { DIALOG_REF } from '../dialog.tokens';\n\n@Directive({\n standalone: false,\n selector: 'ngx-dialog-body,[ngxDialogBody]',\n host: {\n class: 'dialog-body',\n },\n exportAs: 'ngxDialogBody',\n})\nexport class NgxDialogBodyDirective implements AfterViewInit {\n height?: number;\n\n private _dialogRef = inject(DIALOG_REF);\n constructor(\n public _el: ElementRef<HTMLElement>,\n private _renderer: Renderer2,\n ) {\n this._dialogRef.body = this._el;\n }\n\n ngAfterViewInit(): void {\n this.onWindowResize();\n if (this._dialogRef.dialog && this._dialogRef.dialog.nativeElement) {\n new ResizeObserver(() => {\n this.onWindowResize();\n }).observe(this._dialogRef.dialog.nativeElement);\n }\n }\n\n // @HostListener('window:resize', ['$event'])\n onWindowResize(ev?: Event) {\n if (!window) return;\n let headerH = 0;\n let footerH = 0;\n let dialogH = window.innerHeight;\n if (this._dialogRef.header) {\n headerH = this._dialogRef.header.nativeElement.offsetHeight;\n }\n if (this._dialogRef.footer) {\n footerH = this._dialogRef.footer.nativeElement.offsetHeight;\n }\n if (this._dialogRef.dialog && this._dialogRef.dialog.nativeElement.offsetHeight < dialogH) {\n dialogH = this._dialogRef.dialog.nativeElement.offsetHeight;\n }\n this.height = dialogH - headerH - footerH;\n this._renderer.setStyle(this._el.nativeElement, 'max-height', this.height + 'px');\n // console.log(this.height, ':', 'windowHeight', dialogH, 'h', headerH, 'f', footerH);\n }\n}\n","import { Directive, ElementRef, inject, Input, OnInit } from '@angular/core';\nimport { DIALOG_REF } from '../dialog.tokens';\n\n@Directive({\n standalone: false,\n selector: 'ngx-dialog-footer,[ngxDialogFooter]',\n host: {\n class: 'dialog-footer',\n '[class.align-start]': 'align===\"start\"',\n '[class.align-end]': 'align===\"end\"',\n '[class.align-space-between]': 'align===\"space-between\"',\n '[class.align-center]': 'align===\"center\"',\n '[class.align-space-around]': 'align===\"space-around\"',\n },\n exportAs: 'ngxDialogFooter',\n})\nexport class NgxDialogFooterDirective implements OnInit {\n @Input() align: 'start' | 'end' | 'space-between' | 'center' | 'space-around' = 'end';\n\n private _dialogRef = inject(DIALOG_REF);\n constructor(public _el: ElementRef<HTMLElement>) {}\n\n ngOnInit(): void {\n this._dialogRef.footer = this._el;\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { Directive, ElementRef, inject, Inject, Input, OnInit } from '@angular/core';\nimport { DIALOG_REF } from '../dialog.tokens';\n\n@Directive({\n standalone: false,\n selector: 'ngx-dialog-header,[ngxDialogHeader]',\n host: {\n class: 'dialog-header',\n },\n exportAs: 'ngxDialogHeader',\n})\nexport class NgxDialogHeaderDirective implements OnInit {\n @Input() showCloseButton = true;\n\n private _dialogRef = inject(DIALOG_REF);\n constructor(\n public _el: ElementRef<HTMLElement>,\n @Inject(DOCUMENT) private _document: Document,\n ) {}\n\n ngOnInit(): void {\n this._el.nativeElement.innerHTML = '<span>' + this._el.nativeElement.innerHTML + '</span>';\n if (this.showCloseButton) {\n let closeBtn = this._document.createElement('button');\n closeBtn.className = 'close-btn';\n closeBtn.innerHTML =\n '<svg width=\"20\" height=\"20\" fill=\"#fff\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 512\"><path d=\"M312.1 375c9.369 9.369 9.369 24.57 0 33.94s-24.57 9.369-33.94 0L160 289.9l-119 119c-9.369 9.369-24.57 9.369-33.94 0s-9.369-24.57 0-33.94L126.1 256L7.027 136.1c-9.369-9.369-9.369-24.57 0-33.94s24.57-9.369 33.94 0L160 222.1l119-119c9.369-9.369 24.57-9.369 33.94 0s9.369 24.57 0 33.94L193.9 256L312.1 375z\"/></svg>';\n\n closeBtn.onclick = closeBtn.ontouchend = () => {\n this._dialogRef.close();\n };\n this._el.nativeElement.appendChild(closeBtn);\n }\n this._dialogRef.header = this._el;\n }\n}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n inject,\n OnDestroy,\n OnInit,\n Type,\n ViewChild,\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { NgxDialogConfig } from './ngx-dialog-config';\nimport { DIALOG_REF } from './dialog.tokens';\n\n@Component({\n standalone: false,\n templateUrl: './ngx-dialog.component.html',\n styleUrls: ['./ngx-dialog.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgxDialogComponent implements OnInit, AfterViewInit, OnDestroy {\n config?: NgxDialogConfig;\n component!: Type<any>;\n private readonly _onClose = new Subject<void>();\n public onClose = this._onClose.asObservable();\n @ViewChild('ngxDialog') ngxDialog?: ElementRef<HTMLElement>;\n\n _dialogRef = inject(DIALOG_REF);\n private cd = inject(ChangeDetectorRef);\n constructor() {}\n\n ngOnInit(): void {}\n\n ngAfterViewInit(): void {\n this._dialogRef.dialog = this.ngxDialog;\n this.setStyle();\n this.cd.detectChanges();\n }\n\n ngOnDestroy(): void {}\n\n onOverlayClicked(evt: MouseEvent): void {\n if (this.config?.allowCloseOnOutsideClick) {\n this._dialogRef.close();\n }\n }\n\n onDialogClicked(evt: MouseEvent): void {\n evt.stopPropagation();\n }\n\n close(): void {\n this._onClose.next();\n }\n\n setStyle() {\n if (this.ngxDialog) {\n if (this.config?.width) {\n this.ngxDialog.nativeElement.style.width = this.config.width;\n }\n if (this.config?.maxWidth) {\n this.ngxDialog.nativeElement.style.maxWidth = this.config.maxWidth;\n } else {\n this.ngxDialog.nativeElement.style.maxWidth = '100%';\n }\n if (this.config?.minWidth) {\n this.ngxDialog.nativeElement.style.minWidth = this.config.minWidth;\n }\n if (this.config?.height) {\n this.ngxDialog.nativeElement.style.height = this.config.height;\n }\n if (this.config?.maxHeight) {\n this.ngxDialog.nativeElement.style.maxHeight = this.config.maxHeight;\n } else {\n this.ngxDialog.nativeElement.style.maxHeight = '100%';\n }\n if (this.config?.minHeight) {\n this.ngxDialog.nativeElement.style.minHeight = this.config.minHeight;\n }\n }\n }\n}\n","<div class=\"ngx-dialog-overlay\" (click)=\"onOverlayClicked($event)\">\n <div class=\"ngx-dialog\" (click)=\"onDialogClicked($event)\" #ngxDialog>\n <ng-container *ngComponentOutlet=\"component\"></ng-container>\n </div>\n</div>\n","import { Injector } from '@angular/core';\n\nexport class NgxDialogConfig<DataType = any> {\n /**\n * pass data to dialog\n */\n data?: DataType | any = {};\n /** close dialog on outside click\n * - default false */\n allowCloseOnOutsideClick?: boolean = false;\n /**\n * container class\n * - You can separate the list of classes with a space\n * - for example:\"`my class one two three ...`\"\n *\n * TODO: must set with public config setter\n */\n containerClass? = 'ngx-kit';\n header?: {\n enable?: true;\n title?: '';\n showCloseButton?: true;\n };\n footer?: {\n enable?: true;\n };\n width?: string = '';\n minWidth?: string = '';\n maxWidth?: string = '';\n height?: string = '';\n minHeight?: string = '';\n maxHeight?: string = '';\n\n /** parent injector */\n injector?: Injector;\n\n constructor() {}\n}\n","import { ElementRef } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\n\nexport class NgxDialogRef {\n dialog?: ElementRef<HTMLElement>;\n header?: ElementRef<HTMLElement>;\n footer?: ElementRef<HTMLElement>;\n body?: ElementRef<HTMLElement>;\n private readonly _afterClosed = new Subject<any>();\n\n afterClosed: Observable<any> = this._afterClosed.asObservable();\n\n id?: string;\n close(result?: any): void {\n this._afterClosed.next(result);\n }\n}\n","import {\n ApplicationRef,\n ComponentRef,\n createComponent,\n EmbeddedViewRef,\n EnvironmentInjector,\n Injectable,\n Injector,\n Provider,\n runInInjectionContext,\n Type,\n} from '@angular/core';\nimport { NgxDialogConfig } from './ngx-dialog-config';\nimport { NgxDialogRef } from './ngx-dialog-ref';\nimport { NgxDialogComponent } from './ngx-dialog.component';\nimport { DIALOG_DATA, DIALOG_REF } from './dialog.tokens';\nimport { randomStrnig } from 'ngx-kit/shared';\n\n@Injectable()\nexport class NgxOverlayService {\n dialogComponentRefs: ComponentRef<NgxDialogComponent>[] = [];\n _defaultOptions: NgxDialogConfig | undefined;\n constructor(\n private appRef: ApplicationRef,\n private injector: Injector,\n private envInjector: EnvironmentInjector,\n ) {}\n\n public open(component: Type<any>, config?: NgxDialogConfig): NgxDialogRef {\n const dialogRef = this._open(component, config);\n return dialogRef;\n }\n\n private _open(component: Type<any>, config?: NgxDialogConfig): NgxDialogRef {\n config = { ...(this._defaultOptions || new NgxDialogConfig()), ...config };\n const map = new WeakMap();\n map.set(NgxDialogConfig, config);\n\n const dialogRef = new NgxDialogRef();\n dialogRef.id = this.getDialogId;\n map.set(NgxDialogRef, dialogRef);\n\n const sub = dialogRef.afterClosed.subscribe(() => {\n // close the dialog\n this.removeDialogComponentFromBody(dialogRef.id);\n sub.unsubscribe();\n });\n\n // ✅ ساخت Injector اختصاصی با DestroyRef\n const componentInjector = Injector.create({\n providers: [\n NgxDialogRef,\n { provide: DIALOG_DATA, useValue: config.data },\n { provide: DIALOG_REF, useValue: dialogRef, multi: false },\n ],\n parent: config?.injector ? config.injector : this.envInjector,\n });\n\n const componentRef: ComponentRef<NgxDialogComponent> = runInInjectionContext(\n componentInjector,\n () =>\n createComponent(NgxDialogComponent, {\n elementInjector: componentInjector,\n environmentInjector: this.envInjector,\n }),\n );\n\n this.appRef.attachView(componentRef.hostView);\n this.appendDialogComponentToBody(componentRef, config);\n componentRef.instance.config = config;\n componentRef.instance.component = component;\n //componentRef.instance._dialogRef = dialogRef;\n this.dialogComponentRefs.push(componentRef);\n return dialogRef;\n }\n\n private removeDialogComponentFromBody(id?: string): void {\n if (!id) {\n return;\n }\n const index = this.dialogComponentRefs.findIndex((x) => x.instance._dialogRef.id == id);\n if (index > -1 && this.dialogComponentRefs[index]) {\n this.appRef.detachView(this.dialogComponentRefs[index].hostView);\n this.dialogComponentRefs[index].destroy();\n this.dialogComponentRefs.splice(index, 1);\n }\n }\n\n private appendDialogComponentToBody(\n componentRef: ComponentRef<NgxDialogComponent>,\n config: NgxDialogConfig,\n ) {\n const domElem = (componentRef.hostView as EmbeddedViewRef<any>).rootNodes[0] as HTMLElement;\n if (config.containerClass) {\n for (let c of config.containerClass.split(' ')) {\n if (c.trim()) domElem.classList.add(c);\n }\n }\n document.body.appendChild(domElem);\n }\n\n closeAll() {\n for (let index = 0; index < this.dialogComponentRefs.length; index++) {\n if (this.dialogComponentRefs[index]) {\n this.appRef.detachView(this.dialogComponentRefs[index].hostView);\n this.dialogComponentRefs[index].destroy();\n }\n }\n this.dialogComponentRefs = [];\n }\n\n private get getDialogId() {\n return randomStrnig(10, true);\n }\n}\n","import { Type } from '@angular/core';\nimport { NgxDialogConfig } from './ngx-dialog-config';\nimport { NgxOverlayService } from './ngx-dialog.service';\nimport { NgxDialogRef } from './ngx-dialog-ref';\n\nexport class Dialog {\n private static serviceInstance: NgxOverlayService | null = null;\n static _setService(svc: NgxOverlayService) {\n this.serviceInstance = svc;\n }\n\n static open<DataType>(component: Type<any>, config?: NgxDialogConfig<DataType>): NgxDialogRef {\n if (!this.serviceInstance) {\n throw Error('ngx-dialog: service not initialized. Ensure NgxDialogModule is imported.');\n }\n return this.serviceInstance.open(component, config);\n }\n}\n","import { CommonModule, isPlatformServer } from '@angular/common';\nimport { NgModule, Optional, PLATFORM_ID, SkipSelf, inject } from '@angular/core';\nimport { NgxDialogBodyDirective } from './directives/body.directive';\nimport { NgxDialogFooterDirective } from './directives/footer.directive';\nimport { NgxDialogHeaderDirective } from './directives/header.directive';\nimport { NgxDialogComponent } from './ngx-dialog.component';\nimport { NgxOverlayService } from './ngx-dialog.service';\nimport { Dialog as DialogFacade } from './dialog.facade';\n\n@NgModule({\n declarations: [\n NgxDialogComponent,\n NgxDialogHeaderDirective,\n NgxDialogFooterDirective,\n NgxDialogBodyDirective,\n ],\n imports: [CommonModule],\n exports: [\n NgxDialogComponent,\n NgxDialogHeaderDirective,\n NgxDialogFooterDirective,\n NgxDialogBodyDirective,\n ],\n providers: [NgxOverlayService],\n})\nexport class NgxDialogModule {\n private readonly platformId = inject(PLATFORM_ID);\n\n constructor(\n @Optional() @SkipSelf() parentModule: NgxDialogModule | null,\n service: NgxOverlayService,\n ) {\n if (parentModule) {\n return;\n }\n\n // API استاتیک Dialog.open(...) روی یک static field کلاسی پیاده شده تا\n // بدون تزریق دستی سرویس هم قابل استفاده باشه. این static field برای کل\n // پروسهی Node.js مشترکه، نه بهازای هر درخواست — پس در Angular SSR،\n // چند درخواست همزمان میتونستن instance همدیگه رو overwrite کنن و\n // دیالوگ یک کاربر با ApplicationRef اشتباه (کاربر دیگه) کار کنه.\n // بهجای اینکه این باگ بهصورت خاموش رخ بده، روی سرور اصلاً static\n // instance رو ست نمیکنیم؛ Dialog.open() روی سرور با همون خطای\n // «service not initialized» که از قبل وجود داشت fail میکنه (fail-loud\n // بهجای corrupt خاموش). برای SSR باید NgxOverlayService رو مستقیم\n // inject کرد (که per-request/per-injector امنه)، نه از API استاتیک\n // استفاده کرد. رفتار کلاینت (که ۹۹٪ کاربردهاست) کاملاً بدون تغییره.\n if (isPlatformServer(this.platformId)) {\n return;\n }\n\n DialogFacade._setService(service);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["DialogFacade","i1.NgxOverlayService"],"mappings":";;;;;;;MAGa,WAAW,GAAG,IAAI,cAAc,CAAM,aAAa;MACnD,UAAU,GAAG,IAAI,cAAc,CAAe,YAAY;;MCO1D,sBAAsB,CAAA;AAKxB,IAAA,GAAA;AACC,IAAA,SAAA;AALV,IAAA,MAAM;AAEE,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IACvC,WAAA,CACS,GAA4B,EAC3B,SAAoB,EAAA;QADrB,IAAA,CAAA,GAAG,GAAH,GAAG;QACF,IAAA,CAAA,SAAS,GAAT,SAAS;QAEjB,IAAI,CAAC,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG;IACjC;IAEA,eAAe,GAAA;QACb,IAAI,CAAC,cAAc,EAAE;AACrB,QAAA,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,aAAa,EAAE;YAClE,IAAI,cAAc,CAAC,MAAK;gBACtB,IAAI,CAAC,cAAc,EAAE;AACvB,YAAA,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,aAAa,CAAC;QAClD;IACF;;AAGA,IAAA,cAAc,CAA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,wBAAwB;wBACxB,sBAAsB;AACvB,qBAAA;oBACD,SAAS,EAAE,CAAC,iBAAiB,CAAC;AAC/B,iBAAA;;0BAKI;;0BAAY;;;AC7BjB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-kit-dialog.mjs","sources":["../../../projects/libs/dialog/dialog.tokens.ts","../../../projects/libs/dialog/directives/body.directive.ts","../../../projects/libs/dialog/directives/footer.directive.ts","../../../projects/libs/dialog/directives/header.directive.ts","../../../projects/libs/dialog/ngx-dialog.component.ts","../../../projects/libs/dialog/ngx-dialog.component.html","../../../projects/libs/dialog/ngx-dialog-config.ts","../../../projects/libs/dialog/ngx-dialog-ref.ts","../../../projects/libs/dialog/ngx-dialog.service.ts","../../../projects/libs/dialog/dialog.facade.ts","../../../projects/libs/dialog/ngx-dialog.module.ts","../../../projects/libs/dialog/ngx-kit-dialog.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { NgxDialogRef } from './ngx-dialog-ref';\n\nexport const DIALOG_DATA = new InjectionToken<any>('DIALOG_DATA');\nexport const DIALOG_REF = new InjectionToken<NgxDialogRef>('DIALOG_REF');\n","import { AfterViewInit, Directive, ElementRef, inject, Renderer2 } from '@angular/core';\nimport { DIALOG_REF } from '../dialog.tokens';\n\n@Directive({\n standalone: false,\n selector: 'ngx-dialog-body,[ngxDialogBody]',\n host: {\n class: 'dialog-body',\n },\n exportAs: 'ngxDialogBody',\n})\nexport class NgxDialogBodyDirective implements AfterViewInit {\n height?: number;\n\n private _dialogRef = inject(DIALOG_REF);\n constructor(\n public _el: ElementRef<HTMLElement>,\n private _renderer: Renderer2,\n ) {\n this._dialogRef.body = this._el;\n }\n\n ngAfterViewInit(): void {\n this.onWindowResize();\n if (this._dialogRef.dialog && this._dialogRef.dialog.nativeElement) {\n new ResizeObserver(() => {\n this.onWindowResize();\n }).observe(this._dialogRef.dialog.nativeElement);\n }\n }\n\n // @HostListener('window:resize', ['$event'])\n onWindowResize(ev?: Event) {\n if (!window) return;\n let headerH = 0;\n let footerH = 0;\n let dialogH = window.innerHeight;\n if (this._dialogRef.header) {\n headerH = this._dialogRef.header.nativeElement.offsetHeight;\n }\n if (this._dialogRef.footer) {\n footerH = this._dialogRef.footer.nativeElement.offsetHeight;\n }\n if (this._dialogRef.dialog && this._dialogRef.dialog.nativeElement.offsetHeight < dialogH) {\n dialogH = this._dialogRef.dialog.nativeElement.offsetHeight;\n }\n this.height = dialogH - headerH - footerH;\n this._renderer.setStyle(this._el.nativeElement, 'max-height', this.height + 'px');\n // console.log(this.height, ':', 'windowHeight', dialogH, 'h', headerH, 'f', footerH);\n }\n}\n","import { Directive, ElementRef, inject, Input, OnInit } from '@angular/core';\nimport { DIALOG_REF } from '../dialog.tokens';\n\n@Directive({\n standalone: false,\n selector: 'ngx-dialog-footer,[ngxDialogFooter]',\n host: {\n class: 'dialog-footer',\n '[class.align-start]': 'align===\"start\"',\n '[class.align-end]': 'align===\"end\"',\n '[class.align-space-between]': 'align===\"space-between\"',\n '[class.align-center]': 'align===\"center\"',\n '[class.align-space-around]': 'align===\"space-around\"',\n },\n exportAs: 'ngxDialogFooter',\n})\nexport class NgxDialogFooterDirective implements OnInit {\n @Input() align: 'start' | 'end' | 'space-between' | 'center' | 'space-around' = 'end';\n\n private _dialogRef = inject(DIALOG_REF);\n constructor(public _el: ElementRef<HTMLElement>) {}\n\n ngOnInit(): void {\n this._dialogRef.footer = this._el;\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { Directive, ElementRef, inject, Inject, Input, OnInit } from '@angular/core';\nimport { DIALOG_REF } from '../dialog.tokens';\n\n@Directive({\n standalone: false,\n selector: 'ngx-dialog-header,[ngxDialogHeader]',\n host: {\n class: 'dialog-header',\n },\n exportAs: 'ngxDialogHeader',\n})\nexport class NgxDialogHeaderDirective implements OnInit {\n @Input() showCloseButton = true;\n\n private _dialogRef = inject(DIALOG_REF);\n constructor(\n public _el: ElementRef<HTMLElement>,\n @Inject(DOCUMENT) private _document: Document,\n ) {}\n\n ngOnInit(): void {\n this._el.nativeElement.innerHTML = '<span>' + this._el.nativeElement.innerHTML + '</span>';\n if (this.showCloseButton) {\n let closeBtn = this._document.createElement('button');\n closeBtn.className = 'close-btn';\n closeBtn.innerHTML =\n '<svg width=\"20\" height=\"20\" fill=\"#fff\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 512\"><path d=\"M312.1 375c9.369 9.369 9.369 24.57 0 33.94s-24.57 9.369-33.94 0L160 289.9l-119 119c-9.369 9.369-24.57 9.369-33.94 0s-9.369-24.57 0-33.94L126.1 256L7.027 136.1c-9.369-9.369-9.369-24.57 0-33.94s24.57-9.369 33.94 0L160 222.1l119-119c9.369-9.369 24.57-9.369 33.94 0s9.369 24.57 0 33.94L193.9 256L312.1 375z\"/></svg>';\n\n closeBtn.onclick = closeBtn.ontouchend = () => {\n this._dialogRef.close();\n };\n this._el.nativeElement.appendChild(closeBtn);\n }\n this._dialogRef.header = this._el;\n }\n}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n inject,\n OnDestroy,\n OnInit,\n Type,\n ViewChild,\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { NgxDialogConfig } from './ngx-dialog-config';\nimport { DIALOG_REF } from './dialog.tokens';\n\n@Component({\n standalone: false,\n templateUrl: './ngx-dialog.component.html',\n styleUrls: ['./ngx-dialog.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgxDialogComponent implements OnInit, AfterViewInit, OnDestroy {\n config?: NgxDialogConfig;\n component!: Type<any>;\n private readonly _onClose = new Subject<void>();\n public onClose = this._onClose.asObservable();\n @ViewChild('ngxDialog') ngxDialog?: ElementRef<HTMLElement>;\n\n _dialogRef = inject(DIALOG_REF);\n private cd = inject(ChangeDetectorRef);\n constructor() {}\n\n ngOnInit(): void {}\n\n ngAfterViewInit(): void {\n this._dialogRef.dialog = this.ngxDialog;\n this.setStyle();\n this.cd.detectChanges();\n }\n\n ngOnDestroy(): void {}\n\n onOverlayClicked(evt: MouseEvent): void {\n if (this.config?.allowCloseOnOutsideClick) {\n this._dialogRef.close();\n }\n }\n\n onDialogClicked(evt: MouseEvent): void {\n evt.stopPropagation();\n }\n\n close(): void {\n this._onClose.next();\n }\n\n setStyle() {\n if (this.ngxDialog) {\n if (this.config?.width) {\n this.ngxDialog.nativeElement.style.width = this.config.width;\n }\n if (this.config?.maxWidth) {\n this.ngxDialog.nativeElement.style.maxWidth = this.config.maxWidth;\n } else {\n this.ngxDialog.nativeElement.style.maxWidth = '100%';\n }\n if (this.config?.minWidth) {\n this.ngxDialog.nativeElement.style.minWidth = this.config.minWidth;\n }\n if (this.config?.height) {\n this.ngxDialog.nativeElement.style.height = this.config.height;\n }\n if (this.config?.maxHeight) {\n this.ngxDialog.nativeElement.style.maxHeight = this.config.maxHeight;\n } else {\n this.ngxDialog.nativeElement.style.maxHeight = '100%';\n }\n if (this.config?.minHeight) {\n this.ngxDialog.nativeElement.style.minHeight = this.config.minHeight;\n }\n }\n }\n}\n","<div class=\"ngx-dialog-overlay\" (click)=\"onOverlayClicked($event)\">\r\n <div class=\"ngx-dialog\" (click)=\"onDialogClicked($event)\" #ngxDialog>\r\n <ng-container *ngComponentOutlet=\"component\"></ng-container>\r\n </div>\r\n</div>\r\n","import { Injector } from '@angular/core';\n\nexport class NgxDialogConfig<DataType = any> {\n /**\n * pass data to dialog\n */\n data?: DataType | any = {};\n /** close dialog on outside click\n * - default false */\n allowCloseOnOutsideClick?: boolean = false;\n /**\n * container class\n * - You can separate the list of classes with a space\n * - for example:\"`my class one two three ...`\"\n *\n * TODO: must set with public config setter\n */\n containerClass? = 'ngx-kit';\n header?: {\n enable?: true;\n title?: '';\n showCloseButton?: true;\n };\n footer?: {\n enable?: true;\n };\n width?: string = '';\n minWidth?: string = '';\n maxWidth?: string = '';\n height?: string = '';\n minHeight?: string = '';\n maxHeight?: string = '';\n\n /** parent injector */\n injector?: Injector;\n\n constructor() {}\n}\n","import { ElementRef } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\n\nexport class NgxDialogRef {\n dialog?: ElementRef<HTMLElement>;\n header?: ElementRef<HTMLElement>;\n footer?: ElementRef<HTMLElement>;\n body?: ElementRef<HTMLElement>;\n private readonly _afterClosed = new Subject<any>();\n\n afterClosed: Observable<any> = this._afterClosed.asObservable();\n\n id?: string;\n close(result?: any): void {\n this._afterClosed.next(result);\n }\n}\n","import {\n ApplicationRef,\n ComponentRef,\n createComponent,\n EmbeddedViewRef,\n EnvironmentInjector,\n Injectable,\n Injector,\n Provider,\n runInInjectionContext,\n Type,\n} from '@angular/core';\nimport { NgxDialogConfig } from './ngx-dialog-config';\nimport { NgxDialogRef } from './ngx-dialog-ref';\nimport { NgxDialogComponent } from './ngx-dialog.component';\nimport { DIALOG_DATA, DIALOG_REF } from './dialog.tokens';\nimport { randomStrnig } from 'ngx-kit/shared';\n\n@Injectable()\nexport class NgxOverlayService {\n dialogComponentRefs: ComponentRef<NgxDialogComponent>[] = [];\n _defaultOptions: NgxDialogConfig | undefined;\n constructor(\n private appRef: ApplicationRef,\n private injector: Injector,\n private envInjector: EnvironmentInjector,\n ) {}\n\n public open(component: Type<any>, config?: NgxDialogConfig): NgxDialogRef {\n const dialogRef = this._open(component, config);\n return dialogRef;\n }\n\n private _open(component: Type<any>, config?: NgxDialogConfig): NgxDialogRef {\n config = { ...(this._defaultOptions || new NgxDialogConfig()), ...config };\n const map = new WeakMap();\n map.set(NgxDialogConfig, config);\n\n const dialogRef = new NgxDialogRef();\n dialogRef.id = this.getDialogId;\n map.set(NgxDialogRef, dialogRef);\n\n const sub = dialogRef.afterClosed.subscribe(() => {\n // close the dialog\n this.removeDialogComponentFromBody(dialogRef.id);\n sub.unsubscribe();\n });\n\n // ✅ ساخت Injector اختصاصی با DestroyRef\n const componentInjector = Injector.create({\n providers: [\n NgxDialogRef,\n { provide: DIALOG_DATA, useValue: config.data },\n { provide: DIALOG_REF, useValue: dialogRef, multi: false },\n ],\n parent: config?.injector ? config.injector : this.envInjector,\n });\n\n const componentRef: ComponentRef<NgxDialogComponent> = runInInjectionContext(\n componentInjector,\n () =>\n createComponent(NgxDialogComponent, {\n elementInjector: componentInjector,\n environmentInjector: this.envInjector,\n }),\n );\n\n this.appRef.attachView(componentRef.hostView);\n this.appendDialogComponentToBody(componentRef, config);\n componentRef.instance.config = config;\n componentRef.instance.component = component;\n //componentRef.instance._dialogRef = dialogRef;\n this.dialogComponentRefs.push(componentRef);\n return dialogRef;\n }\n\n private removeDialogComponentFromBody(id?: string): void {\n if (!id) {\n return;\n }\n const index = this.dialogComponentRefs.findIndex((x) => x.instance._dialogRef.id == id);\n if (index > -1 && this.dialogComponentRefs[index]) {\n this.appRef.detachView(this.dialogComponentRefs[index].hostView);\n this.dialogComponentRefs[index].destroy();\n this.dialogComponentRefs.splice(index, 1);\n }\n }\n\n private appendDialogComponentToBody(\n componentRef: ComponentRef<NgxDialogComponent>,\n config: NgxDialogConfig,\n ) {\n const domElem = (componentRef.hostView as EmbeddedViewRef<any>).rootNodes[0] as HTMLElement;\n if (config.containerClass) {\n for (let c of config.containerClass.split(' ')) {\n if (c.trim()) domElem.classList.add(c);\n }\n }\n document.body.appendChild(domElem);\n }\n\n closeAll() {\n for (let index = 0; index < this.dialogComponentRefs.length; index++) {\n if (this.dialogComponentRefs[index]) {\n this.appRef.detachView(this.dialogComponentRefs[index].hostView);\n this.dialogComponentRefs[index].destroy();\n }\n }\n this.dialogComponentRefs = [];\n }\n\n private get getDialogId() {\n return randomStrnig(10, true);\n }\n}\n","import { Type } from '@angular/core';\nimport { NgxDialogConfig } from './ngx-dialog-config';\nimport { NgxOverlayService } from './ngx-dialog.service';\nimport { NgxDialogRef } from './ngx-dialog-ref';\n\nexport class Dialog {\n private static serviceInstance: NgxOverlayService | null = null;\n static _setService(svc: NgxOverlayService) {\n this.serviceInstance = svc;\n }\n\n static open<DataType>(component: Type<any>, config?: NgxDialogConfig<DataType>): NgxDialogRef {\n if (!this.serviceInstance) {\n throw Error('ngx-dialog: service not initialized. Ensure NgxDialogModule is imported.');\n }\n return this.serviceInstance.open(component, config);\n }\n}\n","import { CommonModule, isPlatformServer } from '@angular/common';\r\nimport { NgModule, Optional, PLATFORM_ID, SkipSelf, inject } from '@angular/core';\r\nimport { NgxDialogBodyDirective } from './directives/body.directive';\r\nimport { NgxDialogFooterDirective } from './directives/footer.directive';\r\nimport { NgxDialogHeaderDirective } from './directives/header.directive';\r\nimport { NgxDialogComponent } from './ngx-dialog.component';\r\nimport { NgxOverlayService } from './ngx-dialog.service';\r\nimport { Dialog as DialogFacade } from './dialog.facade';\r\n\r\n@NgModule({\r\n declarations: [\r\n NgxDialogComponent,\r\n NgxDialogHeaderDirective,\r\n NgxDialogFooterDirective,\r\n NgxDialogBodyDirective,\r\n ],\r\n imports: [CommonModule],\r\n exports: [\r\n NgxDialogComponent,\r\n NgxDialogHeaderDirective,\r\n NgxDialogFooterDirective,\r\n NgxDialogBodyDirective,\r\n ],\r\n providers: [NgxOverlayService],\r\n})\r\nexport class NgxDialogModule {\r\n private readonly platformId = inject(PLATFORM_ID);\r\n\r\n constructor(\r\n @Optional() @SkipSelf() parentModule: NgxDialogModule | null,\r\n service: NgxOverlayService,\r\n ) {\r\n if (parentModule) {\r\n return;\r\n }\r\n\r\n // API استاتیک Dialog.open(...) روی یک static field کلاسی پیاده شده تا\r\n // بدون تزریق دستی سرویس هم قابل استفاده باشه. این static field برای کل\r\n // پروسهی Node.js مشترکه، نه بهازای هر درخواست — پس در Angular SSR،\r\n // چند درخواست همزمان میتونستن instance همدیگه رو overwrite کنن و\r\n // دیالوگ یک کاربر با ApplicationRef اشتباه (کاربر دیگه) کار کنه.\r\n // بهجای اینکه این باگ بهصورت خاموش رخ بده، روی سرور اصلاً static\r\n // instance رو ست نمیکنیم؛ Dialog.open() روی سرور با همون خطای\r\n // «service not initialized» که از قبل وجود داشت fail میکنه (fail-loud\r\n // بهجای corrupt خاموش). برای SSR باید NgxOverlayService رو مستقیم\r\n // inject کرد (که per-request/per-injector امنه)، نه از API استاتیک\r\n // استفاده کرد. رفتار کلاینت (که ۹۹٪ کاربردهاست) کاملاً بدون تغییره.\r\n if (isPlatformServer(this.platformId)) {\r\n return;\r\n }\r\n\r\n DialogFacade._setService(service);\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["DialogFacade","i1.NgxOverlayService"],"mappings":";;;;;;;MAGa,WAAW,GAAG,IAAI,cAAc,CAAM,aAAa;MACnD,UAAU,GAAG,IAAI,cAAc,CAAe,YAAY;;MCO1D,sBAAsB,CAAA;AAKxB,IAAA,GAAA;AACC,IAAA,SAAA;AALV,IAAA,MAAM;AAEE,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IACvC,WAAA,CACS,GAA4B,EAC3B,SAAoB,EAAA;QADrB,IAAA,CAAA,GAAG,GAAH,GAAG;QACF,IAAA,CAAA,SAAS,GAAT,SAAS;QAEjB,IAAI,CAAC,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG;IACjC;IAEA,eAAe,GAAA;QACb,IAAI,CAAC,cAAc,EAAE;AACrB,QAAA,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,aAAa,EAAE;YAClE,IAAI,cAAc,CAAC,MAAK;gBACtB,IAAI,CAAC,cAAc,EAAE;AACvB,YAAA,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,aAAa,CAAC;QAClD;IACF;;AAGA,IAAA,cAAc,CAAC,EAAU,EAAA;AACvB,QAAA,IAAI,CAAC,MAAM;YAAE;QACb,IAAI,OAAO,GAAG,CAAC;QACf,IAAI,OAAO,GAAG,CAAC;AACf,QAAA,IAAI,OAAO,GAAG,MAAM,CAAC,WAAW;AAChC,QAAA,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;YAC1B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
|
|
174
174
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NgxDrawerMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
175
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: NgxDrawerMenuComponent, isStandalone: true, selector: "ngx-drawer-menu", inputs: { side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null }, effect: { classPropertyName: "effect", publicName: "effect", isSignal: true, isRequired: false, transformFunction: null }, contentBehavior: { classPropertyName: "contentBehavior", publicName: "contentBehavior", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, swipeEdgeSize: { classPropertyName: "swipeEdgeSize", publicName: "swipeEdgeSize", isSignal: true, isRequired: false, transformFunction: null }, curtainStrips: { classPropertyName: "curtainStrips", publicName: "curtainStrips", isSignal: true, isRequired: false, transformFunction: null }, backdropClose: { classPropertyName: "backdropClose", publicName: "backdropClose", isSignal: true, isRequired: false, transformFunction: null }, swipeEnabled: { classPropertyName: "swipeEnabled", publicName: "swipeEnabled", isSignal: true, isRequired: false, transformFunction: null }, respondToViewport: { classPropertyName: "respondToViewport", publicName: "respondToViewport", isSignal: true, isRequired: false, transformFunction: null }, openOnDesktop: { classPropertyName: "openOnDesktop", publicName: "openOnDesktop", isSignal: true, isRequired: false, transformFunction: null }, openOnMobile: { classPropertyName: "openOnMobile", publicName: "openOnMobile", isSignal: true, isRequired: false, transformFunction: null }, mobileBreakpoint: { classPropertyName: "mobileBreakpoint", publicName: "mobileBreakpoint", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange" }, host: { listeners: { "document:keydown.escape": "onEscape()" }, classAttribute: "ngx-drawer-menu-host" }, ngImport: i0, template: "<div\n class=\"ngx-drawer-root\"\n [class]=\"'behavior-' + contentBehavior()\"\n [style.perspective.px]=\"1200\">\n @if (swipeEnabled() && !open()) {\n <div\n class=\"ngx-drawer-edge-zone\"\n [class.edge-start]=\"side() === 'start'\"\n [class.edge-end]=\"side() === 'end'\"\n [style.--ngx-drawer-edge-size]=\"swipeEdgeSize() + 'px'\"\n (mousedown)=\"onEdgeDragStart($event)\"\n (touchstart)=\"onEdgeDragStart($event)\"></div>\n }\n\n @if (visualOpen() > 0 && contentBehavior() === 'overlay') {\n <div\n class=\"ngx-drawer-backdrop\"\n [style.opacity]=\"visualOpen()\"\n [class.no-transition]=\"isDragging()\"\n (click)=\"closeFromBackdrop()\"></div>\n }\n\n <div\n class=\"ngx-drawer-main\"\n [class.no-transition]=\"isDragging()\"\n [style.--ngx-drawer-width]=\"width() + 'px'\"\n [style.--ngx-drawer-open]=\"visualOpen()\"\n [style.--ngx-drawer-dir]=\"pushDirSign()\">\n <ng-content></ng-content>\n\n @if (visualOpen() > 0 && contentBehavior() !== 'overlay') {\n <div\n class=\"ngx-drawer-main-dim\"\n [style.opacity]=\"visualOpen() * 0.35\"\n (click)=\"closeFromBackdrop()\"></div>\n }\n </div>\n\n <aside\n class=\"ngx-drawer-panel\"\n [class]=\"'effect-' + effect()\"\n [class.side-start]=\"side() === 'start'\"\n [class.side-end]=\"side() === 'end'\"\n [class.no-transition]=\"isDragging()\"\n [class.is-open]=\"open()\"\n [class.playing]=\"playEffectClass()\"\n [style.--ngx-drawer-width]=\"width() + 'px'\"\n [style.--ngx-drawer-open]=\"visualOpen()\"\n role=\"dialog\"\n aria-modal=\"true\">\n <div\n class=\"ngx-drawer-drag-handle\"\n [class.edge-start]=\"side() === 'start'\"\n [class.edge-end]=\"side() === 'end'\"\n (mousedown)=\"onPanelDragStart($event)\"\n (touchstart)=\"onPanelDragStart($event)\"></div>\n\n <div class=\"ngx-drawer-content\">\n <ng-content select=\"[drawerContent]\"></ng-content>\n </div>\n\n @if (effect() === 'curtain') {\n <div\n class=\"ngx-drawer-curtain\"\n [class.open]=\"open()\"\n [class.revealed]=\"visualOpen() >= 1 && !isDragging()\">\n @for (i of strips(); track i) {\n <div\n class=\"ngx-drawer-strip\"\n [class.side-start]=\"side() === 'start'\"\n [class.side-end]=\"side() === 'end'\"\n [style.transition-delay]=\"stripDelay(i)\"></div>\n }\n </div>\n }\n </aside>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:contents}:host{display:block;position:relative}.ngx-drawer-root{display:block;position:relative;min-block-size:100%}.ngx-drawer-edge-zone{position:fixed;inset-block:0;inline-size:var(--ngx-drawer-edge-size, 24px);z-index:1400;touch-action:pan-y}.ngx-drawer-edge-zone.edge-start{inset-inline-start:0}.ngx-drawer-edge-zone.edge-end{inset-inline-end:0}.ngx-drawer-backdrop{position:fixed;inset:0;background:#00000080;z-index:1450;transition:opacity .22s ease}.ngx-drawer-backdrop.no-transition{transition:none}.ngx-drawer-main{position:relative;min-block-size:100%;transition:transform .32s cubic-bezier(.22,.9,.32,1)}.ngx-drawer-main.no-transition{transition:none}.ngx-drawer-main-dim{position:absolute;inset:0;background:#000;pointer-events:auto;transition:opacity .22s ease}.behavior-push .ngx-drawer-main{transform:translate(calc(var(--ngx-drawer-open, 0) * var(--ngx-drawer-width, 280px) * var(--ngx-drawer-dir, 1)))}.behavior-reveal .ngx-drawer-main{transform-origin:center;border-radius:calc(var(--ngx-drawer-open, 0) * 16px);overflow:hidden;transform:scale(calc(1 - .08 * var(--ngx-drawer-open, 0))) translate(calc(var(--ngx-drawer-open, 0) * var(--ngx-drawer-width, 280px) * .28 * var(--ngx-drawer-dir, 1)))}.ngx-drawer-panel{position:fixed;inset-block:0;inline-size:var(--ngx-drawer-width, 280px);background:light-dark(#ffffff,#1c1c20);color:light-dark(#111827,#f4f4f5);z-index:1500;box-shadow:0 0 24px #00000040;overflow:hidden;transition:inset-inline-start .32s cubic-bezier(.22,.9,.32,1),inset-inline-end .32s cubic-bezier(.22,.9,.32,1),transform .32s cubic-bezier(.22,.9,.32,1),opacity .32s ease}.ngx-drawer-panel.side-start{inset-inline-start:calc((var(--ngx-drawer-open, 0) - 1) * var(--ngx-drawer-width, 280px))}.ngx-drawer-panel.side-end{inset-inline-end:calc((var(--ngx-drawer-open, 0) - 1) * var(--ngx-drawer-width, 280px))}.ngx-drawer-panel.no-transition{transition:none}.ngx-drawer-drag-handle{position:absolute;inset-block:0;inline-size:20px;z-index:2;touch-action:pan-y}.ngx-drawer-drag-handle.edge-start{inset-inline-end:-10px}.ngx-drawer-drag-handle.edge-end{inset-inline-start:-10px}.ngx-drawer-content{position:relative;block-size:100%;overflow-y:auto}.effect-scale.side-start{inset-inline-start:0;inset-inline-end:auto}.effect-scale.side-end{inset-inline-start:auto;inset-inline-end:0}.effect-scale{transform-origin:center;transform:scale(calc(.72 + .28 * var(--ngx-drawer-open, 0)));opacity:var(--ngx-drawer-open, 0);pointer-events:none}.effect-scale.is-open{pointer-events:auto}.effect-rotate3d{transform-style:preserve-3d;opacity:calc(.35 + .65 * var(--ngx-drawer-open, 0))}.effect-rotate3d.side-start{inset-inline-start:0;inset-inline-end:auto;transform-origin:left center;transform:rotateY(calc((1 - var(--ngx-drawer-open, 0)) * -100deg))}.effect-rotate3d.side-end{inset-inline-start:auto;inset-inline-end:0;transform-origin:right center;transform:rotateY(calc((1 - var(--ngx-drawer-open, 0)) * 100deg))}.effect-flip3d{transform-style:preserve-3d;box-shadow:0 0 30px #00000059}.effect-flip3d.side-start{inset-inline-start:0;inset-inline-end:auto;transform-origin:left center;transform:rotateY(calc((1 - var(--ngx-drawer-open, 0)) * -115deg)) translateZ(calc((1 - var(--ngx-drawer-open, 0)) * -50px))}.effect-flip3d.side-end{inset-inline-start:auto;inset-inline-end:0;transform-origin:right center;transform:rotateY(calc((1 - var(--ngx-drawer-open, 0)) * 115deg)) translateZ(calc((1 - var(--ngx-drawer-open, 0)) * -50px))}@keyframes ngx-drawer-jelly-open{0%{transform:scaleX(.55) skewY(4deg)}35%{transform:scaleX(1.09) skewY(-2.5deg)}55%{transform:scaleX(.96) skewY(1.5deg)}75%{transform:scaleX(1.03) skewY(-.6deg)}to{transform:scaleX(1) skewY(0)}}@keyframes ngx-drawer-jelly-close{0%{transform:scaleX(1) skewY(0)}30%{transform:scaleX(1.07) skewY(2deg)}to{transform:scaleX(.4) skewY(-5deg)}}.effect-jelly.side-start{transform-origin:left center}.effect-jelly.side-end{transform-origin:right center}.effect-jelly.playing.is-open{animation:ngx-drawer-jelly-open .62s cubic-bezier(.34,1.56,.64,1) both}.effect-jelly.playing:not(.is-open){animation:ngx-drawer-jelly-close .48s ease-in both}@keyframes ngx-drawer-pull-open{0%{transform:scaleX(.5)}60%{transform:scaleX(1.14)}to{transform:scaleX(1)}}@keyframes ngx-drawer-pull-close{0%{transform:scaleX(1)}40%{transform:scaleX(1.12)}to{transform:scaleX(.5)}}.effect-pull.side-start{transform-origin:left center}.effect-pull.side-end{transform-origin:right center}.effect-pull.playing.is-open{animation:ngx-drawer-pull-open .42s cubic-bezier(.16,1,.3,1) both}.effect-pull.playing:not(.is-open){animation:ngx-drawer-pull-close .38s ease-in both}.ngx-drawer-curtain{position:absolute;inset:0;display:flex;z-index:1;pointer-events:none}.ngx-drawer-curtain.revealed{display:none}.ngx-drawer-strip{flex:1 1 0;background:light-dark(#ffffff,#1c1c20);transform:scaleX(1);transition:transform .32s cubic-bezier(.65,0,.35,1)}.ngx-drawer-strip.side-start{transform-origin:left center}.ngx-drawer-strip.side-end{transform-origin:right center}.ngx-drawer-curtain.open .ngx-drawer-strip{transform:scaleX(0)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
175
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: NgxDrawerMenuComponent, isStandalone: true, selector: "ngx-drawer-menu", inputs: { side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null }, effect: { classPropertyName: "effect", publicName: "effect", isSignal: true, isRequired: false, transformFunction: null }, contentBehavior: { classPropertyName: "contentBehavior", publicName: "contentBehavior", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, swipeEdgeSize: { classPropertyName: "swipeEdgeSize", publicName: "swipeEdgeSize", isSignal: true, isRequired: false, transformFunction: null }, curtainStrips: { classPropertyName: "curtainStrips", publicName: "curtainStrips", isSignal: true, isRequired: false, transformFunction: null }, backdropClose: { classPropertyName: "backdropClose", publicName: "backdropClose", isSignal: true, isRequired: false, transformFunction: null }, swipeEnabled: { classPropertyName: "swipeEnabled", publicName: "swipeEnabled", isSignal: true, isRequired: false, transformFunction: null }, respondToViewport: { classPropertyName: "respondToViewport", publicName: "respondToViewport", isSignal: true, isRequired: false, transformFunction: null }, openOnDesktop: { classPropertyName: "openOnDesktop", publicName: "openOnDesktop", isSignal: true, isRequired: false, transformFunction: null }, openOnMobile: { classPropertyName: "openOnMobile", publicName: "openOnMobile", isSignal: true, isRequired: false, transformFunction: null }, mobileBreakpoint: { classPropertyName: "mobileBreakpoint", publicName: "mobileBreakpoint", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange" }, host: { listeners: { "document:keydown.escape": "onEscape()" }, classAttribute: "ngx-drawer-menu-host" }, ngImport: i0, template: "<div\r\n class=\"ngx-drawer-root\"\r\n [class]=\"'behavior-' + contentBehavior()\"\r\n [style.perspective.px]=\"1200\">\r\n @if (swipeEnabled() && !open()) {\r\n <div\r\n class=\"ngx-drawer-edge-zone\"\r\n [class.edge-start]=\"side() === 'start'\"\r\n [class.edge-end]=\"side() === 'end'\"\r\n [style.--ngx-drawer-edge-size]=\"swipeEdgeSize() + 'px'\"\r\n (mousedown)=\"onEdgeDragStart($event)\"\r\n (touchstart)=\"onEdgeDragStart($event)\"></div>\r\n }\r\n\r\n @if (visualOpen() > 0 && contentBehavior() === 'overlay') {\r\n <div\r\n class=\"ngx-drawer-backdrop\"\r\n [style.opacity]=\"visualOpen()\"\r\n [class.no-transition]=\"isDragging()\"\r\n (click)=\"closeFromBackdrop()\"></div>\r\n }\r\n\r\n <div\r\n class=\"ngx-drawer-main\"\r\n [class.no-transition]=\"isDragging()\"\r\n [style.--ngx-drawer-width]=\"width() + 'px'\"\r\n [style.--ngx-drawer-open]=\"visualOpen()\"\r\n [style.--ngx-drawer-dir]=\"pushDirSign()\">\r\n <ng-content></ng-content>\r\n\r\n @if (visualOpen() > 0 && contentBehavior() !== 'overlay') {\r\n <div\r\n class=\"ngx-drawer-main-dim\"\r\n [style.opacity]=\"visualOpen() * 0.35\"\r\n (click)=\"closeFromBackdrop()\"></div>\r\n }\r\n </div>\r\n\r\n <aside\r\n class=\"ngx-drawer-panel\"\r\n [class]=\"'effect-' + effect()\"\r\n [class.side-start]=\"side() === 'start'\"\r\n [class.side-end]=\"side() === 'end'\"\r\n [class.no-transition]=\"isDragging()\"\r\n [class.is-open]=\"open()\"\r\n [class.playing]=\"playEffectClass()\"\r\n [style.--ngx-drawer-width]=\"width() + 'px'\"\r\n [style.--ngx-drawer-open]=\"visualOpen()\"\r\n role=\"dialog\"\r\n aria-modal=\"true\">\r\n <div\r\n class=\"ngx-drawer-drag-handle\"\r\n [class.edge-start]=\"side() === 'start'\"\r\n [class.edge-end]=\"side() === 'end'\"\r\n (mousedown)=\"onPanelDragStart($event)\"\r\n (touchstart)=\"onPanelDragStart($event)\"></div>\r\n\r\n <div class=\"ngx-drawer-content\">\r\n <ng-content select=\"[drawerContent]\"></ng-content>\r\n </div>\r\n\r\n @if (effect() === 'curtain') {\r\n <div\r\n class=\"ngx-drawer-curtain\"\r\n [class.open]=\"open()\"\r\n [class.revealed]=\"visualOpen() >= 1 && !isDragging()\">\r\n @for (i of strips(); track i) {\r\n <div\r\n class=\"ngx-drawer-strip\"\r\n [class.side-start]=\"side() === 'start'\"\r\n [class.side-end]=\"side() === 'end'\"\r\n [style.transition-delay]=\"stripDelay(i)\"></div>\r\n }\r\n </div>\r\n }\r\n </aside>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";:host{display:contents}:host{display:block;position:relative}.ngx-drawer-root{display:block;position:relative;min-block-size:100%}.ngx-drawer-edge-zone{position:fixed;inset-block:0;inline-size:var(--ngx-drawer-edge-size, 24px);z-index:1400;touch-action:pan-y}.ngx-drawer-edge-zone.edge-start{inset-inline-start:0}.ngx-drawer-edge-zone.edge-end{inset-inline-end:0}.ngx-drawer-backdrop{position:fixed;inset:0;background:#00000080;z-index:1450;transition:opacity .22s ease}.ngx-drawer-backdrop.no-transition{transition:none}.ngx-drawer-main{position:relative;min-block-size:100%;transition:transform .32s cubic-bezier(.22,.9,.32,1)}.ngx-drawer-main.no-transition{transition:none}.ngx-drawer-main-dim{position:absolute;inset:0;background:#000;pointer-events:auto;transition:opacity .22s ease}.behavior-push .ngx-drawer-main{transform:translate(calc(var(--ngx-drawer-open, 0) * var(--ngx-drawer-width, 280px) * var(--ngx-drawer-dir, 1)))}.behavior-reveal .ngx-drawer-main{transform-origin:center;border-radius:calc(var(--ngx-drawer-open, 0) * 16px);overflow:hidden;transform:scale(calc(1 - .08 * var(--ngx-drawer-open, 0))) translate(calc(var(--ngx-drawer-open, 0) * var(--ngx-drawer-width, 280px) * .28 * var(--ngx-drawer-dir, 1)))}.ngx-drawer-panel{position:fixed;inset-block:0;inline-size:var(--ngx-drawer-width, 280px);background:light-dark(#ffffff,#1c1c20);color:light-dark(#111827,#f4f4f5);z-index:1500;box-shadow:0 0 24px #00000040;overflow:hidden;transition:inset-inline-start .32s cubic-bezier(.22,.9,.32,1),inset-inline-end .32s cubic-bezier(.22,.9,.32,1),transform .32s cubic-bezier(.22,.9,.32,1),opacity .32s ease}.ngx-drawer-panel.side-start{inset-inline-start:calc((var(--ngx-drawer-open, 0) - 1) * var(--ngx-drawer-width, 280px))}.ngx-drawer-panel.side-end{inset-inline-end:calc((var(--ngx-drawer-open, 0) - 1) * var(--ngx-drawer-width, 280px))}.ngx-drawer-panel.no-transition{transition:none}.ngx-drawer-drag-handle{position:absolute;inset-block:0;inline-size:20px;z-index:2;touch-action:pan-y}.ngx-drawer-drag-handle.edge-start{inset-inline-end:-10px}.ngx-drawer-drag-handle.edge-end{inset-inline-start:-10px}.ngx-drawer-content{position:relative;block-size:100%;overflow-y:auto}.effect-scale.side-start{inset-inline-start:0;inset-inline-end:auto}.effect-scale.side-end{inset-inline-start:auto;inset-inline-end:0}.effect-scale{transform-origin:center;transform:scale(calc(.72 + .28 * var(--ngx-drawer-open, 0)));opacity:var(--ngx-drawer-open, 0);pointer-events:none}.effect-scale.is-open{pointer-events:auto}.effect-rotate3d{transform-style:preserve-3d;opacity:calc(.35 + .65 * var(--ngx-drawer-open, 0))}.effect-rotate3d.side-start{inset-inline-start:0;inset-inline-end:auto;transform-origin:left center;transform:rotateY(calc((1 - var(--ngx-drawer-open, 0)) * -100deg))}.effect-rotate3d.side-end{inset-inline-start:auto;inset-inline-end:0;transform-origin:right center;transform:rotateY(calc((1 - var(--ngx-drawer-open, 0)) * 100deg))}.effect-flip3d{transform-style:preserve-3d;box-shadow:0 0 30px #00000059}.effect-flip3d.side-start{inset-inline-start:0;inset-inline-end:auto;transform-origin:left center;transform:rotateY(calc((1 - var(--ngx-drawer-open, 0)) * -115deg)) translateZ(calc((1 - var(--ngx-drawer-open, 0)) * -50px))}.effect-flip3d.side-end{inset-inline-start:auto;inset-inline-end:0;transform-origin:right center;transform:rotateY(calc((1 - var(--ngx-drawer-open, 0)) * 115deg)) translateZ(calc((1 - var(--ngx-drawer-open, 0)) * -50px))}@keyframes ngx-drawer-jelly-open{0%{transform:scaleX(.55) skewY(4deg)}35%{transform:scaleX(1.09) skewY(-2.5deg)}55%{transform:scaleX(.96) skewY(1.5deg)}75%{transform:scaleX(1.03) skewY(-.6deg)}to{transform:scaleX(1) skewY(0)}}@keyframes ngx-drawer-jelly-close{0%{transform:scaleX(1) skewY(0)}30%{transform:scaleX(1.07) skewY(2deg)}to{transform:scaleX(.4) skewY(-5deg)}}.effect-jelly.side-start{transform-origin:left center}.effect-jelly.side-end{transform-origin:right center}.effect-jelly.playing.is-open{animation:ngx-drawer-jelly-open .62s cubic-bezier(.34,1.56,.64,1) both}.effect-jelly.playing:not(.is-open){animation:ngx-drawer-jelly-close .48s ease-in both}@keyframes ngx-drawer-pull-open{0%{transform:scaleX(.5)}60%{transform:scaleX(1.14)}to{transform:scaleX(1)}}@keyframes ngx-drawer-pull-close{0%{transform:scaleX(1)}40%{transform:scaleX(1.12)}to{transform:scaleX(.5)}}.effect-pull.side-start{transform-origin:left center}.effect-pull.side-end{transform-origin:right center}.effect-pull.playing.is-open{animation:ngx-drawer-pull-open .42s cubic-bezier(.16,1,.3,1) both}.effect-pull.playing:not(.is-open){animation:ngx-drawer-pull-close .38s ease-in both}.ngx-drawer-curtain{position:absolute;inset:0;display:flex;z-index:1;pointer-events:none}.ngx-drawer-curtain.revealed{display:none}.ngx-drawer-strip{flex:1 1 0;background:light-dark(#ffffff,#1c1c20);transform:scaleX(1);transition:transform .32s cubic-bezier(.65,0,.35,1)}.ngx-drawer-strip.side-start{transform-origin:left center}.ngx-drawer-strip.side-end{transform-origin:right center}.ngx-drawer-curtain.open .ngx-drawer-strip{transform:scaleX(0)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
176
176
|
}
|
|
177
177
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NgxDrawerMenuComponent, decorators: [{
|
|
178
178
|
type: Component,
|
|
179
|
-
args: [{ selector: 'ngx-drawer-menu', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'ngx-drawer-menu-host' }, template: "<div\n class=\"ngx-drawer-root\"\n [class]=\"'behavior-' + contentBehavior()\"\n [style.perspective.px]=\"1200\">\n @if (swipeEnabled() && !open()) {\n <div\n class=\"ngx-drawer-edge-zone\"\n [class.edge-start]=\"side() === 'start'\"\n [class.edge-end]=\"side() === 'end'\"\n [style.--ngx-drawer-edge-size]=\"swipeEdgeSize() + 'px'\"\n (mousedown)=\"onEdgeDragStart($event)\"\n (touchstart)=\"onEdgeDragStart($event)\"></div>\n }\n\n @if (visualOpen() > 0 && contentBehavior() === 'overlay') {\n <div\n class=\"ngx-drawer-backdrop\"\n [style.opacity]=\"visualOpen()\"\n [class.no-transition]=\"isDragging()\"\n (click)=\"closeFromBackdrop()\"></div>\n }\n\n <div\n class=\"ngx-drawer-main\"\n [class.no-transition]=\"isDragging()\"\n [style.--ngx-drawer-width]=\"width() + 'px'\"\n [style.--ngx-drawer-open]=\"visualOpen()\"\n [style.--ngx-drawer-dir]=\"pushDirSign()\">\n <ng-content></ng-content>\n\n @if (visualOpen() > 0 && contentBehavior() !== 'overlay') {\n <div\n class=\"ngx-drawer-main-dim\"\n [style.opacity]=\"visualOpen() * 0.35\"\n (click)=\"closeFromBackdrop()\"></div>\n }\n </div>\n\n <aside\n class=\"ngx-drawer-panel\"\n [class]=\"'effect-' + effect()\"\n [class.side-start]=\"side() === 'start'\"\n [class.side-end]=\"side() === 'end'\"\n [class.no-transition]=\"isDragging()\"\n [class.is-open]=\"open()\"\n [class.playing]=\"playEffectClass()\"\n [style.--ngx-drawer-width]=\"width() + 'px'\"\n [style.--ngx-drawer-open]=\"visualOpen()\"\n role=\"dialog\"\n aria-modal=\"true\">\n <div\n class=\"ngx-drawer-drag-handle\"\n [class.edge-start]=\"side() === 'start'\"\n [class.edge-end]=\"side() === 'end'\"\n (mousedown)=\"onPanelDragStart($event)\"\n (touchstart)=\"onPanelDragStart($event)\"></div>\n\n <div class=\"ngx-drawer-content\">\n <ng-content select=\"[drawerContent]\"></ng-content>\n </div>\n\n @if (effect() === 'curtain') {\n <div\n class=\"ngx-drawer-curtain\"\n [class.open]=\"open()\"\n [class.revealed]=\"visualOpen() >= 1 && !isDragging()\">\n @for (i of strips(); track i) {\n <div\n class=\"ngx-drawer-strip\"\n [class.side-start]=\"side() === 'start'\"\n [class.side-end]=\"side() === 'end'\"\n [style.transition-delay]=\"stripDelay(i)\"></div>\n }\n </div>\n }\n </aside>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:contents}:host{display:block;position:relative}.ngx-drawer-root{display:block;position:relative;min-block-size:100%}.ngx-drawer-edge-zone{position:fixed;inset-block:0;inline-size:var(--ngx-drawer-edge-size, 24px);z-index:1400;touch-action:pan-y}.ngx-drawer-edge-zone.edge-start{inset-inline-start:0}.ngx-drawer-edge-zone.edge-end{inset-inline-end:0}.ngx-drawer-backdrop{position:fixed;inset:0;background:#00000080;z-index:1450;transition:opacity .22s ease}.ngx-drawer-backdrop.no-transition{transition:none}.ngx-drawer-main{position:relative;min-block-size:100%;transition:transform .32s cubic-bezier(.22,.9,.32,1)}.ngx-drawer-main.no-transition{transition:none}.ngx-drawer-main-dim{position:absolute;inset:0;background:#000;pointer-events:auto;transition:opacity .22s ease}.behavior-push .ngx-drawer-main{transform:translate(calc(var(--ngx-drawer-open, 0) * var(--ngx-drawer-width, 280px) * var(--ngx-drawer-dir, 1)))}.behavior-reveal .ngx-drawer-main{transform-origin:center;border-radius:calc(var(--ngx-drawer-open, 0) * 16px);overflow:hidden;transform:scale(calc(1 - .08 * var(--ngx-drawer-open, 0))) translate(calc(var(--ngx-drawer-open, 0) * var(--ngx-drawer-width, 280px) * .28 * var(--ngx-drawer-dir, 1)))}.ngx-drawer-panel{position:fixed;inset-block:0;inline-size:var(--ngx-drawer-width, 280px);background:light-dark(#ffffff,#1c1c20);color:light-dark(#111827,#f4f4f5);z-index:1500;box-shadow:0 0 24px #00000040;overflow:hidden;transition:inset-inline-start .32s cubic-bezier(.22,.9,.32,1),inset-inline-end .32s cubic-bezier(.22,.9,.32,1),transform .32s cubic-bezier(.22,.9,.32,1),opacity .32s ease}.ngx-drawer-panel.side-start{inset-inline-start:calc((var(--ngx-drawer-open, 0) - 1) * var(--ngx-drawer-width, 280px))}.ngx-drawer-panel.side-end{inset-inline-end:calc((var(--ngx-drawer-open, 0) - 1) * var(--ngx-drawer-width, 280px))}.ngx-drawer-panel.no-transition{transition:none}.ngx-drawer-drag-handle{position:absolute;inset-block:0;inline-size:20px;z-index:2;touch-action:pan-y}.ngx-drawer-drag-handle.edge-start{inset-inline-end:-10px}.ngx-drawer-drag-handle.edge-end{inset-inline-start:-10px}.ngx-drawer-content{position:relative;block-size:100%;overflow-y:auto}.effect-scale.side-start{inset-inline-start:0;inset-inline-end:auto}.effect-scale.side-end{inset-inline-start:auto;inset-inline-end:0}.effect-scale{transform-origin:center;transform:scale(calc(.72 + .28 * var(--ngx-drawer-open, 0)));opacity:var(--ngx-drawer-open, 0);pointer-events:none}.effect-scale.is-open{pointer-events:auto}.effect-rotate3d{transform-style:preserve-3d;opacity:calc(.35 + .65 * var(--ngx-drawer-open, 0))}.effect-rotate3d.side-start{inset-inline-start:0;inset-inline-end:auto;transform-origin:left center;transform:rotateY(calc((1 - var(--ngx-drawer-open, 0)) * -100deg))}.effect-rotate3d.side-end{inset-inline-start:auto;inset-inline-end:0;transform-origin:right center;transform:rotateY(calc((1 - var(--ngx-drawer-open, 0)) * 100deg))}.effect-flip3d{transform-style:preserve-3d;box-shadow:0 0 30px #00000059}.effect-flip3d.side-start{inset-inline-start:0;inset-inline-end:auto;transform-origin:left center;transform:rotateY(calc((1 - var(--ngx-drawer-open, 0)) * -115deg)) translateZ(calc((1 - var(--ngx-drawer-open, 0)) * -50px))}.effect-flip3d.side-end{inset-inline-start:auto;inset-inline-end:0;transform-origin:right center;transform:rotateY(calc((1 - var(--ngx-drawer-open, 0)) * 115deg)) translateZ(calc((1 - var(--ngx-drawer-open, 0)) * -50px))}@keyframes ngx-drawer-jelly-open{0%{transform:scaleX(.55) skewY(4deg)}35%{transform:scaleX(1.09) skewY(-2.5deg)}55%{transform:scaleX(.96) skewY(1.5deg)}75%{transform:scaleX(1.03) skewY(-.6deg)}to{transform:scaleX(1) skewY(0)}}@keyframes ngx-drawer-jelly-close{0%{transform:scaleX(1) skewY(0)}30%{transform:scaleX(1.07) skewY(2deg)}to{transform:scaleX(.4) skewY(-5deg)}}.effect-jelly.side-start{transform-origin:left center}.effect-jelly.side-end{transform-origin:right center}.effect-jelly.playing.is-open{animation:ngx-drawer-jelly-open .62s cubic-bezier(.34,1.56,.64,1) both}.effect-jelly.playing:not(.is-open){animation:ngx-drawer-jelly-close .48s ease-in both}@keyframes ngx-drawer-pull-open{0%{transform:scaleX(.5)}60%{transform:scaleX(1.14)}to{transform:scaleX(1)}}@keyframes ngx-drawer-pull-close{0%{transform:scaleX(1)}40%{transform:scaleX(1.12)}to{transform:scaleX(.5)}}.effect-pull.side-start{transform-origin:left center}.effect-pull.side-end{transform-origin:right center}.effect-pull.playing.is-open{animation:ngx-drawer-pull-open .42s cubic-bezier(.16,1,.3,1) both}.effect-pull.playing:not(.is-open){animation:ngx-drawer-pull-close .38s ease-in both}.ngx-drawer-curtain{position:absolute;inset:0;display:flex;z-index:1;pointer-events:none}.ngx-drawer-curtain.revealed{display:none}.ngx-drawer-strip{flex:1 1 0;background:light-dark(#ffffff,#1c1c20);transform:scaleX(1);transition:transform .32s cubic-bezier(.65,0,.35,1)}.ngx-drawer-strip.side-start{transform-origin:left center}.ngx-drawer-strip.side-end{transform-origin:right center}.ngx-drawer-curtain.open .ngx-drawer-strip{transform:scaleX(0)}\n"] }]
|
|
179
|
+
args: [{ selector: 'ngx-drawer-menu', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'ngx-drawer-menu-host' }, template: "<div\r\n class=\"ngx-drawer-root\"\r\n [class]=\"'behavior-' + contentBehavior()\"\r\n [style.perspective.px]=\"1200\">\r\n @if (swipeEnabled() && !open()) {\r\n <div\r\n class=\"ngx-drawer-edge-zone\"\r\n [class.edge-start]=\"side() === 'start'\"\r\n [class.edge-end]=\"side() === 'end'\"\r\n [style.--ngx-drawer-edge-size]=\"swipeEdgeSize() + 'px'\"\r\n (mousedown)=\"onEdgeDragStart($event)\"\r\n (touchstart)=\"onEdgeDragStart($event)\"></div>\r\n }\r\n\r\n @if (visualOpen() > 0 && contentBehavior() === 'overlay') {\r\n <div\r\n class=\"ngx-drawer-backdrop\"\r\n [style.opacity]=\"visualOpen()\"\r\n [class.no-transition]=\"isDragging()\"\r\n (click)=\"closeFromBackdrop()\"></div>\r\n }\r\n\r\n <div\r\n class=\"ngx-drawer-main\"\r\n [class.no-transition]=\"isDragging()\"\r\n [style.--ngx-drawer-width]=\"width() + 'px'\"\r\n [style.--ngx-drawer-open]=\"visualOpen()\"\r\n [style.--ngx-drawer-dir]=\"pushDirSign()\">\r\n <ng-content></ng-content>\r\n\r\n @if (visualOpen() > 0 && contentBehavior() !== 'overlay') {\r\n <div\r\n class=\"ngx-drawer-main-dim\"\r\n [style.opacity]=\"visualOpen() * 0.35\"\r\n (click)=\"closeFromBackdrop()\"></div>\r\n }\r\n </div>\r\n\r\n <aside\r\n class=\"ngx-drawer-panel\"\r\n [class]=\"'effect-' + effect()\"\r\n [class.side-start]=\"side() === 'start'\"\r\n [class.side-end]=\"side() === 'end'\"\r\n [class.no-transition]=\"isDragging()\"\r\n [class.is-open]=\"open()\"\r\n [class.playing]=\"playEffectClass()\"\r\n [style.--ngx-drawer-width]=\"width() + 'px'\"\r\n [style.--ngx-drawer-open]=\"visualOpen()\"\r\n role=\"dialog\"\r\n aria-modal=\"true\">\r\n <div\r\n class=\"ngx-drawer-drag-handle\"\r\n [class.edge-start]=\"side() === 'start'\"\r\n [class.edge-end]=\"side() === 'end'\"\r\n (mousedown)=\"onPanelDragStart($event)\"\r\n (touchstart)=\"onPanelDragStart($event)\"></div>\r\n\r\n <div class=\"ngx-drawer-content\">\r\n <ng-content select=\"[drawerContent]\"></ng-content>\r\n </div>\r\n\r\n @if (effect() === 'curtain') {\r\n <div\r\n class=\"ngx-drawer-curtain\"\r\n [class.open]=\"open()\"\r\n [class.revealed]=\"visualOpen() >= 1 && !isDragging()\">\r\n @for (i of strips(); track i) {\r\n <div\r\n class=\"ngx-drawer-strip\"\r\n [class.side-start]=\"side() === 'start'\"\r\n [class.side-end]=\"side() === 'end'\"\r\n [style.transition-delay]=\"stripDelay(i)\"></div>\r\n }\r\n </div>\r\n }\r\n </aside>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";:host{display:contents}:host{display:block;position:relative}.ngx-drawer-root{display:block;position:relative;min-block-size:100%}.ngx-drawer-edge-zone{position:fixed;inset-block:0;inline-size:var(--ngx-drawer-edge-size, 24px);z-index:1400;touch-action:pan-y}.ngx-drawer-edge-zone.edge-start{inset-inline-start:0}.ngx-drawer-edge-zone.edge-end{inset-inline-end:0}.ngx-drawer-backdrop{position:fixed;inset:0;background:#00000080;z-index:1450;transition:opacity .22s ease}.ngx-drawer-backdrop.no-transition{transition:none}.ngx-drawer-main{position:relative;min-block-size:100%;transition:transform .32s cubic-bezier(.22,.9,.32,1)}.ngx-drawer-main.no-transition{transition:none}.ngx-drawer-main-dim{position:absolute;inset:0;background:#000;pointer-events:auto;transition:opacity .22s ease}.behavior-push .ngx-drawer-main{transform:translate(calc(var(--ngx-drawer-open, 0) * var(--ngx-drawer-width, 280px) * var(--ngx-drawer-dir, 1)))}.behavior-reveal .ngx-drawer-main{transform-origin:center;border-radius:calc(var(--ngx-drawer-open, 0) * 16px);overflow:hidden;transform:scale(calc(1 - .08 * var(--ngx-drawer-open, 0))) translate(calc(var(--ngx-drawer-open, 0) * var(--ngx-drawer-width, 280px) * .28 * var(--ngx-drawer-dir, 1)))}.ngx-drawer-panel{position:fixed;inset-block:0;inline-size:var(--ngx-drawer-width, 280px);background:light-dark(#ffffff,#1c1c20);color:light-dark(#111827,#f4f4f5);z-index:1500;box-shadow:0 0 24px #00000040;overflow:hidden;transition:inset-inline-start .32s cubic-bezier(.22,.9,.32,1),inset-inline-end .32s cubic-bezier(.22,.9,.32,1),transform .32s cubic-bezier(.22,.9,.32,1),opacity .32s ease}.ngx-drawer-panel.side-start{inset-inline-start:calc((var(--ngx-drawer-open, 0) - 1) * var(--ngx-drawer-width, 280px))}.ngx-drawer-panel.side-end{inset-inline-end:calc((var(--ngx-drawer-open, 0) - 1) * var(--ngx-drawer-width, 280px))}.ngx-drawer-panel.no-transition{transition:none}.ngx-drawer-drag-handle{position:absolute;inset-block:0;inline-size:20px;z-index:2;touch-action:pan-y}.ngx-drawer-drag-handle.edge-start{inset-inline-end:-10px}.ngx-drawer-drag-handle.edge-end{inset-inline-start:-10px}.ngx-drawer-content{position:relative;block-size:100%;overflow-y:auto}.effect-scale.side-start{inset-inline-start:0;inset-inline-end:auto}.effect-scale.side-end{inset-inline-start:auto;inset-inline-end:0}.effect-scale{transform-origin:center;transform:scale(calc(.72 + .28 * var(--ngx-drawer-open, 0)));opacity:var(--ngx-drawer-open, 0);pointer-events:none}.effect-scale.is-open{pointer-events:auto}.effect-rotate3d{transform-style:preserve-3d;opacity:calc(.35 + .65 * var(--ngx-drawer-open, 0))}.effect-rotate3d.side-start{inset-inline-start:0;inset-inline-end:auto;transform-origin:left center;transform:rotateY(calc((1 - var(--ngx-drawer-open, 0)) * -100deg))}.effect-rotate3d.side-end{inset-inline-start:auto;inset-inline-end:0;transform-origin:right center;transform:rotateY(calc((1 - var(--ngx-drawer-open, 0)) * 100deg))}.effect-flip3d{transform-style:preserve-3d;box-shadow:0 0 30px #00000059}.effect-flip3d.side-start{inset-inline-start:0;inset-inline-end:auto;transform-origin:left center;transform:rotateY(calc((1 - var(--ngx-drawer-open, 0)) * -115deg)) translateZ(calc((1 - var(--ngx-drawer-open, 0)) * -50px))}.effect-flip3d.side-end{inset-inline-start:auto;inset-inline-end:0;transform-origin:right center;transform:rotateY(calc((1 - var(--ngx-drawer-open, 0)) * 115deg)) translateZ(calc((1 - var(--ngx-drawer-open, 0)) * -50px))}@keyframes ngx-drawer-jelly-open{0%{transform:scaleX(.55) skewY(4deg)}35%{transform:scaleX(1.09) skewY(-2.5deg)}55%{transform:scaleX(.96) skewY(1.5deg)}75%{transform:scaleX(1.03) skewY(-.6deg)}to{transform:scaleX(1) skewY(0)}}@keyframes ngx-drawer-jelly-close{0%{transform:scaleX(1) skewY(0)}30%{transform:scaleX(1.07) skewY(2deg)}to{transform:scaleX(.4) skewY(-5deg)}}.effect-jelly.side-start{transform-origin:left center}.effect-jelly.side-end{transform-origin:right center}.effect-jelly.playing.is-open{animation:ngx-drawer-jelly-open .62s cubic-bezier(.34,1.56,.64,1) both}.effect-jelly.playing:not(.is-open){animation:ngx-drawer-jelly-close .48s ease-in both}@keyframes ngx-drawer-pull-open{0%{transform:scaleX(.5)}60%{transform:scaleX(1.14)}to{transform:scaleX(1)}}@keyframes ngx-drawer-pull-close{0%{transform:scaleX(1)}40%{transform:scaleX(1.12)}to{transform:scaleX(.5)}}.effect-pull.side-start{transform-origin:left center}.effect-pull.side-end{transform-origin:right center}.effect-pull.playing.is-open{animation:ngx-drawer-pull-open .42s cubic-bezier(.16,1,.3,1) both}.effect-pull.playing:not(.is-open){animation:ngx-drawer-pull-close .38s ease-in both}.ngx-drawer-curtain{position:absolute;inset:0;display:flex;z-index:1;pointer-events:none}.ngx-drawer-curtain.revealed{display:none}.ngx-drawer-strip{flex:1 1 0;background:light-dark(#ffffff,#1c1c20);transform:scaleX(1);transition:transform .32s cubic-bezier(.65,0,.35,1)}.ngx-drawer-strip.side-start{transform-origin:left center}.ngx-drawer-strip.side-end{transform-origin:right center}.ngx-drawer-curtain.open .ngx-drawer-strip{transform:scaleX(0)}\n"] }]
|
|
180
180
|
}], ctorParameters: () => [], propDecorators: { side: [{ type: i0.Input, args: [{ isSignal: true, alias: "side", required: false }] }], effect: [{ type: i0.Input, args: [{ isSignal: true, alias: "effect", required: false }] }], contentBehavior: [{ type: i0.Input, args: [{ isSignal: true, alias: "contentBehavior", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], swipeEdgeSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "swipeEdgeSize", required: false }] }], curtainStrips: [{ type: i0.Input, args: [{ isSignal: true, alias: "curtainStrips", required: false }] }], backdropClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "backdropClose", required: false }] }], swipeEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "swipeEnabled", required: false }] }], respondToViewport: [{ type: i0.Input, args: [{ isSignal: true, alias: "respondToViewport", required: false }] }], openOnDesktop: [{ type: i0.Input, args: [{ isSignal: true, alias: "openOnDesktop", required: false }] }], openOnMobile: [{ type: i0.Input, args: [{ isSignal: true, alias: "openOnMobile", required: false }] }], mobileBreakpoint: [{ type: i0.Input, args: [{ isSignal: true, alias: "mobileBreakpoint", required: false }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], onEscape: [{
|
|
181
181
|
type: HostListener,
|
|
182
182
|
args: ['document:keydown.escape']
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-kit-drawer-menu.mjs","sources":["../../../projects/libs/drawer-menu/components/drawer-menu.component.ts","../../../projects/libs/drawer-menu/components/drawer-menu.component.html","../../../projects/libs/drawer-menu/ngx-kit-drawer-menu.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n DOCUMENT,\n HostListener,\n computed,\n effect,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\nimport { DirectionService, startDragSession } from 'ngx-kit/shared';\nimport {\n NgxDrawerContentBehavior,\n NgxDrawerEffect,\n NgxDrawerSide,\n} from '../contracts/drawer-menu-types';\n\n/**\n * درور منو (side drawer) با ۶ جلوهی بازوبستهشدنِ متفاوت (از ساده تا\n * سهبعدی/ژلهای) و ۳ رفتار برای محتوای صفحه (overlay/push/reveal) —\n * دقیقاً مدل کتابخونههای حرفهای مثل react-burger-menu یا Ionic Menu، ولی\n * signal-based و بدون هیچ وابستگی خارجی.\n *\n * نکات معماری:\n * - از 'start'/'end' منطقی استفاده میکنه، پس با CSS logical properties\n * زیر RTL خودکار برعکس میشه؛ فقط ریاضیِ درگ (که برخلاف CSS جهت فیزیکیِ\n * واقعی لازم داره) از DirectionService مشترک استفاده میکنه.\n * - وضعیت باز/بسته با model() دوطرفهست، پس هم با [(open)] قابل کنترله و\n * هم میتونه بهصورت خودکار و زنده با عرض صفحه هماهنگ بشه (respondToViewport)\n * — یعنی رد شدن از breakpoint (نه فقط بار اول لود) میتونه خودکار باز/بستهش کنه.\n * - افکتهای jelly/pull با keyframe سهمرحلهای (overshoot → نوسان → استقرار)\n * پیاده شدن، نه فقط یه transition ساده.\n */\n@Component({\n selector: 'ngx-drawer-menu',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './drawer-menu.component.html',\n styleUrl: './drawer-menu.component.scss',\n host: { class: 'ngx-drawer-menu-host' },\n})\nexport class NgxDrawerMenuComponent {\n side = input<NgxDrawerSide>('start');\n effect = input<NgxDrawerEffect>('slide');\n contentBehavior = input<NgxDrawerContentBehavior>('overlay');\n width = input<number>(280);\n swipeEdgeSize = input<number>(24);\n curtainStrips = input<number>(7);\n backdropClose = input<boolean>(true);\n swipeEnabled = input<boolean>(true);\n\n /** اگه true باشه، رد شدن از mobileBreakpoint بهصورت زنده open رو با openOnDesktop/openOnMobile هماهنگ میکنه */\n respondToViewport = input<boolean>(true);\n openOnDesktop = input<boolean>(true);\n openOnMobile = input<boolean>(false);\n mobileBreakpoint = input<number>(768);\n\n /** state دوطرفهی باز/بسته؛ با [(open)] قابل bind هست */\n open = model<boolean>(false);\n\n private readonly directionService = inject(DirectionService);\n private readonly doc = inject(DOCUMENT);\n private readonly destroyRef = inject(DestroyRef);\n\n /** فقط حین یه درگِ واقعی مقدار داره؛ null یعنی از روی open() تصمیم بگیر */\n protected readonly dragRatio = signal<number | null>(null);\n protected readonly isDragging = computed(() => this.dragRatio() !== null);\n protected readonly visualOpen = computed(() => this.dragRatio() ?? (this.open() ? 1 : 0));\n protected readonly strips = computed(() =>\n Array.from({ length: this.curtainStrips() }, (_, i) => i),\n );\n\n /**\n * +۱ یعنی این پنل فیزیکاً روی لبهی چپِ صفحهست، -۱ یعنی لبهی راست —\n * برای transform:translateX() محتوای اصلی (که برخلاف inset-inline، به\n * dir=rtl خودکار واکنش نشون نمیده) لازمه. reactive هست چون هم به side()\n * و هم به جهتِ زندهی صفحه (directionService.isRtl()) وابستهست.\n */\n protected readonly pushDirSign = computed(() => (this.isPhysicalLeftEdge() ? 1 : -1));\n\n /** برای افکتهای keyframeمحور (jelly/pull) — فقط لحظهی رهاشدن (نه حین درگ زنده) پخش میشه */\n protected readonly playEffectClass = signal(false);\n\n private stopDrag?: () => void;\n private dragStartX = 0;\n private dragStartRatio = 0;\n private prevOpen = false;\n\n constructor() {\n // قفل اسکرول پسزمینه حین باز بودن پنل (فقط در حالت overlay واقعاً لازمه،\n // ولی در push/reveal هم بیضرره و تجربهی بهتری میده)\n effect((onCleanup) => {\n if (this.open() && this.contentBehavior() === 'overlay') {\n const prevOverflow = this.doc.body.style.overflow;\n this.doc.body.style.overflow = 'hidden';\n onCleanup(() => {\n this.doc.body.style.overflow = prevOverflow;\n });\n }\n });\n\n // پخش انیمیشن keyframeمحور فقط لحظهای که open() واقعاً عوض میشه (نه هر CD)\n effect(() => {\n const isOpen = this.open();\n if (isOpen !== this.prevOpen) {\n this.prevOpen = isOpen;\n this.playEffectClass.set(true);\n const id = setTimeout(() => this.playEffectClass.set(false), 700);\n // پاکسازی در صورتی که کامپوننت زودتر destroy بشه\n this.destroyRef.onDestroy(() => clearTimeout(id));\n }\n });\n\n this.destroyRef.onDestroy(() => this.stopDrag?.());\n\n // هماهنگیِ زنده با breakpoint\n if (typeof window !== 'undefined') {\n const mql = window.matchMedia(`(min-width: ${this.mobileBreakpoint()}px)`);\n const applyForCurrentViewport = (isDesktop: boolean) => {\n if (this.respondToViewport()) {\n this.open.set(isDesktop ? this.openOnDesktop() : this.openOnMobile());\n }\n };\n applyForCurrentViewport(mql.matches);\n const handler = (e: MediaQueryListEvent) => applyForCurrentViewport(e.matches);\n mql.addEventListener('change', handler);\n this.destroyRef.onDestroy(() => mql.removeEventListener('change', handler));\n }\n }\n\n @HostListener('document:keydown.escape')\n protected onEscape(): void {\n if (this.open()) this.open.set(false);\n }\n\n protected closeFromBackdrop(): void {\n if (this.backdropClose()) this.open.set(false);\n }\n\n toggle(): void {\n this.open.update((o) => !o);\n }\n\n /** true یعنی این پنل فیزیکاً روی لبهی چپِ صفحهست (صرفنظر از start/end منطقی) */\n private isPhysicalLeftEdge(): boolean {\n const isRtl = this.directionService.isRtl();\n return this.side() === 'start' ? !isRtl : isRtl;\n }\n\n protected stripDelay(index: number): string {\n const count = this.curtainStrips();\n const order = this.open() ? index : count - 1 - index;\n return `${order * 28}ms`;\n }\n\n // ---------- درگ (هم برای باز کردن از لبه، هم بستن با کشیدنِ پنل) ----------\n protected onEdgeDragStart(ev: MouseEvent | TouchEvent): void {\n if (!this.swipeEnabled() || this.open()) return;\n this.beginDrag(ev, 0);\n }\n\n protected onPanelDragStart(ev: MouseEvent | TouchEvent): void {\n if (!this.open()) return;\n this.beginDrag(ev, 1);\n }\n\n private beginDrag(ev: MouseEvent | TouchEvent, startRatio: number): void {\n ev.preventDefault();\n this.dragStartX = this.clientXOf(ev);\n this.dragStartRatio = startRatio;\n this.dragRatio.set(startRatio);\n this.stopDrag?.();\n this.stopDrag = startDragSession({\n onMove: (moveEv) => {\n const dx = this.clientXOf(moveEv) - this.dragStartX;\n const opensToward = this.isPhysicalLeftEdge() ? 1 : -1;\n const signedRatio = (dx * opensToward) / this.width();\n const ratio = Math.min(1, Math.max(0, this.dragStartRatio + signedRatio));\n this.dragRatio.set(ratio);\n },\n onEnd: () => {\n const ratio = this.dragRatio() ?? this.dragStartRatio;\n this.open.set(ratio > 0.4);\n this.dragRatio.set(null);\n this.stopDrag = undefined;\n },\n });\n }\n\n private clientXOf(ev: MouseEvent | TouchEvent): number {\n return 'touches' in ev\n ? (ev.touches[0]?.clientX ?? ev.changedTouches[0]?.clientX ?? 0)\n : ev.clientX;\n }\n}\n","<div\n class=\"ngx-drawer-root\"\n [class]=\"'behavior-' + contentBehavior()\"\n [style.perspective.px]=\"1200\">\n @if (swipeEnabled() && !open()) {\n <div\n class=\"ngx-drawer-edge-zone\"\n [class.edge-start]=\"side() === 'start'\"\n [class.edge-end]=\"side() === 'end'\"\n [style.--ngx-drawer-edge-size]=\"swipeEdgeSize() + 'px'\"\n (mousedown)=\"onEdgeDragStart($event)\"\n (touchstart)=\"onEdgeDragStart($event)\"></div>\n }\n\n @if (visualOpen() > 0 && contentBehavior() === 'overlay') {\n <div\n class=\"ngx-drawer-backdrop\"\n [style.opacity]=\"visualOpen()\"\n [class.no-transition]=\"isDragging()\"\n (click)=\"closeFromBackdrop()\"></div>\n }\n\n <div\n class=\"ngx-drawer-main\"\n [class.no-transition]=\"isDragging()\"\n [style.--ngx-drawer-width]=\"width() + 'px'\"\n [style.--ngx-drawer-open]=\"visualOpen()\"\n [style.--ngx-drawer-dir]=\"pushDirSign()\">\n <ng-content></ng-content>\n\n @if (visualOpen() > 0 && contentBehavior() !== 'overlay') {\n <div\n class=\"ngx-drawer-main-dim\"\n [style.opacity]=\"visualOpen() * 0.35\"\n (click)=\"closeFromBackdrop()\"></div>\n }\n </div>\n\n <aside\n class=\"ngx-drawer-panel\"\n [class]=\"'effect-' + effect()\"\n [class.side-start]=\"side() === 'start'\"\n [class.side-end]=\"side() === 'end'\"\n [class.no-transition]=\"isDragging()\"\n [class.is-open]=\"open()\"\n [class.playing]=\"playEffectClass()\"\n [style.--ngx-drawer-width]=\"width() + 'px'\"\n [style.--ngx-drawer-open]=\"visualOpen()\"\n role=\"dialog\"\n aria-modal=\"true\">\n <div\n class=\"ngx-drawer-drag-handle\"\n [class.edge-start]=\"side() === 'start'\"\n [class.edge-end]=\"side() === 'end'\"\n (mousedown)=\"onPanelDragStart($event)\"\n (touchstart)=\"onPanelDragStart($event)\"></div>\n\n <div class=\"ngx-drawer-content\">\n <ng-content select=\"[drawerContent]\"></ng-content>\n </div>\n\n @if (effect() === 'curtain') {\n <div\n class=\"ngx-drawer-curtain\"\n [class.open]=\"open()\"\n [class.revealed]=\"visualOpen() >= 1 && !isDragging()\">\n @for (i of strips(); track i) {\n <div\n class=\"ngx-drawer-strip\"\n [class.side-start]=\"side() === 'start'\"\n [class.side-end]=\"side() === 'end'\"\n [style.transition-delay]=\"stripDelay(i)\"></div>\n }\n </div>\n }\n </aside>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAoBA;;;;;;;;;;;;;;;AAeG;MASU,sBAAsB,CAAA;IACjC,IAAI,GAAG,KAAK,CAAgB,OAAO;6EAAC;IACpC,MAAM,GAAG,KAAK,CAAkB,OAAO;+EAAC;IACxC,eAAe,GAAG,KAAK,CAA2B,SAAS;wFAAC;IAC5D,KAAK,GAAG,KAAK,CAAS,GAAG;8EAAC;IAC1B,aAAa,GAAG,KAAK,CAAS,EAAE;sFAAC;IACjC,aAAa,GAAG,KAAK,CAAS,CAAC;sFAAC;IAChC,aAAa,GAAG,KAAK,CAAU,IAAI;sFAAC;IACpC,YAAY,GAAG,KAAK,CAAU,IAAI;qFAAC;;IAGnC,iBAAiB,GAAG,KAAK,CAAU,IAAI;0FAAC;IACxC,aAAa,GAAG,KAAK,CAAU,IAAI;sFAAC;IACpC,YAAY,GAAG,KAAK,CAAU,KAAK;qFAAC;IACpC,gBAAgB,GAAG,KAAK,CAAS,GAAG;yFAAC;;IAGrC,IAAI,GAAG,KAAK,CAAU,KAAK;6EAAC;AAEX,IAAA,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAC3C,IAAA,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC;AACtB,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;;IAG7B,SAAS,GAAG,MAAM,CAAgB,IAAI;kFAAC;IACvC,UAAU,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,KAAK,IAAI;mFAAC;IACtD,UAAU,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,KAAK,I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,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,o+DC5CnC,w9EA6EA,EAAA,MAAA,EAAA,CAAA,8+JAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FDjCa,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBARlC,SAAS;+BACE,iBAAiB,EAAA,UAAA,EACf,IAAI,EAAA,eAAA,EACC,uBAAuB,CAAC,MAAM,EAAA,IAAA,EAGzC,EAAE,KAAK,EAAE,sBAAsB,EAAE,EAAA,QAAA,EAAA,w9EAAA,EAAA,MAAA,EAAA,CAAA,8+JAAA,CAAA,EAAA;;sBA2FtC,YAAY;uBAAC,yBAAyB;;;AErIzC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-kit-drawer-menu.mjs","sources":["../../../projects/libs/drawer-menu/components/drawer-menu.component.ts","../../../projects/libs/drawer-menu/components/drawer-menu.component.html","../../../projects/libs/drawer-menu/ngx-kit-drawer-menu.ts"],"sourcesContent":["import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n DestroyRef,\r\n DOCUMENT,\r\n HostListener,\r\n computed,\r\n effect,\r\n inject,\r\n input,\r\n model,\r\n signal,\r\n} from '@angular/core';\r\nimport { DirectionService, startDragSession } from 'ngx-kit/shared';\r\nimport {\r\n NgxDrawerContentBehavior,\r\n NgxDrawerEffect,\r\n NgxDrawerSide,\r\n} from '../contracts/drawer-menu-types';\r\n\r\n/**\r\n * درور منو (side drawer) با ۶ جلوهی بازوبستهشدنِ متفاوت (از ساده تا\r\n * سهبعدی/ژلهای) و ۳ رفتار برای محتوای صفحه (overlay/push/reveal) —\r\n * دقیقاً مدل کتابخونههای حرفهای مثل react-burger-menu یا Ionic Menu، ولی\r\n * signal-based و بدون هیچ وابستگی خارجی.\r\n *\r\n * نکات معماری:\r\n * - از 'start'/'end' منطقی استفاده میکنه، پس با CSS logical properties\r\n * زیر RTL خودکار برعکس میشه؛ فقط ریاضیِ درگ (که برخلاف CSS جهت فیزیکیِ\r\n * واقعی لازم داره) از DirectionService مشترک استفاده میکنه.\r\n * - وضعیت باز/بسته با model() دوطرفهست، پس هم با [(open)] قابل کنترله و\r\n * هم میتونه بهصورت خودکار و زنده با عرض صفحه هماهنگ بشه (respondToViewport)\r\n * — یعنی رد شدن از breakpoint (نه فقط بار اول لود) میتونه خودکار باز/بستهش کنه.\r\n * - افکتهای jelly/pull با keyframe سهمرحلهای (overshoot → نوسان → استقرار)\r\n * پیاده شدن، نه فقط یه transition ساده.\r\n */\r\n@Component({\r\n selector: 'ngx-drawer-menu',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n templateUrl: './drawer-menu.component.html',\r\n styleUrl: './drawer-menu.component.scss',\r\n host: { class: 'ngx-drawer-menu-host' },\r\n})\r\nexport class NgxDrawerMenuComponent {\r\n side = input<NgxDrawerSide>('start');\r\n effect = input<NgxDrawerEffect>('slide');\r\n contentBehavior = input<NgxDrawerContentBehavior>('overlay');\r\n width = input<number>(280);\r\n swipeEdgeSize = input<number>(24);\r\n curtainStrips = input<number>(7);\r\n backdropClose = input<boolean>(true);\r\n swipeEnabled = input<boolean>(true);\r\n\r\n /** اگه true باشه، رد شدن از mobileBreakpoint بهصورت زنده open رو با openOnDesktop/openOnMobile هماهنگ میکنه */\r\n respondToViewport = input<boolean>(true);\r\n openOnDesktop = input<boolean>(true);\r\n openOnMobile = input<boolean>(false);\r\n mobileBreakpoint = input<number>(768);\r\n\r\n /** state دوطرفهی باز/بسته؛ با [(open)] قابل bind هست */\r\n open = model<boolean>(false);\r\n\r\n private readonly directionService = inject(DirectionService);\r\n private readonly doc = inject(DOCUMENT);\r\n private readonly destroyRef = inject(DestroyRef);\r\n\r\n /** فقط حین یه درگِ واقعی مقدار داره؛ null یعنی از روی open() تصمیم بگیر */\r\n protected readonly dragRatio = signal<number | null>(null);\r\n protected readonly isDragging = computed(() => this.dragRatio() !== null);\r\n protected readonly visualOpen = computed(() => this.dragRatio() ?? (this.open() ? 1 : 0));\r\n protected readonly strips = computed(() =>\r\n Array.from({ length: this.curtainStrips() }, (_, i) => i),\r\n );\r\n\r\n /**\r\n * +۱ یعنی این پنل فیزیکاً روی لبهی چپِ صفحهست، -۱ یعنی لبهی راست —\r\n * برای transform:translateX() محتوای اصلی (که برخلاف inset-inline، به\r\n * dir=rtl خودکار واکنش نشون نمیده) لازمه. reactive هست چون هم به side()\r\n * و هم به جهتِ زندهی صفحه (directionService.isRtl()) وابستهست.\r\n */\r\n protected readonly pushDirSign = computed(() => (this.isPhysicalLeftEdge() ? 1 : -1));\r\n\r\n /** برای افکتهای keyframeمحور (jelly/pull) — فقط لحظهی رهاشدن (نه حین درگ زنده) پخش میشه */\r\n protected readonly playEffectClass = signal(false);\r\n\r\n private stopDrag?: () => void;\r\n private dragStartX = 0;\r\n private dragStartRatio = 0;\r\n private prevOpen = false;\r\n\r\n constructor() {\r\n // قفل اسکرول پسزمینه حین باز بودن پنل (فقط در حالت overlay واقعاً لازمه،\r\n // ولی در push/reveal هم بیضرره و تجربهی بهتری میده)\r\n effect((onCleanup) => {\r\n if (this.open() && this.contentBehavior() === 'overlay') {\r\n const prevOverflow = this.doc.body.style.overflow;\r\n this.doc.body.style.overflow = 'hidden';\r\n onCleanup(() => {\r\n this.doc.body.style.overflow = prevOverflow;\r\n });\r\n }\r\n });\r\n\r\n // پخش انیمیشن keyframeمحور فقط لحظهای که open() واقعاً عوض میشه (نه هر CD)\r\n effect(() => {\r\n const isOpen = this.open();\r\n if (isOpen !== this.prevOpen) {\r\n this.prevOpen = isOpen;\r\n this.playEffectClass.set(true);\r\n const id = setTimeout(() => this.playEffectClass.set(false), 700);\r\n // پاکسازی در صورتی که کامپوننت زودتر destroy بشه\r\n this.destroyRef.onDestroy(() => clearTimeout(id));\r\n }\r\n });\r\n\r\n this.destroyRef.onDestroy(() => this.stopDrag?.());\r\n\r\n // هماهنگیِ زنده با breakpoint\r\n if (typeof window !== 'undefined') {\r\n const mql = window.matchMedia(`(min-width: ${this.mobileBreakpoint()}px)`);\r\n const applyForCurrentViewport = (isDesktop: boolean) => {\r\n if (this.respondToViewport()) {\r\n this.open.set(isDesktop ? this.openOnDesktop() : this.openOnMobile());\r\n }\r\n };\r\n applyForCurrentViewport(mql.matches);\r\n const handler = (e: MediaQueryListEvent) => applyForCurrentViewport(e.matches);\r\n mql.addEventListener('change', handler);\r\n this.destroyRef.onDestroy(() => mql.removeEventListener('change', handler));\r\n }\r\n }\r\n\r\n @HostListener('document:keydown.escape')\r\n protected onEscape(): void {\r\n if (this.open()) this.open.set(false);\r\n }\r\n\r\n protected closeFromBackdrop(): void {\r\n if (this.backdropClose()) this.open.set(false);\r\n }\r\n\r\n toggle(): void {\r\n this.open.update((o) => !o);\r\n }\r\n\r\n /** true یعنی این پنل فیزیکاً روی لبهی چپِ صفحهست (صرفنظر از start/end منطقی) */\r\n private isPhysicalLeftEdge(): boolean {\r\n const isRtl = this.directionService.isRtl();\r\n return this.side() === 'start' ? !isRtl : isRtl;\r\n }\r\n\r\n protected stripDelay(index: number): string {\r\n const count = this.curtainStrips();\r\n const order = this.open() ? index : count - 1 - index;\r\n return `${order * 28}ms`;\r\n }\r\n\r\n // ---------- درگ (هم برای باز کردن از لبه، هم بستن با کشیدنِ پنل) ----------\r\n protected onEdgeDragStart(ev: MouseEvent | TouchEvent): void {\r\n if (!this.swipeEnabled() || this.open()) return;\r\n this.beginDrag(ev, 0);\r\n }\r\n\r\n protected onPanelDragStart(ev: MouseEvent | TouchEvent): void {\r\n if (!this.open()) return;\r\n this.beginDrag(ev, 1);\r\n }\r\n\r\n private beginDrag(ev: MouseEvent | TouchEvent, startRatio: number): void {\r\n ev.preventDefault();\r\n this.dragStartX = this.clientXOf(ev);\r\n this.dragStartRatio = startRatio;\r\n this.dragRatio.set(startRatio);\r\n this.stopDrag?.();\r\n this.stopDrag = startDragSession({\r\n onMove: (moveEv) => {\r\n const dx = this.clientXOf(moveEv) - this.dragStartX;\r\n const opensToward = this.isPhysicalLeftEdge() ? 1 : -1;\r\n const signedRatio = (dx * opensToward) / this.width();\r\n const ratio = Math.min(1, Math.max(0, this.dragStartRatio + signedRatio));\r\n this.dragRatio.set(ratio);\r\n },\r\n onEnd: () => {\r\n const ratio = this.dragRatio() ?? this.dragStartRatio;\r\n this.open.set(ratio > 0.4);\r\n this.dragRatio.set(null);\r\n this.stopDrag = undefined;\r\n },\r\n });\r\n }\r\n\r\n private clientXOf(ev: MouseEvent | TouchEvent): number {\r\n return 'touches' in ev\r\n ? (ev.touches[0]?.clientX ?? ev.changedTouches[0]?.clientX ?? 0)\r\n : ev.clientX;\r\n }\r\n}\r\n","<div\r\n class=\"ngx-drawer-root\"\r\n [class]=\"'behavior-' + contentBehavior()\"\r\n [style.perspective.px]=\"1200\">\r\n @if (swipeEnabled() && !open()) {\r\n <div\r\n class=\"ngx-drawer-edge-zone\"\r\n [class.edge-start]=\"side() === 'start'\"\r\n [class.edge-end]=\"side() === 'end'\"\r\n [style.--ngx-drawer-edge-size]=\"swipeEdgeSize() + 'px'\"\r\n (mousedown)=\"onEdgeDragStart($event)\"\r\n (touchstart)=\"onEdgeDragStart($event)\"></div>\r\n }\r\n\r\n @if (visualOpen() > 0 && contentBehavior() === 'overlay') {\r\n <div\r\n class=\"ngx-drawer-backdrop\"\r\n [style.opacity]=\"visualOpen()\"\r\n [class.no-transition]=\"isDragging()\"\r\n (click)=\"closeFromBackdrop()\"></div>\r\n }\r\n\r\n <div\r\n class=\"ngx-drawer-main\"\r\n [class.no-transition]=\"isDragging()\"\r\n [style.--ngx-drawer-width]=\"width() + 'px'\"\r\n [style.--ngx-drawer-open]=\"visualOpen()\"\r\n [style.--ngx-drawer-dir]=\"pushDirSign()\">\r\n <ng-content></ng-content>\r\n\r\n @if (visualOpen() > 0 && contentBehavior() !== 'overlay') {\r\n <div\r\n class=\"ngx-drawer-main-dim\"\r\n [style.opacity]=\"visualOpen() * 0.35\"\r\n (click)=\"closeFromBackdrop()\"></div>\r\n }\r\n </div>\r\n\r\n <aside\r\n class=\"ngx-drawer-panel\"\r\n [class]=\"'effect-' + effect()\"\r\n [class.side-start]=\"side() === 'start'\"\r\n [class.side-end]=\"side() === 'end'\"\r\n [class.no-transition]=\"isDragging()\"\r\n [class.is-open]=\"open()\"\r\n [class.playing]=\"playEffectClass()\"\r\n [style.--ngx-drawer-width]=\"width() + 'px'\"\r\n [style.--ngx-drawer-open]=\"visualOpen()\"\r\n role=\"dialog\"\r\n aria-modal=\"true\">\r\n <div\r\n class=\"ngx-drawer-drag-handle\"\r\n [class.edge-start]=\"side() === 'start'\"\r\n [class.edge-end]=\"side() === 'end'\"\r\n (mousedown)=\"onPanelDragStart($event)\"\r\n (touchstart)=\"onPanelDragStart($event)\"></div>\r\n\r\n <div class=\"ngx-drawer-content\">\r\n <ng-content select=\"[drawerContent]\"></ng-content>\r\n </div>\r\n\r\n @if (effect() === 'curtain') {\r\n <div\r\n class=\"ngx-drawer-curtain\"\r\n [class.open]=\"open()\"\r\n [class.revealed]=\"visualOpen() >= 1 && !isDragging()\">\r\n @for (i of strips(); track i) {\r\n <div\r\n class=\"ngx-drawer-strip\"\r\n [class.side-start]=\"side() === 'start'\"\r\n [class.side-end]=\"side() === 'end'\"\r\n [style.transition-delay]=\"stripDelay(i)\"></div>\r\n }\r\n </div>\r\n }\r\n </aside>\r\n</div>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAoBA;;;;;;;;;;;;;;;AAeG;MASU,sBAAsB,CAAA;IACjC,IAAI,GAAG,KAAK,CAAgB,OAAO;6EAAC;IACpC,MAAM,GAAG,KAAK,CAAkB,OAAO;+EAAC;IACxC,eAAe,GAAG,KAAK,CAA2B,SAAS;wFAAC;IAC5D,KAAK,GAAG,KAAK,CAAS,GAAG;8EAAC;IAC1B,aAAa,GAAG,KAAK,CAAS,EAAE;sFAAC;IACjC,aAAa,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ent {
|
|
|
500
500
|
this.filesChange.emit(this.files().map((f) => f.file));
|
|
501
501
|
}
|
|
502
502
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NgxDropzoneComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
503
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: NgxDropzoneComponent, isStandalone: true, selector: "ngx-dropzone", inputs: { accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, maxFiles: { classPropertyName: "maxFiles", publicName: "maxFiles", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, showFileList: { classPropertyName: "showFileList", publicName: "showFileList", isSignal: true, isRequired: false, transformFunction: null }, uploadUrl: { classPropertyName: "uploadUrl", publicName: "uploadUrl", isSignal: true, isRequired: false, transformFunction: null }, uploadAlias: { classPropertyName: "uploadAlias", publicName: "uploadAlias", isSignal: true, isRequired: false, transformFunction: null }, autoUpload: { classPropertyName: "autoUpload", publicName: "autoUpload", isSignal: true, isRequired: false, transformFunction: null }, maxParallel: { classPropertyName: "maxParallel", publicName: "maxParallel", isSignal: true, isRequired: false, transformFunction: null }, uploadMode: { classPropertyName: "uploadMode", publicName: "uploadMode", isSignal: true, isRequired: false, transformFunction: null }, uploadData: { classPropertyName: "uploadData", publicName: "uploadData", isSignal: true, isRequired: false, transformFunction: null }, uploadHeaders: { classPropertyName: "uploadHeaders", publicName: "uploadHeaders", isSignal: true, isRequired: false, transformFunction: null }, uploadWithCredentials: { classPropertyName: "uploadWithCredentials", publicName: "uploadWithCredentials", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filesAdded: "filesAdded", filesRejected: "filesRejected", filesChange: "filesChange", uploadStarted: "uploadStarted", uploadProgress: "uploadProgress", uploadSuccess: "uploadSuccess", uploadError: "uploadError" }, host: { classAttribute: "ngx-dropzone-host" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"ngx-dropzone\"\n [class.dragging]=\"isDragging()\"\n [class.disabled]=\"disabled()\"\n [class.has-files]=\"files().length > 0\"\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-disabled]=\"disabled()\"\n (click)=\"onBrowseClick()\"\n (keydown)=\"onKeydown($event)\"\n (dragenter)=\"onDragEnter($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\"\n (drop)=\"onDrop($event)\">\n <input\n #fileInput\n type=\"file\"\n class=\"ngx-dropzone-input\"\n [accept]=\"accept()\"\n [multiple]=\"multiple()\"\n [disabled]=\"disabled()\"\n (click)=\"$event.stopPropagation()\"\n (change)=\"onFileInputChange($event)\" />\n\n <div class=\"ngx-dropzone-icon-wrap\">\n <ng-content select=\"[dropzone-icon]\">\n <svg class=\"ngx-dropzone-icon\" viewBox=\"0 0 24 24\" fill=\"none\" width=\"30\" height=\"30\">\n <path\n d=\"M12 16V4M12 4l-4 4M12 4l4 4M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2\"\n stroke=\"currentColor\"\n stroke-width=\"1.8\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\" />\n </svg>\n </ng-content>\n </div>\n\n <div class=\"ngx-dropzone-text\">\n <ng-content>\n <strong>Drop files here</strong>\n <span>or click to browse</span>\n </ng-content>\n </div>\n\n @if (hint()) {\n <div class=\"ngx-dropzone-hint\">{{ hint() }}</div>\n }\n</div>\n\n@if (!autoUpload() && uploadMode() === 'all' && pendingCount() > 0) {\n <div class=\"ngx-dropzone-actions\">\n <button\n type=\"button\"\n class=\"ngx-dropzone-upload-all\"\n [disabled]=\"disabled() || !hasUploadConfiguration()\"\n (click)=\"uploadAll(); $event.stopPropagation()\">\n Upload all\n <span>{{ pendingCount() }}</span>\n </button>\n </div>\n}\n\n@if (showFileList() && files().length) {\n <ul class=\"ngx-dropzone-list\">\n @for (item of files(); track item.id) {\n <li class=\"ngx-dropzone-item\" [class.is-uploading]=\"item.status === 'uploading'\">\n <div class=\"ngx-dropzone-thumb-wrap\">\n @if (item.previewUrl) {\n <img class=\"ngx-dropzone-thumb\" [src]=\"item.previewUrl\" [alt]=\"item.file.name\" />\n } @else {\n <span class=\"ngx-dropzone-file-icon\">\uD83D\uDCC4</span>\n }\n </div>\n\n <div class=\"ngx-dropzone-meta\">\n <span class=\"ngx-dropzone-name\" [title]=\"item.file.name\">{{ item.file.name }}</span>\n <span class=\"ngx-dropzone-size\">{{ formatSize(item.file.size) }}</span>\n\n @if (item.status === 'uploading' || item.status === 'uploaded') {\n <div\n class=\"ngx-dropzone-progress\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"item.progress\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-label]=\"'Upload progress for ' + item.file.name\">\n <span class=\"ngx-dropzone-progress-bar\" [style.width.%]=\"item.progress\"></span>\n </div>\n <span class=\"ngx-dropzone-progress-text\">{{ item.progress }}%</span>\n }\n\n @if (item.status === 'error') {\n <span class=\"ngx-dropzone-error\">Upload failed</span>\n }\n </div>\n\n <div class=\"ngx-dropzone-row-actions\">\n @if (!autoUpload() && uploadMode() === 'single' && isPending(item)) {\n <button\n type=\"button\"\n class=\"ngx-dropzone-upload\"\n [disabled]=\"disabled() || !hasUploadConfiguration()\"\n [attr.aria-label]=\"'Upload ' + item.file.name\"\n (click)=\"uploadSingle(item.id); $event.stopPropagation()\">\n Upload\n </button>\n }\n\n @if (item.status === 'error') {\n <button\n type=\"button\"\n class=\"ngx-dropzone-retry\"\n [disabled]=\"disabled() || !hasUploadConfiguration()\"\n [attr.aria-label]=\"'Retry upload for ' + item.file.name\"\n (click)=\"retryUpload(item.id); $event.stopPropagation()\">\n Retry\n </button>\n }\n\n @if (item.status === 'uploaded') {\n <span class=\"ngx-dropzone-status success\" aria-label=\"Uploaded\">\u2713</span>\n } @else if (item.status === 'uploading') {\n <span class=\"ngx-dropzone-status uploading\" aria-label=\"Uploading\"></span>\n } @else if (item.status === 'error') {\n <span class=\"ngx-dropzone-status error\" aria-label=\"Upload failed\">!</span>\n } @else {\n <span class=\"ngx-dropzone-status pending\" aria-label=\"Pending\">\u2022</span>\n }\n\n <button\n type=\"button\"\n class=\"ngx-dropzone-remove\"\n [attr.aria-label]=\"'Remove ' + item.file.name\"\n (click)=\"removeFile(item.id); $event.stopPropagation()\">\n \u2715\n </button>\n </div>\n </li>\n }\n </ul>\n}\n", styles: ["@charset \"UTF-8\";:host{display:block}.ngx-dropzone{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.65rem;padding:2.25rem 1.5rem;border-radius:16px;cursor:pointer;text-align:center;overflow:hidden;background:light-dark(#fafbfc,#1a1a1e);border:2px dashed light-dark(#d6dae1,#35353c);transition:border-color .2s ease,background-color .2s ease,transform .2s cubic-bezier(.34,1.56,.64,1),box-shadow .2s ease}.ngx-dropzone:before{content:\"\";position:absolute;inset:0;background:radial-gradient(circle at 50% 0%,light-dark(rgba(37,99,235,.06),rgba(59,130,246,.1)),transparent 65%);opacity:0;transition:opacity .2s ease;pointer-events:none}.ngx-dropzone:hover:not(.disabled){border-color:light-dark(#93c5fd,#3b82f6);box-shadow:0 4px 18px light-dark(rgba(37,99,235,.08),rgba(0,0,0,.35))}.ngx-dropzone:hover:not(.disabled):before{opacity:1}.ngx-dropzone:focus-visible{outline:2px solid light-dark(#2563eb,#60a5fa);outline-offset:3px}.ngx-dropzone.dragging{border-color:light-dark(#2563eb,#60a5fa);border-style:solid;background:light-dark(#eff6ff,#16213a);transform:scale(1.015);box-shadow:0 8px 28px light-dark(rgba(37,99,235,.18),rgba(59,130,246,.25))}.ngx-dropzone.dragging:before{opacity:1}.ngx-dropzone.dragging .ngx-dropzone-icon-wrap{transform:translateY(-4px) scale(1.08)}.ngx-dropzone.disabled{cursor:not-allowed;opacity:.55}.ngx-dropzone.has-files{padding-block:1.5rem}.ngx-dropzone-input{position:absolute;inset-inline-start:-9999px;width:1px;height:1px;opacity:0}.ngx-dropzone-icon-wrap{display:flex;align-items:center;justify-content:center;inline-size:56px;block-size:56px;border-radius:50%;background:light-dark(#eef2ff,#232433);color:light-dark(#4f46e5,#818cf8);transition:transform .22s cubic-bezier(.34,1.56,.64,1);z-index:1}.ngx-dropzone-text{z-index:1;display:flex;flex-direction:column;gap:.15rem}.ngx-dropzone-text strong{font-size:.92rem;font-weight:600;color:light-dark(#1f2937,#e4e4e7)}.ngx-dropzone-text span{font-size:.8rem;color:light-dark(#9ca3af,#71717a)}.ngx-dropzone-hint{z-index:1;font-size:.72rem;color:light-dark(#9ca3af,#6b7280);background:light-dark(#f3f4f6,#232327);padding:.15rem .6rem;border-radius:999px}.ngx-dropzone-list{list-style:none;margin:.85rem 0 0;padding:0;display:flex;flex-direction:column;gap:.45rem}.ngx-dropzone-item{display:flex;align-items:center;gap:.7rem;padding:.5rem .6rem;border-radius:10px;background:light-dark(#ffffff,#1f1f24);border:1px solid light-dark(#eef0f3,#2d2d33);transition:transform .16s ease,box-shadow .16s ease;animation:ngx-dropzone-item-in .22s cubic-bezier(.22,.9,.32,1) both}.ngx-dropzone-item:hover{box-shadow:0 2px 10px light-dark(rgba(0,0,0,.06),rgba(0,0,0,.4))}@keyframes ngx-dropzone-item-in{0%{opacity:0;transform:translateY(-6px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.ngx-dropzone-thumb-wrap{flex-shrink:0;inline-size:38px;block-size:38px;border-radius:8px;overflow:hidden;background:light-dark(#f4f4f5,#29292f);display:flex;align-items:center;justify-content:center}.ngx-dropzone-thumb{inline-size:100%;block-size:100%;object-fit:cover}.ngx-dropzone-file-icon{font-size:1.1rem}.ngx-dropzone-meta{flex:1;min-inline-size:0;display:flex;flex-direction:column;gap:.1rem}.ngx-dropzone-name{font-size:.8rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:light-dark(#1f2937,#e4e4e7)}.ngx-dropzone-size{font-size:.7rem;color:light-dark(#9ca3af,#71717a)}.ngx-dropzone-status{flex-shrink:0;inline-size:20px;block-size:20px;border-radius:50%;background:light-dark(#dcfce7,#14532d);color:light-dark(#16a34a,#4ade80);font-size:.7rem;display:flex;align-items:center;justify-content:center}.ngx-dropzone-remove{flex-shrink:0;appearance:none;border:none;background:transparent;cursor:pointer;color:light-dark(#9ca3af,#71717a);font-size:.8rem;line-height:1;padding:.3rem;border-radius:6px;transition:background-color .14s ease,color .14s ease}.ngx-dropzone-remove:hover{color:light-dark(#dc2626,#f87171);background:light-dark(#fee2e2,#3f1d1d)}.ngx-dropzone-actions{display:flex;justify-content:flex-end;margin-top:.7rem}.ngx-dropzone-upload-all,.ngx-dropzone-upload,.ngx-dropzone-retry{appearance:none;border:1px solid light-dark(#dbe3f0,#3b3b45);border-radius:7px;background:light-dark(#2563eb,#3b82f6);color:#fff;cursor:pointer;font:inherit;font-size:.75rem;font-weight:600;padding:.35rem .65rem;transition:opacity .14s ease,transform .14s ease}.ngx-dropzone-upload:hover:not(:disabled),.ngx-dropzone-upload-all:hover:not(:disabled),.ngx-dropzone-retry:hover:not(:disabled){transform:translateY(-1px)}.ngx-dropzone-upload-all:disabled,.ngx-dropzone-upload:disabled,.ngx-dropzone-retry:disabled{cursor:not-allowed;opacity:.5}.ngx-dropzone-upload-all{display:inline-flex;align-items:center;gap:.45rem}.ngx-dropzone-upload-all span{min-inline-size:1.15rem;block-size:1.15rem;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:#ffffff2e}.ngx-dropzone-retry{background:transparent;color:light-dark(#dc2626,#f87171)}.ngx-dropzone-row-actions{flex-shrink:0;display:flex;align-items:center;gap:.35rem}.ngx-dropzone-item.is-uploading .ngx-dropzone-status.uploading{animation:ngx-dropzone-upload-pulse 1.1s ease-in-out infinite}.ngx-dropzone-status.pending{background:light-dark(#f4f4f5,#29292f);color:light-dark(#a1a1aa,#71717a)}.ngx-dropzone-status.uploading{background:light-dark(#dbeafe,#172554);border:3px solid light-dark(#93c5fd,#3b82f6)}.ngx-dropzone-status.error{background:light-dark(#fee2e2,#450a0a);color:light-dark(#dc2626,#f87171);font-weight:700}.ngx-dropzone-status.success{background:light-dark(#dcfce7,#14532d);color:light-dark(#16a34a,#4ade80)}.ngx-dropzone-progress{position:relative;inline-size:100%;block-size:4px;margin-top:.35rem;overflow:hidden;border-radius:999px;background:light-dark(#e5e7eb,#303038)}.ngx-dropzone-progress-bar{display:block;block-size:100%;border-radius:inherit;background:light-dark(#2563eb,#60a5fa);transition:width .12s linear}.ngx-dropzone-progress-text{font-size:.65rem;color:light-dark(#6b7280,#a1a1aa)}.ngx-dropzone-error{font-size:.65rem;color:light-dark(#dc2626,#f87171)}@keyframes ngx-dropzone-upload-pulse{50%{opacity:.45}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
503
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: NgxDropzoneComponent, isStandalone: true, selector: "ngx-dropzone", inputs: { accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, maxFiles: { classPropertyName: "maxFiles", publicName: "maxFiles", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, showFileList: { classPropertyName: "showFileList", publicName: "showFileList", isSignal: true, isRequired: false, transformFunction: null }, uploadUrl: { classPropertyName: "uploadUrl", publicName: "uploadUrl", isSignal: true, isRequired: false, transformFunction: null }, uploadAlias: { classPropertyName: "uploadAlias", publicName: "uploadAlias", isSignal: true, isRequired: false, transformFunction: null }, autoUpload: { classPropertyName: "autoUpload", publicName: "autoUpload", isSignal: true, isRequired: false, transformFunction: null }, maxParallel: { classPropertyName: "maxParallel", publicName: "maxParallel", isSignal: true, isRequired: false, transformFunction: null }, uploadMode: { classPropertyName: "uploadMode", publicName: "uploadMode", isSignal: true, isRequired: false, transformFunction: null }, uploadData: { classPropertyName: "uploadData", publicName: "uploadData", isSignal: true, isRequired: false, transformFunction: null }, uploadHeaders: { classPropertyName: "uploadHeaders", publicName: "uploadHeaders", isSignal: true, isRequired: false, transformFunction: null }, uploadWithCredentials: { classPropertyName: "uploadWithCredentials", publicName: "uploadWithCredentials", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filesAdded: "filesAdded", filesRejected: "filesRejected", filesChange: "filesChange", uploadStarted: "uploadStarted", uploadProgress: "uploadProgress", uploadSuccess: "uploadSuccess", uploadError: "uploadError" }, host: { classAttribute: "ngx-dropzone-host" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\r\n class=\"ngx-dropzone\"\r\n [class.dragging]=\"isDragging()\"\r\n [class.disabled]=\"disabled()\"\r\n [class.has-files]=\"files().length > 0\"\r\n tabindex=\"0\"\r\n role=\"button\"\r\n [attr.aria-disabled]=\"disabled()\"\r\n (click)=\"onBrowseClick()\"\r\n (keydown)=\"onKeydown($event)\"\r\n (dragenter)=\"onDragEnter($event)\"\r\n (dragover)=\"onDragOver($event)\"\r\n (dragleave)=\"onDragLeave($event)\"\r\n (drop)=\"onDrop($event)\">\r\n <input\r\n #fileInput\r\n type=\"file\"\r\n class=\"ngx-dropzone-input\"\r\n [accept]=\"accept()\"\r\n [multiple]=\"multiple()\"\r\n [disabled]=\"disabled()\"\r\n (click)=\"$event.stopPropagation()\"\r\n (change)=\"onFileInputChange($event)\" />\r\n\r\n <div class=\"ngx-dropzone-icon-wrap\">\r\n <ng-content select=\"[dropzone-icon]\">\r\n <svg class=\"ngx-dropzone-icon\" viewBox=\"0 0 24 24\" fill=\"none\" width=\"30\" height=\"30\">\r\n <path\r\n d=\"M12 16V4M12 4l-4 4M12 4l4 4M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"1.8\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\" />\r\n </svg>\r\n </ng-content>\r\n </div>\r\n\r\n <div class=\"ngx-dropzone-text\">\r\n <ng-content>\r\n <strong>Drop files here</strong>\r\n <span>or click to browse</span>\r\n </ng-content>\r\n </div>\r\n\r\n @if (hint()) {\r\n <div class=\"ngx-dropzone-hint\">{{ hint() }}</div>\r\n }\r\n</div>\r\n\r\n@if (!autoUpload() && uploadMode() === 'all' && pendingCount() > 0) {\r\n <div class=\"ngx-dropzone-actions\">\r\n <button\r\n type=\"button\"\r\n class=\"ngx-dropzone-upload-all\"\r\n [disabled]=\"disabled() || !hasUploadConfiguration()\"\r\n (click)=\"uploadAll(); $event.stopPropagation()\">\r\n Upload all\r\n <span>{{ pendingCount() }}</span>\r\n </button>\r\n </div>\r\n}\r\n\r\n@if (showFileList() && files().length) {\r\n <ul class=\"ngx-dropzone-list\">\r\n @for (item of files(); track item.id) {\r\n <li class=\"ngx-dropzone-item\" [class.is-uploading]=\"item.status === 'uploading'\">\r\n <div class=\"ngx-dropzone-thumb-wrap\">\r\n @if (item.previewUrl) {\r\n <img class=\"ngx-dropzone-thumb\" [src]=\"item.previewUrl\" [alt]=\"item.file.name\" />\r\n } @else {\r\n <span class=\"ngx-dropzone-file-icon\">\uD83D\uDCC4</span>\r\n }\r\n </div>\r\n\r\n <div class=\"ngx-dropzone-meta\">\r\n <span class=\"ngx-dropzone-name\" [title]=\"item.file.name\">{{ item.file.name }}</span>\r\n <span class=\"ngx-dropzone-size\">{{ formatSize(item.file.size) }}</span>\r\n\r\n @if (item.status === 'uploading' || item.status === 'uploaded') {\r\n <div\r\n class=\"ngx-dropzone-progress\"\r\n role=\"progressbar\"\r\n [attr.aria-valuenow]=\"item.progress\"\r\n aria-valuemin=\"0\"\r\n aria-valuemax=\"100\"\r\n [attr.aria-label]=\"'Upload progress for ' + item.file.name\">\r\n <span class=\"ngx-dropzone-progress-bar\" [style.width.%]=\"item.progress\"></span>\r\n </div>\r\n <span class=\"ngx-dropzone-progress-text\">{{ item.progress }}%</span>\r\n }\r\n\r\n @if (item.status === 'error') {\r\n <span class=\"ngx-dropzone-error\">Upload failed</span>\r\n }\r\n </div>\r\n\r\n <div class=\"ngx-dropzone-row-actions\">\r\n @if (!autoUpload() && uploadMode() === 'single' && isPending(item)) {\r\n <button\r\n type=\"button\"\r\n class=\"ngx-dropzone-upload\"\r\n [disabled]=\"disabled() || !hasUploadConfiguration()\"\r\n [attr.aria-label]=\"'Upload ' + item.file.name\"\r\n (click)=\"uploadSingle(item.id); $event.stopPropagation()\">\r\n Upload\r\n </button>\r\n }\r\n\r\n @if (item.status === 'error') {\r\n <button\r\n type=\"button\"\r\n class=\"ngx-dropzone-retry\"\r\n [disabled]=\"disabled() || !hasUploadConfiguration()\"\r\n [attr.aria-label]=\"'Retry upload for ' + item.file.name\"\r\n (click)=\"retryUpload(item.id); $event.stopPropagation()\">\r\n Retry\r\n </button>\r\n }\r\n\r\n @if (item.status === 'uploaded') {\r\n <span class=\"ngx-dropzone-status success\" aria-label=\"Uploaded\">\u2713</span>\r\n } @else if (item.status === 'uploading') {\r\n <span class=\"ngx-dropzone-status uploading\" aria-label=\"Uploading\"></span>\r\n } @else if (item.status === 'error') {\r\n <span class=\"ngx-dropzone-status error\" aria-label=\"Upload failed\">!</span>\r\n } @else {\r\n <span class=\"ngx-dropzone-status pending\" aria-label=\"Pending\">\u2022</span>\r\n }\r\n\r\n <button\r\n type=\"button\"\r\n class=\"ngx-dropzone-remove\"\r\n [attr.aria-label]=\"'Remove ' + item.file.name\"\r\n (click)=\"removeFile(item.id); $event.stopPropagation()\">\r\n \u2715\r\n </button>\r\n </div>\r\n </li>\r\n }\r\n </ul>\r\n}\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.ngx-dropzone{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.65rem;padding:2.25rem 1.5rem;border-radius:16px;cursor:pointer;text-align:center;overflow:hidden;background:light-dark(#fafbfc,#1a1a1e);border:2px dashed light-dark(#d6dae1,#35353c);transition:border-color .2s ease,background-color .2s ease,transform .2s cubic-bezier(.34,1.56,.64,1),box-shadow .2s ease}.ngx-dropzone:before{content:\"\";position:absolute;inset:0;background:radial-gradient(circle at 50% 0%,light-dark(rgba(37,99,235,.06),rgba(59,130,246,.1)),transparent 65%);opacity:0;transition:opacity .2s ease;pointer-events:none}.ngx-dropzone:hover:not(.disabled){border-color:light-dark(#93c5fd,#3b82f6);box-shadow:0 4px 18px light-dark(rgba(37,99,235,.08),rgba(0,0,0,.35))}.ngx-dropzone:hover:not(.disabled):before{opacity:1}.ngx-dropzone:focus-visible{outline:2px solid light-dark(#2563eb,#60a5fa);outline-offset:3px}.ngx-dropzone.dragging{border-color:light-dark(#2563eb,#60a5fa);border-style:solid;background:light-dark(#eff6ff,#16213a);transform:scale(1.015);box-shadow:0 8px 28px light-dark(rgba(37,99,235,.18),rgba(59,130,246,.25))}.ngx-dropzone.dragging:before{opacity:1}.ngx-dropzone.dragging .ngx-dropzone-icon-wrap{transform:translateY(-4px) scale(1.08)}.ngx-dropzone.disabled{cursor:not-allowed;opacity:.55}.ngx-dropzone.has-files{padding-block:1.5rem}.ngx-dropzone-input{position:absolute;inset-inline-start:-9999px;width:1px;height:1px;opacity:0}.ngx-dropzone-icon-wrap{display:flex;align-items:center;justify-content:center;inline-size:56px;block-size:56px;border-radius:50%;background:light-dark(#eef2ff,#232433);color:light-dark(#4f46e5,#818cf8);transition:transform .22s cubic-bezier(.34,1.56,.64,1);z-index:1}.ngx-dropzone-text{z-index:1;display:flex;flex-direction:column;gap:.15rem}.ngx-dropzone-text strong{font-size:.92rem;font-weight:600;color:light-dark(#1f2937,#e4e4e7)}.ngx-dropzone-text span{font-size:.8rem;color:light-dark(#9ca3af,#71717a)}.ngx-dropzone-hint{z-index:1;font-size:.72rem;color:light-dark(#9ca3af,#6b7280);background:light-dark(#f3f4f6,#232327);padding:.15rem .6rem;border-radius:999px}.ngx-dropzone-list{list-style:none;margin:.85rem 0 0;padding:0;display:flex;flex-direction:column;gap:.45rem}.ngx-dropzone-item{display:flex;align-items:center;gap:.7rem;padding:.5rem .6rem;border-radius:10px;background:light-dark(#ffffff,#1f1f24);border:1px solid light-dark(#eef0f3,#2d2d33);transition:transform .16s ease,box-shadow .16s ease;animation:ngx-dropzone-item-in .22s cubic-bezier(.22,.9,.32,1) both}.ngx-dropzone-item:hover{box-shadow:0 2px 10px light-dark(rgba(0,0,0,.06),rgba(0,0,0,.4))}@keyframes ngx-dropzone-item-in{0%{opacity:0;transform:translateY(-6px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.ngx-dropzone-thumb-wrap{flex-shrink:0;inline-size:38px;block-size:38px;border-radius:8px;overflow:hidden;background:light-dark(#f4f4f5,#29292f);display:flex;align-items:center;justify-content:center}.ngx-dropzone-thumb{inline-size:100%;block-size:100%;object-fit:cover}.ngx-dropzone-file-icon{font-size:1.1rem}.ngx-dropzone-meta{flex:1;min-inline-size:0;display:flex;flex-direction:column;gap:.1rem}.ngx-dropzone-name{font-size:.8rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:light-dark(#1f2937,#e4e4e7)}.ngx-dropzone-size{font-size:.7rem;color:light-dark(#9ca3af,#71717a)}.ngx-dropzone-status{flex-shrink:0;inline-size:20px;block-size:20px;border-radius:50%;background:light-dark(#dcfce7,#14532d);color:light-dark(#16a34a,#4ade80);font-size:.7rem;display:flex;align-items:center;justify-content:center}.ngx-dropzone-remove{flex-shrink:0;appearance:none;border:none;background:transparent;cursor:pointer;color:light-dark(#9ca3af,#71717a);font-size:.8rem;line-height:1;padding:.3rem;border-radius:6px;transition:background-color .14s ease,color .14s ease}.ngx-dropzone-remove:hover{color:light-dark(#dc2626,#f87171);background:light-dark(#fee2e2,#3f1d1d)}.ngx-dropzone-actions{display:flex;justify-content:flex-end;margin-top:.7rem}.ngx-dropzone-upload-all,.ngx-dropzone-upload,.ngx-dropzone-retry{appearance:none;border:1px solid light-dark(#dbe3f0,#3b3b45);border-radius:7px;background:light-dark(#2563eb,#3b82f6);color:#fff;cursor:pointer;font:inherit;font-size:.75rem;font-weight:600;padding:.35rem .65rem;transition:opacity .14s ease,transform .14s ease}.ngx-dropzone-upload:hover:not(:disabled),.ngx-dropzone-upload-all:hover:not(:disabled),.ngx-dropzone-retry:hover:not(:disabled){transform:translateY(-1px)}.ngx-dropzone-upload-all:disabled,.ngx-dropzone-upload:disabled,.ngx-dropzone-retry:disabled{cursor:not-allowed;opacity:.5}.ngx-dropzone-upload-all{display:inline-flex;align-items:center;gap:.45rem}.ngx-dropzone-upload-all span{min-inline-size:1.15rem;block-size:1.15rem;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:#ffffff2e}.ngx-dropzone-retry{background:transparent;color:light-dark(#dc2626,#f87171)}.ngx-dropzone-row-actions{flex-shrink:0;display:flex;align-items:center;gap:.35rem}.ngx-dropzone-item.is-uploading .ngx-dropzone-status.uploading{animation:ngx-dropzone-upload-pulse 1.1s ease-in-out infinite}.ngx-dropzone-status.pending{background:light-dark(#f4f4f5,#29292f);color:light-dark(#a1a1aa,#71717a)}.ngx-dropzone-status.uploading{background:light-dark(#dbeafe,#172554);border:3px solid light-dark(#93c5fd,#3b82f6)}.ngx-dropzone-status.error{background:light-dark(#fee2e2,#450a0a);color:light-dark(#dc2626,#f87171);font-weight:700}.ngx-dropzone-status.success{background:light-dark(#dcfce7,#14532d);color:light-dark(#16a34a,#4ade80)}.ngx-dropzone-progress{position:relative;inline-size:100%;block-size:4px;margin-top:.35rem;overflow:hidden;border-radius:999px;background:light-dark(#e5e7eb,#303038)}.ngx-dropzone-progress-bar{display:block;block-size:100%;border-radius:inherit;background:light-dark(#2563eb,#60a5fa);transition:width .12s linear}.ngx-dropzone-progress-text{font-size:.65rem;color:light-dark(#6b7280,#a1a1aa)}.ngx-dropzone-error{font-size:.65rem;color:light-dark(#dc2626,#f87171)}@keyframes ngx-dropzone-upload-pulse{50%{opacity:.45}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
504
504
|
}
|
|
505
505
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NgxDropzoneComponent, decorators: [{
|
|
506
506
|
type: Component,
|
|
507
507
|
args: [{ selector: 'ngx-dropzone', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
508
508
|
class: 'ngx-dropzone-host',
|
|
509
|
-
}, template: "<div\n class=\"ngx-dropzone\"\n [class.dragging]=\"isDragging()\"\n [class.disabled]=\"disabled()\"\n [class.has-files]=\"files().length > 0\"\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-disabled]=\"disabled()\"\n (click)=\"onBrowseClick()\"\n (keydown)=\"onKeydown($event)\"\n (dragenter)=\"onDragEnter($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\"\n (drop)=\"onDrop($event)\">\n <input\n #fileInput\n type=\"file\"\n class=\"ngx-dropzone-input\"\n [accept]=\"accept()\"\n [multiple]=\"multiple()\"\n [disabled]=\"disabled()\"\n (click)=\"$event.stopPropagation()\"\n (change)=\"onFileInputChange($event)\" />\n\n <div class=\"ngx-dropzone-icon-wrap\">\n <ng-content select=\"[dropzone-icon]\">\n <svg class=\"ngx-dropzone-icon\" viewBox=\"0 0 24 24\" fill=\"none\" width=\"30\" height=\"30\">\n <path\n d=\"M12 16V4M12 4l-4 4M12 4l4 4M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2\"\n stroke=\"currentColor\"\n stroke-width=\"1.8\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\" />\n </svg>\n </ng-content>\n </div>\n\n <div class=\"ngx-dropzone-text\">\n <ng-content>\n <strong>Drop files here</strong>\n <span>or click to browse</span>\n </ng-content>\n </div>\n\n @if (hint()) {\n <div class=\"ngx-dropzone-hint\">{{ hint() }}</div>\n }\n</div>\n\n@if (!autoUpload() && uploadMode() === 'all' && pendingCount() > 0) {\n <div class=\"ngx-dropzone-actions\">\n <button\n type=\"button\"\n class=\"ngx-dropzone-upload-all\"\n [disabled]=\"disabled() || !hasUploadConfiguration()\"\n (click)=\"uploadAll(); $event.stopPropagation()\">\n Upload all\n <span>{{ pendingCount() }}</span>\n </button>\n </div>\n}\n\n@if (showFileList() && files().length) {\n <ul class=\"ngx-dropzone-list\">\n @for (item of files(); track item.id) {\n <li class=\"ngx-dropzone-item\" [class.is-uploading]=\"item.status === 'uploading'\">\n <div class=\"ngx-dropzone-thumb-wrap\">\n @if (item.previewUrl) {\n <img class=\"ngx-dropzone-thumb\" [src]=\"item.previewUrl\" [alt]=\"item.file.name\" />\n } @else {\n <span class=\"ngx-dropzone-file-icon\">\uD83D\uDCC4</span>\n }\n </div>\n\n <div class=\"ngx-dropzone-meta\">\n <span class=\"ngx-dropzone-name\" [title]=\"item.file.name\">{{ item.file.name }}</span>\n <span class=\"ngx-dropzone-size\">{{ formatSize(item.file.size) }}</span>\n\n @if (item.status === 'uploading' || item.status === 'uploaded') {\n <div\n class=\"ngx-dropzone-progress\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"item.progress\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-label]=\"'Upload progress for ' + item.file.name\">\n <span class=\"ngx-dropzone-progress-bar\" [style.width.%]=\"item.progress\"></span>\n </div>\n <span class=\"ngx-dropzone-progress-text\">{{ item.progress }}%</span>\n }\n\n @if (item.status === 'error') {\n <span class=\"ngx-dropzone-error\">Upload failed</span>\n }\n </div>\n\n <div class=\"ngx-dropzone-row-actions\">\n @if (!autoUpload() && uploadMode() === 'single' && isPending(item)) {\n <button\n type=\"button\"\n class=\"ngx-dropzone-upload\"\n [disabled]=\"disabled() || !hasUploadConfiguration()\"\n [attr.aria-label]=\"'Upload ' + item.file.name\"\n (click)=\"uploadSingle(item.id); $event.stopPropagation()\">\n Upload\n </button>\n }\n\n @if (item.status === 'error') {\n <button\n type=\"button\"\n class=\"ngx-dropzone-retry\"\n [disabled]=\"disabled() || !hasUploadConfiguration()\"\n [attr.aria-label]=\"'Retry upload for ' + item.file.name\"\n (click)=\"retryUpload(item.id); $event.stopPropagation()\">\n Retry\n </button>\n }\n\n @if (item.status === 'uploaded') {\n <span class=\"ngx-dropzone-status success\" aria-label=\"Uploaded\">\u2713</span>\n } @else if (item.status === 'uploading') {\n <span class=\"ngx-dropzone-status uploading\" aria-label=\"Uploading\"></span>\n } @else if (item.status === 'error') {\n <span class=\"ngx-dropzone-status error\" aria-label=\"Upload failed\">!</span>\n } @else {\n <span class=\"ngx-dropzone-status pending\" aria-label=\"Pending\">\u2022</span>\n }\n\n <button\n type=\"button\"\n class=\"ngx-dropzone-remove\"\n [attr.aria-label]=\"'Remove ' + item.file.name\"\n (click)=\"removeFile(item.id); $event.stopPropagation()\">\n \u2715\n </button>\n </div>\n </li>\n }\n </ul>\n}\n", styles: ["@charset \"UTF-8\";:host{display:block}.ngx-dropzone{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.65rem;padding:2.25rem 1.5rem;border-radius:16px;cursor:pointer;text-align:center;overflow:hidden;background:light-dark(#fafbfc,#1a1a1e);border:2px dashed light-dark(#d6dae1,#35353c);transition:border-color .2s ease,background-color .2s ease,transform .2s cubic-bezier(.34,1.56,.64,1),box-shadow .2s ease}.ngx-dropzone:before{content:\"\";position:absolute;inset:0;background:radial-gradient(circle at 50% 0%,light-dark(rgba(37,99,235,.06),rgba(59,130,246,.1)),transparent 65%);opacity:0;transition:opacity .2s ease;pointer-events:none}.ngx-dropzone:hover:not(.disabled){border-color:light-dark(#93c5fd,#3b82f6);box-shadow:0 4px 18px light-dark(rgba(37,99,235,.08),rgba(0,0,0,.35))}.ngx-dropzone:hover:not(.disabled):before{opacity:1}.ngx-dropzone:focus-visible{outline:2px solid light-dark(#2563eb,#60a5fa);outline-offset:3px}.ngx-dropzone.dragging{border-color:light-dark(#2563eb,#60a5fa);border-style:solid;background:light-dark(#eff6ff,#16213a);transform:scale(1.015);box-shadow:0 8px 28px light-dark(rgba(37,99,235,.18),rgba(59,130,246,.25))}.ngx-dropzone.dragging:before{opacity:1}.ngx-dropzone.dragging .ngx-dropzone-icon-wrap{transform:translateY(-4px) scale(1.08)}.ngx-dropzone.disabled{cursor:not-allowed;opacity:.55}.ngx-dropzone.has-files{padding-block:1.5rem}.ngx-dropzone-input{position:absolute;inset-inline-start:-9999px;width:1px;height:1px;opacity:0}.ngx-dropzone-icon-wrap{display:flex;align-items:center;justify-content:center;inline-size:56px;block-size:56px;border-radius:50%;background:light-dark(#eef2ff,#232433);color:light-dark(#4f46e5,#818cf8);transition:transform .22s cubic-bezier(.34,1.56,.64,1);z-index:1}.ngx-dropzone-text{z-index:1;display:flex;flex-direction:column;gap:.15rem}.ngx-dropzone-text strong{font-size:.92rem;font-weight:600;color:light-dark(#1f2937,#e4e4e7)}.ngx-dropzone-text span{font-size:.8rem;color:light-dark(#9ca3af,#71717a)}.ngx-dropzone-hint{z-index:1;font-size:.72rem;color:light-dark(#9ca3af,#6b7280);background:light-dark(#f3f4f6,#232327);padding:.15rem .6rem;border-radius:999px}.ngx-dropzone-list{list-style:none;margin:.85rem 0 0;padding:0;display:flex;flex-direction:column;gap:.45rem}.ngx-dropzone-item{display:flex;align-items:center;gap:.7rem;padding:.5rem .6rem;border-radius:10px;background:light-dark(#ffffff,#1f1f24);border:1px solid light-dark(#eef0f3,#2d2d33);transition:transform .16s ease,box-shadow .16s ease;animation:ngx-dropzone-item-in .22s cubic-bezier(.22,.9,.32,1) both}.ngx-dropzone-item:hover{box-shadow:0 2px 10px light-dark(rgba(0,0,0,.06),rgba(0,0,0,.4))}@keyframes ngx-dropzone-item-in{0%{opacity:0;transform:translateY(-6px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.ngx-dropzone-thumb-wrap{flex-shrink:0;inline-size:38px;block-size:38px;border-radius:8px;overflow:hidden;background:light-dark(#f4f4f5,#29292f);display:flex;align-items:center;justify-content:center}.ngx-dropzone-thumb{inline-size:100%;block-size:100%;object-fit:cover}.ngx-dropzone-file-icon{font-size:1.1rem}.ngx-dropzone-meta{flex:1;min-inline-size:0;display:flex;flex-direction:column;gap:.1rem}.ngx-dropzone-name{font-size:.8rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:light-dark(#1f2937,#e4e4e7)}.ngx-dropzone-size{font-size:.7rem;color:light-dark(#9ca3af,#71717a)}.ngx-dropzone-status{flex-shrink:0;inline-size:20px;block-size:20px;border-radius:50%;background:light-dark(#dcfce7,#14532d);color:light-dark(#16a34a,#4ade80);font-size:.7rem;display:flex;align-items:center;justify-content:center}.ngx-dropzone-remove{flex-shrink:0;appearance:none;border:none;background:transparent;cursor:pointer;color:light-dark(#9ca3af,#71717a);font-size:.8rem;line-height:1;padding:.3rem;border-radius:6px;transition:background-color .14s ease,color .14s ease}.ngx-dropzone-remove:hover{color:light-dark(#dc2626,#f87171);background:light-dark(#fee2e2,#3f1d1d)}.ngx-dropzone-actions{display:flex;justify-content:flex-end;margin-top:.7rem}.ngx-dropzone-upload-all,.ngx-dropzone-upload,.ngx-dropzone-retry{appearance:none;border:1px solid light-dark(#dbe3f0,#3b3b45);border-radius:7px;background:light-dark(#2563eb,#3b82f6);color:#fff;cursor:pointer;font:inherit;font-size:.75rem;font-weight:600;padding:.35rem .65rem;transition:opacity .14s ease,transform .14s ease}.ngx-dropzone-upload:hover:not(:disabled),.ngx-dropzone-upload-all:hover:not(:disabled),.ngx-dropzone-retry:hover:not(:disabled){transform:translateY(-1px)}.ngx-dropzone-upload-all:disabled,.ngx-dropzone-upload:disabled,.ngx-dropzone-retry:disabled{cursor:not-allowed;opacity:.5}.ngx-dropzone-upload-all{display:inline-flex;align-items:center;gap:.45rem}.ngx-dropzone-upload-all span{min-inline-size:1.15rem;block-size:1.15rem;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:#ffffff2e}.ngx-dropzone-retry{background:transparent;color:light-dark(#dc2626,#f87171)}.ngx-dropzone-row-actions{flex-shrink:0;display:flex;align-items:center;gap:.35rem}.ngx-dropzone-item.is-uploading .ngx-dropzone-status.uploading{animation:ngx-dropzone-upload-pulse 1.1s ease-in-out infinite}.ngx-dropzone-status.pending{background:light-dark(#f4f4f5,#29292f);color:light-dark(#a1a1aa,#71717a)}.ngx-dropzone-status.uploading{background:light-dark(#dbeafe,#172554);border:3px solid light-dark(#93c5fd,#3b82f6)}.ngx-dropzone-status.error{background:light-dark(#fee2e2,#450a0a);color:light-dark(#dc2626,#f87171);font-weight:700}.ngx-dropzone-status.success{background:light-dark(#dcfce7,#14532d);color:light-dark(#16a34a,#4ade80)}.ngx-dropzone-progress{position:relative;inline-size:100%;block-size:4px;margin-top:.35rem;overflow:hidden;border-radius:999px;background:light-dark(#e5e7eb,#303038)}.ngx-dropzone-progress-bar{display:block;block-size:100%;border-radius:inherit;background:light-dark(#2563eb,#60a5fa);transition:width .12s linear}.ngx-dropzone-progress-text{font-size:.65rem;color:light-dark(#6b7280,#a1a1aa)}.ngx-dropzone-error{font-size:.65rem;color:light-dark(#dc2626,#f87171)}@keyframes ngx-dropzone-upload-pulse{50%{opacity:.45}}\n"] }]
|
|
509
|
+
}, template: "<div\r\n class=\"ngx-dropzone\"\r\n [class.dragging]=\"isDragging()\"\r\n [class.disabled]=\"disabled()\"\r\n [class.has-files]=\"files().length > 0\"\r\n tabindex=\"0\"\r\n role=\"button\"\r\n [attr.aria-disabled]=\"disabled()\"\r\n (click)=\"onBrowseClick()\"\r\n (keydown)=\"onKeydown($event)\"\r\n (dragenter)=\"onDragEnter($event)\"\r\n (dragover)=\"onDragOver($event)\"\r\n (dragleave)=\"onDragLeave($event)\"\r\n (drop)=\"onDrop($event)\">\r\n <input\r\n #fileInput\r\n type=\"file\"\r\n class=\"ngx-dropzone-input\"\r\n [accept]=\"accept()\"\r\n [multiple]=\"multiple()\"\r\n [disabled]=\"disabled()\"\r\n (click)=\"$event.stopPropagation()\"\r\n (change)=\"onFileInputChange($event)\" />\r\n\r\n <div class=\"ngx-dropzone-icon-wrap\">\r\n <ng-content select=\"[dropzone-icon]\">\r\n <svg class=\"ngx-dropzone-icon\" viewBox=\"0 0 24 24\" fill=\"none\" width=\"30\" height=\"30\">\r\n <path\r\n d=\"M12 16V4M12 4l-4 4M12 4l4 4M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"1.8\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\" />\r\n </svg>\r\n </ng-content>\r\n </div>\r\n\r\n <div class=\"ngx-dropzone-text\">\r\n <ng-content>\r\n <strong>Drop files here</strong>\r\n <span>or click to browse</span>\r\n </ng-content>\r\n </div>\r\n\r\n @if (hint()) {\r\n <div class=\"ngx-dropzone-hint\">{{ hint() }}</div>\r\n }\r\n</div>\r\n\r\n@if (!autoUpload() && uploadMode() === 'all' && pendingCount() > 0) {\r\n <div class=\"ngx-dropzone-actions\">\r\n <button\r\n type=\"button\"\r\n class=\"ngx-dropzone-upload-all\"\r\n [disabled]=\"disabled() || !hasUploadConfiguration()\"\r\n (click)=\"uploadAll(); $event.stopPropagation()\">\r\n Upload all\r\n <span>{{ pendingCount() }}</span>\r\n </button>\r\n </div>\r\n}\r\n\r\n@if (showFileList() && files().length) {\r\n <ul class=\"ngx-dropzone-list\">\r\n @for (item of files(); track item.id) {\r\n <li class=\"ngx-dropzone-item\" [class.is-uploading]=\"item.status === 'uploading'\">\r\n <div class=\"ngx-dropzone-thumb-wrap\">\r\n @if (item.previewUrl) {\r\n <img class=\"ngx-dropzone-thumb\" [src]=\"item.previewUrl\" [alt]=\"item.file.name\" />\r\n } @else {\r\n <span class=\"ngx-dropzone-file-icon\">\uD83D\uDCC4</span>\r\n }\r\n </div>\r\n\r\n <div class=\"ngx-dropzone-meta\">\r\n <span class=\"ngx-dropzone-name\" [title]=\"item.file.name\">{{ item.file.name }}</span>\r\n <span class=\"ngx-dropzone-size\">{{ formatSize(item.file.size) }}</span>\r\n\r\n @if (item.status === 'uploading' || item.status === 'uploaded') {\r\n <div\r\n class=\"ngx-dropzone-progress\"\r\n role=\"progressbar\"\r\n [attr.aria-valuenow]=\"item.progress\"\r\n aria-valuemin=\"0\"\r\n aria-valuemax=\"100\"\r\n [attr.aria-label]=\"'Upload progress for ' + item.file.name\">\r\n <span class=\"ngx-dropzone-progress-bar\" [style.width.%]=\"item.progress\"></span>\r\n </div>\r\n <span class=\"ngx-dropzone-progress-text\">{{ item.progress }}%</span>\r\n }\r\n\r\n @if (item.status === 'error') {\r\n <span class=\"ngx-dropzone-error\">Upload failed</span>\r\n }\r\n </div>\r\n\r\n <div class=\"ngx-dropzone-row-actions\">\r\n @if (!autoUpload() && uploadMode() === 'single' && isPending(item)) {\r\n <button\r\n type=\"button\"\r\n class=\"ngx-dropzone-upload\"\r\n [disabled]=\"disabled() || !hasUploadConfiguration()\"\r\n [attr.aria-label]=\"'Upload ' + item.file.name\"\r\n (click)=\"uploadSingle(item.id); $event.stopPropagation()\">\r\n Upload\r\n </button>\r\n }\r\n\r\n @if (item.status === 'error') {\r\n <button\r\n type=\"button\"\r\n class=\"ngx-dropzone-retry\"\r\n [disabled]=\"disabled() || !hasUploadConfiguration()\"\r\n [attr.aria-label]=\"'Retry upload for ' + item.file.name\"\r\n (click)=\"retryUpload(item.id); $event.stopPropagation()\">\r\n Retry\r\n </button>\r\n }\r\n\r\n @if (item.status === 'uploaded') {\r\n <span class=\"ngx-dropzone-status success\" aria-label=\"Uploaded\">\u2713</span>\r\n } @else if (item.status === 'uploading') {\r\n <span class=\"ngx-dropzone-status uploading\" aria-label=\"Uploading\"></span>\r\n } @else if (item.status === 'error') {\r\n <span class=\"ngx-dropzone-status error\" aria-label=\"Upload failed\">!</span>\r\n } @else {\r\n <span class=\"ngx-dropzone-status pending\" aria-label=\"Pending\">\u2022</span>\r\n }\r\n\r\n <button\r\n type=\"button\"\r\n class=\"ngx-dropzone-remove\"\r\n [attr.aria-label]=\"'Remove ' + item.file.name\"\r\n (click)=\"removeFile(item.id); $event.stopPropagation()\">\r\n \u2715\r\n </button>\r\n </div>\r\n </li>\r\n }\r\n </ul>\r\n}\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.ngx-dropzone{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.65rem;padding:2.25rem 1.5rem;border-radius:16px;cursor:pointer;text-align:center;overflow:hidden;background:light-dark(#fafbfc,#1a1a1e);border:2px dashed light-dark(#d6dae1,#35353c);transition:border-color .2s ease,background-color .2s ease,transform .2s cubic-bezier(.34,1.56,.64,1),box-shadow .2s ease}.ngx-dropzone:before{content:\"\";position:absolute;inset:0;background:radial-gradient(circle at 50% 0%,light-dark(rgba(37,99,235,.06),rgba(59,130,246,.1)),transparent 65%);opacity:0;transition:opacity .2s ease;pointer-events:none}.ngx-dropzone:hover:not(.disabled){border-color:light-dark(#93c5fd,#3b82f6);box-shadow:0 4px 18px light-dark(rgba(37,99,235,.08),rgba(0,0,0,.35))}.ngx-dropzone:hover:not(.disabled):before{opacity:1}.ngx-dropzone:focus-visible{outline:2px solid light-dark(#2563eb,#60a5fa);outline-offset:3px}.ngx-dropzone.dragging{border-color:light-dark(#2563eb,#60a5fa);border-style:solid;background:light-dark(#eff6ff,#16213a);transform:scale(1.015);box-shadow:0 8px 28px light-dark(rgba(37,99,235,.18),rgba(59,130,246,.25))}.ngx-dropzone.dragging:before{opacity:1}.ngx-dropzone.dragging .ngx-dropzone-icon-wrap{transform:translateY(-4px) scale(1.08)}.ngx-dropzone.disabled{cursor:not-allowed;opacity:.55}.ngx-dropzone.has-files{padding-block:1.5rem}.ngx-dropzone-input{position:absolute;inset-inline-start:-9999px;width:1px;height:1px;opacity:0}.ngx-dropzone-icon-wrap{display:flex;align-items:center;justify-content:center;inline-size:56px;block-size:56px;border-radius:50%;background:light-dark(#eef2ff,#232433);color:light-dark(#4f46e5,#818cf8);transition:transform .22s cubic-bezier(.34,1.56,.64,1);z-index:1}.ngx-dropzone-text{z-index:1;display:flex;flex-direction:column;gap:.15rem}.ngx-dropzone-text strong{font-size:.92rem;font-weight:600;color:light-dark(#1f2937,#e4e4e7)}.ngx-dropzone-text span{font-size:.8rem;color:light-dark(#9ca3af,#71717a)}.ngx-dropzone-hint{z-index:1;font-size:.72rem;color:light-dark(#9ca3af,#6b7280);background:light-dark(#f3f4f6,#232327);padding:.15rem .6rem;border-radius:999px}.ngx-dropzone-list{list-style:none;margin:.85rem 0 0;padding:0;display:flex;flex-direction:column;gap:.45rem}.ngx-dropzone-item{display:flex;align-items:center;gap:.7rem;padding:.5rem .6rem;border-radius:10px;background:light-dark(#ffffff,#1f1f24);border:1px solid light-dark(#eef0f3,#2d2d33);transition:transform .16s ease,box-shadow .16s ease;animation:ngx-dropzone-item-in .22s cubic-bezier(.22,.9,.32,1) both}.ngx-dropzone-item:hover{box-shadow:0 2px 10px light-dark(rgba(0,0,0,.06),rgba(0,0,0,.4))}@keyframes ngx-dropzone-item-in{0%{opacity:0;transform:translateY(-6px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.ngx-dropzone-thumb-wrap{flex-shrink:0;inline-size:38px;block-size:38px;border-radius:8px;overflow:hidden;background:light-dark(#f4f4f5,#29292f);display:flex;align-items:center;justify-content:center}.ngx-dropzone-thumb{inline-size:100%;block-size:100%;object-fit:cover}.ngx-dropzone-file-icon{font-size:1.1rem}.ngx-dropzone-meta{flex:1;min-inline-size:0;display:flex;flex-direction:column;gap:.1rem}.ngx-dropzone-name{font-size:.8rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:light-dark(#1f2937,#e4e4e7)}.ngx-dropzone-size{font-size:.7rem;color:light-dark(#9ca3af,#71717a)}.ngx-dropzone-status{flex-shrink:0;inline-size:20px;block-size:20px;border-radius:50%;background:light-dark(#dcfce7,#14532d);color:light-dark(#16a34a,#4ade80);font-size:.7rem;display:flex;align-items:center;justify-content:center}.ngx-dropzone-remove{flex-shrink:0;appearance:none;border:none;background:transparent;cursor:pointer;color:light-dark(#9ca3af,#71717a);font-size:.8rem;line-height:1;padding:.3rem;border-radius:6px;transition:background-color .14s ease,color .14s ease}.ngx-dropzone-remove:hover{color:light-dark(#dc2626,#f87171);background:light-dark(#fee2e2,#3f1d1d)}.ngx-dropzone-actions{display:flex;justify-content:flex-end;margin-top:.7rem}.ngx-dropzone-upload-all,.ngx-dropzone-upload,.ngx-dropzone-retry{appearance:none;border:1px solid light-dark(#dbe3f0,#3b3b45);border-radius:7px;background:light-dark(#2563eb,#3b82f6);color:#fff;cursor:pointer;font:inherit;font-size:.75rem;font-weight:600;padding:.35rem .65rem;transition:opacity .14s ease,transform .14s ease}.ngx-dropzone-upload:hover:not(:disabled),.ngx-dropzone-upload-all:hover:not(:disabled),.ngx-dropzone-retry:hover:not(:disabled){transform:translateY(-1px)}.ngx-dropzone-upload-all:disabled,.ngx-dropzone-upload:disabled,.ngx-dropzone-retry:disabled{cursor:not-allowed;opacity:.5}.ngx-dropzone-upload-all{display:inline-flex;align-items:center;gap:.45rem}.ngx-dropzone-upload-all span{min-inline-size:1.15rem;block-size:1.15rem;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:#ffffff2e}.ngx-dropzone-retry{background:transparent;color:light-dark(#dc2626,#f87171)}.ngx-dropzone-row-actions{flex-shrink:0;display:flex;align-items:center;gap:.35rem}.ngx-dropzone-item.is-uploading .ngx-dropzone-status.uploading{animation:ngx-dropzone-upload-pulse 1.1s ease-in-out infinite}.ngx-dropzone-status.pending{background:light-dark(#f4f4f5,#29292f);color:light-dark(#a1a1aa,#71717a)}.ngx-dropzone-status.uploading{background:light-dark(#dbeafe,#172554);border:3px solid light-dark(#93c5fd,#3b82f6)}.ngx-dropzone-status.error{background:light-dark(#fee2e2,#450a0a);color:light-dark(#dc2626,#f87171);font-weight:700}.ngx-dropzone-status.success{background:light-dark(#dcfce7,#14532d);color:light-dark(#16a34a,#4ade80)}.ngx-dropzone-progress{position:relative;inline-size:100%;block-size:4px;margin-top:.35rem;overflow:hidden;border-radius:999px;background:light-dark(#e5e7eb,#303038)}.ngx-dropzone-progress-bar{display:block;block-size:100%;border-radius:inherit;background:light-dark(#2563eb,#60a5fa);transition:width .12s linear}.ngx-dropzone-progress-text{font-size:.65rem;color:light-dark(#6b7280,#a1a1aa)}.ngx-dropzone-error{font-size:.65rem;color:light-dark(#dc2626,#f87171)}@keyframes ngx-dropzone-upload-pulse{50%{opacity:.45}}\n"] }]
|
|
510
510
|
}], propDecorators: { accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], maxFileSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFileSize", required: false }] }], maxFiles: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFiles", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], showFileList: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFileList", required: false }] }], uploadUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadUrl", required: false }] }], uploadAlias: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadAlias", required: false }] }], autoUpload: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoUpload", required: false }] }], maxParallel: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxParallel", required: false }] }], uploadMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadMode", required: false }] }], uploadData: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadData", required: false }] }], uploadHeaders: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadHeaders", required: false }] }], uploadWithCredentials: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadWithCredentials", required: false }] }], filesAdded: [{ type: i0.Output, args: ["filesAdded"] }], filesRejected: [{ type: i0.Output, args: ["filesRejected"] }], filesChange: [{ type: i0.Output, args: ["filesChange"] }], uploadStarted: [{ type: i0.Output, args: ["uploadStarted"] }], uploadProgress: [{ type: i0.Output, args: ["uploadProgress"] }], uploadSuccess: [{ type: i0.Output, args: ["uploadSuccess"] }], uploadError: [{ type: i0.Output, args: ["uploadError"] }], fileInput: [{ type: i0.ViewChild, args: ['fileInput', { isSignal: true }] }] } });
|
|
511
511
|
|
|
512
512
|
/**
|