b2b-tools 0.0.3 → 0.1.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.
Files changed (39) hide show
  1. package/LICENCE +21 -0
  2. package/README.md +120 -25
  3. package/ng-package.json +7 -0
  4. package/package.json +13 -24
  5. package/src/lib/b2b-tools.spec.ts +23 -0
  6. package/src/lib/b2b-tools.ts +15 -0
  7. package/src/lib/components/advanced-card/advanced-card.css +265 -0
  8. package/src/lib/components/advanced-card/advanced-card.html +117 -0
  9. package/src/lib/components/advanced-card/advanced-card.ts +75 -0
  10. package/src/lib/components/advanced-card/index.ts +2 -0
  11. package/src/lib/components/advanced-card/types/card.types.ts +37 -0
  12. package/src/lib/components/advanced-card/types/index.ts +1 -0
  13. package/src/lib/components/advanced-table/advanced-table.component.css +81 -0
  14. package/src/lib/components/advanced-table/advanced-table.component.html +56 -0
  15. package/src/lib/components/advanced-table/advanced-table.component.ts +469 -0
  16. package/src/lib/components/advanced-table/index.ts +2 -0
  17. package/src/lib/components/advanced-table/parts/table-grid/table-grid.component.css +274 -0
  18. package/src/lib/components/advanced-table/parts/table-grid/table-grid.component.html +168 -0
  19. package/src/lib/components/advanced-table/parts/table-grid/table-grid.component.ts +224 -0
  20. package/src/lib/components/advanced-table/parts/table-modal-image/table-modal-image.component.css +49 -0
  21. package/src/lib/components/advanced-table/parts/table-modal-image/table-modal-image.component.html +14 -0
  22. package/src/lib/components/advanced-table/parts/table-modal-image/table-modal-image.component.ts +22 -0
  23. package/src/lib/components/advanced-table/parts/table-pagination/table-pagination.component.css +147 -0
  24. package/src/lib/components/advanced-table/parts/table-pagination/table-pagination.component.html +95 -0
  25. package/src/lib/components/advanced-table/parts/table-pagination/table-pagination.component.ts +61 -0
  26. package/src/lib/components/advanced-table/parts/table-toolbar/table-toolbar.component.css +32 -0
  27. package/src/lib/components/advanced-table/parts/table-toolbar/table-toolbar.component.html +17 -0
  28. package/src/lib/components/advanced-table/parts/table-toolbar/table-toolbar.component.ts +30 -0
  29. package/src/lib/components/advanced-table/types/index.ts +2 -0
  30. package/src/lib/components/advanced-table/types/table.types.ts +101 -0
  31. package/src/lib/components/advanced-table/types/time-zone.types.ts +91 -0
  32. package/src/lib/components/index.ts +2 -0
  33. package/src/public-api.ts +4 -0
  34. package/tsconfig.lib.json +17 -0
  35. package/tsconfig.lib.prod.json +11 -0
  36. package/tsconfig.spec.json +15 -0
  37. package/fesm2022/b2b-tools.mjs +0 -761
  38. package/fesm2022/b2b-tools.mjs.map +0 -1
  39. package/types/b2b-tools.d.ts +0 -431
