@cbm-common/cbm-types 0.0.276 → 0.0.277

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.
@@ -0,0 +1,75 @@
1
+ import { CdkDragDrop } from '@angular/cdk/drag-drop';
2
+ import { DestroyRef } from '@angular/core';
3
+ import { FormControl } from '@angular/forms';
4
+ import { CbmDetailBySectionModel } from './detail-by-section.model';
5
+ type TDetailCategory = 'all' | 'item' | 'service' | 'subcontracted';
6
+ declare class DetailSectionControl {
7
+ readonly id: `${string}-${string}-${string}-${string}-${string}`;
8
+ readonly defaultTitle: string;
9
+ constructor(title: string);
10
+ title: import("@angular/core").WritableSignal<string>;
11
+ items: import("@angular/core").WritableSignal<CbmDetailBySectionModel.SectionDetail[]>;
12
+ isDetailHidden: import("@angular/core").WritableSignal<boolean>;
13
+ itemsCount: import("@angular/core").Signal<number>;
14
+ subtotal: import("@angular/core").Signal<number>;
15
+ hasItems: import("@angular/core").Signal<boolean>;
16
+ summaryMessage: import("@angular/core").Signal<string>;
17
+ addItems(details: Array<CbmDetailBySectionModel.SectionDetail>): void;
18
+ replaceItems(details: Array<CbmDetailBySectionModel.SectionDetail>): void;
19
+ removeItem(detailKey: string): boolean;
20
+ resetTitleIfEmpty(value: string): void;
21
+ toggleDetailVisibility(): void;
22
+ }
23
+ export declare class CbmDetailBySectionComponent {
24
+ private readonly destroyRef;
25
+ EType: typeof CbmDetailBySectionModel.Type;
26
+ constructor(destroyRef: DestroyRef);
27
+ labels: import("@angular/core").WritableSignal<{
28
+ labelDetail: string;
29
+ labelSection: string;
30
+ }>;
31
+ sectionsChange: import("@angular/core").OutputEmitterRef<CbmDetailBySectionModel.SectionSnapshot[]>;
32
+ searchItemsControl: FormControl<string>;
33
+ detailCategory: import("@angular/core").WritableSignal<{
34
+ all: boolean;
35
+ item: boolean;
36
+ service: boolean;
37
+ subcontracted: boolean;
38
+ }>;
39
+ selectedCategory: import("@angular/core").WritableSignal<TDetailCategory>;
40
+ detail: import("@angular/core").WritableSignal<CbmDetailBySectionModel.SectionDetail[]>;
41
+ sectionsDetail: import("@angular/core").WritableSignal<DetailSectionControl[]>;
42
+ editingSectionIndex: import("@angular/core").WritableSignal<number | null>;
43
+ nextSectionNumber: import("@angular/core").WritableSignal<number>;
44
+ visibleDetail: import("@angular/core").Signal<CbmDetailBySectionModel.SectionDetail[]>;
45
+ detailSectionAssignments: import("@angular/core").Signal<Map<string, string[]>>;
46
+ dropListIds: import("@angular/core").Signal<string[]>;
47
+ allSectionsConsolidated: import("@angular/core").Signal<boolean>;
48
+ setLabels(labels: Partial<ReturnType<typeof this.labels>>): void;
49
+ setDetail(input: Array<CbmDetailBySectionModel.InputDetail>): void;
50
+ reset(): void;
51
+ searchTerm(term: string): void;
52
+ createSection(): void;
53
+ distributeSections(): void;
54
+ startEditSectionTitle(index: number): void;
55
+ saveSectionTitle(index: number, value: string): void;
56
+ removeSection(index: number): void;
57
+ removeItemFromSection(sectionId: string, detailKey: string, event?: Event): void;
58
+ addItemsByTypeToSection(sectionIndex: number, type: CbmDetailBySectionModel.Type): void;
59
+ toggleSectionDetailVisibility(sectionIndex: number): void;
60
+ toggleAllSectionsDetailVisibility(): void;
61
+ isDetailAssigned(detailKey: string): boolean;
62
+ getDetailAssignedSections(detailKey: string): string[];
63
+ onDropToSection(event: CdkDragDrop<Array<CbmDetailBySectionModel.SectionDetail>>, targetSectionIndex: number): void;
64
+ getSectionDropListId(id: string): string;
65
+ getSectionsSnapshot(): Array<CbmDetailBySectionModel.SectionSnapshot>;
66
+ getDetailAmount(detail: Pick<CbmDetailBySectionModel.SectionDetail, 'amount'>): number;
67
+ getDetailTotal(detail: Pick<CbmDetailBySectionModel.SectionDetail, 'total' | 'total_price'>): number;
68
+ private getDistributionSectionDefinitions;
69
+ private getSourceDetails;
70
+ private getAvailableDetailsByType;
71
+ private getSourceDetailsByType;
72
+ private loadCategory;
73
+ private getDetailKey;
74
+ }
75
+ export {};
@@ -0,0 +1,30 @@
1
+ export declare namespace CbmDetailBySectionModel {
2
+ enum Type {
3
+ ITEM = "item",
4
+ SERVICE = "service",
5
+ SUBCONTRACTED = "subcontracted"
6
+ }
7
+ interface InputDetail {
8
+ _id?: string;
9
+ item_id: string;
10
+ item_code: string;
11
+ item_name: string;
12
+ amount: number;
13
+ total: number;
14
+ type: Type;
15
+ visible: boolean;
16
+ item_barcode?: string;
17
+ total_price?: number;
18
+ unit_measure_name?: string;
19
+ }
20
+ interface SectionDetail extends InputDetail {
21
+ key: string;
22
+ }
23
+ interface SectionSnapshot {
24
+ id: string;
25
+ title: string;
26
+ isDetailHidden: boolean;
27
+ subtotal: number;
28
+ items: Array<SectionDetail>;
29
+ }
30
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cbm-common/cbm-types",
3
- "version": "0.0.276",
3
+ "version": "0.0.277",
4
4
  "main": "index.js",
5
5
  "types": "public-api.d.ts",
6
6
  "exports": {
package/public-api.d.ts CHANGED
@@ -587,3 +587,11 @@ export * from './lib/domain/models/charge-type.domain.model';
587
587
  //#region type Of Service domain repository
588
588
  export * from './lib/domain/repositories/type-of-service.domain.repository';
589
589
  export * from './lib/domain/models/type-of-service.domain.model';
590
+
591
+ //#region type Of detail by section
592
+ export * from './lib/components/detail-by-section/detail-by-section';
593
+ export * from './lib/components/detail-by-section/detail-by-section.model';
594
+
595
+
596
+ //#region type Of SRefheshschedule service
597
+ export * from './lib/domain/services/refresch-schedules.domain.service';