@ngneers/controls 0.0.1-next.1 → 0.0.1-next.2
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-api-ng.mjs +11 -18
- package/fesm2022/ngneers-controls-api-ng.mjs.map +1 -1
- package/fesm2022/ngneers-controls-badge.mjs +160 -0
- package/fesm2022/ngneers-controls-badge.mjs.map +1 -0
- package/fesm2022/ngneers-controls-base.mjs +85 -8
- package/fesm2022/ngneers-controls-base.mjs.map +1 -1
- package/fesm2022/{ngneers-controls-calendar-time-CJT5AFlA.mjs → ngneers-controls-calendar-time-paM6WVpV.mjs} +2 -2
- package/fesm2022/{ngneers-controls-calendar-time-CJT5AFlA.mjs.map → ngneers-controls-calendar-time-paM6WVpV.mjs.map} +1 -1
- package/fesm2022/ngneers-controls-calendar.mjs +13 -6
- package/fesm2022/ngneers-controls-calendar.mjs.map +1 -1
- package/fesm2022/ngneers-controls-checkbox.mjs +3 -3
- package/fesm2022/ngneers-controls-checkbox.mjs.map +1 -1
- package/fesm2022/ngneers-controls-color-picker.mjs +336 -0
- package/fesm2022/ngneers-controls-color-picker.mjs.map +1 -0
- package/fesm2022/ngneers-controls-default-icons.mjs +5 -0
- package/fesm2022/ngneers-controls-default-icons.mjs.map +1 -1
- package/fesm2022/ngneers-controls-directives.mjs +64 -7
- package/fesm2022/ngneers-controls-directives.mjs.map +1 -1
- package/fesm2022/ngneers-controls-edit-inplace.mjs +15 -5
- package/fesm2022/ngneers-controls-edit-inplace.mjs.map +1 -1
- package/fesm2022/ngneers-controls-errors.mjs +203 -148
- package/fesm2022/ngneers-controls-errors.mjs.map +1 -1
- package/fesm2022/ngneers-controls-filter.mjs +2 -2
- package/fesm2022/ngneers-controls-filter.mjs.map +1 -1
- package/fesm2022/ngneers-controls-hint.mjs +18 -1
- package/fesm2022/ngneers-controls-hint.mjs.map +1 -1
- package/fesm2022/ngneers-controls-i18n-translations-de.mjs +14 -0
- package/fesm2022/ngneers-controls-i18n-translations-de.mjs.map +1 -1
- package/fesm2022/ngneers-controls-i18n-translations-en.mjs +16 -0
- package/fesm2022/ngneers-controls-i18n-translations-en.mjs.map +1 -1
- package/fesm2022/ngneers-controls-icon.mjs +23 -6
- package/fesm2022/ngneers-controls-icon.mjs.map +1 -1
- package/fesm2022/ngneers-controls-input-field.mjs +18 -2
- package/fesm2022/ngneers-controls-input-field.mjs.map +1 -1
- package/fesm2022/ngneers-controls-input.mjs +49 -9
- package/fesm2022/ngneers-controls-input.mjs.map +1 -1
- package/fesm2022/ngneers-controls-list-box.mjs +2 -2
- package/fesm2022/ngneers-controls-list-box.mjs.map +1 -1
- package/fesm2022/ngneers-controls-mask-input.mjs +4 -1
- package/fesm2022/ngneers-controls-mask-input.mjs.map +1 -1
- package/fesm2022/ngneers-controls-number-input.mjs +4 -4
- package/fesm2022/ngneers-controls-number-input.mjs.map +1 -1
- package/fesm2022/ngneers-controls-otp.mjs +16 -4
- package/fesm2022/ngneers-controls-otp.mjs.map +1 -1
- package/fesm2022/ngneers-controls-paginator.mjs +36 -9
- package/fesm2022/ngneers-controls-paginator.mjs.map +1 -1
- package/fesm2022/ngneers-controls-radio.mjs +4 -4
- package/fesm2022/ngneers-controls-radio.mjs.map +1 -1
- package/fesm2022/ngneers-controls-rating.mjs +180 -0
- package/fesm2022/ngneers-controls-rating.mjs.map +1 -0
- package/fesm2022/ngneers-controls-scroll-shadow.mjs +33 -7
- package/fesm2022/ngneers-controls-scroll-shadow.mjs.map +1 -1
- package/fesm2022/ngneers-controls-scroller.mjs +4 -2
- package/fesm2022/ngneers-controls-scroller.mjs.map +1 -1
- package/fesm2022/ngneers-controls-select-button.mjs +2 -1
- package/fesm2022/ngneers-controls-select-button.mjs.map +1 -1
- package/fesm2022/ngneers-controls-select.mjs +24 -4
- 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-stepper.mjs +142 -0
- package/fesm2022/ngneers-controls-stepper.mjs.map +1 -0
- package/fesm2022/ngneers-controls-switch.mjs +3 -3
- package/fesm2022/ngneers-controls-switch.mjs.map +1 -1
- package/fesm2022/ngneers-controls-table.mjs +282 -15
- package/fesm2022/ngneers-controls-table.mjs.map +1 -1
- package/fesm2022/ngneers-controls-tabs.mjs +2 -2
- package/fesm2022/ngneers-controls-tabs.mjs.map +1 -1
- package/fesm2022/ngneers-controls-toggle-button.mjs +3 -3
- package/fesm2022/ngneers-controls-toggle-button.mjs.map +1 -1
- package/fesm2022/ngneers-controls-tooltip.mjs +16 -28
- package/fesm2022/ngneers-controls-tooltip.mjs.map +1 -1
- package/fesm2022/ngneers-controls-tree.mjs +2 -2
- package/fesm2022/ngneers-controls-tree.mjs.map +1 -1
- package/fesm2022/ngneers-controls-utils.mjs +138 -1
- package/fesm2022/ngneers-controls-utils.mjs.map +1 -1
- package/package.json +18 -2
- package/types/ngneers-controls-api-ng.d.ts +12 -9
- package/types/ngneers-controls-badge.d.ts +67 -0
- package/types/ngneers-controls-base.d.ts +61 -4
- package/types/ngneers-controls-breadcrumb.d.ts +14 -0
- package/types/ngneers-controls-calendar.d.ts +21 -6
- package/types/ngneers-controls-chip.d.ts +14 -0
- package/types/ngneers-controls-color-picker.d.ts +119 -0
- package/types/ngneers-controls-dialog.d.ts +14 -0
- package/types/ngneers-controls-directives.d.ts +31 -2
- package/types/ngneers-controls-drawer.d.ts +14 -0
- package/types/ngneers-controls-edit-inplace.d.ts +20 -0
- package/types/ngneers-controls-errors.d.ts +105 -16
- package/types/ngneers-controls-filter.d.ts +27 -13
- package/types/ngneers-controls-hint.d.ts +8 -1
- package/types/ngneers-controls-i18n-translations-de.d.ts +14 -0
- package/types/ngneers-controls-i18n-translations-en.d.ts +14 -0
- package/types/ngneers-controls-i18n.d.ts +14 -0
- package/types/ngneers-controls-icon.d.ts +2 -2
- package/types/ngneers-controls-input-field.d.ts +25 -2
- package/types/ngneers-controls-input.d.ts +35 -3
- package/types/ngneers-controls-list-box.d.ts +14 -0
- package/types/ngneers-controls-mask-input.d.ts +14 -0
- package/types/ngneers-controls-otp.d.ts +19 -0
- package/types/ngneers-controls-paginator.d.ts +31 -3
- package/types/ngneers-controls-rating.d.ts +69 -0
- package/types/ngneers-controls-scroll-shadow.d.ts +11 -2
- package/types/ngneers-controls-scroller.d.ts +3 -1
- package/types/ngneers-controls-select.d.ts +27 -3
- package/types/ngneers-controls-snackbar.d.ts +14 -0
- package/types/ngneers-controls-splitter.d.ts +14 -0
- package/types/ngneers-controls-state.d.ts +2 -2
- package/types/ngneers-controls-stepper.d.ts +68 -0
- package/types/ngneers-controls-table.d.ts +273 -169
- package/types/ngneers-controls-toast.d.ts +14 -0
- package/types/ngneers-controls-tooltip.d.ts +0 -1
- package/types/ngneers-controls-tree.d.ts +14 -0
- package/types/ngneers-controls-upload.d.ts +14 -0
- package/types/ngneers-controls-utils.d.ts +27 -2
|
@@ -176,23 +176,6 @@ function elementsSizesSignalInt(element, active) {
|
|
|
176
176
|
});
|
|
177
177
|
return sizeSignal;
|
|
178
178
|
}
|
|
179
|
-
const ABORT_SIGNAL_SYMBOL = Symbol('AbortSignal');
|
|
180
|
-
/**
|
|
181
|
-
* @todo use dom event functions directly and remove this function
|
|
182
|
-
* @deprecated use dom event functions instead
|
|
183
|
-
*/
|
|
184
|
-
function abortSignalOnDestroy(options) {
|
|
185
|
-
const destroyRef = options?.injector?.get(DestroyRef) ?? inject(DestroyRef);
|
|
186
|
-
if (ABORT_SIGNAL_SYMBOL in destroyRef) {
|
|
187
|
-
return destroyRef[ABORT_SIGNAL_SYMBOL];
|
|
188
|
-
}
|
|
189
|
-
const abortController = new AbortController();
|
|
190
|
-
destroyRef.onDestroy(() => {
|
|
191
|
-
abortController.abort();
|
|
192
|
-
});
|
|
193
|
-
destroyRef[ABORT_SIGNAL_SYMBOL] = abortController.signal;
|
|
194
|
-
return abortController.signal;
|
|
195
|
-
}
|
|
196
179
|
/**
|
|
197
180
|
* Creates an Observable that emits the latest event of the specified type from the given DOM element.
|
|
198
181
|
*
|
|
@@ -609,6 +592,16 @@ function injectThemeControlKinds(controlName) {
|
|
|
609
592
|
* `NgnCustomTypes`.
|
|
610
593
|
* @returns A signal of the available colors.
|
|
611
594
|
*/
|
|
595
|
+
/**
|
|
596
|
+
* Reads the explicit per-control default `color`/`kind` from the active theme's
|
|
597
|
+
* `meta.defaults`, as a reactive signal. Empty object when none is configured —
|
|
598
|
+
* callers then fall back to the positional (first-array-entry) default.
|
|
599
|
+
* @param controlName The name of the control to get defaults for.
|
|
600
|
+
*/
|
|
601
|
+
function injectThemeControlDefaults(controlName) {
|
|
602
|
+
const activeTheme = injectActiveTheme();
|
|
603
|
+
return computed(() => (activeTheme()?.meta.defaults?.[controlName] ?? {}));
|
|
604
|
+
}
|
|
612
605
|
function injectThemeColors(controlName) {
|
|
613
606
|
const activeTheme = injectActiveTheme();
|
|
614
607
|
return computed(() => {
|
|
@@ -955,5 +948,5 @@ function templateTypeFn() {
|
|
|
955
948
|
* Generated bundle index. Do not edit.
|
|
956
949
|
*/
|
|
957
950
|
|
|
958
|
-
export { COLOR_SCHEME_STORAGE, COLOR_SCHEME_STORAGE_KEY, COLOR_SCHEME_VALUES, ColorSchemeService, NGN_CONFIG, NgnStorage, NgnTemplate, Platform, ThemeService,
|
|
951
|
+
export { COLOR_SCHEME_STORAGE, COLOR_SCHEME_STORAGE_KEY, COLOR_SCHEME_VALUES, ColorSchemeService, NGN_CONFIG, NgnStorage, NgnTemplate, Platform, ThemeService, autoPositionElement, colorSchemeInitScript, defaultNgnConfig, domEventHandler, domEventObservable, domEventSignal, elementSizeSignal, elementsSizesSignal, getAppliedClasses, injectTheme, injectThemeColors, injectThemeControlDefaults, injectThemeControlKinds, injectThemeTemplate, positionElement, provideNgnConfig, provideNgnControls, roundByDpr, setComponentInput, splitPlacement, templateTypeFn, templateTypesFn, themeTemplateToTemplateInfo, toModalCloseBy, toPopoverCloseBy, withAutoColorScheme };
|
|
959
952
|
//# sourceMappingURL=ngneers-controls-api-ng.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngneers-controls-api-ng.mjs","sources":["../../src/api/ng/config/config.ts","../../src/api/ng/closable.ts","../../src/api/ng/dom.ts","../../src/api/ng/platform.ts","../../src/api/ng/color-scheme.ts","../../src/api/ng/color-scheme-provider.ts","../../src/api/ng/components.ts","../../src/api/ng/theme-service.ts","../../src/api/ng/kinds.ts","../../src/api/ng/positioning.ts","../../src/api/ng/provider.ts","../../src/api/ng/storage.ts","../../src/api/ng/template.ts","../../src/api/ng/ngneers-controls-api-ng.ts"],"sourcesContent":["import { inject, InjectionToken, provideAppInitializer, type Provider } from '@angular/core';\nimport { registerCustomLanguages, type Translations } from '@ngneers/controls/i18n';\nimport { type DeepPartial, Logger, type LogLevel } from '@ngneers/controls/utils';\n\nimport type { TooltipOptions } from './tooltip';\nimport type { NgnStateStorage } from '@ngneers/controls/utils-ng';\nimport type { StyleScope, Theme } from '@ngneers/controls-themes';\n\nexport const NGN_CONFIG = new InjectionToken<NgnConfig>('NGN_CONFIG');\n\nexport type NgnConfig = {\n readonly logLevel: LogLevel;\n readonly customTranslations?: Record<string, () => Promise<Translations>>;\n readonly disableAnimations: boolean;\n readonly theme: {\n readonly preset: Theme | null;\n readonly lazyLoaded: boolean;\n readonly styleScope: StyleScope | null;\n readonly cssLayer: string | null;\n readonly namePrefix: string;\n };\n readonly defaults: {\n readonly stateStorage: NgnStateStorage;\n readonly splitter: {\n readonly stateStorage: NgnStateStorage;\n };\n readonly tooltip: TooltipOptions;\n };\n};\n\nexport type NgnConfigInit = DeepPartial<\n NgnConfig,\n 'theme.preset.*' | 'theme.styleScope.*' | 'customTranslations.*'\n>;\n\nexport const defaultNgnConfig: NgnConfig = {\n logLevel: 'info',\n disableAnimations: false,\n theme: {\n preset: null,\n lazyLoaded: false,\n styleScope: null,\n cssLayer: 'ngn-controls',\n namePrefix: 'ngn-',\n },\n defaults: {\n stateStorage: 'session',\n splitter: {\n stateStorage: 'session',\n },\n tooltip: {\n placement: 'bottom',\n offset: 4,\n showDelay: '0.5s',\n hideDelay: '0.1s',\n showArrow: true,\n showOnHover: true,\n showOnFocus: true,\n hideOnTooltipHover: false,\n hideOnClick: true,\n autoAriaMode: 'description',\n },\n },\n};\n\nexport function provideNgnConfig(config?: NgnConfigInit): Provider {\n return [\n {\n provide: NGN_CONFIG,\n useValue: {\n logLevel: config?.logLevel ?? defaultNgnConfig.logLevel,\n customTranslations: config?.customTranslations,\n disableAnimations: config?.disableAnimations ?? defaultNgnConfig.disableAnimations,\n theme: {\n preset: config?.theme?.preset ?? defaultNgnConfig.theme.preset,\n lazyLoaded: config?.theme?.lazyLoaded ?? defaultNgnConfig.theme.lazyLoaded,\n styleScope: config?.theme?.styleScope ?? defaultNgnConfig.theme.styleScope,\n cssLayer:\n config?.theme?.cssLayer === undefined\n ? defaultNgnConfig.theme.cssLayer\n : config?.theme?.cssLayer,\n namePrefix: config?.theme?.namePrefix ?? defaultNgnConfig.theme.namePrefix,\n },\n defaults: {\n stateStorage: config?.defaults?.stateStorage ?? defaultNgnConfig.defaults.stateStorage,\n splitter: {\n stateStorage:\n config?.defaults?.splitter?.stateStorage ??\n config?.defaults?.stateStorage ??\n defaultNgnConfig.defaults.splitter.stateStorage,\n },\n tooltip: {\n placement:\n config?.defaults?.tooltip?.placement ?? defaultNgnConfig.defaults.tooltip.placement,\n offset: config?.defaults?.tooltip?.offset ?? defaultNgnConfig.defaults.tooltip.offset,\n showDelay:\n config?.defaults?.tooltip?.showDelay ?? defaultNgnConfig.defaults.tooltip.showDelay,\n hideDelay:\n config?.defaults?.tooltip?.hideDelay ?? defaultNgnConfig.defaults.tooltip.hideDelay,\n showArrow:\n config?.defaults?.tooltip?.showArrow ?? defaultNgnConfig.defaults.tooltip.showArrow,\n showOnHover:\n config?.defaults?.tooltip?.showOnHover ??\n defaultNgnConfig.defaults.tooltip.showOnHover,\n showOnFocus:\n config?.defaults?.tooltip?.showOnFocus ??\n defaultNgnConfig.defaults.tooltip.showOnFocus,\n hideOnTooltipHover:\n config?.defaults?.tooltip?.hideOnTooltipHover ??\n defaultNgnConfig.defaults.tooltip.hideOnTooltipHover,\n hideOnClick:\n config?.defaults?.tooltip?.hideOnClick ??\n defaultNgnConfig.defaults.tooltip.hideOnClick,\n autoAriaMode:\n config?.defaults?.tooltip?.autoAriaMode ??\n defaultNgnConfig.defaults.tooltip.autoAriaMode,\n },\n },\n } satisfies NgnConfig,\n },\n provideAppInitializer(() => {\n const config = inject(NGN_CONFIG);\n if (config?.customTranslations) {\n registerCustomLanguages(config.customTranslations);\n }\n Logger.logLevel = config.logLevel ?? Logger.logLevel;\n }),\n ];\n}\n","import { type ModelSignal, OutputEmitterRef } from '@angular/core';\n\nexport type PopoverCloseBy = 'any' | 'none';\nexport type CloseBy = PopoverCloseBy | 'escape';\n\nexport function toPopoverCloseBy(closeBy: CloseBy): 'auto' | 'manual' {\n switch (closeBy) {\n case 'any':\n return 'auto';\n case 'escape':\n case 'none':\n return 'manual';\n }\n}\n\nexport function toModalCloseBy(closeBy: CloseBy): 'any' | 'closerequest' | 'none' {\n switch (closeBy) {\n case 'any':\n return 'any';\n case 'escape':\n return 'closerequest';\n case 'none':\n return 'none';\n }\n}\n\nexport interface Openable {\n show(): void;\n hide(): void;\n toggle(): void;\n open: ModelSignal<boolean>;\n closed: OutputEmitterRef<void>;\n}\n","import {\n afterRenderEffect,\n computed,\n DestroyRef,\n effect,\n ElementRef,\n inject,\n Injector,\n runInInjectionContext,\n signal,\n type Signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { deepCopy } from '@ngneers/controls/utils';\nimport { signalWithPrevious } from '@ngneers/controls/utils-ng';\nimport { fromEvent, Observable, Subject, Subscription } from 'rxjs';\n\nexport type Size = { width: number; height: number };\n\ntype ElementArray =\n | Signal<ReadonlyArray<HTMLElement | ElementRef<HTMLElement>>>\n | ReadonlyArray<HTMLElement | ElementRef<HTMLElement>>;\ntype ElementSingle =\n | Signal<HTMLElement | ElementRef<HTMLElement> | undefined>\n | HTMLElement\n | Document\n | ElementRef<HTMLElement>;\n\nfunction getElement(el: ElementSingle): HTMLElement | Document | undefined {\n const rawElement = typeof el === 'function' ? el() : el;\n const element = rawElement instanceof ElementRef ? rawElement.nativeElement : rawElement;\n return element;\n}\n\nexport function elementSizeSignal(element: ElementSingle, active?: Signal<boolean>): Signal<Size> {\n const val = elementsSizesSignalInt(element, active);\n return computed(() => val()[0] ?? { width: 0, height: 0 });\n}\n\nexport function elementsSizesSignal(\n element: ElementArray,\n active?: Signal<boolean>\n): Signal<readonly Size[]> {\n return elementsSizesSignalInt(element, active);\n}\n\nfunction elementsSizesSignalInt(\n element: ElementArray | ElementSingle,\n active?: Signal<boolean>\n): Signal<readonly Size[]> {\n const sizeSignal = signal<readonly Size[]>([], {\n equal: (a, b) => JSON.stringify(a) === JSON.stringify(b),\n });\n\n let elements: HTMLElement[];\n afterRenderEffect(() => {\n resizeObserver.disconnect();\n if (active && !active()) {\n return;\n }\n const rawElement = typeof element === 'function' ? element() : element;\n const arrayElement = Array.isArray(rawElement) ? rawElement : rawElement ? [rawElement] : [];\n elements = arrayElement.map(el => (el instanceof ElementRef ? el.nativeElement : el));\n\n if (!elements.length) {\n return;\n }\n sizeSignal.set(\n elements.map(el => {\n const rect = el.getBoundingClientRect();\n return {\n width: rect.width,\n height: rect.height,\n };\n })\n );\n elements.forEach(el => {\n resizeObserver.observe(el, { box: 'border-box' });\n });\n });\n const destroyRef = inject(DestroyRef);\n if (typeof ResizeObserver === 'undefined') {\n return sizeSignal; // ResizeObserver is not supported, return initial size\n }\n const resizeObserver = new ResizeObserver(entries => {\n entries.forEach(entry => {\n const index = elements.findIndex(el => el === entry.target);\n sizeSignal.update(s => {\n const copy = deepCopy(s);\n const borderBoxSize = entry.borderBoxSize[0];\n if (!borderBoxSize) {\n return s;\n }\n copy[index] = {\n width: borderBoxSize.inlineSize,\n height: borderBoxSize.blockSize,\n };\n return copy;\n });\n });\n });\n destroyRef.onDestroy(() => {\n resizeObserver.disconnect();\n });\n return sizeSignal;\n}\n\nconst ABORT_SIGNAL_SYMBOL = Symbol('AbortSignal');\ntype DestroyRefWithAbortSignal = DestroyRef & { [ABORT_SIGNAL_SYMBOL]?: AbortSignal };\n/**\n * @todo use dom event functions directly and remove this function\n * @deprecated use dom event functions instead\n */\nexport function abortSignalOnDestroy(options?: { injector?: Injector }): AbortSignal {\n const destroyRef = options?.injector?.get(DestroyRef) ?? inject(DestroyRef);\n if (ABORT_SIGNAL_SYMBOL in destroyRef) {\n return destroyRef[ABORT_SIGNAL_SYMBOL] as AbortSignal;\n }\n const abortController = new AbortController();\n destroyRef.onDestroy(() => {\n abortController.abort();\n });\n (destroyRef as DestroyRefWithAbortSignal)[ABORT_SIGNAL_SYMBOL] = abortController.signal;\n return abortController.signal;\n}\n\n/**\n * Creates an Observable that emits the latest event of the specified type from the given DOM element.\n *\n * ⚠️ Cannot be used to cancel or call preventDefault on the event, as the event is emitted after the event handler phase.\n * @param element The target DOM element or ElementRef. Either can be provided directly or via a Signal.\n * @param eventName The name of the event to listen for.\n * @param injector Optional injector to use for lifecycle management. If not provided, the current injector is used.\n * @returns An Observable that emits the latest event of the specified type. Does not complete until the injector is destroyed.\n */\nexport function domEventObservable<EventName extends keyof GlobalEventHandlersEventMap>(\n element: ElementSingle,\n eventName: EventName,\n injector?: Injector\n): Observable<GlobalEventHandlersEventMap[EventName]> {\n const inj = injector ?? inject(Injector);\n\n const result = new Subject<GlobalEventHandlersEventMap[EventName]>();\n const destroyRef = inj.get(DestroyRef);\n\n let subscription: Subscription | undefined;\n runInInjectionContext(inj, () => {\n afterRenderEffect(() => {\n subscription?.unsubscribe();\n const el = getElement(element);\n if (!el) {\n return;\n }\n subscription = fromEvent(el, eventName)\n .pipe(takeUntilDestroyed(destroyRef))\n .subscribe(e => result.next(e as GlobalEventHandlersEventMap[EventName]));\n });\n });\n return result.asObservable().pipe(takeUntilDestroyed(destroyRef));\n}\n\n/**\n * Creates a Signal that emits the latest event of the specified type from the given DOM element.\n *\n * ⚠️ Cannot be used to cancel or call preventDefault on the event, as the event is emitted after the event handler phase.\n * @param element The target DOM element or ElementRef. Either can be provided directly or via a Signal.\n * @param eventName The name of the event to listen for.\n * @param injector Optional injector to use for lifecycle management. If not provided, the current injector is used.\n * @returns A Signal that emits the latest event of the specified type or null if no event has occurred.\n */\nexport function domEventSignal<EventName extends keyof GlobalEventHandlersEventMap>(\n element: ElementSingle,\n eventName: EventName,\n injector?: Injector\n): Signal<GlobalEventHandlersEventMap[EventName] | null> {\n const inj = injector ?? inject(Injector);\n const res = runInInjectionContext(inj, () => {\n const sig = signal<GlobalEventHandlersEventMap[EventName] | null>(null);\n domEventObservable(element, eventName, inj).subscribe(value => {\n sig.set(value as GlobalEventHandlersEventMap[EventName]);\n });\n return sig;\n });\n return res;\n}\n\n/**\n * Attaches an event handler to a DOM element that is automatically removed when the injector is destroyed.\n * @param element The target DOM element or ElementRef. Either can be provided directly or via a Signal.\n * @param eventName The name of the event to listen for.\n * @param handler The function to handle the event.\n * @param injector Optional injector to use for lifecycle management. If not provided, the current injector is used.\n * @param options Optional addEventListener options (e.g. `{ capture: true }`).\n */\nexport function domEventHandler<EventName extends keyof GlobalEventHandlersEventMap>(\n element: ElementSingle,\n eventName: EventName,\n handler: (event: GlobalEventHandlersEventMap[EventName]) => void,\n injector?: Injector,\n options?: AddEventListenerOptions\n): void {\n const inj = injector ?? inject(Injector);\n const destroyRef = inj.get(DestroyRef);\n runInInjectionContext(inj, () => {\n const destroyed = signal(false);\n destroyRef.onDestroy(() => {\n destroyed.set(true);\n });\n const elSig = computed(() => (destroyed() ? null : getElement(element)));\n const elSigWithPrev = signalWithPrevious(elSig);\n\n effect(() => {\n const element = elSigWithPrev();\n const previousElement = element.previous;\n if (previousElement) {\n previousElement.removeEventListener(\n eventName,\n handler as EventListenerOrEventListenerObject,\n options\n );\n }\n if (element.current) {\n element.current.addEventListener(\n eventName,\n handler as EventListenerOrEventListenerObject,\n options\n );\n }\n });\n });\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n computed,\n DestroyRef,\n DOCUMENT,\n inject,\n Injectable,\n PLATFORM_ID,\n type Signal,\n signal,\n} from '@angular/core';\n\nimport { elementSizeSignal, type Size } from './dom';\n\nexport type DeviceType = 'mobile' | 'desktop' | 'tablet';\n\n@Injectable()\nexport class Platform {\n private readonly _deviceType = signal<DeviceType>('desktop');\n private readonly _prefersColorScheme = signal<'light' | 'dark'>('light');\n\n public readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n public readonly windowSize: Signal<Size> = this.isBrowser\n ? elementSizeSignal(document.body)\n : signal({ width: 0, height: 0 });\n public readonly width = computed(() => this.windowSize().width);\n public readonly height = computed(() => this.windowSize().height);\n\n public readonly prefersColorScheme: Signal<'light' | 'dark'> = this._prefersColorScheme;\n\n constructor() {\n const doc = inject(DOCUMENT);\n const destroyRef = inject(DestroyRef);\n const win = doc.defaultView;\n if (!win || typeof win.matchMedia !== 'function') {\n return;\n }\n\n // color scheme detection (before device-type early returns)\n const colorMql = win.matchMedia('(prefers-color-scheme: dark)');\n this._prefersColorScheme.set(colorMql.matches ? 'dark' : 'light');\n const onColorChange = (e: MediaQueryListEvent) =>\n this._prefersColorScheme.set(e.matches ? 'dark' : 'light');\n colorMql.addEventListener('change', onColorChange);\n destroyRef.onDestroy(() => colorMql.removeEventListener('change', onColorChange));\n\n // device type\n const hasMouse = win.matchMedia('(any-hover: hover)').matches;\n if (hasMouse) {\n this._deviceType.set('desktop');\n return;\n }\n const isSmallScreen =\n win.matchMedia('(max-width: 768px)').matches || win.matchMedia('(max-height: 768px)').matches;\n if (isSmallScreen) {\n this._deviceType.set('mobile');\n } else {\n this._deviceType.set('tablet');\n }\n }\n\n public readonly isTouchDevice = computed(() => {\n return this._deviceType() === 'mobile' || this._deviceType() === 'tablet';\n });\n}\n","import {\n computed,\n effect,\n inject,\n Injectable,\n InjectionToken,\n signal,\n type Signal,\n} from '@angular/core';\nimport { toggleClass } from '@ngneers/controls/utils';\n\nimport { Platform } from './platform';\n\nexport type ColorScheme = 'light' | 'dark' | 'system';\n\n/** Storage key shared by ColorSchemeService and colorSchemeInitScript. */\nexport const COLOR_SCHEME_STORAGE_KEY = 'ngn-color-scheme';\n\n/** Synchronous storage for the color-scheme preference (raw enum string, not JSON). */\nexport interface ColorSchemeStorage {\n get(): ColorScheme | null;\n set(value: ColorScheme): void;\n}\n\nexport const COLOR_SCHEME_STORAGE = new InjectionToken<ColorSchemeStorage>('COLOR_SCHEME_STORAGE');\n\n/** All valid {@link ColorScheme} values; used to validate values read from storage. */\nexport const COLOR_SCHEME_VALUES: readonly ColorScheme[] = ['light', 'dark', 'system'];\n/** Cycling order for the UI button; reorder here without affecting storage validation. */\nconst CYCLE: readonly ColorScheme[] = ['light', 'dark', 'system'];\n\n@Injectable()\nexport class ColorSchemeService {\n private readonly _platform = inject(Platform);\n private readonly _storage = inject(COLOR_SCHEME_STORAGE);\n\n // Must be declared after _platform and _storage: readInitial() reads both.\n private readonly _preference = signal<ColorScheme>(this.readInitial());\n\n public readonly preference: Signal<ColorScheme> = this._preference;\n public readonly resolved: Signal<'light' | 'dark'> = computed(() => {\n const pref = this._preference();\n return pref === 'system' ? this._platform.prefersColorScheme() : pref;\n });\n public readonly isDark: Signal<boolean> = computed(() => this.resolved() === 'dark');\n\n constructor() {\n if (!this._platform.isBrowser) {\n return;\n }\n // Use the real browser document, not inject(DOCUMENT), so the dark class lands\n // on the actual <html> element (matches the theme's :root scope; the SSR mock is a different object).\n const doc = document;\n effect(() => {\n toggleClass(doc.documentElement, 'dark', this.isDark());\n });\n effect(() => {\n this._storage.set(this._preference());\n });\n }\n\n public set(pref: ColorScheme): void {\n this._preference.set(pref);\n }\n\n public cycle(): void {\n const i = CYCLE.indexOf(this._preference());\n this._preference.set(CYCLE[(i + 1) % CYCLE.length] ?? 'system');\n }\n\n private readInitial(): ColorScheme {\n if (!this._platform.isBrowser) {\n return 'system';\n }\n const stored = this._storage.get();\n return stored && COLOR_SCHEME_VALUES.includes(stored) ? stored : 'system';\n }\n}\n","import { inject, provideAppInitializer } from '@angular/core';\n\nimport {\n COLOR_SCHEME_STORAGE,\n COLOR_SCHEME_STORAGE_KEY,\n COLOR_SCHEME_VALUES,\n type ColorScheme,\n type ColorSchemeStorage,\n ColorSchemeService,\n} from './color-scheme';\n\nimport type { NgnFeature } from './provider';\n\nexport type ColorSchemeStorageOption = 'local' | 'session' | ColorSchemeStorage;\n\nfunction webStorage(kind: 'local' | 'session'): ColorSchemeStorage {\n return {\n get(): ColorScheme | null {\n try {\n const store = kind === 'local' ? localStorage : sessionStorage;\n const v = store.getItem(COLOR_SCHEME_STORAGE_KEY) as ColorScheme | null;\n return v && COLOR_SCHEME_VALUES.includes(v) ? v : null;\n } catch {\n return null;\n }\n },\n set(value: ColorScheme): void {\n try {\n const store = kind === 'local' ? localStorage : sessionStorage;\n store.setItem(COLOR_SCHEME_STORAGE_KEY, value);\n } catch {\n // ignore (private mode / blocked storage)\n }\n },\n };\n}\n\nfunction resolveStorage(option: ColorSchemeStorageOption | undefined): ColorSchemeStorage {\n if (option === 'session') return webStorage('session');\n if (option === 'local' || option === undefined) return webStorage('local');\n return option;\n}\n\nexport function colorSchemeInitScript(options?: { storage?: 'local' | 'session' }): string {\n const store = options?.storage === 'session' ? 'sessionStorage' : 'localStorage';\n return (\n `(function(){try{` +\n `var k='${COLOR_SCHEME_STORAGE_KEY}';` +\n `var s=${store}.getItem(k);` +\n `var sys=window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light';` +\n `var m=(s==='light'||s==='dark')?s:sys;` +\n `if(m==='dark')document.documentElement.classList.add('dark');` +\n `}catch(e){}})();`\n );\n}\n\nexport function withAutoColorScheme(options?: { storage?: ColorSchemeStorageOption }): NgnFeature {\n return {\n providers: [\n ColorSchemeService,\n { provide: COLOR_SCHEME_STORAGE, useValue: resolveStorage(options?.storage) },\n // Sole purpose: eagerly instantiate the service so its constructor effects run.\n provideAppInitializer(() => {\n inject(ColorSchemeService);\n }),\n ],\n };\n}\n","import { ComponentRef, type InputSignal, type InputSignalWithTransform } from '@angular/core';\n\ntype ComponentFromRef<T extends ComponentRef<any>> = T extends ComponentRef<infer C> ? C : never;\ntype InputsFromComponent<T> = {\n [K in keyof T]: T[K] extends InputSignal<infer V>\n ? V\n : T[K] extends InputSignalWithTransform<infer V, infer _>\n ? V\n : never;\n};\n\nexport function setComponentInput<\n T extends ComponentRef<C>,\n C,\n Input extends InputsFromComponent<ComponentFromRef<T>>,\n I extends keyof Input & string,\n>(componentRef: T, inputName: I, value: Input[I]): void {\n componentRef.setInput(inputName, value);\n}\n","import {\n DOCUMENT,\n inject,\n Injectable,\n Injector,\n type OnDestroy,\n signal,\n untracked,\n} from '@angular/core';\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\nimport { Logger } from '@ngneers/controls/utils';\nimport {\n applyGlobalStyles,\n applyTheme,\n type ControlName,\n type ControlTemplate,\n getClassName,\n type Theme,\n type ThemeClasses,\n type ThemeTemplate,\n} from '@ngneers/controls-themes';\nimport { globalStyles } from '@ngneers/controls-themes/base/global';\nimport { skip } from 'rxjs';\n\nimport { NGN_CONFIG, type NgnConfig } from './config';\n\nexport type AppliedThemeClassCfg<T extends ControlName> =\n | keyof ThemeClasses<ThemeTemplate[T]>\n | Partial<Record<keyof ThemeClasses<ThemeTemplate[T]>, boolean | (() => boolean)>>;\n\nexport type ControlTemplateInfo<T extends ControlTemplate<string, string[]>> = {\n scope: string;\n class: (className: T['classNames'][number]) => string;\n classes: (classes: {\n [K in T['classNames'][number]]?: boolean;\n }) => string;\n};\n\nexport function themeTemplateToTemplateInfo<T extends ControlTemplate<string, string[]>>(\n config: NgnConfig,\n template: T,\n options?: { unstyled?: () => boolean }\n): ControlTemplateInfo<T> {\n return {\n scope: template.scope,\n class: (className: T['classNames'][number]) =>\n getClassName(config.theme.namePrefix, template.scope, className, options?.unstyled?.()),\n classes: (classes: {\n [K in T['classNames'][number]]?: boolean;\n }): string => {\n let result = '';\n for (const className in classes) {\n if ((classes as Record<string, boolean | undefined>)[className]) {\n if (result) result += ' ';\n result += getClassName(\n config.theme.namePrefix,\n template.scope,\n className,\n options?.unstyled?.()\n );\n }\n }\n return result;\n },\n };\n}\n\nexport function injectThemeTemplate<T extends ControlTemplate<string, string[]>>(\n template: T,\n options?: { injector?: Injector; unstyled?: () => boolean }\n): ControlTemplateInfo<T> {\n const config = options?.injector?.get(NGN_CONFIG) ?? inject(NGN_CONFIG);\n const themeService = options?.injector?.get(ThemeService) ?? inject(ThemeService);\n themeService.loadScope(template.scope);\n return themeTemplateToTemplateInfo(config, template, { unstyled: options?.unstyled });\n}\n\nexport function injectTheme<T extends ControlName>(\n controlName: T,\n options?: { injector?: Injector }\n): ControlTemplate<T, string[]> {\n const themeService = options?.injector?.get(ThemeService) ?? inject(ThemeService);\n const theme = themeService.activeTheme();\n if (!theme) {\n throw new Error(\n `No active theme is set. Cannot inject theme for control \"${controlName}\". Please provide a theme in the configuration or set lazyLoaded to true if you plan to load themes dynamically.`\n );\n }\n const template = theme.parts.find(part => part.scope === controlName)?.controlTemplate as\n | ControlTemplate<T, string[]>\n | undefined;\n if (!template) {\n throw new Error(\n `The active theme \"${theme.name}\" does not contain a template for control \"${controlName}\".`\n );\n }\n return template;\n}\n\nexport function getAppliedClasses<T extends ControlName>(\n klass: AppliedThemeClassCfg<T>,\n themeTemplateInfo: Omit<ControlTemplateInfo<ControlTemplate<T, string[]>>, 'class' | 'classes'>\n): Array<{ class: string; name: string }> {\n function suffixes() {\n if (typeof klass === 'string') {\n return [klass];\n } else if (typeof klass === 'object' && klass !== null) {\n return Object.entries(klass)\n .filter(([_, value]) => (typeof value === 'function' ? value() : value))\n .map(([key, _]) => key);\n }\n return [];\n }\n const classes = suffixes().map(suffix => ({\n class: (themeTemplateInfo as ControlTemplateInfo<ControlTemplate<T, string[]>>).class(suffix),\n name: suffix,\n }));\n return classes;\n}\n\n@Injectable()\nexport class ThemeService implements OnDestroy {\n private readonly _config = inject(NGN_CONFIG);\n private readonly _loadedScopes = new Set<string>();\n private readonly _document = inject(DOCUMENT);\n\n public readonly activeTheme = signal(this._config.theme?.preset);\n\n constructor() {\n if (!this._config.theme?.preset && !this._config.theme?.lazyLoaded) {\n console.warn(\n 'No active theme found. Please provide a theme in the configuration or set lazyLoaded to true if you plan to load themes dynamically.'\n );\n }\n\n if (this._config.disableAnimations) {\n const style = this._document.createElement('style');\n style.setAttribute('ngn-style', '');\n // we set the durations instead of setting animation/transition to none,\n // so that the animation starts/ends are still applied & the events are still fired\n style.innerHTML = `.ngn-control, .ngn-control * {\n animation-duration: 0s !important;\n transition-duration: 0s !important;\n }`;\n this._document.head.appendChild(style);\n Logger.debug('Animations have been disabled via configuration.');\n }\n\n toObservable(this.activeTheme)\n .pipe(takeUntilDestroyed(), skip(1))\n .subscribe(this.onThemeChange.bind(this));\n }\n\n public loadScope(scope: string): void {\n if (this._loadedScopes.has(scope)) {\n Logger.debug(`Theme scope \"${scope}\" is already loaded.`);\n return;\n }\n\n const activeTheme = untracked(() => this.activeTheme());\n if (!activeTheme) {\n Logger.debug(\n `No active theme set. Cannot load theme scope \"${scope}\". Scope will be loaded when the theme is set.`\n );\n return;\n } else {\n Logger.debug(`Loading theme scope \"${scope}\" for active theme \"${activeTheme.name}\".`);\n this.applyTheme(activeTheme, [scope]);\n }\n\n this._loadedScopes.add(scope);\n }\n\n public ngOnDestroy(): void {\n Logger.debug('ThemeService is being destroyed. Unloading all theme scopes...');\n this.unloadAllScopes();\n this._loadedScopes.clear();\n }\n\n private onThemeChange(newTheme: Theme | null): void {\n if (!newTheme) {\n Logger.warn('The active theme has been set to null.');\n this.unloadAllScopes();\n return;\n }\n\n Logger.debug(`Active theme changed to \"${newTheme.name}\". Reloading scopes...`);\n this.unloadAllScopes();\n this._loadedScopes.forEach(scope => {\n Logger.debug(`Reloading theme scope \"${scope}\" for active theme \"${newTheme.name}\".`);\n this.applyTheme(newTheme, [scope]);\n });\n }\n\n private unloadAllScopes(): void {\n this._document.head.querySelectorAll('style[ngn-style][data-theme-scope]').forEach(el => {\n el.remove();\n });\n }\n\n private applyTheme(theme: Theme, scopes: string[]): void {\n applyTheme(theme, scopes, {\n document: this._document,\n layer: this._config.theme.cssLayer ?? undefined,\n styleScope: this._config.theme.styleScope ?? undefined,\n namePrefix: this._config.theme.namePrefix,\n });\n applyGlobalStyles(globalStyles, {\n document: this._document,\n layer: this._config.theme.cssLayer ?? undefined,\n styleScope: this._config.theme.styleScope ?? undefined,\n namePrefix: this._config.theme.namePrefix,\n });\n }\n}\n","import { computed, inject, type Signal } from '@angular/core';\n\nimport { NGN_CONFIG } from './config';\nimport { ThemeService } from './theme-service';\n\nimport type { CustomColor, CustomKind } from '@ngneers/controls-custom-types';\nimport type { Theme } from '@ngneers/controls-themes';\n\n/**\n * Reactively reads the currently active theme (which may be switched at runtime via\n * `ThemeService`), falling back to the configured preset. Reading it inside a `computed`\n * tracks `ThemeService.activeTheme`, so derived kind/color lists update on a theme switch.\n */\nfunction injectActiveTheme(): Signal<Theme | null | undefined> {\n const themeService = inject(ThemeService, { optional: true });\n const config = inject(NGN_CONFIG);\n // Only fall back to the configured preset when there is no `ThemeService`. When the service is\n // present, `activeTheme()` — including its valid `null` (cleared) state — is authoritative and\n // must be preserved rather than reintroducing the preset.\n return computed(() => (themeService ? themeService.activeTheme() : config.theme.preset));\n}\n\n/**\n * Retrieves the available kinds for a given control from the active theme, as a reactive signal\n * that updates when the active theme changes. Does **not** return custom kinds defined by the\n * user in `NgnCustomTypes`.\n * @param controlName The name of the control to get kinds for.\n * @returns A signal of the available kinds for the specified control.\n */\nexport function injectThemeControlKinds<T extends string>(controlName: T): Signal<CustomKind<T>[]> {\n const activeTheme = injectActiveTheme();\n return computed(() => (activeTheme()?.meta.kinds?.[controlName] ?? []) as CustomKind<T>[]);\n}\n\n/**\n * Retrieves the available colors from the active theme, as a reactive signal that updates when\n * the active theme changes. Does **not** return custom colors defined by the user in\n * `NgnCustomTypes`.\n * @returns A signal of the available colors.\n */\nexport function injectThemeColors(controlName?: string): Signal<CustomColor[]> {\n const activeTheme = injectActiveTheme();\n return computed(() => {\n const theme = activeTheme();\n if (controlName) {\n const classNames = theme?.parts.find(x => x.scope === controlName)?.controlTemplate\n ?.classNames;\n if (!classNames?.includes('color-*')) {\n return [];\n }\n }\n return (theme?.meta.colors ?? []) as CustomColor[];\n });\n}\n","import { DestroyRef, inject, Injector } from '@angular/core';\n\nimport type {\n Alignment,\n ComputePositionReturn,\n Middleware,\n Placement,\n ReferenceElement,\n Side,\n Strategy,\n} from '@floating-ui/dom';\n\ntype FloatingUi = typeof import('@floating-ui/dom');\nlet floatingPromise: Promise<FloatingUi> | undefined;\nlet floating: FloatingUi | undefined;\nfunction loadFloating(): Promise<FloatingUi> {\n if (!floatingPromise) {\n floatingPromise = import('@floating-ui/dom').then(m => (floating = m));\n }\n return floatingPromise;\n}\n\nexport type Point = {\n x: number;\n y: number;\n};\n\nexport type Anchor = HTMLElement | Point;\n\nexport type PositioningSizeConstraints = {\n /**\n * The minimum width of the floating element. When a string is provided, it is used as the CSS min-width value.\n */\n minWidth?: string;\n /**\n * The width of the floating element. When a number is provided, it is relative to the width of the reference element.\n * When a string is provided, it is used as the CSS width value.\n */\n width?: number | string;\n /**\n * The maximum width of the floating element. When a number is provided, it is relative to the width of the reference element.\n * When a string is provided, it is used as the CSS max-width value.\n */\n maxWidth?: number | string;\n /**\n * The height of the floating element. When a string is provided, it is used as the CSS height value.\n */\n height?: string;\n /**\n * The maximum height of the floating element. When a string is provided, it is used as the CSS max-height value.\n */\n maxHeight?: string;\n /**\n * The minimum height of the floating element. When a string is provided, it is used as the CSS min-height value.\n */\n minHeight?: string;\n};\n\nexport type PositioningOptions = {\n injector?: Injector;\n placement?: Placement;\n flip?: boolean;\n resize?: boolean;\n shift?: boolean;\n offset?: number;\n stopped?: boolean;\n sizeConstraints?: PositioningSizeConstraints;\n strategy?: Strategy;\n middleware?: Middleware[];\n disableSettingStyles?: boolean;\n hasShrinkableContent?: boolean;\n onPositionChange?: (position: ComputePositionReturn) => void;\n};\n\nexport type AutoPositioningHandle = {\n stop: () => void;\n start: () => void;\n isRunning: () => boolean;\n};\n\n/**\n * Snap a coordinate to the device-pixel grid. floating-ui returns subpixel\n * coordinates; setting them raw puts the floating element (and its arrow) on\n * fractional boundaries, producing blurry, non-deterministic anti-aliasing.\n * Rounding by DPR keeps rendering crisp and stable. Matches floating-ui's own\n * `roundByDPR` guidance.\n */\nexport function roundByDpr(el: HTMLElement, value: number): number {\n const dpr = el.ownerDocument.defaultView?.devicePixelRatio || 1;\n return Math.round(value * dpr) / dpr;\n}\n\nfunction filterNonNullishKeys<T extends Record<string, unknown>>(obj: T): Partial<T> {\n return Object.fromEntries(Object.entries(obj).filter(([, value]) => value != null)) as Partial<T>;\n}\n\nfunction mergeWithDefaults(options: PositioningOptions): PositioningOptions {\n return {\n placement: 'bottom',\n flip: true,\n resize: true,\n shift: true,\n offset: 4,\n stopped: false,\n ...filterNonNullishKeys(options),\n };\n}\n\nexport function positionElement(\n anchor: Anchor,\n floatingEl: HTMLElement,\n options: PositioningOptions = {}\n) {\n options = mergeWithDefaults(options);\n\n function run(fui: FloatingUi): void {\n const { computePosition, flip, offset, shift, size } = fui;\n\n const referenceElement = toReferenceElement(anchor);\n\n const flipMiddleware = options.flip\n ? flip(\n options.shift ? { crossAxis: 'alignment', fallbackAxisSideDirection: 'end' } : undefined\n )\n : undefined;\n const shiftMiddleware = options.shift ? shift() : undefined;\n\n if (options.sizeConstraints) {\n if (options.sizeConstraints.width || options.sizeConstraints.maxWidth) {\n const refWidth = referenceElement.getBoundingClientRect().width;\n if (options.sizeConstraints.width) {\n if (typeof options.sizeConstraints.width === 'string') {\n floatingEl.style.width = options.sizeConstraints.width;\n } else {\n const widthConstraints = options.sizeConstraints.width * refWidth;\n floatingEl.style.width = `min(100%, ${widthConstraints}px)`;\n }\n }\n if (options.sizeConstraints.maxWidth) {\n if (typeof options.sizeConstraints.maxWidth === 'string') {\n floatingEl.style.maxWidth = options.sizeConstraints.maxWidth;\n } else {\n const maxWidthConstraints = options.sizeConstraints.maxWidth * refWidth;\n floatingEl.style.maxWidth = `min(100%, ${maxWidthConstraints}px)`;\n }\n }\n }\n if (options.sizeConstraints.height || options.sizeConstraints.maxHeight) {\n if (options.sizeConstraints.height) {\n floatingEl.style.height = options.sizeConstraints.height;\n }\n if (options.sizeConstraints.maxHeight) {\n floatingEl.style.maxHeight = options.sizeConstraints.maxHeight;\n }\n }\n if (options.sizeConstraints.minWidth) {\n floatingEl.style.minWidth = options.sizeConstraints.minWidth;\n }\n }\n\n void computePosition(referenceElement, floatingEl, {\n placement: options.placement,\n strategy: options.strategy,\n middleware: [\n options.offset ? offset(options.offset) : undefined,\n options.resize\n ? size({\n apply({ availableHeight }) {\n const maxHeightConstraint = options.sizeConstraints?.maxHeight;\n const maxHeightInPx = maxHeightConstraint?.replace(/px$/, '');\n const maxHeight = maxHeightInPx\n ? Math.min(availableHeight, parseInt(maxHeightInPx))\n : availableHeight;\n if (options.hasShrinkableContent) {\n Object.assign(floatingEl.style, {\n height: `${maxHeight - 1}px`,\n });\n }\n },\n })\n : undefined,\n ...(options.placement?.includes('-')\n ? [flipMiddleware, shiftMiddleware]\n : [shiftMiddleware, flipMiddleware]),\n ...(options.middleware || []),\n ].filter(Boolean),\n }).then(pos => {\n if (!options.disableSettingStyles) {\n const flipped = pos.middlewareData.flip?.index;\n const flippedToLREnd =\n flipped &&\n (pos.placement.startsWith('left-') || pos.placement.startsWith('right-')) &&\n pos.placement.endsWith('-end');\n const flippedToTop = flipped && pos.placement.startsWith('top');\n\n Object.assign(floatingEl.style, {\n left: `${roundByDpr(floatingEl, pos.x)}px`,\n top: `${roundByDpr(floatingEl, pos.y)}px`,\n justifyContent: flippedToLREnd || flippedToTop ? 'flex-end' : 'flex-start',\n });\n }\n options.onPositionChange?.(pos);\n });\n }\n\n if (floating) {\n run(floating);\n } else {\n void loadFloating().then(run);\n }\n}\n\nfunction toReferenceElement(anchor: Anchor): ReferenceElement {\n const referenceElement: ReferenceElement =\n anchor instanceof HTMLElement\n ? anchor\n : {\n getBoundingClientRect: () => ({\n x: anchor.x,\n y: anchor.y,\n width: 1,\n height: 1,\n top: anchor.y,\n right: anchor.x + 1,\n bottom: anchor.y + 1,\n left: anchor.x,\n }),\n };\n return referenceElement;\n}\n\nexport function autoPositionElement(\n anchor: Anchor,\n floatingEl: HTMLElement,\n options: PositioningOptions = {}\n): AutoPositioningHandle {\n options = mergeWithDefaults(options);\n\n // Prefetch the floating-ui chunk as soon as a tooltip/popover directive instantiates\n // so the first open does not flash. This is a download trigger only — it does not start.\n void loadFloating();\n\n let cleanup: (() => void) | undefined;\n let started = false; // intent: should be running\n const destroyRef = options.injector?.get(DestroyRef) ?? inject(DestroyRef);\n\n function startAutoUpdate(fui: FloatingUi) {\n // Defensive: a previous start may have already assigned a live cleanup\n // (e.g. two rapid start() calls sharing the cached load promise).\n cleanup?.();\n cleanup = fui.autoUpdate(toReferenceElement(anchor), floatingEl, () => {\n positionElement(anchor, floatingEl, options);\n });\n }\n\n destroyRef.onDestroy(() => {\n started = false;\n cleanup?.();\n cleanup = undefined;\n });\n return {\n start: () => {\n started = true;\n if (floating) {\n // Atomic teardown+reinstall, matching the original synchronous behavior.\n startAutoUpdate(floating);\n } else {\n cleanup?.();\n cleanup = undefined;\n void loadFloating().then(fui => {\n if (!started) {\n return; // a stop()/destroy landed during load — bail, no leak\n }\n startAutoUpdate(fui);\n });\n }\n },\n stop: () => {\n started = false;\n cleanup?.();\n cleanup = undefined;\n },\n isRunning: () => started,\n };\n}\n\nexport function splitPlacement(placement: Placement): [Side, Alignment | undefined] {\n return placement.split('-') as [Side, Alignment | undefined];\n}\n","import { I18n } from '@ngneers/controls/i18n';\nimport { NgnGlobal } from '@ngneers/controls/utils-ng';\n\nimport { type NgnConfigInit, provideNgnConfig } from './config';\nimport { Platform } from './platform';\nimport { ThemeService } from './theme-service';\n\nimport type { EnvironmentProviders, Provider } from '@angular/core';\n\nexport type NgnFeature = {\n providers: (Provider | EnvironmentProviders)[];\n};\n\nexport function provideNgnControls(\n config?: NgnConfigInit,\n ...features: NgnFeature[]\n): (Provider | EnvironmentProviders)[] {\n return [\n NgnGlobal,\n ThemeService,\n I18n,\n Platform,\n provideNgnConfig(config),\n ...features.map(f => f.providers).flat(),\n ];\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n DOCUMENT,\n inject,\n PLATFORM_ID,\n REQUEST,\n signal,\n untracked,\n type WritableSignal,\n} from '@angular/core';\nimport { Logger } from '@ngneers/controls/utils';\n\nexport type NgnStorageKind<T> =\n | 'localstorage'\n | 'sessionstorage'\n | 'cookie'\n | {\n initialize: () => T;\n update: (value: T) => void;\n };\n\n/** One year, in seconds — used as the cookie `max-age`. */\nconst COOKIE_MAX_AGE = 60 * 60 * 24 * 365;\n\nexport class NgnStorage<T extends Record<string, unknown>> {\n private readonly _store: WritableSignal<T>;\n private readonly _set: (value: T) => void;\n\n public set<K extends keyof T>(key: K, value: T[K]) {\n untracked(() => {\n const newVal = {\n ...this._store(),\n [key]: value,\n };\n this._store.set(newVal);\n this._set(newVal);\n });\n }\n\n public get<K extends keyof T>(key: K): T[K] | undefined {\n return this._store()[key];\n }\n\n /**\n * NOTE: must be constructed within an injection context — the built-in kinds\n * read the platform (`PLATFORM_ID`) to stay SSR-safe, and the `cookie` kind\n * additionally reads `DOCUMENT` / the SSR `REQUEST`.\n */\n constructor(key: string, kind: NgnStorageKind<T>, initialValue: T) {\n this._store = signal<T>(initialValue);\n\n // Custom adapter — the caller fully controls persistence.\n if (typeof kind === 'object') {\n this._store.set(kind.initialize() ?? initialValue);\n this._set = kind.update;\n return;\n }\n\n const isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n // Cookies are the only kind readable during SSR (from the request headers).\n if (kind === 'cookie') {\n const doc = inject(DOCUMENT);\n const cookieString = isBrowser\n ? doc.cookie\n : (inject(REQUEST, { optional: true })?.headers.get('cookie') ?? '');\n this._store.set(this._parse(key, readCookie(cookieString, key), initialValue));\n // Writes only happen in the browser; the server render is read-only.\n this._set = isBrowser\n ? value => {\n const encoded = encodeURIComponent(JSON.stringify(value ?? {}));\n const secure = doc.location?.protocol === 'https:' ? ';secure' : '';\n doc.cookie = `${encodeURIComponent(key)}=${encoded};path=/;max-age=${COOKIE_MAX_AGE};samesite=lax${secure}`;\n }\n : () => {\n /* no-op on the server */\n };\n return;\n }\n\n // localstorage / sessionstorage are browser-only; no-op (keep the initial\n // value) during SSR so the render doesn't crash.\n if (!isBrowser) {\n this._set = () => {\n /* no-op on the server */\n };\n return;\n }\n const storage = kind === 'localstorage' ? localStorage : sessionStorage;\n this._store.set(this._parse(key, storage.getItem(key), initialValue));\n this._set = (value: T) => storage.setItem(key, JSON.stringify(value ?? {}));\n }\n\n /** Parse persisted JSON, falling back to the caller's initial value. */\n private _parse(key: string, raw: string | null, fallback: T): T {\n if (!raw) {\n return fallback;\n }\n try {\n return JSON.parse(raw) as T;\n } catch (error) {\n Logger.warn(`Could not parse stored value for key ${key}`, error);\n return fallback;\n }\n }\n}\n\n/** Read a single cookie value from a `Cookie` header / `document.cookie` string. */\nfunction readCookie(cookieString: string, key: string): string | null {\n const name = encodeURIComponent(key);\n for (const part of cookieString.split(';')) {\n const separator = part.indexOf('=');\n if (separator === -1) {\n continue;\n }\n if (part.slice(0, separator).trim() === name) {\n return decodeURIComponent(part.slice(separator + 1));\n }\n }\n return null;\n}\n","import { Directive, input } from '@angular/core';\n\n@Directive({\n selector: 'ng-template[ngnTemplate]',\n})\nexport class NgnTemplate<T> {\n public readonly ngnTemplate = input.required<T>();\n\n public static ngTemplateContextGuard<T>(dir: NgnTemplate<T>, ctx: unknown): ctx is T {\n return true;\n }\n}\n\n/**\n * A noop with return type T.\n * This function is used to define typed properties to use in a template.\n */\nexport function templateTypesFn<T extends Record<string, Record<string, any>>>() {\n return {} as T & { $implicit: { [K in keyof T]: Partial<T[K]> } };\n}\n\n/**\n * A noop with return type `{ $implicit: Implicit } & Named`.\n * This function is used to define a typed property to use in a template.\n */\nexport function templateTypeFn<Implicit, Named extends Record<string, any> = object>() {\n return {} as ([Implicit] extends [undefined] ? unknown : { $implicit: Implicit }) & Named;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;MAQa,UAAU,GAAG,IAAI,cAAc,CAAY,YAAY;AA2B7D,MAAM,gBAAgB,GAAc;AACzC,IAAA,QAAQ,EAAE,MAAM;AAChB,IAAA,iBAAiB,EAAE,KAAK;AACxB,IAAA,KAAK,EAAE;AACL,QAAA,MAAM,EAAE,IAAI;AACZ,QAAA,UAAU,EAAE,KAAK;AACjB,QAAA,UAAU,EAAE,IAAI;AAChB,QAAA,QAAQ,EAAE,cAAc;AACxB,QAAA,UAAU,EAAE,MAAM;AACnB,KAAA;AACD,IAAA,QAAQ,EAAE;AACR,QAAA,YAAY,EAAE,SAAS;AACvB,QAAA,QAAQ,EAAE;AACR,YAAA,YAAY,EAAE,SAAS;AACxB,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,SAAS,EAAE,QAAQ;AACnB,YAAA,MAAM,EAAE,CAAC;AACT,YAAA,SAAS,EAAE,MAAM;AACjB,YAAA,SAAS,EAAE,MAAM;AACjB,YAAA,SAAS,EAAE,IAAI;AACf,YAAA,WAAW,EAAE,IAAI;AACjB,YAAA,WAAW,EAAE,IAAI;AACjB,YAAA,kBAAkB,EAAE,KAAK;AACzB,YAAA,WAAW,EAAE,IAAI;AACjB,YAAA,YAAY,EAAE,aAAa;AAC5B,SAAA;AACF,KAAA;;AAGG,SAAU,gBAAgB,CAAC,MAAsB,EAAA;IACrD,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,UAAU;AACnB,YAAA,QAAQ,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EAAA,aAAA,EAAA,UAAA,EAAA,aAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAX,WAAW,EAAA,UAAA,EAAA,CAAA;kBAHvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,0BAA0B;AACrC,iBAAA;;AASD;;;AAGG;SACa,eAAe,GAAA;AAC7B,IAAA,OAAO,EAA0D;AACnE;AAEA;;;AAGG;SACa,cAAc,GAAA;AAC5B,IAAA,OAAO,EAAkF;AAC3F;;AC3BA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngneers-controls-api-ng.mjs","sources":["../../src/api/ng/config/config.ts","../../src/api/ng/closable.ts","../../src/api/ng/dom.ts","../../src/api/ng/platform.ts","../../src/api/ng/color-scheme.ts","../../src/api/ng/color-scheme-provider.ts","../../src/api/ng/components.ts","../../src/api/ng/theme-service.ts","../../src/api/ng/kinds.ts","../../src/api/ng/positioning.ts","../../src/api/ng/provider.ts","../../src/api/ng/storage.ts","../../src/api/ng/template.ts","../../src/api/ng/ngneers-controls-api-ng.ts"],"sourcesContent":["import { inject, InjectionToken, provideAppInitializer, type Provider } from '@angular/core';\nimport { registerCustomLanguages, type Translations } from '@ngneers/controls/i18n';\nimport { type DeepPartial, Logger, type LogLevel } from '@ngneers/controls/utils';\n\nimport type { TooltipOptions } from './tooltip';\nimport type { NgnStateStorage } from '@ngneers/controls/utils-ng';\nimport type { StyleScope, Theme } from '@ngneers/controls-themes';\n\nexport const NGN_CONFIG = new InjectionToken<NgnConfig>('NGN_CONFIG');\n\nexport type NgnConfig = {\n readonly logLevel: LogLevel;\n readonly customTranslations?: Record<string, () => Promise<Translations>>;\n readonly disableAnimations: boolean;\n readonly theme: {\n readonly preset: Theme | null;\n readonly lazyLoaded: boolean;\n readonly styleScope: StyleScope | null;\n readonly cssLayer: string | null;\n readonly namePrefix: string;\n };\n readonly defaults: {\n readonly stateStorage: NgnStateStorage;\n readonly splitter: {\n readonly stateStorage: NgnStateStorage;\n };\n readonly tooltip: TooltipOptions;\n };\n};\n\nexport type NgnConfigInit = DeepPartial<\n NgnConfig,\n 'theme.preset.*' | 'theme.styleScope.*' | 'customTranslations.*'\n>;\n\nexport const defaultNgnConfig: NgnConfig = {\n logLevel: 'info',\n disableAnimations: false,\n theme: {\n preset: null,\n lazyLoaded: false,\n styleScope: null,\n cssLayer: 'ngn-controls',\n namePrefix: 'ngn-',\n },\n defaults: {\n stateStorage: 'session',\n splitter: {\n stateStorage: 'session',\n },\n tooltip: {\n placement: 'bottom',\n offset: 4,\n showDelay: '0.5s',\n hideDelay: '0.1s',\n showArrow: true,\n showOnHover: true,\n showOnFocus: true,\n hideOnTooltipHover: false,\n hideOnClick: true,\n autoAriaMode: 'description',\n },\n },\n};\n\nexport function provideNgnConfig(config?: NgnConfigInit): Provider {\n return [\n {\n provide: NGN_CONFIG,\n useValue: {\n logLevel: config?.logLevel ?? defaultNgnConfig.logLevel,\n customTranslations: config?.customTranslations,\n disableAnimations: config?.disableAnimations ?? defaultNgnConfig.disableAnimations,\n theme: {\n preset: config?.theme?.preset ?? defaultNgnConfig.theme.preset,\n lazyLoaded: config?.theme?.lazyLoaded ?? defaultNgnConfig.theme.lazyLoaded,\n styleScope: config?.theme?.styleScope ?? defaultNgnConfig.theme.styleScope,\n cssLayer:\n config?.theme?.cssLayer === undefined\n ? defaultNgnConfig.theme.cssLayer\n : config?.theme?.cssLayer,\n namePrefix: config?.theme?.namePrefix ?? defaultNgnConfig.theme.namePrefix,\n },\n defaults: {\n stateStorage: config?.defaults?.stateStorage ?? defaultNgnConfig.defaults.stateStorage,\n splitter: {\n stateStorage:\n config?.defaults?.splitter?.stateStorage ??\n config?.defaults?.stateStorage ??\n defaultNgnConfig.defaults.splitter.stateStorage,\n },\n tooltip: {\n placement:\n config?.defaults?.tooltip?.placement ?? defaultNgnConfig.defaults.tooltip.placement,\n offset: config?.defaults?.tooltip?.offset ?? defaultNgnConfig.defaults.tooltip.offset,\n showDelay:\n config?.defaults?.tooltip?.showDelay ?? defaultNgnConfig.defaults.tooltip.showDelay,\n hideDelay:\n config?.defaults?.tooltip?.hideDelay ?? defaultNgnConfig.defaults.tooltip.hideDelay,\n showArrow:\n config?.defaults?.tooltip?.showArrow ?? defaultNgnConfig.defaults.tooltip.showArrow,\n showOnHover:\n config?.defaults?.tooltip?.showOnHover ??\n defaultNgnConfig.defaults.tooltip.showOnHover,\n showOnFocus:\n config?.defaults?.tooltip?.showOnFocus ??\n defaultNgnConfig.defaults.tooltip.showOnFocus,\n hideOnTooltipHover:\n config?.defaults?.tooltip?.hideOnTooltipHover ??\n defaultNgnConfig.defaults.tooltip.hideOnTooltipHover,\n hideOnClick:\n config?.defaults?.tooltip?.hideOnClick ??\n defaultNgnConfig.defaults.tooltip.hideOnClick,\n autoAriaMode:\n config?.defaults?.tooltip?.autoAriaMode ??\n defaultNgnConfig.defaults.tooltip.autoAriaMode,\n },\n },\n } satisfies NgnConfig,\n },\n provideAppInitializer(() => {\n const config = inject(NGN_CONFIG);\n if (config?.customTranslations) {\n registerCustomLanguages(config.customTranslations);\n }\n Logger.logLevel = config.logLevel ?? Logger.logLevel;\n }),\n ];\n}\n","import { type ModelSignal, OutputEmitterRef } from '@angular/core';\n\nexport type PopoverCloseBy = 'any' | 'none';\nexport type CloseBy = PopoverCloseBy | 'escape';\n\nexport function toPopoverCloseBy(closeBy: CloseBy): 'auto' | 'manual' {\n switch (closeBy) {\n case 'any':\n return 'auto';\n case 'escape':\n case 'none':\n return 'manual';\n }\n}\n\nexport function toModalCloseBy(closeBy: CloseBy): 'any' | 'closerequest' | 'none' {\n switch (closeBy) {\n case 'any':\n return 'any';\n case 'escape':\n return 'closerequest';\n case 'none':\n return 'none';\n }\n}\n\nexport interface Openable {\n show(): void;\n hide(): void;\n toggle(): void;\n open: ModelSignal<boolean>;\n closed: OutputEmitterRef<void>;\n}\n","import {\n afterRenderEffect,\n computed,\n DestroyRef,\n effect,\n ElementRef,\n inject,\n Injector,\n runInInjectionContext,\n signal,\n type Signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { deepCopy } from '@ngneers/controls/utils';\nimport { signalWithPrevious } from '@ngneers/controls/utils-ng';\nimport { fromEvent, Observable, Subject, Subscription } from 'rxjs';\n\nexport type Size = { width: number; height: number };\n\ntype ElementArray =\n | Signal<ReadonlyArray<HTMLElement | ElementRef<HTMLElement>>>\n | ReadonlyArray<HTMLElement | ElementRef<HTMLElement>>;\ntype ElementSingle =\n | Signal<HTMLElement | ElementRef<HTMLElement> | undefined>\n | HTMLElement\n | Document\n | ElementRef<HTMLElement>;\n\nfunction getElement(el: ElementSingle): HTMLElement | Document | undefined {\n const rawElement = typeof el === 'function' ? el() : el;\n const element = rawElement instanceof ElementRef ? rawElement.nativeElement : rawElement;\n return element;\n}\n\nexport function elementSizeSignal(element: ElementSingle, active?: Signal<boolean>): Signal<Size> {\n const val = elementsSizesSignalInt(element, active);\n return computed(() => val()[0] ?? { width: 0, height: 0 });\n}\n\nexport function elementsSizesSignal(\n element: ElementArray,\n active?: Signal<boolean>\n): Signal<readonly Size[]> {\n return elementsSizesSignalInt(element, active);\n}\n\nfunction elementsSizesSignalInt(\n element: ElementArray | ElementSingle,\n active?: Signal<boolean>\n): Signal<readonly Size[]> {\n const sizeSignal = signal<readonly Size[]>([], {\n equal: (a, b) => JSON.stringify(a) === JSON.stringify(b),\n });\n\n let elements: HTMLElement[];\n afterRenderEffect(() => {\n resizeObserver.disconnect();\n if (active && !active()) {\n return;\n }\n const rawElement = typeof element === 'function' ? element() : element;\n const arrayElement = Array.isArray(rawElement) ? rawElement : rawElement ? [rawElement] : [];\n elements = arrayElement.map(el => (el instanceof ElementRef ? el.nativeElement : el));\n\n if (!elements.length) {\n return;\n }\n sizeSignal.set(\n elements.map(el => {\n const rect = el.getBoundingClientRect();\n return {\n width: rect.width,\n height: rect.height,\n };\n })\n );\n elements.forEach(el => {\n resizeObserver.observe(el, { box: 'border-box' });\n });\n });\n const destroyRef = inject(DestroyRef);\n if (typeof ResizeObserver === 'undefined') {\n return sizeSignal; // ResizeObserver is not supported, return initial size\n }\n const resizeObserver = new ResizeObserver(entries => {\n entries.forEach(entry => {\n const index = elements.findIndex(el => el === entry.target);\n sizeSignal.update(s => {\n const copy = deepCopy(s);\n const borderBoxSize = entry.borderBoxSize[0];\n if (!borderBoxSize) {\n return s;\n }\n copy[index] = {\n width: borderBoxSize.inlineSize,\n height: borderBoxSize.blockSize,\n };\n return copy;\n });\n });\n });\n destroyRef.onDestroy(() => {\n resizeObserver.disconnect();\n });\n return sizeSignal;\n}\n\n/**\n * Creates an Observable that emits the latest event of the specified type from the given DOM element.\n *\n * ⚠️ Cannot be used to cancel or call preventDefault on the event, as the event is emitted after the event handler phase.\n * @param element The target DOM element or ElementRef. Either can be provided directly or via a Signal.\n * @param eventName The name of the event to listen for.\n * @param injector Optional injector to use for lifecycle management. If not provided, the current injector is used.\n * @returns An Observable that emits the latest event of the specified type. Does not complete until the injector is destroyed.\n */\nexport function domEventObservable<EventName extends keyof GlobalEventHandlersEventMap>(\n element: ElementSingle,\n eventName: EventName,\n injector?: Injector\n): Observable<GlobalEventHandlersEventMap[EventName]> {\n const inj = injector ?? inject(Injector);\n\n const result = new Subject<GlobalEventHandlersEventMap[EventName]>();\n const destroyRef = inj.get(DestroyRef);\n\n let subscription: Subscription | undefined;\n runInInjectionContext(inj, () => {\n afterRenderEffect(() => {\n subscription?.unsubscribe();\n const el = getElement(element);\n if (!el) {\n return;\n }\n subscription = fromEvent(el, eventName)\n .pipe(takeUntilDestroyed(destroyRef))\n .subscribe(e => result.next(e as GlobalEventHandlersEventMap[EventName]));\n });\n });\n return result.asObservable().pipe(takeUntilDestroyed(destroyRef));\n}\n\n/**\n * Creates a Signal that emits the latest event of the specified type from the given DOM element.\n *\n * ⚠️ Cannot be used to cancel or call preventDefault on the event, as the event is emitted after the event handler phase.\n * @param element The target DOM element or ElementRef. Either can be provided directly or via a Signal.\n * @param eventName The name of the event to listen for.\n * @param injector Optional injector to use for lifecycle management. If not provided, the current injector is used.\n * @returns A Signal that emits the latest event of the specified type or null if no event has occurred.\n */\nexport function domEventSignal<EventName extends keyof GlobalEventHandlersEventMap>(\n element: ElementSingle,\n eventName: EventName,\n injector?: Injector\n): Signal<GlobalEventHandlersEventMap[EventName] | null> {\n const inj = injector ?? inject(Injector);\n const res = runInInjectionContext(inj, () => {\n const sig = signal<GlobalEventHandlersEventMap[EventName] | null>(null);\n domEventObservable(element, eventName, inj).subscribe(value => {\n sig.set(value as GlobalEventHandlersEventMap[EventName]);\n });\n return sig;\n });\n return res;\n}\n\n/**\n * Attaches an event handler to a DOM element that is automatically removed when the injector is destroyed.\n * @param element The target DOM element or ElementRef. Either can be provided directly or via a Signal.\n * @param eventName The name of the event to listen for.\n * @param handler The function to handle the event.\n * @param injector Optional injector to use for lifecycle management. If not provided, the current injector is used.\n * @param options Optional addEventListener options (e.g. `{ capture: true }`).\n */\nexport function domEventHandler<EventName extends keyof GlobalEventHandlersEventMap>(\n element: ElementSingle,\n eventName: EventName,\n handler: (event: GlobalEventHandlersEventMap[EventName]) => void,\n injector?: Injector,\n options?: AddEventListenerOptions\n): void {\n const inj = injector ?? inject(Injector);\n const destroyRef = inj.get(DestroyRef);\n runInInjectionContext(inj, () => {\n const destroyed = signal(false);\n destroyRef.onDestroy(() => {\n destroyed.set(true);\n });\n const elSig = computed(() => (destroyed() ? null : getElement(element)));\n const elSigWithPrev = signalWithPrevious(elSig);\n\n effect(() => {\n const element = elSigWithPrev();\n const previousElement = element.previous;\n if (previousElement) {\n previousElement.removeEventListener(\n eventName,\n handler as EventListenerOrEventListenerObject,\n options\n );\n }\n if (element.current) {\n element.current.addEventListener(\n eventName,\n handler as EventListenerOrEventListenerObject,\n options\n );\n }\n });\n });\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n computed,\n DestroyRef,\n DOCUMENT,\n inject,\n Injectable,\n PLATFORM_ID,\n type Signal,\n signal,\n} from '@angular/core';\n\nimport { elementSizeSignal, type Size } from './dom';\n\nexport type DeviceType = 'mobile' | 'desktop' | 'tablet';\n\n@Injectable()\nexport class Platform {\n private readonly _deviceType = signal<DeviceType>('desktop');\n private readonly _prefersColorScheme = signal<'light' | 'dark'>('light');\n\n public readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n public readonly windowSize: Signal<Size> = this.isBrowser\n ? elementSizeSignal(document.body)\n : signal({ width: 0, height: 0 });\n public readonly width = computed(() => this.windowSize().width);\n public readonly height = computed(() => this.windowSize().height);\n\n public readonly prefersColorScheme: Signal<'light' | 'dark'> = this._prefersColorScheme;\n\n constructor() {\n const doc = inject(DOCUMENT);\n const destroyRef = inject(DestroyRef);\n const win = doc.defaultView;\n if (!win || typeof win.matchMedia !== 'function') {\n return;\n }\n\n // color scheme detection (before device-type early returns)\n const colorMql = win.matchMedia('(prefers-color-scheme: dark)');\n this._prefersColorScheme.set(colorMql.matches ? 'dark' : 'light');\n const onColorChange = (e: MediaQueryListEvent) =>\n this._prefersColorScheme.set(e.matches ? 'dark' : 'light');\n colorMql.addEventListener('change', onColorChange);\n destroyRef.onDestroy(() => colorMql.removeEventListener('change', onColorChange));\n\n // device type\n const hasMouse = win.matchMedia('(any-hover: hover)').matches;\n if (hasMouse) {\n this._deviceType.set('desktop');\n return;\n }\n const isSmallScreen =\n win.matchMedia('(max-width: 768px)').matches || win.matchMedia('(max-height: 768px)').matches;\n if (isSmallScreen) {\n this._deviceType.set('mobile');\n } else {\n this._deviceType.set('tablet');\n }\n }\n\n public readonly isTouchDevice = computed(() => {\n return this._deviceType() === 'mobile' || this._deviceType() === 'tablet';\n });\n}\n","import {\n computed,\n effect,\n inject,\n Injectable,\n InjectionToken,\n signal,\n type Signal,\n} from '@angular/core';\nimport { toggleClass } from '@ngneers/controls/utils';\n\nimport { Platform } from './platform';\n\nexport type ColorScheme = 'light' | 'dark' | 'system';\n\n/** Storage key shared by ColorSchemeService and colorSchemeInitScript. */\nexport const COLOR_SCHEME_STORAGE_KEY = 'ngn-color-scheme';\n\n/** Synchronous storage for the color-scheme preference (raw enum string, not JSON). */\nexport interface ColorSchemeStorage {\n get(): ColorScheme | null;\n set(value: ColorScheme): void;\n}\n\nexport const COLOR_SCHEME_STORAGE = new InjectionToken<ColorSchemeStorage>('COLOR_SCHEME_STORAGE');\n\n/** All valid {@link ColorScheme} values; used to validate values read from storage. */\nexport const COLOR_SCHEME_VALUES: readonly ColorScheme[] = ['light', 'dark', 'system'];\n/** Cycling order for the UI button; reorder here without affecting storage validation. */\nconst CYCLE: readonly ColorScheme[] = ['light', 'dark', 'system'];\n\n@Injectable()\nexport class ColorSchemeService {\n private readonly _platform = inject(Platform);\n private readonly _storage = inject(COLOR_SCHEME_STORAGE);\n\n // Must be declared after _platform and _storage: readInitial() reads both.\n private readonly _preference = signal<ColorScheme>(this.readInitial());\n\n public readonly preference: Signal<ColorScheme> = this._preference;\n public readonly resolved: Signal<'light' | 'dark'> = computed(() => {\n const pref = this._preference();\n return pref === 'system' ? this._platform.prefersColorScheme() : pref;\n });\n public readonly isDark: Signal<boolean> = computed(() => this.resolved() === 'dark');\n\n constructor() {\n if (!this._platform.isBrowser) {\n return;\n }\n // Use the real browser document, not inject(DOCUMENT), so the dark class lands\n // on the actual <html> element (matches the theme's :root scope; the SSR mock is a different object).\n const doc = document;\n effect(() => {\n toggleClass(doc.documentElement, 'dark', this.isDark());\n });\n effect(() => {\n this._storage.set(this._preference());\n });\n }\n\n public set(pref: ColorScheme): void {\n this._preference.set(pref);\n }\n\n public cycle(): void {\n const i = CYCLE.indexOf(this._preference());\n this._preference.set(CYCLE[(i + 1) % CYCLE.length] ?? 'system');\n }\n\n private readInitial(): ColorScheme {\n if (!this._platform.isBrowser) {\n return 'system';\n }\n const stored = this._storage.get();\n return stored && COLOR_SCHEME_VALUES.includes(stored) ? stored : 'system';\n }\n}\n","import { inject, provideAppInitializer } from '@angular/core';\n\nimport {\n COLOR_SCHEME_STORAGE,\n COLOR_SCHEME_STORAGE_KEY,\n COLOR_SCHEME_VALUES,\n type ColorScheme,\n type ColorSchemeStorage,\n ColorSchemeService,\n} from './color-scheme';\n\nimport type { NgnFeature } from './provider';\n\nexport type ColorSchemeStorageOption = 'local' | 'session' | ColorSchemeStorage;\n\nfunction webStorage(kind: 'local' | 'session'): ColorSchemeStorage {\n return {\n get(): ColorScheme | null {\n try {\n const store = kind === 'local' ? localStorage : sessionStorage;\n const v = store.getItem(COLOR_SCHEME_STORAGE_KEY) as ColorScheme | null;\n return v && COLOR_SCHEME_VALUES.includes(v) ? v : null;\n } catch {\n return null;\n }\n },\n set(value: ColorScheme): void {\n try {\n const store = kind === 'local' ? localStorage : sessionStorage;\n store.setItem(COLOR_SCHEME_STORAGE_KEY, value);\n } catch {\n // ignore (private mode / blocked storage)\n }\n },\n };\n}\n\nfunction resolveStorage(option: ColorSchemeStorageOption | undefined): ColorSchemeStorage {\n if (option === 'session') return webStorage('session');\n if (option === 'local' || option === undefined) return webStorage('local');\n return option;\n}\n\nexport function colorSchemeInitScript(options?: { storage?: 'local' | 'session' }): string {\n const store = options?.storage === 'session' ? 'sessionStorage' : 'localStorage';\n return (\n `(function(){try{` +\n `var k='${COLOR_SCHEME_STORAGE_KEY}';` +\n `var s=${store}.getItem(k);` +\n `var sys=window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light';` +\n `var m=(s==='light'||s==='dark')?s:sys;` +\n `if(m==='dark')document.documentElement.classList.add('dark');` +\n `}catch(e){}})();`\n );\n}\n\nexport function withAutoColorScheme(options?: { storage?: ColorSchemeStorageOption }): NgnFeature {\n return {\n providers: [\n ColorSchemeService,\n { provide: COLOR_SCHEME_STORAGE, useValue: resolveStorage(options?.storage) },\n // Sole purpose: eagerly instantiate the service so its constructor effects run.\n provideAppInitializer(() => {\n inject(ColorSchemeService);\n }),\n ],\n };\n}\n","import { ComponentRef, type InputSignal, type InputSignalWithTransform } from '@angular/core';\n\ntype ComponentFromRef<T extends ComponentRef<any>> = T extends ComponentRef<infer C> ? C : never;\ntype InputsFromComponent<T> = {\n [K in keyof T]: T[K] extends InputSignal<infer V>\n ? V\n : T[K] extends InputSignalWithTransform<infer V, infer _>\n ? V\n : never;\n};\n\nexport function setComponentInput<\n T extends ComponentRef<C>,\n C,\n Input extends InputsFromComponent<ComponentFromRef<T>>,\n I extends keyof Input & string,\n>(componentRef: T, inputName: I, value: Input[I]): void {\n componentRef.setInput(inputName, value);\n}\n","import {\n DOCUMENT,\n inject,\n Injectable,\n Injector,\n type OnDestroy,\n signal,\n untracked,\n} from '@angular/core';\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\nimport { Logger } from '@ngneers/controls/utils';\nimport {\n applyGlobalStyles,\n applyTheme,\n type ControlName,\n type ControlTemplate,\n getClassName,\n type Theme,\n type ThemeClasses,\n type ThemeTemplate,\n} from '@ngneers/controls-themes';\nimport { globalStyles } from '@ngneers/controls-themes/base/global';\nimport { skip } from 'rxjs';\n\nimport { NGN_CONFIG, type NgnConfig } from './config';\n\nexport type AppliedThemeClassCfg<T extends ControlName> =\n | keyof ThemeClasses<ThemeTemplate[T]>\n | Partial<Record<keyof ThemeClasses<ThemeTemplate[T]>, boolean | (() => boolean)>>;\n\nexport type ControlTemplateInfo<T extends ControlTemplate<string, string[]>> = {\n scope: string;\n class: (className: T['classNames'][number]) => string;\n classes: (classes: {\n [K in T['classNames'][number]]?: boolean;\n }) => string;\n};\n\nexport function themeTemplateToTemplateInfo<T extends ControlTemplate<string, string[]>>(\n config: NgnConfig,\n template: T,\n options?: { unstyled?: () => boolean }\n): ControlTemplateInfo<T> {\n return {\n scope: template.scope,\n class: (className: T['classNames'][number]) =>\n getClassName(config.theme.namePrefix, template.scope, className, options?.unstyled?.()),\n classes: (classes: {\n [K in T['classNames'][number]]?: boolean;\n }): string => {\n let result = '';\n for (const className in classes) {\n if ((classes as Record<string, boolean | undefined>)[className]) {\n if (result) result += ' ';\n result += getClassName(\n config.theme.namePrefix,\n template.scope,\n className,\n options?.unstyled?.()\n );\n }\n }\n return result;\n },\n };\n}\n\nexport function injectThemeTemplate<T extends ControlTemplate<string, string[]>>(\n template: T,\n options?: { injector?: Injector; unstyled?: () => boolean }\n): ControlTemplateInfo<T> {\n const config = options?.injector?.get(NGN_CONFIG) ?? inject(NGN_CONFIG);\n const themeService = options?.injector?.get(ThemeService) ?? inject(ThemeService);\n themeService.loadScope(template.scope);\n return themeTemplateToTemplateInfo(config, template, { unstyled: options?.unstyled });\n}\n\nexport function injectTheme<T extends ControlName>(\n controlName: T,\n options?: { injector?: Injector }\n): ControlTemplate<T, string[]> {\n const themeService = options?.injector?.get(ThemeService) ?? inject(ThemeService);\n const theme = themeService.activeTheme();\n if (!theme) {\n throw new Error(\n `No active theme is set. Cannot inject theme for control \"${controlName}\". Please provide a theme in the configuration or set lazyLoaded to true if you plan to load themes dynamically.`\n );\n }\n const template = theme.parts.find(part => part.scope === controlName)?.controlTemplate as\n | ControlTemplate<T, string[]>\n | undefined;\n if (!template) {\n throw new Error(\n `The active theme \"${theme.name}\" does not contain a template for control \"${controlName}\".`\n );\n }\n return template;\n}\n\nexport function getAppliedClasses<T extends ControlName>(\n klass: AppliedThemeClassCfg<T>,\n themeTemplateInfo: Omit<ControlTemplateInfo<ControlTemplate<T, string[]>>, 'class' | 'classes'>\n): Array<{ class: string; name: string }> {\n function suffixes() {\n if (typeof klass === 'string') {\n return [klass];\n } else if (typeof klass === 'object' && klass !== null) {\n return Object.entries(klass)\n .filter(([_, value]) => (typeof value === 'function' ? value() : value))\n .map(([key, _]) => key);\n }\n return [];\n }\n const classes = suffixes().map(suffix => ({\n class: (themeTemplateInfo as ControlTemplateInfo<ControlTemplate<T, string[]>>).class(suffix),\n name: suffix,\n }));\n return classes;\n}\n\n@Injectable()\nexport class ThemeService implements OnDestroy {\n private readonly _config = inject(NGN_CONFIG);\n private readonly _loadedScopes = new Set<string>();\n private readonly _document = inject(DOCUMENT);\n\n public readonly activeTheme = signal(this._config.theme?.preset);\n\n constructor() {\n if (!this._config.theme?.preset && !this._config.theme?.lazyLoaded) {\n console.warn(\n 'No active theme found. Please provide a theme in the configuration or set lazyLoaded to true if you plan to load themes dynamically.'\n );\n }\n\n if (this._config.disableAnimations) {\n const style = this._document.createElement('style');\n style.setAttribute('ngn-style', '');\n // we set the durations instead of setting animation/transition to none,\n // so that the animation starts/ends are still applied & the events are still fired\n style.innerHTML = `.ngn-control, .ngn-control * {\n animation-duration: 0s !important;\n transition-duration: 0s !important;\n }`;\n this._document.head.appendChild(style);\n Logger.debug('Animations have been disabled via configuration.');\n }\n\n toObservable(this.activeTheme)\n .pipe(takeUntilDestroyed(), skip(1))\n .subscribe(this.onThemeChange.bind(this));\n }\n\n public loadScope(scope: string): void {\n if (this._loadedScopes.has(scope)) {\n Logger.debug(`Theme scope \"${scope}\" is already loaded.`);\n return;\n }\n\n const activeTheme = untracked(() => this.activeTheme());\n if (!activeTheme) {\n Logger.debug(\n `No active theme set. Cannot load theme scope \"${scope}\". Scope will be loaded when the theme is set.`\n );\n return;\n } else {\n Logger.debug(`Loading theme scope \"${scope}\" for active theme \"${activeTheme.name}\".`);\n this.applyTheme(activeTheme, [scope]);\n }\n\n this._loadedScopes.add(scope);\n }\n\n public ngOnDestroy(): void {\n Logger.debug('ThemeService is being destroyed. Unloading all theme scopes...');\n this.unloadAllScopes();\n this._loadedScopes.clear();\n }\n\n private onThemeChange(newTheme: Theme | null): void {\n if (!newTheme) {\n Logger.warn('The active theme has been set to null.');\n this.unloadAllScopes();\n return;\n }\n\n Logger.debug(`Active theme changed to \"${newTheme.name}\". Reloading scopes...`);\n this.unloadAllScopes();\n this._loadedScopes.forEach(scope => {\n Logger.debug(`Reloading theme scope \"${scope}\" for active theme \"${newTheme.name}\".`);\n this.applyTheme(newTheme, [scope]);\n });\n }\n\n private unloadAllScopes(): void {\n this._document.head.querySelectorAll('style[ngn-style][data-theme-scope]').forEach(el => {\n el.remove();\n });\n }\n\n private applyTheme(theme: Theme, scopes: string[]): void {\n applyTheme(theme, scopes, {\n document: this._document,\n layer: this._config.theme.cssLayer ?? undefined,\n styleScope: this._config.theme.styleScope ?? undefined,\n namePrefix: this._config.theme.namePrefix,\n });\n applyGlobalStyles(globalStyles, {\n document: this._document,\n layer: this._config.theme.cssLayer ?? undefined,\n styleScope: this._config.theme.styleScope ?? undefined,\n namePrefix: this._config.theme.namePrefix,\n });\n }\n}\n","import { computed, inject, type Signal } from '@angular/core';\n\nimport { NGN_CONFIG } from './config';\nimport { ThemeService } from './theme-service';\n\nimport type { CustomColor, CustomKind } from '@ngneers/controls-custom-types';\nimport type { Theme } from '@ngneers/controls-themes';\n\n/**\n * Reactively reads the currently active theme (which may be switched at runtime via\n * `ThemeService`), falling back to the configured preset. Reading it inside a `computed`\n * tracks `ThemeService.activeTheme`, so derived kind/color lists update on a theme switch.\n */\nfunction injectActiveTheme(): Signal<Theme | null | undefined> {\n const themeService = inject(ThemeService, { optional: true });\n const config = inject(NGN_CONFIG);\n // Only fall back to the configured preset when there is no `ThemeService`. When the service is\n // present, `activeTheme()` — including its valid `null` (cleared) state — is authoritative and\n // must be preserved rather than reintroducing the preset.\n return computed(() => (themeService ? themeService.activeTheme() : config.theme.preset));\n}\n\n/**\n * Retrieves the available kinds for a given control from the active theme, as a reactive signal\n * that updates when the active theme changes. Does **not** return custom kinds defined by the\n * user in `NgnCustomTypes`.\n * @param controlName The name of the control to get kinds for.\n * @returns A signal of the available kinds for the specified control.\n */\nexport function injectThemeControlKinds<T extends string>(controlName: T): Signal<CustomKind<T>[]> {\n const activeTheme = injectActiveTheme();\n return computed(() => (activeTheme()?.meta.kinds?.[controlName] ?? []) as CustomKind<T>[]);\n}\n\n/**\n * Retrieves the available colors from the active theme, as a reactive signal that updates when\n * the active theme changes. Does **not** return custom colors defined by the user in\n * `NgnCustomTypes`.\n * @returns A signal of the available colors.\n */\n/**\n * Reads the explicit per-control default `color`/`kind` from the active theme's\n * `meta.defaults`, as a reactive signal. Empty object when none is configured —\n * callers then fall back to the positional (first-array-entry) default.\n * @param controlName The name of the control to get defaults for.\n */\nexport function injectThemeControlDefaults<T extends string>(\n controlName: T\n): Signal<{ color?: CustomColor; kind?: CustomKind<T> }> {\n const activeTheme = injectActiveTheme();\n return computed(\n () =>\n (activeTheme()?.meta.defaults?.[controlName] ?? {}) as {\n color?: CustomColor;\n kind?: CustomKind<T>;\n }\n );\n}\n\nexport function injectThemeColors(controlName?: string): Signal<CustomColor[]> {\n const activeTheme = injectActiveTheme();\n return computed(() => {\n const theme = activeTheme();\n if (controlName) {\n const classNames = theme?.parts.find(x => x.scope === controlName)?.controlTemplate\n ?.classNames;\n if (!classNames?.includes('color-*')) {\n return [];\n }\n }\n return (theme?.meta.colors ?? []) as CustomColor[];\n });\n}\n","import { DestroyRef, inject, Injector } from '@angular/core';\n\nimport type {\n Alignment,\n ComputePositionReturn,\n Middleware,\n Placement,\n ReferenceElement,\n Side,\n Strategy,\n} from '@floating-ui/dom';\n\ntype FloatingUi = typeof import('@floating-ui/dom');\nlet floatingPromise: Promise<FloatingUi> | undefined;\nlet floating: FloatingUi | undefined;\nfunction loadFloating(): Promise<FloatingUi> {\n if (!floatingPromise) {\n floatingPromise = import('@floating-ui/dom').then(m => (floating = m));\n }\n return floatingPromise;\n}\n\nexport type Point = {\n x: number;\n y: number;\n};\n\nexport type Anchor = HTMLElement | Point;\n\nexport type PositioningSizeConstraints = {\n /**\n * The minimum width of the floating element. When a string is provided, it is used as the CSS min-width value.\n */\n minWidth?: string;\n /**\n * The width of the floating element. When a number is provided, it is relative to the width of the reference element.\n * When a string is provided, it is used as the CSS width value.\n */\n width?: number | string;\n /**\n * The maximum width of the floating element. When a number is provided, it is relative to the width of the reference element.\n * When a string is provided, it is used as the CSS max-width value.\n */\n maxWidth?: number | string;\n /**\n * The height of the floating element. When a string is provided, it is used as the CSS height value.\n */\n height?: string;\n /**\n * The maximum height of the floating element. When a string is provided, it is used as the CSS max-height value.\n */\n maxHeight?: string;\n /**\n * The minimum height of the floating element. When a string is provided, it is used as the CSS min-height value.\n */\n minHeight?: string;\n};\n\nexport type PositioningOptions = {\n injector?: Injector;\n placement?: Placement;\n flip?: boolean;\n resize?: boolean;\n shift?: boolean;\n offset?: number;\n stopped?: boolean;\n sizeConstraints?: PositioningSizeConstraints;\n strategy?: Strategy;\n middleware?: Middleware[];\n disableSettingStyles?: boolean;\n hasShrinkableContent?: boolean;\n onPositionChange?: (position: ComputePositionReturn) => void;\n};\n\nexport type AutoPositioningHandle = {\n stop: () => void;\n start: () => void;\n isRunning: () => boolean;\n};\n\n/**\n * Snap a coordinate to the device-pixel grid. floating-ui returns subpixel\n * coordinates; setting them raw puts the floating element (and its arrow) on\n * fractional boundaries, producing blurry, non-deterministic anti-aliasing.\n * Rounding by DPR keeps rendering crisp and stable. Matches floating-ui's own\n * `roundByDPR` guidance.\n */\nexport function roundByDpr(el: HTMLElement, value: number): number {\n const dpr = el.ownerDocument.defaultView?.devicePixelRatio || 1;\n return Math.round(value * dpr) / dpr;\n}\n\nfunction filterNonNullishKeys<T extends Record<string, unknown>>(obj: T): Partial<T> {\n return Object.fromEntries(Object.entries(obj).filter(([, value]) => value != null)) as Partial<T>;\n}\n\nfunction mergeWithDefaults(options: PositioningOptions): PositioningOptions {\n return {\n placement: 'bottom',\n flip: true,\n resize: true,\n shift: true,\n offset: 4,\n stopped: false,\n ...filterNonNullishKeys(options),\n };\n}\n\nexport function positionElement(\n anchor: Anchor,\n floatingEl: HTMLElement,\n options: PositioningOptions = {}\n) {\n options = mergeWithDefaults(options);\n\n function run(fui: FloatingUi): void {\n const { computePosition, flip, offset, shift, size } = fui;\n\n const referenceElement = toReferenceElement(anchor);\n\n const flipMiddleware = options.flip\n ? flip(\n options.shift ? { crossAxis: 'alignment', fallbackAxisSideDirection: 'end' } : undefined\n )\n : undefined;\n const shiftMiddleware = options.shift ? shift() : undefined;\n\n if (options.sizeConstraints) {\n if (options.sizeConstraints.width || options.sizeConstraints.maxWidth) {\n const refWidth = referenceElement.getBoundingClientRect().width;\n if (options.sizeConstraints.width) {\n if (typeof options.sizeConstraints.width === 'string') {\n floatingEl.style.width = options.sizeConstraints.width;\n } else {\n const widthConstraints = options.sizeConstraints.width * refWidth;\n floatingEl.style.width = `min(100%, ${widthConstraints}px)`;\n }\n }\n if (options.sizeConstraints.maxWidth) {\n if (typeof options.sizeConstraints.maxWidth === 'string') {\n floatingEl.style.maxWidth = options.sizeConstraints.maxWidth;\n } else {\n const maxWidthConstraints = options.sizeConstraints.maxWidth * refWidth;\n floatingEl.style.maxWidth = `min(100%, ${maxWidthConstraints}px)`;\n }\n }\n }\n if (options.sizeConstraints.height || options.sizeConstraints.maxHeight) {\n if (options.sizeConstraints.height) {\n floatingEl.style.height = options.sizeConstraints.height;\n }\n if (options.sizeConstraints.maxHeight) {\n floatingEl.style.maxHeight = options.sizeConstraints.maxHeight;\n }\n }\n if (options.sizeConstraints.minWidth) {\n floatingEl.style.minWidth = options.sizeConstraints.minWidth;\n }\n }\n\n void computePosition(referenceElement, floatingEl, {\n placement: options.placement,\n strategy: options.strategy,\n middleware: [\n options.offset ? offset(options.offset) : undefined,\n options.resize\n ? size({\n apply({ availableHeight }) {\n const maxHeightConstraint = options.sizeConstraints?.maxHeight;\n const maxHeightInPx = maxHeightConstraint?.replace(/px$/, '');\n const maxHeight = maxHeightInPx\n ? Math.min(availableHeight, parseInt(maxHeightInPx))\n : availableHeight;\n if (options.hasShrinkableContent) {\n Object.assign(floatingEl.style, {\n height: `${maxHeight - 1}px`,\n });\n }\n },\n })\n : undefined,\n ...(options.placement?.includes('-')\n ? [flipMiddleware, shiftMiddleware]\n : [shiftMiddleware, flipMiddleware]),\n ...(options.middleware || []),\n ].filter(Boolean),\n }).then(pos => {\n if (!options.disableSettingStyles) {\n const flipped = pos.middlewareData.flip?.index;\n const flippedToLREnd =\n flipped &&\n (pos.placement.startsWith('left-') || pos.placement.startsWith('right-')) &&\n pos.placement.endsWith('-end');\n const flippedToTop = flipped && pos.placement.startsWith('top');\n\n Object.assign(floatingEl.style, {\n left: `${roundByDpr(floatingEl, pos.x)}px`,\n top: `${roundByDpr(floatingEl, pos.y)}px`,\n justifyContent: flippedToLREnd || flippedToTop ? 'flex-end' : 'flex-start',\n });\n }\n options.onPositionChange?.(pos);\n });\n }\n\n if (floating) {\n run(floating);\n } else {\n void loadFloating().then(run);\n }\n}\n\nfunction toReferenceElement(anchor: Anchor): ReferenceElement {\n const referenceElement: ReferenceElement =\n anchor instanceof HTMLElement\n ? anchor\n : {\n getBoundingClientRect: () => ({\n x: anchor.x,\n y: anchor.y,\n width: 1,\n height: 1,\n top: anchor.y,\n right: anchor.x + 1,\n bottom: anchor.y + 1,\n left: anchor.x,\n }),\n };\n return referenceElement;\n}\n\nexport function autoPositionElement(\n anchor: Anchor,\n floatingEl: HTMLElement,\n options: PositioningOptions = {}\n): AutoPositioningHandle {\n options = mergeWithDefaults(options);\n\n // Prefetch the floating-ui chunk as soon as a tooltip/popover directive instantiates\n // so the first open does not flash. This is a download trigger only — it does not start.\n void loadFloating();\n\n let cleanup: (() => void) | undefined;\n let started = false; // intent: should be running\n const destroyRef = options.injector?.get(DestroyRef) ?? inject(DestroyRef);\n\n function startAutoUpdate(fui: FloatingUi) {\n // Defensive: a previous start may have already assigned a live cleanup\n // (e.g. two rapid start() calls sharing the cached load promise).\n cleanup?.();\n cleanup = fui.autoUpdate(toReferenceElement(anchor), floatingEl, () => {\n positionElement(anchor, floatingEl, options);\n });\n }\n\n destroyRef.onDestroy(() => {\n started = false;\n cleanup?.();\n cleanup = undefined;\n });\n return {\n start: () => {\n started = true;\n if (floating) {\n // Atomic teardown+reinstall, matching the original synchronous behavior.\n startAutoUpdate(floating);\n } else {\n cleanup?.();\n cleanup = undefined;\n void loadFloating().then(fui => {\n if (!started) {\n return; // a stop()/destroy landed during load — bail, no leak\n }\n startAutoUpdate(fui);\n });\n }\n },\n stop: () => {\n started = false;\n cleanup?.();\n cleanup = undefined;\n },\n isRunning: () => started,\n };\n}\n\nexport function splitPlacement(placement: Placement): [Side, Alignment | undefined] {\n return placement.split('-') as [Side, Alignment | undefined];\n}\n","import { I18n } from '@ngneers/controls/i18n';\nimport { NgnGlobal } from '@ngneers/controls/utils-ng';\n\nimport { type NgnConfigInit, provideNgnConfig } from './config';\nimport { Platform } from './platform';\nimport { ThemeService } from './theme-service';\n\nimport type { EnvironmentProviders, Provider } from '@angular/core';\n\nexport type NgnFeature = {\n providers: (Provider | EnvironmentProviders)[];\n};\n\nexport function provideNgnControls(\n config?: NgnConfigInit,\n ...features: NgnFeature[]\n): (Provider | EnvironmentProviders)[] {\n return [\n NgnGlobal,\n ThemeService,\n I18n,\n Platform,\n provideNgnConfig(config),\n ...features.map(f => f.providers).flat(),\n ];\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n DOCUMENT,\n inject,\n PLATFORM_ID,\n REQUEST,\n signal,\n untracked,\n type WritableSignal,\n} from '@angular/core';\nimport { Logger } from '@ngneers/controls/utils';\n\nexport type NgnStorageKind<T> =\n | 'localstorage'\n | 'sessionstorage'\n | 'cookie'\n | {\n initialize: () => T;\n update: (value: T) => void;\n };\n\n/** One year, in seconds — used as the cookie `max-age`. */\nconst COOKIE_MAX_AGE = 60 * 60 * 24 * 365;\n\nexport class NgnStorage<T extends Record<string, unknown>> {\n private readonly _store: WritableSignal<T>;\n private readonly _set: (value: T) => void;\n\n public set<K extends keyof T>(key: K, value: T[K]) {\n untracked(() => {\n const newVal = {\n ...this._store(),\n [key]: value,\n };\n this._store.set(newVal);\n this._set(newVal);\n });\n }\n\n public get<K extends keyof T>(key: K): T[K] | undefined {\n return this._store()[key];\n }\n\n /**\n * NOTE: must be constructed within an injection context — the built-in kinds\n * read the platform (`PLATFORM_ID`) to stay SSR-safe, and the `cookie` kind\n * additionally reads `DOCUMENT` / the SSR `REQUEST`.\n */\n constructor(key: string, kind: NgnStorageKind<T>, initialValue: T) {\n this._store = signal<T>(initialValue);\n\n // Custom adapter — the caller fully controls persistence.\n if (typeof kind === 'object') {\n this._store.set(kind.initialize() ?? initialValue);\n this._set = kind.update;\n return;\n }\n\n const isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n // Cookies are the only kind readable during SSR (from the request headers).\n if (kind === 'cookie') {\n const doc = inject(DOCUMENT);\n const cookieString = isBrowser\n ? doc.cookie\n : (inject(REQUEST, { optional: true })?.headers.get('cookie') ?? '');\n this._store.set(this._parse(key, readCookie(cookieString, key), initialValue));\n // Writes only happen in the browser; the server render is read-only.\n this._set = isBrowser\n ? value => {\n const encoded = encodeURIComponent(JSON.stringify(value ?? {}));\n const secure = doc.location?.protocol === 'https:' ? ';secure' : '';\n doc.cookie = `${encodeURIComponent(key)}=${encoded};path=/;max-age=${COOKIE_MAX_AGE};samesite=lax${secure}`;\n }\n : () => {\n /* no-op on the server */\n };\n return;\n }\n\n // localstorage / sessionstorage are browser-only; no-op (keep the initial\n // value) during SSR so the render doesn't crash.\n if (!isBrowser) {\n this._set = () => {\n /* no-op on the server */\n };\n return;\n }\n const storage = kind === 'localstorage' ? localStorage : sessionStorage;\n this._store.set(this._parse(key, storage.getItem(key), initialValue));\n this._set = (value: T) => storage.setItem(key, JSON.stringify(value ?? {}));\n }\n\n /** Parse persisted JSON, falling back to the caller's initial value. */\n private _parse(key: string, raw: string | null, fallback: T): T {\n if (!raw) {\n return fallback;\n }\n try {\n return JSON.parse(raw) as T;\n } catch (error) {\n Logger.warn(`Could not parse stored value for key ${key}`, error);\n return fallback;\n }\n }\n}\n\n/** Read a single cookie value from a `Cookie` header / `document.cookie` string. */\nfunction readCookie(cookieString: string, key: string): string | null {\n const name = encodeURIComponent(key);\n for (const part of cookieString.split(';')) {\n const separator = part.indexOf('=');\n if (separator === -1) {\n continue;\n }\n if (part.slice(0, separator).trim() === name) {\n return decodeURIComponent(part.slice(separator + 1));\n }\n }\n return null;\n}\n","import { Directive, input } from '@angular/core';\n\n@Directive({\n selector: 'ng-template[ngnTemplate]',\n})\nexport class NgnTemplate<T> {\n public readonly ngnTemplate = input.required<T>();\n\n public static ngTemplateContextGuard<T>(dir: NgnTemplate<T>, ctx: unknown): ctx is T {\n return true;\n }\n}\n\n/**\n * A noop with return type T.\n * This function is used to define typed properties to use in a template.\n */\nexport function templateTypesFn<T extends Record<string, Record<string, any>>>() {\n return {} as T & { $implicit: { [K in keyof T]: Partial<T[K]> } };\n}\n\n/**\n * A noop with return type `{ $implicit: Implicit } & Named`.\n * This function is used to define a typed property to use in a template.\n */\nexport function templateTypeFn<Implicit, Named extends Record<string, any> = object>() {\n return {} as ([Implicit] extends [undefined] ? unknown : { $implicit: Implicit }) & Named;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;MAQa,UAAU,GAAG,IAAI,cAAc,CAAY,YAAY;AA2B7D,MAAM,gBAAgB,GAAc;AACzC,IAAA,QAAQ,EAAE,MAAM;AAChB,IAAA,iBAAiB,EAAE,KAAK;AACxB,IAAA,KAAK,EAAE;AACL,QAAA,MAAM,EAAE,IAAI;AACZ,QAAA,UAAU,EAAE,KAAK;AACjB,QAAA,UAAU,EAAE,IAAI;AAChB,QAAA,QAAQ,EAAE,cAAc;AACxB,QAAA,UAAU,EAAE,MAAM;AACnB,KAAA;AACD,IAAA,QAAQ,EAAE;AACR,QAAA,YAAY,EAAE,SAAS;AACvB,QAAA,QAAQ,EAAE;AACR,YAAA,YAAY,EAAE,SAAS;AACxB,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,SAAS,EAAE,QAAQ;AACnB,YAAA,MAAM,EAAE,CAAC;AACT,YAAA,SAAS,EAAE,MAAM;AACjB,YAAA,SAAS,EAAE,MAAM;AACjB,YAAA,SAAS,EAAE,IAAI;AACf,YAAA,WAAW,EAAE,IAAI;AACjB,YAAA,WAAW,EAAE,IAAI;AACjB,YAAA,kBAAkB,EAAE,KAAK;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AA,CAAA;;2FAAX,WAAW,EAAA,UAAA,EAAA,CAAA;kBAHvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,0BAA0B;AACrC,iBAAA;;AASD;;;AAGG;SACa,eAAe,GAAA;AAC7B,IAAA,OAAO,EAA0D;AACnE;AAEA;;;AAGG;SACa,cAAc,GAAA;AAC5B,IAAA,OAAO,EAAkF;AAC3F;;AC3BA;;AAEG;;;;"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, computed, Component, inject, ViewContainerRef, ElementRef, DestroyRef, booleanAttribute, afterNextRender, effect, Directive } from '@angular/core';
|
|
3
|
+
import { Platform, setComponentInput } from '@ngneers/controls/api/ng';
|
|
4
|
+
import { NgnBase, provideSelf } from '@ngneers/controls/base';
|
|
5
|
+
import { badgeControlTemplate } from '@ngneers/controls-themes/templates/badge';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
* The overlay element rendered by the {@link NgnBadge} directive. Not intended
|
|
10
|
+
* to be used directly in templates.
|
|
11
|
+
* @category control
|
|
12
|
+
*/
|
|
13
|
+
class NgnBadgeIndicator extends NgnBase {
|
|
14
|
+
theme = this.injectThemeTemplate(badgeControlTemplate, {
|
|
15
|
+
root: true,
|
|
16
|
+
dot: () => this.dot(),
|
|
17
|
+
circular: () => this.circular(),
|
|
18
|
+
'top-end': () => this.position() === 'top-end',
|
|
19
|
+
'top-start': () => this.position() === 'top-start',
|
|
20
|
+
'bottom-end': () => this.position() === 'bottom-end',
|
|
21
|
+
'bottom-start': () => this.position() === 'bottom-start',
|
|
22
|
+
});
|
|
23
|
+
/** The rendered badge text (already max-clamped by the directive). */
|
|
24
|
+
text = input('', /* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
26
|
+
/** Whether to render as a dot (no text). @default false */
|
|
27
|
+
dot = input(false, /* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [{ debugName: "dot" }] : /* istanbul ignore next */ []));
|
|
29
|
+
/** Which corner the badge sits in. @default top-end */
|
|
30
|
+
position = input('top-end', /* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
32
|
+
/** Position on a circular anchor's edge (~45°) instead of the box corner. @default false */
|
|
33
|
+
circular = input(false, /* @ts-ignore */
|
|
34
|
+
...(ngDevMode ? [{ debugName: "circular" }] : /* istanbul ignore next */ []));
|
|
35
|
+
/** CSS color value or `var(...)` reference for the badge fill. */
|
|
36
|
+
bgColor = input(/* @ts-ignore */
|
|
37
|
+
...(ngDevMode ? [undefined, { debugName: "bgColor" }] : /* istanbul ignore next */ []));
|
|
38
|
+
display = computed(() => (this.dot() ? '' : this.text()), /* @ts-ignore */
|
|
39
|
+
...(ngDevMode ? [{ debugName: "display" }] : /* istanbul ignore next */ []));
|
|
40
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NgnBadgeIndicator, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
41
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: NgnBadgeIndicator, isStandalone: true, selector: "ngn-badge-indicator", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, dot: { classPropertyName: "dot", publicName: "dot", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, circular: { classPropertyName: "circular", publicName: "circular", isSignal: true, isRequired: false, transformFunction: null }, bgColor: { classPropertyName: "bgColor", publicName: "bgColor", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" }, properties: { "style.--ngn-badge-color": "bgColor() || null" } }, providers: [provideSelf(NgnBadgeIndicator)], usesInheritance: true, ngImport: i0, template: "{{ display() }}\n" });
|
|
42
|
+
}
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NgnBadgeIndicator, decorators: [{
|
|
44
|
+
type: Component,
|
|
45
|
+
args: [{ selector: 'ngn-badge-indicator', providers: [provideSelf(NgnBadgeIndicator)], host: {
|
|
46
|
+
'aria-hidden': 'true',
|
|
47
|
+
'[style.--ngn-badge-color]': 'bgColor() || null',
|
|
48
|
+
}, template: "{{ display() }}\n" }]
|
|
49
|
+
}], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], dot: [{ type: i0.Input, args: [{ isSignal: true, alias: "dot", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], circular: [{ type: i0.Input, args: [{ isSignal: true, alias: "circular", required: false }] }], bgColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "bgColor", required: false }] }] } });
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Overlays a small badge (count, text, or dot) onto its host element — an icon,
|
|
53
|
+
* button, or avatar. The badge is injected as an absolutely-positioned overlay,
|
|
54
|
+
* so the host is made `position: relative` when it is currently static.
|
|
55
|
+
*/
|
|
56
|
+
class NgnBadge {
|
|
57
|
+
_vcr = inject(ViewContainerRef);
|
|
58
|
+
_host = inject(ElementRef).nativeElement;
|
|
59
|
+
_destroyRef = inject(DestroyRef);
|
|
60
|
+
_ref;
|
|
61
|
+
/** Badge content. A number is clamped by {@link max}; empty hides the badge unless {@link dot}. */
|
|
62
|
+
value = input(undefined, { ...(ngDevMode ? { debugName: "value" } : /* istanbul ignore next */ {}), alias: 'ngnBadge' });
|
|
63
|
+
/** Clamp a numeric {@link value} to `"{max}+"` when it exceeds this. */
|
|
64
|
+
max = input(undefined, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}), alias: 'ngnBadgeMax' });
|
|
65
|
+
/** Render a dot with no text, ignoring {@link value}. @default false */
|
|
66
|
+
dot = input(false, { ...(ngDevMode ? { debugName: "dot" } : /* istanbul ignore next */ {}), transform: booleanAttribute, alias: 'ngnBadgeDot' });
|
|
67
|
+
/** Show the badge even when {@link value} is `0`. @default false */
|
|
68
|
+
showZero = input(false, { ...(ngDevMode ? { debugName: "showZero" } : /* istanbul ignore next */ {}), transform: booleanAttribute,
|
|
69
|
+
alias: 'ngnBadgeShowZero' });
|
|
70
|
+
/** Which corner the badge sits in. @default top-end */
|
|
71
|
+
position = input('top-end', { ...(ngDevMode ? { debugName: "position" } : /* istanbul ignore next */ {}), alias: 'ngnBadgePosition' });
|
|
72
|
+
/** CSS color value (hex/rgb) or `var(...)` reference for the badge fill. */
|
|
73
|
+
color = input(undefined, { ...(ngDevMode ? { debugName: "color" } : /* istanbul ignore next */ {}), alias: 'ngnBadgeColor' });
|
|
74
|
+
/** Hide the badge without removing the host. @default false */
|
|
75
|
+
hidden = input(false, { ...(ngDevMode ? { debugName: "hidden" } : /* istanbul ignore next */ {}), transform: booleanAttribute, alias: 'ngnBadgeHidden' });
|
|
76
|
+
/** Anchor on a circular host's edge (~45°) instead of the box corner (e.g. avatars). @default false */
|
|
77
|
+
circular = input(false, { ...(ngDevMode ? { debugName: "circular" } : /* istanbul ignore next */ {}), transform: booleanAttribute,
|
|
78
|
+
alias: 'ngnBadgeCircular' });
|
|
79
|
+
_platform = inject(Platform);
|
|
80
|
+
constructor() {
|
|
81
|
+
// Ensure the host can anchor the absolutely-positioned indicator. This must run in
|
|
82
|
+
// `afterNextRender` (browser-only, never during SSR): in the constructor the host is
|
|
83
|
+
// not yet connected, so `getComputedStyle(host).position` returns '' (not 'static')
|
|
84
|
+
// and the guard would silently skip — leaving the badge to position against the
|
|
85
|
+
// viewport instead of the host.
|
|
86
|
+
afterNextRender(() => {
|
|
87
|
+
if (getComputedStyle(this._host).position === 'static') {
|
|
88
|
+
this._host.style.position = 'relative';
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
effect(() => {
|
|
92
|
+
// Create the indicator browser-only. It is injected via `ViewContainerRef` and then
|
|
93
|
+
// moved into the host DOM; doing that during SSR serializes a dehydrated view whose
|
|
94
|
+
// anchor no longer matches the moved node, crashing hydration ("Expecting instance of
|
|
95
|
+
// DOM Element"). The badge is decorative (aria-hidden), so it appears on hydration.
|
|
96
|
+
if (!this._platform.isBrowser) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const text = this.resolveText();
|
|
100
|
+
const visible = !this.hidden() && (this.dot() || text !== null);
|
|
101
|
+
if (!visible) {
|
|
102
|
+
this.teardown();
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (!this._ref) {
|
|
106
|
+
this._ref = this._vcr.createComponent(NgnBadgeIndicator);
|
|
107
|
+
this._host.appendChild(this._ref.location.nativeElement);
|
|
108
|
+
}
|
|
109
|
+
setComponentInput(this._ref, 'text', text ?? '');
|
|
110
|
+
setComponentInput(this._ref, 'dot', this.dot());
|
|
111
|
+
setComponentInput(this._ref, 'position', this.position());
|
|
112
|
+
setComponentInput(this._ref, 'circular', this.circular());
|
|
113
|
+
setComponentInput(this._ref, 'bgColor', this.color());
|
|
114
|
+
});
|
|
115
|
+
this._destroyRef.onDestroy(() => this.teardown());
|
|
116
|
+
}
|
|
117
|
+
/** Returns the string to render, or `null` when the badge should not show. */
|
|
118
|
+
resolveText() {
|
|
119
|
+
if (this.dot()) {
|
|
120
|
+
return '';
|
|
121
|
+
}
|
|
122
|
+
const value = this.value();
|
|
123
|
+
if (value === undefined || value === null || value === '') {
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
if (typeof value === 'number') {
|
|
127
|
+
if (value === 0 && !this.showZero()) {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
const max = this.max();
|
|
131
|
+
if (max !== undefined && value > max) {
|
|
132
|
+
return `${max}+`;
|
|
133
|
+
}
|
|
134
|
+
return String(value);
|
|
135
|
+
}
|
|
136
|
+
return value;
|
|
137
|
+
}
|
|
138
|
+
teardown() {
|
|
139
|
+
if (this._ref) {
|
|
140
|
+
this._ref.destroy();
|
|
141
|
+
this._ref = undefined;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NgnBadge, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
145
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: NgnBadge, isStandalone: true, selector: "[ngnBadge], [ngnBadgeDot]", inputs: { value: { classPropertyName: "value", publicName: "ngnBadge", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "ngnBadgeMax", isSignal: true, isRequired: false, transformFunction: null }, dot: { classPropertyName: "dot", publicName: "ngnBadgeDot", isSignal: true, isRequired: false, transformFunction: null }, showZero: { classPropertyName: "showZero", publicName: "ngnBadgeShowZero", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "ngnBadgePosition", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "ngnBadgeColor", isSignal: true, isRequired: false, transformFunction: null }, hidden: { classPropertyName: "hidden", publicName: "ngnBadgeHidden", isSignal: true, isRequired: false, transformFunction: null }, circular: { classPropertyName: "circular", publicName: "ngnBadgeCircular", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
146
|
+
}
|
|
147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NgnBadge, decorators: [{
|
|
148
|
+
type: Directive,
|
|
149
|
+
args: [{
|
|
150
|
+
// Also match `[ngnBadgeDot]` so dot mode works standalone (no value/`ngnBadge` needed).
|
|
151
|
+
selector: '[ngnBadge], [ngnBadgeDot]',
|
|
152
|
+
}]
|
|
153
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngnBadge", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngnBadgeMax", required: false }] }], dot: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngnBadgeDot", required: false }] }], showZero: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngnBadgeShowZero", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngnBadgePosition", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngnBadgeColor", required: false }] }], hidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngnBadgeHidden", required: false }] }], circular: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngnBadgeCircular", required: false }] }] } });
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Generated bundle index. Do not edit.
|
|
157
|
+
*/
|
|
158
|
+
|
|
159
|
+
export { NgnBadge, NgnBadgeIndicator };
|
|
160
|
+
//# sourceMappingURL=ngneers-controls-badge.mjs.map
|