fw-webbuilder 1.1.268 → 1.1.270

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/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { HttpClient } from '@angular/common/http';
1
+ import { HttpClient, HttpEvent } from '@angular/common/http';
2
2
  import { Subject, Observable, Subscription } from 'rxjs';
3
3
  import * as i0 from '@angular/core';
4
4
  import { OnInit, ElementRef, Renderer2, SimpleChanges, OnDestroy, OnChanges, DoCheck, ChangeDetectorRef, AfterViewInit, InjectionToken } from '@angular/core';
@@ -245,6 +245,15 @@ declare class webBuilderService {
245
245
  * @returns
246
246
  */
247
247
  deleteObject(object: any, code?: any): Promise<any>;
248
+ /**
249
+ * Nén ảnh thông minh trước khi upload:
250
+ * - Bỏ qua file không phải ảnh hoặc file svg, gif
251
+ * - Bỏ qua ảnh <= 1MB
252
+ * - Giới hạn kích thước tối đa 2560px (chuẩn 2K)
253
+ * - Nén chất lượng 85% giữ độ sắc nét hoàn hảo
254
+ */
255
+ compressImage(file: File, maxWidth?: number, maxHeight?: number, quality?: number): Promise<File>;
256
+ uploadFileWithProgress(file: File, newPath: string): Observable<HttpEvent<any>>;
248
257
  uploadFile(file: File, newPath: string, options?: any): Promise<Object>;
249
258
  upLoadImage(file: any, oldPath: string, newPath: string, options?: any): Promise<any>;
250
259
  addCategory(data: any): Promise<any>;
@@ -378,11 +387,6 @@ declare class webBuilderService {
378
387
  getOrders_byFields(query: any, sort: any, page?: number, limit?: number): Promise<any>;
379
388
  updateOrder(id: string, data: any): Promise<any>;
380
389
  deleteOrder(id: string): Promise<any>;
381
- /**
382
- * Hàm tạo ID đối tượng theo định dạng ObjectId của MongoDB
383
- * @returns {string} ID đối tượng 24 ký tự hex
384
- */
385
- generateObjectId(): string;
386
390
  addAdminCategory(data: any): Promise<any>;
387
391
  updateAdminCategory(id: string, data: any): Promise<any>;
388
392
  deleteAdminCategory(id: string): Promise<any>;
@@ -451,6 +455,38 @@ declare class webBuilderService {
451
455
  * Trích xuất tên các Font từ chuỗi HTML link của Google Fonts
452
456
  */
453
457
  getFontNames(fontHtml: string): string[];
458
+ /**
459
+ * hàm chuyển tên thành slug
460
+ * vd: "Giới thieu" => "gioi-thieu"
461
+ * @param name tên cần format
462
+ */
463
+ convertNameToSlug(name: string): string;
464
+ removeVietnamese(str: string): string;
465
+ /**
466
+ * Hàm sắp xếp mảng các đối tượng theo trường tiếng Việt
467
+ * @param data_filter
468
+ * @param field
469
+ * @param lang
470
+ * @param order
471
+ * @returns
472
+ */
473
+ sortVietnameseString(data_filter: any[], field: string, lang?: string, order?: number): any[];
474
+ /**
475
+ * Hàm tạo ID đối tượng theo định dạng ObjectId của MongoDB
476
+ * @returns {string} ID đối tượng 24 ký tự hex
477
+ */
478
+ generateObjectId(): string;
479
+ /**
480
+ * Tạo màu hex ngẫu nhiên
481
+ * @returns {string} Màu hex ngẫu nhiên
482
+ */
483
+ randomColor(): string;
484
+ handleNextPrevFrame(_this: any, direction: 'next' | 'prev', classTransition: string): void;
485
+ handleNextPrevCol(_this: any, direction: 'next' | 'prev', classTransition: string): void;
486
+ onMouseDown(_this: any, event: any, type: 'mouse' | 'touch', classTransition: string): void;
487
+ onMouseMove(_this: any, event: any, type: 'mouse' | 'touch'): void;
488
+ onMouseUp(_this: any, event: any, type: 'mouse' | 'touch', classTransition: string): void;
489
+ onMouseLeave(_this: any, event: any): void;
454
490
  static ɵfac: i0.ɵɵFactoryDeclaration<webBuilderService, never>;
455
491
  static ɵprov: i0.ɵɵInjectableDeclaration<webBuilderService>;
456
492
  }
@@ -1829,7 +1865,6 @@ declare class WbFrameProductDetailConfig implements OnInit {
1829
1865
 
1830
1866
  declare class WbFrameProducts implements OnInit, OnDestroy {
1831
1867
  webBuilderService: webBuilderService;
1832
- functionService: FunctionService;
1833
1868
  elementRef: ElementRef;
1834
1869
  authService: AuthService;
1835
1870
  map: ComponentMapService;
@@ -1866,7 +1901,7 @@ declare class WbFrameProducts implements OnInit, OnDestroy {
1866
1901
  changeGridSub: any;
1867
1902
  private lastGridSignature;
1868
1903
  autoSlideInterval: any;
1869
- constructor(webBuilderService: webBuilderService, functionService: FunctionService, elementRef: ElementRef, authService: AuthService, map: ComponentMapService);
1904
+ constructor(webBuilderService: webBuilderService, elementRef: ElementRef, authService: AuthService, map: ComponentMapService);
1870
1905
  ngOnInit(): void;
1871
1906
  updateDataClone(): void;
1872
1907
  ngOnChanges(changes: SimpleChanges): void;
@@ -1908,9 +1943,9 @@ declare class WbFrameProductsConfig implements OnInit {
1908
1943
 
1909
1944
  declare class WbFrameProductsAdmin implements OnInit {
1910
1945
  webBuilderService: webBuilderService;
1911
- functionService: FunctionService;
1912
1946
  private modal;
1913
1947
  private translate;
1948
+ private toast;
1914
1949
  data: any;
1915
1950
  device: any;
1916
1951
  categories: any;
@@ -1931,7 +1966,7 @@ declare class WbFrameProductsAdmin implements OnInit {
1931
1966
  pageSize: number;
1932
1967
  readonly nzModalData: any;
1933
1968
  dataMap: any;
1934
- constructor(webBuilderService: webBuilderService, functionService: FunctionService, modal: NzModalService, translate: TranslateService);
1969
+ constructor(webBuilderService: webBuilderService, modal: NzModalService, translate: TranslateService, toast: NzMessageService);
1935
1970
  ngOnInit(): void;
1936
1971
  ngAfterViewInit(): void;
1937
1972
  getCategories(): void;
@@ -2240,13 +2275,13 @@ declare class WbButton implements OnInit {
2240
2275
  private router;
2241
2276
  webBuilderService: webBuilderService;
2242
2277
  authService: AuthService;
2243
- functionService: FunctionService;
2244
2278
  elementRef: ElementRef;
2245
2279
  private modal;
2246
2280
  modalRef: NzModalRef<WbBlockBlank>;
2247
2281
  private drawerService;
2248
2282
  private cart;
2249
2283
  private translate;
2284
+ private toast;
2250
2285
  data: any;
2251
2286
  device: any;
2252
2287
  class: any;
@@ -2267,7 +2302,7 @@ declare class WbButton implements OnInit {
2267
2302
  _scrollHandler: any;
2268
2303
  routerSubscription: any;
2269
2304
  previousUrl: string;
2270
- constructor(router: Router, webBuilderService: webBuilderService, authService: AuthService, functionService: FunctionService, elementRef: ElementRef, modal: NzModalService, modalRef: NzModalRef<WbBlockBlank>, drawerService: DrawerService, cart: CartService, translate: TranslateService);
2305
+ constructor(router: Router, webBuilderService: webBuilderService, authService: AuthService, elementRef: ElementRef, modal: NzModalService, modalRef: NzModalRef<WbBlockBlank>, drawerService: DrawerService, cart: CartService, translate: TranslateService, toast: NzMessageService);
2271
2306
  ngOnInit(): void;
2272
2307
  onDblClickContent(event: MouseEvent): void;
2273
2308
  onEditContentBlur(): void;
@@ -2307,7 +2342,7 @@ declare class WbButton implements OnInit {
2307
2342
  getIcon(): any;
2308
2343
  handleSendContact(): void;
2309
2344
  getHref(): any;
2310
- static ɵfac: i0.ɵɵFactoryDeclaration<WbButton, [null, null, null, null, null, null, { optional: true; }, null, null, null]>;
2345
+ static ɵfac: i0.ɵɵFactoryDeclaration<WbButton, [null, null, null, null, null, { optional: true; }, null, null, null, null]>;
2311
2346
  static ɵcmp: i0.ɵɵComponentDeclaration<WbButton, "wb-button", never, { "data": { "alias": "data"; "required": false; }; "device": { "alias": "device"; "required": false; }; "class": { "alias": "class"; "required": false; }; "config": { "alias": "config"; "required": false; }; "animation": { "alias": "animation"; "required": false; }; "type": { "alias": "type"; "required": false; }; "isClone": { "alias": "isClone"; "required": false; }; "product": { "alias": "product"; "required": false; }; }, {}, never, never, true, never>;
2312
2347
  }
2313
2348
 
@@ -2795,7 +2830,6 @@ declare class WbCheckboxFilterConfig implements OnInit {
2795
2830
 
2796
2831
  declare class WbProductImageList implements OnInit {
2797
2832
  webBuilderService: webBuilderService;
2798
- private functionService;
2799
2833
  data: any;
2800
2834
  device: any;
2801
2835
  class: any;
@@ -2806,7 +2840,7 @@ declare class WbProductImageList implements OnInit {
2806
2840
  product: any;
2807
2841
  imgs: any;
2808
2842
  changeNumberImgsSub: any;
2809
- constructor(webBuilderService: webBuilderService, functionService: FunctionService);
2843
+ constructor(webBuilderService: webBuilderService);
2810
2844
  ngOnInit(): void;
2811
2845
  updateDataClone(): void;
2812
2846
  ngOnChanges(changes: SimpleChanges): void;
@@ -2904,6 +2938,17 @@ declare class SelectLanguageComponent implements OnInit {
2904
2938
  static ɵcmp: i0.ɵɵComponentDeclaration<SelectLanguageComponent, "app-select-language", never, { "availableLanguage": { "alias": "availableLanguage"; "required": false; }; }, {}, never, never, true, never>;
2905
2939
  }
2906
2940
 
2941
+ interface UploadTask {
2942
+ id: string;
2943
+ file: File;
2944
+ previewUrl: string;
2945
+ progress: number;
2946
+ loaded: number;
2947
+ total: number;
2948
+ status: 'uploading' | 'success' | 'error';
2949
+ errorMsg?: string;
2950
+ serverData?: any;
2951
+ }
2907
2952
  declare class ManageImgsComponent implements OnInit {
2908
2953
  webbuilderService: webBuilderService;
2909
2954
  private msg;
@@ -2911,6 +2956,11 @@ declare class ManageImgsComponent implements OnInit {
2911
2956
  private modal;
2912
2957
  modalRef: NzModalRef<ManageImgsComponent>;
2913
2958
  files: any;
2959
+ uploadTasks: UploadTask[];
2960
+ isUploadDrawerOpen: boolean;
2961
+ isUploadDrawerVisible: boolean;
2962
+ get completedUploadCount(): number;
2963
+ get activeUploadingTasks(): UploadTask[];
2914
2964
  private searchSubject;
2915
2965
  path: any;
2916
2966
  currentTab: any;
@@ -2944,7 +2994,7 @@ declare class ManageImgsComponent implements OnInit {
2944
2994
  onDragLeave(event: DragEvent): void;
2945
2995
  onDrop(event: DragEvent): void;
2946
2996
  onFilesChange(e: any): void;
2947
- handleUploadFiles(selectedFiles: FileList | File[], fileInputTarget?: any): void;
2997
+ handleUploadFiles(selectedFiles: FileList | File[], fileInputTarget?: any): Promise<void>;
2948
2998
  onDelete(item: any): void;
2949
2999
  onChangePath(item: any): void;
2950
3000
  onSelectFile(item: any, event: MouseEvent): void;
@@ -3094,3 +3144,4 @@ declare class WbStyleDirective implements DoCheck {
3094
3144
  declare const WEBBUILDER_API_URL: InjectionToken<string>;
3095
3145
 
3096
3146
  export { AuthService, COUNTRY_CODES, CartService, CommonConfigMapService, ComponentConfigMapService, ComponentMapService, DEVICES, DrawerService, FONTS, FunctionService, LIST_LANGUAGES, MAIN_SECTOR, ManageImgsComponent, PAYMENT_METHODS, SelectLanguageComponent, TOOLS, TOOLS_BLOCK, TOOLS_OBJECT, WEBBUILDER_API_URL, WbAnimationConfig, WbBackgroundColorConfig, WbBannerAnimationConfig, WbBlockBlank, WbBlockBlankConfig, WbBorderConfig, WbBorderRadiusConfig, WbBreadcumb, WbBreadcumbConfig, WbButton, WbButtonConfig, WbButtonQuantity, WbButtonQuantityConfig, WbButtonSetDefaultAddress, WbButtonSetDefaultAddressConfig, WbCheckboxConfig, WbCheckboxFilter, WbCheckboxFilterConfig, WbCkeditorConfig, WbDialogConfig, WbDragDrop, WbFilterConfig, WbFilterImageConfig, WbFixedConfig, WbFrameBanner, WbFrameBannerConfig, WbFrameBlank, WbFrameBlankConfig, WbFrameCart, WbFrameCartConfig, WbFrameCollapse, WbFrameCollapseConfig, WbFrameContentConfig, WbFrameProductDetail, WbFrameProductDetailConfig, WbFrameProducts, WbFrameProductsAdmin, WbFrameProductsByCategory, WbFrameProductsByCategoryConfig, WbFrameProductsConfig, WbFrameTab, WbFrameTabConfig, WbFreeblockConfig, WbGoogleMap, WbGoogleMapConfig, WbGridConfig, WbHideShowConfig, WbIconConfig, WbImage, WbImageConfig, WbImageListNumberConfig, WbInput, WbInputConfig, WbLine, WbLineConfig, WbLinkPageConfig, WbMapConfig, WbMaskImageConfig, WbMenuContentConfig, WbMenuHorizontal, WbMenuHorizontalConfig, WbMenuMobile, WbMenuMobileConfig, WbObjectFitConfig, WbOrdinalConfig, WbPaddingConfig, WbPageConfig, WbPaginationConfig, WbPositionConfig, WbPositionInConfig, WbPositionOutConfig, WbProductImageList, WbProductImageListConfig, WbProductSelectAttribute, WbProductSelectAttributeConfig, WbRotateConfig, WbScrollbarConfig, WbSelectCountry, WbSelectCountryConfig, WbSelectProvinceDistrictWard, WbSelectProvinceDistrictWardConfig, WbShadowConfig, WbSlideConfig, WbStickyConfig, WbStyleDirective, WbText, WbTextConfig, WbTextFormatConfig, WbTextParagraph, WbTextParagraphConfig, WbToolTipConfig, WbUploadImageConfig, WbVideo, WbVideoConfig, WbVirtualSelected, WbWidthHeightConfig, webBuilderService };
3147
+ export type { UploadTask };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fw-webbuilder",
3
- "version": "1.1.268",
3
+ "version": "1.1.270",
4
4
  "peerDependencies": {
5
5
  "@fingerprintjs/fingerprintjs": "^5.2.0",
6
6
  "@abacritt/angularx-social-login": "2.4.0",