matcha-components 19.3.0 → 19.8.0

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.
@@ -1,11 +1,364 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, Component, Output, Input, ContentChildren, ElementRef, Renderer2, Inject, HostListener, Directive, NgModule } from '@angular/core';
2
+ import { EventEmitter, Component, Input, Output, ContentChildren, ElementRef, Renderer2, Inject, HostListener, Directive, NgModule } from '@angular/core';
3
+ import { animation, style, animate, trigger, transition, useAnimation, state, query, stagger, animateChild, sequence, group } from '@angular/animations';
3
4
  import { Subscription } from 'rxjs';
4
5
  import * as i1 from '@angular/common';
5
6
  import { CommonModule } from '@angular/common';
6
7
 
8
+ const customAnimation = animation([
9
+ style({
10
+ opacity: '{{opacity}}',
11
+ transform: 'scale({{scale}}) translate3d({{x}}, {{y}}, {{z}})'
12
+ }),
13
+ animate('{{duration}} {{delay}} cubic-bezier(0.0, 0.0, 0.2, 1)', style('*'))
14
+ ], {
15
+ params: {
16
+ duration: '200ms',
17
+ delay: '0ms',
18
+ opacity: '0',
19
+ scale: '1',
20
+ x: '0',
21
+ y: '0',
22
+ z: '0'
23
+ }
24
+ });
25
+ const createAnimations = [
26
+ trigger('animate', [transition('void => *', [useAnimation(customAnimation)])]),
27
+ trigger('animateStagger', [
28
+ state('50', style('*')),
29
+ state('100', style('*')),
30
+ state('200', style('*')),
31
+ transition('void => 50', query('@*', [
32
+ stagger('50ms', [
33
+ animateChild()
34
+ ])
35
+ ], { optional: true })),
36
+ transition('void => 100', query('@*', [
37
+ stagger('100ms', [
38
+ animateChild()
39
+ ])
40
+ ], { optional: true })),
41
+ transition('void => 200', query('@*', [
42
+ stagger('200ms', [
43
+ animateChild()
44
+ ])
45
+ ], { optional: true }))
46
+ ]),
47
+ trigger('fadeInOut', [
48
+ state('0, void', style({
49
+ opacity: 0
50
+ })),
51
+ state('1, *', style({
52
+ opacity: 1
53
+ })),
54
+ transition('1 => 0', animate('300ms ease-out')),
55
+ transition('0 => 1', animate('300ms ease-in')),
56
+ transition('void <=> *', animate('300ms ease-in'))
57
+ ]),
58
+ trigger('slideInOut', [
59
+ state('0', style({
60
+ height: '0px'
61
+ })),
62
+ state('1', style({
63
+ height: '*'
64
+ })),
65
+ transition('1 => 0', animate('300ms ease-out')),
66
+ transition('0 => 1', animate('300ms ease-in'))
67
+ ]),
68
+ trigger('slideIn', [
69
+ transition('void => left', [
70
+ style({
71
+ transform: 'translateX(100%)'
72
+ }),
73
+ animate('300ms ease-in', style({
74
+ transform: 'translateX(0)'
75
+ }))
76
+ ]),
77
+ transition('left => void', [
78
+ style({
79
+ transform: 'translateX(0)'
80
+ }),
81
+ animate('300ms ease-in', style({
82
+ transform: 'translateX(-100%)'
83
+ }))
84
+ ]),
85
+ transition('void => right', [
86
+ style({
87
+ transform: 'translateX(-100%)'
88
+ }),
89
+ animate('300ms ease-in', style({
90
+ transform: 'translateX(0)'
91
+ }))
92
+ ]),
93
+ transition('right => void', [
94
+ style({
95
+ transform: 'translateX(0)'
96
+ }),
97
+ animate('300ms ease-in', style({
98
+ transform: 'translateX(100%)'
99
+ }))
100
+ ])
101
+ ]),
102
+ trigger('slideInLeft', [
103
+ state('void', style({
104
+ transform: 'translateX(-100%)',
105
+ })),
106
+ state('*', style({
107
+ transform: 'translateX(0)',
108
+ })),
109
+ transition('void => *', animate('300ms')),
110
+ transition('* => void', animate('300ms'))
111
+ ]),
112
+ trigger('slideInRight', [
113
+ state('void', style({
114
+ transform: 'translateX(100%)',
115
+ })),
116
+ state('*', style({
117
+ transform: 'translateX(0)',
118
+ })),
119
+ transition('void => *', animate('300ms')),
120
+ transition('* => void', animate('300ms'))
121
+ ]),
122
+ trigger('slideInTop', [
123
+ state('void', style({
124
+ transform: 'translateY(-100%)',
125
+ })),
126
+ state('*', style({
127
+ transform: 'translateY(0)',
128
+ })),
129
+ transition('void => *', animate('300ms')),
130
+ transition('* => void', animate('300ms'))
131
+ ]),
132
+ trigger('slideInBottom', [
133
+ state('void', style({
134
+ transform: 'translateY(100%)',
135
+ })),
136
+ state('*', style({
137
+ transform: 'translateY(0)',
138
+ })),
139
+ transition('void => *', animate('300ms')),
140
+ transition('* => void', animate('300ms'))
141
+ ]),
142
+ trigger('expandCollapse', [
143
+ state('void', style({
144
+ height: '0px'
145
+ })),
146
+ state('*', style({
147
+ height: '*'
148
+ })),
149
+ transition('void => *', animate('300ms ease-out')),
150
+ transition('* => void', animate('300ms ease-in'))
151
+ ]),
152
+ // -----------------------------------------------------------------------------------------------------
153
+ // @ Router animations
154
+ // -----------------------------------------------------------------------------------------------------
155
+ trigger('routerTransitionLeft', [
156
+ transition('* => *', [
157
+ query('content > :enter, content > :leave', [
158
+ style({
159
+ position: 'absolute',
160
+ top: 0,
161
+ bottom: 0,
162
+ left: 0,
163
+ right: 0
164
+ })
165
+ ], { optional: true }),
166
+ query('content > :enter', [
167
+ style({
168
+ transform: 'translateX(100%)',
169
+ opacity: 0
170
+ })
171
+ ], { optional: true }),
172
+ sequence([
173
+ group([
174
+ query('content > :leave', [
175
+ style({
176
+ transform: 'translateX(0)',
177
+ opacity: 1
178
+ }),
179
+ animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)', style({
180
+ transform: 'translateX(-100%)',
181
+ opacity: 0
182
+ }))
183
+ ], { optional: true }),
184
+ query('content > :enter', [
185
+ style({ transform: 'translateX(100%)' }),
186
+ animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)', style({
187
+ transform: 'translateX(0%)',
188
+ opacity: 1
189
+ }))
190
+ ], { optional: true })
191
+ ]),
192
+ query('content > :leave', animateChild(), { optional: true }),
193
+ query('content > :enter', animateChild(), { optional: true })
194
+ ])
195
+ ])
196
+ ]),
197
+ trigger('routerTransitionRight', [
198
+ transition('* => *', [
199
+ query('content > :enter, content > :leave', [
200
+ style({
201
+ position: 'absolute',
202
+ top: 0,
203
+ bottom: 0,
204
+ left: 0,
205
+ right: 0
206
+ })
207
+ ], { optional: true }),
208
+ query('content > :enter', [
209
+ style({
210
+ transform: 'translateX(-100%)',
211
+ opacity: 0
212
+ })
213
+ ], { optional: true }),
214
+ sequence([
215
+ group([
216
+ query('content > :leave', [
217
+ style({
218
+ transform: 'translateX(0)',
219
+ opacity: 1
220
+ }),
221
+ animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)', style({
222
+ transform: 'translateX(100%)',
223
+ opacity: 0
224
+ }))
225
+ ], { optional: true }),
226
+ query('content > :enter', [
227
+ style({ transform: 'translateX(-100%)' }),
228
+ animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)', style({
229
+ transform: 'translateX(0%)',
230
+ opacity: 1
231
+ }))
232
+ ], { optional: true })
233
+ ]),
234
+ query('content > :leave', animateChild(), { optional: true }),
235
+ query('content > :enter', animateChild(), { optional: true })
236
+ ])
237
+ ])
238
+ ]),
239
+ trigger('routerTransitionUp', [
240
+ transition('* => *', [
241
+ query('content > :enter, content > :leave', [
242
+ style({
243
+ position: 'absolute',
244
+ top: 0,
245
+ bottom: 0,
246
+ left: 0,
247
+ right: 0
248
+ })
249
+ ], { optional: true }),
250
+ query('content > :enter', [
251
+ style({
252
+ transform: 'translateY(100%)',
253
+ opacity: 0
254
+ })
255
+ ], { optional: true }),
256
+ group([
257
+ query('content > :leave', [
258
+ style({
259
+ transform: 'translateY(0)',
260
+ opacity: 1
261
+ }),
262
+ animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)', style({
263
+ transform: 'translateY(-100%)',
264
+ opacity: 0
265
+ }))
266
+ ], { optional: true }),
267
+ query('content > :enter', [
268
+ style({ transform: 'translateY(100%)' }),
269
+ animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)', style({
270
+ transform: 'translateY(0%)',
271
+ opacity: 1
272
+ }))
273
+ ], { optional: true })
274
+ ]),
275
+ query('content > :leave', animateChild(), { optional: true }),
276
+ query('content > :enter', animateChild(), { optional: true })
277
+ ])
278
+ ]),
279
+ trigger('routerTransitionDown', [
280
+ transition('* => *', [
281
+ query('content > :enter, content > :leave', [
282
+ style({
283
+ position: 'absolute',
284
+ top: 0,
285
+ bottom: 0,
286
+ left: 0,
287
+ right: 0
288
+ })
289
+ ], { optional: true }),
290
+ query('content > :enter', [
291
+ style({
292
+ transform: 'translateY(-100%)',
293
+ opacity: 0
294
+ })
295
+ ], { optional: true }),
296
+ sequence([
297
+ group([
298
+ query('content > :leave', [
299
+ style({
300
+ transform: 'translateY(0)',
301
+ opacity: 1
302
+ }),
303
+ animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)', style({
304
+ transform: 'translateY(100%)',
305
+ opacity: 0
306
+ }))
307
+ ], { optional: true }),
308
+ query('content > :enter', [
309
+ style({ transform: 'translateY(-100%)' }),
310
+ animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)', style({
311
+ transform: 'translateY(0%)',
312
+ opacity: 1
313
+ }))
314
+ ], { optional: true })
315
+ ]),
316
+ query('content > :leave', animateChild(), { optional: true }),
317
+ query('content > :enter', animateChild(), { optional: true })
318
+ ])
319
+ ])
320
+ ]),
321
+ trigger('routerTransitionFade', [
322
+ transition('* => *', group([
323
+ query('content > :enter, content > :leave ', [
324
+ style({
325
+ position: 'absolute',
326
+ top: 0,
327
+ bottom: 0,
328
+ left: 0,
329
+ right: 0
330
+ })
331
+ ], { optional: true }),
332
+ query('content > :enter', [
333
+ style({
334
+ opacity: 0
335
+ })
336
+ ], { optional: true }),
337
+ query('content > :leave', [
338
+ style({
339
+ opacity: 1
340
+ }),
341
+ animate('300ms cubic-bezier(0.0, 0.0, 0.2, 1)', style({
342
+ opacity: 0
343
+ }))
344
+ ], { optional: true }),
345
+ query('content > :enter', [
346
+ style({
347
+ opacity: 0
348
+ }),
349
+ animate('300ms cubic-bezier(0.0, 0.0, 0.2, 1)', style({
350
+ opacity: 1
351
+ }))
352
+ ], { optional: true }),
353
+ query('content > :enter', animateChild(), { optional: true }),
354
+ query('content > :leave', animateChild(), { optional: true })
355
+ ]))
356
+ ])
357
+ ];
358
+
7
359
  class MatchaAccordionItemComponent {
8
360
  constructor() {
361
+ this.title = '';
9
362
  this.toggle = new EventEmitter();
10
363
  this.isOpen = false;
11
364
  }
@@ -14,14 +367,16 @@ class MatchaAccordionItemComponent {
14
367
  this.toggle.emit(this.isOpen);
15
368
  }
16
369
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MatchaAccordionItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
17
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: MatchaAccordionItemComponent, isStandalone: false, selector: "matcha-accordion-item", outputs: { toggle: "onOpenedChange" }, ngImport: i0, template: "<div class=\"accordion-item flex-column overflow-hidden\">\n <div class=\"accordion-header d-flex\" >\n <div class=\"d-flex\" (click)=\"toggleAccordion()\">\n <ng-content select=\"matcha-accordion-header\"></ng-content>\n </div>\n </div>\n <div class=\"accordion-content\" [class.open]=\"isOpen\">\n <ng-content select=\"matcha-accordion-content\"></ng-content>\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [".accordion-content{overflow:hidden;max-height:0;transition:max-height .3s ease,padding .5s ease;padding:0 10px}.accordion-content.open{max-height:99999px;padding:16px 0 0}\n"] }); }
370
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: MatchaAccordionItemComponent, isStandalone: false, selector: "matcha-accordion-item", inputs: { title: "title" }, outputs: { toggle: "openedChange" }, ngImport: i0, template: "<div class=\"accordion-item flex-column overflow-hidden\">\n <div class=\"accordion-header d-flex\">\n <div class=\"d-flex\" (click)=\"toggleAccordion()\">\n <ng-content select=\"matcha-accordion-header\"></ng-content>\n </div>\n </div>\n <div class=\"accordion-content overflow-hidden\" [@expandCollapse]=\"isOpen ? '*' : 'void'\">\n <ng-content select=\"matcha-accordion-content\"></ng-content>\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [""], animations: [...createAnimations] }); }
18
371
  }
