@4byte/shared-lib 0.0.1 → 0.0.2
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/fesm2022/4byte-shared-lib.mjs +1176 -0
- package/fesm2022/4byte-shared-lib.mjs.map +1 -0
- package/package.json +15 -27
- package/types/4byte-shared-lib.d.ts +343 -0
- package/.editorconfig +0 -17
- package/.prettierrc +0 -12
- package/.vscode/extensions.json +0 -4
- package/.vscode/launch.json +0 -20
- package/.vscode/mcp.json +0 -9
- package/.vscode/tasks.json +0 -42
- package/angular.json +0 -211
- package/ng-package.json +0 -11
- package/projects/storybook-host/.storybook/main.ts +0 -20
- package/projects/storybook-host/.storybook/preview.ts +0 -74
- package/projects/storybook-host/.storybook/tsconfig.doc.json +0 -10
- package/projects/storybook-host/.storybook/tsconfig.json +0 -22
- package/projects/storybook-host/.storybook/tutorial/Installation.mdx +0 -6
- package/projects/storybook-host/.storybook/tutorial/Introduction.mdx +0 -18
- package/projects/storybook-host/.storybook/tutorial/Theming.mdx +0 -14
- package/projects/storybook-host/.storybook/typings.d.ts +0 -4
- package/projects/storybook-host/documentation.json +0 -605
- package/projects/storybook-host/public/favicon.ico +0 -0
- package/projects/storybook-host/src/app/app.config.ts +0 -8
- package/projects/storybook-host/src/app/app.css +0 -0
- package/projects/storybook-host/src/app/app.html +0 -343
- package/projects/storybook-host/src/app/app.ts +0 -11
- package/projects/storybook-host/src/index.html +0 -13
- package/projects/storybook-host/src/main.ts +0 -6
- package/projects/storybook-host/src/stories/assets/accessibility.png +0 -0
- package/projects/storybook-host/src/stories/assets/accessibility.svg +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- package/projects/storybook-host/src/stories/assets/youtube.svg +0 -1
- package/projects/storybook-host/src/stories/button.component.ts +0 -50
- package/projects/storybook-host/src/stories/button.css +0 -30
- package/projects/storybook-host/src/stories/button.stories.ts +0 -49
- package/projects/storybook-host/src/stories/header.component.ts +0 -78
- package/projects/storybook-host/src/stories/header.css +0 -32
- package/projects/storybook-host/src/stories/header.stories.ts +0 -33
- package/projects/storybook-host/src/stories/page.component.ts +0 -84
- package/projects/storybook-host/src/stories/page.css +0 -68
- package/projects/storybook-host/src/stories/page.stories.ts +0 -32
- package/projects/storybook-host/src/stories/user.ts +0 -3
- package/projects/storybook-host/src/styles.css +0 -1
- package/projects/storybook-host/tsconfig.app.json +0 -15
- package/projects/storybook-host/tsconfig.spec.json +0 -15
- package/src/lib/components/byte-button/byte-button-group/byte-button-group.css +0 -27
- package/src/lib/components/byte-button/byte-button-group/byte-button-group.html +0 -6
- package/src/lib/components/byte-button/byte-button-group/byte-button-group.spec.ts +0 -22
- package/src/lib/components/byte-button/byte-button-group/byte-button-group.ts +0 -35
- package/src/lib/components/byte-button/byte-button.css +0 -0
- package/src/lib/components/byte-button/byte-button.directive.ts +0 -17
- package/src/lib/components/byte-button/byte-button.html +0 -29
- package/src/lib/components/byte-button/byte-button.module.ts +0 -19
- package/src/lib/components/byte-button/byte-button.stories.ts +0 -449
- package/src/lib/components/byte-button/byte-button.ts +0 -129
- package/src/lib/components/byte-dialog/byte-dialog.css +0 -0
- package/src/lib/components/byte-dialog/byte-dialog.directive.ts +0 -21
- package/src/lib/components/byte-dialog/byte-dialog.html +0 -47
- package/src/lib/components/byte-dialog/byte-dialog.module.ts +0 -21
- package/src/lib/components/byte-dialog/byte-dialog.spec.ts +0 -22
- package/src/lib/components/byte-dialog/byte-dialog.ts +0 -121
- package/src/lib/components/byte-dialog/byte.dialog.stories.ts +0 -215
- package/src/lib/components/byte-input/byte-input.css +0 -29
- package/src/lib/components/byte-input/byte-input.html +0 -58
- package/src/lib/components/byte-input/byte-input.spec.ts +0 -22
- package/src/lib/components/byte-input/byte-input.stories.ts +0 -60
- package/src/lib/components/byte-input/byte-input.ts +0 -97
- package/src/lib/components/byte-select/byte-select.css +0 -16
- package/src/lib/components/byte-select/byte-select.directive.ts +0 -61
- package/src/lib/components/byte-select/byte-select.html +0 -101
- package/src/lib/components/byte-select/byte-select.module.ts +0 -26
- package/src/lib/components/byte-select/byte-select.spec.ts +0 -22
- package/src/lib/components/byte-select/byte-select.stories.ts +0 -194
- package/src/lib/components/byte-select/byte-select.ts +0 -168
- package/src/lib/components/byte-select/index.ts +0 -3
- package/src/lib/components/byte-sidebar/byte-sidebar.css +0 -0
- package/src/lib/components/byte-sidebar/byte-sidebar.directive.ts +0 -11
- package/src/lib/components/byte-sidebar/byte-sidebar.html +0 -31
- package/src/lib/components/byte-sidebar/byte-sidebar.module.ts +0 -16
- package/src/lib/components/byte-sidebar/byte-sidebar.spec.ts +0 -22
- package/src/lib/components/byte-sidebar/byte-sidebar.stories.ts +0 -190
- package/src/lib/components/byte-sidebar/byte-sidebar.ts +0 -108
- package/src/lib/components/byte-table/byte-table.css +0 -0
- package/src/lib/components/byte-table/byte-table.directive.ts +0 -49
- package/src/lib/components/byte-table/byte-table.html +0 -102
- package/src/lib/components/byte-table/byte-table.module.ts +0 -33
- package/src/lib/components/byte-table/byte-table.spec.ts +0 -22
- package/src/lib/components/byte-table/byte-table.stories.ts +0 -296
- package/src/lib/components/byte-table/byte-table.ts +0 -162
- package/src/lib/components/calendar/calendar.css +0 -16
- package/src/lib/components/calendar/calendar.html +0 -15
- package/src/lib/components/calendar/calendar.spec.ts +0 -22
- package/src/lib/components/calendar/calendar.stories.ts +0 -153
- package/src/lib/components/calendar/calendar.ts +0 -89
- package/src/lib/components/select/select.css +0 -16
- package/src/lib/components/select/select.html +0 -14
- package/src/lib/components/select/select.spec.ts +0 -22
- package/src/lib/components/select/select.ts +0 -73
- package/src/lib/config/empresa-ui.token.ts +0 -5
- package/src/lib/providers/empresa-ui-config.ts +0 -8
- package/src/lib/providers/provide-empresa-ui.ts +0 -42
- package/src/lib/themes/CRM-Theme.ts +0 -34
- package/src/lib/themes/aura.ts +0 -3
- package/src/lib/themes/index.ts +0 -2
- package/src/lib/themes/registry.ts +0 -9
- package/src/lib/utils/inject-prime-icons.ts +0 -12
- package/src/public-api.ts +0 -30
- package/tsconfig.json +0 -45
- package/tsconfig.lib.json +0 -11
- package/tsconfig.lib.prod.json +0 -9
- package/tsconfig.spec.json +0 -8
|
@@ -1,449 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
applicationConfig,
|
|
3
|
-
moduleMetadata,
|
|
4
|
-
type Meta,
|
|
5
|
-
type StoryObj
|
|
6
|
-
} from '@storybook/angular';
|
|
7
|
-
|
|
8
|
-
import { ByteButton } from './byte-button';
|
|
9
|
-
import { ByteButtonModule } from './byte-button.module';
|
|
10
|
-
|
|
11
|
-
import { provideEmpresaUI } from './../../providers/provide-empresa-ui';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const meta: Meta<ByteButton> = {
|
|
15
|
-
|
|
16
|
-
title: 'Components/ByteButton',
|
|
17
|
-
|
|
18
|
-
component: ByteButton,
|
|
19
|
-
|
|
20
|
-
decorators: [
|
|
21
|
-
|
|
22
|
-
moduleMetadata({
|
|
23
|
-
imports: [
|
|
24
|
-
ByteButtonModule
|
|
25
|
-
]
|
|
26
|
-
}),
|
|
27
|
-
|
|
28
|
-
(story, context) =>
|
|
29
|
-
applicationConfig({
|
|
30
|
-
providers: [
|
|
31
|
-
provideEmpresaUI({
|
|
32
|
-
theme: context.globals['theme']
|
|
33
|
-
})
|
|
34
|
-
]
|
|
35
|
-
})(story, context)
|
|
36
|
-
|
|
37
|
-
],
|
|
38
|
-
|
|
39
|
-
tags: ['autodocs'],
|
|
40
|
-
|
|
41
|
-
parameters: {
|
|
42
|
-
docs: {
|
|
43
|
-
description: {
|
|
44
|
-
component:
|
|
45
|
-
'Componente de botón reutilizable basado en PrimeNG, con soporte para iconos, variantes, estados y contenido personalizado.'
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export default meta;
|
|
53
|
-
|
|
54
|
-
type Story = StoryObj<ByteButton>;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// =====================================================
|
|
58
|
-
// NORMAL
|
|
59
|
-
// =====================================================
|
|
60
|
-
|
|
61
|
-
export const Normal: Story = {
|
|
62
|
-
|
|
63
|
-
args: {
|
|
64
|
-
|
|
65
|
-
label: 'Guardar',
|
|
66
|
-
|
|
67
|
-
icon: 'pi pi-save',
|
|
68
|
-
|
|
69
|
-
severity: 'success'
|
|
70
|
-
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
// =====================================================
|
|
77
|
-
// SEVERITIES
|
|
78
|
-
// =====================================================
|
|
79
|
-
|
|
80
|
-
export const Severities: Story = {
|
|
81
|
-
|
|
82
|
-
render: (args) => ({
|
|
83
|
-
|
|
84
|
-
props: args,
|
|
85
|
-
|
|
86
|
-
template: `
|
|
87
|
-
|
|
88
|
-
<div
|
|
89
|
-
style="
|
|
90
|
-
display: flex;
|
|
91
|
-
gap: 1rem;
|
|
92
|
-
flex-wrap: wrap;
|
|
93
|
-
"
|
|
94
|
-
>
|
|
95
|
-
|
|
96
|
-
<byte-button
|
|
97
|
-
label="Primary"
|
|
98
|
-
/>
|
|
99
|
-
|
|
100
|
-
<byte-button
|
|
101
|
-
label="Secondary"
|
|
102
|
-
severity="secondary"
|
|
103
|
-
/>
|
|
104
|
-
|
|
105
|
-
<byte-button
|
|
106
|
-
label="Success"
|
|
107
|
-
severity="success"
|
|
108
|
-
/>
|
|
109
|
-
|
|
110
|
-
<byte-button
|
|
111
|
-
label="Info"
|
|
112
|
-
severity="info"
|
|
113
|
-
/>
|
|
114
|
-
|
|
115
|
-
<byte-button
|
|
116
|
-
label="Warn"
|
|
117
|
-
severity="warn"
|
|
118
|
-
/>
|
|
119
|
-
|
|
120
|
-
<byte-button
|
|
121
|
-
label="Danger"
|
|
122
|
-
severity="danger"
|
|
123
|
-
/>
|
|
124
|
-
|
|
125
|
-
<byte-button
|
|
126
|
-
label="Contrast"
|
|
127
|
-
severity="contrast"
|
|
128
|
-
/>
|
|
129
|
-
|
|
130
|
-
</div>
|
|
131
|
-
|
|
132
|
-
`
|
|
133
|
-
|
|
134
|
-
})
|
|
135
|
-
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
// =====================================================
|
|
140
|
-
// ICON
|
|
141
|
-
// =====================================================
|
|
142
|
-
|
|
143
|
-
/* export const Icon: Story = {
|
|
144
|
-
|
|
145
|
-
args: {
|
|
146
|
-
|
|
147
|
-
label: 'Guardar',
|
|
148
|
-
|
|
149
|
-
icon: 'pi pi-save',
|
|
150
|
-
|
|
151
|
-
severity: 'success'
|
|
152
|
-
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
}; */
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
// =====================================================
|
|
159
|
-
// ICON ONLY
|
|
160
|
-
// =====================================================
|
|
161
|
-
|
|
162
|
-
export const IconOnly: Story = {
|
|
163
|
-
|
|
164
|
-
args: {
|
|
165
|
-
|
|
166
|
-
icon: 'pi pi-trash',
|
|
167
|
-
|
|
168
|
-
severity: 'danger',
|
|
169
|
-
|
|
170
|
-
rounded: true
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
// =====================================================
|
|
178
|
-
// VARIANTS
|
|
179
|
-
// =====================================================
|
|
180
|
-
|
|
181
|
-
export const Variants: Story = {
|
|
182
|
-
|
|
183
|
-
render: (args) => ({
|
|
184
|
-
|
|
185
|
-
props: args,
|
|
186
|
-
|
|
187
|
-
template: `
|
|
188
|
-
|
|
189
|
-
<div
|
|
190
|
-
style="
|
|
191
|
-
display: flex;
|
|
192
|
-
gap: 1rem;
|
|
193
|
-
flex-wrap: wrap;
|
|
194
|
-
"
|
|
195
|
-
>
|
|
196
|
-
|
|
197
|
-
<byte-button
|
|
198
|
-
label="Default"
|
|
199
|
-
/>
|
|
200
|
-
|
|
201
|
-
<byte-button
|
|
202
|
-
label="Outlined"
|
|
203
|
-
variant="outlined"
|
|
204
|
-
/>
|
|
205
|
-
|
|
206
|
-
<byte-button
|
|
207
|
-
label="Text"
|
|
208
|
-
variant="text"
|
|
209
|
-
/>
|
|
210
|
-
|
|
211
|
-
</div>
|
|
212
|
-
|
|
213
|
-
`
|
|
214
|
-
|
|
215
|
-
})
|
|
216
|
-
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
// =====================================================
|
|
221
|
-
// SIZES
|
|
222
|
-
// =====================================================
|
|
223
|
-
|
|
224
|
-
export const Sizes: Story = {
|
|
225
|
-
|
|
226
|
-
render: (args) => ({
|
|
227
|
-
|
|
228
|
-
props: args,
|
|
229
|
-
|
|
230
|
-
template: `
|
|
231
|
-
|
|
232
|
-
<div
|
|
233
|
-
style="
|
|
234
|
-
display: flex;
|
|
235
|
-
gap: 1rem;
|
|
236
|
-
align-items: center;
|
|
237
|
-
"
|
|
238
|
-
>
|
|
239
|
-
|
|
240
|
-
<byte-button
|
|
241
|
-
label="Small"
|
|
242
|
-
size="small"
|
|
243
|
-
/>
|
|
244
|
-
|
|
245
|
-
<byte-button
|
|
246
|
-
label="Normal"
|
|
247
|
-
/>
|
|
248
|
-
|
|
249
|
-
<byte-button
|
|
250
|
-
label="Large"
|
|
251
|
-
size="large"
|
|
252
|
-
/>
|
|
253
|
-
|
|
254
|
-
</div>
|
|
255
|
-
|
|
256
|
-
`
|
|
257
|
-
|
|
258
|
-
})
|
|
259
|
-
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
// =====================================================
|
|
264
|
-
// STATES
|
|
265
|
-
// =====================================================
|
|
266
|
-
|
|
267
|
-
export const States: Story = {
|
|
268
|
-
|
|
269
|
-
render: (args) => ({
|
|
270
|
-
|
|
271
|
-
props: args,
|
|
272
|
-
|
|
273
|
-
template: `
|
|
274
|
-
|
|
275
|
-
<div
|
|
276
|
-
style="
|
|
277
|
-
display: flex;
|
|
278
|
-
gap: 1rem;
|
|
279
|
-
flex-wrap: wrap;
|
|
280
|
-
"
|
|
281
|
-
>
|
|
282
|
-
|
|
283
|
-
<byte-button
|
|
284
|
-
label="Normal"
|
|
285
|
-
/>
|
|
286
|
-
|
|
287
|
-
<byte-button
|
|
288
|
-
label="Disabled"
|
|
289
|
-
[disabled]="true"
|
|
290
|
-
/>
|
|
291
|
-
|
|
292
|
-
<byte-button
|
|
293
|
-
label="Loading"
|
|
294
|
-
[loading]="true"
|
|
295
|
-
/>
|
|
296
|
-
|
|
297
|
-
</div>
|
|
298
|
-
|
|
299
|
-
`
|
|
300
|
-
|
|
301
|
-
})
|
|
302
|
-
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
// =====================================================
|
|
307
|
-
// BUTTON TYPES
|
|
308
|
-
// =====================================================
|
|
309
|
-
|
|
310
|
-
export const Types: Story = {
|
|
311
|
-
|
|
312
|
-
render: (args) => ({
|
|
313
|
-
|
|
314
|
-
props: args,
|
|
315
|
-
|
|
316
|
-
template: `
|
|
317
|
-
|
|
318
|
-
<div
|
|
319
|
-
style="
|
|
320
|
-
display: flex;
|
|
321
|
-
gap: 1rem;
|
|
322
|
-
"
|
|
323
|
-
>
|
|
324
|
-
|
|
325
|
-
<byte-button
|
|
326
|
-
label="Button"
|
|
327
|
-
type="button"
|
|
328
|
-
/>
|
|
329
|
-
|
|
330
|
-
<byte-button
|
|
331
|
-
label="Submit"
|
|
332
|
-
type="submit"
|
|
333
|
-
/>
|
|
334
|
-
|
|
335
|
-
<byte-button
|
|
336
|
-
label="Reset"
|
|
337
|
-
type="reset"
|
|
338
|
-
/>
|
|
339
|
-
|
|
340
|
-
</div>
|
|
341
|
-
|
|
342
|
-
`
|
|
343
|
-
|
|
344
|
-
})
|
|
345
|
-
|
|
346
|
-
};
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
// =====================================================
|
|
350
|
-
// SHAPES
|
|
351
|
-
// =====================================================
|
|
352
|
-
|
|
353
|
-
export const Shapes: Story = {
|
|
354
|
-
|
|
355
|
-
render: (args) => ({
|
|
356
|
-
|
|
357
|
-
props: args,
|
|
358
|
-
|
|
359
|
-
template: `
|
|
360
|
-
|
|
361
|
-
<div
|
|
362
|
-
style="
|
|
363
|
-
display: flex;
|
|
364
|
-
gap: 1rem;
|
|
365
|
-
align-items: center;
|
|
366
|
-
"
|
|
367
|
-
>
|
|
368
|
-
|
|
369
|
-
<byte-button
|
|
370
|
-
label="Normal"
|
|
371
|
-
/>
|
|
372
|
-
|
|
373
|
-
<byte-button
|
|
374
|
-
label="Raised"
|
|
375
|
-
[raised]="true"
|
|
376
|
-
/>
|
|
377
|
-
|
|
378
|
-
<byte-button
|
|
379
|
-
label="Rounded"
|
|
380
|
-
[rounded]="true"
|
|
381
|
-
/>
|
|
382
|
-
|
|
383
|
-
</div>
|
|
384
|
-
|
|
385
|
-
`
|
|
386
|
-
|
|
387
|
-
})
|
|
388
|
-
|
|
389
|
-
};
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
// =====================================================
|
|
393
|
-
// CUSTOM CONTENT
|
|
394
|
-
// =====================================================
|
|
395
|
-
|
|
396
|
-
export const CustomContent: Story = {
|
|
397
|
-
|
|
398
|
-
render: (args) => ({
|
|
399
|
-
|
|
400
|
-
props: args,
|
|
401
|
-
|
|
402
|
-
template: `
|
|
403
|
-
|
|
404
|
-
<byte-button
|
|
405
|
-
severity="success"
|
|
406
|
-
>
|
|
407
|
-
|
|
408
|
-
<ng-template byteButtonContent>
|
|
409
|
-
|
|
410
|
-
<span>
|
|
411
|
-
|
|
412
|
-
<i class="pi pi-check"></i>
|
|
413
|
-
|
|
414
|
-
Guardar cambios
|
|
415
|
-
|
|
416
|
-
</span>
|
|
417
|
-
|
|
418
|
-
</ng-template>
|
|
419
|
-
|
|
420
|
-
</byte-button>
|
|
421
|
-
|
|
422
|
-
`
|
|
423
|
-
|
|
424
|
-
})
|
|
425
|
-
|
|
426
|
-
};
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
// =====================================================
|
|
430
|
-
// BUTTON GROUP
|
|
431
|
-
// =====================================================
|
|
432
|
-
|
|
433
|
-
export const ButtonGroup: Story = {
|
|
434
|
-
|
|
435
|
-
render: (args) => ({
|
|
436
|
-
|
|
437
|
-
props: args,
|
|
438
|
-
|
|
439
|
-
template: `
|
|
440
|
-
<byte-button-group>
|
|
441
|
-
<byte-button label="Save" icon="pi pi-check" />
|
|
442
|
-
<byte-button label="Delete" icon="pi pi-trash" variant="outlined"/>
|
|
443
|
-
<byte-button label="Cancel" icon="pi pi-times" variant="outlined"/>
|
|
444
|
-
</byte-button-group>
|
|
445
|
-
`
|
|
446
|
-
|
|
447
|
-
})
|
|
448
|
-
|
|
449
|
-
};
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChangeDetectionStrategy,
|
|
3
|
-
Component,
|
|
4
|
-
ContentChild,
|
|
5
|
-
EventEmitter,
|
|
6
|
-
Input,
|
|
7
|
-
Output
|
|
8
|
-
} from '@angular/core';
|
|
9
|
-
|
|
10
|
-
import { NgTemplateOutlet } from '@angular/common';
|
|
11
|
-
import { ButtonModule } from 'primeng/button';
|
|
12
|
-
|
|
13
|
-
import { ByteButtonContentDirective } from './byte-button.directive';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@Component({
|
|
17
|
-
selector: 'byte-button',
|
|
18
|
-
|
|
19
|
-
imports: [
|
|
20
|
-
ButtonModule,
|
|
21
|
-
NgTemplateOutlet,
|
|
22
|
-
ByteButtonContentDirective
|
|
23
|
-
],
|
|
24
|
-
|
|
25
|
-
templateUrl: './byte-button.html',
|
|
26
|
-
|
|
27
|
-
styleUrl: './byte-button.css',
|
|
28
|
-
|
|
29
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
30
|
-
})
|
|
31
|
-
export class ByteButton {
|
|
32
|
-
|
|
33
|
-
// =====================================================
|
|
34
|
-
// INPUTS
|
|
35
|
-
// =====================================================
|
|
36
|
-
|
|
37
|
-
@Input()
|
|
38
|
-
label = '';
|
|
39
|
-
|
|
40
|
-
@Input()
|
|
41
|
-
icon = '';
|
|
42
|
-
|
|
43
|
-
@Input()
|
|
44
|
-
iconPos: 'left' | 'right' | 'top' | 'bottom' = 'left';
|
|
45
|
-
|
|
46
|
-
@Input()
|
|
47
|
-
severity:
|
|
48
|
-
| 'secondary'
|
|
49
|
-
| 'success'
|
|
50
|
-
| 'info'
|
|
51
|
-
| 'warn'
|
|
52
|
-
| 'danger'
|
|
53
|
-
| 'contrast'
|
|
54
|
-
| undefined;
|
|
55
|
-
|
|
56
|
-
@Input()
|
|
57
|
-
variant:
|
|
58
|
-
| 'outlined'
|
|
59
|
-
| 'text'
|
|
60
|
-
| undefined;
|
|
61
|
-
|
|
62
|
-
@Input()
|
|
63
|
-
size:
|
|
64
|
-
| 'small'
|
|
65
|
-
| 'large'
|
|
66
|
-
| undefined;
|
|
67
|
-
|
|
68
|
-
@Input()
|
|
69
|
-
disabled = false;
|
|
70
|
-
|
|
71
|
-
@Input()
|
|
72
|
-
loading = false;
|
|
73
|
-
|
|
74
|
-
@Input()
|
|
75
|
-
loadingIcon = '';
|
|
76
|
-
|
|
77
|
-
@Input()
|
|
78
|
-
raised = false;
|
|
79
|
-
|
|
80
|
-
@Input()
|
|
81
|
-
rounded = false;
|
|
82
|
-
|
|
83
|
-
@Input()
|
|
84
|
-
text = false;
|
|
85
|
-
|
|
86
|
-
@Input()
|
|
87
|
-
outlined = false;
|
|
88
|
-
|
|
89
|
-
@Input()
|
|
90
|
-
link = false;
|
|
91
|
-
|
|
92
|
-
@Input()
|
|
93
|
-
plain = false;
|
|
94
|
-
|
|
95
|
-
@Input()
|
|
96
|
-
fluid = false;
|
|
97
|
-
|
|
98
|
-
@Input()
|
|
99
|
-
type: 'button' | 'submit' | 'reset' = 'button';
|
|
100
|
-
|
|
101
|
-
@Input()
|
|
102
|
-
buttonProps: Record<string, any> = {};
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
// =====================================================
|
|
106
|
-
// CUSTOM TEMPLATE
|
|
107
|
-
// =====================================================
|
|
108
|
-
|
|
109
|
-
@ContentChild(ByteButtonContentDirective)
|
|
110
|
-
contentTemplate?: ByteButtonContentDirective;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
// =====================================================
|
|
114
|
-
// OUTPUT
|
|
115
|
-
// =====================================================
|
|
116
|
-
|
|
117
|
-
@Output()
|
|
118
|
-
clicked = new EventEmitter<MouseEvent>();
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
// =====================================================
|
|
122
|
-
// CLICK
|
|
123
|
-
// =====================================================
|
|
124
|
-
|
|
125
|
-
onButtonClick(event: MouseEvent): void {
|
|
126
|
-
this.clicked.emit(event);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
}
|
|
File without changes
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Directive, TemplateRef } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Directive({
|
|
4
|
-
selector: 'ng-template[byteDialogHeader]',
|
|
5
|
-
standalone: true
|
|
6
|
-
})
|
|
7
|
-
export class ByteDialogHeaderDirective {
|
|
8
|
-
constructor(
|
|
9
|
-
public template: TemplateRef<any>
|
|
10
|
-
) {}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@Directive({
|
|
14
|
-
selector: 'ng-template[byteDialogFooter]',
|
|
15
|
-
standalone: true
|
|
16
|
-
})
|
|
17
|
-
export class ByteDialogFooterDirective {
|
|
18
|
-
constructor(
|
|
19
|
-
public template: TemplateRef<any>
|
|
20
|
-
) {}
|
|
21
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
<p-dialog
|
|
2
|
-
[(visible)]="visible"
|
|
3
|
-
(visibleChange)="onVisibleChange($event)"
|
|
4
|
-
[header]="header"
|
|
5
|
-
[modal]="modal"
|
|
6
|
-
[closable]="closable"
|
|
7
|
-
[draggable]="draggable"
|
|
8
|
-
[resizable]="resizable"
|
|
9
|
-
[dismissableMask]="dismissableMask"
|
|
10
|
-
[closeOnEscape]="closeOnEscape"
|
|
11
|
-
[maximizable]="maximizable"
|
|
12
|
-
[blockScroll]="blockScroll"
|
|
13
|
-
[position]="position"
|
|
14
|
-
[style]="style"
|
|
15
|
-
[styleClass]="styleClass"
|
|
16
|
-
[contentStyle]="contentStyle"
|
|
17
|
-
[breakpoints]="breakpoints"
|
|
18
|
-
appendTo="body"
|
|
19
|
-
>
|
|
20
|
-
|
|
21
|
-
@if (headerTemplate) {
|
|
22
|
-
|
|
23
|
-
<ng-template pTemplate="header">
|
|
24
|
-
|
|
25
|
-
<ng-container
|
|
26
|
-
[ngTemplateOutlet]="headerTemplate.template"
|
|
27
|
-
/>
|
|
28
|
-
|
|
29
|
-
</ng-template>
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
<ng-content></ng-content>
|
|
34
|
-
|
|
35
|
-
@if (footerTemplate) {
|
|
36
|
-
|
|
37
|
-
<ng-template pTemplate="footer">
|
|
38
|
-
|
|
39
|
-
<ng-container
|
|
40
|
-
[ngTemplateOutlet]="footerTemplate.template"
|
|
41
|
-
/>
|
|
42
|
-
|
|
43
|
-
</ng-template>
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
</p-dialog>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
import { ByteDialog } from './byte-dialog';
|
|
4
|
-
import {
|
|
5
|
-
ByteDialogHeaderDirective,
|
|
6
|
-
ByteDialogFooterDirective
|
|
7
|
-
} from './byte-dialog.directive';
|
|
8
|
-
|
|
9
|
-
@NgModule({
|
|
10
|
-
imports: [
|
|
11
|
-
ByteDialog,
|
|
12
|
-
ByteDialogHeaderDirective,
|
|
13
|
-
ByteDialogFooterDirective
|
|
14
|
-
],
|
|
15
|
-
exports: [
|
|
16
|
-
ByteDialog,
|
|
17
|
-
ByteDialogHeaderDirective,
|
|
18
|
-
ByteDialogFooterDirective
|
|
19
|
-
]
|
|
20
|
-
})
|
|
21
|
-
export class ByteDialogModule {}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { ByteDialog } from './byte-dialog';
|
|
4
|
-
|
|
5
|
-
describe('ByteDialog', () => {
|
|
6
|
-
let component: ByteDialog;
|
|
7
|
-
let fixture: ComponentFixture<ByteDialog>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
imports: [ByteDialog],
|
|
12
|
-
}).compileComponents();
|
|
13
|
-
|
|
14
|
-
fixture = TestBed.createComponent(ByteDialog);
|
|
15
|
-
component = fixture.componentInstance;
|
|
16
|
-
await fixture.whenStable();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('should create', () => {
|
|
20
|
-
expect(component).toBeTruthy();
|
|
21
|
-
});
|
|
22
|
-
});
|