@radix-ng/primitives 0.39.4 → 0.40.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.
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, inject, input, computed, signal, effect, Directive, ElementRef, model, booleanAttribute, NgModule } from '@angular/core';
3
- import { useDateField, getDefaultDate, hasTime, isBefore, createContent, watch, isNullish, createFormatter, initializeSegmentValues, syncSegmentValues, getSegmentElements, ARROW_LEFT, ARROW_RIGHT, isSegmentNavigationKey, provideToken } from '@radix-ng/primitives/core';
3
+ import { useDateField, normalizeDateStep, getDefaultDate, hasTime, isBefore, createContent, watch, isNullish, createFormatter, normalizeHourCycle, initializeSegmentValues, syncSegmentValues, getSegmentElements, ARROW_LEFT, ARROW_RIGHT, isSegmentNavigationKey, provideToken } from '@radix-ng/primitives/core';
4
4
 
5
5
  const DATE_FIELDS_ROOT_CONTEXT = new InjectionToken('DATE_FIELDS_ROOT_CONTEXT');
6
6
  function injectDateFieldsRootContext() {
@@ -47,6 +47,7 @@ class RdxDateFieldInputDirective {
47
47
  part: this.part(),
48
48
  disabled: this.rootContext.disabled,
49
49
  readonly: this.rootContext.readonly,
50
+ step: this.rootContext.step$,
50
51
  modelValue: this.rootContext.value,
51
52
  focusNext: this.rootContext.focusNext
52
53
  });
@@ -140,6 +141,11 @@ class RdxDateFieldRootDirective {
140
141
  * Whether or not the field is readonly.
141
142
  */
142
143
  this.readonly = input(false, { transform: booleanAttribute });
144
+ /**
145
+ * The stepping interval for the time fields. Defaults to 1
146
+ */
147
+ this.step = input();
148
+ this.step$ = computed(() => normalizeDateStep(this.step()));
143
149
  /**
144
150
  * @ignore
145
151
  */
@@ -260,7 +266,9 @@ class RdxDateFieldRootDirective {
260
266
  locale: this.locale()
261
267
  });
262
268
  this.placeholder.set(defDate.copy());
263
- this.formatter = createFormatter(this.locale());
269
+ this.formatter = createFormatter(this.locale(), {
270
+ hourCycle: normalizeHourCycle(this.hourCycle())
271
+ });
264
272
  const initialSegments = initializeSegmentValues(this.inferredGranularity());
265
273
  this.segmentValues.set(this.value()
266
274
  ? { ...syncSegmentValues({ value: this.value(), formatter: this.formatter }) }
@@ -292,7 +300,7 @@ class RdxDateFieldRootDirective {
292
300
  this.currentFocusedElement.set(el);
293
301
  }
294
302
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxDateFieldRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
295
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.4", type: RdxDateFieldRootDirective, isStandalone: true, selector: "[rdxDateFieldRoot]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, isDateUnavailable: { classPropertyName: "isDateUnavailable", publicName: "isDateUnavailable", isSignal: true, isRequired: false, transformFunction: null }, hourCycle: { classPropertyName: "hourCycle", publicName: "hourCycle", isSignal: true, isRequired: false, transformFunction: null }, granularity: { classPropertyName: "granularity", publicName: "granularity", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, minValue: { classPropertyName: "minValue", publicName: "minValue", isSignal: true, isRequired: false, transformFunction: null }, maxValue: { classPropertyName: "maxValue", publicName: "maxValue", isSignal: true, isRequired: false, transformFunction: null }, hideTimeZone: { classPropertyName: "hideTimeZone", publicName: "hideTimeZone", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", placeholder: "placeholderChange" }, host: { attributes: { "role": "group" }, listeners: { "keydown": "onKeydown($event)" }, properties: { "attr.aria-disabled": "disabled() ? \"\" : undefined", "attr.data-disabled": "disabled() ? \"\" : undefined", "attr.data-readonly": "readonly() ? \"\" : undefined", "attr.data-invalid": "isInvalid() ? \"\" : undefined", "attr.dir": "dir()" } }, providers: [provideToken(DATE_FIELDS_ROOT_CONTEXT, RdxDateFieldRootDirective)], exportAs: ["rdxDateFieldRoot"], ngImport: i0 }); }
303
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.4", type: RdxDateFieldRootDirective, isStandalone: true, selector: "[rdxDateFieldRoot]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, isDateUnavailable: { classPropertyName: "isDateUnavailable", publicName: "isDateUnavailable", isSignal: true, isRequired: false, transformFunction: null }, hourCycle: { classPropertyName: "hourCycle", publicName: "hourCycle", isSignal: true, isRequired: false, transformFunction: null }, granularity: { classPropertyName: "granularity", publicName: "granularity", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, minValue: { classPropertyName: "minValue", publicName: "minValue", isSignal: true, isRequired: false, transformFunction: null }, maxValue: { classPropertyName: "maxValue", publicName: "maxValue", isSignal: true, isRequired: false, transformFunction: null }, hideTimeZone: { classPropertyName: "hideTimeZone", publicName: "hideTimeZone", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", placeholder: "placeholderChange" }, host: { attributes: { "role": "group" }, listeners: { "keydown": "onKeydown($event)" }, properties: { "attr.aria-disabled": "disabled() ? \"\" : undefined", "attr.data-disabled": "disabled() ? \"\" : undefined", "attr.data-readonly": "readonly() ? \"\" : undefined", "attr.data-invalid": "isInvalid() ? \"\" : undefined", "attr.dir": "dir()" } }, providers: [provideToken(DATE_FIELDS_ROOT_CONTEXT, RdxDateFieldRootDirective)], exportAs: ["rdxDateFieldRoot"], ngImport: i0 }); }
296
304
  }
