fw-webbuilder 0.0.3 → 0.0.5

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,14 +1,14 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
2
  import { Subject, Observable, Subscription } from 'rxjs';
3
3
  import * as i0 from '@angular/core';
4
- import { OnInit, ElementRef, Renderer2, SimpleChanges, ChangeDetectorRef, OnDestroy, InjectionToken } from '@angular/core';
5
- import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
4
+ import { OnInit, ElementRef, Renderer2, SimpleChanges, OnDestroy, ChangeDetectorRef, InjectionToken } from '@angular/core';
5
+ import { Router, ActivatedRoute } from '@angular/router';
6
6
  import * as ng_zorro_antd_message from 'ng-zorro-antd/message';
7
7
  import { NzMessageService } from 'ng-zorro-antd/message';
8
+ import { Overlay } from '@angular/cdk/overlay';
9
+ import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
8
10
  import { CdkDragDrop } from '@angular/cdk/drag-drop';
9
- import { Router, ActivatedRoute } from '@angular/router';
10
11
  import { NzTableQueryParams } from 'ng-zorro-antd/table';
11
- import { Overlay } from '@angular/cdk/overlay';
12
12
  import { SafeHtml, DomSanitizer } from '@angular/platform-browser';
13
13
 
14
14
  declare class SocketService {
@@ -319,6 +319,144 @@ declare class CommonConfigMapService {
319
319
  static ɵprov: i0.ɵɵInjectableDeclaration<CommonConfigMapService>;
320
320
  }
321
321
 
322
+ /**
323
+ * endUser = {
324
+ * email: string,
325
+ * name: string,
326
+ * phone: string,
327
+ * country: string,
328
+ * addresses: [
329
+ * {
330
+ * _id: string
331
+ * address: string,
332
+ * is_default: boolean
333
+ * name: string
334
+ * phone: string
335
+ * city: string
336
+ * district: string
337
+ * ward: string
338
+ * }
339
+ * ],
340
+ * }
341
+ */
342
+ declare class AuthService {
343
+ private http;
344
+ private toast;
345
+ private webBuilderService;
346
+ private router;
347
+ private apiUrl;
348
+ private urlBE;
349
+ private user;
350
+ private endUser;
351
+ constructor(http: HttpClient, toast: NzMessageService, webBuilderService: webBuilderService, router: Router);
352
+ private wrapApiCall;
353
+ handleLogin(email: string, password: string): Promise<any>;
354
+ handleRegister(name: string, email: string, password: string): Promise<any>;
355
+ handleLogout(): Promise<any>;
356
+ checkAuthUser(): Observable<boolean>;
357
+ isAuthenticated(): Observable<boolean>;
358
+ handleRegisterEndUser(name: string, email: string, phone: string, password: string): Promise<any>;
359
+ handleLoginEndUser(email: string, password: string): Promise<any>;
360
+ handleLogoutEndUser(): Promise<any>;
361
+ checkAuthEndUser(): boolean;
362
+ fetchEndUser(): Promise<any>;
363
+ getEndUser(): any;
364
+ getUser(): any;
365
+ sendActivationEmail(token: any): Promise<Object>;
366
+ forgotPassword(email: string): Promise<Object>;
367
+ resetPassword(token: string, newPassword: string): Promise<Object>;
368
+ static ɵfac: i0.ɵɵFactoryDeclaration<AuthService, never>;
369
+ static ɵprov: i0.ɵɵInjectableDeclaration<AuthService>;
370
+ }
371
+
372
+ declare class CartService {
373
+ private webbuilderService;
374
+ private cartState;
375
+ cart: i0.Signal<any>;
376
+ loadInitialCart(): void;
377
+ /**
378
+ * chỉ cần truyền item, hàm tự tính số lượng
379
+ * @param itemToAdd
380
+ */
381
+ addItem(product: any): Promise<void>;
382
+ removeItem(id_variation: string): void;
383
+ updateItemQuantity(id_variation: string, quantity: number): void;
384
+ static ɵfac: i0.ɵɵFactoryDeclaration<CartService, never>;
385
+ static ɵprov: i0.ɵɵInjectableDeclaration<CartService>;
386
+ }
387
+
388
+ declare class FunctionService {
389
+ private webBuilderService;
390
+ private toast;
391
+ constructor(webBuilderService: webBuilderService, toast: NzMessageService);
392
+ /**
393
+ * hàm chuyển tên thành slug
394
+ * vd: "Giới thieu" => "gioi-thieu"
395
+ * @param name tên cần format
396
+ */
397
+ convertNameToSlug(name: string): string;
398
+ removeVietnamese(str: string): string;
399
+ /**
400
+ *
401
+ * @param object đối tượng cần thêm
402
+ */
403
+ addObject(object: any): Promise<void>;
404
+ /**
405
+ * hàm để tính toán lại kích thước của khung để add ra cho đẹp
406
+ * @param frame đối tượng cần thêm
407
+ */
408
+ addFrame(frame: any): void;
409
+ /**
410
+ * hàm để tính toán lại kích thước của khối để add ra cho đẹp
411
+ * @param block đối tượng cần thêm
412
+ */
413
+ addBlock(block: any): void;
414
+ /**
415
+ * hàm tạo thông báo
416
+ * @param type loại thông báok
417
+ * @param message
418
+ * @returns
419
+ */
420
+ createMessage(type: string | 'error' | 'warn' | 'success' | 'info', message: string): ng_zorro_antd_message.NzMessageRef;
421
+ /**
422
+ * Hàm sắp xếp mảng các đối tượng theo trường tiếng Việt
423
+ * @param data_filter
424
+ * @param field
425
+ * @param lang
426
+ * @param order
427
+ * @returns
428
+ */
429
+ sortVietnameseString(data_filter: any[], field: string, lang?: string, order?: number): any[];
430
+ /**
431
+ * Hàm tạo ID đối tượng theo định dạng ObjectId của MongoDB
432
+ * @returns {string} ID đối tượng 24 ký tự hex
433
+ */
434
+ generateObjectId(): string;
435
+ /**
436
+ * Tạo màu hex ngẫu nhiên
437
+ * @returns {string} Màu hex ngẫu nhiên
438
+ */
439
+ randomColor(): string;
440
+ handleNextPrevFrame(_this: any, direction: 'next' | 'prev', classTransition: string): void;
441
+ handleNextPrevCol(_this: any, direction: 'next' | 'prev', classTransition: string): void;
442
+ onMouseDown(_this: any, event: any, type: 'mouse' | 'touch', classTransition: string): void;
443
+ onMouseMove(_this: any, event: any, type: 'mouse' | 'touch'): void;
444
+ onMouseUp(_this: any, event: any, type: 'mouse' | 'touch', classTransition: string): void;
445
+ onMouseLeave(_this: any, event: any): void;
446
+ static ɵfac: i0.ɵɵFactoryDeclaration<FunctionService, never>;
447
+ static ɵprov: i0.ɵɵInjectableDeclaration<FunctionService>;
448
+ }
449
+
450
+ declare class DrawerService {
451
+ private overlay;
452
+ private overlayRef?;
453
+ constructor(overlay: Overlay);
454
+ open(config: any): void;
455
+ close(): void;
456
+ static ɵfac: i0.ɵɵFactoryDeclaration<DrawerService, never>;
457
+ static ɵprov: i0.ɵɵInjectableDeclaration<DrawerService>;
458
+ }
459
+
322
460
  type DragMode = 'absolute' | 'margin';
323
461
  declare class WbDragDrop implements OnInit {
324
462
  webBuilderService: webBuilderService;
@@ -830,28 +968,20 @@ declare class WbLinkPageConfig implements OnInit {
830
968
  static ɵcmp: i0.ɵɵComponentDeclaration<WbLinkPageConfig, "wb-link-page-config", never, { "data": { "alias": "data"; "required": false; }; "device": { "alias": "device"; "required": false; }; "configLinkPage": { "alias": "configLinkPage"; "required": false; }; }, {}, never, never, true, never>;
831
969
  }
832
970
 
833
- declare class WbMenuContent implements OnInit {
971
+ declare class WbMenuContentConfig implements OnInit {
834
972
  webBuilderService: webBuilderService;
835
- modalRef: NzModalRef<WbMenuContent>;
836
973
  private modal;
837
- cdr: ChangeDetectorRef;
838
974
  data: any;
839
975
  device: any;
840
- readonly nzModalData: any;
841
- constructor(webBuilderService: webBuilderService, modalRef: NzModalRef<WbMenuContent>, modal: NzModalService, cdr: ChangeDetectorRef);
976
+ options: any;
977
+ directionOptions: any;
978
+ constructor(webBuilderService: webBuilderService, modal: NzModalService);
842
979
  ngOnInit(): void;
843
- handleAddMenuItem(node?: any): void;
844
- handleChangeIcon(node: any, type: string | 'before' | 'after'): void;
980
+ handleEditContent(): void;
845
981
  updateConfig(): void;
846
- confirmDelete(node: any): void;
847
- findParentNodeById(key: any, nodes: any): any | null;
848
- handleEditMenuItem(node: any): void;
849
- handleOpenMenuMobile(e: any, item: any): void;
850
- drop(event: CdkDragDrop<string[]>): void;
851
- clamp(value: number, max: number): number;
852
- removeIcon(item: any, key: any): void;
853
- static ɵfac: i0.ɵɵFactoryDeclaration<WbMenuContent, never>;
854
- static ɵcmp: i0.ɵɵComponentDeclaration<WbMenuContent, "wb-menu-content", never, {}, {}, never, never, true, never>;
982
+ handleChangeDirection(direction: string): void;
983
+ static ɵfac: i0.ɵɵFactoryDeclaration<WbMenuContentConfig, never>;
984
+ static ɵcmp: i0.ɵɵComponentDeclaration<WbMenuContentConfig, "wb-menu-content-config", never, { "data": { "alias": "data"; "required": false; }; "device": { "alias": "device"; "required": false; }; }, {}, never, never, true, never>;
855
985
  }
856
986
 
857
987
  declare class WbObjectFitConfig implements OnInit {
@@ -1328,72 +1458,6 @@ declare class WbFrameTabConfig implements OnInit {
1328
1458
  static ɵcmp: i0.ɵɵComponentDeclaration<WbFrameTabConfig, "wb-frame-tab-config", 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; }; }, {}, never, never, true, never>;
1329
1459
  }
1330
1460
 
1331
- /**
1332
- * endUser = {
1333
- * email: string,
1334
- * name: string,
1335
- * phone: string,
1336
- * country: string,
1337
- * addresses: [
1338
- * {
1339
- * _id: string
1340
- * address: string,
1341
- * is_default: boolean
1342
- * name: string
1343
- * phone: string
1344
- * city: string
1345
- * district: string
1346
- * ward: string
1347
- * }
1348
- * ],
1349
- * }
1350
- */
1351
- declare class AuthService {
1352
- private http;
1353
- private toast;
1354
- private webBuilderService;
1355
- private router;
1356
- private apiUrl;
1357
- private urlBE;
1358
- private user;
1359
- private endUser;
1360
- constructor(http: HttpClient, toast: NzMessageService, webBuilderService: webBuilderService, router: Router);
1361
- private wrapApiCall;
1362
- handleLogin(email: string, password: string): Promise<any>;
1363
- handleRegister(name: string, email: string, password: string): Promise<any>;
1364
- handleLogout(): Promise<any>;
1365
- checkAuthUser(): Observable<boolean>;
1366
- isAuthenticated(): Observable<boolean>;
1367
- handleRegisterEndUser(name: string, email: string, phone: string, password: string): Promise<any>;
1368
- handleLoginEndUser(email: string, password: string): Promise<any>;
1369
- handleLogoutEndUser(): Promise<any>;
1370
- checkAuthEndUser(): boolean;
1371
- fetchEndUser(): Promise<any>;
1372
- getEndUser(): any;
1373
- getUser(): any;
1374
- sendActivationEmail(token: any): Promise<Object>;
1375
- forgotPassword(email: string): Promise<Object>;
1376
- resetPassword(token: string, newPassword: string): Promise<Object>;
1377
- static ɵfac: i0.ɵɵFactoryDeclaration<AuthService, never>;
1378
- static ɵprov: i0.ɵɵInjectableDeclaration<AuthService>;
1379
- }
1380
-
1381
- declare class CartService {
1382
- private webbuilderService;
1383
- private cartState;
1384
- cart: i0.Signal<any>;
1385
- loadInitialCart(): void;
1386
- /**
1387
- * chỉ cần truyền item, hàm tự tính số lượng
1388
- * @param itemToAdd
1389
- */
1390
- addItem(product: any): Promise<void>;
1391
- removeItem(id_variation: string): void;
1392
- updateItemQuantity(id_variation: string, quantity: number): void;
1393
- static ɵfac: i0.ɵɵFactoryDeclaration<CartService, never>;
1394
- static ɵprov: i0.ɵɵInjectableDeclaration<CartService>;
1395
- }
1396
-
1397
1461
  declare class WbFrameCart implements OnInit {
1398
1462
  webBuilderService: webBuilderService;
1399
1463
  map: ComponentMapService;
@@ -1470,68 +1534,6 @@ declare class WbFrameProductDetailConfig implements OnInit {
1470
1534
  static ɵcmp: i0.ɵɵComponentDeclaration<WbFrameProductDetailConfig, "wb-frame-product-detail-config", 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; }; }, {}, never, never, false, never>;
1471
1535
  }
1472
1536
 
1473
- declare class FunctionService {
1474
- private webBuilderService;
1475
- private toast;
1476
- constructor(webBuilderService: webBuilderService, toast: NzMessageService);
1477
- /**
1478
- * hàm chuyển tên thành slug
1479
- * vd: "Giới thieu" => "gioi-thieu"
1480
- * @param name tên cần format
1481
- */
1482
- convertNameToSlug(name: string): string;
1483
- removeVietnamese(str: string): string;
1484
- /**
1485
- *
1486
- * @param object đối tượng cần thêm
1487
- */
1488
- addObject(object: any): Promise<void>;
1489
- /**
1490
- * hàm để tính toán lại kích thước của khung để add ra cho đẹp
1491
- * @param frame đối tượng cần thêm
1492
- */
1493
- addFrame(frame: any): void;
1494
- /**
1495
- * hàm để tính toán lại kích thước của khối để add ra cho đẹp
1496
- * @param block đối tượng cần thêm
1497
- */
1498
- addBlock(block: any): void;
1499
- /**
1500
- * hàm tạo thông báo
1501
- * @param type loại thông báok
1502
- * @param message
1503
- * @returns
1504
- */
1505
- createMessage(type: string | 'error' | 'warn' | 'success' | 'info', message: string): ng_zorro_antd_message.NzMessageRef;
1506
- /**
1507
- * Hàm sắp xếp mảng các đối tượng theo trường tiếng Việt
1508
- * @param data_filter
1509
- * @param field
1510
- * @param lang
1511
- * @param order
1512
- * @returns
1513
- */
1514
- sortVietnameseString(data_filter: any[], field: string, lang?: string, order?: number): any[];
1515
- /**
1516
- * Hàm tạo ID đối tượng theo định dạng ObjectId của MongoDB
1517
- * @returns {string} ID đối tượng 24 ký tự hex
1518
- */
1519
- generateObjectId(): string;
1520
- /**
1521
- * Tạo màu hex ngẫu nhiên
1522
- * @returns {string} Màu hex ngẫu nhiên
1523
- */
1524
- randomColor(): string;
1525
- handleNextPrevFrame(_this: any, direction: 'next' | 'prev', classTransition: string): void;
1526
- handleNextPrevCol(_this: any, direction: 'next' | 'prev', classTransition: string): void;
1527
- onMouseDown(_this: any, event: any, type: 'mouse' | 'touch', classTransition: string): void;
1528
- onMouseMove(_this: any, event: any, type: 'mouse' | 'touch'): void;
1529
- onMouseUp(_this: any, event: any, type: 'mouse' | 'touch', classTransition: string): void;
1530
- onMouseLeave(_this: any, event: any): void;
1531
- static ɵfac: i0.ɵɵFactoryDeclaration<FunctionService, never>;
1532
- static ɵprov: i0.ɵɵInjectableDeclaration<FunctionService>;
1533
- }
1534
-
1535
1537
  declare class WbFrameProducts implements OnInit {
1536
1538
  webBuilderService: webBuilderService;
1537
1539
  functionService: FunctionService;
@@ -1913,16 +1915,6 @@ declare class WbBreadcumbConfig implements OnInit {
1913
1915
  static ɵcmp: i0.ɵɵComponentDeclaration<WbBreadcumbConfig, "wb-breadcumb-config", 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; }; }, {}, never, never, true, never>;
1914
1916
  }