@@ -0,0 +1,14 @@
1
+ @if (open()) {
2
+ <div class="dt-modal-backdrop" (click)="onClose()">
3
+ <div class="dt-modal" (click)="$event.stopPropagation()">
4
+ <div class="dt-modal-header">
5
+ <span class="dt-modal-title">{{ alt() }}</span>
6
+ <button type="button" class="dt-btn" (click)="onClose()">Cerrar</button>
7
+ </div>
8
+
9
+ <div class="dt-modal-body">
10
+ <img class="dt-modal-img" [src]="src()" [alt]="alt()" />
11
+ </div>
12
+ </div>
13
+ </div>
14
+ }
@@ -0,0 +1,22 @@
1
+ import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+
4
+ @Component({
5
+ selector: 'table-modal-image',
6
+ standalone: true,
7
+ imports: [CommonModule],
8
+ templateUrl: './table-modal-image.component.html',
9
+ styleUrls: ['./table-modal-image.component.css'],
10
+ changeDetection: ChangeDetectionStrategy.OnPush,
11
+ })
12
+ export class TableModalImageComponent {
13
+ readonly open = input<boolean>(false);
14
+ readonly src = input<string>('');
15
+ readonly alt = input<string>('');
16
+
17
+ readonly close = output<void>();
18
+
19
+ onClose() {
20
+ this.close.emit();
21
+ }
22
+ }
@@ -0,0 +1,147 @@
1
+ .dt-pagination {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: space-between;
5
+ gap: 12px;
6
+ padding: 8px 12px;
7
+ font-size: 13px;
8
+ }
9
+
10
+ .dt-page-info {
11
+ white-space: nowrap;
12
+ color: var(--xs-dark-gray);
13
+ }
14
+
15
+ .dt-rows {
16
+ display: flex;
17
+ align-items: center;
18
+ gap: 6px;
19
+ color: var(--xs-dark-gray);
20
+ }
21
+
22
+ .dt-rows select {
23
+ padding: 6px 28px 6px 8px; /* consistente con inputs */
24
+ border-radius: var(--radius-sm);
25
+ border: 1px solid var(--light-gray);
26
+ background: var(--white);
27
+ font-size: 13px;
28
+ color: var(--black);
29
+ }
30
+
31
+ /* ===== Pager ===== */
32
+ .dt-pager {
33
+ display: flex;
34
+ align-items: center;
35
+ gap: 4px;
36
+ }
37
+
38
+ /* Base: BLINDA color para evitar reglas globales */
39
+ .dt-pager-btn,
40
+ .dt-pager-chip {
41
+ min-width: 28px;
42
+ height: 28px;
43
+ border-radius: var(--radius-sm);
44
+ border: 1px solid var(--xs-light-gray);
45
+ background: var(--white);
46
+ cursor: pointer;
47
+ font-size: 13px;
48
+
49
+ display: inline-flex;
50
+ align-items: center;
51
+ justify-content: center;
52
+
53
+ /* evita desplazamientos raros del texto */
54
+ line-height: 1;
55
+ padding: 0;
56
+ }
57
+
58
+ /* Hover: NO tocamos color; solo borde y fondo */
59
+ .dt-pager-btn:hover:not(:disabled),
60
+ .dt-pager-chip:hover:not(:disabled) {
61
+ border-color: var(--dark-gray);
62
+ background: var(--gray-white);
63
+ color: var(--xs-dark-gray); /* <- blindaje extra */
64
+ }
65
+
66
+ /* Active */
67
+ .dt-pager-chip--active {
68
+ background: rgb(51, 97, 250);
69
+ color: var(--white);
70
+ border-color: var(--blue);
71
+ font-weight: 600;
72
+ }
73
+
74
+ .dt-pager-chip--active:hover:not(:disabled) {
75
+ background: rgb(51, 97, 250);
76
+ color: var(--white);
77
+ border-color: var(--blue);
78
+ }
79
+
80
+ /* Disabled */
81
+ .dt-pager-btn:disabled,
82
+ .dt-pager-chip:disabled {
83
+ opacity: 1; /* evita que se vea “lavado” feo */
84
+ color: var(--disabled-text);
85
+ background: var(--soft-white);
86
+ border-color: var(--disabled);
87
+ cursor: not-allowed;
88
+ }
89
+
90
+ .dt-pager-ellipsis {
91
+ padding: 0 6px;
92
+ color: var(--xs-dark-gray);
93
+ }
94
+
95
+
96
+ /* ===== Responsive visibility helpers ===== */
97
+ .dt-hide-xs,
98
+ .dt-hide-sm,
99
+ .dt-hide-md {
100
+ display: inline-flex;
101
+ }
102
+
103
+ .dt-show-xs {
104
+ display: none;
105
+ }
106
+
107
+ .dt-page-compact {
108
+ white-space: nowrap;
109
+ color: var(--xs-dark-gray);
110
+ }
111
+
112
+ /* < 1200px: quitar "Filas" (rows/page) */
113
+ @media (max-width: 1200px) {
114
+ .dt-hide-md {
115
+ display: none !important;
116
+ }
117
+ }
118
+
119
+ /* < 900px: quitar info "Mostrando..." y first/last */
120
+ @media (max-width: 900px) {
121
+ .dt-hide-sm {
122
+ display: none !important;
123
+ }
124
+
125
+ .dt-pagination {
126
+ justify-content: center;
127
+ }
128
+ }
129
+
130
+ /* < 640px: solo prev / (page/pageCount) / next */
131
+ @media (max-width: 640px) {
132
+ .dt-hide-xs {
133
+ display: none !important;
134
+ }
135
+
136
+ .dt-show-xs {
137
+ display: inline-flex !important;
138
+ }
139
+
140
+ .dt-pagination {
141
+ gap: 10px;
142
+ }
143
+
144
+ .dt-pager {
145
+ gap: 8px;
146
+ }
147
+ }
@@ -0,0 +1,95 @@
1
+ <div class="dt-pagination dt-pagination--classic">
2
+ <!-- Info -->
3
+ <span class="dt-page-info dt-hide-sm">
4
+ Mostrando {{ startItem() }} – {{ endItem() }} de {{ totalCount() }}
5
+ </span>
6
+
7
+ <!-- Compact info (mobile) -->
8
+ <span class="dt-page-compact dt-show-xs">
9
+ {{ page() }} / {{ pageCount() }}
10
+ </span>
11
+
12
+ <!-- Rows per page -->
13
+ <div class="dt-rows dt-hide-md">
14
+ <span>Filas:</span>
15
+ <select [value]="pageSize()" (change)="onPageSizeSelect(+$any($event.target).value)">
16
+ @for (size of pageSizeOptions(); track size) {
17
+ <option [value]="size">{{ size }}</option>
18
+ }
19
+ </select>
20
+ </div>
21
+
22
+ <!-- Pager -->
23
+ <div class="dt-pager">
24
+ <button
25
+ type="button"
26
+ class="dt-pager-btn dt-hide-sm"
27
+ (click)="goToPage(1)"
28
+ [disabled]="page() === 1"
29
+ aria-label="Primera página"
30
+ >
31
+ <!-- svg -->
32
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
33
+ <path
34
+ fill="currentColor"
35
+ d="m11 18l-6-6l6-6l1.4 1.4L7.825 12l4.575 4.6zm6.6 0l-6-6l6-6L19 7.4L14.425 12L19 16.6z"
36
+ />
37
+ </svg>
38
+ </button>
39
+
40
+ <button
41
+ type="button"
42
+ class="dt-pager-btn"
43
+ (click)="prevPage()"
44
+ [disabled]="page() === 1"
45
+ aria-label="Página anterior"
46
+ >
47
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
48
+ <path fill="currentColor" d="m14 18l-6-6l6-6l1.4 1.4l-4.6 4.6l4.6 4.6z" />
49
+ </svg>
50
+ </button>
51
+
52
+ <!-- números/ellipsis: se ocultarán en XS por CSS -->
53
+ @for (item of pagerItems(); track $index) {
54
+ @if (item === '…') {
55
+ <span class="dt-pager-ellipsis dt-hide-xs">…</span>
56
+ } @else {
57
+ <button
58
+ type="button"
59
+ class="dt-pager-chip dt-hide-xs"
60
+ [class.dt-pager-chip--active]="item === page()"
61
+ (click)="goToPage(item)"
62
+ >
63
+ {{ item }}
64
+ </button>
65
+ }
66
+ }
67
+
68
+ <button
69
+ type="button"
70
+ class="dt-pager-btn"
71
+ (click)="nextPage()"
72
+ [disabled]="page() === pageCount()"
73
+ aria-label="Página siguiente"
74
+ >
75
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
76
+ <path fill="currentColor" d="M12.6 12L8 7.4L9.4 6l6 6l-6 6L8 16.6z" />
77
+ </svg>
78
+ </button>
79
+
80
+ <button
81
+ type="button"
82
+ class="dt-pager-btn dt-hide-sm"
83
+ (click)="goToPage(pageCount())"
84
+ [disabled]="page() === pageCount()"
85
+ aria-label="Última página"
86
+ >
87
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
88
+ <path
89
+ fill="currentColor"
90
+ d="M9.575 12L5 7.4L6.4 6l6 6l-6 6L5 16.6zm6.6 0L11.6 7.4L13 6l6 6l-6 6l-1.4-1.4z"
91
+ />
92
+ </svg>
93
+ </button>
94
+ </div>
95
+ </div>
@@ -0,0 +1,61 @@
1
+ import {
2
+ ChangeDetectionStrategy,
3
+ Component,
4
+ computed,
5
+ input,
6
+ output,
7
+ } from '@angular/core';
8
+ import { CommonModule } from '@angular/common';
9
+ import { PagerItem } from '../../types/table.types';
10
+
11
+ @Component({
12
+ selector: 'table-pagination',
13
+ standalone: true,
14
+ imports: [CommonModule],
15
+ styleUrls: ['./table-pagination.component.css'],
16
+ templateUrl: './table-pagination.component.html',
17
+ changeDetection: ChangeDetectionStrategy.OnPush,
18
+ })
19
+ export class TablePaginationComponent {
20
+ public readonly Math = Math;
21
+
22
+ // Inputs
23
+ readonly page = input<number>(1);
24
+ readonly pageSize = input<number>(10);
25
+ readonly pageCount = input<number>(1);
26
+ readonly totalCount = input<number>(0);
27
+ readonly pageSizeOptions = input<number[]>([10, 25, 50]);
28
+ readonly pagerItems = input<PagerItem[]>([]);
29
+
30
+ // Outputs
31
+ readonly pageChange = output<number>();
32
+ readonly pageSizeChange = output<number>();
33
+
34
+ readonly startItem = computed(() => {
35
+ if (this.totalCount() <= 0) return 0;
36
+ return (this.page() - 1) * this.pageSize() + 1;
37
+ });
38
+
39
+ readonly endItem = computed(() => {
40
+ if (this.totalCount() <= 0) return 0;
41
+ return Math.min(this.page() * this.pageSize(), this.totalCount());
42
+ });
43
+
44
+ goToPage(page: number) {
45
+ const clamped = Math.max(1, Math.min(this.pageCount(), page));
46
+ this.pageChange.emit(clamped);
47
+ }
48
+
49
+ prevPage() {
50
+ this.goToPage(this.page() - 1);
51
+ }
52
+
53
+ nextPage() {
54
+ this.goToPage(this.page() + 1);
55
+ }
56
+
57
+ onPageSizeSelect(size: number) {
58
+ if (!Number.isFinite(size) || size <= 0) return;
59
+ this.pageSizeChange.emit(size);
60
+ }
61
+ }
@@ -0,0 +1,32 @@
1
+ .dt-toolbar {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: space-between;
5
+ gap: 12px;
6
+ padding: 10px 12px;
7
+ }
8
+
9
+ .dt-input {
10
+ width: 100%;
11
+ max-width: 360px;
12
+ padding: 8px 10px;
13
+ border-radius: var(--radius-sm);
14
+ border: var(--border);
15
+ outline: none;
16
+ }
17
+
18
+ .dt-input:focus {
19
+ box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
20
+ }
21
+
22
+ .dt-btn {
23
+ padding: 8px 10px;
24
+ border-radius: var(--radius-sm);
25
+ border: var(--border);
26
+ background: var(--white);
27
+ cursor: pointer;
28
+ }
29
+
30
+ .dt-btn:hover {
31
+ filter: brightness(0.98);
32
+ }
@@ -0,0 +1,17 @@
1
+ @if (enabled()) {
2
+ <div class="dt-toolbar">
3
+ <input
4
+ class="dt-input"
5
+ type="text"
6
+ [placeholder]="placeholder()"
7
+ [value]="query()"
8
+ (input)="onInput($any($event.target).value)"
9
+ />
10
+
11
+ @if (showClear()) {
12
+ <button type="button" class="dt-btn" (click)="onClear()">
13
+ Limpiar
14
+ </button>
15
+ }
16
+ </div>
17
+ }
@@ -0,0 +1,30 @@
1
+ import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+
4
+ @Component({
5
+ selector: 'table-toolbar',
6
+ standalone: true,
7
+ imports: [CommonModule],
8
+ templateUrl: './table-toolbar.component.html',
9
+ styleUrls: ['./table-toolbar.component.css'],
10
+ changeDetection: ChangeDetectionStrategy.OnPush,
11
+ })
12
+ export class TableToolbarComponent {
13
+ // Inputs
14
+ readonly enabled = input<boolean>(true);
15
+ readonly query = input<string>('');
16
+ readonly placeholder = input<string>('Buscar...');
17
+ readonly showClear = input<boolean>(true);
18
+
19
+ // Outputs
20
+ readonly queryChange = output<string>();
21
+ readonly clear = output<void>();
22
+
23
+ onInput(value: string) {
24
+ this.queryChange.emit(value);
25
+ }
26
+
27
+ onClear() {
28
+ this.clear.emit();
29
+ }
30
+ }
@@ -0,0 +1,2 @@
1
+ export * from './table.types';
2
+ export * from './time-zone.types';
@@ -0,0 +1,101 @@
1
+ export type CellDataType =
2
+ | 'string'
3
+ | 'integer'
4
+ | 'decimal'
5
+ | 'currency'
6
+ | 'date'
7
+ | 'datetime'
8
+ | 'boolean'
9
+ | 'image'
10
+ | 'status'
11
+ | 'link'
12
+ | 'custom'
13
+ | 'actions';
14
+
15
+ export type CellSize = 'XS' | 'SM' | 'MD' | 'LG' | 'XL' | 'AUTO';
16
+ export type TextAlign = 'left' | 'center' | 'right';
17
+
18
+ export type RowId = string | number;
19
+ export type PagerItem = number | '…';
20
+
21
+ export type Icon = 'edit' | 'delete' | 'view' | 'copy';
22
+
23
+ export interface TableColumn<T = unknown> {
24
+ key: string;
25
+ label: string;
26
+ type: CellDataType;
27
+ size?: CellSize;
28
+ align?: TextAlign;
29
+ sortable?: boolean;
30
+ filterable?: boolean;
31
+ hidden?: boolean;
32
+
33
+ valueGetter?: (row: T) => unknown;
34
+ formatter?: (value: unknown, row: T) => string;
35
+ actions?: TableAction<T>[];
36
+ options?: {
37
+ currency?: 'MXN';
38
+ dateFormat?: 'short' | 'medium' | 'long';
39
+ dateTimeFormat?: 'short' | 'medium' | 'long';
40
+ image?: {
41
+ hidden?: boolean;
42
+ openInModal?: boolean;
43
+ showFull?: boolean;
44
+ alt?: (row: T) => string;
45
+ };
46
+ status?: {
47
+ classMap?: Record<string, string>;
48
+ };
49
+ link?: {
50
+ hrefGetter?: (row: T) => string;
51
+ labelGetter?: (row: T) => string;
52
+ target?: '_blank' | '_self';
53
+ };
54
+ };
55
+ }
56
+
57
+ export interface TableConfig {
58
+ globalSearch?: boolean;
59
+ columnFilters?: boolean;
60
+ selectable?: boolean;
61
+ selectionMode?: 'single' | 'multiple';
62
+ pagination?: { enabled: boolean; pageSize: number; pageSizeOptions?: number[]; };
63
+ scroll?: { mode: 'none' | 'infinite'; heightPx?: number; batchSize?: number; };
64
+ fixedRowCount?: number;
65
+ emptyText?: string;
66
+ rowIdKey?: string;
67
+ rowIdGetter?: (row: any) => string | number;
68
+ globalSearchVisibleOnly?: boolean;
69
+ }
70
+
71
+ export interface TableSortState {
72
+ key: string;
73
+ dir: 'asc' | 'desc';
74
+ }
75
+
76
+ export type ActionVariant = 'default' | 'danger';
77
+ export type ActionRender = 'icon' | 'text';
78
+
79
+ export interface TableAction<T> {
80
+ id: string;
81
+ label: string;
82
+ icon?: Icon | string;
83
+ tooltip?: string;
84
+ variant?: ActionVariant;
85
+ render?: ActionRender;
86
+ visible?: (row: T) => boolean;
87
+ disabled?: (row: T) => boolean;
88
+ confirm?: { title?: string; message: string; };
89
+ }
90
+
91
+ export interface TableActionEvent<T> {
92
+ actionId: string;
93
+ row: T;
94
+ }
95
+
96
+ export const SVG_ICONS: Record<string, string> = {
97
+ edit: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h8.925l-2 2H5v14h14v-6.95l2-2V19q0 .825-.587 1.413T19 21zm4-6v-4.25l9.175-9.175q.3-.3.675-.45t.75-.15q.4 0 .763.15t.662.45L22.425 3q.275.3.425.663T23 4.4t-.137.738t-.438.662L13.25 15zM21.025 4.4l-1.4-1.4zM11 13h1.4l5.8-5.8l-.7-.7l-.725-.7L11 11.575zm6.5-6.5l-.725-.7zl.7.7z"/></svg>',
98
+ delete: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M7 21q-.825 0-1.412-.587T5 19V6H4V4h5V3h6v1h5v2h-1v13q0 .825-.587 1.413T17 21zM17 6H7v13h10zM9 17h2V8H9zm4 0h2V8h-2zM7 6v13z"/></svg>',
99
+ open: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"><path d="M7 3.625c-4.187 0-5.945 3.766-5.945 3.844S2.813 11.312 7 11.312s5.945-3.765 5.945-3.843S11.187 3.625 7 3.625M2.169 5.813L.61 4.252m4.525-.354L4.5 1.843m7.331 3.97l1.559-1.56m-4.525-.355L9.5 1.843"/><path d="M5.306 7.081a1.738 1.738 0 1 0 3.388.776a1.738 1.738 0 1 0-3.388-.776"/></g></svg>',
100
+ copy: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M9 18q-.825 0-1.412-.587T7 16V4q0-.825.588-1.412T9 2h9q.825 0 1.413.588T20 4v12q0 .825-.587 1.413T18 18zm-4 4q-.825 0-1.412-.587T3 20V6h2v14h11v2z"/></svg>'
101
+ }
@@ -0,0 +1,91 @@
1
+
2
+ /**
3
+ * Base information for a time zone associated with a country or region.
4
+ * Intended for catalogs, dropdowns, and Intl-based formatting.
5
+ */
6
+ export interface TimeZoneInfo {
7
+ /**
8
+ * Official IANA time zone identifier.
9
+ * Used by Intl.DateTimeFormat and backend time handling.
10
+ * Example: 'America/Mexico_City', 'Europe/Madrid'.
11
+ */
12
+ timeZone: string;
13
+
14
+ /**
15
+ * Country or region name.
16
+ * Intended for user-friendly display in UI components.
17
+ * Example: 'Mexico', 'United States (Eastern)'.
18
+ */
19
+ name: string;
20
+
21
+ /**
22
+ * ISO 4217 currency code used in the country or region.
23
+ * Required for monetary formatting with Intl.NumberFormat.
24
+ * Example: 'MXN', 'USD', 'EUR'.
25
+ */
26
+ currency: string;
27
+
28
+ /**
29
+ * Locale identifier following the BCP-47 standard.
30
+ * Determines language, number formatting, and date conventions.
31
+ * Example: 'es-MX', 'en-US', 'fr-FR'.
32
+ */
33
+ locale: string;
34
+
35
+ /**
36
+ * UTC offset of the time zone expressed in hours.
37
+ * This value represents the standard offset and does not account for DST.
38
+ * Example: -6, -5, +1, +5.5.
39
+ */
40
+ utcOffset: number;
41
+
42
+ /**
43
+ * City name.
44
+ * Used as a human-readable label in dropdowns or selectors.
45
+ * Example: 'Mexico City', 'New York', 'London'.
46
+ */
47
+ city: string;
48
+ }
49
+
50
+ export const TIME_ZONES = {
51
+ // AFRICA
52
+ CAIRO: { city: 'Cairo', timeZone: 'Africa/Cairo', name: 'Egypt', currency: 'EGP', locale: 'ar-EG', utcOffset: +2 },
53
+ CASABLANCA: { city: 'Casablanca', timeZone: 'Africa/Casablanca', name: 'Morocco', currency: 'MAD', locale: 'ar-MA', utcOffset: 0 },
54
+ JOHANNESBURG: { city: 'Johannesburg', timeZone: 'Africa/Johannesburg', name: 'South Africa', currency: 'ZAR', locale: 'en-ZA', utcOffset: +2 },
55
+
56
+ // AMERICA
57
+ BUENOS_AIRES: { city: 'Buenos Aires', timeZone: 'America/Argentina/Buenos_Aires', name: 'Argentina', currency: 'ARS', locale: 'es-AR', utcOffset: -3 },
58
+ SAO_PAULO: { city: 'Sao Paulo', timeZone: 'America/Sao_Paulo', name: 'Brazil', currency: 'BRL', locale: 'pt-BR', utcOffset: -3 },
59
+ TORONTO: { city: 'Toronto', timeZone: 'America/Toronto', name: 'Canada', currency: 'CAD', locale: 'en-CA', utcOffset: -5 },
60
+ VANCOUVER: { city: 'Vancouver', timeZone: 'America/Vancouver', name: 'Canada (Pacific)', currency: 'CAD', locale: 'en-CA', utcOffset: -8 },
61
+ BOGOTA: { city: 'Bogota', timeZone: 'America/Bogota', name: 'Colombia', currency: 'COP', locale: 'es-CO', utcOffset: -5 },
62
+ CANCUN: { city: 'Cancun', timeZone: 'America/Cancun', name: 'Mexico (Quintana Roo)', currency: 'MXN', locale: 'es-MX', utcOffset: -5 },
63
+ MEXICO_CITY: { city: 'Mexico City', timeZone: 'America/Mexico_City', name: 'Mexico', currency: 'MXN', locale: 'es-MX', utcOffset: -6 },
64
+ TIJUANA: { city: 'Tijuana', timeZone: 'America/Tijuana', name: 'Mexico (Pacific)', currency: 'MXN', locale: 'es-MX', utcOffset: -8 },
65
+ LIMA: { city: 'Lima', timeZone: 'America/Lima', name: 'Peru', currency: 'PEN', locale: 'es-PE', utcOffset: -5 },
66
+ SANTIAGO: { city: 'Santiago', timeZone: 'America/Santiago', name: 'Chile', currency: 'CLP', locale: 'es-CL', utcOffset: -4 },
67
+ CHICAGO: { city: 'Chicago', timeZone: 'America/Chicago', name: 'United States (Central)', currency: 'USD', locale: 'en-US', utcOffset: -6 },
68
+ DENVER: { city: 'Denver', timeZone: 'America/Denver', name: 'United States (Mountain)', currency: 'USD', locale: 'en-US', utcOffset: -7 },
69
+ LOS_ANGELES: { city: 'Los Angeles', timeZone: 'America/Los_Angeles', name: 'United States (Pacific)', currency: 'USD', locale: 'en-US', utcOffset: -8 },
70
+ NEW_YORK: { city: 'New York', timeZone: 'America/New_York', name: 'United States (Eastern)', currency: 'USD', locale: 'en-US', utcOffset: -5 },
71
+
72
+ // ASIA
73
+ SHANGHAI: { city: 'Shanghai', timeZone: 'Asia/Shanghai', name: 'China', currency: 'CNY', locale: 'zh-CN', utcOffset: +8 },
74
+ KOLKATA: { city: 'Kolkata', timeZone: 'Asia/Kolkata', name: 'India', currency: 'INR', locale: 'en-IN', utcOffset: +5.5 },
75
+ TOKYO: { city: 'Tokyo', timeZone: 'Asia/Tokyo', name: 'Japan', currency: 'JPY', locale: 'ja-JP', utcOffset: +9 },
76
+ SEOUL: { city: 'Seoul', timeZone: 'Asia/Seoul', name: 'South Korea', currency: 'KRW', locale: 'ko-KR', utcOffset: +9 },
77
+ DUBAI: { city: 'Dubai', timeZone: 'Asia/Dubai', name: 'United Arab Emirates', currency: 'AED', locale: 'ar-AE', utcOffset: +4 },
78
+
79
+ // EUROPE
80
+ BERLIN: { city: 'Berlin', timeZone: 'Europe/Berlin', name: 'Germany', currency: 'EUR', locale: 'de-DE', utcOffset: +1 },
81
+ PARIS: { city: 'Paris', timeZone: 'Europe/Paris', name: 'France', currency: 'EUR', locale: 'fr-FR', utcOffset: +1 },
82
+ ROME: { city: 'Rome', timeZone: 'Europe/Rome', name: 'Italy', currency: 'EUR', locale: 'it-IT', utcOffset: +1 },
83
+ MADRID: { city: 'Madrid', timeZone: 'Europe/Madrid', name: 'Spain', currency: 'EUR', locale: 'es-ES', utcOffset: +1 },
84
+ ZURICH: { city: 'Zurich', timeZone: 'Europe/Zurich', name: 'Switzerland', currency: 'CHF', locale: 'de-CH', utcOffset: +1 },
85
+ LONDON: { city: 'London', timeZone: 'Europe/London', name: 'United Kingdom', currency: 'GBP', locale: 'en-GB', utcOffset: 0 },
86
+
87
+ // OCEANIA
88
+ SYDNEY: { city: 'Sydney', timeZone: 'Australia/Sydney', name: 'Australia', currency: 'AUD', locale: 'en-AU', utcOffset: +10 },
89
+ AUCKLAND: { city: 'Auckland', timeZone: 'Pacific/Auckland', name: 'New Zealand', currency: 'NZD', locale: 'en-NZ', utcOffset: +12 },
90
+ };
91
+
@@ -0,0 +1,2 @@
1
+ export * from './advanced-table';
2
+ export * from './advanced-card';
@@ -0,0 +1,4 @@
1
+ /*
2
+ * Public API Surface of b2b-tools
3
+ */
4
+ export * from './lib/components';
@@ -0,0 +1,17 @@
1
+ /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
+ /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
+ {
4
+ "extends": "../../tsconfig.json",
5
+ "compilerOptions": {
6
+ "outDir": "../../out-tsc/lib",
7
+ "declaration": true,
8
+ "declarationMap": true,
9
+ "types": []
10
+ },
11
+ "include": [
12
+ "src/**/*.ts"
13
+ ],
14
+ "exclude": [
15
+ "**/*.spec.ts"
16
+ ]
17
+ }
@@ -0,0 +1,11 @@
1
+ /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
+ /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
+ {
4
+ "extends": "./tsconfig.lib.json",
5
+ "compilerOptions": {
6
+ "declarationMap": false
7
+ },
8
+ "angularCompilerOptions": {
9
+ "compilationMode": "partial"
10
+ }
11
+ }
@@ -0,0 +1,15 @@
1
+ /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
+ /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
+ {
4
+ "extends": "../../tsconfig.json",
5
+ "compilerOptions": {
6
+ "outDir": "../../out-tsc/spec",
7
+ "types": [
8
+ "vitest/globals"
9
+ ]
10
+ },
11
+ "include": [
12
+ "src/**/*.d.ts",
13
+ "src/**/*.spec.ts"
14
+ ]
15
+ }