297
305
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxDateFieldRootDirective, decorators: [{
298
306
  type: Directive,
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-date-field.mjs","sources":["../../../packages/primitives/date-field/src/date-field-context.token.ts","../../../packages/primitives/date-field/src/date-field-input.directive.ts","../../../packages/primitives/date-field/src/date-field-root.directive.ts","../../../packages/primitives/date-field/index.ts","../../../packages/primitives/date-field/radix-ng-primitives-date-field.ts"],"sourcesContent":["import { inject, InjectionToken, InputSignal, ModelSignal, Signal, WritableSignal } from '@angular/core';\nimport { DateValue } from '@internationalized/date';\nimport { Formatter, HourCycle, SegmentValueObj } from '@radix-ng/primitives/core';\n\nexport interface DateFieldContextToken {\n locale: InputSignal<string>;\n value: ModelSignal<DateValue | undefined>;\n disabled: InputSignal<boolean>;\n readonly: InputSignal<boolean>;\n isInvalid: Signal<boolean>;\n placeholder: ModelSignal<DateValue>;\n hourCycle: InputSignal<HourCycle>;\n formatter: Formatter;\n segmentValues: WritableSignal<SegmentValueObj>;\n focusNext: () => void;\n setFocusedElement: (el: HTMLElement) => void;\n}\n\nexport const DATE_FIELDS_ROOT_CONTEXT = new InjectionToken<DateFieldContextToken>('DATE_FIELDS_ROOT_CONTEXT');\n\nexport function injectDateFieldsRootContext(): DateFieldContextToken {\n return inject(DATE_FIELDS_ROOT_CONTEXT);\n}\n","import { computed, Directive, effect, ElementRef, input, signal } from '@angular/core';\nimport { SegmentPart, useDateField } from '@radix-ng/primitives/core';\nimport { injectDateFieldsRootContext } from './date-field-context.token';\n\n@Directive({\n selector: '[rdxDateFieldInput]',\n host: {\n '[attr.contenteditable]': 'disabled() || readonly() ? false : part() !== \"literal\"',\n '[attr.data-rdx-date-field-segment]': 'part()',\n '[attr.aria-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.data-invalid]': 'isInvalid() ? \"\" : undefined',\n '[attr.aria-invalid]': 'isInvalid() ? true : undefined',\n\n '(mousedown)': 'part() !== \"literal\" && handleSegmentClick($event)',\n '(keydown)': 'part() !== \"literal\" && handleSegmentKeydown($event)',\n '(focus)': 'part() !== \"literal\" && onFocus($event)',\n '(focusout)': 'part() !== \"literal\" && onFocusOut()'\n }\n})\nexport class RdxDateFieldInputDirective {\n private readonly rootContext = injectDateFieldsRootContext();\n\n /**\n * The part of the date to render\n * `'day' | 'month' | 'year' | 'hour' | 'minute' | 'second' | 'dayPeriod' | 'literal' | 'timeZoneName'`\n */\n readonly part = input<SegmentPart>();\n\n /**\n * @ignore\n */\n readonly disabled = computed(() => this.rootContext.disabled());\n\n /**\n * @ignore\n */\n readonly readonly = computed(() => this.rootContext.readonly());\n\n /**\n * @ignore\n */\n readonly isInvalid = computed(() => this.rootContext.isInvalid());\n\n /**\n * @ignore\n */\n readonly hasLeftFocus = signal<boolean>(true);\n\n /**\n * @ignore\n */\n readonly lastKeyZero = signal<boolean>(false);\n\n private readonly fieldData = computed(() => {\n return useDateField({\n hasLeftFocus: this.hasLeftFocus,\n lastKeyZero: this.lastKeyZero,\n placeholder: this.rootContext.placeholder,\n hourCycle: this.rootContext.hourCycle(),\n segmentValues: this.rootContext.segmentValues,\n formatter: this.rootContext.formatter,\n part: <SegmentPart>this.part(),\n disabled: this.rootContext.disabled,\n readonly: this.rootContext.readonly,\n modelValue: this.rootContext.value,\n focusNext: this.rootContext.focusNext\n });\n });\n\n private readonly attributes = computed(() => this.fieldData().attributes());\n\n /**\n * @ignore\n */\n handleSegmentClick: (e: MouseEvent) => void;\n\n /**\n * @ignore\n */\n handleSegmentKeydown: (e: KeyboardEvent) => void;\n\n constructor(private el: ElementRef) {\n effect(() => {\n const { handleSegmentClick, handleSegmentKeydown } = this.fieldData();\n this.handleSegmentKeydown = handleSegmentKeydown;\n this.handleSegmentClick = handleSegmentClick;\n });\n\n effect(() => {\n const attrs = this.attributes();\n Object.entries(attrs).forEach(([attr, value]) => {\n this.el.nativeElement.setAttribute(attr, String(value));\n });\n });\n }\n\n /**\n * @ignore\n */\n onFocus(e: FocusEvent) {\n this.rootContext.setFocusedElement(e.target as HTMLElement);\n }\n\n /**\n * @ignore\n */\n onFocusOut() {\n this.hasLeftFocus.set(true);\n }\n}\n","import { Direction } from '@angular/cdk/bidi';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport {\n AfterViewInit,\n booleanAttribute,\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n model,\n OnInit,\n signal\n} from '@angular/core';\nimport { DateValue } from '@internationalized/date';\nimport {\n ARROW_LEFT,\n ARROW_RIGHT,\n createContent,\n createFormatter,\n DateMatcher,\n Formatter,\n getDefaultDate,\n getSegmentElements,\n Granularity,\n hasTime,\n HourCycle,\n initializeSegmentValues,\n isBefore,\n isNullish,\n isSegmentNavigationKey,\n provideToken,\n SegmentValueObj,\n syncSegmentValues,\n watch\n} from '@radix-ng/primitives/core';\nimport { DATE_FIELDS_ROOT_CONTEXT } from './date-field-context.token';\n\n@Directive({\n selector: '[rdxDateFieldRoot]',\n exportAs: 'rdxDateFieldRoot',\n providers: [provideToken(DATE_FIELDS_ROOT_CONTEXT, RdxDateFieldRootDirective)],\n host: {\n role: 'group',\n '[attr.aria-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.data-readonly]': 'readonly() ? \"\" : undefined',\n '[attr.data-invalid]': 'isInvalid() ? \"\" : undefined',\n '[attr.dir]': 'dir()',\n\n '(keydown)': 'onKeydown($event)'\n }\n})\nexport class RdxDateFieldRootDirective implements OnInit, AfterViewInit {\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n\n /**\n * The controlled checked state of the calendar.\n */\n readonly value = model<DateValue | undefined>();\n\n /**\n * A callback fired when the date field's value is invalid.\n */\n readonly isDateUnavailable = input<DateMatcher | undefined>(undefined);\n\n /**\n * The hour cycle to use for formatting times. Defaults to the locale preference\n */\n readonly hourCycle = input<HourCycle>();\n\n /**\n * The granularity to use for formatting the field. Defaults to 'day' if a CalendarDate is provided, otherwise defaults to 'minute'.\n * The field will render segments for each part of the date up to and including the specified granularity.\n */\n readonly granularity = input<Granularity>();\n\n /**\n * The locale to use for formatting dates.\n */\n readonly locale = input<string>('en');\n\n readonly dir = input<Direction>('ltr');\n\n /**\n * The minimum valid date that can be entered.\n */\n readonly minValue = input<DateValue>();\n\n /**\n * The maximum valid date that can be entered.\n */\n readonly maxValue = input<DateValue>();\n\n /**\n * Whether or not to hide the time zone segment of the field.\n */\n readonly hideTimeZone = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether or not the field is readonly.\n */\n readonly readonly = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * @ignore\n */\n readonly defaultDate = computed(() =>\n getDefaultDate({\n defaultPlaceholder: undefined,\n granularity: this.granularity(),\n defaultValue: this.value(),\n locale: this.locale()\n })\n );\n\n /**\n * The placeholder date, which is used to determine what month to display when no date is selected. This updates as the user navigates the calendar and can be used to programmatically control the calendar view\n */\n readonly placeholder = model<DateValue | undefined>(this.defaultDate().copy());\n\n // Internal state\n\n /**\n * @ignore\n */\n readonly segmentElements = signal<Set<HTMLElement>>(new Set());\n\n /**\n * @ignore\n */\n readonly currentFocusedElement = signal<HTMLElement | null>(null);\n\n /**\n * @ignore\n */\n formatter: Formatter;\n\n /**\n * @ignore\n */\n readonly segmentValues = signal<SegmentValueObj>({\n year: null,\n month: null,\n day: null,\n hour: null,\n minute: null,\n second: null,\n dayPeriod: null\n } as SegmentValueObj);\n\n /**\n * @ignore\n */\n readonly inferredGranularity = computed(() => {\n const placeholder = this.placeholder();\n\n if (this.granularity()) return placeholder && !hasTime(placeholder) ? 'day' : this.granularity();\n\n return placeholder && hasTime(placeholder) ? 'minute' : 'day';\n });\n\n /**\n * @ignore\n */\n readonly isInvalid = computed(() => {\n if (!this.value()) return false;\n\n if (this.isDateUnavailable()?.(<DateValue>this.value())) return true;\n\n if (this.minValue() && isBefore(<DateValue>this.value(), <DateValue>this.minValue())) return true;\n\n if (this.maxValue() && isBefore(<DateValue>this.maxValue(), <DateValue>this.value())) return true;\n\n return false;\n });\n\n /**\n * @ignore\n */\n readonly allSegmentContent = computed(() =>\n createContent({\n granularity: <Granularity>this.inferredGranularity(),\n dateRef: <DateValue>this.placeholder(),\n formatter: this.formatter,\n hideTimeZone: this.hideTimeZone(),\n hourCycle: this.hourCycle(),\n segmentValues: this.segmentValues(),\n locale: this.locale\n })\n );\n\n /**\n * An array of segments that should be readonly, which prevent user input on them.\n */\n readonly segmentContents = computed(() => this.allSegmentContent().arr);\n\n /**\n * @ignore\n */\n readonly currentSegmentIndex = computed(() =>\n Array.from(this.segmentElements()).findIndex(\n (el) =>\n el.getAttribute('data-rdx-date-field-segment') ===\n this.currentFocusedElement()?.getAttribute('data-rdx-date-field-segment')\n )\n );\n\n /**\n * @ignore\n */\n readonly prevFocusableSegment = computed(() => {\n const sign = this.dir() === 'rtl' ? -1 : 1;\n const prevCondition =\n sign > 0 ? this.currentSegmentIndex() < 0 : this.currentSegmentIndex() > this.segmentElements().size - 1;\n if (prevCondition) return null;\n\n const segmentToFocus = Array.from(this.segmentElements())[this.currentSegmentIndex() - sign];\n return segmentToFocus;\n });\n\n /**\n * @ignore\n */\n readonly nextFocusableSegment = computed(() => {\n const sign = this.dir() === 'rtl' ? -1 : 1;\n const nextCondition =\n sign < 0 ? this.currentSegmentIndex() < 0 : this.currentSegmentIndex() > this.segmentElements().size - 1;\n if (nextCondition) return null;\n const segmentToFocus = Array.from(this.segmentElements())[this.currentSegmentIndex() + sign];\n return segmentToFocus;\n });\n\n /**\n * @ignore\n */\n readonly focusNext = () => {\n this.nextFocusableSegment()?.focus();\n };\n\n constructor() {\n watch([this.value], ([modelValue]) => {\n if (!isNullish(modelValue) && this.placeholder()?.compare(modelValue) !== 0) {\n this.placeholder.set(modelValue.copy());\n }\n });\n }\n\n ngOnInit() {\n const defDate = getDefaultDate({\n defaultPlaceholder: undefined,\n granularity: this.granularity(),\n defaultValue: this.value(),\n locale: this.locale()\n });\n\n this.placeholder.set(defDate.copy());\n\n this.formatter = createFormatter(this.locale());\n\n const initialSegments = initializeSegmentValues(this.inferredGranularity()!);\n\n this.segmentValues.set(\n this.value()\n ? { ...syncSegmentValues({ value: <DateValue>this.value(), formatter: this.formatter }) }\n : { ...initialSegments }\n );\n }\n\n ngAfterViewInit() {\n getSegmentElements(this.elementRef.nativeElement).forEach((item) =>\n this.segmentElements().add(item as HTMLElement)\n );\n }\n\n /**\n * @ignore\n */\n onKeydown(event: KeyboardEvent) {\n const code = event.code;\n if ([ARROW_LEFT, ARROW_RIGHT].includes(code)) {\n if (!isSegmentNavigationKey(event.key)) return;\n\n if (code === ARROW_LEFT) {\n this.prevFocusableSegment()?.focus();\n }\n\n if (code === ARROW_RIGHT) {\n this.nextFocusableSegment()?.focus();\n }\n }\n }\n\n /**\n * @ignore\n */\n setFocusedElement(el: HTMLElement) {\n this.currentFocusedElement.set(el);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RdxDateFieldInputDirective } from './src/date-field-input.directive';\nimport { RdxDateFieldRootDirective } from './src/date-field-root.directive';\n\nexport * from './src/date-field-context.token';\nexport * from './src/date-field-input.directive';\nexport * from './src/date-field-root.directive';\n\nconst _imports = [RdxDateFieldRootDirective, RdxDateFieldInputDirective];\n\n@NgModule({\n imports: [..._imports],\n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EAAA,kBAAkB,YANb,yBAAyB,EAAE,0BAA0B,CAArD,EAAA,OAAA,EAAA,CAAA,yBAAyB,EAAE,0BAA0B,CAAA,EAAA,CAAA,CAAA;+GAM1D,kBAAkB,EAAA,CAAA,CAAA;;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ,CAAC;AACtB,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ;AACxB,iBAAA;;;ACbD;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-date-field.mjs","sources":["../../../packages/primitives/date-field/src/date-field-context.token.ts","../../../packages/primitives/date-field/src/date-field-input.directive.ts","../../../packages/primitives/date-field/src/date-field-root.directive.ts","../../../packages/primitives/date-field/index.ts","../../../packages/primitives/date-field/radix-ng-primitives-date-field.ts"],"sourcesContent":["import { inject, InjectionToken, InputSignal, ModelSignal, Signal, WritableSignal } from '@angular/core';\nimport { DateValue } from '@internationalized/date';\nimport { DateStep, Formatter, HourCycle, SegmentValueObj } from '@radix-ng/primitives/core';\n\nexport interface DateFieldContextToken {\n locale: InputSignal<string>;\n value: ModelSignal<DateValue | undefined>;\n disabled: InputSignal<boolean>;\n readonly: InputSignal<boolean>;\n isInvalid: Signal<boolean>;\n placeholder: ModelSignal<DateValue>;\n hourCycle: InputSignal<HourCycle>;\n step$: Signal<DateStep>;\n formatter: Formatter;\n segmentValues: WritableSignal<SegmentValueObj>;\n focusNext: () => void;\n setFocusedElement: (el: HTMLElement) => void;\n}\n\nexport const DATE_FIELDS_ROOT_CONTEXT = new InjectionToken<DateFieldContextToken>('DATE_FIELDS_ROOT_CONTEXT');\n\nexport function injectDateFieldsRootContext(): DateFieldContextToken {\n return inject(DATE_FIELDS_ROOT_CONTEXT);\n}\n","import { computed, Directive, effect, ElementRef, input, signal } from '@angular/core';\nimport { SegmentPart, useDateField } from '@radix-ng/primitives/core';\nimport { injectDateFieldsRootContext } from './date-field-context.token';\n\n@Directive({\n selector: '[rdxDateFieldInput]',\n host: {\n '[attr.contenteditable]': 'disabled() || readonly() ? false : part() !== \"literal\"',\n '[attr.data-rdx-date-field-segment]': 'part()',\n '[attr.aria-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.data-invalid]': 'isInvalid() ? \"\" : undefined',\n '[attr.aria-invalid]': 'isInvalid() ? true : undefined',\n\n '(mousedown)': 'part() !== \"literal\" && handleSegmentClick($event)',\n '(keydown)': 'part() !== \"literal\" && handleSegmentKeydown($event)',\n '(focus)': 'part() !== \"literal\" && onFocus($event)',\n '(focusout)': 'part() !== \"literal\" && onFocusOut()'\n }\n})\nexport class RdxDateFieldInputDirective {\n private readonly rootContext = injectDateFieldsRootContext();\n\n /**\n * The part of the date to render\n * `'day' | 'month' | 'year' | 'hour' | 'minute' | 'second' | 'dayPeriod' | 'literal' | 'timeZoneName'`\n */\n readonly part = input<SegmentPart>();\n\n /**\n * @ignore\n */\n readonly disabled = computed(() => this.rootContext.disabled());\n\n /**\n * @ignore\n */\n readonly readonly = computed(() => this.rootContext.readonly());\n\n /**\n * @ignore\n */\n readonly isInvalid = computed(() => this.rootContext.isInvalid());\n\n /**\n * @ignore\n */\n readonly hasLeftFocus = signal<boolean>(true);\n\n /**\n * @ignore\n */\n readonly lastKeyZero = signal<boolean>(false);\n\n private readonly fieldData = computed(() => {\n return useDateField({\n hasLeftFocus: this.hasLeftFocus,\n lastKeyZero: this.lastKeyZero,\n placeholder: this.rootContext.placeholder,\n hourCycle: this.rootContext.hourCycle(),\n segmentValues: this.rootContext.segmentValues,\n formatter: this.rootContext.formatter,\n part: <SegmentPart>this.part(),\n disabled: this.rootContext.disabled,\n readonly: this.rootContext.readonly,\n step: this.rootContext.step$,\n modelValue: this.rootContext.value,\n focusNext: this.rootContext.focusNext\n });\n });\n\n private readonly attributes = computed(() => this.fieldData().attributes());\n\n /**\n * @ignore\n */\n handleSegmentClick: (e: MouseEvent) => void;\n\n /**\n * @ignore\n */\n handleSegmentKeydown: (e: KeyboardEvent) => void;\n\n constructor(private el: ElementRef) {\n effect(() => {\n const { handleSegmentClick, handleSegmentKeydown } = this.fieldData();\n this.handleSegmentKeydown = handleSegmentKeydown;\n this.handleSegmentClick = handleSegmentClick;\n });\n\n effect(() => {\n const attrs = this.attributes();\n Object.entries(attrs).forEach(([attr, value]) => {\n this.el.nativeElement.setAttribute(attr, String(value));\n });\n });\n }\n\n /**\n * @ignore\n */\n onFocus(e: FocusEvent) {\n this.rootContext.setFocusedElement(e.target as HTMLElement);\n }\n\n /**\n * @ignore\n */\n onFocusOut() {\n this.hasLeftFocus.set(true);\n }\n}\n","import { Direction } from '@angular/cdk/bidi';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport {\n AfterViewInit,\n booleanAttribute,\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n model,\n OnInit,\n signal\n} from '@angular/core';\nimport { DateValue } from '@internationalized/date';\nimport {\n ARROW_LEFT,\n ARROW_RIGHT,\n createContent,\n createFormatter,\n DateMatcher,\n DateStep,\n Formatter,\n getDefaultDate,\n getSegmentElements,\n Granularity,\n hasTime,\n HourCycle,\n initializeSegmentValues,\n isBefore,\n isNullish,\n isSegmentNavigationKey,\n normalizeDateStep,\n normalizeHourCycle,\n provideToken,\n SegmentValueObj,\n syncSegmentValues,\n watch\n} from '@radix-ng/primitives/core';\nimport { DATE_FIELDS_ROOT_CONTEXT } from './date-field-context.token';\n\n@Directive({\n selector: '[rdxDateFieldRoot]',\n exportAs: 'rdxDateFieldRoot',\n providers: [provideToken(DATE_FIELDS_ROOT_CONTEXT, RdxDateFieldRootDirective)],\n host: {\n role: 'group',\n '[attr.aria-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.data-readonly]': 'readonly() ? \"\" : undefined',\n '[attr.data-invalid]': 'isInvalid() ? \"\" : undefined',\n '[attr.dir]': 'dir()',\n\n '(keydown)': 'onKeydown($event)'\n }\n})\nexport class RdxDateFieldRootDirective implements OnInit, AfterViewInit {\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n\n /**\n * The controlled checked state of the calendar.\n */\n readonly value = model<DateValue | undefined>();\n\n /**\n * A callback fired when the date field's value is invalid.\n */\n readonly isDateUnavailable = input<DateMatcher | undefined>(undefined);\n\n /**\n * The hour cycle to use for formatting times. Defaults to the locale preference\n */\n readonly hourCycle = input<HourCycle>();\n\n /**\n * The granularity to use for formatting the field. Defaults to 'day' if a CalendarDate is provided, otherwise defaults to 'minute'.\n * The field will render segments for each part of the date up to and including the specified granularity.\n */\n readonly granularity = input<Granularity>();\n\n /**\n * The locale to use for formatting dates.\n */\n readonly locale = input<string>('en');\n\n readonly dir = input<Direction>('ltr');\n\n /**\n * The minimum valid date that can be entered.\n */\n readonly minValue = input<DateValue>();\n\n /**\n * The maximum valid date that can be entered.\n */\n readonly maxValue = input<DateValue>();\n\n /**\n * Whether or not to hide the time zone segment of the field.\n */\n readonly hideTimeZone = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether or not the field is readonly.\n */\n readonly readonly = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The stepping interval for the time fields. Defaults to 1\n */\n readonly step = input<DateStep>();\n\n readonly step$ = computed(() => normalizeDateStep(this.step()));\n\n /**\n * @ignore\n */\n readonly defaultDate = computed(() =>\n getDefaultDate({\n defaultPlaceholder: undefined,\n granularity: this.granularity(),\n defaultValue: this.value(),\n locale: this.locale()\n })\n );\n\n /**\n * The placeholder date, which is used to determine what month to display when no date is selected. This updates as the user navigates the calendar and can be used to programmatically control the calendar view\n */\n readonly placeholder = model<DateValue | undefined>(this.defaultDate().copy());\n\n // Internal state\n\n /**\n * @ignore\n */\n readonly segmentElements = signal<Set<HTMLElement>>(new Set());\n\n /**\n * @ignore\n */\n readonly currentFocusedElement = signal<HTMLElement | null>(null);\n\n /**\n * @ignore\n */\n formatter: Formatter;\n\n /**\n * @ignore\n */\n readonly segmentValues = signal<SegmentValueObj>({\n year: null,\n month: null,\n day: null,\n hour: null,\n minute: null,\n second: null,\n dayPeriod: null\n } as SegmentValueObj);\n\n /**\n * @ignore\n */\n readonly inferredGranularity = computed(() => {\n const placeholder = this.placeholder();\n\n if (this.granularity()) return placeholder && !hasTime(placeholder) ? 'day' : this.granularity();\n\n return placeholder && hasTime(placeholder) ? 'minute' : 'day';\n });\n\n /**\n * @ignore\n */\n readonly isInvalid = computed(() => {\n if (!this.value()) return false;\n\n if (this.isDateUnavailable()?.(<DateValue>this.value())) return true;\n\n if (this.minValue() && isBefore(<DateValue>this.value(), <DateValue>this.minValue())) return true;\n\n if (this.maxValue() && isBefore(<DateValue>this.maxValue(), <DateValue>this.value())) return true;\n\n return false;\n });\n\n /**\n * @ignore\n */\n readonly allSegmentContent = computed(() =>\n createContent({\n granularity: <Granularity>this.inferredGranularity(),\n dateRef: <DateValue>this.placeholder(),\n formatter: this.formatter,\n hideTimeZone: this.hideTimeZone(),\n hourCycle: this.hourCycle(),\n segmentValues: this.segmentValues(),\n locale: this.locale\n })\n );\n\n /**\n * An array of segments that should be readonly, which prevent user input on them.\n */\n readonly segmentContents = computed(() => this.allSegmentContent().arr);\n\n /**\n * @ignore\n */\n readonly currentSegmentIndex = computed(() =>\n Array.from(this.segmentElements()).findIndex(\n (el) =>\n el.getAttribute('data-rdx-date-field-segment') ===\n this.currentFocusedElement()?.getAttribute('data-rdx-date-field-segment')\n )\n );\n\n /**\n * @ignore\n */\n readonly prevFocusableSegment = computed(() => {\n const sign = this.dir() === 'rtl' ? -1 : 1;\n const prevCondition =\n sign > 0 ? this.currentSegmentIndex() < 0 : this.currentSegmentIndex() > this.segmentElements().size - 1;\n if (prevCondition) return null;\n\n const segmentToFocus = Array.from(this.segmentElements())[this.currentSegmentIndex() - sign];\n return segmentToFocus;\n });\n\n /**\n * @ignore\n */\n readonly nextFocusableSegment = computed(() => {\n const sign = this.dir() === 'rtl' ? -1 : 1;\n const nextCondition =\n sign < 0 ? this.currentSegmentIndex() < 0 : this.currentSegmentIndex() > this.segmentElements().size - 1;\n if (nextCondition) return null;\n const segmentToFocus = Array.from(this.segmentElements())[this.currentSegmentIndex() + sign];\n return segmentToFocus;\n });\n\n /**\n * @ignore\n */\n readonly focusNext = () => {\n this.nextFocusableSegment()?.focus();\n };\n\n constructor() {\n watch([this.value], ([modelValue]) => {\n if (!isNullish(modelValue) && this.placeholder()?.compare(modelValue) !== 0) {\n this.placeholder.set(modelValue.copy());\n }\n });\n }\n\n ngOnInit() {\n const defDate = getDefaultDate({\n defaultPlaceholder: undefined,\n granularity: this.granularity(),\n defaultValue: this.value(),\n locale: this.locale()\n });\n\n this.placeholder.set(defDate.copy());\n\n this.formatter = createFormatter(this.locale(), {\n hourCycle: normalizeHourCycle(this.hourCycle())\n });\n\n const initialSegments = initializeSegmentValues(this.inferredGranularity()!);\n\n this.segmentValues.set(\n this.value()\n ? { ...syncSegmentValues({ value: <DateValue>this.value(), formatter: this.formatter }) }\n : { ...initialSegments }\n );\n }\n\n ngAfterViewInit() {\n getSegmentElements(this.elementRef.nativeElement).forEach((item) =>\n this.segmentElements().add(item as HTMLElement)\n );\n }\n\n /**\n * @ignore\n */\n onKeydown(event: KeyboardEvent) {\n const code = event.code;\n if ([ARROW_LEFT, ARROW_RIGHT].includes(code)) {\n if (!isSegmentNavigationKey(event.key)) return;\n\n if (code === ARROW_LEFT) {\n this.prevFocusableSegment()?.focus();\n }\n\n if (code === ARROW_RIGHT) {\n this.nextFocusableSegment()?.focus();\n }\n }\n }\n\n /**\n * @ignore\n */\n setFocusedElement(el: HTMLElement) {\n this.currentFocusedElement.set(el);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RdxDateFieldInputDirective } from './src/date-field-input.directive';\nimport { RdxDateFieldRootDirective } from './src/date-field-root.directive';\n\nexport * from './src/date-field-context.token';\nexport * from './src/date-field-input.directive';\nexport * from './src/date-field-root.directive';\n\nconst _imports = [RdxDateFieldRootDirective, RdxDateFieldInputDirective];\n\n@NgModule({\n imports: [..._imports],\n exports: [..._imports]\n})\nexport class RdxDateFieldModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAmBa,wBAAwB,GAAG,IAAI,cAAc,CAAwB,0BAA0B;SAE5F,2BAA2B,GAAA;AACvC,IAAA,OAAO,MAAM,CAAC,wBAAwB,CAAC;AAC3C;;MCHa,0BAA0B,CAAA;AA+DnC,IAAA,WAAA,CAAoB,EAAc,EAAA;QAAd,IAAE,CAAA,EAAA,GAAF,EAAE;QA9DL,IAAW,CAAA,WAAA,GAAG,2BAA2B,EAAE;AAE5D;;;AAGG;QACM,IAAI,CAAA,IAAA,GAAG,KAAK,EAAe;AAEpC;;AAEG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;AAE/D;;AAEG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;AAE/D;;AAEG;AACM,QAAA,IAAA,CAAA,SAAS,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC;AAEjE;;AAEG;AACM,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAU,IAAI,CAAC;AAE7C;;AAEG;AACM,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAU,KAAK,CAAC;AAE5B,QAAA,IAAA,CAAA,SAAS,GAAG,QAAQ,CAAC,MAAK;AACvC,YAAA,OAAO,YAAY,CAAC;gBAChB,YAAY,EAAE,IAAI,CAAC,YAAY;gBAC/B,WAAW,EAAE,IAAI,CAAC,WAAW;AAC7B,gBAAA,WAAW,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BAAA,IAAI,EAAE,OAAO;AACb,wBAAA,sBAAsB,EAAE,6BAA6B;AACrD,wBAAA,sBAAsB,EAAE,6BAA6B;AACrD,wBAAA,sBAAsB,EAAE,6BAA6B;AACrD,wBAAA,qBAAqB,EAAE,8BAA8B;AACrD,wBAAA,YAAY,EAAE,OAAO;AAErB,wBAAA,WAAW,EAAE;AAChB;AACJ,iBAAA;;;AC/CD,MAAM,QAAQ,GAAG,CAAC,yBAAyB,EAAE,0BAA0B,CAAC;MAM3D,kBAAkB,CAAA;8GAAlB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YANb,yBAAyB,EAAE,0BAA0B,CAArD,EAAA,OAAA,EAAA,CAAA,yBAAyB,EAAE,0BAA0B,CAAA,EAAA,CAAA,CAAA;+GAM1D,kBAAkB,EAAA,CAAA,CAAA;;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ,CAAC;AACtB,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ;AACxB,iBAAA;;;ACbD;;AAEG;;;;"}
@@ -3,7 +3,7 @@ import { InjectionToken, inject, DestroyRef, signal, effect, Injectable, compute
3
3
  import { NumberFormatter, NumberParser } from '@internationalized/number';
4
4
  import { Subject, fromEvent } from 'rxjs';
5
5
  import { takeUntil } from 'rxjs/operators';
6
- import { getActiveElement, clamp, snapValueToStep, provideToken } from '@radix-ng/primitives/core';
6
+ import { getActiveElement, isNullish, clamp, snapValueToStep, provideToken } from '@radix-ng/primitives/core';
7
7
 
8
8
  const NUMBER_FIELD_ROOT_CONTEXT = new InjectionToken('NUMBER_FIELD_ROOT_CONTEXT');
9
9
  function injectNumberFieldRootContext() {
@@ -325,15 +325,15 @@ class RdxNumberFieldRootDirective {
325
325
  /**
326
326
  * @ignore
327
327
  */
328
- this.isDecreaseDisabled = computed(() => this.clampInputValue(this.value()) === this.min() ||
329
- (this.min() && !isNaN(this.value())
328
+ this.isDecreaseDisabled = computed(() => !isNullish(this.value()) &&
329
+ (this.clampInputValue(this.value()) === this.min() || (this.min() && !isNaN(this.value()))
330
330
  ? handleDecimalOperation('-', this.value(), this.step()) < this.min()
331
331
  : false));
332
332
  /**
333
333
  * @ignore
334
334
  */
335
- this.isIncreaseDisabled = computed(() => this.clampInputValue(this.value()) === this.max() ||
336
- (this.max() && !isNaN(this.value())
335
+ this.isIncreaseDisabled = computed(() => !isNullish(this.value()) &&
336
+ (this.clampInputValue(this.value()) === this.max() || (this.min() && !isNaN(this.value()))
337
337
  ? handleDecimalOperation('+', this.value(), this.step()) > this.max()
338
338
  : false));
339
339
  /**
@@ -352,7 +352,7 @@ class RdxNumberFieldRootDirective {
352
352
  * with a textValue that can be announced using a minus sign.
353
353
  * @ignore
354
354
  */
355
- this.textValue = computed(() => (isNaN(this.value()) ? '' : this.textValueFormatter().format(this.value())));
355
+ this.textValue = computed(() => isNullish(this.value()) || isNaN(this.value()) ? '' : this.textValueFormatter().format(this.value()));
356
356
  /**
357
357
  * @ignore
358
358
  */
@@ -406,7 +406,7 @@ class RdxNumberFieldRootDirective {
406
406
  */
407
407
  applyInputValue(val) {
408
408
  const parsedValue = this.numberParser().parse(val);
409
- this.value.set(this.clampInputValue(parsedValue));
409
+ this.value.set(isNaN(parsedValue) ? undefined : this.clampInputValue(parsedValue));
410
410
  // Set to empty state if input value is empty
411
411
  if (!val.length) {
412
412
  return this.setInputValue(val);
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-number-field.mjs","sources":["../../../packages/primitives/number-field/src/number-field-context.token.ts","../../../packages/primitives/number-field/src/utils.ts","../../../packages/primitives/number-field/src/number-field-decrement.directive.ts","../../../packages/primitives/number-field/src/number-field-increment.directive.ts","../../../packages/primitives/number-field/src/number-field-input.directive.ts","../../../packages/primitives/number-field/src/number-field-root.directive.ts","../../../packages/primitives/number-field/index.ts","../../../packages/primitives/number-field/radix-ng-primitives-number-field.ts"],"sourcesContent":["import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport { inject, InjectionToken, InputSignal, InputSignalWithTransform, ModelSignal, Signal } from '@angular/core';\nimport { InputMode } from './types';\n\nexport interface NumberFieldContextToken {\n value: ModelSignal<number | undefined>;\n locale: InputSignal<string>;\n inputMode: Signal<InputMode>;\n textValue: Signal<any>;\n max: InputSignalWithTransform<number | undefined, NumberInput>;\n min: InputSignalWithTransform<number | undefined, NumberInput>;\n onInputElement: (el: HTMLInputElement) => void;\n disabled: InputSignalWithTransform<boolean, BooleanInput>;\n disableWheelChange: InputSignalWithTransform<boolean, BooleanInput>;\n handleIncrease: (multiplier?: number) => void;\n handleDecrease: (multiplier?: number) => void;\n applyInputValue: (val: string) => void;\n validate: (val: string) => boolean;\n setInputValue: (val: string) => void;\n isIncreaseDisabled: Signal<boolean>;\n isDecreaseDisabled: Signal<boolean>;\n handleMinMaxValue: (type: 'min' | 'max') => void;\n}\n\nexport const NUMBER_FIELD_ROOT_CONTEXT = new InjectionToken<NumberFieldContextToken>('NUMBER_FIELD_ROOT_CONTEXT');\n\nexport function injectNumberFieldRootContext(): NumberFieldContextToken {\n return inject(NUMBER_FIELD_ROOT_CONTEXT);\n}\n","import { computed, DestroyRef, effect, inject, Injectable, signal, Signal } from '@angular/core';\nimport { NumberFormatter, NumberParser } from '@internationalized/number';\nimport { fromEvent, Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\n@Injectable()\nexport class PressedHoldService {\n private readonly destroyRef = inject(DestroyRef);\n\n create(options: { target?: Signal<HTMLElement | undefined>; disabled: Signal<boolean> }) {\n const timeout = signal<number | undefined>(undefined);\n const triggerHook = new Subject<void>();\n const isPressed = signal(false);\n\n const resetTimeout = () => {\n const timer = timeout();\n if (timer !== undefined) {\n window.clearTimeout(timer);\n timeout.set(undefined);\n }\n };\n\n const onIncrementPressStart = (delay: number) => {\n resetTimeout();\n if (options.disabled()) return;\n\n triggerHook.next();\n\n timeout.set(\n window.setTimeout(() => {\n onIncrementPressStart(60);\n }, delay)\n );\n };\n\n const onPressStart = (event: PointerEvent) => {\n if (event.button !== 0 || isPressed()) return;\n event.preventDefault();\n isPressed.set(true);\n onIncrementPressStart(400);\n };\n\n const onPressRelease = () => {\n isPressed.set(false);\n resetTimeout();\n };\n\n effect(() => {\n // Skip SSR environments\n if (typeof window === 'undefined') return;\n\n const targetElement = options.target?.() || window;\n const destroy$ = new Subject<void>();\n\n const pointerDownSub = fromEvent(targetElement, 'pointerdown')\n .pipe(takeUntil(destroy$))\n .subscribe((e) => onPressStart(e as PointerEvent));\n\n const pointerUpSub = fromEvent(window, 'pointerup').pipe(takeUntil(destroy$)).subscribe(onPressRelease);\n\n const pointerCancelSub = fromEvent(window, 'pointercancel')\n .pipe(takeUntil(destroy$))\n .subscribe(onPressRelease);\n\n this.destroyRef.onDestroy(() => {\n destroy$.next();\n destroy$.complete();\n pointerDownSub.unsubscribe();\n pointerUpSub.unsubscribe();\n pointerCancelSub.unsubscribe();\n });\n });\n\n return {\n isPressed: isPressed.asReadonly(),\n onTrigger: (fn: () => void) => {\n const sub = triggerHook.subscribe(fn);\n this.destroyRef.onDestroy(() => sub.unsubscribe());\n }\n };\n }\n}\n\nexport function useNumberFormatter(\n locale: Signal<string>,\n options: Signal<Intl.NumberFormatOptions | undefined> = signal({})\n): Signal<NumberFormatter> {\n return computed(() => new NumberFormatter(locale(), options()));\n}\n\nexport function useNumberParser(\n locale: Signal<string>,\n options: Signal<Intl.NumberFormatOptions | undefined> = signal({})\n): Signal<NumberParser> {\n return computed(() => new NumberParser(locale(), options()));\n}\n\nexport function handleDecimalOperation(operator: '-' | '+', value1: number, value2: number): number {\n let result = operator === '+' ? value1 + value2 : value1 - value2;\n\n // Check if we have decimals\n if (value1 % 1 !== 0 || value2 % 1 !== 0) {\n const value1Decimal = value1.toString().split('.');\n const value2Decimal = value2.toString().split('.');\n const value1DecimalLength = (value1Decimal[1] && value1Decimal[1].length) || 0;\n const value2DecimalLength = (value2Decimal[1] && value2Decimal[1].length) || 0;\n const multiplier = 10 ** Math.max(value1DecimalLength, value2DecimalLength);\n\n // Transform the decimals to integers based on the precision\n value1 = Math.round(value1 * multiplier);\n value2 = Math.round(value2 * multiplier);\n\n // Perform the operation on integers values to make sure we don't get a fancy decimal value\n result = operator === '+' ? value1 + value2 : value1 - value2;\n\n // Transform the integer result back to decimal\n result /= multiplier;\n }\n\n return result;\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, ElementRef, inject, input, OnInit, signal } from '@angular/core';\nimport { injectNumberFieldRootContext } from './number-field-context.token';\nimport { PressedHoldService } from './utils';\n\n@Directive({\n selector: 'button[rdxNumberFieldDecrement]',\n providers: [PressedHoldService],\n host: {\n tabindex: '-1',\n type: '\"button\"',\n '[attr.aria-label]': '\"Decrease\"',\n '[attr.disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-pressed]': 'useHold.isPressed() ? \"true\" : undefined',\n\n '[style.user-select]': 'useHold.isPressed() ? \"none\" : null',\n\n '(contextmenu)': '$event.preventDefault()'\n }\n})\nexport class RdxNumberFieldDecrementDirective implements OnInit {\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly pressedHold = inject(PressedHoldService);\n\n protected readonly rootContext = injectNumberFieldRootContext();\n\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * @ignore\n */\n readonly isDisabled = computed(\n () => this.rootContext.disabled() || this.disabled() || this.rootContext.isDecreaseDisabled()\n );\n\n /**\n * @ignore\n */\n readonly useHold = this.pressedHold.create({\n target: signal(this.elementRef.nativeElement),\n disabled: this.disabled\n });\n\n ngOnInit() {\n this.useHold.onTrigger(() => this.rootContext.handleDecrease());\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, ElementRef, inject, input, OnInit, signal } from '@angular/core';\nimport { injectNumberFieldRootContext } from './number-field-context.token';\nimport { PressedHoldService } from './utils';\n\n@Directive({\n selector: 'button[rdxNumberFieldIncrement]',\n providers: [PressedHoldService],\n host: {\n tabindex: '-1',\n type: '\"button\"',\n '[attr.aria-label]': '\"Increase\"',\n '[attr.disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-pressed]': 'useHold.isPressed() ? \"true\" : undefined',\n\n '[style.user-select]': 'useHold.isPressed() ? \"none\" : null',\n\n '(contextmenu)': '$event.preventDefault()'\n }\n})\nexport class RdxNumberFieldIncrementDirective implements OnInit {\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly pressedHold = inject(PressedHoldService);\n\n protected readonly rootContext = injectNumberFieldRootContext();\n\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * @ignore\n */\n readonly isDisabled = computed(\n () => this.rootContext.disabled() || this.disabled() || this.rootContext.isIncreaseDisabled()\n );\n\n /**\n * @ignore\n */\n readonly useHold = this.pressedHold.create({\n target: signal(this.elementRef.nativeElement),\n disabled: this.disabled\n });\n\n ngOnInit() {\n this.useHold.onTrigger(() => this.rootContext.handleIncrease());\n }\n}\n","import { Directive, effect, ElementRef, inject, OnInit, signal } from '@angular/core';\nimport { getActiveElement } from '@radix-ng/primitives/core';\nimport { injectNumberFieldRootContext } from './number-field-context.token';\n\n@Directive({\n selector: 'input[rdxNumberFieldInput]',\n host: {\n role: 'spinbutton',\n type: 'text',\n tabindex: '0',\n autocomplete: 'off',\n autocorrect: 'off',\n spellcheck: 'false',\n 'aria-roledescription': 'Number field',\n\n '[attr.aria-valuenow]': 'rootContext.value()',\n '[attr.aria-valuemin]': 'rootContext.min()',\n '[attr.aria-valuemax]': 'rootContext.max()',\n '[attr.inputmode]': 'rootContext.inputMode()',\n '[attr.disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.value]': 'inputValue()',\n\n '(change)': 'onChange()',\n '(input)': 'onInput($event)',\n '(blur)': 'onKeydownEnter($event)',\n '(beforeinput)': 'onBeforeInput($event)',\n '(keydown.enter)': 'onKeydownEnter($event)',\n '(keydown.arrowUp)': 'onKeydownUp($event)',\n '(keydown.arrowDown)': 'onKeydownDown($event)',\n '(keydown.home)': 'onKeydownHome($event)',\n '(keydown.end)': 'onKeydownEnd($event)',\n '(keydown.pageUp)': 'onKeydownPageUp($event)',\n '(keydown.pageDown)': 'onKeydownPageDown($event)',\n '(wheel)': 'onWheelEvent($event)'\n }\n})\nexport class RdxNumberFieldInputDirective implements OnInit {\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n\n protected readonly rootContext = injectNumberFieldRootContext();\n\n readonly inputValue = signal(this.rootContext.textValue());\n\n constructor() {\n effect(() => {\n this.inputValue.set(this.rootContext.textValue());\n this.rootContext.setInputValue(this.inputValue());\n });\n }\n\n ngOnInit() {\n this.rootContext.onInputElement(this.elementRef.nativeElement as HTMLInputElement);\n }\n\n onBeforeInput(event: InputEvent) {\n const target = event.target as HTMLInputElement;\n const nextValue =\n target.value.slice(0, target.selectionStart ?? undefined) +\n (event.data ?? '') +\n target.value.slice(target.selectionEnd ?? undefined);\n\n if (!this.rootContext.validate(nextValue)) {\n event.preventDefault();\n }\n }\n\n onWheelEvent(event: WheelEvent) {\n if (this.rootContext.disableWheelChange()) {\n return;\n }\n\n // only handle when in focus\n if (event.target !== getActiveElement()) return;\n\n // if on a trackpad, users can scroll in both X and Y at once, check the magnitude of the change\n // if it's mostly in the X direction, then just return, the user probably doesn't mean to inc/dec\n // this isn't perfect, events come in fast with small deltas and a part of the scroll may give a false indication\n // especially if the user is scrolling near 45deg\n if (Math.abs(event.deltaY) <= Math.abs(event.deltaX)) {\n return;\n }\n\n event.preventDefault();\n if (event.deltaY > 0) {\n this.rootContext.handleIncrease();\n } else if (event.deltaY < 0) {\n this.rootContext.handleDecrease();\n }\n }\n\n onKeydownPageUp(event: KeyboardEvent) {\n event.preventDefault();\n this.rootContext.handleIncrease(10);\n }\n\n onKeydownPageDown(event: KeyboardEvent) {\n event.preventDefault();\n this.rootContext.handleDecrease(10);\n }\n\n onKeydownHome(event: KeyboardEvent) {\n event.preventDefault();\n this.rootContext.handleMinMaxValue('min');\n }\n\n onKeydownEnd(event: KeyboardEvent) {\n event.preventDefault();\n this.rootContext.handleMinMaxValue('max');\n }\n\n onInput(event: InputEvent) {\n const target = event.target as HTMLInputElement;\n this.rootContext.applyInputValue(target.value);\n }\n\n onChange() {\n this.inputValue.set(this.rootContext.textValue());\n }\n\n onKeydownEnter(event: KeyboardEvent) {\n const target = event.target as HTMLInputElement;\n this.rootContext.applyInputValue(target.value);\n }\n\n onKeydownUp(event: KeyboardEvent) {\n event.preventDefault();\n this.rootContext.handleIncrease();\n }\n\n onKeydownDown(event: KeyboardEvent) {\n event.preventDefault();\n this.rootContext.handleDecrease();\n }\n}\n","import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, input, model, numberAttribute, OnInit, signal } from '@angular/core';\nimport { clamp, provideToken, snapValueToStep } from '@radix-ng/primitives/core';\nimport { NUMBER_FIELD_ROOT_CONTEXT, NumberFieldContextToken } from './number-field-context.token';\nimport { InputMode } from './types';\nimport { handleDecimalOperation, useNumberFormatter, useNumberParser } from './utils';\n\n@Directive({\n selector: '[rdxNumberFieldRoot]',\n exportAs: 'rdxNumberFieldRoot',\n providers: [provideToken(NUMBER_FIELD_ROOT_CONTEXT, RdxNumberFieldRootDirective)],\n host: {\n role: 'group',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined'\n }\n})\nexport class RdxNumberFieldRootDirective implements OnInit, NumberFieldContextToken {\n readonly value = model<number>();\n\n readonly min = input<number | undefined, NumberInput>(undefined, { transform: numberAttribute });\n\n readonly max = input<number | undefined, NumberInput>(undefined, { transform: numberAttribute });\n\n readonly step = input<number, NumberInput>(1, { transform: numberAttribute });\n\n readonly stepSnapping = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly disableWheelChange = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly locale = input<string>('en');\n\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly formatOptions = input<Intl.NumberFormatOptions>();\n\n /**\n * @ignore\n */\n readonly inputEl = signal<HTMLInputElement | undefined>(undefined);\n\n /**\n * @ignore\n */\n readonly isDecreaseDisabled = computed(\n () =>\n this.clampInputValue(this.value()!) === this.min() ||\n (this.min() && !isNaN(this.value()!)\n ? handleDecimalOperation('-', this.value()!, this.step()) < this.min()!\n : false)\n );\n\n /**\n * @ignore\n */\n readonly isIncreaseDisabled = computed(\n () =>\n this.clampInputValue(this.value()!) === this.max() ||\n (this.max() && !isNaN(this.value()!)\n ? handleDecimalOperation('+', this.value()!, this.step()) > this.max()!\n : false)\n );\n\n /**\n * @ignore\n */\n readonly inputMode = computed<InputMode>(() => {\n // The inputMode attribute influences the software keyboard that is shown on touch devices.\n // Browsers and operating systems are quite inconsistent about what keys are available, however.\n // We choose between numeric and decimal based on whether we allow negative and fractional numbers,\n // and based on testing on various devices to determine what keys are available in each inputMode.\n const hasDecimals = this.numberFormatter().resolvedOptions().maximumFractionDigits! > 0;\n\n return hasDecimals ? 'decimal' : 'numeric';\n });\n\n /**\n * Replace negative textValue formatted using currencySign: 'accounting'\n * with a textValue that can be announced using a minus sign.\n * @ignore\n */\n readonly textValue = computed(() => (isNaN(this.value()!) ? '' : this.textValueFormatter().format(this.value())));\n\n /**\n * @ignore\n */\n readonly onInputElement = (el: HTMLInputElement) => this.inputEl.set(el);\n\n /**\n * @ignore\n */\n numberParser: any;\n /**\n * @ignore\n */\n numberFormatter: any;\n /**\n * @ignore\n */\n textValueFormatter: any;\n\n /**\n * @ignore\n */\n clampInputValue(val: number) {\n // Clamp to min and max, round to the nearest step, and round to the specified number of digits\n let clampedValue: number;\n if (this.step() === undefined || isNaN(this.step()) || !this.stepSnapping()) {\n clampedValue = clamp(val, this.min(), this.max());\n } else {\n clampedValue = snapValueToStep(val, this.min(), this.max(), this.step());\n }\n\n clampedValue = this.numberParser().parse(this.numberFormatter().format(clampedValue));\n return clampedValue;\n }\n\n ngOnInit() {\n this.numberParser = useNumberParser(this.locale, this.formatOptions);\n this.numberFormatter = useNumberFormatter(this.locale, this.formatOptions);\n this.textValueFormatter = useNumberFormatter(this.locale, this.formatOptions);\n }\n\n /**\n * @ignore\n */\n handleMinMaxValue(type: 'min' | 'max') {\n if (type === 'min' && this.min() !== undefined) {\n this.value.set(this.clampInputValue(this.min()!));\n } else if (type === 'max' && this.max() !== undefined) {\n this.value.set(this.clampInputValue(this.max()!));\n }\n }\n\n /**\n * @ignore\n */\n handleDecrease(multiplier = 1) {\n this.handleChangingValue('decrease', multiplier);\n }\n\n /**\n * @ignore\n */\n handleIncrease(multiplier = 1) {\n this.handleChangingValue('increase', multiplier);\n }\n\n /**\n * @ignore\n */\n applyInputValue(val: string) {\n const parsedValue = this.numberParser().parse(val);\n\n this.value.set(this.clampInputValue(parsedValue));\n\n // Set to empty state if input value is empty\n if (!val.length) {\n return this.setInputValue(val);\n }\n\n // if it failed to parse, then reset input to formatted version of current number\n if (isNaN(parsedValue)) {\n return this.setInputValue(this.textValue());\n }\n\n return this.setInputValue(this.textValue());\n }\n\n /**\n * @ignore\n */\n setInputValue(val: string) {\n if (this.inputEl()) {\n this.inputEl.update((el) => {\n if (el) el.value = val;\n return el;\n });\n }\n }\n\n /**\n * @ignore\n */\n validate(val: string) {\n return this.numberParser().isValidPartialNumber(val, this.min(), this.max());\n }\n\n private handleChangingValue(type: 'increase' | 'decrease', multiplier = 1) {\n this.inputEl()?.focus();\n const currentInputValue = this.numberParser().parse(this.inputEl()?.value ?? '');\n\n if (this.disabled()) {\n return;\n }\n\n if (isNaN(currentInputValue)) {\n this.value.set(this.min() ?? 0);\n } else {\n if (type === 'increase') {\n this.value.set(this.clampInputValue(currentInputValue + (this.step() ?? 1) * multiplier));\n } else {\n this.value.set(this.clampInputValue(currentInputValue - (this.step() ?? 1) * multiplier));\n }\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RdxNumberFieldDecrementDirective } from './src/number-field-decrement.directive';\nimport { RdxNumberFieldIncrementDirective } from './src/number-field-increment.directive';\nimport { RdxNumberFieldInputDirective } from './src/number-field-input.directive';\nimport { RdxNumberFieldRootDirective } from './src/number-field-root.directive';\n\nexport * from './src/number-field-context.token';\nexport * from './src/number-field-decrement.directive';\nexport * from './src/number-field-increment.directive';\nexport * from './src/number-field-input.directive';\nexport * from './src/number-field-root.directive';\nexport * from './src/types';\nexport * from './src/utils';\n\nconst _imports = [\n RdxNumberFieldRootDirective,\n RdxNumberFieldInputDirective,\n RdxNumberFieldIncrementDirective,\n RdxNumberFieldDecrementDirective\n];\n\n@NgModule({\n imports: [..._imports],\n exports: [..._imports]\n})\nexport class RdxNumberFieldModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAwBa,yBAAyB,GAAG,IAAI,cAAc,CAA0B,2BAA2B;SAEhG,4BAA4B,GAAA;AACxC,IAAA,OAAO,MAAM,CAAC,yBAAyB,CAAC;AAC5C;;MCtBa,kBAAkB,CAAA;AAD/B,IAAA,WAAA,GAAA;AAEqB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AA0EnD;AAxEG,IAAA,MAAM,CAAC,OAAgF,EAAA;AACnF,QAAA,MAAM,OAAO,GAAG,MAAM,CAAqB,SAAS,CAAC;AACrD,QAAA,MAAM,WAAW,GAA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CAAC;AACtB,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ;AACxB,iBAAA;;;ACxBD;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-number-field.mjs","sources":["../../../packages/primitives/number-field/src/number-field-context.token.ts","../../../packages/primitives/number-field/src/utils.ts","../../../packages/primitives/number-field/src/number-field-decrement.directive.ts","../../../packages/primitives/number-field/src/number-field-increment.directive.ts","../../../packages/primitives/number-field/src/number-field-input.directive.ts","../../../packages/primitives/number-field/src/number-field-root.directive.ts","../../../packages/primitives/number-field/index.ts","../../../packages/primitives/number-field/radix-ng-primitives-number-field.ts"],"sourcesContent":["import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport { inject, InjectionToken, InputSignal, InputSignalWithTransform, ModelSignal, Signal } from '@angular/core';\nimport { InputMode } from './types';\n\nexport interface NumberFieldContextToken {\n value: ModelSignal<number | undefined>;\n locale: InputSignal<string>;\n inputMode: Signal<InputMode>;\n textValue: Signal<any>;\n max: InputSignalWithTransform<number | undefined, NumberInput>;\n min: InputSignalWithTransform<number | undefined, NumberInput>;\n onInputElement: (el: HTMLInputElement) => void;\n disabled: InputSignalWithTransform<boolean, BooleanInput>;\n disableWheelChange: InputSignalWithTransform<boolean, BooleanInput>;\n handleIncrease: (multiplier?: number) => void;\n handleDecrease: (multiplier?: number) => void;\n applyInputValue: (val: string) => void;\n validate: (val: string) => boolean;\n setInputValue: (val: string) => void;\n isIncreaseDisabled: Signal<boolean>;\n isDecreaseDisabled: Signal<boolean>;\n handleMinMaxValue: (type: 'min' | 'max') => void;\n}\n\nexport const NUMBER_FIELD_ROOT_CONTEXT = new InjectionToken<NumberFieldContextToken>('NUMBER_FIELD_ROOT_CONTEXT');\n\nexport function injectNumberFieldRootContext(): NumberFieldContextToken {\n return inject(NUMBER_FIELD_ROOT_CONTEXT);\n}\n","import { computed, DestroyRef, effect, inject, Injectable, signal, Signal } from '@angular/core';\nimport { NumberFormatter, NumberParser } from '@internationalized/number';\nimport { fromEvent, Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\n@Injectable()\nexport class PressedHoldService {\n private readonly destroyRef = inject(DestroyRef);\n\n create(options: { target?: Signal<HTMLElement | undefined>; disabled: Signal<boolean> }) {\n const timeout = signal<number | undefined>(undefined);\n const triggerHook = new Subject<void>();\n const isPressed = signal(false);\n\n const resetTimeout = () => {\n const timer = timeout();\n if (timer !== undefined) {\n window.clearTimeout(timer);\n timeout.set(undefined);\n }\n };\n\n const onIncrementPressStart = (delay: number) => {\n resetTimeout();\n if (options.disabled()) return;\n\n triggerHook.next();\n\n timeout.set(\n window.setTimeout(() => {\n onIncrementPressStart(60);\n }, delay)\n );\n };\n\n const onPressStart = (event: PointerEvent) => {\n if (event.button !== 0 || isPressed()) return;\n event.preventDefault();\n isPressed.set(true);\n onIncrementPressStart(400);\n };\n\n const onPressRelease = () => {\n isPressed.set(false);\n resetTimeout();\n };\n\n effect(() => {\n // Skip SSR environments\n if (typeof window === 'undefined') return;\n\n const targetElement = options.target?.() || window;\n const destroy$ = new Subject<void>();\n\n const pointerDownSub = fromEvent(targetElement, 'pointerdown')\n .pipe(takeUntil(destroy$))\n .subscribe((e) => onPressStart(e as PointerEvent));\n\n const pointerUpSub = fromEvent(window, 'pointerup').pipe(takeUntil(destroy$)).subscribe(onPressRelease);\n\n const pointerCancelSub = fromEvent(window, 'pointercancel')\n .pipe(takeUntil(destroy$))\n .subscribe(onPressRelease);\n\n this.destroyRef.onDestroy(() => {\n destroy$.next();\n destroy$.complete();\n pointerDownSub.unsubscribe();\n pointerUpSub.unsubscribe();\n pointerCancelSub.unsubscribe();\n });\n });\n\n return {\n isPressed: isPressed.asReadonly(),\n onTrigger: (fn: () => void) => {\n const sub = triggerHook.subscribe(fn);\n this.destroyRef.onDestroy(() => sub.unsubscribe());\n }\n };\n }\n}\n\nexport function useNumberFormatter(\n locale: Signal<string>,\n options: Signal<Intl.NumberFormatOptions | undefined> = signal({})\n): Signal<NumberFormatter> {\n return computed(() => new NumberFormatter(locale(), options()));\n}\n\nexport function useNumberParser(\n locale: Signal<string>,\n options: Signal<Intl.NumberFormatOptions | undefined> = signal({})\n): Signal<NumberParser> {\n return computed(() => new NumberParser(locale(), options()));\n}\n\nexport function handleDecimalOperation(operator: '-' | '+', value1: number, value2: number): number {\n let result = operator === '+' ? value1 + value2 : value1 - value2;\n\n // Check if we have decimals\n if (value1 % 1 !== 0 || value2 % 1 !== 0) {\n const value1Decimal = value1.toString().split('.');\n const value2Decimal = value2.toString().split('.');\n const value1DecimalLength = (value1Decimal[1] && value1Decimal[1].length) || 0;\n const value2DecimalLength = (value2Decimal[1] && value2Decimal[1].length) || 0;\n const multiplier = 10 ** Math.max(value1DecimalLength, value2DecimalLength);\n\n // Transform the decimals to integers based on the precision\n value1 = Math.round(value1 * multiplier);\n value2 = Math.round(value2 * multiplier);\n\n // Perform the operation on integers values to make sure we don't get a fancy decimal value\n result = operator === '+' ? value1 + value2 : value1 - value2;\n\n // Transform the integer result back to decimal\n result /= multiplier;\n }\n\n return result;\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, ElementRef, inject, input, OnInit, signal } from '@angular/core';\nimport { injectNumberFieldRootContext } from './number-field-context.token';\nimport { PressedHoldService } from './utils';\n\n@Directive({\n selector: 'button[rdxNumberFieldDecrement]',\n providers: [PressedHoldService],\n host: {\n tabindex: '-1',\n type: '\"button\"',\n '[attr.aria-label]': '\"Decrease\"',\n '[attr.disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-pressed]': 'useHold.isPressed() ? \"true\" : undefined',\n\n '[style.user-select]': 'useHold.isPressed() ? \"none\" : null',\n\n '(contextmenu)': '$event.preventDefault()'\n }\n})\nexport class RdxNumberFieldDecrementDirective implements OnInit {\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly pressedHold = inject(PressedHoldService);\n\n protected readonly rootContext = injectNumberFieldRootContext();\n\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * @ignore\n */\n readonly isDisabled = computed(\n () => this.rootContext.disabled() || this.disabled() || this.rootContext.isDecreaseDisabled()\n );\n\n /**\n * @ignore\n */\n readonly useHold = this.pressedHold.create({\n target: signal(this.elementRef.nativeElement),\n disabled: this.disabled\n });\n\n ngOnInit() {\n this.useHold.onTrigger(() => this.rootContext.handleDecrease());\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, ElementRef, inject, input, OnInit, signal } from '@angular/core';\nimport { injectNumberFieldRootContext } from './number-field-context.token';\nimport { PressedHoldService } from './utils';\n\n@Directive({\n selector: 'button[rdxNumberFieldIncrement]',\n providers: [PressedHoldService],\n host: {\n tabindex: '-1',\n type: '\"button\"',\n '[attr.aria-label]': '\"Increase\"',\n '[attr.disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-pressed]': 'useHold.isPressed() ? \"true\" : undefined',\n\n '[style.user-select]': 'useHold.isPressed() ? \"none\" : null',\n\n '(contextmenu)': '$event.preventDefault()'\n }\n})\nexport class RdxNumberFieldIncrementDirective implements OnInit {\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly pressedHold = inject(PressedHoldService);\n\n protected readonly rootContext = injectNumberFieldRootContext();\n\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * @ignore\n */\n readonly isDisabled = computed(\n () => this.rootContext.disabled() || this.disabled() || this.rootContext.isIncreaseDisabled()\n );\n\n /**\n * @ignore\n */\n readonly useHold = this.pressedHold.create({\n target: signal(this.elementRef.nativeElement),\n disabled: this.disabled\n });\n\n ngOnInit() {\n this.useHold.onTrigger(() => this.rootContext.handleIncrease());\n }\n}\n","import { Directive, effect, ElementRef, inject, OnInit, signal } from '@angular/core';\nimport { getActiveElement } from '@radix-ng/primitives/core';\nimport { injectNumberFieldRootContext } from './number-field-context.token';\n\n@Directive({\n selector: 'input[rdxNumberFieldInput]',\n host: {\n role: 'spinbutton',\n type: 'text',\n tabindex: '0',\n autocomplete: 'off',\n autocorrect: 'off',\n spellcheck: 'false',\n 'aria-roledescription': 'Number field',\n\n '[attr.aria-valuenow]': 'rootContext.value()',\n '[attr.aria-valuemin]': 'rootContext.min()',\n '[attr.aria-valuemax]': 'rootContext.max()',\n '[attr.inputmode]': 'rootContext.inputMode()',\n '[attr.disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.value]': 'inputValue()',\n\n '(change)': 'onChange()',\n '(input)': 'onInput($event)',\n '(blur)': 'onKeydownEnter($event)',\n '(beforeinput)': 'onBeforeInput($event)',\n '(keydown.enter)': 'onKeydownEnter($event)',\n '(keydown.arrowUp)': 'onKeydownUp($event)',\n '(keydown.arrowDown)': 'onKeydownDown($event)',\n '(keydown.home)': 'onKeydownHome($event)',\n '(keydown.end)': 'onKeydownEnd($event)',\n '(keydown.pageUp)': 'onKeydownPageUp($event)',\n '(keydown.pageDown)': 'onKeydownPageDown($event)',\n '(wheel)': 'onWheelEvent($event)'\n }\n})\nexport class RdxNumberFieldInputDirective implements OnInit {\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n\n protected readonly rootContext = injectNumberFieldRootContext();\n\n readonly inputValue = signal(this.rootContext.textValue());\n\n constructor() {\n effect(() => {\n this.inputValue.set(this.rootContext.textValue());\n this.rootContext.setInputValue(this.inputValue());\n });\n }\n\n ngOnInit() {\n this.rootContext.onInputElement(this.elementRef.nativeElement as HTMLInputElement);\n }\n\n onBeforeInput(event: InputEvent) {\n const target = event.target as HTMLInputElement;\n const nextValue =\n target.value.slice(0, target.selectionStart ?? undefined) +\n (event.data ?? '') +\n target.value.slice(target.selectionEnd ?? undefined);\n\n if (!this.rootContext.validate(nextValue)) {\n event.preventDefault();\n }\n }\n\n onWheelEvent(event: WheelEvent) {\n if (this.rootContext.disableWheelChange()) {\n return;\n }\n\n // only handle when in focus\n if (event.target !== getActiveElement()) return;\n\n // if on a trackpad, users can scroll in both X and Y at once, check the magnitude of the change\n // if it's mostly in the X direction, then just return, the user probably doesn't mean to inc/dec\n // this isn't perfect, events come in fast with small deltas and a part of the scroll may give a false indication\n // especially if the user is scrolling near 45deg\n if (Math.abs(event.deltaY) <= Math.abs(event.deltaX)) {\n return;\n }\n\n event.preventDefault();\n if (event.deltaY > 0) {\n this.rootContext.handleIncrease();\n } else if (event.deltaY < 0) {\n this.rootContext.handleDecrease();\n }\n }\n\n onKeydownPageUp(event: KeyboardEvent) {\n event.preventDefault();\n this.rootContext.handleIncrease(10);\n }\n\n onKeydownPageDown(event: KeyboardEvent) {\n event.preventDefault();\n this.rootContext.handleDecrease(10);\n }\n\n onKeydownHome(event: KeyboardEvent) {\n event.preventDefault();\n this.rootContext.handleMinMaxValue('min');\n }\n\n onKeydownEnd(event: KeyboardEvent) {\n event.preventDefault();\n this.rootContext.handleMinMaxValue('max');\n }\n\n onInput(event: InputEvent) {\n const target = event.target as HTMLInputElement;\n this.rootContext.applyInputValue(target.value);\n }\n\n onChange() {\n this.inputValue.set(this.rootContext.textValue());\n }\n\n onKeydownEnter(event: KeyboardEvent) {\n const target = event.target as HTMLInputElement;\n this.rootContext.applyInputValue(target.value);\n }\n\n onKeydownUp(event: KeyboardEvent) {\n event.preventDefault();\n this.rootContext.handleIncrease();\n }\n\n onKeydownDown(event: KeyboardEvent) {\n event.preventDefault();\n this.rootContext.handleDecrease();\n }\n}\n","import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, input, model, numberAttribute, OnInit, signal } from '@angular/core';\nimport { clamp, isNullish, provideToken, snapValueToStep } from '@radix-ng/primitives/core';\nimport { NUMBER_FIELD_ROOT_CONTEXT, NumberFieldContextToken } from './number-field-context.token';\nimport { InputMode } from './types';\nimport { handleDecimalOperation, useNumberFormatter, useNumberParser } from './utils';\n\n@Directive({\n selector: '[rdxNumberFieldRoot]',\n exportAs: 'rdxNumberFieldRoot',\n providers: [provideToken(NUMBER_FIELD_ROOT_CONTEXT, RdxNumberFieldRootDirective)],\n host: {\n role: 'group',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined'\n }\n})\nexport class RdxNumberFieldRootDirective implements OnInit, NumberFieldContextToken {\n readonly value = model<number>();\n\n readonly min = input<number | undefined, NumberInput>(undefined, { transform: numberAttribute });\n\n readonly max = input<number | undefined, NumberInput>(undefined, { transform: numberAttribute });\n\n readonly step = input<number, NumberInput>(1, { transform: numberAttribute });\n\n readonly stepSnapping = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly disableWheelChange = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly locale = input<string>('en');\n\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly formatOptions = input<Intl.NumberFormatOptions>();\n\n /**\n * @ignore\n */\n readonly inputEl = signal<HTMLInputElement | undefined>(undefined);\n\n /**\n * @ignore\n */\n readonly isDecreaseDisabled = computed(\n () =>\n !isNullish(this.value()!) &&\n (this.clampInputValue(this.value()!) === this.min() || (this.min() && !isNaN(this.value()!))\n ? handleDecimalOperation('-', this.value()!, this.step()) < this.min()!\n : false)\n );\n\n /**\n * @ignore\n */\n readonly isIncreaseDisabled = computed(\n () =>\n !isNullish(this.value()!) &&\n (this.clampInputValue(this.value()!) === this.max() || (this.min() && !isNaN(this.value()!))\n ? handleDecimalOperation('+', this.value()!, this.step()) > this.max()!\n : false)\n );\n\n /**\n * @ignore\n */\n readonly inputMode = computed<InputMode>(() => {\n // The inputMode attribute influences the software keyboard that is shown on touch devices.\n // Browsers and operating systems are quite inconsistent about what keys are available, however.\n // We choose between numeric and decimal based on whether we allow negative and fractional numbers,\n // and based on testing on various devices to determine what keys are available in each inputMode.\n const hasDecimals = this.numberFormatter().resolvedOptions().maximumFractionDigits! > 0;\n\n return hasDecimals ? 'decimal' : 'numeric';\n });\n\n /**\n * Replace negative textValue formatted using currencySign: 'accounting'\n * with a textValue that can be announced using a minus sign.\n * @ignore\n */\n readonly textValue = computed(() =>\n isNullish(this.value()!) || isNaN(this.value()!) ? '' : this.textValueFormatter().format(this.value())\n );\n\n /**\n * @ignore\n */\n readonly onInputElement = (el: HTMLInputElement) => this.inputEl.set(el);\n\n /**\n * @ignore\n */\n numberParser: any;\n /**\n * @ignore\n */\n numberFormatter: any;\n /**\n * @ignore\n */\n textValueFormatter: any;\n\n /**\n * @ignore\n */\n clampInputValue(val: number) {\n // Clamp to min and max, round to the nearest step, and round to the specified number of digits\n let clampedValue: number;\n if (this.step() === undefined || isNaN(this.step()) || !this.stepSnapping()) {\n clampedValue = clamp(val, this.min(), this.max());\n } else {\n clampedValue = snapValueToStep(val, this.min(), this.max(), this.step());\n }\n\n clampedValue = this.numberParser().parse(this.numberFormatter().format(clampedValue));\n return clampedValue;\n }\n\n ngOnInit() {\n this.numberParser = useNumberParser(this.locale, this.formatOptions);\n this.numberFormatter = useNumberFormatter(this.locale, this.formatOptions);\n this.textValueFormatter = useNumberFormatter(this.locale, this.formatOptions);\n }\n\n /**\n * @ignore\n */\n handleMinMaxValue(type: 'min' | 'max') {\n if (type === 'min' && this.min() !== undefined) {\n this.value.set(this.clampInputValue(this.min()!));\n } else if (type === 'max' && this.max() !== undefined) {\n this.value.set(this.clampInputValue(this.max()!));\n }\n }\n\n /**\n * @ignore\n */\n handleDecrease(multiplier = 1) {\n this.handleChangingValue('decrease', multiplier);\n }\n\n /**\n * @ignore\n */\n handleIncrease(multiplier = 1) {\n this.handleChangingValue('increase', multiplier);\n }\n\n /**\n * @ignore\n */\n applyInputValue(val: string) {\n const parsedValue = this.numberParser().parse(val);\n\n this.value.set(isNaN(parsedValue) ? undefined : this.clampInputValue(parsedValue));\n\n // Set to empty state if input value is empty\n if (!val.length) {\n return this.setInputValue(val);\n }\n\n // if it failed to parse, then reset input to formatted version of current number\n if (isNaN(parsedValue)) {\n return this.setInputValue(this.textValue());\n }\n\n return this.setInputValue(this.textValue());\n }\n\n /**\n * @ignore\n */\n setInputValue(val: string) {\n if (this.inputEl()) {\n this.inputEl.update((el) => {\n if (el) el.value = val;\n return el;\n });\n }\n }\n\n /**\n * @ignore\n */\n validate(val: string) {\n return this.numberParser().isValidPartialNumber(val, this.min(), this.max());\n }\n\n private handleChangingValue(type: 'increase' | 'decrease', multiplier = 1) {\n this.inputEl()?.focus();\n const currentInputValue = this.numberParser().parse(this.inputEl()?.value ?? '');\n\n if (this.disabled()) {\n return;\n }\n\n if (isNaN(currentInputValue)) {\n this.value.set(this.min() ?? 0);\n } else {\n if (type === 'increase') {\n this.value.set(this.clampInputValue(currentInputValue + (this.step() ?? 1) * multiplier));\n } else {\n this.value.set(this.clampInputValue(currentInputValue - (this.step() ?? 1) * multiplier));\n }\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RdxNumberFieldDecrementDirective } from './src/number-field-decrement.directive';\nimport { RdxNumberFieldIncrementDirective } from './src/number-field-increment.directive';\nimport { RdxNumberFieldInputDirective } from './src/number-field-input.directive';\nimport { RdxNumberFieldRootDirective } from './src/number-field-root.directive';\n\nexport * from './src/number-field-context.token';\nexport * from './src/number-field-decrement.directive';\nexport * from './src/number-field-increment.directive';\nexport * from './src/number-field-input.directive';\nexport * from './src/number-field-root.directive';\nexport * from './src/types';\nexport * from './src/utils';\n\nconst _imports = [\n RdxNumberFieldRootDirective,\n RdxNumberFieldInputDirective,\n RdxNumberFieldIncrementDirective,\n RdxNumberFieldDecrementDirective\n];\n\n@NgModule({\n imports: [..._imports],\n exports: [..._imports]\n})\nexport class RdxNumberFieldModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAwBa,yBAAyB,GAAG,IAAI,cAAc,CAA0B,2BAA2B;SAEhG,4BAA4B,GAAA;AACxC,IAAA,OAAO,MAAM,CAAC,yBAAyB,CAAC;AAC5C;;MCtBa,kBA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CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,YAV7B,2BAA2B;YAC3B,4BAA4B;YAC5B,gCAAgC;AAChC,YAAA,gCAAgC,aAHhC,2BAA2B;YAC3B,4BAA4B;YAC5B,gCAAgC;YAChC,gCAAgC,CAAA,EAAA,CAAA,CAAA;+GAOvB,oBAAoB,EAAA,CAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ,CAAC;AACtB,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ;AACxB,iBAAA;;;ACxBD;;AAEG;;;;"}
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, inject, input, computed, signal, effect, Directive, ElementRef, model, booleanAttribute, linkedSignal, NgModule } from '@angular/core';
3
- import { useDateField, getDefaultTime, isNullish, isBefore, createContent, watch, createFormatter, initializeSegmentValues, syncSegmentValues, getSegmentElements, isSegmentNavigationKey, ARROW_LEFT, ARROW_RIGHT, provideToken } from '@radix-ng/primitives/core';
3
+ import { useDateField, normalizeDateStep, getDefaultTime, isNullish, isBefore, createContent, watch, createFormatter, normalizeHourCycle, initializeSegmentValues, syncSegmentValues, getSegmentElements, isSegmentNavigationKey, ARROW_LEFT, ARROW_RIGHT, provideToken } from '@radix-ng/primitives/core';
4
4
  import { today, toCalendarDateTime, getLocalTimeZone, isEqualDay } from '@internationalized/date';
5
5
 
6
6
  const TIME_FIELDS_ROOT_CONTEXT = new InjectionToken('TIME_FIELDS_ROOT_CONTEXT');
@@ -49,7 +49,8 @@ class RdxTimeFieldInputDirective {
49
49
  disabled: this.rootContext.disabled,
50
50
  readonly: this.rootContext.readonly,
51
51
  modelValue: this.rootContext.convertedModelValue,
52
- focusNext: this.rootContext.focusNext
52
+ focusNext: this.rootContext.focusNext,
53
+ step: this.rootContext.step$
53
54
  });
54
55
  });
55
56
  this.attributes = computed(() => this.fieldData().attributes());
@@ -143,6 +144,11 @@ class RdxTimeFieldRootDirective {
143
144
  * Whether or not the field is readonly.
144
145
  */
145
146
  this.readonly = input(false, { transform: booleanAttribute });
147
+ /**
148
+ * The stepping interval for the time fields. Defaults to 1
149
+ */
150
+ this.step = input();
151
+ this.step$ = computed(() => normalizeDateStep(this.step()));
146
152
  /**
147
153
  * @ignore
148
154
  */
@@ -279,7 +285,9 @@ class RdxTimeFieldRootDirective {
279
285
  defaultValue: this.value()
280
286
  });
281
287
  this.placeholder.set(defDate.copy());
282
- this.formatter = createFormatter(this.locale());
288
+ this.formatter = createFormatter(this.locale(), {
289
+ hourCycle: normalizeHourCycle(this.hourCycle())
290
+ });
283
291
  const initialSegments = initializeSegmentValues(this.inferredGranularity());
284
292
  this.segmentValues.set(this.value()
285
293
  ? { ...syncSegmentValues({ value: this.value(), formatter: this.formatter }) }
@@ -309,7 +317,7 @@ class RdxTimeFieldRootDirective {
309
317
  this.currentFocusedElement.set(el);
310
318
  }
311
319
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxTimeFieldRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
312
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.4", type: RdxTimeFieldRootDirective, isStandalone: true, selector: "[rdxTimeFieldRoot]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, hourCycle: { classPropertyName: "hourCycle", publicName: "hourCycle", isSignal: true, isRequired: false, transformFunction: null }, granularity: { classPropertyName: "granularity", publicName: "granularity", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, minValue: { classPropertyName: "minValue", publicName: "minValue", isSignal: true, isRequired: false, transformFunction: null }, maxValue: { classPropertyName: "maxValue", publicName: "maxValue", isSignal: true, isRequired: false, transformFunction: null }, hideTimeZone: { classPropertyName: "hideTimeZone", publicName: "hideTimeZone", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", placeholder: "placeholderChange" }, host: { attributes: { "role": "group" }, listeners: { "keydown": "onKeydown($event)" }, properties: { "attr.aria-disabled": "disabled() ? \"\" : undefined", "attr.data-disabled": "disabled() ? \"\" : undefined", "attr.data-readonly": "readonly() ? \"\" : undefined", "attr.data-invalid": "isInvalid() ? \"\" : undefined", "attr.dir": "dir()" } }, providers: [provideToken(TIME_FIELDS_ROOT_CONTEXT, RdxTimeFieldRootDirective)], exportAs: ["rdxTimeFieldRoot"], ngImport: i0 }); }
320
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.4", type: RdxTimeFieldRootDirective, isStandalone: true, selector: "[rdxTimeFieldRoot]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, hourCycle: { classPropertyName: "hourCycle", publicName: "hourCycle", isSignal: true, isRequired: false, transformFunction: null }, granularity: { classPropertyName: "granularity", publicName: "granularity", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, minValue: { classPropertyName: "minValue", publicName: "minValue", isSignal: true, isRequired: false, transformFunction: null }, maxValue: { classPropertyName: "maxValue", publicName: "maxValue", isSignal: true, isRequired: false, transformFunction: null }, hideTimeZone: { classPropertyName: "hideTimeZone", publicName: "hideTimeZone", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", placeholder: "placeholderChange" }, host: { attributes: { "role": "group" }, listeners: { "keydown": "onKeydown($event)" }, properties: { "attr.aria-disabled": "disabled() ? \"\" : undefined", "attr.data-disabled": "disabled() ? \"\" : undefined", "attr.data-readonly": "readonly() ? \"\" : undefined", "attr.data-invalid": "isInvalid() ? \"\" : undefined", "attr.dir": "dir()" } }, providers: [provideToken(TIME_FIELDS_ROOT_CONTEXT, RdxTimeFieldRootDirective)], exportAs: ["rdxTimeFieldRoot"], ngImport: i0 }); }
313
321
  }
314
322
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxTimeFieldRootDirective, decorators: [{
315
323
  type: Directive,