b2b-tools 0.1.2 → 0.1.3

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": "b2b-tools",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "license": "MIT",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^21.1.0",
@@ -1,6 +1,151 @@
1
+ import * as b2b_tools from 'b2b-tools';
1
2
  import * as _angular_core from '@angular/core';
2
3
  import { TemplateRef } from '@angular/core';
3
- import * as b2b_tools from 'b2b-tools';
4
+
5
+ type AdvancedTone = 'primary' | 'success' | 'warning' | 'danger' | 'neutral';
6
+ interface AdvancedBadge {
7
+ label: string;
8
+ tone?: AdvancedTone;
9
+ }
10
+ interface AdvancedHighlight {
11
+ label: string;
12
+ value: string;
13
+ hint?: string;
14
+ }
15
+ interface AdvancedAction {
16
+ id: string;
17
+ label: string;
18
+ tone?: 'primary' | 'secondary' | 'danger';
19
+ disabled?: boolean;
20
+ }
21
+ type AdvancedTabKind = 'template' | 'text' | 'empty';
22
+ type AdvancedDensity = 'compact' | 'comfortable';
23
+ type AdvancedSize = 'sm' | 'md' | 'lg';
24
+ interface AdvancedCardTab {
25
+ id: string;
26
+ label: string;
27
+ kind: AdvancedTabKind;
28
+ /** kind=text */
29
+ text?: string;
30
+ /** kind=template */
31
+ templateId?: string;
32
+ /** toolbar por tab */
33
+ actions?: AdvancedTabAction[];
34
+ /** badge pequeño opcional en tab */
35
+ pill?: {
36
+ label: string;
37
+ tone?: AdvancedTone;
38
+ };
39
+ }
40
+ interface AdvancedCardConfig {
41
+ id: string;
42
+ title: string;
43
+ subtitle?: string;
44
+ badge?: AdvancedBadge;
45
+ highlights?: AdvancedHighlight[];
46
+ summaryBlocks?: AdvancedSummaryBlock[];
47
+ primaryCta?: {
48
+ label: string;
49
+ };
50
+ actions?: AdvancedAction[];
51
+ tabs?: AdvancedCardTab[];
52
+ defaultTabId?: string;
53
+ expandMode?: AdvancedExpandMode;
54
+ closeOnBackdrop?: boolean;
55
+ density?: AdvancedDensity;
56
+ size?: AdvancedSize;
57
+ data?: any;
58
+ }
59
+ interface AdvancedSummaryBlock {
60
+ title: string;
61
+ rows: {
62
+ label: string;
63
+ value: string;
64
+ }[];
65
+ }
66
+ interface AdvancedTabAction {
67
+ id: string;
68
+ label: string;
69
+ tone?: 'primary' | 'secondary' | 'danger';
70
+ disabled?: boolean;
71
+ }
72
+ type AdvancedExpandMode = 'inline' | 'drawer' | 'modal';
73
+ type AdvancedCardTemplateCtx = {
74
+ /** The current card identifier (config.id) */
75
+ cardId: string;
76
+ /** The current active tab identifier (tab.id) */
77
+ tabId: string;
78
+ };
79
+ type AdvancedCardContentVm = {
80
+ cardId: string;
81
+ summaryBlocks?: AdvancedSummaryBlock[];
82
+ tabs: AdvancedCardTab[];
83
+ activeTabId: string | null;
84
+ activeTab: AdvancedCardTab | null;
85
+ templateRef: TemplateRef<AdvancedCardTemplateCtx> | null;
86
+ };
87
+
88
+ declare class AdvancedCardTemplateDirective {
89
+ readonly templateRef: TemplateRef<any>;
90
+ templateId: _angular_core.InputSignal<string>;
91
+ constructor(templateRef: TemplateRef<any>);
92
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<AdvancedCardTemplateDirective, never>;
93
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AdvancedCardTemplateDirective, "[advancedCardTemplate]", never, { "templateId": { "alias": "advancedCardTemplate"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
94
+ }
95
+
96
+ declare class AdvancedCard {
97
+ config: _angular_core.InputSignal<AdvancedCardConfig>;
98
+ fullWidthOnExpand: _angular_core.InputSignal<boolean>;
99
+ stickyHeader: _angular_core.InputSignal<boolean>;
100
+ closeOnEsc: _angular_core.InputSignal<boolean>;
101
+ expandedChange: _angular_core.OutputEmitterRef<boolean>;
102
+ action: _angular_core.OutputEmitterRef<{
103
+ actionId: string;
104
+ cardId: string;
105
+ }>;
106
+ tabChanged: _angular_core.OutputEmitterRef<{
107
+ tabId: string;
108
+ cardId: string;
109
+ }>;
110
+ tabAction: _angular_core.OutputEmitterRef<{
111
+ tabId: string;
112
+ actionId: string;
113
+ cardId: string;
114
+ }>;
115
+ private projectedTemplates;
116
+ readonly expanded: _angular_core.WritableSignal<boolean>;
117
+ readonly activeTabId: _angular_core.WritableSignal<string | null>;
118
+ readonly cardId: _angular_core.Signal<string>;
119
+ readonly expandMode: _angular_core.Signal<b2b_tools.AdvancedExpandMode>;
120
+ readonly closeOnBackdrop: _angular_core.Signal<boolean>;
121
+ readonly isInline: _angular_core.Signal<boolean>;
122
+ readonly isDrawer: _angular_core.Signal<boolean>;
123
+ readonly isModal: _angular_core.Signal<boolean>;
124
+ readonly hasHighlights: _angular_core.Signal<boolean>;
125
+ readonly hasSummaryBlocks: _angular_core.Signal<boolean>;
126
+ readonly tabs: _angular_core.Signal<AdvancedCardTab[]>;
127
+ readonly activeTab: _angular_core.Signal<AdvancedCardTab | null>;
128
+ readonly templateMap: _angular_core.Signal<Map<string, AdvancedCardTemplateDirective>>;
129
+ readonly density: _angular_core.Signal<b2b_tools.AdvancedDensity>;
130
+ readonly size: _angular_core.Signal<b2b_tools.AdvancedSize>;
131
+ readonly hostClass: _angular_core.Signal<string>;
132
+ readonly activeTemplateRef: _angular_core.Signal<any>;
133
+ readonly contentVm: _angular_core.Signal<AdvancedCardContentVm>;
134
+ notifyExpandenChangesEffect: _angular_core.EffectRef;
135
+ initiActiveTabEffect: _angular_core.EffectRef;
136
+ toggleExpand(): void;
137
+ expand(): void;
138
+ collapse(): void;
139
+ onActionClick(a: AdvancedAction): void;
140
+ selectTab(tabId: string): void;
141
+ onTabActionClick(tab: AdvancedCardTab, a: AdvancedTabAction): void;
142
+ getActiveTemplate(): AdvancedCardTemplateDirective | null;
143
+ badgeClass(tone: AdvancedTone | undefined): string;
144
+ onKeydown(ev: KeyboardEvent): void;
145
+ onBackdropClick(): void;
146
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<AdvancedCard, never>;
147
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<AdvancedCard, "advanced-card", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "fullWidthOnExpand": { "alias": "fullWidthOnExpand"; "required": false; "isSignal": true; }; "stickyHeader": { "alias": "stickyHeader"; "required": false; "isSignal": true; }; "closeOnEsc": { "alias": "closeOnEsc"; "required": false; "isSignal": true; }; }, { "expandedChange": "expandedChange"; "action": "action"; "tabChanged": "tabChanged"; "tabAction": "tabAction"; }, ["projectedTemplates"], ["*", "*", "ng-template[advancedCardTemplate]"], true, never>;
148
+ }
4
149
 
5
150
  type CellDataType = 'string' | 'integer' | 'decimal' | 'currency' | 'date' | 'datetime' | 'boolean' | 'image' | 'status' | 'link' | 'custom' | 'actions';
6
151
  type CellSize = 'XS' | 'SM' | 'MD' | 'LG' | 'XL' | 'AUTO';
@@ -429,150 +574,5 @@ declare const TIME_ZONES: {
429
574
  };
430
575
  };
