@mintplayer/ng-bootstrap 22.19.0 → 22.20.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/_bootstrap.scss +10 -0
- package/fesm2022/mintplayer-ng-bootstrap-accordion.mjs +3 -0
- package/fesm2022/mintplayer-ng-bootstrap-accordion.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-alert.mjs +6 -3
- package/fesm2022/mintplayer-ng-bootstrap-alert.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-button-type.mjs +9 -11
- package/fesm2022/mintplayer-ng-bootstrap-button-type.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs +2 -4
- package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs +3 -1
- package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-charts-hierarchy.mjs +36 -56
- package/fesm2022/mintplayer-ng-bootstrap-charts-hierarchy.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-charts-sparkline.mjs +10 -18
- package/fesm2022/mintplayer-ng-bootstrap-charts-sparkline.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-charts-trend.mjs +13 -24
- package/fesm2022/mintplayer-ng-bootstrap-charts-trend.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-checkbox.mjs +6 -15
- package/fesm2022/mintplayer-ng-bootstrap-checkbox.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs +5 -7
- package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs +17 -6
- package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-context-menu.mjs +47 -50
- package/fesm2022/mintplayer-ng-bootstrap-context-menu.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-copy.mjs +8 -5
- package/fesm2022/mintplayer-ng-bootstrap-copy.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs +19 -55
- package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs +2 -4
- package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-datetime-picker.mjs +2 -4
- package/fesm2022/mintplayer-ng-bootstrap-datetime-picker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs +4 -2
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dropdown.mjs +21 -7
- package/fesm2022/mintplayer-ng-bootstrap-dropdown.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-enhanced-paste.mjs +19 -14
- package/fesm2022/mintplayer-ng-bootstrap-enhanced-paste.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-enum.mjs +15 -12
- package/fesm2022/mintplayer-ng-bootstrap-enum.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-file-manager.mjs +3 -3
- package/fesm2022/mintplayer-ng-bootstrap-file-manager.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-file-upload.mjs +16 -6
- package/fesm2022/mintplayer-ng-bootstrap-file-upload.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-modal.mjs +21 -4
- package/fesm2022/mintplayer-ng-bootstrap-modal.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-offcanvas.mjs +26 -10
- package/fesm2022/mintplayer-ng-bootstrap-offcanvas.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-otp-input.mjs +4 -1
- package/fesm2022/mintplayer-ng-bootstrap-otp-input.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs +2 -4
- package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-phone-input.mjs +8 -11
- package/fesm2022/mintplayer-ng-bootstrap-phone-input.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-priority-nav.mjs +73 -67
- package/fesm2022/mintplayer-ng-bootstrap-priority-nav.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-query-builder.mjs +4 -16
- package/fesm2022/mintplayer-ng-bootstrap-query-builder.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-radio.mjs +11 -22
- package/fesm2022/mintplayer-ng-bootstrap-radio.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-range.mjs +2 -4
- package/fesm2022/mintplayer-ng-bootstrap-range.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-resizable.mjs +188 -249
- package/fesm2022/mintplayer-ng-bootstrap-resizable.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs +64 -146
- package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-scrollspy.mjs +37 -30
- package/fesm2022/mintplayer-ng-bootstrap-scrollspy.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-select.mjs +9 -25
- package/fesm2022/mintplayer-ng-bootstrap-select.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs +2 -4
- package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs +3 -0
- package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs +6 -6
- package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-theming.mjs +150 -83
- package/fesm2022/mintplayer-ng-bootstrap-theming.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-tile-manager.mjs +3 -0
- package/fesm2022/mintplayer-ng-bootstrap-tile-manager.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-timeline.mjs +46 -44
- package/fesm2022/mintplayer-ng-bootstrap-timeline.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs +2 -4
- package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-tooltip.mjs +63 -89
- package/fesm2022/mintplayer-ng-bootstrap-tooltip.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-tree-select.mjs +6 -14
- package/fesm2022/mintplayer-ng-bootstrap-tree-select.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs +25 -56
- package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs +1 -0
- package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-user-agent.mjs +47 -58
- package/fesm2022/mintplayer-ng-bootstrap-user-agent.mjs.map +1 -1
- package/package.json +2 -2
- package/types/mintplayer-ng-bootstrap-alert.d.ts +3 -1
- package/types/mintplayer-ng-bootstrap-button-type.d.ts +6 -6
- package/types/mintplayer-ng-bootstrap-calendar.d.ts +1 -1
- package/types/mintplayer-ng-bootstrap-carousel.d.ts +0 -1
- package/types/mintplayer-ng-bootstrap-charts-hierarchy.d.ts +1 -1
- package/types/mintplayer-ng-bootstrap-charts-sparkline.d.ts +1 -1
- package/types/mintplayer-ng-bootstrap-charts-trend.d.ts +1 -1
- package/types/mintplayer-ng-bootstrap-color-picker.d.ts +9 -3
- package/types/mintplayer-ng-bootstrap-context-menu.d.ts +8 -10
- package/types/mintplayer-ng-bootstrap-copy.d.ts +3 -1
- package/types/mintplayer-ng-bootstrap-datatable.d.ts +3 -4
- package/types/mintplayer-ng-bootstrap-datepicker.d.ts +1 -1
- package/types/mintplayer-ng-bootstrap-datetime-picker.d.ts +1 -1
- package/types/mintplayer-ng-bootstrap-dropdown-menu.d.ts +3 -1
- package/types/mintplayer-ng-bootstrap-dropdown.d.ts +3 -0
- package/types/mintplayer-ng-bootstrap-enhanced-paste.d.ts +6 -1
- package/types/mintplayer-ng-bootstrap-enum.d.ts +17 -4
- package/types/mintplayer-ng-bootstrap-file-manager.d.ts +2 -3
- package/types/mintplayer-ng-bootstrap-file-upload.d.ts +7 -1
- package/types/mintplayer-ng-bootstrap-modal.d.ts +9 -1
- package/types/mintplayer-ng-bootstrap-offcanvas.d.ts +10 -1
- package/types/mintplayer-ng-bootstrap-otp-input.d.ts +1 -1
- package/types/mintplayer-ng-bootstrap-pagination.d.ts +1 -1
- package/types/mintplayer-ng-bootstrap-priority-nav.d.ts +1 -1
- package/types/mintplayer-ng-bootstrap-query-builder.d.ts +2 -3
- package/types/mintplayer-ng-bootstrap-resizable.d.ts +65 -31
- package/types/mintplayer-ng-bootstrap-scheduler.d.ts +27 -21
- package/types/mintplayer-ng-bootstrap-scrollspy.d.ts +18 -2
- package/types/mintplayer-ng-bootstrap-select.d.ts +1 -1
- package/types/mintplayer-ng-bootstrap-tab-control.d.ts +2 -2
- package/types/mintplayer-ng-bootstrap-theming.d.ts +86 -54
- package/types/mintplayer-ng-bootstrap-timeline.d.ts +27 -5
- package/types/mintplayer-ng-bootstrap-timepicker.d.ts +1 -1
- package/types/mintplayer-ng-bootstrap-tooltip.d.ts +18 -17
- package/types/mintplayer-ng-bootstrap-tree-select.d.ts +3 -4
- package/types/mintplayer-ng-bootstrap-treeview.d.ts +4 -4
- package/types/mintplayer-ng-bootstrap-user-agent.d.ts +13 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-bootstrap-file-manager.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/file-manager/src/file-manager/file-manager.component.ts","../../../../libs/mintplayer-ng-bootstrap/file-manager/src/file-manager/file-manager.component.html","../../../../libs/mintplayer-ng-bootstrap/file-manager/mintplayer-ng-bootstrap-file-manager.ts"],"sourcesContent":["import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n CUSTOM_ELEMENTS_SCHEMA,\n effect,\n ElementRef,\n input,\n model,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport type {\n ConflictResolver,\n DialogResolver,\n FileManagerMessages,\n FileSystemNode,\n FileManagerSelectionMode,\n FileManagerViewMode,\n MpFileManager,\n NavigateEventDetail,\n NodeOpenEventDetail,\n OperationEventDetail,\n OperationFlags,\n OperationKind,\n SelectionChangeEventDetail,\n UploadEntry,\n UploadRequestEventDetail,\n} from '@mintplayer/web-components/file-manager';\n\n// Side-effect import: registers <mp-file-manager> and all the nested WCs.\nimport '@mintplayer/web-components/file-manager';\nimport { BsForwardAriaDirective } from '@mintplayer/ng-bootstrap/a11y';\n\nexport type FileManagerIconResolver = (\n iconKey: string,\n node?: FileSystemNode,\n) => string | undefined;\n\nexport interface ChildrenLoadedEventDetail {\n parentId: string;\n children: FileSystemNode[];\n}\n\n@Component({\n selector: 'bs-file-manager',\n templateUrl: './file-manager.component.html',\n imports: [BsForwardAriaDirective],\n styleUrls: ['./file-manager.component.scss'],\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BsFileManagerComponent implements AfterViewInit {\n /** All file-system nodes. Consumer mutates this in response to operation events. */\n readonly nodes = input<FileSystemNode[]>([]);\n\n /** Restrict the tree to descendants of this folder. `null` = show everything. */\n readonly rootFolderId = input<string | null>(null);\n\n /** Two-way bound: the folder the user has navigated into. */\n readonly currentFolderId = model<string | null>(null);\n\n /** Show the drag-drop upload overlay on the right pane. */\n readonly allowUpload = input<boolean>(false);\n\n /** Enable / disable individual operations. `true` enables all. */\n readonly allowOperations = input<boolean | OperationFlags>(true);\n\n /** Two-way bound list / icons view toggle. */\n readonly viewMode = model<FileManagerViewMode>('list');\n\n /** Selection mode (none / single / multiple). */\n readonly selectionMode = input<FileManagerSelectionMode>('multiple');\n\n /** Search input placeholder; falls back to the localised default. */\n readonly searchPlaceholder = input<string>('');\n\n /** Resolve a node's icon key to an SVG string. */\n readonly iconResolver = input<FileManagerIconResolver | undefined>(undefined);\n\n /**\n * Lazy-loaded tree: when set, every folder is treated as potentially\n * expandable. The first expansion of each folder invokes this callback;\n * the returned `FileSystemNode[]` is merged into `nodes` automatically.\n */\n readonly loadChildren = input<((parentId: string) => Promise<FileSystemNode[]>) | undefined>(undefined);\n\n /**\n * Replaces `window.confirm` / `window.prompt` with consumer-provided\n * dialogs (typically a `bs-modal`). When unset, the WC falls back to\n * the native browser dialogs.\n */\n readonly dialogResolver = input<DialogResolver | undefined>(undefined);\n\n /**\n * Invoked when paste / upload would overwrite an existing entry. When\n * unset, the WC silently replaces (preserving v1 behaviour).\n */\n readonly conflictResolver = input<ConflictResolver | undefined>(undefined);\n\n /** Partial override of the visible-string set (i18n). */\n readonly messages = input<Partial<FileManagerMessages> | undefined>(undefined);\n\n /** Two-way bound array of selected node IDs. */\n readonly selectedIds = model<string[]>([]);\n\n // Outputs\n readonly navigate = output<NavigateEventDetail>();\n readonly nodeOpen = output<NodeOpenEventDetail>();\n readonly selectionChange = output<SelectionChangeEventDetail>();\n readonly uploadRequest = output<UploadRequestEventDetail>();\n readonly operation = output<OperationEventDetail>();\n readonly errorReported = output<{ kind: string; message: string; nodeId?: string }>();\n readonly childrenLoaded = output<ChildrenLoadedEventDetail>();\n\n readonly fileManagerRef = viewChild<ElementRef<MpFileManager>>('fileManager');\n\n /**\n * Read-only snapshot of in-flight uploads. Updated by the WC; consumers\n * read it for progress UIs. Use `reportUploadProgress(id, pct, status?, error?)`\n * to push progress from the upload-pipeline callback.\n */\n readonly uploads = signal<ReadonlyArray<UploadEntry>>([]);\n\n /** Node IDs currently marked pending by `markPending`. */\n readonly pendingOpIds = signal<ReadonlySet<string>>(new Set());\n\n /** Convenience: number of pending operations. */\n readonly pendingCount = computed(() => this.pendingOpIds().size);\n\n constructor() {\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.nodes = this.nodes();\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.rootFolderId = this.rootFolderId();\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.currentFolderId = this.currentFolderId();\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.allowUpload = this.allowUpload();\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.allowOperations = this.allowOperations();\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.viewMode = this.viewMode();\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.selectionMode = this.selectionMode();\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n const placeholder = this.searchPlaceholder();\n if (placeholder) el.searchPlaceholder = placeholder;\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.iconResolver = this.iconResolver();\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.loadChildren = this.loadChildren();\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.dialogResolver = this.dialogResolver();\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.conflictResolver = this.conflictResolver();\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.messages = this.messages();\n });\n }\n\n ngAfterViewInit(): void {\n // Effects re-run after view init; nothing else required.\n }\n\n /** Mark a node as having an operation in flight (rows render busy). */\n markPending(nodeId: string, op: OperationKind): void {\n const el = this.fileManagerRef()?.nativeElement;\n el?.markPending(nodeId, op);\n if (el) this.pendingOpIds.set(el.pendingOpIds);\n }\n\n /** Clear the pending state on a node. */\n clearPending(nodeId: string): void {\n const el = this.fileManagerRef()?.nativeElement;\n el?.clearPending(nodeId);\n if (el) this.pendingOpIds.set(el.pendingOpIds);\n }\n\n /** Push progress for an in-flight upload (called from the upload pipeline). */\n reportUploadProgress(\n uploadId: string,\n progress: number,\n status?: UploadEntry['status'],\n error?: string,\n ): void {\n const el = this.fileManagerRef()?.nativeElement;\n el?.reportUploadProgress(uploadId, progress, status, error);\n if (el) this.uploads.set(el.uploads);\n }\n\n /** Remove a finished/aborted upload from the tracking list. */\n clearUpload(uploadId: string): void {\n const el = this.fileManagerRef()?.nativeElement;\n el?.clearUpload(uploadId);\n if (el) this.uploads.set(el.uploads);\n }\n\n /** Re-fire `(error)` from anywhere in the consumer's code. */\n reportError(message: string, nodeId?: string): void {\n this.fileManagerRef()?.nativeElement.reportError(message, nodeId);\n }\n\n onNavigate(event: Event): void {\n const detail = (event as CustomEvent<NavigateEventDetail>).detail;\n this.currentFolderId.set(detail.folderId);\n this.navigate.emit(detail);\n }\n\n onNodeOpen(event: Event): void {\n this.nodeOpen.emit((event as CustomEvent<NodeOpenEventDetail>).detail);\n }\n\n onSelectionChange(event: Event): void {\n const detail = (event as CustomEvent<SelectionChangeEventDetail>).detail;\n this.selectedIds.set([...detail.selectedIds]);\n this.selectionChange.emit(detail);\n }\n\n onUploadRequest(event: Event): void {\n const detail = (event as CustomEvent<UploadRequestEventDetail>).detail;\n // Sync the wrapper's uploads signal to the WC's freshly-registered batch.\n const el = this.fileManagerRef()?.nativeElement;\n if (el) this.uploads.set(el.uploads);\n this.uploadRequest.emit(detail);\n }\n\n onOperation(event: Event): void {\n this.operation.emit((event as CustomEvent<OperationEventDetail>).detail);\n }\n\n onErrorReported(event: Event): void {\n this.errorReported.emit((event as CustomEvent<{ kind: string; message: string; nodeId?: string }>).detail);\n }\n\n onChildrenLoaded(event: Event): void {\n this.childrenLoaded.emit((event as CustomEvent<ChildrenLoadedEventDetail>).detail);\n }\n}\n","<mp-file-manager bsForwardAria\n #fileManager\n class=\"bs-file-manager\"\n (mp-navigate)=\"onNavigate($event)\"\n (mp-node-open)=\"onNodeOpen($event)\"\n (mp-selection-change)=\"onSelectionChange($event)\"\n (mp-upload-request)=\"onUploadRequest($event)\"\n (mp-operation)=\"onOperation($event)\"\n (mp-error)=\"onErrorReported($event)\"\n (mp-children-loaded)=\"onChildrenLoaded($event)\"\n></mp-file-manager>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAsDa,sBAAsB,CAAA;AA8EjC,IAAA,WAAA,GAAA;;QA5ES,IAAA,CAAA,KAAK,GAAG,KAAK,CAAmB,EAAE;kFAAC;;QAGnC,IAAA,CAAA,YAAY,GAAG,KAAK,CAAgB,IAAI;yFAAC;;QAGzC,IAAA,CAAA,eAAe,GAAG,KAAK,CAAgB,IAAI;4FAAC;;QAG5C,IAAA,CAAA,WAAW,GAAG,KAAK,CAAU,KAAK;wFAAC;;QAGnC,IAAA,CAAA,eAAe,GAAG,KAAK,CAA2B,IAAI;4FAAC;;QAGvD,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAsB,MAAM;qFAAC;;QAG7C,IAAA,CAAA,aAAa,GAAG,KAAK,CAA2B,UAAU;0FAAC;;QAG3D,IAAA,CAAA,iBAAiB,GAAG,KAAK,CAAS,EAAE;8FAAC;;QAGrC,IAAA,CAAA,YAAY,GAAG,KAAK,CAAsC,SAAS;yFAAC;AAE7E;;;;AAIG;QACM,IAAA,CAAA,YAAY,GAAG,KAAK,CAAgE,SAAS;yFAAC;AAEvG;;;;AAIG;QACM,IAAA,CAAA,cAAc,GAAG,KAAK,CAA6B,SAAS;2FAAC;AAEtE;;;AAGG;QACM,IAAA,CAAA,gBAAgB,GAAG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,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECtDnC,waAWA,EAAA,MAAA,EAAA,CAAA,0IAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDsCY,sBAAsB,EAAA,QAAA,EAAA,iBAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAKrB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBARlC,SAAS;+BACE,iBAAiB,EAAA,OAAA,EAElB,CAAC,sBAAsB,CAAC,EAAA,OAAA,EAExB,CAAC,sBAAsB,CAAC,EAAA,eAAA,EAChB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,waAAA,EAAA,MAAA,EAAA,CAAA,0IAAA,CAAA,EAAA;klEAiEgB,aAAa,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AErH9E;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-bootstrap-file-manager.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/file-manager/src/file-manager/file-manager.component.ts","../../../../libs/mintplayer-ng-bootstrap/file-manager/src/file-manager/file-manager.component.html","../../../../libs/mintplayer-ng-bootstrap/file-manager/mintplayer-ng-bootstrap-file-manager.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n CUSTOM_ELEMENTS_SCHEMA,\n effect,\n ElementRef,\n input,\n model,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport type {\n ConflictResolver,\n DialogResolver,\n FileManagerMessages,\n FileSystemNode,\n FileManagerSelectionMode,\n FileManagerViewMode,\n MpFileManager,\n NavigateEventDetail,\n NodeOpenEventDetail,\n OperationEventDetail,\n OperationFlags,\n OperationKind,\n SelectionChangeEventDetail,\n UploadEntry,\n UploadRequestEventDetail,\n} from '@mintplayer/web-components/file-manager';\n\n// Side-effect import: registers <mp-file-manager> and all the nested WCs.\nimport '@mintplayer/web-components/file-manager';\nimport { BsForwardAriaDirective } from '@mintplayer/ng-bootstrap/a11y';\n\nexport type FileManagerIconResolver = (\n iconKey: string,\n node?: FileSystemNode,\n) => string | undefined;\n\nexport interface ChildrenLoadedEventDetail {\n parentId: string;\n children: FileSystemNode[];\n}\n\n@Component({\n selector: 'bs-file-manager',\n templateUrl: './file-manager.component.html',\n imports: [BsForwardAriaDirective],\n styleUrls: ['./file-manager.component.scss'],\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BsFileManagerComponent {\n /** All file-system nodes. Consumer mutates this in response to operation events. */\n readonly nodes = input<FileSystemNode[]>([]);\n\n /** Restrict the tree to descendants of this folder. `null` = show everything. */\n readonly rootFolderId = input<string | null>(null);\n\n /** Two-way bound: the folder the user has navigated into. */\n readonly currentFolderId = model<string | null>(null);\n\n /** Show the drag-drop upload overlay on the right pane. */\n readonly allowUpload = input<boolean>(false);\n\n /** Enable / disable individual operations. `true` enables all. */\n readonly allowOperations = input<boolean | OperationFlags>(true);\n\n /** Two-way bound list / icons view toggle. */\n readonly viewMode = model<FileManagerViewMode>('list');\n\n /** Selection mode (none / single / multiple). */\n readonly selectionMode = input<FileManagerSelectionMode>('multiple');\n\n /** Search input placeholder; falls back to the localised default. */\n readonly searchPlaceholder = input<string>('');\n\n /** Resolve a node's icon key to an SVG string. */\n readonly iconResolver = input<FileManagerIconResolver | undefined>(undefined);\n\n /**\n * Lazy-loaded tree: when set, every folder is treated as potentially\n * expandable. The first expansion of each folder invokes this callback;\n * the returned `FileSystemNode[]` is merged into `nodes` automatically.\n */\n readonly loadChildren = input<((parentId: string) => Promise<FileSystemNode[]>) | undefined>(undefined);\n\n /**\n * Replaces `window.confirm` / `window.prompt` with consumer-provided\n * dialogs (typically a `bs-modal`). When unset, the WC falls back to\n * the native browser dialogs.\n */\n readonly dialogResolver = input<DialogResolver | undefined>(undefined);\n\n /**\n * Invoked when paste / upload would overwrite an existing entry. When\n * unset, the WC silently replaces (preserving v1 behaviour).\n */\n readonly conflictResolver = input<ConflictResolver | undefined>(undefined);\n\n /** Partial override of the visible-string set (i18n). */\n readonly messages = input<Partial<FileManagerMessages> | undefined>(undefined);\n\n /** Two-way bound array of selected node IDs. */\n readonly selectedIds = model<string[]>([]);\n\n // Outputs\n readonly navigate = output<NavigateEventDetail>();\n readonly nodeOpen = output<NodeOpenEventDetail>();\n readonly selectionChange = output<SelectionChangeEventDetail>();\n readonly uploadRequest = output<UploadRequestEventDetail>();\n readonly operation = output<OperationEventDetail>();\n readonly errorReported = output<{ kind: string; message: string; nodeId?: string }>();\n readonly childrenLoaded = output<ChildrenLoadedEventDetail>();\n\n // Deliberately NOT viewChild.required: public methods read it, and a caller that reaches\n // this component through DI (a child's constructor, say) can call one before this\n // component's view exists. There, NG0951 would throw where the guard is a no-op.\n readonly fileManagerRef = viewChild<ElementRef<MpFileManager>>('fileManager');\n\n /**\n * Read-only snapshot of in-flight uploads. Updated by the WC; consumers\n * read it for progress UIs. Use `reportUploadProgress(id, pct, status?, error?)`\n * to push progress from the upload-pipeline callback.\n */\n readonly uploads = signal<ReadonlyArray<UploadEntry>>([]);\n\n /** Node IDs currently marked pending by `markPending`. */\n readonly pendingOpIds = signal<ReadonlySet<string>>(new Set());\n\n /** Convenience: number of pending operations. */\n readonly pendingCount = computed(() => this.pendingOpIds().size);\n\n constructor() {\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.nodes = this.nodes();\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.rootFolderId = this.rootFolderId();\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.currentFolderId = this.currentFolderId();\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.allowUpload = this.allowUpload();\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.allowOperations = this.allowOperations();\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.viewMode = this.viewMode();\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.selectionMode = this.selectionMode();\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n const placeholder = this.searchPlaceholder();\n if (placeholder) el.searchPlaceholder = placeholder;\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.iconResolver = this.iconResolver();\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.loadChildren = this.loadChildren();\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.dialogResolver = this.dialogResolver();\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.conflictResolver = this.conflictResolver();\n });\n\n effect(() => {\n const el = this.fileManagerRef()?.nativeElement;\n if (!el) return;\n el.messages = this.messages();\n });\n }\n\n /** Mark a node as having an operation in flight (rows render busy). */\n markPending(nodeId: string, op: OperationKind): void {\n const el = this.fileManagerRef()?.nativeElement;\n el?.markPending(nodeId, op);\n if (el) this.pendingOpIds.set(el.pendingOpIds);\n }\n\n /** Clear the pending state on a node. */\n clearPending(nodeId: string): void {\n const el = this.fileManagerRef()?.nativeElement;\n el?.clearPending(nodeId);\n if (el) this.pendingOpIds.set(el.pendingOpIds);\n }\n\n /** Push progress for an in-flight upload (called from the upload pipeline). */\n reportUploadProgress(\n uploadId: string,\n progress: number,\n status?: UploadEntry['status'],\n error?: string,\n ): void {\n const el = this.fileManagerRef()?.nativeElement;\n el?.reportUploadProgress(uploadId, progress, status, error);\n if (el) this.uploads.set(el.uploads);\n }\n\n /** Remove a finished/aborted upload from the tracking list. */\n clearUpload(uploadId: string): void {\n const el = this.fileManagerRef()?.nativeElement;\n el?.clearUpload(uploadId);\n if (el) this.uploads.set(el.uploads);\n }\n\n /** Re-fire `(error)` from anywhere in the consumer's code. */\n reportError(message: string, nodeId?: string): void {\n this.fileManagerRef()?.nativeElement.reportError(message, nodeId);\n }\n\n onNavigate(event: Event): void {\n const detail = (event as CustomEvent<NavigateEventDetail>).detail;\n this.currentFolderId.set(detail.folderId);\n this.navigate.emit(detail);\n }\n\n onNodeOpen(event: Event): void {\n this.nodeOpen.emit((event as CustomEvent<NodeOpenEventDetail>).detail);\n }\n\n onSelectionChange(event: Event): void {\n const detail = (event as CustomEvent<SelectionChangeEventDetail>).detail;\n this.selectedIds.set([...detail.selectedIds]);\n this.selectionChange.emit(detail);\n }\n\n onUploadRequest(event: Event): void {\n const detail = (event as CustomEvent<UploadRequestEventDetail>).detail;\n // Sync the wrapper's uploads signal to the WC's freshly-registered batch.\n const el = this.fileManagerRef()?.nativeElement;\n if (el) this.uploads.set(el.uploads);\n this.uploadRequest.emit(detail);\n }\n\n onOperation(event: Event): void {\n this.operation.emit((event as CustomEvent<OperationEventDetail>).detail);\n }\n\n onErrorReported(event: Event): void {\n this.errorReported.emit((event as CustomEvent<{ kind: string; message: string; nodeId?: string }>).detail);\n }\n\n onChildrenLoaded(event: Event): void {\n this.childrenLoaded.emit((event as CustomEvent<ChildrenLoadedEventDetail>).detail);\n }\n}\n","<mp-file-manager bsForwardAria\n #fileManager\n class=\"bs-file-manager\"\n (mp-navigate)=\"onNavigate($event)\"\n (mp-node-open)=\"onNodeOpen($event)\"\n (mp-selection-change)=\"onSelectionChange($event)\"\n (mp-upload-request)=\"onUploadRequest($event)\"\n (mp-operation)=\"onOperation($event)\"\n (mp-error)=\"onErrorReported($event)\"\n (mp-children-loaded)=\"onChildrenLoaded($event)\"\n></mp-file-manager>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAqDa,sBAAsB,CA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,MAAM,EAAA,QAAA,EAAA,waAAA,EAAA,MAAA,EAAA,CAAA,0IAAA,CAAA,EAAA;klEAoEgB,aAAa,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEvH9E;;AAEG;;;;"}
|
|
@@ -15,7 +15,8 @@ class BsFormatBytesPipe {
|
|
|
15
15
|
const k = 1024;
|
|
16
16
|
const dm = decimals <= 0 ? 0 : decimals;
|
|
17
17
|
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
|
18
|
-
|
|
18
|
+
// Clamped: below 1 byte the log is negative, and past the last unit there is no name.
|
|
19
|
+
const i = Math.min(sizes.length - 1, Math.max(0, Math.floor(Math.log(value) / Math.log(k))));
|
|
19
20
|
return parseFloat((value / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
|
|
20
21
|
}
|
|
21
22
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsFormatBytesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
@@ -42,6 +43,15 @@ class BsFileUploadComponent {
|
|
|
42
43
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
43
44
|
this.inputAriaLabel = input('Choose files to upload', /* @ts-ignore */
|
|
44
45
|
...(ngDevMode ? [{ debugName: "inputAriaLabel" }] : /* istanbul ignore next */ []));
|
|
46
|
+
/** Live-region announcement after one file is added. Override to translate. */
|
|
47
|
+
this.fileAddedAnnouncement = input((fileName) => `Added ${fileName}`, /* @ts-ignore */
|
|
48
|
+
...(ngDevMode ? [{ debugName: "fileAddedAnnouncement" }] : /* istanbul ignore next */ []));
|
|
49
|
+
/** Live-region announcement after several files are added at once. Override to translate. */
|
|
50
|
+
this.filesAddedAnnouncement = input((count) => `Added ${count} files`, /* @ts-ignore */
|
|
51
|
+
...(ngDevMode ? [{ debugName: "filesAddedAnnouncement" }] : /* istanbul ignore next */ []));
|
|
52
|
+
/** Accessible name of the default template's progress bar. Override to translate. */
|
|
53
|
+
this.progressLabel = input((fileName) => `Upload progress for ${fileName}`, /* @ts-ignore */
|
|
54
|
+
...(ngDevMode ? [{ debugName: "progressLabel" }] : /* istanbul ignore next */ []));
|
|
45
55
|
this.colors = Color;
|
|
46
56
|
this.isDraggingFile = signal(false, /* @ts-ignore */
|
|
47
57
|
...(ngDevMode ? [{ debugName: "isDraggingFile" }] : /* istanbul ignore next */ []));
|
|
@@ -92,14 +102,14 @@ class BsFileUploadComponent {
|
|
|
92
102
|
this.files.update(f => [...f, ...newFiles]);
|
|
93
103
|
this.filesDropped.emit(newFiles);
|
|
94
104
|
if (newFiles.length === 1) {
|
|
95
|
-
this.announcer.announce(
|
|
105
|
+
this.announcer.announce(this.fileAddedAnnouncement()(newFiles[0].file.name));
|
|
96
106
|
}
|
|
97
107
|
else if (newFiles.length > 1) {
|
|
98
|
-
this.announcer.announce(
|
|
108
|
+
this.announcer.announce(this.filesAddedAnnouncement()(newFiles.length));
|
|
99
109
|
}
|
|
100
110
|
}
|
|
101
111
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsFileUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
102
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: BsFileUploadComponent, isStandalone: true, selector: "bs-file-upload", inputs: { dropFilesCaption: { classPropertyName: "dropFilesCaption", publicName: "dropFilesCaption", isSignal: true, isRequired: false, transformFunction: null }, browseFilesCaption: { classPropertyName: "browseFilesCaption", publicName: "browseFilesCaption", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, inputAriaLabel: { classPropertyName: "inputAriaLabel", publicName: "inputAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { files: "filesChange", filesDropped: "filesDropped" }, host: { listeners: { "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "drop": "onDrop($event)" } }, ngImport: i0, template: "<div class=\"dropzone border position-relative p-5\" role=\"region\" [attr.aria-label]=\"ariaLabel()\" [class.dragging]=\"isDraggingFile()\">\n <input type=\"file\" multiple #fileUpload (change)=\"onChange($event)\" [title]=\"placeholder()\" [placeholder]=\"placeholder()\" [attr.aria-label]=\"inputAriaLabel()\" class=\"position-absolute w-100 h-100\">\n <!-- <img src=\"/assets/ic-file-upload.svg\" [alt]=\"placeholder()\"> -->\n <span class=\"h3 d-block\" aria-hidden=\"true\">{{ dropFilesCaption() }}</span>\n <label class=\"btn btn-primary position-relative\" [bsFor]=\"fileUpload\">{{ browseFilesCaption() }}</label>\n</div>\n<bs-list-group class=\"files-list\">\n @for (upload of files(); track upload.index) {\n <bs-list-group-item>\n <ng-container *ngTemplateOutlet=\"fileTemplate() ?? defaultFileTemplate; context: { $implicit: upload }\"></ng-container>\n </bs-list-group-item>\n }\n</bs-list-group>\n\n<ng-template #defaultFileTemplate let-upload>\n <div class=\"d-flex flex-row mx-auto\">\n <div class=\"file-img\" aria-hidden=\"true\"></div>\n <div class=\"flex-grow-1 text-start px-2\">\n <span class=\"d-block text-truncate text-secondary\">{{ upload.file.name }}</span>\n <span class=\"d-block text-grey mb-0\">{{ upload.file.size | bsFormatBytes }}</span>\n <bs-progress [height]=\"4\">\n <bs-progress-bar [minimum]=\"0\" [maximum]=\"upload.file.size\" [value]=\"upload.progress\" [ariaLabel]=\"
|
|
112
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: BsFileUploadComponent, isStandalone: true, selector: "bs-file-upload", inputs: { dropFilesCaption: { classPropertyName: "dropFilesCaption", publicName: "dropFilesCaption", isSignal: true, isRequired: false, transformFunction: null }, browseFilesCaption: { classPropertyName: "browseFilesCaption", publicName: "browseFilesCaption", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, inputAriaLabel: { classPropertyName: "inputAriaLabel", publicName: "inputAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, fileAddedAnnouncement: { classPropertyName: "fileAddedAnnouncement", publicName: "fileAddedAnnouncement", isSignal: true, isRequired: false, transformFunction: null }, filesAddedAnnouncement: { classPropertyName: "filesAddedAnnouncement", publicName: "filesAddedAnnouncement", isSignal: true, isRequired: false, transformFunction: null }, progressLabel: { classPropertyName: "progressLabel", publicName: "progressLabel", isSignal: true, isRequired: false, transformFunction: null }, files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { files: "filesChange", filesDropped: "filesDropped" }, host: { listeners: { "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "drop": "onDrop($event)" } }, ngImport: i0, template: "<div class=\"dropzone border position-relative p-5\" role=\"region\" [attr.aria-label]=\"ariaLabel()\" [class.dragging]=\"isDraggingFile()\">\n <input type=\"file\" multiple #fileUpload (change)=\"onChange($event)\" [title]=\"placeholder()\" [placeholder]=\"placeholder()\" [attr.aria-label]=\"inputAriaLabel()\" class=\"position-absolute w-100 h-100\">\n <!-- <img src=\"/assets/ic-file-upload.svg\" [alt]=\"placeholder()\"> -->\n <span class=\"h3 d-block\" aria-hidden=\"true\">{{ dropFilesCaption() }}</span>\n <label class=\"btn btn-primary position-relative\" [bsFor]=\"fileUpload\">{{ browseFilesCaption() }}</label>\n</div>\n<bs-list-group class=\"files-list\">\n @for (upload of files(); track upload.index) {\n <bs-list-group-item>\n <ng-container *ngTemplateOutlet=\"fileTemplate() ?? defaultFileTemplate; context: { $implicit: upload }\"></ng-container>\n </bs-list-group-item>\n }\n</bs-list-group>\n\n<ng-template #defaultFileTemplate let-upload>\n <div class=\"d-flex flex-row mx-auto\">\n <div class=\"file-img\" aria-hidden=\"true\"></div>\n <div class=\"flex-grow-1 text-start px-2\">\n <span class=\"d-block text-truncate text-secondary\">{{ upload.file.name }}</span>\n <span class=\"d-block text-grey mb-0\">{{ upload.file.size | bsFormatBytes }}</span>\n <bs-progress [height]=\"4\">\n <bs-progress-bar [minimum]=\"0\" [maximum]=\"upload.file.size\" [value]=\"upload.progress\" [ariaLabel]=\"progressLabel()(upload.file.name)\"></bs-progress-bar>\n </bs-progress>\n </div>\n </div>\n</ng-template>\n", styles: [".dropzone{z-index:1}.dropzone.dragging{border:4px solid var(--bs-danger)!important;background:var(--bs-danger-bg-subtle);margin:-3px -3px -4px}.dropzone input{opacity:0;z-index:2;top:0;left:0}.dropzone .btn{z-index:5}.files-list{margin-top:-1px}.files-list .d-flex{max-width:400px}.text-grey{color:var(--bs-secondary-color)}.list-group span{margin:-5px auto}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: BsForDirective, selector: "label[bsFor]", inputs: ["bsFor"] }, { kind: "component", type: BsListGroupComponent, selector: "bs-list-group" }, { kind: "component", type: BsListGroupItemComponent, selector: "bs-list-group-item", inputs: ["active", "disabled"] }, { kind: "component", type: BsProgressComponent, selector: "bs-progress", inputs: ["height", "isIndeterminate", "ariaLabel"] }, { kind: "component", type: BsProgressBarComponent, selector: "bs-progress-bar", inputs: ["minimum", "maximum", "value", "color", "striped", "animated", "ariaLabel", "valueText"] }, { kind: "pipe", type: BsFormatBytesPipe, name: "bsFormatBytes" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
103
113
|
}
|
|
104
114
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsFileUploadComponent, decorators: [{
|
|
105
115
|
type: Component,
|
|
@@ -107,8 +117,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
107
117
|
'(dragover)': 'onDragOver($event)',
|
|
108
118
|
'(dragleave)': 'onDragLeave($event)',
|
|
109
119
|
'(drop)': 'onDrop($event)',
|
|
110
|
-
}, template: "<div class=\"dropzone border position-relative p-5\" role=\"region\" [attr.aria-label]=\"ariaLabel()\" [class.dragging]=\"isDraggingFile()\">\n <input type=\"file\" multiple #fileUpload (change)=\"onChange($event)\" [title]=\"placeholder()\" [placeholder]=\"placeholder()\" [attr.aria-label]=\"inputAriaLabel()\" class=\"position-absolute w-100 h-100\">\n <!-- <img src=\"/assets/ic-file-upload.svg\" [alt]=\"placeholder()\"> -->\n <span class=\"h3 d-block\" aria-hidden=\"true\">{{ dropFilesCaption() }}</span>\n <label class=\"btn btn-primary position-relative\" [bsFor]=\"fileUpload\">{{ browseFilesCaption() }}</label>\n</div>\n<bs-list-group class=\"files-list\">\n @for (upload of files(); track upload.index) {\n <bs-list-group-item>\n <ng-container *ngTemplateOutlet=\"fileTemplate() ?? defaultFileTemplate; context: { $implicit: upload }\"></ng-container>\n </bs-list-group-item>\n }\n</bs-list-group>\n\n<ng-template #defaultFileTemplate let-upload>\n <div class=\"d-flex flex-row mx-auto\">\n <div class=\"file-img\" aria-hidden=\"true\"></div>\n <div class=\"flex-grow-1 text-start px-2\">\n <span class=\"d-block text-truncate text-secondary\">{{ upload.file.name }}</span>\n <span class=\"d-block text-grey mb-0\">{{ upload.file.size | bsFormatBytes }}</span>\n <bs-progress [height]=\"4\">\n <bs-progress-bar [minimum]=\"0\" [maximum]=\"upload.file.size\" [value]=\"upload.progress\" [ariaLabel]=\"
|
|
111
|
-
}], propDecorators: { dropFilesCaption: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropFilesCaption", required: false }] }], browseFilesCaption: [{ type: i0.Input, args: [{ isSignal: true, alias: "browseFilesCaption", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], inputAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputAriaLabel", required: false }] }], files: [{ type: i0.Input, args: [{ isSignal: true, alias: "files", required: false }] }, { type: i0.Output, args: ["filesChange"] }], filesDropped: [{ type: i0.Output, args: ["filesDropped"] }] } });
|
|
120
|
+
}, template: "<div class=\"dropzone border position-relative p-5\" role=\"region\" [attr.aria-label]=\"ariaLabel()\" [class.dragging]=\"isDraggingFile()\">\n <input type=\"file\" multiple #fileUpload (change)=\"onChange($event)\" [title]=\"placeholder()\" [placeholder]=\"placeholder()\" [attr.aria-label]=\"inputAriaLabel()\" class=\"position-absolute w-100 h-100\">\n <!-- <img src=\"/assets/ic-file-upload.svg\" [alt]=\"placeholder()\"> -->\n <span class=\"h3 d-block\" aria-hidden=\"true\">{{ dropFilesCaption() }}</span>\n <label class=\"btn btn-primary position-relative\" [bsFor]=\"fileUpload\">{{ browseFilesCaption() }}</label>\n</div>\n<bs-list-group class=\"files-list\">\n @for (upload of files(); track upload.index) {\n <bs-list-group-item>\n <ng-container *ngTemplateOutlet=\"fileTemplate() ?? defaultFileTemplate; context: { $implicit: upload }\"></ng-container>\n </bs-list-group-item>\n }\n</bs-list-group>\n\n<ng-template #defaultFileTemplate let-upload>\n <div class=\"d-flex flex-row mx-auto\">\n <div class=\"file-img\" aria-hidden=\"true\"></div>\n <div class=\"flex-grow-1 text-start px-2\">\n <span class=\"d-block text-truncate text-secondary\">{{ upload.file.name }}</span>\n <span class=\"d-block text-grey mb-0\">{{ upload.file.size | bsFormatBytes }}</span>\n <bs-progress [height]=\"4\">\n <bs-progress-bar [minimum]=\"0\" [maximum]=\"upload.file.size\" [value]=\"upload.progress\" [ariaLabel]=\"progressLabel()(upload.file.name)\"></bs-progress-bar>\n </bs-progress>\n </div>\n </div>\n</ng-template>\n", styles: [".dropzone{z-index:1}.dropzone.dragging{border:4px solid var(--bs-danger)!important;background:var(--bs-danger-bg-subtle);margin:-3px -3px -4px}.dropzone input{opacity:0;z-index:2;top:0;left:0}.dropzone .btn{z-index:5}.files-list{margin-top:-1px}.files-list .d-flex{max-width:400px}.text-grey{color:var(--bs-secondary-color)}.list-group span{margin:-5px auto}\n"] }]
|
|
121
|
+
}], propDecorators: { dropFilesCaption: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropFilesCaption", required: false }] }], browseFilesCaption: [{ type: i0.Input, args: [{ isSignal: true, alias: "browseFilesCaption", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], inputAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputAriaLabel", required: false }] }], fileAddedAnnouncement: [{ type: i0.Input, args: [{ isSignal: true, alias: "fileAddedAnnouncement", required: false }] }], filesAddedAnnouncement: [{ type: i0.Input, args: [{ isSignal: true, alias: "filesAddedAnnouncement", required: false }] }], progressLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "progressLabel", required: false }] }], files: [{ type: i0.Input, args: [{ isSignal: true, alias: "files", required: false }] }, { type: i0.Output, args: ["filesChange"] }], filesDropped: [{ type: i0.Output, args: ["filesDropped"] }] } });
|
|
112
122
|
|
|
113
123
|
class BsFileUploadTemplateDirective {
|
|
114
124
|
constructor() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-bootstrap-file-upload.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/file-upload/src/pipes/format-bytes/format-bytes.pipe.ts","../../../../libs/mintplayer-ng-bootstrap/file-upload/src/component/file-upload.component.ts","../../../../libs/mintplayer-ng-bootstrap/file-upload/src/component/file-upload.component.html","../../../../libs/mintplayer-ng-bootstrap/file-upload/src/directive/file-upload-template.directive.ts","../../../../libs/mintplayer-ng-bootstrap/file-upload/mintplayer-ng-bootstrap-file-upload.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'bsFormatBytes',\n pure: true,\n})\nexport class BsFormatBytesPipe implements PipeTransform {\n\n transform(value: number, decimals = 2) {\n if (value === 0) {\n return \"0 Bytes\";\n }\n\n const k = 1024;\n const dm = decimals <= 0 ? 0 : decimals;\n const sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\"];\n const i = Math.floor(Math.log(value) / Math.log(k));\n\n return parseFloat((value / Math.pow(k, i)).toFixed(dm)) + \" \" + sizes[i];\n }\n\n}\n","import { Component, inject, input, model, output, signal, TemplateRef, ChangeDetectionStrategy } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { BsLiveAnnouncerService } from '@mintplayer/ng-bootstrap/a11y';\nimport { BsForDirective } from '@mintplayer/ng-bootstrap/for';\nimport { BsListGroupComponent } from '@mintplayer/ng-bootstrap/list-group';\nimport { BsListGroupItemComponent } from '@mintplayer/ng-bootstrap/list-group';\nimport { BsProgressComponent, BsProgressBarComponent } from '@mintplayer/ng-bootstrap/progress-bar';\nimport { Color } from '@mintplayer/ng-bootstrap';\nimport { FileUpload } from '../file-upload';\nimport { BsFormatBytesPipe } from '../pipes/format-bytes/format-bytes.pipe';\n\n@Component({\n selector: 'bs-file-upload',\n templateUrl: './file-upload.component.html',\n styleUrls: ['./file-upload.component.scss'],\n imports: [NgTemplateOutlet, BsForDirective, BsListGroupComponent, BsListGroupItemComponent, BsProgressComponent, BsProgressBarComponent, BsFormatBytesPipe],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(dragover)': 'onDragOver($event)',\n '(dragleave)': 'onDragLeave($event)',\n '(drop)': 'onDrop($event)',\n },\n})\nexport class BsFileUploadComponent {\n private announcer = inject(BsLiveAnnouncerService);\n\n readonly dropFilesCaption = input('Drop your files here');\n readonly browseFilesCaption = input('Browse for files');\n readonly placeholder = input('Drop files to upload');\n readonly ariaLabel = input<string>('File upload drop zone');\n readonly inputAriaLabel = input<string>('Choose files to upload');\n\n readonly colors = Color;\n isDraggingFile = signal(false);\n readonly fileTemplate = signal<TemplateRef<FileUpload> | undefined>(undefined);\n readonly files = model<FileUpload[]>([]);\n readonly filesDropped = output<FileUpload[]>();\n\n onChange(event: Event) {\n if (!event.target) return;\n if (!('files' in event.target)) return;\n if (!event.target['files']) return;\n\n const files = (<HTMLInputElement>event.target).files;\n if (!files) return;\n\n this.processDroppedFiles(files);\n }\n\n onDragOver(event: DragEvent) {\n event.preventDefault();\n event.stopPropagation();\n\n if (event.dataTransfer) {\n this.isDraggingFile.set(true);\n event.dataTransfer.effectAllowed = \"copy\";\n }\n }\n\n onDragLeave(event: DragEvent) {\n event.preventDefault();\n event.stopPropagation();\n this.isDraggingFile.set(false);\n }\n\n onDrop(event: DragEvent) {\n event.preventDefault();\n event.stopPropagation();\n this.isDraggingFile.set(false);\n if (event.dataTransfer && event.dataTransfer.files) {\n this.processDroppedFiles(event.dataTransfer.files);\n }\n }\n\n private processDroppedFiles(fileList: FileList) {\n const newFiles = [...Array(fileList.length).keys()]\n .map(i => fileList.item(i))\n .filter(f => !!f)\n .map((file, index) => <FileUpload>{ file, progress: 0, index: this.files().length + index });\n\n this.files.update(f => [...f, ...newFiles]);\n this.filesDropped.emit(newFiles);\n\n if (newFiles.length === 1) {\n this.announcer.announce(`Added ${newFiles[0].file.name}`);\n } else if (newFiles.length > 1) {\n this.announcer.announce(`Added ${newFiles.length} files`);\n }\n }\n}\n","<div class=\"dropzone border position-relative p-5\" role=\"region\" [attr.aria-label]=\"ariaLabel()\" [class.dragging]=\"isDraggingFile()\">\n <input type=\"file\" multiple #fileUpload (change)=\"onChange($event)\" [title]=\"placeholder()\" [placeholder]=\"placeholder()\" [attr.aria-label]=\"inputAriaLabel()\" class=\"position-absolute w-100 h-100\">\n <!-- <img src=\"/assets/ic-file-upload.svg\" [alt]=\"placeholder()\"> -->\n <span class=\"h3 d-block\" aria-hidden=\"true\">{{ dropFilesCaption() }}</span>\n <label class=\"btn btn-primary position-relative\" [bsFor]=\"fileUpload\">{{ browseFilesCaption() }}</label>\n</div>\n<bs-list-group class=\"files-list\">\n @for (upload of files(); track upload.index) {\n <bs-list-group-item>\n <ng-container *ngTemplateOutlet=\"fileTemplate() ?? defaultFileTemplate; context: { $implicit: upload }\"></ng-container>\n </bs-list-group-item>\n }\n</bs-list-group>\n\n<ng-template #defaultFileTemplate let-upload>\n <div class=\"d-flex flex-row mx-auto\">\n <div class=\"file-img\" aria-hidden=\"true\"></div>\n <div class=\"flex-grow-1 text-start px-2\">\n <span class=\"d-block text-truncate text-secondary\">{{ upload.file.name }}</span>\n <span class=\"d-block text-grey mb-0\">{{ upload.file.size | bsFormatBytes }}</span>\n <bs-progress [height]=\"4\">\n <bs-progress-bar [minimum]=\"0\" [maximum]=\"upload.file.size\" [value]=\"upload.progress\" [ariaLabel]=\"'Upload progress for ' + upload.file.name\"></bs-progress-bar>\n </bs-progress>\n </div>\n </div>\n</ng-template>\n","import { Directive, inject, input, TemplateRef } from '@angular/core';\nimport { BsFileUploadComponent } from '../component/file-upload.component';\nimport { FileUpload } from '../file-upload';\n\n@Directive({\n selector: '[bsFileUploadTemplate]',\n})\nexport class BsFileUploadTemplateDirective {\n private fileUploadComponent = inject(BsFileUploadComponent);\n\n constructor() {\n const templateRef = inject(TemplateRef);\n this.fileUploadComponent.fileTemplate.set(templateRef);\n }\n\n readonly bsFileUploadTemplateOf = input<FileUpload[] | undefined>(undefined);\n\n static ngTemplateContextGuard(dir: BsFileUploadTemplateDirective, ctx: any): ctx is BsFileUploadTemplateContext {\n return true;\n }\n\n}\n\nexport class BsFileUploadTemplateContext {\n $implicit: FileUpload = null!;\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings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xC,IAAA,WAAA,GAAA;QACE,IAAA,CAAA,SAAS,GAAe,IAAK;IAC/B;AAAC;;ACzBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-bootstrap-file-upload.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/file-upload/src/pipes/format-bytes/format-bytes.pipe.ts","../../../../libs/mintplayer-ng-bootstrap/file-upload/src/component/file-upload.component.ts","../../../../libs/mintplayer-ng-bootstrap/file-upload/src/component/file-upload.component.html","../../../../libs/mintplayer-ng-bootstrap/file-upload/src/directive/file-upload-template.directive.ts","../../../../libs/mintplayer-ng-bootstrap/file-upload/mintplayer-ng-bootstrap-file-upload.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'bsFormatBytes',\n pure: true,\n})\nexport class BsFormatBytesPipe implements PipeTransform {\n\n transform(value: number, decimals = 2) {\n if (value === 0) {\n return \"0 Bytes\";\n }\n\n const k = 1024;\n const dm = decimals <= 0 ? 0 : decimals;\n const sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\"];\n // Clamped: below 1 byte the log is negative, and past the last unit there is no name.\n const i = Math.min(sizes.length - 1, Math.max(0, Math.floor(Math.log(value) / Math.log(k))));\n\n return parseFloat((value / Math.pow(k, i)).toFixed(dm)) + \" \" + sizes[i];\n }\n\n}\n","import { Component, inject, input, model, output, signal, TemplateRef, ChangeDetectionStrategy } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { BsLiveAnnouncerService } from '@mintplayer/ng-bootstrap/a11y';\nimport { BsForDirective } from '@mintplayer/ng-bootstrap/for';\nimport { BsListGroupComponent } from '@mintplayer/ng-bootstrap/list-group';\nimport { BsListGroupItemComponent } from '@mintplayer/ng-bootstrap/list-group';\nimport { BsProgressComponent, BsProgressBarComponent } from '@mintplayer/ng-bootstrap/progress-bar';\nimport { Color } from '@mintplayer/ng-bootstrap';\nimport { FileUpload } from '../file-upload';\nimport { BsFormatBytesPipe } from '../pipes/format-bytes/format-bytes.pipe';\n\n@Component({\n selector: 'bs-file-upload',\n templateUrl: './file-upload.component.html',\n styleUrls: ['./file-upload.component.scss'],\n imports: [NgTemplateOutlet, BsForDirective, BsListGroupComponent, BsListGroupItemComponent, BsProgressComponent, BsProgressBarComponent, BsFormatBytesPipe],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(dragover)': 'onDragOver($event)',\n '(dragleave)': 'onDragLeave($event)',\n '(drop)': 'onDrop($event)',\n },\n})\nexport class BsFileUploadComponent {\n private announcer = inject(BsLiveAnnouncerService);\n\n readonly dropFilesCaption = input('Drop your files here');\n readonly browseFilesCaption = input('Browse for files');\n readonly placeholder = input('Drop files to upload');\n readonly ariaLabel = input<string>('File upload drop zone');\n readonly inputAriaLabel = input<string>('Choose files to upload');\n /** Live-region announcement after one file is added. Override to translate. */\n readonly fileAddedAnnouncement = input<(fileName: string) => string>((fileName) => `Added ${fileName}`);\n /** Live-region announcement after several files are added at once. Override to translate. */\n readonly filesAddedAnnouncement = input<(count: number) => string>((count) => `Added ${count} files`);\n /** Accessible name of the default template's progress bar. Override to translate. */\n readonly progressLabel = input<(fileName: string) => string>((fileName) => `Upload progress for ${fileName}`);\n\n readonly colors = Color;\n isDraggingFile = signal(false);\n readonly fileTemplate = signal<TemplateRef<FileUpload> | undefined>(undefined);\n readonly files = model<FileUpload[]>([]);\n readonly filesDropped = output<FileUpload[]>();\n\n onChange(event: Event) {\n if (!event.target) return;\n if (!('files' in event.target)) return;\n if (!event.target['files']) return;\n\n const files = (<HTMLInputElement>event.target).files;\n if (!files) return;\n\n this.processDroppedFiles(files);\n }\n\n onDragOver(event: DragEvent) {\n event.preventDefault();\n event.stopPropagation();\n\n if (event.dataTransfer) {\n this.isDraggingFile.set(true);\n event.dataTransfer.effectAllowed = \"copy\";\n }\n }\n\n onDragLeave(event: DragEvent) {\n event.preventDefault();\n event.stopPropagation();\n this.isDraggingFile.set(false);\n }\n\n onDrop(event: DragEvent) {\n event.preventDefault();\n event.stopPropagation();\n this.isDraggingFile.set(false);\n if (event.dataTransfer && event.dataTransfer.files) {\n this.processDroppedFiles(event.dataTransfer.files);\n }\n }\n\n private processDroppedFiles(fileList: FileList) {\n const newFiles = [...Array(fileList.length).keys()]\n .map(i => fileList.item(i))\n .filter(f => !!f)\n .map((file, index) => <FileUpload>{ file, progress: 0, index: this.files().length + index });\n\n this.files.update(f => [...f, ...newFiles]);\n this.filesDropped.emit(newFiles);\n\n if (newFiles.length === 1) {\n this.announcer.announce(this.fileAddedAnnouncement()(newFiles[0].file.name));\n } else if (newFiles.length > 1) {\n this.announcer.announce(this.filesAddedAnnouncement()(newFiles.length));\n }\n }\n}\n","<div class=\"dropzone border position-relative p-5\" role=\"region\" [attr.aria-label]=\"ariaLabel()\" [class.dragging]=\"isDraggingFile()\">\n <input type=\"file\" multiple #fileUpload (change)=\"onChange($event)\" [title]=\"placeholder()\" [placeholder]=\"placeholder()\" [attr.aria-label]=\"inputAriaLabel()\" class=\"position-absolute w-100 h-100\">\n <!-- <img src=\"/assets/ic-file-upload.svg\" [alt]=\"placeholder()\"> -->\n <span class=\"h3 d-block\" aria-hidden=\"true\">{{ dropFilesCaption() }}</span>\n <label class=\"btn btn-primary position-relative\" [bsFor]=\"fileUpload\">{{ browseFilesCaption() }}</label>\n</div>\n<bs-list-group class=\"files-list\">\n @for (upload of files(); track upload.index) {\n <bs-list-group-item>\n <ng-container *ngTemplateOutlet=\"fileTemplate() ?? defaultFileTemplate; context: { $implicit: upload }\"></ng-container>\n </bs-list-group-item>\n }\n</bs-list-group>\n\n<ng-template #defaultFileTemplate let-upload>\n <div class=\"d-flex flex-row mx-auto\">\n <div class=\"file-img\" aria-hidden=\"true\"></div>\n <div class=\"flex-grow-1 text-start px-2\">\n <span class=\"d-block text-truncate text-secondary\">{{ upload.file.name }}</span>\n <span class=\"d-block text-grey mb-0\">{{ upload.file.size | bsFormatBytes }}</span>\n <bs-progress [height]=\"4\">\n <bs-progress-bar [minimum]=\"0\" [maximum]=\"upload.file.size\" [value]=\"upload.progress\" [ariaLabel]=\"progressLabel()(upload.file.name)\"></bs-progress-bar>\n </bs-progress>\n </div>\n </div>\n</ng-template>\n","import { Directive, inject, input, TemplateRef } from '@angular/core';\nimport { BsFileUploadComponent } from '../component/file-upload.component';\nimport { FileUpload } from '../file-upload';\n\n@Directive({\n selector: '[bsFileUploadTemplate]',\n})\nexport class BsFileUploadTemplateDirective {\n private fileUploadComponent = inject(BsFileUploadComponent);\n\n constructor() {\n const templateRef = inject(TemplateRef);\n this.fileUploadComponent.fileTemplate.set(templateRef);\n }\n\n readonly bsFileUploadTemplateOf = input<FileUpload[] | undefined>(undefined);\n\n static ngTemplateContextGuard(dir: BsFileUploadTemplateDirective, ctx: any): ctx is BsFileUploadTemplateContext {\n return true;\n }\n\n}\n\nexport class BsFileUploadTemplateContext {\n $implicit: FileUpload = null!;\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAMa,iBAAiB,CAAA;AAE5B,IAAA,SAAS,CAAC,KAAa,EAAE,QAAQ,GAAG,CAAC,EAAA;AACnC,QAAA,IAAI,KAAK,KAAK,CAAC,EAAE;AACf,YAAA,OAAO,SAAS;QAClB;QAEA,MAAM,CAAC,GAAG,IAAI;AACd,QAAA,MAAM,EAAE,GAAG,QAAQ,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ;QACvC,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;;AAEvE,QAAA,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAA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AA,EAAA,iBAAA,EAAA,wBAAA,EAAA,UAAA,EAAA,wBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAA7B,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBAHzC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,wBAAwB;AACnC,iBAAA;;MAiBY,2BAA2B,CAAA;AAAxC,IAAA,WAAA,GAAA;QACE,IAAA,CAAA,SAAS,GAAe,IAAK;IAC/B;AAAC;;ACzBD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, signal, Injectable, inject, Injector, ChangeDetectionStrategy, Component, model, input, effect, TemplateRef, Directive, ElementRef, afterNextRender } from '@angular/core';
|
|
2
|
+
import { InjectionToken, signal, Injectable, inject, Injector, ChangeDetectionStrategy, Component, ApplicationRef, model, input, effect, TemplateRef, Directive, ElementRef, afterNextRender } from '@angular/core';
|
|
3
3
|
import { NgTemplateOutlet } from '@angular/common';
|
|
4
4
|
import { FadeInOutAnimation, EnterFromTopAnimation } from '@mintplayer/ng-animations';
|
|
5
5
|
import { BsOverlayFocusDirective, BsOverlayStackService, BsIdService } from '@mintplayer/ng-bootstrap/a11y';
|
|
@@ -48,9 +48,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
48
48
|
|
|
49
49
|
const PORTAL_FACTORY = new InjectionToken('ModalPortalFactory');
|
|
50
50
|
|
|
51
|
+
/** Time the modal's leave animation is given before its overlay is disposed. */
|
|
52
|
+
const MODAL_LEAVE_MS = 500;
|
|
51
53
|
class BsModalHostComponent {
|
|
52
54
|
constructor() {
|
|
53
55
|
this.overlay = inject(Overlay);
|
|
56
|
+
this.appRef = inject(ApplicationRef);
|
|
54
57
|
this.parentInjector = inject(Injector);
|
|
55
58
|
this.portalFactory = inject(PORTAL_FACTORY);
|
|
56
59
|
this.overlayStack = inject(BsOverlayStackService);
|
|
@@ -102,13 +105,27 @@ class BsModalHostComponent {
|
|
|
102
105
|
this.componentInstance.instance.isOpen.set(this.isOpen());
|
|
103
106
|
this.componentInstance.instance.scrollable.set(this.scrollable());
|
|
104
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Plays the modal's leave animation, then disposes the overlay. The close is written to the
|
|
110
|
+
* modal directly: this host's sync effect is destroyed with it and would never deliver it.
|
|
111
|
+
* If the application is torn down first, the pending dispose is cancelled and runs at once.
|
|
112
|
+
*/
|
|
105
113
|
ngOnDestroy() {
|
|
106
|
-
this.isOpen.set(false);
|
|
107
114
|
if (this.stackToken !== null) {
|
|
108
115
|
this.overlayStack.release(this.stackToken);
|
|
109
116
|
this.stackToken = null;
|
|
110
117
|
}
|
|
111
|
-
|
|
118
|
+
if (!this.overlayRef)
|
|
119
|
+
return;
|
|
120
|
+
const overlayRef = this.overlayRef;
|
|
121
|
+
this.componentInstance?.instance.isOpen.set(false);
|
|
122
|
+
const dispose = () => {
|
|
123
|
+
clearTimeout(timer);
|
|
124
|
+
unregister();
|
|
125
|
+
overlayRef.dispose();
|
|
126
|
+
};
|
|
127
|
+
const timer = setTimeout(dispose, MODAL_LEAVE_MS);
|
|
128
|
+
const unregister = this.appRef.onDestroy(dispose);
|
|
112
129
|
}
|
|
113
130
|
onKeyDown(event) {
|
|
114
131
|
const ev = event;
|
|
@@ -250,5 +267,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
250
267
|
* Generated bundle index. Do not edit.
|
|
251
268
|
*/
|
|
252
269
|
|
|
253
|
-
export { BsModalBodyDirective, BsModalCloseDirective, BsModalComponent, BsModalDirective, BsModalFooterDirective, BsModalHeaderDirective, BsModalHostComponent };
|
|
270
|
+
export { BsModalBodyDirective, BsModalCloseDirective, BsModalComponent, BsModalDirective, BsModalFooterDirective, BsModalHeaderDirective, BsModalHostComponent, MODAL_LEAVE_MS };
|
|
254
271
|
//# sourceMappingURL=mintplayer-ng-bootstrap-modal.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-bootstrap-modal.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/modal/src/providers/modal-content.provider.ts","../../../../libs/mintplayer-ng-bootstrap/modal/src/services/modal-context.service.ts","../../../../libs/mintplayer-ng-bootstrap/modal/src/components/modal/modal.component.ts","../../../../libs/mintplayer-ng-bootstrap/modal/src/components/modal/modal.component.html","../../../../libs/mintplayer-ng-bootstrap/modal/src/providers/portal-factory.provider.ts","../../../../libs/mintplayer-ng-bootstrap/modal/src/components/modal-host/modal-host.component.ts","../../../../libs/mintplayer-ng-bootstrap/modal/src/components/modal-host/modal-host.component.html","../../../../libs/mintplayer-ng-bootstrap/modal/src/directives/modal/modal.directive.ts","../../../../libs/mintplayer-ng-bootstrap/modal/src/directives/modal-header/modal-header.directive.ts","../../../../libs/mintplayer-ng-bootstrap/modal/src/directives/modal-body/modal-body.directive.ts","../../../../libs/mintplayer-ng-bootstrap/modal/src/directives/modal-footer/modal-footer.directive.ts","../../../../libs/mintplayer-ng-bootstrap/modal/src/directives/modal-close/modal-close.directive.ts","../../../../libs/mintplayer-ng-bootstrap/modal/mintplayer-ng-bootstrap-modal.ts"],"sourcesContent":["import { InjectionToken, TemplateRef } from \"@angular/core\";\n\nexport const MODAL_CONTENT = new InjectionToken<TemplateRef<any>>('ModalContent');","import { Injectable, signal } from '@angular/core';\n\n/**\n * Component-scoped state shared between BsModalComponent (the dialog renderer)\n * and the bsModalHeader / bsModalBody directives applied to the user's template.\n * Provides the ids for aria-labelledby and aria-describedby.\n */\n@Injectable()\nexport class BsModalContextService {\n readonly headerId = signal<string | null>(null);\n readonly bodyId = signal<string | null>(null);\n}\n","import { Component, inject, Injector, signal, TemplateRef, ChangeDetectionStrategy } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { EnterFromTopAnimation, FadeInOutAnimation } from '@mintplayer/ng-animations';\nimport { BsOverlayFocusDirective } from '@mintplayer/ng-bootstrap/a11y';\nimport { MODAL_CONTENT } from '../../providers/modal-content.provider';\nimport { BsModalContextService } from '../../services/modal-context.service';\n\n@Component({\n selector: 'bs-modal-content',\n templateUrl: './modal.component.html',\n styleUrls: ['./modal.component.scss'],\n imports: [NgTemplateOutlet, BsOverlayFocusDirective],\n animations: [FadeInOutAnimation, EnterFromTopAnimation],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [BsModalContextService],\n})\nexport class BsModalComponent {\n\n template = inject<TemplateRef<any>>(MODAL_CONTENT);\n isOpen = signal(false);\n scrollable = signal(false);\n\n context = inject(BsModalContextService);\n injector = inject(Injector);\n}\n","@if (isOpen()) {\n <div class=\"modal d-block\"\n [@fadeInOut]\n [@enterFromTop]\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"context.headerId()\"\n [attr.aria-describedby]=\"context.bodyId()\"\n [bsOverlayFocus]=\"true\"\n tabindex=\"-1\">\n <div class=\"modal-dialog\" [class.modal-dialog-scrollable]=\"scrollable()\">\n <div class=\"modal-content\">\n <ng-container *ngTemplateOutlet=\"template; injector: injector\"></ng-container>\n </div>\n </div>\n </div>\n\n <div [@fadeInOut]>\n <div class=\"modal-backdrop fade\" [class.show]=\"isOpen()\" aria-hidden=\"true\"></div>\n </div>\n}\n","import { ComponentPortal } from \"@angular/cdk/portal\";\nimport { InjectionToken, Injector } from \"@angular/core\";\n\nexport const PORTAL_FACTORY = new InjectionToken<(injector: Injector) => ComponentPortal<any>>('ModalPortalFactory');","import { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { AfterViewInit, Component, ComponentRef, effect, inject, Injector, input, model, OnDestroy, TemplateRef, ChangeDetectionStrategy} from '@angular/core';\nimport { BsOverlayStackService } from '@mintplayer/ng-bootstrap/a11y';\nimport { BsHasOverlayComponent } from '@mintplayer/ng-bootstrap/has-overlay';\nimport { MODAL_CONTENT } from '../../providers/modal-content.provider';\nimport { PORTAL_FACTORY } from '../../providers/portal-factory.provider';\nimport { BsModalComponent } from '../modal/modal.component';\n\n@Component({\n selector: 'bs-modal',\n templateUrl: './modal-host.component.html',\n styleUrls: ['./modal-host.component.scss'],\n imports: [BsHasOverlayComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{\n provide: PORTAL_FACTORY,\n useValue: (injector: Injector) => {\n return new ComponentPortal(BsModalComponent, null, injector);\n }\n }],\n host: {\n '(document:keydown)': 'onKeyDown($event)',\n },\n})\nexport class BsModalHostComponent implements AfterViewInit, OnDestroy {\n private overlay = inject(Overlay);\n private parentInjector = inject(Injector);\n private portalFactory = inject<(injector: Injector) => ComponentPortal<BsModalComponent>>(PORTAL_FACTORY);\n private overlayStack = inject(BsOverlayStackService);\n private stackToken: symbol | null = null;\n\n overlayRef!: OverlayRef;\n componentInstance?: ComponentRef<BsModalComponent>;\n template!: TemplateRef<any>;\n\n //#region isOpen\n readonly isOpen = model<boolean>(false);\n //#endregion\n readonly closeOnEscape = input(true);\n readonly scrollable = input(false);\n\n constructor() {\n effect(() => {\n const value = this.isOpen();\n if (this.componentInstance) {\n this.componentInstance.instance.isOpen.set(value);\n }\n\n if (value && this.stackToken === null) {\n this.stackToken = this.overlayStack.push();\n } else if (!value && this.stackToken !== null) {\n this.overlayStack.release(this.stackToken);\n this.stackToken = null;\n }\n });\n\n effect(() => {\n const scrollable = this.scrollable();\n if (this.componentInstance) {\n this.componentInstance.instance.scrollable.set(scrollable);\n }\n });\n }\n\n ngAfterViewInit() {\n const injector = Injector.create({\n providers: [\n { provide: MODAL_CONTENT, useValue: this.template }\n ],\n parent: this.parentInjector\n });\n const portal = this.portalFactory(injector);\n this.overlayRef = this.overlay.create({\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n positionStrategy: this.overlay.position()\n .global().centerHorizontally().bottom('0').top('0').left('0').right('0'),\n width: '100%',\n hasBackdrop: false\n });\n this.componentInstance = this.overlayRef.attach<BsModalComponent>(portal);\n this.componentInstance.instance.isOpen.set(this.isOpen());\n this.componentInstance.instance.scrollable.set(this.scrollable());\n }\n\n ngOnDestroy() {\n this.isOpen.set(false);\n if (this.stackToken !== null) {\n this.overlayStack.release(this.stackToken);\n this.stackToken = null;\n }\n setTimeout(() => this.overlayRef && this.overlayRef.dispose(), 500);\n }\n\n onKeyDown(event: Event) {\n const ev = event as KeyboardEvent;\n if (this.isOpen() && this.closeOnEscape() && ev.code === 'Escape') {\n if (this.stackToken !== null && this.overlayStack.isTop(this.stackToken)) {\n this.isOpen.set(false);\n }\n }\n }\n}","<bs-has-overlay></bs-has-overlay>","import { Directive, inject, TemplateRef } from '@angular/core';\nimport { BsModalHostComponent } from '../../components/modal-host/modal-host.component';\n\n@Directive({\n selector: '[bsModal]',\n})\nexport class BsModalDirective {\n\n constructor() {\n const template = inject(TemplateRef);\n const host = inject(BsModalHostComponent);\n host.template = template;\n }\n\n}\n","import { afterNextRender, Directive, ElementRef, inject } from '@angular/core';\nimport { BsIdService } from '@mintplayer/ng-bootstrap/a11y';\nimport { BsModalContextService } from '../../services/modal-context.service';\n\n@Directive({\n selector: '[bsModalHeader]',\n host: {\n '[class.modal-header]': 'true',\n },\n})\nexport class BsModalHeaderDirective {\n private el = inject<ElementRef<HTMLElement>>(ElementRef);\n private ids = inject(BsIdService);\n private context = inject(BsModalContextService, { optional: true });\n\n constructor() {\n // After first render, all sibling host bindings + static attrs on this element\n // have applied. Read an existing id if the consumer set one, otherwise generate\n // and assign — then publish it to the modal context for aria-labelledby.\n afterNextRender(() => {\n let id = this.el.nativeElement.id;\n if (!id) {\n id = this.ids.next('bs-modal-header');\n this.el.nativeElement.id = id;\n }\n this.context?.headerId.set(id);\n });\n }\n}\n","import { afterNextRender, Directive, ElementRef, inject } from '@angular/core';\nimport { BsIdService } from '@mintplayer/ng-bootstrap/a11y';\nimport { BsModalContextService } from '../../services/modal-context.service';\n\n@Directive({\n selector: '[bsModalBody]',\n host: {\n '[class.modal-body]': 'true',\n },\n})\nexport class BsModalBodyDirective {\n private el = inject<ElementRef<HTMLElement>>(ElementRef);\n private ids = inject(BsIdService);\n private context = inject(BsModalContextService, { optional: true });\n\n constructor() {\n afterNextRender(() => {\n let id = this.el.nativeElement.id;\n if (!id) {\n id = this.ids.next('bs-modal-body');\n this.el.nativeElement.id = id;\n }\n this.context?.bodyId.set(id);\n });\n }\n}\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: '[bsModalFooter]',\n host: {\n '[class.modal-footer]': 'true',\n },\n})\nexport class BsModalFooterDirective {\n}\n","import { Directive, inject } from '@angular/core';\nimport { BsModalHostComponent } from '../../components/modal-host/modal-host.component';\n\n@Directive({\n selector: '[bsModalClose]',\n host: {\n '[attr.aria-label]': '\"Close\"',\n '(click)': 'onClick()',\n },\n})\nexport class BsModalCloseDirective {\n private host = inject(BsModalHostComponent);\n\n onClick() {\n this.host.isOpen.set(false);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAEO,MAAM,aAAa,GAAG,IAAI,cAAc,CAAmB,cAAc,CAAC;;ACAjF;;;;AAIG;MAEU,qBAAqB,CAAA;AADlC,IAAA,WAAA,GAAA;QAEW,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAgB,IAAI;qFAAC;QACtC,IAAA,CAAA,MAAM,GAAG,MAAM,CAAgB,IAAI;mFAAC;AAC9C,IAAA;8GAHY,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAArB,qBAAqB,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBADjC;;;MCSY,gBAAgB,CAAA;AAT7B,IAAA,WAA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AA;;;ACTD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-bootstrap-modal.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/modal/src/providers/modal-content.provider.ts","../../../../libs/mintplayer-ng-bootstrap/modal/src/services/modal-context.service.ts","../../../../libs/mintplayer-ng-bootstrap/modal/src/components/modal/modal.component.ts","../../../../libs/mintplayer-ng-bootstrap/modal/src/components/modal/modal.component.html","../../../../libs/mintplayer-ng-bootstrap/modal/src/providers/portal-factory.provider.ts","../../../../libs/mintplayer-ng-bootstrap/modal/src/components/modal-host/modal-host.component.ts","../../../../libs/mintplayer-ng-bootstrap/modal/src/components/modal-host/modal-host.component.html","../../../../libs/mintplayer-ng-bootstrap/modal/src/directives/modal/modal.directive.ts","../../../../libs/mintplayer-ng-bootstrap/modal/src/directives/modal-header/modal-header.directive.ts","../../../../libs/mintplayer-ng-bootstrap/modal/src/directives/modal-body/modal-body.directive.ts","../../../../libs/mintplayer-ng-bootstrap/modal/src/directives/modal-footer/modal-footer.directive.ts","../../../../libs/mintplayer-ng-bootstrap/modal/src/directives/modal-close/modal-close.directive.ts","../../../../libs/mintplayer-ng-bootstrap/modal/mintplayer-ng-bootstrap-modal.ts"],"sourcesContent":["import { InjectionToken, TemplateRef } from \"@angular/core\";\n\nexport const MODAL_CONTENT = new InjectionToken<TemplateRef<any>>('ModalContent');","import { Injectable, signal } from '@angular/core';\n\n/**\n * Component-scoped state shared between BsModalComponent (the dialog renderer)\n * and the bsModalHeader / bsModalBody directives applied to the user's template.\n * Provides the ids for aria-labelledby and aria-describedby.\n */\n@Injectable()\nexport class BsModalContextService {\n readonly headerId = signal<string | null>(null);\n readonly bodyId = signal<string | null>(null);\n}\n","import { Component, inject, Injector, signal, TemplateRef, ChangeDetectionStrategy } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { EnterFromTopAnimation, FadeInOutAnimation } from '@mintplayer/ng-animations';\nimport { BsOverlayFocusDirective } from '@mintplayer/ng-bootstrap/a11y';\nimport { MODAL_CONTENT } from '../../providers/modal-content.provider';\nimport { BsModalContextService } from '../../services/modal-context.service';\n\n@Component({\n selector: 'bs-modal-content',\n templateUrl: './modal.component.html',\n styleUrls: ['./modal.component.scss'],\n imports: [NgTemplateOutlet, BsOverlayFocusDirective],\n animations: [FadeInOutAnimation, EnterFromTopAnimation],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [BsModalContextService],\n})\nexport class BsModalComponent {\n\n template = inject<TemplateRef<any>>(MODAL_CONTENT);\n isOpen = signal(false);\n scrollable = signal(false);\n\n context = inject(BsModalContextService);\n injector = inject(Injector);\n}\n","@if (isOpen()) {\n <div class=\"modal d-block\"\n [@fadeInOut]\n [@enterFromTop]\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"context.headerId()\"\n [attr.aria-describedby]=\"context.bodyId()\"\n [bsOverlayFocus]=\"true\"\n tabindex=\"-1\">\n <div class=\"modal-dialog\" [class.modal-dialog-scrollable]=\"scrollable()\">\n <div class=\"modal-content\">\n <ng-container *ngTemplateOutlet=\"template; injector: injector\"></ng-container>\n </div>\n </div>\n </div>\n\n <div [@fadeInOut]>\n <div class=\"modal-backdrop fade\" [class.show]=\"isOpen()\" aria-hidden=\"true\"></div>\n </div>\n}\n","import { ComponentPortal } from \"@angular/cdk/portal\";\nimport { InjectionToken, Injector } from \"@angular/core\";\n\nexport const PORTAL_FACTORY = new InjectionToken<(injector: Injector) => ComponentPortal<any>>('ModalPortalFactory');","import { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { AfterViewInit, ApplicationRef, Component, ComponentRef, effect, inject, Injector, input, model, OnDestroy, TemplateRef, ChangeDetectionStrategy} from '@angular/core';\nimport { BsOverlayStackService } from '@mintplayer/ng-bootstrap/a11y';\nimport { BsHasOverlayComponent } from '@mintplayer/ng-bootstrap/has-overlay';\nimport { MODAL_CONTENT } from '../../providers/modal-content.provider';\nimport { PORTAL_FACTORY } from '../../providers/portal-factory.provider';\nimport { BsModalComponent } from '../modal/modal.component';\n\n/** Time the modal's leave animation is given before its overlay is disposed. */\nexport const MODAL_LEAVE_MS = 500;\n\n@Component({\n selector: 'bs-modal',\n templateUrl: './modal-host.component.html',\n styleUrls: ['./modal-host.component.scss'],\n imports: [BsHasOverlayComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{\n provide: PORTAL_FACTORY,\n useValue: (injector: Injector) => {\n return new ComponentPortal(BsModalComponent, null, injector);\n }\n }],\n host: {\n '(document:keydown)': 'onKeyDown($event)',\n },\n})\nexport class BsModalHostComponent implements AfterViewInit, OnDestroy {\n private overlay = inject(Overlay);\n private appRef = inject(ApplicationRef);\n private parentInjector = inject(Injector);\n private portalFactory = inject<(injector: Injector) => ComponentPortal<BsModalComponent>>(PORTAL_FACTORY);\n private overlayStack = inject(BsOverlayStackService);\n private stackToken: symbol | null = null;\n\n overlayRef!: OverlayRef;\n componentInstance?: ComponentRef<BsModalComponent>;\n template!: TemplateRef<any>;\n\n //#region isOpen\n readonly isOpen = model<boolean>(false);\n //#endregion\n readonly closeOnEscape = input(true);\n readonly scrollable = input(false);\n\n constructor() {\n effect(() => {\n const value = this.isOpen();\n if (this.componentInstance) {\n this.componentInstance.instance.isOpen.set(value);\n }\n\n if (value && this.stackToken === null) {\n this.stackToken = this.overlayStack.push();\n } else if (!value && this.stackToken !== null) {\n this.overlayStack.release(this.stackToken);\n this.stackToken = null;\n }\n });\n\n effect(() => {\n const scrollable = this.scrollable();\n if (this.componentInstance) {\n this.componentInstance.instance.scrollable.set(scrollable);\n }\n });\n }\n\n ngAfterViewInit() {\n const injector = Injector.create({\n providers: [\n { provide: MODAL_CONTENT, useValue: this.template }\n ],\n parent: this.parentInjector\n });\n const portal = this.portalFactory(injector);\n this.overlayRef = this.overlay.create({\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n positionStrategy: this.overlay.position()\n .global().centerHorizontally().bottom('0').top('0').left('0').right('0'),\n width: '100%',\n hasBackdrop: false\n });\n this.componentInstance = this.overlayRef.attach<BsModalComponent>(portal);\n this.componentInstance.instance.isOpen.set(this.isOpen());\n this.componentInstance.instance.scrollable.set(this.scrollable());\n }\n\n /**\n * Plays the modal's leave animation, then disposes the overlay. The close is written to the\n * modal directly: this host's sync effect is destroyed with it and would never deliver it.\n * If the application is torn down first, the pending dispose is cancelled and runs at once.\n */\n ngOnDestroy() {\n if (this.stackToken !== null) {\n this.overlayStack.release(this.stackToken);\n this.stackToken = null;\n }\n if (!this.overlayRef) return;\n const overlayRef = this.overlayRef;\n this.componentInstance?.instance.isOpen.set(false);\n const dispose = () => {\n clearTimeout(timer);\n unregister();\n overlayRef.dispose();\n };\n const timer = setTimeout(dispose, MODAL_LEAVE_MS);\n const unregister = this.appRef.onDestroy(dispose);\n }\n\n onKeyDown(event: Event) {\n const ev = event as KeyboardEvent;\n if (this.isOpen() && this.closeOnEscape() && ev.code === 'Escape') {\n if (this.stackToken !== null && this.overlayStack.isTop(this.stackToken)) {\n this.isOpen.set(false);\n }\n }\n }\n}","<bs-has-overlay></bs-has-overlay>","import { Directive, inject, TemplateRef } from '@angular/core';\nimport { BsModalHostComponent } from '../../components/modal-host/modal-host.component';\n\n@Directive({\n selector: '[bsModal]',\n})\nexport class BsModalDirective {\n\n constructor() {\n const template = inject(TemplateRef);\n const host = inject(BsModalHostComponent);\n host.template = template;\n }\n\n}\n","import { afterNextRender, Directive, ElementRef, inject } from '@angular/core';\nimport { BsIdService } from '@mintplayer/ng-bootstrap/a11y';\nimport { BsModalContextService } from '../../services/modal-context.service';\n\n@Directive({\n selector: '[bsModalHeader]',\n host: {\n '[class.modal-header]': 'true',\n },\n})\nexport class BsModalHeaderDirective {\n private el = inject<ElementRef<HTMLElement>>(ElementRef);\n private ids = inject(BsIdService);\n private context = inject(BsModalContextService, { optional: true });\n\n constructor() {\n // After first render, all sibling host bindings + static attrs on this element\n // have applied. Read an existing id if the consumer set one, otherwise generate\n // and assign — then publish it to the modal context for aria-labelledby.\n afterNextRender(() => {\n let id = this.el.nativeElement.id;\n if (!id) {\n id = this.ids.next('bs-modal-header');\n this.el.nativeElement.id = id;\n }\n this.context?.headerId.set(id);\n });\n }\n}\n","import { afterNextRender, Directive, ElementRef, inject } from '@angular/core';\nimport { BsIdService } from '@mintplayer/ng-bootstrap/a11y';\nimport { BsModalContextService } from '../../services/modal-context.service';\n\n@Directive({\n selector: '[bsModalBody]',\n host: {\n '[class.modal-body]': 'true',\n },\n})\nexport class BsModalBodyDirective {\n private el = inject<ElementRef<HTMLElement>>(ElementRef);\n private ids = inject(BsIdService);\n private context = inject(BsModalContextService, { optional: true });\n\n constructor() {\n afterNextRender(() => {\n let id = this.el.nativeElement.id;\n if (!id) {\n id = this.ids.next('bs-modal-body');\n this.el.nativeElement.id = id;\n }\n this.context?.bodyId.set(id);\n });\n }\n}\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: '[bsModalFooter]',\n host: {\n '[class.modal-footer]': 'true',\n },\n})\nexport class BsModalFooterDirective {\n}\n","import { Directive, inject } from '@angular/core';\nimport { BsModalHostComponent } from '../../components/modal-host/modal-host.component';\n\n@Directive({\n selector: '[bsModalClose]',\n host: {\n '[attr.aria-label]': '\"Close\"',\n '(click)': 'onClick()',\n },\n})\nexport class BsModalCloseDirective {\n private host = inject(BsModalHostComponent);\n\n onClick() {\n this.host.isOpen.set(false);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAEO,MAAM,aAAa,GAAG,IAAI,cAAc,CAAmB,cAAc,CAAC;;ACAjF;;;;AAIG;MAEU,qBAAqB,CAAA;AADlC,IAAA,WAAA,GAAA;QAEW,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAgB,IAAI;qFAAC;QACtC,IAAA,CAAA,MAAM,GAAG,MAAM,CAAgB,IAAI;mFAAC;AAC9C,IAAA;8GAHY,qBAAqB,EAAA,IAAA,EAAA,E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;8GALW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,WAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAPjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,IAAI,EAAE;AACJ,wBAAA,mBAAmB,EAAE,SAAS;AAC9B,wBAAA,SAAS,EAAE,WAAW;AACvB,qBAAA;AACF,iBAAA;;;ACTD;;AAEG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isPlatformServer, NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken, signal, Injectable, inject, PLATFORM_ID, Injector, computed, output, effect, untracked, ChangeDetectionStrategy, Component, ElementRef, afterNextRender, input, model, Directive, TemplateRef } from '@angular/core';
|
|
3
|
+
import { InjectionToken, signal, Injectable, inject, PLATFORM_ID, Injector, computed, output, effect, untracked, ChangeDetectionStrategy, Component, ElementRef, afterNextRender, input, ApplicationRef, model, Directive, TemplateRef } from '@angular/core';
|
|
4
4
|
import { FadeInOutAnimation } from '@mintplayer/ng-animations';
|
|
5
5
|
import { BsOverlayFocusDirective, BsIdService } from '@mintplayer/ng-bootstrap/a11y';
|
|
6
6
|
import { Overlay } from '@angular/cdk/overlay';
|
|
@@ -29,6 +29,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
29
29
|
type: Injectable
|
|
30
30
|
}] });
|
|
31
31
|
|
|
32
|
+
/** Duration of the panel's slide transition (Bootstrap's $offcanvas-transition-duration). */
|
|
33
|
+
const OFFCANVAS_TRANSITION_MS = 300;
|
|
32
34
|
class BsOffcanvasComponent {
|
|
33
35
|
constructor() {
|
|
34
36
|
this.contentTemplate = inject(OFFCANVAS_CONTENT);
|
|
@@ -116,7 +118,7 @@ class BsOffcanvasComponent {
|
|
|
116
118
|
if (!this.isVisible()) {
|
|
117
119
|
this.visibility.set('hidden');
|
|
118
120
|
}
|
|
119
|
-
},
|
|
121
|
+
}, OFFCANVAS_TRANSITION_MS);
|
|
120
122
|
}
|
|
121
123
|
});
|
|
122
124
|
});
|
|
@@ -199,6 +201,7 @@ class BsOffcanvasHostComponent {
|
|
|
199
201
|
constructor() {
|
|
200
202
|
this.overlayService = inject(Overlay);
|
|
201
203
|
this.rootInjector = inject(Injector);
|
|
204
|
+
this.appRef = inject(ApplicationRef);
|
|
202
205
|
this.portalFactory = inject(PORTAL_FACTORY);
|
|
203
206
|
// Signals
|
|
204
207
|
this.viewInited = signal(false, /* @ts-ignore */
|
|
@@ -248,7 +251,6 @@ class BsOffcanvasHostComponent {
|
|
|
248
251
|
],
|
|
249
252
|
parent: this.rootInjector,
|
|
250
253
|
});
|
|
251
|
-
// const portal = new ComponentPortal(BsOffcanvasComponent, null, injector);
|
|
252
254
|
const portal = this.portalFactory(injector);
|
|
253
255
|
this.overlayRef = this.overlayService.create({
|
|
254
256
|
scrollStrategy: this.overlayService.scrollStrategies.reposition(),
|
|
@@ -265,10 +267,25 @@ class BsOffcanvasHostComponent {
|
|
|
265
267
|
this.component.instance.hasBackdrop.set(this.hasBackdrop());
|
|
266
268
|
this.viewInited.set(true);
|
|
267
269
|
}
|
|
270
|
+
/**
|
|
271
|
+
* Plays the panel's hide transition, then disposes the overlay. The hide is written to the
|
|
272
|
+
* panel directly: this host's sync effects are destroyed with it and would never deliver it.
|
|
273
|
+
* If the application is torn down before the transition ends, the pending dispose is
|
|
274
|
+
* cancelled and runs at once, so no timer outlives the app.
|
|
275
|
+
*/
|
|
268
276
|
ngOnDestroy() {
|
|
269
277
|
this.backdropClickSubscription?.unsubscribe();
|
|
270
|
-
this.
|
|
271
|
-
|
|
278
|
+
if (!this.overlayRef)
|
|
279
|
+
return;
|
|
280
|
+
const overlayRef = this.overlayRef;
|
|
281
|
+
this.component.instance.isVisible.set(false);
|
|
282
|
+
const dispose = () => {
|
|
283
|
+
clearTimeout(timer);
|
|
284
|
+
unregister();
|
|
285
|
+
overlayRef.dispose();
|
|
286
|
+
};
|
|
287
|
+
const timer = setTimeout(dispose, OFFCANVAS_TRANSITION_MS);
|
|
288
|
+
const unregister = this.appRef.onDestroy(dispose);
|
|
272
289
|
}
|
|
273
290
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsOffcanvasHostComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
274
291
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.8", type: BsOffcanvasHostComponent, isStandalone: true, selector: "bs-offcanvas", inputs: { isVisible: { classPropertyName: "isVisible", publicName: "isVisible", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, hasBackdrop: { classPropertyName: "hasBackdrop", publicName: "hasBackdrop", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isVisible: "isVisibleChange", size: "sizeChange", position: "positionChange", hasBackdrop: "hasBackdropChange", backdropClick: "backdropClick" }, providers: [{
|
|
@@ -356,10 +373,9 @@ class BsOffcanvasPushDirective {
|
|
|
356
373
|
el = el.parentElement;
|
|
357
374
|
}
|
|
358
375
|
if (this.element.nativeElement.parentElement) {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
};
|
|
376
|
+
// Remember the value of the element that is clipped, which is only the direct
|
|
377
|
+
// parent when the walk stopped immediately.
|
|
378
|
+
this.initialOverflowX = { value: el.style.overflowX, element: el };
|
|
363
379
|
el.style.overflowX = 'hidden';
|
|
364
380
|
}
|
|
365
381
|
}
|
|
@@ -395,5 +411,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
395
411
|
* Generated bundle index. Do not edit.
|
|
396
412
|
*/
|
|
397
413
|
|
|
398
|
-
export { BsOffcanvasCloseDirective, BsOffcanvasComponent, BsOffcanvasContentDirective, BsOffcanvasHostComponent, BsOffcanvasPushDirective, OffcanvasBodyComponent, OffcanvasHeaderComponent };
|
|
414
|
+
export { BsOffcanvasCloseDirective, BsOffcanvasComponent, BsOffcanvasContentDirective, BsOffcanvasHostComponent, BsOffcanvasPushDirective, OFFCANVAS_TRANSITION_MS, OffcanvasBodyComponent, OffcanvasHeaderComponent };
|
|
399
415
|
//# sourceMappingURL=mintplayer-ng-bootstrap-offcanvas.mjs.map
|