@ngbase/adk 0.1.20 → 0.1.21

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ngbase-adk-resizable.mjs","sources":["../../../projects/adk/resizable/resizable-group.ts","../../../projects/adk/resizable/resizable.ts","../../../projects/adk/resizable/public-api.ts","../../../projects/adk/resizable/ngbase-adk-resizable.ts"],"sourcesContent":["import {\n Directive,\n ElementRef,\n contentChildren,\n effect,\n forwardRef,\n inject,\n input,\n untracked,\n DOCUMENT,\n} from '@angular/core';\nimport { uniqueId } from '@ngbase/adk/utils';\nimport { NgbResizable } from './resizable';\n\n@Directive({\n selector: '[ngbResizableGroup]',\n exportAs: 'ngbResizableGroup',\n host: {\n '[attr.id]': 'id',\n },\n})\nexport class NgbResizableGroup {\n readonly document = inject(DOCUMENT);\n readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly panels = contentChildren<NgbResizable>(forwardRef(() => NgbResizable));\n\n readonly direction = input<'horizontal' | 'vertical'>('horizontal');\n\n readonly id = uniqueId();\n\n private overlayDiv?: HTMLDivElement;\n\n constructor() {\n effect(() => {\n const panels = this.panels();\n\n untracked(() => {\n // set the index of each panel first before initializing the drag\n panels.forEach((panel, index) => {\n panel.index = index;\n });\n panels.forEach((panel, index) => {\n // hide the last panel's drag handle\n panel.draggable.set(index !== panels.length - 1);\n if (panel.size() !== 'auto') {\n panel.handleDrag();\n }\n });\n // we need to called setAuto after all panels have been initialized\n // because the number of panels could have changed\n this.setAuto();\n });\n });\n }\n\n get w() {\n return this.el.nativeElement.clientWidth;\n }\n\n get h() {\n return this.el.nativeElement.clientHeight;\n }\n\n setAuto() {\n const panels = this.panels();\n let str = 'calc(100%';\n const autos = [];\n for (const panel of panels) {\n if (panel.size() !== 'auto') {\n str += panel.str ? ` - ${panel.str}` : '';\n } else {\n autos.push(panel);\n }\n }\n str += ')';\n if (autos.length > 1) {\n str = `calc(${str} / ${autos.length})`;\n }\n for (const auto of autos) {\n auto.lSize.set(str);\n auto.handleDrag();\n }\n }\n\n start() {\n const div = this.document.createElement('div');\n div.style.position = 'absolute';\n div.style.top = '0';\n div.style.left = '0';\n div.style.width = '100%';\n div.style.height = '100%';\n div.style.zIndex = '9999';\n div.style.cursor = 'ew-resize';\n this.document.body.appendChild(div);\n this.overlayDiv = div;\n\n this.panels().forEach(panel => {\n panel.onStart();\n });\n }\n\n end() {\n this.overlayDiv?.remove();\n this.panels().forEach(panel => {\n panel.onEnd();\n });\n }\n}\n\nexport function aliasResizableGroup(resizableGroup: typeof NgbResizableGroup) {\n return { provide: NgbResizableGroup, useExisting: resizableGroup };\n}\n","import {\n Directive,\n ElementRef,\n TemplateRef,\n ViewContainerRef,\n computed,\n effect,\n inject,\n input,\n linkedSignal,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { Drag, DragData } from '@ngbase/adk/drag';\nimport { NgbResizableGroup } from './resizable-group';\n\n@Directive({\n selector: '[ngbGutter]',\n exportAs: 'ngbGutter',\n hostDirectives: [Drag],\n host: {\n role: 'separator',\n '[attr.aria-valuemin]': 'resizable.min()',\n '[attr.aria-valuemax]': 'resizable.max()',\n },\n})\nexport class NgbGutter {\n readonly resizable = inject(NgbResizable);\n readonly drag = inject(Drag);\n\n constructor() {\n this.drag._lockAxis = linkedSignal(this.resizable.lockAxis);\n this.drag._dragBoundary = linkedSignal(() => `#${this.resizable.id}`);\n }\n}\n\n@Directive({\n selector: '[ngbResizable]',\n exportAs: 'ngbResizable',\n})\nexport class NgbResizable {\n // Dependencies\n readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly resizable = inject(NgbResizableGroup);\n readonly containerRef = inject(ViewContainerRef);\n readonly dragElement = viewChild('dragElement', { read: TemplateRef });\n readonly drag = viewChild(Drag);\n readonly id = this.resizable.id;\n readonly lockAxis = computed(() => (this.resizable.direction() === 'horizontal' ? 'x' : 'y'));\n\n // inputs\n readonly size = input<number | string>('auto');\n readonly min = input<number | string>(0);\n readonly max = input<number | string>();\n\n // State\n readonly lSize = linkedSignal({\n source: this.size,\n computation: size => (size !== 'auto' ? size : ''),\n });\n readonly draggable = signal(false);\n reducedSize = 0;\n private localMinSize = Infinity;\n private localMaxSize = -Infinity;\n private initialReducedSize = 0;\n index = 0;\n str = '';\n\n constructor() {\n effect(() => {\n const size = this.size();\n untracked(() => {\n if (size !== 'auto') {\n this.reducedSize = 0;\n this.handleDrag();\n }\n\n this.resizable.setAuto();\n });\n });\n\n // This effect is responsible for creating the gutter element\n effect(() => {\n const cf = this.containerRef;\n if (this.draggable() && this.size()) {\n if (cf.length === 0) {\n untracked(() => cf.createEmbeddedView(this.dragElement()!));\n }\n } else {\n cf.clear();\n }\n });\n\n // This effect is responsible for handling the drag events\n effect(cleanup => {\n const drag = this.drag();\n\n if (!drag) return;\n\n untracked(() => {\n const sub = drag.events.subscribe((data: DragData) => {\n data.event?.preventDefault();\n\n requestAnimationFrame(() => this.onDrag(data));\n });\n cleanup(() => sub.unsubscribe());\n });\n });\n }\n\n // get w() {\n // return this.el.nativeElement.clientWidth;\n // }\n\n // get h() {\n // return this.el.nativeElement.clientHeight;\n // }\n\n cSize() {\n return this.resizable.direction() === 'horizontal'\n ? this.el.nativeElement.offsetWidth\n : this.el.nativeElement.offsetHeight;\n }\n\n onStart() {\n this.initialReducedSize = this.reducedSize;\n const cSize = this.cSize();\n const minSize = this.getSize(this.min());\n this.localMinSize = Math.max(this.reducedSize + (cSize - minSize), this.reducedSize);\n if (this.max()) {\n const maxSize = this.getSize(this.max());\n this.localMaxSize = Math.min(this.reducedSize - (maxSize - cSize), this.reducedSize);\n } else {\n this.localMaxSize = -Infinity;\n }\n }\n\n onEnd() {\n this.localMinSize = Infinity;\n this.localMaxSize = -Infinity;\n }\n\n private getSize(size?: number | string): number {\n if (size === undefined || size === null || size === '') return 0;\n\n const minValue = size;\n if (typeof minValue === 'number') {\n // If number, treat as percentage\n return (\n (this.resizable.direction() === 'horizontal' ? this.resizable.w : this.resizable.h) *\n (minValue / 100)\n );\n }\n\n // Handle pixel values\n const pixelMatch = minValue?.toString().match(/(\\d+)px/);\n if (pixelMatch) {\n return parseInt(pixelMatch[1], 10);\n }\n\n // Handle percentage values provided as string\n const percentMatch = minValue?.toString().match(/(\\d+)%/);\n if (percentMatch) {\n return (\n (this.resizable.direction() === 'horizontal' ? this.resizable.w : this.resizable.h) *\n (parseInt(percentMatch[1], 10) / 100)\n );\n }\n\n return 0;\n }\n\n onDrag(data: DragData): void {\n if (data.type === 'start') {\n this.resizable.start();\n }\n\n // We have to call end method without calling handleDrag to avoid layout thrashing\n if (data.type === 'end') {\n this.resizable.end();\n } else {\n this.handleDrag(data);\n }\n }\n\n handleDrag(event?: DragData) {\n if (!event) {\n this.updateFlex();\n return;\n }\n\n const isHorizontal = this.resizable.direction() === 'horizontal';\n let delta = isHorizontal ? event.x : event.y;\n\n const panels = this.resizable.panels();\n\n // Check how much we can move left (shrink panels before and including current)\n let remaining = -delta;\n for (let i = this.index; i >= 0; i--) {\n const panel = panels[i];\n remaining = panel.getUpdatedSize(panel.initialReducedSize + remaining).remaining;\n if (remaining === 0) break;\n }\n delta = delta + remaining;\n\n // Check how much we can move right (shrink panels after current)\n remaining = delta;\n for (let i = this.index + 1; i < panels.length; i++) {\n const panel = panels[i];\n remaining = panel.getUpdatedSize(panel.initialReducedSize + remaining).remaining;\n if (remaining === 0) break;\n }\n delta = delta - remaining;\n\n // Apply the validated delta\n const current = panels[this.index];\n const next = panels[this.index + 1];\n\n // Auto-Auto\n if (current.size() === 'auto' && next?.size() === 'auto') {\n this.updateSize(delta, 'prev', true);\n panels[this.index + 1]?.updateSize(-delta, 'next', true);\n this.resizable.setAuto();\n return;\n }\n\n const autos = panels.filter(p => p.size() === 'auto');\n const N = autos.length;\n\n if (N > 0) {\n // Fixed-Auto\n if (current.size() !== 'auto' && next?.size() === 'auto') {\n this.updateSize(delta, 'prev');\n const input = -delta;\n console.log('auto 1');\n autos.forEach(auto => {\n const factor = auto === next ? (N - 1) / N : -1 / N;\n auto.updateSize(input * factor, 'next', true);\n });\n this.resizable.setAuto();\n return;\n }\n\n // Auto-Fixed\n if (current.size() === 'auto' && next?.size() !== 'auto') {\n next?.updateSize(-delta, 'next');\n const input = delta;\n\n console.log('auto 2');\n autos.forEach(auto => {\n const factor = auto === current ? (N - 1) / N : -1 / N;\n auto.updateSize(input * factor, 'prev', true);\n });\n this.resizable.setAuto();\n return;\n }\n }\n\n // Fixed-Fixed\n this.updateSize(delta, 'prev');\n panels[this.index + 1]?.updateSize(-delta, 'next');\n\n this.resizable.setAuto();\n }\n\n private getUpdatedSize(px: number): { remaining: number; value: number } {\n const v = Math.max(Math.min(px, this.localMinSize), this.localMaxSize);\n return { remaining: px - v, value: v };\n }\n\n updateSize(delta: number, direct: 'prev' | 'next', force = false) {\n if (this.size() === 'auto' && !force) {\n this.reducedSize = 0;\n this.updateFlex();\n return;\n }\n\n const requestedReducedSize = this.initialReducedSize - delta;\n const { remaining, value } = this.getUpdatedSize(requestedReducedSize);\n this.reducedSize = value;\n\n this.updateFlex();\n\n const actualDelta = this.initialReducedSize - this.reducedSize;\n const unabsorbed = delta - actualDelta;\n\n console.log('unabsorbed', this.index, actualDelta, unabsorbed);\n if (unabsorbed !== 0) {\n const nextIndex = direct === 'next' ? this.index + 1 : this.index - 1;\n const neighbor = this.resizable.panels()[nextIndex];\n\n if (neighbor && neighbor.size() === 'auto') {\n const autos = this.resizable.panels().filter(p => p.size() === 'auto');\n const N = autos.length;\n if (N > 0) {\n const baseShift = unabsorbed / N;\n const targets = new Map<NgbResizable, number>();\n autos.forEach(a => targets.set(a, 0));\n\n let remaining = unabsorbed;\n const neighborIdx = autos.findIndex(a => a.index === neighbor.index);\n\n // safe guard\n if (neighborIdx === -1) return;\n\n const relevantAutos =\n direct === 'next'\n ? autos.slice(neighborIdx)\n : autos.slice(0, neighborIdx + 1).reverse();\n\n for (const panel of relevantAutos) {\n const maxShrink = panel['localMinSize'] - panel.initialReducedSize;\n const maxGrow = panel.initialReducedSize - panel['localMaxSize'];\n\n const allowedShrink = -maxShrink;\n const allowedGrow = maxGrow;\n\n const consumed = Math.max(allowedShrink, Math.min(allowedGrow, remaining));\n\n targets.set(panel, consumed);\n remaining -= consumed;\n\n if (Math.abs(remaining) < 0.1) break;\n }\n\n // const tracks: number[] = [];\n autos.forEach(auto => {\n const t = targets.get(auto) || 0;\n const d = t - baseShift;\n // tracks.push(d);\n auto.updateSize(d, direct, true);\n });\n // console.log('auto 3 ', tracks, baseShift);\n }\n } else {\n neighbor?.updateSize(unabsorbed, direct);\n }\n }\n }\n\n private calculateSize(): string {\n const size = this.lSize();\n\n if (this.size() === 'auto' && this.reducedSize === 0) {\n return size as any;\n }\n\n const baseSize = typeof size === 'number' ? `${size}%` : size;\n\n if (this.reducedSize === 0) {\n return baseSize;\n }\n\n const sign = this.reducedSize > 0 ? '-' : '+';\n const absSize = Math.abs(this.reducedSize);\n return `calc(${baseSize} ${sign} ${absSize}px)`;\n }\n\n private updateFlex() {\n const size = this.calculateSize();\n this.updateElementSize(size || '0px');\n }\n\n updateElementSize(str: string) {\n this.str = str;\n if (this.resizable.direction() === 'horizontal') {\n this.el.nativeElement.style.width = this.str;\n } else {\n this.el.nativeElement.style.height = this.str;\n }\n }\n}\n\nexport function aliasResizable(resizable: typeof NgbResizable) {\n return { provide: NgbResizable, useExisting: resizable };\n}\n","/*\n * Public API Surface of resizable\n */\n\nexport * from './resizable';\nexport * from './resizable-group';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAqBa,iBAAiB,CAAA;AAW5B,IAAA,WAAA,GAAA;AAVS,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,CAA0B,UAAU,CAAC;QAChD,IAAA,CAAA,MAAM,GAAG,eAAe,CAAe,UAAU,CAAC,MAAM,Y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,EAAA,cAAA,EAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,aAAa,OAAE,EAAE,IAAI,EAAE,WAAW,EAAE,gFAC3C,IAAI,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,IAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,MAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,KAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,KAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;AAuU1B,SAAU,cAAc,CAAC,SAA8B,EAAA;IAC3D,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE;AAC1D;;ACxXA;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"ngbase-adk-resizable.mjs","sources":["../../../projects/adk/resizable/resizable-group.ts","../../../projects/adk/resizable/resizable.ts","../../../projects/adk/resizable/public-api.ts","../../../projects/adk/resizable/ngbase-adk-resizable.ts"],"sourcesContent":["import {\n Directive,\n ElementRef,\n contentChildren,\n effect,\n forwardRef,\n inject,\n input,\n untracked,\n DOCUMENT,\n} from '@angular/core';\nimport { uniqueId } from '@ngbase/adk/utils';\nimport { NgbResizable } from './resizable';\n\n@Directive({\n selector: '[ngbResizableGroup]',\n exportAs: 'ngbResizableGroup',\n host: {\n '[attr.id]': 'id',\n },\n})\nexport class NgbResizableGroup {\n readonly document = inject(DOCUMENT);\n readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly panels = contentChildren<NgbResizable>(forwardRef(() => NgbResizable));\n\n readonly direction = input<'horizontal' | 'vertical'>('horizontal');\n\n readonly id = uniqueId();\n\n private overlayDiv?: HTMLDivElement;\n\n constructor() {\n effect(() => {\n const panels = this.panels();\n\n untracked(() => {\n // set the index of each panel first before initializing the drag\n panels.forEach((panel, index) => {\n panel.index = index;\n });\n panels.forEach((panel, index) => {\n // hide the last panel's drag handle\n panel.draggable.set(index !== panels.length - 1);\n if (panel.size() !== 'auto') {\n panel.handleDrag();\n }\n });\n // we need to called setAuto after all panels have been initialized\n // because the number of panels could have changed\n this.setAuto();\n });\n });\n }\n\n get w() {\n return this.el.nativeElement.clientWidth;\n }\n\n get h() {\n return this.el.nativeElement.clientHeight;\n }\n\n setAuto() {\n const panels = this.panels();\n let str = 'calc(100%';\n const autos = [];\n for (const panel of panels) {\n if (panel.size() !== 'auto') {\n str += panel.str ? ` - ${panel.str}` : '';\n } else {\n autos.push(panel);\n }\n }\n str += ')';\n if (autos.length > 1) {\n str = `calc(${str} / ${autos.length})`;\n }\n for (const auto of autos) {\n auto.lSize.set(str);\n auto.handleDrag();\n }\n }\n\n start() {\n const div = this.document.createElement('div');\n div.style.position = 'absolute';\n div.style.top = '0';\n div.style.left = '0';\n div.style.width = '100%';\n div.style.height = '100%';\n div.style.zIndex = '9999';\n div.style.cursor = 'ew-resize';\n this.document.body.appendChild(div);\n this.overlayDiv = div;\n\n this.panels().forEach(panel => {\n panel.onStart();\n });\n }\n\n end() {\n this.overlayDiv?.remove();\n this.panels().forEach(panel => {\n panel.onEnd();\n });\n }\n}\n\nexport function aliasResizableGroup(resizableGroup: typeof NgbResizableGroup) {\n return { provide: NgbResizableGroup, useExisting: resizableGroup };\n}\n","import {\n Directive,\n ElementRef,\n TemplateRef,\n ViewContainerRef,\n computed,\n effect,\n inject,\n input,\n linkedSignal,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { Drag, DragData } from '@ngbase/adk/drag';\nimport { NgbResizableGroup } from './resizable-group';\n\n@Directive({\n selector: '[ngbGutter]',\n exportAs: 'ngbGutter',\n hostDirectives: [Drag],\n host: {\n role: 'separator',\n '[attr.aria-valuemin]': 'resizable.min()',\n '[attr.aria-valuemax]': 'resizable.max()',\n },\n})\nexport class NgbGutter {\n readonly resizable = inject(NgbResizable);\n readonly drag = inject(Drag);\n\n constructor() {\n this.drag._lockAxis = linkedSignal(this.resizable.lockAxis);\n this.drag._dragBoundary = linkedSignal(() => `#${this.resizable.id}`);\n }\n}\n\n@Directive({\n selector: '[ngbResizable]',\n exportAs: 'ngbResizable',\n})\nexport class NgbResizable {\n // Dependencies\n readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly resizable = inject(NgbResizableGroup);\n readonly containerRef = inject(ViewContainerRef);\n readonly dragElement = viewChild('dragElement', { read: TemplateRef });\n readonly drag = viewChild(Drag);\n readonly id = this.resizable.id;\n readonly lockAxis = computed(() => (this.resizable.direction() === 'horizontal' ? 'x' : 'y'));\n\n // inputs\n readonly size = input<number | string>('auto');\n readonly min = input<number | string>(0);\n readonly max = input<number | string>();\n\n // State\n readonly lSize = linkedSignal({\n source: this.size,\n computation: size => (size !== 'auto' ? size : ''),\n });\n readonly draggable = signal(false);\n private reducedSize = 0;\n private localMinSize = Infinity;\n private localMaxSize = -Infinity;\n private lastReducedSize = 0;\n index = 0;\n str = '';\n\n constructor() {\n effect(() => {\n const size = this.size();\n untracked(() => {\n if (size !== 'auto') this.handleDrag();\n\n this.resizable.setAuto();\n });\n });\n\n // This effect is responsible for creating the gutter element\n effect(() => {\n const cf = this.containerRef;\n if (this.draggable() && this.size()) {\n if (cf.length === 0) {\n untracked(() => cf.createEmbeddedView(this.dragElement()!));\n }\n } else {\n cf.clear();\n }\n });\n\n // This effect is responsible for handling the drag events\n effect(cleanup => {\n const drag = this.drag();\n\n if (!drag) return;\n\n untracked(() => {\n const sub = drag.events.subscribe((data: DragData) => {\n data.event?.preventDefault();\n\n requestAnimationFrame(() => this.onDrag(data));\n });\n cleanup(() => sub.unsubscribe());\n });\n });\n }\n\n // get w() {\n // return this.el.nativeElement.clientWidth;\n // }\n\n // get h() {\n // return this.el.nativeElement.clientHeight;\n // }\n\n cSize() {\n return this.resizable.direction() === 'horizontal'\n ? this.el.nativeElement.offsetWidth\n : this.el.nativeElement.offsetHeight;\n }\n\n onStart() {\n const cSize = this.cSize();\n const minSize = this.getSize(this.min());\n this.localMinSize = cSize + this.reducedSize - minSize;\n if (this.max()) {\n const maxSize = this.getSize(this.max());\n this.localMaxSize = cSize + this.reducedSize - maxSize;\n }\n // console.log(`onStart ${this.index}`, this.min(), this.localMinSize, this.localMaxSize);\n }\n\n onEnd() {\n this.localMinSize = Infinity;\n this.localMaxSize = -Infinity;\n this.lastReducedSize = this.reducedSize;\n }\n\n private getSize(size?: number | string): number {\n if (!size) return 0;\n\n const minValue = size;\n if (typeof minValue === 'number') {\n // If number, treat as percentage\n return (\n (this.resizable.direction() === 'horizontal' ? this.resizable.w : this.resizable.h) *\n (minValue / 100)\n );\n }\n\n // Handle pixel values\n const pixelMatch = minValue?.toString().match(/(\\d+)px/);\n if (pixelMatch) {\n return parseInt(pixelMatch[1], 10);\n }\n\n // Handle percentage values provided as string\n const percentMatch = minValue?.toString().match(/(\\d+)%/);\n if (percentMatch) {\n return (\n (this.resizable.direction() === 'horizontal' ? this.resizable.w : this.resizable.h) *\n (parseInt(percentMatch[1], 10) / 100)\n );\n }\n\n return 0;\n }\n\n onDrag(data: DragData): void {\n if (data.type === 'start') {\n this.resizable.start();\n }\n\n // We have to call end method without calling handleDrag to avoid layout thrashing\n if (data.type === 'end') {\n this.resizable.end();\n } else {\n this.handleDrag(data);\n }\n }\n\n handleDrag(event = { x: 0, y: 0 } as DragData) {\n const isHorizontal = this.resizable.direction() === 'horizontal';\n\n let delta = isHorizontal ? event.x : event.y;\n delta -= this.lastReducedSize;\n\n const panels = this.resizable.panels();\n\n let remaining = -delta;\n for (let i = this.index; i >= 0; i--) {\n const panel = panels[i];\n remaining = panel.getUpdatedSize(remaining).remaining;\n if (remaining === 0) {\n break;\n }\n }\n delta = delta + remaining;\n remaining = delta;\n for (let i = this.index + 1; i < panels.length; i++) {\n const panel = panels[i];\n remaining = panel.getUpdatedSize(remaining).remaining;\n if (remaining === 0) {\n break;\n }\n }\n delta = delta - remaining;\n\n const current = panels[this.index];\n current.updateSize(delta, 'both');\n }\n\n private getUpdatedSize(px: number): { remaining: number; value: number } {\n const v = Math.max(Math.min(px, this.localMinSize), this.localMaxSize);\n return { remaining: px - v, value: v };\n }\n\n updateSize(px: number, direct: 'both' | 'prev' | 'next') {\n const prevSize = -px;\n const { remaining, value } = this.getUpdatedSize(prevSize);\n this.reducedSize = value;\n\n this.updateFlex();\n const isSame = prevSize !== this.reducedSize;\n\n const v = direct === 'both' ? px : remaining;\n\n if ((isSame && direct === 'next') || direct === 'both') {\n // console.log(`updateSize ${this.index}`, this.reducedSize, px, value, v);\n const next = this.resizable.panels()[this.index + 1];\n next?.updateSize(-v, 'next');\n }\n if (isSame && (direct === 'prev' || direct === 'both')) {\n const prev = this.resizable.panels()[this.index - 1];\n prev?.updateSize(v, 'prev');\n }\n }\n\n private calculateSize(): string {\n const size = this.lSize();\n\n const baseSize = typeof size === 'number' ? `${size}%` : size;\n\n if (this.reducedSize === 0) {\n return baseSize;\n }\n\n return `calc(${baseSize} - ${this.reducedSize}px)`;\n }\n\n private updateFlex() {\n const size = this.calculateSize();\n this.updateElementSize(size || '0px');\n }\n\n updateElementSize(str: string) {\n this.str = str;\n if (this.resizable.direction() === 'horizontal') {\n this.el.nativeElement.style.width = this.str;\n } else {\n this.el.nativeElement.style.height = this.str;\n }\n }\n}\n\nexport function aliasResizable(resizable: typeof NgbResizable) {\n return { provide: NgbResizable, useExisting: resizable };\n}\n","/*\n * Public API Surface of resizable\n */\n\nexport * from './resizable';\nexport * from './resizable-group';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAqBa,iBAAiB,CAAA;AAW5B,IAAA,WAAA,GAAA;AAVS,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,CAA0B,UAAU,CAAC;QAChD,IAAA,CAAA,MAAM,GAAG,eAAe,CAAe,UAAU,CAAC,MAAM,YAAY,CAAC,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,QAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAC;AAEtE,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAA4B,YAAY,qDAAC;QAE1D,IAAA,CAAA,EAAE,GAAG,QAAQ,EAAE;QAKtB,MAAM,CAAC,MAAK;AACV,YAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE;YAE5B,SAAS,CAAC,MAAK;;gBAEb,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,KAAI;AAC9B,oBAAA,KAAK,CAAC,KAAK,GAAG,KAAK;AACrB,gBAAA,CAAC,CAAC;gBACF,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,KAAI;;AAE9B,oBAAA,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,KAAK,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;AAChD,oBAAA,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,MAAM,EAAE;wBAC3B,KAAK,CAAC,UAAU,EAAE;oBACpB;AACF,gBAAA,CAAC,CAAC;;;gBAGF,IAAI,CAAC,OAAO,EAAE;AAChB,YAAA,CAAC,CAAC;AACJ,QAAA,CAAC,CAAC;IACJ;AAEA,IAAA,IAAI,CAA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A,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,MAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,KAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,KAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;AA2N1B,SAAU,cAAc,CAAC,SAA8B,EAAA;IAC3D,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE;AAC1D;;AC5QA;;AAEG;;ACFH;;AAEG;;;;"}
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, input, booleanAttribute, output, signal, linkedSignal, Directive, contentChildren, viewChild, TemplateRef, model, computed, effect, untracked, contentChild } from '@angular/core';
2
+ import { signal, Directive, inject, ElementRef, viewChild, TemplateRef, model, input, booleanAttribute, output, computed, effect, untracked, contentChild, numberAttribute, linkedSignal, forwardRef, DestroyRef } from '@angular/core';
3
3
  import * as i1 from '@ngbase/adk/a11y';
4
- import { AccessibleItem, AccessibleGroup, Autofocus } from '@ngbase/adk/a11y';
4
+ import { AccessibleGroup, AccessibleItem, Autofocus } from '@ngbase/adk/a11y';
5
5
  import { uniqueId, filterFunction } from '@ngbase/adk/utils';
6
6
  import { Directionality } from '@ngbase/adk/bidi';
7
7
  import { ngbPopoverPortal } from '@ngbase/adk/popover';
@@ -9,59 +9,6 @@ import { Subject } from 'rxjs';
9
9
  import * as i2 from '@ngbase/adk/form-field';
10
10
  import { InputBase } from '@ngbase/adk/form-field';
11
11
 
12
- class NgbOption {
13
- constructor() {
14
- this.allyItem = inject(AccessibleItem);
15
- this.el = inject(ElementRef);
16
- // inputs
17
- this.value = input(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
18
- this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
19
- this.ayId = input(...(ngDevMode ? [undefined, { debugName: "ayId" }] : []));
20
- // outputs
21
- this.onSelectionChange = output();
22
- this.multiple = signal(false, ...(ngDevMode ? [{ debugName: "multiple" }] : []));
23
- this.checked = signal(false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
24
- this.active = signal(false, ...(ngDevMode ? [{ debugName: "active" }] : []));
25
- this._ayId = linkedSignal({ ...(ngDevMode ? { debugName: "_ayId" } : {}), source: this.ayId, computation: id => id || '' });
26
- this.allyItem._ayId = this._ayId;
27
- this.allyItem._disabled = this.disabled;
28
- }
29
- selectOption() { }
30
- setAyId(id) {
31
- this._ayId.set(id);
32
- }
33
- label() {
34
- return this.el.nativeElement.textContent || '';
35
- }
36
- focus() {
37
- this.el.nativeElement.scrollIntoView({ block: 'nearest' });
38
- this.el.nativeElement.classList.add('bg-muted');
39
- }
40
- unselect() {
41
- this.el.nativeElement.classList.remove('bg-muted');
42
- }
43
- getValue() {
44
- if (this.value() === undefined) {
45
- return this.label();
46
- }
47
- return this.value();
48
- }
49
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: NgbOption, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
50
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.2", type: NgbOption, isStandalone: true, selector: "[ngbOption]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ayId: { classPropertyName: "ayId", publicName: "ayId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onSelectionChange: "onSelectionChange" }, host: { attributes: { "role": "option", "tabindex": "-1" }, listeners: { "click": "selectOption()" } }, hostDirectives: [{ directive: i1.AccessibleItem }], ngImport: i0 }); }
51
- }
52
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: NgbOption, decorators: [{
53
- type: Directive,
54
- args: [{
55
- selector: '[ngbOption]',
56
- hostDirectives: [AccessibleItem],
57
- host: {
58
- role: 'option',
59
- tabindex: '-1',
60
- '(click)': 'selectOption()',
61
- },
62
- }]
63
- }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], ayId: [{ type: i0.Input, args: [{ isSignal: true, alias: "ayId", required: false }] }], onSelectionChange: [{ type: i0.Output, args: ["onSelectionChange"] }] } });
64
-
65
12
  class NgbSelectTarget {
66
13
  constructor() {
67
14
  this.target = signal(null, ...(ngDevMode ? [{ debugName: "target" }] : []));
@@ -76,13 +23,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
76
23
  }]
77
24
  }] });
78
25
  class SelectBase {
26
+ registerOption(option) {
27
+ this.registered.update(list => [...list, option]);
28
+ }
29
+ unregisterOption(option) {
30
+ this.registered.update(list => list.filter(o => o !== option));
31
+ }
79
32
  constructor(isSelect) {
80
33
  this.isSelect = isSelect;
81
34
  // Dependencies
82
35
  this.el = inject(ElementRef);
83
36
  this.dir = inject(Directionality);
84
37
  this.target = inject(NgbSelectTarget, { optional: true });
85
- this.list = contentChildren(NgbOption, { ...(ngDevMode ? { debugName: "list" } : {}), descendants: true });
38
+ this.registered = signal([], ...(ngDevMode ? [{ debugName: "registered" }] : []));
39
+ this.list = this.registered.asReadonly();
86
40
  this.popover = ngbPopoverPortal();
87
41
  this.optionsTemplate = viewChild('optionsTemplate', { ...(ngDevMode ? { debugName: "optionsTemplate" } : {}), read: TemplateRef });
88
42
  this.container = viewChild('container', { ...(ngDevMode ? { debugName: "container" } : {}), read: ElementRef });
@@ -91,6 +45,7 @@ class SelectBase {
91
45
  this.value = model('', ...(ngDevMode ? [{ debugName: "value" }] : []));
92
46
  this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
93
47
  this.touched = model(false, ...(ngDevMode ? [{ debugName: "touched" }] : []));
48
+ this.labelFn = input(undefined, ...(ngDevMode ? [{ debugName: "labelFn" }] : []));
94
49
  this.multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : {}), transform: booleanAttribute });
95
50
  this.noAutoClose = input(false, { ...(ngDevMode ? { debugName: "noAutoClose" } : {}), transform: booleanAttribute });
96
51
  this.options = input([], ...(ngDevMode ? [{ debugName: "options" }] : []));
@@ -106,21 +61,34 @@ class SelectBase {
106
61
  this.previousValue = '';
107
62
  this.events = new Subject();
108
63
  this.ayId = uniqueId();
64
+ // Cache of value -> label. Populated when options register/are selected.
65
+ // Allows display value to persist after option is destroyed (e.g. virtual scroll).
66
+ this.labelCache = signal(new Map(), ...(ngDevMode ? [{ debugName: "labelCache" }] : []));
109
67
  this.cValue = computed(() => {
110
68
  if (!this.isSelect && this.status() === 'opened') {
111
69
  return this.previousValue;
112
70
  }
113
71
  const multiple = this.multiple();
72
+ const filtered = this.values();
73
+ const labelFn = this.labelFn();
74
+ const cache = this.labelCache();
114
75
  const options = this.list();
115
- const filtered = this.values(); // .filter(x => x !== undefined && x !== null && x !== '');
116
- const values = filtered.length
117
- ? options.reduce((acc, option) => {
118
- if (filtered.includes(option.getValue())) {
119
- acc.push(option.label());
120
- }
121
- return acc;
122
- }, [])
123
- : [];
76
+ const values = filtered
77
+ .filter(v => v !== undefined && v !== null && v !== '')
78
+ .map(v => {
79
+ // Prefer fresh DOM label if option currently registered
80
+ const opt = options.find(o => o.getValue() === v);
81
+ if (opt)
82
+ return opt.label();
83
+ // Then cached label from previous registration
84
+ const cached = cache.get(v);
85
+ if (cached)
86
+ return cached;
87
+ // Then user-supplied label function (data-driven virtual scroll)
88
+ if (labelFn)
89
+ return labelFn(v);
90
+ return '';
91
+ });
124
92
  // if the value is greater than 1, then take the first value and add a plus sign with the length of the remaining values
125
93
  if (multiple && values.length > 1) {
126
94
  this.previousValue = `${values[0]} (+${values.length - 1})`;
@@ -175,6 +143,31 @@ class SelectBase {
175
143
  option.checked.set(values.includes(option.getValue()));
176
144
  });
177
145
  });
146
+ // Cache labels of currently-selected options so display value survives
147
+ // option destruction (e.g., virtual scroll removing off-screen items).
148
+ effect(() => {
149
+ const options = this.list();
150
+ const values = this.values();
151
+ untracked(() => {
152
+ const cache = this.labelCache();
153
+ let next = null;
154
+ for (const o of options) {
155
+ const v = o.getValue();
156
+ if (!values.includes(v))
157
+ continue;
158
+ const lbl = o.label();
159
+ if (!lbl)
160
+ continue;
161
+ if (cache.get(v) !== lbl) {
162
+ if (!next)
163
+ next = new Map(cache);
164
+ next.set(v, lbl);
165
+ }
166
+ }
167
+ if (next)
168
+ this.labelCache.set(next);
169
+ });
170
+ });
178
171
  // Sync value model to internal values array
179
172
  effect(() => this.updateValues(this.value()));
180
173
  }
@@ -286,11 +279,31 @@ class SelectBase {
286
279
  this.close();
287
280
  }
288
281
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: SelectBase, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive }); }
289
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.1.2", type: SelectBase, isStandalone: true, inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, noAutoClose: { classPropertyName: "noAutoClose", publicName: "noAutoClose", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touched: "touchedChange", opened: "opened", closed: "closed" }, queries: [{ propertyName: "list", predicate: NgbOption, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "optionsTemplate", first: true, predicate: ["optionsTemplate"], descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "optionsGroup", first: true, predicate: ["optionsGroup"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0 }); }
282
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.1.2", type: SelectBase, isStandalone: true, inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, labelFn: { classPropertyName: "labelFn", publicName: "labelFn", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, noAutoClose: { classPropertyName: "noAutoClose", publicName: "noAutoClose", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touched: "touchedChange", opened: "opened", closed: "closed" }, viewQueries: [{ propertyName: "optionsTemplate", first: true, predicate: ["optionsTemplate"], descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "optionsGroup", first: true, predicate: ["optionsGroup"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0 }); }
290
283
  }
