codexly-ui 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codexly-ui",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Standalone, signal-based Angular UI component library for Codexly, styled with Tailwind CSS.",
5
5
  "keywords": [
6
6
  "angular",
@@ -1,5 +1,5 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { Signal, InjectionToken, ElementRef, AfterViewInit, OnDestroy, AfterContentInit, OnInit, QueryList, TemplateRef, Provider, OnChanges, SimpleChanges } from '@angular/core';
2
+ import { Signal, InjectionToken, OnDestroy, ElementRef, AfterViewInit, AfterContentInit, OnInit, QueryList, TemplateRef, Provider, OnChanges, SimpleChanges } from '@angular/core';
3
3
  import * as codexly_ui from 'codexly-ui';
4
4
  import { ControlValueAccessor, FormControl, FormGroup } from '@angular/forms';
5
5
  import * as _angular_cdk_overlay from '@angular/cdk/overlay';
@@ -1084,8 +1084,31 @@ declare class ClxSliderComponent implements ControlValueAccessor {
1084
1084
 
1085
1085
  type ClxUploadSize = 'sm' | 'md' | 'lg';
1086
1086
  type ClxUploadError = 'fileType' | 'fileSize';
1087
+ /** An already-persisted file (e.g. previously uploaded to the backend). Rendered alongside
1088
+ * newly-selected local files in the same preview list. Removing one only emits
1089
+ * `existingFileRemove` — the component never calls the backend itself. */
1090
+ interface ClxExistingFile {
1091
+ id: string;
1092
+ url: string;
1093
+ name?: string;
1094
+ /** Set when the caller wants per-file status overlays (e.g. processing/failed thumbnails). */
1095
+ status?: 'DONE' | 'PENDING' | 'PROCESSING' | 'FAILED';
1096
+ }
1087
1097
 
1088
- declare class ClxUploadComponent implements ControlValueAccessor {
1098
+ interface ClxUploadPreviewItem {
1099
+ kind: 'existing' | 'new';
1100
+ key: string;
1101
+ name: string;
1102
+ size?: number;
1103
+ isImage: boolean;
1104
+ thumbUrl: string | null;
1105
+ fileIcon: string;
1106
+ fileColor: string;
1107
+ status?: ClxExistingFile['status'];
1108
+ existing?: ClxExistingFile;
1109
+ file?: File;
1110
+ }
1111
+ declare class ClxUploadComponent implements ControlValueAccessor, OnDestroy {
1089
1112
  private readonly _themeSvc;
1090
1113
  readonly multiple: _angular_core.InputSignal<boolean>;
1091
1114
  readonly accept: _angular_core.InputSignal<string>;
@@ -1096,14 +1119,21 @@ declare class ClxUploadComponent implements ControlValueAccessor {
1096
1119
  readonly size: _angular_core.InputSignal<ClxUploadSize | undefined>;
1097
1120
  protected readonly _size: _angular_core.Signal<ClxUploadSize>;
1098
1121
  readonly disabled: _angular_core.InputSignal<boolean>;
1122
+ /** Already-persisted files (e.g. previously uploaded to the backend). Rendered in the same
1123
+ * preview grid as newly-selected local files. The component never deletes these itself —
1124
+ * removing one only emits `existingFileRemove`, letting the caller decide (e.g. call the API). */
1125
+ readonly existingFiles: _angular_core.InputSignal<ClxExistingFile[]>;
1099
1126
  readonly onUploadError: _angular_core.OutputEmitterRef<{
1100
1127
  file: File;
1101
1128
  error: ClxUploadError;
1102
1129
  }>;
1103
1130
  readonly onUploadSuccess: _angular_core.OutputEmitterRef<File[]>;
1131
+ readonly existingFileRemove: _angular_core.OutputEmitterRef<string>;
1104
1132
  readonly _files: _angular_core.WritableSignal<File[]>;
1105
1133
  readonly _isDragging: _angular_core.WritableSignal<boolean>;
1106
1134
  readonly _errorKey: _angular_core.WritableSignal<ClxUploadError | null>;
1135
+ /** File → object URL cache, so we don't re-create (and leak) a new URL on every re-render. */
1136
+ private readonly _objectUrls;
1107
1137
  private readonly _ngControl;
1108
1138
  private readonly _cvaDisabled;
1109
1139
  private _cvaConnected;
@@ -1119,8 +1149,9 @@ declare class ClxUploadComponent implements ControlValueAccessor {
1119
1149
  hint: string;
1120
1150
  }>;
1121
1151
  protected readonly _isError: _angular_core.Signal<boolean>;
1122
- protected readonly _fileItemClass: _angular_core.Signal<string>;
1123
- protected readonly _fileIconClass: _angular_core.Signal<string>;
1152
+ protected readonly _thumbClass: _angular_core.Signal<string>;
1153
+ protected readonly _fileCardClass: _angular_core.Signal<string>;
1154
+ protected readonly _previewItems: _angular_core.Signal<ClxUploadPreviewItem[]>;
1124
1155
  protected readonly _zoneClass: _angular_core.Signal<string>;
1125
1156
  protected readonly _iconClass: _angular_core.Signal<string>;
1126
1157
  protected readonly _linkClass: _angular_core.Signal<string>;
@@ -1136,13 +1167,16 @@ declare class ClxUploadComponent implements ControlValueAccessor {
1136
1167
  protected _onDragOver(event: DragEvent): void;
1137
1168
  protected _onDragLeave(): void;
1138
1169
  protected _onDrop(event: DragEvent): void;
1139
- protected _removeFile(file: File): void;
1170
+ protected _removeItem(item: ClxUploadPreviewItem): void;
1171
+ private _getObjectUrl;
1172
+ private _releaseObjectUrl;
1173
+ ngOnDestroy(): void;
1140
1174
  private _addFiles;
1141
1175
  private _isAccepted;
1142
1176
  private _emit;
1143
1177
  protected _formatSize(bytes: number): string;
1144
1178
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ClxUploadComponent, never>;
1145
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ClxUploadComponent, "clx-upload", never, { "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "accept": { "alias": "accept"; "required": false; "isSignal": true; }; "maxFileSize": { "alias": "maxFileSize"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "onUploadError": "onUploadError"; "onUploadSuccess": "onUploadSuccess"; }, never, ["[clx-label]"], true, never>;
1179
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ClxUploadComponent, "clx-upload", never, { "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "accept": { "alias": "accept"; "required": false; "isSignal": true; }; "maxFileSize": { "alias": "maxFileSize"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "existingFiles": { "alias": "existingFiles"; "required": false; "isSignal": true; }; }, { "onUploadError": "onUploadError"; "onUploadSuccess": "onUploadSuccess"; "existingFileRemove": "existingFileRemove"; }, never, ["[clx-label]"], true, never>;
1146
1180
  }
1147
1181
 
1148
1182
  type ClxColorPickerSize = 'sm' | 'md' | 'lg';
@@ -3064,4 +3098,4 @@ declare class ClxToastService {
3064
3098
  }
3065
3099
 
3066
3100
  export { CLX_ADDON_BORDER, CLX_ADDON_TEXT, CLX_ALERT_OPTIONS, CLX_ALERT_RESOLVE, CLX_BG_ADDON, CLX_BG_DISABLED, CLX_BG_ICON_WRAP, CLX_BG_SECTION, CLX_BG_SURFACE, CLX_BORDER_DEFAULT, CLX_BORDER_DISABLED, CLX_BORDER_MEDIUM, CLX_COLOR_HEX, CLX_COLOR_HEX_100, CLX_COLOR_MAP, CLX_FONT_CATALOG, CLX_MODAL_ANIM_CONFIG, CLX_MODAL_DATA, CLX_MODAL_REF, CLX_OPTION_DISABLED, CLX_PLACEHOLDER, CLX_RADIO_GROUP, CLX_RADIUS_MAP, CLX_TEXT_BODY, CLX_TEXT_DISABLED, CLX_TEXT_HEADING, CLX_TEXT_HINT, CLX_TEXT_IDLE, CLX_TEXT_INPUT, CLX_TEXT_LABEL, CLX_TEXT_OPTION, CLX_TEXT_SUBTITLE, CLX_TEXT_TITLE, CLX_THEME_CONFIG, CLX_THEME_DEFAULTS, CLX_TOAST_DEFAULTS, ClxAlertComponent, ClxAlertService, ClxAnimateDirective, ClxAnimateGroupDirective, ClxAnimateService, ClxAppLayoutComponent, ClxAvatarComponent, ClxBadgeComponent, ClxBrandComponent, ClxButtonComponent, ClxButtonGroupComponent, ClxCardBodyDirective, ClxCardComponent, ClxCardFooterDirective, ClxCardHeaderDirective, ClxCarouselComponent, ClxCarouselDirective, ClxCartComponent, ClxCartSummaryDrawer, ClxCellDirective, ClxCheckboxComponent, ClxColorPickerComponent, ClxColumnDefDirective, ClxDateRangePickerComponent, ClxDatepickerComponent, ClxDrawerComponent, ClxDrawerService, ClxEditorComponent, ClxEditorLinkModalComponent, ClxFilterPanelComponent, ClxHeaderCellDirective, ClxIconComponent, ClxInputComponent, ClxListComponent, ClxListItemComponent, ClxMenuComponent, ClxMenuItemComponent, ClxModalComponent, ClxModalService, ClxNavGroupComponent, ClxNumberComponent, ClxPageEmptyComponent, ClxPageNotFoundComponent, ClxPageServerErrorComponent, ClxPageUnauthorizedComponent, ClxPaginationComponent, ClxProductComponent, ClxProductDetailComponent, ClxProfileComponent, ClxProgressBarComponent, ClxRadioComponent, ClxRadioGroupComponent, ClxRatingComponent, ClxSelectComponent, ClxSkeletonComponent, ClxSliderComponent, ClxSpinnerComponent, ClxStatCardComponent, ClxStepComponent, ClxStepperComponent, ClxSwitchComponent, ClxTabDirective, ClxTableComponent, ClxTabsComponent, ClxTagComponent, ClxTextareaComponent, ClxThemeService, ClxTimelineComponent, ClxTimelineItemComponent, ClxTimepickerComponent, ClxToastComponent, ClxToastContainerComponent, ClxToastService, ClxTooltipComponent, ClxTooltipDirective, ClxTreeComponent, ClxUploadComponent, ClxWishlistComponent, ClxWizardComponent, TIMEPICKER_SIZE_MAP, parseColorInput, provideCodexlyTheme, resolveColor, resolveContainerRadius, resolveRadius };
3067
- export type { ClxAlertButtonOptions, ClxAlertOptions, ClxAlertResult, ClxAlertType, ClxAnimateAttentionSeeker, ClxAnimateBackEntrance, ClxAnimateBackExit, ClxAnimateBouncingEntrance, ClxAnimateBouncingExit, ClxAnimateConfig, ClxAnimateDefaults, ClxAnimateEvent, ClxAnimateFadingEntrance, ClxAnimateFadingExit, ClxAnimateFlipper, ClxAnimateLightspeed, ClxAnimateName, ClxAnimateRotatingEntrance, ClxAnimateRotatingExit, ClxAnimateSlidingEntrance, ClxAnimateSlidingExit, ClxAnimateSpecial, ClxAnimateTrigger, ClxAnimateZoomingEntrance, ClxAnimateZoomingExit, ClxAvatarContentType, ClxBadgeVariant, ClxButtonColor, ClxButtonGroupShape, ClxButtonVariant, ClxCardPadding, ClxCardShadow, ClxCardVariant, ClxCarouselAspectRatio, ClxCarouselConfig, ClxCartItem, ClxCartSummaryData, ClxCellContext, ClxCheckboxVariant, ClxColor, ClxColorInput, ClxColorPickerFormat, ClxColorPickerSize, ClxColorResolved, ClxColorTokens, ClxCouponResult, ClxDateRange, ClxDateRangePickerSize, ClxDateRangePickerStatus, ClxDatepickerSize, ClxDatepickerStatus, ClxDrawerButtonOptions, ClxDrawerConfig, ClxDrawerRef, ClxDrawerSize, ClxEditorSize, ClxEditorTool, ClxEditorToolbarGroup, ClxFilterChangeEvent, ClxFilterField, ClxFilterFieldType, ClxFilterOption, ClxFilterValue, ClxFilterValues, ClxFontFamily, ClxFontOption, ClxInputSize, ClxInputStatus, ClxInputType, ClxListItem, ClxListSize, ClxListVariant, ClxModalButtonOptions, ClxModalConfig, ClxModalRef, ClxModalSize, ClxNumberSize, ClxNumberVariant, ClxPageChangeEvent, ClxPageSizeChangeEvent, ClxPaginationSize, ClxProduct, ClxProductDescription, ClxProductDetailData, ClxProductLayout, ClxProductSize, ClxProductSpec, ClxProfileMenuItem, ClxProgressBarSize, ClxProgressBarVariant, ClxRadioVariant, ClxReview, ClxRippleItem, ClxSelectOption, ClxSelectSize, ClxShade, ClxShape, ClxSize, ClxSkeletonVariant, ClxSliderSize, ClxSpecOption, ClxSpecType, ClxSpinnerColor, ClxSpinnerVariant, ClxStatMetric, ClxStepperOrientation, ClxStepperSize, ClxStepperStatus, ClxStepperStep, ClxTabItem, ClxTableColumn, ClxTablePageEvent, ClxTableSelectionEvent, ClxTableSort, ClxTableSortEvent, ClxTagShape, ClxTagSize, ClxTagVariant, ClxTextareaResize, ClxTextareaSize, ClxTextareaStatus, ClxThemeConfig, ClxThemeMode, ClxTimelineLineStyle, ClxTimelineMode, ClxTimelineSize, ClxTimepickerSize, ClxTimepickerStatus, ClxToastAction, ClxToastEntry, ClxToastOptions, ClxToastPosition, ClxToastType, ClxTooltipPosition, ClxTooltipSize, ClxTreeExpandEvent, ClxTreeNode, ClxTreeSelectEvent, ClxTreeSize, ClxTreeVariant, ClxTrendDirection, ClxUploadError, ClxUploadSize, ClxVariation, ClxWishlistItem, ClxWishlistPageChangeEvent, ClxWizardColor, ClxWizardOrientation, ClxWizardStepStatus, SparkPoint };
3101
+ export type { ClxAlertButtonOptions, ClxAlertOptions, ClxAlertResult, ClxAlertType, ClxAnimateAttentionSeeker, ClxAnimateBackEntrance, ClxAnimateBackExit, ClxAnimateBouncingEntrance, ClxAnimateBouncingExit, ClxAnimateConfig, ClxAnimateDefaults, ClxAnimateEvent, ClxAnimateFadingEntrance, ClxAnimateFadingExit, ClxAnimateFlipper, ClxAnimateLightspeed, ClxAnimateName, ClxAnimateRotatingEntrance, ClxAnimateRotatingExit, ClxAnimateSlidingEntrance, ClxAnimateSlidingExit, ClxAnimateSpecial, ClxAnimateTrigger, ClxAnimateZoomingEntrance, ClxAnimateZoomingExit, ClxAvatarContentType, ClxBadgeVariant, ClxButtonColor, ClxButtonGroupShape, ClxButtonVariant, ClxCardPadding, ClxCardShadow, ClxCardVariant, ClxCarouselAspectRatio, ClxCarouselConfig, ClxCartItem, ClxCartSummaryData, ClxCellContext, ClxCheckboxVariant, ClxColor, ClxColorInput, ClxColorPickerFormat, ClxColorPickerSize, ClxColorResolved, ClxColorTokens, ClxCouponResult, ClxDateRange, ClxDateRangePickerSize, ClxDateRangePickerStatus, ClxDatepickerSize, ClxDatepickerStatus, ClxDrawerButtonOptions, ClxDrawerConfig, ClxDrawerRef, ClxDrawerSize, ClxEditorSize, ClxEditorTool, ClxEditorToolbarGroup, ClxExistingFile, ClxFilterChangeEvent, ClxFilterField, ClxFilterFieldType, ClxFilterOption, ClxFilterValue, ClxFilterValues, ClxFontFamily, ClxFontOption, ClxInputSize, ClxInputStatus, ClxInputType, ClxListItem, ClxListSize, ClxListVariant, ClxModalButtonOptions, ClxModalConfig, ClxModalRef, ClxModalSize, ClxNumberSize, ClxNumberVariant, ClxPageChangeEvent, ClxPageSizeChangeEvent, ClxPaginationSize, ClxProduct, ClxProductDescription, ClxProductDetailData, ClxProductLayout, ClxProductSize, ClxProductSpec, ClxProfileMenuItem, ClxProgressBarSize, ClxProgressBarVariant, ClxRadioVariant, ClxReview, ClxRippleItem, ClxSelectOption, ClxSelectSize, ClxShade, ClxShape, ClxSize, ClxSkeletonVariant, ClxSliderSize, ClxSpecOption, ClxSpecType, ClxSpinnerColor, ClxSpinnerVariant, ClxStatMetric, ClxStepperOrientation, ClxStepperSize, ClxStepperStatus, ClxStepperStep, ClxTabItem, ClxTableColumn, ClxTablePageEvent, ClxTableSelectionEvent, ClxTableSort, ClxTableSortEvent, ClxTagShape, ClxTagSize, ClxTagVariant, ClxTextareaResize, ClxTextareaSize, ClxTextareaStatus, ClxThemeConfig, ClxThemeMode, ClxTimelineLineStyle, ClxTimelineMode, ClxTimelineSize, ClxTimepickerSize, ClxTimepickerStatus, ClxToastAction, ClxToastEntry, ClxToastOptions, ClxToastPosition, ClxToastType, ClxTooltipPosition, ClxTooltipSize, ClxTreeExpandEvent, ClxTreeNode, ClxTreeSelectEvent, ClxTreeSize, ClxTreeVariant, ClxTrendDirection, ClxUploadError, ClxUploadSize, ClxVariation, ClxWishlistItem, ClxWishlistPageChangeEvent, ClxWizardColor, ClxWizardOrientation, ClxWizardStepStatus, SparkPoint };