ng-primitives 0.46.0 → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/combobox/combobox-dropdown/combobox-dropdown.d.ts +1 -2
- package/example-theme/index.css +1 -1
- package/fesm2022/ng-primitives-combobox.mjs +4 -6
- package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/ng-primitives-file-upload.mjs +6 -1
- package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
- package/fesm2022/ng-primitives-internal.mjs +53 -41
- package/fesm2022/ng-primitives-internal.mjs.map +1 -1
- package/fesm2022/ng-primitives-menu.mjs +39 -42
- package/fesm2022/ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-popover.mjs +5 -6
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-portal.mjs +17 -10
- package/fesm2022/ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/ng-primitives-switch.mjs +5 -3
- package/fesm2022/ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs +3 -6
- package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
- package/file-upload/file-upload/file-upload-state.d.ts +1 -0
- package/file-upload/file-upload/file-upload.d.ts +4 -0
- package/internal/exit-animation/exit-animation.d.ts +14 -5
- package/internal/index.d.ts +1 -1
- package/menu/menu/menu.d.ts +5 -7
- package/menu/submenu-trigger/submenu-trigger-state.d.ts +1 -23
- package/menu/submenu-trigger/submenu-trigger.d.ts +2 -4
- package/package.json +5 -5
- package/popover/popover/popover.d.ts +1 -2
- package/portal/portal.d.ts +2 -0
- package/schematics/ng-generate/templates/combobox/combobox.__fileSuffix@dasherize__.ts.template +5 -4
- package/schematics/ng-generate/templates/listbox/listbox.__fileSuffix@dasherize__.ts.template +1 -0
- package/schematics/ng-generate/templates/switch/switch.__fileSuffix@dasherize__.ts.template +3 -3
- package/switch/switch/switch-state.d.ts +1 -1
- package/switch/switch/switch.d.ts +1 -1
- package/switch/switch-thumb/switch-thumb.d.ts +1 -1
- package/tooltip/tooltip/tooltip.d.ts +1 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-tooltip.mjs","sources":["../../../../packages/ng-primitives/tooltip/src/config/tooltip-config.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger-state.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger.ts","../../../../packages/ng-primitives/tooltip/src/tooltip/tooltip.ts","../../../../packages/ng-primitives/tooltip/src/ng-primitives-tooltip.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { type Placement } from '@floating-ui/dom';\n\nexport interface NgpTooltipConfig {\n /**\n * Define the offset of the tooltip relative to the trigger.\n * @default 4\n */\n offset: number;\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n placement: Placement;\n\n /**\n * Define the delay before the tooltip is shown.\n * @default 0\n */\n showDelay: number;\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n hideDelay: number;\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * @default true\n */\n flip: boolean;\n\n /**\n * Define the container in to which the tooltip should be attached.\n * @default document.body\n */\n container: HTMLElement | null;\n}\n\nexport const defaultTooltipConfig: NgpTooltipConfig = {\n offset: 4,\n placement: 'top',\n showDelay: 0,\n hideDelay: 0,\n flip: true,\n container: null,\n};\n\nexport const NgpTooltipConfigToken = new InjectionToken<NgpTooltipConfig>('NgpTooltipConfigToken');\n\n/**\n * Provide the default Tooltip configuration\n * @param config The Tooltip configuration\n * @returns The provider\n */\nexport function provideTooltipConfig(config: Partial<NgpTooltipConfig>): Provider[] {\n return [\n {\n provide: NgpTooltipConfigToken,\n useValue: { ...defaultTooltipConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Tooltip configuration\n * @returns The global Tooltip configuration\n */\nexport function injectTooltipConfig(): NgpTooltipConfig {\n return inject(NgpTooltipConfigToken, { optional: true }) ?? defaultTooltipConfig;\n}\n","import { Signal } from '@angular/core';\nimport {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n State,\n} from 'ng-primitives/state';\nimport type { NgpTooltipTrigger } from './tooltip-trigger';\n\n/**\n * The state token for the TooltipTrigger primitive.\n */\nexport const NgpTooltipTriggerStateToken =\n createStateToken<NgpTooltipTrigger<unknown>>('TooltipTrigger');\n\n/**\n * Provides the TooltipTrigger state.\n */\nexport const provideTooltipTriggerState = createStateProvider(NgpTooltipTriggerStateToken);\n\n/**\n * Injects the TooltipTrigger state.\n */\nexport const injectTooltipTriggerState = createStateInjector(NgpTooltipTriggerStateToken) as <\n T,\n>() => Signal<State<NgpTooltipTrigger<T>>>;\n\n/**\n * The TooltipTrigger state registration function.\n */\nexport const tooltipTriggerState = createState(NgpTooltipTriggerStateToken);\n","import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n ElementRef,\n inject,\n Injector,\n input,\n numberAttribute,\n OnDestroy,\n signal,\n ViewContainerRef,\n} from '@angular/core';\nimport { Placement } from '@floating-ui/dom';\nimport { provideExitAnimationManager } from 'ng-primitives/internal';\nimport {\n createOverlay,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n} from 'ng-primitives/portal';\nimport { injectTooltipConfig } from '../config/tooltip-config';\nimport { provideTooltipTriggerState, tooltipTriggerState } from './tooltip-trigger-state';\n\n/**\n * Apply the `ngpTooltipTrigger` directive to an element that triggers the tooltip to show.\n */\n@Directive({\n selector: '[ngpTooltipTrigger]',\n exportAs: 'ngpTooltipTrigger',\n providers: [provideTooltipTriggerState(), provideExitAnimationManager()],\n host: {\n '[attr.data-open]': 'open() ? \"\" : null',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n '(mouseenter)': 'show()',\n '(mouseleave)': 'hide()',\n '(focus)': 'show()',\n '(blur)': 'hide()',\n },\n})\nexport class NgpTooltipTrigger<T = null> implements OnDestroy {\n /**\n * Access the trigger element\n */\n private readonly trigger = inject(ElementRef<HTMLElement>);\n\n /**\n * Access the injector.\n */\n private readonly injector = inject(Injector);\n\n /**\n * Access the view container reference.\n */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /**\n * Access the global tooltip configuration.\n */\n private readonly config = injectTooltipConfig();\n\n /**\n * Access the tooltip template ref.\n */\n readonly tooltip = input<NgpOverlayContent<T>>(undefined, {\n alias: 'ngpTooltipTrigger',\n });\n\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpTooltipTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n readonly placement = input<Placement>(this.config.placement, {\n alias: 'ngpTooltipTriggerPlacement',\n });\n\n /**\n * Define the offset of the tooltip relative to the trigger.\n * @default 0\n */\n readonly offset = input<number, NumberInput>(this.config.offset, {\n alias: 'ngpTooltipTriggerOffset',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the tooltip is displayed.\n * @default 0\n */\n readonly showDelay = input<number, NumberInput>(this.config.showDelay, {\n alias: 'ngpTooltipTriggerShowDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n readonly hideDelay = input<number, NumberInput>(this.config.hideDelay, {\n alias: 'ngpTooltipTriggerHideDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * @default true\n */\n readonly flip = input<boolean, BooleanInput>(this.config.flip, {\n alias: 'ngpTooltipTriggerFlip',\n transform: booleanAttribute,\n });\n\n /**\n * Define the container in which the tooltip should be attached.\n * @default document.body\n */\n readonly container = input<HTMLElement | null>(this.config.container, {\n alias: 'ngpTooltipTriggerContainer',\n });\n\n /**\n * Provide context to the tooltip. This can be used to pass data to the tooltip content.\n */\n readonly context = input<T>(undefined, {\n alias: 'ngpTooltipTriggerContext',\n });\n\n /**\n * The overlay that manages the tooltip\n * @internal\n */\n readonly overlay = signal<NgpOverlay<T> | null>(null);\n\n /**\n * The open state of the tooltip.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * Store the state of the tooltip.\n * @internal\n */\n readonly state = tooltipTriggerState<NgpTooltipTrigger<T>>(this);\n\n ngOnDestroy(): void {\n this.overlay()?.destroy();\n }\n\n /**\n * Show the tooltip.\n */\n show(): void {\n // If the trigger is disabled, do not show the tooltip\n if (this.state.disabled() || this.open()) {\n return;\n }\n\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n this.overlay()?.show();\n }\n\n /**\n * Hide the tooltip.\n */\n hide(): void {\n // If the trigger is disabled, do nothing\n if (this.state.disabled()) {\n return;\n }\n\n this.overlay()?.hide();\n }\n\n /**\n * Create the overlay that will contain the tooltip\n */\n private createOverlay(): void {\n const tooltip = this.state.tooltip();\n\n if (!tooltip) {\n throw new Error('Tooltip must be either a TemplateRef or a ComponentType');\n }\n\n // Create config for the overlay\n const config: NgpOverlayConfig<T> = {\n content: tooltip,\n triggerElement: this.trigger.nativeElement,\n injector: this.injector,\n context: this.state.context(),\n container: this.state.container(),\n placement: this.state.placement(),\n offset: this.state.offset(),\n flip: this.state.flip(),\n showDelay: this.state.showDelay(),\n hideDelay: this.state.hideDelay(),\n closeOnEscape: true,\n closeOnOutsideClick: true,\n viewContainerRef: this.viewContainerRef,\n };\n\n // Create the overlay instance\n this.overlay.set(createOverlay(config));\n }\n}\n","import { Directive } from '@angular/core';\nimport { NgpExitAnimation } from 'ng-primitives/internal';\nimport { injectOverlay } from 'ng-primitives/portal';\n\n/**\n * Apply the `ngpTooltip` directive to an element that represents the tooltip. This typically would be a `div` inside an `ng-template`.\n */\n@Directive({\n selector: '[ngpTooltip]',\n exportAs: 'ngpTooltip',\n hostDirectives: [NgpExitAnimation],\n host: {\n role: 'tooltip',\n '[style.left.px]': 'overlay.position().x',\n '[style.top.px]': 'overlay.position().y',\n '[style.--ngp-tooltip-trigger-width.px]': 'overlay.triggerWidth()',\n '[style.--ngp-tooltip-transform-origin]': 'overlay.transformOrigin()',\n },\n})\nexport class NgpTooltip {\n /**\n * Access the overlay.\n */\n protected readonly overlay = injectOverlay();\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAyCO,MAAM,oBAAoB,GAAqB;AACpD,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,SAAS,EAAE,IAAI;CAChB;AAEM,MAAM,qBAAqB,GAAG,IAAI,cAAc,CAAmB,uBAAuB,CAAC;AAElG;;;;AAIG;AACG,SAAU,oBAAoB,CAAC,MAAiC,EAAA;IACpE,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,qBAAqB;AAC9B,YAAA,QAAQ,EAAE,EAAE,GAAG,oBAAoB,EAAE,GAAG,MAAM,EAAE;AACjD,SAAA;KACF;AACH;AAEA;;;AAGG;SACa,mBAAmB,GAAA;AACjC,IAAA,OAAO,MAAM,CAAC,qBAAqB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,oBAAoB;AAClF;;AC9DA;;AAEG;AACI,MAAM,2BAA2B,GACtC,gBAAgB,CAA6B,gBAAgB,CAAC;AAEhE;;AAEG;MACU,0BAA0B,GAAG,mBAAmB,CAAC,2BAA2B;AAEzF;;AAEG;MACU,yBAAyB,GAAG,mBAAmB,CAAC,2BAA2B;AAIxF;;AAEG;AACI,MAAM,mBAAmB,GAAG,WAAW,CAAC,2BAA2B,CAAC;;ACN3E;;AAEG;MAcU,iBAAiB,CAAA;AAb9B,IAAA,WAAA,GAAA;AAcE;;AAEG;AACc,QAA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AA,EAAA,CAAA;kBAZtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,YAAY;oBACtB,cAAc,EAAE,CAAC,gBAAgB,CAAC;AAClC,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,SAAS;AACf,wBAAA,iBAAiB,EAAE,sBAAsB;AACzC,wBAAA,gBAAgB,EAAE,sBAAsB;AACxC,wBAAA,wCAAwC,EAAE,wBAAwB;AAClE,wBAAA,wCAAwC,EAAE,2BAA2B;AACtE,qBAAA;AACF,iBAAA;;;AClBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-tooltip.mjs","sources":["../../../../packages/ng-primitives/tooltip/src/config/tooltip-config.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger-state.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger.ts","../../../../packages/ng-primitives/tooltip/src/tooltip/tooltip.ts","../../../../packages/ng-primitives/tooltip/src/ng-primitives-tooltip.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { type Placement } from '@floating-ui/dom';\n\nexport interface NgpTooltipConfig {\n /**\n * Define the offset of the tooltip relative to the trigger.\n * @default 4\n */\n offset: number;\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n placement: Placement;\n\n /**\n * Define the delay before the tooltip is shown.\n * @default 0\n */\n showDelay: number;\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n hideDelay: number;\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * @default true\n */\n flip: boolean;\n\n /**\n * Define the container in to which the tooltip should be attached.\n * @default document.body\n */\n container: HTMLElement | null;\n}\n\nexport const defaultTooltipConfig: NgpTooltipConfig = {\n offset: 4,\n placement: 'top',\n showDelay: 0,\n hideDelay: 0,\n flip: true,\n container: null,\n};\n\nexport const NgpTooltipConfigToken = new InjectionToken<NgpTooltipConfig>('NgpTooltipConfigToken');\n\n/**\n * Provide the default Tooltip configuration\n * @param config The Tooltip configuration\n * @returns The provider\n */\nexport function provideTooltipConfig(config: Partial<NgpTooltipConfig>): Provider[] {\n return [\n {\n provide: NgpTooltipConfigToken,\n useValue: { ...defaultTooltipConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Tooltip configuration\n * @returns The global Tooltip configuration\n */\nexport function injectTooltipConfig(): NgpTooltipConfig {\n return inject(NgpTooltipConfigToken, { optional: true }) ?? defaultTooltipConfig;\n}\n","import { Signal } from '@angular/core';\nimport {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n State,\n} from 'ng-primitives/state';\nimport type { NgpTooltipTrigger } from './tooltip-trigger';\n\n/**\n * The state token for the TooltipTrigger primitive.\n */\nexport const NgpTooltipTriggerStateToken =\n createStateToken<NgpTooltipTrigger<unknown>>('TooltipTrigger');\n\n/**\n * Provides the TooltipTrigger state.\n */\nexport const provideTooltipTriggerState = createStateProvider(NgpTooltipTriggerStateToken);\n\n/**\n * Injects the TooltipTrigger state.\n */\nexport const injectTooltipTriggerState = createStateInjector(NgpTooltipTriggerStateToken) as <\n T,\n>() => Signal<State<NgpTooltipTrigger<T>>>;\n\n/**\n * The TooltipTrigger state registration function.\n */\nexport const tooltipTriggerState = createState(NgpTooltipTriggerStateToken);\n","import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n ElementRef,\n inject,\n Injector,\n input,\n numberAttribute,\n OnDestroy,\n signal,\n ViewContainerRef,\n} from '@angular/core';\nimport { Placement } from '@floating-ui/dom';\nimport {\n createOverlay,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n} from 'ng-primitives/portal';\nimport { injectTooltipConfig } from '../config/tooltip-config';\nimport { provideTooltipTriggerState, tooltipTriggerState } from './tooltip-trigger-state';\n\n/**\n * Apply the `ngpTooltipTrigger` directive to an element that triggers the tooltip to show.\n */\n@Directive({\n selector: '[ngpTooltipTrigger]',\n exportAs: 'ngpTooltipTrigger',\n providers: [provideTooltipTriggerState()],\n host: {\n '[attr.data-open]': 'open() ? \"\" : null',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n '(mouseenter)': 'show()',\n '(mouseleave)': 'hide()',\n '(focus)': 'show()',\n '(blur)': 'hide()',\n },\n})\nexport class NgpTooltipTrigger<T = null> implements OnDestroy {\n /**\n * Access the trigger element\n */\n private readonly trigger = inject(ElementRef<HTMLElement>);\n\n /**\n * Access the injector.\n */\n private readonly injector = inject(Injector);\n\n /**\n * Access the view container reference.\n */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /**\n * Access the global tooltip configuration.\n */\n private readonly config = injectTooltipConfig();\n\n /**\n * Access the tooltip template ref.\n */\n readonly tooltip = input<NgpOverlayContent<T>>(undefined, {\n alias: 'ngpTooltipTrigger',\n });\n\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpTooltipTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n readonly placement = input<Placement>(this.config.placement, {\n alias: 'ngpTooltipTriggerPlacement',\n });\n\n /**\n * Define the offset of the tooltip relative to the trigger.\n * @default 0\n */\n readonly offset = input<number, NumberInput>(this.config.offset, {\n alias: 'ngpTooltipTriggerOffset',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the tooltip is displayed.\n * @default 0\n */\n readonly showDelay = input<number, NumberInput>(this.config.showDelay, {\n alias: 'ngpTooltipTriggerShowDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n readonly hideDelay = input<number, NumberInput>(this.config.hideDelay, {\n alias: 'ngpTooltipTriggerHideDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * @default true\n */\n readonly flip = input<boolean, BooleanInput>(this.config.flip, {\n alias: 'ngpTooltipTriggerFlip',\n transform: booleanAttribute,\n });\n\n /**\n * Define the container in which the tooltip should be attached.\n * @default document.body\n */\n readonly container = input<HTMLElement | null>(this.config.container, {\n alias: 'ngpTooltipTriggerContainer',\n });\n\n /**\n * Provide context to the tooltip. This can be used to pass data to the tooltip content.\n */\n readonly context = input<T>(undefined, {\n alias: 'ngpTooltipTriggerContext',\n });\n\n /**\n * The overlay that manages the tooltip\n * @internal\n */\n readonly overlay = signal<NgpOverlay<T> | null>(null);\n\n /**\n * The open state of the tooltip.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * Store the state of the tooltip.\n * @internal\n */\n readonly state = tooltipTriggerState<NgpTooltipTrigger<T>>(this);\n\n ngOnDestroy(): void {\n this.overlay()?.destroy();\n }\n\n /**\n * Show the tooltip.\n */\n show(): void {\n // If the trigger is disabled, do not show the tooltip\n if (this.state.disabled() || this.open()) {\n return;\n }\n\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n this.overlay()?.show();\n }\n\n /**\n * Hide the tooltip.\n */\n hide(): void {\n // If the trigger is disabled, do nothing\n if (this.state.disabled()) {\n return;\n }\n\n this.overlay()?.hide();\n }\n\n /**\n * Create the overlay that will contain the tooltip\n */\n private createOverlay(): void {\n const tooltip = this.state.tooltip();\n\n if (!tooltip) {\n throw new Error('Tooltip must be either a TemplateRef or a ComponentType');\n }\n\n // Create config for the overlay\n const config: NgpOverlayConfig<T> = {\n content: tooltip,\n triggerElement: this.trigger.nativeElement,\n injector: this.injector,\n context: this.state.context(),\n container: this.state.container(),\n placement: this.state.placement(),\n offset: this.state.offset(),\n flip: this.state.flip(),\n showDelay: this.state.showDelay(),\n hideDelay: this.state.hideDelay(),\n closeOnEscape: true,\n closeOnOutsideClick: true,\n viewContainerRef: this.viewContainerRef,\n };\n\n // Create the overlay instance\n this.overlay.set(createOverlay(config));\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectOverlay } from 'ng-primitives/portal';\n\n/**\n * Apply the `ngpTooltip` directive to an element that represents the tooltip. This typically would be a `div` inside an `ng-template`.\n */\n@Directive({\n selector: '[ngpTooltip]',\n exportAs: 'ngpTooltip',\n host: {\n role: 'tooltip',\n '[style.left.px]': 'overlay.position().x',\n '[style.top.px]': 'overlay.position().y',\n '[style.--ngp-tooltip-trigger-width.px]': 'overlay.triggerWidth()',\n '[style.--ngp-tooltip-transform-origin]': 'overlay.transformOrigin()',\n },\n})\nexport class NgpTooltip {\n /**\n * Access the overlay.\n */\n protected readonly overlay = injectOverlay();\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAyCO,MAAM,oBAAoB,GAAqB;AACpD,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,SAAS,EAAE,IAAI;CAChB;AAEM,MAAM,qBAAqB,GAAG,IAAI,cAAc,CAAmB,uBAAuB,CAAC;AAElG;;;;AAIG;AACG,SAAU,oBAAoB,CAAC,MAAiC,EAAA;IACpE,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,qBAAqB;AAC9B,YAAA,QAAQ,EAAE,EAAE,GAAG,oBAAoB,EAAE,GAAG,MAAM,EAAE;AACjD,SAAA;KACF;AACH;AAEA;;;AAGG;SACa,mBAAmB,GAAA;AACjC,IAAA,OAAO,MAAM,CAAC,qBAAqB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,oBAAoB;AAClF;;AC9DA;;AAEG;AACI,MAAM,2BAA2B,GACtC,gBAAgB,CAA6B,gBAAgB,CAAC;AAEhE;;AAEG;MACU,0BAA0B,GAAG,mBAAmB,CAAC,2BAA2B;AAEzF;;AAEG;MACU,yBA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;AAC7C;+GALY,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAV,UAAU,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,SAAA,EAAA,EAAA,UAAA,EAAA,EAAA,eAAA,EAAA,sBAAA,EAAA,cAAA,EAAA,sBAAA,EAAA,sCAAA,EAAA,wBAAA,EAAA,sCAAA,EAAA,2BAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBAXtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,SAAS;AACf,wBAAA,iBAAiB,EAAE,sBAAsB;AACzC,wBAAA,gBAAgB,EAAE,sBAAsB;AACxC,wBAAA,wCAAwC,EAAE,wBAAwB;AAClE,wBAAA,wCAAwC,EAAE,2BAA2B;AACtE,qBAAA;AACF,iBAAA;;;AChBD;;AAEG;;;;"}
|
|
@@ -11,6 +11,7 @@ export declare const provideFileUploadState: (options?: import("ng-primitives/st
|
|
|
11
11
|
* Injects the FileUpload state.
|
|
12
12
|
*/
|
|
13
13
|
export declare const injectFileUploadState: <U = {
|
|
14
|
+
readonly document: Document;
|
|
14
15
|
readonly elementRef: import("@angular/core").ElementRef<HTMLElement>;
|
|
15
16
|
readonly fileTypes: import("@angular/core").InputSignalWithTransform<string[] | undefined, string | string[]>;
|
|
16
17
|
readonly multiple: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
@@ -4,6 +4,10 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
* A directive that allows you to turn any element into a file upload trigger.
|
|
5
5
|
*/
|
|
6
6
|
export declare class NgpFileUpload {
|
|
7
|
+
/**
|
|
8
|
+
* Access the document
|
|
9
|
+
*/
|
|
10
|
+
private readonly document;
|
|
7
11
|
/**
|
|
8
12
|
* Access the host element.
|
|
9
13
|
*/
|
|
@@ -3,15 +3,24 @@ import * as i0 from "@angular/core";
|
|
|
3
3
|
export declare class NgpExitAnimation implements OnDestroy {
|
|
4
4
|
/** The animation manager. */
|
|
5
5
|
private readonly animationManager;
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
|
|
6
|
+
/** Access the element reference. */
|
|
7
|
+
protected readonly elementRef: import("@angular/core").ElementRef<HTMLElement>;
|
|
8
|
+
/** Exist animation reference. */
|
|
9
|
+
protected readonly ref: NgpExitAnimationRef;
|
|
10
10
|
constructor();
|
|
11
11
|
ngOnDestroy(): void;
|
|
12
12
|
/** Mark the element as exiting. */
|
|
13
13
|
exit(): Promise<void>;
|
|
14
|
-
private setAnimationState;
|
|
15
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpExitAnimation, never>;
|
|
16
15
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpExitAnimation, "[ngpExitAnimation]", ["ngpExitAnimation"], {}, {}, never, never, true, never>;
|
|
17
16
|
}
|
|
17
|
+
interface NgpExitAnimationOptions {
|
|
18
|
+
/** The element to animate. */
|
|
19
|
+
element: HTMLElement;
|
|
20
|
+
}
|
|
21
|
+
export interface NgpExitAnimationRef {
|
|
22
|
+
/** Mark the element as exiting and wait for the animation to finish. */
|
|
23
|
+
exit: () => Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
export declare function setupExitAnimation({ element }: NgpExitAnimationOptions): NgpExitAnimationRef;
|
|
26
|
+
export {};
|
package/internal/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { NgpExitAnimation } from './exit-animation/exit-animation';
|
|
1
|
+
export { NgpExitAnimation, NgpExitAnimationRef, setupExitAnimation, } from './exit-animation/exit-animation';
|
|
2
2
|
export { injectExitAnimationManager, NgpExitAnimationManager, provideExitAnimationManager, } from './exit-animation/exit-animation-manager';
|
|
3
3
|
export * from './interactions/index';
|
|
4
4
|
export * from './signals/explicit-effect';
|
package/menu/menu/menu.d.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { FocusOrigin } from '@angular/cdk/a11y';
|
|
2
2
|
import { Subject } from 'rxjs';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
import * as i1 from "ng-primitives/
|
|
5
|
-
import * as i2 from "ng-primitives/
|
|
4
|
+
import * as i1 from "ng-primitives/roving-focus";
|
|
5
|
+
import * as i2 from "ng-primitives/focus-trap";
|
|
6
6
|
/**
|
|
7
7
|
* The `NgpMenu` is a container for menu items.
|
|
8
8
|
*/
|
|
9
9
|
export declare class NgpMenu {
|
|
10
|
-
/**
|
|
11
|
-
* Access the overlay.
|
|
12
|
-
*/
|
|
10
|
+
/** Access the overlay. */
|
|
13
11
|
protected readonly overlay: import("ng-primitives/portal").NgpOverlay<unknown>;
|
|
14
12
|
/** Access the menu trigger state */
|
|
15
13
|
private readonly menuTrigger;
|
|
@@ -17,8 +15,8 @@ export declare class NgpMenu {
|
|
|
17
15
|
private readonly parentMenu;
|
|
18
16
|
/** @internal Whether we should close submenus */
|
|
19
17
|
readonly closeSubmenus: Subject<HTMLElement>;
|
|
20
|
-
/** Close the menu and any parent menus */
|
|
18
|
+
/** @internal Close the menu and any parent menus */
|
|
21
19
|
closeAllMenus(origin: FocusOrigin): void;
|
|
22
20
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpMenu, never>;
|
|
23
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpMenu, "[ngpMenu]", ["ngpMenu"], {}, {}, never, never, true, [{ directive: typeof i1.
|
|
21
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpMenu, "[ngpMenu]", ["ngpMenu"], {}, {}, never, never, true, [{ directive: typeof i1.NgpRovingFocusGroup; inputs: {}; outputs: {}; }, { directive: typeof i2.NgpFocusTrap; inputs: {}; outputs: {}; }]>;
|
|
24
22
|
}
|
|
@@ -14,28 +14,6 @@ export declare const injectSubmenuTriggerState: <U = {
|
|
|
14
14
|
readonly trigger: import("@angular/core").ElementRef<HTMLElement>;
|
|
15
15
|
readonly injector: import("@angular/core").Injector;
|
|
16
16
|
readonly viewContainerRef: import("@angular/core").ViewContainerRef;
|
|
17
|
-
readonly menuTrigger: import("@angular/core").Signal<import("ng-primitives/state").State<{
|
|
18
|
-
readonly trigger: /*elided*/ any;
|
|
19
|
-
readonly injector: /*elided*/ any;
|
|
20
|
-
readonly viewContainerRef: /*elided*/ any;
|
|
21
|
-
readonly config: /*elided*/ any;
|
|
22
|
-
readonly menu: /*elided*/ any;
|
|
23
|
-
readonly disabled: /*elided*/ any;
|
|
24
|
-
readonly placement: /*elided*/ any;
|
|
25
|
-
readonly offset: /*elided*/ any;
|
|
26
|
-
readonly flip: /*elided*/ any;
|
|
27
|
-
readonly container: /*elided*/ any;
|
|
28
|
-
readonly scrollBehavior: /*elided*/ any;
|
|
29
|
-
readonly context: /*elided*/ any;
|
|
30
|
-
readonly overlay: /*elided*/ any;
|
|
31
|
-
readonly open: /*elided*/ any;
|
|
32
|
-
readonly state: /*elided*/ any;
|
|
33
|
-
ngOnDestroy: /*elided*/ any;
|
|
34
|
-
toggle: /*elided*/ any;
|
|
35
|
-
show: /*elided*/ any;
|
|
36
|
-
hide: /*elided*/ any;
|
|
37
|
-
createOverlay: /*elided*/ any;
|
|
38
|
-
}>>;
|
|
39
17
|
readonly parentMenu: import("ng-primitives/menu").NgpMenu | null;
|
|
40
18
|
readonly menu: import("@angular/core").InputSignal<import("ng-primitives/portal").NgpOverlayContent<unknown> | undefined>;
|
|
41
19
|
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
@@ -50,7 +28,7 @@ export declare const injectSubmenuTriggerState: <U = {
|
|
|
50
28
|
hide: (origin?: import("@angular/cdk/focus-monitor.d-CvvJeQRc").F) => void;
|
|
51
29
|
createOverlay: () => void;
|
|
52
30
|
showSubmenuOnArrow: (event: KeyboardEvent) => void;
|
|
53
|
-
showSubmenuOnHover: () => void;
|
|
31
|
+
showSubmenuOnHover: (event: PointerEvent) => void;
|
|
54
32
|
}>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
55
33
|
/**
|
|
56
34
|
* The SubmenuTrigger state registration function.
|
|
@@ -16,8 +16,6 @@ export declare class NgpSubmenuTrigger<T = unknown> {
|
|
|
16
16
|
* Access the view container reference.
|
|
17
17
|
*/
|
|
18
18
|
private readonly viewContainerRef;
|
|
19
|
-
/** Access the menu trigger state */
|
|
20
|
-
private readonly menuTrigger;
|
|
21
19
|
/** Access the parent menu */
|
|
22
20
|
private readonly parentMenu;
|
|
23
21
|
/**
|
|
@@ -83,7 +81,7 @@ export declare class NgpSubmenuTrigger<T = unknown> {
|
|
|
83
81
|
/**
|
|
84
82
|
* If the user hovers over the trigger, we want to open the submenu
|
|
85
83
|
*/
|
|
86
|
-
protected showSubmenuOnHover(): void;
|
|
84
|
+
protected showSubmenuOnHover(event: PointerEvent): void;
|
|
87
85
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpSubmenuTrigger<any>, never>;
|
|
88
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpSubmenuTrigger<any>, "[ngpSubmenuTrigger]", ["ngpSubmenuTrigger"], { "menu": { "alias": "ngpSubmenuTrigger"; "required": false; "isSignal": true; }; "disabled": { "alias": "
|
|
86
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpSubmenuTrigger<any>, "[ngpSubmenuTrigger]", ["ngpSubmenuTrigger"], { "menu": { "alias": "ngpSubmenuTrigger"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpSubmenuTriggerDisabled"; "required": false; "isSignal": true; }; "placement": { "alias": "ngpSubmenuTriggerPlacement"; "required": false; "isSignal": true; }; "offset": { "alias": "ngpSubmenuTriggerOffset"; "required": false; "isSignal": true; }; "flip": { "alias": "ngpSubmenuTriggerFlip"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
89
87
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "ng-primitives",
|
|
3
3
|
"description": "Angular Primitives is a low-level headless UI component library with a focus on accessibility, customization, and developer experience. ",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.47.0",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"angular",
|
|
8
8
|
"primitives",
|
|
@@ -71,14 +71,14 @@
|
|
|
71
71
|
"types": "./accordion/index.d.ts",
|
|
72
72
|
"default": "./fesm2022/ng-primitives-accordion.mjs"
|
|
73
73
|
},
|
|
74
|
-
"./autofill": {
|
|
75
|
-
"types": "./autofill/index.d.ts",
|
|
76
|
-
"default": "./fesm2022/ng-primitives-autofill.mjs"
|
|
77
|
-
},
|
|
78
74
|
"./avatar": {
|
|
79
75
|
"types": "./avatar/index.d.ts",
|
|
80
76
|
"default": "./fesm2022/ng-primitives-avatar.mjs"
|
|
81
77
|
},
|
|
78
|
+
"./autofill": {
|
|
79
|
+
"types": "./autofill/index.d.ts",
|
|
80
|
+
"default": "./fesm2022/ng-primitives-autofill.mjs"
|
|
81
|
+
},
|
|
82
82
|
"./button": {
|
|
83
83
|
"types": "./button/index.d.ts",
|
|
84
84
|
"default": "./fesm2022/ng-primitives-button.mjs"
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import * as i1 from "ng-primitives/focus-trap";
|
|
3
|
-
import * as i2 from "ng-primitives/internal";
|
|
4
3
|
/**
|
|
5
4
|
* Apply the `ngpPopover` directive to an element that represents the popover. This typically would be a `div` inside an `ng-template`.
|
|
6
5
|
*/
|
|
@@ -10,5 +9,5 @@ export declare class NgpPopover {
|
|
|
10
9
|
*/
|
|
11
10
|
protected readonly overlay: import("ng-primitives/portal").NgpOverlay<unknown>;
|
|
12
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpPopover, never>;
|
|
13
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpPopover, "[ngpPopover]", ["ngpPopover"], {}, {}, never, never, true, [{ directive: typeof i1.NgpFocusTrap; inputs: {}; outputs: {}; }
|
|
12
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpPopover, "[ngpPopover]", ["ngpPopover"], {}, {}, never, never, true, [{ directive: typeof i1.NgpFocusTrap; inputs: {}; outputs: {}; }]>;
|
|
14
13
|
}
|
package/portal/portal.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export declare class NgpComponentPortal<T> extends NgpPortal {
|
|
|
29
29
|
private readonly componentPortal;
|
|
30
30
|
private viewRef;
|
|
31
31
|
private isDestroying;
|
|
32
|
+
private exitAnimationRef;
|
|
32
33
|
constructor(component: Type<T>, viewContainerRef: ViewContainerRef, injector: Injector);
|
|
33
34
|
/**
|
|
34
35
|
* Attach the portal to a DOM element.
|
|
@@ -55,6 +56,7 @@ export declare class NgpComponentPortal<T> extends NgpPortal {
|
|
|
55
56
|
export declare class NgpTemplatePortal<T> extends NgpPortal {
|
|
56
57
|
private readonly templatePortal;
|
|
57
58
|
private viewRef;
|
|
59
|
+
private exitAnimationRefs;
|
|
58
60
|
private isDestroying;
|
|
59
61
|
constructor(template: TemplateRef<T>, viewContainerRef: ViewContainerRef, injector: Injector, context?: T);
|
|
60
62
|
/**
|
package/schematics/ng-generate/templates/combobox/combobox.__fileSuffix@dasherize__.ts.template
CHANGED
|
@@ -106,6 +106,7 @@ import { ChangeFn, provideValueAccessor, TouchedFn } from 'ng-primitives/utils';
|
|
|
106
106
|
position: absolute;
|
|
107
107
|
animation: popover-show 0.1s ease-out;
|
|
108
108
|
width: var(--ngp-combobox-width);
|
|
109
|
+
box-shadow: var(--ngp-shadow-lg);
|
|
109
110
|
box-sizing: border-box;
|
|
110
111
|
margin-top: 4px;
|
|
111
112
|
max-height: 240px;
|
|
@@ -161,22 +162,22 @@ import { ChangeFn, provideValueAccessor, TouchedFn } from 'ng-primitives/utils';
|
|
|
161
162
|
@keyframes combobox-show {
|
|
162
163
|
0% {
|
|
163
164
|
opacity: 0;
|
|
164
|
-
transform: scale(0.9);
|
|
165
|
+
transform: translateY(-10px) scale(0.9);
|
|
165
166
|
}
|
|
166
167
|
100% {
|
|
167
168
|
opacity: 1;
|
|
168
|
-
transform: scale(1);
|
|
169
|
+
transform: translateY(0) scale(1);
|
|
169
170
|
}
|
|
170
171
|
}
|
|
171
172
|
|
|
172
173
|
@keyframes combobox-hide {
|
|
173
174
|
0% {
|
|
174
175
|
opacity: 1;
|
|
175
|
-
transform: scale(1);
|
|
176
|
+
transform: translateY(0) scale(1);
|
|
176
177
|
}
|
|
177
178
|
100% {
|
|
178
179
|
opacity: 0;
|
|
179
|
-
transform: scale(0.9);
|
|
180
|
+
transform: translateY(-10px) scale(0.9);
|
|
180
181
|
}
|
|
181
182
|
}
|
|
182
183
|
`,
|
package/schematics/ng-generate/templates/listbox/listbox.__fileSuffix@dasherize__.ts.template
CHANGED
|
@@ -76,6 +76,7 @@ import { ChangeFn, provideValueAccessor, TouchedFn } from 'ng-primitives/utils';
|
|
|
76
76
|
position: absolute;
|
|
77
77
|
animation: popover-show 0.1s ease-out;
|
|
78
78
|
width: var(--ngp-popover-trigger-width);
|
|
79
|
+
box-shadow: var(--ngp-shadow-lg);
|
|
79
80
|
box-sizing: border-box;
|
|
80
81
|
}
|
|
81
82
|
`,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component } from '@angular/core';
|
|
1
|
+
import { Component, OnInit } from '@angular/core';
|
|
2
2
|
import { ControlValueAccessor } from '@angular/forms';
|
|
3
3
|
import { injectSwitchState, NgpSwitch, NgpSwitchThumb } from 'ng-primitives/switch';
|
|
4
4
|
import { ChangeFn, provideValueAccessor, TouchedFn } from 'ng-primitives/utils';
|
|
@@ -68,7 +68,7 @@ import { ChangeFn, provideValueAccessor, TouchedFn } from 'ng-primitives/utils';
|
|
|
68
68
|
'(focusout)': 'onTouched?.()',
|
|
69
69
|
},
|
|
70
70
|
})
|
|
71
|
-
export class Switch<%= componentSuffix %> implements ControlValueAccessor {
|
|
71
|
+
export class Switch<%= componentSuffix %> implements OnInit, ControlValueAccessor {
|
|
72
72
|
/** Access the switch state. */
|
|
73
73
|
private readonly switch = injectSwitchState();
|
|
74
74
|
|
|
@@ -78,7 +78,7 @@ export class Switch<%= componentSuffix %> implements ControlValueAccessor {
|
|
|
78
78
|
/** The on touched callback */
|
|
79
79
|
protected onTouched?: TouchedFn;
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
ngOnInit() {
|
|
82
82
|
// Any time the switch changes, update the form value.
|
|
83
83
|
this.switch().checkedChange.subscribe(value => this.onChange?.(value));
|
|
84
84
|
}
|
|
@@ -18,7 +18,7 @@ export declare const injectSwitchState: <U = {
|
|
|
18
18
|
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
19
19
|
readonly state: import("ng-primitives/state").CreatedState<NgpSwitch>;
|
|
20
20
|
toggle: () => void;
|
|
21
|
-
onKeyDown: () => void;
|
|
21
|
+
onKeyDown: (event: KeyboardEvent) => void;
|
|
22
22
|
}>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
23
23
|
/**
|
|
24
24
|
* The Switch state registration function.
|
|
@@ -40,7 +40,7 @@ export declare class NgpSwitch {
|
|
|
40
40
|
/**
|
|
41
41
|
* Handle the keydown event.
|
|
42
42
|
*/
|
|
43
|
-
protected onKeyDown(): void;
|
|
43
|
+
protected onKeyDown(event: KeyboardEvent): void;
|
|
44
44
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpSwitch, never>;
|
|
45
45
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpSwitch, "[ngpSwitch]", ["ngpSwitch"], { "checked": { "alias": "ngpSwitchChecked"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpSwitchDisabled"; "required": false; "isSignal": true; }; }, { "checkedChange": "ngpSwitchCheckedChange"; }, never, never, true, [{ directive: typeof i1.NgpFormControl; inputs: {}; outputs: {}; }]>;
|
|
46
46
|
}
|
|
@@ -14,7 +14,7 @@ export declare class NgpSwitchThumb {
|
|
|
14
14
|
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
15
15
|
readonly state: import("ng-primitives/state").CreatedState<import("ng-primitives/switch").NgpSwitch>;
|
|
16
16
|
toggle: () => void;
|
|
17
|
-
onKeyDown: () => void;
|
|
17
|
+
onKeyDown: (event: KeyboardEvent) => void;
|
|
18
18
|
}>>;
|
|
19
19
|
constructor();
|
|
20
20
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpSwitchThumb, never>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "ng-primitives/internal";
|
|
3
2
|
/**
|
|
4
3
|
* Apply the `ngpTooltip` directive to an element that represents the tooltip. This typically would be a `div` inside an `ng-template`.
|
|
5
4
|
*/
|
|
@@ -9,5 +8,5 @@ export declare class NgpTooltip {
|
|
|
9
8
|
*/
|
|
10
9
|
protected readonly overlay: import("ng-primitives/portal").NgpOverlay<unknown>;
|
|
11
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpTooltip, never>;
|
|
12
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpTooltip, "[ngpTooltip]", ["ngpTooltip"], {}, {}, never, never, true,
|
|
11
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpTooltip, "[ngpTooltip]", ["ngpTooltip"], {}, {}, never, never, true, never>;
|
|
13
12
|
}
|