ng-primitives 0.99.0 → 0.99.2

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.
Files changed (36) hide show
  1. package/accordion/index.d.ts +17 -5
  2. package/fesm2022/ng-primitives-a11y.mjs.map +1 -1
  3. package/fesm2022/ng-primitives-accordion.mjs +1 -1
  4. package/fesm2022/ng-primitives-accordion.mjs.map +1 -1
  5. package/fesm2022/ng-primitives-autofill.mjs.map +1 -1
  6. package/fesm2022/ng-primitives-avatar.mjs.map +1 -1
  7. package/fesm2022/ng-primitives-breadcrumbs.mjs.map +1 -1
  8. package/fesm2022/ng-primitives-button.mjs.map +1 -1
  9. package/fesm2022/ng-primitives-checkbox.mjs.map +1 -1
  10. package/fesm2022/ng-primitives-file-upload.mjs +9 -3
  11. package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
  12. package/fesm2022/ng-primitives-focus-trap.mjs.map +1 -1
  13. package/fesm2022/ng-primitives-form-field.mjs.map +1 -1
  14. package/fesm2022/ng-primitives-input.mjs.map +1 -1
  15. package/fesm2022/ng-primitives-menu.mjs +79 -6
  16. package/fesm2022/ng-primitives-menu.mjs.map +1 -1
  17. package/fesm2022/ng-primitives-progress.mjs +23 -6
  18. package/fesm2022/ng-primitives-progress.mjs.map +1 -1
  19. package/fesm2022/ng-primitives-roving-focus.mjs.map +1 -1
  20. package/fesm2022/ng-primitives-separator.mjs.map +1 -1
  21. package/fesm2022/ng-primitives-slider.mjs +1 -0
  22. package/fesm2022/ng-primitives-slider.mjs.map +1 -1
  23. package/fesm2022/ng-primitives-switch.mjs.map +1 -1
  24. package/fesm2022/ng-primitives-tabs.mjs +9 -3
  25. package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
  26. package/fesm2022/ng-primitives-textarea.mjs.map +1 -1
  27. package/fesm2022/ng-primitives-toggle-group.mjs.map +1 -1
  28. package/fesm2022/ng-primitives-toggle.mjs.map +1 -1
  29. package/fesm2022/ng-primitives-toolbar.mjs.map +1 -1
  30. package/file-upload/index.d.ts +20 -16
  31. package/input/index.d.ts +10 -5
  32. package/menu/index.d.ts +188 -17
  33. package/package.json +1 -1
  34. package/progress/index.d.ts +48 -36
  35. package/slider/index.d.ts +4 -4
  36. package/tabs/index.d.ts +20 -14
@@ -3,7 +3,7 @@ import * as i0 from '@angular/core';
3
3
  import { signal, input, booleanAttribute, output, Directive, inject, DOCUMENT } from '@angular/core';
4
4
  import { ngpHover, ngpInteractions } from 'ng-primitives/interactions';
5
5
  import { injectElementRef } from 'ng-primitives/internal';
6
- import { createPrimitive, emitter, dataBinding, listener } from 'ng-primitives/state';
6
+ import { createPrimitive, controlled, emitter, dataBinding, listener, deprecatedSetter } from 'ng-primitives/state';
7
7
 
