@radix-ng/primitives 0.36.0 → 0.38.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 (101) hide show
  1. package/accordion/index.d.ts +3 -1
  2. package/accordion/src/accordion-content-presence.directive.d.ts +6 -0
  3. package/accordion/src/accordion-content.directive.d.ts +4 -7
  4. package/accordion/src/accordion-header.directive.d.ts +2 -2
  5. package/accordion/src/accordion-item.directive.d.ts +24 -83
  6. package/accordion/src/accordion-root.directive.d.ts +33 -87
  7. package/accordion/src/accordion-trigger.directive.d.ts +5 -11
  8. package/avatar/index.d.ts +1 -1
  9. package/avatar/src/avatar-context.token.d.ts +7 -0
  10. package/avatar/src/avatar-fallback.directive.d.ts +3 -9
  11. package/avatar/src/avatar-image.directive.d.ts +11 -11
  12. package/avatar/src/avatar-root.directive.d.ts +3 -6
  13. package/avatar/src/types.d.ts +2 -0
  14. package/checkbox/index.d.ts +1 -1
  15. package/checkbox/src/checkbox-button.directive.d.ts +1 -1
  16. package/checkbox/src/checkbox-indicator.directive.d.ts +1 -1
  17. package/checkbox/src/checkbox-input.directive.d.ts +1 -1
  18. package/checkbox/src/checkbox.directive.d.ts +3 -3
  19. package/checkbox/src/checkbox.token.d.ts +3 -3
  20. package/collapsible/index.d.ts +11 -0
  21. package/collapsible/src/collapsible-content-presence.directive.d.ts +6 -0
  22. package/collapsible/src/collapsible-content.directive.d.ts +10 -9
  23. package/collapsible/src/collapsible-root.directive.d.ts +19 -37
  24. package/collapsible/src/collapsible-trigger.directive.d.ts +1 -21
  25. package/core/index.d.ts +5 -0
  26. package/core/src/accessor/control-value-accessor.d.ts +67 -0
  27. package/core/src/create-context.d.ts +10 -0
  28. package/core/src/date-time/comparators.d.ts +7 -1
  29. package/core/src/date-time/useDateField.d.ts +2 -2
  30. package/core/src/types.d.ts +24 -0
  31. package/{stepper/src/utils → core/src}/useArrowNavigation.d.ts +2 -2
  32. package/core/src/useResizeObserver.d.ts +15 -0
  33. package/cropper/README.md +1 -0
  34. package/cropper/index.d.ts +15 -0
  35. package/cropper/src/cropper-context.token.d.ts +12 -0
  36. package/cropper/src/cropper-crop-area.directive.d.ts +6 -0
  37. package/cropper/src/cropper-description.directive.d.ts +6 -0
  38. package/cropper/src/cropper-image.component.d.ts +10 -0
  39. package/cropper/src/cropper-root.directive.d.ts +91 -0
  40. package/fesm2022/radix-ng-primitives-accordion.mjs +196 -408
  41. package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
  42. package/fesm2022/radix-ng-primitives-avatar.mjs +84 -96
  43. package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
  44. package/fesm2022/radix-ng-primitives-calendar.mjs +3 -14
  45. package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
  46. package/fesm2022/radix-ng-primitives-checkbox.mjs +13 -16
  47. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  48. package/fesm2022/radix-ng-primitives-collapsible.mjs +138 -143
  49. package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
  50. package/fesm2022/radix-ng-primitives-core.mjs +248 -7
  51. package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
  52. package/fesm2022/radix-ng-primitives-cropper.mjs +680 -0
  53. package/fesm2022/radix-ng-primitives-cropper.mjs.map +1 -0
  54. package/fesm2022/radix-ng-primitives-hover-card.mjs +1 -3
  55. package/fesm2022/radix-ng-primitives-hover-card.mjs.map +1 -1
  56. package/fesm2022/radix-ng-primitives-menubar.mjs +1 -8
  57. package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
  58. package/fesm2022/radix-ng-primitives-pagination.mjs +2 -6
  59. package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
  60. package/fesm2022/radix-ng-primitives-popover.mjs +2 -6
  61. package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
  62. package/fesm2022/radix-ng-primitives-presence.mjs +34 -1
  63. package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
  64. package/fesm2022/radix-ng-primitives-progress.mjs +2 -7
  65. package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
  66. package/fesm2022/radix-ng-primitives-radio.mjs +1 -3
  67. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  68. package/fesm2022/radix-ng-primitives-select.mjs +75 -33
  69. package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
  70. package/fesm2022/radix-ng-primitives-stepper.mjs +1 -97
  71. package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
  72. package/fesm2022/radix-ng-primitives-switch.mjs +61 -100
  73. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  74. package/fesm2022/radix-ng-primitives-tabs.mjs +4 -19
  75. package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
  76. package/fesm2022/radix-ng-primitives-time-field.mjs +351 -0
  77. package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -0
  78. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  79. package/fesm2022/radix-ng-primitives-toggle.mjs +1 -6
  80. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  81. package/fesm2022/radix-ng-primitives-tooltip.mjs +1 -3
  82. package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
  83. package/hover-card/src/hover-card-root.directive.d.ts +4 -4
  84. package/package.json +9 -1
  85. package/popover/src/popover-root.directive.d.ts +4 -4
  86. package/presence/index.d.ts +1 -0
  87. package/presence/src/presence.directive.d.ts +27 -0
  88. package/select/src/select-trigger.directive.d.ts +8 -2
  89. package/select/src/select.component.d.ts +23 -6
  90. package/switch/index.d.ts +0 -1
  91. package/switch/src/switch-input.directive.d.ts +1 -1
  92. package/switch/src/switch-root.directive.d.ts +23 -46
  93. package/switch/src/switch-thumb.directive.d.ts +1 -1
  94. package/time-field/README.md +1 -0
  95. package/time-field/index.d.ts +11 -0
  96. package/time-field/src/time-field-context.token.d.ts +19 -0
  97. package/time-field/src/time-field-input.directive.d.ts +53 -0
  98. package/time-field/src/time-field-root.directive.d.ts +125 -0
  99. package/tooltip/src/tooltip-root.directive.d.ts +4 -4
  100. package/collapsible/src/collapsible-content.token.d.ts +0 -3
  101. package/stepper/src/utils/getActiveElement.d.ts +0 -1
