@radix-ng/primitives 0.34.0 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/calendar/src/calendar-root.directive.d.ts +3 -3
  2. package/core/index.d.ts +3 -0
  3. package/core/src/accessor/provide-value-accessor.d.ts +1 -1
  4. package/core/src/clamp.d.ts +38 -0
  5. package/core/src/date-time/index.d.ts +3 -0
  6. package/core/src/date-time/parser.d.ts +37 -0
  7. package/core/src/date-time/parts.d.ts +12 -0
  8. package/core/src/date-time/segment.d.ts +4 -0
  9. package/core/src/date-time/types.d.ts +18 -1
  10. package/core/src/date-time/useDateField.d.ts +141 -0
  11. package/core/src/date-time/utils.d.ts +3 -0
  12. package/core/src/getActiveElement.d.ts +1 -0
  13. package/core/src/provide-token.d.ts +22 -0
  14. package/date-field/README.md +1 -0
  15. package/date-field/index.d.ts +11 -0
  16. package/date-field/src/date-field-context.token.d.ts +18 -0
  17. package/date-field/src/date-field-input.directive.d.ts +53 -0
  18. package/date-field/src/date-field-root.directive.d.ts +126 -0
  19. package/dialog/src/dialog-ref.d.ts +3 -0
  20. package/dialog/src/dialog.config.d.ts +1 -0
  21. package/fesm2022/radix-ng-primitives-calendar.mjs +6 -15
  22. package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
  23. package/fesm2022/radix-ng-primitives-checkbox.mjs +3 -4
  24. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  25. package/fesm2022/radix-ng-primitives-core.mjs +1097 -8
  26. package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
  27. package/fesm2022/radix-ng-primitives-date-field.mjs +334 -0
  28. package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -0
  29. package/fesm2022/radix-ng-primitives-dialog.mjs +54 -4
  30. package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
  31. package/fesm2022/radix-ng-primitives-navigation-menu.mjs +0 -2
  32. package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
  33. package/fesm2022/radix-ng-primitives-number-field.mjs +502 -0
  34. package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -0
  35. package/fesm2022/radix-ng-primitives-progress.mjs +3 -3
  36. package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
  37. package/fesm2022/radix-ng-primitives-radio.mjs +7 -7
  38. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  39. package/fesm2022/radix-ng-primitives-switch.mjs +7 -15
  40. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  41. package/fesm2022/radix-ng-primitives-tabs.mjs +3 -6
  42. package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
  43. package/fesm2022/radix-ng-primitives-toggle-group.mjs +8 -10
  44. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  45. package/fesm2022/radix-ng-primitives-toggle.mjs +5 -12
  46. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  47. package/hover-card/src/hover-card-root.directive.d.ts +4 -4
  48. package/number-field/README.md +1 -0
  49. package/number-field/index.d.ts +17 -0
  50. package/number-field/src/number-field-context.token.d.ts +24 -0
  51. package/number-field/src/number-field-decrement.directive.d.ts +23 -0
  52. package/number-field/src/number-field-increment.directive.d.ts +23 -0
  53. package/number-field/src/number-field-input.directive.d.ts +22 -0
  54. package/number-field/src/number-field-root.directive.d.ts +86 -0
  55. package/number-field/src/types.d.ts +1 -0
  56. package/number-field/src/utils.d.ts +18 -0
  57. package/package.json +9 -1
  58. package/popover/src/popover-root.directive.d.ts +4 -4
  59. package/switch/src/switch-root.directive.d.ts +0 -1
  60. package/toggle/src/toggle.directive.d.ts +0 -1
  61. package/tooltip/src/tooltip-root.directive.d.ts +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-toggle-group.mjs","sources":["../../../packages/primitives/toggle-group/src/toggle-group-item.token.ts","../../../packages/primitives/toggle-group/src/toggle-group.token.ts","../../../packages/primitives/toggle-group/src/toggle-group-item.directive.ts","../../../packages/primitives/toggle-group/src/toggle-group-without-focus.directive.ts","../../../packages/primitives/toggle-group/src/toggle-group.directive.ts","../../../packages/primitives/toggle-group/radix-ng-primitives-toggle-group.ts"],"sourcesContent":["import { inject, InjectionToken } from '@angular/core';\nimport type { RdxToggleGroupItemDirective } from './toggle-group-item.directive';\n\nexport const RdxToggleGroupItemToken = new InjectionToken<RdxToggleGroupItemDirective>('RdxToggleGroupItemToken');\n\nexport function injectToggleGroupItem(): RdxToggleGroupItemDirective {\n return inject(RdxToggleGroupItemToken);\n}\n","import { inject, InjectionToken } from '@angular/core';\n\nexport interface IRdxToggleGroup {\n toggle(value: string): void;\n\n disabled: any;\n value: any;\n type: any;\n}\n\nexport const RdxToggleGroupToken = new InjectionToken<IRdxToggleGroup>('RdxToggleGroupToken');\n\nexport function injectToggleGroup(): IRdxToggleGroup {\n return inject(RdxToggleGroupToken);\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, effect, inject, input } from '@angular/core';\nimport { RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';\nimport { RdxToggleDirective } from '@radix-ng/primitives/toggle';\nimport { RdxToggleGroupItemToken } from './toggle-group-item.token';\nimport { injectToggleGroup } from './toggle-group.token';\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxToggleGroupItem]',\n exportAs: 'rdxToggleGroupItem',\n standalone: true,\n providers: [{ provide: RdxToggleGroupItemToken, useExisting: RdxToggleGroupItemDirective }],\n hostDirectives: [\n {\n directive: RdxRovingFocusItemDirective,\n inputs: ['focusable', 'active', 'allowShiftKey']\n },\n {\n directive: RdxToggleDirective,\n inputs: ['pressed', 'disabled']\n }\n ],\n host: {\n '(click)': 'toggle()'\n }\n})\nexport class RdxToggleGroupItemDirective {\n private readonly rdxToggleDirective = inject(RdxToggleDirective);\n\n private readonly rdxRovingFocusItemDirective = inject(RdxRovingFocusItemDirective);\n\n /**\n * Access the toggle group.\n * @ignore\n */\n protected readonly rootContext = injectToggleGroup();\n\n /**\n * The value of this toggle button.\n *\n * @group Props\n */\n readonly value = input.required<string>();\n\n /**\n * Whether this toggle button is disabled.\n * @defaultValue false\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n private readonly isPressed = computed(() => {\n return this.rootContext.type() === 'single'\n ? this.rootContext.value() === this.value()\n : this.rootContext.value()?.includes(this.value());\n });\n\n private readonly isDisabled = computed(() => this.rootContext.disabled() || this.disabled());\n\n constructor() {\n effect(() => {\n this.rdxToggleDirective.pressed.set(!!this.isPressed());\n this.rdxToggleDirective.disabledModel.set(this.isDisabled());\n\n this.rdxRovingFocusItemDirective.active = !!this.isPressed();\n });\n }\n\n /**\n * @ignore\n */\n toggle(): void {\n if (this.disabled()) {\n return;\n }\n\n this.rootContext.toggle(this.value());\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, model, output, signal } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { RdxToggleGroupToken } from './toggle-group.token';\n\nlet nextId = 0;\n\n@Directive({\n selector: '[rdxToggleGroupWithoutFocus]',\n exportAs: 'rdxToggleGroupWithoutFocus',\n standalone: true,\n providers: [\n { provide: RdxToggleGroupToken, useExisting: RdxToggleGroupWithoutFocusDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxToggleGroupWithoutFocusDirective, multi: true }\n ],\n host: {\n role: 'group',\n '(focusout)': 'onTouched?.()'\n }\n})\nexport class RdxToggleGroupWithoutFocusDirective implements ControlValueAccessor {\n /**\n * @ignore\n */\n readonly id: string = `rdx-toggle-group-${nextId++}`;\n\n /**\n * @group Props\n */\n readonly value = model<string | string[] | undefined>(undefined);\n\n /**\n * @group Props\n */\n readonly type = input<'single' | 'multiple'>('single');\n\n /**\n * Whether the toggle group is disabled.\n * @defaultValue false\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Event emitted when the selected toggle button changes.\n * @group Emits\n */\n readonly onValueChange = output<string[] | string | undefined>();\n\n /**\n * The value change callback.\n */\n private onChange?: (value: string | string[] | undefined) => void;\n\n /**\n * onTouch function registered via registerOnTouch (ControlValueAccessor).\n */\n protected onTouched?: () => void;\n\n /**\n * Toggle a value.\n * @param value The value to toggle.\n * @ignore\n */\n toggle(value: string): void {\n if (this.disabled()) {\n return;\n }\n\n if (this.type() === 'single') {\n this.value.set(value);\n } else {\n this.value.set(\n ((currentValue) =>\n currentValue && Array.isArray(currentValue)\n ? currentValue.includes(value)\n ? currentValue.filter((v) => v !== value) // delete\n : [...currentValue, value] // update\n : [value])(this.value())\n );\n }\n\n this.onValueChange.emit(this.value());\n this.onChange?.(this.value());\n }\n\n /**\n * Select a value from Angular forms.\n * @param value The value to select.\n * @ignore\n */\n writeValue(value: string): void {\n this.value.set(value);\n }\n\n /**\n * Register a callback to be called when the value changes.\n * @param fn The callback to register.\n * @ignore\n */\n registerOnChange(fn: (value: string | string[] | undefined) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Register a callback to be called when the toggle group is touched.\n * @param fn The callback to register.\n * @ignore\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n private readonly accessorDisabled = signal(false);\n\n /**\n * Set the disabled state of the toggle group.\n * @param isDisabled Whether the toggle group is disabled.\n * @ignore\n */\n setDisabledState(isDisabled: boolean): void {\n this.accessorDisabled.set(isDisabled);\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, forwardRef, input, model, output, signal } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { RdxRovingFocusGroupDirective } from '@radix-ng/primitives/roving-focus';\nimport { RdxToggleGroupToken } from './toggle-group.token';\n\nlet nextId = 0;\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxToggleGroup]',\n exportAs: 'rdxToggleGroup',\n providers: [\n { provide: RdxToggleGroupToken, useExisting: forwardRef(() => RdxToggleGroupDirective) },\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => RdxToggleGroupDirective), multi: true }\n ],\n hostDirectives: [{ directive: RdxRovingFocusGroupDirective, inputs: ['dir', 'orientation', 'loop'] }],\n host: {\n role: 'group',\n\n '(focusout)': 'onTouched?.()'\n }\n})\nexport class RdxToggleGroupDirective implements ControlValueAccessor {\n /**\n * @ignore\n */\n readonly id: string = `rdx-toggle-group-${nextId++}`;\n\n /**\n * @group Props\n */\n readonly value = model<string | string[] | undefined>(undefined);\n\n /**\n * @group Props\n */\n readonly type = input<'single' | 'multiple'>('single');\n\n /**\n * Whether the toggle group is disabled.\n * @defaultValue false\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Event emitted when the selected toggle button changes.\n * @group Emits\n */\n readonly onValueChange = output<string[] | string | undefined>();\n\n /**\n * The value change callback.\n */\n private onChange?: (value: string | string[] | undefined) => void;\n\n /**\n * onTouch function registered via registerOnTouch (ControlValueAccessor).\n */\n protected onTouched?: () => void;\n\n /**\n * Toggle a value.\n * @param value The value to toggle.\n * @ignore\n */\n toggle(value: string): void {\n if (this.disabled()) {\n return;\n }\n\n if (this.type() === 'single') {\n this.value.set(value);\n } else {\n this.value.set(\n ((currentValue) =>\n currentValue && Array.isArray(currentValue)\n ? currentValue.includes(value)\n ? currentValue.filter((v) => v !== value) // delete\n : [...currentValue, value] // update\n : [value])(this.value())\n );\n }\n\n this.onValueChange.emit(this.value());\n this.onChange?.(this.value());\n }\n\n /**\n * Select a value from Angular forms.\n * @param value The value to select.\n * @ignore\n */\n writeValue(value: string): void {\n this.value.set(value);\n }\n\n /**\n * Register a callback to be called when the value changes.\n * @param fn The callback to register.\n * @ignore\n */\n registerOnChange(fn: (value: string | string[] | undefined) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Register a callback to be called when the toggle group is touched.\n * @param fn The callback to register.\n * @ignore\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n private readonly accessorDisabled = signal(false);\n /**\n * Set the disabled state of the toggle group.\n * @param isDisabled Whether the toggle group is disabled.\n * @ignore\n */\n setDisabledState(isDisabled: boolean): void {\n this.accessorDisabled.set(isDisabled);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["nextId"],"mappings":";;;;;;;;MAGa,uBAAuB,GAAG,IAAI,cAAc,CAA8B,yBAAyB;SAEhG,qBAAqB,GAAA;AACjC,IAAA,OAAO,MAAM,CAAC,uBAAuB,CAAC;AAC1C;;MCGa,mBAAmB,GAAG,IAAI,cAAc,CAAkB,qBAAqB;SAE5E,iBAAiB,GAAA;AAC7B,IAAA,OAAO,MAAM,CAAC,mBAAmB,CAAC;AACtC;;ACPA;;AAEG;MAoBU,2BAA2B,CAAA;AAiCpC,IAAA,WAAA,GAAA;AAhCiB,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAE/C,QAAA,IAAA,CAAA,2BAA2B,GAAG,MAAM,CAAC,2BAA2B,CAAC;AAElF;;;AAGG;QACgB,IAAW,CAAA,WAAA,GAAG,iBAAiB,EAAE;AAEpD;;;;AAIG;AACM,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAU;AAEzC;;;;AAIG;QACM,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAwB,KAAK,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;AAEvE,QAAA,IAAA,CAAA,SAAS,GAAG,QAAQ,CAAC,MAAK;AACvC,YAAA,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK;kBAC7B,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,IAAI,CAAC,KAAK;AACzC,kBAAE,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,EAAE,QAAQ,CAAC,IAAI,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,EAAA,CAAA,gBAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,4BAAA,EAAA,MAAA,EAAA,CAAA,KAAA,EAAA,KAAA,EAAA,aAAA,EAAA,aAAA,EAAA,MAAA,EAAA,MAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAQQ,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAdnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,SAAS,EAAE;AACP,wBAAA,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,UAAU,CAAC,MAA6B,uBAAA,CAAC,EAAE;AACxF,wBAAA,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,6BAA6B,CAAC,EAAE,KAAK,EAAE,IAAI;AACpG,qBAAA;AACD,oBAAA,cAAc,EAAE,CAAC,EAAE,SAAS,EAAE,4BAA4B,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,CAAC;AACrG,oBAAA,IAAI,EAAE;AACF,wBAAA,IAAI,EAAE,OAAO;AAEb,wBAAA,YAAY,EAAE;AACjB;AACJ,iBAAA;;;ACxBD;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-toggle-group.mjs","sources":["../../../packages/primitives/toggle-group/src/toggle-group-item.token.ts","../../../packages/primitives/toggle-group/src/toggle-group.token.ts","../../../packages/primitives/toggle-group/src/toggle-group-item.directive.ts","../../../packages/primitives/toggle-group/src/toggle-group-without-focus.directive.ts","../../../packages/primitives/toggle-group/src/toggle-group.directive.ts","../../../packages/primitives/toggle-group/radix-ng-primitives-toggle-group.ts"],"sourcesContent":["import { inject, InjectionToken } from '@angular/core';\nimport type { RdxToggleGroupItemDirective } from './toggle-group-item.directive';\n\nexport const RdxToggleGroupItemToken = new InjectionToken<RdxToggleGroupItemDirective>('RdxToggleGroupItemToken');\n\nexport function injectToggleGroupItem(): RdxToggleGroupItemDirective {\n return inject(RdxToggleGroupItemToken);\n}\n","import { inject, InjectionToken } from '@angular/core';\n\nexport interface IRdxToggleGroup {\n toggle(value: string): void;\n disabled: any;\n value: any;\n type: any;\n}\n\nexport const RdxToggleGroupToken = new InjectionToken<IRdxToggleGroup>('RdxToggleGroupToken');\n\nexport function injectToggleGroup(): IRdxToggleGroup {\n return inject(RdxToggleGroupToken);\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, effect, inject, input } from '@angular/core';\nimport { RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';\nimport { RdxToggleDirective } from '@radix-ng/primitives/toggle';\nimport { RdxToggleGroupItemToken } from './toggle-group-item.token';\nimport { injectToggleGroup } from './toggle-group.token';\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxToggleGroupItem]',\n exportAs: 'rdxToggleGroupItem',\n providers: [{ provide: RdxToggleGroupItemToken, useExisting: RdxToggleGroupItemDirective }],\n hostDirectives: [\n {\n directive: RdxRovingFocusItemDirective,\n inputs: ['focusable', 'active', 'allowShiftKey']\n },\n {\n directive: RdxToggleDirective,\n inputs: ['pressed', 'disabled']\n }\n ],\n host: {\n '(click)': 'toggle()'\n }\n})\nexport class RdxToggleGroupItemDirective {\n private readonly rdxToggleDirective = inject(RdxToggleDirective);\n\n private readonly rdxRovingFocusItemDirective = inject(RdxRovingFocusItemDirective);\n\n /**\n * Access the toggle group.\n * @ignore\n */\n protected readonly rootContext = injectToggleGroup();\n\n /**\n * The value of this toggle button.\n *\n * @group Props\n */\n readonly value = input.required<string>();\n\n /**\n * Whether this toggle button is disabled.\n * @defaultValue false\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n private readonly isPressed = computed(() => {\n return this.rootContext.type() === 'single'\n ? this.rootContext.value() === this.value()\n : this.rootContext.value()?.includes(this.value());\n });\n\n private readonly isDisabled = computed(() => this.rootContext.disabled() || this.disabled());\n\n constructor() {\n effect(() => {\n this.rdxToggleDirective.pressed.set(!!this.isPressed());\n this.rdxToggleDirective.disabledModel.set(this.isDisabled());\n\n this.rdxRovingFocusItemDirective.active = !!this.isPressed();\n });\n }\n\n /**\n * @ignore\n */\n toggle(): void {\n if (this.disabled()) {\n return;\n }\n\n this.rootContext.toggle(this.value());\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, model, output, signal } from '@angular/core';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { provideValueAccessor } from '@radix-ng/primitives/core';\nimport { RdxToggleGroupToken } from './toggle-group.token';\n\nlet nextId = 0;\n\n@Directive({\n selector: '[rdxToggleGroupWithoutFocus]',\n exportAs: 'rdxToggleGroupWithoutFocus',\n providers: [\n { provide: RdxToggleGroupToken, useExisting: RdxToggleGroupWithoutFocusDirective },\n provideValueAccessor(RdxToggleGroupWithoutFocusDirective)],\n host: {\n role: 'group',\n '(focusout)': 'onTouched?.()'\n }\n})\nexport class RdxToggleGroupWithoutFocusDirective implements ControlValueAccessor {\n /**\n * @ignore\n */\n readonly id: string = `rdx-toggle-group-${nextId++}`;\n\n /**\n * @group Props\n */\n readonly value = model<string | string[] | undefined>(undefined);\n\n /**\n * @group Props\n */\n readonly type = input<'single' | 'multiple'>('single');\n\n /**\n * Whether the toggle group is disabled.\n * @defaultValue false\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Event emitted when the selected toggle button changes.\n * @group Emits\n */\n readonly onValueChange = output<string[] | string | undefined>();\n\n /**\n * The value change callback.\n */\n private onChange?: (value: string | string[] | undefined) => void;\n\n /**\n * onTouch function registered via registerOnTouch (ControlValueAccessor).\n */\n protected onTouched?: () => void;\n\n /**\n * Toggle a value.\n * @param value The value to toggle.\n * @ignore\n */\n toggle(value: string): void {\n if (this.disabled()) {\n return;\n }\n\n if (this.type() === 'single') {\n this.value.set(value);\n } else {\n this.value.set(\n ((currentValue) =>\n currentValue && Array.isArray(currentValue)\n ? currentValue.includes(value)\n ? currentValue.filter((v) => v !== value) // delete\n : [...currentValue, value] // update\n : [value])(this.value())\n );\n }\n\n this.onValueChange.emit(this.value());\n this.onChange?.(this.value());\n }\n\n /**\n * Select a value from Angular forms.\n * @param value The value to select.\n * @ignore\n */\n writeValue(value: string): void {\n this.value.set(value);\n }\n\n /**\n * Register a callback to be called when the value changes.\n * @param fn The callback to register.\n * @ignore\n */\n registerOnChange(fn: (value: string | string[] | undefined) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Register a callback to be called when the toggle group is touched.\n * @param fn The callback to register.\n * @ignore\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n private readonly accessorDisabled = signal(false);\n\n /**\n * Set the disabled state of the toggle group.\n * @param isDisabled Whether the toggle group is disabled.\n * @ignore\n */\n setDisabledState(isDisabled: boolean): void {\n this.accessorDisabled.set(isDisabled);\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, model, output, signal } from '@angular/core';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { provideToken, provideValueAccessor } from '@radix-ng/primitives/core';\nimport { RdxRovingFocusGroupDirective } from '@radix-ng/primitives/roving-focus';\nimport { RdxToggleGroupToken } from './toggle-group.token';\n\nlet nextId = 0;\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxToggleGroup]',\n exportAs: 'rdxToggleGroup',\n providers: [\n provideToken(RdxToggleGroupToken, RdxToggleGroupDirective),\n provideValueAccessor(RdxToggleGroupDirective)],\n hostDirectives: [{ directive: RdxRovingFocusGroupDirective, inputs: ['dir', 'orientation', 'loop'] }],\n host: {\n role: 'group',\n\n '(focusout)': 'onTouched?.()'\n }\n})\nexport class RdxToggleGroupDirective implements ControlValueAccessor {\n /**\n * @ignore\n */\n readonly id: string = `rdx-toggle-group-${nextId++}`;\n\n /**\n * @group Props\n */\n readonly value = model<string | string[] | undefined>(undefined);\n\n /**\n * @group Props\n */\n readonly type = input<'single' | 'multiple'>('single');\n\n /**\n * Whether the toggle group is disabled.\n * @defaultValue false\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Event emitted when the selected toggle button changes.\n * @group Emits\n */\n readonly onValueChange = output<string[] | string | undefined>();\n\n /**\n * The value change callback.\n */\n private onChange?: (value: string | string[] | undefined) => void;\n\n /**\n * onTouch function registered via registerOnTouch (ControlValueAccessor).\n */\n protected onTouched?: () => void;\n\n /**\n * Toggle a value.\n * @param value The value to toggle.\n * @ignore\n */\n toggle(value: string): void {\n if (this.disabled()) {\n return;\n }\n\n if (this.type() === 'single') {\n this.value.set(value);\n } else {\n this.value.set(\n ((currentValue) =>\n currentValue && Array.isArray(currentValue)\n ? currentValue.includes(value)\n ? currentValue.filter((v) => v !== value) // delete\n : [...currentValue, value] // update\n : [value])(this.value())\n );\n }\n\n this.onValueChange.emit(this.value());\n this.onChange?.(this.value());\n }\n\n /**\n * Select a value from Angular forms.\n * @param value The value to select.\n * @ignore\n */\n writeValue(value: string): void {\n this.value.set(value);\n }\n\n /**\n * Register a callback to be called when the value changes.\n * @param fn The callback to register.\n * @ignore\n */\n registerOnChange(fn: (value: string | string[] | undefined) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Register a callback to be called when the toggle group is touched.\n * @param fn The callback to register.\n * @ignore\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n private readonly accessorDisabled = signal(false);\n /**\n * Set the disabled state of the toggle group.\n * @param isDisabled Whether the toggle group is disabled.\n * @ignore\n */\n setDisabledState(isDisabled: boolean): void {\n this.accessorDisabled.set(isDisabled);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["nextId"],"mappings":";;;;;;;;MAGa,uBAA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E,MAAM,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,CAAC;AACrG,oBAAA,IAAI,EAAE;AACF,wBAAA,IAAI,EAAE,OAAO;AAEb,wBAAA,YAAY,EAAE;AACjB;AACJ,iBAAA;;;ACxBD;;AAEG;;;;"}
@@ -1,8 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, forwardRef, input, booleanAttribute, model, computed, output, signal } from '@angular/core';
2
+ import { Directive, input, booleanAttribute, model, computed, output, signal } from '@angular/core';
3
3
  import * as i1 from '@radix-ng/primitives/visually-hidden';
4
4
  import { RdxVisuallyHiddenInputDirective } from '@radix-ng/primitives/visually-hidden';
5
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
5
+ import { provideValueAccessor } from '@radix-ng/primitives/core';
6
6
 
7
7
  class RdxToggleVisuallyHiddenInputDirective {
8
8
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxToggleVisuallyHiddenInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
@@ -13,7 +13,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
13
13
  args: [{
14
14
  selector: 'input[rdxToggleVisuallyHiddenInput]',
15
15
  exportAs: 'rdxToggleVisuallyHiddenInput',
16
- standalone: true,
17
16
  hostDirectives: [
18
17
  {
19
18
  directive: RdxVisuallyHiddenInputDirective,
@@ -31,11 +30,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
31
30
  }]
32
31
  }] });
33
32
 
34
- const TOGGLE_VALUE_ACCESSOR = {
35
- provide: NG_VALUE_ACCESSOR,
36
- useExisting: forwardRef(() => RdxToggleDirective),
37
- multi: true
38
- };
39
33
  /**
40
34
  * @group Components
41
35
  */
@@ -101,15 +95,14 @@ class RdxToggleDirective {
101
95
  this.accessorDisabled.set(isDisabled);
102
96
  }
103
97
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxToggleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
104
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.4", type: RdxToggleDirective, isStandalone: true, selector: "[rdxToggle]", inputs: { defaultPressed: { classPropertyName: "defaultPressed", publicName: "defaultPressed", isSignal: true, isRequired: false, transformFunction: null }, pressed: { classPropertyName: "pressed", publicName: "pressed", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, disabledModel: { classPropertyName: "disabledModel", publicName: "disabledModel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressedChange", disabledModel: "disabledModelChange", onPressedChange: "onPressedChange" }, host: { listeners: { "click": "togglePressed()" }, properties: { "attr.aria-pressed": "pressed()", "attr.data-state": "dataState()", "attr.data-disabled": "disabledState() ? \"\" : undefined", "disabled": "disabledState()" } }, providers: [TOGGLE_VALUE_ACCESSOR], exportAs: ["rdxToggle"], ngImport: i0 }); }
98
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.4", type: RdxToggleDirective, isStandalone: true, selector: "[rdxToggle]", inputs: { defaultPressed: { classPropertyName: "defaultPressed", publicName: "defaultPressed", isSignal: true, isRequired: false, transformFunction: null }, pressed: { classPropertyName: "pressed", publicName: "pressed", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, disabledModel: { classPropertyName: "disabledModel", publicName: "disabledModel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressedChange", disabledModel: "disabledModelChange", onPressedChange: "onPressedChange" }, host: { listeners: { "click": "togglePressed()" }, properties: { "attr.aria-pressed": "pressed()", "attr.data-state": "dataState()", "attr.data-disabled": "disabledState() ? \"\" : undefined", "disabled": "disabledState()" } }, providers: [provideValueAccessor(RdxToggleDirective)], exportAs: ["rdxToggle"], ngImport: i0 }); }
105
99
  }
