ng-primitives 0.111.0 → 0.112.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ng-primitives-number-field.mjs +660 -0
- package/fesm2022/ng-primitives-number-field.mjs.map +1 -0
- package/fesm2022/ng-primitives-portal.mjs +44 -2
- package/fesm2022/ng-primitives-portal.mjs.map +1 -1
- package/number-field/README.md +3 -0
- package/number-field/index.d.ts +329 -0
- package/package.json +5 -1
- package/portal/index.d.ts +17 -0
- package/schematics/ng-generate/templates/number-field/number-field.__fileSuffix@dasherize__.ts.template +109 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-primitives-number-field.mjs","sources":["../../../../packages/ng-primitives/number-field/src/number-field/number-field-state.ts","../../../../packages/ng-primitives/number-field/src/number-field/number-field.ts","../../../../packages/ng-primitives/number-field/src/number-field-input/number-field-input-state.ts","../../../../packages/ng-primitives/number-field/src/number-field-input/number-field-input.ts","../../../../packages/ng-primitives/number-field/src/number-field-increment/number-field-increment-state.ts","../../../../packages/ng-primitives/number-field/src/number-field-increment/number-field-increment.ts","../../../../packages/ng-primitives/number-field/src/number-field-decrement/number-field-decrement-state.ts","../../../../packages/ng-primitives/number-field/src/number-field-decrement/number-field-decrement.ts","../../../../packages/ng-primitives/number-field/src/ng-primitives-number-field.ts"],"sourcesContent":["import { computed, Signal, signal, WritableSignal } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n attrBinding,\n controlled,\n createPrimitive,\n dataBinding,\n deprecatedSetter,\n emitter,\n} from 'ng-primitives/state';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { Observable } from 'rxjs';\n\n/**\n * Public state surface for the NumberField primitive.\n */\nexport interface NgpNumberFieldState {\n /**\n * The id of the number field.\n */\n readonly id: Signal<string>;\n /**\n * The current value.\n */\n readonly value: WritableSignal<number | null>;\n /**\n * The minimum value.\n */\n readonly min: Signal<number>;\n /**\n * The maximum value.\n */\n readonly max: Signal<number>;\n /**\n * The step value.\n */\n readonly step: Signal<number>;\n /**\n * The large step value (used with Shift key).\n */\n readonly largeStep: Signal<number>;\n /**\n * Whether the number field is disabled (includes form control state).\n */\n readonly disabled: WritableSignal<boolean>;\n /**\n * Whether the number field is readonly.\n */\n readonly readonly: WritableSignal<boolean>;\n /**\n * Whether the increment button should be disabled.\n */\n readonly canIncrement: Signal<boolean>;\n /**\n * Whether the decrement button should be disabled.\n */\n readonly canDecrement: Signal<boolean>;\n /**\n * Emit when the value changes.\n */\n readonly valueChange: Observable<number | null>;\n /**\n * Set the current value (clamped and stepped).\n */\n setValue(value: number | null): void;\n /**\n * Increment the value by one step.\n */\n increment(multiplier?: number): void;\n /**\n * Decrement the value by one step.\n */\n decrement(multiplier?: number): void;\n /**\n * Set the disabled state.\n */\n setDisabled(disabled: boolean): void;\n /**\n * Set the readonly state.\n */\n setReadonly(readonly: boolean): void;\n /** @internal */\n registerInputCommit(commitFn: () => void): void;\n}\n\n/**\n * Inputs for configuring the NumberField primitive.\n */\nexport interface NgpNumberFieldProps {\n /**\n * The id of the number field.\n */\n readonly id?: Signal<string>;\n /**\n * The current value.\n */\n readonly value?: Signal<number | null>;\n /**\n * The minimum value.\n */\n readonly min?: Signal<number>;\n /**\n * The maximum value.\n */\n readonly max?: Signal<number>;\n /**\n * The step value.\n */\n readonly step?: Signal<number>;\n /**\n * The large step value (used with Shift key).\n */\n readonly largeStep?: Signal<number>;\n /**\n * Whether the number field is disabled.\n */\n readonly disabled?: Signal<boolean>;\n /**\n * Whether the number field is readonly.\n */\n readonly readonly?: Signal<boolean>;\n /**\n * Callback fired when the value changes.\n */\n readonly onValueChange?: (value: number | null) => void;\n}\n\nexport const [\n NgpNumberFieldStateToken,\n ngpNumberField,\n injectNumberFieldState,\n provideNumberFieldState,\n] = createPrimitive(\n 'NgpNumberField',\n ({\n id = signal(uniqueId('ngp-number-field')),\n value: _value = signal<number | null>(null),\n min = signal(-Infinity),\n max = signal(Infinity),\n step = signal(1),\n largeStep: _largeStep = signal(10),\n disabled: _disabled = signal(false),\n readonly: _readonly = signal(false),\n onValueChange,\n }: NgpNumberFieldProps): NgpNumberFieldState => {\n const element = injectElementRef();\n const value = controlled(_value);\n const disabled = controlled(_disabled);\n const readonly = controlled(_readonly);\n\n const valueChange = emitter<number | null>();\n\n const canIncrement = computed(() => {\n if (disabled() || readonly()) return false;\n if (value() === null) return true;\n return value()! < max();\n });\n\n const canDecrement = computed(() => {\n if (disabled() || readonly()) return false;\n if (value() === null) return true;\n return value()! > min();\n });\n\n // Host bindings\n attrBinding(element, 'role', () => 'group');\n dataBinding(element, 'data-disabled', disabled);\n dataBinding(element, 'data-readonly', readonly);\n\n /**\n * Count the number of decimal places in a number.\n */\n function getDecimalPlaces(n: number): number {\n const str = String(n);\n const dotIndex = str.indexOf('.');\n return dotIndex === -1 ? 0 : str.length - dotIndex - 1;\n }\n\n /**\n * Round a number to a specific number of decimal places to avoid\n * floating point precision issues (e.g. 0.1 + 0.2 = 0.30000000000000004).\n */\n function roundToPrecision(val: number, precision: number): number {\n if (precision === 0) return Math.round(val);\n return parseFloat(val.toFixed(precision));\n }\n\n function clampAndStep(val: number): number {\n const clamped = Math.min(max(), Math.max(min(), val));\n // Round to nearest step\n if (isFinite(step()) && step() > 0) {\n const base = isFinite(min()) ? min() : 0;\n const precision = Math.max(getDecimalPlaces(step()), getDecimalPlaces(base));\n const stepped = roundToPrecision(\n Math.round((clamped - base) / step()) * step() + base,\n precision,\n );\n return Math.min(max(), Math.max(min(), stepped));\n }\n return clamped;\n }\n\n let suppressEmit = false;\n\n function setValue(newValue: number | null): void {\n if (disabled() || readonly()) return;\n if (newValue !== null && isNaN(newValue)) return;\n const finalValue = newValue !== null ? clampAndStep(newValue) : null;\n // Skip emit when value is unchanged\n if (finalValue === value()) return;\n value.set(finalValue);\n if (!suppressEmit) {\n onValueChange?.(finalValue);\n valueChange.emit(finalValue);\n }\n }\n\n let inputCommitFn: (() => void) | null = null;\n\n function registerInputCommit(commitFn: () => void): void {\n inputCommitFn = commitFn;\n }\n\n /**\n * Commit any pending input value without emitting change events.\n * This ensures increment/decrement operates on the displayed value\n * while only emitting the final stepped result.\n */\n function commitPendingInputSilently(): void {\n if (!inputCommitFn) return;\n suppressEmit = true;\n try {\n inputCommitFn();\n } finally {\n suppressEmit = false;\n }\n }\n\n function getStepPrecision(): number {\n const base = isFinite(min()) ? min() : 0;\n return Math.max(getDecimalPlaces(step()), getDecimalPlaces(base));\n }\n\n function increment(multiplier: number = 1): void {\n if (!canIncrement()) return;\n const valueBefore = value();\n commitPendingInputSilently();\n const valueAfterCommit = value();\n const current = valueAfterCommit ?? (isFinite(min()) ? min() : 0);\n const precision = getStepPrecision();\n setValue(roundToPrecision(current + step() * multiplier, precision));\n // If the silent commit changed the value but setValue was a no-op\n // (stepped result clamped back to the committed value), emit the change\n // so the parent learns about the new value.\n if (valueBefore !== value() && valueAfterCommit === value()) {\n onValueChange?.(value());\n valueChange.emit(value());\n }\n }\n\n function decrement(multiplier: number = 1): void {\n if (!canDecrement()) return;\n const valueBefore = value();\n commitPendingInputSilently();\n const valueAfterCommit = value();\n const current = valueAfterCommit ?? (isFinite(max()) ? max() : 0);\n const precision = getStepPrecision();\n setValue(roundToPrecision(current - step() * multiplier, precision));\n // If the silent commit changed the value but setValue was a no-op\n // (stepped result clamped back to the committed value), emit the change\n // so the parent learns about the new value.\n if (valueBefore !== value() && valueAfterCommit === value()) {\n onValueChange?.(value());\n valueChange.emit(value());\n }\n }\n\n function setDisabled(isDisabled: boolean): void {\n disabled.set(isDisabled);\n }\n\n function setReadonly(isReadonly: boolean): void {\n readonly.set(isReadonly);\n }\n\n return {\n id,\n value,\n min,\n max,\n step,\n largeStep: _largeStep,\n disabled: deprecatedSetter(disabled, 'setDisabled'),\n readonly: deprecatedSetter(readonly, 'setReadonly'),\n canIncrement,\n canDecrement,\n valueChange: valueChange.asObservable(),\n setValue,\n increment,\n decrement,\n setDisabled,\n setReadonly,\n registerInputCommit,\n } satisfies NgpNumberFieldState;\n },\n);\n","import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input, numberAttribute, output } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpNumberField, provideNumberFieldState } from './number-field-state';\n\n/**\n * Apply the `ngpNumberField` directive to an element that represents the number field\n * and contains the input, increment, and decrement buttons.\n */\n@Directive({\n selector: '[ngpNumberField]',\n exportAs: 'ngpNumberField',\n providers: [provideNumberFieldState()],\n})\nexport class NgpNumberField {\n /**\n * The id of the number field. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-number-field'));\n\n /**\n * The value of the number field.\n */\n readonly value = input<number | null, NumberInput>(null, {\n alias: 'ngpNumberFieldValue',\n transform: (v: NumberInput) =>\n v === null || v === undefined || v === '' ? null : numberAttribute(v),\n });\n\n /**\n * Emits when the value changes.\n */\n readonly valueChange = output<number | null>({\n alias: 'ngpNumberFieldValueChange',\n });\n\n /**\n * The minimum value.\n */\n readonly min = input<number, NumberInput>(-Infinity, {\n alias: 'ngpNumberFieldMin',\n transform: numberAttribute,\n });\n\n /**\n * The maximum value.\n */\n readonly max = input<number, NumberInput>(Infinity, {\n alias: 'ngpNumberFieldMax',\n transform: numberAttribute,\n });\n\n /**\n * The step value.\n */\n readonly step = input<number, NumberInput>(1, {\n alias: 'ngpNumberFieldStep',\n transform: numberAttribute,\n });\n\n /**\n * The large step value (used with Shift key).\n */\n readonly largeStep = input<number, NumberInput>(10, {\n alias: 'ngpNumberFieldLargeStep',\n transform: numberAttribute,\n });\n\n /**\n * The disabled state of the number field.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpNumberFieldDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The readonly state of the number field.\n */\n readonly readonly = input<boolean, BooleanInput>(false, {\n alias: 'ngpNumberFieldReadonly',\n transform: booleanAttribute,\n });\n\n /**\n * @internal\n */\n protected readonly state = ngpNumberField({\n id: this.id,\n value: this.value,\n min: this.min,\n max: this.max,\n step: this.step,\n largeStep: this.largeStep,\n disabled: this.disabled,\n readonly: this.readonly,\n onValueChange: value => this.valueChange.emit(value),\n });\n\n /**\n * Set the value of the number field.\n */\n setValue(value: number | null): void {\n this.state.setValue(value);\n }\n\n /**\n * Increment the value.\n */\n increment(multiplier?: number): void {\n this.state.increment(multiplier);\n }\n\n /**\n * Decrement the value.\n */\n decrement(multiplier?: number): void {\n this.state.decrement(multiplier);\n }\n\n /**\n * Set the disabled state.\n */\n setDisabled(disabled: boolean): void {\n this.state.setDisabled(disabled);\n }\n\n /**\n * Set the readonly state.\n */\n setReadonly(readonly: boolean): void {\n this.state.setReadonly(readonly);\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { computed, inject, Signal, signal } from '@angular/core';\nimport { ngpFormControl } from 'ng-primitives/form-field';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { explicitEffect, injectElementRef } from 'ng-primitives/internal';\nimport { attrBinding, createPrimitive, dataBinding, listener } from 'ng-primitives/state';\nimport { injectNumberFieldState } from '../number-field/number-field-state';\n\n/**\n * Public state surface for the NumberField Input primitive.\n */\nexport interface NgpNumberFieldInputState {\n /**\n * Focus the input element.\n */\n focus(): void;\n}\n\n/**\n * Inputs for configuring the NumberField Input primitive.\n */\nexport interface NgpNumberFieldInputProps {\n /**\n * Whether mouse wheel changes the value.\n */\n readonly allowWheelScrub?: Signal<boolean>;\n}\n\nexport const [\n NgpNumberFieldInputStateToken,\n ngpNumberFieldInput,\n injectNumberFieldInputState,\n provideNumberFieldInputState,\n] = createPrimitive(\n 'NgpNumberFieldInput',\n ({ allowWheelScrub = signal(false) }: NgpNumberFieldInputProps): NgpNumberFieldInputState => {\n const elementRef = injectElementRef<HTMLInputElement>();\n const numberField = injectNumberFieldState();\n const document = inject(DOCUMENT);\n\n // Form control integration — sets id, aria-labelledby, aria-describedby on the input\n ngpFormControl({ id: numberField().id, disabled: numberField().disabled });\n\n const tabindex = computed(() => (numberField().disabled() ? -1 : 0));\n\n // Host bindings\n const inputMode = computed(() => {\n const minVal = numberField().min();\n const stepVal = numberField().step();\n const allowsNegative = !isFinite(minVal) || minVal < 0;\n const hasDecimals = stepVal % 1 !== 0;\n\n // Some mobile keyboards can't show both minus sign and decimal point\n if (allowsNegative && hasDecimals) return 'text';\n if (hasDecimals) return 'decimal';\n if (!allowsNegative) return 'numeric';\n return 'text';\n });\n\n attrBinding(elementRef, 'role', 'spinbutton');\n attrBinding(elementRef, 'type', 'text');\n attrBinding(elementRef, 'inputmode', inputMode);\n attrBinding(elementRef, 'autocomplete', 'off');\n attrBinding(elementRef, 'autocorrect', 'off');\n attrBinding(elementRef, 'spellcheck', 'false');\n attrBinding(elementRef, 'aria-valuemin', () => {\n const min = numberField().min();\n return isFinite(min) ? min.toString() : null;\n });\n attrBinding(elementRef, 'aria-valuemax', () => {\n const max = numberField().max();\n return isFinite(max) ? max.toString() : null;\n });\n attrBinding(elementRef, 'aria-valuenow', () => numberField().value()?.toString() ?? null);\n attrBinding(elementRef, 'tabindex', () => tabindex().toString());\n attrBinding(elementRef, 'readonly', () => (numberField().readonly() ? '' : null));\n dataBinding(elementRef, 'data-readonly', () => numberField().readonly());\n\n ngpInteractions({\n hover: true,\n focusVisible: true,\n disabled: numberField().disabled,\n });\n\n let isFocused = false;\n\n /**\n * Parse text and set the number field value accordingly.\n */\n function parseAndSetValue(text: string): void {\n const trimmed = text.trim();\n if (trimmed === '' || trimmed === '-') {\n numberField().setValue(null);\n } else {\n const parsed = parseFloat(trimmed);\n if (!isNaN(parsed)) {\n numberField().setValue(parsed);\n }\n }\n }\n\n /**\n * Commit the current input text to the number field value.\n * Called before increment/decrement so they operate on the displayed value.\n */\n function commitInputValue(): void {\n if (!isFocused) return;\n parseAndSetValue(elementRef.nativeElement.value);\n }\n\n // Register the commit function with the number field so buttons can trigger it\n numberField().registerInputCommit(commitInputValue);\n\n function formatDisplayValue(): string {\n const val = numberField().value();\n return val !== null ? String(val) : '';\n }\n\n // Sync input display value when the number field value changes\n // (programmatically, via stepping, or on commit)\n explicitEffect([() => numberField().value()], ([value]) => {\n elementRef.nativeElement.value = value !== null ? String(value) : '';\n });\n\n listener(elementRef, 'focus', () => {\n isFocused = true;\n });\n\n listener(elementRef, 'blur', () => {\n isFocused = false;\n parseAndSetValue(elementRef.nativeElement.value);\n\n // Always sync the display value on blur to show the clamped/stepped value\n elementRef.nativeElement.value = formatDisplayValue();\n });\n\n // Reject characters that can't form a valid number\n listener(elementRef, 'beforeinput', (event: InputEvent) => {\n if (numberField().disabled() || numberField().readonly()) return;\n\n // Only filter insertions (typing, paste, drop)\n const insertTypes = ['insertText', 'insertFromPaste', 'insertFromDrop'];\n if (!insertTypes.includes(event.inputType) || !event.data) return;\n\n const input = elementRef.nativeElement;\n const selStart = input.selectionStart ?? 0;\n const selEnd = input.selectionEnd ?? 0;\n const current = input.value;\n const proposed = current.slice(0, selStart) + event.data + current.slice(selEnd);\n\n const minVal = numberField().min();\n const allowsNegative = !isFinite(minVal) || minVal < 0;\n\n // Build a regex for valid partial number input\n const pattern = allowsNegative ? /^-?(\\d+\\.?\\d*|\\.\\d*)?$/ : /^(\\d+\\.?\\d*|\\.\\d*)?$/;\n\n if (!pattern.test(proposed)) {\n event.preventDefault();\n }\n });\n\n // Keyboard interactions\n listener(elementRef, 'keydown', (event: KeyboardEvent) => {\n if (numberField().disabled() || numberField().readonly()) return;\n\n const useLargeStep = event.shiftKey;\n\n function getLargeStepMultiplier(): number {\n const s = numberField().step();\n if (!isFinite(s) || s <= 0) return 1;\n return numberField().largeStep() / s;\n }\n\n switch (event.key) {\n case 'ArrowUp':\n event.preventDefault();\n numberField().increment(useLargeStep ? getLargeStepMultiplier() : 1);\n elementRef.nativeElement.value = formatDisplayValue();\n break;\n case 'ArrowDown':\n event.preventDefault();\n numberField().decrement(useLargeStep ? getLargeStepMultiplier() : 1);\n elementRef.nativeElement.value = formatDisplayValue();\n break;\n case 'Home':\n if (isFinite(numberField().min())) {\n event.preventDefault();\n numberField().setValue(numberField().min());\n elementRef.nativeElement.value = formatDisplayValue();\n }\n break;\n case 'End':\n if (isFinite(numberField().max())) {\n event.preventDefault();\n numberField().setValue(numberField().max());\n elementRef.nativeElement.value = formatDisplayValue();\n }\n break;\n case 'Enter':\n parseAndSetValue(elementRef.nativeElement.value);\n elementRef.nativeElement.value = formatDisplayValue();\n break;\n }\n });\n\n // Mouse wheel support\n listener(\n elementRef,\n 'wheel',\n (event: WheelEvent) => {\n if (!allowWheelScrub() || numberField().disabled() || numberField().readonly()) return;\n\n // Don't intercept browser zoom (Ctrl+wheel / Cmd+wheel)\n if (event.ctrlKey || event.metaKey) return;\n\n // Only handle when focused\n if (document.activeElement !== elementRef.nativeElement) return;\n\n event.preventDefault();\n\n if (event.deltaY < 0) {\n numberField().increment();\n } else if (event.deltaY > 0) {\n numberField().decrement();\n }\n\n elementRef.nativeElement.value = formatDisplayValue();\n },\n { config: { passive: false } },\n );\n\n function focus(): void {\n elementRef.nativeElement.focus({ preventScroll: true });\n }\n\n return {\n focus,\n } satisfies NgpNumberFieldInputState;\n },\n);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input } from '@angular/core';\nimport { ngpNumberFieldInput, provideNumberFieldInputState } from './number-field-input-state';\n\n/**\n * Apply the `ngpNumberFieldInput` directive to an input element within a number field.\n */\n@Directive({\n selector: '[ngpNumberFieldInput]',\n exportAs: 'ngpNumberFieldInput',\n providers: [provideNumberFieldInputState()],\n})\nexport class NgpNumberFieldInput {\n /**\n * Whether mouse wheel changes the value when the input is focused.\n */\n readonly allowWheelScrub = input<boolean, BooleanInput>(false, {\n alias: 'ngpNumberFieldInputAllowWheelScrub',\n transform: booleanAttribute,\n });\n\n constructor() {\n ngpNumberFieldInput({\n allowWheelScrub: this.allowWheelScrub,\n });\n }\n}\n","import { computed, inject, Injector } from '@angular/core';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { attrBinding, createPrimitive, dataBinding, listener } from 'ng-primitives/state';\nimport { injectDisposables } from 'ng-primitives/utils';\nimport { injectNumberFieldState } from '../number-field/number-field-state';\n\n/**\n * Public state surface for the NumberField Increment primitive.\n */\nexport interface NgpNumberFieldIncrementState {}\n\n/**\n * Inputs for configuring the NumberField Increment primitive.\n */\nexport interface NgpNumberFieldIncrementProps {}\n\nexport const [\n NgpNumberFieldIncrementStateToken,\n ngpNumberFieldIncrement,\n injectNumberFieldIncrementState,\n provideNumberFieldIncrementState,\n] = createPrimitive(\n 'NgpNumberFieldIncrement',\n ({}: NgpNumberFieldIncrementProps): NgpNumberFieldIncrementState => {\n const elementRef = injectElementRef<HTMLButtonElement>();\n const numberField = injectNumberFieldState();\n const injector = inject(Injector);\n const disposables = injectDisposables();\n\n const isDisabled = computed(() => !numberField().canIncrement());\n\n // Host bindings\n attrBinding(elementRef, 'type', 'button');\n attrBinding(elementRef, 'tabindex', '-1');\n attrBinding(elementRef, 'disabled', () => (isDisabled() ? '' : null));\n dataBinding(elementRef, 'data-disabled', isDisabled);\n\n ngpInteractions({\n hover: true,\n focusVisible: true,\n press: true,\n disabled: isDisabled,\n });\n\n let cleanupRepeat: (() => void) | null = null;\n\n function stopRepeat(): void {\n cleanupRepeat?.();\n cleanupRepeat = null;\n }\n\n listener(elementRef, 'pointerdown', (event: PointerEvent) => {\n event.preventDefault();\n\n if (isDisabled()) return;\n\n numberField().increment();\n\n // Start auto-repeat: 400ms initial delay, then 60ms interval\n stopRepeat();\n\n let intervalCleanup: (() => void) | null = null;\n\n const delayCleanup = disposables.setTimeout(() => {\n intervalCleanup = disposables.setInterval(() => {\n if (!numberField().canIncrement()) {\n stopRepeat();\n return;\n }\n numberField().increment();\n }, 60);\n }, 400);\n\n // Set up document-level listeners to stop on pointer release\n const pointerUpCleanup = listener(document, 'pointerup', stopRepeat, {\n config: false,\n injector,\n });\n\n const pointerCancelCleanup = listener(document, 'pointercancel', stopRepeat, {\n config: false,\n injector,\n });\n\n cleanupRepeat = () => {\n delayCleanup();\n intervalCleanup?.();\n pointerUpCleanup();\n pointerCancelCleanup();\n };\n });\n\n return {} satisfies NgpNumberFieldIncrementState;\n },\n);\n","import { Directive } from '@angular/core';\nimport {\n ngpNumberFieldIncrement,\n provideNumberFieldIncrementState,\n} from './number-field-increment-state';\n\n/**\n * Apply the `ngpNumberFieldIncrement` directive to a button element that increments the number field value.\n */\n@Directive({\n selector: '[ngpNumberFieldIncrement]',\n exportAs: 'ngpNumberFieldIncrement',\n providers: [provideNumberFieldIncrementState()],\n})\nexport class NgpNumberFieldIncrement {\n constructor() {\n ngpNumberFieldIncrement({});\n }\n}\n","import { computed, inject, Injector } from '@angular/core';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { attrBinding, createPrimitive, dataBinding, listener } from 'ng-primitives/state';\nimport { injectDisposables } from 'ng-primitives/utils';\nimport { injectNumberFieldState } from '../number-field/number-field-state';\n\n/**\n * Public state surface for the NumberField Decrement primitive.\n */\nexport interface NgpNumberFieldDecrementState {}\n\n/**\n * Inputs for configuring the NumberField Decrement primitive.\n */\nexport interface NgpNumberFieldDecrementProps {}\n\nexport const [\n NgpNumberFieldDecrementStateToken,\n ngpNumberFieldDecrement,\n injectNumberFieldDecrementState,\n provideNumberFieldDecrementState,\n] = createPrimitive(\n 'NgpNumberFieldDecrement',\n ({}: NgpNumberFieldDecrementProps): NgpNumberFieldDecrementState => {\n const elementRef = injectElementRef<HTMLButtonElement>();\n const numberField = injectNumberFieldState();\n const injector = inject(Injector);\n const disposables = injectDisposables();\n\n const isDisabled = computed(() => !numberField().canDecrement());\n\n // Host bindings\n attrBinding(elementRef, 'type', 'button');\n attrBinding(elementRef, 'tabindex', '-1');\n attrBinding(elementRef, 'disabled', () => (isDisabled() ? '' : null));\n dataBinding(elementRef, 'data-disabled', isDisabled);\n\n ngpInteractions({\n hover: true,\n focusVisible: true,\n press: true,\n disabled: isDisabled,\n });\n\n let cleanupRepeat: (() => void) | null = null;\n\n function stopRepeat(): void {\n cleanupRepeat?.();\n cleanupRepeat = null;\n }\n\n listener(elementRef, 'pointerdown', (event: PointerEvent) => {\n event.preventDefault();\n\n if (isDisabled()) return;\n\n numberField().decrement();\n\n // Start auto-repeat: 400ms initial delay, then 60ms interval\n stopRepeat();\n\n let intervalCleanup: (() => void) | null = null;\n\n const delayCleanup = disposables.setTimeout(() => {\n intervalCleanup = disposables.setInterval(() => {\n if (!numberField().canDecrement()) {\n stopRepeat();\n return;\n }\n numberField().decrement();\n }, 60);\n }, 400);\n\n // Set up document-level listeners to stop on pointer release\n const pointerUpCleanup = listener(document, 'pointerup', stopRepeat, {\n config: false,\n injector,\n });\n\n const pointerCancelCleanup = listener(document, 'pointercancel', stopRepeat, {\n config: false,\n injector,\n });\n\n cleanupRepeat = () => {\n delayCleanup();\n intervalCleanup?.();\n pointerUpCleanup();\n pointerCancelCleanup();\n };\n });\n\n return {} satisfies NgpNumberFieldDecrementState;\n },\n);\n","import { Directive } from '@angular/core';\nimport {\n ngpNumberFieldDecrement,\n provideNumberFieldDecrementState,\n} from './number-field-decrement-state';\n\n/**\n * Apply the `ngpNumberFieldDecrement` directive to a button element that decrements the number field value.\n */\n@Directive({\n selector: '[ngpNumberFieldDecrement]',\n exportAs: 'ngpNumberFieldDecrement',\n providers: [provideNumberFieldDecrementState()],\n})\nexport class NgpNumberFieldDecrement {\n constructor() {\n ngpNumberFieldDecrement({});\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AA+HO,MAAM,CACX,wBAAwB,EACxB,cAAc,EACd,sBAAsB,EACtB,uBAAuB,EACxB,GAAG,eAAe,CACjB,gBAAgB,EAChB,CAAC,EACC,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,EACzC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAgB,IAAI,CAAC,EAC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A,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,uBAAuB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,2BAAA,EAAA,SAAA,EAFvB,CAAC,gCAAgC,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,yBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAEpC,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBALnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,2BAA2B;AACrC,oBAAA,QAAQ,EAAE,yBAAyB;AACnC,oBAAA,SAAS,EAAE,CAAC,gCAAgC,EAAE,CAAC;AAChD,iBAAA;;;ACbD;;AAEG;;;;"}
|
|
@@ -563,6 +563,8 @@ class NgpOverlay {
|
|
|
563
563
|
this.cooldownManager = inject(NgpOverlayCooldownManager);
|
|
564
564
|
/** Access any parent overlays */
|
|
565
565
|
this.parentOverlay = inject(NgpOverlay, { optional: true });
|
|
566
|
+
/** Track child overlays for outside click detection */
|
|
567
|
+
this.childOverlays = new Set();
|
|
566
568
|
/** Signal tracking the portal instance */
|
|
567
569
|
this.portal = signal(null, ...(ngDevMode ? [{ debugName: "portal" }] : []));
|
|
568
570
|
/** Signal tracking the overlay position */
|
|
@@ -638,6 +640,10 @@ class NgpOverlay {
|
|
|
638
640
|
this.hideImmediate();
|
|
639
641
|
}
|
|
640
642
|
});
|
|
643
|
+
// Register with parent overlay for outside click detection
|
|
644
|
+
if (this.parentOverlay) {
|
|
645
|
+
this.parentOverlay.registerChildOverlay(this);
|
|
646
|
+
}
|
|
641
647
|
// if there is a parent overlay and it is closed, close this overlay
|
|
642
648
|
this.parentOverlay?.closing
|
|
643
649
|
// we add a debounce here to ensure any dom events like clicks are processed first
|
|
@@ -664,7 +670,10 @@ class NgpOverlay {
|
|
|
664
670
|
const isInsideAnchor = this.config.anchorElement
|
|
665
671
|
? path.includes(this.config.anchorElement)
|
|
666
672
|
: false;
|
|
667
|
-
if (!isInsideOverlay &&
|
|
673
|
+
if (!isInsideOverlay &&
|
|
674
|
+
!isInsideTrigger &&
|
|
675
|
+
!isInsideAnchor &&
|
|
676
|
+
!this.isInsideChildOverlay(path)) {
|
|
668
677
|
this.hide();
|
|
669
678
|
}
|
|
670
679
|
});
|
|
@@ -679,7 +688,10 @@ class NgpOverlay {
|
|
|
679
688
|
}
|
|
680
689
|
});
|
|
681
690
|
// Ensure cleanup on destroy
|
|
682
|
-
this.destroyRef.onDestroy(() =>
|
|
691
|
+
this.destroyRef.onDestroy(() => {
|
|
692
|
+
this.parentOverlay?.unregisterChildOverlay(this);
|
|
693
|
+
this.destroy();
|
|
694
|
+
});
|
|
683
695
|
}
|
|
684
696
|
/**
|
|
685
697
|
* Show the overlay with the specified delay
|
|
@@ -880,6 +892,36 @@ class NgpOverlay {
|
|
|
880
892
|
getElements() {
|
|
881
893
|
return this.portal()?.getElements() ?? [];
|
|
882
894
|
}
|
|
895
|
+
/**
|
|
896
|
+
* Register a child overlay for outside click detection.
|
|
897
|
+
* @internal
|
|
898
|
+
*/
|
|
899
|
+
registerChildOverlay(child) {
|
|
900
|
+
this.childOverlays.add(child);
|
|
901
|
+
}
|
|
902
|
+
/**
|
|
903
|
+
* Unregister a child overlay.
|
|
904
|
+
* @internal
|
|
905
|
+
*/
|
|
906
|
+
unregisterChildOverlay(child) {
|
|
907
|
+
this.childOverlays.delete(child);
|
|
908
|
+
}
|
|
909
|
+
/**
|
|
910
|
+
* Check if the event path includes any child overlay elements (recursively).
|
|
911
|
+
* @internal
|
|
912
|
+
*/
|
|
913
|
+
isInsideChildOverlay(path) {
|
|
914
|
+
for (const child of this.childOverlays) {
|
|
915
|
+
const childElements = child.getElements();
|
|
916
|
+
if (childElements.some(el => path.includes(el))) {
|
|
917
|
+
return true;
|
|
918
|
+
}
|
|
919
|
+
if (child.isInsideChildOverlay(path)) {
|
|
920
|
+
return true;
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
return false;
|
|
924
|
+
}
|
|
883
925
|
/**
|
|
884
926
|
* Internal method to create the overlay
|
|
885
927
|
* @param skipCooldown If true, skip registering with the cooldown manager
|