431
576
 
432
- type AdvancedTone = 'primary' | 'success' | 'warning' | 'danger' | 'neutral';
433
- interface AdvancedBadge {
434
- label: string;
435
- tone?: AdvancedTone;
436
- }
437
- interface AdvancedHighlight {
438
- label: string;
439
- value: string;
440
- hint?: string;
441
- }
442
- interface AdvancedAction {
443
- id: string;
444
- label: string;
445
- tone?: 'primary' | 'secondary' | 'danger';
446
- disabled?: boolean;
447
- }
448
- type AdvancedTabKind = 'template' | 'text' | 'empty';
449
- type AdvancedDensity = 'compact' | 'comfortable';
450
- type AdvancedSize = 'sm' | 'md' | 'lg';
451
- interface AdvancedCardTab {
452
- id: string;
453
- label: string;
454
- kind: AdvancedTabKind;
455
- /** kind=text */
456
- text?: string;
457
- /** kind=template */
458
- templateId?: string;
459
- /** toolbar por tab */
460
- actions?: AdvancedTabAction[];
461
- /** badge pequeño opcional en tab */
462
- pill?: {
463
- label: string;
464
- tone?: AdvancedTone;
465
- };
466
- }
467
- interface AdvancedCardConfig {
468
- id: string;
469
- title: string;
470
- subtitle?: string;
471
- badge?: AdvancedBadge;
472
- highlights?: AdvancedHighlight[];
473
- summaryBlocks?: AdvancedSummaryBlock[];
474
- primaryCta?: {
475
- label: string;
476
- };
477
- actions?: AdvancedAction[];
478
- tabs?: AdvancedCardTab[];
479
- defaultTabId?: string;
480
- expandMode?: AdvancedExpandMode;
481
- closeOnBackdrop?: boolean;
482
- density?: AdvancedDensity;
483
- size?: AdvancedSize;
484
- data?: any;
485
- }
486
- interface AdvancedSummaryBlock {
487
- title: string;
488
- rows: {
489
- label: string;
490
- value: string;
491
- }[];
492
- }
493
- interface AdvancedTabAction {
494
- id: string;
495
- label: string;
496
- tone?: 'primary' | 'secondary' | 'danger';
497
- disabled?: boolean;
498
- }
499
- type AdvancedExpandMode = 'inline' | 'drawer' | 'modal';
500
- type AdvancedCardTemplateCtx = {
501
- /** The current card identifier (config.id) */
502
- cardId: string;
503
- /** The current active tab identifier (tab.id) */
504
- tabId: string;
505
- };
506
- type AdvancedCardContentVm = {
507
- cardId: string;
508
- summaryBlocks?: AdvancedSummaryBlock[];
509
- tabs: AdvancedCardTab[];
510
- activeTabId: string | null;
511
- activeTab: AdvancedCardTab | null;
512
- templateRef: TemplateRef<AdvancedCardTemplateCtx> | null;
513
- };
514
-
515
- declare class AdvancedCardTemplateDirective {
516
- readonly templateRef: TemplateRef<any>;
517
- templateId: _angular_core.InputSignal<string>;
518
- constructor(templateRef: TemplateRef<any>);
519
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<AdvancedCardTemplateDirective, never>;
520
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AdvancedCardTemplateDirective, "[advancedCardTemplate]", never, { "templateId": { "alias": "advancedCardTemplate"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
521
- }
522
-
523
- declare class AdvancedCard {
524
- config: _angular_core.InputSignal<AdvancedCardConfig>;
525
- fullWidthOnExpand: _angular_core.InputSignal<boolean>;
526
- stickyHeader: _angular_core.InputSignal<boolean>;
527
- closeOnEsc: _angular_core.InputSignal<boolean>;
528
- expandedChange: _angular_core.OutputEmitterRef<boolean>;
529
- action: _angular_core.OutputEmitterRef<{
530
- actionId: string;
531
- cardId: string;
532
- }>;
533
- tabChanged: _angular_core.OutputEmitterRef<{
534
- tabId: string;
535
- cardId: string;
536
- }>;
537
- tabAction: _angular_core.OutputEmitterRef<{
538
- tabId: string;
539
- actionId: string;
540
- cardId: string;
541
- }>;
542
- private projectedTemplates;
543
- readonly expanded: _angular_core.WritableSignal<boolean>;
544
- readonly activeTabId: _angular_core.WritableSignal<string | null>;
545
- readonly cardId: _angular_core.Signal<string>;
546
- readonly expandMode: _angular_core.Signal<b2b_tools.AdvancedExpandMode>;
547
- readonly closeOnBackdrop: _angular_core.Signal<boolean>;
548
- readonly isInline: _angular_core.Signal<boolean>;
549
- readonly isDrawer: _angular_core.Signal<boolean>;
550
- readonly isModal: _angular_core.Signal<boolean>;
551
- readonly hasHighlights: _angular_core.Signal<boolean>;
552
- readonly hasSummaryBlocks: _angular_core.Signal<boolean>;
553
- readonly tabs: _angular_core.Signal<AdvancedCardTab[]>;
554
- readonly activeTab: _angular_core.Signal<AdvancedCardTab | null>;
555
- readonly templateMap: _angular_core.Signal<Map<string, AdvancedCardTemplateDirective>>;
556
- readonly density: _angular_core.Signal<b2b_tools.AdvancedDensity>;
557
- readonly size: _angular_core.Signal<b2b_tools.AdvancedSize>;
558
- readonly hostClass: _angular_core.Signal<string>;
559
- readonly activeTemplateRef: _angular_core.Signal<any>;
560
- readonly contentVm: _angular_core.Signal<AdvancedCardContentVm>;
561
- notifyExpandenChangesEffect: _angular_core.EffectRef;
562
- initiActiveTabEffect: _angular_core.EffectRef;
563
- toggleExpand(): void;
564
- expand(): void;
565
- collapse(): void;
566
- onActionClick(a: AdvancedAction): void;
567
- selectTab(tabId: string): void;
568
- onTabActionClick(tab: AdvancedCardTab, a: AdvancedTabAction): void;
569
- getActiveTemplate(): AdvancedCardTemplateDirective | null;
570
- badgeClass(tone: AdvancedTone | undefined): string;
571
- onKeydown(ev: KeyboardEvent): void;
572
- onBackdropClick(): void;
573
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<AdvancedCard, never>;
574
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<AdvancedCard, "advanced-card", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "fullWidthOnExpand": { "alias": "fullWidthOnExpand"; "required": false; "isSignal": true; }; "stickyHeader": { "alias": "stickyHeader"; "required": false; "isSignal": true; }; "closeOnEsc": { "alias": "closeOnEsc"; "required": false; "isSignal": true; }; }, { "expandedChange": "expandedChange"; "action": "action"; "tabChanged": "tabChanged"; "tabAction": "tabAction"; }, ["projectedTemplates"], ["*", "*", "ng-template[advancedCardTemplate]"], true, never>;
575
- }
576
-
577
577
  export { AdvancedCard, AdvancedCardTemplateDirective, AdvancedTable, SVG_ICONS, TIME_ZONES };
578
578
  export type { ActionRender, ActionVariant, AdvancedAction, AdvancedBadge, AdvancedCardConfig, AdvancedCardContentVm, AdvancedCardTab, AdvancedCardTemplateCtx, AdvancedDensity, AdvancedExpandMode, AdvancedHighlight, AdvancedSize, AdvancedSummaryBlock, AdvancedTabAction, AdvancedTabKind, AdvancedTone, CellDataType, CellSize, Icon, PagerItem, RowId, TableAction, TableActionEvent, TableColumn, TableConfig, TableSortState, TextAlign, TimeZoneInfo };