ng-primitives 0.120.5 → 0.121.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/fesm2022/ng-primitives-a11y.mjs +5 -5
- package/fesm2022/ng-primitives-a11y.mjs.map +1 -1
- package/fesm2022/ng-primitives-accordion.mjs +30 -47
- package/fesm2022/ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/ng-primitives-ai.mjs +39 -52
- package/fesm2022/ng-primitives-ai.mjs.map +1 -1
- package/fesm2022/ng-primitives-autofill.mjs +4 -4
- package/fesm2022/ng-primitives-autofill.mjs.map +1 -1
- package/fesm2022/ng-primitives-avatar.mjs +14 -17
- package/fesm2022/ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/ng-primitives-breadcrumbs.mjs +21 -21
- package/fesm2022/ng-primitives-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ng-primitives-button.mjs +7 -9
- package/fesm2022/ng-primitives-button.mjs.map +1 -1
- package/fesm2022/ng-primitives-checkbox.mjs +15 -30
- package/fesm2022/ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/ng-primitives-combobox.mjs +60 -92
- package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/ng-primitives-common.mjs +4 -4
- package/fesm2022/ng-primitives-common.mjs.map +1 -1
- package/fesm2022/ng-primitives-context-menu.mjs +66 -119
- package/fesm2022/ng-primitives-context-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-date-picker.mjs +70 -108
- package/fesm2022/ng-primitives-date-picker.mjs.map +1 -1
- package/fesm2022/ng-primitives-dialog.mjs +33 -49
- package/fesm2022/ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/ng-primitives-file-upload.mjs +26 -53
- package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
- package/fesm2022/ng-primitives-focus-trap.mjs +5 -8
- package/fesm2022/ng-primitives-focus-trap.mjs.map +1 -1
- package/fesm2022/ng-primitives-form-field.mjs +39 -44
- package/fesm2022/ng-primitives-form-field.mjs.map +1 -1
- package/fesm2022/ng-primitives-input-otp.mjs +30 -43
- package/fesm2022/ng-primitives-input-otp.mjs.map +1 -1
- package/fesm2022/ng-primitives-input.mjs +6 -8
- package/fesm2022/ng-primitives-input.mjs.map +1 -1
- package/fesm2022/ng-primitives-interactions.mjs +31 -48
- 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 +34 -48
- package/fesm2022/ng-primitives-listbox.mjs.map +1 -1
- package/fesm2022/ng-primitives-menu.mjs +83 -149
- package/fesm2022/ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-meter.mjs +25 -36
- package/fesm2022/ng-primitives-meter.mjs.map +1 -1
- package/fesm2022/ng-primitives-navigation-menu.mjs +60 -108
- package/fesm2022/ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-number-field.mjs +35 -59
- package/fesm2022/ng-primitives-number-field.mjs.map +1 -1
- package/fesm2022/ng-primitives-pagination.mjs +270 -297
- package/fesm2022/ng-primitives-pagination.mjs.map +1 -1
- package/fesm2022/ng-primitives-popover.mjs +42 -87
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-portal.mjs +81 -57
- package/fesm2022/ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/ng-primitives-progress.mjs +30 -41
- package/fesm2022/ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/ng-primitives-radio.mjs +20 -30
- package/fesm2022/ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/ng-primitives-resize.mjs +3 -3
- package/fesm2022/ng-primitives-resize.mjs.map +1 -1
- package/fesm2022/ng-primitives-roving-focus.mjs +20 -34
- package/fesm2022/ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/ng-primitives-search.mjs +9 -9
- package/fesm2022/ng-primitives-search.mjs.map +1 -1
- package/fesm2022/ng-primitives-select.mjs +50 -81
- package/fesm2022/ng-primitives-select.mjs.map +1 -1
- package/fesm2022/ng-primitives-separator.mjs +4 -6
- package/fesm2022/ng-primitives-separator.mjs.map +1 -1
- package/fesm2022/ng-primitives-slider.mjs +63 -100
- package/fesm2022/ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/ng-primitives-state.mjs +3 -3
- package/fesm2022/ng-primitives-state.mjs.map +1 -1
- package/fesm2022/ng-primitives-switch.mjs +15 -21
- package/fesm2022/ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/ng-primitives-tabs.mjs +31 -41
- 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 +19 -19
- package/fesm2022/ng-primitives-toast.mjs.map +1 -1
- package/fesm2022/ng-primitives-toggle-group.mjs +20 -36
- package/fesm2022/ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/ng-primitives-toggle.mjs +10 -19
- package/fesm2022/ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/ng-primitives-toolbar.mjs +4 -6
- package/fesm2022/ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs +401 -402
- package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
- package/fesm2022/ng-primitives-utils.mjs +5 -4
- package/fesm2022/ng-primitives-utils.mjs.map +1 -1
- package/package.json +56 -55
- package/{a11y/index.d.ts → types/ng-primitives-a11y.d.ts} +15 -14
- package/{accordion/index.d.ts → types/ng-primitives-accordion.d.ts} +78 -77
- package/{button/index.d.ts → types/ng-primitives-button.d.ts} +21 -20
- package/{checkbox/index.d.ts → types/ng-primitives-checkbox.d.ts} +67 -66
- package/{combobox/index.d.ts → types/ng-primitives-combobox.d.ts} +35 -35
- package/{date-picker/index.d.ts → types/ng-primitives-date-picker.d.ts} +2 -2
- package/{number-field/index.d.ts → types/ng-primitives-number-field.d.ts} +72 -71
- package/types/ng-primitives-pagination.d.ts +502 -0
- package/{popover/index.d.ts → types/ng-primitives-popover.d.ts} +3 -2
- package/{portal/index.d.ts → types/ng-primitives-portal.d.ts} +19 -3
- package/{roving-focus/index.d.ts → types/ng-primitives-roving-focus.d.ts} +61 -60
- package/{select/index.d.ts → types/ng-primitives-select.d.ts} +39 -38
- package/{slider/index.d.ts → types/ng-primitives-slider.d.ts} +59 -58
- package/{switch/index.d.ts → types/ng-primitives-switch.d.ts} +45 -44
- package/{toast/index.d.ts → types/ng-primitives-toast.d.ts} +2 -1
- package/{toggle-group/index.d.ts → types/ng-primitives-toggle-group.d.ts} +69 -68
- package/{toggle/index.d.ts → types/ng-primitives-toggle.d.ts} +48 -47
- package/types/ng-primitives-tooltip.d.ts +691 -0
- package/pagination/index.d.ts +0 -211
- package/tooltip/index.d.ts +0 -376
- /package/{ai/index.d.ts → types/ng-primitives-ai.d.ts} +0 -0
- /package/{autofill/index.d.ts → types/ng-primitives-autofill.d.ts} +0 -0
- /package/{avatar/index.d.ts → types/ng-primitives-avatar.d.ts} +0 -0
- /package/{breadcrumbs/index.d.ts → types/ng-primitives-breadcrumbs.d.ts} +0 -0
- /package/{common/index.d.ts → types/ng-primitives-common.d.ts} +0 -0
- /package/{context-menu/index.d.ts → types/ng-primitives-context-menu.d.ts} +0 -0
- /package/{date-time-luxon/index.d.ts → types/ng-primitives-date-time-luxon.d.ts} +0 -0
- /package/{date-time/index.d.ts → types/ng-primitives-date-time.d.ts} +0 -0
- /package/{dialog/index.d.ts → types/ng-primitives-dialog.d.ts} +0 -0
- /package/{file-upload/index.d.ts → types/ng-primitives-file-upload.d.ts} +0 -0
- /package/{focus-trap/index.d.ts → types/ng-primitives-focus-trap.d.ts} +0 -0
- /package/{form-field/index.d.ts → types/ng-primitives-form-field.d.ts} +0 -0
- /package/{input-otp/index.d.ts → types/ng-primitives-input-otp.d.ts} +0 -0
- /package/{input/index.d.ts → types/ng-primitives-input.d.ts} +0 -0
- /package/{interactions/index.d.ts → types/ng-primitives-interactions.d.ts} +0 -0
- /package/{internal/index.d.ts → types/ng-primitives-internal.d.ts} +0 -0
- /package/{listbox/index.d.ts → types/ng-primitives-listbox.d.ts} +0 -0
- /package/{menu/index.d.ts → types/ng-primitives-menu.d.ts} +0 -0
- /package/{meter/index.d.ts → types/ng-primitives-meter.d.ts} +0 -0
- /package/{navigation-menu/index.d.ts → types/ng-primitives-navigation-menu.d.ts} +0 -0
- /package/{progress/index.d.ts → types/ng-primitives-progress.d.ts} +0 -0
- /package/{radio/index.d.ts → types/ng-primitives-radio.d.ts} +0 -0
- /package/{resize/index.d.ts → types/ng-primitives-resize.d.ts} +0 -0
- /package/{search/index.d.ts → types/ng-primitives-search.d.ts} +0 -0
- /package/{separator/index.d.ts → types/ng-primitives-separator.d.ts} +0 -0
- /package/{state/index.d.ts → types/ng-primitives-state.d.ts} +0 -0
- /package/{tabs/index.d.ts → types/ng-primitives-tabs.d.ts} +0 -0
- /package/{textarea/index.d.ts → types/ng-primitives-textarea.d.ts} +0 -0
- /package/{toolbar/index.d.ts → types/ng-primitives-toolbar.d.ts} +0 -0
- /package/{utils/index.d.ts → types/ng-primitives-utils.d.ts} +0 -0
- /package/{index.d.ts → types/ng-primitives.d.ts} +0 -0
|
@@ -4,8 +4,8 @@ import { ngpInteractions } from 'ng-primitives/interactions';
|
|
|
4
4
|
import { injectElementRef, observeResize, scrollIntoViewIfNeeded, domSort } from 'ng-primitives/internal';
|
|
5
5
|
import { uniqueId } from 'ng-primitives/utils';
|
|
6
6
|
import { createStateToken, createStateProvider, createStateInjector, createState } from 'ng-primitives/state';
|
|
7
|
+
import { provideControlContainerIsolation, createOverlay, coerceFlip, coerceOffset } from 'ng-primitives/portal';
|
|
7
8
|
import { ngpFormControl } from 'ng-primitives/form-field';
|
|
8
|
-
import { createOverlay, coerceFlip, coerceOffset } from 'ng-primitives/portal';
|
|
9
9
|
import { activeDescendantManager } from 'ng-primitives/a11y';
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -35,9 +35,9 @@ class NgpComboboxButton {
|
|
|
35
35
|
*/
|
|
36
36
|
this.elementRef = injectElementRef();
|
|
37
37
|
/** The id of the button. */
|
|
38
|
-
this.id = input(uniqueId('ngp-combobox-button'), ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
38
|
+
this.id = input(uniqueId('ngp-combobox-button'), ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
39
39
|
/** The id of the dropdown. */
|
|
40
|
-
this.dropdownId = computed(() => this.state().dropdown()?.id(), ...(ngDevMode ? [{ debugName: "dropdownId" }] : []));
|
|
40
|
+
this.dropdownId = computed(() => this.state().dropdown()?.id(), ...(ngDevMode ? [{ debugName: "dropdownId" }] : /* istanbul ignore next */ []));
|
|
41
41
|
ngpInteractions({
|
|
42
42
|
hover: true,
|
|
43
43
|
press: true,
|
|
@@ -49,10 +49,10 @@ class NgpComboboxButton {
|
|
|
49
49
|
await this.state().toggleDropdown();
|
|
50
50
|
this.state().input()?.focus();
|
|
51
51
|
}
|
|
52
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
53
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
52
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpComboboxButton, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
53
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.14", type: NgpComboboxButton, isStandalone: true, selector: "button[ngpComboboxButton]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button", "tabindex": "-1", "aria-haspopup": "listbox" }, listeners: { "click": "toggleDropdown()" }, properties: { "id": "id()", "attr.aria-controls": "dropdownId()", "attr.aria-expanded": "state().open()", "attr.data-open": "state().open() ? \"\" : undefined", "attr.data-disabled": "state().disabled() ? \"\" : undefined", "attr.data-multiple": "state().multiple() ? \"\" : undefined", "disabled": "state().disabled()" } }, exportAs: ["ngpComboboxButton"], ngImport: i0 }); }
|
|
54
54
|
}
|
|
55
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
55
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpComboboxButton, decorators: [{
|
|
56
56
|
type: Directive,
|
|
57
57
|
args: [{
|
|
58
58
|
selector: 'button[ngpComboboxButton]',
|
|
@@ -91,17 +91,18 @@ class NgpComboboxDropdown {
|
|
|
91
91
|
*/
|
|
92
92
|
this.elementRef = injectElementRef();
|
|
93
93
|
/** The id of the dropdown. */
|
|
94
|
-
this.id = input(uniqueId('ngp-combobox-dropdown'), ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
94
|
+
this.id = input(uniqueId('ngp-combobox-dropdown'), ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
95
95
|
this.state().registerDropdown(this);
|
|
96
96
|
}
|
|
97
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
98
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
97
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpComboboxDropdown, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
98
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.14", type: NgpComboboxDropdown, isStandalone: true, selector: "[ngpComboboxDropdown]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "listbox" }, properties: { "id": "id()", "style.left.px": "state().overlay()?.position()?.x", "style.top.px": "state().overlay()?.position()?.y", "style.--ngp-combobox-transform-origin": "state().overlay()?.transformOrigin()", "style.--ngp-combobox-available-width.px": "state().overlay()?.availableWidth()", "style.--ngp-combobox-available-height.px": "state().overlay()?.availableHeight()", "style.--ngp-combobox-width.px": "comboboxDimensions().width", "style.--ngp-combobox-input-width.px": "inputDimensions().width", "style.--ngp-combobox-button-width.px": "buttonDimensions().width" } }, providers: [provideControlContainerIsolation()], exportAs: ["ngpComboboxDropdown"], ngImport: i0 }); }
|
|
99
99
|
}
|
|
100
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
100
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpComboboxDropdown, decorators: [{
|
|
101
101
|
type: Directive,
|
|
102
102
|
args: [{
|
|
103
103
|
selector: '[ngpComboboxDropdown]',
|
|
104
104
|
exportAs: 'ngpComboboxDropdown',
|
|
105
|
+
providers: [provideControlContainerIsolation()],
|
|
105
106
|
host: {
|
|
106
107
|
role: 'listbox',
|
|
107
108
|
'[id]': 'id()',
|
|
@@ -127,11 +128,11 @@ class NgpComboboxInput {
|
|
|
127
128
|
*/
|
|
128
129
|
this.elementRef = injectElementRef();
|
|
129
130
|
/** The id of the input. */
|
|
130
|
-
this.id = input(uniqueId('ngp-combobox-input'), ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
131
|
+
this.id = input(uniqueId('ngp-combobox-input'), ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
131
132
|
/** The id of the dropdown. */
|
|
132
|
-
this.dropdownId = computed(() => this.state().dropdown()?.id(), ...(ngDevMode ? [{ debugName: "dropdownId" }] : []));
|
|
133
|
+
this.dropdownId = computed(() => this.state().dropdown()?.id(), ...(ngDevMode ? [{ debugName: "dropdownId" }] : /* istanbul ignore next */ []));
|
|
133
134
|
/** The id of the active descendant. */
|
|
134
|
-
this.activeDescendant = computed(() => this.state().activeDescendantManager.id(), ...(ngDevMode ? [{ debugName: "activeDescendant" }] : []));
|
|
135
|
+
this.activeDescendant = computed(() => this.state().activeDescendantManager.id(), ...(ngDevMode ? [{ debugName: "activeDescendant" }] : /* istanbul ignore next */ []));
|
|
135
136
|
/** Determine if the pointer was used to focus the input. */
|
|
136
137
|
this.pointerFocused = false;
|
|
137
138
|
/**
|
|
@@ -246,10 +247,10 @@ class NgpComboboxInput {
|
|
|
246
247
|
handlePointerDown() {
|
|
247
248
|
this.pointerFocused = true;
|
|
248
249
|
}
|
|
249
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
250
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
250
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpComboboxInput, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
251
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.14", type: NgpComboboxInput, isStandalone: true, selector: "input[ngpComboboxInput]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "combobox", "type": "text", "autocomplete": "off", "autocorrect": "off", "spellcheck": "false", "aria-haspopup": "listbox", "aria-autocomplete": "list" }, listeners: { "keydown": "handleKeydown($event)", "blur": "closeDropdown($event)", "focus": "highlightText()", "pointerdown": "handlePointerDown()" }, properties: { "id": "id()", "attr.aria-controls": "state().open() ? dropdownId() : undefined", "attr.aria-expanded": "state().open()", "attr.data-open": "state().open() ? \"\" : undefined", "attr.data-disabled": "state().disabled() ? \"\" : undefined", "attr.data-multiple": "state().multiple() ? \"\" : undefined", "attr.aria-activedescendant": "activeDescendant()", "disabled": "state().disabled()" } }, exportAs: ["ngpComboboxInput"], ngImport: i0 }); }
|
|
251
252
|
}
|
|
252
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
253
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpComboboxInput, decorators: [{
|
|
253
254
|
type: Directive,
|
|
254
255
|
args: [{
|
|
255
256
|
selector: 'input[ngpComboboxInput]',
|
|
@@ -311,26 +312,18 @@ class NgpComboboxOption {
|
|
|
311
312
|
*/
|
|
312
313
|
this.elementRef = injectElementRef();
|
|
313
314
|
/** The id of the option. */
|
|
314
|
-
this.id = input(uniqueId('ngp-combobox-option'), ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
315
|
+
this.id = input(uniqueId('ngp-combobox-option'), ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
315
316
|
/** @required The value of the option. */
|
|
316
|
-
this.value = input(undefined, ...(ngDevMode ?
|
|
317
|
-
alias: 'ngpComboboxOptionValue',
|
|
318
|
-
}]));
|
|
317
|
+
this.value = input(undefined, { ...(ngDevMode ? { debugName: "value" } : /* istanbul ignore next */ {}), alias: 'ngpComboboxOptionValue' });
|
|
319
318
|
/** The disabled state of the option. */
|
|
320
|
-
this.disabled = input(false, ...(ngDevMode ?
|
|
321
|
-
|
|
322
|
-
alias: 'ngpComboboxOptionDisabled',
|
|
323
|
-
transform: booleanAttribute,
|
|
324
|
-
}]));
|
|
319
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), alias: 'ngpComboboxOptionDisabled',
|
|
320
|
+
transform: booleanAttribute });
|
|
325
321
|
/**
|
|
326
322
|
* The index of the option in the combobox. This can be used to define the order of options
|
|
327
323
|
* when virtual scrolling is used or when the order is not determined by DOM order.
|
|
328
324
|
*/
|
|
329
|
-
this.index = input(undefined, ...(ngDevMode ?
|
|
330
|
-
|
|
331
|
-
alias: 'ngpComboboxOptionIndex',
|
|
332
|
-
transform: numberAttribute,
|
|
333
|
-
}]));
|
|
325
|
+
this.index = input(undefined, { ...(ngDevMode ? { debugName: "index" } : /* istanbul ignore next */ {}), alias: 'ngpComboboxOptionIndex',
|
|
326
|
+
transform: numberAttribute });
|
|
334
327
|
/**
|
|
335
328
|
* Event emitted when the option is activated via click or keyboard.
|
|
336
329
|
* This is useful for options without values that need custom behavior.
|
|
@@ -350,7 +343,7 @@ class NgpComboboxOption {
|
|
|
350
343
|
return this.state().activeDescendantManager.index() === index;
|
|
351
344
|
}
|
|
352
345
|
return this.state().activeDescendantManager.id() === this.id();
|
|
353
|
-
}, ...(ngDevMode ? [{ debugName: "active" }] : []));
|
|
346
|
+
}, ...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
|
|
354
347
|
/** Whether this option is selected. */
|
|
355
348
|
this.selected = computed(() => {
|
|
356
349
|
const value = this.value();
|
|
@@ -375,7 +368,7 @@ class NgpComboboxOption {
|
|
|
375
368
|
return (Array.isArray(stateValue) && stateValue.some(v => this.state().compareWith()(value, v)));
|
|
376
369
|
}
|
|
377
370
|
return this.state().compareWith()(value, stateValue);
|
|
378
|
-
}, ...(ngDevMode ? [{ debugName: "selected" }] : []));
|
|
371
|
+
}, ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
379
372
|
this.state().registerOption(this);
|
|
380
373
|
ngpInteractions({
|
|
381
374
|
hover: true,
|
|
@@ -433,10 +426,10 @@ class NgpComboboxOption {
|
|
|
433
426
|
this.state().activeDescendantManager.reset({ origin: 'pointer' });
|
|
434
427
|
}
|
|
435
428
|
}
|
|
436
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
437
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
429
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpComboboxOption, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
430
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.14", type: NgpComboboxOption, isStandalone: true, selector: "[ngpComboboxOption]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "ngpComboboxOptionValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpComboboxOptionDisabled", isSignal: true, isRequired: false, transformFunction: null }, index: { classPropertyName: "index", publicName: "ngpComboboxOptionIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activated: "ngpComboboxOptionActivated" }, host: { attributes: { "role": "option" }, listeners: { "click": "select()", "pointerenter": "onPointerEnter()", "pointerleave": "onPointerLeave()" }, properties: { "id": "id()", "attr.tabindex": "-1", "attr.aria-selected": "selected() ? \"true\" : undefined", "attr.data-selected": "selected() ? \"\" : undefined", "attr.data-active": "active() ? \"\" : undefined", "attr.data-disabled": "disabled() ? \"\" : undefined" } }, exportAs: ["ngpComboboxOption"], ngImport: i0 }); }
|
|
438
431
|
}
|
|
439
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
432
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpComboboxOption, decorators: [{
|
|
440
433
|
type: Directive,
|
|
441
434
|
args: [{
|
|
442
435
|
selector: '[ngpComboboxOption]',
|
|
@@ -474,7 +467,7 @@ class NgpComboboxPortal {
|
|
|
474
467
|
* The overlay that manages the popover
|
|
475
468
|
* @internal
|
|
476
469
|
*/
|
|
477
|
-
this.overlay = signal(null, ...(ngDevMode ? [{ debugName: "overlay" }] : []));
|
|
470
|
+
this.overlay = signal(null, ...(ngDevMode ? [{ debugName: "overlay" }] : /* istanbul ignore next */ []));
|
|
478
471
|
this.state().registerPortal(this);
|
|
479
472
|
}
|
|
480
473
|
/** Cleanup the portal. */
|
|
@@ -522,10 +515,10 @@ class NgpComboboxPortal {
|
|
|
522
515
|
};
|
|
523
516
|
this.overlay.set(createOverlay(config));
|
|
524
517
|
}
|
|
525
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
526
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
518
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpComboboxPortal, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
519
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.14", type: NgpComboboxPortal, isStandalone: true, selector: "[ngpComboboxPortal]", exportAs: ["ngpComboboxPortal"], ngImport: i0 }); }
|
|
527
520
|
}
|
|
528
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
521
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpComboboxPortal, decorators: [{
|
|
529
522
|
type: Directive,
|
|
530
523
|
args: [{
|
|
531
524
|
selector: '[ngpComboboxPortal]',
|
|
@@ -570,118 +563,93 @@ class NgpCombobox {
|
|
|
570
563
|
/** Access the injector. */
|
|
571
564
|
this.injector = inject(Injector);
|
|
572
565
|
/** The value of the combobox. */
|
|
573
|
-
this.value = input(undefined, ...(ngDevMode ?
|
|
574
|
-
alias: 'ngpComboboxValue',
|
|
575
|
-
}]));
|
|
566
|
+
this.value = input(undefined, { ...(ngDevMode ? { debugName: "value" } : /* istanbul ignore next */ {}), alias: 'ngpComboboxValue' });
|
|
576
567
|
/** Event emitted when the value changes. */
|
|
577
568
|
this.valueChange = output({
|
|
578
569
|
alias: 'ngpComboboxValueChange',
|
|
579
570
|
});
|
|
580
571
|
/** Whether the combobox is multiple selection. */
|
|
581
|
-
this.multiple = input(false, ...(ngDevMode ?
|
|
582
|
-
|
|
583
|
-
alias: 'ngpComboboxMultiple',
|
|
584
|
-
transform: booleanAttribute,
|
|
585
|
-
}]));
|
|
572
|
+
this.multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {}), alias: 'ngpComboboxMultiple',
|
|
573
|
+
transform: booleanAttribute });
|
|
586
574
|
/** Whether the combobox is disabled. */
|
|
587
|
-
this.disabled = input(false, ...(ngDevMode ?
|
|
588
|
-
|
|
589
|
-
alias: 'ngpComboboxDisabled',
|
|
590
|
-
transform: booleanAttribute,
|
|
591
|
-
}]));
|
|
575
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), alias: 'ngpComboboxDisabled',
|
|
576
|
+
transform: booleanAttribute });
|
|
592
577
|
/** Whether the combobox allows deselection in single selection mode. */
|
|
593
|
-
this.allowDeselect = input(false, ...(ngDevMode ?
|
|
594
|
-
|
|
595
|
-
alias: 'ngpComboboxAllowDeselect',
|
|
596
|
-
transform: booleanAttribute,
|
|
597
|
-
}]));
|
|
578
|
+
this.allowDeselect = input(false, { ...(ngDevMode ? { debugName: "allowDeselect" } : /* istanbul ignore next */ {}), alias: 'ngpComboboxAllowDeselect',
|
|
579
|
+
transform: booleanAttribute });
|
|
598
580
|
/** Emit when the dropdown open state changes. */
|
|
599
581
|
this.openChange = output({
|
|
600
582
|
alias: 'ngpComboboxOpenChange',
|
|
601
583
|
});
|
|
602
584
|
/** The comparator function used to compare options. */
|
|
603
|
-
this.compareWith = input(Object.is, ...(ngDevMode ?
|
|
604
|
-
alias: 'ngpComboboxCompareWith',
|
|
605
|
-
}]));
|
|
585
|
+
this.compareWith = input(Object.is, { ...(ngDevMode ? { debugName: "compareWith" } : /* istanbul ignore next */ {}), alias: 'ngpComboboxCompareWith' });
|
|
606
586
|
/** The position of the dropdown. */
|
|
607
|
-
this.placement = input(this.config.placement, ...(ngDevMode ?
|
|
608
|
-
alias: 'ngpComboboxDropdownPlacement',
|
|
609
|
-
}]));
|
|
587
|
+
this.placement = input(this.config.placement, { ...(ngDevMode ? { debugName: "placement" } : /* istanbul ignore next */ {}), alias: 'ngpComboboxDropdownPlacement' });
|
|
610
588
|
/** The container for the dropdown. */
|
|
611
|
-
this.container = input(this.config.container, ...(ngDevMode ?
|
|
612
|
-
alias: 'ngpComboboxDropdownContainer',
|
|
613
|
-
}]));
|
|
589
|
+
this.container = input(this.config.container, { ...(ngDevMode ? { debugName: "container" } : /* istanbul ignore next */ {}), alias: 'ngpComboboxDropdownContainer' });
|
|
614
590
|
/** Whether the dropdown should flip when there is not enough space. Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options. */
|
|
615
|
-
this.flip = input(this.config.flip, ...(ngDevMode ?
|
|
616
|
-
|
|
617
|
-
alias: 'ngpComboboxDropdownFlip',
|
|
618
|
-
transform: coerceFlip,
|
|
619
|
-
}]));
|
|
591
|
+
this.flip = input(this.config.flip, { ...(ngDevMode ? { debugName: "flip" } : /* istanbul ignore next */ {}), alias: 'ngpComboboxDropdownFlip',
|
|
592
|
+
transform: coerceFlip });
|
|
620
593
|
/**
|
|
621
594
|
* Define the offset of the combobox dropdown relative to the trigger.
|
|
622
595
|
* Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis.
|
|
623
596
|
* @default 0
|
|
624
597
|
*/
|
|
625
|
-
this.offset = input(this.config.offset, ...(ngDevMode ?
|
|
626
|
-
|
|
627
|
-
alias: 'ngpComboboxDropdownOffset',
|
|
628
|
-
transform: coerceOffset,
|
|
629
|
-
}]));
|
|
598
|
+
this.offset = input(this.config.offset, { ...(ngDevMode ? { debugName: "offset" } : /* istanbul ignore next */ {}), alias: 'ngpComboboxDropdownOffset',
|
|
599
|
+
transform: coerceOffset });
|
|
630
600
|
/**
|
|
631
601
|
* A function that will scroll the active option into view. This can be overridden
|
|
632
602
|
* for cases such as virtual scrolling where we cannot scroll the option directly because
|
|
633
603
|
* it may not be rendered.
|
|
634
604
|
*/
|
|
635
|
-
this.scrollToOption = input(undefined, ...(ngDevMode ?
|
|
636
|
-
alias: 'ngpComboboxScrollToOption',
|
|
637
|
-
}]));
|
|
605
|
+
this.scrollToOption = input(undefined, { ...(ngDevMode ? { debugName: "scrollToOption" } : /* istanbul ignore next */ {}), alias: 'ngpComboboxScrollToOption' });
|
|
638
606
|
/**
|
|
639
607
|
* Provide all the option values to the combobox. This is useful for virtual scrolling scenarios
|
|
640
608
|
* where not all options are rendered in the DOM. This is not an alternative to adding the options
|
|
641
609
|
* in the DOM, it is only to provide the combobox with the full list of options. This list should match
|
|
642
610
|
* the order of the options as they would appear in the DOM.
|
|
643
611
|
*/
|
|
644
|
-
this.allOptions = input(undefined, ...(ngDevMode ?
|
|
612
|
+
this.allOptions = input(undefined, { ...(ngDevMode ? { debugName: "allOptions" } : /* istanbul ignore next */ {}), alias: 'ngpComboboxOptions' });
|
|
645
613
|
/**
|
|
646
614
|
* Store the combobox input
|
|
647
615
|
* @internal
|
|
648
616
|
*/
|
|
649
|
-
this.input = signal(undefined, ...(ngDevMode ? [{ debugName: "input" }] : []));
|
|
617
|
+
this.input = signal(undefined, ...(ngDevMode ? [{ debugName: "input" }] : /* istanbul ignore next */ []));
|
|
650
618
|
/**
|
|
651
619
|
* Store the combobox button.
|
|
652
620
|
* @internal
|
|
653
621
|
*/
|
|
654
|
-
this.button = signal(undefined, ...(ngDevMode ? [{ debugName: "button" }] : []));
|
|
622
|
+
this.button = signal(undefined, ...(ngDevMode ? [{ debugName: "button" }] : /* istanbul ignore next */ []));
|
|
655
623
|
/**
|
|
656
624
|
* Store the combobox portal.
|
|
657
625
|
* @internal
|
|
658
626
|
*/
|
|
659
|
-
this.portal = signal(undefined, ...(ngDevMode ? [{ debugName: "portal" }] : []));
|
|
627
|
+
this.portal = signal(undefined, ...(ngDevMode ? [{ debugName: "portal" }] : /* istanbul ignore next */ []));
|
|
660
628
|
/**
|
|
661
629
|
* Store the combobox dropdown.
|
|
662
630
|
* @internal
|
|
663
631
|
*/
|
|
664
|
-
this.dropdown = signal(undefined, ...(ngDevMode ? [{ debugName: "dropdown" }] : []));
|
|
632
|
+
this.dropdown = signal(undefined, ...(ngDevMode ? [{ debugName: "dropdown" }] : /* istanbul ignore next */ []));
|
|
665
633
|
/**
|
|
666
634
|
* Store the combobox options.
|
|
667
635
|
* @internal
|
|
668
636
|
*/
|
|
669
|
-
this.options = signal([], ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
637
|
+
this.options = signal([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
670
638
|
/**
|
|
671
639
|
* Access the overlay
|
|
672
640
|
* @internal
|
|
673
641
|
*/
|
|
674
|
-
this.overlay = computed(() => this.portal()?.overlay(), ...(ngDevMode ? [{ debugName: "overlay" }] : []));
|
|
642
|
+
this.overlay = computed(() => this.portal()?.overlay(), ...(ngDevMode ? [{ debugName: "overlay" }] : /* istanbul ignore next */ []));
|
|
675
643
|
/**
|
|
676
644
|
* The open state of the combobox.
|
|
677
645
|
* @internal
|
|
678
646
|
*/
|
|
679
|
-
this.open = computed(() => this.overlay()?.isOpen() ?? false, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
647
|
+
this.open = computed(() => this.overlay()?.isOpen() ?? false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
680
648
|
/**
|
|
681
649
|
* The options sorted by their index or DOM position.
|
|
682
650
|
* @internal
|
|
683
651
|
*/
|
|
684
|
-
this.sortedOptions = computed(() => domSort(this.options(), option => option.elementRef.nativeElement, option => option.index()), ...(ngDevMode ? [{ debugName: "sortedOptions" }] : []));
|
|
652
|
+
this.sortedOptions = computed(() => domSort(this.options(), option => option.elementRef.nativeElement, option => option.index()), ...(ngDevMode ? [{ debugName: "sortedOptions" }] : /* istanbul ignore next */ []));
|
|
685
653
|
/**
|
|
686
654
|
* The active key descendant manager.
|
|
687
655
|
* @internal
|
|
@@ -702,7 +670,7 @@ class NgpCombobox {
|
|
|
702
670
|
},
|
|
703
671
|
});
|
|
704
672
|
/** The control status */
|
|
705
|
-
this.controlStatus = computed(() => this.input()?.controlStatus(), ...(ngDevMode ? [{ debugName: "controlStatus" }] : []));
|
|
673
|
+
this.controlStatus = computed(() => this.input()?.controlStatus(), ...(ngDevMode ? [{ debugName: "controlStatus" }] : /* istanbul ignore next */ []));
|
|
706
674
|
/** The state of the combobox. */
|
|
707
675
|
this.state = comboboxState(this);
|
|
708
676
|
ngpInteractions({
|
|
@@ -1183,10 +1151,10 @@ class NgpCombobox {
|
|
|
1183
1151
|
}
|
|
1184
1152
|
return this.sortedOptions()[index];
|
|
1185
1153
|
}
|
|
1186
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1187
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
1154
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpCombobox, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1155
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.14", type: NgpCombobox, isStandalone: true, selector: "[ngpCombobox]", inputs: { value: { classPropertyName: "value", publicName: "ngpComboboxValue", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "ngpComboboxMultiple", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpComboboxDisabled", isSignal: true, isRequired: false, transformFunction: null }, allowDeselect: { classPropertyName: "allowDeselect", publicName: "ngpComboboxAllowDeselect", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "ngpComboboxCompareWith", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "ngpComboboxDropdownPlacement", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "ngpComboboxDropdownContainer", isSignal: true, isRequired: false, transformFunction: null }, flip: { classPropertyName: "flip", publicName: "ngpComboboxDropdownFlip", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "ngpComboboxDropdownOffset", isSignal: true, isRequired: false, transformFunction: null }, scrollToOption: { classPropertyName: "scrollToOption", publicName: "ngpComboboxScrollToOption", isSignal: true, isRequired: false, transformFunction: null }, allOptions: { classPropertyName: "allOptions", publicName: "ngpComboboxOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "ngpComboboxValueChange", openChange: "ngpComboboxOpenChange" }, host: { listeners: { "keydown": "handleKeydown($event)", "blur": "onBlur($event)" }, properties: { "attr.tabindex": "input() ? -1 : (state.disabled() ? -1 : 0)", "attr.data-open": "open() ? \"\" : undefined", "attr.data-disabled": "state.disabled() ? \"\" : undefined", "attr.data-multiple": "state.multiple() ? \"\" : undefined", "attr.data-invalid": "controlStatus()?.invalid ? \"\" : undefined", "attr.data-valid": "controlStatus()?.valid ? \"\" : undefined", "attr.data-touched": "controlStatus()?.touched ? \"\" : undefined", "attr.data-pristine": "controlStatus()?.pristine ? \"\" : undefined", "attr.data-dirty": "controlStatus()?.dirty ? \"\" : undefined", "attr.data-pending": "controlStatus()?.pending ? \"\" : undefined" } }, providers: [provideComboboxState()], exportAs: ["ngpCombobox"], ngImport: i0 }); }
|
|
1188
1156
|
}
|
|
1189
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1157
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpCombobox, decorators: [{
|
|
1190
1158
|
type: Directive,
|
|
1191
1159
|
args: [{
|
|
1192
1160
|
selector: '[ngpCombobox]',
|