106
100
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxToggleDirective, decorators: [{
107
101
  type: Directive,
108
102
  args: [{
109
103
  selector: '[rdxToggle]',
110
104
  exportAs: 'rdxToggle',
111
- standalone: true,
112
- providers: [TOGGLE_VALUE_ACCESSOR],
105
+ providers: [provideValueAccessor(RdxToggleDirective)],
113
106
  host: {
114
107
  '[attr.aria-pressed]': 'pressed()',
115
108
  '[attr.data-state]': 'dataState()',
@@ -124,5 +117,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
124
117
  * Generated bundle index. Do not edit.
125
118
  */
126
119
 
127
- export { RdxToggleDirective, RdxToggleVisuallyHiddenInputDirective, TOGGLE_VALUE_ACCESSOR };
120
+ export { RdxToggleDirective, RdxToggleVisuallyHiddenInputDirective };
128
121
  //# sourceMappingURL=radix-ng-primitives-toggle.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-toggle.mjs","sources":["../../../packages/primitives/toggle/src/toggle-visually-hidden-input.directive.ts","../../../packages/primitives/toggle/src/toggle.directive.ts","../../../packages/primitives/toggle/radix-ng-primitives-toggle.ts"],"sourcesContent":["import { Directive } from '@angular/core';\nimport { RdxVisuallyHiddenInputDirective } from '@radix-ng/primitives/visually-hidden';\n\n@Directive({\n selector: 'input[rdxToggleVisuallyHiddenInput]',\n exportAs: 'rdxToggleVisuallyHiddenInput',\n standalone: true,\n hostDirectives: [\n {\n directive: RdxVisuallyHiddenInputDirective,\n inputs: [\n 'name',\n 'required',\n 'value',\n 'disabled'\n ]\n }\n ],\n host: {\n type: 'checkbox'\n }\n})\nexport class RdxToggleVisuallyHiddenInputDirective {}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n forwardRef,\n input,\n model,\n output,\n OutputEmitterRef,\n signal\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nexport interface ToggleProps {\n /**\n * The controlled state of the toggle.\n */\n pressed?: boolean;\n\n /**\n * The state of the toggle when initially rendered. Use `defaultPressed`\n * if you do not need to control the state of the toggle.\n * @defaultValue false\n */\n defaultPressed?: boolean;\n\n /**\n * The callback that fires when the state of the toggle changes.\n */\n onPressedChange?: OutputEmitterRef<boolean>;\n\n /**\n * Whether the toggle is disabled.\n * @defaultValue false\n */\n disabled?: boolean;\n}\n\nexport type DataState = 'on' | 'off';\n\nexport const TOGGLE_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => RdxToggleDirective),\n multi: true\n};\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxToggle]',\n exportAs: 'rdxToggle',\n standalone: true,\n providers: [TOGGLE_VALUE_ACCESSOR],\n host: {\n '[attr.aria-pressed]': 'pressed()',\n '[attr.data-state]': 'dataState()',\n '[attr.data-disabled]': 'disabledState() ? \"\" : undefined',\n '[disabled]': 'disabledState()',\n\n '(click)': 'togglePressed()'\n }\n})\nexport class RdxToggleDirective implements ControlValueAccessor {\n /**\n * The pressed state of the toggle when it is initially rendered.\n * Use when you do not need to control its pressed state.\n *\n * @group Props\n */\n readonly defaultPressed = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The controlled pressed state of the toggle.\n * Must be used in conjunction with `onPressedChange`.\n *\n * @group Props\n */\n readonly pressed = model<boolean>(this.defaultPressed());\n\n /**\n * When true, prevents the user from interacting with the toggle.\n *\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** @ignore */\n readonly disabledModel = model<boolean>(this.disabled());\n\n /** @ignore */\n readonly disabledState = computed(() => this.disabled() || this.disabledModel() || this.accessorDisabled());\n\n protected readonly dataState = computed<DataState>(() => {\n return this.pressed() ? 'on' : 'off';\n });\n\n /**\n * Event handler called when the pressed state of the toggle changes.\n *\n * @group Emits\n */\n readonly onPressedChange = output<boolean>();\n\n protected togglePressed(): void {\n if (!this.disabled()) {\n this.pressed.set(!this.pressed());\n this.onChange(this.pressed());\n this.onPressedChange.emit(this.pressed());\n }\n }\n\n private readonly accessorDisabled = signal(false);\n\n private onChange: (value: any) => void = () => {};\n\n /** @ignore */\n onTouched: (() => void) | undefined;\n\n /** @ignore */\n writeValue(value: any): void {\n this.pressed.set(value);\n }\n\n /** @ignore */\n registerOnChange(fn: (value: any) => void): void {\n this.onChange = fn;\n }\n\n /** @ignore */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** @ignore */\n setDisabledState(isDisabled: boolean): void {\n this.accessorDisabled.set(isDisabled);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAsBa,qCAAqC,CAAA;8GAArC,qCAAqC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAArC,qCAAqC,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qCAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,UAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,8BAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,+BAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,UAAA,EAAA,UAAA,EAAA,OAAA,EAAA,OAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAArC,qCAAqC,EAAA,UAAA,EAAA,CAAA;kBAnBjD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ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{"version":3,"file":"radix-ng-primitives-toggle.mjs","sources":["../../../packages/primitives/toggle/src/toggle-visually-hidden-input.directive.ts","../../../packages/primitives/toggle/src/toggle.directive.ts","../../../packages/primitives/toggle/radix-ng-primitives-toggle.ts"],"sourcesContent":["import { Directive } from '@angular/core';\nimport { RdxVisuallyHiddenInputDirective } from '@radix-ng/primitives/visually-hidden';\n\n@Directive({\n selector: 'input[rdxToggleVisuallyHiddenInput]',\n exportAs: 'rdxToggleVisuallyHiddenInput',\n hostDirectives: [\n {\n directive: RdxVisuallyHiddenInputDirective,\n inputs: [\n 'name',\n 'required',\n 'value',\n 'disabled'\n ]\n }\n ],\n host: {\n type: 'checkbox'\n }\n})\nexport class RdxToggleVisuallyHiddenInputDirective {}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, input, model, output, OutputEmitterRef, signal } from '@angular/core';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { provideValueAccessor } from '@radix-ng/primitives/core';\n\nexport interface ToggleProps {\n /**\n * The controlled state of the toggle.\n */\n pressed?: boolean;\n\n /**\n * The state of the toggle when initially rendered. Use `defaultPressed`\n * if you do not need to control the state of the toggle.\n * @defaultValue false\n */\n defaultPressed?: boolean;\n\n /**\n * The callback that fires when the state of the toggle changes.\n */\n onPressedChange?: OutputEmitterRef<boolean>;\n\n /**\n * Whether the toggle is disabled.\n * @defaultValue false\n */\n disabled?: boolean;\n}\n\nexport type DataState = 'on' | 'off';\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxToggle]',\n exportAs: 'rdxToggle',\n providers: [provideValueAccessor(RdxToggleDirective)],\n host: {\n '[attr.aria-pressed]': 'pressed()',\n '[attr.data-state]': 'dataState()',\n '[attr.data-disabled]': 'disabledState() ? \"\" : undefined',\n '[disabled]': 'disabledState()',\n\n '(click)': 'togglePressed()'\n }\n})\nexport class RdxToggleDirective implements ControlValueAccessor {\n /**\n * The pressed state of the toggle when it is initially rendered.\n * Use when you do not need to control its pressed state.\n *\n * @group Props\n */\n readonly defaultPressed = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The controlled pressed state of the toggle.\n * Must be used in conjunction with `onPressedChange`.\n *\n * @group Props\n */\n readonly pressed = model<boolean>(this.defaultPressed());\n\n /**\n * When true, prevents the user from interacting with the toggle.\n *\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** @ignore */\n readonly disabledModel = model<boolean>(this.disabled());\n\n /** @ignore */\n readonly disabledState = computed(() => this.disabled() || this.disabledModel() || this.accessorDisabled());\n\n protected readonly dataState = computed<DataState>(() => {\n return this.pressed() ? 'on' : 'off';\n });\n\n /**\n * Event handler called when the pressed state of the toggle changes.\n *\n * @group Emits\n */\n readonly onPressedChange = output<boolean>();\n\n protected togglePressed(): void {\n if (!this.disabled()) {\n this.pressed.set(!this.pressed());\n this.onChange(this.pressed());\n this.onPressedChange.emit(this.pressed());\n }\n }\n\n private readonly accessorDisabled = signal(false);\n\n private onChange: (value: any) => void = () => {};\n\n /** @ignore */\n onTouched: (() => void) | undefined;\n\n /** @ignore */\n writeValue(value: any): void {\n this.pressed.set(value);\n }\n\n /** @ignore */\n registerOnChange(fn: (value: any) => void): void {\n this.onChange = fn;\n }\n\n /** @ignore */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** @ignore */\n setDisabledState(isDisabled: boolean): void {\n this.accessorDisabled.set(isDisabled);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAqBa,qCAAqC,CAAA;8GAArC,qCAAqC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAArC,qCAAqC,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qCAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,UAAA,EAAA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QAAA,EAAA,IAAA,EAAA,kBAAkB,67BAVhB,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,CAAC,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAU5C,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAb9B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,SAAS,EAAE,CAAC,oBAAoB,CAAA,kBAAA,CAAoB,CAAC;AACrD,oBAAA,IAAI,EAAE;AACF,wBAAA,qBAAqB,EAAE,WAAW;AAClC,wBAAA,mBAAmB,EAAE,aAAa;AAClC,wBAAA,sBAAsB,EAAE,kCAAkC;AAC1D,wBAAA,YAAY,EAAE,iBAAiB;AAE/B,wBAAA,SAAS,EAAE;AACd;AACJ,iBAAA;;;AC/CD;;AAEG;;;;"}
@@ -79,7 +79,7 @@ export declare class RdxHoverCardRootDirective {
79
79
  window: Window & typeof globalThis;
80
80
  primitiveConfigs?: import("./utils/types").PrimitiveConfigs;
81
81
  onDestroyCallbacks: Set<() => void>;
82
- "__#10818@#clickDomRootEventCallbacks": Set<(event: MouseEvent) => void>;
82
+ "__#12411@#clickDomRootEventCallbacks": Set<(event: MouseEvent) => void>;
83
83
  registerPrimitive<T extends object>(primitiveInstance: T): void;
84
84
  deregisterPrimitive<T extends object>(primitiveInstance: T): void;
85
85
  preventPrimitiveFromCdkEvent<T extends object>(primitiveInstance: T, eventType: import("./utils/types").EventType): void;
@@ -90,9 +90,9 @@ export declare class RdxHoverCardRootDirective {
90
90
  primitivePreventedFromCdkEvent<T extends object>(primitiveInstance: T, eventType: import("./utils/types").EventType): boolean | undefined;
91
91
  addClickDomRootEventCallback(callback: (event: MouseEvent) => void): void;
92
92
  removeClickDomRootEventCallback(callback: (event: MouseEvent) => void): boolean;
93
- "__#10818@#setPreventPrimitiveFromCdkEvent"<T extends object, R extends import("./utils/types").EventType, K extends import("./utils/types").PrimitiveConfig[`prevent${Capitalize<R>}`]>(primitiveInstance: T, eventType: R, value: K): void;
94
- "__#10818@#registerOnDestroyCallbacks"(): void;
95
- "__#10818@#listenToClickDomRootEvent"(): void;
93
+ "__#12411@#setPreventPrimitiveFromCdkEvent"<T extends object, R extends import("./utils/types").EventType, K extends import("./utils/types").PrimitiveConfig[`prevent${Capitalize<R>}`]>(primitiveInstance: T, eventType: R, value: K): void;
94
+ "__#12411@#registerOnDestroyCallbacks"(): void;
95
+ "__#12411@#listenToClickDomRootEvent"(): void;
96
96
  } | null;
97
97
  /** @ignore */
98
98
  readonly destroyRef: DestroyRef;
@@ -0,0 +1 @@
1
+ # @radix-ng/primitives/number-field
@@ -0,0 +1,17 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./src/number-field-root.directive";
3
+ import * as i2 from "./src/number-field-input.directive";
4
+ import * as i3 from "./src/number-field-increment.directive";
5
+ import * as i4 from "./src/number-field-decrement.directive";
6
+ export * from './src/number-field-context.token';
7
+ export * from './src/number-field-decrement.directive';
8
+ export * from './src/number-field-increment.directive';
9
+ export * from './src/number-field-input.directive';
10
+ export * from './src/number-field-root.directive';
11
+ export * from './src/types';
12
+ export * from './src/utils';
13
+ export declare class RdxNumberFieldModule {
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxNumberFieldModule, never>;
15
+ static ɵmod: i0.ɵɵNgModuleDeclaration<RdxNumberFieldModule, never, [typeof i1.RdxNumberFieldRootDirective, typeof i2.RdxNumberFieldInputDirective, typeof i3.RdxNumberFieldIncrementDirective, typeof i4.RdxNumberFieldDecrementDirective], [typeof i1.RdxNumberFieldRootDirective, typeof i2.RdxNumberFieldInputDirective, typeof i3.RdxNumberFieldIncrementDirective, typeof i4.RdxNumberFieldDecrementDirective]>;
16
+ static ɵinj: i0.ɵɵInjectorDeclaration<RdxNumberFieldModule>;
17
+ }
@@ -0,0 +1,24 @@
1
+ import { BooleanInput, NumberInput } from '@angular/cdk/coercion';
2
+ import { InjectionToken, InputSignal, InputSignalWithTransform, ModelSignal, Signal } from '@angular/core';
3
+ import { InputMode } from './types';
4
+ export interface NumberFieldContextToken {
5
+ value: ModelSignal<number | undefined>;
6
+ locale: InputSignal<string>;
7
+ inputMode: Signal<InputMode>;
8
+ textValue: Signal<any>;
9
+ max: InputSignalWithTransform<number | undefined, NumberInput>;
10
+ min: InputSignalWithTransform<number | undefined, NumberInput>;
11
+ onInputElement: (el: HTMLInputElement) => void;
12
+ disabled: InputSignalWithTransform<boolean, BooleanInput>;
13
+ disableWheelChange: InputSignalWithTransform<boolean, BooleanInput>;
14
+ handleIncrease: (multiplier?: number) => void;
15
+ handleDecrease: (multiplier?: number) => void;
16
+ applyInputValue: (val: string) => void;
17
+ validate: (val: string) => boolean;
18
+ setInputValue: (val: string) => void;
19
+ isIncreaseDisabled: Signal<boolean>;
20
+ isDecreaseDisabled: Signal<boolean>;
21
+ handleMinMaxValue: (type: 'min' | 'max') => void;
22
+ }
23
+ export declare const NUMBER_FIELD_ROOT_CONTEXT: InjectionToken<NumberFieldContextToken>;
24
+ export declare function injectNumberFieldRootContext(): NumberFieldContextToken;
@@ -0,0 +1,23 @@
1
+ import { BooleanInput } from '@angular/cdk/coercion';
2
+ import { OnInit } from '@angular/core';
3
+ import * as i0 from "@angular/core";
4
+ export declare class RdxNumberFieldDecrementDirective implements OnInit {
5
+ private readonly elementRef;
6
+ private readonly pressedHold;
7
+ protected readonly rootContext: import("./number-field-context.token").NumberFieldContextToken;
8
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
9
+ /**
10
+ * @ignore
11
+ */
12
+ readonly isDisabled: import("@angular/core").Signal<boolean>;
13
+ /**
14
+ * @ignore
15
+ */
16
+ readonly useHold: {
17
+ isPressed: import("@angular/core").Signal<boolean>;
18
+ onTrigger: (fn: () => void) => void;
19
+ };
20
+ ngOnInit(): void;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxNumberFieldDecrementDirective, never>;
22
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxNumberFieldDecrementDirective, "button[rdxNumberFieldDecrement]", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
23
+ }
@@ -0,0 +1,23 @@
1
+ import { BooleanInput } from '@angular/cdk/coercion';
2
+ import { OnInit } from '@angular/core';
3
+ import * as i0 from "@angular/core";
4
+ export declare class RdxNumberFieldIncrementDirective implements OnInit {
5
+ private readonly elementRef;
6
+ private readonly pressedHold;
7
+ protected readonly rootContext: import("./number-field-context.token").NumberFieldContextToken;
8
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
9
+ /**
10
+ * @ignore
11
+ */
12
+ readonly isDisabled: import("@angular/core").Signal<boolean>;
13
+ /**
14
+ * @ignore
15
+ */
16
+ readonly useHold: {
17
+ isPressed: import("@angular/core").Signal<boolean>;
18
+ onTrigger: (fn: () => void) => void;
19
+ };
20
+ ngOnInit(): void;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxNumberFieldIncrementDirective, never>;
22
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxNumberFieldIncrementDirective, "button[rdxNumberFieldIncrement]", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
23
+ }
@@ -0,0 +1,22 @@
1
+ import { OnInit } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class RdxNumberFieldInputDirective implements OnInit {
4
+ private readonly elementRef;
5
+ protected readonly rootContext: import("./number-field-context.token").NumberFieldContextToken;
6
+ readonly inputValue: import("@angular/core").WritableSignal<any>;
7
+ constructor();
8
+ ngOnInit(): void;
9
+ onBeforeInput(event: InputEvent): void;
10
+ onWheelEvent(event: WheelEvent): void;
11
+ onKeydownPageUp(event: KeyboardEvent): void;
12
+ onKeydownPageDown(event: KeyboardEvent): void;
13
+ onKeydownHome(event: KeyboardEvent): void;
14
+ onKeydownEnd(event: KeyboardEvent): void;
15
+ onInput(event: InputEvent): void;
16
+ onChange(): void;
17
+ onKeydownEnter(event: KeyboardEvent): void;
18
+ onKeydownUp(event: KeyboardEvent): void;
19
+ onKeydownDown(event: KeyboardEvent): void;
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxNumberFieldInputDirective, never>;
21
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxNumberFieldInputDirective, "input[rdxNumberFieldInput]", never, {}, {}, never, never, true, never>;
22
+ }
@@ -0,0 +1,86 @@
1
+ import { BooleanInput, NumberInput } from '@angular/cdk/coercion';
2
+ import { OnInit } from '@angular/core';
3
+ import { NumberFieldContextToken } from './number-field-context.token';
4
+ import { InputMode } from './types';
5
+ import * as i0 from "@angular/core";
6
+ export declare class RdxNumberFieldRootDirective implements OnInit, NumberFieldContextToken {
7
+ readonly value: import("@angular/core").ModelSignal<number | undefined>;
8
+ readonly min: import("@angular/core").InputSignalWithTransform<number | undefined, NumberInput>;
9
+ readonly max: import("@angular/core").InputSignalWithTransform<number | undefined, NumberInput>;
10
+ readonly step: import("@angular/core").InputSignalWithTransform<number, NumberInput>;
11
+ readonly stepSnapping: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
12
+ readonly disableWheelChange: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
13
+ readonly locale: import("@angular/core").InputSignal<string>;
14
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
15
+ readonly formatOptions: import("@angular/core").InputSignal<Intl.NumberFormatOptions | undefined>;
16
+ /**
17
+ * @ignore
18
+ */
19
+ readonly inputEl: import("@angular/core").WritableSignal<HTMLInputElement | undefined>;
20
+ /**
21
+ * @ignore
22
+ */
23
+ readonly isDecreaseDisabled: import("@angular/core").Signal<boolean>;
24
+ /**
25
+ * @ignore
26
+ */
27
+ readonly isIncreaseDisabled: import("@angular/core").Signal<boolean>;
28
+ /**
29
+ * @ignore
30
+ */
31
+ readonly inputMode: import("@angular/core").Signal<InputMode>;
32
+ /**
33
+ * Replace negative textValue formatted using currencySign: 'accounting'
34
+ * with a textValue that can be announced using a minus sign.
35
+ * @ignore
36
+ */
37
+ readonly textValue: import("@angular/core").Signal<any>;
38
+ /**
39
+ * @ignore
40
+ */
41
+ readonly onInputElement: (el: HTMLInputElement) => void;
42
+ /**
43
+ * @ignore
44
+ */
45
+ numberParser: any;
46
+ /**
47
+ * @ignore
48
+ */
49
+ numberFormatter: any;
50
+ /**
51
+ * @ignore
52
+ */
53
+ textValueFormatter: any;
54
+ /**
55
+ * @ignore
56
+ */
57
+ clampInputValue(val: number): number;
58
+ ngOnInit(): void;
59
+ /**
60
+ * @ignore
61
+ */
62
+ handleMinMaxValue(type: 'min' | 'max'): void;
63
+ /**
64
+ * @ignore
65
+ */
66
+ handleDecrease(multiplier?: number): void;
67
+ /**
68
+ * @ignore
69
+ */
70
+ handleIncrease(multiplier?: number): void;
71
+ /**
72
+ * @ignore
73
+ */
74
+ applyInputValue(val: string): void;
75
+ /**
76
+ * @ignore
77
+ */
78
+ setInputValue(val: string): void;
79
+ /**
80
+ * @ignore
81
+ */
82
+ validate(val: string): any;
83
+ private handleChangingValue;
84
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxNumberFieldRootDirective, never>;
85
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxNumberFieldRootDirective, "[rdxNumberFieldRoot]", ["rdxNumberFieldRoot"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "stepSnapping": { "alias": "stepSnapping"; "required": false; "isSignal": true; }; "disableWheelChange": { "alias": "disableWheelChange"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "formatOptions": { "alias": "formatOptions"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
86
+ }
@@ -0,0 +1 @@
1
+ export type InputMode = 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
@@ -0,0 +1,18 @@
1
+ import { Signal } from '@angular/core';
2
+ import { NumberFormatter, NumberParser } from '@internationalized/number';
3
+ import * as i0 from "@angular/core";
4
+ export declare class PressedHoldService {
5
+ private readonly destroyRef;
6
+ create(options: {
7
+ target?: Signal<HTMLElement | undefined>;
8
+ disabled: Signal<boolean>;
9
+ }): {
10
+ isPressed: Signal<boolean>;
11
+ onTrigger: (fn: () => void) => void;
12
+ };
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<PressedHoldService, never>;
14
+ static ɵprov: i0.ɵɵInjectableDeclaration<PressedHoldService>;
15
+ }
16
+ export declare function useNumberFormatter(locale: Signal<string>, options?: Signal<Intl.NumberFormatOptions | undefined>): Signal<NumberFormatter>;
17
+ export declare function useNumberParser(locale: Signal<string>, options?: Signal<Intl.NumberFormatOptions | undefined>): Signal<NumberParser>;
18
+ export declare function handleDecimalOperation(operator: '-' | '+', value1: number, value2: number): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radix-ng/primitives",
3
- "version": "0.34.0",
3
+ "version": "0.36.0",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -76,6 +76,10 @@
76
76
  "types": "./core/index.d.ts",
77
77
  "default": "./fesm2022/radix-ng-primitives-core.mjs"
78
78
  },
79
+ "./date-field": {
80
+ "types": "./date-field/index.d.ts",
81
+ "default": "./fesm2022/radix-ng-primitives-date-field.mjs"
82
+ },
79
83
  "./dialog": {
80
84
  "types": "./dialog/index.d.ts",
81
85
  "default": "./fesm2022/radix-ng-primitives-dialog.mjs"
@@ -104,6 +108,10 @@
104
108
  "types": "./navigation-menu/index.d.ts",
105
109
  "default": "./fesm2022/radix-ng-primitives-navigation-menu.mjs"
106
110
  },
111
+ "./number-field": {
112
+ "types": "./number-field/index.d.ts",
113
+ "default": "./fesm2022/radix-ng-primitives-number-field.mjs"
114
+ },
107
115
  "./pagination": {
108
116
  "types": "./pagination/index.d.ts",
109
117
  "default": "./fesm2022/radix-ng-primitives-pagination.mjs"
@@ -70,7 +70,7 @@ export declare class RdxPopoverRootDirective {
70
70
  window: Window & typeof globalThis;
71
71
  primitiveConfigs?: import("./utils/types").PrimitiveConfigs;
72
72
  onDestroyCallbacks: Set<() => void>;
73
- "__#14454@#clickDomRootEventCallbacks": Set<(event: MouseEvent) => void>;
73
+ "__#17319@#clickDomRootEventCallbacks": Set<(event: MouseEvent) => void>;
74
74
  registerPrimitive<T extends object>(primitiveInstance: T): void;
75
75
  deregisterPrimitive<T extends object>(primitiveInstance: T): void;
76
76
  preventPrimitiveFromCdkEvent<T extends object>(primitiveInstance: T, eventType: import("./utils/types").EventType): void;
@@ -81,9 +81,9 @@ export declare class RdxPopoverRootDirective {
81
81
  primitivePreventedFromCdkEvent<T extends object>(primitiveInstance: T, eventType: import("./utils/types").EventType): boolean | undefined;
82
82
  addClickDomRootEventCallback(callback: (event: MouseEvent) => void): void;
83
83
  removeClickDomRootEventCallback(callback: (event: MouseEvent) => void): boolean;
84
- "__#14454@#setPreventPrimitiveFromCdkEvent"<T extends object, R extends import("./utils/types").EventType, K extends import("./utils/types").PrimitiveConfig[`prevent${Capitalize<R>}`]>(primitiveInstance: T, eventType: R, value: K): void;
85
- "__#14454@#registerOnDestroyCallbacks"(): void;
86
- "__#14454@#listenToClickDomRootEvent"(): void;
84
+ "__#17319@#setPreventPrimitiveFromCdkEvent"<T extends object, R extends import("./utils/types").EventType, K extends import("./utils/types").PrimitiveConfig[`prevent${Capitalize<R>}`]>(primitiveInstance: T, eventType: R, value: K): void;
85
+ "__#17319@#registerOnDestroyCallbacks"(): void;
86
+ "__#17319@#listenToClickDomRootEvent"(): void;
87
87
  } | null;
88
88
  /** @ignore */
89
89
  readonly destroyRef: DestroyRef;
@@ -4,7 +4,6 @@ import { ControlValueAccessor } from '@angular/forms';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare const RdxSwitchToken: InjectionToken<RdxSwitchRootDirective>;
6
6
  export declare function injectSwitch(): RdxSwitchRootDirective;
7
- export declare const SWITCH_VALUE_ACCESSOR: any;
8
7
  export interface SwitchProps {
9
8
  checked?: ModelSignal<boolean>;
10
9
  defaultChecked?: InputSignalWithTransform<boolean, BooleanInput>;
@@ -24,7 +24,6 @@ export interface ToggleProps {
24
24
  disabled?: boolean;
25
25
  }
26
26
  export type DataState = 'on' | 'off';
27
- export declare const TOGGLE_VALUE_ACCESSOR: any;
28
27
  /**
29
28
  * @group Components
30
29
  */
@@ -79,7 +79,7 @@ export declare class RdxTooltipRootDirective {
79
79
  window: Window & typeof globalThis;
80
80
  primitiveConfigs?: import("./utils/types").PrimitiveConfigs;
81
81
  onDestroyCallbacks: Set<() => void>;
82
- "__#17971@#clickDomRootEventCallbacks": Set<(event: MouseEvent) => void>;
82
+ "__#20782@#clickDomRootEventCallbacks": Set<(event: MouseEvent) => void>;
83
83
  registerPrimitive<T extends object>(primitiveInstance: T): void;
84
84
  deregisterPrimitive<T extends object>(primitiveInstance: T): void;
85
85
  preventPrimitiveFromCdkEvent<T extends object>(primitiveInstance: T, eventType: import("./utils/types").EventType): void;
@@ -90,9 +90,9 @@ export declare class RdxTooltipRootDirective {
90
90
  primitivePreventedFromCdkEvent<T extends object>(primitiveInstance: T, eventType: import("./utils/types").EventType): boolean | undefined;
91
91
  addClickDomRootEventCallback(callback: (event: MouseEvent) => void): void;
92
92
  removeClickDomRootEventCallback(callback: (event: MouseEvent) => void): boolean;
93
- "__#17971@#setPreventPrimitiveFromCdkEvent"<T extends object, R extends import("./utils/types").EventType, K extends import("./utils/types").PrimitiveConfig[`prevent${Capitalize<R>}`]>(primitiveInstance: T, eventType: R, value: K): void;
94
- "__#17971@#registerOnDestroyCallbacks"(): void;
95
- "__#17971@#listenToClickDomRootEvent"(): void;
93
+ "__#20782@#setPreventPrimitiveFromCdkEvent"<T extends object, R extends import("./utils/types").EventType, K extends import("./utils/types").PrimitiveConfig[`prevent${Capitalize<R>}`]>(primitiveInstance: T, eventType: R, value: K): void;
94
+ "__#20782@#registerOnDestroyCallbacks"(): void;
95
+ "__#20782@#listenToClickDomRootEvent"(): void;
96
96
  } | null;
97
97
  /** @ignore */
98
98
  readonly destroyRef: DestroyRef;