ng-primitives 0.35.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/a11y/visually-hidden/visually-hidden-state.d.ts +1 -1
- package/accordion/accordion/accordion-state.d.ts +1 -1
- package/accordion/accordion-item/accordion-item-state.d.ts +1 -1
- package/accordion/accordion-trigger/accordion-trigger.d.ts +4 -0
- package/avatar/avatar/avatar-state.d.ts +1 -1
- package/button/button/button-state.d.ts +1 -1
- package/checkbox/checkbox/checkbox-state.d.ts +1 -1
- package/date-picker/date-picker/date-picker-state.d.ts +1 -1
- package/dialog/dialog/dialog-state.d.ts +1 -1
- 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 +18 -12
- 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 +66 -70
- 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 +114 -68
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-progress.mjs +6 -6
- package/fesm2022/ng-primitives-radio.mjs +13 -9
- package/fesm2022/ng-primitives-radio.mjs.map +1 -1
- 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-state.mjs +10 -3
- package/fesm2022/ng-primitives-state.mjs.map +1 -1
- package/fesm2022/ng-primitives-switch.mjs +6 -6
- package/fesm2022/ng-primitives-tabs.mjs +35 -48
- 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 +108 -51
- package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
- package/fesm2022/ng-primitives-utils.mjs +18 -0
- package/fesm2022/ng-primitives-utils.mjs.map +1 -1
- package/file-upload/file-dropzone/file-dropzone-state.d.ts +2 -2
- package/file-upload/file-dropzone/file-dropzone.d.ts +3 -2
- package/file-upload/file-upload/file-upload-state.d.ts +2 -2
- package/file-upload/file-upload/file-upload.d.ts +3 -2
- 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 +24 -24
- package/form-field/form-field/form-field-state.d.ts +1 -1
- package/input/input/input-state.d.ts +1 -1
- package/internal/exit-animation/exit-animation-manager.d.ts +17 -0
- package/internal/exit-animation/exit-animation.d.ts +4 -17
- package/internal/index.d.ts +2 -1
- package/listbox/listbox/listbox-state.d.ts +4 -4
- 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 +13 -9
- package/pagination/pagination/pagination-state.d.ts +3 -3
- 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/index.d.ts +1 -0
- package/popover/popover/popover-token.d.ts +10 -0
- package/popover/popover/popover.d.ts +34 -3
- package/popover/popover-trigger/popover-trigger-state.d.ts +5 -3
- package/popover/popover-trigger/popover-trigger.d.ts +26 -18
- package/progress/progress/progress-state.d.ts +3 -3
- package/progress/progress-indicator/progress-indicator.d.ts +2 -2
- package/radio/radio-group/radio-group-state.d.ts +1 -1
- package/radio/radio-item/radio-item-state.d.ts +1 -1
- package/roving-focus/roving-focus-group/roving-focus-group-state.d.ts +7 -7
- package/schematics/ng-generate/schema.d.ts +4 -1
- package/schematics/ng-generate/schema.json +4 -1
- 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-button.__fileSuffix@dasherize__.ts.template +58 -0
- package/schematics/ng-generate/templates/toolbar/toolbar.__fileSuffix@dasherize__.ts.template +37 -0
- package/schematics/ng-generate/templates/tooltip/tooltip-trigger.__fileSuffix@dasherize__.ts.template +35 -0
- package/schematics/ng-generate/templates/tooltip/tooltip.__fileSuffix@dasherize__.ts.template +60 -0
- package/search/search/search-state.d.ts +1 -1
- package/select/select/select-state.d.ts +1 -1
- package/slider/slider/slider-state.d.ts +5 -5
- 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/state/index.d.ts +7 -1
- package/switch/switch/switch-state.d.ts +1 -1
- package/tabs/index.d.ts +1 -2
- package/tabs/tab-button/tab-button.d.ts +9 -10
- 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 +7 -8
- package/tabs/tabset/tabset.d.ts +3 -4
- package/textarea/textarea/textarea-state.d.ts +1 -1
- package/toggle/toggle/toggle-state.d.ts +1 -1
- package/toggle-group/toggle-group/toggle-group-state.d.ts +7 -7
- package/toggle-group/toggle-group/toggle-group.d.ts +1 -1
- package/toggle-group/toggle-group-item/toggle-group-item-state.d.ts +13 -13
- 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/index.d.ts +1 -0
- package/tooltip/tooltip/tooltip-token.d.ts +10 -0
- package/tooltip/tooltip/tooltip.d.ts +2 -1
- package/tooltip/tooltip-trigger/tooltip-trigger-state.d.ts +3 -3
- package/tooltip/tooltip-trigger/tooltip-trigger.d.ts +44 -18
- package/tabs/tabset/tabset-token.d.ts +0 -11
|
@@ -6,7 +6,7 @@ export declare const NgpVisuallyHiddenStateToken: import("@angular/core").Inject
|
|
|
6
6
|
/**
|
|
7
7
|
* Provides the VisuallyHidden state.
|
|
8
8
|
*/
|
|
9
|
-
export declare const provideVisuallyHiddenState: () => import("@angular/core").FactoryProvider;
|
|
9
|
+
export declare const provideVisuallyHiddenState: (options?: import("ng-primitives/state").CreateStateProviderOptions) => import("@angular/core").FactoryProvider;
|
|
10
10
|
/**
|
|
11
11
|
* Injects the VisuallyHidden state.
|
|
12
12
|
*/
|
|
@@ -6,7 +6,7 @@ export declare const NgpAccordionStateToken: import("@angular/core").InjectionTo
|
|
|
6
6
|
/**
|
|
7
7
|
* Provides the Accordion state.
|
|
8
8
|
*/
|
|
9
|
-
export declare const provideAccordionState: () => import("@angular/core").FactoryProvider;
|
|
9
|
+
export declare const provideAccordionState: (options?: import("ng-primitives/state").CreateStateProviderOptions) => import("@angular/core").FactoryProvider;
|
|
10
10
|
/**
|
|
11
11
|
* Injects the Accordion state.
|
|
12
12
|
*/
|
|
@@ -6,7 +6,7 @@ export declare const NgpAccordionItemStateToken: import("@angular/core").Injecti
|
|
|
6
6
|
/**
|
|
7
7
|
* Provides the AccordionItem state.
|
|
8
8
|
*/
|
|
9
|
-
export declare const provideAccordionItemState: () => import("@angular/core").FactoryProvider;
|
|
9
|
+
export declare const provideAccordionItemState: (options?: import("ng-primitives/state").CreateStateProviderOptions) => import("@angular/core").FactoryProvider;
|
|
10
10
|
/**
|
|
11
11
|
* Injects the AccordionItem state.
|
|
12
12
|
*/
|
|
@@ -5,6 +5,10 @@ import * as i0 from "@angular/core";
|
|
|
5
5
|
* Apply the `ngpAccordionTrigger` directive to an element that represents the trigger for an accordion item, such as a button.
|
|
6
6
|
*/
|
|
7
7
|
export declare class NgpAccordionTrigger<T> {
|
|
8
|
+
/**
|
|
9
|
+
* The tag name of the element.
|
|
10
|
+
*/
|
|
11
|
+
protected readonly tagName: string;
|
|
8
12
|
/**
|
|
9
13
|
* Access the parent accordion.
|
|
10
14
|
*/
|
|
@@ -6,7 +6,7 @@ export declare const NgpAvatarStateToken: import("@angular/core").InjectionToken
|
|
|
6
6
|
/**
|
|
7
7
|
* Provides the Avatar state.
|
|
8
8
|
*/
|
|
9
|
-
export declare const provideAvatarState: () => import("@angular/core").FactoryProvider;
|
|
9
|
+
export declare const provideAvatarState: (options?: import("ng-primitives/state").CreateStateProviderOptions) => import("@angular/core").FactoryProvider;
|
|
10
10
|
/**
|
|
11
11
|
* Injects the Avatar state.
|
|
12
12
|
*/
|
|
@@ -7,7 +7,7 @@ export declare const NgpButtonStateToken: import("@angular/core").InjectionToken
|
|
|
7
7
|
/**
|
|
8
8
|
* Provides the Button state.
|
|
9
9
|
*/
|
|
10
|
-
export declare const provideButtonState: () => import("@angular/core").FactoryProvider;
|
|
10
|
+
export declare const provideButtonState: (options?: import("ng-primitives/state").CreateStateProviderOptions) => import("@angular/core").FactoryProvider;
|
|
11
11
|
/**
|
|
12
12
|
* Injects the Button state.
|
|
13
13
|
*/
|
|
@@ -6,7 +6,7 @@ export declare const NgpCheckboxStateToken: import("@angular/core").InjectionTok
|
|
|
6
6
|
/**
|
|
7
7
|
* Provides the Checkbox state.
|
|
8
8
|
*/
|
|
9
|
-
export declare const provideCheckboxState: () => import("@angular/core").FactoryProvider;
|
|
9
|
+
export declare const provideCheckboxState: (options?: import("ng-primitives/state").CreateStateProviderOptions) => import("@angular/core").FactoryProvider;
|
|
10
10
|
/**
|
|
11
11
|
* Injects the Checkbox state.
|
|
12
12
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InjectedState } from 'ng-primitives/state';
|
|
2
2
|
import type { NgpDatePicker } from './date-picker';
|
|
3
3
|
export declare const NgpDatePickerStateToken: import("@angular/core").InjectionToken<NgpDatePicker<unknown>>;
|
|
4
|
-
export declare const provideDatePickerState: () => import("@angular/core").FactoryProvider;
|
|
4
|
+
export declare const provideDatePickerState: (options?: import("ng-primitives/state").CreateStateProviderOptions) => import("@angular/core").FactoryProvider;
|
|
5
5
|
export declare const injectDatePickerState: <T>() => InjectedState<NgpDatePicker<T>>;
|
|
6
6
|
export declare const datePickerState: <U>(state: U) => import("ng-primitives/state").CreatedState<U>;
|
|
@@ -6,7 +6,7 @@ export declare const NgpDialogStateToken: import("@angular/core").InjectionToken
|
|
|
6
6
|
/**
|
|
7
7
|
* Provides the Dialog state.
|
|
8
8
|
*/
|
|
9
|
-
export declare const provideDialogState: () => import("@angular/core").FactoryProvider;
|
|
9
|
+
export declare const provideDialogState: (options?: import("ng-primitives/state").CreateStateProviderOptions) => import("@angular/core").FactoryProvider;
|
|
10
10
|
/**
|
|
11
11
|
* Injects the Dialog state.
|
|
12
12
|
*/
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
import { BooleanInput } from '@angular/cdk/coercion';
|
|
1
2
|
import * as i0 from "@angular/core";
|
|
2
3
|
import * as i1 from "ng-primitives/internal";
|
|
3
4
|
export declare class NgpDialogOverlay {
|
|
4
5
|
/** Access the dialog ref. */
|
|
5
6
|
private readonly dialogRef;
|
|
7
|
+
/**
|
|
8
|
+
* Whether the dialog should close on backdrop click.
|
|
9
|
+
* @default `true`
|
|
10
|
+
*/
|
|
11
|
+
readonly closeOnClick: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
|
|
6
12
|
protected close(): void;
|
|
7
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpDialogOverlay, never>;
|
|
8
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpDialogOverlay, "[ngpDialogOverlay]", ["ngpDialogOverlay"], {}, {}, never, never, true, [{ directive: typeof i1.NgpExitAnimation; inputs: {}; outputs: {}; }]>;
|
|
14
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpDialogOverlay, "[ngpDialogOverlay]", ["ngpDialogOverlay"], { "closeOnClick": { "alias": "ngpDialogOverlayCloseOnClick"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.NgpExitAnimation; inputs: {}; outputs: {}; }]>;
|
|
9
15
|
}
|
|
@@ -4,8 +4,6 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
export declare class NgpDialogTrigger {
|
|
5
5
|
/** Access the dialog manager. */
|
|
6
6
|
private readonly dialogManager;
|
|
7
|
-
/** Access the application ref. */
|
|
8
|
-
private readonly applicationRef;
|
|
9
7
|
/** Access the focus monitor. */
|
|
10
8
|
private readonly focusMonitor;
|
|
11
9
|
/** Access the element ref. */
|
package/example-theme/index.css
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
--ngp-background-inverse: var(--ngp-black);
|
|
25
25
|
--ngp-background-disabled: var(--ngp-gray-100);
|
|
26
26
|
--ngp-background-blue: #dbeafe;
|
|
27
|
+
--ngp-background-success: oklch(84.1% 0.238 128.85);
|
|
27
28
|
|
|
28
29
|
--ngp-border: var(--ngp-gray-200);
|
|
29
30
|
--ngp-border-secondary: var(--ngp-gray-300);
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
--ngp-text-red: #ef4444;
|
|
42
43
|
|
|
43
44
|
--ngp-shadow: 0 1px 2px 0 rgba(0 0 0 0.05);
|
|
45
|
+
--ngp-shadow-border: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
44
46
|
|
|
45
47
|
--ngp-focus-ring: rgb(59 130 246);
|
|
46
48
|
|
|
@@ -58,10 +58,10 @@ class NgpVisuallyHidden {
|
|
|
58
58
|
setVisibility(visible) {
|
|
59
59
|
this.hidden.set(!visible);
|
|
60
60
|
}
|
|
61
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
62
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.
|
|
61
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpVisuallyHidden, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
62
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: NgpVisuallyHidden, isStandalone: true, selector: "[ngpVisuallyHidden]", host: { properties: { "style": "style()" } }, providers: [provideVisuallyHiddenState()], exportAs: ["ngpVisuallyHidden"], ngImport: i0 }); }
|
|
63
63
|
}
|
|
64
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpVisuallyHidden, decorators: [{
|
|
65
65
|
type: Directive,
|
|
66
66
|
args: [{
|
|
67
67
|
selector: '[ngpVisuallyHidden]',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, signal, afterRenderEffect, Directive, booleanAttribute, computed, HostListener, InjectionToken,
|
|
2
|
+
import { input, signal, afterRenderEffect, Directive, booleanAttribute, computed, inject, HOST_TAG_NAME, HostListener, InjectionToken, output } from '@angular/core';
|
|
3
3
|
import { injectElementRef } from 'ng-primitives/internal';
|
|
4
4
|
import { uniqueId } from 'ng-primitives/utils';
|
|
5
5
|
import { createStateToken, createStateProvider, createStateInjector, createState } from 'ng-primitives/state';
|
|
@@ -75,10 +75,10 @@ class NgpAccordionContent {
|
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
79
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.
|
|
78
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpAccordionContent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
79
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: NgpAccordionContent, isStandalone: true, selector: "[ngpAccordionContent]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "region" }, properties: { "id": "id()", "attr.data-orientation": "accordion().orientation()", "attr.data-open": "accordionItem().open() ? \"\" : null", "attr.data-closed": "accordionItem().open() ? null : \"\"", "attr.aria-labelledby": "accordionItem().triggerId()", "style.--ngp-accordion-content-width.px": "width()", "style.--ngp-accordion-content-height.px": "height()" } }, exportAs: ["ngpAccordionContent"], ngImport: i0 }); }
|
|
80
80
|
}
|
|
81
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
81
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpAccordionContent, decorators: [{
|
|
82
82
|
type: Directive,
|
|
83
83
|
args: [{
|
|
84
84
|
selector: '[ngpAccordionContent]',
|
|
@@ -150,10 +150,10 @@ class NgpAccordionItem {
|
|
|
150
150
|
throw new Error('The accordion item value is required');
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
154
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.
|
|
153
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpAccordionItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
154
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: NgpAccordionItem, isStandalone: true, selector: "[ngpAccordionItem]", inputs: { value: { classPropertyName: "value", publicName: "ngpAccordionItemValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpAccordionItemDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-orientation": "accordion().orientation()", "attr.data-open": "state.open() ? \"\" : null", "attr.data-disabled": "state.disabled() || accordion().disabled() ? \"\" : null" } }, providers: [provideAccordionItemState()], exportAs: ["ngpAccordionItem"], ngImport: i0 }); }
|
|
155
155
|
}
|
|
156
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
156
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpAccordionItem, decorators: [{
|
|
157
157
|
type: Directive,
|
|
158
158
|
args: [{
|
|
159
159
|
selector: '[ngpAccordionItem]',
|
|
@@ -172,6 +172,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
|
|
|
172
172
|
*/
|
|
173
173
|
class NgpAccordionTrigger {
|
|
174
174
|
constructor() {
|
|
175
|
+
/**
|
|
176
|
+
* The tag name of the element.
|
|
177
|
+
*/
|
|
178
|
+
this.tagName = inject(HOST_TAG_NAME);
|
|
175
179
|
/**
|
|
176
180
|
* Access the parent accordion.
|
|
177
181
|
*/
|
|
@@ -195,16 +199,17 @@ class NgpAccordionTrigger {
|
|
|
195
199
|
}
|
|
196
200
|
this.accordion().toggle(this.accordionItem().value());
|
|
197
201
|
}
|
|
198
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
199
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.
|
|
202
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpAccordionTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
203
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: NgpAccordionTrigger, isStandalone: true, selector: "[ngpAccordionTrigger]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "toggle()" }, properties: { "id": "id()", "attr.type": "tagName === \"button\" ? \"button\" : null", "attr.data-orientation": "accordion().orientation()", "attr.data-open": "accordionItem().open() ? \"\" : null", "attr.data-disabled": "accordionItem().disabled() || accordion().disabled() ? \"\" : null", "attr.aria-controls": "accordionItem().contentId()", "attr.aria-expanded": "accordionItem().open()" } }, exportAs: ["ngpAccordionTrigger"], ngImport: i0 }); }
|
|
200
204
|
}
|
|
201
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
205
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpAccordionTrigger, decorators: [{
|
|
202
206
|
type: Directive,
|
|
203
207
|
args: [{
|
|
204
208
|
selector: '[ngpAccordionTrigger]',
|
|
205
209
|
exportAs: 'ngpAccordionTrigger',
|
|
206
210
|
host: {
|
|
207
211
|
'[id]': 'id()',
|
|
212
|
+
'[attr.type]': 'tagName === "button" ? "button" : null',
|
|
208
213
|
'[attr.data-orientation]': 'accordion().orientation()',
|
|
209
214
|
'[attr.data-open]': 'accordionItem().open() ? "" : null',
|
|
210
215
|
'[attr.data-disabled]': 'accordionItem().disabled() || accordion().disabled() ? "" : null',
|
|
@@ -329,10 +334,10 @@ class NgpAccordion {
|
|
|
329
334
|
}
|
|
330
335
|
this.valueChange.emit(this.state.value());
|
|
331
336
|
}
|
|
332
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
333
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.
|
|
337
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpAccordion, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
338
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: NgpAccordion, isStandalone: true, selector: "[ngpAccordion]", inputs: { type: { classPropertyName: "type", publicName: "ngpAccordionType", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "ngpAccordionCollapsible", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "ngpAccordionValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpAccordionDisabled", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "ngpAccordionOrientation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "ngpAccordionValueChange" }, host: { properties: { "attr.data-orientation": "state.orientation()", "attr.data-disabled": "state.disabled() ? \"\" : null" } }, providers: [provideAccordionState()], exportAs: ["ngpAccordion"], ngImport: i0 }); }
|
|
334
339
|
}
|
|
335
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
340
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpAccordion, decorators: [{
|
|
336
341
|
type: Directive,
|
|
337
342
|
args: [{
|
|
338
343
|
selector: '[ngpAccordion]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-accordion.mjs","sources":["../../../../packages/ng-primitives/accordion/src/accordion-item/accordion-item-state.ts","../../../../packages/ng-primitives/accordion/src/accordion/accordion-state.ts","../../../../packages/ng-primitives/accordion/src/accordion-content/accordion-content.ts","../../../../packages/ng-primitives/accordion/src/accordion-item/accordion-item.ts","../../../../packages/ng-primitives/accordion/src/accordion-trigger/accordion-trigger.ts","../../../../packages/ng-primitives/accordion/src/config/accordion-config.ts","../../../../packages/ng-primitives/accordion/src/accordion/accordion.ts","../../../../packages/ng-primitives/accordion/src/ng-primitives-accordion.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpAccordionItem } from './accordion-item';\n\n/**\n * The state token for the AccordionItem primitive.\n */\nexport const NgpAccordionItemStateToken =\n createStateToken<NgpAccordionItem<unknown>>('AccordionItem');\n\n/**\n * Provides the AccordionItem state.\n */\nexport const provideAccordionItemState = createStateProvider(NgpAccordionItemStateToken);\n\n/**\n * Injects the AccordionItem state.\n */\nexport const injectAccordionItemState = createStateInjector(NgpAccordionItemStateToken);\n\n/**\n * The AccordionItem state registration function.\n */\nexport const accordionItemState = createState(NgpAccordionItemStateToken);\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpAccordion } from './accordion';\n\n/**\n * The state token for the Accordion primitive.\n */\nexport const NgpAccordionStateToken = createStateToken<NgpAccordion<unknown>>('Accordion');\n\n/**\n * Provides the Accordion state.\n */\nexport const provideAccordionState = createStateProvider(NgpAccordionStateToken);\n\n/**\n * Injects the Accordion state.\n */\nexport const injectAccordionState = createStateInjector(NgpAccordionStateToken);\n\n/**\n * The Accordion state registration function.\n */\nexport const accordionState = createState(NgpAccordionStateToken);\n","import { afterRenderEffect, Directive, input, signal } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectAccordionItemState } from '../accordion-item/accordion-item-state';\nimport type { NgpAccordion } from '../accordion/accordion';\nimport { injectAccordionState } from '../accordion/accordion-state';\n\n/**\n * Apply the `ngpAccordionContent` directive to an element that represents the content of an accordion item.\n */\n@Directive({\n selector: '[ngpAccordionContent]',\n exportAs: 'ngpAccordionContent',\n host: {\n role: 'region',\n '[id]': 'id()',\n '[attr.data-orientation]': 'accordion().orientation()',\n '[attr.data-open]': 'accordionItem().open() ? \"\" : null',\n '[attr.data-closed]': 'accordionItem().open() ? null : \"\"',\n '[attr.aria-labelledby]': 'accordionItem().triggerId()',\n '[style.--ngp-accordion-content-width.px]': 'width()',\n '[style.--ngp-accordion-content-height.px]': 'height()',\n },\n})\nexport class NgpAccordionContent<T> {\n /**\n * Access the accordion content element reference\n */\n private readonly elementRef = injectElementRef();\n\n /**\n * Access the accordion\n */\n protected readonly accordion = injectAccordionState<NgpAccordion<T>>();\n\n /**\n * Access the accordion item\n */\n protected readonly accordionItem = injectAccordionItemState();\n\n /**\n * The id of the content region\n */\n readonly id = input<string>(uniqueId('ngp-accordion-content'));\n\n /**\n * The content width\n */\n readonly width = signal<number>(0);\n\n /**\n * The content height\n */\n readonly height = signal<number>(0);\n\n constructor() {\n this.accordionItem().content.set(this);\n\n afterRenderEffect(() => {\n if (this.accordionItem().open()) {\n this.width.set(this.elementRef.nativeElement.scrollWidth);\n this.height.set(this.elementRef.nativeElement.scrollHeight);\n }\n });\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, OnInit, booleanAttribute, computed, input, signal } from '@angular/core';\nimport { NgpAccordionContent } from '../accordion-content/accordion-content';\nimport { NgpAccordionTrigger } from '../accordion-trigger/accordion-trigger';\nimport { NgpAccordion } from '../accordion/accordion';\nimport { injectAccordionState } from '../accordion/accordion-state';\nimport { accordionItemState, provideAccordionItemState } from './accordion-item-state';\n\n/**\n * Apply the `ngpAccordionItem` directive to an element that represents an accordion item.\n */\n@Directive({\n selector: '[ngpAccordionItem]',\n exportAs: 'ngpAccordionItem',\n providers: [provideAccordionItemState()],\n host: {\n '[attr.data-orientation]': 'accordion().orientation()',\n '[attr.data-open]': 'state.open() ? \"\" : null',\n '[attr.data-disabled]': 'state.disabled() || accordion().disabled() ? \"\" : null',\n },\n})\nexport class NgpAccordionItem<T> implements OnInit {\n /**\n * Access the accordion.\n */\n protected readonly accordion = injectAccordionState<NgpAccordion<T>>();\n\n /**\n * The value of the accordion item.\n */\n readonly value = input<T>(undefined, {\n alias: 'ngpAccordionItemValue',\n });\n\n /**\n * Whether the accordion item is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpAccordionItemDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Access the accordion trigger\n * @internal\n */\n readonly trigger = signal<NgpAccordionTrigger<T> | undefined>(undefined);\n\n /**\n * Access the accordion content\n * @internal\n */\n readonly content = signal<NgpAccordionContent<T> | undefined>(undefined);\n\n /**\n * Whether the accordion item is expanded.\n */\n readonly open = computed<boolean>(() => this.accordion().isOpen(this.state.value()!));\n\n /**\n * The trigger id.\n */\n readonly triggerId = computed(() => this.trigger()?.id());\n\n /**\n * The content id.\n */\n readonly contentId = computed(() => this.content()?.id());\n\n /**\n * The accordion item state.\n */\n private readonly state = accordionItemState<NgpAccordionItem<T>>(this);\n\n ngOnInit(): void {\n if (!this.state.value()) {\n throw new Error('The accordion item value is required');\n }\n }\n}\n","import { Directive, HostListener, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { NgpAccordionItem } from '../accordion-item/accordion-item';\nimport { injectAccordionItemState } from '../accordion-item/accordion-item-state';\nimport { NgpAccordion } from '../accordion/accordion';\nimport { injectAccordionState } from '../accordion/accordion-state';\n\n/**\n * Apply the `ngpAccordionTrigger` directive to an element that represents the trigger for an accordion item, such as a button.\n */\n@Directive({\n selector: '[ngpAccordionTrigger]',\n exportAs: 'ngpAccordionTrigger',\n host: {\n '[id]': 'id()',\n '[attr.data-orientation]': 'accordion().orientation()',\n '[attr.data-open]': 'accordionItem().open() ? \"\" : null',\n '[attr.data-disabled]': 'accordionItem().disabled() || accordion().disabled() ? \"\" : null',\n '[attr.aria-controls]': 'accordionItem().contentId()',\n '[attr.aria-expanded]': 'accordionItem().open()',\n },\n})\nexport class NgpAccordionTrigger<T> {\n /**\n * Access the parent accordion.\n */\n protected readonly accordion = injectAccordionState<NgpAccordion<T>>();\n\n /**\n * The item instance.\n */\n protected readonly accordionItem = injectAccordionItemState<NgpAccordionItem<T>>();\n\n /**\n * The id of the trigger.\n */\n readonly id = input<string>(uniqueId('ngp-accordion-trigger'));\n\n constructor() {\n this.accordionItem().trigger.set(this);\n }\n\n /**\n * Toggle the accordion item.\n */\n @HostListener('click')\n toggle(): void {\n if (this.accordionItem().disabled() || this.accordion().disabled()) {\n return;\n }\n\n this.accordion().toggle(this.accordionItem().value()!);\n }\n}\n","import { InjectionToken, Provider, inject } from '@angular/core';\nimport { NgpAccordionType } from '../accordion/accordion';\n\nexport interface NgpAccordionConfig {\n /**\n * The default type of the accordion\n * @default 'single'\n */\n type: NgpAccordionType;\n /**\n * Whether the accordion is collapsible\n * @default false\n */\n collapsible: boolean;\n /**\n * The default orientation of the accordion\n * @default 'vertical'\n */\n orientation: 'vertical' | 'horizontal';\n}\n\nexport const defaultAccordionConfig: NgpAccordionConfig = {\n type: 'single',\n collapsible: false,\n orientation: 'vertical',\n};\n\nexport const NgpAccordionConfigToken = new InjectionToken<NgpAccordionConfig>(\n 'NgpAccordionConfigToken',\n);\n\n/**\n * Provide the default Accordion configuration\n * @param config The Accordion configuration\n * @returns The provider\n */\nexport function provideAccordionConfig(config: Partial<NgpAccordionConfig>): Provider[] {\n return [\n {\n provide: NgpAccordionConfigToken,\n useValue: { ...defaultAccordionConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Accordion configuration\n * @returns The global Accordion configuration\n */\nexport function injectAccordionConfig(): NgpAccordionConfig {\n return inject(NgpAccordionConfigToken, { optional: true }) ?? defaultAccordionConfig;\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input, output } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\nimport { injectAccordionConfig } from '../config/accordion-config';\nimport { accordionState, provideAccordionState } from './accordion-state';\n\n/**\n * Apply the `ngpAccordion` directive to an element that represents the group of accordion items.\n */\n@Directive({\n selector: '[ngpAccordion]',\n exportAs: 'ngpAccordion',\n providers: [provideAccordionState()],\n host: {\n '[attr.data-orientation]': 'state.orientation()',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n },\n})\nexport class NgpAccordion<T> {\n /**\n * Access the global accordion configuration.\n */\n private readonly config = injectAccordionConfig();\n\n /**\n * The type of the accordion.\n */\n readonly type = input<NgpAccordionType>(this.config.type, {\n alias: 'ngpAccordionType',\n });\n\n /**\n * Whether the accordion is collapsible.\n */\n readonly collapsible = input<boolean, BooleanInput>(this.config.collapsible, {\n alias: 'ngpAccordionCollapsible',\n transform: booleanAttribute,\n });\n\n /**\n * The value of the accordion.\n */\n readonly value = input<T | T[] | null>(null, {\n alias: 'ngpAccordionValue',\n });\n\n /**\n * Event emitted when the accordion value changes.\n */\n readonly valueChange = output<T | T[] | null>({\n alias: 'ngpAccordionValueChange',\n });\n\n /**\n * Whether the accordion is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpAccordionDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The accordion orientation.\n */\n readonly orientation = input<NgpOrientation>(this.config.orientation, {\n alias: 'ngpAccordionOrientation',\n });\n\n /**\n * The accordion state.\n */\n private readonly state = accordionState<NgpAccordion<T>>(this);\n\n /**\n * @param value The value to check.\n * @returns Whether the value is open.\n * @internal\n */\n isOpen(value: T): boolean {\n if (this.state.type() === 'multiple') {\n return (this.state.value() as T[] | null)?.includes(value) ?? false;\n }\n\n return this.state.value() === value;\n }\n\n toggle(value: T): void {\n const isOpen = this.isOpen(value);\n\n // if we are in single mode and the value is already open and the accordion is not collapsible, do nothing\n if (this.state.type() === 'single' && isOpen && !this.state.collapsible()) {\n return;\n }\n\n // if we are in single mode then toggle the value\n if (this.state.type() === 'single') {\n this.state.value.set(isOpen ? null : value);\n this.valueChange.emit(this.state.value());\n return;\n }\n\n // if we are in multiple mode then toggle the value\n const values = (this.state.value() as T[]) ?? [];\n\n if (isOpen) {\n this.state.value.set(values.filter(v => v !== value));\n } else {\n this.state.value.set([...values, value]);\n }\n this.valueChange.emit(this.state.value());\n }\n}\n\nexport type NgpAccordionType = 'single' | 'multiple';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAQA;;AAEG;AACI,MAAM,0BAA0B,GACrC,gBAAgB,CAA4B,eAAe,CAAC;AAE9D;;AAEG;MACU,yBAAyB,GAAG,mBAAmB,CAAC,0BAA0B;A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ion-item/accordion-item-state.ts","../../../../packages/ng-primitives/accordion/src/accordion/accordion-state.ts","../../../../packages/ng-primitives/accordion/src/accordion-content/accordion-content.ts","../../../../packages/ng-primitives/accordion/src/accordion-item/accordion-item.ts","../../../../packages/ng-primitives/accordion/src/accordion-trigger/accordion-trigger.ts","../../../../packages/ng-primitives/accordion/src/config/accordion-config.ts","../../../../packages/ng-primitives/accordion/src/accordion/accordion.ts","../../../../packages/ng-primitives/accordion/src/ng-primitives-accordion.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpAccordionItem } from './accordion-item';\n\n/**\n * The state token for the AccordionItem primitive.\n */\nexport const NgpAccordionItemStateToken =\n createStateToken<NgpAccordionItem<unknown>>('AccordionItem');\n\n/**\n * Provides the AccordionItem state.\n */\nexport const provideAccordionItemState = createStateProvider(NgpAccordionItemStateToken);\n\n/**\n * Injects the AccordionItem state.\n */\nexport const injectAccordionItemState = createStateInjector(NgpAccordionItemStateToken);\n\n/**\n * The AccordionItem state registration function.\n */\nexport const accordionItemState = createState(NgpAccordionItemStateToken);\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpAccordion } from './accordion';\n\n/**\n * The state token for the Accordion primitive.\n */\nexport const NgpAccordionStateToken = createStateToken<NgpAccordion<unknown>>('Accordion');\n\n/**\n * Provides the Accordion state.\n */\nexport const provideAccordionState = createStateProvider(NgpAccordionStateToken);\n\n/**\n * Injects the Accordion state.\n */\nexport const injectAccordionState = createStateInjector(NgpAccordionStateToken);\n\n/**\n * The Accordion state registration function.\n */\nexport const accordionState = createState(NgpAccordionStateToken);\n","import { afterRenderEffect, Directive, input, signal } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectAccordionItemState } from '../accordion-item/accordion-item-state';\nimport type { NgpAccordion } from '../accordion/accordion';\nimport { injectAccordionState } from '../accordion/accordion-state';\n\n/**\n * Apply the `ngpAccordionContent` directive to an element that represents the content of an accordion item.\n */\n@Directive({\n selector: '[ngpAccordionContent]',\n exportAs: 'ngpAccordionContent',\n host: {\n role: 'region',\n '[id]': 'id()',\n '[attr.data-orientation]': 'accordion().orientation()',\n '[attr.data-open]': 'accordionItem().open() ? \"\" : null',\n '[attr.data-closed]': 'accordionItem().open() ? null : \"\"',\n '[attr.aria-labelledby]': 'accordionItem().triggerId()',\n '[style.--ngp-accordion-content-width.px]': 'width()',\n '[style.--ngp-accordion-content-height.px]': 'height()',\n },\n})\nexport class NgpAccordionContent<T> {\n /**\n * Access the accordion content element reference\n */\n private readonly elementRef = injectElementRef();\n\n /**\n * Access the accordion\n */\n protected readonly accordion = injectAccordionState<NgpAccordion<T>>();\n\n /**\n * Access the accordion item\n */\n protected readonly accordionItem = injectAccordionItemState();\n\n /**\n * The id of the content region\n */\n readonly id = input<string>(uniqueId('ngp-accordion-content'));\n\n /**\n * The content width\n */\n readonly width = signal<number>(0);\n\n /**\n * The content height\n */\n readonly height = signal<number>(0);\n\n constructor() {\n this.accordionItem().content.set(this);\n\n afterRenderEffect(() => {\n if (this.accordionItem().open()) {\n this.width.set(this.elementRef.nativeElement.scrollWidth);\n this.height.set(this.elementRef.nativeElement.scrollHeight);\n }\n });\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, OnInit, booleanAttribute, computed, input, signal } from '@angular/core';\nimport { NgpAccordionContent } from '../accordion-content/accordion-content';\nimport { NgpAccordionTrigger } from '../accordion-trigger/accordion-trigger';\nimport { NgpAccordion } from '../accordion/accordion';\nimport { injectAccordionState } from '../accordion/accordion-state';\nimport { accordionItemState, provideAccordionItemState } from './accordion-item-state';\n\n/**\n * Apply the `ngpAccordionItem` directive to an element that represents an accordion item.\n */\n@Directive({\n selector: '[ngpAccordionItem]',\n exportAs: 'ngpAccordionItem',\n providers: [provideAccordionItemState()],\n host: {\n '[attr.data-orientation]': 'accordion().orientation()',\n '[attr.data-open]': 'state.open() ? \"\" : null',\n '[attr.data-disabled]': 'state.disabled() || accordion().disabled() ? \"\" : null',\n },\n})\nexport class NgpAccordionItem<T> implements OnInit {\n /**\n * Access the accordion.\n */\n protected readonly accordion = injectAccordionState<NgpAccordion<T>>();\n\n /**\n * The value of the accordion item.\n */\n readonly value = input<T>(undefined, {\n alias: 'ngpAccordionItemValue',\n });\n\n /**\n * Whether the accordion item is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpAccordionItemDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Access the accordion trigger\n * @internal\n */\n readonly trigger = signal<NgpAccordionTrigger<T> | undefined>(undefined);\n\n /**\n * Access the accordion content\n * @internal\n */\n readonly content = signal<NgpAccordionContent<T> | undefined>(undefined);\n\n /**\n * Whether the accordion item is expanded.\n */\n readonly open = computed<boolean>(() => this.accordion().isOpen(this.state.value()!));\n\n /**\n * The trigger id.\n */\n readonly triggerId = computed(() => this.trigger()?.id());\n\n /**\n * The content id.\n */\n readonly contentId = computed(() => this.content()?.id());\n\n /**\n * The accordion item state.\n */\n private readonly state = accordionItemState<NgpAccordionItem<T>>(this);\n\n ngOnInit(): void {\n if (!this.state.value()) {\n throw new Error('The accordion item value is required');\n }\n }\n}\n","import { Directive, HOST_TAG_NAME, HostListener, inject, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { NgpAccordionItem } from '../accordion-item/accordion-item';\nimport { injectAccordionItemState } from '../accordion-item/accordion-item-state';\nimport { NgpAccordion } from '../accordion/accordion';\nimport { injectAccordionState } from '../accordion/accordion-state';\n\n/**\n * Apply the `ngpAccordionTrigger` directive to an element that represents the trigger for an accordion item, such as a button.\n */\n@Directive({\n selector: '[ngpAccordionTrigger]',\n exportAs: 'ngpAccordionTrigger',\n host: {\n '[id]': 'id()',\n '[attr.type]': 'tagName === \"button\" ? \"button\" : null',\n '[attr.data-orientation]': 'accordion().orientation()',\n '[attr.data-open]': 'accordionItem().open() ? \"\" : null',\n '[attr.data-disabled]': 'accordionItem().disabled() || accordion().disabled() ? \"\" : null',\n '[attr.aria-controls]': 'accordionItem().contentId()',\n '[attr.aria-expanded]': 'accordionItem().open()',\n },\n})\nexport class NgpAccordionTrigger<T> {\n /**\n * The tag name of the element.\n */\n protected readonly tagName = inject(HOST_TAG_NAME);\n\n /**\n * Access the parent accordion.\n */\n protected readonly accordion = injectAccordionState<NgpAccordion<T>>();\n\n /**\n * The item instance.\n */\n protected readonly accordionItem = injectAccordionItemState<NgpAccordionItem<T>>();\n\n /**\n * The id of the trigger.\n */\n readonly id = input<string>(uniqueId('ngp-accordion-trigger'));\n\n constructor() {\n this.accordionItem().trigger.set(this);\n }\n\n /**\n * Toggle the accordion item.\n */\n @HostListener('click')\n toggle(): void {\n if (this.accordionItem().disabled() || this.accordion().disabled()) {\n return;\n }\n\n this.accordion().toggle(this.accordionItem().value()!);\n }\n}\n","import { InjectionToken, Provider, inject } from '@angular/core';\nimport { NgpAccordionType } from '../accordion/accordion';\n\nexport interface NgpAccordionConfig {\n /**\n * The default type of the accordion\n * @default 'single'\n */\n type: NgpAccordionType;\n /**\n * Whether the accordion is collapsible\n * @default false\n */\n collapsible: boolean;\n /**\n * The default orientation of the accordion\n * @default 'vertical'\n */\n orientation: 'vertical' | 'horizontal';\n}\n\nexport const defaultAccordionConfig: NgpAccordionConfig = {\n type: 'single',\n collapsible: false,\n orientation: 'vertical',\n};\n\nexport const NgpAccordionConfigToken = new InjectionToken<NgpAccordionConfig>(\n 'NgpAccordionConfigToken',\n);\n\n/**\n * Provide the default Accordion configuration\n * @param config The Accordion configuration\n * @returns The provider\n */\nexport function provideAccordionConfig(config: Partial<NgpAccordionConfig>): Provider[] {\n return [\n {\n provide: NgpAccordionConfigToken,\n useValue: { ...defaultAccordionConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Accordion configuration\n * @returns The global Accordion configuration\n */\nexport function injectAccordionConfig(): NgpAccordionConfig {\n return inject(NgpAccordionConfigToken, { optional: true }) ?? defaultAccordionConfig;\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input, output } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\nimport { injectAccordionConfig } from '../config/accordion-config';\nimport { accordionState, provideAccordionState } from './accordion-state';\n\n/**\n * Apply the `ngpAccordion` directive to an element that represents the group of accordion items.\n */\n@Directive({\n selector: '[ngpAccordion]',\n exportAs: 'ngpAccordion',\n providers: [provideAccordionState()],\n host: {\n '[attr.data-orientation]': 'state.orientation()',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n },\n})\nexport class NgpAccordion<T> {\n /**\n * Access the global accordion configuration.\n */\n private readonly config = injectAccordionConfig();\n\n /**\n * The type of the accordion.\n */\n readonly type = input<NgpAccordionType>(this.config.type, {\n alias: 'ngpAccordionType',\n });\n\n /**\n * Whether the accordion is collapsible.\n */\n readonly collapsible = input<boolean, BooleanInput>(this.config.collapsible, {\n alias: 'ngpAccordionCollapsible',\n transform: booleanAttribute,\n });\n\n /**\n * The value of the accordion.\n */\n readonly value = input<T | T[] | null>(null, {\n alias: 'ngpAccordionValue',\n });\n\n /**\n * Event emitted when the accordion value changes.\n */\n readonly valueChange = output<T | T[] | null>({\n alias: 'ngpAccordionValueChange',\n });\n\n /**\n * Whether the accordion is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpAccordionDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The accordion orientation.\n */\n readonly orientation = input<NgpOrientation>(this.config.orientation, {\n alias: 'ngpAccordionOrientation',\n });\n\n /**\n * The accordion state.\n */\n private readonly state = accordionState<NgpAccordion<T>>(this);\n\n /**\n * @param value The value to check.\n * @returns Whether the value is open.\n * @internal\n */\n isOpen(value: T): boolean {\n if (this.state.type() === 'multiple') {\n return (this.state.value() as T[] | null)?.includes(value) ?? false;\n }\n\n return this.state.value() === value;\n }\n\n toggle(value: T): void {\n const isOpen = this.isOpen(value);\n\n // if we are in single mode and the value is already open and the accordion is not collapsible, do nothing\n if (this.state.type() === 'single' && isOpen && !this.state.collapsible()) {\n return;\n }\n\n // if we are in single mode then toggle the value\n if (this.state.type() === 'single') {\n this.state.value.set(isOpen ? null : value);\n this.valueChange.emit(this.state.value());\n return;\n }\n\n // if we are in multiple mode then toggle the value\n const values = (this.state.value() as T[]) ?? [];\n\n if (isOpen) {\n this.state.value.set(values.filter(v => v !== value));\n } else {\n this.state.value.set([...values, value]);\n }\n this.valueChange.emit(this.state.value());\n }\n}\n\nexport type NgpAccordionType = 'single' | 'multiple';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAQA;;AAEG;AACI,MAAM,0BAA0B,GACrC,gBAAgB,CAA4B,eAAe,CAAC;AAE9D;;AAEG;MACU,yBAAyB,GAAG,mBAAmB,CAAC,0BAA0B;AAEvF;;AAEG;MACU,wBAAwB,GAAG,mBAAmB,CAAC,0BAA0B;AAEtF;;AAEG;AACI,MAAM,kBAAkB,GAAG,WAAW,CAAC,0BAA0B,CAAC;;ACnBzE;;AAEG;AACI,MAAM,sBAAsB,GAAG,gBAAgB,CAAwB,WAAW,CAAC;AAE1F;;AAEG;MACU,qBAAqB,GAAG,mBAAmB,CAAC,sBAAsB;AAE/E;;AAEG;MACU,oBAAoB,GAAG,mBAAmB,CAAC,sBAAsB;AAE9E;;AAEG;AACI,MAAM,cAAc,GAAG,WAAW,CAAC,sBAAsB,CAAC;;ACnBjE;;AAEG;MAeU,mBAAmB,CAAA;AA+B9B,IAAA,WAAA,GAAA;AA9BA;;AAEG;QACc,IAAU,CAAA,UAAA,GAAG,gBAAgB,EAAE;AAEhD;;AAEG;QACgB,IAAS,CAAA,SAAA,GAAG,oBAAoB,EAAmB;AAEtE;;AAEG;QACgB,IAAa,CAAA,aAAA,GAAG,wBAAwB,EAAE;AAE7D;;AAEG;QACM,IAAE,CAAA,EAAA,GAAG,KAAK,CAAS,QA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,EAAA,OAAA,EAAA,EAAA,WAAA,EAAA,yBAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,uBAAA,EAAA,qBAAA,EAAA,oBAAA,EAAA,gCAAA,EAAA,EAAA,EAAA,SAAA,EAAA,CAAC,qBAAqB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAMzB,YAAY,EAAA,UAAA,EAAA,CAAA;kBATxB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,SAAS,EAAE,CAAC,qBAAqB,EAAE,CAAC;AACpC,oBAAA,IAAI,EAAE;AACJ,wBAAA,yBAAyB,EAAE,qBAAqB;AAChD,wBAAA,sBAAsB,EAAE,8BAA8B;AACvD,qBAAA;AACF,iBAAA;;;ACjBD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, output,
|
|
2
|
+
import { signal, output, HostListener, Directive } from '@angular/core';
|
|
3
3
|
import { injectStyleInjector } from 'ng-primitives/internal';
|
|
4
4
|
|
|
5
5
|
class NgpAutofill {
|
|
@@ -43,10 +43,10 @@ class NgpAutofill {
|
|
|
43
43
|
this.autofillChange.emit(false);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
47
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.
|
|
46
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpAutofill, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
47
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: NgpAutofill, isStandalone: true, selector: "[ngpAutofill]", outputs: { autofillChange: "ngpAutofill" }, host: { listeners: { "animationstart": "onAnimationStart($event)" }, properties: { "attr.data-autofill": "autofilled() ? \"\" : null" } }, exportAs: ["ngpAutofill"], ngImport: i0 }); }
|
|
48
48
|
}
|
|
49
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpAutofill, decorators: [{
|
|
50
50
|
type: Directive,
|
|
51
51
|
args: [{
|
|
52
52
|
selector: '[ngpAutofill]',
|
|
@@ -47,10 +47,10 @@ class NgpAvatar {
|
|
|
47
47
|
setStatus(status) {
|
|
48
48
|
this.status.set(status);
|
|
49
49
|
}
|
|
50
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
51
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.
|
|
50
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpAvatar, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
51
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: NgpAvatar, isStandalone: true, selector: "[ngpAvatar]", host: { properties: { "attr.data-status": "status()" } }, providers: [provideAvatarState()], exportAs: ["ngpAvatar"], hostDirectives: [{ directive: i1.NgpHover }, { directive: i1.NgpFocusVisible }, { directive: i1.NgpPress }], ngImport: i0 }); }
|
|
52
52
|
}
|
|
53
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
53
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpAvatar, decorators: [{
|
|
54
54
|
type: Directive,
|
|
55
55
|
args: [{
|
|
56
56
|
selector: '[ngpAvatar]',
|
|
@@ -135,10 +135,10 @@ class NgpAvatarFallback {
|
|
|
135
135
|
ngOnInit() {
|
|
136
136
|
this.disposables.setTimeout(() => this.delayElapsed.set(true), this.delay());
|
|
137
137
|
}
|
|
138
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
139
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.
|
|
138
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpAvatarFallback, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
139
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: NgpAvatarFallback, isStandalone: true, selector: "[ngpAvatarFallback]", inputs: { delay: { classPropertyName: "delay", publicName: "ngpAvatarFallbackDelay", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.display": "visible() ? null : \"none\"" } }, exportAs: ["ngpAvatarFallback"], ngImport: i0 }); }
|
|
140
140
|
}
|
|
141
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
141
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpAvatarFallback, decorators: [{
|
|
142
142
|
type: Directive,
|
|
143
143
|
args: [{
|
|
144
144
|
selector: '[ngpAvatarFallback]',
|
|
@@ -190,10 +190,10 @@ class NgpAvatarImage {
|
|
|
190
190
|
// if the state is loaded then we should make the image visible
|
|
191
191
|
this.visuallyHidden().setVisibility(state === NgpAvatarStatus.Loaded);
|
|
192
192
|
}
|
|
193
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
194
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.
|
|
193
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpAvatarImage, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
194
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: NgpAvatarImage, isStandalone: true, selector: "img[ngpAvatarImage]", host: { listeners: { "load": "onLoad()", "error": "onError()" } }, exportAs: ["ngpAvatarImage"], hostDirectives: [{ directive: i1$1.NgpVisuallyHidden }], ngImport: i0 }); }
|
|
195
195
|
}
|
|
196
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
196
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpAvatarImage, decorators: [{
|
|
197
197
|
type: Directive,
|
|
198
198
|
args: [{
|
|
199
199
|
selector: 'img[ngpAvatarImage]',
|
|
@@ -56,10 +56,10 @@ class NgpButton {
|
|
|
56
56
|
focusVisible: true,
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
60
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.
|
|
59
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpButton, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
60
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: NgpButton, isStandalone: true, selector: "[ngpButton]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-disabled": "state.disabled() ? \"\" : null", "attr.disabled": "isButton && state.disabled() ? true : null" } }, providers: [provideButtonState()], exportAs: ["ngpButton"], ngImport: i0 }); }
|
|
61
61
|
}
|
|
62
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
62
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpButton, decorators: [{
|
|
63
63
|
type: Directive,
|
|
64
64
|
args: [{
|
|
65
65
|
selector: '[ngpButton]',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, booleanAttribute, output,
|
|
2
|
+
import { input, booleanAttribute, output, HostListener, Directive } from '@angular/core';
|
|
3
3
|
import * as i1 from 'ng-primitives/form-field';
|
|
4
4
|
import { syncFormControl, NgpFormControl } from 'ng-primitives/form-field';
|
|
5
5
|
import { setupInteractions } from 'ng-primitives/internal';
|
|
@@ -103,10 +103,10 @@ class NgpCheckbox {
|
|
|
103
103
|
this.indeterminateChange.emit(false);
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
107
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.
|
|
106
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
107
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: NgpCheckbox, isStandalone: true, selector: "[ngpCheckbox]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "ngpCheckboxChecked", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "ngpCheckboxIndeterminate", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "ngpCheckboxRequired", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpCheckboxDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checkedChange: "ngpCheckboxCheckedChange", indeterminateChange: "ngpCheckboxIndeterminateChange" }, host: { attributes: { "role": "checkbox" }, listeners: { "keydown.enter": "onEnter($event)", "click": "toggle($event)", "keydown.space": "toggle($event)" }, properties: { "attr.aria-checked": "state.indeterminate() ? \"mixed\" : state.checked()", "attr.data-checked": "state.checked() ? \"\" : null", "attr.data-indeterminate": "state.indeterminate() ? \"\" : null", "attr.aria-disabled": "state.disabled()", "tabindex": "state.disabled() ? -1 : 0" } }, providers: [provideCheckboxState()], hostDirectives: [{ directive: i1.NgpFormControl }], ngImport: i0 }); }
|
|
108
108
|
}
|
|
109
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
109
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpCheckbox, decorators: [{
|
|
110
110
|
type: Directive,
|
|
111
111
|
args: [{
|
|
112
112
|
selector: '[ngpCheckbox]',
|
|
@@ -17,10 +17,10 @@ class NgpHeader {
|
|
|
17
17
|
*/
|
|
18
18
|
this.id = input(uniqueId('ngp-header'));
|
|
19
19
|
}
|
|
20
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
21
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.
|
|
20
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpHeader, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
21
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: NgpHeader, isStandalone: true, selector: "[ngpHeader]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "presentation" }, properties: { "attr.id": "id()" } }, providers: [{ provide: NgpHeaderToken, useExisting: NgpHeader }], exportAs: ["ngpHeader"], ngImport: i0 }); }
|
|
22
22
|
}
|
|
23
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpHeader, decorators: [{
|
|
24
24
|
type: Directive,
|
|
25
25
|
args: [{
|
|
26
26
|
selector: '[ngpHeader]',
|