ng-primitives 0.41.0 → 0.43.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/checkbox/checkbox/checkbox.d.ts +1 -2
- package/dialog/dialog-trigger/dialog-trigger.d.ts +0 -4
- package/fesm2022/ng-primitives-a11y.mjs +3 -3
- package/fesm2022/ng-primitives-a11y.mjs.map +1 -1
- package/fesm2022/ng-primitives-accordion.mjs +12 -12
- package/fesm2022/ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/ng-primitives-autofill.mjs +3 -3
- package/fesm2022/ng-primitives-autofill.mjs.map +1 -1
- package/fesm2022/ng-primitives-avatar.mjs +9 -9
- package/fesm2022/ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/ng-primitives-button.mjs +3 -3
- package/fesm2022/ng-primitives-button.mjs.map +1 -1
- package/fesm2022/ng-primitives-checkbox.mjs +5 -7
- package/fesm2022/ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/ng-primitives-common.mjs +3 -3
- package/fesm2022/ng-primitives-common.mjs.map +1 -1
- package/fesm2022/ng-primitives-date-picker.mjs +27 -27
- package/fesm2022/ng-primitives-date-picker.mjs.map +1 -1
- package/fesm2022/ng-primitives-dialog.mjs +19 -23
- package/fesm2022/ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/ng-primitives-file-upload.mjs +6 -6
- package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
- package/fesm2022/ng-primitives-focus-trap.mjs +3 -3
- package/fesm2022/ng-primitives-focus-trap.mjs.map +1 -1
- package/fesm2022/ng-primitives-form-field.mjs +77 -54
- package/fesm2022/ng-primitives-form-field.mjs.map +1 -1
- package/fesm2022/ng-primitives-input.mjs +7 -8
- package/fesm2022/ng-primitives-input.mjs.map +1 -1
- package/fesm2022/ng-primitives-interactions.mjs +15 -15
- package/fesm2022/ng-primitives-interactions.mjs.map +1 -1
- package/fesm2022/ng-primitives-internal.mjs +12 -12
- package/fesm2022/ng-primitives-internal.mjs.map +1 -1
- package/fesm2022/ng-primitives-listbox.mjs +12 -12
- package/fesm2022/ng-primitives-listbox.mjs.map +1 -1
- package/fesm2022/ng-primitives-menu.mjs +12 -12
- package/fesm2022/ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-meter.mjs +15 -15
- package/fesm2022/ng-primitives-meter.mjs.map +1 -1
- package/fesm2022/ng-primitives-pagination.mjs +18 -18
- package/fesm2022/ng-primitives-pagination.mjs.map +1 -1
- package/fesm2022/ng-primitives-popover.mjs +6 -6
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-progress.mjs +15 -15
- package/fesm2022/ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/ng-primitives-radio.mjs +12 -14
- package/fesm2022/ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/ng-primitives-resize.mjs +10 -3
- package/fesm2022/ng-primitives-resize.mjs.map +1 -1
- package/fesm2022/ng-primitives-roving-focus.mjs +6 -6
- package/fesm2022/ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/ng-primitives-search.mjs +6 -6
- package/fesm2022/ng-primitives-search.mjs.map +1 -1
- package/fesm2022/ng-primitives-select.mjs +5 -7
- package/fesm2022/ng-primitives-select.mjs.map +1 -1
- package/fesm2022/ng-primitives-separator.mjs +3 -3
- package/fesm2022/ng-primitives-separator.mjs.map +1 -1
- package/fesm2022/ng-primitives-slider.mjs +14 -16
- package/fesm2022/ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/ng-primitives-switch.mjs +6 -6
- package/fesm2022/ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/ng-primitives-tabs.mjs +14 -13
- package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/ng-primitives-textarea.mjs +5 -7
- package/fesm2022/ng-primitives-textarea.mjs.map +1 -1
- package/fesm2022/ng-primitives-toast.mjs +3 -3
- package/fesm2022/ng-primitives-toast.mjs.map +1 -1
- package/fesm2022/ng-primitives-toggle-group.mjs +6 -6
- package/fesm2022/ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/ng-primitives-toggle.mjs +3 -3
- package/fesm2022/ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/ng-primitives-toolbar.mjs +3 -3
- package/fesm2022/ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs +6 -6
- package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
- package/focus-trap/focus-trap/focus-trap-state.d.ts +2 -2
- package/form-field/form-control/form-control-state.d.ts +1 -38
- package/form-field/form-control/form-control.d.ts +7 -36
- package/form-field/index.d.ts +2 -2
- package/input/input/input.d.ts +2 -3
- package/listbox/listbox/listbox-state.d.ts +2 -2
- package/meter/meter/meter-state.d.ts +3 -3
- package/meter/meter-indicator/meter-indicator.d.ts +3 -3
- package/meter/meter-label/meter-label.d.ts +3 -3
- package/package.json +5 -5
- package/pagination/pagination/pagination-state.d.ts +2 -2
- package/pagination/pagination-first/pagination-first.d.ts +2 -2
- package/pagination/pagination-next/pagination-next.d.ts +2 -2
- package/pagination/pagination-previous/pagination-previous.d.ts +2 -2
- package/progress/progress/progress-state.d.ts +3 -3
- package/progress/progress-indicator/progress-indicator.d.ts +3 -3
- package/progress/progress-label/progress-label.d.ts +3 -3
- package/progress/progress-track/progress-track.d.ts +3 -3
- package/progress/progress-value/progress-value.d.ts +3 -3
- package/radio/radio-group/radio-group.d.ts +1 -2
- package/roving-focus/roving-focus-group/roving-focus-group-state.d.ts +6 -6
- package/schematics/ng-generate/schema.d.ts +2 -1
- package/schematics/ng-generate/schema.json +1 -0
- package/schematics/ng-generate/templates/popover/popover-trigger.__fileSuffix@dasherize__.ts.template +39 -0
- package/schematics/ng-generate/templates/popover/popover.__fileSuffix@dasherize__.ts.template +59 -0
- package/select/select/select.d.ts +1 -2
- package/slider/slider/slider-state.d.ts +4 -4
- package/slider/slider/slider.d.ts +1 -2
- package/slider/slider-range/slider-range.d.ts +4 -4
- package/slider/slider-thumb/slider-thumb.d.ts +4 -4
- package/slider/slider-track/slider-track.d.ts +4 -4
- package/tabs/tab-button/tab-button.d.ts +9 -12
- package/tabs/tab-list/tab-list.d.ts +6 -6
- package/tabs/tab-panel/tab-panel.d.ts +6 -6
- package/tabs/tabset/tabset-state.d.ts +6 -6
- package/textarea/textarea/textarea.d.ts +1 -2
- package/toggle-group/toggle-group/toggle-group-state.d.ts +6 -6
- package/toolbar/toolbar/toolbar-state.d.ts +6 -6
|
@@ -82,10 +82,10 @@ class NgpSubmenuTrigger {
|
|
|
82
82
|
showSubmenuOnHover() {
|
|
83
83
|
this.openMenu('mouse');
|
|
84
84
|
}
|
|
85
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
86
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
85
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpSubmenuTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
86
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpSubmenuTrigger, isStandalone: true, selector: "[ngpSubmenuTrigger]", host: { attributes: { "aria-haspopup": "true" }, listeners: { "keydown.ArrowRight": "showSubmenuOnArrow($event)", "keydown.ArrowLeft": "showSubmenuOnArrow($event)", "mouseenter": "showSubmenuOnHover()" } }, exportAs: ["ngpSubmenuTrigger"], hostDirectives: [{ directive: i1.NgpPopoverTrigger, inputs: ["ngpPopoverTrigger", "ngpSubmenuTrigger"] }], ngImport: i0 }); }
|
|
87
87
|
}
|
|
88
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
88
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpSubmenuTrigger, decorators: [{
|
|
89
89
|
type: Directive,
|
|
90
90
|
args: [{
|
|
91
91
|
selector: '[ngpSubmenuTrigger]',
|
|
@@ -157,10 +157,10 @@ class NgpMenuItem {
|
|
|
157
157
|
showSubmenuOnHover() {
|
|
158
158
|
this.parentMenu?.closeSubmenus.next(this.elementRef.nativeElement);
|
|
159
159
|
}
|
|
160
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
161
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
160
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpMenuItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
161
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpMenuItem, isStandalone: true, selector: "[ngpMenuItem]", host: { attributes: { "role": "menuitem" }, listeners: { "click": "onClick($event)", "keydown.ArrowLeft": "handleArrowKey($event)", "keydown.ArrowRight": "handleArrowKey($event)", "mouseenter": "showSubmenuOnHover()" } }, exportAs: ["ngpMenuItem"], hostDirectives: [{ directive: i1$1.NgpButton, inputs: ["disabled", "ngpMenuItemDisabled"] }, { directive: i2.NgpRovingFocusItem }], ngImport: i0 }); }
|
|
162
162
|
}
|
|
163
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
163
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpMenuItem, decorators: [{
|
|
164
164
|
type: Directive,
|
|
165
165
|
args: [{
|
|
166
166
|
selector: '[ngpMenuItem]',
|
|
@@ -202,10 +202,10 @@ class NgpMenuTrigger {
|
|
|
202
202
|
closeOnEscape() {
|
|
203
203
|
this.parentMenu?.closeAllMenus('keyboard');
|
|
204
204
|
}
|
|
205
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
206
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
205
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpMenuTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
206
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpMenuTrigger, isStandalone: true, selector: "[ngpMenuTrigger]", host: { attributes: { "aria-haspopup": "true" }, listeners: { "document:keydown.escape": "closeOnEscape()" } }, exportAs: ["ngpMenuTrigger"], hostDirectives: [{ directive: i1.NgpPopoverTrigger, inputs: ["ngpPopoverTrigger", "ngpMenuTrigger", "ngpPopoverTriggerDisabled", "ngpMenuTriggerDisabled", "ngpPopoverTriggerPlacement", "ngpMenuTriggerPlacement", "ngpPopoverTriggerOffset", "ngpMenuTriggerOffset", "ngpPopoverTriggerShowDelay", "ngpMenuTriggerShowDelay", "ngpPopoverTriggerHideDelay", "ngpMenuTriggerHideDelay", "ngpPopoverTriggerFlip", "ngpMenuTriggerFlip", "ngpPopoverTriggerContainer", "ngpMenuTriggerContainer", "ngpPopoverTriggerScrollBehavior", "ngpMenuTriggerScrollBehavior"] }], ngImport: i0 }); }
|
|
207
207
|
}
|
|
208
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
208
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpMenuTrigger, decorators: [{
|
|
209
209
|
type: Directive,
|
|
210
210
|
args: [{
|
|
211
211
|
selector: '[ngpMenuTrigger]',
|
|
@@ -250,14 +250,14 @@ class NgpMenu {
|
|
|
250
250
|
this.popover().hide(origin);
|
|
251
251
|
this.parentMenu?.closeAllMenus(origin);
|
|
252
252
|
}
|
|
253
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
254
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
253
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpMenu, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
254
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpMenu, isStandalone: true, selector: "[ngpMenu]", providers: [
|
|
255
255
|
// ensure we don't inherit the focus group from the parent menu if there is one
|
|
256
256
|
provideRovingFocusGroup(NgpRovingFocusGroup, { inherit: false }),
|
|
257
257
|
provideMenu(NgpMenu),
|
|
258
258
|
], exportAs: ["ngpMenu"], hostDirectives: [{ directive: i1.NgpPopover }, { directive: i2.NgpRovingFocusGroup }], ngImport: i0 }); }
|
|
259
259
|
}
|
|
260
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
260
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpMenu, decorators: [{
|
|
261
261
|
type: Directive,
|
|
262
262
|
args: [{
|
|
263
263
|
selector: '[ngpMenu]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-menu.mjs","sources":["../../../../packages/ng-primitives/menu/src/menu/menu-token.ts","../../../../packages/ng-primitives/menu/src/submenu-trigger/submenu-trigger.ts","../../../../packages/ng-primitives/menu/src/menu-item/menu-item.ts","../../../../packages/ng-primitives/menu/src/menu-trigger/menu-trigger.ts","../../../../packages/ng-primitives/menu/src/menu/menu.ts","../../../../packages/ng-primitives/menu/src/ng-primitives-menu.ts"],"sourcesContent":["import { ExistingProvider, inject, InjectionToken, Type } from '@angular/core';\nimport type { NgpMenu } from './menu';\n\nexport const NgpMenuToken = new InjectionToken<NgpMenu>('NgpMenuToken');\n\n/**\n * Inject the Menu directive instance\n */\nexport function injectMenu(): NgpMenu {\n return inject(NgpMenuToken);\n}\n\n/**\n * Provide the Menu directive instance\n */\nexport function provideMenu(type: Type<NgpMenu>): ExistingProvider {\n return { provide: NgpMenuToken, useExisting: type };\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { Directive, HostListener, inject } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { injectPopoverTriggerState, NgpPopoverTrigger } from 'ng-primitives/popover';\nimport { NgpMenuToken } from '../menu/menu-token';\n\n@Directive({\n selector: '[ngpSubmenuTrigger]',\n exportAs: 'ngpSubmenuTrigger',\n hostDirectives: [\n { directive: NgpPopoverTrigger, inputs: ['ngpPopoverTrigger:ngpSubmenuTrigger'] },\n ],\n host: {\n 'aria-haspopup': 'true',\n },\n})\nexport class NgpSubmenuTrigger {\n /** Access the popover trigger element. */\n private readonly trigger = injectElementRef();\n\n /** Access the popover trigger state */\n private readonly popoverTrigger = injectPopoverTriggerState();\n\n /** Access the parent menu */\n private readonly parentMenu = inject(NgpMenuToken, { optional: true });\n\n constructor() {\n // by default the popover opens below and to the center of the trigger,\n // but as this is a submenu we want to default to opening to the right\n // and to the start\n this.popoverTrigger().placement.set('right-start');\n\n this.parentMenu?.closeSubmenus.pipe(takeUntilDestroyed()).subscribe(element => {\n // if the element is not the trigger, we want to close the menu\n if (element === this.trigger.nativeElement) {\n return;\n }\n\n this.closeMenu('mouse');\n });\n }\n\n /**\n * @internal\n */\n openMenu(origin: FocusOrigin): void {\n // if the menu is already open, we don't want to do anything\n if (this.popoverTrigger().open()) {\n return;\n }\n\n this.popoverTrigger().show(origin);\n }\n\n /**\n * @internal\n */\n closeMenu(origin: FocusOrigin): void {\n this.popoverTrigger().hide(origin);\n }\n\n /**\n * If the user presses the right arrow key, we want to open the submenu\n * and focus the first item in the submenu.\n * This behavior will be inverted if the direction is RTL.\n * @param event\n */\n @HostListener('keydown.ArrowRight', ['$event'])\n @HostListener('keydown.ArrowLeft', ['$event'])\n protected showSubmenuOnArrow(event: KeyboardEvent): void {\n const direction = getComputedStyle(this.trigger.nativeElement).direction;\n\n const isRtl = direction === 'rtl';\n\n const isRightArrow = event.key === 'ArrowRight';\n const isLeftArrow = event.key === 'ArrowLeft';\n\n if ((isRightArrow && !isRtl) || (isLeftArrow && isRtl)) {\n event.preventDefault();\n this.openMenu('keyboard');\n }\n }\n\n /**\n * If the user hovers over the trigger, we want to open the submenu\n */\n @HostListener('mouseenter')\n protected showSubmenuOnHover(): void {\n this.openMenu('mouse');\n }\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { Directive, HostListener, inject, Injector } from '@angular/core';\nimport { NgpButton } from 'ng-primitives/button';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { NgpRovingFocusItem } from 'ng-primitives/roving-focus';\nimport { injectMenu } from '../menu/menu-token';\nimport { NgpSubmenuTrigger } from '../submenu-trigger/submenu-trigger';\n\n/**\n * The `NgpMenuItem` directive represents a menu item.\n */\n@Directive({\n selector: '[ngpMenuItem]',\n exportAs: 'ngpMenuItem',\n hostDirectives: [\n { directive: NgpButton, inputs: ['disabled: ngpMenuItemDisabled'] },\n NgpRovingFocusItem,\n ],\n host: {\n role: 'menuitem',\n '(click)': 'onClick($event)',\n '(keydown.ArrowLeft)': 'handleArrowKey($event)',\n '(keydown.ArrowRight)': 'handleArrowKey($event)',\n },\n})\nexport class NgpMenuItem {\n /** Access the injector */\n private readonly injector = inject(Injector);\n /** Access the button element */\n private readonly elementRef = injectElementRef();\n\n /** Access the parent menu */\n private readonly parentMenu = injectMenu();\n\n /** Close the menu when the item is clicked */\n protected onClick(event: MouseEvent): void {\n // we do this here to avoid circular dependency issues\n const trigger = this.injector.get(NgpSubmenuTrigger, null, { self: true, optional: true });\n\n const origin: FocusOrigin = event.detail === 0 ? 'keyboard' : 'mouse';\n\n // if this is a submenu trigger, we don't want to close the menu, we want to open the submenu\n if (!trigger) {\n this.parentMenu?.closeAllMenus(origin);\n }\n }\n\n /**\n * If the user presses the left arrow key (in LTR) and there is a parent menu,\n * we want to close the menu and focus the parent menu item.\n */\n protected handleArrowKey(event: KeyboardEvent): void {\n // if there is no parent menu, we don't want to do anything\n const trigger = this.injector.get(NgpSubmenuTrigger, null, { optional: true });\n\n if (!trigger) {\n return;\n }\n\n const direction = getComputedStyle(this.elementRef.nativeElement).direction;\n const isRtl = direction === 'rtl';\n\n const isLeftArrow = event.key === 'ArrowLeft';\n const isRightArrow = event.key === 'ArrowRight';\n\n if ((isLeftArrow && !isRtl) || (isRightArrow && isRtl)) {\n event.preventDefault();\n\n if (trigger) {\n trigger.closeMenu('keyboard');\n }\n }\n }\n\n /**\n * If the user hovers over the trigger, we want to open the submenu\n */\n @HostListener('mouseenter')\n protected showSubmenuOnHover(): void {\n this.parentMenu?.closeSubmenus.next(this.elementRef.nativeElement);\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { injectPopoverTriggerState, NgpPopoverTrigger } from 'ng-primitives/popover';\nimport { NgpMenuToken } from '../menu/menu-token';\n\n/**\n * The `NgpMenuTrigger` directive allows you to turn an element into a menu trigger.\n */\n@Directive({\n selector: '[ngpMenuTrigger]',\n exportAs: 'ngpMenuTrigger',\n hostDirectives: [\n {\n directive: NgpPopoverTrigger,\n inputs: [\n 'ngpPopoverTrigger:ngpMenuTrigger',\n 'ngpPopoverTriggerDisabled:ngpMenuTriggerDisabled',\n 'ngpPopoverTriggerPlacement:ngpMenuTriggerPlacement',\n 'ngpPopoverTriggerOffset:ngpMenuTriggerOffset',\n 'ngpPopoverTriggerShowDelay:ngpMenuTriggerShowDelay',\n 'ngpPopoverTriggerHideDelay:ngpMenuTriggerHideDelay',\n 'ngpPopoverTriggerFlip:ngpMenuTriggerFlip',\n 'ngpPopoverTriggerContainer:ngpMenuTriggerContainer',\n 'ngpPopoverTriggerScrollBehavior:ngpMenuTriggerScrollBehavior',\n ],\n },\n ],\n host: {\n 'aria-haspopup': 'true',\n '(document:keydown.escape)': 'closeOnEscape()',\n },\n})\nexport class NgpMenuTrigger {\n /** Access the popover trigger state */\n private readonly state = injectPopoverTriggerState();\n\n /** Access any parent menus */\n private readonly parentMenu = inject(NgpMenuToken, { optional: true });\n\n constructor() {\n // by default the popover opens below and to the center of the trigger,\n // but as this is a menu we want to default to opening below and to the start\n this.state().placement.set('bottom-start');\n // for menus we want to default to blocking the scroll behavior\n this.state().scrollBehavior.set('block');\n }\n\n /**\n * Close the menu and any parent menus\n */\n closeOnEscape(): void {\n this.parentMenu?.closeAllMenus('keyboard');\n }\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { Directive, inject } from '@angular/core';\nimport { injectPopoverTriggerState, NgpPopover } from 'ng-primitives/popover';\nimport { NgpRovingFocusGroup, provideRovingFocusGroup } from 'ng-primitives/roving-focus';\nimport { Subject } from 'rxjs';\nimport { NgpMenuToken, provideMenu } from './menu-token';\n\n/**\n * The `NgpMenu` is a container for menu items.\n */\n@Directive({\n selector: '[ngpMenu]',\n exportAs: 'ngpMenu',\n hostDirectives: [NgpPopover, NgpRovingFocusGroup],\n providers: [\n // ensure we don't inherit the focus group from the parent menu if there is one\n provideRovingFocusGroup(NgpRovingFocusGroup, { inherit: false }),\n provideMenu(NgpMenu),\n ],\n})\nexport class NgpMenu {\n /** Access the popover trigger state */\n private readonly popover = injectPopoverTriggerState();\n\n /** Access any parent menus */\n private readonly parentMenu = inject(NgpMenuToken, { optional: true, skipSelf: true });\n\n /** @internal Whether we should close submenus */\n readonly closeSubmenus = new Subject<HTMLElement>();\n\n /** Close the menu and any parent menus */\n closeAllMenus(origin: FocusOrigin): void {\n this.popover().hide(origin);\n this.parentMenu?.closeAllMenus(origin);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;MAGa,YAAY,GAAG,IAAI,cAAc,CAAU,cAAc;AAEtE;;A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,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,MAAM,CAAC;;8GAb7B,OAAO,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAP,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,OAAO,EANP,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,WAAA,EAAA,SAAA,EAAA;;YAET,uBAAuB,CAAC,mBAAmB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;YAChE,WAAW,CAAC,OAAO,CAAC;AACrB,SAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,UAAA,EAAA,EAAA,EAAA,SAAA,EAAA,EAAA,CAAA,mBAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAEU,OAAO,EAAA,UAAA,EAAA,CAAA;kBAVnB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,QAAQ,EAAE,SAAS;AACnB,oBAAA,cAAc,EAAE,CAAC,UAAU,EAAE,mBAAmB,CAAC;AACjD,oBAAA,SAAS,EAAE;;wBAET,uBAAuB,CAAC,mBAAmB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAChE,wBAAA,WAAW,CAAS,OAAA,CAAA;AACrB,qBAAA;AACF,iBAAA;;;ACnBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-menu.mjs","sources":["../../../../packages/ng-primitives/menu/src/menu/menu-token.ts","../../../../packages/ng-primitives/menu/src/submenu-trigger/submenu-trigger.ts","../../../../packages/ng-primitives/menu/src/menu-item/menu-item.ts","../../../../packages/ng-primitives/menu/src/menu-trigger/menu-trigger.ts","../../../../packages/ng-primitives/menu/src/menu/menu.ts","../../../../packages/ng-primitives/menu/src/ng-primitives-menu.ts"],"sourcesContent":["import { ExistingProvider, inject, InjectionToken, Type } from '@angular/core';\nimport type { NgpMenu } from './menu';\n\nexport const NgpMenuToken = new InjectionToken<NgpMenu>('NgpMenuToken');\n\n/**\n * Inject the Menu directive instance\n */\nexport function injectMenu(): NgpMenu {\n return inject(NgpMenuToken);\n}\n\n/**\n * Provide the Menu directive instance\n */\nexport function provideMenu(type: Type<NgpMenu>): ExistingProvider {\n return { provide: NgpMenuToken, useExisting: type };\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { Directive, HostListener, inject } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { injectPopoverTriggerState, NgpPopoverTrigger } from 'ng-primitives/popover';\nimport { NgpMenuToken } from '../menu/menu-token';\n\n@Directive({\n selector: '[ngpSubmenuTrigger]',\n exportAs: 'ngpSubmenuTrigger',\n hostDirectives: [\n { directive: NgpPopoverTrigger, inputs: ['ngpPopoverTrigger:ngpSubmenuTrigger'] },\n ],\n host: {\n 'aria-haspopup': 'true',\n },\n})\nexport class NgpSubmenuTrigger {\n /** Access the popover trigger element. */\n private readonly trigger = injectElementRef();\n\n /** Access the popover trigger state */\n private readonly popoverTrigger = injectPopoverTriggerState();\n\n /** Access the parent menu */\n private readonly parentMenu = inject(NgpMenuToken, { optional: true });\n\n constructor() {\n // by default the popover opens below and to the center of the trigger,\n // but as this is a submenu we want to default to opening to the right\n // and to the start\n this.popoverTrigger().placement.set('right-start');\n\n this.parentMenu?.closeSubmenus.pipe(takeUntilDestroyed()).subscribe(element => {\n // if the element is not the trigger, we want to close the menu\n if (element === this.trigger.nativeElement) {\n return;\n }\n\n this.closeMenu('mouse');\n });\n }\n\n /**\n * @internal\n */\n openMenu(origin: FocusOrigin): void {\n // if the menu is already open, we don't want to do anything\n if (this.popoverTrigger().open()) {\n return;\n }\n\n this.popoverTrigger().show(origin);\n }\n\n /**\n * @internal\n */\n closeMenu(origin: FocusOrigin): void {\n this.popoverTrigger().hide(origin);\n }\n\n /**\n * If the user presses the right arrow key, we want to open the submenu\n * and focus the first item in the submenu.\n * This behavior will be inverted if the direction is RTL.\n * @param event\n */\n @HostListener('keydown.ArrowRight', ['$event'])\n @HostListener('keydown.ArrowLeft', ['$event'])\n protected showSubmenuOnArrow(event: KeyboardEvent): void {\n const direction = getComputedStyle(this.trigger.nativeElement).direction;\n\n const isRtl = direction === 'rtl';\n\n const isRightArrow = event.key === 'ArrowRight';\n const isLeftArrow = event.key === 'ArrowLeft';\n\n if ((isRightArrow && !isRtl) || (isLeftArrow && isRtl)) {\n event.preventDefault();\n this.openMenu('keyboard');\n }\n }\n\n /**\n * If the user hovers over the trigger, we want to open the submenu\n */\n @HostListener('mouseenter')\n protected showSubmenuOnHover(): void {\n this.openMenu('mouse');\n }\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { Directive, HostListener, inject, Injector } from '@angular/core';\nimport { NgpButton } from 'ng-primitives/button';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { NgpRovingFocusItem } from 'ng-primitives/roving-focus';\nimport { injectMenu } from '../menu/menu-token';\nimport { NgpSubmenuTrigger } from '../submenu-trigger/submenu-trigger';\n\n/**\n * The `NgpMenuItem` directive represents a menu item.\n */\n@Directive({\n selector: '[ngpMenuItem]',\n exportAs: 'ngpMenuItem',\n hostDirectives: [\n { directive: NgpButton, inputs: ['disabled: ngpMenuItemDisabled'] },\n NgpRovingFocusItem,\n ],\n host: {\n role: 'menuitem',\n '(click)': 'onClick($event)',\n '(keydown.ArrowLeft)': 'handleArrowKey($event)',\n '(keydown.ArrowRight)': 'handleArrowKey($event)',\n },\n})\nexport class NgpMenuItem {\n /** Access the injector */\n private readonly injector = inject(Injector);\n /** Access the button element */\n private readonly elementRef = injectElementRef();\n\n /** Access the parent menu */\n private readonly parentMenu = injectMenu();\n\n /** Close the menu when the item is clicked */\n protected onClick(event: MouseEvent): void {\n // we do this here to avoid circular dependency issues\n const trigger = this.injector.get(NgpSubmenuTrigger, null, { self: true, optional: true });\n\n const origin: FocusOrigin = event.detail === 0 ? 'keyboard' : 'mouse';\n\n // if this is a submenu trigger, we don't want to close the menu, we want to open the submenu\n if (!trigger) {\n this.parentMenu?.closeAllMenus(origin);\n }\n }\n\n /**\n * If the user presses the left arrow key (in LTR) and there is a parent menu,\n * we want to close the menu and focus the parent menu item.\n */\n protected handleArrowKey(event: KeyboardEvent): void {\n // if there is no parent menu, we don't want to do anything\n const trigger = this.injector.get(NgpSubmenuTrigger, null, { optional: true });\n\n if (!trigger) {\n return;\n }\n\n const direction = getComputedStyle(this.elementRef.nativeElement).direction;\n const isRtl = direction === 'rtl';\n\n const isLeftArrow = event.key === 'ArrowLeft';\n const isRightArrow = event.key === 'ArrowRight';\n\n if ((isLeftArrow && !isRtl) || (isRightArrow && isRtl)) {\n event.preventDefault();\n\n if (trigger) {\n trigger.closeMenu('keyboard');\n }\n }\n }\n\n /**\n * If the user hovers over the trigger, we want to open the submenu\n */\n @HostListener('mouseenter')\n protected showSubmenuOnHover(): void {\n this.parentMenu?.closeSubmenus.next(this.elementRef.nativeElement);\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { injectPopoverTriggerState, NgpPopoverTrigger } from 'ng-primitives/popover';\nimport { NgpMenuToken } from '../menu/menu-token';\n\n/**\n * The `NgpMenuTrigger` directive allows you to turn an element into a menu trigger.\n */\n@Directive({\n selector: '[ngpMenuTrigger]',\n exportAs: 'ngpMenuTrigger',\n hostDirectives: [\n {\n directive: NgpPopoverTrigger,\n inputs: [\n 'ngpPopoverTrigger:ngpMenuTrigger',\n 'ngpPopoverTriggerDisabled:ngpMenuTriggerDisabled',\n 'ngpPopoverTriggerPlacement:ngpMenuTriggerPlacement',\n 'ngpPopoverTriggerOffset:ngpMenuTriggerOffset',\n 'ngpPopoverTriggerShowDelay:ngpMenuTriggerShowDelay',\n 'ngpPopoverTriggerHideDelay:ngpMenuTriggerHideDelay',\n 'ngpPopoverTriggerFlip:ngpMenuTriggerFlip',\n 'ngpPopoverTriggerContainer:ngpMenuTriggerContainer',\n 'ngpPopoverTriggerScrollBehavior:ngpMenuTriggerScrollBehavior',\n ],\n },\n ],\n host: {\n 'aria-haspopup': 'true',\n '(document:keydown.escape)': 'closeOnEscape()',\n },\n})\nexport class NgpMenuTrigger {\n /** Access the popover trigger state */\n private readonly state = injectPopoverTriggerState();\n\n /** Access any parent menus */\n private readonly parentMenu = inject(NgpMenuToken, { optional: true });\n\n constructor() {\n // by default the popover opens below and to the center of the trigger,\n // but as this is a menu we want to default to opening below and to the start\n this.state().placement.set('bottom-start');\n // for menus we want to default to blocking the scroll behavior\n this.state().scrollBehavior.set('block');\n }\n\n /**\n * Close the menu and any parent menus\n */\n closeOnEscape(): void {\n this.parentMenu?.closeAllMenus('keyboard');\n }\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { Directive, inject } from '@angular/core';\nimport { injectPopoverTriggerState, NgpPopover } from 'ng-primitives/popover';\nimport { NgpRovingFocusGroup, provideRovingFocusGroup } from 'ng-primitives/roving-focus';\nimport { Subject } from 'rxjs';\nimport { NgpMenuToken, provideMenu } from './menu-token';\n\n/**\n * The `NgpMenu` is a container for menu items.\n */\n@Directive({\n selector: '[ngpMenu]',\n exportAs: 'ngpMenu',\n hostDirectives: [NgpPopover, NgpRovingFocusGroup],\n providers: [\n // ensure we don't inherit the focus group from the parent menu if there is one\n provideRovingFocusGroup(NgpRovingFocusGroup, { inherit: false }),\n provideMenu(NgpMenu),\n ],\n})\nexport class NgpMenu {\n /** Access the popover trigger state */\n private readonly popover = injectPopoverTriggerState();\n\n /** Access any parent menus */\n private readonly parentMenu = inject(NgpMenuToken, { optional: true, skipSelf: true });\n\n /** @internal Whether we should close submenus */\n readonly closeSubmenus = new Subject<HTMLElement>();\n\n /** Close the menu and any parent menus */\n closeAllMenus(origin: FocusOrigin): void {\n this.popover().hide(origin);\n this.parentMenu?.closeAllMenus(origin);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;MAGa,YAAY,GAAG,IAAI,cAAc,CAAU,cAAc;AAEtE;;AAEG;SACa,UAAU,GAAA;AACxB,IAAA,OAAO,MAAM,CAAC,YAAY,CAAC;AAC7B;AAEA;;AAEG;AACG,SAAU,WAAW,CAAC,IAAmB,EAAA;IAC7C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,IAAI,EAAE;AACrD;;MCAa,iBAAiB,CAAA;AAU5B,IAAA,WAAA,GAAA;;QARiB,IAAO,CAAA,OAAA,GAAG,gBAAgB,EAAE;;QAG5B,IAAc,CAAA,cAAA,GAAG,yBAAyB,EAAE;;QAG5C,IAAU,CAAA,UAAA,GAAG,MAAM,CAAC,YAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;;;QAMpE,IAAI,CAAC,cAAc,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC;AAElD,QAAA,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC,CAAC,SAAS,CAAC,OAAO,IAAG;;YAE5E,IAAI,OAAO,KAAK,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;gBAC1C;;AAGF,YAAA,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;AACzB,SAAC,CAAC;;AAGJ;;AAEG;AACH,IAAA,QAAQ,CAAC,MAAmB,EAAA;;QAE1B,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE;YAChC;;QAGF,IAAI,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC;;AAGpC;;AAEG;AACH,IAAA,SAAS,CAAC,MAAmB,EAAA;QAC3B,IAAI,CAAC,cAAc,EA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B,qBAAA;AACF,iBAAA;;;ACnBD;;AAEG;;;;"}
|
|
@@ -67,10 +67,10 @@ class NgpMeter {
|
|
|
67
67
|
/** The state of the meter. */
|
|
68
68
|
this.state = meterState(this);
|
|
69
69
|
}
|
|
70
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
71
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.
|
|
70
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpMeter, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
71
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpMeter, isStandalone: true, selector: "[ngpMeter]", inputs: { value: { classPropertyName: "value", publicName: "ngpMeterValue", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "ngpMeterMin", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "ngpMeterMax", isSignal: true, isRequired: false, transformFunction: null }, valueLabel: { classPropertyName: "valueLabel", publicName: "ngpMeterValueLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "meter" }, properties: { "attr.aria-valuenow": "percentage()", "attr.aria-valuemin": "min()", "attr.aria-valuemax": "max()", "attr.aria-valuetext": "valueLabel()(value(), max())", "attr.aria-labelledby": "label()?.id()" } }, providers: [provideMeterState()], exportAs: ["ngpMeter"], ngImport: i0 }); }
|
|
72
72
|
}
|
|
73
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
73
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpMeter, decorators: [{
|
|
74
74
|
type: Directive,
|
|
75
75
|
args: [{
|
|
76
76
|
selector: '[ngpMeter]',
|
|
@@ -88,10 +88,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
88
88
|
}] });
|
|
89
89
|
|
|
90
90
|
class NgpMeterTrack {
|
|
91
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
92
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
91
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpMeterTrack, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
92
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpMeterTrack, isStandalone: true, selector: "[ngpMeterTrack]", exportAs: ["ngpMeterTrack"], ngImport: i0 }); }
|
|
93
93
|
}
|
|
94
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
94
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpMeterTrack, decorators: [{
|
|
95
95
|
type: Directive,
|
|
96
96
|
args: [{
|
|
97
97
|
selector: '[ngpMeterTrack]',
|
|
@@ -104,10 +104,10 @@ class NgpMeterIndicator {
|
|
|
104
104
|
/** Access the meter */
|
|
105
105
|
this.meter = injectMeterState();
|
|
106
106
|
}
|
|
107
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
108
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
107
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpMeterIndicator, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
108
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpMeterIndicator, isStandalone: true, selector: "[ngpMeterIndicator]", host: { properties: { "style.width.%": "meter().percentage()" } }, exportAs: ["ngpMeterIndicator"], ngImport: i0 }); }
|
|
109
109
|
}
|
|
110
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
110
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpMeterIndicator, decorators: [{
|
|
111
111
|
type: Directive,
|
|
112
112
|
args: [{
|
|
113
113
|
selector: '[ngpMeterIndicator]',
|
|
@@ -119,10 +119,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
119
119
|
}] });
|
|
120
120
|
|
|
121
121
|
class NgpMeterValue {
|
|
122
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
123
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
122
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpMeterValue, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
123
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpMeterValue, isStandalone: true, selector: "[ngpMeterValue]", host: { attributes: { "aria-hidden": "true" } }, exportAs: ["ngpMeterValue"], ngImport: i0 }); }
|
|
124
124
|
}
|
|
125
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
125
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpMeterValue, decorators: [{
|
|
126
126
|
type: Directive,
|
|
127
127
|
args: [{
|
|
128
128
|
selector: '[ngpMeterValue]',
|
|
@@ -142,10 +142,10 @@ class NgpMeterLabel {
|
|
|
142
142
|
// Register the label with the meter
|
|
143
143
|
this.meter().label.set(this);
|
|
144
144
|
}
|
|
145
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
146
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.
|
|
145
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpMeterLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
146
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpMeterLabel, isStandalone: true, selector: "[ngpMeterLabel]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.id": "id()" } }, exportAs: ["ngpMeterLabel"], ngImport: i0 }); }
|
|
147
147
|
}
|
|
148
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
148
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpMeterLabel, decorators: [{
|
|
149
149
|
type: Directive,
|
|
150
150
|
args: [{
|
|
151
151
|
selector: '[ngpMeterLabel]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-meter.mjs","sources":["../../../../packages/ng-primitives/meter/src/meter/meter-state.ts","../../../../packages/ng-primitives/meter/src/meter/meter.ts","../../../../packages/ng-primitives/meter/src/meter-track/meter-track.ts","../../../../packages/ng-primitives/meter/src/meter-indicator/meter-indicator.ts","../../../../packages/ng-primitives/meter/src/meter-value/meter-value.ts","../../../../packages/ng-primitives/meter/src/meter-label/meter-label.ts","../../../../packages/ng-primitives/meter/src/ng-primitives-meter.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpMeter } from './meter';\n\n/**\n * The state token for the Meter primitive.\n */\nexport const NgpMeterStateToken = createStateToken<NgpMeter>('Meter');\n\n/**\n * Provides the Meter state.\n */\nexport const provideMeterState = createStateProvider(NgpMeterStateToken);\n\n/**\n * Injects the Meter state.\n */\nexport const injectMeterState = createStateInjector(NgpMeterStateToken);\n\n/**\n * The Meter state registration function.\n */\nexport const meterState = createState(NgpMeterStateToken);\n","import { NumberInput } from '@angular/cdk/coercion';\nimport { computed, Directive, input, numberAttribute, signal } from '@angular/core';\nimport type { NgpMeterLabel } from '../meter-label/meter-label';\nimport { meterState, provideMeterState } from './meter-state';\n\n@Directive({\n selector: '[ngpMeter]',\n exportAs: 'ngpMeter',\n providers: [provideMeterState()],\n host: {\n role: 'meter',\n '[attr.aria-valuenow]': 'percentage()',\n '[attr.aria-valuemin]': 'min()',\n '[attr.aria-valuemax]': 'max()',\n '[attr.aria-valuetext]': 'valueLabel()(value(), max())',\n '[attr.aria-labelledby]': 'label()?.id()',\n },\n})\nexport class NgpMeter {\n /** The value of the meter. */\n readonly value = input<number, NumberInput>(0, {\n alias: 'ngpMeterValue',\n transform: numberAttribute,\n });\n\n /** The minimum value of the meter. */\n readonly min = input<number, NumberInput>(0, {\n alias: 'ngpMeterMin',\n transform: numberAttribute,\n });\n\n /** The maximum value of the meter. */\n readonly max = input<number, NumberInput>(100, {\n alias: 'ngpMeterMax',\n transform: numberAttribute,\n });\n\n /**\n * Define a function that returns the meter value label.\n * @param value The current value\n * @param max The maximum value\n * @returns The value label\n */\n readonly valueLabel = input<NgpMeterValueTextFn>(\n (value, max) => `${Math.round((value / max) * 100)}%`,\n {\n alias: 'ngpMeterValueLabel',\n },\n );\n\n /** @internal Store the label instance */\n readonly label = signal<NgpMeterLabel | null>(null);\n\n /** @internal The percentage of the meter. */\n readonly percentage = computed(() => {\n const value = this.state.value();\n const min = this.state.min();\n const max = this.state.max();\n\n if (value == null) {\n return 0;\n }\n\n if (value < min) {\n return 0;\n }\n\n if (value > max) {\n return 100;\n }\n\n return ((value - min) / (max - min)) * 100;\n });\n\n /** The state of the meter. */\n private readonly state = meterState<NgpMeter>(this);\n}\n\nexport type NgpMeterValueTextFn = (value: number, max: number) => string;\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: '[ngpMeterTrack]',\n exportAs: 'ngpMeterTrack',\n})\nexport class NgpMeterTrack {}\n","import { Directive } from '@angular/core';\nimport { injectMeterState } from '../meter/meter-state';\n\n@Directive({\n selector: '[ngpMeterIndicator]',\n exportAs: 'ngpMeterIndicator',\n host: {\n '[style.width.%]': 'meter().percentage()',\n },\n})\nexport class NgpMeterIndicator {\n /** Access the meter */\n protected readonly meter = injectMeterState();\n}\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: '[ngpMeterValue]',\n exportAs: 'ngpMeterValue',\n host: {\n 'aria-hidden': 'true',\n },\n})\nexport class NgpMeterValue {}\n","import { Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectMeterState } from '../meter/meter-state';\n\n@Directive({\n selector: '[ngpMeterLabel]',\n exportAs: 'ngpMeterLabel',\n host: {\n '[attr.id]': 'id()',\n },\n})\nexport class NgpMeterLabel {\n /** Access the meter */\n protected readonly meter = injectMeterState();\n\n /** The id of the meter label */\n readonly id = input(uniqueId('ngp-meter-label'));\n\n constructor() {\n // Register the label with the meter\n this.meter().label.set(this);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAQA;;AAEG;AACI,MAAM,kBAAkB,GAAG,gBAAgB,CAAW,OAAO,CAAC;AAErE;;AAEG;MACU,iBAAiB,GAAG,mBAAmB,CAAC,kBAAkB;AAEvE;;AAEG;MACU,gBAAgB,GAAG,mBAAmB,CAAC,kBAAkB;AAEtE;;AAEG;AACI,MAAM,UAAU,GAAG,WAAW,CAAC,kBAAkB,CAAC;;MCR5C,QAAQ,CAAA;AAbrB,IAAA,WAAA,GAAA;;AAeW,QAAA,IAAA,CAAA,KAAK,GAAG,K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C5C,SAAC,CAAC;;AAGe,QAAA,IAAA,CAAA,KAAK,GAAG,UAAU,CAAW,IAAI,CAAC;AACpD
|
|
1
|
+
{"version":3,"file":"ng-primitives-meter.mjs","sources":["../../../../packages/ng-primitives/meter/src/meter/meter-state.ts","../../../../packages/ng-primitives/meter/src/meter/meter.ts","../../../../packages/ng-primitives/meter/src/meter-track/meter-track.ts","../../../../packages/ng-primitives/meter/src/meter-indicator/meter-indicator.ts","../../../../packages/ng-primitives/meter/src/meter-value/meter-value.ts","../../../../packages/ng-primitives/meter/src/meter-label/meter-label.ts","../../../../packages/ng-primitives/meter/src/ng-primitives-meter.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpMeter } from './meter';\n\n/**\n * The state token for the Meter primitive.\n */\nexport const NgpMeterStateToken = createStateToken<NgpMeter>('Meter');\n\n/**\n * Provides the Meter state.\n */\nexport const provideMeterState = createStateProvider(NgpMeterStateToken);\n\n/**\n * Injects the Meter state.\n */\nexport const injectMeterState = createStateInjector(NgpMeterStateToken);\n\n/**\n * The Meter state registration function.\n */\nexport const meterState = createState(NgpMeterStateToken);\n","import { NumberInput } from '@angular/cdk/coercion';\nimport { computed, Directive, input, numberAttribute, signal } from '@angular/core';\nimport type { NgpMeterLabel } from '../meter-label/meter-label';\nimport { meterState, provideMeterState } from './meter-state';\n\n@Directive({\n selector: '[ngpMeter]',\n exportAs: 'ngpMeter',\n providers: [provideMeterState()],\n host: {\n role: 'meter',\n '[attr.aria-valuenow]': 'percentage()',\n '[attr.aria-valuemin]': 'min()',\n '[attr.aria-valuemax]': 'max()',\n '[attr.aria-valuetext]': 'valueLabel()(value(), max())',\n '[attr.aria-labelledby]': 'label()?.id()',\n },\n})\nexport class NgpMeter {\n /** The value of the meter. */\n readonly value = input<number, NumberInput>(0, {\n alias: 'ngpMeterValue',\n transform: numberAttribute,\n });\n\n /** The minimum value of the meter. */\n readonly min = input<number, NumberInput>(0, {\n alias: 'ngpMeterMin',\n transform: numberAttribute,\n });\n\n /** The maximum value of the meter. */\n readonly max = input<number, NumberInput>(100, {\n alias: 'ngpMeterMax',\n transform: numberAttribute,\n });\n\n /**\n * Define a function that returns the meter value label.\n * @param value The current value\n * @param max The maximum value\n * @returns The value label\n */\n readonly valueLabel = input<NgpMeterValueTextFn>(\n (value, max) => `${Math.round((value / max) * 100)}%`,\n {\n alias: 'ngpMeterValueLabel',\n },\n );\n\n /** @internal Store the label instance */\n readonly label = signal<NgpMeterLabel | null>(null);\n\n /** @internal The percentage of the meter. */\n readonly percentage = computed(() => {\n const value = this.state.value();\n const min = this.state.min();\n const max = this.state.max();\n\n if (value == null) {\n return 0;\n }\n\n if (value < min) {\n return 0;\n }\n\n if (value > max) {\n return 100;\n }\n\n return ((value - min) / (max - min)) * 100;\n });\n\n /** The state of the meter. */\n private readonly state = meterState<NgpMeter>(this);\n}\n\nexport type NgpMeterValueTextFn = (value: number, max: number) => string;\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: '[ngpMeterTrack]',\n exportAs: 'ngpMeterTrack',\n})\nexport class NgpMeterTrack {}\n","import { Directive } from '@angular/core';\nimport { injectMeterState } from '../meter/meter-state';\n\n@Directive({\n selector: '[ngpMeterIndicator]',\n exportAs: 'ngpMeterIndicator',\n host: {\n '[style.width.%]': 'meter().percentage()',\n },\n})\nexport class NgpMeterIndicator {\n /** Access the meter */\n protected readonly meter = injectMeterState();\n}\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: '[ngpMeterValue]',\n exportAs: 'ngpMeterValue',\n host: {\n 'aria-hidden': 'true',\n },\n})\nexport class NgpMeterValue {}\n","import { Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectMeterState } from '../meter/meter-state';\n\n@Directive({\n selector: '[ngpMeterLabel]',\n exportAs: 'ngpMeterLabel',\n host: {\n '[attr.id]': 'id()',\n },\n})\nexport class NgpMeterLabel {\n /** Access the meter */\n protected readonly meter = injectMeterState();\n\n /** The id of the meter label */\n readonly id = input(uniqueId('ngp-meter-label'));\n\n constructor() {\n // Register the label with the meter\n this.meter().label.set(this);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAQA;;AAEG;AACI,MAAM,kBAAkB,GAAG,gBAAgB,CAAW,OAAO,CAAC;AAErE;;AAEG;MACU,iBAAiB,GAAG,mBAAmB,CAAC,kBAAkB;AAEvE;;AAEG;MACU,gBAAgB,GAAG,mBAAmB,CAAC,kBAAkB;AAEtE;;AAEG;AACI,MAAM,UAAU,GAAG,WAAW,CAAC,kBAAkB,CAAC;;MCR5C,QAAQ,CAAA;AAbrB,IAAA,WAAA,GAAA;;AAeW,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAsB,CAAC,EAAE;AAC7C,YAAA,KAAK,EAAE,eAAe;AACtB,YAAA,SAAS,EAAE,eAAe;AAC3B,SAAA,CAAC;;AAGO,QAAA,IAAA,CAAA,GAAG,GAAG,KAAK,CAAsB,CAAC,EAAE;AAC3C,YAAA,KAAK,EAAE,aAAa;AACpB,YAAA,SAAS,EAAE,eAAe;AAC3B,SAAA,CAAC;;AAGO,QAAA,IAAA,CAAA,GAAG,GAAG,KAAK,CAAsB,GAAG,EAAE;AAC7C,YAAA,KAAK,EAAE,aAAa;AACpB,YAAA,SAAS,EAAE,eAAe;AAC3B,SAAA,CAAC;AAEF;;;;;AAKG;QACM,IAAU,CAAA,UAAA,GAAG,KAAK,CACzB,CAAC,KAAK,EAAE,GAAG,KAAK,CAAG,EAAA,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,GAAG,IAAI,GAAG,CAAC,CAAA,CAAA,CAAG,EACrD;AACE,YAAA,KAAK,EAAE,oBAAoB;AAC5B,SAAA,CACF;;AAGQ,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAuB,IAAI,CAAC;;AAG1C,QAAA,IAAA,CAAA,UAAU,GAAG,Q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;ACVD;;AAEG;;;;"}
|
|
@@ -72,10 +72,10 @@ class NgpPaginationButton {
|
|
|
72
72
|
event.stopPropagation();
|
|
73
73
|
this.goToPage();
|
|
74
74
|
}
|
|
75
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
76
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.
|
|
75
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPaginationButton, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
76
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpPaginationButton, isStandalone: true, selector: "[ngpPaginationButton]", inputs: { page: { classPropertyName: "page", publicName: "ngpPaginationButtonPage", isSignal: true, isRequired: true, transformFunction: null }, buttonDisabled: { classPropertyName: "buttonDisabled", publicName: "ngpPaginationButtonDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "goToPage()", "keydown.enter": "onEnter($event)", "keydown.space": "onEnter($event)" }, properties: { "tabindex": "disabled() ? -1 : 0", "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-page": "page()", "attr.data-selected": "selected() ? \"\" : null", "attr.aria-current": "selected()" } }, exportAs: ["ngpPaginationButton"], hostDirectives: [{ directive: i1.NgpButton }], ngImport: i0 }); }
|
|
77
77
|
}
|
|
78
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPaginationButton, decorators: [{
|
|
79
79
|
type: Directive,
|
|
80
80
|
args: [{
|
|
81
81
|
selector: '[ngpPaginationButton]',
|
|
@@ -139,10 +139,10 @@ class NgpPaginationFirst {
|
|
|
139
139
|
event.stopPropagation();
|
|
140
140
|
this.goToFirstPage();
|
|
141
141
|
}
|
|
142
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
143
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.
|
|
142
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPaginationFirst, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
143
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpPaginationFirst, isStandalone: true, selector: "[ngpPaginationFirst]", inputs: { buttonDisabled: { classPropertyName: "buttonDisabled", publicName: "ngpPaginationFirstDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "goToFirstPage()", "keydown.enter": "onEnter($event)", "keydown.space": "onEnter($event)" }, properties: { "tabindex": "disabled() ? -1 : 0", "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-first-page": "paginationState().firstPage() ? \"\" : null" } }, exportAs: ["ngpPaginationFirst"], hostDirectives: [{ directive: i1.NgpButton }], ngImport: i0 }); }
|
|
144
144
|
}
|
|
145
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
145
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPaginationFirst, decorators: [{
|
|
146
146
|
type: Directive,
|
|
147
147
|
args: [{
|
|
148
148
|
selector: '[ngpPaginationFirst]',
|
|
@@ -204,10 +204,10 @@ class NgpPaginationLast {
|
|
|
204
204
|
event.stopPropagation();
|
|
205
205
|
this.goToLastPage();
|
|
206
206
|
}
|
|
207
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
208
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.
|
|
207
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPaginationLast, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
208
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpPaginationLast, isStandalone: true, selector: "[ngpPaginationLast]", inputs: { buttonDisabled: { classPropertyName: "buttonDisabled", publicName: "ngpPaginationLastDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "goToLastPage()", "keydown.enter": "onEnter($event)", "keydown.space": "onEnter($event)" }, properties: { "tabindex": "disabled() ? -1 : 0", "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-last-page": "paginationState().lastPage() ? \"\" : null" } }, exportAs: ["ngpPaginationLast"], hostDirectives: [{ directive: i1.NgpButton }], ngImport: i0 }); }
|
|
209
209
|
}
|
|
210
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
210
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPaginationLast, decorators: [{
|
|
211
211
|
type: Directive,
|
|
212
212
|
args: [{
|
|
213
213
|
selector: '[ngpPaginationLast]',
|
|
@@ -272,10 +272,10 @@ class NgpPaginationNext {
|
|
|
272
272
|
event.stopPropagation();
|
|
273
273
|
this.goToNextPage();
|
|
274
274
|
}
|
|
275
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
276
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.
|
|
275
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPaginationNext, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
276
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpPaginationNext, isStandalone: true, selector: "[ngpPaginationNext]", inputs: { buttonDisabled: { classPropertyName: "buttonDisabled", publicName: "ngpPaginationNextDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "goToNextPage()", "keydown.enter": "onEnter($event)", "keydown.space": "onEnter($event)" }, properties: { "tabindex": "disabled() ? -1 : 0", "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-last-page": "paginationState().lastPage() ? \"\" : null" } }, exportAs: ["ngpPaginationNext"], hostDirectives: [{ directive: i1.NgpButton }], ngImport: i0 }); }
|
|
277
277
|
}
|
|
278
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
278
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPaginationNext, decorators: [{
|
|
279
279
|
type: Directive,
|
|
280
280
|
args: [{
|
|
281
281
|
selector: '[ngpPaginationNext]',
|
|
@@ -340,10 +340,10 @@ class NgpPaginationPrevious {
|
|
|
340
340
|
event.stopPropagation();
|
|
341
341
|
this.goToPreviousPage();
|
|
342
342
|
}
|
|
343
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
344
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.
|
|
343
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPaginationPrevious, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
344
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpPaginationPrevious, isStandalone: true, selector: "[ngpPaginationPrevious]", inputs: { buttonDisabled: { classPropertyName: "buttonDisabled", publicName: "ngpPaginationPreviousDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "goToPreviousPage()", "keydown.enter": "onEnter($event)", "keydown.space": "onEnter($event)" }, properties: { "tabindex": "disabled() ? -1 : 0", "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-first-page": "paginationState().firstPage() ? \"\" : null" } }, exportAs: ["ngpPaginationPrevious"], hostDirectives: [{ directive: i1.NgpButton }], ngImport: i0 }); }
|
|
345
345
|
}
|
|
346
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
346
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPaginationPrevious, decorators: [{
|
|
347
347
|
type: Directive,
|
|
348
348
|
args: [{
|
|
349
349
|
selector: '[ngpPaginationPrevious]',
|
|
@@ -426,10 +426,10 @@ class NgpPagination {
|
|
|
426
426
|
this.state.page.set(page);
|
|
427
427
|
this.pageChange.emit(page);
|
|
428
428
|
}
|
|
429
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
430
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.
|
|
429
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPagination, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
430
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpPagination, isStandalone: true, selector: "[ngpPagination]", inputs: { page: { classPropertyName: "page", publicName: "ngpPaginationPage", isSignal: true, isRequired: false, transformFunction: null }, pageCount: { classPropertyName: "pageCount", publicName: "ngpPaginationPageCount", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpPaginationDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageChange: "ngpPaginationPageChange" }, host: { attributes: { "role": "navigation" }, properties: { "attr.data-page": "state.page()", "attr.data-page-count": "state.pageCount()", "attr.data-first-page": "firstPage() ? \"\" : null", "attr.data-last-page": "lastPage() ? \"\" : null", "attr.data-disabled": "state.disabled() ? \"\" : null" } }, providers: [providePaginationState()], exportAs: ["ngpPagination"], ngImport: i0 }); }
|
|
431
431
|
}
|
|
432
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
432
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPagination, decorators: [{
|
|
433
433
|
type: Directive,
|
|
434
434
|
args: [{
|
|
435
435
|
selector: '[ngpPagination]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-pagination.mjs","sources":["../../../../packages/ng-primitives/pagination/src/pagination/pagination-state.ts","../../../../packages/ng-primitives/pagination/src/pagination-button/pagination-button.ts","../../../../packages/ng-primitives/pagination/src/pagination-first/pagination-first.ts","../../../../packages/ng-primitives/pagination/src/pagination-last/pagination-last.ts","../../../../packages/ng-primitives/pagination/src/pagination-next/pagination-next.ts","../../../../packages/ng-primitives/pagination/src/pagination-previous/pagination-previous.ts","../../../../packages/ng-primitives/pagination/src/pagination/pagination.ts","../../../../packages/ng-primitives/pagination/src/ng-primitives-pagination.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpPagination } from './pagination';\n\n/**\n * The state token for the Pagination primitive.\n */\nexport const NgpPaginationStateToken = createStateToken<NgpPagination>('Pagination');\n\n/**\n * Provides the Pagination state.\n */\nexport const providePaginationState = createStateProvider(NgpPaginationStateToken);\n\n/**\n * Injects the Pagination state.\n */\nexport const injectPaginationState = createStateInjector(NgpPaginationStateToken);\n\n/**\n * The Pagination state registration function.\n */\nexport const paginationState = createState(NgpPaginationStateToken);\n","import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n HostListener,\n input,\n numberAttribute,\n} from '@angular/core';\nimport { NgpButton, syncButton } from 'ng-primitives/button';\nimport { injectPaginationState } from '../pagination/pagination-state';\n\n/**\n * The `NgpPaginationButton` directive is used to create a pagination button.\n */\n@Directive({\n selector: '[ngpPaginationButton]',\n exportAs: 'ngpPaginationButton',\n hostDirectives: [NgpButton],\n host: {\n '[tabindex]': 'disabled() ? -1 : 0',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.data-page]': 'page()',\n '[attr.data-selected]': 'selected() ? \"\" : null',\n '[attr.aria-current]': 'selected()',\n },\n})\nexport class NgpPaginationButton {\n /**\n * Access the pagination state.\n */\n protected readonly paginationState = injectPaginationState();\n\n /**\n * Define the page this button represents.\n */\n readonly page = input.required<number, NumberInput>({\n alias: 'ngpPaginationButtonPage',\n transform: numberAttribute,\n });\n\n /**\n * Whether the button is disabled.\n */\n readonly buttonDisabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpPaginationButtonDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the button is disabled.\n */\n readonly disabled = computed(() => this.buttonDisabled() || this.paginationState().disabled());\n\n /**\n * Whether this page is the currently selected page.\n */\n protected readonly selected = computed(() => this.page() === this.paginationState().page());\n\n constructor() {\n syncButton({ disabled: this.disabled });\n }\n\n /**\n * Go to the page this button represents.\n */\n @HostListener('click')\n goToPage(): void {\n if (this.disabled()) {\n return;\n }\n\n this.paginationState().goToPage(this.page());\n }\n\n /**\n * A click event may not be fired if this is on an anchor tag and the href is empty.\n * This is a workaround to ensure the click event is fired.\n */\n @HostListener('keydown.enter', ['$event'])\n @HostListener('keydown.space', ['$event'])\n protected onEnter(event: KeyboardEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.goToPage();\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, HostListener, input } from '@angular/core';\nimport { NgpButton, syncButton } from 'ng-primitives/button';\nimport { injectPaginationState } from '../pagination/pagination-state';\n\n/**\n * The `NgpPaginationFirst` directive is used to create a pagination button that navigates to the first page.\n */\n@Directive({\n selector: '[ngpPaginationFirst]',\n exportAs: 'ngpPaginationFirst',\n hostDirectives: [NgpButton],\n host: {\n '[tabindex]': 'disabled() ? -1 : 0',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.data-first-page]': 'paginationState().firstPage() ? \"\" : null',\n },\n})\nexport class NgpPaginationFirst {\n /**\n * Access the pagination state.\n */\n protected readonly paginationState = injectPaginationState();\n\n /**\n * Whether the button is disabled.\n */\n readonly buttonDisabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpPaginationFirstDisabled',\n transform: booleanAttribute,\n });\n\n readonly disabled = computed(\n () =>\n this.buttonDisabled() ||\n this.paginationState().disabled() ||\n this.paginationState().firstPage(),\n );\n\n constructor() {\n syncButton({ disabled: this.disabled });\n }\n /**\n * Go to the first page.\n */\n @HostListener('click')\n goToFirstPage() {\n if (this.disabled()) {\n return;\n }\n\n this.paginationState().goToPage(1);\n }\n\n /**\n * A click event may not be fired if this is on an anchor tag and the href is empty.\n * This is a workaround to ensure the click event is fired.\n */\n @HostListener('keydown.enter', ['$event'])\n @HostListener('keydown.space', ['$event'])\n protected onEnter(event: KeyboardEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.goToFirstPage();\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, HostListener, input } from '@angular/core';\nimport { NgpButton, syncButton } from 'ng-primitives/button';\nimport { injectPaginationState } from '../pagination/pagination-state';\n\n/**\n * The `NgpPaginationLast` directive is used to create a pagination button that navigates to the last page.\n */\n@Directive({\n selector: '[ngpPaginationLast]',\n exportAs: 'ngpPaginationLast',\n hostDirectives: [NgpButton],\n host: {\n '[tabindex]': 'disabled() ? -1 : 0',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.data-last-page]': 'paginationState().lastPage() ? \"\" : null',\n },\n})\nexport class NgpPaginationLast {\n /**\n * Access the pagination state.\n */\n private readonly paginationState = injectPaginationState();\n\n /**\n * Whether the button is disabled.\n */\n readonly buttonDisabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpPaginationLastDisabled',\n transform: booleanAttribute,\n });\n\n readonly disabled = computed(\n () =>\n this.buttonDisabled() ||\n this.paginationState().disabled() ||\n this.paginationState().lastPage(),\n );\n\n constructor() {\n syncButton({ disabled: this.disabled });\n }\n\n /**\n * Go to the last page.\n */\n @HostListener('click')\n goToLastPage(): void {\n if (this.disabled()) {\n return;\n }\n\n this.paginationState().goToPage(this.paginationState().pageCount());\n }\n\n /**\n * A click event may not be fired if this is on an anchor tag and the href is empty.\n * This is a workaround to ensure the click event is fired.\n */\n @HostListener('keydown.enter', ['$event'])\n @HostListener('keydown.space', ['$event'])\n protected onEnter(event: KeyboardEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.goToLastPage();\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, HostListener, input } from '@angular/core';\nimport { NgpButton, syncButton } from 'ng-primitives/button';\nimport { injectPaginationState } from '../pagination/pagination-state';\n\n/**\n * The `NgpPaginationNext` directive is used to create a pagination button that navigates to the next page.\n */\n@Directive({\n selector: '[ngpPaginationNext]',\n exportAs: 'ngpPaginationNext',\n hostDirectives: [NgpButton],\n host: {\n '[tabindex]': 'disabled() ? -1 : 0',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.data-last-page]': 'paginationState().lastPage() ? \"\" : null',\n },\n})\nexport class NgpPaginationNext {\n /**\n * Access the pagination state.\n */\n protected readonly paginationState = injectPaginationState();\n\n /**\n * Whether the button is disabled.\n */\n readonly buttonDisabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpPaginationNextDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the button is disabled.\n */\n readonly disabled = computed(\n () =>\n this.buttonDisabled() ||\n this.paginationState().disabled() ||\n this.paginationState().lastPage(),\n );\n\n constructor() {\n syncButton({ disabled: this.disabled });\n }\n\n /**\n * Go to the next page.\n */\n @HostListener('click')\n goToNextPage(): void {\n if (this.disabled()) {\n return;\n }\n\n this.paginationState().goToPage(this.paginationState().page() + 1);\n }\n\n /**\n * A click event may not be fired if this is on an anchor tag and the href is empty.\n * This is a workaround to ensure the click event is fired.\n */\n @HostListener('keydown.enter', ['$event'])\n @HostListener('keydown.space', ['$event'])\n protected onEnter(event: KeyboardEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.goToNextPage();\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, HostListener, input } from '@angular/core';\nimport { NgpButton, syncButton } from 'ng-primitives/button';\nimport { injectPaginationState } from '../pagination/pagination-state';\n\n/**\n * The `NgpPaginationPrevious` directive is used to create a pagination button that navigates to the previous page.\n */\n@Directive({\n selector: '[ngpPaginationPrevious]',\n exportAs: 'ngpPaginationPrevious',\n hostDirectives: [NgpButton],\n host: {\n '[tabindex]': 'disabled() ? -1 : 0',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.data-first-page]': 'paginationState().firstPage() ? \"\" : null',\n },\n})\nexport class NgpPaginationPrevious {\n /**\n * Access the pagination state.\n */\n protected readonly paginationState = injectPaginationState();\n\n /**\n * Whether the button is disabled.\n */\n readonly buttonDisabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpPaginationPreviousDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the button is disabled.\n */\n readonly disabled = computed(\n () =>\n this.buttonDisabled() ||\n this.paginationState().disabled() ||\n this.paginationState().firstPage(),\n );\n\n constructor() {\n syncButton({ disabled: this.disabled });\n }\n\n /**\n * Go to the previous page.\n */\n @HostListener('click')\n goToPreviousPage() {\n if (this.disabled()) {\n return;\n }\n\n this.paginationState().goToPage(this.paginationState().page() - 1);\n }\n\n /**\n * A click event may not be fired if this is on an anchor tag and the href is empty.\n * This is a workaround to ensure the click event is fired.\n */\n @HostListener('keydown.enter', ['$event'])\n @HostListener('keydown.space', ['$event'])\n protected onEnter(event: KeyboardEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.goToPreviousPage();\n }\n}\n","import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n input,\n numberAttribute,\n output,\n} from '@angular/core';\nimport { paginationState, providePaginationState } from './pagination-state';\n\n/**\n * The `NgpPagination` directive is used to create a pagination control.\n */\n@Directive({\n selector: '[ngpPagination]',\n exportAs: 'ngpPagination',\n providers: [providePaginationState()],\n host: {\n role: 'navigation',\n '[attr.data-page]': 'state.page()',\n '[attr.data-page-count]': 'state.pageCount()',\n '[attr.data-first-page]': 'firstPage() ? \"\" : null',\n '[attr.data-last-page]': 'lastPage() ? \"\" : null',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n },\n})\nexport class NgpPagination {\n /**\n * The currently selected page.\n */\n readonly page = input<number, NumberInput>(1, {\n alias: 'ngpPaginationPage',\n transform: numberAttribute,\n });\n\n /**\n * The event that is fired when the page changes.\n */\n readonly pageChange = output<number>({\n alias: 'ngpPaginationPageChange',\n });\n\n /**\n * The total number of pages.\n */\n readonly pageCount = input<number, NumberInput>(0, {\n alias: 'ngpPaginationPageCount',\n transform: numberAttribute,\n });\n\n /**\n * Whether the pagination is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpPaginationDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Determine if we are on the first page.\n * @internal\n */\n readonly firstPage = computed(() => this.state.page() === 1);\n\n /**\n * Determine if we are on the last page.\n * @internal\n */\n readonly lastPage = computed(() => this.state.page() === this.state.pageCount());\n\n /**\n * The control state for the pagination.\n * @internal\n */\n private readonly state = paginationState<NgpPagination>(this);\n\n /**\n * Go to the specified page.\n * @param page The page to go to.\n */\n goToPage(page: number) {\n // check if the page is within the bounds of the pagination\n if (page < 1 || page > this.state.pageCount()) {\n return;\n }\n\n this.state.page.set(page);\n this.pageChange.emit(page);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\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AA,EAAA,UAAA,EAAA,yBAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,YAAA,EAAA,EAAA,UAAA,EAAA,EAAA,gBAAA,EAAA,cAAA,EAAA,sBAAA,EAAA,mBAAA,EAAA,sBAAA,EAAA,2BAAA,EAAA,qBAAA,EAAA,0BAAA,EAAA,oBAAA,EAAA,gCAAA,EAAA,EAAA,EAAA,SAAA,EAAA,CAAC,sBAAsB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAU1B,aAAa,EAAA,UAAA,EAAA,CAAA;kBAbzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,SAAS,EAAE,CAAC,sBAAsB,EAAE,CAAC;AACrC,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,YAAY;AAClB,wBAAA,kBAAkB,EAAE,cAAc;AAClC,wBAAA,wBAAwB,EAAE,mBAAmB;AAC7C,wBAAA,wBAAwB,EAAE,yBAAyB;AACnD,wBAAA,uBAAuB,EAAE,wBAAwB;AACjD,wBAAA,sBAAsB,EAAE,8BAA8B;AACvD,qBAAA;AACF,iBAAA;;;AC1BD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-pagination.mjs","sources":["../../../../packages/ng-primitives/pagination/src/pagination/pagination-state.ts","../../../../packages/ng-primitives/pagination/src/pagination-button/pagination-button.ts","../../../../packages/ng-primitives/pagination/src/pagination-first/pagination-first.ts","../../../../packages/ng-primitives/pagination/src/pagination-last/pagination-last.ts","../../../../packages/ng-primitives/pagination/src/pagination-next/pagination-next.ts","../../../../packages/ng-primitives/pagination/src/pagination-previous/pagination-previous.ts","../../../../packages/ng-primitives/pagination/src/pagination/pagination.ts","../../../../packages/ng-primitives/pagination/src/ng-primitives-pagination.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpPagination } from './pagination';\n\n/**\n * The state token for the Pagination primitive.\n */\nexport const NgpPaginationStateToken = createStateToken<NgpPagination>('Pagination');\n\n/**\n * Provides the Pagination state.\n */\nexport const providePaginationState = createStateProvider(NgpPaginationStateToken);\n\n/**\n * Injects the Pagination state.\n */\nexport const injectPaginationState = createStateInjector(NgpPaginationStateToken);\n\n/**\n * The Pagination state registration function.\n */\nexport const paginationState = createState(NgpPaginationStateToken);\n","import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n HostListener,\n input,\n numberAttribute,\n} from '@angular/core';\nimport { NgpButton, syncButton } from 'ng-primitives/button';\nimport { injectPaginationState } from '../pagination/pagination-state';\n\n/**\n * The `NgpPaginationButton` directive is used to create a pagination button.\n */\n@Directive({\n selector: '[ngpPaginationButton]',\n exportAs: 'ngpPaginationButton',\n hostDirectives: [NgpButton],\n host: {\n '[tabindex]': 'disabled() ? -1 : 0',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.data-page]': 'page()',\n '[attr.data-selected]': 'selected() ? \"\" : null',\n '[attr.aria-current]': 'selected()',\n },\n})\nexport class NgpPaginationButton {\n /**\n * Access the pagination state.\n */\n protected readonly paginationState = injectPaginationState();\n\n /**\n * Define the page this button represents.\n */\n readonly page = input.required<number, NumberInput>({\n alias: 'ngpPaginationButtonPage',\n transform: numberAttribute,\n });\n\n /**\n * Whether the button is disabled.\n */\n readonly buttonDisabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpPaginationButtonDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the button is disabled.\n */\n readonly disabled = computed(() => this.buttonDisabled() || this.paginationState().disabled());\n\n /**\n * Whether this page is the currently selected page.\n */\n protected readonly selected = computed(() => this.page() === this.paginationState().page());\n\n constructor() {\n syncButton({ disabled: this.disabled });\n }\n\n /**\n * Go to the page this button represents.\n */\n @HostListener('click')\n goToPage(): void {\n if (this.disabled()) {\n return;\n }\n\n this.paginationState().goToPage(this.page());\n }\n\n /**\n * A click event may not be fired if this is on an anchor tag and the href is empty.\n * This is a workaround to ensure the click event is fired.\n */\n @HostListener('keydown.enter', ['$event'])\n @HostListener('keydown.space', ['$event'])\n protected onEnter(event: KeyboardEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.goToPage();\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, HostListener, input } from '@angular/core';\nimport { NgpButton, syncButton } from 'ng-primitives/button';\nimport { injectPaginationState } from '../pagination/pagination-state';\n\n/**\n * The `NgpPaginationFirst` directive is used to create a pagination button that navigates to the first page.\n */\n@Directive({\n selector: '[ngpPaginationFirst]',\n exportAs: 'ngpPaginationFirst',\n hostDirectives: [NgpButton],\n host: {\n '[tabindex]': 'disabled() ? -1 : 0',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.data-first-page]': 'paginationState().firstPage() ? \"\" : null',\n },\n})\nexport class NgpPaginationFirst {\n /**\n * Access the pagination state.\n */\n protected readonly paginationState = injectPaginationState();\n\n /**\n * Whether the button is disabled.\n */\n readonly buttonDisabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpPaginationFirstDisabled',\n transform: booleanAttribute,\n });\n\n readonly disabled = computed(\n () =>\n this.buttonDisabled() ||\n this.paginationState().disabled() ||\n this.paginationState().firstPage(),\n );\n\n constructor() {\n syncButton({ disabled: this.disabled });\n }\n /**\n * Go to the first page.\n */\n @HostListener('click')\n goToFirstPage() {\n if (this.disabled()) {\n return;\n }\n\n this.paginationState().goToPage(1);\n }\n\n /**\n * A click event may not be fired if this is on an anchor tag and the href is empty.\n * This is a workaround to ensure the click event is fired.\n */\n @HostListener('keydown.enter', ['$event'])\n @HostListener('keydown.space', ['$event'])\n protected onEnter(event: KeyboardEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.goToFirstPage();\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, HostListener, input } from '@angular/core';\nimport { NgpButton, syncButton } from 'ng-primitives/button';\nimport { injectPaginationState } from '../pagination/pagination-state';\n\n/**\n * The `NgpPaginationLast` directive is used to create a pagination button that navigates to the last page.\n */\n@Directive({\n selector: '[ngpPaginationLast]',\n exportAs: 'ngpPaginationLast',\n hostDirectives: [NgpButton],\n host: {\n '[tabindex]': 'disabled() ? -1 : 0',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.data-last-page]': 'paginationState().lastPage() ? \"\" : null',\n },\n})\nexport class NgpPaginationLast {\n /**\n * Access the pagination state.\n */\n private readonly paginationState = injectPaginationState();\n\n /**\n * Whether the button is disabled.\n */\n readonly buttonDisabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpPaginationLastDisabled',\n transform: booleanAttribute,\n });\n\n readonly disabled = computed(\n () =>\n this.buttonDisabled() ||\n this.paginationState().disabled() ||\n this.paginationState().lastPage(),\n );\n\n constructor() {\n syncButton({ disabled: this.disabled });\n }\n\n /**\n * Go to the last page.\n */\n @HostListener('click')\n goToLastPage(): void {\n if (this.disabled()) {\n return;\n }\n\n this.paginationState().goToPage(this.paginationState().pageCount());\n }\n\n /**\n * A click event may not be fired if this is on an anchor tag and the href is empty.\n * This is a workaround to ensure the click event is fired.\n */\n @HostListener('keydown.enter', ['$event'])\n @HostListener('keydown.space', ['$event'])\n protected onEnter(event: KeyboardEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.goToLastPage();\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, HostListener, input } from '@angular/core';\nimport { NgpButton, syncButton } from 'ng-primitives/button';\nimport { injectPaginationState } from '../pagination/pagination-state';\n\n/**\n * The `NgpPaginationNext` directive is used to create a pagination button that navigates to the next page.\n */\n@Directive({\n selector: '[ngpPaginationNext]',\n exportAs: 'ngpPaginationNext',\n hostDirectives: [NgpButton],\n host: {\n '[tabindex]': 'disabled() ? -1 : 0',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.data-last-page]': 'paginationState().lastPage() ? \"\" : null',\n },\n})\nexport class NgpPaginationNext {\n /**\n * Access the pagination state.\n */\n protected readonly paginationState = injectPaginationState();\n\n /**\n * Whether the button is disabled.\n */\n readonly buttonDisabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpPaginationNextDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the button is disabled.\n */\n readonly disabled = computed(\n () =>\n this.buttonDisabled() ||\n this.paginationState().disabled() ||\n this.paginationState().lastPage(),\n );\n\n constructor() {\n syncButton({ disabled: this.disabled });\n }\n\n /**\n * Go to the next page.\n */\n @HostListener('click')\n goToNextPage(): void {\n if (this.disabled()) {\n return;\n }\n\n this.paginationState().goToPage(this.paginationState().page() + 1);\n }\n\n /**\n * A click event may not be fired if this is on an anchor tag and the href is empty.\n * This is a workaround to ensure the click event is fired.\n */\n @HostListener('keydown.enter', ['$event'])\n @HostListener('keydown.space', ['$event'])\n protected onEnter(event: KeyboardEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.goToNextPage();\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, HostListener, input } from '@angular/core';\nimport { NgpButton, syncButton } from 'ng-primitives/button';\nimport { injectPaginationState } from '../pagination/pagination-state';\n\n/**\n * The `NgpPaginationPrevious` directive is used to create a pagination button that navigates to the previous page.\n */\n@Directive({\n selector: '[ngpPaginationPrevious]',\n exportAs: 'ngpPaginationPrevious',\n hostDirectives: [NgpButton],\n host: {\n '[tabindex]': 'disabled() ? -1 : 0',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.data-first-page]': 'paginationState().firstPage() ? \"\" : null',\n },\n})\nexport class NgpPaginationPrevious {\n /**\n * Access the pagination state.\n */\n protected readonly paginationState = injectPaginationState();\n\n /**\n * Whether the button is disabled.\n */\n readonly buttonDisabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpPaginationPreviousDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the button is disabled.\n */\n readonly disabled = computed(\n () =>\n this.buttonDisabled() ||\n this.paginationState().disabled() ||\n this.paginationState().firstPage(),\n );\n\n constructor() {\n syncButton({ disabled: this.disabled });\n }\n\n /**\n * Go to the previous page.\n */\n @HostListener('click')\n goToPreviousPage() {\n if (this.disabled()) {\n return;\n }\n\n this.paginationState().goToPage(this.paginationState().page() - 1);\n }\n\n /**\n * A click event may not be fired if this is on an anchor tag and the href is empty.\n * This is a workaround to ensure the click event is fired.\n */\n @HostListener('keydown.enter', ['$event'])\n @HostListener('keydown.space', ['$event'])\n protected onEnter(event: KeyboardEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.goToPreviousPage();\n }\n}\n","import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n input,\n numberAttribute,\n output,\n} from '@angular/core';\nimport { paginationState, providePaginationState } from './pagination-state';\n\n/**\n * The `NgpPagination` directive is used to create a pagination control.\n */\n@Directive({\n selector: '[ngpPagination]',\n exportAs: 'ngpPagination',\n providers: [providePaginationState()],\n host: {\n role: 'navigation',\n '[attr.data-page]': 'state.page()',\n '[attr.data-page-count]': 'state.pageCount()',\n '[attr.data-first-page]': 'firstPage() ? \"\" : null',\n '[attr.data-last-page]': 'lastPage() ? \"\" : null',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n },\n})\nexport class NgpPagination {\n /**\n * The currently selected page.\n */\n readonly page = input<number, NumberInput>(1, {\n alias: 'ngpPaginationPage',\n transform: numberAttribute,\n });\n\n /**\n * The event that is fired when the page changes.\n */\n readonly pageChange = output<number>({\n alias: 'ngpPaginationPageChange',\n });\n\n /**\n * The total number of pages.\n */\n readonly pageCount = input<number, NumberInput>(0, {\n alias: 'ngpPaginationPageCount',\n transform: numberAttribute,\n });\n\n /**\n * Whether the pagination is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpPaginationDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Determine if we are on the first page.\n * @internal\n */\n readonly firstPage = computed(() => this.state.page() === 1);\n\n /**\n * Determine if we are on the last page.\n * @internal\n */\n readonly lastPage = computed(() => this.state.page() === this.state.pageCount());\n\n /**\n * The control state for the pagination.\n * @internal\n */\n private readonly state = paginationState<NgpPagination>(this);\n\n /**\n * Go to the specified page.\n * @param page The page to go to.\n */\n goToPage(page: number) {\n // check if the page is within the bounds of the pagination\n if (page < 1 || page > this.state.pageCount()) {\n return;\n }\n\n this.state.page.set(page);\n this.pageChange.emit(page);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAQA;;AAEG;AACI,MAAM,uBAAuB,GAAG,gBAAgB,CAAgB,YAAY,CAAC;AAEpF;;AAEG;MACU,sBAAsB,GAAG,mBAAmB,CAAC,uBAAuB;AAEjF;;AAEG;MACU,qBAAqB,GAAG,mBAAmB,CAAC,uBAAuB;AAEhF;;AAEG;AACI,MAAM,eAAe,GAAG,WAAW,CAAC,uBAAuB,CAAC;;ACdnE;;AAEG;MAaU,mBAAmB,CAAA;AAgC9B,IAAA,WAAA,GAAA;AA/BA;;AAEG;QACgB,IAAe,CAAA,eAAA,GAAG,qBAAqB,EAAE;AAE5D;;AAEG;AACM,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAsB;AAClD,YAAA,KAAK,EAAE,yBAAyB;AAChC,YAAA,SAAS,EAAE,eAAe;AAC3B,SAAA,CAAC;AAEF;;AAEG;AACM,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CAAwB,KAAK,EAAE;AAC5D,YAAA,KAAK,EAAE,6BAA6B;AACpC,YAAA,SAAS,EAAE,gBAAgB;AAC5B,SAAA,CAAC;AAEF;;AAEG;AACM,QAAA,IAAA,CAA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yB;AACnD,wBAAA,uBAAuB,EAAE,wBAAwB;AACjD,wBAAA,sBAAsB,EAAE,8BAA8B;AACvD,qBAAA;AACF,iBAAA;;;AC1BD;;AAEG;;;;"}
|
|
@@ -434,10 +434,10 @@ class NgpPopoverTrigger {
|
|
|
434
434
|
setPopover(instance) {
|
|
435
435
|
this.popoverInstance = instance;
|
|
436
436
|
}
|
|
437
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
438
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.
|
|
437
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPopoverTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
438
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpPopoverTrigger, isStandalone: true, selector: "[ngpPopoverTrigger]", inputs: { popover: { classPropertyName: "popover", publicName: "ngpPopoverTrigger", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpPopoverTriggerDisabled", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "ngpPopoverTriggerPlacement", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "ngpPopoverTriggerOffset", isSignal: true, isRequired: false, transformFunction: null }, showDelay: { classPropertyName: "showDelay", publicName: "ngpPopoverTriggerShowDelay", isSignal: true, isRequired: false, transformFunction: null }, hideDelay: { classPropertyName: "hideDelay", publicName: "ngpPopoverTriggerHideDelay", isSignal: true, isRequired: false, transformFunction: null }, flip: { classPropertyName: "flip", publicName: "ngpPopoverTriggerFlip", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "ngpPopoverTriggerContainer", isSignal: true, isRequired: false, transformFunction: null }, closeOnOutsideClick: { classPropertyName: "closeOnOutsideClick", publicName: "ngpPopoverTriggerCloseOnOutsideClick", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "ngpPopoverTriggerCloseOnEscape", isSignal: true, isRequired: false, transformFunction: null }, scrollBehavior: { classPropertyName: "scrollBehavior", publicName: "ngpPopoverTriggerScrollBehavior", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "ngpPopoverTriggerContext", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "toggleOpenState($event)", "document:keydown.escape": "handleEscapeKey()" }, properties: { "attr.aria-expanded": "open() ? \"true\" : \"false\"", "attr.data-open": "open() ? \"\" : null", "attr.data-placement": "state.placement()" } }, providers: [providePopoverTriggerState({ inherit: false }), provideExitAnimationManager()], exportAs: ["ngpPopoverTrigger"], ngImport: i0 }); }
|
|
439
439
|
}
|
|
440
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
440
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPopoverTrigger, decorators: [{
|
|
441
441
|
type: Directive,
|
|
442
442
|
args: [{
|
|
443
443
|
selector: '[ngpPopoverTrigger]',
|
|
@@ -548,10 +548,10 @@ class NgpPopover {
|
|
|
548
548
|
disableFocusTrap() {
|
|
549
549
|
this.focusTrap().disabled.set(true);
|
|
550
550
|
}
|
|
551
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
552
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
551
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPopover, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
552
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpPopover, isStandalone: true, selector: "[ngpPopover]", host: { attributes: { "role": "menu" }, listeners: { "keydown.escape": "trigger().handleEscapeKey()" }, properties: { "style.left.px": "x()", "style.top.px": "y()", "style.--ngp-popover-trigger-width.px": "trigger().width()", "style.--ngp-popover-transform-origin": "transformOrigin()" } }, exportAs: ["ngpPopover"], hostDirectives: [{ directive: i1.NgpFocusTrap }, { directive: i2.NgpExitAnimation }], ngImport: i0 }); }
|
|
553
553
|
}
|
|
554
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
554
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPopover, decorators: [{
|
|
555
555
|
type: Directive,
|
|
556
556
|
args: [{
|
|
557
557
|
selector: '[ngpPopover]',
|