1915
1917
 
1916
- declare class DrawerService {
1917
- private overlay;
1918
- private overlayRef?;
1919
- constructor(overlay: Overlay);
1920
- open(config: any): void;
1921
- close(): void;
1922
- static ɵfac: i0.ɵɵFactoryDeclaration<DrawerService, never>;
1923
- static ɵprov: i0.ɵɵInjectableDeclaration<DrawerService>;
1924
- }
1925
-
1926
1918
  declare class WbButton implements OnInit {
1927
1919
  private router;
1928
1920
  webBuilderService: webBuilderService;
@@ -2461,4 +2453,4 @@ declare class SelectLanguageComponent implements OnInit {
2461
2453
 
2462
2454
  declare const WEBBUILDER_API_URL: InjectionToken<string>;
2463
2455
 
2464
- export { CommonConfigMapService, ComponentConfigMapService, ComponentMapService, SelectLanguageComponent, WEBBUILDER_API_URL, WbAnimationConfig, WbBackgroundColorConfig, WbBackgroundImageConfig, WbBannerAnimationConfig, WbBlockBlank, WbBlockBlankConfig, WbBorderConfig, WbBorderRadiusConfig, WbBreadcumb, WbBreadcumbConfig, WbButton, WbButtonConfig, WbButtonQuantity, WbButtonQuantityConfig, WbButtonSetDefaultAddress, WbButtonSetDefaultAddressConfig, WbCheckboxConfig, WbCheckboxFilter, WbCheckboxFilterConfig, WbCkeditorConfig, WbDialogConfig, WbDragDrop, WbFilterConfig, WbFixedConfig, WbFrameBanner, WbFrameBannerConfig, WbFrameBlank, WbFrameBlankConfig, WbFrameCart, WbFrameCartConfig, WbFrameContentConfig, WbFrameProductDetail, WbFrameProductDetailConfig, WbFrameProducts, WbFrameProductsAdmin, WbFrameProductsByCategory, WbFrameProductsByCategoryConfig, WbFrameProductsConfig, WbFrameTab, WbFrameTabConfig, WbFreeblockConfig, WbGridConfig, WbHideShowConfig, WbIconConfig, WbImage, WbImageConfig, WbImageListNumberConfig, WbInput, WbInputConfig, WbLine, WbLineConfig, WbLinkPageConfig, WbMenuContent, 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, WbText, WbTextConfig, WbTextFormatConfig, WbTextParagraph, WbTextParagraphConfig, WbToolTipConfig, WbUploadImageConfig, WbUploadVideoConfig, WbVideo, WbVideoConfig, WbVirtualSelected, WbWidthHeightConfig, webBuilderService };
2456
+ export { AuthService, CartService, CommonConfigMapService, ComponentConfigMapService, ComponentMapService, DrawerService, FunctionService, SelectLanguageComponent, WEBBUILDER_API_URL, WbAnimationConfig, WbBackgroundColorConfig, WbBackgroundImageConfig, WbBannerAnimationConfig, WbBlockBlank, WbBlockBlankConfig, WbBorderConfig, WbBorderRadiusConfig, WbBreadcumb, WbBreadcumbConfig, WbButton, WbButtonConfig, WbButtonQuantity, WbButtonQuantityConfig, WbButtonSetDefaultAddress, WbButtonSetDefaultAddressConfig, WbCheckboxConfig, WbCheckboxFilter, WbCheckboxFilterConfig, WbCkeditorConfig, WbDialogConfig, WbDragDrop, WbFilterConfig, WbFixedConfig, WbFrameBanner, WbFrameBannerConfig, WbFrameBlank, WbFrameBlankConfig, WbFrameCart, WbFrameCartConfig, WbFrameContentConfig, WbFrameProductDetail, WbFrameProductDetailConfig, WbFrameProducts, WbFrameProductsAdmin, WbFrameProductsByCategory, WbFrameProductsByCategoryConfig, WbFrameProductsConfig, WbFrameTab, WbFrameTabConfig, WbFreeblockConfig, WbGridConfig, WbHideShowConfig, WbIconConfig, WbImage, WbImageConfig, WbImageListNumberConfig, WbInput, WbInputConfig, WbLine, WbLineConfig, WbLinkPageConfig, 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, WbText, WbTextConfig, WbTextFormatConfig, WbTextParagraph, WbTextParagraphConfig, WbToolTipConfig, WbUploadImageConfig, WbUploadVideoConfig, WbVideo, WbVideoConfig, WbVirtualSelected, WbWidthHeightConfig, webBuilderService };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fw-webbuilder",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^20.3.0",
6
6
  "@angular/core": "^20.3.0"