ngx-kit 7.2.0 → 7.3.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/angle-selector/README.md +34 -34
- package/box-shadow/README.md +33 -33
- package/color-picker/README.md +52 -52
- package/{shared → core}/README.md +117 -117
- package/data-table/README.md +120 -120
- package/date-picker/README.md +74 -74
- package/dialog/README.md +122 -92
- package/drag-resize/README.md +53 -55
- package/fesm2022/ngx-kit-angle-selector.mjs +9 -26
- package/fesm2022/ngx-kit-angle-selector.mjs.map +1 -1
- package/fesm2022/ngx-kit-box-shadow.mjs +330 -356
- package/fesm2022/ngx-kit-box-shadow.mjs.map +1 -1
- package/fesm2022/ngx-kit-color-picker.mjs +132 -272
- package/fesm2022/ngx-kit-color-picker.mjs.map +1 -1
- package/fesm2022/{ngx-kit-shared.mjs → ngx-kit-core.mjs} +845 -277
- package/fesm2022/ngx-kit-core.mjs.map +1 -0
- package/fesm2022/ngx-kit-data-table.mjs +1 -1
- package/fesm2022/ngx-kit-data-table.mjs.map +1 -1
- package/fesm2022/ngx-kit-date-picker.mjs +27 -21
- package/fesm2022/ngx-kit-date-picker.mjs.map +1 -1
- package/fesm2022/ngx-kit-dialog.mjs +430 -331
- package/fesm2022/ngx-kit-dialog.mjs.map +1 -1
- package/fesm2022/ngx-kit-drag-resize.mjs +126 -45
- package/fesm2022/ngx-kit-drag-resize.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.map +1 -1
- package/fesm2022/ngx-kit-form-field.mjs.map +1 -1
- package/fesm2022/ngx-kit-gallery.mjs +3 -3
- package/fesm2022/ngx-kit-gallery.mjs.map +1 -1
- package/fesm2022/ngx-kit-gradient-picker.mjs +20 -38
- package/fesm2022/ngx-kit-gradient-picker.mjs.map +1 -1
- package/fesm2022/ngx-kit-grid-layout.mjs +14 -14
- package/fesm2022/ngx-kit-grid-layout.mjs.map +1 -1
- package/fesm2022/ngx-kit-image-editor.mjs +3 -3
- package/fesm2022/ngx-kit-image-editor.mjs.map +1 -1
- package/fesm2022/ngx-kit-menu.mjs +1 -1
- package/fesm2022/ngx-kit-menu.mjs.map +1 -1
- package/fesm2022/ngx-kit-message.mjs +1 -1
- package/fesm2022/ngx-kit-message.mjs.map +1 -1
- package/fesm2022/ngx-kit-notify.mjs +1 -1
- package/fesm2022/ngx-kit-notify.mjs.map +1 -1
- package/fesm2022/ngx-kit-time-picker.mjs +1 -1
- package/fesm2022/ngx-kit-time-picker.mjs.map +1 -1
- package/fesm2022/ngx-kit-virtual-scroll.mjs +2 -2
- package/fesm2022/ngx-kit-virtual-scroll.mjs.map +1 -1
- package/gallery/README.md +71 -71
- package/gradient-picker/README.md +41 -41
- package/grid-layout/README.md +64 -64
- package/image-editor/README.md +44 -44
- package/menu/README.md +85 -85
- package/message/README.md +70 -70
- package/notify/README.md +56 -56
- package/package.json +5 -9
- package/time-picker/README.md +89 -89
- package/types/ngx-kit-angle-selector.d.ts +13 -16
- package/types/ngx-kit-box-shadow.d.ts +37 -95
- package/types/ngx-kit-color-picker.d.ts +61 -58
- package/types/{ngx-kit-shared.d.ts → ngx-kit-core.d.ts} +156 -34
- package/types/ngx-kit-data-table.d.ts +2 -2
- package/types/ngx-kit-date-picker.d.ts +1 -1
- package/types/ngx-kit-dialog.d.ts +208 -107
- package/types/ngx-kit-drag-resize.d.ts +33 -6
- package/types/ngx-kit-gradient-picker.d.ts +4 -7
- package/types/ngx-kit-menu.d.ts +1 -1
- package/types/ngx-kit-time-picker.d.ts +1 -1
- package/virtual-scroll/README.md +199 -199
- package/fesm2022/ngx-kit-shared.mjs.map +0 -1
- package/fesm2022/ngx-kit-webflow.mjs +0 -709
- package/fesm2022/ngx-kit-webflow.mjs.map +0 -1
- package/types/ngx-kit-webflow.d.ts +0 -286
|
@@ -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';\r\nimport { Directive, ElementRef, inject, Inject, Input, OnInit } from '@angular/core';\r\nimport { DIALOG_REF } from '../dialog.tokens';\r\n\r\n@Directive({\r\n standalone: false,\r\n selector: 'ngx-dialog-header,[ngxDialogHeader]',\r\n host: {\r\n class: 'dialog-header',\r\n },\r\n exportAs: 'ngxDialogHeader',\r\n})\r\nexport class NgxDialogHeaderDirective implements OnInit {\r\n @Input() showCloseButton = true;\r\n\r\n private _dialogRef = inject(DIALOG_REF);\r\n constructor(\r\n public _el: ElementRef<HTMLElement>,\r\n @Inject(DOCUMENT) private _document: Document,\r\n ) {}\r\n\r\n ngOnInit(): void {\r\n this._el.nativeElement.innerHTML = '<span>' + this._el.nativeElement.innerHTML + '</span>';\r\n if (this.showCloseButton) {\r\n let closeBtn = this._document.createElement('button');\r\n closeBtn.className = 'close-btn';\r\n closeBtn.innerHTML =\r\n '<svg width=\"20\" height=\"20\" fill=\"currentColor\" 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>';\r\n\r\n closeBtn.onclick = closeBtn.ontouchend = () => {\r\n this._dialogRef.close();\r\n };\r\n this._el.nativeElement.appendChild(closeBtn);\r\n }\r\n this._dialogRef.header = this._el;\r\n }\r\n}\r\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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mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,iBAdxB,kBAAkB;YAClB,wBAAwB;YACxB,wBAAwB;YACxB,sBAAsB,CAAA,EAAA,OAAA,EAAA,CAEd,YAAY,CAAA,EAAA,OAAA,EAAA,CAEpB,kBAAkB;YAClB,wBAAwB;YACxB,wBAAwB;YACxB,sBAAsB,CAAA,EAAA,CAAA;AAIb,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,EAAA,SAAA,EAFf,CAAC,iBAAiB,CAAC,YAPpB,YAAY,CAAA,EAAA,CAAA;;2FASX,eAAe,EAAA,UAAA,EAAA,CAAA;kBAhB3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,kBAAkB;wBAClB,wBAAwB;wBACxB,wBAAwB;wBACxB,sBAAsB;AACvB,qBAAA;oBACD,OAAO,EAAE,CAAC,YAAY,CAAC;AACvB,oBAAA,OAAO,EAAE;wBACP,kBAAkB;wBAClB,wBAAwB;wBACxB,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/configs/dialog-ref.ts","../../../projects/libs/dialog/configs/dialog-config.ts","../../../projects/libs/dialog/tokens/dialog.tokens.ts","../../../projects/libs/dialog/directives/footer.directive.ts","../../../projects/libs/dialog/directives/header.directive.ts","../../../projects/libs/dialog/components/ngx-dialog.component.ts","../../../projects/libs/dialog/components/ngx-dialog.component.html","../../../projects/libs/dialog/services/ngx-dialog.service.ts","../../../projects/libs/dialog/dialog.facade.ts","../../../projects/libs/dialog/ngx-dialog.provider.ts","../../../projects/libs/dialog/directives/body.directive.ts","../../../projects/libs/dialog/ngx-dialog.module.ts","../../../projects/libs/dialog/ngx-kit-dialog.ts"],"sourcesContent":["import { signal } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\nimport { OverlayRef } from 'ngx-kit/core';\n\nlet uniqueId = 0;\nfunction nextDialogId(): string {\n uniqueId += 1;\n return `ngx-dialog-${Date.now().toString(36)}-${uniqueId}`;\n}\n\nexport class NgxDialogRef<R = any> {\n readonly id = nextDialogId();\n\n /** true from the moment `close()` is called, even before teardown finishes. */\n readonly closing = signal(false);\n /** true once the dialog has been fully removed from the DOM. */\n readonly closed = signal(false);\n\n private readonly _afterClosed = new Subject<R | undefined>();\n /** Emits the result exactly once, after the dialog has been fully torn down. */\n readonly afterClosed: Observable<R | undefined> = this._afterClosed.asObservable();\n\n /** @internal set by the layout directives; read by NgxDialogBody to size itself. */\n readonly headerEl = signal<HTMLElement | null>(null);\n /** @internal */\n readonly footerEl = signal<HTMLElement | null>(null);\n /** @internal */\n readonly bodyEl = signal<HTMLElement | null>(null);\n /** @internal the dialog panel's own host element. */\n readonly panelEl = signal<HTMLElement | null>(null);\n\n /** Optional synchronous guard - return `false` to prevent Escape/outside-click from closing. */\n beforeClose?: () => boolean;\n\n private overlayRef?: OverlayRef<unknown>;\n private result: R | undefined;\n\n /** @internal used by NgxDialogService right after creating the overlay. */\n _attachOverlayRef(ref: OverlayRef<unknown>): void {\n this.overlayRef = ref;\n }\n\n /** @internal used by the header/footer/body directives and the panel component. */\n _setHeaderElement(el: HTMLElement | null): void {\n this.headerEl.set(el);\n }\n /** @internal */\n _setFooterElement(el: HTMLElement | null): void {\n this.footerEl.set(el);\n }\n /** @internal */\n _setBodyElement(el: HTMLElement | null): void {\n this.bodyEl.set(el);\n }\n /** @internal */\n _setPanelElement(el: HTMLElement | null): void {\n this.panelEl.set(el);\n }\n\n /** Closes the dialog and emits `result` on `afterClosed` once torn down. Idempotent. */\n close(result?: R): void {\n if (this.closing() || this.closed()) {\n return;\n }\n this.closing.set(true);\n this.result = result;\n this.overlayRef?.close();\n }\n\n /** @internal called by NgxDialogService's `onClosed` callback once the overlay is fully torn down. */\n _finalizeClose(): void {\n if (this.closed()) {\n return;\n }\n this.closed.set(true);\n this._afterClosed.next(this.result);\n this._afterClosed.complete();\n }\n}\n","import { Injector } from '@angular/core';\nimport { NgxDialogFooterAlign } from '../directives/footer.directive';\n\nexport type NgxDialogSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';\n\nexport interface NgxDialogHeaderConfig {\n enable?: boolean;\n title?: string;\n showCloseButton?: boolean;\n showMaximizeButton?: boolean;\n}\n\nexport interface NgxDialogFooterConfig {\n enable?: boolean;\n /** Text for the auto-generated close button. Default: 'Close'. */\n closeText?: string;\n align?: NgxDialogFooterAlign;\n}\n\n/**\n * BREAKING CHANGE from the previous version of this config:\n * - `allowCloseOnOutsideClick` -> `closeOnOutsideClick` (naming now matches\n * `ngx-kit/overlay`'s options, which this service is built directly on).\n * - `header`/`footer` are now actually wired up (previously declared but\n * unused) - set `enable: true` to get an automatic header/footer without\n * having to place the `ngxDialogHeader`/`ngxDialogFooter` directives\n * yourself inside the content component.\n */\nexport class NgxDialogConfig<DataType = any> {\n /** Data made available to the content component (and to `ngx-dialog-panel`\n * itself) via the `DIALOG_DATA` injection token. */\n data?: DataType = {} as DataType;\n\n /** Named size preset - sets sensible min/max width bounds. Combine with\n * `width`/`maxWidth`/... for full manual control. */\n size?: NgxDialogSize;\n width?: string;\n minWidth?: string;\n maxWidth?: string;\n height?: string;\n minHeight?: string;\n maxHeight?: string;\n\n /** Extra class(es) on the dialog panel (the `ngx-dialog-panel` host). */\n panelClass?: string | string[] = 'ngx-kit';\n /** Extra class(es) on the backdrop element behind the panel. */\n backdropClass?: string | string[] = 'ngx-dialog-backdrop';\n\n header?: NgxDialogHeaderConfig = {\n enable: false,\n showCloseButton: true,\n showMaximizeButton: true,\n };\n footer?: NgxDialogFooterConfig = { enable: false, align: 'end' };\n\n /** Close when clicking outside the panel. Default: false (modal by default). */\n closeOnOutsideClick?: boolean = false;\n /** Close on Escape. Default: true. */\n closeOnEscape?: boolean = true;\n /** Shorthand for `closeOnOutsideClick: false, closeOnEscape: false` - the\n * dialog can then only be closed programmatically (e.g. via its own\n * buttons calling `dialogRef.close()`). */\n disableClose?: boolean = false;\n /** Synchronous guard consulted before Escape/outside-click would close the\n * dialog - return `false` to block it (e.g. unsaved changes). Does not\n * affect a programmatic `dialogRef.close()` call. */\n beforeClose?: () => boolean;\n\n /** Prevent the page behind the dialog from scrolling while it's open. Default: true. */\n lockBodyScroll?: boolean = true;\n /** Move focus into the dialog on open. Default: true. */\n autoFocus?: boolean = true;\n /** Restore focus to the previously focused element on close. Default: true. */\n restoreFocus?: boolean = true;\n /** Render via the native Popover API when supported. Default: true. */\n usePopover?: boolean = true;\n\n role?: 'dialog' | 'alertdialog' = 'dialog';\n ariaLabel?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n\n /** Entry animation for the panel. Default: 'zoom'. */\n animation?: 'zoom' | 'fade' | 'slide-up' | 'none' = 'zoom';\n\n /** Parent injector for the content component (and `ngx-dialog-panel`\n * itself). Defaults to the root injector. */\n injector?: Injector;\n\n constructor(init?: Partial<NgxDialogConfig<DataType>>) {\n Object.assign(this, init);\n }\n}\n","import { InjectionToken, Type } from '@angular/core';\nimport { NgxDialogConfig } from '../configs/dialog-config';\nimport { NgxDialogRef } from '../configs/dialog-ref';\n\nexport const DIALOG_DATA = new InjectionToken<any>('NGX_DIALOG_DATA');\nexport const DIALOG_REF = new InjectionToken<NgxDialogRef<any>>('NGX_DIALOG_REF');\n/** The resolved config for the dialog currently being rendered. */\n\nexport const NGX_DIALOG_DEFAULT_CONFIG = new NgxDialogConfig();\nexport const NGX_DIALOG_CONFIG = new InjectionToken<NgxDialogConfig<any>>('NGX_NGX_DIALOG_CONFIG');\n/** The arbitrary content component passed to `open()`, projected via `*ngComponentOutlet`. */\nexport const DIALOG_CONTENT = new InjectionToken<Type<any>>('NGX_DIALOG_CONTENT');\n","import { Directive, ElementRef, inject, input, OnDestroy, OnInit } from '@angular/core';\nimport { DIALOG_REF } from '../tokens/dialog.tokens';\n\nexport type NgxDialogFooterAlign = 'start' | 'end' | 'center' | 'space-between' | 'space-around';\n\n@Directive({\n selector: 'ngx-dialog-footer,[ngxDialogFooter]',\n standalone: true,\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 NgxDialogFooter implements OnInit, OnDestroy {\n readonly align = input<NgxDialogFooterAlign>('end');\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly dialogRef = inject(DIALOG_REF);\n\n ngOnInit(): void {\n this.dialogRef._setFooterElement(this.el.nativeElement);\n }\n\n ngOnDestroy(): void {\n this.dialogRef._setFooterElement(null);\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { Directive, ElementRef, inject, input, OnInit } from '@angular/core';\nimport { DIALOG_REF, NGX_DIALOG_CONFIG } from '../tokens/dialog.tokens';\nimport { NgxDraggable } from 'ngx-kit/drag-resize';\nimport { DIALOG_OVERLAY_CLASSNAME } from 'ngx-kit/core';\n\nconst CLOSE_ICON_SVG = `<svg width=\"16\" height=\"16\" fill=\"currentColor\" viewBox=\"0 0 320 512\" aria-hidden=\"true\">\n <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\"/>\n </svg>`;\nconst MAXIMIZE_ICON_SVG = `<svg name=\"maximize\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M7.4852 16.5149C6.9104 15.9401 7.00595 13.4982 7.00595 13.4982M7.4852 16.5149C8.06001 17.0897 10.5019 16.994 10.5019 16.994M7.4852 16.5149L11 13M16.5149 7.48512C15.9401 6.91031 13.4982 7.00596 13.4982 7.00596M16.5149 7.48512C17.0897 8.05993 16.994 10.5018 16.994 10.5018M16.5149 7.48512L13 11\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z\" stroke-width=\"1.5\"/>\n</svg>`;\nconst RESTORE_ICON_SVG = `<svg name=\"restore\" stroke=\"currentColor\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z\" stroke-width=\"1.5\"/>\n<path d=\"M12.9833 11.0167C12.4085 10.4419 12.5041 8 12.5041 8M12.9833 11.0167C13.5581 11.5915 16 11.4958 16 11.4958M12.9833 11.0167L17 7M11.0131 12.9868C10.4383 12.412 7.99641 12.5077 7.99641 12.5077M11.0131 12.9868C11.5879 13.5616 11.4922 16.0035 11.4922 16.0035M11.0131 12.9868L7 16.9999\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>`;\n\n@Directive({\n selector: 'ngx-dialog-header,[ngxDialogHeader]',\n standalone: true,\n hostDirectives: [NgxDraggable],\n host: { class: 'dialog-header' },\n exportAs: 'ngxDialogHeader',\n})\nexport class NgxDialogHeader implements OnInit {\n private config = inject(NGX_DIALOG_CONFIG);\n readonly showCloseButton = input(this.config.header?.showCloseButton ?? true);\n readonly showMaximizeButton = input(this.config.header?.showMaximizeButton ?? true);\n\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef<HTMLElement>);\n private readonly document = inject(DOCUMENT);\n private readonly dialogRef = inject(DIALOG_REF);\n\n private readonly drag = inject(NgxDraggable);\n\n private isMaximized = false;\n\n ngOnInit(): void {\n this.drag.dragRootElement.set('.ngx-ui-overlay');\n this.drag.dragHandle.set('.dialog-header-title');\n // Wrap the existing (Angular-rendered) header content in a title span by\n // MOVING the actual DOM nodes, not by re-serializing/re-parsing\n // `innerHTML`. The original implementation did\n // `el.innerHTML = '<span>' + el.innerHTML + '</span>'`, which silently\n // destroys any event listeners or component state living inside the\n // header content (anything beyond static text) because the browser\n // throws away and re-parses the whole subtree.\n const titleWrapper = this.document.createElement('span');\n titleWrapper.className = 'dialog-header-title';\n while (this.el.nativeElement.firstChild) {\n titleWrapper.appendChild(this.el.nativeElement.firstChild);\n }\n this.el.nativeElement.appendChild(titleWrapper);\n if (this.showMaximizeButton()) {\n const fullScreenBtn = this.document.createElement('button');\n fullScreenBtn.type = 'button';\n fullScreenBtn.className = 'ngx-dialog-action-btn';\n fullScreenBtn.setAttribute('aria-label', 'Maximaize');\n fullScreenBtn.setAttribute('title', 'Maximaize');\n fullScreenBtn.innerHTML = MAXIMIZE_ICON_SVG;\n fullScreenBtn.addEventListener('click', (ev: Event) => this.fullScreen(ev));\n this.el.nativeElement.appendChild(fullScreenBtn);\n }\n if (this.showCloseButton()) {\n const closeBtn = this.document.createElement('button');\n closeBtn.type = 'button';\n closeBtn.className = 'ngx-dialog-action-btn';\n closeBtn.setAttribute('aria-label', 'Close');\n closeBtn.setAttribute('title', 'Close');\n closeBtn.innerHTML = CLOSE_ICON_SVG;\n closeBtn.addEventListener('click', () => this.dialogRef.close());\n this.el.nativeElement.appendChild(closeBtn);\n }\n\n this.dialogRef._setHeaderElement(this.el.nativeElement);\n }\n\n private fullScreen(ev: Event) {\n const overlay = this.el.nativeElement.closest(`.${DIALOG_OVERLAY_CLASSNAME}`);\n this.isMaximized = !this.isMaximized;\n this.drag.disabled.set(this.isMaximized);\n if (overlay) {\n overlay.classList.toggle('ngx-dialog-fullscreen');\n const btn = ev.currentTarget as HTMLButtonElement;\n btn.innerHTML = this.isMaximized ? RESTORE_ICON_SVG : MAXIMIZE_ICON_SVG;\n btn.setAttribute('aria-label', this.isMaximized ? 'Restore' : 'Maximaize');\n btn.setAttribute('title', this.isMaximized ? 'Restore' : 'Maximaize');\n }\n }\n}\n","import { NgComponentOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ElementRef, computed, inject } from '@angular/core';\nimport { NGX_DIALOG_CONFIG, DIALOG_CONTENT, DIALOG_REF } from '../tokens/dialog.tokens';\nimport { NgxDialogFooter } from '../directives/footer.directive';\nimport { NgxDialogHeader } from '../directives/header.directive';\n\n/**\n * The dialog \"panel\" shell. It no longer owns the backdrop, centering,\n * focus trap, Escape handling or outside-click handling - all of that now\n * lives in `OverlayService`, which this component is rendered inside of.\n * This is intentionally a thin, fully signal-driven shell: no\n * `AfterViewInit`, no manual `ChangeDetectorRef.detectChanges()`, no\n * imperative style writes. Angular schedules change detection automatically\n * whenever a signal read from the template changes, including in zoneless\n * apps.\n */\n@Component({\n selector: 'ngx-dialog-panel',\n standalone: true,\n imports: [NgComponentOutlet, NgxDialogHeader, NgxDialogFooter],\n templateUrl: './ngx-dialog.component.html',\n styleUrl: './ngx-dialog.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'ngx-dialog-panel',\n '[class]': 'sizeClass()',\n },\n})\nexport class NgxDialogComponent {\n protected readonly dialogRef = inject(DIALOG_REF);\n protected readonly config = inject(NGX_DIALOG_CONFIG);\n protected readonly content = inject(DIALOG_CONTENT);\n\n protected readonly sizeClass = computed(() =>\n this.config.size ? `ngx-dialog-size-${this.config.size}` : '',\n );\n\n constructor() {\n this.dialogRef._setPanelElement(inject(ElementRef<HTMLElement>).nativeElement);\n }\n}\n","@if (config.header?.enable) {\n <div\n ngxDialogHeader\n [showCloseButton]=\"config.header?.showCloseButton ?? true\"\n [showMaximizeButton]=\"config.header?.showMaximizeButton ?? true\">\n {{ config.header?.title }}\n </div>\n}\n\n<ng-container *ngComponentOutlet=\"content\" />\n\n@if (config.footer?.enable) {\n <div ngxDialogFooter [align]=\"config.footer?.align ?? 'end'\">\n <button type=\"button\" class=\"ngx-dialog-default-close-btn\" (click)=\"dialogRef.close()\">\n {{ config.footer?.closeText ?? 'Close' }}\n </button>\n </div>\n}\n","import { Injectable, Injector, Type, computed, inject, signal } from '@angular/core';\nimport { OverlayService, OverlayOptions } from 'ngx-kit/core';\nimport { NgxDialogRef } from '../configs/dialog-ref';\nimport { NgxDialogConfig } from '../configs/dialog-config';\nimport {\n NGX_DIALOG_CONFIG,\n DIALOG_CONTENT,\n DIALOG_DATA,\n DIALOG_REF,\n} from '../tokens/dialog.tokens';\nimport { NgxDialogComponent } from '../components/ngx-dialog.component';\n\n@Injectable({ providedIn: 'root' })\nexport class NgxDialogService {\n private readonly overlay = inject(OverlayService);\n private readonly injector = inject(Injector);\n\n private readonly _openRefs = signal<NgxDialogRef<any>[]>([]);\n /** Every currently open dialog, oldest first. */\n readonly openDialogs = this._openRefs.asReadonly();\n /** How many dialogs are currently open. */\n readonly openCount = computed(() => this._openRefs().length);\n readonly defaultConfig = inject(NGX_DIALOG_CONFIG);\n /**\n * Opens `content` inside a dialog panel and returns a ref you can use to\n * close it and read the result back (`afterClosed`).\n */\n open<R = any, DataType = any>(\n content: Type<any>,\n config?: Partial<NgxDialogConfig<DataType>>,\n ): NgxDialogRef<R> {\n const resolvedConfig = { ...this.defaultConfig, ...config };\n const dialogRef = new NgxDialogRef<R>();\n dialogRef.beforeClose = resolvedConfig.beforeClose;\n\n const componentInjector = Injector.create({\n providers: [\n { provide: DIALOG_DATA, useValue: resolvedConfig.data },\n { provide: DIALOG_REF, useValue: dialogRef },\n { provide: NGX_DIALOG_CONFIG, useValue: resolvedConfig },\n { provide: DIALOG_CONTENT, useValue: content },\n ],\n parent: resolvedConfig.injector ?? this.injector,\n });\n\n const disableClose = resolvedConfig.disableClose ?? false;\n\n const overlayRef = this.overlay.open<NgxDialogComponent>({\n component: NgxDialogComponent,\n injector: componentInjector,\n placement: 'center',\n alignment: 'center',\n margin: 0,\n role: resolvedConfig.role ?? 'dialog',\n ariaModal: true,\n ariaLabel: resolvedConfig.ariaLabel,\n ariaLabelledby: resolvedConfig.ariaLabelledby,\n ariaDescribedby: resolvedConfig.ariaDescribedby,\n usePopover: resolvedConfig.usePopover ?? true,\n closeOnEscape: disableClose ? false : (resolvedConfig.closeOnEscape ?? true),\n closeOnOutsideClick: disableClose ? false : (resolvedConfig.closeOnOutsideClick ?? false),\n canClose: () => dialogRef.beforeClose?.() ?? true,\n restoreFocus: resolvedConfig.restoreFocus ?? true,\n autoFocus: resolvedConfig.autoFocus ?? true,\n lockBodyScroll: resolvedConfig.lockBodyScroll ?? true,\n backdropClass: resolvedConfig.backdropClass,\n panelClass: resolvedConfig.panelClass,\n configure: (_instance, ref) => this.applySizing(ref.nativeElement, resolvedConfig),\n onClosed: () => {\n this._openRefs.update((refs) => refs.filter((r) => r !== dialogRef));\n dialogRef._finalizeClose();\n },\n } satisfies OverlayOptions<NgxDialogComponent>);\n\n dialogRef._attachOverlayRef(overlayRef);\n this._openRefs.update((refs) => [...refs, dialogRef]);\n return dialogRef;\n }\n\n /** Closes every currently open dialog (ignores `disableClose`/guards - use sparingly, e.g. on logout). */\n closeAll(): void {\n [...this._openRefs()].forEach((ref) => ref.close());\n }\n\n private applySizing(el: HTMLElement | null, config: NgxDialogConfig): void {\n if (!el) return;\n if (config.width) el.style.width = config.width;\n if (config.minWidth) el.style.minWidth = config.minWidth;\n if (config.maxWidth) el.style.maxWidth = config.maxWidth;\n if (config.height) el.style.height = config.height;\n if (config.minHeight) el.style.minHeight = config.minHeight;\n if (config.maxHeight) el.style.maxHeight = config.maxHeight;\n }\n}\n","import { Type } from '@angular/core';\nimport { NgxDialogConfig } from './configs/dialog-config';\nimport { NgxDialogRef } from './configs/dialog-ref';\nimport { NgxDialogService } from './services/ngx-dialog.service';\n\nconst NOT_INITIALIZED_MESSAGE =\n '[ngx-kit/dialog] Dialog.* was called before provideNgxDialog() ran. ' +\n 'Add provideNgxDialog() to your app providers, or inject NgxDialogService directly instead of using the static Dialog API.';\n\n/**\n * Static convenience API over `NgxDialogService`, so you can call\n * `Dialog.open(...)` from anywhere without injecting the service manually.\n *\n * SSR note: the instance backing this static class is process-wide, not\n * per-request, so it is deliberately left unset on the server (see\n * `provideNgxDialog()`). Inject `NgxDialogService` directly in SSR code paths.\n */\nexport class Dialog {\n private static serviceInstance: NgxDialogService | null = null;\n\n /** @internal set by `provideNgxDialog()`'s environment initializer. */\n static _setService(svc: NgxDialogService): void {\n this.serviceInstance = svc;\n }\n\n private static get service(): NgxDialogService {\n if (!this.serviceInstance) {\n throw new Error(NOT_INITIALIZED_MESSAGE);\n }\n return this.serviceInstance;\n }\n\n static open<R = any, DataType = any>(\n component: Type<any>,\n config?: Partial<NgxDialogConfig<DataType>>,\n ): NgxDialogRef<R> {\n return this.service.open<R, DataType>(component, config);\n }\n\n static closeAll(): void {\n this.service.closeAll();\n }\n}\n","import {\n EnvironmentProviders,\n PLATFORM_ID,\n inject,\n makeEnvironmentProviders,\n provideEnvironmentInitializer,\n} from '@angular/core';\nimport { isPlatformServer } from '@angular/common';\nimport { NgxDialogService } from './services/ngx-dialog.service';\nimport { Dialog } from './dialog.facade';\nimport { NgxDialogConfig } from './configs/dialog-config';\nimport { NGX_DIALOG_CONFIG, NGX_DIALOG_DEFAULT_CONFIG } from './tokens/dialog.tokens';\n\nexport function provideNgxDialog(config?: NgxDialogConfig): EnvironmentProviders {\n return makeEnvironmentProviders([\n {\n provide: NGX_DIALOG_CONFIG,\n useValue: { ...NGX_DIALOG_DEFAULT_CONFIG, ...(config || {}) },\n },\n NgxDialogService,\n provideEnvironmentInitializer(() => {\n if (isPlatformServer(inject(PLATFORM_ID))) {\n return;\n }\n\n Dialog._setService(inject(NgxDialogService));\n }),\n ]);\n}\n","import {\n DestroyRef,\n Directive,\n ElementRef,\n HostListener,\n Renderer2,\n effect,\n inject,\n} from '@angular/core';\nimport { DIALOG_REF } from '../tokens/dialog.tokens';\n\n/**\n * Why this can't be pure CSS flexbox: the header/body/footer elements are\n * *grandchildren* of the dialog panel (panel -> `*ngComponentOutlet`'s host\n * element -> header/body/footer), not direct children, because the content\n * component that hosts them is arbitrary and we don't control its own host\n * styling. `display:flex;flex-direction:column` on the panel therefore can't\n * size the body against the header/footer through that extra layer, so we\n * measure and set an explicit `max-height` instead, driven by a\n * `ResizeObserver` on the panel (not a `window:resize` listener, so it also\n * reacts to the dialog itself changing size, e.g. via `config.size`).\n */\n@Directive({\n selector: 'ngx-dialog-body,[ngxDialogBody]',\n standalone: true,\n host: { class: 'dialog-body' },\n exportAs: 'ngxDialogBody',\n})\nexport class NgxDialogBody {\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly renderer = inject(Renderer2);\n private readonly dialogRef = inject(DIALOG_REF);\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n this.dialogRef._setBodyElement(this.el.nativeElement);\n this.destroyRef.onDestroy(() => this.dialogRef._setBodyElement(null));\n effect((onCleanup) => {\n const panel = this.dialogRef.panelEl();\n if (!panel || typeof ResizeObserver === 'undefined') {\n return;\n }\n const recompute = (): void => this.recomputeHeight(panel);\n\n const observer = new ResizeObserver(recompute);\n observer.observe(panel);\n recompute();\n onCleanup(() => observer.disconnect());\n });\n }\n\n private recomputeHeight(panel: HTMLElement): void {\n const headerHeight = this.dialogRef.headerEl()?.offsetHeight ?? 0;\n const footerHeight = this.dialogRef.footerEl()?.offsetHeight ?? 0;\n const panelHeight = Math.min(panel.clientHeight, window.innerHeight);\n const available = panelHeight - headerHeight - footerHeight;\n console.log('available', available);\n if (available > 0) {\n this.renderer.setStyle(this.el.nativeElement, 'max-height', `${available}px`);\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { NgxDialogBody } from './directives/body.directive';\nimport { NgxDialogFooter } from './directives/footer.directive';\nimport { NgxDialogHeader } from './directives/header.directive';\nimport { NgxDialogComponent } from './components/ngx-dialog.component';\n\n@NgModule({\n declarations: [],\n imports: [NgxDialogComponent, NgxDialogHeader, NgxDialogFooter, NgxDialogBody],\n exports: [NgxDialogComponent, NgxDialogHeader, NgxDialogFooter, NgxDialogBody],\n})\nexport class NgxDialogModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAIA,IAAI,QAAQ,GAAG,CAAC;AAChB,SAAS,YAAY,GAAA;IACnB,QAAQ,IAAI,CAAC;AACb,IAAA,OAAO,CAAA,WAAA,EAAc,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA,CAAA,EAAI,QAAQ,EAAE;AAC5D;MAEa,YAAY,CAAA;IACd,EAAE,GAAG,YAAY,EAAE;;IAGnB,OAAO,GAAG,MAAM,CAAC,KAAK;gFAAC;;IAEvB,MAAM,GAAG,MAAM,CAAC,KAAK;+EAAC;AAEd,IAAA,YAAY,GAAG,IAAI,OAAO,EAAiB;;AAEnD,IAAA,WAAW,GAA8B,IAAI,CAAC,YAAY,CAA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 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, EventEmitter, Injectable, InjectionToken, Directive, inject, Output, Input, model, input, output, HostListener } from '@angular/core';
|
|
2
|
+
import { signal, EventEmitter, Injectable, InjectionToken, Directive, inject, Output, Input, model, input, output, effect, HostListener } from '@angular/core';
|
|
3
3
|
import { DOCUMENT } from '@angular/common';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -124,6 +124,7 @@ class DragRef {
|
|
|
124
124
|
previousZIndex = '';
|
|
125
125
|
moveDx = 0;
|
|
126
126
|
moveDy = 0;
|
|
127
|
+
scrollCompensation = { x: 0, y: 0 };
|
|
127
128
|
preview;
|
|
128
129
|
previewOffsetX = 0;
|
|
129
130
|
previewOffsetY = 0;
|
|
@@ -155,6 +156,7 @@ class DragRef {
|
|
|
155
156
|
this.lastPointer = { ...pointer };
|
|
156
157
|
this.moveDx = 0;
|
|
157
158
|
this.moveDy = 0;
|
|
159
|
+
this.scrollCompensation = { x: 0, y: 0 };
|
|
158
160
|
this.originDropList = this.dropList;
|
|
159
161
|
this.originIndex = this.dropList?.getItemIndex(this) ?? -1;
|
|
160
162
|
this.previousTransform = getComputedStyle(this.el).getPropertyValue('transform');
|
|
@@ -261,6 +263,7 @@ class DragRef {
|
|
|
261
263
|
this.el.style.transform = this.previousTransform;
|
|
262
264
|
this.el.style.visibility = this.sourceVisibility;
|
|
263
265
|
this.el.style.pointerEvents = this.sourcePointerEvents;
|
|
266
|
+
this.scrollCompensation = { x: 0, y: 0 };
|
|
264
267
|
this.endDrag();
|
|
265
268
|
}
|
|
266
269
|
get x() {
|
|
@@ -278,11 +281,32 @@ class DragRef {
|
|
|
278
281
|
getPlaceholderElement() {
|
|
279
282
|
return this.placeholder?.element;
|
|
280
283
|
}
|
|
284
|
+
/**
|
|
285
|
+
* صدا زده میشود هر بار که container یا window در حین درگ اسکرول شود
|
|
286
|
+
* (چه توسط auto-scroll خودمان، چه با wheel/اسکرولبار دستی کاربر).
|
|
287
|
+
* transform را فوراً تصحیح میکند تا عنصر زیر پوینتر بماند.
|
|
288
|
+
*/
|
|
289
|
+
notifyScroll(dx, dy) {
|
|
290
|
+
if (!this.isDragging())
|
|
291
|
+
return;
|
|
292
|
+
this.scrollCompensation = {
|
|
293
|
+
x: this.scrollCompensation.x + dx,
|
|
294
|
+
y: this.scrollCompensation.y + dy,
|
|
295
|
+
};
|
|
296
|
+
if (this.dropList) {
|
|
297
|
+
this.updatePreview();
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
this.applyTransform();
|
|
301
|
+
}
|
|
302
|
+
}
|
|
281
303
|
applyTransform() {
|
|
282
304
|
const base = this.previousTransform && this.previousTransform !== 'none'
|
|
283
305
|
? this.previousTransform + ' '
|
|
284
306
|
: '';
|
|
285
|
-
|
|
307
|
+
const tx = this.moveDx + this.scrollCompensation.x;
|
|
308
|
+
const ty = this.moveDy + this.scrollCompensation.y;
|
|
309
|
+
this.el.style.transform = `${base}translate3d(${tx}px, ${ty}px, 0)`;
|
|
286
310
|
}
|
|
287
311
|
updatePreview() {
|
|
288
312
|
if (!this.preview)
|
|
@@ -397,9 +421,7 @@ class PositionalSortStrategy {
|
|
|
397
421
|
for (const node of Array.from(this.container.children)) {
|
|
398
422
|
if (node === placeholder)
|
|
399
423
|
return position;
|
|
400
|
-
if (node instanceof HTMLElement &&
|
|
401
|
-
itemElements.has(node) &&
|
|
402
|
-
node !== this.dragging?.el) {
|
|
424
|
+
if (node instanceof HTMLElement && itemElements.has(node) && node !== this.dragging?.el) {
|
|
403
425
|
position++;
|
|
404
426
|
}
|
|
405
427
|
}
|
|
@@ -519,8 +541,7 @@ class PositionalSortStrategy {
|
|
|
519
541
|
}
|
|
520
542
|
}
|
|
521
543
|
const target = best.rect;
|
|
522
|
-
const sameRow = y >= target.top - target.height * 0.35 &&
|
|
523
|
-
y <= target.bottom + target.height * 0.35;
|
|
544
|
+
const sameRow = y >= target.top - target.height * 0.35 && y <= target.bottom + target.height * 0.35;
|
|
524
545
|
const before = sameRow
|
|
525
546
|
? this.rtl
|
|
526
547
|
? x > target.left + target.width / 2
|
|
@@ -790,27 +811,22 @@ class DragDropService {
|
|
|
790
811
|
this.activeDrag.set(null);
|
|
791
812
|
}
|
|
792
813
|
findDropList(point, current) {
|
|
793
|
-
const candidates = this.dropLists()
|
|
794
|
-
.filter((list) => {
|
|
814
|
+
const candidates = this.dropLists().filter((list) => {
|
|
795
815
|
const r = list.el?.getBoundingClientRect();
|
|
796
|
-
return (!!r &&
|
|
797
|
-
point.x >= r.left &&
|
|
798
|
-
point.x <= r.right &&
|
|
799
|
-
point.y >= r.top &&
|
|
800
|
-
point.y <= r.bottom);
|
|
816
|
+
return (!!r && point.x >= r.left && point.x <= r.right && point.y >= r.top && point.y <= r.bottom);
|
|
801
817
|
});
|
|
802
818
|
// Staying over the current list should always win.
|
|
803
819
|
if (current && candidates.includes(current))
|
|
804
820
|
return current;
|
|
805
821
|
// Never jump into an unrelated list just because it overlaps the pointer.
|
|
806
822
|
// Prefer the smallest matching connected container (useful for nested lists).
|
|
807
|
-
return candidates
|
|
823
|
+
return (candidates
|
|
808
824
|
.filter((list) => !current || current.isConnectedTo(list))
|
|
809
825
|
.sort((a, b) => {
|
|
810
826
|
const ra = a.el.getBoundingClientRect();
|
|
811
827
|
const rb = b.el.getBoundingClientRect();
|
|
812
828
|
return ra.width * ra.height - rb.width * rb.height;
|
|
813
|
-
})[0] ?? null;
|
|
829
|
+
})[0] ?? null);
|
|
814
830
|
}
|
|
815
831
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: DragDropService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
816
832
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: DragDropService, providedIn: 'root' });
|
|
@@ -899,16 +915,22 @@ class AutoScroller {
|
|
|
899
915
|
raf = 0;
|
|
900
916
|
container = window;
|
|
901
917
|
speed = { x: 0, y: 0 };
|
|
918
|
+
onTick;
|
|
902
919
|
edge;
|
|
903
920
|
maxSpeed;
|
|
904
921
|
constructor(edge = 56, maxSpeed = 18) {
|
|
905
922
|
this.edge = edge;
|
|
906
923
|
this.maxSpeed = maxSpeed;
|
|
907
924
|
}
|
|
908
|
-
|
|
925
|
+
/** onTick اجرا میشود بعد از هر گام اسکرول، تا با آخرین موقعیت pointer، sort/placeholder بهروز شود. */
|
|
926
|
+
start(fromEl, onTick) {
|
|
927
|
+
this.container = findScrollableAncestor(fromEl);
|
|
928
|
+
this.onTick = onTick;
|
|
929
|
+
}
|
|
930
|
+
/** فقط container را عوض میکند بدون قطع حلقهی در حال اجرا یا صفر کردن speed. */
|
|
931
|
+
retarget(fromEl) {
|
|
909
932
|
this.container = findScrollableAncestor(fromEl);
|
|
910
933
|
}
|
|
911
|
-
/** Call on every pointermove with the current client coordinates. */
|
|
912
934
|
update(clientX, clientY) {
|
|
913
935
|
const rect = getScrollRect(this.container);
|
|
914
936
|
this.speed = {
|
|
@@ -924,6 +946,7 @@ class AutoScroller {
|
|
|
924
946
|
cancelAnimationFrame(this.raf);
|
|
925
947
|
this.raf = 0;
|
|
926
948
|
this.speed = { x: 0, y: 0 };
|
|
949
|
+
this.onTick = undefined;
|
|
927
950
|
}
|
|
928
951
|
tick = () => {
|
|
929
952
|
if (!this.speed.x && !this.speed.y) {
|
|
@@ -937,6 +960,9 @@ class AutoScroller {
|
|
|
937
960
|
this.container.scrollLeft += this.speed.x;
|
|
938
961
|
this.container.scrollTop += this.speed.y;
|
|
939
962
|
}
|
|
963
|
+
// pointer ثابت مونده ولی محتوای زیرش اسکرول شده — پس sort/placeholder را
|
|
964
|
+
// دوباره با آخرین موقعیت شناختهشده اجرا کن.
|
|
965
|
+
this.onTick?.();
|
|
940
966
|
this.raf = requestAnimationFrame(this.tick);
|
|
941
967
|
};
|
|
942
968
|
}
|
|
@@ -964,6 +990,12 @@ function findScrollableAncestor(el) {
|
|
|
964
990
|
}
|
|
965
991
|
return window;
|
|
966
992
|
}
|
|
993
|
+
function getScrollPosition(container) {
|
|
994
|
+
if (container instanceof Window) {
|
|
995
|
+
return { left: window.scrollX, top: window.scrollY };
|
|
996
|
+
}
|
|
997
|
+
return { left: container.scrollLeft, top: container.scrollTop };
|
|
998
|
+
}
|
|
967
999
|
|
|
968
1000
|
const NGX_DRAGGABLE = new InjectionToken('ngx-draggable');
|
|
969
1001
|
const DEFAULT_KEYBOARD_STEP = 8;
|
|
@@ -975,10 +1007,10 @@ class NgxDraggable {
|
|
|
975
1007
|
/** Element whose rect constrains the drag. Now actually enforced. */
|
|
976
1008
|
boundary = input(/* @ts-ignore */
|
|
977
1009
|
...(ngDevMode ? [undefined, { debugName: "boundary" }] : /* istanbul ignore next */ []));
|
|
978
|
-
dragRootElement =
|
|
1010
|
+
dragRootElement = model('', /* @ts-ignore */
|
|
979
1011
|
...(ngDevMode ? [{ debugName: "dragRootElement" }] : /* istanbul ignore next */ []));
|
|
980
1012
|
/** CSS selector for a drag handle. When set, only pointerdowns inside it start a drag. */
|
|
981
|
-
dragHandle =
|
|
1013
|
+
dragHandle = model('', /* @ts-ignore */
|
|
982
1014
|
...(ngDevMode ? [{ debugName: "dragHandle" }] : /* istanbul ignore next */ []));
|
|
983
1015
|
/** Restrict movement to a single axis. */
|
|
984
1016
|
lockAxis = input(/* @ts-ignore */
|
|
@@ -1009,14 +1041,25 @@ class NgxDraggable {
|
|
|
1009
1041
|
down = false;
|
|
1010
1042
|
start = { x: 0, y: 0 };
|
|
1011
1043
|
pointerId = -1;
|
|
1044
|
+
lastPointer = { x: 0, y: 0 };
|
|
1012
1045
|
removeDown;
|
|
1013
1046
|
removeMove;
|
|
1014
1047
|
removeUp;
|
|
1015
1048
|
removeKeydown;
|
|
1016
1049
|
removeEscape;
|
|
1050
|
+
scrollTarget = window;
|
|
1051
|
+
lastScroll = { left: 0, top: 0 };
|
|
1052
|
+
lastWindowScroll = { left: 0, top: 0 };
|
|
1053
|
+
removeContainerScroll;
|
|
1054
|
+
removeWindowScroll;
|
|
1017
1055
|
constructor(host, renderer) {
|
|
1018
1056
|
this.host = host;
|
|
1019
1057
|
this.renderer = renderer;
|
|
1058
|
+
effect(() => {
|
|
1059
|
+
this._ref.el = this.dragRootElement()
|
|
1060
|
+
? (this.host.nativeElement.closest(this.dragRootElement()) ?? this.host.nativeElement)
|
|
1061
|
+
: this.host.nativeElement;
|
|
1062
|
+
});
|
|
1020
1063
|
}
|
|
1021
1064
|
ngOnInit() {
|
|
1022
1065
|
this._ref.el = this.dragRootElement()
|
|
@@ -1061,21 +1104,7 @@ class NgxDraggable {
|
|
|
1061
1104
|
this.cancel();
|
|
1062
1105
|
});
|
|
1063
1106
|
}
|
|
1064
|
-
|
|
1065
|
-
if (!this.down || e.pointerId !== this.pointerId)
|
|
1066
|
-
return;
|
|
1067
|
-
const p = { x: e.clientX, y: e.clientY };
|
|
1068
|
-
if (!this.dragging() &&
|
|
1069
|
-
Math.hypot(p.x - this.start.x, p.y - this.start.y) < this.dragThreshold())
|
|
1070
|
-
return;
|
|
1071
|
-
if (!this.dragging()) {
|
|
1072
|
-
this._ref.startDrag(p);
|
|
1073
|
-
this.dragging.set(true);
|
|
1074
|
-
this.service.begin(this._ref);
|
|
1075
|
-
if (this.autoScroll())
|
|
1076
|
-
this.scroller.start(this._ref.el);
|
|
1077
|
-
this.dragStart.emit(p);
|
|
1078
|
-
}
|
|
1107
|
+
applyDragUpdate(p) {
|
|
1079
1108
|
this._ref.dragMove(p);
|
|
1080
1109
|
const target = this.service.findDropList(p, this._ref.dropList);
|
|
1081
1110
|
if (target !== this._ref.dropList) {
|
|
@@ -1084,21 +1113,69 @@ class NgxDraggable {
|
|
|
1084
1113
|
if (target) {
|
|
1085
1114
|
this._ref.withDropList(target);
|
|
1086
1115
|
target.createPlaceholder(this._ref);
|
|
1087
|
-
if (this.autoScroll())
|
|
1088
|
-
this.scroller.
|
|
1089
|
-
this.scroller.start(target.el);
|
|
1090
|
-
}
|
|
1116
|
+
if (this.autoScroll())
|
|
1117
|
+
this.scroller.retarget(target.el);
|
|
1091
1118
|
}
|
|
1092
1119
|
else if (this.autoScroll()) {
|
|
1093
1120
|
this.scroller.stop();
|
|
1094
1121
|
}
|
|
1095
1122
|
}
|
|
1096
|
-
// Sorting uses the pointer against the currently active list. Its geometry
|
|
1097
|
-
// is read live, so the placeholder and auto-scroll are both reflected.
|
|
1098
1123
|
this._ref.dropList?.sortItem(this._ref, p);
|
|
1124
|
+
this.dragMove.emit(p);
|
|
1125
|
+
}
|
|
1126
|
+
/** فراخوانی میشود دقیقاً وقتی drag واقعاً شروع میشود (چه با موس، چه با کیبورد). */
|
|
1127
|
+
startScrollTracking() {
|
|
1128
|
+
this.scrollTarget = findScrollableAncestor(this._ref.el);
|
|
1129
|
+
this.lastScroll = getScrollPosition(this.scrollTarget);
|
|
1130
|
+
this.lastWindowScroll = { left: window.scrollX, top: window.scrollY };
|
|
1131
|
+
if (this.scrollTarget !== window) {
|
|
1132
|
+
this.removeContainerScroll = this.renderer.listen(this.scrollTarget, 'scroll', () => this.handleContainerScroll());
|
|
1133
|
+
}
|
|
1134
|
+
// همیشه window رو هم جدا گوش میدیم؛ چون ممکنه container محلی نداشته باشیم
|
|
1135
|
+
// ولی خودِ صفحه اسکرول بشه.
|
|
1136
|
+
this.removeWindowScroll = this.renderer.listen('window', 'scroll', () => this.handleWindowScroll());
|
|
1137
|
+
}
|
|
1138
|
+
handleContainerScroll() {
|
|
1139
|
+
const pos = getScrollPosition(this.scrollTarget);
|
|
1140
|
+
const dx = pos.left - this.lastScroll.left;
|
|
1141
|
+
const dy = pos.top - this.lastScroll.top;
|
|
1142
|
+
this.lastScroll = pos;
|
|
1143
|
+
this._ref.notifyScroll(dx, dy);
|
|
1144
|
+
}
|
|
1145
|
+
handleWindowScroll() {
|
|
1146
|
+
const left = window.scrollX;
|
|
1147
|
+
const top = window.scrollY;
|
|
1148
|
+
const dx = left - this.lastWindowScroll.left;
|
|
1149
|
+
const dy = top - this.lastWindowScroll.top;
|
|
1150
|
+
this.lastWindowScroll = { left, top };
|
|
1151
|
+
this._ref.notifyScroll(dx, dy);
|
|
1152
|
+
}
|
|
1153
|
+
stopScrollTracking() {
|
|
1154
|
+
this.removeContainerScroll?.();
|
|
1155
|
+
this.removeWindowScroll?.();
|
|
1156
|
+
this.removeContainerScroll = this.removeWindowScroll = undefined;
|
|
1157
|
+
}
|
|
1158
|
+
pointerMove(e) {
|
|
1159
|
+
if (!this.down || e.pointerId !== this.pointerId)
|
|
1160
|
+
return;
|
|
1161
|
+
const p = { x: e.clientX, y: e.clientY };
|
|
1162
|
+
this.lastPointer = p;
|
|
1163
|
+
if (!this.dragging() &&
|
|
1164
|
+
Math.hypot(p.x - this.start.x, p.y - this.start.y) < this.dragThreshold())
|
|
1165
|
+
return;
|
|
1166
|
+
if (!this.dragging()) {
|
|
1167
|
+
this._ref.startDrag(p);
|
|
1168
|
+
this.dragging.set(true);
|
|
1169
|
+
this.service.begin(this._ref);
|
|
1170
|
+
this.startScrollTracking();
|
|
1171
|
+
if (this.autoScroll()) {
|
|
1172
|
+
this.scroller.start(this._ref.el, () => this.applyDragUpdate(this.lastPointer));
|
|
1173
|
+
}
|
|
1174
|
+
this.dragStart.emit(p);
|
|
1175
|
+
}
|
|
1176
|
+
this.applyDragUpdate(p);
|
|
1099
1177
|
if (this.autoScroll())
|
|
1100
1178
|
this.scroller.update(p.x, p.y);
|
|
1101
|
-
this.dragMove.emit(p);
|
|
1102
1179
|
}
|
|
1103
1180
|
pointerUp(e) {
|
|
1104
1181
|
if (!this.down || e.pointerId !== this.pointerId)
|
|
@@ -1121,6 +1198,7 @@ class NgxDraggable {
|
|
|
1121
1198
|
this.dragging.set(false);
|
|
1122
1199
|
this.down = false;
|
|
1123
1200
|
this.scroller.stop();
|
|
1201
|
+
this.stopScrollTracking();
|
|
1124
1202
|
this.removeMove?.();
|
|
1125
1203
|
this.removeUp?.();
|
|
1126
1204
|
this.removeEscape?.();
|
|
@@ -1147,6 +1225,7 @@ class NgxDraggable {
|
|
|
1147
1225
|
this._ref.startDrag({ x: 0, y: 0 });
|
|
1148
1226
|
this.dragging.set(true);
|
|
1149
1227
|
this.service.begin(this._ref);
|
|
1228
|
+
this.startScrollTracking();
|
|
1150
1229
|
this.dragStart.emit({ x: 0, y: 0 });
|
|
1151
1230
|
}
|
|
1152
1231
|
this._ref.nudge(delta.x, delta.y);
|
|
@@ -1159,6 +1238,7 @@ class NgxDraggable {
|
|
|
1159
1238
|
this.service.end(this._ref);
|
|
1160
1239
|
this.dragEnd.emit(this._ref.pointer);
|
|
1161
1240
|
this.dragging.set(false);
|
|
1241
|
+
this.stopScrollTracking();
|
|
1162
1242
|
}
|
|
1163
1243
|
else if (e.key === 'Escape' && this.dragging()) {
|
|
1164
1244
|
e.preventDefault();
|
|
@@ -1177,7 +1257,7 @@ class NgxDraggable {
|
|
|
1177
1257
|
!!target.closest('button,a,input,textarea,select,[data-no-drag]'));
|
|
1178
1258
|
}
|
|
1179
1259
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NgxDraggable, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1180
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.4", type: NgxDraggable, isStandalone: true, selector: "[NgxDraggable],[ngxDraggable]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, boundary: { classPropertyName: "boundary", publicName: "boundary", isSignal: true, isRequired: false, transformFunction: null }, dragRootElement: { classPropertyName: "dragRootElement", publicName: "dragRootElement", isSignal: true, isRequired: false, transformFunction: null }, dragHandle: { classPropertyName: "dragHandle", publicName: "dragHandle", isSignal: true, isRequired: false, transformFunction: null }, lockAxis: { classPropertyName: "lockAxis", publicName: "lockAxis", isSignal: true, isRequired: false, transformFunction: null }, dragThreshold: { classPropertyName: "dragThreshold", publicName: "dragThreshold", isSignal: true, isRequired: false, transformFunction: null }, keyboardStep: { classPropertyName: "keyboardStep", publicName: "keyboardStep", isSignal: true, isRequired: false, transformFunction: null }, autoScroll: { classPropertyName: "autoScroll", publicName: "autoScroll", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange", dragStart: "dragStart", dragMove: "dragMove", dragEnd: "dragEnd" }, host: { properties: { "style.touch-action": "\"none\"", "attr.tabindex": "disabled() ? null : 0", "attr.aria-grabbed": "dragging()" }, classAttribute: "ngx-draggable" }, providers: [{ provide: NGX_DRAGGABLE, useExisting: NgxDraggable }], ngImport: i0 });
|
|
1260
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.4", type: NgxDraggable, isStandalone: true, selector: "[NgxDraggable],[ngxDraggable]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, boundary: { classPropertyName: "boundary", publicName: "boundary", isSignal: true, isRequired: false, transformFunction: null }, dragRootElement: { classPropertyName: "dragRootElement", publicName: "dragRootElement", isSignal: true, isRequired: false, transformFunction: null }, dragHandle: { classPropertyName: "dragHandle", publicName: "dragHandle", isSignal: true, isRequired: false, transformFunction: null }, lockAxis: { classPropertyName: "lockAxis", publicName: "lockAxis", isSignal: true, isRequired: false, transformFunction: null }, dragThreshold: { classPropertyName: "dragThreshold", publicName: "dragThreshold", isSignal: true, isRequired: false, transformFunction: null }, keyboardStep: { classPropertyName: "keyboardStep", publicName: "keyboardStep", isSignal: true, isRequired: false, transformFunction: null }, autoScroll: { classPropertyName: "autoScroll", publicName: "autoScroll", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange", dragRootElement: "dragRootElementChange", dragHandle: "dragHandleChange", dragStart: "dragStart", dragMove: "dragMove", dragEnd: "dragEnd" }, host: { properties: { "style.touch-action": "\"none\"", "attr.tabindex": "disabled() ? null : 0", "attr.aria-grabbed": "dragging()", "class.disable-drag": "disabled()" }, classAttribute: "ngx-draggable" }, providers: [{ provide: NGX_DRAGGABLE, useExisting: NgxDraggable }], ngImport: i0 });
|
|
1181
1261
|
}
|
|
1182
1262
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NgxDraggable, decorators: [{
|
|
1183
1263
|
type: Directive,
|
|
@@ -1189,9 +1269,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImpor
|
|
|
1189
1269
|
'[attr.tabindex]': 'disabled() ? null : 0',
|
|
1190
1270
|
'[attr.aria-grabbed]': 'dragging()',
|
|
1191
1271
|
class: 'ngx-draggable',
|
|
1272
|
+
'[class.disable-drag]': 'disabled()',
|
|
1192
1273
|
},
|
|
1193
1274
|
}]
|
|
1194
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], boundary: [{ type: i0.Input, args: [{ isSignal: true, alias: "boundary", required: false }] }], dragRootElement: [{ type: i0.Input, args: [{ isSignal: true, alias: "dragRootElement", required: false }] }], dragHandle: [{ type: i0.Input, args: [{ isSignal: true, alias: "dragHandle", required: false }] }], lockAxis: [{ type: i0.Input, args: [{ isSignal: true, alias: "lockAxis", required: false }] }], dragThreshold: [{ type: i0.Input, args: [{ isSignal: true, alias: "dragThreshold", required: false }] }], keyboardStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "keyboardStep", required: false }] }], autoScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoScroll", required: false }] }], data: [{
|
|
1275
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], boundary: [{ type: i0.Input, args: [{ isSignal: true, alias: "boundary", required: false }] }], dragRootElement: [{ type: i0.Input, args: [{ isSignal: true, alias: "dragRootElement", required: false }] }, { type: i0.Output, args: ["dragRootElementChange"] }], dragHandle: [{ type: i0.Input, args: [{ isSignal: true, alias: "dragHandle", required: false }] }, { type: i0.Output, args: ["dragHandleChange"] }], lockAxis: [{ type: i0.Input, args: [{ isSignal: true, alias: "lockAxis", required: false }] }], dragThreshold: [{ type: i0.Input, args: [{ isSignal: true, alias: "dragThreshold", required: false }] }], keyboardStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "keyboardStep", required: false }] }], autoScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoScroll", required: false }] }], data: [{
|
|
1195
1276
|
type: Input,
|
|
1196
1277
|
args: ['data']
|
|
1197
1278
|
}], dragStart: [{ type: i0.Output, args: ["dragStart"] }], dragMove: [{ type: i0.Output, args: ["dragMove"] }], dragEnd: [{ type: i0.Output, args: ["dragEnd"] }] } });
|
|
@@ -1632,5 +1713,5 @@ function clamp(v, max) {
|
|
|
1632
1713
|
* Generated bundle index. Do not edit.
|
|
1633
1714
|
*/
|
|
1634
1715
|
|
|
1635
|
-
export { AutoScroller, DragDropService, DragRef, DropListGroupRef, DropListRef, NGX_DRAGGABLE, NGX_DROPLIST, NGX_DROPLIST_GROUP, NGX_PLACEHOLDER, NgxDraggable, NgxDropList, NgxDropListGroup, NgxPlaceholder, NgxResizable, PlaceHolderRef, adjustForZoom, checkBoundX, checkBoundY, clampResizeWithinBoundary, copyArrayItem, getPageZoom, isRtl, moveItemInArray, resolveLogicalDirection, transferArrayItem };
|
|
1716
|
+
export { AutoScroller, DragDropService, DragRef, DropListGroupRef, DropListRef, NGX_DRAGGABLE, NGX_DROPLIST, NGX_DROPLIST_GROUP, NGX_PLACEHOLDER, NgxDraggable, NgxDropList, NgxDropListGroup, NgxPlaceholder, NgxResizable, PlaceHolderRef, adjustForZoom, checkBoundX, checkBoundY, clampResizeWithinBoundary, copyArrayItem, findScrollableAncestor, getPageZoom, getScrollPosition, isRtl, moveItemInArray, resolveLogicalDirection, transferArrayItem };
|
|
1636
1717
|
//# sourceMappingURL=ngx-kit-drag-resize.mjs.map
|