@@ -1,22 +1,18 @@
1
1
  import { BooleanInput } from '@angular/cdk/coercion';
2
+ import { InputSignal, ModelSignal, Signal } from '@angular/core';
2
3
  import * as i0 from "@angular/core";
3
- export declare function injectCollapsible(): RdxCollapsibleRootDirective;
4
4
  export type RdxCollapsibleState = 'open' | 'closed';
5
+ export interface CollapsibleRootContext {
6
+ contentId: InputSignal<string>;
7
+ open: ModelSignal<boolean>;
8
+ toggle: () => void;
9
+ disabled: Signal<boolean>;
10
+ }
11
+ export declare const injectCollapsibleRootContext: (optional?: boolean) => CollapsibleRootContext | null, provideCollapsibleRootContext: (useFactory: () => CollapsibleRootContext) => import("@angular/core").Provider;
5
12
  /**
6
13
  * @group Components
7
14
  */
8
15
  export declare class RdxCollapsibleRootDirective {
9
- /**
10
- * Reference to RdxCollapsibleContent directive
11
- */
12
- private readonly contentDirective;
13
- /**
14
- * Determines whether a directive is available for interaction.
15
- * When true, prevents the user from interacting with the collapsible.
16
- *
17
- * @group Props
18
- */
19
- readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
20
16
  /**
21
17
  * The controlled open state of the collapsible.
22
18
  * Sets the state of the directive. `true` - expanded, `false` - collapsed
@@ -24,12 +20,18 @@ export declare class RdxCollapsibleRootDirective {
24
20
  * @group Props
25
21
  * @defaultValue false
26
22
  */
27
- set open(value: boolean);
28
- get open(): boolean;
23
+ readonly open: ModelSignal<boolean>;
24
+ readonly contentId: InputSignal<string>;
29
25
  /**
30
- * Stores collapsible state
26
+ * Determines whether a directive is available for interaction.
27
+ * When true, prevents the user from interacting with the collapsible.
28
+ *
29
+ * @group Props
31
30
  */
32
- private _open;
31
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
32
+ readonly _disabled: import("@angular/core").WritableSignal<boolean>;
33
+ readonly isDisabled: Signal<boolean>;
34
+ readonly isOpen: Signal<boolean>;
33
35
  /**
34
36
  * Emitted with new value when directive state changed.
35
37
  * Event handler called when the open state of the collapsible changes.
@@ -37,26 +39,6 @@ export declare class RdxCollapsibleRootDirective {
37
39
  * @group Emits
38
40
  */
39
41
  readonly onOpenChange: import("@angular/core").OutputEmitterRef<boolean>;
40
- /**
41
- * Allows to change directive state
42
- * @param {boolean | undefined} value
43
- * @ignore
44
- */
45
- setOpen(value?: boolean): void;
46
- /**
47
- * Returns directive state (open | closed)
48
- * @ignore
49
- */
50
- getState(): RdxCollapsibleState;
51
- /**
52
- * Returns current directive state
53
- * @ignore
54
- */
55
- isOpen(): boolean;
56
- /**
57
- * Controls visibility of content
58
- */
59
- private setPresence;
60
42
  static ɵfac: i0.ɵɵFactoryDeclaration<RdxCollapsibleRootDirective, never>;
61
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdxCollapsibleRootDirective, "[rdxCollapsibleRoot]", ["collapsibleRoot"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "open": { "alias": "open"; "required": false; }; }, { "onOpenChange": "onOpenChange"; }, ["contentDirective"], never, true, never>;
43
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxCollapsibleRootDirective, "[rdxCollapsibleRoot]", ["rdxCollapsibleRoot"], { "open": { "alias": "open"; "required": false; "isSignal": true; }; "contentId": { "alias": "contentId"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "open": "openChange"; "onOpenChange": "onOpenChange"; }, never, never, true, never>;
62
44
  }
@@ -1,26 +1,6 @@
1
- import { RdxCollapsibleState } from './collapsible-root.directive';
2
1
  import * as i0 from "@angular/core";
3
2
  export declare class RdxCollapsibleTriggerDirective {
4
- /**
5
- * Reference to CollapsibleRoot
6
- * @private
7
- * @ignore
8
- */
9
- private readonly collapsible;
10
- /**
11
- * Called on trigger clicked
12
- */
13
- onOpenToggle(): void;
14
- /**
15
- * Returns current directive state (open | closed)
16
- * @ignore
17
- */
18
- getState(): RdxCollapsibleState;
19
- /**
20
- * Returns current trigger state
21
- * @ignore
22
- */
23
- getDisabled(): string | undefined;
3
+ protected readonly rootContext: import("./collapsible-root.directive").CollapsibleRootContext;
24
4
  static ɵfac: i0.ɵɵFactoryDeclaration<RdxCollapsibleTriggerDirective, never>;
25
5
  static ɵdir: i0.ɵɵDirectiveDeclaration<RdxCollapsibleTriggerDirective, "[rdxCollapsibleTrigger]", never, {}, {}, never, never, true, never>;
26
6
  }
package/core/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './src/accessor/control-value-accessor';
1
2
  export * from './src/accessor/provide-value-accessor';
2
3
  export * from './src/auto-focus.directive';
3
4
  export * from './src/clamp';
@@ -13,8 +14,12 @@ export * from './src/is-number';
13
14
  export * from './src/kbd-constants';
14
15
  export * from './src/provide-token';
15
16
  export * from './src/window';
17
+ export * from './src/create-context';
16
18
  export * from './src/date-time';
17
19
  export * from './src/positioning/constants';
18
20
  export * from './src/positioning/types';
19
21
  export * from './src/positioning/utils';
22
+ export * from './src/types';
23
+ export * from './src/useArrowNavigation';
24
+ export * from './src/useResizeObserver';
20
25
  export * from './src/watch';
@@ -0,0 +1,67 @@
1
+ import { BooleanInput } from '@angular/cdk/coercion';
2
+ import { ControlValueAccessor } from '@angular/forms';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * A reusable ControlValueAccessor implementation for form controls
6
+ * @template T The type of the control's value
7
+ */
8
+ export declare class RdxControlValueAccessor<T> implements ControlValueAccessor {
9
+ /**
10
+ * Input for the control's value with alias 'value'
11
+ * @default undefined
12
+ */
13
+ readonly valueInput: import("@angular/core").InputSignal<T | undefined>;
14
+ /**
15
+ * Input for the disabled state with alias 'disabled'
16
+ * Uses booleanAttribute transform to convert string attributes to booleans
17
+ * @default false
18
+ */
19
+ readonly disabledInput: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
20
+ readonly valueChange: import("@angular/core").OutputEmitterRef<T>;
21
+ private readonly _value;
22
+ /**
23
+ * Readonly access to the current value
24
+ */
25
+ readonly value: import("@angular/core").Signal<T | undefined>;
26
+ private readonly _disabled;
27
+ /**
28
+ * Readonly access to the disabled state
29
+ */
30
+ readonly disabled: import("@angular/core").Signal<boolean>;
31
+ private onChange?;
32
+ private onTouched?;
33
+ /**
34
+ * Writes a new value to the control (ControlValueAccessor interface)
35
+ * @param value The new value for the control
36
+ */
37
+ writeValue(value: T | undefined): void;
38
+ /**
39
+ * Registers a callback for when the control value changes (ControlValueAccessor interface)
40
+ * @param fn The callback function
41
+ */
42
+ registerOnChange(fn: (value: T | undefined) => void): void;
43
+ /**
44
+ * Registers a callback for when the control is touched (ControlValueAccessor interface)
45
+ * @param fn The callback function
46
+ */
47
+ registerOnTouched(fn: () => void): void;
48
+ /**
49
+ * Sets the disabled state of the control (ControlValueAccessor interface)
50
+ * @param isDisabled Whether the control should be disabled
51
+ */
52
+ setDisabledState(isDisabled: boolean): void;
53
+ /**
54
+ * Updates the control's value and triggers change detection
55
+ * @param value The new value
56
+ */
57
+ setValue(value: T): void;
58
+ markAsTouched(): void;
59
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxControlValueAccessor<any>, never>;
60
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxControlValueAccessor<any>, never, ["rdxControlValueAccessor"], { "valueInput": { "alias": "value"; "required": false; "isSignal": true; }; "disabledInput": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
61
+ }
62
+ /**
63
+ * Provides a type-safe way to inject the RdxControlValueAccessor
64
+ * @template T The type of the control's value
65
+ * @returns An instance of RdxControlValueAccessor<T>
66
+ */
67
+ export declare function injectControlValueAccessor<T>(): RdxControlValueAccessor<T>;
@@ -0,0 +1,10 @@
1
+ import { Provider } from '@angular/core';
2
+ /**
3
+ * Creates a context with injector and provider functions for a given type
4
+ * @template T The type of the context value
5
+ * @param description Descriptive string for the context (used in token creation)
6
+ * @returns A tuple containing:
7
+ * - injectContext: Function to retrieve the context value
8
+ * - provideContext: Function to create a provider for the context
9
+ */
10
+ export declare function createContext<T>(description: string): readonly [injectContext: (optional?: boolean) => T | null, provideContext: (useFactory: () => T) => Provider];
@@ -1,4 +1,4 @@
1
- import { CalendarDateTime, type DateValue, ZonedDateTime } from '@internationalized/date';
1
+ import { CalendarDateTime, type DateValue, Time, ZonedDateTime } from '@internationalized/date';
2
2
  import type { DateMatcher } from './types';
3
3
  /**
4
4
  * Given a `DateValue` object, convert it to a native `Date` object.
@@ -70,6 +70,7 @@ export declare function isBetween(date: DateValue, start: DateValue, end: DateVa
70
70
  export declare function getLastFirstDayOfWeek<T extends DateValue = DateValue>(date: T, firstDayOfWeek: number, locale: string): T;
71
71
  export declare function getNextLastDayOfWeek<T extends DateValue = DateValue>(date: T, firstDayOfWeek: number, locale: string): T;
72
72
  export declare function areAllDaysBetweenValid(start: DateValue, end: DateValue, isUnavailable: DateMatcher | undefined, isDisabled: DateMatcher | undefined): boolean;
73
+ export type TimeValue = Time | CalendarDateTime | ZonedDateTime;
73
74
  export type Granularity = 'day' | 'hour' | 'minute' | 'second';
74
75
  export type TimeGranularity = 'hour' | 'minute' | 'second';
75
76
  type GetDefaultDateProps = {
@@ -89,4 +90,9 @@ type GetDefaultDateProps = {
89
90
  *
90
91
  */
91
92
  export declare function getDefaultDate(props: GetDefaultDateProps): DateValue;
93
+ type GetDefaultTimeProps = {
94
+ defaultValue?: TimeValue | undefined;
95
+ defaultPlaceholder?: TimeValue | undefined;
96
+ };
97
+ export declare function getDefaultTime(props: GetDefaultTimeProps): TimeValue;
92
98
  export {};
@@ -5,14 +5,14 @@ import { HourCycle, SegmentPart, SegmentValueObj } from './types';
5
5
  export type UseDateFieldProps = {
6
6
  hasLeftFocus: WritableSignal<boolean>;
7
7
  lastKeyZero: WritableSignal<boolean>;
8
- placeholder: ModelSignal<DateValue>;
8
+ placeholder: ModelSignal<DateValue> | WritableSignal<DateValue>;
9
9
  hourCycle: HourCycle;
10
10
  formatter: Formatter;
11
11
  segmentValues: WritableSignal<SegmentValueObj>;
12
12
  disabled: InputSignal<boolean>;
13
13
  readonly: InputSignal<boolean>;
14
14
  part: SegmentPart;
15
- modelValue: ModelSignal<DateValue | undefined>;
15
+ modelValue: ModelSignal<DateValue | undefined> | WritableSignal<DateValue | undefined>;
16
16
  focusNext: () => void;
17
17
  };
18
18
  type SegmentAttrProps = {
@@ -0,0 +1,24 @@
1
+ export type DataOrientation = 'vertical' | 'horizontal';
2
+ /**
3
+ * Nullable from `Type` adds `null` and `undefined`
4
+ *
5
+ * @example ```ts
6
+ * // Expect: string | number | undefined | null
7
+ * type Value = Nulling<string | number>;
8
+ * ```
9
+ */
10
+ export type Nullable<Type> = null | Type | undefined;
11
+ /**
12
+ * SafeFunction is a type for functions that accept any number of arguments of unknown types
13
+ * and return a value of an unknown type. This is useful when you want to define a function
14
+ * without being strict about the input or output types, maintaining flexibility.
15
+ *
16
+ * @example ```ts
17
+ * const safeFn: SafeFunction = (...args) => {
18
+ * return args.length > 0 ? args[0] : null;
19
+ * };
20
+ *
21
+ * const result = safeFn(1, 'hello'); // result: 1
22
+ * ```
23
+ */
24
+ export type SafeFunction = (...args: unknown[]) => unknown;
@@ -10,7 +10,7 @@ interface ArrowNavigationOptions {
10
10
  /**
11
11
  * The attribute name to find the collection items in the parent element.
12
12
  *
13
- * @defaultValue "data-reka-collection-item"
13
+ * @defaultValue "data-rdx-collection-item"
14
14
  */
15
15
  attributeName?: string;
16
16
  /**
@@ -53,7 +53,7 @@ interface ArrowNavigationOptions {
53
53
  focus?: boolean;
54
54
  }
55
55
  /**
56
- * Allow arrow navigation for every html element with data-reka-collection-item tag
56
+ * Allow arrow navigation for every html element with data-rdx-collection-item tag
57
57
  *
58
58
  * @param e Keyboard event
59
59
  * @param currentElement Event initiator element or any element that wants to handle the navigation
@@ -0,0 +1,15 @@
1
+ import { EffectRef, ElementRef, Injector, Signal } from '@angular/core';
2
+ /**
3
+ * Creates a resize observer effect for element
4
+ *
5
+ * @param options Configuration options
6
+ * @param options.injector Angular injector
7
+ * @param options.element Signal returning the element to observe
8
+ * @param options.onResize Callback when element is resized
9
+ * @returns EffectRef that can be destroyed when needed
10
+ */
11
+ export declare function resizeEffect(options: {
12
+ injector: Injector;
13
+ element: Signal<ElementRef | HTMLElement | null | undefined>;
14
+ onResize: ResizeObserverCallback;
15
+ }): EffectRef;
@@ -0,0 +1 @@
1
+ # @radix-ng/primitives/cropper
@@ -0,0 +1,15 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./src/cropper-root.directive";
3
+ import * as i2 from "./src/cropper-image.component";
4
+ import * as i3 from "./src/cropper-crop-area.directive";
5
+ import * as i4 from "./src/cropper-description.directive";
6
+ export * from './src/cropper-context.token';
7
+ export * from './src/cropper-crop-area.directive';
8
+ export * from './src/cropper-description.directive';
9
+ export * from './src/cropper-image.component';
10
+ export * from './src/cropper-root.directive';
11
+ export declare class RdxCropperModule {
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxCropperModule, never>;
13
+ static ɵmod: i0.ɵɵNgModuleDeclaration<RdxCropperModule, never, [typeof i1.RdxCropperRootDirective, typeof i2.RdxCropperImageComponent, typeof i3.RdxCropperCropAreaDirective, typeof i4.RdxCropperDescriptionDirective], [typeof i1.RdxCropperRootDirective, typeof i2.RdxCropperImageComponent, typeof i3.RdxCropperCropAreaDirective, typeof i4.RdxCropperDescriptionDirective]>;
14
+ static ɵinj: i0.ɵɵInjectorDeclaration<RdxCropperModule>;
15
+ }
@@ -0,0 +1,12 @@
1
+ import { InjectionToken, InputSignal, WritableSignal } from '@angular/core';
2
+ export interface CropperContextToken {
3
+ image: InputSignal<string>;
4
+ getImageProps: () => {
5
+ [key: string]: any;
6
+ };
7
+ getImageWrapperStyle: () => Record<string, string>;
8
+ getCropAreaStyle: () => Record<string, string>;
9
+ descriptionId: WritableSignal<string>;
10
+ }
11
+ export declare const CROPPER_ROOT_CONTEXT: InjectionToken<CropperContextToken>;
12
+ export declare function injectCropperRootContext(): CropperContextToken;
@@ -0,0 +1,6 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class RdxCropperCropAreaDirective {
3
+ readonly rootContext: import("./cropper-context.token").CropperContextToken;
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxCropperCropAreaDirective, never>;
5
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxCropperCropAreaDirective, "[rdxCropperCropArea]", never, {}, {}, never, never, true, never>;
6
+ }
@@ -0,0 +1,6 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class RdxCropperDescriptionDirective {
3
+ readonly rootContext: import("./cropper-context.token").CropperContextToken;
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxCropperDescriptionDirective, never>;
5
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxCropperDescriptionDirective, "[rdxCropperDescription]", never, {}, {}, never, never, true, never>;
6
+ }
@@ -0,0 +1,10 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class RdxCropperImageComponent {
3
+ protected readonly rootContext: import("./cropper-context.token").CropperContextToken;
4
+ readonly imgClass: import("@angular/core").InputSignal<string | undefined>;
5
+ readonly imgStyles: import("@angular/core").InputSignal<string | undefined>;
6
+ protected readonly imgClasses: import("@angular/core").Signal<string | undefined>;
7
+ protected readonly imgStyless: import("@angular/core").Signal<string | undefined>;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxCropperImageComponent, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<RdxCropperImageComponent, "[rdxCropperImage]", never, { "imgClass": { "alias": "imgClass"; "required": false; "isSignal": true; }; "imgStyles": { "alias": "imgStyles"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
10
+ }
@@ -0,0 +1,91 @@
1
+ import { NumberInput } from '@angular/cdk/coercion';
2
+ import { CropperContextToken } from './cropper-context.token';
3
+ import * as i0 from "@angular/core";
4
+ export type Area = {
5
+ x: number;
6
+ y: number;
7
+ width: number;
8
+ height: number;
9
+ };
10
+ export declare class RdxCropperRootDirective implements CropperContextToken {
11
+ private readonly elementRef;
12
+ private readonly CROPPER_DESC_WARN_MESSAGE;
13
+ readonly image: import("@angular/core").InputSignal<string>;
14
+ readonly cropPadding: import("@angular/core").InputSignalWithTransform<number, unknown>;
15
+ readonly aspectRatio: import("@angular/core").InputSignalWithTransform<number, unknown>;
16
+ readonly minZoom: import("@angular/core").InputSignalWithTransform<number, unknown>;
17
+ readonly maxZoom: import("@angular/core").InputSignalWithTransform<number, unknown>;
18
+ readonly zoomSensitivity: import("@angular/core").InputSignalWithTransform<number, unknown>;
19
+ readonly keyboardStep: import("@angular/core").InputSignalWithTransform<number, unknown>;
20
+ readonly zoom: import("@angular/core").InputSignalWithTransform<number | undefined, NumberInput>;
21
+ readonly onCropChange: import("@angular/core").OutputEmitterRef<Area | null>;
22
+ readonly onZoomChange: import("@angular/core").OutputEmitterRef<number>;
23
+ private readonly imgWidth;
24
+ private readonly imgHeight;
25
+ private readonly cropAreaWidth;
26
+ private readonly cropAreaHeight;
27
+ private readonly imageWrapperWidth;
28
+ private readonly imageWrapperHeight;
29
+ private readonly offsetX;
30
+ private readonly offsetY;
31
+ private readonly internalZoom;
32
+ private readonly isDragging;
33
+ readonly descriptionId: import("@angular/core").WritableSignal<string>;
34
+ private readonly isZoomControlled;
35
+ protected readonly effectiveZoom: import("@angular/core").Signal<number>;
36
+ protected readonly zoomValueText: import("@angular/core").Signal<string>;
37
+ private readonly dragStartPoint;
38
+ private readonly dragStartOffset;
39
+ private readonly latestRestrictedOffset;
40
+ private readonly latestZoom;
41
+ private readonly isInitialSetupDone;
42
+ private readonly initialPinchDistance;
43
+ private readonly initialPinchZoom;
44
+ private readonly isPinching;
45
+ private readonly hasWarned;
46
+ constructor();
47
+ private updateZoom;
48
+ private initializeContainerDimensions;
49
+ private setupImageLoadEffect;
50
+ private setupDimensionsEffects;
51
+ private restrictOffset;
52
+ private calculateCropData;
53
+ private setupCropCalculationEffect;
54
+ private setupAccessibilityWarningEffect;
55
+ private setupEventListenersEffect;
56
+ private handleInteractionEnd;
57
+ /**
58
+ * @ignore
59
+ */
60
+ onMouseDown(e: MouseEvent): void;
61
+ private handleWheel;
62
+ private getPinchDistance;
63
+ private getPinchCenter;
64
+ private handleTouchStart;
65
+ private handleTouchMove;
66
+ private handleTouchEnd;
67
+ /**
68
+ * @ignore
69
+ */
70
+ onKeyDown(e: KeyboardEvent): void;
71
+ /**
72
+ * @ignore
73
+ */
74
+ onKeyUp(e: KeyboardEvent): void;
75
+ /**
76
+ * @ignore
77
+ */
78
+ getImageProps(): {
79
+ [key: string]: any;
80
+ };
81
+ /**
82
+ * @ignore
83
+ */
84
+ getImageWrapperStyle(): Record<string, string>;
85
+ /**
86
+ * @ignore
87
+ */
88
+ getCropAreaStyle(): Record<string, string>;
89
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxCropperRootDirective, never>;
90
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxCropperRootDirective, "[rdxCropperRoot]", never, { "image": { "alias": "image"; "required": true; "isSignal": true; }; "cropPadding": { "alias": "cropPadding"; "required": false; "isSignal": true; }; "aspectRatio": { "alias": "aspectRatio"; "required": false; "isSignal": true; }; "minZoom": { "alias": "minZoom"; "required": false; "isSignal": true; }; "maxZoom": { "alias": "maxZoom"; "required": false; "isSignal": true; }; "zoomSensitivity": { "alias": "zoomSensitivity"; "required": false; "isSignal": true; }; "keyboardStep": { "alias": "keyboardStep"; "required": false; "isSignal": true; }; "zoom": { "alias": "zoom"; "required": false; "isSignal": true; }; }, { "onCropChange": "onCropChange"; "onZoomChange": "onZoomChange"; }, never, never, true, never>;
91
+ }