ng-primitives 0.35.0 → 0.36.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/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/fesm2022/ng-primitives-file-upload.mjs +6 -4
- package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
- package/fesm2022/ng-primitives-internal.mjs +73 -50
- package/fesm2022/ng-primitives-internal.mjs.map +1 -1
- package/fesm2022/ng-primitives-popover.mjs +95 -59
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-radio.mjs +4 -0
- package/fesm2022/ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/ng-primitives-state.mjs +10 -3
- package/fesm2022/ng-primitives-state.mjs.map +1 -1
- package/fesm2022/ng-primitives-tabs.mjs +17 -22
- package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs +94 -43
- 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/form-field/form-control/form-control-state.d.ts +1 -1
- 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 +2 -2
- package/package.json +5 -5
- package/pagination/pagination/pagination-state.d.ts +1 -1
- package/popover/index.d.ts +1 -0
- package/popover/popover/popover-token.d.ts +10 -0
- package/popover/popover/popover.d.ts +3 -2
- 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 +1 -1
- 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 +1 -1
- package/schematics/ng-generate/schema.d.ts +3 -1
- package/schematics/ng-generate/schema.json +3 -1
- 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 +29 -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 +1 -1
- 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 +2 -2
- package/tabs/tabset/tabset-state.d.ts +1 -1
- 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 +1 -1
- package/toggle-group/toggle-group-item/toggle-group-item-state.d.ts +1 -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 +39 -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
|
*/
|
|
@@ -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
|
*/
|
|
@@ -31,11 +31,12 @@ class NgpFileDropzone {
|
|
|
31
31
|
*/
|
|
32
32
|
this.elementRef = inject(ElementRef);
|
|
33
33
|
/**
|
|
34
|
-
* The accepted file types.
|
|
34
|
+
* The accepted file types. This can be an array of strings or a comma-separated string.
|
|
35
|
+
* Accepted types can either be file extensions (e.g. `.jpg`) or MIME types (e.g. `image/jpeg`).
|
|
35
36
|
*/
|
|
36
37
|
this.fileTypes = input(undefined, {
|
|
37
38
|
alias: 'ngpFileDropzoneFileTypes',
|
|
38
|
-
transform: coerceStringArray,
|
|
39
|
+
transform: types => coerceStringArray(types, ','),
|
|
39
40
|
});
|
|
40
41
|
/**
|
|
41
42
|
* Whether to allow multiple files to be selected.
|
|
@@ -176,11 +177,12 @@ class NgpFileUpload {
|
|
|
176
177
|
*/
|
|
177
178
|
this.elementRef = inject(ElementRef);
|
|
178
179
|
/**
|
|
179
|
-
* The accepted file types.
|
|
180
|
+
* The accepted file types. This can be an array of strings or a comma-separated string.
|
|
181
|
+
* Accepted types can either be file extensions (e.g. `.jpg`) or MIME types (e.g. `image/jpeg`).
|
|
180
182
|
*/
|
|
181
183
|
this.fileTypes = input(undefined, {
|
|
182
184
|
alias: 'ngpFileUploadFileTypes',
|
|
183
|
-
transform: coerceStringArray,
|
|
185
|
+
transform: types => coerceStringArray(types, ','),
|
|
184
186
|
});
|
|
185
187
|
/**
|
|
186
188
|
* Whether to allow multiple files to be selected.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-file-upload.mjs","sources":["../../../../packages/ng-primitives/file-upload/src/file-dropzone/file-dropzone-state.ts","../../../../packages/ng-primitives/file-upload/src/file-dropzone/file-dropzone.ts","../../../../packages/ng-primitives/file-upload/src/file-upload/file-upload-state.ts","../../../../packages/ng-primitives/file-upload/src/file-upload/file-upload.ts","../../../../packages/ng-primitives/file-upload/src/ng-primitives-file-upload.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpFileDropzone } from './file-dropzone';\n\n/**\n * The state token for the FileDropzone primitive.\n */\nexport const NgpFileDropzoneStateToken = createStateToken<NgpFileDropzone>('FileDropzone');\n\n/**\n * Provides the FileDropzone state.\n */\nexport const provideFileDropzoneState = createStateProvider(NgpFileDropzoneStateToken);\n\n/**\n * Injects the FileDropzone state.\n */\nexport const injectFileDropzoneState = createStateInjector(NgpFileDropzoneStateToken);\n\n/**\n * The FileDropzone state registration function.\n */\nexport const fileDropzoneState = createState(NgpFileDropzoneStateToken);\n","import { BooleanInput, coerceStringArray } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n Directive,\n ElementRef,\n HostListener,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { setupHover } from 'ng-primitives/internal';\nimport { fileDropzoneState, provideFileDropzoneState } from './file-dropzone-state';\n\n/**\n * Capture files dropped on the element.\n */\n@Directive({\n selector: '[ngpFileDropzone]',\n exportAs: 'ngpFileDropzone',\n providers: [provideFileDropzoneState()],\n host: {\n '[attr.data-dragover]': 'isDragOver() ? \"\" : null',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n },\n})\nexport class NgpFileDropzone {\n /**\n * Access the host element.\n */\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * The accepted file types.\n */\n readonly fileTypes = input<string[] | undefined, string>(undefined, {\n alias: 'ngpFileDropzoneFileTypes',\n transform: coerceStringArray,\n });\n\n /**\n * Whether to allow multiple files to be selected.\n */\n readonly multiple = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileDropzoneMultiple',\n transform: booleanAttribute,\n });\n\n /**\n * Whether to allow the user to select directories.\n */\n readonly directory = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileDropzoneDirectory',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the file upload is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileDropzoneDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emits when the user selects files.\n */\n readonly selected = output<FileList | null>({\n alias: 'ngpFileDropzoneSelected',\n });\n\n /**\n * Emits when the user drags a file over the file upload.\n */\n readonly dragOver = output<boolean>({\n alias: 'ngpFileDropzoneDragOver',\n });\n\n /**\n * Whether the user is currently dragging a file over the file upload.\n */\n protected readonly isDragOver = signal<boolean>(false);\n\n /**\n * The file upload state.\n */\n private readonly state = fileDropzoneState<NgpFileDropzone>(this);\n\n constructor() {\n setupHover({ disabled: this.state.disabled });\n }\n\n @HostListener('dragenter', ['$event'])\n protected onDragEnter(event: DragEvent): void {\n if (this.state.disabled()) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n this.isDragOver.set(true);\n this.dragOver.emit(true);\n }\n\n @HostListener('dragover', ['$event'])\n protected onDragOver(event: DragEvent): void {\n if (this.state.disabled()) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n this.isDragOver.set(true);\n }\n\n @HostListener('dragleave', ['$event'])\n protected onDragLeave(event: DragEvent): void {\n if (this.state.disabled() || !this.isDragOver()) {\n return;\n }\n\n // if the element we are dragging over is a child of the file upload, ignore the event\n if (this.elementRef.nativeElement.contains(event.relatedTarget as Node)) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n this.isDragOver.set(false);\n this.dragOver.emit(false);\n }\n\n @HostListener('drop', ['$event'])\n protected onDrop(event: DragEvent): void {\n if (this.state.disabled()) {\n return;\n }\n\n event.preventDefault();\n this.isDragOver.set(false);\n this.dragOver.emit(false);\n\n if (event.dataTransfer?.files) {\n this.selected.emit(event.dataTransfer.files);\n }\n }\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpFileUpload } from './file-upload';\n\n/**\n * The state token for the FileUpload primitive.\n */\nexport const NgpFileUploadStateToken = createStateToken<NgpFileUpload>('FileUpload');\n\n/**\n * Provides the FileUpload state.\n */\nexport const provideFileUploadState = createStateProvider(NgpFileUploadStateToken);\n\n/**\n * Injects the FileUpload state.\n */\nexport const injectFileUploadState = createStateInjector(NgpFileUploadStateToken);\n\n/**\n * The FileUpload state registration function.\n */\nexport const fileUploadState = createState(NgpFileUploadStateToken);\n","import { BooleanInput, coerceStringArray } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n Directive,\n ElementRef,\n HostListener,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { setupInteractions } from 'ng-primitives/internal';\nimport { fileUploadState, provideFileUploadState } from './file-upload-state';\n\n/**\n * A directive that allows you to turn any element into a file upload trigger.\n */\n@Directive({\n selector: '[ngpFileUpload]',\n exportAs: 'ngpFileUpload',\n providers: [provideFileUploadState()],\n host: {\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n '[attr.data-dragover]': 'isDragOver() ? \"\" : null',\n },\n})\nexport class NgpFileUpload {\n /**\n * Access the host element.\n */\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * The accepted file types.\n */\n readonly fileTypes = input<string[] | undefined, string>(undefined, {\n alias: 'ngpFileUploadFileTypes',\n transform: coerceStringArray,\n });\n\n /**\n * Whether to allow multiple files to be selected.\n */\n readonly multiple = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileUploadMultiple',\n transform: booleanAttribute,\n });\n\n /**\n * Whether to allow the user to select directories.\n */\n readonly directory = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileUploadDirectory',\n transform: booleanAttribute,\n });\n\n /**\n * Whether drag-and-drop is enabled.\n */\n readonly dragAndDrop = input<boolean, BooleanInput>(true, {\n alias: 'ngpFileUploadDragDrop',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the file upload is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileUploadDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emits when the user selects files.\n */\n readonly selected = output<FileList | null>({\n alias: 'ngpFileUploadSelected',\n });\n\n /**\n * Emits when the user selects files.\n */\n readonly canceled = output<void>({\n alias: 'ngpFileUploadCanceled',\n });\n\n /**\n * Emits when the user drags a file over the file upload.\n */\n readonly dragOver = output<boolean>({\n alias: 'ngpFileUploadDragOver',\n });\n\n /**\n * Whether the user is currently dragging a file over the file upload.\n */\n protected readonly isDragOver = signal<boolean>(false);\n\n /**\n * Store the file input element.\n */\n private input: HTMLInputElement = document.createElement('input');\n\n /**\n * The file upload state.\n */\n protected readonly state = fileUploadState<NgpFileUpload>(this);\n\n constructor() {\n setupInteractions({\n hover: true,\n press: true,\n focusVisible: true,\n disabled: this.state.disabled,\n });\n this.input.type = 'file';\n this.input.addEventListener('change', () => this.selected.emit(this.input.files));\n this.input.addEventListener('cancel', () => this.canceled.emit());\n }\n\n @HostListener('click')\n protected showFileDialog(): void {\n if (this.state.disabled()) {\n return;\n }\n\n const fileTypes = this.state.fileTypes()?.join(',');\n\n if (fileTypes) {\n this.input.accept = fileTypes;\n }\n\n this.input.multiple = this.state.multiple();\n this.input.webkitdirectory = this.state.directory();\n this.input.click();\n }\n\n @HostListener('dragenter', ['$event'])\n protected onDragEnter(event: DragEvent): void {\n if (this.state.disabled() || !this.state.dragAndDrop()) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n this.isDragOver.set(true);\n this.dragOver.emit(true);\n }\n\n @HostListener('dragover', ['$event'])\n protected onDragOver(event: DragEvent): void {\n if (this.state.disabled() || !this.state.dragAndDrop()) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n this.isDragOver.set(true);\n }\n\n @HostListener('dragleave', ['$event'])\n protected onDragLeave(event: DragEvent): void {\n if (this.state.disabled() || !this.state.dragAndDrop() || !this.isDragOver()) {\n return;\n }\n\n // if the element we are dragging over is a child of the file upload, ignore the event\n if (this.elementRef.nativeElement.contains(event.relatedTarget as Node)) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n this.isDragOver.set(false);\n this.dragOver.emit(false);\n }\n\n @HostListener('drop', ['$event'])\n protected onDrop(event: DragEvent): void {\n if (this.state.disabled() || !this.state.dragAndDrop()) {\n return;\n }\n\n event.preventDefault();\n this.isDragOver.set(false);\n this.dragOver.emit(false);\n\n if (event.dataTransfer?.files) {\n this.selected.emit(event.dataTransfer.files);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAQA;;AAEG;AACI,MAAM,yBAAyB,GAAG,gBAAgB,CAAkB,cAAc,CAAC;AAE1F;;AAEG;MACU,wBAAwB,GAAG,mBAAmB,CAAC,yBAAyB;AAErF;;AAEG;MACU,uBAAuB,GAAG,mBAAmB,CAAC,yBAAyB;AAEpF;;AAEG;AACI,MAAM,iBAAiB,GAAG,WAAW,CAAC,yBAAyB,CAAC;;ACZvE;;AAEG;MAUU,eAAe,CAAA;AA8D1B,IAAA,WAAA,GAAA;AA7DA;;AAEG;AACc,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;AAEzE;;AAEG;AACM,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAA+B,SAAS,EAAE;AAClE,YAAA,KAAK,EAAE,0BAA0B;AACjC,YAAA,SAAS,EAAE,iBAAiB;AAC7B,SAAA,CAAC;AAEF;;AAEG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE;AACtD,YAAA,KAAK,EAAE,yBAAyB;AAChC,YAAA,SAAS,EAAE,gBAAgB;AAC5B,SAAA,CAAC;AAEF;;AAEG;AACM,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAwB,KAAK,EAAE;AACvD,YAAA,KAAK,EAAE,0BAA0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AAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,SAAS,EAAE,CAAC,sBAAsB,EAAE,CAAC;AACrC,oBAAA,IAAI,EAAE;AACJ,wBAAA,sBAAsB,EAAE,8BAA8B;AACtD,wBAAA,sBAAsB,EAAE,0BAA0B;AACnD,qBAAA;AACF,iBAAA;wDAgGW,cAAc,EAAA,CAAA;sBADvB,YAAY;uBAAC,OAAO;gBAkBX,WAAW,EAAA,CAAA;sBADpB,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;gBAa3B,UAAU,EAAA,CAAA;sBADnB,YAAY;uBAAC,UAAU,EAAE,CAAC,QAAQ,CAAC;gBAY1B,WAAW,EAAA,CAAA;sBADpB,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;gBAkB3B,MAAM,EAAA,CAAA;sBADf,YAAY;uBAAC,MAAM,EAAE,CAAC,QAAQ,CAAC;;;ACjLlC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-file-upload.mjs","sources":["../../../../packages/ng-primitives/file-upload/src/file-dropzone/file-dropzone-state.ts","../../../../packages/ng-primitives/file-upload/src/file-dropzone/file-dropzone.ts","../../../../packages/ng-primitives/file-upload/src/file-upload/file-upload-state.ts","../../../../packages/ng-primitives/file-upload/src/file-upload/file-upload.ts","../../../../packages/ng-primitives/file-upload/src/ng-primitives-file-upload.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpFileDropzone } from './file-dropzone';\n\n/**\n * The state token for the FileDropzone primitive.\n */\nexport const NgpFileDropzoneStateToken = createStateToken<NgpFileDropzone>('FileDropzone');\n\n/**\n * Provides the FileDropzone state.\n */\nexport const provideFileDropzoneState = createStateProvider(NgpFileDropzoneStateToken);\n\n/**\n * Injects the FileDropzone state.\n */\nexport const injectFileDropzoneState = createStateInjector(NgpFileDropzoneStateToken);\n\n/**\n * The FileDropzone state registration function.\n */\nexport const fileDropzoneState = createState(NgpFileDropzoneStateToken);\n","import { BooleanInput, coerceStringArray } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n Directive,\n ElementRef,\n HostListener,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { setupHover } from 'ng-primitives/internal';\nimport { fileDropzoneState, provideFileDropzoneState } from './file-dropzone-state';\n\n/**\n * Capture files dropped on the element.\n */\n@Directive({\n selector: '[ngpFileDropzone]',\n exportAs: 'ngpFileDropzone',\n providers: [provideFileDropzoneState()],\n host: {\n '[attr.data-dragover]': 'isDragOver() ? \"\" : null',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n },\n})\nexport class NgpFileDropzone {\n /**\n * Access the host element.\n */\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * The accepted file types. This can be an array of strings or a comma-separated string.\n * Accepted types can either be file extensions (e.g. `.jpg`) or MIME types (e.g. `image/jpeg`).\n */\n readonly fileTypes = input<string[], string | string[]>(undefined, {\n alias: 'ngpFileDropzoneFileTypes',\n transform: types => coerceStringArray(types, ','),\n });\n\n /**\n * Whether to allow multiple files to be selected.\n */\n readonly multiple = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileDropzoneMultiple',\n transform: booleanAttribute,\n });\n\n /**\n * Whether to allow the user to select directories.\n */\n readonly directory = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileDropzoneDirectory',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the file upload is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileDropzoneDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emits when the user selects files.\n */\n readonly selected = output<FileList | null>({\n alias: 'ngpFileDropzoneSelected',\n });\n\n /**\n * Emits when the user drags a file over the file upload.\n */\n readonly dragOver = output<boolean>({\n alias: 'ngpFileDropzoneDragOver',\n });\n\n /**\n * Whether the user is currently dragging a file over the file upload.\n */\n protected readonly isDragOver = signal<boolean>(false);\n\n /**\n * The file upload state.\n */\n private readonly state = fileDropzoneState<NgpFileDropzone>(this);\n\n constructor() {\n setupHover({ disabled: this.state.disabled });\n }\n\n @HostListener('dragenter', ['$event'])\n protected onDragEnter(event: DragEvent): void {\n if (this.state.disabled()) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n this.isDragOver.set(true);\n this.dragOver.emit(true);\n }\n\n @HostListener('dragover', ['$event'])\n protected onDragOver(event: DragEvent): void {\n if (this.state.disabled()) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n this.isDragOver.set(true);\n }\n\n @HostListener('dragleave', ['$event'])\n protected onDragLeave(event: DragEvent): void {\n if (this.state.disabled() || !this.isDragOver()) {\n return;\n }\n\n // if the element we are dragging over is a child of the file upload, ignore the event\n if (this.elementRef.nativeElement.contains(event.relatedTarget as Node)) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n this.isDragOver.set(false);\n this.dragOver.emit(false);\n }\n\n @HostListener('drop', ['$event'])\n protected onDrop(event: DragEvent): void {\n if (this.state.disabled()) {\n return;\n }\n\n event.preventDefault();\n this.isDragOver.set(false);\n this.dragOver.emit(false);\n\n if (event.dataTransfer?.files) {\n this.selected.emit(event.dataTransfer.files);\n }\n }\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpFileUpload } from './file-upload';\n\n/**\n * The state token for the FileUpload primitive.\n */\nexport const NgpFileUploadStateToken = createStateToken<NgpFileUpload>('FileUpload');\n\n/**\n * Provides the FileUpload state.\n */\nexport const provideFileUploadState = createStateProvider(NgpFileUploadStateToken);\n\n/**\n * Injects the FileUpload state.\n */\nexport const injectFileUploadState = createStateInjector(NgpFileUploadStateToken);\n\n/**\n * The FileUpload state registration function.\n */\nexport const fileUploadState = createState(NgpFileUploadStateToken);\n","import { BooleanInput, coerceStringArray } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n Directive,\n ElementRef,\n HostListener,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { setupInteractions } from 'ng-primitives/internal';\nimport { fileUploadState, provideFileUploadState } from './file-upload-state';\n\n/**\n * A directive that allows you to turn any element into a file upload trigger.\n */\n@Directive({\n selector: '[ngpFileUpload]',\n exportAs: 'ngpFileUpload',\n providers: [provideFileUploadState()],\n host: {\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n '[attr.data-dragover]': 'isDragOver() ? \"\" : null',\n },\n})\nexport class NgpFileUpload {\n /**\n * Access the host element.\n */\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * The accepted file types. This can be an array of strings or a comma-separated string.\n * Accepted types can either be file extensions (e.g. `.jpg`) or MIME types (e.g. `image/jpeg`).\n */\n readonly fileTypes = input<string[], string | string[]>(undefined, {\n alias: 'ngpFileUploadFileTypes',\n transform: types => coerceStringArray(types, ','),\n });\n\n /**\n * Whether to allow multiple files to be selected.\n */\n readonly multiple = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileUploadMultiple',\n transform: booleanAttribute,\n });\n\n /**\n * Whether to allow the user to select directories.\n */\n readonly directory = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileUploadDirectory',\n transform: booleanAttribute,\n });\n\n /**\n * Whether drag-and-drop is enabled.\n */\n readonly dragAndDrop = input<boolean, BooleanInput>(true, {\n alias: 'ngpFileUploadDragDrop',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the file upload is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileUploadDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emits when the user selects files.\n */\n readonly selected = output<FileList | null>({\n alias: 'ngpFileUploadSelected',\n });\n\n /**\n * Emits when the user selects files.\n */\n readonly canceled = output<void>({\n alias: 'ngpFileUploadCanceled',\n });\n\n /**\n * Emits when the user drags a file over the file upload.\n */\n readonly dragOver = output<boolean>({\n alias: 'ngpFileUploadDragOver',\n });\n\n /**\n * Whether the user is currently dragging a file over the file upload.\n */\n protected readonly isDragOver = signal<boolean>(false);\n\n /**\n * Store the file input element.\n */\n private input: HTMLInputElement = document.createElement('input');\n\n /**\n * The file upload state.\n */\n protected readonly state = fileUploadState<NgpFileUpload>(this);\n\n constructor() {\n setupInteractions({\n hover: true,\n press: true,\n focusVisible: true,\n disabled: this.state.disabled,\n });\n this.input.type = 'file';\n this.input.addEventListener('change', () => this.selected.emit(this.input.files));\n this.input.addEventListener('cancel', () => this.canceled.emit());\n }\n\n @HostListener('click')\n protected showFileDialog(): void {\n if (this.state.disabled()) {\n return;\n }\n\n const fileTypes = this.state.fileTypes()?.join(',');\n\n if (fileTypes) {\n this.input.accept = fileTypes;\n }\n\n this.input.multiple = this.state.multiple();\n this.input.webkitdirectory = this.state.directory();\n this.input.click();\n }\n\n @HostListener('dragenter', ['$event'])\n protected onDragEnter(event: DragEvent): void {\n if (this.state.disabled() || !this.state.dragAndDrop()) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n this.isDragOver.set(true);\n this.dragOver.emit(true);\n }\n\n @HostListener('dragover', ['$event'])\n protected onDragOver(event: DragEvent): void {\n if (this.state.disabled() || !this.state.dragAndDrop()) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n this.isDragOver.set(true);\n }\n\n @HostListener('dragleave', ['$event'])\n protected onDragLeave(event: DragEvent): void {\n if (this.state.disabled() || !this.state.dragAndDrop() || !this.isDragOver()) {\n return;\n }\n\n // if the element we are dragging over is a child of the file upload, ignore the event\n if (this.elementRef.nativeElement.contains(event.relatedTarget as Node)) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n this.isDragOver.set(false);\n this.dragOver.emit(false);\n }\n\n @HostListener('drop', ['$event'])\n protected onDrop(event: DragEvent): void {\n if (this.state.disabled() || !this.state.dragAndDrop()) {\n return;\n }\n\n event.preventDefault();\n this.isDragOver.set(false);\n this.dragOver.emit(false);\n\n if (event.dataTransfer?.files) {\n this.selected.emit(event.dataTransfer.files);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAQA;;AAEG;AACI,MAAM,yBAAyB,GAAG,gBAAgB,CAAkB,cAAc,CAAC;AAE1F;;AAEG;MACU,wBAAwB,GAAG,mBAAmB,CAAC,yBAAyB;AAErF;;AAEG;MACU,uBAAuB,GAAG,mBAAmB,CAAC,yBAAyB;AAEpF;;AAEG;AACI,MAAM,iBAAiB,GAAG,WAAW,CAAC,yBAAyB,CAAC;;ACZvE;;AAEG;MAUU,eAAe,CAAA;AA+D1B,IAAA,WAAA,GAAA;AA9DA;;AAEG;AACc,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;AAEzE;;;AAGG;AACM,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAA8B,SAAS,EAAE;AACjE,YAAA,KAAK,EAAE,0BAA0B;YACjC,SAAS,EAAE,KAAK,IAAI,iBAAiB,CAAC,KAAK,EAAE,GAAG,CAAC;AAClD,SAAA,CAAC;AAEF;;AAEG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE;AACtD,YAAA,KAAK,EAAE,yBAAyB;AAChC,YAAA,SAAS,EAAE,gBAAgB;AAC5B,SAAA,CAAC;AAEF;;AAEG;AACM,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAwB,KAAK,EAAE;AACvD,YAAA,KAAK,EAAE,0BAA0B;AACjC,YAAA,SAAS,EAAE,gBAAgB;AAC5B,SAAA,CAAC;AAEF;;AAEG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE;AACtD,YAAA,KAAK,EAAE,yBAAyB;AAChC,YAAA,SAAS,EAAE,gBAAgB;AAC5B,SAAA,CAAC;AAEF;;AAEG;QACM,IAAQ,CAAA,QAAA,GAAG,MAAM,CAAkB;AAC1C,YAAA,KAAK,EAA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cAAc,EAAA,CAAA;sBADvB,YAAY;uBAAC,OAAO;gBAkBX,WAAW,EAAA,CAAA;sBADpB,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;gBAa3B,UAAU,EAAA,CAAA;sBADnB,YAAY;uBAAC,UAAU,EAAE,CAAC,QAAQ,CAAC;gBAY1B,WAAW,EAAA,CAAA;sBADpB,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;gBAkB3B,MAAM,EAAA,CAAA;sBADf,YAAY;uBAAC,MAAM,EAAE,CAAC,QAAQ,CAAC;;;AClLlC;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef,
|
|
2
|
+
import { inject, ElementRef, Injectable, Renderer2, Directive, signal, PLATFORM_ID, effect, untracked } from '@angular/core';
|
|
3
3
|
import { injectDisposables, onBooleanChange } from 'ng-primitives/utils';
|
|
4
4
|
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
5
5
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
@@ -14,90 +14,113 @@ function injectElementRef() {
|
|
|
14
14
|
return inject(ElementRef);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
class NgpExitAnimationManager {
|
|
18
|
+
constructor() {
|
|
19
|
+
/** Store the instances of the exit animation directive. */
|
|
20
|
+
this.instances = [];
|
|
21
|
+
}
|
|
22
|
+
/** Add an instance to the manager. */
|
|
23
|
+
add(instance) {
|
|
24
|
+
this.instances.push(instance);
|
|
25
|
+
}
|
|
26
|
+
/** Remove an instance from the manager. */
|
|
27
|
+
remove(instance) {
|
|
28
|
+
const index = this.instances.indexOf(instance);
|
|
29
|
+
if (index !== -1) {
|
|
30
|
+
this.instances.splice(index, 1);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/** Exit all instances. */
|
|
34
|
+
exit() {
|
|
35
|
+
return Promise.all(this.instances.map(instance => instance.exit()));
|
|
36
|
+
}
|
|
37
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: NgpExitAnimationManager, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
38
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: NgpExitAnimationManager }); }
|
|
39
|
+
}
|
|
40
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: NgpExitAnimationManager, decorators: [{
|
|
41
|
+
type: Injectable
|
|
42
|
+
}] });
|
|
43
|
+
function provideExitAnimationManager() {
|
|
44
|
+
return { provide: NgpExitAnimationManager, useClass: NgpExitAnimationManager };
|
|
45
|
+
}
|
|
46
|
+
function injectExitAnimationManager() {
|
|
47
|
+
return inject(NgpExitAnimationManager);
|
|
48
|
+
}
|
|
49
|
+
|
|
17
50
|
class NgpExitAnimation {
|
|
18
51
|
constructor() {
|
|
19
52
|
/** The animation manager. */
|
|
20
|
-
this.animationManager =
|
|
53
|
+
this.animationManager = injectExitAnimationManager();
|
|
21
54
|
/** The element to animate. */
|
|
22
|
-
this.
|
|
23
|
-
/** Access the
|
|
24
|
-
this.
|
|
25
|
-
/** The animation state */
|
|
26
|
-
this.state = signal('enter');
|
|
55
|
+
this.elementRef = injectElementRef();
|
|
56
|
+
/** Access the renderer. */
|
|
57
|
+
this.renderer = inject(Renderer2);
|
|
27
58
|
this.animationManager.add(this);
|
|
59
|
+
this.setAnimationState('enter');
|
|
28
60
|
}
|
|
29
61
|
ngOnDestroy() {
|
|
30
62
|
this.animationManager.remove(this);
|
|
31
63
|
}
|
|
32
64
|
/** Mark the element as exiting. */
|
|
33
65
|
exit() {
|
|
34
|
-
|
|
35
|
-
this.
|
|
66
|
+
// Capture the initial animation name before changing state
|
|
67
|
+
const initialStyle = window.getComputedStyle(this.elementRef.nativeElement);
|
|
68
|
+
const initialAnimationName = initialStyle.animationName;
|
|
69
|
+
const initialTransitionProperty = initialStyle.transitionProperty;
|
|
70
|
+
this.setAnimationState('exit');
|
|
36
71
|
return new Promise(resolve => {
|
|
37
72
|
// check if there are any exit animations or transitions
|
|
38
|
-
const computedStyle = window.getComputedStyle(this.
|
|
73
|
+
const computedStyle = window.getComputedStyle(this.elementRef.nativeElement);
|
|
39
74
|
const hasTransition = parseFloat(computedStyle.transitionDuration) > 0;
|
|
40
75
|
const hasAnimation = parseFloat(computedStyle.animationDuration) > 0;
|
|
41
|
-
|
|
76
|
+
// Compare animation properties to see if they've changed
|
|
77
|
+
const animationChanged = computedStyle.animationName !== initialAnimationName &&
|
|
78
|
+
computedStyle.animationName !== 'none';
|
|
79
|
+
const transitionChanged = computedStyle.transitionProperty !== initialTransitionProperty &&
|
|
80
|
+
computedStyle.transitionProperty !== 'none';
|
|
81
|
+
// If no new animations/transitions, resolve immediately
|
|
82
|
+
if ((!hasTransition && !hasAnimation) || (!animationChanged && !transitionChanged)) {
|
|
42
83
|
resolve();
|
|
43
84
|
return;
|
|
44
85
|
}
|
|
45
86
|
// wait for the exit animation to finish
|
|
46
87
|
const done = (event) => {
|
|
47
88
|
// check if the event is for this element
|
|
48
|
-
if (event.target !== this.
|
|
89
|
+
if (event.target !== this.elementRef.nativeElement) {
|
|
49
90
|
return;
|
|
50
91
|
}
|
|
51
|
-
this.
|
|
52
|
-
this.
|
|
92
|
+
this.elementRef.nativeElement.removeEventListener('transitionend', done);
|
|
93
|
+
this.elementRef.nativeElement.removeEventListener('animationend', done);
|
|
94
|
+
// reset the animation state
|
|
95
|
+
this.setAnimationState(null);
|
|
53
96
|
resolve();
|
|
54
97
|
};
|
|
55
|
-
this.
|
|
56
|
-
this.
|
|
98
|
+
this.elementRef.nativeElement.addEventListener('transitionend', done);
|
|
99
|
+
this.elementRef.nativeElement.addEventListener('animationend', done);
|
|
57
100
|
});
|
|
58
101
|
}
|
|
102
|
+
setAnimationState(state) {
|
|
103
|
+
// remove all current animation state attributes
|
|
104
|
+
this.renderer.removeAttribute(this.elementRef.nativeElement, 'data-enter');
|
|
105
|
+
this.renderer.removeAttribute(this.elementRef.nativeElement, 'data-exit');
|
|
106
|
+
// add the new animation state attribute
|
|
107
|
+
if (state === 'enter') {
|
|
108
|
+
this.renderer.setAttribute(this.elementRef.nativeElement, 'data-enter', '');
|
|
109
|
+
}
|
|
110
|
+
else if (state === 'exit') {
|
|
111
|
+
this.renderer.setAttribute(this.elementRef.nativeElement, 'data-exit', '');
|
|
112
|
+
}
|
|
113
|
+
}
|
|
59
114
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: NgpExitAnimation, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
60
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.7", type: NgpExitAnimation, isStandalone: true, selector: "[ngpExitAnimation]",
|
|
115
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.7", type: NgpExitAnimation, isStandalone: true, selector: "[ngpExitAnimation]", exportAs: ["ngpExitAnimation"], ngImport: i0 }); }
|
|
61
116
|
}
|
|
62
117
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: NgpExitAnimation, decorators: [{
|
|
63
118
|
type: Directive,
|
|
64
119
|
args: [{
|
|
65
120
|
selector: '[ngpExitAnimation]',
|
|
66
121
|
exportAs: 'ngpExitAnimation',
|
|
67
|
-
host: {
|
|
68
|
-
// Deprecated - use data-exit instead
|
|
69
|
-
'[attr.data-closing]': 'state() === "exit" ? "" : null',
|
|
70
|
-
'[attr.data-exit]': 'state() === "exit" ? "" : null',
|
|
71
|
-
},
|
|
72
122
|
}]
|
|
73
123
|
}], ctorParameters: () => [] });
|
|
74
|
-
class NgpExitAnimationManager {
|
|
75
|
-
constructor() {
|
|
76
|
-
/** Store the instances of the exit animation directive. */
|
|
77
|
-
this.instances = [];
|
|
78
|
-
}
|
|
79
|
-
/** Add an instance to the manager. */
|
|
80
|
-
add(instance) {
|
|
81
|
-
this.instances.push(instance);
|
|
82
|
-
}
|
|
83
|
-
/** Remove an instance from the manager. */
|
|
84
|
-
remove(instance) {
|
|
85
|
-
const index = this.instances.indexOf(instance);
|
|
86
|
-
if (index !== -1) {
|
|
87
|
-
this.instances.splice(index, 1);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
/** Exit all instances. */
|
|
91
|
-
exit() {
|
|
92
|
-
const promises = this.instances.map(instance => instance.exit());
|
|
93
|
-
return Promise.all(promises);
|
|
94
|
-
}
|
|
95
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: NgpExitAnimationManager, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
96
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: NgpExitAnimationManager }); }
|
|
97
|
-
}
|
|
98
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: NgpExitAnimationManager, decorators: [{
|
|
99
|
-
type: Injectable
|
|
100
|
-
}] });
|
|
101
124
|
|
|
102
125
|
function setupFocus({ focus, blur, disabled = signal(false), }) {
|
|
103
126
|
/**
|
|
@@ -646,5 +669,5 @@ function scrollIntoViewIfNeeded(element) {
|
|
|
646
669
|
* Generated bundle index. Do not edit.
|
|
647
670
|
*/
|
|
648
671
|
|
|
649
|
-
export { NgpExitAnimation, NgpExitAnimationManager, StyleInjector, explicitEffect, injectElementRef, injectStyleInjector, onDomRemoval, scrollIntoViewIfNeeded, setupFocus, setupFocusVisible, setupHover, setupInteractions, setupPress, syncState };
|
|
672
|
+
export { NgpExitAnimation, NgpExitAnimationManager, StyleInjector, explicitEffect, injectElementRef, injectExitAnimationManager, injectStyleInjector, onDomRemoval, provideExitAnimationManager, scrollIntoViewIfNeeded, setupFocus, setupFocusVisible, setupHover, setupInteractions, setupPress, syncState };
|
|
650
673
|
//# sourceMappingURL=ng-primitives-internal.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-internal.mjs","sources":["../../../../packages/ng-primitives/internal/src/utilities/element-ref.ts","../../../../packages/ng-primitives/internal/src/exit-animation/exit-animation.ts","../../../../packages/ng-primitives/internal/src/interactions/focus.ts","../../../../packages/ng-primitives/internal/src/interactions/focus-visible.ts","../../../../packages/ng-primitives/internal/src/utilities/dom-removal.ts","../../../../packages/ng-primitives/internal/src/interactions/hover.ts","../../../../packages/ng-primitives/internal/src/interactions/press.ts","../../../../packages/ng-primitives/internal/src/interactions/interactions.ts","../../../../packages/ng-primitives/internal/src/signals/explicit-effect.ts","../../../../packages/ng-primitives/internal/src/signals/sync-state.ts","../../../../packages/ng-primitives/internal/src/style-injector/style-injector.ts","../../../../packages/ng-primitives/internal/src/utilities/scrolling.ts","../../../../packages/ng-primitives/internal/src/ng-primitives-internal.ts"],"sourcesContent":["import { ElementRef, inject } from '@angular/core';\n\n/**\n * A simple utility function to inject an element reference with less boilerplate.\n * @returns The element reference.\n */\nexport function injectElementRef<T extends HTMLElement>(): ElementRef<T> {\n return inject(ElementRef);\n}\n","import { ChangeDetectorRef, Directive, inject, Injectable, OnDestroy, signal } from '@angular/core';\nimport { injectElementRef } from '../utilities/element-ref';\n\n@Directive({\n selector: '[ngpExitAnimation]',\n exportAs: 'ngpExitAnimation',\n host: {\n // Deprecated - use data-exit instead\n '[attr.data-closing]': 'state() === \"exit\" ? \"\" : null',\n '[attr.data-exit]': 'state() === \"exit\" ? \"\" : null',\n },\n})\nexport class NgpExitAnimation implements OnDestroy {\n /** The animation manager. */\n private readonly animationManager = inject(NgpExitAnimationManager);\n /** The element to animate. */\n private readonly element = injectElementRef();\n /** Access the change detector. */\n private readonly changeDetector = inject(ChangeDetectorRef);\n\n /** The animation state */\n private readonly state = signal<'enter' | 'exit'>('enter');\n\n constructor() {\n this.animationManager.add(this);\n }\n\n ngOnDestroy(): void {\n this.animationManager.remove(this);\n }\n\n /** Mark the element as exiting. */\n exit(): Promise<void> {\n this.state.set('exit');\n this.changeDetector.detectChanges();\n return new Promise(resolve => {\n // check if there are any exit animations or transitions\n const computedStyle = window.getComputedStyle(this.element.nativeElement);\n const hasTransition = parseFloat(computedStyle.transitionDuration) > 0;\n const hasAnimation = parseFloat(computedStyle.animationDuration) > 0;\n\n if (!hasTransition && !hasAnimation) {\n resolve();\n return;\n }\n\n // wait for the exit animation to finish\n const done = (event: AnimationEvent | TransitionEvent) => {\n // check if the event is for this element\n if (event.target !== this.element.nativeElement) {\n return;\n }\n\n this.element.nativeElement.removeEventListener('transitionend', done);\n this.element.nativeElement.removeEventListener('animationend', done);\n resolve();\n };\n\n this.element.nativeElement.addEventListener('transitionend', done);\n this.element.nativeElement.addEventListener('animationend', done);\n });\n }\n}\n\n@Injectable()\nexport class NgpExitAnimationManager {\n /** Store the instances of the exit animation directive. */\n private readonly instances: NgpExitAnimation[] = [];\n\n /** Add an instance to the manager. */\n add(instance: NgpExitAnimation): void {\n this.instances.push(instance);\n }\n\n /** Remove an instance from the manager. */\n remove(instance: NgpExitAnimation): void {\n const index = this.instances.indexOf(instance);\n if (index !== -1) {\n this.instances.splice(index, 1);\n }\n }\n\n /** Exit all instances. */\n exit(): Promise<void[]> {\n const promises = this.instances.map(instance => instance.exit());\n return Promise.all(promises);\n }\n}\n","import { ElementRef, Renderer2, Signal, inject, signal } from '@angular/core';\nimport { injectDisposables } from 'ng-primitives/utils';\n\nexport interface NgpFocusOptions {\n disabled?: Signal<boolean>;\n focus?: () => void;\n blur?: () => void;\n}\n\nexport interface NgpFocusState {\n isFocused: Signal<boolean>;\n}\n\nexport function setupFocus({\n focus,\n blur,\n disabled = signal(false),\n}: NgpFocusOptions): NgpFocusState {\n /**\n * Access the element reference.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the disposables helper.\n */\n const disposables = injectDisposables();\n\n /**\n * Access the renderer.\n */\n const renderer = inject(Renderer2);\n\n /**\n * Whether the element is currently focused.\n */\n const isFocused = signal<boolean>(false);\n\n // setup event listeners\n disposables.addEventListener(elementRef.nativeElement, 'focus', onFocus);\n disposables.addEventListener(elementRef.nativeElement, 'blur', onBlur);\n\n /**\n * Listen for focus events.\n * @param event\n */\n function onFocus(event: FocusEvent): void {\n if (disabled()) {\n return;\n }\n\n const ownerDocument = (event.target as HTMLElement)?.ownerDocument ?? document;\n\n // ensure this element is still focused\n if (ownerDocument.activeElement === event.target && event.currentTarget === event.target) {\n focus?.();\n isFocused.set(true);\n // set the data-focus attribute\n renderer.setAttribute(elementRef.nativeElement, 'data-focus', '');\n }\n }\n\n /**\n * Listen for blur events.\n * @param event\n */\n function onBlur(event: FocusEvent): void {\n if (disabled()) {\n return;\n }\n\n if (event.currentTarget === event.target) {\n blur?.();\n isFocused.set(false);\n // remove the data-focus attribute\n renderer.removeAttribute(elementRef.nativeElement, 'data-focus');\n }\n }\n\n return {\n isFocused,\n };\n}\n","import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';\nimport { ElementRef, inject, Renderer2, Signal, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { onBooleanChange } from 'ng-primitives/utils';\n\nexport interface NgpFocusVisibleOptions {\n disabled?: Signal<boolean>;\n focusChange?: (value: boolean) => void;\n}\n\nexport interface NgpFocusVisibleState {\n isFocused: Signal<boolean>;\n}\n\nexport function setupFocusVisible({\n focusChange,\n disabled = signal(false),\n}: NgpFocusVisibleOptions): NgpFocusVisibleState {\n /**\n * Access the element that the directive is applied to.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the renderer.\n */\n const renderer = inject(Renderer2);\n\n /**\n * Access the focus monitor.\n */\n const focusMonitor = inject(FocusMonitor);\n\n /**\n * Whether the element is currently focused.\n */\n const isFocused = signal<boolean>(false);\n\n // handle focus state\n focusMonitor\n .monitor(elementRef.nativeElement)\n .pipe(takeUntilDestroyed())\n .subscribe(origin =>\n // null indicates the element was blurred\n origin === null ? onBlur() : onFocus(origin),\n );\n\n // if the component becomes disabled and it is focused, hide the focus\n onBooleanChange(disabled, () => focus(false));\n\n function onFocus(origin: FocusOrigin): void {\n if (disabled() || isFocused()) {\n return;\n }\n\n // for some elements the focus visible state should always appear on focus\n if (alwaysShowFocus()) {\n focus(true);\n return;\n }\n\n // if the focus origin is keyboard or program(focused programmatically), then the focus is visible\n if (origin === 'keyboard') {\n focus(true);\n return;\n }\n }\n\n function onBlur(): void {\n if (disabled() || !isFocused()) {\n return;\n }\n\n focus(false);\n }\n\n /**\n * Trigger the focus signal along with the focusChange event.\n */\n function focus(value: boolean) {\n if (isFocused() === value) {\n return;\n }\n\n isFocused.set(value);\n focusChange?.(value);\n\n if (value) {\n renderer.setAttribute(elementRef.nativeElement, 'data-focus-visible', '');\n } else {\n renderer.removeAttribute(elementRef.nativeElement, 'data-focus-visible');\n }\n }\n\n function alwaysShowFocus(): boolean {\n const nonTextInputTypes = [\n 'checkbox',\n 'radio',\n 'range',\n 'color',\n 'file',\n 'image',\n 'button',\n 'submit',\n 'reset',\n ];\n\n // if this is an input element and it is a text input\n if (\n elementRef.nativeElement instanceof HTMLInputElement &&\n !nonTextInputTypes.includes(elementRef.nativeElement.type)\n ) {\n return true;\n }\n\n // if this is a textarea\n if (elementRef.nativeElement instanceof HTMLTextAreaElement) {\n return true;\n }\n\n // if this is an element with contenteditable\n if (\n elementRef.nativeElement.isContentEditable ||\n elementRef.nativeElement.hasAttribute('contenteditable')\n ) {\n return true;\n }\n\n return false;\n }\n\n return {\n isFocused,\n };\n}\n","import { isPlatformServer } from '@angular/common';\nimport { inject, PLATFORM_ID } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromResizeEvent } from 'ng-primitives/resize';\n\n/**\n * Whenever an element is removed from the DOM, we call the callback.\n * @param element The element to watch for removal.\n * @param callback The callback to call when the element is removed.\n */\nexport function onDomRemoval(element: HTMLElement, callback: () => void): void {\n const platform = inject(PLATFORM_ID);\n\n // Dont run this on the server\n if (isPlatformServer(platform)) {\n return;\n }\n\n // This is a bit of a hack, but it works. If the element dimensions become zero,\n // it's likely that the element has been removed from the DOM.\n fromResizeEvent(element)\n .pipe(takeUntilDestroyed())\n .subscribe(dimensions => {\n // we check the dimensions first to short-circuit the check as it's faster\n if (dimensions.width === 0 && dimensions.height === 0 && !document.body.contains(element)) {\n callback();\n }\n });\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { effect, ElementRef, inject, Injectable, PLATFORM_ID, Signal, signal } from '@angular/core';\nimport { injectDisposables, onBooleanChange } from 'ng-primitives/utils';\nimport { onDomRemoval } from '../utilities/dom-removal';\n\n/**\n * We use a service here as this value is a singleton\n * and allows us to register the dom events once.\n */\n@Injectable({\n providedIn: 'root',\n})\nclass GlobalPointerEvents {\n /**\n * Whether global mouse events should be ignored.\n */\n ignoreEmulatedMouseEvents: boolean = false;\n\n /**\n * Access the document.\n */\n private readonly document = inject(DOCUMENT);\n\n /**\n * Determine the platform id.\n */\n private readonly platformId = inject(PLATFORM_ID);\n\n constructor() {\n // we only want to setup events on the client\n if (isPlatformBrowser(this.platformId)) {\n this.setupGlobalTouchEvents();\n }\n }\n\n private setupGlobalTouchEvents(): void {\n this.document.addEventListener('pointerup', this.handleGlobalPointerEvent.bind(this));\n this.document.addEventListener('touchend', this.setGlobalIgnoreEmulatedMouseEvents.bind(this));\n }\n\n private setGlobalIgnoreEmulatedMouseEvents(): void {\n this.ignoreEmulatedMouseEvents = true;\n // Clear globalIgnoreEmulatedMouseEvents after a short timeout. iOS fires onPointerEnter\n // with pointerType=\"mouse\" immediately after onPointerUp and before onFocus. On other\n // devices that don't have this quirk, we don't want to ignore a mouse hover sometime in\n // the distant future because a user previously touched the element.\n setTimeout(() => (this.ignoreEmulatedMouseEvents = false), 50);\n }\n\n private handleGlobalPointerEvent(event: PointerEvent): void {\n if (event.pointerType === 'touch') {\n this.setGlobalIgnoreEmulatedMouseEvents();\n }\n }\n}\n\ninterface NgpHoverOptions {\n disabled?: Signal<boolean>;\n hoverStart?: () => void;\n hoverEnd?: () => void;\n}\n\nexport interface NgpHoverState {\n hovered: Signal<boolean>;\n}\n\n/**\n * Programatically add the hover functionality to an element.\n * This is useful in cases where we can't necessarily use a HostDirective,\n * because there is a chance the directive has already been used.\n */\nexport function setupHover({\n hoverStart,\n hoverEnd,\n disabled = signal(false),\n}: NgpHoverOptions): NgpHoverState {\n /**\n * Access the element.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the global pointer events handler.\n */\n const globalPointerEvents = inject(GlobalPointerEvents);\n\n /**\n * Access the disposable helper.\n */\n const disposables = injectDisposables();\n\n /**\n * Store the current hover state.\n */\n const hovered = signal<boolean>(false);\n\n /**\n * Whether this element should ignore emulated mouse events.\n */\n let ignoreEmulatedMouseEvents: boolean = false;\n\n /**\n * Setup event listeners.\n */\n disposables.addEventListener(elementRef.nativeElement, 'pointerenter', onPointerEnter);\n disposables.addEventListener(elementRef.nativeElement, 'pointerleave', onPointerLeave);\n disposables.addEventListener(elementRef.nativeElement, 'touchstart', onTouchStart);\n disposables.addEventListener(elementRef.nativeElement, 'mouseenter', onMouseEnter);\n disposables.addEventListener(elementRef.nativeElement, 'mouseleave', onMouseLeave);\n\n // anytime the disabled state changes to true, we must reset the hover state\n if (disabled) {\n onBooleanChange(disabled, reset);\n }\n\n // if the element is removed from the dom, we want to reset the hover state\n onDomRemoval(elementRef.nativeElement, reset);\n\n // anytime the hover state changes we want to update the attribute\n effect(() =>\n hovered()\n ? elementRef.nativeElement.setAttribute('data-hover', '')\n : elementRef.nativeElement.removeAttribute('data-hover'),\n );\n\n /**\n * Reset the hover state.\n */\n function reset(): void {\n onHoverEnd('mouse');\n }\n\n /**\n * Trigger the hover start events.\n * @param event\n * @param pointerType\n */\n function onHoverStart(event: Event, pointerType: string): void {\n if (\n disabled() ||\n pointerType === 'touch' ||\n hovered() ||\n !(event.currentTarget as Element)?.contains(event.target as Element)\n ) {\n return;\n }\n\n hovered.set(true);\n hoverStart?.();\n }\n\n /**\n * Trigger the hover end events.\n * @param pointerType\n */\n function onHoverEnd(pointerType: string): void {\n if (pointerType === 'touch' || !hovered()) {\n return;\n }\n\n hovered.set(false);\n hoverEnd?.();\n }\n\n function onPointerEnter(event: PointerEvent): void {\n if (globalPointerEvents.ignoreEmulatedMouseEvents && event.pointerType === 'mouse') {\n return;\n }\n\n onHoverStart(event, event.pointerType);\n }\n\n function onPointerLeave(event: PointerEvent): void {\n if (!disabled() && (event.currentTarget as Element)?.contains(event.target as Element)) {\n onHoverEnd(event.pointerType);\n }\n }\n\n function onTouchStart(): void {\n ignoreEmulatedMouseEvents = true;\n }\n\n function onMouseEnter(event: MouseEvent): void {\n if (!ignoreEmulatedMouseEvents && !globalPointerEvents.ignoreEmulatedMouseEvents) {\n onHoverStart(event, 'mouse');\n }\n\n ignoreEmulatedMouseEvents = false;\n }\n\n function onMouseLeave(event: MouseEvent): void {\n if (!disabled() && (event.currentTarget as Element)?.contains(event.target as Element)) {\n onHoverEnd('mouse');\n }\n }\n\n return { hovered };\n}\n","import { ElementRef, Signal, effect, inject, signal } from '@angular/core';\nimport { injectDisposables } from 'ng-primitives/utils';\n\ninterface NgpPressState {\n pressed: Signal<boolean>;\n}\n\ninterface NgpPressOptions {\n disabled?: Signal<boolean>;\n pressStart?: () => void;\n pressEnd?: () => void;\n}\n\nexport function setupPress({\n pressStart,\n pressEnd,\n disabled = signal(false),\n}: NgpPressOptions): NgpPressState {\n /**\n * Access the element reference.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the disposables helper.\n */\n const disposables = injectDisposables();\n\n /**\n * Whether the element is currently pressed.\n */\n const pressed = signal<boolean>(false);\n\n // setup event listeners\n disposables.addEventListener(elementRef.nativeElement, 'pointerdown', onPointerDown);\n\n // anytime the press state changes we want to update the attribute\n effect(() =>\n pressed() && !disabled()\n ? elementRef.nativeElement.setAttribute('data-press', '')\n : elementRef.nativeElement.removeAttribute('data-press'),\n );\n\n /**\n * Reset the press state.\n */\n function reset(): void {\n // if we are not pressing, then do nothing\n if (!pressed()) {\n return;\n }\n\n // clear any existing disposables\n disposableListeners.forEach(dispose => dispose());\n pressed.set(false);\n pressEnd?.();\n }\n\n /**\n * Store the list of disposables.\n */\n let disposableListeners: (() => void)[] = [];\n\n function onPointerDown(): void {\n if (disabled()) {\n return;\n }\n\n // clear any existing disposables\n disposableListeners.forEach(dispose => dispose());\n\n // update the press state\n pressed.set(true);\n pressStart?.();\n\n // setup global event listeners to catch events on elements outside the directive\n const ownerDocument = elementRef.nativeElement.ownerDocument ?? document;\n\n // if the pointer up event happens on any elements, then we are no longer pressing on this element\n const pointerUp = disposables.addEventListener(\n ownerDocument,\n 'pointerup',\n () => reset(),\n false,\n );\n\n // Instead of relying on the `pointerleave` event, which is not consistently called on iOS Safari,\n // we use the `pointermove` event to determine if we are still \"pressing\".\n // By checking if the target is still within the element, we can determine if the press is ongoing.\n const pointerMove = disposables.addEventListener(\n ownerDocument,\n 'pointermove',\n () => onPointerMove as EventListener,\n false,\n );\n\n // if the pointer is cancelled, then we are no longer pressing on this element\n const pointerCancel = disposables.addEventListener(\n ownerDocument,\n 'pointercancel',\n () => reset(),\n false,\n );\n\n disposableListeners = [pointerUp, pointerMove, pointerCancel];\n }\n\n function onPointerMove(event: PointerEvent): void {\n if (\n elementRef.nativeElement !== event.target &&\n !elementRef.nativeElement.contains(event.target as Node)\n ) {\n reset();\n }\n }\n\n return { pressed };\n}\n","import { signal, Signal } from '@angular/core';\nimport { setupFocus } from './focus';\nimport { setupFocusVisible } from './focus-visible';\nimport { setupHover } from './hover';\nimport { setupPress } from './press';\n\nexport interface NgpInteractionOptions {\n hover?: boolean;\n press?: boolean;\n focus?: boolean;\n focusVisible?: boolean;\n disabled?: Signal<boolean>;\n}\n\n/**\n * Setup the interactions without relying on HostDirectives.\n */\nexport function setupInteractions({\n focus,\n hover,\n press,\n focusVisible,\n disabled = signal(false),\n}: NgpInteractionOptions): void {\n if (hover) {\n setupHover({ disabled });\n }\n if (press) {\n setupPress({ disabled });\n }\n if (focus) {\n setupFocus({ disabled });\n }\n if (focusVisible) {\n setupFocusVisible({ disabled });\n }\n}\n","/**\n * This implementation is heavily inspired by the great work on ngextension!\n * https://github.com/ngxtension/ngxtension-platform/blob/main/libs/ngxtension/explicit-effect/src/explicit-effect.ts\n */\nimport {\n CreateEffectOptions,\n EffectCleanupRegisterFn,\n EffectRef,\n effect,\n untracked,\n} from '@angular/core';\n\n/**\n * We want to have the Tuple in order to use the types in the function signature\n */\ntype ExplicitEffectValues<T> = {\n [K in keyof T]: () => T[K];\n};\n\n/**\n * This explicit effect function will take the dependencies and the function to run when the dependencies change.\n * @param deps - The dependencies that the effect will run on\n * @param fn - The function to run when the dependencies change\n * @param options - The options for the effect with the addition of defer (it allows the computation to run on first change, not immediately)\n */\nexport function explicitEffect<Input extends readonly unknown[], Params = Input>(\n deps: readonly [...ExplicitEffectValues<Input>],\n fn: (deps: Params, onCleanup: EffectCleanupRegisterFn) => void,\n options?: CreateEffectOptions,\n): EffectRef {\n return effect(onCleanup => {\n const depValues = deps.map(s => s());\n untracked(() => fn(depValues as Params, onCleanup));\n }, options);\n}\n","import { effect, Signal, untracked, WritableSignal } from '@angular/core';\n\nexport function syncState<T>(source: Signal<T>, target: WritableSignal<T>) {\n effect(() => {\n const sourceValue = source();\n untracked(() => target.set(sourceValue));\n });\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { inject, Injectable, PLATFORM_ID } from '@angular/core';\n\n/**\n * A utility service for injecting styles into the document.\n * Angular doesn't allow directives to specify styles, only components.\n * As we ship directives, occasionally we need to associate styles with them.\n * This service allows us to programmatically inject styles into the document.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class StyleInjector {\n /**\n * Access the document.\n */\n private readonly document = inject(DOCUMENT);\n\n /**\n * Detect the platform.\n */\n private readonly platformId = inject(PLATFORM_ID);\n\n /**\n * Store the map of style elements with their unique identifiers.\n */\n private readonly styleElements = new Map<string, HTMLStyleElement>();\n\n constructor() {\n if (isPlatformBrowser(this.platformId)) {\n this.collectServerStyles();\n }\n }\n\n /**\n * Inject a style into the document.\n * @param id The unique identifier for the style.\n * @param style The style to inject.\n */\n add(id: string, style: string): void {\n if (this.styleElements.has(id)) {\n return;\n }\n\n const styleElement = this.document.createElement('style');\n styleElement.setAttribute('data-ngp-style', id);\n styleElement.textContent = style;\n\n this.document.head.appendChild(styleElement);\n this.styleElements.set(id, styleElement);\n }\n\n /**\n * Remove a style from the document.\n * @param id The unique identifier for the style.\n */\n remove(id: string): void {\n const styleElement = this.styleElements.get(id);\n\n if (styleElement) {\n this.document.head.removeChild(styleElement);\n this.styleElements.delete(id);\n }\n }\n\n /**\n * Collect any styles that were rendered by the server.\n */\n private collectServerStyles(): void {\n const styleElements = this.document.querySelectorAll<HTMLStyleElement>('style[data-ngp-style]');\n\n styleElements.forEach(styleElement => {\n const id = styleElement.getAttribute('data-ngp-style');\n\n if (id) {\n this.styleElements.set(id, styleElement);\n }\n });\n }\n}\n\nexport function injectStyleInjector(): StyleInjector {\n return inject(StyleInjector);\n}\n","function getScrollableAncestor(element: HTMLElement): HTMLElement | null {\n let parent = element.parentElement;\n while (parent) {\n const style = window.getComputedStyle(parent);\n if (/(auto|scroll)/.test(style.overflowY) || /(auto|scroll)/.test(style.overflowX)) {\n return parent;\n }\n parent = parent.parentElement;\n }\n return null;\n}\n\nexport function scrollIntoViewIfNeeded(element: HTMLElement): void {\n const scrollableAncestor = getScrollableAncestor(element);\n if (!scrollableAncestor) return;\n\n const parentRect = scrollableAncestor.getBoundingClientRect();\n const elementRect = element.getBoundingClientRect();\n\n if (elementRect.top < parentRect.top) {\n scrollableAncestor.scrollTop -= parentRect.top - elementRect.top;\n } else if (elementRect.bottom > parentRect.bottom) {\n scrollableAncestor.scrollTop += elementRect.bottom - parentRect.bottom;\n }\n\n if (elementRect.left < parentRect.left) {\n scrollableAncestor.scrollLeft -= parentRect.left - elementRect.left;\n } else if (elementRect.right > parentRect.right) {\n scrollableAncestor.scrollLeft += elementRect.right - parentRect.right;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAEA;;;AAGG;SACa,gBAAgB,GAAA;AAC9B,IAAA,OAAO,MAAM,CAAC,UAAU,CAAC;AAC3B;;MCIa,gBAAgB,CAAA;AAW3B,IAAA,WAAA,GAAA;;AATiB,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,uBAAuB,CAAC;;QAElD,IAAO,CAAA,OAAA,GAAG,gBAAgB,EAAE;;AAE5B,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;;AAG1C,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAmB,OAAO,CAAC;AAGxD,QAAA,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC;;IAGjC,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC;;;IAIpC,IAAI,GAAA;AACF,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC;AACtB,QAAA,IAAI,CAAC,cAAc,CAAC,aAAa,EAAE;AACnC,QAAA,OAAO,IAAI,OAAO,CAAC,OAAO,IAAG;;AAE3B,YAAA,MAAM,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;YACzE,MAAM,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC,kBAAkB,CAAC,GAAG,CAAC;YACtE,MAAM,YAAY,GAAG,UAAU,CAAC,aAAa,CAAC,iBAAiB,CAAC,GAAG,CAAC;AAEpE,YA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AACzD,IAAA,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,OAAO,CAAC;AACzD,IAAA,IAAI,CAAC,kBAAkB;QAAE;AAEzB,IAAA,MAAM,UAAU,GAAG,kBAAkB,CAAC,qBAAqB,EAAE;AAC7D,IAAA,MAAM,WAAW,GAAG,OAAO,CAAC,qBAAqB,EAAE;IAEnD,IAAI,WAAW,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG,EAAE;QACpC,kBAAkB,CAAC,SAAS,IAAI,UAAU,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG;;SAC3D,IAAI,WAAW,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE;QACjD,kBAAkB,CAAC,SAAS,IAAI,WAAW,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM;;IAGxE,IAAI,WAAW,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,EAAE;QACtC,kBAAkB,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI;;SAC9D,IAAI,WAAW,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE;QAC/C,kBAAkB,CAAC,UAAU,IAAI,WAAW,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK;;AAEzE;;AC9BA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-internal.mjs","sources":["../../../../packages/ng-primitives/internal/src/utilities/element-ref.ts","../../../../packages/ng-primitives/internal/src/exit-animation/exit-animation-manager.ts","../../../../packages/ng-primitives/internal/src/exit-animation/exit-animation.ts","../../../../packages/ng-primitives/internal/src/interactions/focus.ts","../../../../packages/ng-primitives/internal/src/interactions/focus-visible.ts","../../../../packages/ng-primitives/internal/src/utilities/dom-removal.ts","../../../../packages/ng-primitives/internal/src/interactions/hover.ts","../../../../packages/ng-primitives/internal/src/interactions/press.ts","../../../../packages/ng-primitives/internal/src/interactions/interactions.ts","../../../../packages/ng-primitives/internal/src/signals/explicit-effect.ts","../../../../packages/ng-primitives/internal/src/signals/sync-state.ts","../../../../packages/ng-primitives/internal/src/style-injector/style-injector.ts","../../../../packages/ng-primitives/internal/src/utilities/scrolling.ts","../../../../packages/ng-primitives/internal/src/ng-primitives-internal.ts"],"sourcesContent":["import { ElementRef, inject } from '@angular/core';\n\n/**\n * A simple utility function to inject an element reference with less boilerplate.\n * @returns The element reference.\n */\nexport function injectElementRef<T extends HTMLElement>(): ElementRef<T> {\n return inject(ElementRef);\n}\n","import { ClassProvider, inject, Injectable } from '@angular/core';\nimport type { NgpExitAnimation } from './exit-animation';\n\n@Injectable()\nexport class NgpExitAnimationManager {\n /** Store the instances of the exit animation directive. */\n private readonly instances: NgpExitAnimation[] = [];\n\n /** Add an instance to the manager. */\n add(instance: NgpExitAnimation): void {\n this.instances.push(instance);\n }\n\n /** Remove an instance from the manager. */\n remove(instance: NgpExitAnimation): void {\n const index = this.instances.indexOf(instance);\n if (index !== -1) {\n this.instances.splice(index, 1);\n }\n }\n\n /** Exit all instances. */\n exit(): Promise<void[]> {\n return Promise.all(this.instances.map(instance => instance.exit()));\n }\n}\n\nexport function provideExitAnimationManager(): ClassProvider {\n return { provide: NgpExitAnimationManager, useClass: NgpExitAnimationManager };\n}\n\nexport function injectExitAnimationManager(): NgpExitAnimationManager {\n return inject(NgpExitAnimationManager);\n}\n","import { Directive, inject, OnDestroy, Renderer2 } from '@angular/core';\nimport { injectElementRef } from '../utilities/element-ref';\nimport { injectExitAnimationManager } from './exit-animation-manager';\n\n@Directive({\n selector: '[ngpExitAnimation]',\n exportAs: 'ngpExitAnimation',\n})\nexport class NgpExitAnimation implements OnDestroy {\n /** The animation manager. */\n private readonly animationManager = injectExitAnimationManager();\n /** The element to animate. */\n private readonly elementRef = injectElementRef();\n /** Access the renderer. */\n private readonly renderer = inject(Renderer2);\n\n constructor() {\n this.animationManager.add(this);\n this.setAnimationState('enter');\n }\n\n ngOnDestroy(): void {\n this.animationManager.remove(this);\n }\n\n /** Mark the element as exiting. */\n exit(): Promise<void> {\n // Capture the initial animation name before changing state\n const initialStyle = window.getComputedStyle(this.elementRef.nativeElement);\n const initialAnimationName = initialStyle.animationName;\n const initialTransitionProperty = initialStyle.transitionProperty;\n\n this.setAnimationState('exit');\n\n return new Promise(resolve => {\n // check if there are any exit animations or transitions\n const computedStyle = window.getComputedStyle(this.elementRef.nativeElement);\n const hasTransition = parseFloat(computedStyle.transitionDuration) > 0;\n const hasAnimation = parseFloat(computedStyle.animationDuration) > 0;\n\n // Compare animation properties to see if they've changed\n const animationChanged =\n computedStyle.animationName !== initialAnimationName &&\n computedStyle.animationName !== 'none';\n const transitionChanged =\n computedStyle.transitionProperty !== initialTransitionProperty &&\n computedStyle.transitionProperty !== 'none';\n\n // If no new animations/transitions, resolve immediately\n if ((!hasTransition && !hasAnimation) || (!animationChanged && !transitionChanged)) {\n resolve();\n return;\n }\n\n // wait for the exit animation to finish\n const done = (event: AnimationEvent | TransitionEvent) => {\n // check if the event is for this element\n if (event.target !== this.elementRef.nativeElement) {\n return;\n }\n\n this.elementRef.nativeElement.removeEventListener('transitionend', done);\n this.elementRef.nativeElement.removeEventListener('animationend', done);\n\n // reset the animation state\n this.setAnimationState(null);\n\n resolve();\n };\n\n this.elementRef.nativeElement.addEventListener('transitionend', done);\n this.elementRef.nativeElement.addEventListener('animationend', done);\n });\n }\n\n private setAnimationState(state: 'enter' | 'exit' | null): void {\n // remove all current animation state attributes\n this.renderer.removeAttribute(this.elementRef.nativeElement, 'data-enter');\n this.renderer.removeAttribute(this.elementRef.nativeElement, 'data-exit');\n\n // add the new animation state attribute\n if (state === 'enter') {\n this.renderer.setAttribute(this.elementRef.nativeElement, 'data-enter', '');\n } else if (state === 'exit') {\n this.renderer.setAttribute(this.elementRef.nativeElement, 'data-exit', '');\n }\n }\n}\n","import { ElementRef, Renderer2, Signal, inject, signal } from '@angular/core';\nimport { injectDisposables } from 'ng-primitives/utils';\n\nexport interface NgpFocusOptions {\n disabled?: Signal<boolean>;\n focus?: () => void;\n blur?: () => void;\n}\n\nexport interface NgpFocusState {\n isFocused: Signal<boolean>;\n}\n\nexport function setupFocus({\n focus,\n blur,\n disabled = signal(false),\n}: NgpFocusOptions): NgpFocusState {\n /**\n * Access the element reference.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the disposables helper.\n */\n const disposables = injectDisposables();\n\n /**\n * Access the renderer.\n */\n const renderer = inject(Renderer2);\n\n /**\n * Whether the element is currently focused.\n */\n const isFocused = signal<boolean>(false);\n\n // setup event listeners\n disposables.addEventListener(elementRef.nativeElement, 'focus', onFocus);\n disposables.addEventListener(elementRef.nativeElement, 'blur', onBlur);\n\n /**\n * Listen for focus events.\n * @param event\n */\n function onFocus(event: FocusEvent): void {\n if (disabled()) {\n return;\n }\n\n const ownerDocument = (event.target as HTMLElement)?.ownerDocument ?? document;\n\n // ensure this element is still focused\n if (ownerDocument.activeElement === event.target && event.currentTarget === event.target) {\n focus?.();\n isFocused.set(true);\n // set the data-focus attribute\n renderer.setAttribute(elementRef.nativeElement, 'data-focus', '');\n }\n }\n\n /**\n * Listen for blur events.\n * @param event\n */\n function onBlur(event: FocusEvent): void {\n if (disabled()) {\n return;\n }\n\n if (event.currentTarget === event.target) {\n blur?.();\n isFocused.set(false);\n // remove the data-focus attribute\n renderer.removeAttribute(elementRef.nativeElement, 'data-focus');\n }\n }\n\n return {\n isFocused,\n };\n}\n","import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';\nimport { ElementRef, inject, Renderer2, Signal, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { onBooleanChange } from 'ng-primitives/utils';\n\nexport interface NgpFocusVisibleOptions {\n disabled?: Signal<boolean>;\n focusChange?: (value: boolean) => void;\n}\n\nexport interface NgpFocusVisibleState {\n isFocused: Signal<boolean>;\n}\n\nexport function setupFocusVisible({\n focusChange,\n disabled = signal(false),\n}: NgpFocusVisibleOptions): NgpFocusVisibleState {\n /**\n * Access the element that the directive is applied to.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the renderer.\n */\n const renderer = inject(Renderer2);\n\n /**\n * Access the focus monitor.\n */\n const focusMonitor = inject(FocusMonitor);\n\n /**\n * Whether the element is currently focused.\n */\n const isFocused = signal<boolean>(false);\n\n // handle focus state\n focusMonitor\n .monitor(elementRef.nativeElement)\n .pipe(takeUntilDestroyed())\n .subscribe(origin =>\n // null indicates the element was blurred\n origin === null ? onBlur() : onFocus(origin),\n );\n\n // if the component becomes disabled and it is focused, hide the focus\n onBooleanChange(disabled, () => focus(false));\n\n function onFocus(origin: FocusOrigin): void {\n if (disabled() || isFocused()) {\n return;\n }\n\n // for some elements the focus visible state should always appear on focus\n if (alwaysShowFocus()) {\n focus(true);\n return;\n }\n\n // if the focus origin is keyboard or program(focused programmatically), then the focus is visible\n if (origin === 'keyboard') {\n focus(true);\n return;\n }\n }\n\n function onBlur(): void {\n if (disabled() || !isFocused()) {\n return;\n }\n\n focus(false);\n }\n\n /**\n * Trigger the focus signal along with the focusChange event.\n */\n function focus(value: boolean) {\n if (isFocused() === value) {\n return;\n }\n\n isFocused.set(value);\n focusChange?.(value);\n\n if (value) {\n renderer.setAttribute(elementRef.nativeElement, 'data-focus-visible', '');\n } else {\n renderer.removeAttribute(elementRef.nativeElement, 'data-focus-visible');\n }\n }\n\n function alwaysShowFocus(): boolean {\n const nonTextInputTypes = [\n 'checkbox',\n 'radio',\n 'range',\n 'color',\n 'file',\n 'image',\n 'button',\n 'submit',\n 'reset',\n ];\n\n // if this is an input element and it is a text input\n if (\n elementRef.nativeElement instanceof HTMLInputElement &&\n !nonTextInputTypes.includes(elementRef.nativeElement.type)\n ) {\n return true;\n }\n\n // if this is a textarea\n if (elementRef.nativeElement instanceof HTMLTextAreaElement) {\n return true;\n }\n\n // if this is an element with contenteditable\n if (\n elementRef.nativeElement.isContentEditable ||\n elementRef.nativeElement.hasAttribute('contenteditable')\n ) {\n return true;\n }\n\n return false;\n }\n\n return {\n isFocused,\n };\n}\n","import { isPlatformServer } from '@angular/common';\nimport { inject, PLATFORM_ID } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromResizeEvent } from 'ng-primitives/resize';\n\n/**\n * Whenever an element is removed from the DOM, we call the callback.\n * @param element The element to watch for removal.\n * @param callback The callback to call when the element is removed.\n */\nexport function onDomRemoval(element: HTMLElement, callback: () => void): void {\n const platform = inject(PLATFORM_ID);\n\n // Dont run this on the server\n if (isPlatformServer(platform)) {\n return;\n }\n\n // This is a bit of a hack, but it works. If the element dimensions become zero,\n // it's likely that the element has been removed from the DOM.\n fromResizeEvent(element)\n .pipe(takeUntilDestroyed())\n .subscribe(dimensions => {\n // we check the dimensions first to short-circuit the check as it's faster\n if (dimensions.width === 0 && dimensions.height === 0 && !document.body.contains(element)) {\n callback();\n }\n });\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { effect, ElementRef, inject, Injectable, PLATFORM_ID, Signal, signal } from '@angular/core';\nimport { injectDisposables, onBooleanChange } from 'ng-primitives/utils';\nimport { onDomRemoval } from '../utilities/dom-removal';\n\n/**\n * We use a service here as this value is a singleton\n * and allows us to register the dom events once.\n */\n@Injectable({\n providedIn: 'root',\n})\nclass GlobalPointerEvents {\n /**\n * Whether global mouse events should be ignored.\n */\n ignoreEmulatedMouseEvents: boolean = false;\n\n /**\n * Access the document.\n */\n private readonly document = inject(DOCUMENT);\n\n /**\n * Determine the platform id.\n */\n private readonly platformId = inject(PLATFORM_ID);\n\n constructor() {\n // we only want to setup events on the client\n if (isPlatformBrowser(this.platformId)) {\n this.setupGlobalTouchEvents();\n }\n }\n\n private setupGlobalTouchEvents(): void {\n this.document.addEventListener('pointerup', this.handleGlobalPointerEvent.bind(this));\n this.document.addEventListener('touchend', this.setGlobalIgnoreEmulatedMouseEvents.bind(this));\n }\n\n private setGlobalIgnoreEmulatedMouseEvents(): void {\n this.ignoreEmulatedMouseEvents = true;\n // Clear globalIgnoreEmulatedMouseEvents after a short timeout. iOS fires onPointerEnter\n // with pointerType=\"mouse\" immediately after onPointerUp and before onFocus. On other\n // devices that don't have this quirk, we don't want to ignore a mouse hover sometime in\n // the distant future because a user previously touched the element.\n setTimeout(() => (this.ignoreEmulatedMouseEvents = false), 50);\n }\n\n private handleGlobalPointerEvent(event: PointerEvent): void {\n if (event.pointerType === 'touch') {\n this.setGlobalIgnoreEmulatedMouseEvents();\n }\n }\n}\n\ninterface NgpHoverOptions {\n disabled?: Signal<boolean>;\n hoverStart?: () => void;\n hoverEnd?: () => void;\n}\n\nexport interface NgpHoverState {\n hovered: Signal<boolean>;\n}\n\n/**\n * Programatically add the hover functionality to an element.\n * This is useful in cases where we can't necessarily use a HostDirective,\n * because there is a chance the directive has already been used.\n */\nexport function setupHover({\n hoverStart,\n hoverEnd,\n disabled = signal(false),\n}: NgpHoverOptions): NgpHoverState {\n /**\n * Access the element.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the global pointer events handler.\n */\n const globalPointerEvents = inject(GlobalPointerEvents);\n\n /**\n * Access the disposable helper.\n */\n const disposables = injectDisposables();\n\n /**\n * Store the current hover state.\n */\n const hovered = signal<boolean>(false);\n\n /**\n * Whether this element should ignore emulated mouse events.\n */\n let ignoreEmulatedMouseEvents: boolean = false;\n\n /**\n * Setup event listeners.\n */\n disposables.addEventListener(elementRef.nativeElement, 'pointerenter', onPointerEnter);\n disposables.addEventListener(elementRef.nativeElement, 'pointerleave', onPointerLeave);\n disposables.addEventListener(elementRef.nativeElement, 'touchstart', onTouchStart);\n disposables.addEventListener(elementRef.nativeElement, 'mouseenter', onMouseEnter);\n disposables.addEventListener(elementRef.nativeElement, 'mouseleave', onMouseLeave);\n\n // anytime the disabled state changes to true, we must reset the hover state\n if (disabled) {\n onBooleanChange(disabled, reset);\n }\n\n // if the element is removed from the dom, we want to reset the hover state\n onDomRemoval(elementRef.nativeElement, reset);\n\n // anytime the hover state changes we want to update the attribute\n effect(() =>\n hovered()\n ? elementRef.nativeElement.setAttribute('data-hover', '')\n : elementRef.nativeElement.removeAttribute('data-hover'),\n );\n\n /**\n * Reset the hover state.\n */\n function reset(): void {\n onHoverEnd('mouse');\n }\n\n /**\n * Trigger the hover start events.\n * @param event\n * @param pointerType\n */\n function onHoverStart(event: Event, pointerType: string): void {\n if (\n disabled() ||\n pointerType === 'touch' ||\n hovered() ||\n !(event.currentTarget as Element)?.contains(event.target as Element)\n ) {\n return;\n }\n\n hovered.set(true);\n hoverStart?.();\n }\n\n /**\n * Trigger the hover end events.\n * @param pointerType\n */\n function onHoverEnd(pointerType: string): void {\n if (pointerType === 'touch' || !hovered()) {\n return;\n }\n\n hovered.set(false);\n hoverEnd?.();\n }\n\n function onPointerEnter(event: PointerEvent): void {\n if (globalPointerEvents.ignoreEmulatedMouseEvents && event.pointerType === 'mouse') {\n return;\n }\n\n onHoverStart(event, event.pointerType);\n }\n\n function onPointerLeave(event: PointerEvent): void {\n if (!disabled() && (event.currentTarget as Element)?.contains(event.target as Element)) {\n onHoverEnd(event.pointerType);\n }\n }\n\n function onTouchStart(): void {\n ignoreEmulatedMouseEvents = true;\n }\n\n function onMouseEnter(event: MouseEvent): void {\n if (!ignoreEmulatedMouseEvents && !globalPointerEvents.ignoreEmulatedMouseEvents) {\n onHoverStart(event, 'mouse');\n }\n\n ignoreEmulatedMouseEvents = false;\n }\n\n function onMouseLeave(event: MouseEvent): void {\n if (!disabled() && (event.currentTarget as Element)?.contains(event.target as Element)) {\n onHoverEnd('mouse');\n }\n }\n\n return { hovered };\n}\n","import { ElementRef, Signal, effect, inject, signal } from '@angular/core';\nimport { injectDisposables } from 'ng-primitives/utils';\n\ninterface NgpPressState {\n pressed: Signal<boolean>;\n}\n\ninterface NgpPressOptions {\n disabled?: Signal<boolean>;\n pressStart?: () => void;\n pressEnd?: () => void;\n}\n\nexport function setupPress({\n pressStart,\n pressEnd,\n disabled = signal(false),\n}: NgpPressOptions): NgpPressState {\n /**\n * Access the element reference.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the disposables helper.\n */\n const disposables = injectDisposables();\n\n /**\n * Whether the element is currently pressed.\n */\n const pressed = signal<boolean>(false);\n\n // setup event listeners\n disposables.addEventListener(elementRef.nativeElement, 'pointerdown', onPointerDown);\n\n // anytime the press state changes we want to update the attribute\n effect(() =>\n pressed() && !disabled()\n ? elementRef.nativeElement.setAttribute('data-press', '')\n : elementRef.nativeElement.removeAttribute('data-press'),\n );\n\n /**\n * Reset the press state.\n */\n function reset(): void {\n // if we are not pressing, then do nothing\n if (!pressed()) {\n return;\n }\n\n // clear any existing disposables\n disposableListeners.forEach(dispose => dispose());\n pressed.set(false);\n pressEnd?.();\n }\n\n /**\n * Store the list of disposables.\n */\n let disposableListeners: (() => void)[] = [];\n\n function onPointerDown(): void {\n if (disabled()) {\n return;\n }\n\n // clear any existing disposables\n disposableListeners.forEach(dispose => dispose());\n\n // update the press state\n pressed.set(true);\n pressStart?.();\n\n // setup global event listeners to catch events on elements outside the directive\n const ownerDocument = elementRef.nativeElement.ownerDocument ?? document;\n\n // if the pointer up event happens on any elements, then we are no longer pressing on this element\n const pointerUp = disposables.addEventListener(\n ownerDocument,\n 'pointerup',\n () => reset(),\n false,\n );\n\n // Instead of relying on the `pointerleave` event, which is not consistently called on iOS Safari,\n // we use the `pointermove` event to determine if we are still \"pressing\".\n // By checking if the target is still within the element, we can determine if the press is ongoing.\n const pointerMove = disposables.addEventListener(\n ownerDocument,\n 'pointermove',\n () => onPointerMove as EventListener,\n false,\n );\n\n // if the pointer is cancelled, then we are no longer pressing on this element\n const pointerCancel = disposables.addEventListener(\n ownerDocument,\n 'pointercancel',\n () => reset(),\n false,\n );\n\n disposableListeners = [pointerUp, pointerMove, pointerCancel];\n }\n\n function onPointerMove(event: PointerEvent): void {\n if (\n elementRef.nativeElement !== event.target &&\n !elementRef.nativeElement.contains(event.target as Node)\n ) {\n reset();\n }\n }\n\n return { pressed };\n}\n","import { signal, Signal } from '@angular/core';\nimport { setupFocus } from './focus';\nimport { setupFocusVisible } from './focus-visible';\nimport { setupHover } from './hover';\nimport { setupPress } from './press';\n\nexport interface NgpInteractionOptions {\n hover?: boolean;\n press?: boolean;\n focus?: boolean;\n focusVisible?: boolean;\n disabled?: Signal<boolean>;\n}\n\n/**\n * Setup the interactions without relying on HostDirectives.\n */\nexport function setupInteractions({\n focus,\n hover,\n press,\n focusVisible,\n disabled = signal(false),\n}: NgpInteractionOptions): void {\n if (hover) {\n setupHover({ disabled });\n }\n if (press) {\n setupPress({ disabled });\n }\n if (focus) {\n setupFocus({ disabled });\n }\n if (focusVisible) {\n setupFocusVisible({ disabled });\n }\n}\n","/**\n * This implementation is heavily inspired by the great work on ngextension!\n * https://github.com/ngxtension/ngxtension-platform/blob/main/libs/ngxtension/explicit-effect/src/explicit-effect.ts\n */\nimport {\n CreateEffectOptions,\n EffectCleanupRegisterFn,\n EffectRef,\n effect,\n untracked,\n} from '@angular/core';\n\n/**\n * We want to have the Tuple in order to use the types in the function signature\n */\ntype ExplicitEffectValues<T> = {\n [K in keyof T]: () => T[K];\n};\n\n/**\n * This explicit effect function will take the dependencies and the function to run when the dependencies change.\n * @param deps - The dependencies that the effect will run on\n * @param fn - The function to run when the dependencies change\n * @param options - The options for the effect with the addition of defer (it allows the computation to run on first change, not immediately)\n */\nexport function explicitEffect<Input extends readonly unknown[], Params = Input>(\n deps: readonly [...ExplicitEffectValues<Input>],\n fn: (deps: Params, onCleanup: EffectCleanupRegisterFn) => void,\n options?: CreateEffectOptions,\n): EffectRef {\n return effect(onCleanup => {\n const depValues = deps.map(s => s());\n untracked(() => fn(depValues as Params, onCleanup));\n }, options);\n}\n","import { effect, Signal, untracked, WritableSignal } from '@angular/core';\n\nexport function syncState<T>(source: Signal<T>, target: WritableSignal<T>) {\n effect(() => {\n const sourceValue = source();\n untracked(() => target.set(sourceValue));\n });\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { inject, Injectable, PLATFORM_ID } from '@angular/core';\n\n/**\n * A utility service for injecting styles into the document.\n * Angular doesn't allow directives to specify styles, only components.\n * As we ship directives, occasionally we need to associate styles with them.\n * This service allows us to programmatically inject styles into the document.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class StyleInjector {\n /**\n * Access the document.\n */\n private readonly document = inject(DOCUMENT);\n\n /**\n * Detect the platform.\n */\n private readonly platformId = inject(PLATFORM_ID);\n\n /**\n * Store the map of style elements with their unique identifiers.\n */\n private readonly styleElements = new Map<string, HTMLStyleElement>();\n\n constructor() {\n if (isPlatformBrowser(this.platformId)) {\n this.collectServerStyles();\n }\n }\n\n /**\n * Inject a style into the document.\n * @param id The unique identifier for the style.\n * @param style The style to inject.\n */\n add(id: string, style: string): void {\n if (this.styleElements.has(id)) {\n return;\n }\n\n const styleElement = this.document.createElement('style');\n styleElement.setAttribute('data-ngp-style', id);\n styleElement.textContent = style;\n\n this.document.head.appendChild(styleElement);\n this.styleElements.set(id, styleElement);\n }\n\n /**\n * Remove a style from the document.\n * @param id The unique identifier for the style.\n */\n remove(id: string): void {\n const styleElement = this.styleElements.get(id);\n\n if (styleElement) {\n this.document.head.removeChild(styleElement);\n this.styleElements.delete(id);\n }\n }\n\n /**\n * Collect any styles that were rendered by the server.\n */\n private collectServerStyles(): void {\n const styleElements = this.document.querySelectorAll<HTMLStyleElement>('style[data-ngp-style]');\n\n styleElements.forEach(styleElement => {\n const id = styleElement.getAttribute('data-ngp-style');\n\n if (id) {\n this.styleElements.set(id, styleElement);\n }\n });\n }\n}\n\nexport function injectStyleInjector(): StyleInjector {\n return inject(StyleInjector);\n}\n","function getScrollableAncestor(element: HTMLElement): HTMLElement | null {\n let parent = element.parentElement;\n while (parent) {\n const style = window.getComputedStyle(parent);\n if (/(auto|scroll)/.test(style.overflowY) || /(auto|scroll)/.test(style.overflowX)) {\n return parent;\n }\n parent = parent.parentElement;\n }\n return null;\n}\n\nexport function scrollIntoViewIfNeeded(element: HTMLElement): void {\n const scrollableAncestor = getScrollableAncestor(element);\n if (!scrollableAncestor) return;\n\n const parentRect = scrollableAncestor.getBoundingClientRect();\n const elementRect = element.getBoundingClientRect();\n\n if (elementRect.top < parentRect.top) {\n scrollableAncestor.scrollTop -= parentRect.top - elementRect.top;\n } else if (elementRect.bottom > parentRect.bottom) {\n scrollableAncestor.scrollTop += elementRect.bottom - parentRect.bottom;\n }\n\n if (elementRect.left < parentRect.left) {\n scrollableAncestor.scrollLeft -= parentRect.left - elementRect.left;\n } else if (elementRect.right > parentRect.right) {\n scrollableAncestor.scrollLeft += elementRect.right - parentRect.right;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAEA;;;AAGG;SACa,gBAAgB,GAAA;AAC9B,IAAA,OAAO,MAAM,CAAC,UAAU,CAAC;AAC3B;;MCJa,uBAAuB,CAAA;AADpC,IAAA,WAAA,GAAA;;QAGmB,IAAS,CAAA,SAAA,GAAuB,EAAE;AAmBpD;;AAhBC,IAAA,GAAG,CAAC,QAA0B,EAAA;AAC5B,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;;;AAI/B,IAAA,MAAM,CAAC,QAA0B,EAAA;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC;AAC9C,QAAA,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YAChB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;;;;IAKnC,IAAI,GAAA;QACF,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;;8GAnB1D,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAvB,uBAAuB,EAA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