@4byte/shared-lib 0.0.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.
- package/.editorconfig +17 -0
- package/.prettierrc +12 -0
- package/.vscode/extensions.json +4 -0
- package/.vscode/launch.json +20 -0
- package/.vscode/mcp.json +9 -0
- package/.vscode/tasks.json +42 -0
- package/README.md +284 -0
- package/angular.json +211 -0
- package/ng-package.json +11 -0
- package/package.json +44 -0
- package/projects/storybook-host/.storybook/main.ts +20 -0
- package/projects/storybook-host/.storybook/preview.ts +74 -0
- package/projects/storybook-host/.storybook/tsconfig.doc.json +10 -0
- package/projects/storybook-host/.storybook/tsconfig.json +22 -0
- package/projects/storybook-host/.storybook/tutorial/Installation.mdx +6 -0
- package/projects/storybook-host/.storybook/tutorial/Introduction.mdx +18 -0
- package/projects/storybook-host/.storybook/tutorial/Theming.mdx +14 -0
- package/projects/storybook-host/.storybook/typings.d.ts +4 -0
- package/projects/storybook-host/documentation.json +605 -0
- package/projects/storybook-host/public/favicon.ico +0 -0
- package/projects/storybook-host/src/app/app.config.ts +8 -0
- package/projects/storybook-host/src/app/app.css +0 -0
- package/projects/storybook-host/src/app/app.html +343 -0
- package/projects/storybook-host/src/app/app.ts +11 -0
- package/projects/storybook-host/src/index.html +13 -0
- package/projects/storybook-host/src/main.ts +6 -0
- package/projects/storybook-host/src/stories/assets/accessibility.png +0 -0
- package/projects/storybook-host/src/stories/assets/accessibility.svg +1 -0
- package/projects/storybook-host/src/stories/assets/addon-library.png +0 -0
- package/projects/storybook-host/src/stories/assets/assets.png +0 -0
- package/projects/storybook-host/src/stories/assets/avif-test-image.avif +0 -0
- package/projects/storybook-host/src/stories/assets/context.png +0 -0
- package/projects/storybook-host/src/stories/assets/discord.svg +1 -0
- package/projects/storybook-host/src/stories/assets/docs.png +0 -0
- package/projects/storybook-host/src/stories/assets/figma-plugin.png +0 -0
- package/projects/storybook-host/src/stories/assets/github.svg +1 -0
- package/projects/storybook-host/src/stories/assets/share.png +0 -0
- package/projects/storybook-host/src/stories/assets/styling.png +0 -0
- package/projects/storybook-host/src/stories/assets/testing.png +0 -0
- package/projects/storybook-host/src/stories/assets/theming.png +0 -0
- package/projects/storybook-host/src/stories/assets/tutorials.svg +1 -0
- package/projects/storybook-host/src/stories/assets/youtube.svg +1 -0
- package/projects/storybook-host/src/stories/button.component.ts +50 -0
- package/projects/storybook-host/src/stories/button.css +30 -0
- package/projects/storybook-host/src/stories/button.stories.ts +49 -0
- package/projects/storybook-host/src/stories/header.component.ts +78 -0
- package/projects/storybook-host/src/stories/header.css +32 -0
- package/projects/storybook-host/src/stories/header.stories.ts +33 -0
- package/projects/storybook-host/src/stories/page.component.ts +84 -0
- package/projects/storybook-host/src/stories/page.css +68 -0
- package/projects/storybook-host/src/stories/page.stories.ts +32 -0
- package/projects/storybook-host/src/stories/user.ts +3 -0
- package/projects/storybook-host/src/styles.css +1 -0
- package/projects/storybook-host/tsconfig.app.json +15 -0
- package/projects/storybook-host/tsconfig.spec.json +15 -0
- package/src/lib/components/byte-button/byte-button-group/byte-button-group.css +27 -0
- package/src/lib/components/byte-button/byte-button-group/byte-button-group.html +6 -0
- package/src/lib/components/byte-button/byte-button-group/byte-button-group.spec.ts +22 -0
- package/src/lib/components/byte-button/byte-button-group/byte-button-group.ts +35 -0
- package/src/lib/components/byte-button/byte-button.css +0 -0
- package/src/lib/components/byte-button/byte-button.directive.ts +17 -0
- package/src/lib/components/byte-button/byte-button.html +29 -0
- package/src/lib/components/byte-button/byte-button.module.ts +19 -0
- package/src/lib/components/byte-button/byte-button.stories.ts +449 -0
- package/src/lib/components/byte-button/byte-button.ts +129 -0
- package/src/lib/components/byte-dialog/byte-dialog.css +0 -0
- package/src/lib/components/byte-dialog/byte-dialog.directive.ts +21 -0
- package/src/lib/components/byte-dialog/byte-dialog.html +47 -0
- package/src/lib/components/byte-dialog/byte-dialog.module.ts +21 -0
- package/src/lib/components/byte-dialog/byte-dialog.spec.ts +22 -0
- package/src/lib/components/byte-dialog/byte-dialog.ts +121 -0
- package/src/lib/components/byte-dialog/byte.dialog.stories.ts +215 -0
- package/src/lib/components/byte-input/byte-input.css +29 -0
- package/src/lib/components/byte-input/byte-input.html +58 -0
- package/src/lib/components/byte-input/byte-input.spec.ts +22 -0
- package/src/lib/components/byte-input/byte-input.stories.ts +60 -0
- package/src/lib/components/byte-input/byte-input.ts +97 -0
- package/src/lib/components/byte-select/byte-select.css +16 -0
- package/src/lib/components/byte-select/byte-select.directive.ts +61 -0
- package/src/lib/components/byte-select/byte-select.html +101 -0
- package/src/lib/components/byte-select/byte-select.module.ts +26 -0
- package/src/lib/components/byte-select/byte-select.spec.ts +22 -0
- package/src/lib/components/byte-select/byte-select.stories.ts +194 -0
- package/src/lib/components/byte-select/byte-select.ts +168 -0
- package/src/lib/components/byte-select/index.ts +3 -0
- package/src/lib/components/byte-sidebar/byte-sidebar.css +0 -0
- package/src/lib/components/byte-sidebar/byte-sidebar.directive.ts +11 -0
- package/src/lib/components/byte-sidebar/byte-sidebar.html +31 -0
- package/src/lib/components/byte-sidebar/byte-sidebar.module.ts +16 -0
- package/src/lib/components/byte-sidebar/byte-sidebar.spec.ts +22 -0
- package/src/lib/components/byte-sidebar/byte-sidebar.stories.ts +190 -0
- package/src/lib/components/byte-sidebar/byte-sidebar.ts +108 -0
- package/src/lib/components/byte-table/byte-table.css +0 -0
- package/src/lib/components/byte-table/byte-table.directive.ts +49 -0
- package/src/lib/components/byte-table/byte-table.html +102 -0
- package/src/lib/components/byte-table/byte-table.module.ts +33 -0
- package/src/lib/components/byte-table/byte-table.spec.ts +22 -0
- package/src/lib/components/byte-table/byte-table.stories.ts +296 -0
- package/src/lib/components/byte-table/byte-table.ts +162 -0
- package/src/lib/components/calendar/calendar.css +16 -0
- package/src/lib/components/calendar/calendar.html +15 -0
- package/src/lib/components/calendar/calendar.spec.ts +22 -0
- package/src/lib/components/calendar/calendar.stories.ts +153 -0
- package/src/lib/components/calendar/calendar.ts +89 -0
- package/src/lib/components/select/select.css +16 -0
- package/src/lib/components/select/select.html +14 -0
- package/src/lib/components/select/select.spec.ts +22 -0
- package/src/lib/components/select/select.ts +73 -0
- package/src/lib/config/empresa-ui.token.ts +5 -0
- package/src/lib/providers/empresa-ui-config.ts +8 -0
- package/src/lib/providers/provide-empresa-ui.ts +42 -0
- package/src/lib/themes/CRM-Theme.ts +34 -0
- package/src/lib/themes/aura.ts +3 -0
- package/src/lib/themes/index.ts +2 -0
- package/src/lib/themes/registry.ts +9 -0
- package/src/lib/utils/inject-prime-icons.ts +12 -0
- package/src/public-api.ts +30 -0
- package/tsconfig.json +45 -0
- package/tsconfig.lib.json +11 -0
- package/tsconfig.lib.prod.json +9 -0
- package/tsconfig.spec.json +8 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import {
|
|
2
|
+
applicationConfig,
|
|
3
|
+
moduleMetadata,
|
|
4
|
+
type Meta,
|
|
5
|
+
type StoryObj
|
|
6
|
+
} from '@storybook/angular';
|
|
7
|
+
|
|
8
|
+
import { ByteSidebar } from './byte-sidebar';
|
|
9
|
+
import { ByteSidebarModule } from './byte-sidebar.module';
|
|
10
|
+
|
|
11
|
+
import { provideEmpresaUI } from './../../providers/provide-empresa-ui';
|
|
12
|
+
import { ByteButton } from '../byte-button/byte-button';
|
|
13
|
+
|
|
14
|
+
const meta: Meta<ByteSidebar> = {
|
|
15
|
+
title: 'Components/ByteSidebar',
|
|
16
|
+
component: ByteSidebar,
|
|
17
|
+
|
|
18
|
+
decorators: [
|
|
19
|
+
moduleMetadata({
|
|
20
|
+
imports: [
|
|
21
|
+
ByteButton,
|
|
22
|
+
ByteSidebarModule
|
|
23
|
+
]
|
|
24
|
+
}),
|
|
25
|
+
|
|
26
|
+
(story, context) =>
|
|
27
|
+
applicationConfig({
|
|
28
|
+
providers: [
|
|
29
|
+
provideEmpresaUI({
|
|
30
|
+
theme: context.globals['theme']
|
|
31
|
+
})
|
|
32
|
+
]
|
|
33
|
+
})(story, context)
|
|
34
|
+
],
|
|
35
|
+
|
|
36
|
+
tags: ['autodocs'],
|
|
37
|
+
|
|
38
|
+
parameters: {
|
|
39
|
+
docs: {
|
|
40
|
+
description: {
|
|
41
|
+
component:
|
|
42
|
+
'Panel lateral desplegable (overlay), basado en PrimeNG y compatible con un template personalizado de header.'
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default meta;
|
|
49
|
+
|
|
50
|
+
type Story = StoryObj<ByteSidebar>;
|
|
51
|
+
|
|
52
|
+
export const Normal: Story = {
|
|
53
|
+
render: (args) => ({
|
|
54
|
+
props: {
|
|
55
|
+
...args,
|
|
56
|
+
visible: false
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
template: `
|
|
60
|
+
<byte-button (click)="visible = true" label="Abrir sidebar"></byte-button>
|
|
61
|
+
|
|
62
|
+
<byte-sidebar
|
|
63
|
+
[(visible)]="visible"
|
|
64
|
+
[position]="position"
|
|
65
|
+
>
|
|
66
|
+
<h3>Contenido del sidebar</h3>
|
|
67
|
+
<p>Aquí va lo que necesites mostrar dentro del panel.</p>
|
|
68
|
+
</byte-sidebar>
|
|
69
|
+
`
|
|
70
|
+
}),
|
|
71
|
+
|
|
72
|
+
args: {
|
|
73
|
+
position: 'left'
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const Right: Story = {
|
|
78
|
+
render: (args) => ({
|
|
79
|
+
props: {
|
|
80
|
+
...args,
|
|
81
|
+
visible: false
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
template: `
|
|
85
|
+
<byte-button (click)="visible = true" label="Abrir desde la derecha"></byte-button>
|
|
86
|
+
|
|
87
|
+
<byte-sidebar
|
|
88
|
+
[(visible)]="visible"
|
|
89
|
+
[position]="position"
|
|
90
|
+
>
|
|
91
|
+
<h3>Panel derecho</h3>
|
|
92
|
+
<p>Ideal para filtros o detalles contextuales.</p>
|
|
93
|
+
</byte-sidebar>
|
|
94
|
+
`
|
|
95
|
+
}),
|
|
96
|
+
|
|
97
|
+
args: {
|
|
98
|
+
position: 'right'
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const TopBottom: Story = {
|
|
103
|
+
render: (args) => ({
|
|
104
|
+
props: {
|
|
105
|
+
...args,
|
|
106
|
+
visibleTop: false,
|
|
107
|
+
visibleBottom: false
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
template: `
|
|
111
|
+
<div style="display:flex; gap:10px">
|
|
112
|
+
<byte-button (click)="visibleTop = true" label="Abrir arriba"></byte-button>
|
|
113
|
+
<byte-button (click)="visibleBottom = true" label="Abrir abajo"></byte-button>
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
<byte-sidebar
|
|
117
|
+
[(visible)]="visibleTop"
|
|
118
|
+
position="top"
|
|
119
|
+
>
|
|
120
|
+
<p>Sidebar desde arriba.</p>
|
|
121
|
+
</byte-sidebar>
|
|
122
|
+
|
|
123
|
+
<byte-sidebar
|
|
124
|
+
[(visible)]="visibleBottom"
|
|
125
|
+
position="bottom"
|
|
126
|
+
>
|
|
127
|
+
<p>Sidebar desde abajo.</p>
|
|
128
|
+
</byte-sidebar>
|
|
129
|
+
`
|
|
130
|
+
}),
|
|
131
|
+
|
|
132
|
+
args: {}
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export const NonModal: Story = {
|
|
136
|
+
render: (args) => ({
|
|
137
|
+
props: {
|
|
138
|
+
...args,
|
|
139
|
+
visible: false
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
template: `
|
|
143
|
+
<byte-button (click)="visible = true" label="Abrir sidebar no modal"></byte-button>
|
|
144
|
+
|
|
145
|
+
<byte-sidebar
|
|
146
|
+
[(visible)]="visible"
|
|
147
|
+
[position]="position"
|
|
148
|
+
[modal]="modal"
|
|
149
|
+
>
|
|
150
|
+
<h3>Sidebar no modal</h3>
|
|
151
|
+
<p>No bloquea la interacción con el resto de la página.</p>
|
|
152
|
+
</byte-sidebar>
|
|
153
|
+
`
|
|
154
|
+
}),
|
|
155
|
+
|
|
156
|
+
args: {
|
|
157
|
+
position: 'left',
|
|
158
|
+
modal: false
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export const CustomHeader: Story = {
|
|
163
|
+
render: (args) => ({
|
|
164
|
+
props: {
|
|
165
|
+
...args,
|
|
166
|
+
visible: false
|
|
167
|
+
},
|
|
168
|
+
|
|
169
|
+
template: `
|
|
170
|
+
<byte-button (click)="visible = true" label="Abrir sidebar"></byte-button>
|
|
171
|
+
|
|
172
|
+
<byte-sidebar
|
|
173
|
+
[(visible)]="visible"
|
|
174
|
+
[position]="position"
|
|
175
|
+
>
|
|
176
|
+
<ng-template byteSidebarHeader>
|
|
177
|
+
<div style="display: flex; align-items: center; gap: 8px;">
|
|
178
|
+
<strong>⚙️ Configuración</strong>
|
|
179
|
+
</div>
|
|
180
|
+
</ng-template>
|
|
181
|
+
|
|
182
|
+
<p>Contenido con encabezado personalizado.</p>
|
|
183
|
+
</byte-sidebar>
|
|
184
|
+
`
|
|
185
|
+
}),
|
|
186
|
+
|
|
187
|
+
args: {
|
|
188
|
+
position: 'right'
|
|
189
|
+
}
|
|
190
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
ChangeDetectorRef,
|
|
4
|
+
Component,
|
|
5
|
+
ContentChild,
|
|
6
|
+
EventEmitter,
|
|
7
|
+
Input,
|
|
8
|
+
Output
|
|
9
|
+
} from '@angular/core';
|
|
10
|
+
|
|
11
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
12
|
+
|
|
13
|
+
import { DrawerModule } from 'primeng/drawer';
|
|
14
|
+
|
|
15
|
+
import { ByteSidebarHeaderDirective } from './byte-sidebar.directive';
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@Component({
|
|
19
|
+
selector: 'byte-sidebar',
|
|
20
|
+
|
|
21
|
+
imports: [
|
|
22
|
+
DrawerModule,
|
|
23
|
+
|
|
24
|
+
NgTemplateOutlet,
|
|
25
|
+
|
|
26
|
+
ByteSidebarHeaderDirective
|
|
27
|
+
],
|
|
28
|
+
|
|
29
|
+
templateUrl: './byte-sidebar.html',
|
|
30
|
+
|
|
31
|
+
styleUrl: './byte-sidebar.css',
|
|
32
|
+
|
|
33
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
34
|
+
})
|
|
35
|
+
export class ByteSidebar {
|
|
36
|
+
|
|
37
|
+
constructor(private cdRef: ChangeDetectorRef) {}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
// =====================================================
|
|
41
|
+
// INPUTS
|
|
42
|
+
// =====================================================
|
|
43
|
+
|
|
44
|
+
@Input()
|
|
45
|
+
visible = false;
|
|
46
|
+
|
|
47
|
+
@Input()
|
|
48
|
+
position: 'left' | 'right' | 'top' | 'bottom' | 'full' = 'left';
|
|
49
|
+
|
|
50
|
+
@Input()
|
|
51
|
+
modal = true;
|
|
52
|
+
|
|
53
|
+
@Input()
|
|
54
|
+
dismissible = true;
|
|
55
|
+
|
|
56
|
+
@Input()
|
|
57
|
+
closeOnEscape = true;
|
|
58
|
+
|
|
59
|
+
@Input()
|
|
60
|
+
showCloseIcon = true;
|
|
61
|
+
|
|
62
|
+
@Input()
|
|
63
|
+
blockScroll = false;
|
|
64
|
+
|
|
65
|
+
@Input()
|
|
66
|
+
style: { [klass: string]: any } | null = null;
|
|
67
|
+
|
|
68
|
+
@Input()
|
|
69
|
+
styleClass = '';
|
|
70
|
+
|
|
71
|
+
@Input()
|
|
72
|
+
autoZIndex = true;
|
|
73
|
+
|
|
74
|
+
@Input()
|
|
75
|
+
baseZIndex = 0;
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
// =====================================================
|
|
79
|
+
// OUTPUTS
|
|
80
|
+
// =====================================================
|
|
81
|
+
|
|
82
|
+
@Output()
|
|
83
|
+
visibleChange = new EventEmitter<boolean>();
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
// =====================================================
|
|
87
|
+
// CUSTOM TEMPLATES
|
|
88
|
+
// =====================================================
|
|
89
|
+
|
|
90
|
+
@ContentChild(ByteSidebarHeaderDirective)
|
|
91
|
+
headerTemplate?: ByteSidebarHeaderDirective;
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
// =====================================================
|
|
95
|
+
// CHANGE
|
|
96
|
+
// =====================================================
|
|
97
|
+
|
|
98
|
+
onVisibleChange(value: boolean): void {
|
|
99
|
+
|
|
100
|
+
this.visible = value;
|
|
101
|
+
|
|
102
|
+
this.visibleChange.emit(value);
|
|
103
|
+
|
|
104
|
+
this.cdRef.markForCheck();
|
|
105
|
+
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Directive, TemplateRef } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Directive({
|
|
4
|
+
selector: 'ng-template[byteTableCaption]',
|
|
5
|
+
standalone: true
|
|
6
|
+
})
|
|
7
|
+
export class ByteTableCaptionDirective {
|
|
8
|
+
constructor(public template: TemplateRef<any>) {}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@Directive({
|
|
12
|
+
selector: 'ng-template[byteTableHeader]',
|
|
13
|
+
standalone: true
|
|
14
|
+
})
|
|
15
|
+
export class ByteTableHeaderDirective {
|
|
16
|
+
constructor(public template: TemplateRef<any>) {}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@Directive({
|
|
20
|
+
selector: 'ng-template[byteTableBody]',
|
|
21
|
+
standalone: true
|
|
22
|
+
})
|
|
23
|
+
export class ByteTableBodyDirective {
|
|
24
|
+
constructor(public template: TemplateRef<any>) {}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@Directive({
|
|
28
|
+
selector: 'ng-template[byteTableFooter]',
|
|
29
|
+
standalone: true
|
|
30
|
+
})
|
|
31
|
+
export class ByteTableFooterDirective {
|
|
32
|
+
constructor(public template: TemplateRef<any>) {}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@Directive({
|
|
36
|
+
selector: 'ng-template[byteTableEmptyMessage]',
|
|
37
|
+
standalone: true
|
|
38
|
+
})
|
|
39
|
+
export class ByteTableEmptyMessageDirective {
|
|
40
|
+
constructor(public template: TemplateRef<any>) {}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@Directive({
|
|
44
|
+
selector: 'ng-template[byteTableSummary]',
|
|
45
|
+
standalone: true
|
|
46
|
+
})
|
|
47
|
+
export class ByteTableSummaryDirective {
|
|
48
|
+
constructor(public template: TemplateRef<any>) {}
|
|
49
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<p-table
|
|
2
|
+
[value]="value"
|
|
3
|
+
[columns]="columns"
|
|
4
|
+
[paginator]="paginator"
|
|
5
|
+
[rows]="rows"
|
|
6
|
+
[rowsPerPageOptions]="rowsPerPageOptions"
|
|
7
|
+
[loading]="loading"
|
|
8
|
+
[sortField]="sortField"
|
|
9
|
+
[sortOrder]="sortOrder"
|
|
10
|
+
[selectionMode]="selectionMode"
|
|
11
|
+
[(selection)]="selection"
|
|
12
|
+
(selectionChange)="onSelectionChange($event)"
|
|
13
|
+
[dataKey]="dataKey"
|
|
14
|
+
[scrollable]="scrollable"
|
|
15
|
+
[tableStyle]="tableStyle"
|
|
16
|
+
>
|
|
17
|
+
|
|
18
|
+
@if (captionTemplate) {
|
|
19
|
+
|
|
20
|
+
<ng-template pTemplate="caption">
|
|
21
|
+
|
|
22
|
+
<ng-container [ngTemplateOutlet]="captionTemplate.template" />
|
|
23
|
+
|
|
24
|
+
</ng-template>
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@if (headerTemplate) {
|
|
29
|
+
|
|
30
|
+
<ng-template
|
|
31
|
+
pTemplate="header"
|
|
32
|
+
let-columns
|
|
33
|
+
>
|
|
34
|
+
|
|
35
|
+
<ng-container
|
|
36
|
+
[ngTemplateOutlet]="headerTemplate.template"
|
|
37
|
+
[ngTemplateOutletContext]="{ $implicit: columns }"
|
|
38
|
+
/>
|
|
39
|
+
|
|
40
|
+
</ng-template>
|
|
41
|
+
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@if (bodyTemplate) {
|
|
45
|
+
|
|
46
|
+
<ng-template
|
|
47
|
+
pTemplate="body"
|
|
48
|
+
let-rowData
|
|
49
|
+
let-columns="columns"
|
|
50
|
+
let-rowIndex="rowIndex"
|
|
51
|
+
>
|
|
52
|
+
|
|
53
|
+
<ng-container
|
|
54
|
+
[ngTemplateOutlet]="bodyTemplate.template"
|
|
55
|
+
[ngTemplateOutletContext]="{
|
|
56
|
+
$implicit: rowData,
|
|
57
|
+
columns: columns,
|
|
58
|
+
rowIndex: rowIndex
|
|
59
|
+
}"
|
|
60
|
+
/>
|
|
61
|
+
|
|
62
|
+
</ng-template>
|
|
63
|
+
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@if (footerTemplate) {
|
|
67
|
+
|
|
68
|
+
<ng-template
|
|
69
|
+
pTemplate="footer"
|
|
70
|
+
let-columns
|
|
71
|
+
>
|
|
72
|
+
|
|
73
|
+
<ng-container
|
|
74
|
+
[ngTemplateOutlet]="footerTemplate.template"
|
|
75
|
+
[ngTemplateOutletContext]="{ $implicit: columns }"
|
|
76
|
+
/>
|
|
77
|
+
|
|
78
|
+
</ng-template>
|
|
79
|
+
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@if (emptyMessageTemplate) {
|
|
83
|
+
|
|
84
|
+
<ng-template pTemplate="emptymessage">
|
|
85
|
+
|
|
86
|
+
<ng-container [ngTemplateOutlet]="emptyMessageTemplate.template" />
|
|
87
|
+
|
|
88
|
+
</ng-template>
|
|
89
|
+
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@if (summaryTemplate) {
|
|
93
|
+
|
|
94
|
+
<ng-template pTemplate="summary">
|
|
95
|
+
|
|
96
|
+
<ng-container [ngTemplateOutlet]="summaryTemplate.template" />
|
|
97
|
+
|
|
98
|
+
</ng-template>
|
|
99
|
+
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
</p-table>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import { ByteTable } from './byte-table';
|
|
4
|
+
import {
|
|
5
|
+
ByteTableCaptionDirective,
|
|
6
|
+
ByteTableHeaderDirective,
|
|
7
|
+
ByteTableBodyDirective,
|
|
8
|
+
ByteTableFooterDirective,
|
|
9
|
+
ByteTableEmptyMessageDirective,
|
|
10
|
+
ByteTableSummaryDirective
|
|
11
|
+
} from './byte-table.directive';
|
|
12
|
+
|
|
13
|
+
@NgModule({
|
|
14
|
+
imports: [
|
|
15
|
+
ByteTable,
|
|
16
|
+
ByteTableCaptionDirective,
|
|
17
|
+
ByteTableHeaderDirective,
|
|
18
|
+
ByteTableBodyDirective,
|
|
19
|
+
ByteTableFooterDirective,
|
|
20
|
+
ByteTableEmptyMessageDirective,
|
|
21
|
+
ByteTableSummaryDirective
|
|
22
|
+
],
|
|
23
|
+
exports: [
|
|
24
|
+
ByteTable,
|
|
25
|
+
ByteTableCaptionDirective,
|
|
26
|
+
ByteTableHeaderDirective,
|
|
27
|
+
ByteTableBodyDirective,
|
|
28
|
+
ByteTableFooterDirective,
|
|
29
|
+
ByteTableEmptyMessageDirective,
|
|
30
|
+
ByteTableSummaryDirective
|
|
31
|
+
]
|
|
32
|
+
})
|
|
33
|
+
export class ByteTableModule {}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { ByteTable } from './byte-table';
|
|
4
|
+
|
|
5
|
+
describe('ByteTable', () => {
|
|
6
|
+
let component: ByteTable;
|
|
7
|
+
let fixture: ComponentFixture<ByteTable>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [ByteTable],
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
|
|
14
|
+
fixture = TestBed.createComponent(ByteTable);
|
|
15
|
+
component = fixture.componentInstance;
|
|
16
|
+
await fixture.whenStable();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('should create', () => {
|
|
20
|
+
expect(component).toBeTruthy();
|
|
21
|
+
});
|
|
22
|
+
});
|