291
284
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: SelectBase, decorators: [{
292
285
  type: Directive
293
- }], ctorParameters: () => [{ type: undefined }], propDecorators: { list: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => NgbOption), { ...{ descendants: true }, isSignal: true }] }], optionsTemplate: [{ type: i0.ViewChild, args: ['optionsTemplate', { ...{ read: TemplateRef }, isSignal: true }] }], container: [{ type: i0.ViewChild, args: ['container', { ...{ read: ElementRef }, isSignal: true }] }], optionsGroup: [{ type: i0.ViewChild, args: ['optionsGroup', { ...{ read: ElementRef }, isSignal: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], noAutoClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "noAutoClose", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
286
+ }], ctorParameters: () => [{ type: undefined }], propDecorators: { optionsTemplate: [{ type: i0.ViewChild, args: ['optionsTemplate', { ...{ read: TemplateRef }, isSignal: true }] }], container: [{ type: i0.ViewChild, args: ['container', { ...{ read: ElementRef }, isSignal: true }] }], optionsGroup: [{ type: i0.ViewChild, args: ['optionsGroup', { ...{ read: ElementRef }, isSignal: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], labelFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelFn", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], noAutoClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "noAutoClose", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
287
+
288
+ function flattenForVirtualScroll(items, groupKey, groupLabelKey) {
289
+ if (!groupKey) {
290
+ return items.map(item => ({ type: 'option', value: item }));
291
+ }
292
+ const result = [];
293
+ for (const group of items) {
294
+ result.push({
295
+ type: 'group-header',
296
+ label: group[groupLabelKey || 'label'],
297
+ });
298
+ const children = group[groupKey];
299
+ if (children) {
300
+ for (const child of children) {
301
+ result.push({ type: 'option', value: child });
302
+ }
303
+ }
304
+ }
305
+ return result;
306
+ }
294
307
 
295
308
  class NgbSelectOption {
296
309
  constructor() {
@@ -349,10 +362,82 @@ class NgbSelect extends SelectBase {
349
362
  this.search = model('', ...(ngDevMode ? [{ debugName: "search" }] : []));
350
363
  this.filterFn = input((option) => option, ...(ngDevMode ? [{ debugName: "filterFn" }] : []));
351
364
  this.filterOptions = input(...(ngDevMode ? [undefined, { debugName: "filterOptions" }] : []));
365
+ // Virtual scroll inputs
366
+ this.virtualScroll = input(false, { ...(ngDevMode ? { debugName: "virtualScroll" } : {}), transform: booleanAttribute });
367
+ this.itemSize = input(36, { ...(ngDevMode ? { debugName: "itemSize" } : {}), transform: numberAttribute });
368
+ this.groupKey = input(...(ngDevMode ? [undefined, { debugName: "groupKey" }] : []));
369
+ this.groupLabelKey = input(...(ngDevMode ? [undefined, { debugName: "groupLabelKey" }] : []));
352
370
  this.optionsFilter = filterFunction(this.options, computed(() => this.filterOptions() ?? { filter: this.filterFn() }));
371
+ // Flattened items for virtual scroll rendering
372
+ this.virtualItems = computed(() => {
373
+ if (!this.virtualScroll())
374
+ return [];
375
+ const filtered = this.optionsFilter.filteredList();
376
+ return flattenForVirtualScroll(filtered, this.groupKey(), this.groupLabelKey());
377
+ }, ...(ngDevMode ? [{ debugName: "virtualItems" }] : []));
378
+ // Keyboard navigation state for virtual mode
379
+ this.focusedVirtualIndex = signal(-1, ...(ngDevMode ? [{ debugName: "focusedVirtualIndex" }] : []));
380
+ this.scrollToIndexFn = signal(null, ...(ngDevMode ? [{ debugName: "scrollToIndexFn" }] : []));
381
+ // Reset scroll position when filtered list changes in virtual mode
382
+ effect(() => {
383
+ this.optionsFilter.filteredList();
384
+ untracked(() => {
385
+ if (this.virtualScroll()) {
386
+ this.focusedVirtualIndex.set(-1);
387
+ this.scrollToIndexFn()?.call(null, 0);
388
+ }
389
+ });
390
+ });
391
+ }
392
+ handleVirtualKeydown(event) {
393
+ const items = this.virtualItems();
394
+ if (!items.length)
395
+ return;
396
+ const current = this.focusedVirtualIndex();
397
+ let next = current;
398
+ switch (event.key) {
399
+ case 'ArrowDown':
400
+ next = current + 1;
401
+ break;
402
+ case 'ArrowUp':
403
+ next = current - 1;
404
+ break;
405
+ case 'Enter':
406
+ case ' ': {
407
+ const item = items[current];
408
+ if (item?.type === 'option' && item.value !== undefined) {
409
+ this.selectVirtualItem(item.value);
410
+ }
411
+ event.preventDefault();
412
+ return;
413
+ }
414
+ case 'Escape':
415
+ this.close();
416
+ event.preventDefault();
417
+ return;
418
+ default:
419
+ return;
420
+ }
421
+ event.preventDefault();
422
+ // Skip group headers
423
+ const dir = event.key === 'ArrowDown' ? 1 : -1;
424
+ while (next >= 0 && next < items.length && items[next].type === 'group-header') {
425
+ next += dir;
426
+ }
427
+ if (next < 0 || next >= items.length)
428
+ return;
429
+ this.focusedVirtualIndex.set(next);
430
+ this.scrollToIndexFn()?.call(null, next);
431
+ }
432
+ selectVirtualItem(value) {
433
+ const list = this.list();
434
+ const option = list.find(o => o.getValue() === value);
435
+ if (option) {
436
+ option.selectOption();
437
+ }
353
438
  }
354
439
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: NgbSelect, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
355
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.1.2", type: NgbSelect, isStandalone: true, selector: "[ngbSelect]", inputs: { search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, filterFn: { classPropertyName: "filterFn", publicName: "filterFn", isSignal: true, isRequired: false, transformFunction: null }, filterOptions: { classPropertyName: "filterOptions", publicName: "filterOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { search: "searchChange" }, host: { attributes: { "role": "listbox", "type": "button" }, listeners: { "click": "open()", "blur": "touched.set(true)", "keydown.arrowdown": "$event.preventDefault(); open()", "keydown.arrowup": "$event.preventDefault(); open()", "keydown.enter": "$event.preventDefault(); open()", "keydown.space": "$event.preventDefault(); open()" }, properties: { "tabindex": "disabled() ? -1 : 0" } }, providers: [{ provide: SelectBase, useExisting: NgbSelect }], queries: [{ propertyName: "optionTemplate", first: true, predicate: (NgbSelectOption), descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0 }); }
440
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.1.2", type: NgbSelect, isStandalone: true, selector: "[ngbSelect]", inputs: { search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, filterFn: { classPropertyName: "filterFn", publicName: "filterFn", isSignal: true, isRequired: false, transformFunction: null }, filterOptions: { classPropertyName: "filterOptions", publicName: "filterOptions", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, itemSize: { classPropertyName: "itemSize", publicName: "itemSize", isSignal: true, isRequired: false, transformFunction: null }, groupKey: { classPropertyName: "groupKey", publicName: "groupKey", isSignal: true, isRequired: false, transformFunction: null }, groupLabelKey: { classPropertyName: "groupLabelKey", publicName: "groupLabelKey", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { search: "searchChange" }, host: { attributes: { "role": "listbox", "type": "button" }, listeners: { "click": "open()", "blur": "touched.set(true)", "keydown.arrowdown": "$event.preventDefault(); open()", "keydown.arrowup": "$event.preventDefault(); open()", "keydown.enter": "$event.preventDefault(); open()", "keydown.space": "$event.preventDefault(); open()" }, properties: { "tabindex": "disabled() ? -1 : 0" } }, providers: [{ provide: SelectBase, useExisting: NgbSelect }], queries: [{ propertyName: "optionTemplate", first: true, predicate: (NgbSelectOption), descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0 }); }
356
441
  }
357
442
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: NgbSelect, decorators: [{
358
443
  type: Directive,
@@ -371,7 +456,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
371
456
  '[tabindex]': 'disabled() ? -1 : 0',
372
457
  },
373
458
  }]
374
- }], ctorParameters: () => [], propDecorators: { optionTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NgbSelectOption), { isSignal: true }] }], search: [{ type: i0.Input, args: [{ isSignal: true, alias: "search", required: false }] }, { type: i0.Output, args: ["searchChange"] }], filterFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterFn", required: false }] }], filterOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterOptions", required: false }] }] } });
459
+ }], ctorParameters: () => [], propDecorators: { optionTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NgbSelectOption), { isSignal: true }] }], search: [{ type: i0.Input, args: [{ isSignal: true, alias: "search", required: false }] }, { type: i0.Output, args: ["searchChange"] }], filterFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterFn", required: false }] }], filterOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterOptions", required: false }] }], virtualScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScroll", required: false }] }], itemSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemSize", required: false }] }], groupKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupKey", required: false }] }], groupLabelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupLabelKey", required: false }] }] } });
375
460
  function aliasSelect(select) {
376
461
  return [
377
462
  { provide: SelectBase, useExisting: select },
@@ -379,6 +464,64 @@ function aliasSelect(select) {
379
464
  ];
380
465
  }
381
466
 
467
+ class NgbOption {
468
+ constructor() {
469
+ this.allyItem = inject(AccessibleItem);
470
+ this.el = inject(ElementRef);
471
+ // inputs
472
+ this.value = input(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
473
+ this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
474
+ this.ayId = input(...(ngDevMode ? [undefined, { debugName: "ayId" }] : []));
475
+ // outputs
476
+ this.onSelectionChange = output();
477
+ this.multiple = signal(false, ...(ngDevMode ? [{ debugName: "multiple" }] : []));
478
+ this.checked = signal(false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
479
+ this.active = signal(false, ...(ngDevMode ? [{ debugName: "active" }] : []));
480
+ this._ayId = linkedSignal({ ...(ngDevMode ? { debugName: "_ayId" } : {}), source: this.ayId, computation: id => id || '' });
481
+ this.allyItem._ayId = this._ayId;
482
+ this.allyItem._disabled = this.disabled;
483
+ const select = inject(forwardRef(() => SelectBase), { optional: true });
484
+ if (select) {
485
+ select.registerOption(this);
486
+ inject(DestroyRef).onDestroy(() => select.unregisterOption(this));
487
+ }
488
+ }
489
+ selectOption() { }
490
+ setAyId(id) {
491
+ this._ayId.set(id);
492
+ }
493
+ label() {
494
+ return this.el.nativeElement.textContent || '';
495
+ }
496
+ focus() {
497
+ this.el.nativeElement.scrollIntoView({ block: 'nearest' });
498
+ this.el.nativeElement.classList.add('bg-muted');
499
+ }
500
+ unselect() {
501
+ this.el.nativeElement.classList.remove('bg-muted');
502
+ }
503
+ getValue() {
504
+ if (this.value() === undefined) {
505
+ return this.label();
506
+ }
507
+ return this.value();
508
+ }
509
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: NgbOption, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
510
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.2", type: NgbOption, isStandalone: true, selector: "[ngbOption]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ayId: { classPropertyName: "ayId", publicName: "ayId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onSelectionChange: "onSelectionChange" }, host: { attributes: { "role": "option", "tabindex": "-1" }, listeners: { "click": "selectOption()" } }, hostDirectives: [{ directive: i1.AccessibleItem }], ngImport: i0 }); }
511
+ }
512
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: NgbOption, decorators: [{
513
+ type: Directive,
514
+ args: [{
515
+ selector: '[ngbOption]',
516
+ hostDirectives: [AccessibleItem],
517
+ host: {
518
+ role: 'option',
519
+ tabindex: '-1',
520
+ '(click)': 'selectOption()',
521
+ },
522
+ }]
523
+ }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], ayId: [{ type: i0.Input, args: [{ isSignal: true, alias: "ayId", required: false }] }], onSelectionChange: [{ type: i0.Output, args: ["onSelectionChange"] }] } });
524
+
382
525
  class NgbOptionGroup {
383
526
  constructor() {
384
527
  this.label = input.required(...(ngDevMode ? [{ debugName: "label" }] : []));
@@ -473,5 +616,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
473
616
  * Generated bundle index. Do not edit.
474
617
  */
475
618
 
476
- export { ListSelection, NgbOption, NgbOptionGroup, NgbSelect, NgbSelectInput, NgbSelectOption, NgbSelectOptionGroup, NgbSelectTarget, NgbSelectTrigger, SelectBase, SelectValue, aliasSelect };
619
+ export { ListSelection, NgbOption, NgbOptionGroup, NgbSelect, NgbSelectInput, NgbSelectOption, NgbSelectOptionGroup, NgbSelectTarget, NgbSelectTrigger, SelectBase, SelectValue, aliasSelect, flattenForVirtualScroll };
477
620
  //# sourceMappingURL=ngbase-adk-select.mjs.map