19
372
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MatchaAccordionItemComponent, decorators: [{
20
373
  type: Component,
21
- args: [{ selector: 'matcha-accordion-item', standalone: false, template: "<div class=\"accordion-item flex-column overflow-hidden\">\n <div class=\"accordion-header d-flex\" >\n <div class=\"d-flex\" (click)=\"toggleAccordion()\">\n <ng-content select=\"matcha-accordion-header\"></ng-content>\n </div>\n </div>\n <div class=\"accordion-content\" [class.open]=\"isOpen\">\n <ng-content select=\"matcha-accordion-content\"></ng-content>\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [".accordion-content{overflow:hidden;max-height:0;transition:max-height .3s ease,padding .5s ease;padding:0 10px}.accordion-content.open{max-height:99999px;padding:16px 0 0}\n"] }]
22
- }], propDecorators: { toggle: [{
374
+ args: [{ selector: 'matcha-accordion-item', standalone: false, animations: [...createAnimations], template: "<div class=\"accordion-item flex-column overflow-hidden\">\n <div class=\"accordion-header d-flex\">\n <div class=\"d-flex\" (click)=\"toggleAccordion()\">\n <ng-content select=\"matcha-accordion-header\"></ng-content>\n </div>\n </div>\n <div class=\"accordion-content overflow-hidden\" [@expandCollapse]=\"isOpen ? '*' : 'void'\">\n <ng-content select=\"matcha-accordion-content\"></ng-content>\n <ng-content></ng-content>\n </div>\n</div>\n" }]
375
+ }], propDecorators: { title: [{
376
+ type: Input
377
+ }], toggle: [{
23
378
  type: Output,
24
- args: ['onOpenedChange']
379
+ args: ['openedChange']
25
380
  }] } });
26
381
 
27
382
  class MatchaAccordionComponent {
@@ -167,6 +522,7 @@ class MatchaInfiniteScrollDataComponent {
167
522
  * Detecta mudanças no resetKey e, se for o caso, reseta a lista e a página atual.
168
523
  */
169
524
  ngOnChanges(changes) {
525
+ console.log('changes', changes);
170
526
  if (changes['resetKey'] && !changes['resetKey'].firstChange) {
171
527
  this.reset();
172
528
  }