ng-primitives 0.36.0 → 0.37.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/accordion/accordion-trigger/accordion-trigger.d.ts +4 -0
- package/dialog/dialog-overlay/dialog-overlay.d.ts +7 -1
- package/dialog/dialog-trigger/dialog-trigger.d.ts +0 -2
- package/example-theme/index.css +2 -0
- package/fesm2022/ng-primitives-a11y.mjs +3 -3
- package/fesm2022/ng-primitives-accordion.mjs +18 -13
- package/fesm2022/ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/ng-primitives-autofill.mjs +4 -4
- package/fesm2022/ng-primitives-avatar.mjs +9 -9
- package/fesm2022/ng-primitives-button.mjs +3 -3
- package/fesm2022/ng-primitives-checkbox.mjs +4 -4
- package/fesm2022/ng-primitives-common.mjs +3 -3
- package/fesm2022/ng-primitives-date-picker.mjs +27 -27
- package/fesm2022/ng-primitives-dialog.mjs +30 -22
- package/fesm2022/ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/ng-primitives-file-upload.mjs +12 -8
- package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
- package/fesm2022/ng-primitives-focus-trap.mjs +31 -8
- package/fesm2022/ng-primitives-focus-trap.mjs.map +1 -1
- package/fesm2022/ng-primitives-form-field.mjs +15 -15
- package/fesm2022/ng-primitives-input.mjs +3 -3
- package/fesm2022/ng-primitives-interactions.mjs +15 -15
- package/fesm2022/ng-primitives-internal.mjs +20 -47
- package/fesm2022/ng-primitives-internal.mjs.map +1 -1
- package/fesm2022/ng-primitives-listbox.mjs +12 -12
- package/fesm2022/ng-primitives-menu.mjs +13 -13
- package/fesm2022/ng-primitives-meter.mjs +164 -0
- package/fesm2022/ng-primitives-meter.mjs.map +1 -0
- package/fesm2022/ng-primitives-pagination.mjs +19 -19
- package/fesm2022/ng-primitives-popover.mjs +25 -15
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-progress.mjs +6 -6
- package/fesm2022/ng-primitives-radio.mjs +9 -9
- package/fesm2022/ng-primitives-resize.mjs +3 -3
- package/fesm2022/ng-primitives-roving-focus.mjs +6 -6
- package/fesm2022/ng-primitives-search.mjs +7 -7
- package/fesm2022/ng-primitives-select.mjs +3 -3
- package/fesm2022/ng-primitives-separator.mjs +3 -3
- package/fesm2022/ng-primitives-slider.mjs +12 -12
- package/fesm2022/ng-primitives-switch.mjs +6 -6
- package/fesm2022/ng-primitives-tabs.mjs +21 -29
- package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/ng-primitives-textarea.mjs +3 -3
- package/fesm2022/ng-primitives-toast.mjs +3 -3
- package/fesm2022/ng-primitives-toggle-group.mjs +9 -14
- package/fesm2022/ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/ng-primitives-toggle.mjs +4 -4
- package/fesm2022/ng-primitives-toolbar.mjs +38 -14
- package/fesm2022/ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs +25 -19
- package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
- package/focus-trap/focus-trap/focus-trap-state.d.ts +41 -0
- package/focus-trap/focus-trap/focus-trap.d.ts +4 -0
- package/focus-trap/index.d.ts +1 -0
- package/form-field/form-control/form-control-state.d.ts +23 -23
- package/listbox/listbox/listbox-state.d.ts +2 -2
- package/meter/README.md +3 -0
- package/meter/index.d.ts +6 -0
- package/meter/meter/meter-state.d.ts +25 -0
- package/meter/meter/meter.d.ts +27 -0
- package/meter/meter-indicator/meter-indicator.d.ts +15 -0
- package/meter/meter-label/meter-label.d.ts +18 -0
- package/meter/meter-track/meter-track.d.ts +5 -0
- package/meter/meter-value/meter-value.d.ts +5 -0
- package/package.json +9 -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/popover/popover/popover.d.ts +31 -1
- package/progress/progress/progress-state.d.ts +2 -2
- package/progress/progress-indicator/progress-indicator.d.ts +2 -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/meter/meter.__fileSuffix@dasherize__.ts.template +78 -0
- package/schematics/ng-generate/templates/pagination/pagination.__fileSuffix@dasherize__.ts.template +11 -11
- package/schematics/ng-generate/templates/slider/slider.__fileSuffix@dasherize__.ts.template +8 -3
- package/schematics/ng-generate/templates/toolbar/toolbar.__fileSuffix@dasherize__.ts.template +10 -2
- package/slider/slider/slider-state.d.ts +4 -4
- 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 +7 -8
- package/tabs/tab-list/tab-list.d.ts +6 -7
- package/tabs/tab-panel/tab-panel.d.ts +11 -9
- package/tabs/tabset/tabset-state.d.ts +6 -7
- package/tabs/tabset/tabset.d.ts +3 -4
- package/toggle-group/toggle-group/toggle-group-state.d.ts +6 -6
- package/toggle-group/toggle-group/toggle-group.d.ts +1 -1
- package/toggle-group/toggle-group-item/toggle-group-item-state.d.ts +12 -12
- package/toolbar/index.d.ts +1 -0
- package/toolbar/toolbar/toolbar-state.d.ts +39 -0
- package/toolbar/toolbar/toolbar.d.ts +10 -1
- package/tooltip/tooltip-trigger/tooltip-trigger.d.ts +6 -1
|
@@ -125,10 +125,10 @@ class NgpListboxOption {
|
|
|
125
125
|
}
|
|
126
126
|
this.listbox()?.activateOption(this.value());
|
|
127
127
|
}
|
|
128
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
129
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.
|
|
128
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpListboxOption, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
129
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: NgpListboxOption, isStandalone: true, selector: "[ngpListboxOption]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "ngpListboxOptionValue", isSignal: true, isRequired: true, transformFunction: null }, optionDisabled: { classPropertyName: "optionDisabled", publicName: "ngpListboxOptionDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "option" }, listeners: { "click": "select(\"mouse\")", "mouseenter": "activate()", "keydown.enter": "select(\"keyboard\")", "keydown.space": "select(\"keyboard\")" }, properties: { "attr.id": "id()", "attr.aria-disabled": "optionDisabled()", "attr.data-active": "listbox()?.isFocused() && active() ? \"\" : undefined", "attr.data-selected": "selected() ? \"\" : undefined", "attr.data-disabled": "optionDisabled() ? \"\" : undefined" } }, exportAs: ["ngpListboxOption"], ngImport: i0 }); }
|
|
130
130
|
}
|
|
131
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
131
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpListboxOption, decorators: [{
|
|
132
132
|
type: Directive,
|
|
133
133
|
args: [{
|
|
134
134
|
selector: '[ngpListboxOption]',
|
|
@@ -155,10 +155,10 @@ class NgpListboxSection {
|
|
|
155
155
|
*/
|
|
156
156
|
this.header = contentChild(NgpHeaderToken, { descendants: true });
|
|
157
157
|
}
|
|
158
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
159
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.
|
|
158
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpListboxSection, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
159
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.2.8", type: NgpListboxSection, isStandalone: true, selector: "[ngpListboxSection]", host: { attributes: { "role": "group" }, properties: { "attr.aria-labelledby": "header()?.id()" } }, queries: [{ propertyName: "header", first: true, predicate: NgpHeaderToken, descendants: true, isSignal: true }], exportAs: ["ngpListboxSection"], ngImport: i0 }); }
|
|
160
160
|
}
|
|
161
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
161
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpListboxSection, decorators: [{
|
|
162
162
|
type: Directive,
|
|
163
163
|
args: [{
|
|
164
164
|
selector: '[ngpListboxSection]',
|
|
@@ -186,10 +186,10 @@ class NgpListboxTrigger {
|
|
|
186
186
|
event.preventDefault();
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
190
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.
|
|
189
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpListboxTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
190
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: NgpListboxTrigger, isStandalone: true, selector: "[ngpListboxTrigger]", host: { listeners: { "keydown": "openPopover($event)" } }, exportAs: ["ngpListboxTrigger"], ngImport: i0 }); }
|
|
191
191
|
}
|
|
192
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
192
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpListboxTrigger, decorators: [{
|
|
193
193
|
type: Directive,
|
|
194
194
|
args: [{
|
|
195
195
|
selector: '[ngpListboxTrigger]',
|
|
@@ -377,10 +377,10 @@ class NgpListbox {
|
|
|
377
377
|
removeOption(option) {
|
|
378
378
|
this.options.update(options => options.filter(o => o !== option));
|
|
379
379
|
}
|
|
380
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
381
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.
|
|
380
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpListbox, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
381
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: NgpListbox, isStandalone: true, selector: "[ngpListbox]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "ngpListboxMode", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "ngpListboxValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpListboxDisabled", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "ngpListboxCompareWith", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "ngpListboxValueChange" }, host: { attributes: { "role": "listbox" }, listeners: { "focusin": "isFocused.set(true)", "focusout": "isFocused.set(false)", "keydown": "onKeydown($event)" }, properties: { "id": "state.id()", "attr.tabindex": "tabindex()", "attr.aria-disabled": "state.disabled()", "attr.aria-multiselectable": "state.mode() === \"multiple\"", "attr.aria-activedescendant": "activeDescendant()" } }, providers: [provideListboxState()], exportAs: ["ngpListbox"], ngImport: i0 }); }
|
|
382
382
|
}
|
|
383
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
383
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpListbox, decorators: [{
|
|
384
384
|
type: Directive,
|
|
385
385
|
args: [{
|
|
386
386
|
selector: '[ngpListbox]',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject,
|
|
2
|
+
import { InjectionToken, inject, HostListener, Directive, Injector } from '@angular/core';
|
|
3
3
|
import * as i1$1 from 'ng-primitives/button';
|
|
4
4
|
import { NgpButton } from 'ng-primitives/button';
|
|
5
5
|
import { injectElementRef } from 'ng-primitives/internal';
|
|
@@ -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.
|
|
86
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.
|
|
85
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpSubmenuTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
86
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", 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.
|
|
88
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", 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.
|
|
161
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.
|
|
160
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpMenuItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
161
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", 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.
|
|
163
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", 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.
|
|
206
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.
|
|
205
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpMenuTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
206
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", 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.
|
|
208
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", 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.
|
|
254
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.
|
|
253
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpMenu, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
254
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", 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.
|
|
260
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpMenu, decorators: [{
|
|
261
261
|
type: Directive,
|
|
262
262
|
args: [{
|
|
263
263
|
selector: '[ngpMenu]',
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, numberAttribute, signal, computed, Directive } from '@angular/core';
|
|
3
|
+
import { createStateToken, createStateProvider, createStateInjector, createState } from 'ng-primitives/state';
|
|
4
|
+
import { uniqueId } from 'ng-primitives/utils';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The state token for the Meter primitive.
|
|
8
|
+
*/
|
|
9
|
+
const NgpMeterStateToken = createStateToken('Meter');
|
|
10
|
+
/**
|
|
11
|
+
* Provides the Meter state.
|
|
12
|
+
*/
|
|
13
|
+
const provideMeterState = createStateProvider(NgpMeterStateToken);
|
|
14
|
+
/**
|
|
15
|
+
* Injects the Meter state.
|
|
16
|
+
*/
|
|
17
|
+
const injectMeterState = createStateInjector(NgpMeterStateToken);
|
|
18
|
+
/**
|
|
19
|
+
* The Meter state registration function.
|
|
20
|
+
*/
|
|
21
|
+
const meterState = createState(NgpMeterStateToken);
|
|
22
|
+
|
|
23
|
+
class NgpMeter {
|
|
24
|
+
constructor() {
|
|
25
|
+
/** The value of the meter. */
|
|
26
|
+
this.value = input(0, {
|
|
27
|
+
alias: 'ngpMeterValue',
|
|
28
|
+
transform: numberAttribute,
|
|
29
|
+
});
|
|
30
|
+
/** The minimum value of the meter. */
|
|
31
|
+
this.min = input(0, {
|
|
32
|
+
alias: 'ngpMeterMin',
|
|
33
|
+
transform: numberAttribute,
|
|
34
|
+
});
|
|
35
|
+
/** The maximum value of the meter. */
|
|
36
|
+
this.max = input(100, {
|
|
37
|
+
alias: 'ngpMeterMax',
|
|
38
|
+
transform: numberAttribute,
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* Define a function that returns the meter value label.
|
|
42
|
+
* @param value The current value
|
|
43
|
+
* @param max The maximum value
|
|
44
|
+
* @returns The value label
|
|
45
|
+
*/
|
|
46
|
+
this.valueLabel = input((value, max) => `${Math.round((value / max) * 100)}%`, {
|
|
47
|
+
alias: 'ngpMeterValueLabel',
|
|
48
|
+
});
|
|
49
|
+
/** @internal Store the label instance */
|
|
50
|
+
this.label = signal(null);
|
|
51
|
+
/** @internal The percentage of the meter. */
|
|
52
|
+
this.percentage = computed(() => {
|
|
53
|
+
const value = this.state.value();
|
|
54
|
+
const min = this.state.min();
|
|
55
|
+
const max = this.state.max();
|
|
56
|
+
if (value == null) {
|
|
57
|
+
return 0;
|
|
58
|
+
}
|
|
59
|
+
if (value < min) {
|
|
60
|
+
return 0;
|
|
61
|
+
}
|
|
62
|
+
if (value > max) {
|
|
63
|
+
return 100;
|
|
64
|
+
}
|
|
65
|
+
return ((value - min) / (max - min)) * 100;
|
|
66
|
+
});
|
|
67
|
+
/** The state of the meter. */
|
|
68
|
+
this.state = meterState(this);
|
|
69
|
+
}
|
|
70
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpMeter, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
71
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", 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
|
+
}
|
|
73
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpMeter, decorators: [{
|
|
74
|
+
type: Directive,
|
|
75
|
+
args: [{
|
|
76
|
+
selector: '[ngpMeter]',
|
|
77
|
+
exportAs: 'ngpMeter',
|
|
78
|
+
providers: [provideMeterState()],
|
|
79
|
+
host: {
|
|
80
|
+
role: 'meter',
|
|
81
|
+
'[attr.aria-valuenow]': 'percentage()',
|
|
82
|
+
'[attr.aria-valuemin]': 'min()',
|
|
83
|
+
'[attr.aria-valuemax]': 'max()',
|
|
84
|
+
'[attr.aria-valuetext]': 'valueLabel()(value(), max())',
|
|
85
|
+
'[attr.aria-labelledby]': 'label()?.id()',
|
|
86
|
+
},
|
|
87
|
+
}]
|
|
88
|
+
}] });
|
|
89
|
+
|
|
90
|
+
class NgpMeterTrack {
|
|
91
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpMeterTrack, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
92
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: NgpMeterTrack, isStandalone: true, selector: "[ngpMeterTrack]", exportAs: ["ngpMeterTrack"], ngImport: i0 }); }
|
|
93
|
+
}
|
|
94
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpMeterTrack, decorators: [{
|
|
95
|
+
type: Directive,
|
|
96
|
+
args: [{
|
|
97
|
+
selector: '[ngpMeterTrack]',
|
|
98
|
+
exportAs: 'ngpMeterTrack',
|
|
99
|
+
}]
|
|
100
|
+
}] });
|
|
101
|
+
|
|
102
|
+
class NgpMeterIndicator {
|
|
103
|
+
constructor() {
|
|
104
|
+
/** Access the meter */
|
|
105
|
+
this.meter = injectMeterState();
|
|
106
|
+
}
|
|
107
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpMeterIndicator, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
108
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: NgpMeterIndicator, isStandalone: true, selector: "[ngpMeterIndicator]", host: { properties: { "style.width.%": "meter().percentage()" } }, exportAs: ["ngpMeterIndicator"], ngImport: i0 }); }
|
|
109
|
+
}
|
|
110
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpMeterIndicator, decorators: [{
|
|
111
|
+
type: Directive,
|
|
112
|
+
args: [{
|
|
113
|
+
selector: '[ngpMeterIndicator]',
|
|
114
|
+
exportAs: 'ngpMeterIndicator',
|
|
115
|
+
host: {
|
|
116
|
+
'[style.width.%]': 'meter().percentage()',
|
|
117
|
+
},
|
|
118
|
+
}]
|
|
119
|
+
}] });
|
|
120
|
+
|
|
121
|
+
class NgpMeterValue {
|
|
122
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpMeterValue, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
123
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: NgpMeterValue, isStandalone: true, selector: "[ngpMeterValue]", host: { attributes: { "aria-hidden": "true" } }, exportAs: ["ngpMeterValue"], ngImport: i0 }); }
|
|
124
|
+
}
|
|
125
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpMeterValue, decorators: [{
|
|
126
|
+
type: Directive,
|
|
127
|
+
args: [{
|
|
128
|
+
selector: '[ngpMeterValue]',
|
|
129
|
+
exportAs: 'ngpMeterValue',
|
|
130
|
+
host: {
|
|
131
|
+
'aria-hidden': 'true',
|
|
132
|
+
},
|
|
133
|
+
}]
|
|
134
|
+
}] });
|
|
135
|
+
|
|
136
|
+
class NgpMeterLabel {
|
|
137
|
+
constructor() {
|
|
138
|
+
/** Access the meter */
|
|
139
|
+
this.meter = injectMeterState();
|
|
140
|
+
/** The id of the meter label */
|
|
141
|
+
this.id = input(uniqueId('ngp-meter-label'));
|
|
142
|
+
// Register the label with the meter
|
|
143
|
+
this.meter().label.set(this);
|
|
144
|
+
}
|
|
145
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpMeterLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
146
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", 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
|
+
}
|
|
148
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpMeterLabel, decorators: [{
|
|
149
|
+
type: Directive,
|
|
150
|
+
args: [{
|
|
151
|
+
selector: '[ngpMeterLabel]',
|
|
152
|
+
exportAs: 'ngpMeterLabel',
|
|
153
|
+
host: {
|
|
154
|
+
'[attr.id]': 'id()',
|
|
155
|
+
},
|
|
156
|
+
}]
|
|
157
|
+
}], ctorParameters: () => [] });
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Generated bundle index. Do not edit.
|
|
161
|
+
*/
|
|
162
|
+
|
|
163
|
+
export { NgpMeter, NgpMeterIndicator, NgpMeterLabel, NgpMeterTrack, NgpMeterValue, injectMeterState, provideMeterState };
|
|
164
|
+
//# sourceMappingURL=ng-primitives-meter.mjs.map
|
|
@@ -0,0 +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,IA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AAK,CAAC,GAAG,CAAC,IAAI,CAAC;;8GATnB,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,EAAA,EAAA,EAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,SAAA,EAAA,MAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBAPzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,IAAI,EAAE;AACJ,wBAAA,WAAW,EAAE,MAAM;AACpB,qBAAA;AACF,iBAAA;;;ACVD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, numberAttribute, booleanAttribute, computed,
|
|
2
|
+
import { input, numberAttribute, booleanAttribute, computed, HostListener, Directive, output } from '@angular/core';
|
|
3
3
|
import * as i1 from 'ng-primitives/button';
|
|
4
4
|
import { syncButton, NgpButton } from 'ng-primitives/button';
|
|
5
5
|
import { createStateToken, createStateProvider, createStateInjector, createState } from 'ng-primitives/state';
|
|
@@ -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.
|
|
76
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.
|
|
75
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpPaginationButton, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
76
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", 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.
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", 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.
|
|
143
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.
|
|
142
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpPaginationFirst, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
143
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", 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.
|
|
145
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", 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.
|
|
208
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.
|
|
207
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpPaginationLast, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
208
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", 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.
|
|
210
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", 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.
|
|
276
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.
|
|
275
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpPaginationNext, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
276
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", 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.
|
|
278
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", 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.
|
|
344
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.
|
|
343
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpPaginationPrevious, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
344
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", 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.
|
|
346
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", 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.
|
|
430
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.
|
|
429
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpPagination, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
430
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", 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.
|
|
432
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpPagination, decorators: [{
|
|
433
433
|
type: Directive,
|
|
434
434
|
args: [{
|
|
435
435
|
selector: '[ngpPagination]',
|
|
@@ -12,7 +12,7 @@ import { fromResizeEvent } from 'ng-primitives/resize';
|
|
|
12
12
|
import { injectDisposables } from 'ng-primitives/utils';
|
|
13
13
|
import { createStateToken, createStateProvider, createStateInjector, createState } from 'ng-primitives/state';
|
|
14
14
|
import * as i1 from 'ng-primitives/focus-trap';
|
|
15
|
-
import { NgpFocusTrap } from 'ng-primitives/focus-trap';
|
|
15
|
+
import { injectFocusTrapState, NgpFocusTrap } from 'ng-primitives/focus-trap';
|
|
16
16
|
|
|
17
17
|
const defaultPopoverConfig = {
|
|
18
18
|
offset: 4,
|
|
@@ -330,11 +330,14 @@ class NgpPopoverTrigger {
|
|
|
330
330
|
for (const child of this.stack) {
|
|
331
331
|
child.hide(origin);
|
|
332
332
|
}
|
|
333
|
+
// disable the focus trap in the popover to prevent it trying to return focus to the popover
|
|
334
|
+
// when the popover is closed/closing
|
|
335
|
+
this.popoverInstance?.focusTrap().disabled.set(true);
|
|
336
|
+
// ensure the trigger is focused after closing the popover
|
|
337
|
+
this.focusTrigger(origin);
|
|
333
338
|
this.closeTimeout = this.disposables.setTimeout(async () => {
|
|
334
339
|
this.closeTimeout = undefined;
|
|
335
340
|
await this.destroyPopover();
|
|
336
|
-
// ensure the trigger is focused after closing the popover
|
|
337
|
-
this.disposables.setTimeout(() => this.focusTrigger(origin), 0);
|
|
338
341
|
}, this.state.hideDelay());
|
|
339
342
|
}
|
|
340
343
|
onDocumentClick(event) {
|
|
@@ -403,15 +406,17 @@ class NgpPopoverTrigger {
|
|
|
403
406
|
async destroyPopover() {
|
|
404
407
|
// clear the close timeout
|
|
405
408
|
this.closeTimeout = undefined;
|
|
406
|
-
await this.exitAnimationState.exit();
|
|
407
409
|
const viewRef = this.viewRef();
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
if (viewRef && !isDestroyed) {
|
|
411
|
-
// destroy the view ref
|
|
412
|
-
viewRef.destroy();
|
|
410
|
+
if (!viewRef) {
|
|
411
|
+
return;
|
|
413
412
|
}
|
|
413
|
+
// we remove this to prevent the popover from being destroyed twice
|
|
414
|
+
// because ngOnDestroy will be called on the viewRef
|
|
415
|
+
// when the popover is destroyed triggering this method again
|
|
414
416
|
this.viewRef.set(null);
|
|
417
|
+
await this.exitAnimationState.exit();
|
|
418
|
+
// destroy the view ref
|
|
419
|
+
viewRef.destroy();
|
|
415
420
|
this.dispose?.();
|
|
416
421
|
// deactivate the scroll strategy
|
|
417
422
|
this.scrollStrategy().disable();
|
|
@@ -439,10 +444,10 @@ class NgpPopoverTrigger {
|
|
|
439
444
|
setPopover(instance) {
|
|
440
445
|
this.popoverInstance = instance;
|
|
441
446
|
}
|
|
442
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
443
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.
|
|
447
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpPopoverTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
448
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", 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()", "attr.data-disabled": "state.disabled() ? \"\" : null" } }, providers: [providePopoverTriggerState({ inherit: false }), provideExitAnimationManager()], exportAs: ["ngpPopoverTrigger"], ngImport: i0 }); }
|
|
444
449
|
}
|
|
445
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
450
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpPopoverTrigger, decorators: [{
|
|
446
451
|
type: Directive,
|
|
447
452
|
args: [{
|
|
448
453
|
selector: '[ngpPopoverTrigger]',
|
|
@@ -504,6 +509,11 @@ class NgpPopover {
|
|
|
504
509
|
* Access the focus monitor.
|
|
505
510
|
*/
|
|
506
511
|
this.focusMonitor = inject(FocusMonitor);
|
|
512
|
+
/**
|
|
513
|
+
* Access the focus trap.
|
|
514
|
+
* @internal
|
|
515
|
+
*/
|
|
516
|
+
this.focusTrap = injectFocusTrapState();
|
|
507
517
|
/**
|
|
508
518
|
* Access the trigger instance.
|
|
509
519
|
*/
|
|
@@ -543,10 +553,10 @@ class NgpPopover {
|
|
|
543
553
|
this.popover.nativeElement.focus();
|
|
544
554
|
}
|
|
545
555
|
}
|
|
546
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
547
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.
|
|
556
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpPopover, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
557
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", 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 }); }
|
|
548
558
|
}
|
|
549
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
559
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpPopover, decorators: [{
|
|
550
560
|
type: Directive,
|
|
551
561
|
args: [{
|
|
552
562
|
selector: '[ngpPopover]',
|