@eagami/ui 0.6.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eagami/ui",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "description": "Lightweight, accessible Angular UI component library built on CSS custom properties",
5
5
  "author": "Michal Wiraszka <michal@eagami.com>",
6
6
  "license": "MIT",
@@ -36,6 +36,7 @@
36
36
  "default": "./fesm2022/eagami-ui.mjs"
37
37
  }
38
38
  },
39
+ "type": "module",
39
40
  "dependencies": {
40
41
  "tslib": "^2.3.0"
41
42
  }
@@ -42,6 +42,11 @@ interface AvatarEditorCropEvent {
42
42
  blob: Blob;
43
43
  dataUrl: string;
44
44
  }
45
+ interface AvatarEditorCropState {
46
+ zoom: number;
47
+ offsetX: number;
48
+ offsetY: number;
49
+ }
45
50
  declare class AvatarEditorComponent implements OnDestroy {
46
51
  readonly canvasEl: _angular_core.Signal<ElementRef<HTMLCanvasElement> | undefined>;
47
52
  readonly fileInputEl: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
@@ -54,9 +59,12 @@ declare class AvatarEditorComponent implements OnDestroy {
54
59
  readonly maxZoom: _angular_core.InputSignal<number>;
55
60
  readonly exportQuality: _angular_core.InputSignal<number>;
56
61
  readonly exportType: _angular_core.InputSignal<string>;
62
+ readonly cropState: _angular_core.InputSignal<AvatarEditorCropState | null | undefined>;
57
63
  readonly cropped: _angular_core.OutputEmitterRef<AvatarEditorCropEvent>;
64
+ readonly fileSelected: _angular_core.OutputEmitterRef<File>;
58
65
  readonly removed: _angular_core.OutputEmitterRef<void>;
59
66
  readonly fileError: _angular_core.OutputEmitterRef<string>;
67
+ readonly cropStateChange: _angular_core.OutputEmitterRef<AvatarEditorCropState>;
60
68
  readonly hasImage: _angular_core.WritableSignal<boolean>;
61
69
  readonly isDragOver: _angular_core.WritableSignal<boolean>;
62
70
  readonly zoom: _angular_core.WritableSignal<number>;
@@ -70,6 +78,7 @@ declare class AvatarEditorComponent implements OnDestroy {
70
78
  private hasDragged;
71
79
  private initialOffsetX;
72
80
  private initialOffsetY;
81
+ private _suppressCropStateEmit;
73
82
  readonly hostClasses: _angular_core.Signal<{
74
83
  [x: string]: boolean;
75
84
  'ea-avatar-editor--has-image': boolean;
@@ -99,7 +108,7 @@ declare class AvatarEditorComponent implements OnDestroy {
99
108
  onZoomInput(event: Event): void;
100
109
  removeImage(): void;
101
110
  revertImage(): void;
102
- exportCrop(): void;
111
+ exportCrop(): Promise<Blob>;
103
112
  private loadFromUrl;
104
113
  private loadFile;
105
114
  private scheduleDrawAfterRender;
@@ -108,9 +117,10 @@ declare class AvatarEditorComponent implements OnDestroy {
108
117
  private getDrawParams;
109
118
  private clampOffset;
110
119
  private draw;
120
+ private emitCropStateChange;
111
121
  private clearCanvas;
112
122
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AvatarEditorComponent, never>;
113
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<AvatarEditorComponent, "ea-avatar-editor", never, { "shape": { "alias": "shape"; "required": false; "isSignal": true; }; "canvasSize": { "alias": "canvasSize"; "required": false; "isSignal": true; }; "currentSrc": { "alias": "currentSrc"; "required": false; "isSignal": true; }; "accept": { "alias": "accept"; "required": false; "isSignal": true; }; "maxFileSize": { "alias": "maxFileSize"; "required": false; "isSignal": true; }; "minZoom": { "alias": "minZoom"; "required": false; "isSignal": true; }; "maxZoom": { "alias": "maxZoom"; "required": false; "isSignal": true; }; "exportQuality": { "alias": "exportQuality"; "required": false; "isSignal": true; }; "exportType": { "alias": "exportType"; "required": false; "isSignal": true; }; }, { "cropped": "cropped"; "removed": "removed"; "fileError": "fileError"; }, never, never, true, never>;
123
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<AvatarEditorComponent, "ea-avatar-editor", never, { "shape": { "alias": "shape"; "required": false; "isSignal": true; }; "canvasSize": { "alias": "canvasSize"; "required": false; "isSignal": true; }; "currentSrc": { "alias": "currentSrc"; "required": false; "isSignal": true; }; "accept": { "alias": "accept"; "required": false; "isSignal": true; }; "maxFileSize": { "alias": "maxFileSize"; "required": false; "isSignal": true; }; "minZoom": { "alias": "minZoom"; "required": false; "isSignal": true; }; "maxZoom": { "alias": "maxZoom"; "required": false; "isSignal": true; }; "exportQuality": { "alias": "exportQuality"; "required": false; "isSignal": true; }; "exportType": { "alias": "exportType"; "required": false; "isSignal": true; }; "cropState": { "alias": "cropState"; "required": false; "isSignal": true; }; }, { "cropped": "cropped"; "fileSelected": "fileSelected"; "removed": "removed"; "fileError": "fileError"; "cropStateChange": "cropStateChange"; }, never, never, true, never>;
114
124
  }
115
125
 
116
126
  type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
@@ -467,6 +477,26 @@ declare class InputComponent implements ControlValueAccessor, AfterViewInit {
467
477
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<InputComponent, "ea-input", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "status": { "alias": "status"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "errorMsg": { "alias": "error"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "autocomplete": { "alias": "autocomplete"; "required": false; "isSignal": true; }; "autofocus": { "alias": "autofocus"; "required": false; "isSignal": true; }; "showPasswordToggle": { "alias": "showPasswordToggle"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "inputFocused": "inputFocused"; "inputBlurred": "inputBlurred"; }, never, ["[slot=prefix]", "[slot=suffix]"], true, never>;
468
478
  }
469
479
 
480
+ type ProgressBarVariant = 'default' | 'success' | 'warning' | 'error' | 'info';
481
+ type ProgressBarSize = 'sm' | 'md' | 'lg';
482
+ declare class ProgressBarComponent {
483
+ readonly value: _angular_core.InputSignal<number>;
484
+ readonly max: _angular_core.InputSignal<number>;
485
+ readonly variant: _angular_core.InputSignal<ProgressBarVariant>;
486
+ readonly size: _angular_core.InputSignal<ProgressBarSize>;
487
+ readonly label: _angular_core.InputSignal<string>;
488
+ readonly showValue: _angular_core.InputSignal<boolean>;
489
+ readonly indeterminate: _angular_core.InputSignal<boolean>;
490
+ readonly percentage: _angular_core.Signal<number>;
491
+ readonly percentageRounded: _angular_core.Signal<number>;
492
+ readonly hostClasses: _angular_core.Signal<{
493
+ [x: string]: boolean;
494
+ 'ea-progress-bar--indeterminate': boolean;
495
+ }>;
496
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ProgressBarComponent, never>;
497
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ProgressBarComponent, "ea-progress-bar", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "showValue": { "alias": "showValue"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
498
+ }
499
+
470
500
  type RadioSize = 'sm' | 'md' | 'lg';
471
501
  type RadioOrientation = 'vertical' | 'horizontal';
472
502
  declare class RadioGroupComponent implements ControlValueAccessor {
@@ -590,6 +620,23 @@ declare class TabsComponent {
590
620
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<TabsComponent, "ea-tabs", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "activeTab": { "alias": "activeTab"; "required": false; "isSignal": true; }; }, { "activeTab": "activeTabChange"; "tabChange": "tabChange"; }, never, ["*"], true, never>;
591
621
  }
592
622
 
623
+ type TagVariant = 'default' | 'primary' | 'success' | 'warning' | 'error' | 'info';
624
+ type TagSize = 'sm' | 'md' | 'lg';
625
+ declare class TagComponent {
626
+ readonly variant: _angular_core.InputSignal<TagVariant>;
627
+ readonly size: _angular_core.InputSignal<TagSize>;
628
+ readonly removable: _angular_core.InputSignal<boolean>;
629
+ readonly disabled: _angular_core.InputSignal<boolean>;
630
+ readonly removed: _angular_core.OutputEmitterRef<void>;
631
+ readonly hostClasses: _angular_core.Signal<{
632
+ [x: string]: boolean;
633
+ 'ea-tag--disabled': boolean;
634
+ }>;
635
+ onRemove(event: MouseEvent): void;
636
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TagComponent, never>;
637
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<TagComponent, "ea-tag", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "removable": { "alias": "removable"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "removed": "removed"; }, never, ["*"], true, never>;
638
+ }
639
+
593
640
  type TextareaSize = 'sm' | 'md' | 'lg';
594
641
  type TextareaStatus = 'default' | 'error' | 'success';
595
642
  type TextareaResize = 'none' | 'vertical' | 'horizontal' | 'both';
@@ -686,5 +733,5 @@ declare class TooltipDirective implements OnDestroy {
686
733
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<TooltipDirective, "[eaTooltip]", never, { "eaTooltip": { "alias": "eaTooltip"; "required": true; "isSignal": true; }; "tooltipPosition": { "alias": "tooltipPosition"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
687
734
  }
688
735
 
689
- export { AccordionComponent, AccordionItemComponent, AlertCircleIconComponent, AlertComponent, AvatarComponent, AvatarEditorComponent, BadgeComponent, ButtonComponent, CameraIconComponent, CardComponent, CheckIconComponent, CheckboxComponent, ChevronDownIconComponent, CodeInputComponent, DialogComponent, DividerComponent, DropdownComponent, EyeIconComponent, EyeOffIconComponent, GoogleIconComponent, InfoIconComponent, InputComponent, LoaderIconComponent, MinusIconComponent, PlusIconComponent, RadioComponent, RadioGroupComponent, RotateCcwIconComponent, SkeletonComponent, SpinnerComponent, SwitchComponent, TabComponent, TabsComponent, TextareaComponent, ToastComponent, ToastService, TooltipDirective, TrashIconComponent, UploadIconComponent, UserIconComponent, XIconComponent };
690
- export type { AlertVariant, AvatarEditorCropEvent, AvatarEditorShape, AvatarShape, AvatarSize, BadgeSize, BadgeVariant, ButtonSize, ButtonType, ButtonVariant, CardHeaderAlign, CardPadding, CardVariant, CheckboxSize, CodeInputSize, CodeInputStatus, DialogSize, DividerOrientation, DropdownOption, DropdownSize, InputSize, InputStatus, InputType, RadioOrientation, RadioSize, SkeletonVariant, SpinnerSize, SwitchSize, TabsSize, TabsVariant, TextareaResize, TextareaSize, TextareaStatus, Toast, ToastOptions, ToastVariant, TooltipPosition };
736
+ export { AccordionComponent, AccordionItemComponent, AlertCircleIconComponent, AlertComponent, AvatarComponent, AvatarEditorComponent, BadgeComponent, ButtonComponent, CameraIconComponent, CardComponent, CheckIconComponent, CheckboxComponent, ChevronDownIconComponent, CodeInputComponent, DialogComponent, DividerComponent, DropdownComponent, EyeIconComponent, EyeOffIconComponent, GoogleIconComponent, InfoIconComponent, InputComponent, LoaderIconComponent, MinusIconComponent, PlusIconComponent, ProgressBarComponent, RadioComponent, RadioGroupComponent, RotateCcwIconComponent, SkeletonComponent, SpinnerComponent, SwitchComponent, TabComponent, TabsComponent, TagComponent, TextareaComponent, ToastComponent, ToastService, TooltipDirective, TrashIconComponent, UploadIconComponent, UserIconComponent, XIconComponent };
737
+ export type { AlertVariant, AvatarEditorCropEvent, AvatarEditorCropState, AvatarEditorShape, AvatarShape, AvatarSize, BadgeSize, BadgeVariant, ButtonSize, ButtonType, ButtonVariant, CardHeaderAlign, CardPadding, CardVariant, CheckboxSize, CodeInputSize, CodeInputStatus, DialogSize, DividerOrientation, DropdownOption, DropdownSize, InputSize, InputStatus, InputType, ProgressBarSize, ProgressBarVariant, RadioOrientation, RadioSize, SkeletonVariant, SpinnerSize, SwitchSize, TabsSize, TabsVariant, TagSize, TagVariant, TextareaResize, TextareaSize, TextareaStatus, Toast, ToastOptions, ToastVariant, TooltipPosition };