8
8
  function fileDropFilter(fileList, acceptedTypes, multiple) {
9
9
  const validFiles = Array.from(fileList).filter(file => isFileTypeAccepted(file, acceptedTypes));
@@ -34,9 +34,11 @@ function filesToFileList(files) {
34
34
  return dataTransfer.files;
35
35
  }
36
36
 
37
- const [NgpFileDropzoneStateToken, ngpFileDropzone, injectFileDropzoneState, provideFileDropzoneState,] = createPrimitive('NgpFileDropzone', ({ fileTypes, multiple, directory, disabled, onSelected, onRejected, onDragOver, }) => {
37
+ const [NgpFileDropzoneStateToken, ngpFileDropzone, injectFileDropzoneState, provideFileDropzoneState,] = createPrimitive('NgpFileDropzone', ({ fileTypes = signal(undefined), multiple = signal(false), directory = signal(false), disabled: _disabled = signal(false), onSelected, onRejected, onDragOver, }) => {
38
38
  const element = injectElementRef();
39
39
  const isDragOverState = signal(false, ...(ngDevMode ? [{ debugName: "isDragOverState" }] : []));
40
+ // Controlled properties
41
+ const disabled = controlled(_disabled);
40
42
  // Create observables
41
43
  const selected = emitter();
42
44
  const rejected = emitter();
@@ -104,8 +106,11 @@ const [NgpFileDropzoneStateToken, ngpFileDropzone, injectFileDropzoneState, prov
104
106
  listener(element, 'dragover', onDragOverHandler);
105
107
  listener(element, 'dragleave', onDragLeave);
106
108
  listener(element, 'drop', onDrop);
109
+ function setDisabled(value) {
110
+ disabled?.set(value);
111
+ }
107
112
  return {
108
- disabled,
113
+ disabled: deprecatedSetter(disabled, 'setDisabled'),
109
114
  fileTypes,
110
115
  multiple,
111
116
  directory,
@@ -113,6 +118,7 @@ const [NgpFileDropzoneStateToken, ngpFileDropzone, injectFileDropzoneState, prov
113
118
  selected: selected.asObservable(),
114
119
  rejected: rejected.asObservable(),
115
120
  dragOver: dragOver.asObservable(),
121
+ setDisabled,
116
122
  };
117
123
  });
118
124
 
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-file-upload.mjs","sources":["../../../../packages/ng-primitives/file-upload/src/file-dropzone/file-drop-filter.ts","../../../../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":["export function fileDropFilter(\n fileList: FileList,\n acceptedTypes: string[] | undefined,\n multiple: boolean,\n) {\n const validFiles = Array.from(fileList).filter(file => isFileTypeAccepted(file, acceptedTypes));\n\n const limitedFiles = multiple ? validFiles : validFiles.slice(0, 1);\n\n return limitedFiles.length > 0 ? filesToFileList(limitedFiles) : null;\n}\n\nexport function isFileTypeAccepted(file: File, acceptedTypes: string[] | undefined) {\n // allow all file types if no types are specified\n if (!acceptedTypes || acceptedTypes.length === 0) return true;\n\n const mimeType = file.type;\n const fileName = file.name.toLowerCase();\n\n return acceptedTypes.some(type => {\n type = type.toLowerCase();\n\n if (type.startsWith('.')) {\n return fileName.endsWith(type);\n }\n\n if (type.endsWith('/*')) {\n const baseType = type.replace('/*', '');\n return mimeType.startsWith(baseType);\n }\n\n return mimeType === type;\n });\n}\n\nfunction filesToFileList(files: File[]): FileList {\n const dataTransfer = new DataTransfer();\n files.forEach(file => dataTransfer.items.add(file));\n return dataTransfer.files;\n}\n","import { Signal, signal } from '@angular/core';\nimport { ngpHover } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { createPrimitive, dataBinding, emitter, listener } from 'ng-primitives/state';\nimport { Observable } from 'rxjs';\nimport { fileDropFilter } from './file-drop-filter';\n\n/**\n * The state for the NgpFileDropzone directive.\n */\nexport interface NgpFileDropzoneState {\n /**\n * Whether the user is currently dragging over the element.\n */\n readonly isDragOver: Signal<boolean>;\n /**\n * Observable that emits when files are selected.\n */\n readonly selected: Observable<FileList | null>;\n /**\n * Observable that emits when files are rejected.\n */\n readonly rejected: Observable<void>;\n /**\n * Observable that emits when drag over state changes.\n */\n readonly dragOver: Observable<boolean>;\n}\n\n/**\n * The props for the NgpFileDropzone state.\n */\nexport interface NgpFileDropzoneProps {\n /**\n * The accepted file types.\n */\n readonly fileTypes?: Signal<string[] | undefined>;\n /**\n * Whether multiple files can be selected.\n */\n readonly multiple?: Signal<boolean>;\n /**\n * Whether directories can be selected.\n */\n readonly directory?: Signal<boolean>;\n /**\n * Whether the file dropzone is disabled.\n */\n readonly disabled?: Signal<boolean>;\n /**\n * Callback when files are selected.\n */\n readonly onSelected?: (files: FileList | null) => void;\n /**\n * Callback when files are rejected.\n */\n readonly onRejected?: () => void;\n /**\n * Callback when drag over state changes.\n */\n readonly onDragOver?: (isDragOver: boolean) => void;\n}\n\nexport const [\n NgpFileDropzoneStateToken,\n ngpFileDropzone,\n injectFileDropzoneState,\n provideFileDropzoneState,\n] = createPrimitive(\n 'NgpFileDropzone',\n ({\n fileTypes,\n multiple,\n directory,\n disabled,\n onSelected,\n onRejected,\n onDragOver,\n }: NgpFileDropzoneProps) => {\n const element = injectElementRef();\n const isDragOverState = signal(false);\n\n // Create observables\n const selected = emitter<FileList | null>();\n const rejected = emitter<void>();\n const dragOver = emitter<boolean>();\n\n // Host bindings\n dataBinding(element, 'data-dragover', () => (isDragOverState() ? '' : null));\n dataBinding(element, 'data-disabled', () => (disabled?.() ? '' : null));\n\n // Setup hover interaction\n ngpHover({ disabled });\n\n function onDragEnter(event: DragEvent): void {\n if (disabled?.()) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n isDragOverState.set(true);\n dragOver.emit(true);\n onDragOver?.(true);\n }\n\n function onDragOverHandler(event: DragEvent): void {\n if (disabled?.()) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n isDragOverState.set(true);\n }\n\n function onDragLeave(event: DragEvent): void {\n if (disabled?.() || !isDragOverState()) {\n return;\n }\n\n // if the element we are dragging over is a child of the file dropzone, ignore the event\n if (element.nativeElement.contains(event.relatedTarget as Node)) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n isDragOverState.set(false);\n dragOver.emit(false);\n onDragOver?.(false);\n }\n\n function onDrop(event: DragEvent): void {\n if (disabled?.()) {\n return;\n }\n\n event.preventDefault();\n isDragOverState.set(false);\n dragOver.emit(false);\n onDragOver?.(false);\n\n const fileList = event.dataTransfer?.files;\n if (fileList) {\n const filteredFiles = fileDropFilter(fileList, fileTypes?.(), multiple?.() ?? false);\n\n if (filteredFiles) {\n selected.emit(filteredFiles);\n onSelected?.(filteredFiles);\n } else {\n rejected.emit();\n onRejected?.();\n }\n }\n }\n\n // Event listeners\n listener(element, 'dragenter', onDragEnter);\n listener(element, 'dragover', onDragOverHandler);\n listener(element, 'dragleave', onDragLeave);\n listener(element, 'drop', onDrop);\n\n return {\n disabled,\n fileTypes,\n multiple,\n directory,\n isDragOver: isDragOverState,\n selected: selected.asObservable(),\n rejected: rejected.asObservable(),\n dragOver: dragOver.asObservable(),\n };\n },\n);\n","import { BooleanInput, coerceStringArray } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, output } from '@angular/core';\nimport { ngpFileDropzone, 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})\nexport class NgpFileDropzone {\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 uploaded files are rejected because they do not match the allowed {@link fileTypes}.\n */\n readonly rejected = output<void>({\n alias: 'ngpFileDropzoneRejected',\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 private readonly state = ngpFileDropzone({\n fileTypes: this.fileTypes,\n multiple: this.multiple,\n directory: this.directory,\n disabled: this.disabled,\n onSelected: files => this.selected.emit(files),\n onRejected: () => this.rejected.emit(),\n onDragOver: isDragOver => this.dragOver.emit(isDragOver),\n });\n\n /**\n * Whether the user is currently dragging a file over the file upload.\n */\n readonly isDragOver = this.state.isDragOver;\n}\n","import { DOCUMENT, inject, Signal, signal } from '@angular/core';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { createPrimitive, dataBinding, emitter, listener } from 'ng-primitives/state';\nimport { Observable } from 'rxjs';\nimport { fileDropFilter } from '../file-dropzone/file-drop-filter';\n\n/**\n * The state for the NgpFileUpload directive.\n */\nexport interface NgpFileUploadState {\n /**\n * Whether the user is currently dragging over the element.\n */\n readonly isDragOver: Signal<boolean>;\n /**\n * Observable that emits when files are selected.\n */\n readonly selected: Observable<FileList | null>;\n /**\n * Observable that emits when file selection is canceled.\n */\n readonly canceled: Observable<void>;\n /**\n * Observable that emits when files are rejected.\n */\n readonly rejected: Observable<void>;\n /**\n * Observable that emits when drag over state changes.\n */\n readonly dragOver: Observable<boolean>;\n /**\n * Show the file dialog.\n */\n showFileDialog(): void;\n}\n\n/**\n * The props for the NgpFileUpload state.\n */\nexport interface NgpFileUploadProps {\n /**\n * The accepted file types.\n */\n readonly fileTypes?: Signal<string[] | undefined>;\n /**\n * Whether multiple files can be selected.\n */\n readonly multiple?: Signal<boolean>;\n /**\n * Whether directories can be selected.\n */\n readonly directory?: Signal<boolean>;\n /**\n * Whether drag and drop is enabled.\n */\n readonly dragAndDrop?: Signal<boolean>;\n /**\n * Whether the file upload is disabled.\n */\n readonly disabled?: Signal<boolean>;\n /**\n * Callback when files are selected.\n */\n readonly onSelected?: (files: FileList | null) => void;\n /**\n * Callback when file selection is canceled.\n */\n readonly onCanceled?: () => void;\n /**\n * Callback when files are rejected.\n */\n readonly onRejected?: () => void;\n /**\n * Callback when drag over state changes.\n */\n readonly onDragOver?: (isDragOver: boolean) => void;\n}\n\nexport const [\n NgpFileUploadStateToken,\n ngpFileUpload,\n injectFileUploadState,\n provideFileUploadState,\n] = createPrimitive(\n 'NgpFileUpload',\n ({\n fileTypes,\n multiple,\n directory,\n dragAndDrop,\n disabled,\n onSelected,\n onCanceled,\n onRejected,\n onDragOver,\n }: NgpFileUploadProps) => {\n const element = injectElementRef();\n const document = inject(DOCUMENT);\n\n const isDragOver = signal(false);\n\n // Create observables\n const selected = emitter<FileList | null>();\n const canceled = emitter<void>();\n const rejected = emitter<void>();\n const dragOver = emitter<boolean>();\n\n // Host bindings\n dataBinding(element, 'data-disabled', () => (disabled?.() ? '' : null));\n dataBinding(element, 'data-dragover', () => (isDragOver() ? '' : null));\n\n // Setup interactions\n ngpInteractions({\n hover: true,\n press: true,\n focusVisible: true,\n disabled,\n });\n\n // Create file input\n const input: HTMLInputElement = document.createElement('input');\n input.type = 'file';\n input.style.display = 'none';\n\n input.addEventListener('change', () => {\n const files = input.files;\n selected.emit(files);\n onSelected?.(files);\n input.value = '';\n });\n\n input.addEventListener('cancel', () => {\n canceled.emit();\n onCanceled?.();\n });\n\n function showFileDialog(): void {\n if (disabled?.()) {\n return;\n }\n\n const fileTypesValue = fileTypes?.()?.join(',');\n if (fileTypesValue) {\n input.accept = fileTypesValue;\n }\n\n input.multiple = multiple?.() ?? false;\n input.webkitdirectory = directory?.() ?? false;\n input.click();\n }\n\n function onDragEnter(event: DragEvent): void {\n if (disabled?.() || !dragAndDrop?.()) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n isDragOver.set(true);\n dragOver.emit(true);\n onDragOver?.(true);\n }\n\n function onDragOverHandler(event: DragEvent): void {\n if (disabled?.() || !dragAndDrop?.()) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n isDragOver.set(true);\n }\n\n function onDragLeave(event: DragEvent): void {\n if (disabled?.() || !dragAndDrop?.() || !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 (element.nativeElement.contains(event.relatedTarget as Node)) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n isDragOver.set(false);\n dragOver.emit(false);\n onDragOver?.(false);\n }\n\n function onDrop(event: DragEvent): void {\n if (disabled?.() || !dragAndDrop?.()) {\n return;\n }\n\n event.preventDefault();\n isDragOver.set(false);\n dragOver.emit(false);\n onDragOver?.(false);\n\n const fileList = event.dataTransfer?.files;\n if (fileList) {\n const filteredFiles = fileDropFilter(fileList, fileTypes?.(), multiple?.() ?? false);\n\n if (filteredFiles) {\n selected.emit(filteredFiles);\n onSelected?.(filteredFiles);\n } else {\n rejected.emit();\n onRejected?.();\n }\n }\n }\n\n // Event listeners\n listener(element, 'click', showFileDialog);\n listener(element, 'dragenter', onDragEnter);\n listener(element, 'dragover', onDragOverHandler);\n listener(element, 'dragleave', onDragLeave);\n listener(element, 'drop', onDrop);\n\n return {\n isDragOver,\n selected: selected.asObservable(),\n canceled: canceled.asObservable(),\n rejected: rejected.asObservable(),\n dragOver: dragOver.asObservable(),\n showFileDialog,\n };\n },\n);\n","import { BooleanInput, coerceStringArray } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, output } from '@angular/core';\nimport { ngpFileUpload, 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})\nexport class NgpFileUpload {\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 cancel the file selection.\n */\n readonly canceled = output<void>({\n alias: 'ngpFileUploadCanceled',\n });\n\n /**\n * Emits when uploaded files are rejected because they do not match the allowed {@link fileTypes}.\n */\n readonly rejected = output<void>({\n alias: 'ngpFileUploadRejected',\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 private readonly state = ngpFileUpload({\n fileTypes: this.fileTypes,\n multiple: this.multiple,\n directory: this.directory,\n dragAndDrop: this.dragAndDrop,\n disabled: this.disabled,\n onSelected: files => this.selected.emit(files),\n onCanceled: () => this.canceled.emit(),\n onRejected: () => this.rejected.emit(),\n onDragOver: isDragOver => this.dragOver.emit(isDragOver),\n });\n\n /**\n * Whether the user is currently dragging a file over the file upload.\n */\n readonly isDragOver = this.state.isDragOver;\n\n /**\n * Show the file dialog.\n */\n showFileDialog(): void {\n this.state.showFileDialog();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;SAAgB,cAAc,CAC5B,QAAkB,EAClB,aAAmC,EACnC,QAAiB,EAAA;IAEjB,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,kBAAkB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;AAE/F,IAAA,MAAM,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;AAEnE,IAAA,OAAO,YAAY,CAAC,MAAM,GAAG,CAAC,GAAG,eAAe,CAAC,YAAY,CAAC,GAAG,IAAI;AACvE;AAEM,SAAU,kBAAkB,CAAC,IAAU,EAAE,aAAmC,EAAA;;AAEhF,IAAA,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC;AAAE,QAAA,OAAO,IAAI;AAE7D,IAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI;IAC1B,MAAM,QAAQ,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,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,EAAA,SAAA,EAFb,CAAC,sBAAsB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAE1B,aAAa,EAAA,UAAA,EAAA,CAAA;kBALzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,SAAS,EAAE,CAAC,sBAAsB,EAAE,CAAC;AACtC,iBAAA;;;ACXD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-file-upload.mjs","sources":["../../../../packages/ng-primitives/file-upload/src/file-dropzone/file-drop-filter.ts","../../../../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":["export function fileDropFilter(\n fileList: FileList,\n acceptedTypes: string[] | undefined,\n multiple: boolean,\n) {\n const validFiles = Array.from(fileList).filter(file => isFileTypeAccepted(file, acceptedTypes));\n\n const limitedFiles = multiple ? validFiles : validFiles.slice(0, 1);\n\n return limitedFiles.length > 0 ? filesToFileList(limitedFiles) : null;\n}\n\nexport function isFileTypeAccepted(file: File, acceptedTypes: string[] | undefined) {\n // allow all file types if no types are specified\n if (!acceptedTypes || acceptedTypes.length === 0) return true;\n\n const mimeType = file.type;\n const fileName = file.name.toLowerCase();\n\n return acceptedTypes.some(type => {\n type = type.toLowerCase();\n\n if (type.startsWith('.')) {\n return fileName.endsWith(type);\n }\n\n if (type.endsWith('/*')) {\n const baseType = type.replace('/*', '');\n return mimeType.startsWith(baseType);\n }\n\n return mimeType === type;\n });\n}\n\nfunction filesToFileList(files: File[]): FileList {\n const dataTransfer = new DataTransfer();\n files.forEach(file => dataTransfer.items.add(file));\n return dataTransfer.files;\n}\n","import { Signal, signal } from '@angular/core';\nimport { ngpHover } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n controlled,\n createPrimitive,\n dataBinding,\n deprecatedSetter,\n emitter,\n listener,\n} from 'ng-primitives/state';\nimport { Observable } from 'rxjs';\nimport { fileDropFilter } from './file-drop-filter';\n\n/**\n * The state for the NgpFileDropzone directive.\n */\nexport interface NgpFileDropzoneState {\n /**\n * Whether the file dropzone is disabled.\n */\n readonly disabled: Signal<boolean | undefined>;\n /**\n * Whether the user is currently dragging over the element.\n */\n readonly isDragOver: Signal<boolean>;\n /**\n * Observable that emits when files are selected.\n */\n readonly selected: Observable<FileList | null>;\n /**\n * Observable that emits when files are rejected.\n */\n readonly rejected: Observable<void>;\n /**\n * Observable that emits when drag over state changes.\n */\n readonly dragOver: Observable<boolean>;\n\n /**\n * Set the accepted file types.\n */\n readonly fileTypes: Signal<string[] | undefined>;\n /**\n * Whether multiple files can be selected.\n */\n readonly multiple: Signal<boolean | undefined>;\n /**\n * Whether directories can be selected.\n */\n readonly directory: Signal<boolean | undefined>;\n\n /**\n * Set the disabled state.\n */\n setDisabled(value: boolean): void;\n}\n\n/**\n * The props for the NgpFileDropzone state.\n */\nexport interface NgpFileDropzoneProps {\n /**\n * The accepted file types.\n */\n readonly fileTypes?: Signal<string[] | undefined>;\n /**\n * Whether multiple files can be selected.\n */\n readonly multiple?: Signal<boolean>;\n /**\n * Whether directories can be selected.\n */\n readonly directory?: Signal<boolean>;\n /**\n * Whether the file dropzone is disabled.\n */\n readonly disabled?: Signal<boolean>;\n /**\n * Callback when files are selected.\n */\n readonly onSelected?: (files: FileList | null) => void;\n /**\n * Callback when files are rejected.\n */\n readonly onRejected?: () => void;\n /**\n * Callback when drag over state changes.\n */\n readonly onDragOver?: (isDragOver: boolean) => void;\n}\n\nexport const [\n NgpFileDropzoneStateToken,\n ngpFileDropzone,\n injectFileDropzoneState,\n provideFileDropzoneState,\n] = createPrimitive(\n 'NgpFileDropzone',\n ({\n fileTypes = signal<string[] | undefined>(undefined),\n multiple = signal<boolean>(false),\n directory = signal<boolean>(false),\n disabled: _disabled = signal<boolean>(false),\n onSelected,\n onRejected,\n onDragOver,\n }: NgpFileDropzoneProps) => {\n const element = injectElementRef();\n const isDragOverState = signal(false);\n\n // Controlled properties\n const disabled = controlled(_disabled);\n\n // Create observables\n const selected = emitter<FileList | null>();\n const rejected = emitter<void>();\n const dragOver = emitter<boolean>();\n\n // Host bindings\n dataBinding(element, 'data-dragover', () => (isDragOverState() ? '' : null));\n dataBinding(element, 'data-disabled', () => (disabled?.() ? '' : null));\n\n // Setup hover interaction\n ngpHover({ disabled });\n\n function onDragEnter(event: DragEvent): void {\n if (disabled?.()) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n isDragOverState.set(true);\n dragOver.emit(true);\n onDragOver?.(true);\n }\n\n function onDragOverHandler(event: DragEvent): void {\n if (disabled?.()) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n isDragOverState.set(true);\n }\n\n function onDragLeave(event: DragEvent): void {\n if (disabled?.() || !isDragOverState()) {\n return;\n }\n\n // if the element we are dragging over is a child of the file dropzone, ignore the event\n if (element.nativeElement.contains(event.relatedTarget as Node)) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n isDragOverState.set(false);\n dragOver.emit(false);\n onDragOver?.(false);\n }\n\n function onDrop(event: DragEvent): void {\n if (disabled?.()) {\n return;\n }\n\n event.preventDefault();\n isDragOverState.set(false);\n dragOver.emit(false);\n onDragOver?.(false);\n\n const fileList = event.dataTransfer?.files;\n if (fileList) {\n const filteredFiles = fileDropFilter(fileList, fileTypes?.(), multiple?.() ?? false);\n\n if (filteredFiles) {\n selected.emit(filteredFiles);\n onSelected?.(filteredFiles);\n } else {\n rejected.emit();\n onRejected?.();\n }\n }\n }\n\n // Event listeners\n listener(element, 'dragenter', onDragEnter);\n listener(element, 'dragover', onDragOverHandler);\n listener(element, 'dragleave', onDragLeave);\n listener(element, 'drop', onDrop);\n\n function setDisabled(value: boolean): void {\n disabled?.set(value);\n }\n\n return {\n disabled: deprecatedSetter(disabled, 'setDisabled'),\n fileTypes,\n multiple,\n directory,\n isDragOver: isDragOverState,\n selected: selected.asObservable(),\n rejected: rejected.asObservable(),\n dragOver: dragOver.asObservable(),\n setDisabled,\n } satisfies NgpFileDropzoneState;\n },\n);\n","import { BooleanInput, coerceStringArray } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, output } from '@angular/core';\nimport { ngpFileDropzone, 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})\nexport class NgpFileDropzone {\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 uploaded files are rejected because they do not match the allowed {@link fileTypes}.\n */\n readonly rejected = output<void>({\n alias: 'ngpFileDropzoneRejected',\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 private readonly state = ngpFileDropzone({\n fileTypes: this.fileTypes,\n multiple: this.multiple,\n directory: this.directory,\n disabled: this.disabled,\n onSelected: files => this.selected.emit(files),\n onRejected: () => this.rejected.emit(),\n onDragOver: isDragOver => this.dragOver.emit(isDragOver),\n });\n\n /**\n * Whether the user is currently dragging a file over the file upload.\n */\n readonly isDragOver = this.state.isDragOver;\n}\n","import { DOCUMENT, inject, Signal, signal } from '@angular/core';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { createPrimitive, dataBinding, emitter, listener } from 'ng-primitives/state';\nimport { Observable } from 'rxjs';\nimport { fileDropFilter } from '../file-dropzone/file-drop-filter';\n\n/**\n * The state for the NgpFileUpload directive.\n */\nexport interface NgpFileUploadState {\n /**\n * Whether the user is currently dragging over the element.\n */\n readonly isDragOver: Signal<boolean>;\n /**\n * Observable that emits when files are selected.\n */\n readonly selected: Observable<FileList | null>;\n /**\n * Observable that emits when file selection is canceled.\n */\n readonly canceled: Observable<void>;\n /**\n * Observable that emits when files are rejected.\n */\n readonly rejected: Observable<void>;\n /**\n * Observable that emits when drag over state changes.\n */\n readonly dragOver: Observable<boolean>;\n /**\n * Show the file dialog.\n */\n showFileDialog(): void;\n}\n\n/**\n * The props for the NgpFileUpload state.\n */\nexport interface NgpFileUploadProps {\n /**\n * The accepted file types.\n */\n readonly fileTypes?: Signal<string[] | undefined>;\n /**\n * Whether multiple files can be selected.\n */\n readonly multiple?: Signal<boolean>;\n /**\n * Whether directories can be selected.\n */\n readonly directory?: Signal<boolean>;\n /**\n * Whether drag and drop is enabled.\n */\n readonly dragAndDrop?: Signal<boolean>;\n /**\n * Whether the file upload is disabled.\n */\n readonly disabled?: Signal<boolean>;\n /**\n * Callback when files are selected.\n */\n readonly onSelected?: (files: FileList | null) => void;\n /**\n * Callback when file selection is canceled.\n */\n readonly onCanceled?: () => void;\n /**\n * Callback when files are rejected.\n */\n readonly onRejected?: () => void;\n /**\n * Callback when drag over state changes.\n */\n readonly onDragOver?: (isDragOver: boolean) => void;\n}\n\nexport const [\n NgpFileUploadStateToken,\n ngpFileUpload,\n injectFileUploadState,\n provideFileUploadState,\n] = createPrimitive(\n 'NgpFileUpload',\n ({\n fileTypes,\n multiple,\n directory,\n dragAndDrop,\n disabled,\n onSelected,\n onCanceled,\n onRejected,\n onDragOver,\n }: NgpFileUploadProps) => {\n const element = injectElementRef();\n const document = inject(DOCUMENT);\n\n const isDragOver = signal(false);\n\n // Create observables\n const selected = emitter<FileList | null>();\n const canceled = emitter<void>();\n const rejected = emitter<void>();\n const dragOver = emitter<boolean>();\n\n // Host bindings\n dataBinding(element, 'data-disabled', () => (disabled?.() ? '' : null));\n dataBinding(element, 'data-dragover', () => (isDragOver() ? '' : null));\n\n // Setup interactions\n ngpInteractions({\n hover: true,\n press: true,\n focusVisible: true,\n disabled,\n });\n\n // Create file input\n const input: HTMLInputElement = document.createElement('input');\n input.type = 'file';\n input.style.display = 'none';\n\n input.addEventListener('change', () => {\n const files = input.files;\n selected.emit(files);\n onSelected?.(files);\n input.value = '';\n });\n\n input.addEventListener('cancel', () => {\n canceled.emit();\n onCanceled?.();\n });\n\n function showFileDialog(): void {\n if (disabled?.()) {\n return;\n }\n\n const fileTypesValue = fileTypes?.()?.join(',');\n if (fileTypesValue) {\n input.accept = fileTypesValue;\n }\n\n input.multiple = multiple?.() ?? false;\n input.webkitdirectory = directory?.() ?? false;\n input.click();\n }\n\n function onDragEnter(event: DragEvent): void {\n if (disabled?.() || !dragAndDrop?.()) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n isDragOver.set(true);\n dragOver.emit(true);\n onDragOver?.(true);\n }\n\n function onDragOverHandler(event: DragEvent): void {\n if (disabled?.() || !dragAndDrop?.()) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n isDragOver.set(true);\n }\n\n function onDragLeave(event: DragEvent): void {\n if (disabled?.() || !dragAndDrop?.() || !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 (element.nativeElement.contains(event.relatedTarget as Node)) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n isDragOver.set(false);\n dragOver.emit(false);\n onDragOver?.(false);\n }\n\n function onDrop(event: DragEvent): void {\n if (disabled?.() || !dragAndDrop?.()) {\n return;\n }\n\n event.preventDefault();\n isDragOver.set(false);\n dragOver.emit(false);\n onDragOver?.(false);\n\n const fileList = event.dataTransfer?.files;\n if (fileList) {\n const filteredFiles = fileDropFilter(fileList, fileTypes?.(), multiple?.() ?? false);\n\n if (filteredFiles) {\n selected.emit(filteredFiles);\n onSelected?.(filteredFiles);\n } else {\n rejected.emit();\n onRejected?.();\n }\n }\n }\n\n // Event listeners\n listener(element, 'click', showFileDialog);\n listener(element, 'dragenter', onDragEnter);\n listener(element, 'dragover', onDragOverHandler);\n listener(element, 'dragleave', onDragLeave);\n listener(element, 'drop', onDrop);\n\n return {\n isDragOver,\n selected: selected.asObservable(),\n canceled: canceled.asObservable(),\n rejected: rejected.asObservable(),\n dragOver: dragOver.asObservable(),\n showFileDialog,\n } satisfies NgpFileUploadState;\n },\n);\n","import { BooleanInput, coerceStringArray } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, output } from '@angular/core';\nimport { ngpFileUpload, 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})\nexport class NgpFileUpload {\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 cancel the file selection.\n */\n readonly canceled = output<void>({\n alias: 'ngpFileUploadCanceled',\n });\n\n /**\n * Emits when uploaded files are rejected because they do not match the allowed {@link fileTypes}.\n */\n readonly rejected = output<void>({\n alias: 'ngpFileUploadRejected',\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 private readonly state = ngpFileUpload({\n fileTypes: this.fileTypes,\n multiple: this.multiple,\n directory: this.directory,\n dragAndDrop: this.dragAndDrop,\n disabled: this.disabled,\n onSelected: files => this.selected.emit(files),\n onCanceled: () => this.canceled.emit(),\n onRejected: () => this.rejected.emit(),\n onDragOver: isDragOver => this.dragOver.emit(isDragOver),\n });\n\n /**\n * Whether the user is currently dragging a file over the file upload.\n */\n readonly isDragOver = this.state.isDragOver;\n\n /**\n * Show the file dialog.\n */\n showF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,EAAA,uBAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,EAAA,SAAA,EAFb,CAAC,sBAAsB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAE1B,aAAa,EAAA,UAAA,EAAA,CAAA;kBALzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,SAAS,EAAE,CAAC,sBAAsB,EAAE,CAAC;AACtC,iBAAA;;;ACXD;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-focus-trap.mjs","sources":["../../../../packages/ng-primitives/focus-trap/src/focus-trap/focus-trap-state.ts","../../../../packages/ng-primitives/focus-trap/src/focus-trap/focus-trap.ts","../../../../packages/ng-primitives/focus-trap/src/ng-primitives-focus-trap.ts"],"sourcesContent":["import { FocusMonitor, InteractivityChecker } from '@angular/cdk/a11y';\nimport { afterNextRender, inject, Injector, NgZone, signal, Signal } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { NgpOverlay } from 'ng-primitives/portal';\nimport {\n attrBinding,\n createPrimitive,\n dataBinding,\n listener,\n onDestroy,\n} from 'ng-primitives/state';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\n\nclass FocusTrap {\n /**\n * Whether the focus trap is active.\n */\n active: boolean = false;\n\n /**\n * Activates the focus trap.\n */\n activate(): void {\n this.active = true;\n }\n\n /**\n * Deactivates the focus trap.\n */\n deactivate(): void {\n this.active = false;\n }\n}\n\nclass FocusTrapStack {\n /**\n * The stack of focus traps.\n */\n private readonly stack: FocusTrap[] = [];\n\n /**\n * Adds a focus trap to the stack.\n */\n add(focusTrap: FocusTrap): void {\n // deactivate the previous focus trap\n this.stack.forEach(t => t.deactivate());\n\n // add the new focus trap and activate it\n this.stack.push(focusTrap);\n focusTrap.activate();\n }\n\n /**\n * Removes a focus trap from the stack.\n */\n remove(focusTrap: FocusTrap): void {\n // remove the focus trap\n const index = this.stack.indexOf(focusTrap);\n\n if (index >= 0) {\n this.stack.splice(index, 1);\n }\n\n // activate the previous focus trap\n const previous = this.stack[this.stack.length - 1];\n\n if (previous) {\n previous.activate();\n }\n }\n}\n\n// create a global stack of focus traps\nconst focusTrapStack = new FocusTrapStack();\n\n/**\n * The state for the FocusTrap primitive.\n */\nexport interface NgpFocusTrapState {\n // No public API\n}\n\n/**\n * The props for the FocusTrap primitive.\n */\nexport interface NgpFocusTrapProps {\n /**\n * Whether the focus trap is disabled.\n */\n readonly disabled?: Signal<boolean>;\n}\n\nexport const [NgpFocusTrapStateToken, ngpFocusTrap, injectFocusTrapState, provideFocusTrapState] =\n createPrimitive('NgpFocusTrap', ({ disabled = signal(false) }: NgpFocusTrapProps) => {\n const element = injectElementRef();\n const overlay = inject(NgpOverlay, { optional: true });\n const injector = inject(Injector);\n const focusMonitor = inject(FocusMonitor);\n const interactivityChecker = inject(InteractivityChecker);\n const ngZone = inject(NgZone);\n\n // Create a new focus trap\n const focusTrap = new FocusTrap();\n\n // Store the mutation observer\n let mutationObserver: MutationObserver | null = null;\n\n // Store the last focused element\n let lastFocusedElement: HTMLElement | null = null;\n\n // Host bindings\n attrBinding(element, 'tabindex', '-1');\n dataBinding(element, 'data-focus-trap', () => (disabled() ? null : ''));\n\n // Setup the focus trap\n function setupFocusTrap(): void {\n focusTrapStack.add(focusTrap);\n\n mutationObserver = new MutationObserver(handleMutations);\n\n // Setup event listeners\n ngZone.runOutsideAngular(() => {\n mutationObserver!.observe(element.nativeElement, {\n childList: true,\n subtree: true,\n });\n document.addEventListener('focusin', handleFocusIn);\n document.addEventListener('focusout', handleFocusOut);\n });\n\n const previouslyFocusedElement = document.activeElement as HTMLElement | null;\n const hasFocusedCandidate = element.nativeElement.contains(previouslyFocusedElement);\n\n if (!hasFocusedCandidate) {\n // we do this to ensure the content is rendered before we try to find the first focusable element\n // and focus it\n afterNextRender(\n {\n write: () => {\n focusFirst();\n\n // if the focus didn't change, focus the container\n if (document.activeElement === previouslyFocusedElement) {\n focus(element.nativeElement);\n }\n },\n },\n { injector },\n );\n }\n }\n\n function teardownFocusTrap(): void {\n focusTrapStack.remove(focusTrap);\n mutationObserver?.disconnect();\n mutationObserver = null;\n focusTrap.deactivate();\n\n // Remove event listeners\n document.removeEventListener('focusin', handleFocusIn);\n document.removeEventListener('focusout', handleFocusOut);\n }\n\n function handleFocusIn(event: FocusEvent): void {\n if (!focusTrap.active || disabled?.()) {\n return;\n }\n\n const target = event.target as HTMLElement | null;\n\n if (element.nativeElement.contains(target)) {\n lastFocusedElement = target;\n } else {\n focus(lastFocusedElement);\n }\n }\n\n /**\n * Handles the `focusout` event.\n */\n function handleFocusOut(event: FocusEvent) {\n if (!focusTrap.active || disabled?.() || event.relatedTarget === null) {\n return;\n }\n\n const relatedTarget = event.relatedTarget as HTMLElement;\n\n if (!element.nativeElement.contains(relatedTarget)) {\n focus(lastFocusedElement);\n }\n }\n\n /**\n * If the focused element gets removed from the DOM, browsers move focus back to the document.body.\n * We move focus to the container to keep focus trapped correctly.\n */\n function handleMutations(mutations: MutationRecord[]): void {\n const focusedElement = document.activeElement as HTMLElement | null;\n\n if (focusedElement !== document.body) {\n return;\n }\n\n for (const mutation of mutations) {\n if (mutation.removedNodes.length > 0) {\n focus(element.nativeElement);\n }\n }\n }\n\n /**\n * Handles the `keydown` event.\n */\n function handleKeyDown(event: KeyboardEvent): void {\n if (!focusTrap.active || disabled?.()) {\n return;\n }\n\n const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey;\n const focusedElement = document.activeElement as HTMLElement | null;\n\n if (isTabKey && focusedElement) {\n const container = event.currentTarget as HTMLElement;\n const [first, last] = getTabbableEdges(container);\n const hasTabbableElementsInside = first && last;\n\n // we can only wrap focus if we have tabbable edges\n if (!hasTabbableElementsInside) {\n if (focusedElement === container) {\n event.preventDefault();\n }\n } else {\n if (!event.shiftKey && focusedElement === last) {\n event.preventDefault();\n focus(first);\n } else if (event.shiftKey && focusedElement === first) {\n event.preventDefault();\n focus(last);\n }\n }\n }\n }\n\n /**\n * Returns the first and last tabbable elements inside a container.\n */\n function getTabbableEdges(container: HTMLElement) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates);\n const last = findVisible(candidates.reverse());\n return [first, last] as const;\n }\n\n /**\n * Returns a list of potential focusable elements inside a container.\n */\n function getTabbableCandidates(container: HTMLElement) {\n const nodes: HTMLElement[] = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node: HTMLElement) =>\n interactivityChecker.isFocusable(node)\n ? NodeFilter.FILTER_ACCEPT\n : NodeFilter.FILTER_SKIP,\n });\n while (walker.nextNode()) {\n nodes.push(walker.currentNode as HTMLElement);\n }\n return nodes;\n }\n\n /**\n * Returns the first visible element in a list..\n */\n function findVisible(elements: HTMLElement[]) {\n return elements.find(element => interactivityChecker.isVisible(element)) ?? null;\n }\n\n function focus(element: HTMLElement | null): void {\n if (!element) {\n return;\n }\n // Its not great that we are relying on an internal API here, but we need to in order to\n // try and best determine the focus origin when it is programmatically closed by the user.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n focusMonitor.focusVia(element, (focusMonitor as any)._lastFocusOrigin, {\n preventScroll: true,\n });\n }\n\n function focusFirst(): void {\n const previouslyFocusedElement = document.activeElement;\n\n for (const candidate of getTabbableCandidates(element.nativeElement)) {\n focus(candidate);\n\n if (document.activeElement !== previouslyFocusedElement) {\n return;\n }\n }\n }\n\n // Setup the focus trap\n setupFocusTrap();\n\n // Teardown the focus trap on destroy\n onDestroy(teardownFocusTrap);\n\n // Listen to keydown events\n listener(element, 'keydown', handleKeyDown);\n\n // if this is used within an overlay we must disable the focus trap as soon as the overlay is closing\n overlay?.closing.pipe(safeTakeUntilDestroyed()).subscribe(() => focusTrap.deactivate());\n\n return {};\n });\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input } from '@angular/core';\nimport { ngpFocusTrap, provideFocusTrapState } from './focus-trap-state';\n\n/**\n * This implementation is based on the Radix UI FocusScope:\n * https://github.com/radix-ui/primitives/blob/main/packages/react/focus-scope/src/FocusScope.tsx#L306\n */\n\n/**\n * The `NgpFocusTrap` directive traps focus within the host element.\n */\n@Directive({\n selector: '[ngpFocusTrap]',\n exportAs: 'ngpFocusTrap',\n providers: [provideFocusTrapState()],\n})\nexport class NgpFocusTrap {\n /**\n * Whether the focus trap is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFocusTrapDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The focus trap state.\n */\n constructor() {\n ngpFocusTrap({ disabled: this.disabled });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAaA,MAAM,SAAS,CAAA;AAAf,IAAA,WAAA,GAAA;AACE;;AAEG;QACH,IAAA,CAAA,MAAM,GAAY,KAAK;IAezB;AAbE;;AAEG;IACH,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,MAAM,GAAG,IAAI;IACpB;AAEA;;AAEG;IACH,UAAU,GAAA;AACR,QAAA,IAAI,CAAC,MAAM,GAAG,KAAK;IACrB;AACD;AAED,MAAM,cAAc,CAAA;AAApB,IAAA,WAAA,GAAA;AACE;;AAEG;QACc,IAAA,CAAA,KAAK,GAAgB,EAAE;IAgC1C;AA9BE;;AAEG;AACH,IAAA,GAAG,CAAC,SAAoB,EAAA;;AAEtB,QAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;;AAGvC,QAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;QAC1B,SAAS,CAAC,QAAQ,EAAE;IACtB;AAEA;;AAEG;AACH,IAAA,MAAM,CAAC,SAAoB,EAAA;;QAEzB,MAAM,K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ap/focus-trap-state.ts","../../../../packages/ng-primitives/focus-trap/src/focus-trap/focus-trap.ts","../../../../packages/ng-primitives/focus-trap/src/ng-primitives-focus-trap.ts"],"sourcesContent":["import { FocusMonitor, InteractivityChecker } from '@angular/cdk/a11y';\nimport { afterNextRender, inject, Injector, NgZone, signal, Signal } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { NgpOverlay } from 'ng-primitives/portal';\nimport {\n attrBinding,\n createPrimitive,\n dataBinding,\n listener,\n onDestroy,\n} from 'ng-primitives/state';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\n\nclass FocusTrap {\n /**\n * Whether the focus trap is active.\n */\n active: boolean = false;\n\n /**\n * Activates the focus trap.\n */\n activate(): void {\n this.active = true;\n }\n\n /**\n * Deactivates the focus trap.\n */\n deactivate(): void {\n this.active = false;\n }\n}\n\nclass FocusTrapStack {\n /**\n * The stack of focus traps.\n */\n private readonly stack: FocusTrap[] = [];\n\n /**\n * Adds a focus trap to the stack.\n */\n add(focusTrap: FocusTrap): void {\n // deactivate the previous focus trap\n this.stack.forEach(t => t.deactivate());\n\n // add the new focus trap and activate it\n this.stack.push(focusTrap);\n focusTrap.activate();\n }\n\n /**\n * Removes a focus trap from the stack.\n */\n remove(focusTrap: FocusTrap): void {\n // remove the focus trap\n const index = this.stack.indexOf(focusTrap);\n\n if (index >= 0) {\n this.stack.splice(index, 1);\n }\n\n // activate the previous focus trap\n const previous = this.stack[this.stack.length - 1];\n\n if (previous) {\n previous.activate();\n }\n }\n}\n\n// create a global stack of focus traps\nconst focusTrapStack = new FocusTrapStack();\n\n/**\n * The state for the FocusTrap primitive.\n */\nexport interface NgpFocusTrapState {\n // No public API\n}\n\n/**\n * The props for the FocusTrap primitive.\n */\nexport interface NgpFocusTrapProps {\n /**\n * Whether the focus trap is disabled.\n */\n readonly disabled?: Signal<boolean>;\n}\n\nexport const [NgpFocusTrapStateToken, ngpFocusTrap, injectFocusTrapState, provideFocusTrapState] =\n createPrimitive('NgpFocusTrap', ({ disabled = signal(false) }: NgpFocusTrapProps) => {\n const element = injectElementRef();\n const overlay = inject(NgpOverlay, { optional: true });\n const injector = inject(Injector);\n const focusMonitor = inject(FocusMonitor);\n const interactivityChecker = inject(InteractivityChecker);\n const ngZone = inject(NgZone);\n\n // Create a new focus trap\n const focusTrap = new FocusTrap();\n\n // Store the mutation observer\n let mutationObserver: MutationObserver | null = null;\n\n // Store the last focused element\n let lastFocusedElement: HTMLElement | null = null;\n\n // Host bindings\n attrBinding(element, 'tabindex', '-1');\n dataBinding(element, 'data-focus-trap', () => (disabled() ? null : ''));\n\n // Setup the focus trap\n function setupFocusTrap(): void {\n focusTrapStack.add(focusTrap);\n\n mutationObserver = new MutationObserver(handleMutations);\n\n // Setup event listeners\n ngZone.runOutsideAngular(() => {\n mutationObserver!.observe(element.nativeElement, {\n childList: true,\n subtree: true,\n });\n document.addEventListener('focusin', handleFocusIn);\n document.addEventListener('focusout', handleFocusOut);\n });\n\n const previouslyFocusedElement = document.activeElement as HTMLElement | null;\n const hasFocusedCandidate = element.nativeElement.contains(previouslyFocusedElement);\n\n if (!hasFocusedCandidate) {\n // we do this to ensure the content is rendered before we try to find the first focusable element\n // and focus it\n afterNextRender(\n {\n write: () => {\n focusFirst();\n\n // if the focus didn't change, focus the container\n if (document.activeElement === previouslyFocusedElement) {\n focus(element.nativeElement);\n }\n },\n },\n { injector },\n );\n }\n }\n\n function teardownFocusTrap(): void {\n focusTrapStack.remove(focusTrap);\n mutationObserver?.disconnect();\n mutationObserver = null;\n focusTrap.deactivate();\n\n // Remove event listeners\n document.removeEventListener('focusin', handleFocusIn);\n document.removeEventListener('focusout', handleFocusOut);\n }\n\n function handleFocusIn(event: FocusEvent): void {\n if (!focusTrap.active || disabled?.()) {\n return;\n }\n\n const target = event.target as HTMLElement | null;\n\n if (element.nativeElement.contains(target)) {\n lastFocusedElement = target;\n } else {\n focus(lastFocusedElement);\n }\n }\n\n /**\n * Handles the `focusout` event.\n */\n function handleFocusOut(event: FocusEvent) {\n if (!focusTrap.active || disabled?.() || event.relatedTarget === null) {\n return;\n }\n\n const relatedTarget = event.relatedTarget as HTMLElement;\n\n if (!element.nativeElement.contains(relatedTarget)) {\n focus(lastFocusedElement);\n }\n }\n\n /**\n * If the focused element gets removed from the DOM, browsers move focus back to the document.body.\n * We move focus to the container to keep focus trapped correctly.\n */\n function handleMutations(mutations: MutationRecord[]): void {\n const focusedElement = document.activeElement as HTMLElement | null;\n\n if (focusedElement !== document.body) {\n return;\n }\n\n for (const mutation of mutations) {\n if (mutation.removedNodes.length > 0) {\n focus(element.nativeElement);\n }\n }\n }\n\n /**\n * Handles the `keydown` event.\n */\n function handleKeyDown(event: KeyboardEvent): void {\n if (!focusTrap.active || disabled?.()) {\n return;\n }\n\n const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey;\n const focusedElement = document.activeElement as HTMLElement | null;\n\n if (isTabKey && focusedElement) {\n const container = event.currentTarget as HTMLElement;\n const [first, last] = getTabbableEdges(container);\n const hasTabbableElementsInside = first && last;\n\n // we can only wrap focus if we have tabbable edges\n if (!hasTabbableElementsInside) {\n if (focusedElement === container) {\n event.preventDefault();\n }\n } else {\n if (!event.shiftKey && focusedElement === last) {\n event.preventDefault();\n focus(first);\n } else if (event.shiftKey && focusedElement === first) {\n event.preventDefault();\n focus(last);\n }\n }\n }\n }\n\n /**\n * Returns the first and last tabbable elements inside a container.\n */\n function getTabbableEdges(container: HTMLElement) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates);\n const last = findVisible(candidates.reverse());\n return [first, last] as const;\n }\n\n /**\n * Returns a list of potential focusable elements inside a container.\n */\n function getTabbableCandidates(container: HTMLElement) {\n const nodes: HTMLElement[] = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node: HTMLElement) =>\n interactivityChecker.isFocusable(node)\n ? NodeFilter.FILTER_ACCEPT\n : NodeFilter.FILTER_SKIP,\n });\n while (walker.nextNode()) {\n nodes.push(walker.currentNode as HTMLElement);\n }\n return nodes;\n }\n\n /**\n * Returns the first visible element in a list..\n */\n function findVisible(elements: HTMLElement[]) {\n return elements.find(element => interactivityChecker.isVisible(element)) ?? null;\n }\n\n function focus(element: HTMLElement | null): void {\n if (!element) {\n return;\n }\n // Its not great that we are relying on an internal API here, but we need to in order to\n // try and best determine the focus origin when it is programmatically closed by the user.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n focusMonitor.focusVia(element, (focusMonitor as any)._lastFocusOrigin, {\n preventScroll: true,\n });\n }\n\n function focusFirst(): void {\n const previouslyFocusedElement = document.activeElement;\n\n for (const candidate of getTabbableCandidates(element.nativeElement)) {\n focus(candidate);\n\n if (document.activeElement !== previouslyFocusedElement) {\n return;\n }\n }\n }\n\n // Setup the focus trap\n setupFocusTrap();\n\n // Teardown the focus trap on destroy\n onDestroy(teardownFocusTrap);\n\n // Listen to keydown events\n listener(element, 'keydown', handleKeyDown);\n\n // if this is used within an overlay we must disable the focus trap as soon as the overlay is closing\n overlay?.closing.pipe(safeTakeUntilDestroyed()).subscribe(() => focusTrap.deactivate());\n\n return {} satisfies NgpFocusTrapState;\n });\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input } from '@angular/core';\nimport { ngpFocusTrap, provideFocusTrapState } from './focus-trap-state';\n\n/**\n * This implementation is based on the Radix UI FocusScope:\n * https://github.com/radix-ui/primitives/blob/main/packages/react/focus-scope/src/FocusScope.tsx#L306\n */\n\n/**\n * The `NgpFocusTrap` directive traps focus within the host element.\n */\n@Directive({\n selector: '[ngpFocusTrap]',\n exportAs: 'ngpFocusTrap',\n providers: [provideFocusTrapState()],\n})\nexport class NgpFocusTrap {\n /**\n * Whether the focus trap is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFocusTrapDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The focus trap state.\n */\n constructor() {\n ngpFocusTrap({ disabled: this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AAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAY,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,sBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,SAAA,EAFZ,CAAC,qBAAqB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAEzB,YAAY,EAAA,UAAA,EAAA,CAAA;kBALxB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,SAAS,EAAE,CAAC,qBAAqB,EAAE,CAAC;AACrC,iBAAA;;;AChBD;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-form-field.mjs","sources":["../../../../packages/ng-primitives/form-field/src/form-field/form-field-state.ts","../../../../packages/ng-primitives/form-field/src/description/description-state.ts","../../../../packages/ng-primitives/form-field/src/description/description.ts","../../../../packages/ng-primitives/form-field/src/error/error-state.ts","../../../../packages/ng-primitives/form-field/src/error/error.ts","../../../../packages/ng-primitives/form-field/src/form-control/form-control-state.ts","../../../../packages/ng-primitives/form-field/src/form-control/form-control.ts","../../../../packages/ng-primitives/form-field/src/form-field/form-field.ts","../../../../packages/ng-primitives/form-field/src/label/label-state.ts","../../../../packages/ng-primitives/form-field/src/label/label.ts","../../../../packages/ng-primitives/form-field/src/ng-primitives-form-field.ts"],"sourcesContent":["import { Injector, Signal, effect, inject, signal, untracked } from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { createPrimitive, dataBinding, onDestroy } from 'ng-primitives/state';\nimport { onChange } from 'ng-primitives/utils';\nimport { Subscription } from 'rxjs';\n\n/**\n * The state interface for the FormField primitive.\n */\nexport interface NgpFormFieldState {\n /**\n * The form labels.\n */\n readonly labels: Signal<string[]>;\n /**\n * The form descriptions.\n */\n readonly descriptions: Signal<string[]>;\n /**\n * The id of the associated form control.\n */\n readonly formControl: Signal<string | null>;\n /**\n * The validation error messages.\n */\n readonly errors: Signal<string[]>;\n /**\n * Whether the control is pristine.\n */\n readonly pristine: Signal<boolean | null>;\n /**\n * Whether the control is touched.\n */\n readonly touched: Signal<boolean | null>;\n /**\n * Whether the control is dirty.\n */\n readonly dirty: Signal<boolean | null>;\n /**\n * Whether the control is valid.\n */\n readonly valid: Signal<boolean | null>;\n /**\n * Whether the control is invalid.\n */\n readonly invalid: Signal<boolean | null>;\n /**\n * Whether the control is pending.\n */\n readonly pending: Signal<boolean | null>;\n /**\n * Whether the control is disabled.\n */\n readonly disabled: Signal<boolean | null>;\n /**\n * Register the id of the associated form control.\n */\n setFormControl(id: string): void;\n /**\n * Register a label with the form field.\n */\n addLabel(label: string): void;\n /**\n * Register a description with the form field.\n */\n addDescription(description: string): void;\n /**\n * Remove the associated form control.\n */\n removeFormControl(): void;\n /**\n * Remove a label from the form field.\n */\n removeLabel(label: string): void;\n /**\n * Remove a description from the form field.\n */\n removeDescription(description: string): void;\n}\n\n/**\n * The props interface for the FormField primitive.\n */\nexport interface NgpFormFieldProps {\n /**\n * Find any NgControl within the form field.\n */\n readonly ngControl: Signal<NgControl | undefined>;\n}\n\nexport const [NgpFormFieldStateToken, ngpFormField, injectFormFieldState, provideFormFieldState] =\n createPrimitive('NgpFormField', ({ ngControl }: NgpFormFieldProps) => {\n const element = injectElementRef();\n const injector = inject(Injector);\n\n // Store the form labels\n const labels = signal<string[]>([]);\n\n // Store the form descriptions\n const descriptions = signal<string[]>([]);\n\n // Store the id of the associated form control\n const formControl = signal<string | null>(null);\n\n // Store the validation error messages\n const errors = signal<string[]>([]);\n\n // Form control state signals\n const pristine = signal<boolean | null>(null);\n const touched = signal<boolean | null>(null);\n const dirty = signal<boolean | null>(null);\n const valid = signal<boolean | null>(null);\n const invalid = signal<boolean | null>(null);\n const pending = signal<boolean | null>(null);\n const disabled = signal<boolean | null>(null);\n\n // Store the current status subscription\n let subscription: Subscription | undefined;\n\n // Host bindings\n dataBinding(element, 'data-invalid', invalid);\n dataBinding(element, 'data-valid', valid);\n dataBinding(element, 'data-touched', touched);\n dataBinding(element, 'data-pristine', pristine);\n dataBinding(element, 'data-dirty', dirty);\n dataBinding(element, 'data-pending', pending);\n dataBinding(element, 'data-disabled', disabled);\n\n function updateStatus(): void {\n const control = ngControl();\n\n if (!control) {\n return;\n }\n\n // Wrap in try-catch to handle signal-forms interop controls where\n // the `field` input may not be available yet (throws NG0950).\n // Reading the signal still establishes a dependency, so the effect\n // will re-run when the input becomes available.\n try {\n const controlPristine = control.pristine;\n const controlTouched = control.touched;\n const controlDirty = control.dirty;\n const controlValid = control.valid;\n const controlInvalid = control.invalid;\n const controlPending = control.pending;\n const controlDisabled = control.disabled;\n const controlErrors = control.errors;\n\n untracked(() => {\n pristine.set(controlPristine);\n touched.set(controlTouched);\n dirty.set(controlDirty);\n valid.set(controlValid);\n invalid.set(controlInvalid);\n pending.set(controlPending);\n disabled.set(controlDisabled);\n errors.set(controlErrors ? Object.keys(controlErrors) : []);\n });\n } catch {\n // NG0950: Required input not available yet. The effect will re-run\n // when the signal input becomes available.\n }\n }\n\n function setupSubscriptions(control: NgControl | null | undefined): void {\n // Unsubscribe from the previous subscriptions.\n subscription?.unsubscribe();\n\n if (!control) {\n return;\n }\n\n // For signal-forms interop controls, use an effect to reactively track status.\n // For classic controls, also use an effect but additionally subscribe to events.\n effect(\n () => {\n updateStatus();\n },\n { injector },\n );\n\n // Classic controls also have an events observable we can subscribe to.\n const underlyingControl = control?.control;\n if (underlyingControl?.events) {\n subscription = underlyingControl.events.subscribe(() => updateStatus());\n }\n }\n\n // Setup subscriptions when ngControl changes\n onChange(ngControl, setupSubscriptions);\n\n // Cleanup subscription on destroy\n onDestroy(() => subscription?.unsubscribe());\n\n // Methods\n function setFormControl(id: string): void {\n formControl.set(id);\n }\n\n function addLabel(label: string): void {\n if (labels().includes(label)) {\n return;\n }\n\n labels.update(currentLabels => [...currentLabels, label]);\n }\n\n function addDescription(description: string): void {\n if (descriptions().includes(description)) {\n return;\n }\n\n descriptions.update(currentDescriptions => [...currentDescriptions, description]);\n }\n\n function removeFormControl(): void {\n formControl.set(null);\n }\n\n function removeLabel(label: string): void {\n labels.update(currentLabels => currentLabels.filter(l => l !== label));\n }\n\n function removeDescription(description: string): void {\n descriptions.update(currentDescriptions =>\n currentDescriptions.filter(d => d !== description),\n );\n }\n\n return {\n labels,\n descriptions,\n formControl,\n errors,\n pristine,\n touched,\n dirty,\n valid,\n invalid,\n pending,\n disabled,\n setFormControl,\n addLabel,\n addDescription,\n removeFormControl,\n removeLabel,\n removeDescription,\n };\n });\n","import { signal, Signal } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { attrBinding, createPrimitive, dataBinding, onDestroy } from 'ng-primitives/state';\nimport { onChange, uniqueId } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-state';\n\n/**\n * The state interface for the Description primitive.\n */\nexport interface NgpDescriptionState {\n /**\n * The id of the description.\n */\n readonly id: Signal<string>;\n}\n\n/**\n * The props interface for the Description primitive.\n */\nexport interface NgpDescriptionProps {\n /**\n * The id of the description.\n */\n readonly id: Signal<string>;\n}\n\nexport const [\n NgpDescriptionStateToken,\n ngpDescription,\n injectDescriptionState,\n provideDescriptionState,\n] = createPrimitive(\n 'NgpDescription',\n ({ id = signal(uniqueId('ngp-description')) }: NgpDescriptionProps) => {\n const element = injectElementRef();\n const formField = injectFormFieldState({ optional: true });\n\n // Host bindings\n attrBinding(element, 'id', id);\n dataBinding(element, 'data-invalid', () => (formField()?.invalid() ? '' : null));\n dataBinding(element, 'data-valid', () => (formField()?.valid() ? '' : null));\n dataBinding(element, 'data-touched', () => (formField()?.touched() ? '' : null));\n dataBinding(element, 'data-pristine', () => (formField()?.pristine() ? '' : null));\n dataBinding(element, 'data-dirty', () => (formField()?.dirty() ? '' : null));\n dataBinding(element, 'data-pending', () => (formField()?.pending() ? '' : null));\n dataBinding(element, 'data-disabled', () => (formField()?.disabled() ? '' : null));\n\n // Register with form field and cleanup on destroy\n formField()?.addDescription(id());\n onDestroy(() => formField()?.removeDescription(id()));\n\n onChange(id, (newId, oldId) => {\n if (oldId) {\n formField()?.removeDescription(oldId);\n }\n formField()?.addDescription(newId);\n });\n\n return { id };\n },\n);\n","import { Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpDescription, provideDescriptionState } from './description-state';\n\n/**\n * The `NgpDescription` directive is used to mark a description element within a form field. There may be multiple descriptions associated with a form control.\n */\n@Directive({\n selector: '[ngpDescription]',\n exportAs: 'ngpDescription',\n providers: [provideDescriptionState()],\n})\nexport class NgpDescription {\n /**\n * The id of the description. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-description'));\n\n /**\n * The description state.\n */\n constructor() {\n ngpDescription({ id: this.id });\n }\n}\n","import { Signal, computed, signal } from '@angular/core';\nimport { explicitEffect, injectElementRef } from 'ng-primitives/internal';\nimport { attrBinding, createPrimitive, dataBinding, onDestroy } from 'ng-primitives/state';\nimport { onBooleanChange } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-state';\n\n/**\n * The state interface for the Error primitive.\n */\nexport interface NgpErrorState {\n /**\n * The id of the error message.\n */\n readonly id: Signal<string>;\n /**\n * Determine if there is an error message.\n */\n readonly hasError: Signal<boolean>;\n /**\n * Determine whether the validator associated with this error is failing.\n */\n readonly state: Signal<'fail' | 'pass'>;\n}\n\n/**\n * The props interface for the Error primitive.\n */\nexport interface NgpErrorProps {\n /**\n * The id of the error message.\n */\n readonly id: Signal<string>;\n /**\n * The validator associated with the error message.\n */\n readonly validator?: Signal<string | null>;\n}\n\nexport const [NgpErrorStateToken, ngpError, injectErrorState, provideErrorState] = createPrimitive(\n 'NgpError',\n ({ id, validator = signal(null) }: NgpErrorProps) => {\n const element = injectElementRef();\n const formField = injectFormFieldState({ optional: true });\n\n // Determine if there is an error message\n const hasError = computed(() => {\n const errors = formField()?.errors() ?? [];\n const validatorValue = validator();\n\n return validatorValue ? errors?.includes(validatorValue) : errors?.length > 0;\n });\n\n // Determine whether the validator associated with this error is failing\n const state = computed(() => (hasError() ? 'fail' : 'pass'));\n\n // Host bindings\n attrBinding(element, 'id', id);\n dataBinding(element, 'data-invalid', () => (formField()?.invalid() ? '' : null));\n dataBinding(element, 'data-valid', () => (formField()?.valid() ? '' : null));\n dataBinding(element, 'data-touched', () => (formField()?.touched() ? '' : null));\n dataBinding(element, 'data-pristine', () => (formField()?.pristine() ? '' : null));\n dataBinding(element, 'data-dirty', () => (formField()?.dirty() ? '' : null));\n dataBinding(element, 'data-pending', () => (formField()?.pending() ? '' : null));\n dataBinding(element, 'data-disabled', () => (formField()?.disabled() ? '' : null));\n dataBinding(element, 'data-validator', state);\n\n let currentId = id();\n\n // Register/unregister with form field based on error state\n function registerError(): void {\n formField()?.addDescription(currentId);\n }\n\n function unregisterError(): void {\n formField()?.removeDescription(currentId);\n }\n\n // Update error registration when hasError changes\n onBooleanChange(hasError, registerError, unregisterError);\n\n function updateIdRegistration(newId: string, oldId?: string): void {\n if (oldId && hasError()) {\n formField()?.removeDescription(oldId);\n }\n currentId = newId;\n if (hasError()) {\n formField()?.addDescription(newId);\n }\n }\n\n // Watch for id changes to update registration\n explicitEffect([id], () => updateIdRegistration(id(), currentId));\n\n // Cleanup on destroy\n onDestroy(() => {\n if (hasError()) {\n formField()?.removeDescription(currentId);\n }\n });\n\n return {\n id,\n hasError,\n state,\n };\n },\n);\n","import { Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpError, provideErrorState } from './error-state';\n\n/**\n * The `NgpError` directive is used to mark an error message element within a form field. There may be multiple error messages associated with a form control.\n */\n@Directive({\n selector: '[ngpError]',\n exportAs: 'ngpError',\n providers: [provideErrorState()],\n})\nexport class NgpError {\n /**\n * The id of the error message. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-error'));\n\n /**\n * The validator associated with the error message.\n */\n readonly validator = input<string | null>(null, {\n alias: 'ngpErrorValidator',\n });\n\n /**\n * The error state.\n */\n constructor() {\n ngpError({ id: this.id, validator: this.validator });\n }\n}\n","import { Signal, computed, signal } from '@angular/core';\nimport { explicitEffect, injectElementRef } from 'ng-primitives/internal';\nimport { attrBinding, dataBinding } from 'ng-primitives/state';\nimport { NgpControlStatus, controlStatus } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-state';\n\ninterface NgpFormControlProps {\n /**\n * The id of the form control.\n */\n\n readonly id: Signal<string>;\n /**\n * Whether the form control is disabled by a parent.\n */\n readonly disabled?: Signal<boolean>;\n}\n\nexport function ngpFormControl({\n id,\n disabled = signal(false),\n}: NgpFormControlProps): Signal<NgpControlStatus> {\n const elementRef = injectElementRef();\n // Access the form field that the form control is associated with.\n const formField = injectFormFieldState({ optional: true });\n // Access the form control status.\n const status = controlStatus();\n // Determine the aria-labelledby attribute value.\n const ariaLabelledBy = computed(() => {\n const labels = formField()?.labels() ?? [];\n return labels.length > 0 ? labels.join(' ') : null;\n });\n // Determine the aria-describedby attribute value.\n const ariaDescribedBy = computed(() => {\n const descriptions = formField()?.descriptions() ?? [];\n return descriptions.length > 0 ? descriptions.join(' ') : null;\n });\n\n const supportsDisabledAttribute = 'disabled' in elementRef.nativeElement;\n\n // Host bindings\n attrBinding(elementRef, 'disabled', () => (supportsDisabledAttribute && disabled() ? '' : null));\n\n explicitEffect([id], ([id], onCleanup) => {\n formField()?.setFormControl(id);\n onCleanup(() => formField()?.removeFormControl());\n });\n\n attrBinding(elementRef, 'id', id);\n attrBinding(elementRef, 'aria-labelledby', ariaLabelledBy);\n attrBinding(elementRef, 'aria-describedby', ariaDescribedBy);\n dataBinding(elementRef, 'data-invalid', () => status().invalid);\n dataBinding(elementRef, 'data-valid', () => status().valid);\n dataBinding(elementRef, 'data-touched', () => status().touched);\n dataBinding(elementRef, 'data-pristine', () => status().pristine);\n dataBinding(elementRef, 'data-dirty', () => status().dirty);\n dataBinding(elementRef, 'data-pending', () => status().pending);\n dataBinding(elementRef, 'data-disabled', () => disabled() || status().disabled);\n\n return computed(() => ({ ...status(), disabled: status().disabled || disabled() }));\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpFormControl } from './form-control-state';\n\n/**\n * Typically this primitive would be not be used directly, but instead a more specific form control primitive would be used (e.g. `ngpInput`). All of our form control primitives use `ngpFormControl` internally so they will have the same accessibility features as described below.\n *\n * The `NgpFormControl` directive is used to mark a form control element within a form field. This element will have an `aria-labelledby` attribute set to the ID of the label element within the form field and an `aria-describedby` attribute set to the ID of the description elements within the form field.\n */\n@Directive({\n selector: '[ngpFormControl]',\n exportAs: 'ngpFormControl',\n})\nexport class NgpFormControl {\n /**\n * The id of the form control. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-form-control'));\n\n /**\n * Whether the form control is disabled by a parent.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFormControlDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The status of the form control.\n */\n readonly status = ngpFormControl({ id: this.id, disabled: this.disabled });\n}\n","import { Directive, contentChild } from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { ngpFormField, provideFormFieldState } from './form-field-state';\n\n/**\n * The `NgpFormField` directive is a container for form field elements. Any labels, form controls, or descriptions should be placed within this directive.\n */\n@Directive({\n selector: '[ngpFormField]',\n exportAs: 'ngpFormField',\n providers: [provideFormFieldState()],\n})\nexport class NgpFormField {\n /**\n * Find any NgControl within the form field.\n * @internal\n */\n private readonly ngControl = contentChild(NgControl);\n\n /**\n * The form field state.\n */\n constructor() {\n ngpFormField({ ngControl: this.ngControl });\n }\n}\n","import { Signal, computed } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n attrBinding,\n createPrimitive,\n dataBinding,\n listener,\n onDestroy,\n} from 'ng-primitives/state';\nimport { onChange } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-state';\n\n/**\n * The state interface for the Label primitive.\n */\nexport interface NgpLabelState {\n /**\n * The id of the label.\n */\n readonly id: Signal<string>;\n /**\n * The htmlFor attribute value.\n */\n readonly htmlFor: Signal<string | null>;\n}\n\n/**\n * The props interface for the Label primitive.\n */\nexport interface NgpLabelProps {\n /**\n * The id of the label.\n */\n readonly id: Signal<string>;\n}\n\nexport const [NgpLabelStateToken, ngpLabel, injectLabelState, provideLabelState] = createPrimitive(\n 'NgpLabel',\n ({ id }: NgpLabelProps) => {\n const element = injectElementRef();\n const formField = injectFormFieldState({ optional: true });\n\n // Derive the for attribute value if the label is an HTML label element\n const htmlFor = computed(() => formField()?.formControl() ?? null);\n\n // Determine if the label is an HTML label element\n const isLabel = element.nativeElement instanceof HTMLLabelElement;\n\n // Host bindings\n attrBinding(element, 'id', id);\n attrBinding(element, 'for', htmlFor);\n dataBinding(element, 'data-invalid', () => (formField()?.invalid() ? '' : null));\n dataBinding(element, 'data-valid', () => (formField()?.valid() ? '' : null));\n dataBinding(element, 'data-touched', () => (formField()?.touched() ? '' : null));\n dataBinding(element, 'data-pristine', () => (formField()?.pristine() ? '' : null));\n dataBinding(element, 'data-dirty', () => (formField()?.dirty() ? '' : null));\n dataBinding(element, 'data-pending', () => (formField()?.pending() ? '' : null));\n dataBinding(element, 'data-disabled', () => (formField()?.disabled() ? '' : null));\n\n function onClick(event: MouseEvent): void {\n // by default a label will perform a click on the associated form control, however\n // this only works if the associated form control is an input element which may not always\n // be the case, so we prevent the default behavior and handle the click event ourselves.\n // This was inspired by the HeadlessUI approach:\n // https://github.com/tailwindlabs/headlessui/blob/main/packages/%40headlessui-react/src/components/label/label.tsx#L58\n if (isLabel) {\n event.preventDefault();\n }\n\n // to find the associated form control we can lookup via the known id\n const targetId = htmlFor();\n\n if (!targetId) {\n return;\n }\n\n const target = document.getElementById(targetId);\n\n if (!target) {\n return;\n }\n\n // if the target is disabled then do nothing\n const disabled = target.getAttribute('disabled');\n const ariaDisabled = target.getAttribute('aria-disabled');\n\n if (disabled === '' || disabled === 'true' || ariaDisabled === 'true') {\n return;\n }\n\n // radio buttons, checkboxes and switches should all be clicked immediately as they require state changes\n if (\n (target instanceof HTMLInputElement &&\n (target.type === 'radio' || target.type === 'checkbox')) ||\n target.role === 'radio' ||\n target.role === 'checkbox' ||\n target.role === 'switch'\n ) {\n target.click();\n }\n\n // Move focus to the element, this allows you to start using keyboard shortcuts since the\n // bound element is now focused.\n target.focus({ preventScroll: true });\n }\n\n // Event listeners\n listener(element, 'click', onClick);\n\n // Register with form field and cleanup on destroy\n formField()?.addLabel(id());\n onDestroy(() => formField()?.removeLabel(id()));\n\n // any time the id changes we need to update the registration with the form field\n onChange(id, (newId, oldId) => {\n if (oldId) {\n formField()?.removeLabel(oldId);\n }\n formField()?.addLabel(newId);\n });\n\n return {\n id,\n htmlFor,\n };\n },\n);\n","import { Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpLabel, provideLabelState } from './label-state';\n\n/**\n * The `NgpLabel` directive is used to mark a label element within a form field. Preferably, there should use an HTML `<label>` element.\n */\n@Directive({\n selector: '[ngpLabel]',\n exportAs: 'ngpLabel',\n providers: [provideLabelState()],\n})\nexport class NgpLabel {\n /**\n * The id of the label. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-label'));\n\n /**\n * The label state.\n */\n constructor() {\n ngpLabel({ id: this.id });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\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CAAC,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAErB,QAAQ,EAAA,UAAA,EAAA,CAAA;kBALpB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,QAAQ,EAAE,UAAU;AACpB,oBAAA,SAAS,EAAE,CAAC,iBAAiB,EAAE,CAAC;AACjC,iBAAA;;;ACXD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-form-field.mjs","sources":["../../../../packages/ng-primitives/form-field/src/form-field/form-field-state.ts","../../../../packages/ng-primitives/form-field/src/description/description-state.ts","../../../../packages/ng-primitives/form-field/src/description/description.ts","../../../../packages/ng-primitives/form-field/src/error/error-state.ts","../../../../packages/ng-primitives/form-field/src/error/error.ts","../../../../packages/ng-primitives/form-field/src/form-control/form-control-state.ts","../../../../packages/ng-primitives/form-field/src/form-control/form-control.ts","../../../../packages/ng-primitives/form-field/src/form-field/form-field.ts","../../../../packages/ng-primitives/form-field/src/label/label-state.ts","../../../../packages/ng-primitives/form-field/src/label/label.ts","../../../../packages/ng-primitives/form-field/src/ng-primitives-form-field.ts"],"sourcesContent":["import { Injector, Signal, effect, inject, signal, untracked } from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { createPrimitive, dataBinding, onDestroy } from 'ng-primitives/state';\nimport { onChange } from 'ng-primitives/utils';\nimport { Subscription } from 'rxjs';\n\n/**\n * The state interface for the FormField primitive.\n */\nexport interface NgpFormFieldState {\n /**\n * The form labels.\n */\n readonly labels: Signal<string[]>;\n /**\n * The form descriptions.\n */\n readonly descriptions: Signal<string[]>;\n /**\n * The id of the associated form control.\n */\n readonly formControl: Signal<string | null>;\n /**\n * The validation error messages.\n */\n readonly errors: Signal<string[]>;\n /**\n * Whether the control is pristine.\n */\n readonly pristine: Signal<boolean | null>;\n /**\n * Whether the control is touched.\n */\n readonly touched: Signal<boolean | null>;\n /**\n * Whether the control is dirty.\n */\n readonly dirty: Signal<boolean | null>;\n /**\n * Whether the control is valid.\n */\n readonly valid: Signal<boolean | null>;\n /**\n * Whether the control is invalid.\n */\n readonly invalid: Signal<boolean | null>;\n /**\n * Whether the control is pending.\n */\n readonly pending: Signal<boolean | null>;\n /**\n * Whether the control is disabled.\n */\n readonly disabled: Signal<boolean | null>;\n /**\n * Register the id of the associated form control.\n */\n setFormControl(id: string): void;\n /**\n * Register a label with the form field.\n */\n addLabel(label: string): void;\n /**\n * Register a description with the form field.\n */\n addDescription(description: string): void;\n /**\n * Remove the associated form control.\n */\n removeFormControl(): void;\n /**\n * Remove a label from the form field.\n */\n removeLabel(label: string): void;\n /**\n * Remove a description from the form field.\n */\n removeDescription(description: string): void;\n}\n\n/**\n * The props interface for the FormField primitive.\n */\nexport interface NgpFormFieldProps {\n /**\n * Find any NgControl within the form field.\n */\n readonly ngControl: Signal<NgControl | undefined>;\n}\n\nexport const [NgpFormFieldStateToken, ngpFormField, injectFormFieldState, provideFormFieldState] =\n createPrimitive('NgpFormField', ({ ngControl }: NgpFormFieldProps) => {\n const element = injectElementRef();\n const injector = inject(Injector);\n\n // Store the form labels\n const labels = signal<string[]>([]);\n\n // Store the form descriptions\n const descriptions = signal<string[]>([]);\n\n // Store the id of the associated form control\n const formControl = signal<string | null>(null);\n\n // Store the validation error messages\n const errors = signal<string[]>([]);\n\n // Form control state signals\n const pristine = signal<boolean | null>(null);\n const touched = signal<boolean | null>(null);\n const dirty = signal<boolean | null>(null);\n const valid = signal<boolean | null>(null);\n const invalid = signal<boolean | null>(null);\n const pending = signal<boolean | null>(null);\n const disabled = signal<boolean | null>(null);\n\n // Store the current status subscription\n let subscription: Subscription | undefined;\n\n // Host bindings\n dataBinding(element, 'data-invalid', invalid);\n dataBinding(element, 'data-valid', valid);\n dataBinding(element, 'data-touched', touched);\n dataBinding(element, 'data-pristine', pristine);\n dataBinding(element, 'data-dirty', dirty);\n dataBinding(element, 'data-pending', pending);\n dataBinding(element, 'data-disabled', disabled);\n\n function updateStatus(): void {\n const control = ngControl();\n\n if (!control) {\n return;\n }\n\n // Wrap in try-catch to handle signal-forms interop controls where\n // the `field` input may not be available yet (throws NG0950).\n // Reading the signal still establishes a dependency, so the effect\n // will re-run when the input becomes available.\n try {\n const controlPristine = control.pristine;\n const controlTouched = control.touched;\n const controlDirty = control.dirty;\n const controlValid = control.valid;\n const controlInvalid = control.invalid;\n const controlPending = control.pending;\n const controlDisabled = control.disabled;\n const controlErrors = control.errors;\n\n untracked(() => {\n pristine.set(controlPristine);\n touched.set(controlTouched);\n dirty.set(controlDirty);\n valid.set(controlValid);\n invalid.set(controlInvalid);\n pending.set(controlPending);\n disabled.set(controlDisabled);\n errors.set(controlErrors ? Object.keys(controlErrors) : []);\n });\n } catch {\n // NG0950: Required input not available yet. The effect will re-run\n // when the signal input becomes available.\n }\n }\n\n function setupSubscriptions(control: NgControl | null | undefined): void {\n // Unsubscribe from the previous subscriptions.\n subscription?.unsubscribe();\n\n if (!control) {\n return;\n }\n\n // For signal-forms interop controls, use an effect to reactively track status.\n // For classic controls, also use an effect but additionally subscribe to events.\n effect(\n () => {\n updateStatus();\n },\n { injector },\n );\n\n // Classic controls also have an events observable we can subscribe to.\n const underlyingControl = control?.control;\n if (underlyingControl?.events) {\n subscription = underlyingControl.events.subscribe(() => updateStatus());\n }\n }\n\n // Setup subscriptions when ngControl changes\n onChange(ngControl, setupSubscriptions);\n\n // Cleanup subscription on destroy\n onDestroy(() => subscription?.unsubscribe());\n\n // Methods\n function setFormControl(id: string): void {\n formControl.set(id);\n }\n\n function addLabel(label: string): void {\n if (labels().includes(label)) {\n return;\n }\n\n labels.update(currentLabels => [...currentLabels, label]);\n }\n\n function addDescription(description: string): void {\n if (descriptions().includes(description)) {\n return;\n }\n\n descriptions.update(currentDescriptions => [...currentDescriptions, description]);\n }\n\n function removeFormControl(): void {\n formControl.set(null);\n }\n\n function removeLabel(label: string): void {\n labels.update(currentLabels => currentLabels.filter(l => l !== label));\n }\n\n function removeDescription(description: string): void {\n descriptions.update(currentDescriptions =>\n currentDescriptions.filter(d => d !== description),\n );\n }\n\n return {\n labels,\n descriptions,\n formControl,\n errors,\n pristine,\n touched,\n dirty,\n valid,\n invalid,\n pending,\n disabled,\n setFormControl,\n addLabel,\n addDescription,\n removeFormControl,\n removeLabel,\n removeDescription,\n } satisfies NgpFormFieldState;\n });\n","import { signal, Signal } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { attrBinding, createPrimitive, dataBinding, onDestroy } from 'ng-primitives/state';\nimport { onChange, uniqueId } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-state';\n\n/**\n * The state interface for the Description primitive.\n */\nexport interface NgpDescriptionState {\n /**\n * The id of the description.\n */\n readonly id: Signal<string>;\n}\n\n/**\n * The props interface for the Description primitive.\n */\nexport interface NgpDescriptionProps {\n /**\n * The id of the description.\n */\n readonly id: Signal<string>;\n}\n\nexport const [\n NgpDescriptionStateToken,\n ngpDescription,\n injectDescriptionState,\n provideDescriptionState,\n] = createPrimitive(\n 'NgpDescription',\n ({ id = signal(uniqueId('ngp-description')) }: NgpDescriptionProps) => {\n const element = injectElementRef();\n const formField = injectFormFieldState({ optional: true });\n\n // Host bindings\n attrBinding(element, 'id', id);\n dataBinding(element, 'data-invalid', () => (formField()?.invalid() ? '' : null));\n dataBinding(element, 'data-valid', () => (formField()?.valid() ? '' : null));\n dataBinding(element, 'data-touched', () => (formField()?.touched() ? '' : null));\n dataBinding(element, 'data-pristine', () => (formField()?.pristine() ? '' : null));\n dataBinding(element, 'data-dirty', () => (formField()?.dirty() ? '' : null));\n dataBinding(element, 'data-pending', () => (formField()?.pending() ? '' : null));\n dataBinding(element, 'data-disabled', () => (formField()?.disabled() ? '' : null));\n\n // Register with form field and cleanup on destroy\n formField()?.addDescription(id());\n onDestroy(() => formField()?.removeDescription(id()));\n\n onChange(id, (newId, oldId) => {\n if (oldId) {\n formField()?.removeDescription(oldId);\n }\n formField()?.addDescription(newId);\n });\n\n return { id } satisfies NgpDescriptionState;\n },\n);\n","import { Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpDescription, provideDescriptionState } from './description-state';\n\n/**\n * The `NgpDescription` directive is used to mark a description element within a form field. There may be multiple descriptions associated with a form control.\n */\n@Directive({\n selector: '[ngpDescription]',\n exportAs: 'ngpDescription',\n providers: [provideDescriptionState()],\n})\nexport class NgpDescription {\n /**\n * The id of the description. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-description'));\n\n /**\n * The description state.\n */\n constructor() {\n ngpDescription({ id: this.id });\n }\n}\n","import { Signal, computed, signal } from '@angular/core';\nimport { explicitEffect, injectElementRef } from 'ng-primitives/internal';\nimport { attrBinding, createPrimitive, dataBinding, onDestroy } from 'ng-primitives/state';\nimport { onBooleanChange } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-state';\n\n/**\n * The state interface for the Error primitive.\n */\nexport interface NgpErrorState {\n /**\n * The id of the error message.\n */\n readonly id: Signal<string>;\n /**\n * Determine if there is an error message.\n */\n readonly hasError: Signal<boolean>;\n /**\n * Determine whether the validator associated with this error is failing.\n */\n readonly state: Signal<'fail' | 'pass'>;\n}\n\n/**\n * The props interface for the Error primitive.\n */\nexport interface NgpErrorProps {\n /**\n * The id of the error message.\n */\n readonly id: Signal<string>;\n /**\n * The validator associated with the error message.\n */\n readonly validator?: Signal<string | null>;\n}\n\nexport const [NgpErrorStateToken, ngpError, injectErrorState, provideErrorState] = createPrimitive(\n 'NgpError',\n ({ id, validator = signal(null) }: NgpErrorProps) => {\n const element = injectElementRef();\n const formField = injectFormFieldState({ optional: true });\n\n // Determine if there is an error message\n const hasError = computed(() => {\n const errors = formField()?.errors() ?? [];\n const validatorValue = validator();\n\n return validatorValue ? errors?.includes(validatorValue) : errors?.length > 0;\n });\n\n // Determine whether the validator associated with this error is failing\n const state = computed(() => (hasError() ? 'fail' : 'pass'));\n\n // Host bindings\n attrBinding(element, 'id', id);\n dataBinding(element, 'data-invalid', () => (formField()?.invalid() ? '' : null));\n dataBinding(element, 'data-valid', () => (formField()?.valid() ? '' : null));\n dataBinding(element, 'data-touched', () => (formField()?.touched() ? '' : null));\n dataBinding(element, 'data-pristine', () => (formField()?.pristine() ? '' : null));\n dataBinding(element, 'data-dirty', () => (formField()?.dirty() ? '' : null));\n dataBinding(element, 'data-pending', () => (formField()?.pending() ? '' : null));\n dataBinding(element, 'data-disabled', () => (formField()?.disabled() ? '' : null));\n dataBinding(element, 'data-validator', state);\n\n let currentId = id();\n\n // Register/unregister with form field based on error state\n function registerError(): void {\n formField()?.addDescription(currentId);\n }\n\n function unregisterError(): void {\n formField()?.removeDescription(currentId);\n }\n\n // Update error registration when hasError changes\n onBooleanChange(hasError, registerError, unregisterError);\n\n function updateIdRegistration(newId: string, oldId?: string): void {\n if (oldId && hasError()) {\n formField()?.removeDescription(oldId);\n }\n currentId = newId;\n if (hasError()) {\n formField()?.addDescription(newId);\n }\n }\n\n // Watch for id changes to update registration\n explicitEffect([id], () => updateIdRegistration(id(), currentId));\n\n // Cleanup on destroy\n onDestroy(() => {\n if (hasError()) {\n formField()?.removeDescription(currentId);\n }\n });\n\n return {\n id,\n hasError,\n state,\n } satisfies NgpErrorState;\n },\n);\n","import { Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpError, provideErrorState } from './error-state';\n\n/**\n * The `NgpError` directive is used to mark an error message element within a form field. There may be multiple error messages associated with a form control.\n */\n@Directive({\n selector: '[ngpError]',\n exportAs: 'ngpError',\n providers: [provideErrorState()],\n})\nexport class NgpError {\n /**\n * The id of the error message. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-error'));\n\n /**\n * The validator associated with the error message.\n */\n readonly validator = input<string | null>(null, {\n alias: 'ngpErrorValidator',\n });\n\n /**\n * The error state.\n */\n constructor() {\n ngpError({ id: this.id, validator: this.validator });\n }\n}\n","import { Signal, computed, signal } from '@angular/core';\nimport { explicitEffect, injectElementRef } from 'ng-primitives/internal';\nimport { attrBinding, dataBinding } from 'ng-primitives/state';\nimport { NgpControlStatus, controlStatus } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-state';\n\ninterface NgpFormControlProps {\n /**\n * The id of the form control.\n */\n\n readonly id: Signal<string>;\n /**\n * Whether the form control is disabled by a parent.\n */\n readonly disabled?: Signal<boolean>;\n}\n\nexport function ngpFormControl({\n id,\n disabled = signal(false),\n}: NgpFormControlProps): Signal<NgpControlStatus> {\n const elementRef = injectElementRef();\n // Access the form field that the form control is associated with.\n const formField = injectFormFieldState({ optional: true });\n // Access the form control status.\n const status = controlStatus();\n // Determine the aria-labelledby attribute value.\n const ariaLabelledBy = computed(() => {\n const labels = formField()?.labels() ?? [];\n return labels.length > 0 ? labels.join(' ') : null;\n });\n // Determine the aria-describedby attribute value.\n const ariaDescribedBy = computed(() => {\n const descriptions = formField()?.descriptions() ?? [];\n return descriptions.length > 0 ? descriptions.join(' ') : null;\n });\n\n const supportsDisabledAttribute = 'disabled' in elementRef.nativeElement;\n\n // Host bindings\n attrBinding(elementRef, 'disabled', () => (supportsDisabledAttribute && disabled() ? '' : null));\n\n explicitEffect([id], ([id], onCleanup) => {\n formField()?.setFormControl(id);\n onCleanup(() => formField()?.removeFormControl());\n });\n\n attrBinding(elementRef, 'id', id);\n attrBinding(elementRef, 'aria-labelledby', ariaLabelledBy);\n attrBinding(elementRef, 'aria-describedby', ariaDescribedBy);\n dataBinding(elementRef, 'data-invalid', () => status().invalid);\n dataBinding(elementRef, 'data-valid', () => status().valid);\n dataBinding(elementRef, 'data-touched', () => status().touched);\n dataBinding(elementRef, 'data-pristine', () => status().pristine);\n dataBinding(elementRef, 'data-dirty', () => status().dirty);\n dataBinding(elementRef, 'data-pending', () => status().pending);\n dataBinding(elementRef, 'data-disabled', () => disabled() || status().disabled);\n\n return computed(() => ({ ...status(), disabled: status().disabled || disabled() }));\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpFormControl } from './form-control-state';\n\n/**\n * Typically this primitive would be not be used directly, but instead a more specific form control primitive would be used (e.g. `ngpInput`). All of our form control primitives use `ngpFormControl` internally so they will have the same accessibility features as described below.\n *\n * The `NgpFormControl` directive is used to mark a form control element within a form field. This element will have an `aria-labelledby` attribute set to the ID of the label element within the form field and an `aria-describedby` attribute set to the ID of the description elements within the form field.\n */\n@Directive({\n selector: '[ngpFormControl]',\n exportAs: 'ngpFormControl',\n})\nexport class NgpFormControl {\n /**\n * The id of the form control. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-form-control'));\n\n /**\n * Whether the form control is disabled by a parent.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFormControlDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The status of the form control.\n */\n readonly status = ngpFormControl({ id: this.id, disabled: this.disabled });\n}\n","import { Directive, contentChild } from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { ngpFormField, provideFormFieldState } from './form-field-state';\n\n/**\n * The `NgpFormField` directive is a container for form field elements. Any labels, form controls, or descriptions should be placed within this directive.\n */\n@Directive({\n selector: '[ngpFormField]',\n exportAs: 'ngpFormField',\n providers: [provideFormFieldState()],\n})\nexport class NgpFormField {\n /**\n * Find any NgControl within the form field.\n * @internal\n */\n private readonly ngControl = contentChild(NgControl);\n\n /**\n * The form field state.\n */\n constructor() {\n ngpFormField({ ngControl: this.ngControl });\n }\n}\n","import { Signal, computed } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n attrBinding,\n createPrimitive,\n dataBinding,\n listener,\n onDestroy,\n} from 'ng-primitives/state';\nimport { onChange } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-state';\n\n/**\n * The state interface for the Label primitive.\n */\nexport interface NgpLabelState {\n /**\n * The id of the label.\n */\n readonly id: Signal<string>;\n /**\n * The htmlFor attribute value.\n */\n readonly htmlFor: Signal<string | null>;\n}\n\n/**\n * The props interface for the Label primitive.\n */\nexport interface NgpLabelProps {\n /**\n * The id of the label.\n */\n readonly id: Signal<string>;\n}\n\nexport const [NgpLabelStateToken, ngpLabel, injectLabelState, provideLabelState] = createPrimitive(\n 'NgpLabel',\n ({ id }: NgpLabelProps) => {\n const element = injectElementRef();\n const formField = injectFormFieldState({ optional: true });\n\n // Derive the for attribute value if the label is an HTML label element\n const htmlFor = computed(() => formField()?.formControl() ?? null);\n\n // Determine if the label is an HTML label element\n const isLabel = element.nativeElement instanceof HTMLLabelElement;\n\n // Host bindings\n attrBinding(element, 'id', id);\n attrBinding(element, 'for', htmlFor);\n dataBinding(element, 'data-invalid', () => (formField()?.invalid() ? '' : null));\n dataBinding(element, 'data-valid', () => (formField()?.valid() ? '' : null));\n dataBinding(element, 'data-touched', () => (formField()?.touched() ? '' : null));\n dataBinding(element, 'data-pristine', () => (formField()?.pristine() ? '' : null));\n dataBinding(element, 'data-dirty', () => (formField()?.dirty() ? '' : null));\n dataBinding(element, 'data-pending', () => (formField()?.pending() ? '' : null));\n dataBinding(element, 'data-disabled', () => (formField()?.disabled() ? '' : null));\n\n function onClick(event: MouseEvent): void {\n // by default a label will perform a click on the associated form control, however\n // this only works if the associated form control is an input element which may not always\n // be the case, so we prevent the default behavior and handle the click event ourselves.\n // This was inspired by the HeadlessUI approach:\n // https://github.com/tailwindlabs/headlessui/blob/main/packages/%40headlessui-react/src/components/label/label.tsx#L58\n if (isLabel) {\n event.preventDefault();\n }\n\n // to find the associated form control we can lookup via the known id\n const targetId = htmlFor();\n\n if (!targetId) {\n return;\n }\n\n const target = document.getElementById(targetId);\n\n if (!target) {\n return;\n }\n\n // if the target is disabled then do nothing\n const disabled = target.getAttribute('disabled');\n const ariaDisabled = target.getAttribute('aria-disabled');\n\n if (disabled === '' || disabled === 'true' || ariaDisabled === 'true') {\n return;\n }\n\n // radio buttons, checkboxes and switches should all be clicked immediately as they require state changes\n if (\n (target instanceof HTMLInputElement &&\n (target.type === 'radio' || target.type === 'checkbox')) ||\n target.role === 'radio' ||\n target.role === 'checkbox' ||\n target.role === 'switch'\n ) {\n target.click();\n }\n\n // Move focus to the element, this allows you to start using keyboard shortcuts since the\n // bound element is now focused.\n target.focus({ preventScroll: true });\n }\n\n // Event listeners\n listener(element, 'click', onClick);\n\n // Register with form field and cleanup on destroy\n formField()?.addLabel(id());\n onDestroy(() => formField()?.removeLabel(id()));\n\n // any time the id changes we need to update the registration with the form field\n onChange(id, (newId, oldId) => {\n if (oldId) {\n formField()?.removeLabel(oldId);\n }\n formField()?.addLabel(newId);\n });\n\n return {\n id,\n htmlFor,\n } satisfies NgpLabelState;\n },\n);\n","import { Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpLabel, provideLabelState } from './label-state';\n\n/**\n * The `NgpLabel` directive is used to mark a label element within a form field. Preferably, there should use an HTML `<label>` element.\n */\n@Directive({\n selector: '[ngpLabel]',\n exportAs: 'ngpLabel',\n providers: [provideLabelState()],\n})\nexport class NgpLabel {\n /**\n * The id of the label. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-label'));\n\n /**\n * The label state.\n */\n constructor() {\n ngpLabel({ id: this.id });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MA2Fa,CAAC,sBAAsB,EAAE,YAAY,EAAE,oBAAoB,EAAE,qBAAqB,CAAC,GAC9F,eAAe,CAAC,cAAc,EAAE,CAAC,EAAE,SAAS,EAAqB,KAAI;AACnE,IAAA,MAAM,OAAO,GAAG,gBAAgB,EAAE;AAClC,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;;AAGjC,IAAA,MAAM,MAAM,GAAG,MAAM,CAAW,EAAE,kDAAC;;A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AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-input.mjs","sources":["../../../../packages/ng-primitives/input/src/input/input-state.ts","../../../../packages/ng-primitives/input/src/input/input.ts","../../../../packages/ng-primitives/input/src/ng-primitives-input.ts"],"sourcesContent":["import { computed, Signal, signal, WritableSignal } from '@angular/core';\nimport { ngpAutofill } from 'ng-primitives/autofill';\nimport { ngpFormControl } from 'ng-primitives/form-field';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { injectSearchState } from 'ng-primitives/search';\nimport { attrBinding, controlled, createPrimitive, deprecatedSetter } from 'ng-primitives/state';\nimport { uniqueId } from 'ng-primitives/utils';\n\n/**\n * Public state surface for the Input primitive.\n */\nexport interface NgpInputState {\n /**\n * The id of the input.\n */\n readonly id: Signal<string>;\n /**\n * Whether the input is disabled.\n */\n readonly disabled: WritableSignal<boolean>;\n\n /**\n * Set the disabled state of the input.\n * @param value The disabled state.\n */\n setDisabled(value: boolean): void;\n}\n\n/**\n * Inputs for configuring the Input primitive.\n */\nexport interface NgpInputProps {\n /**\n * The id of the input.\n */\n readonly id?: Signal<string>;\n /**\n * Whether the input is disabled.\n */\n readonly disabled?: Signal<boolean>;\n}\n\nexport const [NgpInputStateToken, ngpInput, injectInputState, provideInputState] = createPrimitive(\n 'NgpInput',\n ({ id = signal(uniqueId('ngp-input')), disabled: _disabled = signal(false) }: NgpInputProps) => {\n const element = injectElementRef<HTMLInputElement>();\n const searchState = injectSearchState({ optional: true });\n const disabled = controlled(_disabled);\n\n // Setup autofill detection\n ngpAutofill({});\n\n // Setup interactions and form control bindings\n const status = ngpFormControl({ id, disabled });\n const isDisabled = computed(() => status().disabled ?? disabled());\n\n ngpInteractions({ hover: true, press: true, focus: true, disabled: isDisabled });\n\n // Host bindings\n attrBinding(element, 'id', id);\n attrBinding(element, 'disabled', () => (isDisabled() ? '' : null));\n\n // Register the input with an enclosing search field if present\n const search = searchState();\n\n if (search) {\n search.registerInput(element.nativeElement);\n }\n\n function setDisabled(value: boolean): void {\n disabled.set(value);\n }\n\n return {\n id,\n disabled: deprecatedSetter(disabled, 'setDisabled'),\n status,\n setDisabled,\n };\n },\n);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpInput, provideInputState } from './input-state';\n\n@Directive({\n selector: 'input[ngpInput]',\n exportAs: 'ngpInput',\n providers: [provideInputState({ inherit: false })],\n})\nexport class NgpInput {\n /**\n * The id of the input.\n */\n readonly id = input(uniqueId('ngp-input'));\n\n /**\n * Whether the element is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute,\n });\n\n /**\n * The input state.\n */\n protected readonly state = ngpInput({\n id: this.id,\n disabled: this.disabled,\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AA2CO,MAAM,CAAC,kBAAkB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,GAAG,eAAe,CAChG,UAAU,EACV,CAAC,EAAE,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,QAAQ,EAAE,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,EAAiB,KAAI;AAC7F,IAAA,MAAM,OAAO,GAAG,gBAAgB,EAAoB;IACpD,MAAM,WAAW,GAAG,iBAAiB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACzD,IAAA,MAAM,QAAQ,GAAG,UAAU,CAAC,SAAS,CAAC;;IAGtC,WAAW,CAAC,EAAE,CAAC;;IAGf,MAAM,MAAM,GAAG,cAAc,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC;AAC/C,IAAA,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,MAAM,EAAE,CAAC,QAAQ,IAAI,QAAQ,EAAE,sD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AR,QAAQ,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,EAAA,EAAA,EAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,SAAA,EAFR,CAAC,iBAAiB,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAEvC,QAAQ,EAAA,UAAA,EAAA,CAAA;kBALpB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,QAAQ,EAAE,UAAU;oBACpB,SAAS,EAAE,CAAC,iBAAiB,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;AACnD,iBAAA;;;ACTD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-input.mjs","sources":["../../../../packages/ng-primitives/input/src/input/input-state.ts","../../../../packages/ng-primitives/input/src/input/input.ts","../../../../packages/ng-primitives/input/src/ng-primitives-input.ts"],"sourcesContent":["import { computed, Signal, signal, WritableSignal } from '@angular/core';\nimport { ngpAutofill } from 'ng-primitives/autofill';\nimport { ngpFormControl } from 'ng-primitives/form-field';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { injectSearchState } from 'ng-primitives/search';\nimport { attrBinding, controlled, createPrimitive, deprecatedSetter } from 'ng-primitives/state';\nimport { NgpControlStatus, uniqueId } from 'ng-primitives/utils';\n\n/**\n * Public state surface for the Input primitive.\n */\nexport interface NgpInputState {\n /**\n * The id of the input.\n */\n readonly id: Signal<string>;\n\n /**\n * The form control state.\n */\n readonly status: Signal<NgpControlStatus>;\n\n /**\n * Whether the input is disabled.\n */\n readonly disabled: WritableSignal<boolean>;\n\n /**\n * Set the disabled state of the input.\n * @param value The disabled state.\n */\n setDisabled(value: boolean): void;\n}\n\n/**\n * Inputs for configuring the Input primitive.\n */\nexport interface NgpInputProps {\n /**\n * The id of the input.\n */\n readonly id?: Signal<string>;\n /**\n * Whether the input is disabled.\n */\n readonly disabled?: Signal<boolean>;\n}\n\nexport const [NgpInputStateToken, ngpInput, injectInputState, provideInputState] = createPrimitive(\n 'NgpInput',\n ({ id = signal(uniqueId('ngp-input')), disabled: _disabled = signal(false) }: NgpInputProps) => {\n const element = injectElementRef<HTMLInputElement>();\n const searchState = injectSearchState({ optional: true });\n const disabled = controlled(_disabled);\n\n // Setup autofill detection\n ngpAutofill({});\n\n // Setup interactions and form control bindings\n const status = ngpFormControl({ id, disabled });\n const isDisabled = computed(() => status().disabled ?? disabled());\n\n ngpInteractions({ hover: true, press: true, focus: true, disabled: isDisabled });\n\n // Host bindings\n attrBinding(element, 'id', id);\n attrBinding(element, 'disabled', () => (isDisabled() ? '' : null));\n\n // Register the input with an enclosing search field if present\n const search = searchState();\n\n if (search) {\n search.registerInput(element.nativeElement);\n }\n\n function setDisabled(value: boolean): void {\n disabled.set(value);\n }\n\n return {\n id,\n disabled: deprecatedSetter(disabled, 'setDisabled'),\n status,\n setDisabled,\n } satisfies NgpInputState;\n },\n);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpInput, provideInputState } from './input-state';\n\n@Directive({\n selector: 'input[ngpInput]',\n exportAs: 'ngpInput',\n providers: [provideInputState({ inherit: false })],\n})\nexport class NgpInput {\n /**\n * The id of the input.\n */\n readonly id = input(uniqueId('ngp-input'));\n\n /**\n * Whether the element is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute,\n });\n\n /**\n * The input state.\n */\n protected readonly state = ngpInput({\n id: this.id,\n disabled: this.disabled,\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAiDO,MAAM,CAAC,kBAAkB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,GAAG,eAAe,CAChG,UAAU,EACV,CAAC,EAAE,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,QAAQ,EAAE,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,EAAiB,KAAI;AAC7F,IAAA,MAAM,OAAO,GAAG,gBAAgB,EAAoB;IACpD,MAAM,WAAW,GAAG,iBAAiB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACzD,IAAA,MAAM,QAAQ,GAAG,UAAU,CAAC,SAAS,CAAC;;IAGtC,WAAW,CAAC,EAAE,CAAC;;IAGf,MAAM,MAAM,GAAG,cAAc,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC;AAC/C,IAAA,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,MAAM,EAAE,CAAC,QAAQ,IAAI,QAAQ,EAAE,sDAAC;AAElE,IAAA,eAAe,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;;AAGhF,IAAA,WAAW,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;IAC9B,WAAW,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,UAAU,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;;AAGlE,IAAA,MAAM,MAAM,GAAG,WAAW,EAAE;IAE5B,IAAI,MAAM,EAAE;AACV,QAAA,M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