@ngneers/controls 0.0.1-pre6 → 0.0.1-pre7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ngneers-controls-accordion.mjs +10 -10
- package/fesm2022/ngneers-controls-accordion.mjs.map +1 -1
- package/fesm2022/ngneers-controls-api-ng.mjs +12 -9
- package/fesm2022/ngneers-controls-api-ng.mjs.map +1 -1
- package/fesm2022/ngneers-controls-avatar.mjs +6 -6
- package/fesm2022/ngneers-controls-avatar.mjs.map +1 -1
- package/fesm2022/ngneers-controls-base.mjs +9 -9
- package/fesm2022/ngneers-controls-base.mjs.map +1 -1
- package/fesm2022/ngneers-controls-breadcrumb.mjs +7 -7
- package/fesm2022/ngneers-controls-breadcrumb.mjs.map +1 -1
- package/fesm2022/ngneers-controls-button-group.mjs +3 -3
- package/fesm2022/ngneers-controls-button-group.mjs.map +1 -1
- package/fesm2022/ngneers-controls-button.mjs +6 -6
- package/fesm2022/ngneers-controls-button.mjs.map +1 -1
- package/fesm2022/{ngneers-controls-calendar-time-Bzlv9Vkn.mjs → ngneers-controls-calendar-time-CKAqRgOP.mjs} +4 -4
- package/fesm2022/{ngneers-controls-calendar-time-Bzlv9Vkn.mjs.map → ngneers-controls-calendar-time-CKAqRgOP.mjs.map} +1 -1
- package/fesm2022/ngneers-controls-calendar.mjs +11 -11
- package/fesm2022/ngneers-controls-calendar.mjs.map +1 -1
- package/fesm2022/ngneers-controls-checkbox.mjs +4 -4
- package/fesm2022/ngneers-controls-checkbox.mjs.map +1 -1
- package/fesm2022/ngneers-controls-chip.mjs +4 -4
- package/fesm2022/ngneers-controls-chip.mjs.map +1 -1
- package/fesm2022/ngneers-controls-default-icons.mjs +61 -0
- package/fesm2022/ngneers-controls-default-icons.mjs.map +1 -0
- package/fesm2022/ngneers-controls-defer.mjs +3 -3
- package/fesm2022/ngneers-controls-defer.mjs.map +1 -1
- package/fesm2022/ngneers-controls-dialog.mjs +10 -10
- package/fesm2022/ngneers-controls-dialog.mjs.map +1 -1
- package/fesm2022/ngneers-controls-directives.mjs +21 -21
- package/fesm2022/ngneers-controls-directives.mjs.map +1 -1
- package/fesm2022/ngneers-controls-drawer.mjs +7 -7
- package/fesm2022/ngneers-controls-drawer.mjs.map +1 -1
- package/fesm2022/ngneers-controls-edit-inplace.mjs +7 -7
- package/fesm2022/ngneers-controls-edit-inplace.mjs.map +1 -1
- package/fesm2022/ngneers-controls-filter.mjs +4 -4
- package/fesm2022/ngneers-controls-filter.mjs.map +1 -1
- package/fesm2022/ngneers-controls-i18n.mjs +3 -3
- package/fesm2022/ngneers-controls-i18n.mjs.map +1 -1
- package/fesm2022/ngneers-controls-icon.mjs +108 -44
- package/fesm2022/ngneers-controls-icon.mjs.map +1 -1
- package/fesm2022/ngneers-controls-inplace.mjs +6 -6
- package/fesm2022/ngneers-controls-inplace.mjs.map +1 -1
- package/fesm2022/ngneers-controls-input-field.mjs +5 -5
- package/fesm2022/ngneers-controls-input-field.mjs.map +1 -1
- package/fesm2022/ngneers-controls-input-mask.mjs +3 -3
- package/fesm2022/ngneers-controls-input-mask.mjs.map +1 -1
- package/fesm2022/ngneers-controls-input.mjs +3 -3
- package/fesm2022/ngneers-controls-input.mjs.map +1 -1
- package/fesm2022/ngneers-controls-item-view.mjs +6 -6
- package/fesm2022/ngneers-controls-item-view.mjs.map +1 -1
- package/fesm2022/ngneers-controls-list-box.mjs +6 -6
- package/fesm2022/ngneers-controls-list-box.mjs.map +1 -1
- package/fesm2022/ngneers-controls-menu.mjs +10 -10
- package/fesm2022/ngneers-controls-menu.mjs.map +1 -1
- package/fesm2022/ngneers-controls-message.mjs +3 -3
- package/fesm2022/ngneers-controls-message.mjs.map +1 -1
- package/fesm2022/ngneers-controls-paginator.mjs +4 -4
- package/fesm2022/ngneers-controls-paginator.mjs.map +1 -1
- package/fesm2022/ngneers-controls-popover.mjs +11 -6
- package/fesm2022/ngneers-controls-popover.mjs.map +1 -1
- package/fesm2022/ngneers-controls-progress.mjs +3 -3
- package/fesm2022/ngneers-controls-progress.mjs.map +1 -1
- package/fesm2022/ngneers-controls-scroll-shadow.mjs +54 -0
- package/fesm2022/ngneers-controls-scroll-shadow.mjs.map +1 -0
- package/fesm2022/ngneers-controls-scroller.mjs +9 -9
- package/fesm2022/ngneers-controls-scroller.mjs.map +1 -1
- package/fesm2022/ngneers-controls-select-button.mjs +4 -4
- package/fesm2022/ngneers-controls-select-button.mjs.map +1 -1
- package/fesm2022/ngneers-controls-select.mjs +8 -7
- package/fesm2022/ngneers-controls-select.mjs.map +1 -1
- package/fesm2022/ngneers-controls-slider.mjs +3 -3
- package/fesm2022/ngneers-controls-slider.mjs.map +1 -1
- package/fesm2022/ngneers-controls-spinner.mjs +3 -3
- package/fesm2022/ngneers-controls-spinner.mjs.map +1 -1
- package/fesm2022/ngneers-controls-splitter.mjs +10 -10
- package/fesm2022/ngneers-controls-splitter.mjs.map +1 -1
- package/fesm2022/ngneers-controls-switch.mjs +3 -3
- package/fesm2022/ngneers-controls-switch.mjs.map +1 -1
- package/fesm2022/ngneers-controls-table.mjs +227 -293
- package/fesm2022/ngneers-controls-table.mjs.map +1 -1
- package/fesm2022/ngneers-controls-tabs.mjs +10 -10
- package/fesm2022/ngneers-controls-tabs.mjs.map +1 -1
- package/fesm2022/ngneers-controls-tag.mjs +3 -3
- package/fesm2022/ngneers-controls-tag.mjs.map +1 -1
- package/fesm2022/ngneers-controls-toast.mjs +10 -10
- package/fesm2022/ngneers-controls-toast.mjs.map +1 -1
- package/fesm2022/ngneers-controls-toggle-button.mjs +4 -4
- package/fesm2022/ngneers-controls-toggle-button.mjs.map +1 -1
- package/fesm2022/ngneers-controls-tooltip.mjs +44 -8
- package/fesm2022/ngneers-controls-tooltip.mjs.map +1 -1
- package/fesm2022/ngneers-controls-utils-ng.mjs +3 -3
- package/fesm2022/ngneers-controls-utils-ng.mjs.map +1 -1
- package/fesm2022/ngneers-controls-utils.mjs +1 -1
- package/fesm2022/ngneers-controls-utils.mjs.map +1 -1
- package/package.json +29 -11
- package/types/ngneers-controls-accordion.d.ts +6 -4
- package/types/ngneers-controls-api-ng.d.ts +5 -0
- package/types/ngneers-controls-api.d.ts +2 -2
- package/types/ngneers-controls-breadcrumb.d.ts +5 -3
- package/types/ngneers-controls-checkbox.d.ts +5 -3
- package/types/ngneers-controls-chip.d.ts +3 -1
- package/types/ngneers-controls-default-icons.d.ts +5 -0
- package/types/ngneers-controls-drawer.d.ts +3 -1
- package/types/ngneers-controls-filter.d.ts +1 -1
- package/types/ngneers-controls-icon.d.ts +23 -40
- package/types/ngneers-controls-input-field.d.ts +3 -1
- package/types/ngneers-controls-item-view.d.ts +4 -2
- package/types/ngneers-controls-menu.d.ts +3 -1
- package/types/ngneers-controls-message.d.ts +3 -1
- package/types/ngneers-controls-popover.d.ts +1 -0
- package/types/ngneers-controls-scroll-shadow.d.ts +16 -0
- package/types/ngneers-controls-select.d.ts +5 -10
- package/types/ngneers-controls-table.d.ts +29 -41
- package/types/ngneers-controls-tabs.d.ts +4 -2
- package/types/ngneers-controls-tag.d.ts +3 -1
- package/types/ngneers-controls-toast.d.ts +4 -2
- package/types/ngneers-controls-toggle-button.d.ts +5 -3
- package/types/ngneers-controls-tooltip.d.ts +7 -1
- package/fesm2022/ngneers-controls-icon-calendar-z5xA9wTT.mjs +0 -4
- package/fesm2022/ngneers-controls-icon-calendar-z5xA9wTT.mjs.map +0 -1
- package/fesm2022/ngneers-controls-icon-check-DdAQ9k-T.mjs +0 -4
- package/fesm2022/ngneers-controls-icon-check-DdAQ9k-T.mjs.map +0 -1
- package/fesm2022/ngneers-controls-icon-chevron_down-HO-z-xOr.mjs +0 -4
- package/fesm2022/ngneers-controls-icon-chevron_down-HO-z-xOr.mjs.map +0 -1
- package/fesm2022/ngneers-controls-icon-chevron_left-CC5psi16.mjs +0 -4
- package/fesm2022/ngneers-controls-icon-chevron_left-CC5psi16.mjs.map +0 -1
- package/fesm2022/ngneers-controls-icon-chevron_right-BRxlzx4G.mjs +0 -4
- package/fesm2022/ngneers-controls-icon-chevron_right-BRxlzx4G.mjs.map +0 -1
- package/fesm2022/ngneers-controls-icon-chevron_up-cqhPO7g2.mjs +0 -4
- package/fesm2022/ngneers-controls-icon-chevron_up-cqhPO7g2.mjs.map +0 -1
- package/fesm2022/ngneers-controls-icon-ellipsis-DXIGA1sk.mjs +0 -4
- package/fesm2022/ngneers-controls-icon-ellipsis-DXIGA1sk.mjs.map +0 -1
- package/fesm2022/ngneers-controls-icon-filter-oU7E6Xgr.mjs +0 -4
- package/fesm2022/ngneers-controls-icon-filter-oU7E6Xgr.mjs.map +0 -1
- package/fesm2022/ngneers-controls-icon-filter_solid-CqIKuR4N.mjs +0 -4
- package/fesm2022/ngneers-controls-icon-filter_solid-CqIKuR4N.mjs.map +0 -1
- package/fesm2022/ngneers-controls-icon-magnifying_glass-T4Hzbkig.mjs +0 -4
- package/fesm2022/ngneers-controls-icon-magnifying_glass-T4Hzbkig.mjs.map +0 -1
- package/fesm2022/ngneers-controls-icon-minus-oGDEFO4E.mjs +0 -4
- package/fesm2022/ngneers-controls-icon-minus-oGDEFO4E.mjs.map +0 -1
- package/fesm2022/ngneers-controls-icon-sort-CRD4tafz.mjs +0 -4
- package/fesm2022/ngneers-controls-icon-sort-CRD4tafz.mjs.map +0 -1
- package/fesm2022/ngneers-controls-icon-sort_down-DiFB1P6R.mjs +0 -4
- package/fesm2022/ngneers-controls-icon-sort_down-DiFB1P6R.mjs.map +0 -1
- package/fesm2022/ngneers-controls-icon-sort_up-Bq_q3hIi.mjs +0 -4
- package/fesm2022/ngneers-controls-icon-sort_up-Bq_q3hIi.mjs.map +0 -1
- package/fesm2022/ngneers-controls-icon-xmark-BZKZORiu.mjs +0 -4
- package/fesm2022/ngneers-controls-icon-xmark-BZKZORiu.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngneers-controls-input-mask.mjs","sources":["../../src/input-mask/masks.ts","../../src/input-mask/helper.ts","../../src/input-mask/input-mask.ts","../../src/input-mask/input-mask.html","../../src/input-mask/ngneers-controls-input-mask.ts"],"sourcesContent":["import type { InputMaskCfg } from './types';\r\n\r\nconst time = [\r\n {\r\n accepts: /^\\d$/,\r\n default: '0',\r\n placeholder: 'H',\r\n },\r\n {\r\n accepts: /^\\d$/,\r\n default: '0',\r\n placeholder: 'H',\r\n },\r\n ':',\r\n {\r\n accepts: /^\\d$/,\r\n default: '0',\r\n placeholder: 'M',\r\n },\r\n {\r\n accepts: /^\\d$/,\r\n default: '0',\r\n placeholder: 'M',\r\n },\r\n] as const satisfies InputMaskCfg;\r\n\r\nconst timeSeconds = [\r\n ...time,\r\n ':',\r\n {\r\n accepts: /^\\d$/,\r\n default: '0',\r\n placeholder: 'S',\r\n },\r\n {\r\n accepts: /^\\d$/,\r\n default: '0',\r\n placeholder: 'S',\r\n },\r\n] as const satisfies InputMaskCfg;\r\n\r\nexport const MASKS = {\r\n time,\r\n timeSeconds,\r\n} as const satisfies Record<string, InputMaskCfg>;\r\n","import { MASKS } from './masks';\r\n\r\nimport type { InputMaskCfg } from './types';\r\n\r\n// Interface for communicating with the parent component\r\ntype MaskData = {\r\n updateValue: (element: HTMLInputElement, value: string, position: number) => void;\r\n};\r\n\r\n/**\r\n * Helper class for handling masked input functionality\r\n */\r\nexport class MaskHelper {\r\n private readonly _data: MaskData;\r\n\r\n constructor(data: MaskData) {\r\n this._data = data;\r\n }\r\n\r\n /**\r\n * Ensure the mask is in the correct format\r\n * Converts string masks to TextFieldMaskCfg format\r\n * Returns null if no mask is provided\r\n */\r\n public ensureMask(mask: InputMaskCfg | string | null): InputMaskCfg | null {\r\n if (!mask) return null;\r\n if (typeof mask === 'string') {\r\n if (mask === 'time') {\r\n return MASKS.time;\r\n }\r\n // Convert string mask to TextFieldMaskCfg\r\n // 0 => digit, A => letter, * => alphanumeric\r\n return mask.split('').map(char => {\r\n if (char === '0') {\r\n return { placeholder: char, accepts: /\\d/, default: '0' };\r\n } else if (char === 'A') {\r\n return { placeholder: char, accepts: /[a-zA-Z]/, default: 'A' };\r\n } else if (char === '*') {\r\n return { placeholder: char, accepts: /[a-zA-Z0-9]/, default: 'A' };\r\n }\r\n return char;\r\n });\r\n }\r\n return mask;\r\n }\r\n\r\n /**\r\n * Handle key down events to manage special keys like Backspace and Delete\r\n */\r\n public handleKeyDown(event: KeyboardEvent, mask: InputMaskCfg): void {\r\n if (!mask || this._shouldIgnoreEvent(event)) {\r\n return;\r\n }\r\n const el = event.target as HTMLInputElement;\r\n const key = event.key;\r\n const currentPosition = el.selectionStart ?? 0;\r\n\r\n if (this._isSpecialKey(key)) {\r\n this._handleSpecialKey(event, el, key, currentPosition, mask);\r\n }\r\n }\r\n\r\n /**\r\n * Handle before input event to manage character input with mask validation\r\n */\r\n public handleBeforeInput(event: InputEvent, mask: InputMaskCfg): void {\r\n const el = event.target as HTMLInputElement;\r\n const key = event.data;\r\n const currentPosition = el.selectionStart ?? 0;\r\n\r\n if (!key) {\r\n // If no key data, just return\r\n return;\r\n }\r\n\r\n // Route to appropriate handler based on key type\r\n if (!this._isSpecialKey(key)) {\r\n this._handleCharacterInput(event, el, key, currentPosition, mask);\r\n }\r\n }\r\n\r\n /**\r\n * Check if the event should be ignored (modifier keys)\r\n */\r\n private _shouldIgnoreEvent(event: KeyboardEvent): boolean {\r\n return event.ctrlKey || event.metaKey || event.altKey;\r\n }\r\n\r\n /**\r\n * Check if key is a special key (Backspace/Delete)\r\n */\r\n private _isSpecialKey(key: string): boolean {\r\n return key.length > 1;\r\n }\r\n\r\n /**\r\n * Handle special keys like Backspace and Delete\r\n */\r\n private _handleSpecialKey(\r\n event: KeyboardEvent,\r\n el: HTMLInputElement,\r\n key: string,\r\n currentPosition: number,\r\n mask: InputMaskCfg\r\n ): void {\r\n if (key === 'Backspace' && currentPosition > 0) {\r\n const maskEntry = mask[currentPosition - 1];\r\n if (!maskEntry) {\r\n return;\r\n }\r\n // Get the default character for this position\r\n const defaultChar = typeof maskEntry === 'string' ? maskEntry : maskEntry.default;\r\n\r\n if (currentPosition === el.value.length) {\r\n return;\r\n }\r\n\r\n const newVal =\r\n el.value.slice(0, currentPosition - 1) + defaultChar + el.value.slice(currentPosition);\r\n\r\n this._data.updateValue(el, newVal, currentPosition - 1);\r\n event.preventDefault();\r\n } else if (key === 'Delete' && currentPosition < el.value.length) {\r\n const maskEntry = mask[currentPosition];\r\n if (!maskEntry) {\r\n return;\r\n }\r\n // Get the default character for this position\r\n const defaultChar = typeof maskEntry === 'string' ? maskEntry : maskEntry.default;\r\n const newVal =\r\n el.value.slice(0, currentPosition) + defaultChar + el.value.slice(currentPosition + 1);\r\n\r\n this._data.updateValue(el, newVal, currentPosition + 1);\r\n event.preventDefault();\r\n }\r\n }\r\n\r\n /**\r\n * Handle regular character input with mask validation\r\n */\r\n private _handleCharacterInput(\r\n event: InputEvent,\r\n el: HTMLInputElement,\r\n key: string,\r\n currentPosition: number,\r\n mask: InputMaskCfg\r\n ): void {\r\n // Skip over static characters and find the next input position\r\n const { position, autoPrintChars } = this._processStaticCharacters(el, currentPosition, mask);\r\n const maskEntry = mask[position];\r\n\r\n // Check if we're at a valid input position\r\n if (!maskEntry || typeof maskEntry === 'string') {\r\n event.preventDefault();\r\n return;\r\n }\r\n\r\n // Validate the character against the mask requirements\r\n if (!maskEntry.accepts.test(key)) {\r\n event.preventDefault();\r\n setTimeout(() => {\r\n // Ensure the cursor position is set after the value update for android compatibility\r\n el.setSelectionRange(position, position);\r\n });\r\n return;\r\n }\r\n\r\n // Build the new value with auto-inserted static characters\r\n const newVal =\r\n el.value.slice(0, position) + autoPrintChars + key + el.value.slice(position + 1);\r\n\r\n this._data.updateValue(el, newVal, position + 1);\r\n event.preventDefault();\r\n }\r\n\r\n /**\r\n * Process static characters in the mask and auto-insert them\r\n * Returns the next input position and any static characters to insert\r\n */\r\n private _processStaticCharacters(\r\n el: HTMLInputElement,\r\n startPosition: number,\r\n mask: InputMaskCfg\r\n ): { position: number; autoPrintChars: string } {\r\n let currentPosition = startPosition;\r\n let autoPrintChars = '';\r\n let currentMaskEntry = mask[currentPosition];\r\n\r\n // Skip over static characters and collect them for auto-insertion\r\n while (currentMaskEntry && typeof currentMaskEntry === 'string') {\r\n if (el.value.charAt(currentPosition) !== currentMaskEntry) {\r\n autoPrintChars += currentMaskEntry;\r\n }\r\n currentPosition++;\r\n currentMaskEntry = mask[currentPosition];\r\n }\r\n\r\n return { position: currentPosition, autoPrintChars };\r\n }\r\n}\r\n","import {\r\n afterRenderEffect,\r\n Component,\r\n computed,\r\n contentChild,\r\n input,\r\n signal,\r\n ChangeDetectionStrategy,\r\n} from '@angular/core';\r\nimport { domEventHandler } from '@ngneers/controls/api/ng';\r\nimport { NgnBase, provideSelf, NgnPt } from '@ngneers/controls/base';\r\nimport { NgnInput } from '@ngneers/controls/input';\r\nimport { inputMaskControlTemplate } from '@ngneers/controls-themes/templates/input-mask';\r\n\r\nimport { MaskHelper } from './helper';\r\n\r\nimport type { InputMaskCfg } from './types';\r\n\r\n/**\r\n * @category control\r\n */\r\n@Component({\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n selector: 'ngn-input-mask',\r\n templateUrl: './input-mask.html',\r\n imports: [NgnPt],\r\n providers: [provideSelf(NgnInputMask)],\r\n})\r\nexport class NgnInputMask extends NgnBase<'inputMask'> {\r\n protected readonly theme = this.injectThemeTemplate(inputMaskControlTemplate);\r\n /**\r\n * The mask to apply to the input. Can be a predefined mask key, a custom mask configuration, or a string pattern.\r\n */\r\n public readonly mask = input<'time' | InputMaskCfg | string | null>(null);\r\n\r\n private readonly _ngnInput = contentChild.required<NgnInput>(NgnInput);\r\n private readonly _inputElement = computed(\r\n () => this._ngnInput().element.nativeElement as HTMLInputElement\r\n );\r\n\r\n constructor() {\r\n super();\r\n domEventHandler(this._inputElement, 'keydown', event => this.onKeyDown(event));\r\n domEventHandler(this._inputElement, 'beforeinput', event => this.onBeforeInput(event));\r\n\r\n afterRenderEffect(() => {\r\n if (this._ngnInput().value() !== this.currentInputValue()) {\r\n this.currentInputValue.set(this._ngnInput().value() ?? '');\r\n }\r\n });\r\n }\r\n\r\n private readonly _maskHelper = new MaskHelper({\r\n updateValue: (e, v, i) => this._updateValue(e, v, i),\r\n });\r\n\r\n protected onInput(event: Event) {\r\n // Update the current input value\r\n this.currentInputValue.set((event.target as HTMLInputElement).value);\r\n }\r\n\r\n protected readonly currentInputValue = signal<string>('');\r\n\r\n private readonly _mask = computed(() => this._maskHelper.ensureMask(this.mask()));\r\n\r\n protected readonly maskWatermark = computed(() => {\r\n const mask = this._mask();\r\n if (!mask) return null;\r\n const maskString = mask\r\n .map(entry => {\r\n if (typeof entry === 'string') return entry;\r\n return entry.placeholder;\r\n })\r\n .join('');\r\n return maskString.substring(this.currentInputValue().length, maskString.length);\r\n });\r\n\r\n protected onKeyDown(event: KeyboardEvent) {\r\n const mask = this._mask();\r\n if (!mask) return;\r\n this._maskHelper.handleKeyDown(event, mask);\r\n }\r\n\r\n protected onBeforeInput(event: Event) {\r\n const mask = this._mask();\r\n if (!mask) return;\r\n this._maskHelper.handleBeforeInput(event as InputEvent, mask);\r\n }\r\n\r\n private _updateValue(el: HTMLInputElement, newValue: string, cursorPosition: number): void {\r\n el.value = newValue;\r\n this.currentInputValue.set(newValue);\r\n setTimeout(() => {\r\n // Ensure the cursor position is set after the value update for android compatibility\r\n el.setSelectionRange(cursorPosition, cursorPosition);\r\n });\r\n this._inputElement().dispatchEvent(new Event('input', { bubbles: true }));\r\n }\r\n}\r\n","<div [ptInt]=\"this\" [ptClass]=\"'root'\">\r\n <ng-content />\r\n <span [ptInt]=\"this\" [ptClass]=\"'mask'\">\r\n <span [ptInt]=\"this\" [ptClass]=\"'mask-placeholder'\" aria-hidden=\"true\" style=\"opacity: 0\">{{\r\n currentInputValue()\r\n }}</span>\r\n <span [ptInt]=\"this\" [ptClass]=\"'mask-text'\">{{ maskWatermark() }}</span>\r\n </span>\r\n</div>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport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","../../src/input-mask/input-mask.html","../../src/input-mask/ngneers-controls-input-mask.ts"],"sourcesContent":["import type { InputMaskCfg } from './types';\r\n\r\nconst time = [\r\n {\r\n accepts: /^\\d$/,\r\n default: '0',\r\n placeholder: 'H',\r\n },\r\n {\r\n accepts: /^\\d$/,\r\n default: '0',\r\n placeholder: 'H',\r\n },\r\n ':',\r\n {\r\n accepts: /^\\d$/,\r\n default: '0',\r\n placeholder: 'M',\r\n },\r\n {\r\n accepts: /^\\d$/,\r\n default: '0',\r\n placeholder: 'M',\r\n },\r\n] as const satisfies InputMaskCfg;\r\n\r\nconst timeSeconds = [\r\n ...time,\r\n ':',\r\n {\r\n accepts: /^\\d$/,\r\n default: '0',\r\n placeholder: 'S',\r\n },\r\n {\r\n accepts: /^\\d$/,\r\n default: '0',\r\n placeholder: 'S',\r\n },\r\n] as const satisfies InputMaskCfg;\r\n\r\nexport const MASKS = {\r\n time,\r\n timeSeconds,\r\n} as const satisfies Record<string, InputMaskCfg>;\r\n","import { MASKS } from './masks';\r\n\r\nimport type { InputMaskCfg } from './types';\r\n\r\n// Interface for communicating with the parent component\r\ntype MaskData = {\r\n updateValue: (element: HTMLInputElement, value: string, position: number) => void;\r\n};\r\n\r\n/**\r\n * Helper class for handling masked input functionality\r\n */\r\nexport class MaskHelper {\r\n private readonly _data: MaskData;\r\n\r\n constructor(data: MaskData) {\r\n this._data = data;\r\n }\r\n\r\n /**\r\n * Ensure the mask is in the correct format\r\n * Converts string masks to TextFieldMaskCfg format\r\n * Returns null if no mask is provided\r\n */\r\n public ensureMask(mask: InputMaskCfg | string | null): InputMaskCfg | null {\r\n if (!mask) return null;\r\n if (typeof mask === 'string') {\r\n if (mask === 'time') {\r\n return MASKS.time;\r\n }\r\n // Convert string mask to TextFieldMaskCfg\r\n // 0 => digit, A => letter, * => alphanumeric\r\n return mask.split('').map(char => {\r\n if (char === '0') {\r\n return { placeholder: char, accepts: /\\d/, default: '0' };\r\n } else if (char === 'A') {\r\n return { placeholder: char, accepts: /[a-zA-Z]/, default: 'A' };\r\n } else if (char === '*') {\r\n return { placeholder: char, accepts: /[a-zA-Z0-9]/, default: 'A' };\r\n }\r\n return char;\r\n });\r\n }\r\n return mask;\r\n }\r\n\r\n /**\r\n * Handle key down events to manage special keys like Backspace and Delete\r\n */\r\n public handleKeyDown(event: KeyboardEvent, mask: InputMaskCfg): void {\r\n if (!mask || this._shouldIgnoreEvent(event)) {\r\n return;\r\n }\r\n const el = event.target as HTMLInputElement;\r\n const key = event.key;\r\n const currentPosition = el.selectionStart ?? 0;\r\n\r\n if (this._isSpecialKey(key)) {\r\n this._handleSpecialKey(event, el, key, currentPosition, mask);\r\n }\r\n }\r\n\r\n /**\r\n * Handle before input event to manage character input with mask validation\r\n */\r\n public handleBeforeInput(event: InputEvent, mask: InputMaskCfg): void {\r\n const el = event.target as HTMLInputElement;\r\n const key = event.data;\r\n const currentPosition = el.selectionStart ?? 0;\r\n\r\n if (!key) {\r\n // If no key data, just return\r\n return;\r\n }\r\n\r\n // Route to appropriate handler based on key type\r\n if (!this._isSpecialKey(key)) {\r\n this._handleCharacterInput(event, el, key, currentPosition, mask);\r\n }\r\n }\r\n\r\n /**\r\n * Check if the event should be ignored (modifier keys)\r\n */\r\n private _shouldIgnoreEvent(event: KeyboardEvent): boolean {\r\n return event.ctrlKey || event.metaKey || event.altKey;\r\n }\r\n\r\n /**\r\n * Check if key is a special key (Backspace/Delete)\r\n */\r\n private _isSpecialKey(key: string): boolean {\r\n return key.length > 1;\r\n }\r\n\r\n /**\r\n * Handle special keys like Backspace and Delete\r\n */\r\n private _handleSpecialKey(\r\n event: KeyboardEvent,\r\n el: HTMLInputElement,\r\n key: string,\r\n currentPosition: number,\r\n mask: InputMaskCfg\r\n ): void {\r\n if (key === 'Backspace' && currentPosition > 0) {\r\n const maskEntry = mask[currentPosition - 1];\r\n if (!maskEntry) {\r\n return;\r\n }\r\n // Get the default character for this position\r\n const defaultChar = typeof maskEntry === 'string' ? maskEntry : maskEntry.default;\r\n\r\n if (currentPosition === el.value.length) {\r\n return;\r\n }\r\n\r\n const newVal =\r\n el.value.slice(0, currentPosition - 1) + defaultChar + el.value.slice(currentPosition);\r\n\r\n this._data.updateValue(el, newVal, currentPosition - 1);\r\n event.preventDefault();\r\n } else if (key === 'Delete' && currentPosition < el.value.length) {\r\n const maskEntry = mask[currentPosition];\r\n if (!maskEntry) {\r\n return;\r\n }\r\n // Get the default character for this position\r\n const defaultChar = typeof maskEntry === 'string' ? maskEntry : maskEntry.default;\r\n const newVal =\r\n el.value.slice(0, currentPosition) + defaultChar + el.value.slice(currentPosition + 1);\r\n\r\n this._data.updateValue(el, newVal, currentPosition + 1);\r\n event.preventDefault();\r\n }\r\n }\r\n\r\n /**\r\n * Handle regular character input with mask validation\r\n */\r\n private _handleCharacterInput(\r\n event: InputEvent,\r\n el: HTMLInputElement,\r\n key: string,\r\n currentPosition: number,\r\n mask: InputMaskCfg\r\n ): void {\r\n // Skip over static characters and find the next input position\r\n const { position, autoPrintChars } = this._processStaticCharacters(el, currentPosition, mask);\r\n const maskEntry = mask[position];\r\n\r\n // Check if we're at a valid input position\r\n if (!maskEntry || typeof maskEntry === 'string') {\r\n event.preventDefault();\r\n return;\r\n }\r\n\r\n // Validate the character against the mask requirements\r\n if (!maskEntry.accepts.test(key)) {\r\n event.preventDefault();\r\n setTimeout(() => {\r\n // Ensure the cursor position is set after the value update for android compatibility\r\n el.setSelectionRange(position, position);\r\n });\r\n return;\r\n }\r\n\r\n // Build the new value with auto-inserted static characters\r\n const newVal =\r\n el.value.slice(0, position) + autoPrintChars + key + el.value.slice(position + 1);\r\n\r\n this._data.updateValue(el, newVal, position + 1);\r\n event.preventDefault();\r\n }\r\n\r\n /**\r\n * Process static characters in the mask and auto-insert them\r\n * Returns the next input position and any static characters to insert\r\n */\r\n private _processStaticCharacters(\r\n el: HTMLInputElement,\r\n startPosition: number,\r\n mask: InputMaskCfg\r\n ): { position: number; autoPrintChars: string } {\r\n let currentPosition = startPosition;\r\n let autoPrintChars = '';\r\n let currentMaskEntry = mask[currentPosition];\r\n\r\n // Skip over static characters and collect them for auto-insertion\r\n while (currentMaskEntry && typeof currentMaskEntry === 'string') {\r\n if (el.value.charAt(currentPosition) !== currentMaskEntry) {\r\n autoPrintChars += currentMaskEntry;\r\n }\r\n currentPosition++;\r\n currentMaskEntry = mask[currentPosition];\r\n }\r\n\r\n return { position: currentPosition, autoPrintChars };\r\n }\r\n}\r\n","import {\r\n afterRenderEffect,\r\n Component,\r\n computed,\r\n contentChild,\r\n input,\r\n signal,\r\n ChangeDetectionStrategy,\r\n} from '@angular/core';\r\nimport { domEventHandler } from '@ngneers/controls/api/ng';\r\nimport { NgnBase, provideSelf, NgnPt } from '@ngneers/controls/base';\r\nimport { NgnInput } from '@ngneers/controls/input';\r\nimport { inputMaskControlTemplate } from '@ngneers/controls-themes/templates/input-mask';\r\n\r\nimport { MaskHelper } from './helper';\r\n\r\nimport type { InputMaskCfg } from './types';\r\n\r\n/**\r\n * @category control\r\n */\r\n@Component({\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n selector: 'ngn-input-mask',\r\n templateUrl: './input-mask.html',\r\n imports: [NgnPt],\r\n providers: [provideSelf(NgnInputMask)],\r\n})\r\nexport class NgnInputMask extends NgnBase<'inputMask'> {\r\n protected readonly theme = this.injectThemeTemplate(inputMaskControlTemplate);\r\n /**\r\n * The mask to apply to the input. Can be a predefined mask key, a custom mask configuration, or a string pattern.\r\n */\r\n public readonly mask = input<'time' | InputMaskCfg | string | null>(null);\r\n\r\n private readonly _ngnInput = contentChild.required<NgnInput>(NgnInput);\r\n private readonly _inputElement = computed(\r\n () => this._ngnInput().element.nativeElement as HTMLInputElement\r\n );\r\n\r\n constructor() {\r\n super();\r\n domEventHandler(this._inputElement, 'keydown', event => this.onKeyDown(event));\r\n domEventHandler(this._inputElement, 'beforeinput', event => this.onBeforeInput(event));\r\n\r\n afterRenderEffect(() => {\r\n if (this._ngnInput().value() !== this.currentInputValue()) {\r\n this.currentInputValue.set(this._ngnInput().value() ?? '');\r\n }\r\n });\r\n }\r\n\r\n private readonly _maskHelper = new MaskHelper({\r\n updateValue: (e, v, i) => this._updateValue(e, v, i),\r\n });\r\n\r\n protected onInput(event: Event) {\r\n // Update the current input value\r\n this.currentInputValue.set((event.target as HTMLInputElement).value);\r\n }\r\n\r\n protected readonly currentInputValue = signal<string>('');\r\n\r\n private readonly _mask = computed(() => this._maskHelper.ensureMask(this.mask()));\r\n\r\n protected readonly maskWatermark = computed(() => {\r\n const mask = this._mask();\r\n if (!mask) return null;\r\n const maskString = mask\r\n .map(entry => {\r\n if (typeof entry === 'string') return entry;\r\n return entry.placeholder;\r\n })\r\n .join('');\r\n return maskString.substring(this.currentInputValue().length, maskString.length);\r\n });\r\n\r\n protected onKeyDown(event: KeyboardEvent) {\r\n const mask = this._mask();\r\n if (!mask) return;\r\n this._maskHelper.handleKeyDown(event, mask);\r\n }\r\n\r\n protected onBeforeInput(event: Event) {\r\n const mask = this._mask();\r\n if (!mask) return;\r\n this._maskHelper.handleBeforeInput(event as InputEvent, mask);\r\n }\r\n\r\n private _updateValue(el: HTMLInputElement, newValue: string, cursorPosition: number): void {\r\n el.value = newValue;\r\n this.currentInputValue.set(newValue);\r\n setTimeout(() => {\r\n // Ensure the cursor position is set after the value update for android compatibility\r\n el.setSelectionRange(cursorPosition, cursorPosition);\r\n });\r\n this._inputElement().dispatchEvent(new Event('input', { bubbles: true }));\r\n }\r\n}\r\n","<div [ptInt]=\"this\" [ptClass]=\"'root'\">\r\n <ng-content />\r\n <span [ptInt]=\"this\" [ptClass]=\"'mask'\">\r\n <span [ptInt]=\"this\" [ptClass]=\"'mask-placeholder'\" aria-hidden=\"true\" style=\"opacity: 0\">{{\r\n currentInputValue()\r\n }}</span>\r\n <span [ptInt]=\"this\" [ptClass]=\"'mask-text'\">{{ maskWatermark() }}</span>\r\n </span>\r\n</div>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"m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Factory({ minVersion: "12.0.0", version: "21.2.
|
|
51
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.
|
|
50
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: NgnInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
51
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.10", type: NgnInput, isStandalone: true, selector: "input[ngnInput], textarea[ngnInput]", inputs: { invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "(hasParentInputfield() ? \"\" : ` ${inputFieldTheme.class(\"root\")}`)" } }, providers: [provideSelf(NgnInput)], exportAs: ["ngnInput"], usesInheritance: true, ngImport: i0 });
|
|
52
52
|
}
|
|
53
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
53
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: NgnInput, decorators: [{
|
|
54
54
|
type: Directive,
|
|
55
55
|
args: [{
|
|
56
56
|
selector: 'input[ngnInput], textarea[ngnInput]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngneers-controls-input.mjs","sources":["../../src/input/input.ts","../../src/input/ngneers-controls-input.ts"],"sourcesContent":["import {\r\n type AfterViewInit,\r\n booleanAttribute,\r\n Directive,\r\n effect,\r\n input,\r\n model,\r\n runInInjectionContext,\r\n signal,\r\n} from '@angular/core';\r\nimport { domEventSignal } from '@ngneers/controls/api/ng';\r\nimport { NgnBase, provideSelf } from '@ngneers/controls/base';\r\nimport { inputControlTemplate } from '@ngneers/controls-themes/templates/input';\r\nimport { inputFieldControlTemplate } from '@ngneers/controls-themes/templates/input-field';\r\n\r\n/**\r\n * @category control\r\n */\r\n@Directive({\r\n selector: 'input[ngnInput], textarea[ngnInput]',\r\n host: {\r\n '[class]': '(hasParentInputfield() ? \"\" : ` ${inputFieldTheme.class(\"root\")}`)',\r\n },\r\n providers: [provideSelf(NgnInput)],\r\n exportAs: 'ngnInput',\r\n})\r\nexport class NgnInput extends NgnBase<'input'> implements AfterViewInit {\r\n protected readonly hasParentInputfield = signal(false);\r\n\r\n protected readonly theme = this.injectThemeTemplate(inputControlTemplate, {\r\n root: true,\r\n invalid: () => this.invalid(),\r\n empty: () => !this.value(),\r\n });\r\n protected readonly inputFieldTheme = this.injectThemeTemplate<true>(inputFieldControlTemplate);\r\n /**\r\n * Explicitly apply invalid state styling\r\n * @default false\r\n */\r\n public readonly invalid = input(false, { transform: booleanAttribute });\r\n\r\n public readonly value = model<string | null>('');\r\n\r\n private readonly _input = this.element.nativeElement as HTMLInputElement;\r\n\r\n public ngAfterViewInit() {\r\n this.hasParentInputfield.set(!!this.element.nativeElement.closest('ngn-input-field'));\r\n const changeEvent = domEventSignal(\r\n this.element.nativeElement as HTMLInputElement,\r\n 'change',\r\n this.injector\r\n );\r\n const inputEvent = domEventSignal(\r\n this.element.nativeElement as HTMLInputElement,\r\n 'input',\r\n this.injector\r\n );\r\n\r\n runInInjectionContext(this.injector, () => {\r\n effect(() => {\r\n const _changeEvent = changeEvent();\r\n const _inputEvent = inputEvent();\r\n if (!_changeEvent && !_inputEvent) {\r\n return;\r\n }\r\n const val = this._input.value;\r\n this.value.set(val ?? '');\r\n });\r\n });\r\n }\r\n\r\n constructor() {\r\n super();\r\n effect(() => {\r\n if (this._input.value !== this.value()) {\r\n this._input.value = this.value() || '';\r\n }\r\n });\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAeA;;AAEG;AASG,MAAO,QAAS,SAAQ,OAAgB,CAAA;AACzB,IAAA,mBAAmB,GAAG,MAAM,CAAC,KAAK,0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,CAAC;AAC3B,YAAA,CAAC,CAAC;AACJ,QAAA,CAAC,CAAC;IACJ;AAEA,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;QACP,MAAM,CAAC,MAAK;YACV,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,EAAE,EAAE;gBACtC,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE;YACxC;AACF,QAAA,CAAC,CAAC;IACJ;
|
|
1
|
+
{"version":3,"file":"ngneers-controls-input.mjs","sources":["../../src/input/input.ts","../../src/input/ngneers-controls-input.ts"],"sourcesContent":["import {\r\n type AfterViewInit,\r\n booleanAttribute,\r\n Directive,\r\n effect,\r\n input,\r\n model,\r\n runInInjectionContext,\r\n signal,\r\n} from '@angular/core';\r\nimport { domEventSignal } from '@ngneers/controls/api/ng';\r\nimport { NgnBase, provideSelf } from '@ngneers/controls/base';\r\nimport { inputControlTemplate } from '@ngneers/controls-themes/templates/input';\r\nimport { inputFieldControlTemplate } from '@ngneers/controls-themes/templates/input-field';\r\n\r\n/**\r\n * @category control\r\n */\r\n@Directive({\r\n selector: 'input[ngnInput], textarea[ngnInput]',\r\n host: {\r\n '[class]': '(hasParentInputfield() ? \"\" : ` ${inputFieldTheme.class(\"root\")}`)',\r\n },\r\n providers: [provideSelf(NgnInput)],\r\n exportAs: 'ngnInput',\r\n})\r\nexport class NgnInput extends NgnBase<'input'> implements AfterViewInit {\r\n protected readonly hasParentInputfield = signal(false);\r\n\r\n protected readonly theme = this.injectThemeTemplate(inputControlTemplate, {\r\n root: true,\r\n invalid: () => this.invalid(),\r\n empty: () => !this.value(),\r\n });\r\n protected readonly inputFieldTheme = this.injectThemeTemplate<true>(inputFieldControlTemplate);\r\n /**\r\n * Explicitly apply invalid state styling\r\n * @default false\r\n */\r\n public readonly invalid = input(false, { transform: booleanAttribute });\r\n\r\n public readonly value = model<string | null>('');\r\n\r\n private readonly _input = this.element.nativeElement as HTMLInputElement;\r\n\r\n public ngAfterViewInit() {\r\n this.hasParentInputfield.set(!!this.element.nativeElement.closest('ngn-input-field'));\r\n const changeEvent = domEventSignal(\r\n this.element.nativeElement as HTMLInputElement,\r\n 'change',\r\n this.injector\r\n );\r\n const inputEvent = domEventSignal(\r\n this.element.nativeElement as HTMLInputElement,\r\n 'input',\r\n this.injector\r\n );\r\n\r\n runInInjectionContext(this.injector, () => {\r\n effect(() => {\r\n const _changeEvent = changeEvent();\r\n const _inputEvent = inputEvent();\r\n if (!_changeEvent && !_inputEvent) {\r\n return;\r\n }\r\n const val = this._input.value;\r\n this.value.set(val ?? '');\r\n });\r\n });\r\n }\r\n\r\n constructor() {\r\n super();\r\n effect(() => {\r\n if (this._input.value !== this.value()) {\r\n this._input.value = this.value() || '';\r\n }\r\n });\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAeA;;AAEG;AASG,MAAO,QAAS,SAAQ,OAAgB,CAAA;AACzB,IAAA,mBAAmB,GAAG,MAAM,CAAC,KAAK,0FAAC;AAEnC,IAAA,KAAK,GAAG,IAAI,CAAC,mBAAmB,CAAC,oBAAoB,EAAE;AACxE,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,OAAO,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE;QAC7B,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE;AAC3B,KAAA,CAAC;AACiB,IAAA,eAAe,GAAG,IAAI,CAAC,mBAAmB,CAAO,yBAAyB,CAAC;AAC9F;;;AAGG;IACa,OAAO,GAAG,KAAK,CAAC,KAAK,+EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAEvD,IAAA,KAAK,GAAG,KAAK,CAAgB,EAAE,4EAAC;AAE/B,IAAA,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,aAAiC;IAEjE,eAAe,GAAA;AACpB,QAAA,IAAI,CAAC,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,EAAA,QAAQ,oeAHR,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAGvB,QAAQ,EAAA,UAAA,EAAA,CAAA;kBARpB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qCAAqC;AAC/C,oBAAA,IAAI,EAAE;AACJ,wBAAA,SAAS,EAAE,oEAAoE;AAChF,qBAAA;AACD,oBAAA,SAAS,EAAE,CAAC,WAAW,CAAA,QAAA,CAAU,CAAC;AAClC,oBAAA,QAAQ,EAAE,UAAU;AACrB,iBAAA;;;ACzBD;;AAEG;;;;"}
|
|
@@ -224,10 +224,10 @@ class ItemViewTemplates extends NgnBase {
|
|
|
224
224
|
* Can be used with the {@link NgnTemplate} directive for type safe ng-templates.
|
|
225
225
|
*/
|
|
226
226
|
templateTypes = templateTypesFn();
|
|
227
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
228
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.
|
|
227
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: ItemViewTemplates, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
228
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.10", type: ItemViewTemplates, isStandalone: true, inputs: { templateItem: { classPropertyName: "templateItem", publicName: "templateItem", isSignal: true, isRequired: false, transformFunction: null }, templateSeparator: { classPropertyName: "templateSeparator", publicName: "templateSeparator", isSignal: true, isRequired: false, transformFunction: null }, templateOverflow: { classPropertyName: "templateOverflow", publicName: "templateOverflow", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "_userItemTemplate", first: true, predicate: ["item"], descendants: true, isSignal: true }, { propertyName: "_userSeparatorTemplate", first: true, predicate: ["separator"], descendants: true, isSignal: true }, { propertyName: "_userOverflowItemTemplate", first: true, predicate: ["overflow"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_defaultSeparatorTemplate", first: true, predicate: ["defaultSeparatorTemplate"], descendants: true, isSignal: true }, { propertyName: "_defaultOverflowItemTemplate", first: true, predicate: ["defaultOverflowItemTemplate"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0 });
|
|
229
229
|
}
|
|
230
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
230
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: ItemViewTemplates, decorators: [{
|
|
231
231
|
type: Directive
|
|
232
232
|
}], propDecorators: { templateItem: [{ type: i0.Input, args: [{ isSignal: true, alias: "templateItem", required: false }] }], _userItemTemplate: [{ type: i0.ContentChild, args: ['item', { isSignal: true }] }], _defaultSeparatorTemplate: [{ type: i0.ViewChild, args: ['defaultSeparatorTemplate', { isSignal: true }] }], _userSeparatorTemplate: [{ type: i0.ContentChild, args: ['separator', { isSignal: true }] }], templateSeparator: [{ type: i0.Input, args: [{ isSignal: true, alias: "templateSeparator", required: false }] }], _defaultOverflowItemTemplate: [{ type: i0.ViewChild, args: ['defaultOverflowItemTemplate', { isSignal: true }] }], _userOverflowItemTemplate: [{ type: i0.ContentChild, args: ['overflow', { isSignal: true }] }], templateOverflow: [{ type: i0.Input, args: [{ isSignal: true, alias: "templateOverflow", required: false }] }] } });
|
|
233
233
|
|
|
@@ -422,10 +422,10 @@ class NgnItemView extends ItemViewTemplates {
|
|
|
422
422
|
this._themeGap.set(gap);
|
|
423
423
|
});
|
|
424
424
|
}
|
|
425
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
426
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
425
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: NgnItemView, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
426
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: NgnItemView, isStandalone: true, selector: "ngn-item-view", inputs: { idField: { classPropertyName: "idField", publicName: "idField", isSignal: true, isRequired: true, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null }, iconItemSeparator: { classPropertyName: "iconItemSeparator", publicName: "iconItemSeparator", isSignal: true, isRequired: false, transformFunction: null }, overflowStrategy: { classPropertyName: "overflowStrategy", publicName: "overflowStrategy", isSignal: true, isRequired: false, transformFunction: null }, overflowStrategyFreezeCount: { classPropertyName: "overflowStrategyFreezeCount", publicName: "overflowStrategyFreezeCount", isSignal: true, isRequired: false, transformFunction: null }, overflowStrategyIndex: { classPropertyName: "overflowStrategyIndex", publicName: "overflowStrategyIndex", isSignal: true, isRequired: false, transformFunction: null }, sameWidthItems: { classPropertyName: "sameWidthItems", publicName: "sameWidthItems", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.role": "\"list\"", "style.maxWidth.px": "maxWidth()" } }, providers: [provideSelf(NgnItemView)], viewQueries: [{ propertyName: "_renderedItemRefs", predicate: ["itemRef"], descendants: true, isSignal: true }, { propertyName: "_firstItemRef", first: true, predicate: ["itemRef"], descendants: true, isSignal: true }, { propertyName: "_overflowItemRef", first: true, predicate: ["overflowItem"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@for (item of renderedItems(); track item.id; let i = $index) {\r\n @if (item.kind === 'visibleItem' || item.kind === 'overflowItem') {\r\n <span\r\n role=\"listitem\"\r\n #itemRef\r\n [ptInt]=\"this\"\r\n [ptClass]=\"{\r\n item: true,\r\n 'item-overflowing': item.kind === 'overflowItem',\r\n }\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n itemTemplate();\r\n context: { $implicit: item.item, index: i, last: $last, first: $first }\r\n \"\r\n />\r\n @if (!$last) {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n separatorTemplate();\r\n context: { $implicit: { character: separatorChar(), icon: iconItemSeparator() } }\r\n \"\r\n />\r\n }\r\n </span>\r\n } @else if (item.kind === 'overflowIndicator') {\r\n <div\r\n [ptInt]=\"this\"\r\n [ptClass]=\"{ 'more-items': true, 'more-items-hidden': !item.visible }\"\r\n aria-hidden=\"true\"\r\n #overflowItem\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n overflowTemplate();\r\n context: {\r\n $implicit: {\r\n totalCount: items().length,\r\n overflowCount: item.items.length,\r\n overflowItems: item.items,\r\n },\r\n }\r\n \"\r\n />\r\n @if (!$last) {\r\n <span\r\n [style.visibility]=\"item.hasSeparator ? 'visible' : 'hidden'\"\r\n style=\"display: contents\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n separatorTemplate();\r\n context: { $implicit: { character: separatorChar(), icon: iconItemSeparator() } }\r\n \"\r\n />\r\n </span>\r\n }\r\n </div>\r\n }\r\n}\r\n\r\n<ng-template #defaultSeparatorTemplate [ngnTemplate]=\"templateTypes.separator\" let-separator>\r\n @if (separator.character) {\r\n <span>{{ separator.character }}</span>\r\n } @else if (separator.icon) {\r\n <ngn-icon [icon]=\"separator.icon\" />\r\n }\r\n</ng-template>\r\n\r\n<ng-template #defaultOverflowItemTemplate [ngnTemplate]=\"templateTypes.overflow\" let-overflow>\r\n <span [ptInt]=\"this\" [ptClass]=\"'more-items-default'\">+{{ overflow.overflowCount }}</span>\r\n</ng-template>\r\n", dependencies: [{ kind: "directive", type: NgnPt, selector: "[ptInt]", inputs: ["ptInt", "ptClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgnTemplate, selector: "ng-template[ngnTemplate]", inputs: ["ngnTemplate"] }, { kind: "component", type: NgnIcon, selector: "ngn-icon", inputs: ["defaultIcon", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
427
427
|
}
|
|
428
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
428
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: NgnItemView, decorators: [{
|
|
429
429
|
type: Component,
|
|
430
430
|
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ngn-item-view', imports: [NgnPt, NgTemplateOutlet, NgnTemplate, NgnIcon], providers: [provideSelf(NgnItemView)], host: {
|
|
431
431
|
'[attr.role]': '"list"',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngneers-controls-item-view.mjs","sources":["../../src/item-view/item-view-layout.ts","../../src/item-view/item-view-templates.ts","../../src/item-view/item-view.ts","../../src/item-view/item-view.html","../../src/item-view/ngneers-controls-item-view.ts"],"sourcesContent":["import { NgnError } from '@ngneers/controls/utils';\r\n\r\nimport type { OverflowStrategy } from './types';\r\n\r\nexport type ItemOverflowLocation = 'start' | 'end' | 'center';\r\n\r\nexport type OverflowOrderEntry = {\r\n index: number;\r\n location: ItemOverflowLocation;\r\n};\r\n\r\nexport type OverflowOrder = readonly OverflowOrderEntry[];\r\n\r\nexport type ItemViewLayoutInput = {\r\n count: number;\r\n strategy: OverflowStrategy;\r\n freezeCount: number;\r\n strategyIndex: number;\r\n containerWidth: number;\r\n itemWidths: readonly number[];\r\n overflowItemWidth: number;\r\n gap: number;\r\n};\r\n\r\nexport type ItemViewLayoutResult = {\r\n checkOrder: OverflowOrder;\r\n renderedItemOrders: OverflowOrder;\r\n remainingItemOrders: OverflowOrder;\r\n overflowIndicatorCount: number;\r\n overflowIndicatorIndices: readonly (number | null)[];\r\n};\r\n\r\n/**\r\n * Returns the *priority order* in which items are considered for keeping visible.\r\n * The algorithm is greedy: it walks this list until items no longer fit.\r\n * Each entry also carries a `location` which describes which overflow indicator would own the item.\r\n */\r\nexport function getItemOverflowCheckOrder(params: {\r\n count: number;\r\n strategy: OverflowStrategy;\r\n freezeCount: number;\r\n strategyIndex: number;\r\n}): OverflowOrder {\r\n const count = Math.max(0, Math.floor(params.count));\r\n if (count === 0) {\r\n return [];\r\n }\r\n\r\n const freezeCount = Math.min(Math.max(0, Math.floor(params.freezeCount)), count);\r\n\r\n switch (params.strategy) {\r\n case 'end': {\r\n const arr = [...Array.from({ length: count - freezeCount }, (_, i) => i)];\r\n arr.splice(1, 0, ...Array.from({ length: freezeCount }, (_, i) => count - freezeCount + i));\r\n return arr.map(index => ({ index, location: 'end' }));\r\n }\r\n case 'start': {\r\n const arr = [...Array.from({ length: count - freezeCount }, (_, i) => count - i - 1)];\r\n arr.splice(1, 0, ...Array.from({ length: freezeCount }, (_, i) => i));\r\n return arr.map(index => ({ index, location: 'start' }));\r\n }\r\n case 'center': {\r\n // \"Center\" overflows symmetrically: keep alternating left/right items first.\r\n const order: OverflowOrderEntry[] = [];\r\n let leftIndex = 0;\r\n let rightIndex = count - 1;\r\n\r\n for (let i = 0; i < count; i++) {\r\n if (i % 2 === 0) {\r\n order.push({ index: leftIndex++, location: 'center' } as const);\r\n } else {\r\n order.push({ index: rightIndex--, location: 'center' } as const);\r\n }\r\n }\r\n return order;\r\n }\r\n case 'aroundIndex': {\r\n // \"AroundIndex\" keeps the chosen item visible, then expands outward on both sides.\r\n // FreezeCount applies to both ends; we must ensure the chosen index stays in-bounds.\r\n const minIndex = Math.min(freezeCount, count - 1);\r\n const maxIndex = Math.max(minIndex, count - freezeCount - 1);\r\n const index = Math.min(Math.max(minIndex, Math.floor(params.strategyIndex)), maxIndex);\r\n\r\n const targetMiddleCount = Math.max(0, count - freezeCount * 2);\r\n const order: { index: number; location: 'start' | 'end' }[] =\r\n targetMiddleCount > 0 ? [{ index, location: 'start' }] : [];\r\n\r\n let offset = 1;\r\n while (order.length < targetMiddleCount) {\r\n if (index - offset >= freezeCount) {\r\n order.push({ index: index - offset, location: 'start' });\r\n }\r\n if (order.length >= targetMiddleCount) {\r\n break;\r\n }\r\n if (index + offset < count - freezeCount) {\r\n order.push({\r\n index: index + offset,\r\n location: 'end',\r\n });\r\n }\r\n offset++;\r\n }\r\n\r\n // Insert frozen items near the front of the list so they are kept visible.\r\n // Keep the insertion ordering consistent with the component implementation.\r\n order.splice(\r\n 1,\r\n 0,\r\n ...Array.from({ length: freezeCount }, (_, i) => ({ index: i, location: 'start' }) as const)\r\n );\r\n order.splice(\r\n 1,\r\n 0,\r\n ...Array.from(\r\n { length: freezeCount },\r\n (_, i) =>\r\n ({\r\n index: count - freezeCount + i,\r\n location: 'end',\r\n }) as const\r\n )\r\n );\r\n\r\n return order;\r\n }\r\n }\r\n}\r\n\r\nexport function calculateItemViewLayout(params: ItemViewLayoutInput): ItemViewLayoutResult {\r\n const count = Math.max(0, Math.floor(params.count));\r\n const containerWidth = Math.max(0, params.containerWidth);\r\n const overflowItemWidth = Math.max(0, params.overflowItemWidth);\r\n const gap = Math.max(0, params.gap);\r\n const maxOverflowIndicatorCount = params.strategy === 'aroundIndex' ? 2 : 1;\r\n\r\n const overflowCheckOrder = getItemOverflowCheckOrder({\r\n count,\r\n strategy: params.strategy,\r\n freezeCount: params.freezeCount,\r\n strategyIndex: params.strategyIndex,\r\n });\r\n\r\n const getVisibleItemCount = (reservedWidth: number): number => {\r\n let visibleItemCount = 0;\r\n let totalWidth = Math.max(0, reservedWidth);\r\n\r\n for (let i = 0; i < overflowCheckOrder.length; i++) {\r\n const index = overflowCheckOrder[i]?.index;\r\n if (index === undefined) {\r\n throw new NgnError(\r\n 'calculateItemViewLayout',\r\n 'Invalid overflow check order: index is undefined'\r\n );\r\n }\r\n const itemWidth = params.itemWidths[index] ?? 0;\r\n const itemGap = i > 0 ? gap : 0;\r\n const newWidth = totalWidth + itemWidth + itemGap;\r\n\r\n if (newWidth <= containerWidth) {\r\n totalWidth = newWidth;\r\n visibleItemCount++;\r\n } else {\r\n break;\r\n }\r\n }\r\n\r\n return visibleItemCount;\r\n };\r\n\r\n let overflowIndicatorCount = 0;\r\n let previousOverflowIndicatorCount = -1;\r\n let remainingItemOrders: OverflowOrder = overflowCheckOrder;\r\n let renderedItemOrders: OverflowOrderEntry[] = [];\r\n let overflowIndicatorLocations = new Set<ItemOverflowLocation>();\r\n\r\n // Fixed-point iteration:\r\n // 1) We blindly assume that we don't need any overflow indicators for the first pass.\r\n // 2) We see how many items fit with that assumption.\r\n // 3) The remaining items define which overflow locations exist (start/end/center).\r\n // 4) That determines the *actual* number of indicators.\r\n // Repeat until the indicator count stabilizes.\r\n while (overflowIndicatorCount !== previousOverflowIndicatorCount) {\r\n previousOverflowIndicatorCount = overflowIndicatorCount;\r\n\r\n const initialVisibleItemCount = getVisibleItemCount(\r\n overflowIndicatorCount * (overflowItemWidth + gap)\r\n );\r\n\r\n remainingItemOrders = overflowCheckOrder\r\n .slice(initialVisibleItemCount)\r\n .toSorted((a, b) => a.index - b.index);\r\n\r\n overflowIndicatorLocations = new Set(remainingItemOrders.map(i => i.location));\r\n overflowIndicatorCount = overflowIndicatorLocations.size;\r\n const finalVisibleItemCount = getVisibleItemCount(\r\n overflowIndicatorCount * (overflowItemWidth + gap)\r\n );\r\n renderedItemOrders = overflowCheckOrder.slice(0, finalVisibleItemCount);\r\n }\r\n\r\n (['start', 'end'] as const).forEach(location => {\r\n // Optimization: if all overflowed items for a side would fit inside the overflow indicator width,\r\n // we can render them inline and drop that overflow indicator entirely.\r\n // This is only applicable for start/end & the aroundIndex strategy. Center has no \"adjacent\" insertion point.\r\n if (overflowIndicatorLocations.has(location)) {\r\n const itemsWithIndices = remainingItemOrders\r\n .map((x, i) => [i + renderedItemOrders.length, x] as const)\r\n .filter(x => x[1].location === location);\r\n const itemSizes = itemsWithIndices.map(i => params.itemWidths[i[1].index] ?? 0);\r\n const itemsTotalSize = itemSizes.reduce((a, b) => a + b, 0);\r\n if (itemsTotalSize <= overflowItemWidth) {\r\n overflowIndicatorLocations.delete(location);\r\n renderedItemOrders = [...renderedItemOrders, ...itemsWithIndices.map(i => i[1])];\r\n overflowIndicatorCount--;\r\n }\r\n }\r\n });\r\n\r\n // Keep result consistent after the optimization pass.\r\n const renderedIndices = new Set(renderedItemOrders.map(x => x.index));\r\n remainingItemOrders = overflowCheckOrder\r\n .filter(x => !renderedIndices.has(x.index))\r\n .toSorted((a, b) => a.index - b.index);\r\n\r\n // Calculate the insertion indices for the overflow indicators.\r\n const overflowIndicatorIndices = (() => {\r\n if (overflowIndicatorCount === 0) {\r\n return [null];\r\n } else if (maxOverflowIndicatorCount === 1 && overflowIndicatorCount === 1) {\r\n return [remainingItemOrders[0]?.index ?? null];\r\n } else if (maxOverflowIndicatorCount === 2) {\r\n const res: number[] = [];\r\n const firstEndIndex = remainingItemOrders.find(x => x.location === 'end')?.index;\r\n const lastEndIndex = remainingItemOrders.findLast(x => x.location === 'end')?.index;\r\n const firstStartIndex = remainingItemOrders.find(x => x.location === 'start')?.index;\r\n const lastStartIndex = remainingItemOrders.findLast(x => x.location === 'start')?.index;\r\n if (overflowIndicatorLocations.has('start')) {\r\n const startIndex = firstStartIndex ?? firstEndIndex ?? 0;\r\n res.push(startIndex + Math.min(Math.max(0, Math.floor(params.freezeCount)), count));\r\n }\r\n if (overflowIndicatorLocations.has('end')) {\r\n const endIndex = lastEndIndex ? lastEndIndex + 1 : (lastStartIndex ?? 0);\r\n res.push(endIndex);\r\n }\r\n return res;\r\n }\r\n return [];\r\n })();\r\n\r\n return {\r\n checkOrder: overflowCheckOrder,\r\n renderedItemOrders,\r\n remainingItemOrders,\r\n overflowIndicatorCount,\r\n overflowIndicatorIndices,\r\n };\r\n}\r\n","import { computed, contentChild, Directive, input, TemplateRef, viewChild } from '@angular/core';\r\nimport { templateTypesFn } from '@ngneers/controls/api/ng';\r\nimport { NgnBase } from '@ngneers/controls/base';\r\n\r\nimport type { IconType } from '@ngneers/controls-custom-types';\r\n\r\n@Directive()\r\nexport abstract class ItemViewTemplates<T> extends NgnBase<'itemView'> {\r\n /**\r\n * The template to be used for rendering each item in the item view.\r\n * Can also be set using the `item` content child.\r\n */\r\n public readonly templateItem = input<TemplateRef<\r\n typeof this.templateTypes.$implicit.item\r\n > | null>(null);\r\n private readonly _userItemTemplate =\r\n contentChild<TemplateRef<typeof this.templateTypes.item>>('item');\r\n protected readonly itemTemplate = computed(() => this._userItemTemplate() ?? this.templateItem());\r\n\r\n // Separator template\r\n private readonly _defaultSeparatorTemplate = viewChild.required<\r\n TemplateRef<typeof this.templateTypes.separator>\r\n >('defaultSeparatorTemplate');\r\n private readonly _userSeparatorTemplate =\r\n contentChild<TemplateRef<typeof this.templateTypes.separator>>('separator');\r\n /**\r\n * Set a custom template for the separators of the breadcrumb.\r\n * Can also be set using an `<ng-template>` element with `#separator` template reference variable.\r\n */\r\n public readonly templateSeparator = input<TemplateRef<\r\n typeof this.templateTypes.separator\r\n > | null>(null);\r\n protected readonly separatorTemplate = computed(\r\n () =>\r\n this._userSeparatorTemplate() ?? this.templateSeparator() ?? this._defaultSeparatorTemplate()\r\n );\r\n\r\n // Overflow item template\r\n private readonly _defaultOverflowItemTemplate = viewChild.required<\r\n TemplateRef<typeof this.templateTypes.overflow>\r\n >('defaultOverflowItemTemplate');\r\n private readonly _userOverflowItemTemplate =\r\n contentChild<TemplateRef<typeof this.templateTypes.overflow>>('overflow');\r\n /**\r\n * Set a custom template for the overflow item.\r\n * Can also be set using an `<ng-template>` element with `#overflow` template reference variable.\r\n */\r\n public readonly templateOverflow = input<TemplateRef<typeof this.templateTypes.overflow> | null>(\r\n null\r\n );\r\n protected readonly overflowTemplate = computed(\r\n () =>\r\n this._userOverflowItemTemplate() ??\r\n this.templateOverflow() ??\r\n this._defaultOverflowItemTemplate()\r\n );\r\n\r\n /**\r\n * Template types for the item-view.\r\n * Can be used with the {@link NgnTemplate} directive for type safe ng-templates.\r\n */\r\n public readonly templateTypes = templateTypesFn<{\r\n item: {\r\n $implicit: T;\r\n index: number;\r\n last: boolean;\r\n first: boolean;\r\n };\r\n separator: {\r\n $implicit: {\r\n icon?: IconType;\r\n character?: string;\r\n };\r\n };\r\n overflow: {\r\n $implicit: {\r\n totalCount: number;\r\n overflowCount: number;\r\n overflowItems: T[];\r\n };\r\n };\r\n }>();\r\n}\r\n","import { NgTemplateOutlet } from '@angular/common';\r\nimport {\r\n type AfterViewInit,\r\n Component,\r\n computed,\r\n ElementRef,\r\n inject,\r\n input,\r\n signal,\r\n viewChild,\r\n viewChildren,\r\n ChangeDetectionStrategy,\r\n} from '@angular/core';\r\nimport {\r\n elementSizeSignal,\r\n elementsSizesSignal,\r\n NgnTemplate,\r\n Platform,\r\n} from '@ngneers/controls/api/ng';\r\nimport { NgnPt, provideSelf } from '@ngneers/controls/base';\r\nimport { NgnIcon } from '@ngneers/controls/icon';\r\nimport { areArraysDeepEqual, throwExp } from '@ngneers/controls/utils';\r\nimport { itemViewControlTemplate } from '@ngneers/controls-themes/templates/item-view';\r\n\r\nimport {\r\n calculateItemViewLayout,\r\n getItemOverflowCheckOrder,\r\n type ItemOverflowLocation,\r\n type OverflowOrder,\r\n} from './item-view-layout';\r\nimport { ItemViewTemplates } from './item-view-templates';\r\n\r\nimport type { OverflowStrategy } from './types';\r\nimport type { IconType } from '@ngneers/controls-custom-types';\r\n\r\ntype RenderItem<T> =\r\n | {\r\n id: string | number;\r\n kind: 'visibleItem';\r\n item: T;\r\n }\r\n | {\r\n id: string | number;\r\n kind: 'overflowItem';\r\n location: ItemOverflowLocation;\r\n item: T;\r\n }\r\n | {\r\n id: string;\r\n kind: 'overflowIndicator';\r\n visible: boolean;\r\n items: T[];\r\n hasSeparator: boolean;\r\n };\r\n\r\n/**\r\n * @category control\r\n */\r\n@Component({\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n selector: 'ngn-item-view',\r\n templateUrl: './item-view.html',\r\n imports: [NgnPt, NgTemplateOutlet, NgnTemplate, NgnIcon],\r\n providers: [provideSelf(NgnItemView)],\r\n host: {\r\n '[attr.role]': '\"list\"',\r\n '[style.maxWidth.px]': 'maxWidth()',\r\n },\r\n})\r\nexport class NgnItemView<T extends object, IdField extends keyof T>\r\n extends ItemViewTemplates<T>\r\n implements AfterViewInit\r\n{\r\n protected readonly theme = this.injectThemeTemplate(itemViewControlTemplate, 'root');\r\n /**\r\n * The key of the id property in the item object. This is used to track items in the template.\r\n */\r\n public readonly idField = input.required<IdField>();\r\n /**\r\n * The items to be displayed in the item view.\r\n * This is a required input and should be an array of items of type {@link T}.\r\n */\r\n public readonly items = input.required<readonly T[]>();\r\n /**\r\n * A separator string (character) to be displayed between items. Set `true` for `,` or provide a custom string.\r\n */\r\n public readonly separator = input<true | string>();\r\n /**\r\n * A separator icon to be displayed between items.\r\n */\r\n public readonly iconItemSeparator = input<IconType>();\r\n /**\r\n * Strategy to use when there are more items than can be displayed in the available space.\r\n * The value determines where the items should start to overflow.\r\n * @default 'end'\r\n */\r\n public readonly overflowStrategy = input<OverflowStrategy>('end');\r\n /**\r\n * The amount of items to keep visible after or before overflowing, depending on the {@link overflowStrategy}.\r\n * @default 0\r\n */\r\n public readonly overflowStrategyFreezeCount = input<number>(0);\r\n /**\r\n * Index of the item to be used as the overflow indicator when using the 'aroundIndex' overflow strategy.\r\n * This input is only relevant when the {@link overflowStrategy} is set to 'aroundIndex'.\r\n * @default 0\r\n */\r\n public readonly overflowStrategyIndex = input<number>(0);\r\n /**\r\n * Set this to `true` for greatly improving performance when all items have the same width.\r\n * Especially true for large lists of items.\r\n *\r\n * ⚠️ This reduces the accessibility of the control as screen\r\n * readers will not be able to determine the number of hidden items and keyboard users cannot directly\r\n * navigate to them. Use this only for potentially very large lists (with items of identical width) where users will not\r\n * need to access overflowed items directly.\r\n * @default false\r\n */\r\n public readonly sameWidthItems = input<boolean>(false);\r\n\r\n private readonly _themeGap = signal(0);\r\n private readonly _isBrowser = inject(Platform).isBrowser;\r\n\r\n protected readonly separatorChar = computed(() => {\r\n const sep = this.separator();\r\n return typeof sep === 'boolean' ? (sep ? ', ' : '') : sep;\r\n });\r\n\r\n private readonly _enableSizeMeasuring = computed(() => !this.sameWidthItems());\r\n private readonly _renderedItemRefs = viewChildren<ElementRef<HTMLElement>>('itemRef');\r\n private readonly _firstItemRef = viewChild<ElementRef<HTMLElement>>('itemRef');\r\n private readonly _firstItemWidth = elementSizeSignal(this._firstItemRef);\r\n private readonly _renderedItemSizes = elementsSizesSignal(\r\n this._renderedItemRefs,\r\n this._enableSizeMeasuring\r\n );\r\n private readonly _renderedItemWidths = computed(\r\n () =>\r\n this.sameWidthItems()\r\n ? this.items().map(() => this._firstItemWidth().width || Number.MAX_SAFE_INTEGER)\r\n : this._renderedItemSizes().map(size => size.width),\r\n { equal: areArraysDeepEqual }\r\n );\r\n private readonly _containerSize = elementSizeSignal(this.element.nativeElement);\r\n private readonly _overflowItemRef = viewChild<ElementRef<HTMLElement>>('overflowItem');\r\n private readonly _overflowItemSize = elementSizeSignal(this._overflowItemRef);\r\n\r\n protected readonly itemOverflowCheckOrder = computed<OverflowOrder>(() => {\r\n const count = this.items().length;\r\n const freezeCount = Math.min(this.overflowStrategyFreezeCount(), count);\r\n return getItemOverflowCheckOrder({\r\n count,\r\n strategy: this.overflowStrategy(),\r\n freezeCount,\r\n strategyIndex: this.overflowStrategyIndex(),\r\n });\r\n });\r\n\r\n protected readonly renderedItems = computed<RenderItem<T>[]>(() => {\r\n const containerWidth = this._containerSize().width;\r\n const renderedItemWidths = this._renderedItemWidths();\r\n const overflowCheckOrder = this.itemOverflowCheckOrder();\r\n\r\n const count = this.items().length;\r\n const freezeCount = Math.min(this.overflowStrategyFreezeCount(), count);\r\n const layout = calculateItemViewLayout({\r\n count,\r\n strategy: this.overflowStrategy(),\r\n freezeCount,\r\n strategyIndex: this.overflowStrategyIndex(),\r\n containerWidth,\r\n itemWidths: renderedItemWidths,\r\n overflowItemWidth: this._overflowItemSize().width,\r\n gap: this._themeGap(),\r\n });\r\n\r\n const renderedItemOrders = layout.renderedItemOrders;\r\n // Precompute quick lookups for the hot paths below.\r\n // - `renderedIndexSet` allows O(1) visibility checks.\r\n // - `locationByIndex` avoids repeatedly scanning the overflow order to find an item's location.\r\n const renderedIndexSet = new Set<number>(renderedItemOrders.map(x => x.index));\r\n const locationByIndex: Array<ItemOverflowLocation | undefined> = new Array(count);\r\n for (const entry of overflowCheckOrder) {\r\n locationByIndex[entry.index] = entry.location;\r\n }\r\n\r\n // First pass: build the full list with items marked as visible vs overflowed.\r\n // We'll insert overflow indicators afterwards at the computed insertion indices.\r\n let res: RenderItem<T>[] = this.items().map((item, index) => {\r\n if (renderedIndexSet.has(index)) {\r\n return <RenderItem<T>>{\r\n id: item[this.idField()] as string | number,\r\n kind: 'visibleItem',\r\n item,\r\n };\r\n } else {\r\n return <RenderItem<T>>{\r\n id: item[this.idField()] as string | number,\r\n kind: 'overflowItem',\r\n location: locationByIndex[index] ?? 'end',\r\n item,\r\n };\r\n }\r\n });\r\n\r\n const getFallbackOverflowIndicatorIndex = () => {\r\n // When the layout says \"no indicator\" for the only slot (null), we still need a stable\r\n // insertion index so the DOM structure stays consistent for measurement.\r\n if (overflowCheckOrder.length === 0) {\r\n return 0;\r\n }\r\n const lastItem = overflowCheckOrder[overflowCheckOrder.length - 1];\r\n return (lastItem ?? throwExp('NgnItemView', 'Unexpected empty entry in overflowCheckOrder'))\r\n .index;\r\n };\r\n\r\n // Insert overflow indicators at the calculated indices\r\n // Note: inserting into `res` shifts subsequent indices; track that shift explicitly with `insertOffset`.\r\n let insertOffset = 0;\r\n\r\n // Collect overflowed items, both as a single list and grouped by location.\r\n const overflowedItemsAll: T[] = [];\r\n const overflowedItemsByLocation: Record<ItemOverflowLocation, T[]> = {\r\n start: [],\r\n end: [],\r\n center: [],\r\n };\r\n const allItems = this.items();\r\n for (let i = 0; i < count; i++) {\r\n if (renderedIndexSet.has(i)) {\r\n continue;\r\n }\r\n const item = allItems[i];\r\n if (item === undefined) {\r\n continue;\r\n }\r\n overflowedItemsAll.push(item);\r\n const location = locationByIndex[i] ?? 'end';\r\n overflowedItemsByLocation[location].push(item);\r\n }\r\n\r\n layout.overflowIndicatorIndices.forEach((indicatorIndex, iterationIndex) => {\r\n const insertIndex = indicatorIndex ?? getFallbackOverflowIndicatorIndex() + insertOffset;\r\n\r\n // If two overflow indicators are rendered (aroundIndex), we must split overflow items by location\r\n // so each indicator shows its own count/list.\r\n const overflowIndicatorLocation =\r\n layout.overflowIndicatorCount === 1 ? null : iterationIndex === 0 ? 'start' : 'end';\r\n const items = overflowIndicatorLocation\r\n ? overflowedItemsByLocation[overflowIndicatorLocation]\r\n : overflowedItemsAll;\r\n\r\n res.splice(insertIndex, 0, <RenderItem<T>>{\r\n id: `overflow-indicator-${indicatorIndex}`,\r\n kind: 'overflowIndicator',\r\n visible: indicatorIndex !== null,\r\n items,\r\n hasSeparator: renderedItemOrders.some(x => x.index + insertOffset > insertIndex),\r\n });\r\n insertOffset++;\r\n });\r\n\r\n // In fixed width mode, remove all hidden items except for the first one (used for measurement)\r\n if (this.sameWidthItems()) {\r\n res = res.filter((item, index) => item.kind !== 'overflowItem' || index === 0);\r\n }\r\n\r\n return res;\r\n });\r\n\r\n protected readonly maxWidth = computed<number>(() => {\r\n return Math.ceil(\r\n this._renderedItemWidths().reduce((sum, w) => sum + w, 0) +\r\n this._themeGap() * Math.max(0, this.items().length - 1)\r\n );\r\n });\r\n\r\n public ngAfterViewInit(): void {\r\n if (!this._isBrowser) {\r\n return;\r\n }\r\n requestAnimationFrame(() => {\r\n const gapString = getComputedStyle(this.element.nativeElement).getPropertyValue('column-gap');\r\n const gap = parseFloat(gapString) || 0;\r\n this._themeGap.set(gap);\r\n });\r\n }\r\n}\r\n","@for (item of renderedItems(); track item.id; let i = $index) {\r\n @if (item.kind === 'visibleItem' || item.kind === 'overflowItem') {\r\n <span\r\n role=\"listitem\"\r\n #itemRef\r\n [ptInt]=\"this\"\r\n [ptClass]=\"{\r\n item: true,\r\n 'item-overflowing': item.kind === 'overflowItem',\r\n }\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n itemTemplate();\r\n context: { $implicit: item.item, index: i, last: $last, first: $first }\r\n \"\r\n />\r\n @if (!$last) {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n separatorTemplate();\r\n context: { $implicit: { character: separatorChar(), icon: iconItemSeparator() } }\r\n \"\r\n />\r\n }\r\n </span>\r\n } @else if (item.kind === 'overflowIndicator') {\r\n <div\r\n [ptInt]=\"this\"\r\n [ptClass]=\"{ 'more-items': true, 'more-items-hidden': !item.visible }\"\r\n aria-hidden=\"true\"\r\n #overflowItem\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n overflowTemplate();\r\n context: {\r\n $implicit: {\r\n totalCount: items().length,\r\n overflowCount: item.items.length,\r\n overflowItems: item.items,\r\n },\r\n }\r\n \"\r\n />\r\n @if (!$last) {\r\n <span\r\n [style.visibility]=\"item.hasSeparator ? 'visible' : 'hidden'\"\r\n style=\"display: contents\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n separatorTemplate();\r\n context: { $implicit: { character: separatorChar(), icon: iconItemSeparator() } }\r\n \"\r\n />\r\n </span>\r\n }\r\n </div>\r\n }\r\n}\r\n\r\n<ng-template #defaultSeparatorTemplate [ngnTemplate]=\"templateTypes.separator\" let-separator>\r\n @if (separator.character) {\r\n <span>{{ separator.character }}</span>\r\n } @else if (separator.icon) {\r\n <ngn-icon [icon]=\"separator.icon\" />\r\n }\r\n</ng-template>\r\n\r\n<ng-template #defaultOverflowItemTemplate [ngnTemplate]=\"templateTypes.overflow\" let-overflow>\r\n <span [ptInt]=\"this\" [ptClass]=\"'more-items-default'\">+{{ overflow.overflowCount }}</span>\r\n</ng-template>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AA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,aAAa,EAAE,QAAQ;AACvB,wBAAA,qBAAqB,EAAE,YAAY;AACpC,qBAAA,EAAA,QAAA,EAAA,i0EAAA,EAAA;w7BA8D0E,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAChB,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,gBAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAcN,cAAc,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEhJvF;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngneers-controls-item-view.mjs","sources":["../../src/item-view/item-view-layout.ts","../../src/item-view/item-view-templates.ts","../../src/item-view/item-view.ts","../../src/item-view/item-view.html","../../src/item-view/ngneers-controls-item-view.ts"],"sourcesContent":["import { NgnError } from '@ngneers/controls/utils';\r\n\r\nimport type { OverflowStrategy } from './types';\r\n\r\nexport type ItemOverflowLocation = 'start' | 'end' | 'center';\r\n\r\nexport type OverflowOrderEntry = {\r\n index: number;\r\n location: ItemOverflowLocation;\r\n};\r\n\r\nexport type OverflowOrder = readonly OverflowOrderEntry[];\r\n\r\nexport type ItemViewLayoutInput = {\r\n count: number;\r\n strategy: OverflowStrategy;\r\n freezeCount: number;\r\n strategyIndex: number;\r\n containerWidth: number;\r\n itemWidths: readonly number[];\r\n overflowItemWidth: number;\r\n gap: number;\r\n};\r\n\r\nexport type ItemViewLayoutResult = {\r\n checkOrder: OverflowOrder;\r\n renderedItemOrders: OverflowOrder;\r\n remainingItemOrders: OverflowOrder;\r\n overflowIndicatorCount: number;\r\n overflowIndicatorIndices: readonly (number | null)[];\r\n};\r\n\r\n/**\r\n * Returns the *priority order* in which items are considered for keeping visible.\r\n * The algorithm is greedy: it walks this list until items no longer fit.\r\n * Each entry also carries a `location` which describes which overflow indicator would own the item.\r\n */\r\nexport function getItemOverflowCheckOrder(params: {\r\n count: number;\r\n strategy: OverflowStrategy;\r\n freezeCount: number;\r\n strategyIndex: number;\r\n}): OverflowOrder {\r\n const count = Math.max(0, Math.floor(params.count));\r\n if (count === 0) {\r\n return [];\r\n }\r\n\r\n const freezeCount = Math.min(Math.max(0, Math.floor(params.freezeCount)), count);\r\n\r\n switch (params.strategy) {\r\n case 'end': {\r\n const arr = [...Array.from({ length: count - freezeCount }, (_, i) => i)];\r\n arr.splice(1, 0, ...Array.from({ length: freezeCount }, (_, i) => count - freezeCount + i));\r\n return arr.map(index => ({ index, location: 'end' }));\r\n }\r\n case 'start': {\r\n const arr = [...Array.from({ length: count - freezeCount }, (_, i) => count - i - 1)];\r\n arr.splice(1, 0, ...Array.from({ length: freezeCount }, (_, i) => i));\r\n return arr.map(index => ({ index, location: 'start' }));\r\n }\r\n case 'center': {\r\n // \"Center\" overflows symmetrically: keep alternating left/right items first.\r\n const order: OverflowOrderEntry[] = [];\r\n let leftIndex = 0;\r\n let rightIndex = count - 1;\r\n\r\n for (let i = 0; i < count; i++) {\r\n if (i % 2 === 0) {\r\n order.push({ index: leftIndex++, location: 'center' } as const);\r\n } else {\r\n order.push({ index: rightIndex--, location: 'center' } as const);\r\n }\r\n }\r\n return order;\r\n }\r\n case 'aroundIndex': {\r\n // \"AroundIndex\" keeps the chosen item visible, then expands outward on both sides.\r\n // FreezeCount applies to both ends; we must ensure the chosen index stays in-bounds.\r\n const minIndex = Math.min(freezeCount, count - 1);\r\n const maxIndex = Math.max(minIndex, count - freezeCount - 1);\r\n const index = Math.min(Math.max(minIndex, Math.floor(params.strategyIndex)), maxIndex);\r\n\r\n const targetMiddleCount = Math.max(0, count - freezeCount * 2);\r\n const order: { index: number; location: 'start' | 'end' }[] =\r\n targetMiddleCount > 0 ? [{ index, location: 'start' }] : [];\r\n\r\n let offset = 1;\r\n while (order.length < targetMiddleCount) {\r\n if (index - offset >= freezeCount) {\r\n order.push({ index: index - offset, location: 'start' });\r\n }\r\n if (order.length >= targetMiddleCount) {\r\n break;\r\n }\r\n if (index + offset < count - freezeCount) {\r\n order.push({\r\n index: index + offset,\r\n location: 'end',\r\n });\r\n }\r\n offset++;\r\n }\r\n\r\n // Insert frozen items near the front of the list so they are kept visible.\r\n // Keep the insertion ordering consistent with the component implementation.\r\n order.splice(\r\n 1,\r\n 0,\r\n ...Array.from({ length: freezeCount }, (_, i) => ({ index: i, location: 'start' }) as const)\r\n );\r\n order.splice(\r\n 1,\r\n 0,\r\n ...Array.from(\r\n { length: freezeCount },\r\n (_, i) =>\r\n ({\r\n index: count - freezeCount + i,\r\n location: 'end',\r\n }) as const\r\n )\r\n );\r\n\r\n return order;\r\n }\r\n }\r\n}\r\n\r\nexport function calculateItemViewLayout(params: ItemViewLayoutInput): ItemViewLayoutResult {\r\n const count = Math.max(0, Math.floor(params.count));\r\n const containerWidth = Math.max(0, params.containerWidth);\r\n const overflowItemWidth = Math.max(0, params.overflowItemWidth);\r\n const gap = Math.max(0, params.gap);\r\n const maxOverflowIndicatorCount = params.strategy === 'aroundIndex' ? 2 : 1;\r\n\r\n const overflowCheckOrder = getItemOverflowCheckOrder({\r\n count,\r\n strategy: params.strategy,\r\n freezeCount: params.freezeCount,\r\n strategyIndex: params.strategyIndex,\r\n });\r\n\r\n const getVisibleItemCount = (reservedWidth: number): number => {\r\n let visibleItemCount = 0;\r\n let totalWidth = Math.max(0, reservedWidth);\r\n\r\n for (let i = 0; i < overflowCheckOrder.length; i++) {\r\n const index = overflowCheckOrder[i]?.index;\r\n if (index === undefined) {\r\n throw new NgnError(\r\n 'calculateItemViewLayout',\r\n 'Invalid overflow check order: index is undefined'\r\n );\r\n }\r\n const itemWidth = params.itemWidths[index] ?? 0;\r\n const itemGap = i > 0 ? gap : 0;\r\n const newWidth = totalWidth + itemWidth + itemGap;\r\n\r\n if (newWidth <= containerWidth) {\r\n totalWidth = newWidth;\r\n visibleItemCount++;\r\n } else {\r\n break;\r\n }\r\n }\r\n\r\n return visibleItemCount;\r\n };\r\n\r\n let overflowIndicatorCount = 0;\r\n let previousOverflowIndicatorCount = -1;\r\n let remainingItemOrders: OverflowOrder = overflowCheckOrder;\r\n let renderedItemOrders: OverflowOrderEntry[] = [];\r\n let overflowIndicatorLocations = new Set<ItemOverflowLocation>();\r\n\r\n // Fixed-point iteration:\r\n // 1) We blindly assume that we don't need any overflow indicators for the first pass.\r\n // 2) We see how many items fit with that assumption.\r\n // 3) The remaining items define which overflow locations exist (start/end/center).\r\n // 4) That determines the *actual* number of indicators.\r\n // Repeat until the indicator count stabilizes.\r\n while (overflowIndicatorCount !== previousOverflowIndicatorCount) {\r\n previousOverflowIndicatorCount = overflowIndicatorCount;\r\n\r\n const initialVisibleItemCount = getVisibleItemCount(\r\n overflowIndicatorCount * (overflowItemWidth + gap)\r\n );\r\n\r\n remainingItemOrders = overflowCheckOrder\r\n .slice(initialVisibleItemCount)\r\n .toSorted((a, b) => a.index - b.index);\r\n\r\n overflowIndicatorLocations = new Set(remainingItemOrders.map(i => i.location));\r\n overflowIndicatorCount = overflowIndicatorLocations.size;\r\n const finalVisibleItemCount = getVisibleItemCount(\r\n overflowIndicatorCount * (overflowItemWidth + gap)\r\n );\r\n renderedItemOrders = overflowCheckOrder.slice(0, finalVisibleItemCount);\r\n }\r\n\r\n (['start', 'end'] as const).forEach(location => {\r\n // Optimization: if all overflowed items for a side would fit inside the overflow indicator width,\r\n // we can render them inline and drop that overflow indicator entirely.\r\n // This is only applicable for start/end & the aroundIndex strategy. Center has no \"adjacent\" insertion point.\r\n if (overflowIndicatorLocations.has(location)) {\r\n const itemsWithIndices = remainingItemOrders\r\n .map((x, i) => [i + renderedItemOrders.length, x] as const)\r\n .filter(x => x[1].location === location);\r\n const itemSizes = itemsWithIndices.map(i => params.itemWidths[i[1].index] ?? 0);\r\n const itemsTotalSize = itemSizes.reduce((a, b) => a + b, 0);\r\n if (itemsTotalSize <= overflowItemWidth) {\r\n overflowIndicatorLocations.delete(location);\r\n renderedItemOrders = [...renderedItemOrders, ...itemsWithIndices.map(i => i[1])];\r\n overflowIndicatorCount--;\r\n }\r\n }\r\n });\r\n\r\n // Keep result consistent after the optimization pass.\r\n const renderedIndices = new Set(renderedItemOrders.map(x => x.index));\r\n remainingItemOrders = overflowCheckOrder\r\n .filter(x => !renderedIndices.has(x.index))\r\n .toSorted((a, b) => a.index - b.index);\r\n\r\n // Calculate the insertion indices for the overflow indicators.\r\n const overflowIndicatorIndices = (() => {\r\n if (overflowIndicatorCount === 0) {\r\n return [null];\r\n } else if (maxOverflowIndicatorCount === 1 && overflowIndicatorCount === 1) {\r\n return [remainingItemOrders[0]?.index ?? null];\r\n } else if (maxOverflowIndicatorCount === 2) {\r\n const res: number[] = [];\r\n const firstEndIndex = remainingItemOrders.find(x => x.location === 'end')?.index;\r\n const lastEndIndex = remainingItemOrders.findLast(x => x.location === 'end')?.index;\r\n const firstStartIndex = remainingItemOrders.find(x => x.location === 'start')?.index;\r\n const lastStartIndex = remainingItemOrders.findLast(x => x.location === 'start')?.index;\r\n if (overflowIndicatorLocations.has('start')) {\r\n const startIndex = firstStartIndex ?? firstEndIndex ?? 0;\r\n res.push(startIndex + Math.min(Math.max(0, Math.floor(params.freezeCount)), count));\r\n }\r\n if (overflowIndicatorLocations.has('end')) {\r\n const endIndex = lastEndIndex ? lastEndIndex + 1 : (lastStartIndex ?? 0);\r\n res.push(endIndex);\r\n }\r\n return res;\r\n }\r\n return [];\r\n })();\r\n\r\n return {\r\n checkOrder: overflowCheckOrder,\r\n renderedItemOrders,\r\n remainingItemOrders,\r\n overflowIndicatorCount,\r\n overflowIndicatorIndices,\r\n };\r\n}\r\n","import { computed, contentChild, Directive, input, TemplateRef, viewChild } from '@angular/core';\r\nimport { templateTypesFn } from '@ngneers/controls/api/ng';\r\nimport { NgnBase } from '@ngneers/controls/base';\r\n\r\nimport type { IconType } from '@ngneers/controls-custom-types';\r\n\r\n@Directive()\r\nexport abstract class ItemViewTemplates<T> extends NgnBase<'itemView'> {\r\n /**\r\n * The template to be used for rendering each item in the item view.\r\n * Can also be set using the `item` content child.\r\n */\r\n public readonly templateItem = input<TemplateRef<\r\n typeof this.templateTypes.$implicit.item\r\n > | null>(null);\r\n private readonly _userItemTemplate =\r\n contentChild<TemplateRef<typeof this.templateTypes.item>>('item');\r\n protected readonly itemTemplate = computed(() => this._userItemTemplate() ?? this.templateItem());\r\n\r\n // Separator template\r\n private readonly _defaultSeparatorTemplate = viewChild.required<\r\n TemplateRef<typeof this.templateTypes.separator>\r\n >('defaultSeparatorTemplate');\r\n private readonly _userSeparatorTemplate =\r\n contentChild<TemplateRef<typeof this.templateTypes.separator>>('separator');\r\n /**\r\n * Set a custom template for the separators of the breadcrumb.\r\n * Can also be set using an `<ng-template>` element with `#separator` template reference variable.\r\n */\r\n public readonly templateSeparator = input<TemplateRef<\r\n typeof this.templateTypes.separator\r\n > | null>(null);\r\n protected readonly separatorTemplate = computed(\r\n () =>\r\n this._userSeparatorTemplate() ?? this.templateSeparator() ?? this._defaultSeparatorTemplate()\r\n );\r\n\r\n // Overflow item template\r\n private readonly _defaultOverflowItemTemplate = viewChild.required<\r\n TemplateRef<typeof this.templateTypes.overflow>\r\n >('defaultOverflowItemTemplate');\r\n private readonly _userOverflowItemTemplate =\r\n contentChild<TemplateRef<typeof this.templateTypes.overflow>>('overflow');\r\n /**\r\n * Set a custom template for the overflow item.\r\n * Can also be set using an `<ng-template>` element with `#overflow` template reference variable.\r\n */\r\n public readonly templateOverflow = input<TemplateRef<typeof this.templateTypes.overflow> | null>(\r\n null\r\n );\r\n protected readonly overflowTemplate = computed(\r\n () =>\r\n this._userOverflowItemTemplate() ??\r\n this.templateOverflow() ??\r\n this._defaultOverflowItemTemplate()\r\n );\r\n\r\n /**\r\n * Template types for the item-view.\r\n * Can be used with the {@link NgnTemplate} directive for type safe ng-templates.\r\n */\r\n public readonly templateTypes = templateTypesFn<{\r\n item: {\r\n $implicit: T;\r\n index: number;\r\n last: boolean;\r\n first: boolean;\r\n };\r\n separator: {\r\n $implicit: {\r\n icon?: IconType;\r\n character?: string;\r\n };\r\n };\r\n overflow: {\r\n $implicit: {\r\n totalCount: number;\r\n overflowCount: number;\r\n overflowItems: T[];\r\n };\r\n };\r\n }>();\r\n}\r\n","import { NgTemplateOutlet } from '@angular/common';\r\nimport {\r\n type AfterViewInit,\r\n Component,\r\n computed,\r\n ElementRef,\r\n inject,\r\n input,\r\n signal,\r\n viewChild,\r\n viewChildren,\r\n ChangeDetectionStrategy,\r\n} from '@angular/core';\r\nimport {\r\n elementSizeSignal,\r\n elementsSizesSignal,\r\n NgnTemplate,\r\n Platform,\r\n} from '@ngneers/controls/api/ng';\r\nimport { NgnPt, provideSelf } from '@ngneers/controls/base';\r\nimport { NgnIcon } from '@ngneers/controls/icon';\r\nimport { areArraysDeepEqual, throwExp } from '@ngneers/controls/utils';\r\nimport { itemViewControlTemplate } from '@ngneers/controls-themes/templates/item-view';\r\n\r\nimport {\r\n calculateItemViewLayout,\r\n getItemOverflowCheckOrder,\r\n type ItemOverflowLocation,\r\n type OverflowOrder,\r\n} from './item-view-layout';\r\nimport { ItemViewTemplates } from './item-view-templates';\r\n\r\nimport type { OverflowStrategy } from './types';\r\nimport type { IconType } from '@ngneers/controls-custom-types';\r\n\r\ntype RenderItem<T> =\r\n | {\r\n id: string | number;\r\n kind: 'visibleItem';\r\n item: T;\r\n }\r\n | {\r\n id: string | number;\r\n kind: 'overflowItem';\r\n location: ItemOverflowLocation;\r\n item: T;\r\n }\r\n | {\r\n id: string;\r\n kind: 'overflowIndicator';\r\n visible: boolean;\r\n items: T[];\r\n hasSeparator: boolean;\r\n };\r\n\r\n/**\r\n * @category control\r\n */\r\n@Component({\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n selector: 'ngn-item-view',\r\n templateUrl: './item-view.html',\r\n imports: [NgnPt, NgTemplateOutlet, NgnTemplate, NgnIcon],\r\n providers: [provideSelf(NgnItemView)],\r\n host: {\r\n '[attr.role]': '\"list\"',\r\n '[style.maxWidth.px]': 'maxWidth()',\r\n },\r\n})\r\nexport class NgnItemView<T extends object, IdField extends keyof T>\r\n extends ItemViewTemplates<T>\r\n implements AfterViewInit\r\n{\r\n protected readonly theme = this.injectThemeTemplate(itemViewControlTemplate, 'root');\r\n /**\r\n * The key of the id property in the item object. This is used to track items in the template.\r\n */\r\n public readonly idField = input.required<IdField>();\r\n /**\r\n * The items to be displayed in the item view.\r\n * This is a required input and should be an array of items of type {@link T}.\r\n */\r\n public readonly items = input.required<readonly T[]>();\r\n /**\r\n * A separator string (character) to be displayed between items. Set `true` for `,` or provide a custom string.\r\n */\r\n public readonly separator = input<true | string>();\r\n /**\r\n * A separator icon to be displayed between items.\r\n */\r\n public readonly iconItemSeparator = input<IconType>();\r\n /**\r\n * Strategy to use when there are more items than can be displayed in the available space.\r\n * The value determines where the items should start to overflow.\r\n * @default 'end'\r\n */\r\n public readonly overflowStrategy = input<OverflowStrategy>('end');\r\n /**\r\n * The amount of items to keep visible after or before overflowing, depending on the {@link overflowStrategy}.\r\n * @default 0\r\n */\r\n public readonly overflowStrategyFreezeCount = input<number>(0);\r\n /**\r\n * Index of the item to be used as the overflow indicator when using the 'aroundIndex' overflow strategy.\r\n * This input is only relevant when the {@link overflowStrategy} is set to 'aroundIndex'.\r\n * @default 0\r\n */\r\n public readonly overflowStrategyIndex = input<number>(0);\r\n /**\r\n * Set this to `true` for greatly improving performance when all items have the same width.\r\n * Especially true for large lists of items.\r\n *\r\n * ⚠️ This reduces the accessibility of the control as screen\r\n * readers will not be able to determine the number of hidden items and keyboard users cannot directly\r\n * navigate to them. Use this only for potentially very large lists (with items of identical width) where users will not\r\n * need to access overflowed items directly.\r\n * @default false\r\n */\r\n public readonly sameWidthItems = input<boolean>(false);\r\n\r\n private readonly _themeGap = signal(0);\r\n private readonly _isBrowser = inject(Platform).isBrowser;\r\n\r\n protected readonly separatorChar = computed(() => {\r\n const sep = this.separator();\r\n return typeof sep === 'boolean' ? (sep ? ', ' : '') : sep;\r\n });\r\n\r\n private readonly _enableSizeMeasuring = computed(() => !this.sameWidthItems());\r\n private readonly _renderedItemRefs = viewChildren<ElementRef<HTMLElement>>('itemRef');\r\n private readonly _firstItemRef = viewChild<ElementRef<HTMLElement>>('itemRef');\r\n private readonly _firstItemWidth = elementSizeSignal(this._firstItemRef);\r\n private readonly _renderedItemSizes = elementsSizesSignal(\r\n this._renderedItemRefs,\r\n this._enableSizeMeasuring\r\n );\r\n private readonly _renderedItemWidths = computed(\r\n () =>\r\n this.sameWidthItems()\r\n ? this.items().map(() => this._firstItemWidth().width || Number.MAX_SAFE_INTEGER)\r\n : this._renderedItemSizes().map(size => size.width),\r\n { equal: areArraysDeepEqual }\r\n );\r\n private readonly _containerSize = elementSizeSignal(this.element.nativeElement);\r\n private readonly _overflowItemRef = viewChild<ElementRef<HTMLElement>>('overflowItem');\r\n private readonly _overflowItemSize = elementSizeSignal(this._overflowItemRef);\r\n\r\n protected readonly itemOverflowCheckOrder = computed<OverflowOrder>(() => {\r\n const count = this.items().length;\r\n const freezeCount = Math.min(this.overflowStrategyFreezeCount(), count);\r\n return getItemOverflowCheckOrder({\r\n count,\r\n strategy: this.overflowStrategy(),\r\n freezeCount,\r\n strategyIndex: this.overflowStrategyIndex(),\r\n });\r\n });\r\n\r\n protected readonly renderedItems = computed<RenderItem<T>[]>(() => {\r\n const containerWidth = this._containerSize().width;\r\n const renderedItemWidths = this._renderedItemWidths();\r\n const overflowCheckOrder = this.itemOverflowCheckOrder();\r\n\r\n const count = this.items().length;\r\n const freezeCount = Math.min(this.overflowStrategyFreezeCount(), count);\r\n const layout = calculateItemViewLayout({\r\n count,\r\n strategy: this.overflowStrategy(),\r\n freezeCount,\r\n strategyIndex: this.overflowStrategyIndex(),\r\n containerWidth,\r\n itemWidths: renderedItemWidths,\r\n overflowItemWidth: this._overflowItemSize().width,\r\n gap: this._themeGap(),\r\n });\r\n\r\n const renderedItemOrders = layout.renderedItemOrders;\r\n // Precompute quick lookups for the hot paths below.\r\n // - `renderedIndexSet` allows O(1) visibility checks.\r\n // - `locationByIndex` avoids repeatedly scanning the overflow order to find an item's location.\r\n const renderedIndexSet = new Set<number>(renderedItemOrders.map(x => x.index));\r\n const locationByIndex: Array<ItemOverflowLocation | undefined> = new Array(count);\r\n for (const entry of overflowCheckOrder) {\r\n locationByIndex[entry.index] = entry.location;\r\n }\r\n\r\n // First pass: build the full list with items marked as visible vs overflowed.\r\n // We'll insert overflow indicators afterwards at the computed insertion indices.\r\n let res: RenderItem<T>[] = this.items().map((item, index) => {\r\n if (renderedIndexSet.has(index)) {\r\n return <RenderItem<T>>{\r\n id: item[this.idField()] as string | number,\r\n kind: 'visibleItem',\r\n item,\r\n };\r\n } else {\r\n return <RenderItem<T>>{\r\n id: item[this.idField()] as string | number,\r\n kind: 'overflowItem',\r\n location: locationByIndex[index] ?? 'end',\r\n item,\r\n };\r\n }\r\n });\r\n\r\n const getFallbackOverflowIndicatorIndex = () => {\r\n // When the layout says \"no indicator\" for the only slot (null), we still need a stable\r\n // insertion index so the DOM structure stays consistent for measurement.\r\n if (overflowCheckOrder.length === 0) {\r\n return 0;\r\n }\r\n const lastItem = overflowCheckOrder[overflowCheckOrder.length - 1];\r\n return (lastItem ?? throwExp('NgnItemView', 'Unexpected empty entry in overflowCheckOrder'))\r\n .index;\r\n };\r\n\r\n // Insert overflow indicators at the calculated indices\r\n // Note: inserting into `res` shifts subsequent indices; track that shift explicitly with `insertOffset`.\r\n let insertOffset = 0;\r\n\r\n // Collect overflowed items, both as a single list and grouped by location.\r\n const overflowedItemsAll: T[] = [];\r\n const overflowedItemsByLocation: Record<ItemOverflowLocation, T[]> = {\r\n start: [],\r\n end: [],\r\n center: [],\r\n };\r\n const allItems = this.items();\r\n for (let i = 0; i < count; i++) {\r\n if (renderedIndexSet.has(i)) {\r\n continue;\r\n }\r\n const item = allItems[i];\r\n if (item === undefined) {\r\n continue;\r\n }\r\n overflowedItemsAll.push(item);\r\n const location = locationByIndex[i] ?? 'end';\r\n overflowedItemsByLocation[location].push(item);\r\n }\r\n\r\n layout.overflowIndicatorIndices.forEach((indicatorIndex, iterationIndex) => {\r\n const insertIndex = indicatorIndex ?? getFallbackOverflowIndicatorIndex() + insertOffset;\r\n\r\n // If two overflow indicators are rendered (aroundIndex), we must split overflow items by location\r\n // so each indicator shows its own count/list.\r\n const overflowIndicatorLocation =\r\n layout.overflowIndicatorCount === 1 ? null : iterationIndex === 0 ? 'start' : 'end';\r\n const items = overflowIndicatorLocation\r\n ? overflowedItemsByLocation[overflowIndicatorLocation]\r\n : overflowedItemsAll;\r\n\r\n res.splice(insertIndex, 0, <RenderItem<T>>{\r\n id: `overflow-indicator-${indicatorIndex}`,\r\n kind: 'overflowIndicator',\r\n visible: indicatorIndex !== null,\r\n items,\r\n hasSeparator: renderedItemOrders.some(x => x.index + insertOffset > insertIndex),\r\n });\r\n insertOffset++;\r\n });\r\n\r\n // In fixed width mode, remove all hidden items except for the first one (used for measurement)\r\n if (this.sameWidthItems()) {\r\n res = res.filter((item, index) => item.kind !== 'overflowItem' || index === 0);\r\n }\r\n\r\n return res;\r\n });\r\n\r\n protected readonly maxWidth = computed<number>(() => {\r\n return Math.ceil(\r\n this._renderedItemWidths().reduce((sum, w) => sum + w, 0) +\r\n this._themeGap() * Math.max(0, this.items().length - 1)\r\n );\r\n });\r\n\r\n public ngAfterViewInit(): void {\r\n if (!this._isBrowser) {\r\n return;\r\n }\r\n requestAnimationFrame(() => {\r\n const gapString = getComputedStyle(this.element.nativeElement).getPropertyValue('column-gap');\r\n const gap = parseFloat(gapString) || 0;\r\n this._themeGap.set(gap);\r\n });\r\n }\r\n}\r\n","@for (item of renderedItems(); track item.id; let i = $index) {\r\n @if (item.kind === 'visibleItem' || item.kind === 'overflowItem') {\r\n <span\r\n role=\"listitem\"\r\n #itemRef\r\n [ptInt]=\"this\"\r\n [ptClass]=\"{\r\n item: true,\r\n 'item-overflowing': item.kind === 'overflowItem',\r\n }\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n itemTemplate();\r\n context: { $implicit: item.item, index: i, last: $last, first: $first }\r\n \"\r\n />\r\n @if (!$last) {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n separatorTemplate();\r\n context: { $implicit: { character: separatorChar(), icon: iconItemSeparator() } }\r\n \"\r\n />\r\n }\r\n </span>\r\n } @else if (item.kind === 'overflowIndicator') {\r\n <div\r\n [ptInt]=\"this\"\r\n [ptClass]=\"{ 'more-items': true, 'more-items-hidden': !item.visible }\"\r\n aria-hidden=\"true\"\r\n #overflowItem\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n overflowTemplate();\r\n context: {\r\n $implicit: {\r\n totalCount: items().length,\r\n overflowCount: item.items.length,\r\n overflowItems: item.items,\r\n },\r\n }\r\n \"\r\n />\r\n @if (!$last) {\r\n <span\r\n [style.visibility]=\"item.hasSeparator ? 'visible' : 'hidden'\"\r\n style=\"display: contents\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n separatorTemplate();\r\n context: { $implicit: { character: separatorChar(), icon: iconItemSeparator() } }\r\n \"\r\n />\r\n </span>\r\n }\r\n </div>\r\n }\r\n}\r\n\r\n<ng-template #defaultSeparatorTemplate [ngnTemplate]=\"templateTypes.separator\" let-separator>\r\n @if (separator.character) {\r\n <span>{{ separator.character }}</span>\r\n } @else if (separator.icon) {\r\n <ngn-icon [icon]=\"separator.icon\" />\r\n }\r\n</ng-template>\r\n\r\n<ng-template #defaultOverflowItemTemplate [ngnTemplate]=\"templateTypes.overflow\" let-overflow>\r\n <span [ptInt]=\"this\" [ptClass]=\"'more-items-default'\">+{{ overflow.overflowCount }}</span>\r\n</ng-template>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAgCA;;;;AAIG;AACG,SAAU,yBAAyB,CAAC,MAKzC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E,YAAY;AACpC,qBAAA,EAAA,QAAA,EAAA,i0EAAA,EAAA;w7BA8D0E,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAChB,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,gBAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAcN,cAAc,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEhJvF;;AAEG;;;;"}
|
|
@@ -45,10 +45,10 @@ class ListBoxTemplates extends ValueControlBase {
|
|
|
45
45
|
*/
|
|
46
46
|
templateTypes = templateTypesFn();
|
|
47
47
|
templateTypesInternal = templateTypesFn();
|
|
48
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
49
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.
|
|
48
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: ListBoxTemplates, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
49
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.10", type: ListBoxTemplates, isStandalone: true, inputs: { templateItem: { classPropertyName: "templateItem", publicName: "templateItem", isSignal: true, isRequired: false, transformFunction: null }, templateGroup: { classPropertyName: "templateGroup", publicName: "templateGroup", isSignal: true, isRequired: false, transformFunction: null }, templateEmpty: { classPropertyName: "templateEmpty", publicName: "templateEmpty", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "_userItemTemplate", first: true, predicate: ["item"], descendants: true, isSignal: true }, { propertyName: "_userGroupTemplate", first: true, predicate: ["group"], descendants: true, isSignal: true }, { propertyName: "_userEmptyTemplate", first: true, predicate: ["empty"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_defaultItemTemplate", first: true, predicate: ["defaultItemTemplate"], descendants: true, isSignal: true }, { propertyName: "_defaultGroupTemplate", first: true, predicate: ["defaultGroupTemplate"], descendants: true, isSignal: true }, { propertyName: "_defaultEmptyTemplate", first: true, predicate: ["defaultEmptyTemplate"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0 });
|
|
50
50
|
}
|
|
51
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: ListBoxTemplates, decorators: [{
|
|
52
52
|
type: Directive
|
|
53
53
|
}], propDecorators: { _defaultItemTemplate: [{ type: i0.ViewChild, args: ['defaultItemTemplate', { isSignal: true }] }], _userItemTemplate: [{ type: i0.ContentChild, args: ['item', { isSignal: true }] }], templateItem: [{ type: i0.Input, args: [{ isSignal: true, alias: "templateItem", required: false }] }], _defaultGroupTemplate: [{ type: i0.ViewChild, args: ['defaultGroupTemplate', { isSignal: true }] }], _userGroupTemplate: [{ type: i0.ContentChild, args: ['group', { isSignal: true }] }], templateGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "templateGroup", required: false }] }], _defaultEmptyTemplate: [{ type: i0.ViewChild, args: ['defaultEmptyTemplate', { isSignal: true }] }], _userEmptyTemplate: [{ type: i0.ContentChild, args: ['empty', { isSignal: true }] }], templateEmpty: [{ type: i0.Input, args: [{ isSignal: true, alias: "templateEmpty", required: false }] }] } });
|
|
54
54
|
|
|
@@ -199,10 +199,10 @@ class NgnListBox extends ListBoxTemplates {
|
|
|
199
199
|
this.itemClicked.emit(value);
|
|
200
200
|
this.touched.set(true);
|
|
201
201
|
}
|
|
202
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
203
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
202
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: NgnListBox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
203
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: NgnListBox, isStandalone: true, selector: "ngn-list-box", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, scrollToSelectedItemOnInit: { classPropertyName: "scrollToSelectedItemOnInit", publicName: "scrollToSelectedItemOnInit", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, selectOnHover: { classPropertyName: "selectOnHover", publicName: "selectOnHover", isSignal: true, isRequired: false, transformFunction: null }, focussable: { classPropertyName: "focussable", publicName: "focussable", isSignal: true, isRequired: false, transformFunction: null }, virtual: { classPropertyName: "virtual", publicName: "virtual", isSignal: true, isRequired: false, transformFunction: null }, itemHeight: { classPropertyName: "itemHeight", publicName: "itemHeight", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, checkbox: { classPropertyName: "checkbox", publicName: "checkbox", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, filterText: { classPropertyName: "filterText", publicName: "filterText", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClicked: "itemClicked" }, host: { attributes: { "role": "listbox" }, listeners: { "keydown": "onKeyDown($event)", "focusout": "currentHighlightedValue.set(null)" }, properties: { "attr.tabIndex": "focussable() ? 0 : null", "attr.aria-activedescendant": "currentHighlightedValue() ? inputId() + \"_option_\" + currentHighlightedValue() : null", "aria-multiselectable": "!!multiple()", "id": "inputId()" } }, providers: [provideSelf(NgnListBox)], viewQueries: [{ propertyName: "_scroller", first: true, predicate: NgnScroller, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ngn-scroller\r\n [ptInt]=\"this\"\r\n [ptClass]=\"'scroller'\"\r\n [virtual]=\"virtual()\"\r\n [itemHeight]=\"itemHeight()\"\r\n [items]=\"displayedItems()\"\r\n [templateItem]=\"usedItemTemplate\"\r\n [fieldSticky]=\"'items'\"\r\n #scroller\r\n/>\r\n\r\n@if (!displayedItems().length) {\r\n <ng-container\r\n *ngTemplateOutlet=\"emptyTemplate() || defaultEmptyTemplate; context: {}\"\r\n ></ng-container>\r\n}\r\n\r\n<ng-template #usedItemTemplate [ngnTemplate]=\"scroller.templateTypes.item\" let-itemOrGroup>\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\r\n <div\r\n [ngnScrollerItem]=\"itemOrGroup\"\r\n [id]=\"inputId() + '_option_' + itemOrGroup.value\"\r\n [attr.role]=\"'option'\"\r\n [aria-selected]=\"selectable() ? valueArray().includes(itemOrGroup.value) : null\"\r\n [ptInt]=\"this\"\r\n [ptClass]=\"{\r\n item: !itemOrGroup.items,\r\n group: !!itemOrGroup.items,\r\n 'item-selected': valueArray().includes(itemOrGroup.value),\r\n 'item-highlighted': itemOrGroup.value === currentHighlightedValue(),\r\n }\"\r\n (click)=\"!itemOrGroup.items && selectable() && onSelect(itemOrGroup.value)\"\r\n (mouseenter)=\"\r\n !itemOrGroup.items && selectable() && selectOnHover() && onSelect(itemOrGroup.value)\r\n \"\r\n >\r\n @if (showCheckboxes() && !itemOrGroup.items) {\r\n <ngn-checkbox\r\n [value]=\"valueArray().includes(itemOrGroup.value)\"\r\n aria-hidden=\"true\"\r\n inert=\"true\"\r\n />\r\n }\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n itemOrGroup.items ? groupTemplate() : itemTemplate();\r\n context: { $implicit: itemOrGroup }\r\n \"\r\n ></ng-container>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #defaultItemTemplate [ngnTemplate]=\"templateTypes.item\" let-item>\r\n <span [attr.data-testid]=\"item?.testId\" [ptInt]=\"this\" [ptClass]=\"'default-item'\">\r\n @let label = item?.label;\r\n @if (label) {\r\n <span [attr.data-testid]=\"item?.testId\">{{ maybeCallback(label) }}</span>\r\n } @else {\r\n <span [attr.data-testid]=\"item?.testId\">​</span>\r\n }\r\n </span>\r\n</ng-template>\r\n\r\n<ng-template #defaultGroupTemplate [ngnTemplate]=\"templateTypes.item\" let-group>\r\n <span [attr.data-testid]=\"group?.testId\" [ptInt]=\"this\" [ptClass]=\"'default-group'\">\r\n @let label = group?.label;\r\n @if (label) {\r\n <span [attr.data-testid]=\"group?.testId\">{{ maybeCallback(label) }}</span>\r\n } @else {\r\n <span [attr.data-testid]=\"group?.testId\">​</span>\r\n }\r\n </span>\r\n</ng-template>\r\n\r\n<ng-template #defaultEmptyTemplate>\r\n <span [ptInt]=\"this\" [ptClass]=\"'empty'\" [attr.data-testid]=\"'empty'\">{{\r\n 'No items found'\r\n }}</span>\r\n</ng-template>\r\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NgnScroller, selector: "ngn-scroller, [ngn-scroller]", inputs: ["items", "fieldId", "virtual", "itemHeight", "virtualPadding", "focusable", "fieldSticky"] }, { kind: "directive", type: NgnScrollerItem, selector: "[ngnScrollerItem]", inputs: ["ngnScrollerItem"] }, { kind: "component", type: NgnCheckbox, selector: "ngn-checkbox", inputs: ["iconChecked", "iconUnchecked", "iconIndeterminate", "allowIndeterminate"] }, { kind: "directive", type: NgnTemplate, selector: "ng-template[ngnTemplate]", inputs: ["ngnTemplate"] }, { kind: "directive", type: NgnPt, selector: "[ptInt]", inputs: ["ptInt", "ptClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
204
204
|
}
|
|
205
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
205
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: NgnListBox, decorators: [{
|
|
206
206
|
type: Component,
|
|
207
207
|
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ngn-list-box', imports: [NgTemplateOutlet, NgnScroller, NgnScrollerItem, NgnCheckbox, NgnTemplate, NgnPt], providers: [provideSelf(NgnListBox)], host: {
|
|
208
208
|
'[attr.tabIndex]': 'focussable() ? 0 : null',
|